These comments contained important about place where the splintme detected potential bounds errors within Splint.
They were removed because this information was not particularly useful and it made the code harder to read.
}
constraint_free(c);
- /*drl bee: pbr*/ *resolved = TRUE;
+ *resolved = TRUE;
return NULL;
}
- /*drl bee: pbr*/ *resolved = FALSE;
+ *resolved = FALSE;
llassert(constraint_isDefined(c) );
curr = doResolve (curr, post1, resolved);
- /*drl bee: pbr*/ if (*resolved)
+ if (*resolved)
{
/* curr is null so we don't try to free it*/
llassert(curr == NULL);
for (i = 0; i < len; i++)
{
- /*drl bee: is*/ if (p[i] == '.') {
+ if (p[i] == '.') {
/* It's a float since it contains a point. */
cppReader_errorLit
(pfile,
/*@innerbreak@*/ break;
}
- /*drl bee: ltc*/ c = *p++;
+ c = *p++;
}
/* Don't look for any more digits after the suffixes. */
break;
}
++ptr;
- /*drl bee: hda*/ while (ptr < tok_end && ((c = *ptr++) != '\''))
+ while (ptr < tok_end && ((c = *ptr++) != '\''))
{
if (c == '\\')
{
}
}
- /*drl bee: dad*/ token_buffer[num_chars] = 0;
+ token_buffer[num_chars] = 0;
if (c != '\'')
cppReader_errorLit (pfile,
{
for (toktab = tokentab2; toktab->operator != NULL; toktab++)
{
- /*drl bee: hda*/ if (tok_start[0] == /*drl bee: hda*/ toktab->operator[0]
- && /*drl bee: hda*/ tok_start[1] == /*drl bee: hda*/ toktab->operator[1])
+ if (tok_start[0] == toktab->operator[0] &&
+ tok_start[1] == toktab->operator[1])
{
/*@loopbreak@*/ break;
}
int
cppReader_parseEscape (cppReader *pfile, char **string_ptr)
{
- /*drl bee: pbr*/ char c = *(*string_ptr)++;
+ char c = *(*string_ptr)++;
switch (c)
{
else
{
- /*drl bee: pbr*/ (*string_ptr)--;
+ (*string_ptr)--;
/*@loopbreak@*/ break;
}
}
for (i = 0; i < size_toInt (size); i++)
{
- /*drl bee: is*/
+
char c = s[i];
if (strchr (clist, c) != NULL)
for (j = i; j < size_toInt (size); j++)
{
- /*drl bee: is*/ /*drl bee: is*/ s[j] = s[j+1];
+ s[j] = s[j+1];
}
- /*drl bee: is*/ s[size] = '\0';
+ s[size] = '\0';
i--;
}
}
t++;
}
- /*drl bee: ib*/
- /*drl bee: ib*/
+
if (*s == '\0' && *t != '\0')
{
return CGE_DISTINCT;
else
{
llassert (s != NULL);
- /*drl bee: mrms*/
+
*(s + len) = '\0';
}
cstring sc = cstring_create (len);
strncpy (sc, s, len);
- /*drl bee: mrms*/
+
*(sc + len - 1) = '\0';
*(sc + len - 2) = '.';
*(sc + len - 3) = '.';
{
for (i = 0; i < n; i++)
{
- /*drl bee: is*/
- /*drl bee: is*/
+
*t++ = *s++;
}
*t = '\0';
{
for (i = 0; i < len; i++)
{
- /*drl bee: is*/
-/*drl bee: is*/
+
*t++ = *s++;
}
for (i = 0; i < n - len; i++)
{
-/*drl bee: is*/
+
*t++ = ' ';
}
*t = '\0';
cstring ot = t;
char c;
- /*drl bee: lhnt*/ while ((c = *s) != '\0')
+ while ((c = *s) != '\0')
{
if (c >= 'A' && c <= 'Z')
{
*t++ = c;
s++;
}
- /*drl bee: is*/ *t = '\0';
+ *t = '\0';
return ot;
}
{
strcpy (s, s1);
*(s + l) = c;
- /*drl bee: dm*/ *(s + l + 1) = '\0';
+ *(s + l + 1) = '\0';
sfree (s1);
}
else
{
*(s) = c;
- /*drl bee: dm*/ *(s + 1) = '\0';
+ *(s + 1) = '\0';
}
return s;
if (cstring_isDefined (s))
{
- /*drl bee: sl*/ strcpy (ret, s);
+ strcpy (ret, s);
}
if (cstring_isDefined (t))
{
size_t l = cstring_length (s1);
char *s = (char *) dmalloc (sizeof (*s) * (l + 2));
-/*drl bee: dm*/ *(s) = c;
+ *(s) = c;
if (cstring_isDefined (s1))
{
/*@=mayaliasunique@*/
}
- /*drl bee: dm*/ *(s + l + 1) = '\0';
+ *(s + l + 1) = '\0';
return s;
}
if (cstring_isUndefined (s)) return FALSE;
-/*drl bee: lhnt*/ while ((c = (int) *s) != (int) '\0')
+ while ((c = (int) *s) != (int) '\0')
{
if ((isalnum (c) == 0) && (c != (int) '_')
&& (c != (int) '.') && (c != (int) CONNECTCHAR))
{
char *s = dmalloc (sizeof (*s) * (n + 1));
- /*drl bee: dm*/ *s = '\0';
+ *s = '\0';
return s;
}
if (mid != 0 && mid < nentries - 1)
{
llassert (cstring_compare (key, table[mid - 1]) > 0);
- /*drl bee: ndv*/ llassert (cstring_compare (key, table[mid + 1]) < 0);
+ llassert (cstring_compare (key, table[mid + 1]) < 0);
}
return res;
if (cstring_isDefined (s)) {
char *t = s;
- /*drl bee: lhnt*/ while (*t != '\0' && isspace ((int) *t)) {
+ while (*t != '\0' && isspace ((int) *t)) {
t++;
}
for (i = 0; i < h->size; i++)
{
- /*drl bee: si*/ s = message ("%q %s:%d", s, h->entries[i]->key, h->entries[i]->val);
+ s = message ("%q %s:%d", s, h->entries[i]->key, h->entries[i]->val);
}
}
h->size = 1;
h->nspace = HBUCKET_BASESIZE - 1;
h->entries = (hentry *) dmalloc (HBUCKET_BASESIZE * sizeof (*h->entries));
- /*drl bee: dm*/ h->entries[0] = e;
+ h->entries[0] = e;
return (h);
}
for (i = 0; i < h->size; i++)
{
- /*drl bee: dm*/
- /*drl bee: si*/ newentries[i] = h->entries[i];
+ newentries[i] = h->entries[i];
}
/*@i32@*/ sfree (h->entries);
}
llassert (e->val != HBUCKET_DNE);
- /*drl bee: si*/ h->entries[h->size] = e;
+ h->entries[h->size] = e;
h->size++;
h->nspace--;
}
for (i = 0; i < h->size; i++)
{
- /*drl bee: si*/ if (cstring_equal (h->entries[i]->key, key))
+ if (cstring_equal (h->entries[i]->key, key))
{
return h->entries[i]->val;
}
for (i = 0; i < h->size; i++)
{
- /*drl bee: si*/ hbucket_free (h->buckets[i]);
+ hbucket_free (h->buckets[i]);
}
sfree (h->buckets);
for (i = 0; i < h->size; i++)
{
- /*drl bee: si*/ nc += hbucket_ncollisions (h->buckets[i]);
+ nc += hbucket_ncollisions (h->buckets[i]);
}
return (nc);
for (i = 0; i < h->size; i++)
{
- /*drl bee: si*/ if (hbucket_isEmpty (h->buckets[i]))
+ if (hbucket_isEmpty (h->buckets[i]))
{
nc++;
}
for (p = cstring_toCharsSafe (key); *p != '\0'; p++)
{
- /*drl bee: nm*/ hash_value = (hash_value << 1) ^ g_randomNumbers[*p % 256];
+ hash_value = (hash_value << 1) ^ g_randomNumbers[*p % 256];
}
return (hash_value % h->size);
/*@+loopexec@*/
for (i = 0; i < size; i++)
{
- /*drl bee: dm*/ h->buckets[i] = hbucket_undefined;
+ h->buckets[i] = hbucket_undefined;
}
/*@-loopexec@*/
return h;
{
for (i = 0; i < h->size; i++)
{
- /*drl bee: si*/ hbucket hb = h->buckets[i];
+ hbucket hb = h->buckets[i];
if (hb != NULL)
{
/*@+loopexec@*/
for (i = 0; i < newsize; i++)
{
- /*drl bee: dm*/ h->buckets[i] = hbucket_undefined;
+ h->buckets[i] = hbucket_undefined;
}
/*@=loopexec@*/
for (i = 0; i < oldsize; i++)
{
- /*drl bee: dm*/ hbucket bucket = oldbuckets[i];
+ hbucket bucket = oldbuckets[i];
- /*drl bee: dm*/ oldbuckets[i] = NULL;
+ oldbuckets[i] = NULL;
if (!hbucket_isNull (bucket))
{
for (j = 0; j < bucket->size; j++)
{
- /*drl bee: si*/ cstringTable_addEntry (h, bucket->entries[j]);
+ cstringTable_addEntry (h, bucket->entries[j]);
}
/*
** instead reveals a bug I don't want to deal with right now!
*/
- /*drl bee: si*/ if (hbucket_isNull (h->buckets[hindex]))
+ if (hbucket_isNull (h->buckets[hindex]))
{
- /*drl bee: si*/ h->buckets[hindex] = hbucket_single (e);
+ h->buckets[hindex] = hbucket_single (e);
h->nentries++;
}
else
hindex = cstringTable_hashValue (h, key);
e = hentry_create (key, value);
- /*drl bee: si*/ hb = h->buckets[hindex];
+ hb = h->buckets[hindex];
if (hbucket_isNull (hb))
{
- /*drl bee: si*/ h->buckets[hindex] = hbucket_single (e);
+ h->buckets[hindex] = hbucket_single (e);
}
else
{
for (i = 0; i < hb->size; i++)
{
- /*drl bee: si*/ if (cstring_equal (hb->entries[i]->key, key))
+ if (cstring_equal (hb->entries[i]->key, key))
{
- /*drl bee: si*/ hb->entries[i]->val = newval;
+ hb->entries[i]->val = newval;
return;
}
}
for (i = 0; i < hb->size; i++)
{
- /*drl bee: si*/ if (cstring_equal (hb->entries[i]->key, oldkey))
+ if (cstring_equal (hb->entries[i]->key, oldkey))
{
- /*drl bee: si*/ hb->entries[i]->key = newkey;
+ hb->entries[i]->key = newkey;
return;
}
}
for (i = 0; i < hb->size; i++)
{
- /*drl bee: si*/ if (cstring_equal (hb->entries[i]->key, key))
+ if (cstring_equal (hb->entries[i]->key, key))
{
if (i < hb->size - 1)
{
- /*drl bee: si*/
- hb->entries[i] = hb->entries[hb->size - 1];
+ hb->entries[i] = hb->entries[hb->size - 1];
}
hb->size--;
{
ctype cbr = ctype_getConjA (*c);
- /*drl bee: si*/ if ((*pred) (cbr))
+ if ((*pred) (cbr))
{
if ((*pred) (ctype_getConjB (*c)))
{
s->nelements = 1;
s->nspace = enumNameListBASESIZE - 1;
s->elements = (enumName *) dmalloc (sizeof (*s->elements) * enumNameListBASESIZE);
- /*drl bee: dm*/
- s->elements[0] = t;
+ s->elements[0] = t;
return (s);
}
for (i = 0; i < e1->nelements; i++)
{
- /*drl bee: si*/
- /*drl bee: si*/
- if (!cstring_equal (e1->elements[i], e2->elements[i]))
+ if (!cstring_equal (e1->elements[i], e2->elements[i]))
return FALSE;
}
return TRUE;
for (i = 0; i < s->nelements; i++)
{
- /*drl bee: si*/
- /*drl bee: si*/
- newelements[i] = s->elements[i];
+ newelements[i] = s->elements[i];
}
sfree (s->elements);
enumNameList_grow (s);
s->nspace--;
- /*drl bee: si*/
- s->elements[s->nelements] = el;
+ s->elements[s->nelements] = el;
s->nelements++;
}
{
if (i == 0)
{
- /*drl bee: si*/
- st = cstring_copy (s->elements[i]);
+ st = cstring_copy (s->elements[i]);
}
else
{
- /*drl bee: si*/
- st = message ("%q, %s", st, s->elements[i]);
+ st = message ("%q, %s", st, s->elements[i]);
}
}
{
if (i == 0)
{
- /*drl bee: si*/
- st = cstring_copy (s->elements[i]);
+ st = cstring_copy (s->elements[i]);
}
else if (i == 3 && s->nelements > 5)
{
}
else
{
- /*drl bee: si*/
- st = message ("%q, %s", st, s->elements[i]);
+ st = message ("%q, %s", st, s->elements[i]);
}
}
{
if (i == 0)
{
- /*drl bee: si*/
- st = cstring_copy (s->elements[i]);
+ st = cstring_copy (s->elements[i]);
}
else
- /*drl bee: si*/
- st = message ("%q,%s", st, s->elements[i]);
+ st = message ("%q,%s", st, s->elements[i]);
}
return st;
}
for (i = 0; i < s->nelements; i++)
{
- /*drl bee: si*/
- /*drl bee: si*/
- s->elements[i] = oldelements[i];
+ s->elements[i] = oldelements[i];
}
sfree (oldelements);
}
s->free--;
- /*drl bee: si*/
- s->elements[s->nelements] = el;
+ s->elements[s->nelements] = el;
s->nelements++;
}
for (i = 0; i < s->nelements; i++)
{
- /*drl bee: si*/
- fileloc_free (s->elements[i]);
+ fileloc_free (s->elements[i]);
}
s->free += s->nelements;
for (i = s->nelements - 1; i >= 0; i--)
{
- /*drl bee: si*/
- if (fileloc_sameBaseFile (s->elements[i], el))
+ if (fileloc_sameBaseFile (s->elements[i], el))
{
int j;
for (j = i; j < s->nelements; j++)
{
- /*drl bee: si*/
- fileloc_free (s->elements[j]);
+ fileloc_free (s->elements[j]);
}
- /*drl bee: si*/
- s->elements[i] = el;
+ s->elements[i] = el;
s->nelements = i + 1;
return FALSE;
}
{
if (i == s->nelements - 1)
{
- /*drl bee: si*/
- st = message ("%q %q", st, fileloc_unparse (s->elements[i]));
+ st = message ("%q %q", st, fileloc_unparse (s->elements[i]));
}
else
{
- /*drl bee: si*/
- st = message ("%q, %q", st, fileloc_unparse (s->elements[i]));
+ st = message ("%q, %q", st, fileloc_unparse (s->elements[i]));
}
}
}
/* the zeroth element doesn't count! */
for (i = s->nelements - 1; i > 0; i--)
{
- /*drl bee: si*/
- if (!fileloc_isSpecialFile (s->elements[i]))
+ if (!fileloc_isSpecialFile (s->elements[i]))
{
depth++;
}
/* don't show last two files pushed */
for (i = s->nelements - 3; i >= 0; i--)
{
- /*drl bee: si*/
- if (i == 0 || !fileloc_isSpecialFile (s->elements[i]))
+ if (i == 0 || !fileloc_isSpecialFile (s->elements[i]))
{
- /*drl bee: si*/
- llgenindentmsg (cstring_makeLiteral ("Include site"),
+ llgenindentmsg (cstring_makeLiteral ("Include site"),
s->elements[i]);
}
}
int i;
for (i = 0; i < s->nelements; i++)
{
- /*drl bee: si*/
- fileloc_free (s->elements[i]);
+ fileloc_free (s->elements[i]);
}
sfree (s->elements);
}
else
{
- /*drl bee: ec*/
- /*drl bee: ec*/
flags[f].nreported = flags[f].nreported + 1;
}
}
{
llassertprint (f != INVALID_FLAG, ("flagcode: %s", flagcode_unparse (f)));
- /*drl bee: ec*/
- /*drl bee: ec*/ flags[f].nsuppressed = flags[f].nsuppressed + 1;
+ flags[f].nsuppressed = flags[f].nsuppressed + 1;
}
int
{
llassert (f != INVALID_FLAG);
- /*drl bee: ec*/
if (mstring_isDefined (flags[f].hint))
{
return (cstring_fromChars (flags[f].hint));
for (i = 0; categories[i].kind != FK_NONE; i++)
{
- /*drl bee: mRug*/
if (mstring_isDefined (categories[i].name))
{
if (cstring_equalLit (s, categories[i].name))
for (i = 0; categories[i].kind != FK_NONE; i++)
{
- /*drl bee: mrUg*/
if (categories[i].kind == kind)
{
return (cstring_fromChars (categories[i].name));
for (i = 0; categories[i].kind != FK_NONE; i++)
{
- /*drl bee: mRug*/
if (categories[i].kind == kind)
{
return i;
int index = categoryIndex (kind);
llassert (index >= 0);
- /*drl bee: mRug*/
llmsg (message ("%s (%d flags)\n\3%s\n\n",
cstring_fromChars (categories[index].name),
categorySize (kind),
for (i = 0; categories[i].kind != FK_NONE; i++)
{
- /*drl bee: mRug*/
flagkind kind = categories[i].kind ;
if (categories[i].describe != NULL)
context_resetAllFlags ();
- /*drl bee: mRug*/
f = flags[flag];
ret = cstring_copy (cstring_fromChars (f.desc));
} ;
char *current;
- /*drl bee: ia*/
while ((current = transform[i]) != NULL)
{
if (cstring_containsLit (res, current))
{
/* static valueFlags must be defined */
/*@-usedef@*/
- /*drl bee: sta*/
if (f == valueFlags[i]) /*@=usedef@*/
{
return i;
for (i = 0; i < NUMSTRINGFLAGS; i++)
{
- /*drl bee: sta*/
/*@-usedef@*/ if (f == stringFlags[i]) /*@=usedef@*/
{
return i;
for (i = 0; i < s->entries; i++)
{
- /*drl bee: si*/ mce_free (s->contents[i]);
+ mce_free (s->contents[i]);
}
sfree (s->contents);
for (i = 0; i < s->entries; i++)
{
- /*drl bee: dm*/ /*drl bee: si*/ s->contents[i] = oldcontents[i];
+ s->contents[i] = oldcontents[i];
}
sfree (oldcontents);
if ((i = macrocache_exists (s, fl)) != DNE)
{
- /*drl bee: si*/ 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);
- /*drl bee: si*/ s->contents[i]->def = def;
+ s->contents[i]->def = def;
fileloc_free (fl);
return;
}
s->nspace--;
- /*drl bee: si*/ s->contents[s->entries] = mce_create (fl, def, sup);
+ s->contents[s->entries] = mce_create (fl, def, sup);
s->entries++;
}
for (i = 0; i < s->entries; i++)
{
- /*drl bee: si*/ 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++)
{
- /*drl bee: si*/ fileloc fl = m->contents[i]->fl;
+ fileloc fl = m->contents[i]->fl;
cstring def = m->contents[i]->def;
bool defined = m->contents[i]->defined;
static void
macrocache_processMacro (macrocache m, int i)
{
- /*drl bee: si*/ fileloc fl = m->contents[i]->fl;
+ fileloc fl = m->contents[i]->fl;
- /*drl bee: si*/ m->contents[i]->defined = TRUE;
+ m->contents[i]->defined = TRUE;
if (!fileId_equal (currentFile (), fileloc_fileId (fl)))
{
{
for (i = 0; i < m->entries; i++)
{
- /*drl bee: si*/ if (m->contents[i]->defined)
+ if (m->contents[i]->defined)
{
;
}
for (i = 0; i < m->entries; i++)
{
- /*drl bee: si*/ if (m->contents[i]->defined)
+ if (m->contents[i]->defined)
{
;
}