make compile on MSVC, and fix stringmap_insert
authorAras Pranckevicius <aras@unity3d.com>
Thu, 25 Feb 2010 08:52:46 +0200
changeset 870 f9e20269c20b
parent 869 5bd359b047f3
child 871 e72ec737ed74
make compile on MSVC, and fix stringmap_insert
mojoshader_common.c
--- a/mojoshader_common.c	Thu Feb 25 02:26:36 2010 -0500
+++ b/mojoshader_common.c	Thu Feb 25 08:52:46 2010 +0200
@@ -178,7 +178,7 @@
 uint32 hash_hash_string(const void *sym, void *data)
 {
     (void) data;
-    return hash_string(sym, strlen((const char *) sym));
+    return hash_string((const char*) sym, strlen((const char *) sym));
 } // hash_hash_string
 
 int hash_keymatch_string(const void *a, const void *b, void *data)
@@ -222,7 +222,7 @@
 
     int rc = -1;
     char *k = (char *) smap->m(strlen(key) + 1, smap->d);
-    char *v = (char *) v ? smap->m(strlen(value) + 1, smap->d) : NULL;
+    char *v = (char *) (value ? smap->m(strlen(value) + 1, smap->d) : NULL);
     if ( (!k) || ((!v) && (value)) || ((rc = hash_insert(smap, k, v)) <= 0) )
     {
         smap->f(k, smap->d);