diff options
author | marha <marha@users.sourceforge.net> | 2012-09-06 08:49:13 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-09-06 08:49:13 +0200 |
commit | ccc8a492607df715b08d27c6bb3b9d13b1ff48a2 (patch) | |
tree | 4311d252acd49786ceed60cb55343af0a9294a2f /mesalib/src/mesa/main/imports.c | |
parent | a4d007b9b60f2fc7c8de46533e2f47ecb24f3c9c (diff) | |
parent | aa10a08696cae93799fcddae3f0245ceee905e01 (diff) | |
download | vcxsrv-ccc8a492607df715b08d27c6bb3b9d13b1ff48a2.tar.gz vcxsrv-ccc8a492607df715b08d27c6bb3b9d13b1ff48a2.tar.bz2 vcxsrv-ccc8a492607df715b08d27c6bb3b9d13b1ff48a2.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/main/imports.c')
-rw-r--r-- | mesalib/src/mesa/main/imports.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/mesalib/src/mesa/main/imports.c b/mesalib/src/mesa/main/imports.c index 0d6b56a51..934a2d05f 100644 --- a/mesalib/src/mesa/main/imports.c +++ b/mesalib/src/mesa/main/imports.c @@ -57,7 +57,7 @@ #endif -#ifdef WIN32 +#ifdef _WIN32 #define vsnprintf _vsnprintf #elif defined(__IBMC__) || defined(__IBMCPP__) || ( defined(__VMS) && __CRTL_VER < 70312000 ) extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg); @@ -97,7 +97,7 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment) ASSERT( alignment > 0 ); - ptr = (uintptr_t) malloc(bytes + alignment + sizeof(void *)); + ptr = malloc(bytes + alignment + sizeof(void *)); if (!ptr) return NULL; @@ -146,7 +146,7 @@ _mesa_align_calloc(size_t bytes, unsigned long alignment) ASSERT( alignment > 0 ); - ptr = (uintptr_t) calloc(1, bytes + alignment + sizeof(void *)); + ptr = calloc(1, bytes + alignment + sizeof(void *)); if (!ptr) return NULL; @@ -218,8 +218,7 @@ _mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize) void *newBuffer = malloc(newSize); if (newBuffer && oldBuffer && copySize > 0) memcpy(newBuffer, oldBuffer, copySize); - if (oldBuffer) - free(oldBuffer); + free(oldBuffer); return newBuffer; } @@ -527,7 +526,7 @@ _mesa_strdup( const char *s ) { if (s) { size_t l = strlen(s); - char *s2 = (char *) malloc(l + 1); + char *s2 = malloc(l + 1); if (s2) strcpy(s2, s); return s2; |