Should be an array of structs, not an array of pointers to structs.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 18 Feb 2009 21:16:26 -0500
changeset 658 22695d3d6b98
parent 657 1268d95644f0
child 659 e77acde263cc
Should be an array of structs, not an array of pointers to structs.
mojoshader.h
mojoshader_assembler.c
mojoshader_internal.h
mojoshader_preprocessor.c
--- a/mojoshader.h	Wed Feb 18 20:08:01 2009 -0500
+++ b/mojoshader.h	Wed Feb 18 21:16:26 2009 -0500
@@ -791,7 +791,7 @@
  */
 const MOJOSHADER_preprocessData *MOJOSHADER_preprocess(const char *filename,
                              const char *source, unsigned int sourcelen,
-                             const MOJOSHADER_preprocessorDefine **defines,
+                             const MOJOSHADER_preprocessorDefine *defines,
                              unsigned int define_count,
                              MOJOSHADER_includeOpen include_open,
                              MOJOSHADER_includeClose include_close,
@@ -874,7 +874,7 @@
                              const char **comments, unsigned int comment_count,
                              const MOJOSHADER_symbol *symbols,
                              unsigned int symbol_count,
-                             const MOJOSHADER_preprocessorDefine **defines,
+                             const MOJOSHADER_preprocessorDefine *defines,
                              unsigned int define_count,
                              MOJOSHADER_includeOpen include_open,
                              MOJOSHADER_includeClose include_close,
--- a/mojoshader_assembler.c	Wed Feb 18 20:08:01 2009 -0500
+++ b/mojoshader_assembler.c	Wed Feb 18 21:16:26 2009 -0500
@@ -1405,7 +1405,7 @@
 
 static Context *build_context(const char *filename,
                               const char *source, unsigned int sourcelen,
-                              const MOJOSHADER_preprocessorDefine **defines,
+                              const MOJOSHADER_preprocessorDefine *defines,
                               unsigned int define_count,
                               MOJOSHADER_includeOpen include_open,
                               MOJOSHADER_includeClose include_close,
@@ -1709,7 +1709,7 @@
                              const char **comments, unsigned int comment_count,
                              const MOJOSHADER_symbol *symbols,
                              unsigned int symbol_count,
-                             const MOJOSHADER_preprocessorDefine **defines,
+                             const MOJOSHADER_preprocessorDefine *defines,
                              unsigned int define_count,
                              MOJOSHADER_includeOpen include_open,
                              MOJOSHADER_includeClose include_close,
--- a/mojoshader_internal.h	Wed Feb 18 20:08:01 2009 -0500
+++ b/mojoshader_internal.h	Wed Feb 18 21:16:26 2009 -0500
@@ -415,7 +415,7 @@
                             unsigned int sourcelen,
                             MOJOSHADER_includeOpen open_callback,
                             MOJOSHADER_includeClose close_callback,
-                            const MOJOSHADER_preprocessorDefine **defines,
+                            const MOJOSHADER_preprocessorDefine *defines,
                             unsigned int define_count,
                             MOJOSHADER_malloc m, MOJOSHADER_free f, void *d);
 
--- a/mojoshader_preprocessor.c	Wed Feb 18 20:08:01 2009 -0500
+++ b/mojoshader_preprocessor.c	Wed Feb 18 21:16:26 2009 -0500
@@ -606,7 +606,7 @@
                             unsigned int sourcelen,
                             MOJOSHADER_includeOpen open_callback,
                             MOJOSHADER_includeClose close_callback,
-                            const MOJOSHADER_preprocessorDefine **defines,
+                            const MOJOSHADER_preprocessorDefine *defines,
                             unsigned int define_count,
                             MOJOSHADER_malloc m, MOJOSHADER_free f, void *d)
 {
@@ -637,8 +637,8 @@
     {
         for (i = 0; i < define_count; i++)
         {
-            define_include_len += strlen(defines[i]->identifier);
-            define_include_len += strlen(defines[i]->definition);
+            define_include_len += strlen(defines[i].identifier);
+            define_include_len += strlen(defines[i].definition);
             define_include_len += 10;  // "#define<space><space><newline>"
         } // for
         define_include_len++;  // for null terminator.
@@ -651,8 +651,8 @@
             char *ptr = define_include;
             for (i = 0; i < define_count; i++)
             {
-                ptr += sprintf(ptr, "#define %s %s\n", defines[i]->identifier,
-                               defines[i]->definition);
+                ptr += sprintf(ptr, "#define %s %s\n", defines[i].identifier,
+                               defines[i].definition);
             } // for
         } // else
     } // if
@@ -1357,7 +1357,7 @@
 
 const MOJOSHADER_preprocessData *MOJOSHADER_preprocess(const char *filename,
                              const char *source, unsigned int sourcelen,
-                             const MOJOSHADER_preprocessorDefine **defines,
+                             const MOJOSHADER_preprocessorDefine *defines,
                              unsigned int define_count,
                              MOJOSHADER_includeOpen include_open,
                              MOJOSHADER_includeClose include_close,