Just to nitpick, in most of your patches, you have this :
if (TRACE_ON(ddraw)) {
DPRINTF(" Real caps are : "); DDRAW_dump_DDSCAPS2(&our_caps); DPRINTF("\n");
}TRACE(" Real caps are : "); DDRAW_dump_DDSCAPS2(&our_caps); TRACE("\n");
As we use 'TRACE' now and not 'DPRINTF', the 'TRACE_ON' constructs could be removed.
But well, one could say that it optimizes stuff to not do the test thrice :-)
Lionel
On March 15, 2003 04:22 pm, Lionel Ulmer wrote:
Just to nitpick, in most of your patches, you have this :
if (TRACE_ON(ddraw)) {
DPRINTF(" Real caps are : "); DDRAW_dump_DDSCAPS2(&our_caps); DPRINTF("\n");
TRACE(" Real caps are : "); DDRAW_dump_DDSCAPS2(&our_caps); TRACE("\n");
As we use 'TRACE' now and not 'DPRINTF', the 'TRACE_ON' constructs could be removed.
This is why I said these needs manual review, so we can eliminate this type of tests. But personally I would have liked it a lot more if you could code these like so:
if (TRACE_ON(ddraw)) { - DPRINTF(" Real caps are : "); DDRAW_dump_DDSCAPS2(&our_caps); DPRINTF("\n"); + TRACE(" Real caps are : %s\n", debugddscaps2(&our_caps));
That's what I did in listview.c, and the code looks a lot neater IMO. But then again, maybe that's just me.
Dimitrie O. Paun wrote:
On March 15, 2003 04:22 pm, Lionel Ulmer wrote:
Just to nitpick, in most of your patches, you have this :
if (TRACE_ON(ddraw)) {
DPRINTF(" Real caps are : "); DDRAW_dump_DDSCAPS2(&our_caps); DPRINTF("\n");
TRACE(" Real caps are : "); DDRAW_dump_DDSCAPS2(&our_caps); TRACE("\n");
As we use 'TRACE' now and not 'DPRINTF', the 'TRACE_ON' constructs could be removed.
This is why I said these needs manual review, so we can eliminate this type of tests. But personally I would have liked it a lot more if you could code these like so:
if (TRACE_ON(ddraw)) {
DPRINTF(" Real caps are : "); DDRAW_dump_DDSCAPS2(&our_caps); DPRINTF("\n");
TRACE(" Real caps are : %s\n", debugddscaps2(&our_caps));
That's what I did in listview.c, and the code looks a lot neater IMO. But then again, maybe that's just me.
I agree Dimi's suggestion. One of the reasons for this exerciese is to be able to compile out these messages. My thoughts on this at the time was to leave this in place since the dump function should not print and DDRAW_dump and the others still use DPRINTF. If I just removed the TRACE_ON check it would always print and that would not be good.
I think that there is still work to be done on this. All I did was a quick sweep with the broom. Some of the stuff that is left will require something more like saws and hammers.<g>.
This is why I said these needs manual review, so we can eliminate this type of tests. But personally I would have liked it a lot more if you could code these like so:
if (TRACE_ON(ddraw)) {
DPRINTF(" Real caps are : "); DDRAW_dump_DDSCAPS2(&our_caps); DPRINTF("\n");
TRACE(" Real caps are : %s\n", debugddscaps2(&our_caps));
Of course, I would like it better too if all the 'caps' functions could return an actual string and if we just could auto-magically do a 'TRACE(".. %s ..");'.
At the time I started adding all these dump functions to DDraw, I was aware of no good way to do that (ie with thread-safe string buffers guaranteed of sufficient size to use to print my caps in).
If now something like that is present in the debug tools, I would be more than happy to change all that (when I find time as I'm pretty short of it lately). Of course, if this is already documented how to do it, tell me to RTFM :-)
Lionel
Lionel Ulmer lionel.ulmer@free.fr writes:
If now something like that is present in the debug tools, I would be more than happy to change all that (when I find time as I'm pretty short of it lately). Of course, if this is already documented how to do it, tell me to RTFM :-)
There is wine_dbg_sprintf(). You can either use it directly, or if more convenient build the string into a stack buffer and then use wine_dbg_sprintf("%s") to copy it to the per-thread string buffer.