static char *
skipwhitespace(char *str)
{
- while (isspace(*str))
+ while (sc_isspace(*str))
str++;
return str;
}
write_encoded(FILE * fbin, ucell * c, int num)
{
assert(sizeof(cell) <= 4); /* code must be adjusted for larger cells */
- assert(!!fbin);
+ assert(fbin != NULL);
while (num-- > 0)
{
if (sc_compress)
if (fbin)
write_encoded(fbin, &p, 1);
num++;
- while (isspace(*params))
+ while (sc_isspace(*params))
params++;
} /* while */
return num * sizeof(cell);
symbol *sym;
ucell p;
- for (i = 0; !isspace(*params); i++, params++)
+ for (i = 0; !sc_isspace(*params); i++, params++)
{
assert(*params != '\0');
assert(i < sNAMEMAX);
* already have been set (in order for static globals to be found).
*/
sym = findglb(name);
- assert(!!sym);
+ assert(sym != NULL);
assert(sym->ident == iFUNCTN || sym->ident == iREFFUNC);
assert(sym->vclass == sGLOBAL);
if (fbin)
{
- assert(!!lbltab);
+ assert(lbltab != NULL);
p = lbltab[i];
write_encoded(fbin, (ucell *) & opcode, 1);
write_encoded(fbin, &p, 1);
p = hex2long(params, ¶ms);
/* remove leading and trailing white space from the filename */
- while (isspace(*params))
+ while (sc_isspace(*params))
params++;
len = strlen(params);
- while (len > 0 && isspace(params[len - 1]))
+ while (len > 0 && sc_isspace(params[len - 1]))
len--;
params[len++] = '\0'; /* zero-terminate */
while (len % sizeof(cell) != 0)
int len;
unsigned char mclass, type;
- for (endptr = params; !isspace(*endptr) && endptr != '\0'; endptr++)
+ for (endptr = params; !sc_isspace(*endptr) && endptr != '\0'; endptr++)
/* nothing */ ;
assert(*endptr == ' ');
if (fbin)
{
- assert(!!lbltab);
+ assert(lbltab != NULL);
p = lbltab[i];
write_encoded(fbin, (ucell *) & opcode, 1);
write_encoded(fbin, &p, 1);
if (fbin)
{
- assert(!!lbltab);
+ assert(lbltab != NULL);
p = lbltab[i];
write_encoded(fbin, &v, 1);
write_encoded(fbin, &p, 1);
while (low < high)
{
mid = (low + high) / 2;
- assert(!!opcodelist[mid].name);
+ assert(opcodelist[mid].name != NULL);
cmp = strcasecmp(str, opcodelist[mid].name);
if (cmp > 0)
low = mid + 1;
#if !defined NDEBUG
/* verify that the opcode list is sorted (skip entry 1; it is reserved
- * for a non-existant opcode)
+ * for a non-existent opcode)
*/
- assert(!!opcodelist[1].name);
- for (i = 2; i < (sizeof opcodelist / sizeof opcodelist[0]); i++)
+ assert(opcodelist[1].name != NULL);
+ for (i = 2; i < (int)(sizeof(opcodelist) / sizeof(opcodelist[0])); i++)
{
- assert(!!opcodelist[i].name);
+ assert(opcodelist[i].name != NULL);
assert(strcasecmp(opcodelist[i].name, opcodelist[i - 1].name) > 0);
} /* for */
#endif
char alias[sNAMEMAX + 1];
sym = nativelist[i];
- assert(!!sym);
+ assert(sym != NULL);
if (!lookup_alias(alias, sym->name))
{
assert(strlen(sym->name) <= sNAMEMAX);
/* get to the end of the instruction (make use of the '\n' that fgets()
* added at the end of the line; this way we will *always* drop on a
* whitespace character) */
- for (params = instr; *params != '\0' && !isspace(*params);
+ for (params = instr; *params != '\0' && !sc_isspace(*params);
params++)
/* nothing */ ;
assert(params > instr);
/* get to the end of the instruction (make use of the '\n' that fgets()
* added at the end of the line; this way we will *always* drop on a
* whitespace character) */
- for (params = instr; *params != '\0' && !isspace(*params);
+ for (params = instr; *params != '\0' && !sc_isspace(*params);
params++)
/* nothing */ ;
assert(params > instr);
i = findopcode(instr, (int)(params - instr));
- assert(!!opcodelist[i].name);
+ assert(opcodelist[i].name != NULL);
if (opcodelist[i].segment == pass)
opcodelist[i].func(fout, skipwhitespace(params),
opcodelist[i].opcode);