diff options
author | Tor Lillqvist <tlillqvist@novell.com> | 2011-02-02 23:49:51 +0200 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@novell.com> | 2011-02-03 00:44:31 +0200 |
commit | 6ade6fe1e657b1c8092f6a6c18a4c7776590973d (patch) | |
tree | c29a4df98e890f2bb0500b0b4941391f2be27136 /soltools | |
parent | Silence a couple of compiler warnings (diff) | |
download | core-6ade6fe1e657b1c8092f6a6c18a4c7776590973d.tar.gz core-6ade6fe1e657b1c8092f6a6c18a4c7776590973d.zip |
Silence compiler warnings
Diffstat (limited to 'soltools')
-rw-r--r-- | soltools/cpp/_cpp.c | 2 | ||||
-rw-r--r-- | soltools/cpp/_eval.c | 3 | ||||
-rw-r--r-- | soltools/cpp/_lex.c | 2 | ||||
-rw-r--r-- | soltools/cpp/_macro.c | 8 | ||||
-rw-r--r-- | soltools/cpp/_tokens.c | 22 | ||||
-rw-r--r-- | soltools/cpp/_unix.c | 4 | ||||
-rw-r--r-- | soltools/cpp/cpp.h | 10 |
7 files changed, 26 insertions, 25 deletions
diff --git a/soltools/cpp/_cpp.c b/soltools/cpp/_cpp.c index d639c684d8f3..c1a2d7f81b40 100644 --- a/soltools/cpp/_cpp.c +++ b/soltools/cpp/_cpp.c @@ -299,7 +299,7 @@ void } void * - domalloc(int size) + domalloc(size_t size) { void *p = malloc(size); diff --git a/soltools/cpp/_eval.c b/soltools/cpp/_eval.c index 46a990be71e1..c33ef690d1c9 100644 --- a/soltools/cpp/_eval.c +++ b/soltools/cpp/_eval.c @@ -234,7 +234,8 @@ long { Token *tp; Nlist *np; - int ntok, rnd; + size_t ntok; + int rnd; trp->tp++; if (kw == KIFDEF || kw == KIFNDEF) diff --git a/soltools/cpp/_lex.c b/soltools/cpp/_lex.c index ffbc54a26915..452de6c779b1 100644 --- a/soltools/cpp/_lex.c +++ b/soltools/cpp/_lex.c @@ -635,7 +635,7 @@ Source * setsource(char *name, int path, int fd, char *str, int wrap) { Source *s = new(Source); - int len; + size_t len; s->line = 1; s->lineinc = 0; diff --git a/soltools/cpp/_macro.c b/soltools/cpp/_macro.c index d1775c6a1f64..1541dd80a581 100644 --- a/soltools/cpp/_macro.c +++ b/soltools/cpp/_macro.c @@ -516,7 +516,7 @@ void error(ERROR, "# not followed by macro parameter"); continue; } - ntok = 1 + (rtr->tp - tp); + ntok = 1 + (int)(rtr->tp - tp); rtr->tp = tp; insertrow(rtr, ntok, stringify(atr[argno])); continue; @@ -554,7 +554,7 @@ void { Token *ltp, *ntp; Tokenrow ntr; - int len; + size_t len; for (trp->tp = trp->bp; trp->tp < trp->lp; trp->tp++) { @@ -617,7 +617,7 @@ void doconcat(&ntr); trp->tp = ltp; makespace(&ntr, ltp); - insertrow(trp, ntp - ltp, &ntr); + insertrow(trp, (int)(ntp - ltp), &ntr); dofree(ntr.bp); trp->tp--; } @@ -639,7 +639,7 @@ int for (ap = mac->ap->bp; ap < mac->ap->lp; ap++) { if (ap->len == tp->len && strncmp((char *) ap->t, (char *) tp->t, ap->len) == 0) - return ap - mac->ap->bp; + return (int)(ap - mac->ap->bp); } return -1; } diff --git a/soltools/cpp/_tokens.c b/soltools/cpp/_tokens.c index 12a51fddd9d5..00849d9006c2 100644 --- a/soltools/cpp/_tokens.c +++ b/soltools/cpp/_tokens.c @@ -194,8 +194,8 @@ void Token * growtokenrow(Tokenrow * trp) { - int ncur = trp->tp - trp->bp; - int nlast = trp->lp - trp->bp; + size_t ncur = trp->tp - trp->bp; + size_t nlast = trp->lp - trp->bp; trp->max = 3 * trp->max / 2 + 1; trp->bp = (Token *) realloc(trp->bp, trp->max * sizeof(Token)); @@ -235,7 +235,7 @@ int void insertrow(Tokenrow * dtr, int ntok, Tokenrow * str) { - int nrtok = rowlen(str); + int nrtok = (int)rowlen(str); dtr->tp += ntok; adjustrow(dtr, nrtok - ntok); @@ -274,7 +274,7 @@ void void movetokenrow(Tokenrow * dtr, Tokenrow * str) { - int nby; + size_t nby; /* nby = sizeof(Token) * (str->lp - str->bp); */ nby = (char *) str->lp - (char *) str->bp; @@ -290,7 +290,7 @@ void void adjustrow(Tokenrow * trp, int nt) { - int nby, size; + size_t nby, size; if (nt == 0) return; @@ -311,7 +311,7 @@ void Tokenrow * copytokenrow(Tokenrow * dtr, Tokenrow * str) { - int len = rowlen(str); + int len = (int)rowlen(str); maketokenrow(len, dtr); movetokenrow(dtr, str); @@ -331,7 +331,7 @@ Tokenrow * Tokenrow *ntrp = new(Tokenrow); int len; - len = trp->lp - trp->tp; + len = (int)(trp->lp - trp->tp); if (len <= 0) len = 1; maketokenrow(len, ntrp); @@ -396,7 +396,7 @@ void { if (tp->type != NL) { - len = tp->len + tp->wslen; + len = (int)(tp->len + tp->wslen); p = tp->t - tp->wslen; /* add parameter check to delete operator? */ @@ -410,7 +410,7 @@ void if( ntp->type == NAME ) { uchar* np = ntp->t - ntp->wslen; - int nlen = ntp->len + ntp->wslen; + int nlen = (int)(ntp->len + ntp->wslen); memcpy(wbp, "if(", 3 ); wbp += 4; @@ -492,7 +492,7 @@ void { if (wbp > wbuf) { - if ( write(1, wbuf, wbp - wbuf) != -1) + if ( write(1, wbuf, (int)(wbp - wbuf)) != -1) wbp = wbuf; else exit(1); @@ -527,7 +527,7 @@ char * * Null terminated. */ uchar * - newstring(uchar * s, int l, int o) + newstring(uchar * s, size_t l, size_t o) { uchar *ns = (uchar *) domalloc(l + o + 1); diff --git a/soltools/cpp/_unix.c b/soltools/cpp/_unix.c index d3d55a67aff9..e6aed77b89cb 100644 --- a/soltools/cpp/_unix.c +++ b/soltools/cpp/_unix.c @@ -135,7 +135,7 @@ void case 'w': dp = &optarg[n + 1]; - n += strlen(dp); + n += (int)strlen(dp); while (isspace(*dp)) dp++; for (i = NINCLUDE - 1; i >= 0; i--) @@ -173,7 +173,7 @@ void { if ((fp = strrchr(argv[optind], '/')) != NULL) { - int len = fp - argv[optind]; + int len = (int)(fp - argv[optind]); dp = (char *) newstring((uchar *) argv[optind], len + 1, 0); dp[len] = '\0'; diff --git a/soltools/cpp/cpp.h b/soltools/cpp/cpp.h index d6efb21319a0..3c44f90ea7ca 100644 --- a/soltools/cpp/cpp.h +++ b/soltools/cpp/cpp.h @@ -54,8 +54,8 @@ typedef struct token { unsigned char type; unsigned char flag; - unsigned int wslen; - unsigned int len; + size_t wslen; + size_t len; uchar *t; unsigned int identifier; /* used from macro processor to identify where a macro becomes valid again. */ } Token; @@ -87,7 +87,7 @@ typedef struct nlist { struct nlist *next; uchar *name; - int len; + size_t len; Tokenrow *vp; /* value as macro */ Tokenrow *ap; /* list of argument names, if any */ char val; /* value as preprocessor name */ @@ -174,7 +174,7 @@ Source *setsource(char *, int, int, char *, int); void unsetsource(void); void puttokens(Tokenrow *); void process(Tokenrow *); -void *domalloc(int); +void *domalloc(size_t); void dofree(void *); void error(enum errtype, char *,...); void flushout(void); @@ -211,7 +211,7 @@ void setempty(Tokenrow *); void makespace(Tokenrow *, Token *); char *outnum(char *, int); int digit(int); -uchar *newstring(uchar *, int, int); +uchar *newstring(uchar *, size_t, size_t); #define rowlen(tokrow) ((tokrow)->lp - (tokrow)->bp) |