/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2001 University of Virginia,
+** Splint - annotation-assisted static program checker
+** Copyright (C) 1994-2003 University of Virginia,
** Massachusetts Institute of Technology
**
** This program is free software; you can redistribute it and/or modify it
** 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 more information: http://lclint.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
*/
/*
** macrocache.c
**
*/
-# include "lclintMacros.nf"
+# include "splintMacros.nf"
# include "llbasic.h"
# include "llmain.h"
for (i = 0; i < s->entries; i++)
{
- mce_free (s->contents[i]);
+ mce_free (s->contents[i]);
}
sfree (s->contents);
for (i = 0; i < s->entries; i++)
{
- s->contents[i] = oldcontents[i];
+ s->contents[i] = oldcontents[i];
}
sfree (oldcontents);
if ((i = macrocache_exists (s, fl)) != DNE)
{
- if (cstring_equal (def, s->contents[i]->def))
+ if (cstring_equal (def, s->contents[i]->def))
{
fileloc_free (fl);
cstring_free (def);
*/
cstring_free (s->contents[i]->def);
- s->contents[i]->def = def;
+ s->contents[i]->def = def;
fileloc_free (fl);
return;
}
s->nspace--;
- s->contents[s->entries] = mce_create (fl, def, sup);
+ s->contents[s->entries] = mce_create (fl, def, sup);
s->entries++;
}
void
macrocache_addComment (macrocache s, /*@only@*/ fileloc fl, /*@only@*/ cstring def)
{
- DPRINTF (("Add comment: %s / %s", fileloc_unparse (fl), def));
+ DPRINTF (("Macrocache add comment: %s / %s", fileloc_unparse (fl), def));
macrocache_addGenEntry (s, fl, def, TRUE);
}
for (i = 0; i < s->entries; i++)
{
- if (fileloc_equal (s->contents[i]->fl, fl))
+ if (fileloc_equal (s->contents[i]->fl, fl))
return (i);
}
for (i = 0; i < m->entries; i++)
{
- fileloc fl = m->contents[i]->fl;
+ fileloc fl = m->contents[i]->fl;
cstring def = m->contents[i]->def;
bool defined = m->contents[i]->defined;
cstring fname;
mtid = fileTable_addMacrosFile (context_fileTable ());
- fname = fileName (mtid);
- s_macFile = fileTable_openFile (context_fileTable (), fname, "wb+");
+ fname = fileTable_fileName (mtid);
+ s_macFile = fileTable_createMacrosFile (context_fileTable (), fname); /* , "wb+"); ? **/
if (s_macFile == NULL)
{
static void
macrocache_processMacro (macrocache m, int i)
{
- fileloc fl = m->contents[i]->fl;
+ fileloc fl = m->contents[i]->fl;
- m->contents[i]->defined = TRUE;
+ m->contents[i]->defined = TRUE;
if (!fileId_equal (currentFile (), fileloc_fileId (fl)))
{
{
for (i = 0; i < m->entries; i++)
{
- if (m->contents[i]->defined)
+ if (m->contents[i]->defined)
{
;
}
}
else
{
- if (context_getFlag (FLG_SHOWSCAN))
+ if (!fileloc_isLib (fl))
{
- if (!fileloc_isLib (fl))
- {
- lldiagmsg (message ("< checking macros %q >",
- fileloc_outputFilename (fl)));
- }
+ displayScan (message ("checking macros %q",
+ fileloc_outputFilename (fl)));
}
lastfl = fl;
for (i = 0; i < m->entries; i++)
{
- if (m->contents[i]->defined)
+ if (m->contents[i]->defined)
{
;
}