rename 'or' variable (now keyword)

This commit is contained in:
David Rose 2002-05-17 17:21:47 +00:00
parent 2b3caf3f8f
commit c44d91f9d1
2 changed files with 13 additions and 13 deletions

View File

@ -36,7 +36,7 @@ fputresolu(int ord, int sl, int ns, FILE *fp) /* put out picture dimen
{ {
RESOLU rs; RESOLU rs;
if ((rs.or = ord) & YMAJOR) { if ((rs.orient = ord) & YMAJOR) {
rs.xr = sl; rs.xr = sl;
rs.yr = ns; rs.yr = ns;
} else { } else {
@ -54,28 +54,28 @@ fgetresolu(int *sl, int *ns, FILE *fp) /* get picture dimension
if (!fgetsresolu(&rs, fp)) if (!fgetsresolu(&rs, fp))
return(-1); return(-1);
if (rs.or & YMAJOR) { if (rs.orient & YMAJOR) {
*sl = rs.xr; *sl = rs.xr;
*ns = rs.yr; *ns = rs.yr;
} else { } else {
*sl = rs.yr; *sl = rs.yr;
*ns = rs.xr; *ns = rs.xr;
} }
return(rs.or); return(rs.orient);
} }
char * char *
resolu2str(char *buf, register RESOLU *rp) /* convert resolution struct to line */ resolu2str(char *buf, register RESOLU *rp) /* convert resolution struct to line */
{ {
if (rp->or&YMAJOR) if (rp->orient&YMAJOR)
sprintf(buf, "%cY %d %cX %d\n", sprintf(buf, "%cY %d %cX %d\n",
rp->or&YDECR ? '-' : '+', rp->yr, rp->orient&YDECR ? '-' : '+', rp->yr,
rp->or&XDECR ? '-' : '+', rp->xr); rp->orient&XDECR ? '-' : '+', rp->xr);
else else
sprintf(buf, "%cX %d %cY %d\n", sprintf(buf, "%cX %d %cY %d\n",
rp->or&XDECR ? '-' : '+', rp->xr, rp->orient&XDECR ? '-' : '+', rp->xr,
rp->or&YDECR ? '-' : '+', rp->yr); rp->orient&YDECR ? '-' : '+', rp->yr);
return(buf); return(buf);
} }
@ -95,10 +95,10 @@ int str2resolu(register RESOLU *rp, char *buf) /* convert resolution li
yndx = cp; yndx = cp;
if (xndx == NULL || yndx == NULL) if (xndx == NULL || yndx == NULL)
return(0); return(0);
rp->or = 0; rp->orient = 0;
if (xndx > yndx) rp->or |= YMAJOR; if (xndx > yndx) rp->orient |= YMAJOR;
if (xndx[-1] == '-') rp->or |= XDECR; if (xndx[-1] == '-') rp->orient |= XDECR;
if (yndx[-1] == '-') rp->or |= YDECR; if (yndx[-1] == '-') rp->orient |= YDECR;
if ((rp->xr = atoi(xndx+1)) <= 0) if ((rp->xr = atoi(xndx+1)) <= 0)
return(0); return(0);
if ((rp->yr = atoi(yndx+1)) <= 0) if ((rp->yr = atoi(yndx+1)) <= 0)

View File

@ -42,7 +42,7 @@
/* structure for image dimensions */ /* structure for image dimensions */
typedef struct { typedef struct {
int or; /* orientation (from flags above) */ int orient; /* orientation (from flags above) */
int xr, yr; /* x and y resolution */ int xr, yr; /* x and y resolution */
} RESOLU; } RESOLU;