Commit 2c54cf2e authored by Masaki Muranaka's avatar Masaki Muranaka

Add comments for paradnoid (a.k.a. mission critical) engineers.

parent e1d2f50e
......@@ -3399,11 +3399,14 @@ scan_oct(const int *start, int len, int *retlen)
const int *s = start;
unsigned long retval = 0;
/* PARANOID: assert(len <= 3) */
while (len-- && *s >= '0' && *s <= '7') {
retval <<= 3;
retval |= *s++ - '0';
}
*retlen = s - start;
return retval;
}
......@@ -3415,12 +3418,15 @@ scan_hex(const int *start, int len, int *retlen)
register unsigned long retval = 0;
char *tmp;
/* PARANOID: assert(len <= 2) */
while (len-- && *s && (tmp = strchr(hexdigit, *s))) {
retval <<= 4;
retval |= (tmp - hexdigit) & 15;
s++;
}
*retlen = s - start;
return retval;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment