From bf0a4f7d99d7c4beedc63fdb50d3ac083011641f Mon Sep 17 00:00:00 2001 From: Ryan Avella Date: Wed, 21 Oct 2020 20:15:54 -0700 Subject: [PATCH] renaming `strtonum` to `str2num` to avoid conflict with BSD libc --- readshpfont.c | 8 ++++---- shpfonts/parse2.c | 8 ++++---- shpfonts/readshp.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/readshpfont.c b/readshpfont.c index 86d992c..8de5aa9 100644 --- a/readshpfont.c +++ b/readshpfont.c @@ -94,7 +94,7 @@ void shp_jump(BOUNDS *bb, int mode) { // printf("jump\n"); } -int strtonum(char *str) { +int str2num(char *str) { int i; int sign=1.0; int val; @@ -657,7 +657,7 @@ int shp_loadfont(char *path, int position) break; case 1: // get glyph num if (token == VAL) { - glyphnum = strtonum(tp); + glyphnum = str2num(tp); } else if (token == WORD) { glyphnum = 0; } else { @@ -672,7 +672,7 @@ int shp_loadfont(char *path, int position) fprintf(stderr, "parse error in state %d\n", state); exit(1); } - numbytes = strtonum(tp); + numbytes = str2num(tp); if (debug) printf("got numbytes %d\n", numbytes); state = 3; break; @@ -699,7 +699,7 @@ int shp_loadfont(char *path, int position) break; case 5: if (token == VAL) { - bytecode[count]=strtonum(tp); + bytecode[count]=str2num(tp); if (debug) printf(" %d %d %d\n", count, numbytes, bytecode[count]); count++; } else if (token == EOL) { diff --git a/shpfonts/parse2.c b/shpfonts/parse2.c index bf2b07d..61df2b7 100644 --- a/shpfonts/parse2.c +++ b/shpfonts/parse2.c @@ -47,7 +47,7 @@ char *estrdup(const char *s); void eatwhite(); int token_unget(TOKEN token, char *word); -int strtonum(char *str) { +int str2num(char *str) { int i; int sign=1.0; int val; @@ -541,7 +541,7 @@ int main() break; case 1: // get glyph num if (token == NUM) { - glyphnum = strtonum(tp); + glyphnum = str2num(tp); } else if (token == WORD) { glyphnum = 0; } else { @@ -556,7 +556,7 @@ int main() fprintf(stderr, "parse error in state %d\n", state); exit(1); } - numbytes = strtonum(tp); + numbytes = str2num(tp); if (debug) printf("got numbytes %d\n", numbytes); state = 3; break; @@ -579,7 +579,7 @@ int main() break; case 5: if (token == NUM) { - bytecode[count]=strtonum(tp); + bytecode[count]=str2num(tp); if (debug) printf(" %d %d %d\n", count, numbytes, bytecode[count]); count++; } else if (token == EOL) { diff --git a/shpfonts/readshp.c b/shpfonts/readshp.c index d0ba980..c49d994 100644 --- a/shpfonts/readshp.c +++ b/shpfonts/readshp.c @@ -82,7 +82,7 @@ void shpjump(int mode) { printf("jump\n"); } -int strtonum(char *str) { +int str2num(char *str) { int i; int sign=1.0; int val; @@ -624,7 +624,7 @@ int shp_loadfont(char *path) break; case 1: // get glyph num if (token == NUM) { - glyphnum = strtonum(tp); + glyphnum = str2num(tp); } else if (token == WORD) { glyphnum = 0; } else { @@ -639,7 +639,7 @@ int shp_loadfont(char *path) fprintf(stderr, "parse error in state %d\n", state); exit(1); } - numbytes = strtonum(tp); + numbytes = str2num(tp); if (debug) printf("got numbytes %d\n", numbytes); state = 3; break; @@ -666,7 +666,7 @@ int shp_loadfont(char *path) break; case 5: if (token == NUM) { - bytecode[count]=strtonum(tp); + bytecode[count]=str2num(tp); if (debug) printf(" %d %d %d\n", count, numbytes, bytecode[count]); count++; } else if (token == EOL) {