summaryrefslogtreecommitdiff
path: root/Xprint
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2005-07-07 02:47:06 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2005-07-07 02:47:06 +0000
commitf86562540d1c945bfd96d4b89259d81e4ed25255 (patch)
treea9a990e4dd24aa1eead1a28da2150235e34d60c9 /Xprint
parent4047191124c237518110e698bde6dab445644449 (diff)
Bug #2901 <https://bugs.freedesktop.org/show_bug.cgi?id=2901> Patch #2325
<https://bugs.freedesktop.org/attachment.cgi?id=2325> 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 (Peter Breitenlohner) Bug #2901 <https://bugs.freedesktop.org/show_bug.cgi?id=2901> Patch #2326 <https://bugs.freedesktop.org/attachment.cgi?id=2326> This patch removes these 2 gcc-3.4.3 warnings: missing braces around initializer implicit declaration of function `XpOidTrayMediumListHasTray' (Peter Breitenlohner)
Diffstat (limited to 'Xprint')
-rw-r--r--Xprint/AttrValid.c2
-rw-r--r--Xprint/Init.c12
-rw-r--r--Xprint/Oid.c8
-rw-r--r--Xprint/Oid.h1
-rw-r--r--Xprint/ps/PsFonts.c2
5 files changed, 16 insertions, 9 deletions
diff --git a/Xprint/AttrValid.c b/Xprint/AttrValid.c
index b2b018216..cf9476003 100644
--- a/Xprint/AttrValid.c
+++ b/Xprint/AttrValid.c
@@ -48,7 +48,7 @@ static XpOidMediumDiscreteSizeList DefaultMediumSizeList = {
&DefaultMediumSize, 1
};
static XpOidMediumSourceSize DefaultMediumSourceSize = {
- xpoid_unspecified, XpOidMediumSS_DISCRETE, &DefaultMediumSizeList
+ xpoid_unspecified, XpOidMediumSS_DISCRETE, { &DefaultMediumSizeList }
};
static XpOidMediumSS DefaultMediumSS = {
&DefaultMediumSourceSize, 1
diff --git a/Xprint/Init.c b/Xprint/Init.c
index 0779eda10..889a036dc 100644
--- a/Xprint/Init.c
+++ b/Xprint/Init.c
@@ -536,7 +536,7 @@ AugmentPrinterDb(const char *command)
#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) */
@@ -755,7 +755,7 @@ GetConfigFileName(void)
/*
* Check for a LANG-specific file.
*/
- if(dirName = XpGetConfigDir(TRUE))
+ if((dirName = XpGetConfigDir(TRUE)))
{
filePath = (char *)xalloc(strlen(dirName) +
strlen(XPRINTERSFILENAME) + 2);
@@ -774,7 +774,7 @@ GetConfigFileName(void)
xfree(filePath);
}
- if(dirName = XpGetConfigDir(FALSE))
+ if((dirName = XpGetConfigDir(FALSE)))
{
filePath = (char *)xalloc(strlen(dirName) +
strlen(XPRINTERSFILENAME) + 2);
@@ -833,7 +833,7 @@ BuildPrinterDb(void)
{
while((tok = strtok((char *)NULL, " \t")) != (char *)NULL)
{
- if(ptr = MbStrchr(tok, '\012'))
+ if((ptr = MbStrchr(tok, '\012')))
*ptr = (char)'\0';
AddPrinterDbName(tok, NULL);
}
@@ -1094,7 +1094,7 @@ FindFontDir(
return (char *)NULL;
configDir = XpGetConfigDir(TRUE);
- if(fontDir = ValidateFontDir(configDir, modelName))
+ if((fontDir = ValidateFontDir(configDir, modelName)))
{
xfree(configDir);
return fontDir;
@@ -1215,7 +1215,7 @@ AugmentFontPath(void)
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 --git a/Xprint/Oid.c b/Xprint/Oid.c
index 7f0acaf0b..7cb1230c7 100644
--- a/Xprint/Oid.c
+++ b/Xprint/Oid.c
@@ -754,7 +754,7 @@ XpOidLinkedListFirstOid(XpOidLinkedList* me)
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;
@@ -1716,6 +1716,7 @@ TrayMediumListValidate(XpOidTrayMediumList* me,
* list
*/
if(tray_ds == (XpOidMediumDiscreteSizeList*)NULL)
+ {
if(unspecified_tray_ds == (XpOidMediumDiscreteSizeList*)NULL)
{
/*
@@ -1727,6 +1728,7 @@ TrayMediumListValidate(XpOidTrayMediumList* me,
}
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
@@ -2554,10 +2556,12 @@ XpOidDocFmtListHasFmt(const XpOidDocFmtList* list,
* 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)
@@ -2566,10 +2570,12 @@ XpOidDocFmtListHasFmt(const XpOidDocFmtList* list,
* 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 --git a/Xprint/Oid.h b/Xprint/Oid.h
index 820cd7563..ba9dc77f3 100644
--- a/Xprint/Oid.h
+++ b/Xprint/Oid.h
@@ -191,6 +191,7 @@ typedef struct
const char* XpOidString(XpOid);
int XpOidStringLength(XpOid);
XpOid XpOidFromString(const char* value);
+BOOL XpOidTrayMediumListHasTray(const XpOidTrayMediumList* list, XpOid tray);
/*
* XpOidList public methods
diff --git a/Xprint/ps/PsFonts.c b/Xprint/ps/PsFonts.c
index 10c0b1a5b..515a31884 100644
--- a/Xprint/ps/PsFonts.c
+++ b/Xprint/ps/PsFonts.c
@@ -603,7 +603,7 @@ PsFontTypeInfoRec *PsCreateFontTypeInfoRec(DrawablePtr pDrawable, FontPtr pFont)
rec->next = NULL;
- if (rec->filename = getFontFilename(pFont))
+ if ((rec->filename = getFontFilename(pFont)))
{
rec->font_type = getFontFileType(rec->filename);
}