Bug 5070 - Let private functions be 'static' within tr_font.c
Status: RESOLVED WONTFIX
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: GIT MASTER
Hardware: All All
: P3 trivial
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2011-07-08 09:38 EDT by uZu
Modified: 2011-07-10 16:22:42 EDT
2 users (show)

See Also:


Attachments
Add 'static' for private functions in tr_font.c (1.54 KB, patch)
2011-07-08 09:38 EDT, uZu

Description uZu 2011-07-08 09:38:46 EDT
Created attachment 2815 [details]
Add 'static' for private functions in tr_font.c

Hi there,
here is another huge change ^^
The included patch adds 'static' in front of the functions declarations in tr_font.c; of course, not all the functions are affected, only those with a limited/private scope.
Comment 1 Thilo Schulz 2011-07-08 20:04:57 EDT
What use is there in applying this patch, other than making it more difficult for engine forks to merge these changes?
Comment 2 uZu 2011-07-09 05:03:09 EDT
As a custom engine dev, I disagree for I don't think it's "more difficult", I actually reckon it's easier as it removes 1 patch on my side.
Anyway, I sincerely thought the main goal of this project was to maintain a clean and improved code base, this is why I sent this patch(*); just thought it would be better to have this made upstream but if you disagree that's ok to me ^^

(*) this is why I also sent my questions about the cvar naming scheme to the ML, http://lists.ioquake.org/pipermail/ioquake3-ioquake.org/2011-July/004655.html
Comment 3 Thilo Schulz 2011-07-10 04:55:47 EDT
I simply don't think it's worth it. Why do you only make functions in tr_font.c static? There's lots of other functions in other files that could be declared "static" then. I don't even really consider this a cleanup. It's not imperative that functions used locally only are to be declared static.
so WONTFIX
Comment 4 uZu 2011-07-10 05:09:22 EDT
I only altered tr_font.c because I was working on a piece of code related to this file, also I prefer doing small, atomic changes instead of a big patch. If you were interrested in specifying 'static' for every private function in the whole code, I guess it could have been done smoothly and files by files.
But that's ok to me anyway and I understand your refusal.
Comment 5 Ben Millwood 2011-07-10 16:22:42 EDT
I wrote a patch once to use GCC's compilation information gathering (via -aux-info) to add static to all sorts of functions only used in their file. It was huge. The benefits are reduced executable size (but not by a very impressive amount) and GCC can provide more warnings (e.g. for unused functions) because it knows a particular function can't be used outside of some file. Neither are really major though.