* OTHER DEALINGS IN THE SOFTWARE.
*/
-
-
+#include <stdio.h>
+#include <stdarg.h>
+#include "c99_math.h"
#include "imports.h"
#include "context.h"
#include "mtypes.h"
#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;
#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;
/** \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