On Sun, Jul 09, 2017 at 10:33:41 -1000, Richard Henderson wrote: > On 07/08/2017 09:50 PM, Emilio G. Cota wrote: > > #if defined(DEBUG_TB_FLUSH) > >+ nb_tbs = g_tree_nnodes(tcg_ctx.tb_ctx.tb_tree); > > printf("qemu: flush code_size=%ld nb_tbs=%d avg_tb_size=%ld\n", > > (unsigned long)(tcg_ctx.code_gen_ptr - tcg_ctx.code_gen_buffer), > >- tcg_ctx.tb_ctx.nb_tbs, tcg_ctx.tb_ctx.nb_tbs > 0 ? > >+ nb_tbs, nb_tbs > 0 ? > > ((unsigned long)(tcg_ctx.code_gen_ptr - > > tcg_ctx.code_gen_buffer)) / > >- tcg_ctx.tb_ctx.nb_tbs : 0); > >+ nb_tbs : 0); > > #endif > > Variable declaration within braces within the ifdef. Better as size_t or > unsigned long. Using int to count thing on 64-bit hosts always seems like a > bug.
g_tree_nnodes returns a gint, which is documented to be a typedef for 'int'. So I went with that. But yes, a size_t here is better. E.