diff options
author | smatz <smatz@openttd.org> | 2009-09-04 23:02:52 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-09-04 23:02:52 +0000 |
commit | 0bfea0646c93e627cbf2f358aea57dbf8eb8abfe (patch) | |
tree | 618ffc9ef0a15953d1b016302bef2643c9387722 /src | |
parent | ae9441aa4628e2e559ea8f7e490e13ea0be34bab (diff) | |
download | openttd-0bfea0646c93e627cbf2f358aea57dbf8eb8abfe.tar.xz |
(svn r17420) -Codechange: replace assert() by assert_compile() where possible
Diffstat (limited to 'src')
-rw-r--r-- | src/economy.cpp | 2 | ||||
-rw-r--r-- | src/graph_gui.cpp | 4 | ||||
-rw-r--r-- | src/misc_gui.cpp | 2 | ||||
-rw-r--r-- | src/newgrf.cpp | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/economy.cpp b/src/economy.cpp index 335889d83..4e8bbc252 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -738,7 +738,7 @@ void StartupEconomy() { int i; - assert(sizeof(_price) == NUM_PRICES * sizeof(Money)); + assert_compile(sizeof(_price) == NUM_PRICES * sizeof(Money)); /* Setup price bases */ for (i = 0; i < NUM_PRICES; i++) { diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 0bd219d7b..8ba32105d 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -213,7 +213,7 @@ protected: /* the colours and cost array of GraphDrawer must accomodate * both values for cargo and companies. So if any are higher, quit */ - assert(GRAPH_MAX_DATASETS >= (int)NUM_CARGO && GRAPH_MAX_DATASETS >= (int)MAX_COMPANIES); + assert_compile(GRAPH_MAX_DATASETS >= (int)NUM_CARGO && GRAPH_MAX_DATASETS >= (int)MAX_COMPANIES); assert(this->num_vert_lines > 0); byte grid_colour = _colour_gradient[COLOUR_GREY][4]; @@ -1244,7 +1244,7 @@ static NWidgetBase *MakePerformanceDetailPanels(int *biggest_index) STR_PERFORMANCE_DETAIL_TOTAL_TOOLTIP, }; - assert(lengthof(performance_tips) == SCORE_END - SCORE_BEGIN); + assert_compile(lengthof(performance_tips) == SCORE_END - SCORE_BEGIN); NWidgetVertical *vert = new NWidgetVertical(); for (int widnum = PRW_SCORE_FIRST; widnum <= PRW_SCORE_LAST; widnum++) { diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 4e5a1d93d..e03224cf9 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -788,7 +788,7 @@ struct TooltipsWindow : public Window Window(x, y, width, height, WC_TOOLTIPS, widget) { this->string_id = str; - assert(sizeof(this->params[0]) == sizeof(params[0])); + assert_compile(sizeof(this->params[0]) == sizeof(params[0])); assert(paramcount <= lengthof(this->params)); memcpy(this->params, params, sizeof(this->params[0]) * paramcount); this->paramcount = paramcount; diff --git a/src/newgrf.cpp b/src/newgrf.cpp index a3003aee8..1e77d8a6e 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -5652,7 +5652,7 @@ static void InitNewGRFFile(const GRFConfig *config, int sprite_offset) newfile->traininfo_vehicle_width = TRAININFO_DEFAULT_VEHICLE_WIDTH; /* Copy the initial parameter list */ - assert(lengthof(newfile->param) == lengthof(config->param) && lengthof(config->param) == 0x80); + assert_compile(lengthof(newfile->param) == lengthof(config->param) && lengthof(config->param) == 0x80); newfile->param_end = config->num_params; memcpy(newfile->param, config->param, sizeof(newfile->param)); |