diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2020-06-10 09:52:45 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2020-06-10 09:52:45 -0400 |
commit | a53ba84a4c0c8cfcc944d08aa30d062afc6df9a3 (patch) | |
tree | 9bd5879ea9ec4034eb1855c219358843c6c790ce | |
parent | dff45aba93a56a50d5ad26c5ef1597abc1e2fe79 (diff) | |
download | egawk-a53ba84a4c0c8cfcc944d08aa30d062afc6df9a3.tar.gz egawk-a53ba84a4c0c8cfcc944d08aa30d062afc6df9a3.tar.bz2 egawk-a53ba84a4c0c8cfcc944d08aa30d062afc6df9a3.zip |
Convert exec_count to unsigned long long.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | awk.h | 2 | ||||
-rw-r--r-- | debug.c | 2 | ||||
-rw-r--r-- | doc/ChangeLog | 5 | ||||
-rw-r--r-- | doc/bc_notes | 3 | ||||
-rw-r--r-- | profile.c | 8 |
6 files changed, 22 insertions, 7 deletions
@@ -1,3 +1,12 @@ +2020-06-10 Andrew J. Schorr <aschorr@telemetry-investments.com> + + Convert exec_count from long long to unsigned long long. + * awk.h (INSTRUCTION): Change ldl type from long long to unsigned + long long. + * debug.c (print_instruction): Fix printf format for exec_count. + * profile.c (indent): The argument is now an unsigned long long, + and fix the printf format to match. + 2020-06-10 Arnold D. Robbins <arnold@skeeve.com> Thanks to Andrew Schorr for suggestion of better way to @@ -759,7 +759,7 @@ typedef struct exp_instruction { awk_value_t *result, struct awk_ext_func *finfo); long dl; - long long ldl; // for exec_count + unsigned long long ldl; // for exec_count char *name; } d; @@ -4074,7 +4074,7 @@ print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump) break; case Op_exec_count: - print_func(fp, "[exec_count = %ld]\n", pc->exec_count); + print_func(fp, "[exec_count = %llu]\n", pc->exec_count); break; case Op_store_var: diff --git a/doc/ChangeLog b/doc/ChangeLog index b7d145e2..94f3e3d5 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2020-06-10 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * bc_notes: Add new field `unsigned long long ldl' to INSTRUCTION, + and update the definition of exec_count. + 2020-06-09 Arnold D. Robbins <arnold@skeeve.com> * gawktexi.in (Implementation Limits): Update the table to be more diff --git a/doc/bc_notes b/doc/bc_notes index b548cec5..bca13a71 100644 --- a/doc/bc_notes +++ b/doc/bc_notes @@ -154,6 +154,7 @@ typedef struct exp_instruction { struct exp_instruction *di; NODE *(*fptr) P((int)); long dl; + unsigned long long ldl; char *name; } d; @@ -251,7 +252,7 @@ typedef struct exp_instruction { /*------------------ pretty printing/profiling --------*/ /* Op_exec_count */ -#define exec_count d.dl +#define exec_count d.ldl /* Op_K_while */ #define while_body d.di @@ -135,7 +135,7 @@ init_profiling_signals() /* indent --- print out enough tabs */ static void -indent(long long count) +indent(unsigned long long count) { int i; @@ -143,7 +143,7 @@ indent(long long count) if (count == 0) fprintf(prof_fp, "\t"); else - fprintf(prof_fp, "%6lld ", count); + fprintf(prof_fp, "%6llu ", count); } assert(indent_level >= 0); @@ -297,7 +297,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags) ip2 = (pc + 1)->lasti; if (do_profile && ip1->exec_count > 0) - fprintf(prof_fp, " # %lld", ip1->exec_count); + fprintf(prof_fp, " # %llu", ip1->exec_count); end_line(ip1); skip_comment = true; @@ -1043,7 +1043,7 @@ cleanup: ip1 = pc->branch_if; if (ip1->exec_count > 0) - fprintf(prof_fp, " # %lld", ip1->exec_count); + fprintf(prof_fp, " # %llu", ip1->exec_count); ip1 = end_line(ip1); indent_in(); if (pc->comment != NULL) |