Index: icon/src/xpm/data.c =================================================================== --- icon.orig/src/xpm/data.c 2013-01-28 18:48:50.560689916 +0000 +++ icon/src/xpm/data.c 2013-01-28 19:08:40.943484565 +0000 @@ -8,11 +8,6 @@ * Developed by Arnaud Le Hors * \*****************************************************************************/ -/* Official version number */ -static char *RCS_Version = "$XpmVersion: 3.2c $"; - -/* Internal version number */ -static char *RCS_Id = "$Id: xpm.shar,v 3.13 1992/12/29 16:05:26 lehors Exp $"; #include "xpmP.h" #ifdef VMS @@ -23,7 +18,6 @@ #include #endif -FUNC(atoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return)); LFUNC(ParseComment, int, (xpmData *mdata)); unsigned int @@ -105,12 +99,13 @@ ungetc(*s, file); } } + return 0; } /* * skip to the end of the current string and the beginning of the next one */ -xpmNextString(mdata) +int xpmNextString(mdata) xpmData *mdata; { if (!mdata->type) @@ -136,6 +131,7 @@ ungetc(c, file); } } + return 0; } @@ -208,7 +204,7 @@ while (isspace(c = *mdata->cptr) && c != mdata->Eos) mdata->cptr++; start = mdata->cptr; - while (c = *mdata->cptr) + while ((c = *mdata->cptr)) mdata->cptr++; n = mdata->cptr - start + 1; p = (char *) malloc(n); @@ -277,7 +273,7 @@ /* * get the current comment line */ -xpmGetCmt(mdata, cmt) +int xpmGetCmt(mdata, cmt) xpmData *mdata; char **cmt; { @@ -291,6 +287,7 @@ mdata->CommentLength = 0; } else *cmt = NULL; + return 0; } /* @@ -403,7 +400,7 @@ /* * close the file related to the xpmData if any */ -XpmDataClose(mdata) +int XpmDataClose(mdata) xpmData *mdata; { switch (mdata->type) { @@ -419,4 +416,5 @@ break; #endif } + return 0; } Index: icon/src/xpm/create.c =================================================================== --- icon.orig/src/xpm/create.c 2013-01-28 18:48:50.560747560 +0000 +++ icon/src/xpm/create.c 2013-01-28 19:08:40.947269453 +0000 @@ -260,7 +260,7 @@ for (l = 0, cs = colorsymbols; l < numsymbols; l++, cs++) if ((!cs->name && cs->value && cts[cts_index] && !strcasecmp(cs->value,cts[cts_index])) || - cs->name && !strcmp(cs->name, s)) + (cs->name && !strcmp(cs->name, s))) break; if (l != numsymbols) { if (cs->name && cs->value) @@ -344,7 +344,7 @@ #endif -xpmCreateImage(display, attrib, image_return, shapeimage_return, attributes) +int xpmCreateImage(display, attrib, image_return, shapeimage_return, attributes) Display *display; xpmInternAttrib *attrib; XImage **image_return; @@ -414,8 +414,8 @@ ErrorStatus = CreateColors(display, attributes, attrib->colorTable, attrib->ncolors, image_pixels, mask_pixels, &mask_pixel, &pixels, &npixels); - if (ErrorStatus != XpmSuccess && (ErrorStatus < 0 || attributes && - (attributes->valuemask & XpmExactColors) && attributes->exactColors)) + if ((ErrorStatus != XpmSuccess) && (ErrorStatus < 0 || (attributes && + (attributes->valuemask & XpmExactColors) && attributes->exactColors))) RETURN(ErrorStatus); /* Index: icon/src/xpm/misc.c =================================================================== --- icon.orig/src/xpm/misc.c 2013-01-28 18:48:50.560638791 +0000 +++ icon/src/xpm/misc.c 2013-01-28 19:08:40.950369742 +0000 @@ -14,7 +14,7 @@ * Free the computed color table */ -xpmFreeColorTable(colorTable, ncolors) +int xpmFreeColorTable(colorTable, ncolors) char ***colorTable; int ncolors; { @@ -31,6 +31,7 @@ } free(colorTable); } + return 0; } @@ -39,7 +40,7 @@ * which ones must be freed later on. */ -xpmInitInternAttrib(attrib) +int xpmInitInternAttrib(attrib) xpmInternAttrib *attrib; { attrib->ncolors = 0; @@ -48,6 +49,7 @@ attrib->xcolors = NULL; attrib->colorStrings = NULL; attrib->mask_pixel = UNDEF_PIXEL; + return 0; } @@ -55,7 +57,7 @@ * Free the xpmInternAttrib pointers which have been allocated */ -xpmFreeInternAttrib(attrib) +int xpmFreeInternAttrib(attrib) xpmInternAttrib *attrib; { unsigned int a, ncolors; @@ -74,13 +76,14 @@ free(*sptr); free(attrib->colorStrings); } + return 0; } /* * Free array of extensions */ -XpmFreeExtensions(extensions, nextensions) +int XpmFreeExtensions(extensions, nextensions) XpmExtension *extensions; int nextensions; { @@ -101,6 +104,7 @@ } free(extensions); } + return 0; } @@ -108,7 +112,7 @@ * Return the XpmAttributes structure size */ -XpmAttributesSize() +int XpmAttributesSize() { return sizeof(XpmAttributes); } @@ -119,7 +123,7 @@ * but the structure itself */ -XpmFreeAttributes(attributes) +int XpmFreeAttributes(attributes) XpmAttributes *attributes; { if (attributes) { @@ -159,6 +163,7 @@ } attributes->valuemask = 0; } + return 0; } @@ -167,7 +172,7 @@ * the xpmInternAttrib structure. */ -xpmSetAttributes(attrib, attributes) +int xpmSetAttributes(attrib, attributes) xpmInternAttrib *attrib; XpmAttributes *attributes; { @@ -184,6 +189,7 @@ attributes->height = attrib->height; attributes->valuemask |= XpmSize; } + return 0; } #ifdef NEED_STRDUP Index: icon/src/xpm/parse.c =================================================================== --- icon.orig/src/xpm/parse.c 2013-01-28 18:48:50.560801268 +0000 +++ icon/src/xpm/parse.c 2013-01-28 19:08:40.953095572 +0000 @@ -136,7 +136,7 @@ /* * parse extensions */ - if (attributes && (attributes->valuemask & XpmReturnExtensions)) + if (attributes && (attributes->valuemask & XpmReturnExtensions)) { if (extensions) { ErrorStatus = ParseExtensions(data, &attributes->extensions, &attributes->nextensions); @@ -146,6 +146,7 @@ attributes->extensions = NULL; attributes->nextensions = 0; } + } /* * store found informations in the xpmInternAttrib structure @@ -265,7 +266,7 @@ */ curkey = 0; lastwaskey = 0; - while (l = xpmNextWord(data, buf)) { + while ((l = xpmNextWord(data, buf))) { if (!lastwaskey) { for (key = 0, sptr = xpmColorKeys; key < NKEYS; key++, sptr++) if ((strlen(*sptr) == l) && (!strncmp(*sptr, buf, l))) @@ -338,7 +339,7 @@ bzero(colidx, 256 * sizeof(short)); for (a = 0; a < ncolors; a++) - colidx[ colorTable[a][0][0] ] = a + 1; + colidx[(size_t) colorTable[a][0][0] ] = a + 1; for (y = 0; y < height; y++) { @@ -363,7 +364,7 @@ bzero(cidx, 256*256 * sizeof(short)); for (a = 0; a < ncolors; a++) - cidx [ colorTable[a][0][0] ][ colorTable[a][0][1] ] = a + 1; + cidx [(size_t) colorTable[a][0][0] ][(size_t) colorTable[a][0][1] ] = a + 1; for (y = 0; y < height; y++) { Index: icon/src/xpm/xpmP.h =================================================================== --- icon.orig/src/xpm/xpmP.h 2013-01-28 18:48:50.560850152 +0000 +++ icon/src/xpm/xpmP.h 2013-01-28 19:08:40.955816887 +0000 @@ -173,6 +173,7 @@ /* I/O utility */ +FUNC(xpmGetString, int, (xpmData * mdata, char **sptr, unsigned int *l)); FUNC(xpmNextString, int, (xpmData * mdata)); FUNC(xpmNextUI, int, (xpmData * mdata, unsigned int *ui_return)); @@ -276,4 +277,6 @@ FUNC(strdup, char *, (char *s1)); #endif +FUNC(atoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return)); + #endif Index: icon/src/xpm/XpmWrFFrI.c =================================================================== --- icon.orig/src/xpm/XpmWrFFrI.c 2013-01-28 18:48:50.560591340 +0000 +++ icon/src/xpm/XpmWrFFrI.c 2013-01-28 19:08:40.958310424 +0000 @@ -63,7 +63,7 @@ else name++; #endif - if (dot = index(name, '.')) { + if ((dot = index(name, '.'))) { new_name = (char*)strdup(name); if (!new_name) { new_name = NULL; @@ -71,7 +71,7 @@ } else { /* change '.' to '_' to get a valid C syntax name */ name = s = new_name; - while (dot = index(s, '.')) { + while ((dot = index(s, '.'))) { *dot = '_'; s = dot; } @@ -206,7 +206,7 @@ if (colorTable && mask_pixel != UNDEF_PIXEL) { for (key = 1; key <= NKEYS; key++) { - if (s = colorTable[mask_pixel][key]) + if ((s = colorTable[mask_pixel][key])) fprintf(file, "\t%s %s", xpmColorKeys[key - 1], s); } } else @@ -258,7 +258,7 @@ if (b != ncolors2) { c = 0; for (key = 1; key <= NKEYS; key++) { - if (s = colorTable[b][key]) + if ((s = colorTable[b][key])) fprintf(file, "\t%s %s", xpmColorKeys[key - 1], s); } } Index: icon/src/rtt/rttdb.c =================================================================== --- icon.orig/src/rtt/rttdb.c 2013-01-28 19:02:21.936306598 +0000 +++ icon/src/rtt/rttdb.c 2013-01-28 19:08:40.969697764 +0000 @@ -1028,11 +1028,12 @@ fprintf(db, "e"); /* can do error conversion */ else fprintf(db, "_"); /* cannot do error conversion */ - if (may_fthru) /* body functions only: */ + if (may_fthru) { /* body functions only: */ if (flag & DoesFThru) fprintf(db, "t"); /* can fall through */ else fprintf(db, "_"); /* cannot fall through */ + } fprintf(db, " "); } Index: icon/src/preproc/bldtok.c =================================================================== --- icon.orig/src/preproc/bldtok.c 2013-01-28 18:48:50.560925838 +0000 +++ icon/src/preproc/bldtok.c 2013-01-28 19:08:40.975520305 +0000 @@ -212,7 +212,7 @@ /* * Look ahead to see if a ## operator is next. */ - if (*next_char == '#' && next_char[1] == '#') + if (*next_char == '#' && next_char[1] == '#') { if (tok_id == PpDirEnd) errt1(t, "## expressions must not cross directive boundaries"); else { @@ -222,6 +222,7 @@ free_t(t); return NULL; } + } return t; } @@ -365,7 +366,7 @@ * for white space to discard. */ cs->dir_state = Within; - if ((t1 = chck_wh_sp(cs)) != NULL) + if ((t1 = chck_wh_sp(cs)) != NULL) { if (t1->tok_id == PpDirEnd) { /* * We found a new-line, this is a null preprocessor directive. @@ -376,6 +377,7 @@ } else free_t(t1); /* discard white space */ + } c = *next_char; if (islower(c) || isupper(c) || c == '_') { /* @@ -399,11 +401,12 @@ * A header name has to be tokenized specially. Find * it, then save the token. */ - if ((t2 = chck_wh_sp(cs)) != NULL) + if ((t2 = chck_wh_sp(cs)) != NULL) { if (t2->tok_id == PpDirEnd) errt1(t2, "file name missing from #include"); else free_t(t2); + } c = *next_char; if (c == '"') cs->tok_sav = hdr_tok('"', StrLit, cs); @@ -752,12 +755,13 @@ /* * The operand must be in the same preprocessing directive. */ - if ((t2 = chck_wh_sp(cs)) != NULL) + if ((t2 = chck_wh_sp(cs)) != NULL) { if (t2->tok_id == PpDirEnd) errt2(t2, t1->image, " preprocessing expression must not cross directive boundary"); else free_t(t2); + } return t1; default: Index: icon/src/preproc/macro.c =================================================================== --- icon.orig/src/preproc/macro.c 2013-01-28 18:48:50.560876838 +0000 +++ icon/src/preproc/macro.c 2013-01-28 19:08:40.978091646 +0000 @@ -270,7 +270,7 @@ static char buf[20]; m = *m_find(id->image); - if (m != NULL && m->category == SpecMac) + if (m != NULL && m->category == SpecMac) { if (m->mname == line_mac) { /* __LINE___ */ sprintf(buf, "%d", id->line); m->body = new_t_lst(new_token(PpNumber, buf, id->fname, @@ -279,6 +279,7 @@ else if (m->mname == file_mac) /* __FILE__ */ m->body = new_t_lst(new_token(StrLit, id->fname, id->fname, id->line)); + } return m; } Index: icon/ipl/cfuncs/icall.h =================================================================== --- icon.orig/ipl/cfuncs/icall.h 2013-01-28 19:02:21.860442103 +0000 +++ icon/ipl/cfuncs/icall.h 2013-01-28 19:08:41.001319232 +0000 @@ -97,6 +97,7 @@ #include #include +#include #if INT_MAX == 32767 #define WordSize 16