use 64 bits variable to store memory size #456
Merged
SlavekB
merged 1 commits from freebsd-info-memory
into master
2 months ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'freebsd-info-memory'
Deleting a branch is permanent. It CANNOT be undone. Continue?
int is too small to store modern memory size
Signed-off-by: Denis Kozadaev denis@dilos.org
Make sense, good catch, but there is one more thing...
char blah[10], buf[80], *used_str, *total_str;
/* Stuff for sysctl */
int memory;
unsigned long memory;
There is an
snprintf()
later which would require a format specifier change, but it andblah
seems not to be used anyway, so it would be better to remove those both altogether...Macro MEMORY() used to cast the variable to t_memory (aka unsigned long), there is no reason to change anything because the variable is already unsigned long type.
err: t_memsize instead of t_memory
by the way, the result of snprintf is not used anywhere and the line could be removed
yes, that's exactly what I'm talking about: remove
snprintf
and the bufferblah
as they aren't used.If it were used, it'd require to change the format
%d
->%ul
Please, you can add a prefix in the commit message, for example:
kcontrol-info-memory:
to make it clear to the git log, what is it?54e9ec4d1f
to8bc4276855
2 months ago8bc4276855
to220dec20f9
2 months agoLGTM now (assuming Slavek's commit message notice will be fixed)
It looks good, thank you.
Yes, committ message is now good. Although after the squash has disappeared information about the drop of unnecessary snprintf, but this is not essential.
220dec20f9
into master 2 months agoReviewers
220dec20f9
.