summaryrefslogtreecommitdiff
path: root/Xprint/Oid.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xprint/Oid.c')
-rw-r--r--Xprint/Oid.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/Xprint/Oid.c b/Xprint/Oid.c
index 3fe926c00..ac0e54434 100644
--- a/Xprint/Oid.c
+++ b/Xprint/Oid.c
@@ -30,11 +30,9 @@ not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from said
copyright holders.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include "Oid.h"
-#include <X11/Xfuncs.h> /* for memmove */
+/* $XFree86: xc/programs/Xserver/Xprint/Oid.c,v 1.5 2001/10/28 03:32:53 tsi Exp $ */
+
+#include "attributes.h"
/*
* XpOidNotify value strings
@@ -753,7 +751,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) != 0 : xFalse)
return me->current->oid;
else
return xpoid_none;
@@ -1654,8 +1652,6 @@ TrayMediumListValidate(XpOidTrayMediumList* me,
const XpOidMediumSS* msss)
{
int i_mss, i_ds, i_itm;
- XpOidMediumDiscreteSizeList* ds_list;
- int tray_count;
XpOid current_tray, current_medium;
XpOidMediumDiscreteSizeList* unspecified_tray_ds;
XpOidMediumDiscreteSizeList* tray_ds;
@@ -1715,6 +1711,7 @@ TrayMediumListValidate(XpOidTrayMediumList* me,
* list
*/
if(tray_ds == (XpOidMediumDiscreteSizeList*)NULL)
+ {
if(unspecified_tray_ds == (XpOidMediumDiscreteSizeList*)NULL)
{
/*
@@ -1725,7 +1722,10 @@ TrayMediumListValidate(XpOidTrayMediumList* me,
continue;
}
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
@@ -2107,15 +2107,13 @@ const char* XpOidNotifyString(XpOidNotify notify)
{
switch(notify)
{
+ default:
case XPOID_NOTIFY_UNSUPPORTED:
return (const char*)NULL;
- break;
case XPOID_NOTIFY_NONE:
return NOTIFY_NONE_STR;
- break;
case XPOID_NOTIFY_EMAIL:
return NOTIFY_EMAIL_STR;
- break;
}
}
@@ -2240,7 +2238,7 @@ XpOidDocFmtNext(XpOidDocFmt* doc_fmt,
const char* first_nonws_ptr;
const char* format;
const char* variant;
- const char* version;
+ const char* version = 0;
int format_len;
int variant_len;
int version_len;
@@ -2553,10 +2551,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)
@@ -2565,10 +2565,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)