wgl: use gldrv.h instead of stw_icd.h
[mesa.git] / src / mesa / main / imports.c
index 808b8f67302d77c95e983867c69b43a1a44b94d8..96f8ad443f3c6ee27117da0653c976f25086b5ca 100644 (file)
 #include <stdio.h>
 #include <stdarg.h>
 #include "c99_math.h"
-#include "util/rounding.h" /* for _mesa_roundeven */
 #include "imports.h"
 #include "context.h"
-#include "mtypes.h"
 #include "version.h"
 
 #ifdef _GNU_SOURCE
@@ -103,7 +101,7 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment)
    buf = (ptr + alignment + sizeof(void *)) & ~(uintptr_t)(alignment - 1);
    *(uintptr_t *)(buf - sizeof(void *)) = ptr;
 
-#ifdef DEBUG
+#ifndef NDEBUG
    /* mark the non-aligned area */
    while ( ptr < buf - sizeof(void *) ) {
       *(unsigned long *)ptr = 0xcdcdcdcd;
@@ -152,7 +150,7 @@ _mesa_align_calloc(size_t bytes, unsigned long alignment)
    buf = (ptr + alignment + sizeof(void *)) & ~(uintptr_t)(alignment - 1);
    *(uintptr_t *)(buf - sizeof(void *)) = ptr;
 
-#ifdef DEBUG
+#ifndef NDEBUG
    /* mark the non-aligned area */
    while ( ptr < buf - sizeof(void *) ) {
       *(unsigned long *)ptr = 0xcdcdcdcd;
@@ -214,66 +212,6 @@ _mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize,
 /*@}*/
 
 
-/**********************************************************************/
-/** \name Math */
-/*@{*/
-
-
-#ifndef HAVE___BUILTIN_POPCOUNT
-/**
- * Return number of bits set in given GLuint.
- */
-unsigned int
-_mesa_bitcount(unsigned int n)
-{
-   unsigned int bits;
-   for (bits = 0; n > 0; n = n >> 1) {
-      bits += (n & 1);
-   }
-   return bits;
-}
-#endif
-
-#ifndef HAVE___BUILTIN_POPCOUNTLL
-/**
- * Return number of bits set in given 64-bit uint.
- */
-unsigned int
-_mesa_bitcount_64(uint64_t n)
-{
-   unsigned int bits;
-   for (bits = 0; n > 0; n = n >> 1) {
-      bits += (n & 1);
-   }
-   return bits;
-}
-#endif
-
-/*@}*/
-
-
-/**********************************************************************/
-/** \name String */
-/*@{*/
-
-
-/** Compute simple checksum/hash for a string */
-unsigned int
-_mesa_str_checksum(const char *str)
-{
-   /* This could probably be much better */
-   unsigned int sum, i;
-   const char *c;
-   sum = i = 1;
-   for (c = str; *c; c++, i++)
-      sum += *c * (i % 100);
-   return sum + i;
-}
-
-
-/*@}*/
-
-
 /** Needed due to #ifdef's, above. */
 int
 _mesa_vsnprintf(char *str, size_t size, const char *fmt, va_list args)