warnings--

warnings = 0



SVN revision: 52451
This commit is contained in:
Carsten Haitzler 2010-09-19 03:00:12 +00:00
parent 77e3899ad6
commit eaa190ad0e
6 changed files with 24 additions and 17 deletions

View File

@ -101,7 +101,8 @@ plungequalifiedfile(char *name)
} /* if */
ext_idx++;
}
while (!fp && ext_idx < (sizeof extensions / sizeof extensions[0]));
while ((!fp) &&
(ext_idx < (int)(sizeof extensions / sizeof extensions[0])));
if (!fp)
{
*ext = '\0'; /* restore filename */
@ -197,11 +198,11 @@ doinclude(void)
} /* if */
i = 0;
while (*lptr != c && *lptr != '\0' && i < sizeof name - 1) /* find the end of the string */
while ((*lptr != c) && (*lptr != '\0') && (i < (int)(sizeof(name) - 1))) /* find the end of the string */
name[i++] = *lptr++;
while (i > 0 && name[i - 1] <= ' ')
i--; /* strip trailing whitespace */
assert(i >= 0 && i < sizeof name);
assert((i >= 0) && (i < (int)(sizeof(name))));
name[i] = '\0'; /* zero-terminate the string */
if (*lptr != c)
@ -989,7 +990,9 @@ command(void)
{
int i;
for (i = 0; i < sizeof name && alphanum(*lptr);
for (i = 0;
(i < (int)(sizeof(name))) &&
(alphanum(*lptr));
i++, lptr++)
name[i] = *lptr;
name[i] = '\0';
@ -1022,9 +1025,11 @@ command(void)
int i;
/* first gather all information, start with the tag name */
while (*lptr <= ' ' && *lptr != '\0')
while ((*lptr <= ' ') && (*lptr != '\0'))
lptr++;
for (i = 0; i < sizeof name && alphanum(*lptr);
for (i = 0;
(i < (int)(sizeof(name))) &&
(alphanum(*lptr));
i++, lptr++)
name[i] = *lptr;
name[i] = '\0';
@ -1084,9 +1089,11 @@ command(void)
do
{
/* get the name */
while (*lptr <= ' ' && *lptr != '\0')
while ((*lptr <= ' ') && (*lptr != '\0'))
lptr++;
for (i = 0; i < sizeof name && isalpha(*lptr);
for (i = 0;
(i < (int)(sizeof(name))) &&
(isalpha(*lptr));
i++, lptr++)
name[i] = *lptr;
name[i] = '\0';

View File

@ -166,7 +166,7 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam,
{
assert((sizeof binoperstr / sizeof binoperstr[0]) ==
(sizeof op1 / sizeof op1[0]));
for (i = 0; i < sizeof op1 / sizeof op1[0]; i++)
for (i = 0; i < (int)(sizeof op1 / sizeof op1[0]); i++)
{
if (oper == op1[i])
{
@ -186,7 +186,7 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam,
(sizeof unopers / sizeof unopers[0]));
if (opername[0] == '\0')
{
for (i = 0; i < sizeof unopers / sizeof unopers[0]; i++)
for (i = 0; i < (int)(sizeof unopers / sizeof unopers[0]); i++)
{
if (oper == unopers[i])
{

View File

@ -247,7 +247,7 @@ alignframe(int numbytes)
/* "numbytes" should be a power of 2 for this code to work */
int i, count = 0;
for (i = 0; i < sizeof numbytes * 8; i++)
for (i = 0; i < (int)(sizeof(numbytes) * 8); i++)
if (numbytes & (1 << i))
count++;
assert(count == 1);

View File

@ -665,7 +665,7 @@ assemble(FILE * fout, FILE * fin)
* for a non-existent opcode)
*/
assert(opcodelist[1].name != NULL);
for (i = 2; i < (sizeof opcodelist / sizeof opcodelist[0]); i++)
for (i = 2; i < (int)(sizeof(opcodelist) / sizeof(opcodelist[0])); i++)
{
assert(opcodelist[i].name != NULL);
assert(strcasecmp(opcodelist[i].name, opcodelist[i - 1].name) > 0);

View File

@ -402,16 +402,16 @@ phopt_init(void)
len =
strexpand(str, (unsigned char *)sequences_cmp[i].find, sizeof str,
SCPACK_TABLE);
assert(len <= sizeof str);
assert(len == (int)strlen(str) + 1);
assert(len <= (int)(sizeof(str)));
assert(len == (int)(strlen(str) + 1));
sequences[i].find = (char *)malloc(len);
if (sequences[i].find)
strcpy(sequences[i].find, str);
len =
strexpand(str, (unsigned char *)sequences_cmp[i].replace, sizeof str,
SCPACK_TABLE);
assert(len <= sizeof str);
assert(len == (int)strlen(str) + 1);
assert(len <= (int)(sizeof(str)));
assert(len == (int)(strlen(str) + 1));
sequences[i].replace = (char *)malloc(len);
if (sequences[i].replace)
strcpy(sequences[i].replace, str);

View File

@ -288,6 +288,6 @@ delete_substtable(void)
int i;
delete_stringpairtable(&substpair);
for (i = 0; i < sizeof substindex / sizeof substindex[0]; i++)
for (i = 0; i < (int)(sizeof(substindex) / sizeof(substindex[0])); i++)
substindex[i] = NULL;
}