mark functions and vars as static (#146)
the goal here to mark functions and variables not used outside the translation unit as static. main reason for this is cleanliness. however as a side-effect this can help compilers optimize better as it now has guarantee that a certain function won't be called outside of that translation unit. one other side-effect of this is that accessing these vars/function from config.h is now different. if one wants to access a static var/func from different translation unit in config.h, he would have to create a wrapper function under the right ifdef. for static functions one would also need to forward declare it. here's a dummy example of accessing the function `run_key_handler` from config.h under _MAPPINGS_CONFIG ``` static void run_key_handler(const char *, unsigned); bool send_with_ctrl(arg_t key) { run_key_handler(XKeysymToString(key), ControlMask); return false; } ```
This commit is contained in:
2
nsxiv.h
2
nsxiv.h
@ -233,7 +233,6 @@ bool img_fit_win(img_t*, scalemode_t);
|
||||
bool img_zoom(img_t*, int);
|
||||
bool img_zoom_to(img_t*, float);
|
||||
bool img_pos(img_t*, float, float);
|
||||
bool img_move(img_t*, float, float);
|
||||
bool img_pan(img_t*, direction_t, int);
|
||||
bool img_pan_edge(img_t*, direction_t);
|
||||
void img_rotate(img_t*, degree_t);
|
||||
@ -283,7 +282,6 @@ struct opt {
|
||||
extern const opt_t *options;
|
||||
|
||||
void print_usage(void);
|
||||
void print_version(void);
|
||||
void parse_options(int, char**);
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user