summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2020-06-08 22:20:46 +0300
committerArnold D. Robbins <arnold@skeeve.com>2020-06-08 22:20:46 +0300
commit339f21ce25f2144bf6941c925594039bdfe440b4 (patch)
treeaafa71fae9130b24ab8851ce736fa1f9fcaa8187
parent4fdd2362ad9c9a215da4b4a9f2c96b15a5d5d881 (diff)
downloadgawk-339f21ce25f2144bf6941c925594039bdfe440b4.tar.gz
Make profiling counts 64 bits.
-rw-r--r--ChangeLog8
-rw-r--r--awk.h2
-rw-r--r--pc/Makefile.tst8
-rw-r--r--profile.c4
4 files changed, 18 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 2b25a9b7..92454f0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,14 @@
* awkgram.y: Fix `print $"2"' case. Thanks to Ed Morton
Morton <mortoneccc@comcast.net> for the report.
+ Unrelated:
+
+ * awk.h (INSTRUCTION): Make dl a long long for profiling
+ counts on 32 bit systems. Thanks to Peter Lindgren
+ <lindgren@ameritech.net> for the report.
+ * profile.c (indent): Take a long long parameter and fix
+ the printf format.
+
2020-06-05 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y: Allow @/foo/ as return expression in a function.
diff --git a/awk.h b/awk.h
index 3fba240d..515b524d 100644
--- a/awk.h
+++ b/awk.h
@@ -758,7 +758,7 @@ typedef struct exp_instruction {
awk_value_t *(*efptr)(int num_actual_args,
awk_value_t *result,
struct awk_ext_func *finfo);
- long dl;
+ long long dl;
char *name;
} d;
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index 22ac2240..2670ae4b 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -175,7 +175,8 @@ BASIC_TESTS = \
rstest1 rstest2 rstest3 rstest4 rstest5 rswhite \
scalar sclforin sclifin setrec0 setrec1 \
sigpipe1 sortempty sortglos spacere splitargv splitarr \
- splitdef splitvar splitwht status-close strcat1 strnum1 strnum2 strtod \
+ splitdef splitvar splitwht status-close \
+ strcat1 strfieldnum strnum1 strnum2 strtod \
subamp subback subi18n subsepnm subslash substr swaplns synerr1 synerr2 synerr3 \
tailrecurse tradanch trailbs tweakfld \
uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs uplus \
@@ -2295,6 +2296,11 @@ strcat1:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+strfieldnum:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
strnum1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/profile.c b/profile.c
index 0f77c8a1..d3f6f84f 100644
--- a/profile.c
+++ b/profile.c
@@ -135,7 +135,7 @@ init_profiling_signals()
/* indent --- print out enough tabs */
static void
-indent(long count)
+indent(long long count)
{
int i;
@@ -143,7 +143,7 @@ indent(long count)
if (count == 0)
fprintf(prof_fp, "\t");
else
- fprintf(prof_fp, "%6ld ", count);
+ fprintf(prof_fp, "%6lld ", count);
}
assert(indent_level >= 0);