From b7bac4ec79f59488dbb83fa1db01f380fe20e223 Mon Sep 17 00:00:00 2001 From: icculus Date: Mon, 11 Feb 2008 22:37:34 -0500 Subject: [PATCH] [svn] Patched to compile. --HG-- branch : trunk --- CMakeLists.txt | 2 +- d3d2glsl.c | 4 +++- d3d2glsl.h | 2 +- testparse.c | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1cfd99f..7aff1f86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ PROJECT(d3d2glsl) -ADD_EXECUTABLE(parse testparse.c parse.c) +ADD_EXECUTABLE(parse testparse.c d3d2glsl.c) # End of CMakeLists.txt ... diff --git a/d3d2glsl.c b/d3d2glsl.c index 1124fa81..966956e7 100644 --- a/d3d2glsl.c +++ b/d3d2glsl.c @@ -13,6 +13,8 @@ #include #include +#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 @@ static int parse_token(const uint32 *tokens, const uint32 tokencount) // 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); diff --git a/d3d2glsl.h b/d3d2glsl.h index 614c4683..2dc1c1c0 100644 --- a/d3d2glsl.h +++ b/d3d2glsl.h @@ -15,7 +15,7 @@ extern "C" { /* !!! 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 } diff --git a/testparse.c b/testparse.c index 7584da4a..851ee07a 100644 --- a/testparse.c +++ b/testparse.c @@ -1,4 +1,5 @@ #include +#include #include "d3d2glsl.h" int main(int argc, char **argv) @@ -8,7 +9,7 @@ int main(int argc, char **argv) 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);