Changeset 7258c6a in buchla-68k for libcio/scan.c
- Timestamp:
- 07/09/2017 04:45:34 PM (7 years ago)
- Branches:
- master
- Children:
- 8618599
- Parents:
- 0292fbb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcio/scan.c
r0292fbb r7258c6a 10 10 #include "ctype.h" 11 11 12 static int maxwide;13 static int (*gsub)();14 15 extern char *index(char *str, charc);16 17 static char*scnstr;18 static charquit;19 20 /* 21 22 */ 23 24 static long getnum(char *list, char *values, int base)25 { 26 register longval;27 register char*cp;28 int c;29 int sign;12 static int16_t maxwide; 13 static int16_t (*gsub)(); 14 15 extern int8_t *index(int8_t *str, int8_t c); 16 17 static int8_t *scnstr; 18 static int8_t quit; 19 20 /* 21 22 */ 23 24 static int32_t getnum(int8_t *list, int8_t *values, int16_t base) 25 { 26 register int32_t val; 27 register int8_t *cp; 28 int16_t c; 29 int16_t sign; 30 30 31 31 if (maxwide LE 0) … … 53 53 54 54 val *= base; 55 val += values[( long)cp - (long)list];55 val += values[(int32_t)cp - (int32_t)list]; 56 56 } 57 57 … … 66 66 */ 67 67 68 static int skipblk(void)68 static int16_t skipblk(void) 69 69 { 70 70 while (isspace((*gsub)(0))) … … 77 77 } 78 78 79 static int sgetc(int what)79 static int16_t sgetc(int16_t what) 80 80 { 81 81 if (what EQ 0) { … … 99 99 */ 100 100 101 int scanfmt(int (*getsub)(), char *fmt, int **args)101 int16_t scanfmt(int16_t (*getsub)(), int8_t *fmt, int16_t **args) 102 102 { 103 103 … … 106 106 #endif 107 107 108 longlv;109 int c, count, dontdo, lflag, base;110 char*cp;111 chartlist[130];112 113 static charlist[] = "ABCDEFabcdef9876543210";114 115 static charvals[] = {108 int32_t lv; 109 int16_t c, count, dontdo, lflag, base; 110 int8_t *cp; 111 int8_t tlist[130]; 112 113 static int8_t list[] = "ABCDEFabcdef9876543210"; 114 115 static int8_t vals[] = { 116 116 117 117 10,11,12,13,14,15,10,11,12,13,14,15,9,8,7,6,5,4,3,2,1,0 … … 198 198 199 199 if (lflag) 200 *( long*)(*args++) = lv;200 *(int32_t *)(*args++) = lv; 201 201 else 202 202 **args++ = lv; … … 298 298 if (!dontdo) { 299 299 300 *( char*)(*args++) = c;300 *(int8_t *)(*args++) = c; 301 301 ++count; 302 302 } … … 379 379 */ 380 380 381 int sscanf(char *string, char *fmt, int *args)381 int16_t sscanf(int8_t *string, int8_t *fmt, int16_t *args) 382 382 { 383 383 scnstr = string;
Note:
See TracChangeset
for help on using the changeset viewer.