/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 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
*/
/*
** checking.c
** Massachusetts Institute of Technology
*/
-# include "lclintMacros.nf"
-# include "llbasic.h"
+# include "splintMacros.nf"
+# include "basic.h"
# include "llgrammar.h"
# include "checking.h"
# include "lclscan.h"
static /*@only@*/ cstring printBadArgs (sortSetList p_args);
static /*@only@*/ sortSet
- standardOperators (/*@null@*/ nameNode p_n, sortSetList p_argSorts, sort p_qual);
+ standardOperators (/*@null@*/ nameNode p_n, sortSetList p_argSorts, sort p_q);
static bool isStandardOperator (/*@null@*/ nameNode p_n);
static void assignSorts (termNode p_t, sort p_s);
unsigned int arity = termNodeList_size (t->args);
errtok = nameNode_errorToken (t->name);
- /* errorShowPoint (tsource_thisLine (lclsource), ltoken_getCol (errtok)); */
+ /* errorShowPoint (inputStream_thisLine (lclsource), ltoken_getCol (errtok)); */
if (isStandardOperator (t->name))
{
case TRM_LITERAL:
sortSet_elements (t->possibleSorts, s2)
{
- if (sort_equal (&s2, &s))
+ if (sort_equal (s2, s))
{
sortSet_free (t->possibleSorts);
t->possibleSorts = sortSet_new ();
{
sort rsort = sigNode_rangeSort (sig->signature);
- if (sort_equal (&s, &rsort))
+ if (sort_equal (s, rsort))
{
lslOp iop;
}
else
{
- /* errorShowPoint (tsource_thisLine (lclsource), ltoken_getCol (errtok)); */
+ /* errorShowPoint (inputStream_thisLine (lclsource), ltoken_getCol (errtok)); */
t->error_reported = TRUE;
lclerror (errtok, message ("Operator not found: %q",
else
{
errtok = nameNode_errorToken (name);
- /* errorShowPoint (tsource_thisLine (lclsource), ltoken_getCol (errtok)); */
+ /* errorShowPoint (inputStream_thisLine (lclsource), ltoken_getCol (errtok)); */
t->error_reported = TRUE;
lclerror (errtok, message ("No matching operator: %q",
{
/* check that the sort of n is boolean */
theSort = n->predicate->sort;
- if (!sort_compatible (theSort, sort_capBool))
+ if (!sort_compatible (theSort, g_sortCapBool))
{
if (sort_isNoSort (theSort))
{
}
static /*@only@*/ sortSet
-standardOperators (/*@null@*/ nameNode n, sortSetList argSorts, /*@unused@*/ sort qual)
+standardOperators (/*@null@*/ nameNode n, sortSetList argSorts, /*@unused@*/ sort q)
{
sortSet argSet;
sortSet ret = sortSet_new ();
sn = sort_quietLookup (current);
- while (sn.kind == SRT_SYN)
+ while (sn->kind == SRT_SYN)
{
- sn = sort_quietLookup (sn.baseSort);
+ sn = sort_quietLookup (sn->baseSort);
}
/*@-loopswitchbreak@*/
if (cstring_equalLit (text, "trashed")) /* GACK! */
{
- if (sn.kind == SRT_OBJ ||
- sn.kind == SRT_ARRAY)
- (void) sortSet_insert (ret, sort_bool);
+ if (sn->kind == SRT_OBJ ||
+ sn->kind == SRT_ARRAY)
+ (void) sortSet_insert (ret, g_sortBool);
}
if (cstring_equalLit (text, "maxIndex") ||
cstring_equalLit (text, "minIndex"))
{
- if (sn.kind == SRT_ARRAY || sn.kind == SRT_PTR)
- (void) sortSet_insert (ret, sort_int);
+ if (sn->kind == SRT_ARRAY || sn->kind == SRT_PTR)
+ (void) sortSet_insert (ret, g_sortInt);
/* if (lsymbol_fromChars ("maxIndex") */
}
case LLT_MODIFIES:
case LLT_FRESH:
case LLT_UNCHANGED:
- if (sn.kind == SRT_OBJ ||
- sn.kind == SRT_ARRAY)
+ if (sn->kind == SRT_OBJ ||
+ sn->kind == SRT_ARRAY)
{
- (void) sortSet_insert (ret, sort_bool);
+ (void) sortSet_insert (ret, g_sortBool);
}
break;
case LLT_SIZEOF:
- if (sn.kind == SRT_OBJ ||
- sn.kind == SRT_ARRAY ||
- sn.kind == SRT_VECTOR)
- (void) sortSet_insert (ret, sort_int);
+ if (sn->kind == SRT_OBJ ||
+ sn->kind == SRT_ARRAY ||
+ sn->kind == SRT_VECTOR)
+ (void) sortSet_insert (ret, g_sortInt);
break;
default:
break;
{
argSet = sortSetList_head (argSorts);
- if (sortSet_member (argSet, sort_bool))
+ if (sortSet_member (argSet, g_sortBool))
{
sortSetList_reset (argSorts);
sortSetList_advance (argSorts);
clause2 = sortSet_choose (argSet);
if (sortSet_size (argSet) == 1 &&
- sort_equal (&clause, &clause2))
+ sort_equal (clause, clause2))
{
(void) sortSet_insert (ret, clause);
}
sn = sort_quietLookup (current);
- while (sn.kind == SRT_SYN)
+ while (sn->kind == SRT_SYN)
{
- sn = sort_quietLookup (sn.baseSort);
+ sn = sort_quietLookup (sn->baseSort);
}
- switch (sn.kind)
+ switch (sn->kind)
{
case SRT_OBJ:
- (void) sortSet_insert (ret, sn.baseSort);
+ (void) sortSet_insert (ret, sn->baseSort);
break;
case SRT_ARRAY:
(void) sortSet_insert (ret,
sn = sort_quietLookup (current);
- while (sn.kind == SRT_SYN)
+ while (sn->kind == SRT_SYN)
{
- sn = sort_quietLookup (sn.baseSort);
+ sn = sort_quietLookup (sn->baseSort);
}
- if (sn.kind == SRT_PTR)
+ if (sn->kind == SRT_PTR)
{
- (void) sortSet_insert (ret, sn.baseSort);
+ (void) sortSet_insert (ret, sn->baseSort);
}
} end_sortSet_elements;
}
{
sortSet_elements (argSet2, cl2)
{
- if (sort_equal (&cl, &cl2))
+ if (sort_equal (cl, cl2))
{
- (void) sortSet_insert (ret, sort_bool);
+ (void) sortSet_insert (ret, g_sortBool);
}
} end_sortSet_elements;
} end_sortSet_elements;