mesa: remove MSVC warning pragmas
[mesa.git] / src / mesa / main / imports.c
index 6945c2f621b1bbd930be29bb2458060d8ac5e1ed..ac8deeb97c983674c7cd5f14133efd41e53a1a1a 100644 (file)
@@ -42,8 +42,9 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-
-
+#include <stdio.h>
+#include <stdarg.h>
+#include "c99_math.h"
 #include "imports.h"
 #include "context.h"
 #include "mtypes.h"
@@ -92,9 +93,9 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment)
 #else
    uintptr_t ptr, buf;
 
-   ASSERT( alignment > 0 );
+   assert( alignment > 0 );
 
-   ptr = malloc(bytes + alignment + sizeof(void *));
+   ptr = (uintptr_t)malloc(bytes + alignment + sizeof(void *));
    if (!ptr)
       return NULL;
 
@@ -141,9 +142,9 @@ _mesa_align_calloc(size_t bytes, unsigned long alignment)
 #else
    uintptr_t ptr, buf;
 
-   ASSERT( alignment > 0 );
+   assert( alignment > 0 );
 
-   ptr = calloc(1, bytes + alignment + sizeof(void *));
+   ptr = (uintptr_t)calloc(1, bytes + alignment + sizeof(void *));
    if (!ptr)
       return NULL;
 
@@ -480,24 +481,6 @@ _mesa_half_to_float(GLhalfARB val)
 /** \name String */
 /*@{*/
 
-/**
- * Implemented using malloc() and strcpy.
- * Note that NULL is handled accordingly.
- */
-char *
-_mesa_strdup( const char *s )
-{
-   if (s) {
-      size_t l = strlen(s);
-      char *s2 = malloc(l + 1);
-      if (s2)
-         strcpy(s2, s);
-      return s2;
-   }
-   else {
-      return NULL;
-   }
-}
 
 /** Compute simple checksum/hash for a string */
 unsigned int