diff options
author | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-05-06 01:44:06 +0700 |
---|---|---|
committer | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-05-13 00:22:37 +0700 |
commit | 3f3ff971ecff9936cebafc813af9193b97bba89c (patch) | |
tree | fdbbad794a42488b7ffe41eed7aba4e498335f55 /glx/single2.c | |
parent | 96c7ab27c383ec767f62a7a11e5fd76f86363fbc (diff) |
Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.
X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'glx/single2.c')
-rw-r--r-- | glx/single2.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/glx/single2.c b/glx/single2.c index 50a59ed71..070062691 100644 --- a/glx/single2.c +++ b/glx/single2.c @@ -62,7 +62,7 @@ int __glXDisp_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc) size = *(GLsizei *)(pc+0); type = *(GLenum *)(pc+4); if (cx->feedbackBufSize < size) { - cx->feedbackBuf = (GLfloat *) xrealloc(cx->feedbackBuf, + cx->feedbackBuf = (GLfloat *) realloc(cx->feedbackBuf, (size_t)size * __GLX_SIZE_FLOAT32); if (!cx->feedbackBuf) { @@ -90,7 +90,7 @@ int __glXDisp_SelectBuffer(__GLXclientState *cl, GLbyte *pc) pc += __GLX_SINGLE_HDR_SIZE; size = *(GLsizei *)(pc+0); if (cx->selectBufSize < size) { - cx->selectBuf = (GLuint *) xrealloc(cx->selectBuf, + cx->selectBuf = (GLuint *) realloc(cx->selectBuf, (size_t) size * __GLX_SIZE_CARD32); if (!cx->selectBuf) { @@ -261,21 +261,21 @@ char *__glXcombine_strings(const char *cext_string, const char *sext_string) clen = strlen(cext_string); slen = strlen(sext_string); if (clen > slen) { - combo_string = (char *) xalloc(slen + 2); - s1 = (char *) xalloc(slen + 2); + combo_string = (char *) malloc(slen + 2); + s1 = (char *) malloc(slen + 2); if (s1) strcpy(s1, sext_string); s2 = cext_string; } else { - combo_string = (char *) xalloc(clen + 2); - s1 = (char *) xalloc(clen + 2); + combo_string = (char *) malloc(clen + 2); + s1 = (char *) malloc(clen + 2); if (s1) strcpy(s1, cext_string); s2 = sext_string; } if (!combo_string || !s1) { if (combo_string) - xfree(combo_string); + free(combo_string); if (s1) - xfree(s1); + free(s1); return NULL; } combo_string[0] = '\0'; @@ -302,7 +302,7 @@ char *__glXcombine_strings(const char *cext_string, const char *sext_string) /* Get next extension token */ token = strtok( NULL, SEPARATOR); } - xfree(s1); + free(s1); return combo_string; } @@ -349,13 +349,13 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) buf = __glXcombine_strings(buf1, cx->pGlxScreen->GLextensions); if (buf1 != NULL) { - xfree(buf1); + free(buf1); } string = buf; } else if ( name == GL_VERSION ) { if ( atof( string ) > atof( GLServerVersion ) ) { - buf = xalloc( strlen( string ) + strlen( GLServerVersion ) + 4 ); + buf = malloc( strlen( string ) + strlen( GLServerVersion ) + 4 ); if ( buf == NULL ) { string = GLServerVersion; } @@ -380,7 +380,7 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) __GLX_SEND_HEADER(); WriteToClient(client, length, (char *) string); if (buf != NULL) - xfree(buf); + free(buf); return Success; } |