-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Remove most of the silly warnings #3613
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
Windows defines `timeval` with `long`, which we cannot sanely cope with. Instead, use a custom timeval struct.
@@ -135,7 +135,7 @@ static git_tree_entry *alloc_entry(const char *filename) | |||
|
|||
struct tree_key_search { | |||
const char *filename; | |||
uint16_t filename_len; | |||
size_t filename_len; |
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.
This makes the filename_len
field a different size for the field in the git_tree_entry
which I'd rather avoid.
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.
Hm, yes that's true. A quick perusal of the git source shows that they use an unsigned int
here for the tree entry length.
There's an obvious compatibility issue here, then. And although I'm not surprised that we haven't run into it yet, one can certainly imagine a world where somebody is using git as a general data exchange mechanism (perhaps not directly related to filesystem or filename sizes) and a uint16_t
is too small to hold the tree entries. So we should probably increase git_tree_entry
's size as well.
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 only just moved to 16 bits. This is in part to reduce the size and improve the alignment of the tree entries, and partly to make sure we can allocate the entries in the pool. We figured that 16 bits is more than actual OSs allow you to use for file names, and we're not going to go out of our way to support people who should be using actual databases.
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.
Updated to use uint16_t
.
Remove most of the silly warnings
Fix up some of the silly warning: correct casts, constness, etc. This doesn't get us to zero warnings on all platforms, but it gets us closer.