Ok I really hope this is not a common way to format macros.
a. it looks horrible if someone views your code with a different tab with (something something indentation width accessibility) , which is why you don't use tabs for alignment (its also the only instance of tabs being used for alignment)
b. its not even aligned on the tab size I presume the code was written in (the indentation size every where else and the only size that makes those lines with a tab align)
c. some lines have a single space before the tab padding (or backslash for that one line without tabbing)
d. the visual line length seems to be arbitrary, at 106 characters, since there are other longer lines in the file
e. the macro name mimics the naming convention of vulkan's own macros
f. why is there a double space after the comma ?
g. why are you printing a message to stdout
instead of stderr
?
h. vulkan has (at least now) a function to represent the VkResult
enum as a string (string_VkResult
) which would give way more information than the error code itself
i. this macro isn't really amazing if you want to react to any of the non error return codes that aren't VK_SUCCESS
(ex VK_NOT_READY
)
j. small nitpick but I would also use either __FUNCTION__
or __PRETTY_FUNCTION__
so that you can more quickly get an idea where the issue happened (though the assert will give you that information anyway)
k. why bother with the assert if you already printed a message and not just exit? I assume not to leave a core dump
l. oh and there is no ability for the developer to add any extra information to the exit message , yay
@minekpo1 I think clang format does this automatically
@gfaster I quickly went through all of clang-format's built in styles (setting IndentWidth
to 4) and each style:
a. uses spaces not tabs for padding
b. pads to a "nice" width (80, 120, etc)
c. does not match the style of this dev
d. doesnt leave out one line without padding
decided to run the project through clang-tidy and apparently , after explicitly checking a file didn't open , the program only prints a message (to stdout) and continues on , which then segfaults
oh and despite it being a c++ file , its pretty much just c but with (a single instance of) classes
@minekpo1 huh, I wonder if it's another editor-local formatter or something. That's kinda wild.