X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/blobdiff_plain/11db3170da99e22aa0acea76debd6c7b590a629c..0f55522abf3e990fe6984a24a351bf684c4977cc:/src/cppmain.c diff --git a/src/cppmain.c b/src/cppmain.c index ed6a6d6..74c68ba 100644 --- a/src/cppmain.c +++ b/src/cppmain.c @@ -1,6 +1,6 @@ /* ** Splint - annotation-assisted static program checker -** Copyright (C) 1994-2001 University of Virginia, +** Copyright (C) 1994-2002 University of Virginia, ** Massachusetts Institute of Technology ** ** This program is free software; you can redistribute it and/or modify it @@ -17,8 +17,8 @@ ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ** MA 02111-1307, USA. ** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu +** For information on splint: info@splint.org +** To report a bug: splint-bug@splint.org ** For more information: http://www.splint.org */ /* @@ -46,12 +46,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. You are forbidden to forbid anyone else to use, share and improve what you give them. Help stamp out software-hoarding! */ -# include "lclintMacros.nf" +# include "splintMacros.nf" # include "llbasic.h" # include "cpplib.h" # include "cpphash.h" # include "cpperror.h" # include "llmain.h" +# include "osd.h" # include @@ -80,7 +81,7 @@ void cppReader_initMod () { struct cppOptions *opts = (struct cppOptions *) dmalloc (sizeof (*opts)); - cppReader_init (&g_cppState); + cpplib_init (&g_cppState); llassert (g_cppState.opts == NULL); g_cppState.opts = opts; @@ -90,7 +91,7 @@ void cppReader_initMod () void cppReader_initialize () { - cppReader_initializeReader (&g_cppState); + cpplib_initializeReader (&g_cppState); } int cppProcess (/*@dependent@*/ cstring infile, @@ -103,7 +104,7 @@ int cppProcess (/*@dependent@*/ cstring infile, opts->in_fname = infile; opts->out_fname = outfile; - if (cppFatalErrors (&g_cppState)) + if (cpplib_fatalErrors (&g_cppState)) { llexit (LLFAILURE); } @@ -120,6 +121,7 @@ int cppProcess (/*@dependent@*/ cstring infile, if (ofile == NULL) { fileTable_noDelete (context_fileTable (), outfile); + osd_setTempError (); llfatalerror (message ("Cannot create temporary file for " "pre-processor output. Trying to " "open: %s. Use -tmpdir to change " @@ -136,11 +138,11 @@ int cppProcess (/*@dependent@*/ cstring infile, if (!opts->no_output) { (void) fwrite (g_cppState.token_buffer, (size_t) 1, - cppReader_getWritten (&g_cppState), ofile); + cpplib_getWritten (&g_cppState), ofile); } cppReader_setWritten (&g_cppState, 0); - kind = cppGetToken (&g_cppState); + kind = cpplib_getToken (&g_cppState); if (kind == CPP_EOF) break; @@ -209,14 +211,14 @@ void cppDoDefine (cstring str) void cppDoUndefine (cstring str) { - int sym_length; + size_t sym_length; hashNode hp; char *buf = cstring_toCharsSafe (str); sym_length = cppReader_checkMacroName (&g_cppState, buf, - cstring_makeLiteralTemp ("macro")); + cstring_makeLiteralTemp ("macro")); - while ((hp = cppReader_lookup (buf, sym_length, -1)) != NULL) + while ((hp = cpphash_lookup (buf, size_toInt (sym_length), -1)) != NULL) { /*@-exposetrans@*/ /*@-dependenttrans@*/ cppReader_deleteMacro (hp);