Skip to content

Commit

Permalink
[svn] Patched to compile.
Browse files Browse the repository at this point in the history
--HG--
branch : trunk
  • Loading branch information
icculus committed Feb 12, 2008
1 parent 93188f8 commit b7bac4e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 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 ...

4 changes: 3 additions & 1 deletion d3d2glsl.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion d3d2glsl.h
Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion testparse.c
@@ -1,4 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include "d3d2glsl.h"

int main(int argc, char **argv)
Expand All @@ -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);
Expand Down

0 comments on commit b7bac4e

Please sign in to comment.