Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
pointers can be implicitly converted to booleans, you don't need to compare to NULL
-
I think you should wrap your macro bodies in a do { ... } while(0) block to avoid dangling else and other potential unintended behavior
-
@offworld That is an interesting idea. I could slap just some braces {} around it, or put a else{} on the end too. Thanks.
-
@orhun I am not sure I can get rid of the goto. I will look into some potential RAII for this.
Related Rants
#define AUDIOLB_EXIT_ON_ERROR(hres) \
if (FAILED(hres)) { goto Exit; }
#define AUDIOLB_SAFE_RELEASE(punk) \
if ((punk) != NULL) \
{ (punk)->Release(); (punk) = NULL; }
Looking through old audio code I wrote. Found these macros. Will most likely reuse for a new project. It works damnit!
Do you feel lucky?!
random
old code
lol
will probably reuse