libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
8.47k stars 1.59k forks source link

Magic numbers #9764

Closed Sackzement closed 2 weeks ago

Sackzement commented 3 weeks ago

Here is a list of some magic numbers in the headers.

SDL_GamepadSensorEvent.data[3]
SDL_SensorEvent.data[6]
SDL_Event.padding[128]
SDL_GUID.data[16]
SDL_HapticDirection.dir[3]
SDL_HapticCondition.right_sat[3]
SDL_HapticCondition.left_sat[3]
SDL_HapticCondition.right_coeff[3]
SDL_HapticCondition.left_coeff[3]
SDL_HapticCondition.deadband[3]
SDL_HapticCondition.center[3]

I was trying to replace some of these with a more descriptive macro constant or struct type. But some of these are obvious enough and some can't be replaced by a struct because their used parameters and meaning vary.

Any thoughts?

slouken commented 2 weeks ago

I think we can leave them.