[svn] Patched to compile. trunk
authoricculus
Mon, 11 Feb 2008 22:37:34 -0500
branchtrunk
changeset 9 aea1b254e6a5
parent 8 6903b0d7d877
child 10 8104628081a8
[svn] Patched to compile.
CMakeLists.txt
d3d2glsl.c
d3d2glsl.h
testparse.c
--- a/CMakeLists.txt	Sun Feb 10 18:34:26 2008 -0500
+++ b/CMakeLists.txt	Mon Feb 11 22:37:34 2008 -0500
@@ -1,5 +1,5 @@
 PROJECT(d3d2glsl)
-ADD_EXECUTABLE(parse testparse.c parse.c)
+ADD_EXECUTABLE(parse testparse.c d3d2glsl.c)
 
 # End of CMakeLists.txt ...
 
--- a/d3d2glsl.c	Sun Feb 10 18:34:26 2008 -0500
+++ b/d3d2glsl.c	Mon Feb 11 22:37:34 2008 -0500
@@ -13,6 +13,8 @@
 #include <stdlib.h>
 #include <stdint.h>
 
+#include "d3d2glsl.h"
+
 typedef unsigned int uint;  // this is a printf() helper. don't use for code.
 typedef uint8_t uint8;
 typedef uint32_t uint32;
@@ -710,7 +712,7 @@
 
 // API entry point...
 
-int D3D2GLSL_parse(const uint8 *tokenbuf, const uint32 bufsize)
+int D3D2GLSL_parse(const unsigned char *tokenbuf, const unsigned int bufsize)
 {
     const uint32 *tokens = (const uint32 *) tokenbuf;
     uint32 tokencount = bufsize / sizeof (uint32);
--- a/d3d2glsl.h	Sun Feb 10 18:34:26 2008 -0500
+++ b/d3d2glsl.h	Mon Feb 11 22:37:34 2008 -0500
@@ -15,7 +15,7 @@
 
 /* !!! FIXME: documentation. */
 /* !!! FIXME: this needs to change to return a buffer of GLSL code. */
-int D3D2GLSL_parse(const uint8 *tokenbuf, const uint32 bufsize);
+int D3D2GLSL_parse(const unsigned char *tokenbuf, const unsigned int bufsize);
 
 #ifdef __cplusplus
 }
--- a/testparse.c	Sun Feb 10 18:34:26 2008 -0500
+++ b/testparse.c	Mon Feb 11 22:37:34 2008 -0500
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 #include "d3d2glsl.h"
 
 int main(int argc, char **argv)
@@ -8,7 +9,7 @@
         FILE *io = fopen(argv[1], "rb");
         if (io != NULL)
         {
-            uint8 *buf = (uint8 *) malloc(1000000);
+            unsigned char *buf = (unsigned char *) malloc(1000000);
             int rc = fread(buf, 1, 1000000, io);
             fclose(io);
             D3D2GLSL_parse(buf, rc);