On Wed Aug 21 13:01:35 2024 +0000, Vibhav Pant wrote:
Note that if you're using DWORD (and you could just as easily use
"unsigned int" instead) you probably want "%lu" rather than casting to int. Yeah, I was a little confused if there's a format specification convention used by Wine for unsigned type variables used for storing size. Except for `%#Ix` used to `SIZE_T`, I could only see `ULONG`s being cast to int and then being printed with `%d`, so that's what I went with to be safe. But yeah, `%lu` makes more sense.
I think %u/%d vs %#x is mostly a matter of "best judgement", but in general you should use the right signed variant, and in PE code you shouldn't need to cast to get the right length specifier (though it may require a bit of extra knowledge: %d for int, %ld for long [which is always 32-bit on Windows], %Id for anything pointer-size, %I64d for 64-bit types [note that 'long long' is always 64-bit, but can't be used.])