Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
/*@}*/
-/**********************************************************************/
-/** \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)
return h & 0x8000;
}
-extern unsigned int
-_mesa_str_checksum(const char *str);
-
extern int
_mesa_snprintf( char *str, size_t size, const char *fmt, ... ) PRINTFLIKE(3, 4);
#include "util/ralloc.h"
#include "util/hash_table.h"
#include "util/mesa-sha1.h"
+#include "util/crc32.h"
/**
* Return mask of GLSL_x flags by examining the MESA_GLSL env var.
free((void *)sh->Source);
sh->Source = source;
#ifdef DEBUG
- sh->SourceChecksum = _mesa_str_checksum(sh->Source);
+ sh->SourceChecksum = util_hash_crc32(sh->Source, strlen(sh->Source));
#endif
}