Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 367
Power management and other comments + constify ipc_buffer_new#4441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
503740a7a906f22412748c48ddf6File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -119,10 +119,26 @@ | ||
| #define PP_NARG(...) (sizeof((unsigned int[]){0, ##__VA_ARGS__}) \ | ||
| / sizeof(unsigned int) - 1) | ||
| /* compile-time assertion */ | ||
| /* Compile-time assertion. | ||
| * | ||
| * The first, typedef-based solution silently succeeds with variables, | ||
| * for instance STATIC_ASSERT(n == 42, always_succeeds) when 'n' is a | ||
| * variable in a function. The second, array-based solution is not | ||
| * fooled by variables but it increases the .bss size at the -O0 | ||
| * optimization level (no difference with any real -O). As we're often | ||
| * short on space, use the typedef-based version by default. If you're | ||
| * afraid that some assertions are being fooled by variables then | ||
| * temporarily and locally switch to the second one. | ||
| */ | ||
| #if 1 | ||
| #define STATIC_ASSERT(COND, MESSAGE) \ | ||
| __attribute__((unused)) \ | ||
| typedef char META_CONCAT(assertion_failed_, MESSAGE)[(COND) ? 1 : -1] | ||
| #else | ||
| #define STATIC_ASSERT(COND, MESSAGE) \ | ||
| __attribute__((unused)) \ | ||
| static char META_CONCAT(arr_assertion_failed_, MESSAGE)[(COND) ? 1 : -1] | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does it have to be CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Depends where you prefer to waste a few bytes per assertion at the
That was for aligning with the other one but not very useful, I can remove.
| ||
| #endif | ||
| /* Allows checking preprocessor symbols in compile-time. | ||
| * Returns true for config with value 1, false for undefined or any other value. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are probably missing other const usage wrt IPC too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, this one just came up when looking at your valgrind fixes.