summaryrefslogtreecommitdiff
path: root/src/news_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-03-23 11:48:05 +0000
committersmatz <smatz@openttd.org>2009-03-23 11:48:05 +0000
commitc299bac5be4e5c1cd00f6218f7507a78479dcecc (patch)
tree3a2f4cbf8f42be535eaf63539c41f5958f7bc827 /src/news_gui.cpp
parentc91f965f0831867e9b971c119da11aed6c37077e (diff)
downloadopenttd-c299bac5be4e5c1cd00f6218f7507a78479dcecc.tar.xz
(svn r15830) -Codechange: don't use fixed size of array in news_gui.cpp and news_func.h
Diffstat (limited to 'src/news_gui.cpp')
-rw-r--r--src/news_gui.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index 32d03f56b..c35c23fde 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -104,7 +104,7 @@ struct NewsSubtypeData {
/**
* Data common to all news items of a given subtype (actual data)
*/
-static const struct NewsSubtypeData _news_subtype_data[NS_END] = {
+static const NewsSubtypeData _news_subtype_data[] = {
/* type, display_mode, flags, callback */
{ NT_ARRIVAL_COMPANY, NM_THIN, NF_VIEWPORT|NF_VEHICLE, NULL }, ///< NS_ARRIVAL_COMPANY
{ NT_ARRIVAL_OTHER, NM_THIN, NF_VIEWPORT|NF_VEHICLE, NULL }, ///< NS_ARRIVAL_OTHER
@@ -127,10 +127,12 @@ static const struct NewsSubtypeData _news_subtype_data[NS_END] = {
{ NT_GENERAL, NM_NORMAL, NF_TILE, NULL }, ///< NS_GENERAL
};
+assert_compile(lengthof(_news_subtype_data) == NS_END);
+
/**
* Per-NewsType data
*/
-NewsTypeData _news_type_data[NT_END] = {
+NewsTypeData _news_type_data[] = {
/* name, age, sound, display */
{ "arrival_player", 60, SND_1D_APPLAUSE, ND_FULL }, ///< NT_ARRIVAL_COMPANY
{ "arrival_other", 60, SND_1D_APPLAUSE, ND_FULL }, ///< NT_ARRIVAL_OTHER
@@ -149,6 +151,8 @@ NewsTypeData _news_type_data[NT_END] = {
{ "general", 60, SND_BEGIN, ND_FULL }, ///< NT_GENERAL
};
+assert_compile(lengthof(_news_type_data) == NT_END);
+
struct NewsWindow : Window {
uint16 chat_height;
NewsItem *ni;