From: Zack Rusin Date: Thu, 27 Jan 2011 02:20:53 +0000 (-0500) Subject: mesa: fix compilation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=59dbdbbb7d0ff90dc7561b1bc337bbb918755103;p=mesa.git mesa: fix compilation this isn't c++ please don't mix declerations with code --- diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 38227e5b9be..aaef337ac11 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -747,6 +747,11 @@ static char * get_extension_override( struct gl_context *ctx ) { const char *env_const= _mesa_getenv("MESA_EXTENSION_OVERRIDE"); + char *env; + char *ext; + char *extra_exts; + int len; + if (env_const == NULL) { /* Return the empty string rather than NULL. This simplifies the logic * of client functions. */ @@ -754,13 +759,13 @@ get_extension_override( struct gl_context *ctx ) } /* extra_exts: List of unrecognized extensions. */ - char *extra_exts = calloc(strlen(env_const), sizeof(char)); + extra_exts = calloc(strlen(env_const), sizeof(char)); /* Copy env_const because strtok() is destructive. */ - char *env = strdup(env_const); - char *ext; + env = strdup(env_const); for (ext = strtok(env, " "); ext != NULL; ext = strtok(NULL, " ")) { int enable; + int recognized; switch (ext[0]) { case '+': enable = 1; @@ -774,7 +779,7 @@ get_extension_override( struct gl_context *ctx ) enable = 1; break; } - int recognized = set_extension(ctx, ext, enable); + recognized = set_extension(ctx, ext, enable); if (!recognized) { strcat(extra_exts, ext); strcat(extra_exts, " "); @@ -782,7 +787,7 @@ get_extension_override( struct gl_context *ctx ) } /* Remove trailing space. */ - int len = strlen(extra_exts); + len = strlen(extra_exts); if (extra_exts[len - 1] == ' ') extra_exts[len - 1] = '\0';