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 */ } /* if */
ext_idx++; ext_idx++;
} }
while (!fp && ext_idx < (sizeof extensions / sizeof extensions[0])); while ((!fp) &&
(ext_idx < (int)(sizeof extensions / sizeof extensions[0])));
if (!fp) if (!fp)
{ {
*ext = '\0'; /* restore filename */ *ext = '\0'; /* restore filename */
@ -197,11 +198,11 @@ doinclude(void)
} /* if */ } /* if */
i = 0; 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++; name[i++] = *lptr++;
while (i > 0 && name[i - 1] <= ' ') while (i > 0 && name[i - 1] <= ' ')
i--; /* strip trailing whitespace */ i--; /* strip trailing whitespace */
assert(i >= 0 && i < sizeof name); assert((i >= 0) && (i < (int)(sizeof(name))));
name[i] = '\0'; /* zero-terminate the string */ name[i] = '\0'; /* zero-terminate the string */
if (*lptr != c) if (*lptr != c)
@ -989,7 +990,9 @@ command(void)
{ {
int i; int i;
for (i = 0; i < sizeof name && alphanum(*lptr); for (i = 0;
(i < (int)(sizeof(name))) &&
(alphanum(*lptr));
i++, lptr++) i++, lptr++)
name[i] = *lptr; name[i] = *lptr;
name[i] = '\0'; name[i] = '\0';
@ -1022,9 +1025,11 @@ command(void)
int i; int i;
/* first gather all information, start with the tag name */ /* first gather all information, start with the tag name */
while (*lptr <= ' ' && *lptr != '\0') while ((*lptr <= ' ') && (*lptr != '\0'))
lptr++; lptr++;
for (i = 0; i < sizeof name && alphanum(*lptr); for (i = 0;
(i < (int)(sizeof(name))) &&
(alphanum(*lptr));
i++, lptr++) i++, lptr++)
name[i] = *lptr; name[i] = *lptr;
name[i] = '\0'; name[i] = '\0';
@ -1084,9 +1089,11 @@ command(void)
do do
{ {
/* get the name */ /* get the name */
while (*lptr <= ' ' && *lptr != '\0') while ((*lptr <= ' ') && (*lptr != '\0'))
lptr++; lptr++;
for (i = 0; i < sizeof name && isalpha(*lptr); for (i = 0;
(i < (int)(sizeof(name))) &&
(isalpha(*lptr));
i++, lptr++) i++, lptr++)
name[i] = *lptr; name[i] = *lptr;
name[i] = '\0'; 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]) == assert((sizeof binoperstr / sizeof binoperstr[0]) ==
(sizeof op1 / sizeof op1[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]) if (oper == op1[i])
{ {
@ -186,7 +186,7 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam,
(sizeof unopers / sizeof unopers[0])); (sizeof unopers / sizeof unopers[0]));
if (opername[0] == '\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]) 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 */ /* "numbytes" should be a power of 2 for this code to work */
int i, count = 0; 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)) if (numbytes & (1 << i))
count++; count++;
assert(count == 1); assert(count == 1);

View File

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

View File

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

View File

@ -288,6 +288,6 @@ delete_substtable(void)
int i; int i;
delete_stringpairtable(&substpair); 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; substindex[i] = NULL;
} }