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
2161 2161
2162PUB_FUNC void tcc_print_stats(TCCState *s1, unsigned total_time)2162PUB_FUNC void tcc_print_stats(TCCState *s1, unsigned total_time)
2163{2163{
2164 if (total_time < 1)2164 if (!total_time)
2165 total_time = 1;2165 total_time = 1;
2166 if (total_bytes < 1)2166 fprintf(stderr, "# %d idents, %d lines, %u bytes\n"
2167 total_bytes = 1;2167 "# %0.3f s, %u lines/s, %0.1f MB/s\n",
2168 fprintf(stderr, "* %d idents, %d lines, %d bytes\n"
2169 "* %0.3f s, %u lines/s, %0.1f MB/s\n",
2170 total_idents, total_lines, total_bytes,2168 total_idents, total_lines, total_bytes,
2171 (double)total_time/1000,2169 (double)total_time/1000,
2172 (unsigned)total_lines*1000/total_time,2170 (unsigned)total_lines*1000/total_time,
2173 (double)total_bytes/1000/total_time);2171 (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",
2175 s1->total_output[0],2173 s1->total_output[0],
2176 s1->total_output[1],2174 s1->total_output[1],
2177 s1->total_output[2],2175 s1->total_output[2],
2178 s1->total_output[3]2176 s1->total_output[3]
2179 );2177 );
2180#ifdef MEM_DEBUG2178#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);
2182#endif2180#endif
2183}2181}
tcc.h+1−1
@@ -1001,7 +1001,7 @@ struct TCCState { · 1000 unmodified lines
1001 /* benchmark info */1001 /* benchmark info */
1002 int total_idents;1002 int total_idents;
1003 int total_lines;1003 int total_lines;
1004 int total_bytes;1004 unsigned int total_bytes;
1005 unsigned int total_output[4];1005 unsigned int total_output[4];
1006 1006
1007 /* option -dnum (for general development purposes) */1007 /* 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