ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/words.c
(Generate patch)

Comparing ray/src/common/words.c (file contents):
Revision 2.10 by greg, Fri Feb 18 00:40:25 2011 UTC vs.
Revision 2.12 by greg, Sat Dec 28 18:05:14 2019 UTC

# Line 10 | Line 10 | static const char RCSid[] = "$Id$";
10   #include "copyright.h"
11  
12   #include  <ctype.h>
13 #include  <string.h>
13  
14   #include  "rtio.h"
15  
16   char *
17   atos(char *rs, int nb, char *s)         /* get word from string, returning rs */
18   {
19 <        register char  *cp = rs;
19 >        char  *cp = rs;
20  
21          while (isspace(*s))
22                  s++;
# Line 83 | Line 82 | iskip(char *s)                 /* skip integer in string */
82   {
83          while (isspace(*s))
84                  s++;
85 <        if (*s == '-' || *s == '+')
85 >        if ((*s == '-') | (*s == '+'))
86                  s++;
87          if (!isdigit(*s))
88                  return(NULL);
# Line 97 | Line 96 | iskip(char *s)                 /* skip integer in string */
96   char *
97   fskip(char *s)                  /* skip float in string */
98   {
99 <        register char  *cp;
99 >        char  *cp;
100  
101          while (isspace(*s))
102                  s++;
103 <        if (*s == '-' || *s == '+')
103 >        if ((*s == '-') | (*s == '+'))
104                  s++;
105          cp = s;
106          while (isdigit(*cp))
# Line 113 | Line 112 | fskip(char *s)                 /* skip float in string */
112          }
113          if (cp == s)
114                  return(NULL);
115 <        if (*cp == 'e' || *cp == 'E')
116 <                return(iskip(cp+1));
115 >        if ((*cp == 'e') | (*cp == 'E'))
116 >                return(isspace(*++cp) ? NULL : iskip(cp));
117          return(cp);
118   }
119  
# Line 122 | Line 121 | fskip(char *s)                 /* skip float in string */
121   int
122   isint(char *s)                  /* check integer format */
123   {
124 <        register char  *cp;
124 >        char  *cp;
125  
126          cp = iskip(s);
127          return(cp != NULL && *cp == '\0');
# Line 132 | Line 131 | isint(char *s)                 /* check integer format */
131   int
132   isintd(char *s, char *ds)       /* check integer format with delimiter set */
133   {
134 <        register char  *cp;
134 >        char  *cp;
135  
136          cp = iskip(s);
137          return(cp != NULL && strchr(ds, *cp) != NULL);
# Line 142 | Line 141 | isintd(char *s, char *ds)      /* check integer format with
141   int
142   isflt(char *s)                  /* check float format */
143   {
144 <        register char  *cp;
144 >        char  *cp;
145  
146          cp = fskip(s);
147          return(cp != NULL && *cp == '\0');
# Line 152 | Line 151 | isflt(char *s)                 /* check float format */
151   int
152   isfltd(char *s, char *ds)       /* check integer format with delimiter set */
153   {
154 <        register char  *cp;
154 >        char  *cp;
155  
156          cp = fskip(s);
157          return(cp != NULL && strchr(ds, *cp) != NULL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines