On Tue Feb 21 05:22:44 2023 +0000, Zebediah Figura wrote:
The fact that DEFAULT_ERROR is 0xdeadbeef makes the GetLastError() test less interesting. The fact that DEFAULT_ERROR is a macro makes this above observation less obvious, which is one reason I would just write it out everywhere. (Also, there's a dead assignment to "ret" in here.)
It's to show that the function doesn't call `SetLastError`, but it's not really needed so I'll remove that block.
So get rid of the DEFAULT_ERROR macro and replace all instances with `0xdeadbeef`? I always thought it was good practice to define variables that are used repeatedly. Though, it doesn't really make a difference in this case, win32_error can be anything for the unsupported codes.
But IMO it looks clearer with DEFAULT_ERROR. It doesn't really matter to me so it's up to you.