Avoid 38 gcc-3.4.2 warnings: suggest parentheses around assignment used as truth value suggest explicit braces to avoid ambiguous `else' suggest parentheses around && within || suggest parentheses around arithmetic in operand of ^ "/*" within comment FIXME: suggest parentheses around && within || in xc/extras/ttf2pt1/ft.c:629 diff -ur -N XOrg-6.8.2.orig/xc/extras/ttf2pt1/ft.c XOrg-6.8.2/xc/extras/ttf2pt1/ft.c --- XOrg-6.8.2.orig/xc/extras/ttf2pt1/ft.c 2004-04-23 20:42:57.000000000 +0200 +++ XOrg-6.8.2/xc/extras/ttf2pt1/ft.c 2005-03-23 17:52:21.000000000 +0100 @@ -611,7 +611,7 @@ for(i=0; fm->name_ps[i]!=0; i++) if(fm->name_ps[i] == ' ') - fm->name_ps[i] = '_'; /* no spaces in the Postscript name *m + fm->name_ps[i] = '_'; /* no spaces in the Postscript name *m */ /* guess the boldness from the font names */ fm->force_bold=0; diff -ur -N XOrg-6.8.2.orig/xc/extras/ttf2pt1/pt1.c XOrg-6.8.2/xc/extras/ttf2pt1/pt1.c --- XOrg-6.8.2.orig/xc/extras/ttf2pt1/pt1.c 2004-04-23 20:42:57.000000000 +0200 +++ XOrg-6.8.2/xc/extras/ttf2pt1/pt1.c 2005-03-23 18:23:25.000000000 +0100 @@ -779,8 +779,8 @@ dx = x2 - x1; dy = y2 - y1; - if (dx == 0 && dy == 0 - || x2 == x3 && y2 == y3) { + if ((dx == 0 && dy == 0) + || (x2 == x3 && y2 == y3)) { /* Oops, we actually have a straight line */ /* * if it's small, we hope that it will get optimized @@ -1396,7 +1396,7 @@ continue; ge = xge->prev; - if(ge == 0 || ge->type != GE_LINE && ge->type!= GE_CURVE) { + if(ge == 0 || (ge->type != GE_LINE && ge->type!= GE_CURVE)) { fprintf(stderr, "**! Glyph %s got empty path\n", g->name); exit(1); @@ -1604,8 +1604,8 @@ if (abs(dx1) <= 4 && abs(dx2) <= 4 && dy1 != 0 && 5 * abs(dx1) / abs(dy1) == 0 && dy2 != 0 && 5 * abs(dx2) / abs(dy2) == 0 - && (ge->iy3 < ge->prev->iy3 && ne->iy3 < ge->iy3 - || ge->iy3 > ge->prev->iy3 && ne->iy3 > ge->iy3) + && ((ge->iy3 < ge->prev->iy3 && ne->iy3 < ge->iy3) + || (ge->iy3 > ge->prev->iy3 && ne->iy3 > ge->iy3)) && (ge->ix3 - ge->prev->ix3) * (ne->ix3 - ge->ix3) < 0 ) { dir = igetcvdir(ge); @@ -1621,8 +1621,8 @@ else if (abs(dy1) <= 4 && abs(dy2) <= 4 && dx1 != 0 && 5 * abs(dy1) / abs(dx1) == 0 && dx2 != 0 && 5 * abs(dy2) / abs(dx2) == 0 - && (ge->ix3 < ge->prev->ix3 && ne->ix3 < ge->ix3 - || ge->ix3 > ge->prev->ix3 && ne->ix3 > ge->ix3) + && ((ge->ix3 < ge->prev->ix3 && ne->ix3 < ge->ix3) + || (ge->ix3 > ge->prev->ix3 && ne->ix3 > ge->ix3)) && (ge->iy3 - ge->prev->iy3) * (ne->iy3 - ge->iy3) < 0 ) { dir = igetcvdir(ge); @@ -1810,16 +1810,16 @@ if( (s[i].flags & ST_UP) == (s[j].flags & ST_UP) ) { if( s[i].flags & ST_UP ) { if( - (s[i].flags & (ST_ZONE|ST_FLAT|ST_END) ^ ST_FLAT) + ((s[i].flags & (ST_ZONE|ST_FLAT|ST_END)) ^ ST_FLAT) > - (s[j].flags & (ST_ZONE|ST_FLAT|ST_END) ^ ST_FLAT) + ((s[j].flags & (ST_ZONE|ST_FLAT|ST_END)) ^ ST_FLAT) ) continue; } else { if( - (s[i].flags & (ST_ZONE|ST_FLAT|ST_END) ^ ST_FLAT) + ((s[i].flags & (ST_ZONE|ST_FLAT|ST_END)) ^ ST_FLAT) < - (s[j].flags & (ST_ZONE|ST_FLAT|ST_END) ^ ST_FLAT) + ((s[j].flags & (ST_ZONE|ST_FLAT|ST_END)) ^ ST_FLAT) ) continue; } @@ -1841,8 +1841,8 @@ { int result; - if (s1->from <= s2->from && s1->to >= s2->from - || s2->from <= s1->from && s2->to >= s1->from) + if ((s1->from <= s2->from && s1->to >= s2->from) + || (s2->from <= s1->from && s2->to >= s1->from)) result = 1; else result = 0; @@ -2202,7 +2202,7 @@ else pri = 2; - if (pri < readystem && s[nnew + 1].value >= stack[j].value + if ((pri < readystem && s[nnew + 1].value >= stack[j].value) || !stemoverlap(&stack[j], &s[i])) continue; @@ -2757,8 +2757,8 @@ pri=2; if(lastpri==0 - || pri > lastpri - && ( lastpri==1 || s[j].value-v<20 || (s[x].value-v)*2 >= s[j].value-v ) ) { + || ( pri > lastpri + && ( lastpri==1 || s[j].value-v<20 || (s[x].value-v)*2 >= s[j].value-v ) ) ) { lastpri=pri; x=j; } @@ -2776,8 +2776,8 @@ pri=2; if(lastpri==0 - || pri > lastpri - && ( lastpri==1 || v-s[j].value<20 || (v-s[x].value)*2 >= v-s[j].value ) ) { + || ( pri > lastpri + && ( lastpri==1 || v-s[j].value<20 || (v-s[x].value)*2 >= v-s[j].value ) ) ) { lastpri=pri; x=j; } @@ -2930,7 +2930,7 @@ pri=0; wd=abs(sp[i].value-value); if( prevbest == -1 || pri >prevpri - || pri==prevpri && prevwd==0 || wd!=0 && wdiy3 > ge->iy2 && ge->iy3 > ny - || ge->iy3 < ge->iy2 && ge->iy3 < ny) { + if ((ge->iy3 > ge->iy2 && ge->iy3 > ny) + || (ge->iy3 < ge->iy2 && ge->iy3 < ny)) { hs[g->nhs].value = ge->iy3; hs[g->nhs].from = hs[g->nhs].to @@ -3509,8 +3509,8 @@ * vertical extremum */ /* check for horizontal extremums */ - if (ge->ix3 > ge->ix2 && ge->ix3 > nx - || ge->ix3 < ge->ix2 && ge->ix3 < nx) { + if ((ge->ix3 > ge->ix2 && ge->ix3 > nx) + || (ge->ix3 < ge->ix2 && ge->ix3 < nx)) { vs[g->nvs].value = ge->ix3; vs[g->nvs].from = vs[g->nvs].to @@ -3679,8 +3679,8 @@ continue; /* check for vertical extremums */ - if (ge->iy3 > ge->prev->iy3 && ge->iy3 > ny - || ge->iy3 < ge->prev->iy3 && ge->iy3 < ny) { + if ((ge->iy3 > ge->prev->iy3 && ge->iy3 > ny) + || (ge->iy3 < ge->prev->iy3 && ge->iy3 < ny)) { hs[g->nhs].value = ge->iy3; hs[g->nhs].from = hs[g->nhs].to @@ -3701,8 +3701,8 @@ * extremum */ /* check for horizontal extremums */ - if (ge->ix3 > ge->prev->ix3 && ge->ix3 > nx - || ge->ix3 < ge->prev->ix3 && ge->ix3 < nx) { + if ((ge->ix3 > ge->prev->ix3 && ge->ix3 > nx) + || (ge->ix3 < ge->prev->ix3 && ge->ix3 < nx)) { vs[g->nvs].value = ge->ix3; vs[g->nvs].from = vs[g->nvs].to @@ -3865,7 +3865,7 @@ || ge->fpoints[o][2] == ge->fpoints[o][1] || ge->fpoints[o][0] == pge->fpoints[o][2] || iln > 2. - || iln > 1. && iln/oln > 0.1 ) + || (iln > 1. && iln/oln > 0.1) ) continue; @@ -4228,7 +4228,7 @@ k2 = fabs((double) b / (double) a); /* if the curve is not a zigzag */ - if (k1+0.0001 >= k && k2 <= k+0.0001 || k1 <= k+0.0001 && k2+0.0001 >= k) + if ((k1+0.0001 >= k && k2 <= k+0.0001) || (k1 <= k+0.0001 && k2+0.0001 >= k)) return 0; else return 1; @@ -4278,7 +4278,7 @@ k2 = b / a; /* if the curve is not a zigzag */ - if (k1+0.0001 >= k && k2 <= k+0.0001 || k1 <= k+0.0001 && k2+0.0001 >= k) + if ((k1+0.0001 >= k && k2 <= k+0.0001) || (k1 <= k+0.0001 && k2+0.0001 >= k)) return 0; else return 1; @@ -6136,7 +6136,7 @@ */ if(nge->bkwd == ge - || pge != ge && (pgex->flags & GEXF_JCVMASK) <= (ngex->flags & GEXF_JCVMASK) ) { + || (pge != ge && (pgex->flags & GEXF_JCVMASK) <= (ngex->flags & GEXF_JCVMASK)) ) { pge = pge->frwd; } else { nge = nge->bkwd; @@ -6675,7 +6675,7 @@ break; if (physt[first] < physt[last] - || physt[first] == physt[last] && j) { + || (physt[first] == physt[last] && j)) { if (physt[first] * 20 > w) /* if weight is >5%, * stop */ break; diff -ur -N XOrg-6.8.2.orig/xc/lib/XprintAppUtil/xpapputil.c XOrg-6.8.2/xc/lib/XprintAppUtil/xpapputil.c --- XOrg-6.8.2.orig/xc/lib/XprintAppUtil/xpapputil.c 2004-04-23 20:43:46.000000000 +0200 +++ XOrg-6.8.2/xc/lib/XprintAppUtil/xpapputil.c 2005-03-23 17:30:31.000000000 +0100 @@ -40,7 +40,7 @@ if( XpuGetPrinter(printername, &pdpy, &pcontext) != 1 ) return NULL; - if( context = (XpauContext *)malloc(sizeof(XpauContext)) ) + if( (context = (XpauContext *)malloc(sizeof(XpauContext))) ) { memset(context, 0, sizeof(XpauContext)); diff -ur -N XOrg-6.8.2.orig/xc/programs/Xserver/Xext/xevie.c XOrg-6.8.2/xc/programs/Xserver/Xext/xevie.c --- XOrg-6.8.2.orig/xc/programs/Xserver/Xext/xevie.c 2004-07-31 03:34:26.000000000 +0200 +++ XOrg-6.8.2/xc/programs/Xserver/Xext/xevie.c 2005-03-23 18:25:25.000000000 +0100 @@ -92,13 +92,13 @@ if (!AddCallback(&ServerGrabCallback,XevieServerGrabStateCallback,NULL)) return; - if (extEntry = AddExtension (XEVIENAME, + if ((extEntry = AddExtension (XEVIENAME, 0, XevieNumberErrors, ProcDispatch, SProcDispatch, ResetProc, - StandardMinorOpcode)) { + StandardMinorOpcode))) { ReqCode = (unsigned char)extEntry->base; ErrorBase = extEntry->errorBase; } diff -ur -N XOrg-6.8.2.orig/xc/programs/Xserver/Xprint/Init.c XOrg-6.8.2/xc/programs/Xserver/Xprint/Init.c --- XOrg-6.8.2.orig/xc/programs/Xserver/Xprint/Init.c 2004-12-13 06:12:12.000000000 +0100 +++ XOrg-6.8.2/xc/programs/Xserver/Xprint/Init.c 2005-03-23 17:33:47.000000000 +0100 @@ -518,7 +518,7 @@ #define XP_DESCRIPTOR "xp-printerattr.descriptor=" #define XP_DESCRIPTOR_LEN (sizeof(XP_DESCRIPTOR)-1) - while (option = strchr(option, '\t')) { + while ((option = strchr(option, '\t'))) { option++; /* Skip the '\t' */ if (!strncmp(option, XP_DESCRIPTOR, XP_DESCRIPTOR_LEN)) { *(option-1) = '\0'; /* Kill the '\t' (only if we found a valid option) */ @@ -737,7 +737,7 @@ /* * Check for a LANG-specific file. */ - if(dirName = XpGetConfigDir(TRUE)) + if((dirName = XpGetConfigDir(TRUE))) { filePath = (char *)xalloc(strlen(dirName) + strlen(XPRINTERSFILENAME) + 2); @@ -756,7 +756,7 @@ xfree(filePath); } - if(dirName = XpGetConfigDir(FALSE)) + if((dirName = XpGetConfigDir(FALSE))) { filePath = (char *)xalloc(strlen(dirName) + strlen(XPRINTERSFILENAME) + 2); @@ -815,7 +815,7 @@ { while((tok = strtok((char *)NULL, " \t")) != (char *)NULL) { - if(ptr = MbStrchr(tok, '\012')) + if((ptr = MbStrchr(tok, '\012'))) *ptr = (char)'\0'; AddPrinterDbName(tok, NULL); } @@ -1076,7 +1076,7 @@ return (char *)NULL; configDir = XpGetConfigDir(TRUE); - if(fontDir = ValidateFontDir(configDir, modelName)) + if((fontDir = ValidateFontDir(configDir, modelName))) { xfree(configDir); return fontDir; @@ -1197,7 +1197,7 @@ for(i = 0; allIDs != (char **)NULL && allIDs[i] != (char *)NULL; i ++) { char *fontDir; - if(fontDir = FindFontDir(allIDs[i])) + if((fontDir = FindFontDir(allIDs[i]))) { AddToFontPath(fontDir); xfree(fontDir); diff -ur -N XOrg-6.8.2.orig/xc/programs/Xserver/Xprint/Oid.c XOrg-6.8.2/xc/programs/Xserver/Xprint/Oid.c --- XOrg-6.8.2.orig/xc/programs/Xserver/Xprint/Oid.c 2004-12-13 06:30:48.000000000 +0100 +++ XOrg-6.8.2/xc/programs/Xserver/Xprint/Oid.c 2005-03-23 17:38:19.000000000 +0100 @@ -750,7 +750,7 @@ XpOid XpOidLinkedListNextOid(XpOidLinkedList* me) { - if(me->current ? me->current = me->current->next : xFalse) + if(me->current ? (me->current = me->current->next) : xFalse) return me->current->oid; else return xpoid_none; @@ -1712,6 +1712,7 @@ * list */ if(tray_ds == (XpOidMediumDiscreteSizeList*)NULL) + { if(unspecified_tray_ds == (XpOidMediumDiscreteSizeList*)NULL) { /* @@ -1723,6 +1724,7 @@ } else tray_ds = unspecified_tray_ds; + } /* * loop through the discrete sizes list, looking for a size that * matches the medium for the current input tray @@ -2550,10 +2552,12 @@ * variants must both be NULL or match */ if(fmt->variant == (char*)NULL) + { if(list->list[i].variant == (char*)NULL) return xTrue; else continue; + } if(list->list[i].variant == (char*)NULL) continue; if(strcmp(fmt->variant, list->list[i].variant) != 0) @@ -2562,10 +2566,12 @@ * versions must both be NULL or match */ if(fmt->version == (char*)NULL) + { if(list->list[i].version == (char*)NULL) return xTrue; else continue; + } if(list->list[i].version == (char*)NULL) continue; if(strcmp(fmt->version, list->list[i].version) == 0) diff -ur -N XOrg-6.8.2.orig/xc/programs/Xserver/Xprint/ps/PsFonts.c XOrg-6.8.2/xc/programs/Xserver/Xprint/ps/PsFonts.c --- XOrg-6.8.2.orig/xc/programs/Xserver/Xprint/ps/PsFonts.c 2004-05-06 03:53:52.000000000 +0200 +++ XOrg-6.8.2/xc/programs/Xserver/Xprint/ps/PsFonts.c 2005-03-23 17:39:58.000000000 +0100 @@ -599,7 +599,7 @@ rec->next = NULL; - if (rec->filename = getFontFilename(pFont)) + if ((rec->filename = getFontFilename(pFont))) { rec->font_type = getFontFileType(rec->filename); }