preprocessor expressions. (Should add a warning for these).
Some problems with make splintme not yet resolved.
struct s_cstringTable
{
- int size;
+ unsigned long size;
int nentries;
/*@only@*/ o_hbucket *buckets;
} ;
}
else
{
- long l = int_toNonNegative (a) << b;
+ /*@-shiftimplementation@*/
+ long l = a << b; /* int_toNonNegative removed (allow shifts of negative values) */
# ifdef WIN32
# pragma warning( disable : 4018 )
# endif
- if (int_toNonNegative (l) >> b != a)
+ if (l >> b != a) /* int_toNonNegative removed (allow shifts of negative values) */
{
integer_overflow (pfile);
}
else if (unsignedp)
return (unsigned long) a >> b;
else
- return int_toNonNegative (a) >> b;
+ return a >> b; /* int_toNonNegative removed (allow shifts of negative values) */
+ /*@=shiftimplementation@*/
}
/* These priorities are all even, so we can handle associatively. */
/*drl 1/9/2001/ try to define the right symbol for the architecture
We use autoconf to determine the target cpu
*/
+# ifndef S_SPLINT_S
cpplib_installBuiltin ("__" TARGET_CPU, ctype_int, -1, T_CONST, 2, NULL, -1);
+# endif
/*drl 1/2/2002 set some flags based on uname
I'd like to be able to do this with autoconf macro instead...
cstring_free (exname);
}
- cscannerHelp_handleNewLine (); // evans 2003-10-27: pragment increments line
+ (void) cscannerHelp_handleNewLine (); /* evans 2003-10-27: pragment increments line */
}
else if (cstring_equalPrefixLit (olc, "ident"))
{
/* Some pre-processors will leave these in the code. Ignore rest of line */
- cscannerHelp_handleNewLine (); // evans 2003-10-27: ident increments line
+ (void) cscannerHelp_handleNewLine (); /* evans 2003-10-27: ident increments line */
}
/*
** We handle a plain # in the input file, by echoing it, and ignoring it in the post-pp-file.
*/
mstring_free (ol);
- cscannerHelp_handleNewLine (); // evans 2003-10-27: increments line
+ (void) cscannerHelp_handleNewLine (); /* evans 2003-10-27: increments line */
return FALSE;
} else {
voptgenerror
message ("Unrecognized pre-processor directive: #%s",
cstring_fromChars (ol)),
g_currentloc);
- cscannerHelp_handleNewLine (); // evans 2003-10-27: increments line
+ (void) cscannerHelp_handleNewLine (); /* evans 2003-10-27: increments line */
}
sfree (ol);
void
cstringTable_free (/*@only@*/ cstringTable h)
{
- int i;
+ unsigned int i;
llassert (cstringTable_isDefined (h));
cstringTable_countCollisions (cstringTable h)
{
int nc = 0;
- int i;
+ unsigned int i;
llassert (cstringTable_isDefined (h));
cstringTable_countEmpty (cstringTable h)
{
int nc = 0;
- int i;
+ unsigned int i;
llassert (cstringTable_isDefined (h));
/*@only@*/ cstringTable
-cstringTable_create (int size)
+cstringTable_create (unsigned int size)
{
int i;
cstringTable h = (cstringTable) dmalloc (sizeof (*h));
cstring cstringTable_unparse (cstringTable h)
{
cstring res = cstring_newEmpty ();
- int i;
+ unsigned int i;
if (cstringTable_isDefined (h))
{
}
}
- res = message ("%qsize: %d, collisions: %d, empty: %d",
+ res = message ("%qsize: %u, collisions: %d, empty: %d",
res,
h->size,
cstringTable_countCollisions (h),
cstringTable_stats (cstringTable h)
{
llassert (cstringTable_isDefined (h));
- return (message ("size: %d, collisions: %d, empty: %d\n",
+ return (message ("size: %u, collisions: %d, empty: %d\n",
h->size, cstringTable_countCollisions (h),
cstringTable_countEmpty (h)));
}
** rehashing based (loosely) on code by Steve Harrison
*/
- int i;
- int oldsize = h->size;
- int newsize = 1 + ((oldsize * 26244) / 10000); /* 26244 = 162^2 */
+ unsigned int i;
+ /* Fix provided by Thomas Mertz (int -> unsigned long), 21 Apr 2004 */
+ unsigned long oldsize = h->size;
+ unsigned long newsize = 1 + ((oldsize * 26244) / 10000); /* 26244 = 162^2 */
hbucket *oldbuckets = h->buckets;
h->size = newsize;
*tt = '\0';
lldiagmsg (message ("Standard library: %s", fpath));
- lldiagmsg (message (" (created using %s)", cstring_fromChars (t)));
+ /* evans 2004-01-13: removed this (it is the libversion which is confusing) */
+ /* lldiagmsg (message (" (created using %s)", cstring_fromChars (t))); */
}
sfree (ot);
cstring_toCharsSafe (loc));
cstring_free (loc);
printCodePoint ();
- fprintf (g_errorstream, "*** Please report bug to %s\n", SPLINT_MAINTAINER);
+ fprintf (g_errorstream, "*** Please report bug to %s\n*** A useful bug report should include everything we need to reproduce the bug.\n", SPLINT_MAINTAINER);
exit (LLGIVEUP);
}
default:
cstring_toCharsSafe (fileloc_unparse (g_currentloc)));
/*@=mustfree@*/
printCodePoint ();
- fprintf (g_errorstream, "*** Please report bug to %s ***\n", SPLINT_MAINTAINER);
+ fprintf (g_errorstream, "*** Please report bug to %s\n*** A useful bug report should include everything we need to reproduce the bug.", SPLINT_MAINTAINER);
exit (LLGIVEUP);
}
}
# if defined (WIN32) || defined (OS2) && defined (__IBMC__)
int pid = _getpid ();
# else
- pid_t pid = getpid ();
+ __pid_t pid = getpid ();
# endif
return (int) pid;