diff options
author | tron <tron@openttd.org> | 2005-07-28 09:41:09 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-07-28 09:41:09 +0000 |
commit | ff61e34d6c62f8fe06b140b54a2d2b7098a6c154 (patch) | |
tree | 082c4b30a3afd942355fc1c59fe80fb222b6b690 | |
parent | 04f4d8237b879e3bb7c61a84cfbb5146cd408111 (diff) | |
download | openttd-ff61e34d6c62f8fe06b140b54a2d2b7098a6c154.tar.xz |
(svn r2737) static, const and don't make variables public nobody else needs to know about
-rw-r--r-- | driver.c | 24 | ||||
-rw-r--r-- | hal.h | 10 |
2 files changed, 15 insertions, 19 deletions
@@ -24,22 +24,28 @@ #include "video/sdl_v.h" #include "video/win32_v.h" -typedef struct { +typedef struct DriverDesc { + const char* name; + const char* longname; + const void* drv; +} DriverDesc; + +typedef struct DriverClass { const DriverDesc *descs; const char *name; void *var; } DriverClass; -static DriverClass _driver_classes[] = { +static const DriverDesc _video_driver_descs[]; +static const DriverDesc _sound_driver_descs[]; +static const DriverDesc _music_driver_descs[]; + +static const DriverClass _driver_classes[] = { {_video_driver_descs, "video", &_video_driver}, {_sound_driver_descs, "sound", &_sound_driver}, {_music_driver_descs, "music", &_music_driver}, }; -enum { - DF_PRIORITY_MASK = 0xF, -}; - static const DriverDesc* GetDriverByName(const DriverDesc* dd, const char* name) { for (; dd->name != NULL; dd++) { @@ -156,7 +162,7 @@ void GetDriverList(char* p) } -const DriverDesc _music_driver_descs[] = { +static const DriverDesc _music_driver_descs[] = { #ifdef __BEOS__ { "bemidi", "BeOS MIDI Driver", &_bemidi_music_driver }, #endif @@ -178,7 +184,7 @@ const DriverDesc _music_driver_descs[] = { { NULL, NULL, NULL} }; -const DriverDesc _sound_driver_descs[] = { +static const DriverDesc _sound_driver_descs[] = { #ifdef WIN32 { "win32", "Win32 WaveOut Driver", &_win32_sound_driver }, #endif @@ -189,7 +195,7 @@ const DriverDesc _sound_driver_descs[] = { { NULL, NULL, NULL} }; -const DriverDesc _video_driver_descs[] = { +static const DriverDesc _video_driver_descs[] = { #ifdef WIN32 { "win32", "Win32 GDI Video Driver", &_win32_video_driver }, #endif @@ -37,12 +37,6 @@ typedef struct { void (*set_volume)(byte vol); } HalMusicDriver; -typedef struct { - const char *name; - const char *longname; - const void *drv; -} DriverDesc; - enum { HALERR_OK = 0, HALERR_ERROR = 1, @@ -52,10 +46,6 @@ VARDEF HalMusicDriver *_music_driver; VARDEF HalSoundDriver *_sound_driver; VARDEF HalVideoDriver *_video_driver; -extern const DriverDesc _video_driver_descs[]; -extern const DriverDesc _sound_driver_descs[]; -extern const DriverDesc _music_driver_descs[]; - enum DriverType { VIDEO_DRIVER = 0, SOUND_DRIVER = 1, |