summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-03 17:09:31 +0000
committerrubidium <rubidium@openttd.org>2009-01-03 17:09:31 +0000
commit099022224f9eef0e9f4a01d83fea7217e6f83b86 (patch)
tree0c77597eda8bd41f5d61be3456938baf42eed730
parent455a6e4554f7b65e0c68bc9fe44ee558e5524ea3 (diff)
downloadopenttd-099022224f9eef0e9f4a01d83fea7217e6f83b86.tar.xz
(svn r14810) -Codechange: use the proper style for global variables.
-rw-r--r--src/music.cpp4
-rw-r--r--src/music.h2
-rw-r--r--src/music_gui.cpp4
-rw-r--r--src/strings.cpp2
4 files changed, 7 insertions, 5 deletions
diff --git a/src/music.cpp b/src/music.cpp
index e24cc97be..e755d2013 100644
--- a/src/music.cpp
+++ b/src/music.cpp
@@ -5,7 +5,7 @@
#include "stdafx.h"
#include "music.h"
-const SongSpecs origin_songs_specs[NUM_SONGS_AVAILABLE] = {
+const SongSpecs _origin_songs_specs[] = {
{"gm_tt00.gm", "Tycoon DELUXE Theme"},
{"gm_tt02.gm", "Easy Driver"},
{"gm_tt03.gm", "Little Red Diesel"},
@@ -29,3 +29,5 @@ const SongSpecs origin_songs_specs[NUM_SONGS_AVAILABLE] = {
{"gm_tt20.gm", "Jammit"},
{"gm_tt11.gm", "Hard Drivin'"},
};
+
+assert_compile(NUM_SONGS_AVAILABLE == lengthof(_origin_songs_specs));
diff --git a/src/music.h b/src/music.h
index 22726105d..cc131b24e 100644
--- a/src/music.h
+++ b/src/music.h
@@ -13,6 +13,6 @@ struct SongSpecs {
char song_name[64];
};
-extern const SongSpecs origin_songs_specs[NUM_SONGS_AVAILABLE];
+extern const SongSpecs _origin_songs_specs[];
#endif //MUSIC_H
diff --git a/src/music_gui.cpp b/src/music_gui.cpp
index 90f976db8..d81fb41d3 100644
--- a/src/music_gui.cpp
+++ b/src/music_gui.cpp
@@ -96,7 +96,7 @@ static void DoPlaySong()
{
char filename[MAX_PATH];
FioFindFullPath(filename, lengthof(filename), GM_DIR,
- origin_songs_specs[_music_wnd_cursong - 1].filename);
+ _origin_songs_specs[_music_wnd_cursong - 1].filename);
_music_driver->PlaySong(filename);
}
@@ -114,7 +114,7 @@ static void SelectSongToPlay()
do {
/* We are now checking for the existence of that file prior
* to add it to the list of available songs */
- if (FioCheckFileExists(origin_songs_specs[_playlists[msf.playlist][i] - 1].filename, GM_DIR)) {
+ if (FioCheckFileExists(_origin_songs_specs[_playlists[msf.playlist][i] - 1].filename, GM_DIR)) {
_cur_playlist[j] = _playlists[msf.playlist][i];
j++;
}
diff --git a/src/strings.cpp b/src/strings.cpp
index 2373a4c4e..a03354ae5 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -1189,7 +1189,7 @@ static char *GetSpecialNameString(char *buff, int ind, const int64 *argv, const
return GenPresidentName(buff, GetInt32(&argv), last);
case 4: // song names
- return strecpy(buff, origin_songs_specs[GetInt32(&argv) - 1].song_name, last);
+ return strecpy(buff, _origin_songs_specs[GetInt32(&argv) - 1].song_name, last);
}
/* town name? */