summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Borca <dborca@users.sourceforge.net>2005-01-14 08:40:43 +0000
committerJosé Fonseca <jfonseca@vmware.com>2011-07-11 20:03:33 +0100
commit459a837a098a4a6a6466c23de8024040d95e6f85 (patch)
treef0e3cc24a1af45f9126253cd2aeb0c0f58991819
parent13e76c1fd30686b2a528209506e34c4c78d4a222 (diff)
downloadglut-459a837a098a4a6a6466c23de8024040d95e6f85.tar.gz
changed coding style. added a NULL pointer check.
-rw-r--r--src/glut/dos/extens.c58
1 files changed, 31 insertions, 27 deletions
diff --git a/src/glut/dos/extens.c b/src/glut/dos/extens.c
index 8427990..b0cff69 100644
--- a/src/glut/dos/extens.c
+++ b/src/glut/dos/extens.c
@@ -19,9 +19,9 @@
*/
/*
- * DOS/DJGPP glut driver v1.4 for Mesa
+ * DOS/DJGPP glut driver v1.5 for Mesa
*
- * Copyright (C) 2002 - Borca Daniel
+ * Copyright (C) 2002 - Daniel Borca
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
@@ -34,39 +34,43 @@
#include "GL/dmesa.h"
-int APIENTRY glutExtensionSupported (const char *extension)
+int APIENTRY
+glutExtensionSupported (const char *extension)
{
- static const GLubyte *extensions = NULL;
- const GLubyte *last, *where;
+ static const GLubyte *extensions = NULL;
+ const GLubyte *last, *where;
- /* Extension names should not have spaces. */
- if (strchr(extension, ' ') || *extension == '\0') {
- return GL_FALSE;
- }
+ /* Extension names should not have spaces. */
+ if (strchr(extension, ' ') || *extension == '\0') {
+ return GL_FALSE;
+ }
- /* Not my problem if you don't have a valid OpenGL context */
- if (!extensions) {
- extensions = glGetString(GL_EXTENSIONS);
- }
+ /* Not my problem if you don't have a valid OpenGL context */
+ if (!extensions) {
+ extensions = glGetString(GL_EXTENSIONS);
+ }
+ if (!extensions) {
+ return GL_FALSE;
+ }
- /* Take care of sub-strings etc. */
- for (last = extensions;;) {
- if ((where = (GLubyte *)strstr((const char *)last, extension)) == NULL) {
- return GL_FALSE;
- }
- last = where + strlen(extension);
- if (where == extensions || *(where - 1) == ' ') {
- if (*last == ' ' || *last == '\0') {
- return GL_TRUE;
- }
- }
- }
+ /* Take care of sub-strings etc. */
+ for (last = extensions;;) {
+ if ((where = (GLubyte *)strstr((const char *)last, extension)) == NULL) {
+ return GL_FALSE;
+ }
+ last = where + strlen(extension);
+ if (where == extensions || *(where - 1) == ' ') {
+ if (*last == ' ' || *last == '\0') {
+ return GL_TRUE;
+ }
+ }
+ }
}
GLUTproc APIENTRY
glutGetProcAddress (const char *procName)
{
- /* TODO - handle glut namespace */
- return (GLUTproc)DMesaGetProcAddress(procName);
+ /* TODO - handle glut namespace */
+ return (GLUTproc)DMesaGetProcAddress(procName);
}