Skip to content
Snippets Groups Projects
Commit a148eb03 authored by Anders Lindh Olsson's avatar Anders Lindh Olsson :8ball:
Browse files

Minor linting fixes

parent 1064b609
No related branches found
No related tags found
No related merge requests found
...@@ -160,11 +160,11 @@ static int startsWith(const char *p, const char *s) { ...@@ -160,11 +160,11 @@ static int startsWith(const char *p, const char *s) {
static int parseOp(const char **pp) { static int parseOp(const char **pp) {
const char *p = *pp; const char *p = *pp;
int o, l;
skipSpace(p); skipSpace(p);
if (ispunct((unsigned char)*p)) { if (ispunct((unsigned char)*p)) {
for (o = 1; o < (int)(sizeof(ops) / sizeof(ops[0])); o++) { for (int o = 1; o < (int)(sizeof(ops) / sizeof(ops[0])); o++) {
int l;
if ((l = startsWith(p, ops[o].str))) { if ((l = startsWith(p, ops[o].str))) {
/* operator found */ /* operator found */
*pp = p + l; *pp = p + l;
...@@ -179,7 +179,7 @@ static int parseSubExpr(const char **pp, long *v, int pr, int o) { ...@@ -179,7 +179,7 @@ static int parseSubExpr(const char **pp, long *v, int pr, int o) {
const char *p = *pp; const char *p = *pp;
long val = o ? *v : 0; long val = o ? *v : 0;
long val2; long val2;
int o2 = o; int o2;
if (exprDebug) if (exprDebug)
printf("parseExpr(%d): start %ld %s \"%s\"\n", pr, val, ops[o].str, p); printf("parseExpr(%d): start %ld %s \"%s\"\n", pr, val, ops[o].str, p);
...@@ -322,10 +322,10 @@ static int parseSubExpr(const char **pp, long *v, int pr, int o) { ...@@ -322,10 +322,10 @@ static int parseSubExpr(const char **pp, long *v, int pr, int o) {
static const char *getFormat(const char **pp) { static const char *getFormat(const char **pp) {
static char format[20]; static char format[20];
const char *p = *pp; const char *p = *pp;
unsigned int i = 1;
if (exprDebug) if (exprDebug)
printf("getFormat %s\n", p); printf("getFormat %s\n", p);
if ((format[0] = *p++) == '%') { if ((format[0] = *p++) == '%') {
unsigned int i = 1;
while (i < sizeof(format) && memchr(" #-+0", *p, 5)) while (i < sizeof(format) && memchr(" #-+0", *p, 5))
format[i++] = *p++; format[i++] = *p++;
while (i < sizeof(format) && *p >= '0' && *p <= '9') while (i < sizeof(format) && *p >= '0' && *p <= '9')
...@@ -334,7 +334,7 @@ static const char *getFormat(const char **pp) { ...@@ -334,7 +334,7 @@ static const char *getFormat(const char **pp) {
format[i++] = 'l'; format[i++] = 'l';
if (i < sizeof(format) && memchr("diouxXc", *p, 7)) { if (i < sizeof(format) && memchr("diouxXc", *p, 7)) {
format[i++] = *p++; format[i++] = *p++;
format[i] = 0; format[i] = 0; // FIXME (alo): not our memory!
*pp = p; *pp = p;
if (exprDebug) if (exprDebug)
printf("format = '%s'\n", format); printf("format = '%s'\n", format);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment