Is this good programming style?
Let's say I wanted to reuse a set of global variables in multiple functions, but I don't want to call them arg1, arg2, etc within the function.
Can I just use #define to give arg1 a fancy new name to use just for that function? Like...
#define X_velocity arg1
And then in another function use the same generic global variable with a different #define
#define frame_count arg1
Does that seem like a good idea? Assuming I'm not nesting these two functions together, and using the same global, or is this style just potentially error prone?
EDIT, and if you're wondering why I just don't use the C stack and/or local variables... they seem to be significantly slower than global variables.
Let's say I wanted to reuse a set of global variables in multiple functions, but I don't want to call them arg1, arg2, etc within the function.
Can I just use #define to give arg1 a fancy new name to use just for that function? Like...
#define X_velocity arg1
And then in another function use the same generic global variable with a different #define
#define frame_count arg1
Does that seem like a good idea? Assuming I'm not nesting these two functions together, and using the same global, or is this style just potentially error prone?
EDIT, and if you're wondering why I just don't use the C stack and/or local variables... they seem to be significantly slower than global variables.