From 6d43e86c47a9417dc3d577244ab526c126d4b4e4 Mon Sep 17 00:00:00 2001 From: evans1629 Date: Tue, 29 Apr 2003 01:33:59 +0000 Subject: [PATCH] Renamings to avoid conflicts with type names. --- src/Headers/context.h | 18 ++---------------- src/context.c | 34 +++++++++++++++------------------- src/stateInfo.c | 40 ++++++++++++++++++++-------------------- 3 files changed, 37 insertions(+), 55 deletions(-) diff --git a/src/Headers/context.h b/src/Headers/context.h index 0af5595..4d5929e 100644 --- a/src/Headers/context.h +++ b/src/Headers/context.h @@ -331,29 +331,15 @@ extern void context_addAnnotation (/*@only@*/ annotationInfo) extern void context_addMetaState (/*@only@*/ cstring, /*@only@*/ metaStateInfo) /*@modifies internalState@*/ ; -extern valueTable context_createValueTable (sRef p_s, /*@only@*/ stateInfo p_sinfo) +extern valueTable context_createValueTable (sRef p_s, /*@only@*/ stateInfo p_info) /*@globals internalState@*/ ; -extern valueTable context_createGlobalMarkerValueTable (/*@only@*/ stateInfo p_sinfo) +extern valueTable context_createGlobalMarkerValueTable (/*@only@*/ stateInfo p_info) /*@globals internalState@*/ ; extern int context_getBugsLimit (void) /*@*/ ; # define context_getBugsLimit() ((int)context_getValue(FLG_BUGSLIMIT)) -/*drl 12/30/2001 these are some ugly functions that were added to facilitate struct annotations */ -/*drl 1/6/2001: I didn't think these functions were solid enough to include in the - stable release of splint. I commented them out so that they won't break anything - but didn't delete them because they will be fixed and included later -*/ - -/*extern void setGlobalStructInfo(ctype p_ct, constraintList p_list); */ - -/*extern constraintList getInvariants (ctype p_ct); */ - -/* static int getSref (ctype ct, sRef s); */ - -/* sRef fixSref (ctype p_ct, sRef p_base, sRef p_fix); */ - extern ctype context_setLastStruct (/*@returned@*/ ctype p_s) /*@modifies internalState@*/; extern ctype context_getLastStruct (/*@returned@*/ /*ctype p_s*/) /*@modifies internalState@*/; diff --git a/src/context.c b/src/context.c index b7fcc97..0819834 100644 --- a/src/context.c +++ b/src/context.c @@ -4795,27 +4795,23 @@ metaStateInfo context_lookupMetaStateInfo (cstring key) /*@null@*/ annotationInfo context_lookupAnnotation (cstring annot) { - annotationInfo ainfo; - - ainfo = annotationTable_lookup (gc.annotTable, annot); - - return ainfo; + return annotationTable_lookup (gc.annotTable, annot); } -void context_addAnnotation (annotationInfo ainfo) +void context_addAnnotation (annotationInfo info) { - if (annotationTable_contains (gc.annotTable, annotationInfo_getName (ainfo))) + if (annotationTable_contains (gc.annotTable, annotationInfo_getName (info))) { voptgenerror (FLG_SYNTAX, - message ("Duplicate annotation declaration: %s", annotationInfo_getName (ainfo)), - annotationInfo_getLoc (ainfo)); + message ("Duplicate annotation declaration: %s", annotationInfo_getName (info)), + annotationInfo_getLoc (info)); - annotationInfo_free (ainfo); + annotationInfo_free (info); } else { - annotationTable_insert (gc.annotTable, ainfo); + annotationTable_insert (gc.annotTable, info); } } @@ -4837,7 +4833,7 @@ void context_addMetaState (cstring mname, metaStateInfo msinfo) } } -valueTable context_createValueTable (sRef s, stateInfo sinfo) +valueTable context_createValueTable (sRef s, stateInfo info) { if (metaStateTable_size (gc.stateTable) > 0) { @@ -4858,7 +4854,7 @@ valueTable context_createValueTable (sRef s, stateInfo sinfo) (res, cstring_copy (metaStateInfo_getName (msi)), stateValue_createImplicit (metaStateInfo_getDefaultValue (msi, s), - stateInfo_copy (sinfo))); + stateInfo_copy (info))); } else { @@ -4867,18 +4863,18 @@ valueTable context_createValueTable (sRef s, stateInfo sinfo) } end_metaStateTable_elements ; - stateInfo_free (sinfo); + stateInfo_free (info); DPRINTF (("Value table: %s", valueTable_unparse (res))); return res; } else { - stateInfo_free (sinfo); + stateInfo_free (info); return valueTable_undefined; } } -valueTable context_createGlobalMarkerValueTable (stateInfo sinfo) +valueTable context_createGlobalMarkerValueTable (stateInfo info) { if (metaStateTable_size (gc.stateTable) > 0) { @@ -4894,17 +4890,17 @@ valueTable context_createGlobalMarkerValueTable (stateInfo sinfo) valueTable_insert (res, cstring_copy (metaStateInfo_getName (msi)), stateValue_create (metaStateInfo_getDefaultGlobalValue (msi), - stateInfo_copy (sinfo))); + stateInfo_copy (info))); } end_metaStateTable_elements ; - stateInfo_free (sinfo); + stateInfo_free (info); DPRINTF (("Value table: %s", valueTable_unparse (res))); return res; } else { - stateInfo_free (sinfo); + stateInfo_free (info); return valueTable_undefined; } } diff --git a/src/stateInfo.c b/src/stateInfo.c index 6d80a88..cf5246a 100644 --- a/src/stateInfo.c +++ b/src/stateInfo.c @@ -87,32 +87,32 @@ void stateInfo_free (/*@only@*/ stateInfo a) } } -static /*@observer@*/ stateInfo stateInfo_sort (/*@temp@*/ stateInfo sinfo) +static /*@observer@*/ stateInfo stateInfo_sort (/*@temp@*/ stateInfo stinfo) /* Sorts in reverse location order */ { - DPRINTF (("Sorting: %s", stateInfo_unparse (sinfo))); + DPRINTF (("Sorting: %s", stateInfo_unparse (stinfo))); - if (sinfo == NULL || sinfo->previous == NULL) + if (stinfo == NULL || stinfo->previous == NULL) { - return sinfo; + return stinfo; } else { - stateInfo snext = stateInfo_sort (sinfo->previous); + stateInfo snext = stateInfo_sort (stinfo->previous); stateInfo sfirst = snext; - DPRINTF (("sinfo/sext: %s // %s", stateInfo_unparse (sinfo), stateInfo_unparse (snext))); + DPRINTF (("stinfo/sext: %s // %s", stateInfo_unparse (stinfo), stateInfo_unparse (snext))); llassert (snext != NULL); - if (!fileloc_lessthan (sinfo->loc, snext->loc)) + if (!fileloc_lessthan (stinfo->loc, snext->loc)) { - /*@i2@*/ sinfo->previous = sfirst; /* spurious? */ - DPRINTF (("Sorted ==> %s", stateInfo_unparse (sinfo))); - /*@i2@*/ return sinfo; /* spurious? */ + /*@i2@*/ stinfo->previous = sfirst; /* spurious? */ + DPRINTF (("Sorted ==> %s", stateInfo_unparse (stinfo))); + /*@i2@*/ return stinfo; /* spurious? */ } else { - while (snext != NULL && fileloc_lessthan (sinfo->loc, snext->loc)) + while (snext != NULL && fileloc_lessthan (stinfo->loc, snext->loc)) { /* ** swap the order @@ -121,22 +121,22 @@ static /*@observer@*/ stateInfo stateInfo_sort (/*@temp@*/ stateInfo sinfo) stateAction taction = snext->action; sRef tref = snext->ref; - DPRINTF (("in while: sinfo/sext: %s // %s", stateInfo_unparse (sinfo), stateInfo_unparse (snext))); + DPRINTF (("in while: stinfo/sext: %s // %s", stateInfo_unparse (stinfo), stateInfo_unparse (snext))); - snext->loc = sinfo->loc; - snext->action = sinfo->action; + snext->loc = stinfo->loc; + snext->action = stinfo->action; /*@-modobserver@*/ - snext->ref = sinfo->ref; /* Doesn't actually modifie sfirst */ + snext->ref = stinfo->ref; /* Doesn't actually modifie sfirst */ /*@=modobserver@*/ - sinfo->loc = tloc; - sinfo->action = taction; - sinfo->ref = tref; + stinfo->loc = tloc; + stinfo->action = taction; + stinfo->ref = tref; /*@-mustfreeonly@*/ - sinfo->previous = snext->previous; + stinfo->previous = snext->previous; /*@=mustfreeonly@*/ snext = snext->previous; - DPRINTF (("in while: sinfo/sext: %s // %s", stateInfo_unparse (sinfo), stateInfo_unparse (snext))); + DPRINTF (("in while: stinfo/sext: %s // %s", stateInfo_unparse (stinfo), stateInfo_unparse (snext))); } DPRINTF (("Sorted ==> %s", stateInfo_unparse (sfirst))); -- 2.45.0