From 638de77243f93636ad1c1bf14cfd470d15423847 Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 21 Nov 2005 20:53:43 +0000 Subject: [PATCH] FrikaC told me of a few bugs in here, so lets use a decent compiler and fix them git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1574 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/test.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/engine/qclib/test.c b/engine/qclib/test.c index 307ea08fa..b93ecf1cc 100644 --- a/engine/qclib/test.c +++ b/engine/qclib/test.c @@ -1,7 +1,17 @@ +//This is basically a sample program. +//It deomnstrates the code required to get qclib up and running. +//This code does not demonstrate entities, however. +//It does demonstrate the built in qc compiler, and does demonstrate a globals-only progs interface. +//It also demonstrates basic builtin(s). + + + #include "progtype.h" #include "progslib.h" #include +#include +#include //the only function that is required externally. :/ void SV_EndRedirect (void) {} @@ -37,7 +47,7 @@ void Sys_Abort(char *s, ...) //Not really that useful for the normal vm. int Sys_Printf(char *s, ...) { //look up quake's va function to find out how to deal with variable arguments properly. - printf("%s", s); + return printf("%s", s); } #include @@ -87,7 +97,7 @@ pbool Sys_WriteFile (char *fname, void *data, int len) return 1; } -int runtest(void) +void runtest(void) { progfuncs_t *pf; func_t func; @@ -129,11 +139,9 @@ int runtest(void) //Run a compiler and nothing else. //Note that this could be done with an autocompile of PR_COMPILEALWAYS. -int compile(void) +void compile(void) { progfuncs_t *pf; - func_t func; - progsnum_t pn; progparms_t ext;