} /* 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 */
} /* 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)
{
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';
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';
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';
{
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])
{
(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])
{
/* "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);
* 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);
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);
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;
}