mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use size_t for array iteration
This commit is contained in:
parent
dc7f4bcf89
commit
d19727afc7
|
@ -270,7 +270,7 @@ extern rct_object_entry RequiredSelectedObjects[7];
|
|||
*/
|
||||
static void research_scenery_sets_setup(){
|
||||
|
||||
for (sint32 i = 0; i < Util::CountOf(RequiredSelectedObjects); i++) {
|
||||
for (size_t i = 0; i < Util::CountOf(RequiredSelectedObjects); i++) {
|
||||
rct_object_entry * object = &RequiredSelectedObjects[i];
|
||||
|
||||
uint8 entry_type, entry_index;
|
||||
|
|
|
@ -193,7 +193,7 @@ static void window_music_credits_scrollpaint(rct_window *w, rct_drawpixelinfo *d
|
|||
|
||||
sint32 y = 2;
|
||||
|
||||
for (sint32 i = 0; i < Util::CountOf(music_credits); i++) {
|
||||
for (size_t i = 0; i < Util::CountOf(music_credits); i++) {
|
||||
gfx_draw_string_centred(dpi, music_credits[i], x, y, COLOUR_BLACK, NULL);
|
||||
y += 10;
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ static void window_music_credits_scrollpaint(rct_window *w, rct_drawpixelinfo *d
|
|||
gfx_fill_rect_inset(dpi, 4, y, 484, y+1, w->colours[1], INSET_RECT_FLAG_BORDER_INSET);
|
||||
y += 11;
|
||||
|
||||
for (sint32 i = 0; i < Util::CountOf(music_credits_rct2); i++) {
|
||||
for (size_t i = 0; i < Util::CountOf(music_credits_rct2); i++) {
|
||||
gfx_draw_string_centred(dpi, music_credits_rct2[i], x, y, COLOUR_BLACK, NULL);
|
||||
y += 10;
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ static void window_news_options_mouseup(rct_window *w, rct_widgetindex widgetInd
|
|||
sint32 checkBoxIndex = widgetIndex - WIDX_CHECKBOX_0;
|
||||
if (checkBoxIndex >= 0) {
|
||||
sint32 matchIndex = 0;
|
||||
for (sint32 i = 0; i < Util::CountOf(NewsItemOptionDefinitions); i++) {
|
||||
for (size_t i = 0; i < Util::CountOf(NewsItemOptionDefinitions); i++) {
|
||||
const notification_def *ndef = &NewsItemOptionDefinitions[i];
|
||||
if (ndef->category != w->page) continue;
|
||||
|
||||
|
@ -214,7 +214,7 @@ static void window_news_options_invalidate(rct_window *w)
|
|||
|
||||
sint32 checkboxWidgetIndex = WIDX_CHECKBOX_0;
|
||||
rct_widget *checkboxWidget = &w->widgets[checkboxWidgetIndex];
|
||||
for (sint32 i = 0; i < Util::CountOf(NewsItemOptionDefinitions); i++) {
|
||||
for (size_t i = 0; i < Util::CountOf(NewsItemOptionDefinitions); i++) {
|
||||
const notification_def *ndef = &NewsItemOptionDefinitions[i];
|
||||
if (ndef->category != w->page) continue;
|
||||
|
||||
|
|
|
@ -4822,8 +4822,8 @@ static void window_ride_music_mousedown(rct_window *w, rct_widgetindex widgetInd
|
|||
if (ride->type == RIDE_TYPE_MERRY_GO_ROUND) {
|
||||
window_ride_current_music_style_order[numItems++] = MUSIC_STYLE_FAIRGROUND_ORGAN;
|
||||
} else {
|
||||
for (i = 0; i < Util::CountOf(MusicStyleOrder); i++)
|
||||
window_ride_current_music_style_order[numItems++] = MusicStyleOrder[i];
|
||||
for (size_t n = 0; n < Util::CountOf(MusicStyleOrder); n++)
|
||||
window_ride_current_music_style_order[numItems++] = MusicStyleOrder[n];
|
||||
|
||||
if (gRideMusicInfoList[36]->length != 0)
|
||||
window_ride_current_music_style_order[numItems++] = MUSIC_STYLE_CUSTOM_MUSIC_1;
|
||||
|
|
|
@ -378,7 +378,7 @@ static void window_ride_list_dropdown(rct_window *w, rct_widgetindex widgetIndex
|
|||
|
||||
sint32 informationType = INFORMATION_TYPE_STATUS;
|
||||
uint32 arg = (uint32)gDropdownItemsArgs[dropdownIndex];
|
||||
for (sint32 i = 0; i < Util::CountOf(ride_info_type_string_mapping); i++) {
|
||||
for (size_t i = 0; i < Util::CountOf(ride_info_type_string_mapping); i++) {
|
||||
if (arg == ride_info_type_string_mapping[i]) {
|
||||
informationType = i;
|
||||
}
|
||||
|
|
|
@ -748,7 +748,7 @@ static void window_top_toolbar_invalidate(rct_window *w)
|
|||
// Align left hand side toolbar buttons
|
||||
firstAlignment = 1;
|
||||
x = 0;
|
||||
for (sint32 i = 0; i < Util::CountOf(left_aligned_widgets_order); ++i) {
|
||||
for (size_t i = 0; i < Util::CountOf(left_aligned_widgets_order); ++i) {
|
||||
widgetIndex = left_aligned_widgets_order[i];
|
||||
widget = &window_top_toolbar_widgets[widgetIndex];
|
||||
if (widget->type == WWT_EMPTY && widgetIndex != WIDX_SEPARATOR)
|
||||
|
@ -769,7 +769,7 @@ static void window_top_toolbar_invalidate(rct_window *w)
|
|||
sint32 screenWidth = context_get_width();
|
||||
firstAlignment = 1;
|
||||
x = Math::Max(640, screenWidth);
|
||||
for (sint32 i = 0; i < Util::CountOf(right_aligned_widgets_order); ++i) {
|
||||
for (size_t i = 0; i < Util::CountOf(right_aligned_widgets_order); ++i) {
|
||||
widgetIndex = right_aligned_widgets_order[i];
|
||||
widget = &window_top_toolbar_widgets[widgetIndex];
|
||||
if (widget->type == WWT_EMPTY && widgetIndex != WIDX_SEPARATOR)
|
||||
|
|
Loading…
Reference in New Issue