Re: [hatari-devel] Sorted trace flags

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 22.5.2021 0.29, Eero Tamminen wrote:
On 21.5.2021 13.30, Thomas Huth wrote:
So if we want to re-order the defines, too, maybe it's best to go through an intermediate step with an enum instead, i.e.:

enum {
     ...
     TRACE_VIDEO_SYNC_BIT,
     TRACE_VIDEO_RES_BIT,
     TRACE_VIDEO_COLOR_BIT,
     ...
};

and then:

#define    TRACE_VIDEO_SYNC     (1 << TRACE_VIDEO_SYNC_BIT)
#define    TRACE_VIDEO_RES      (1 << TRACE_VIDEO_RES_BIT)
#define    TRACE_VIDEO_COLOR     (1 << TRACE_VIDEO_COLOR_BIT)
etc.

What do you think?

It's one more thing to update when adding new
trace option (there can't be that many additional
ones anymore, can there?), but commits keep
smaller so I'll change it to work like that.

I've now pushed that change (and dropped
the change to cpu_/dsp_symbols option names).

I decided enums look nicer like this:
	TRACE_BIT_ACIA
Instead of:
	TRACE_ACIA_BIT


	- Eero

PS. New defines were generated with:

1. awk '/define[^_]*TRACE.*<</{print $2}' ../src/debug/log.h|sort > traceflags.in

2. awk '{printf("\t%s,\n",$1)}' < traceflags.in | sed 's/TRACE_/TRACE_BIT_/' > traceflags.h

3. awk '{printf("#define %-24s (1ll<<BIT_%s)\n",$1,$i)}' < traceflags.in | sed 's/BIT_TRACE/TRACE_BIT_/' >> traceflags.h

4. copying the new defines to log.h and adding
   enum & extra lines to separate option groups.



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/