-
Notifications
You must be signed in to change notification settings - Fork 955
Delete unused declaration. #400
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #400 +/- ##
============================================
+ Coverage 68.33% 68.38% +0.04%
============================================
Files 108 108
Lines 61563 61563
============================================
+ Hits 42072 42099 +27
+ Misses 19491 19464 -27 |
Signed-off-by: Lipeng Zhu <[email protected]>
src/dict.h
Outdated
| #ifndef DICT_H | ||
| #define DICT_H |
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.
Why rename this? It's a fairly common pattern in other code. I'm not sure if there is a strong reason to change it.
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.
I remember @zuiderkwast requested such similar renaming because the leading double underscore which is a reserved name by the C standard.
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.
I mostly meant that when we're anyway renaming things like __REDIS_XYZ, we can drop the leading underscores at the same time.
I don't think we want do it all over the code base. (Sorry if I said that.)
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.
What's the motivation to drop the leading underscores? It's just a little bit less consistent now.
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.
They're reserved names in C.
https://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html
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.
I don't think it will ever be a problem, unless name macros __ARM or something like that.
If you prefer to keep double underscores for consistency, I can accept that.
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.
@lipzhu Please revert back to __DICT_H. If we ever want to change all these reserved names (for some kind of validator in the future) we can fix all files at the same time.
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.
If you prefer to keep double underscores for consistency, I can accept that.
I had read that reserved-names doc multiple times, and never noticed __ clause. I would prefer we keep what we have (since there isn't a conflict), but moving forward use the style that we mentioned here.
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.
In case you still didn't find it:
In addition to the names documented in this manual, reserved names include all external identifiers (global functions and variables) that begin with an underscore (‘_’) and all identifiers regardless of use that begin with either two underscores or an underscore followed by a capital letter are reserved names.
Signed-off-by: Lipeng Zhu <[email protected]>
Delete unused declaration `void *dictEntryMetadata(dictEntry *de);` in dict.h. --------- Signed-off-by: Lipeng Zhu <[email protected]>
Delete unused declaration
void *dictEntryMetadata(dictEntry *de);in dict.h.