Skip to content
Permalink
Browse files
[svn] Some testparse cleanups.
--HG--
branch : trunk
  • Loading branch information
icculus committed Mar 28, 2008
1 parent 36e20cd commit d49cd8b230616557714a23144237498ada774924
Showing with 21 additions and 11 deletions.
  1. +21 −11 testparse.c
@@ -64,22 +64,32 @@ int main(int argc, char **argv)
{
int i;

printf("MojoShader testparse\n");
printf("Compiled against version %d\n", MOJOSHADER_VERSION);
printf("Linked against version %d\n", MOJOSHADER_version());
printf("\n");

for (i = 1; i < argc; i++)
if (argc == 1)
printf("No files specified.\n");
else
{
FILE *io = fopen(argv[i], "rb");
if (io != NULL)
for (i = 1; i < argc; i++)
{
unsigned char *buf = (unsigned char *) malloc(1000000);
int rc = fread(buf, 1, 1000000, io);
fclose(io);
do_parse(buf, rc, MOJOSHADER_PROFILE_D3D);
do_parse(buf, rc, MOJOSHADER_PROFILE_GLSL);
free(buf);
} // if
} // if
FILE *io = fopen(argv[i], "rb");
printf("FILE: %s\n", argv[i]);
if (io == NULL)
printf("fopen('%s') failed.\n", argv[i]);
else
{
unsigned char *buf = (unsigned char *) malloc(1000000);
int rc = fread(buf, 1, 1000000, io);
fclose(io);
do_parse(buf, rc, MOJOSHADER_PROFILE_D3D);
do_parse(buf, rc, MOJOSHADER_PROFILE_GLSL);
free(buf);
} // else
} // for
} // else

return 0;
} // main

0 comments on commit d49cd8b

Please sign in to comment.