Module Name: src
Committed By: christos
Date: Sun Aug 18 18:04:49 UTC 2024
Modified Files:
src/external/historical/nawk/dist: tran.c
Log Message:
reduce diff from upstream
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/historical/nawk/dist/tran.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/historical/nawk/dist/tran.c
diff -u src/external/historical/nawk/dist/tran.c:1.16 src/external/historical/nawk/dist/tran.c:1.17
--- src/external/historical/nawk/dist/tran.c:1.16 Sat Aug 17 18:22:29 2024
+++ src/external/historical/nawk/dist/tran.c Sun Aug 18 14:04:49 2024
@@ -33,7 +33,6 @@ THIS SOFTWARE.
#include <string.h>
#include <stdlib.h>
#include "awk.h"
-#include "awkgram.h"
#define FULLTAB 2 /* rehash when table gets this x full */
#define GROWTAB 4 /* grow table by this factor */
@@ -392,31 +391,6 @@ char *setsval(Cell *vp, const char *s) /
return(vp->sval);
}
-static int checkstr(const char *s, const char *v)
-{
- while (*s && tolower((unsigned char)*s) == *v)
- s++, v++;
- while (isspace((unsigned char)*s))
- s++;
- return !(*s || *v);
-}
-
-static int checkinfnan(const char *s)
-{
- while (isspace((unsigned char)*s))
- s++;
- if (*s == '+' || *s == '-')
- s++;
- switch (tolower((unsigned char)*s)) {
- case 'i':
- return checkstr(s, "inf") || checkstr(s, "infinity");
- case 'n':
- return checkstr(s, "nan");
- default:
- return 1;
- }
-}
-
Awkfloat getfval(Cell *vp) /* get float val of a Cell */
{
if ((vp->tval & (NUM | STR)) == 0)
@@ -428,10 +402,6 @@ Awkfloat getfval(Cell *vp) /* get float
if (!isnum(vp)) { /* not a number */
double fval;
bool no_trailing;
- if (checkinfnan(vp->sval))
- vp->fval = atof(vp->sval); /* best guess */
- else
- vp->fval = 0.0;
if (is_valid_number(vp->sval, true, & no_trailing, & fval)) {
vp->fval = fval;