History

Print correct values in tcc_print_stats (yarpgen v1)

Value 0 and values >2GB where printed wrong during tests with yarpgen (v1) Starting the output with a hashtag make it compatible to TAP -- Regards ... Detlef

Detlef Riekenberg committed 3 years ago

Commit e7262ac1 parent afa05ca2 files · +6 −8Browse files

Unified · Split

2 files
  1. libtcc.c +5 −7
  2. tcc.h +1 −1
libtcc.c+5−7
@@ -2161,23 +2161,21 @@ LIBTCCAPI void tcc_set_options(TCCState *s, const char *r) · 2160 unmodified lines
21612161
21622162 PUB_FUNC void tcc_print_stats(TCCState *s1, unsigned total_time)
21632163 {
2164− if (total_time < 1)
2164+ if (!total_time)
21652165 total_time = 1;
2166− if (total_bytes < 1)
2167− total_bytes = 1;
2168− fprintf(stderr, "* %d idents, %d lines, %d bytes\n"
2169− "* %0.3f s, %u lines/s, %0.1f MB/s\n",
2166+ fprintf(stderr, "# %d idents, %d lines, %u bytes\n"
2167+ "# %0.3f s, %u lines/s, %0.1f MB/s\n",
21702168 total_idents, total_lines, total_bytes,
21712169 (double)total_time/1000,
21722170 (unsigned)total_lines*1000/total_time,
21732171 (double)total_bytes/1000/total_time);
2174− fprintf(stderr, "* text %u, data.rw %u, data.ro %u, bss %u bytes\n",
2172+ fprintf(stderr, "# text %u, data.rw %u, data.ro %u, bss %u bytes\n",
21752173 s1->total_output[0],
21762174 s1->total_output[1],
21772175 s1->total_output[2],
21782176 s1->total_output[3]
21792177 );
21802178 #ifdef MEM_DEBUG
2181− fprintf(stderr, "* %d bytes memory used\n", mem_max_size);
2179+ fprintf(stderr, "# %d bytes memory used\n", mem_max_size);
21822180 #endif
21832181 }
tcc.h+1−1
@@ -1001,7 +1001,7 @@ struct TCCState { · 1000 unmodified lines
10011001 /* benchmark info */
10021002 int total_idents;
10031003 int total_lines;
1004− int total_bytes;
1004+ unsigned int total_bytes;
10051005 unsigned int total_output[4];
10061006
10071007 /* option -dnum (for general development purposes) */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t