Skip to content
Permalink
Browse files
[svn] Patched to compile.
--HG--
branch : trunk
  • Loading branch information
icculus committed Feb 12, 2008
1 parent 93188f8 commit b7bac4ec79f59488dbb83fa1db01f380fe20e223
Showing with 7 additions and 4 deletions.
  1. +1 −1 CMakeLists.txt
  2. +3 −1 d3d2glsl.c
  3. +1 −1 d3d2glsl.h
  4. +2 −1 testparse.c
@@ -1,5 +1,5 @@
PROJECT(d3d2glsl)
ADD_EXECUTABLE(parse testparse.c parse.c)
ADD_EXECUTABLE(parse testparse.c d3d2glsl.c)

# End of CMakeLists.txt ...

@@ -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 @@ 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);
@@ -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
}
@@ -1,4 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#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);

0 comments on commit b7bac4e

Please sign in to comment.