(svn r2799) Make the only two non-const widget lists const
authortron
Wed, 03 Aug 2005 13:07:29 +0000
changeset 2275 11a1dac70c45
parent 2274 2c99425c1086
child 2276 910e10dae3c3
(svn r2799) Make the only two non-const widget lists const
misc_gui.c
train_gui.c
--- a/misc_gui.c	Wed Aug 03 11:08:13 2005 +0000
+++ b/misc_gui.c	Wed Aug 03 13:07:29 2005 +0000
@@ -615,7 +615,7 @@
 	AddTextEffect(STR_FEEDER, pt.x, pt.y, 0x250);
 }
 
-static Widget _tooltips_widgets[] = {
+static const Widget _tooltips_widgets[] = {
 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   199,     0,    31, 0x0, STR_NULL},
 {   WIDGETS_END},
 };
@@ -665,9 +665,6 @@
 		right = 200;
 	}
 
-	_tooltips_widgets[0].right = right;
-	_tooltips_widgets[0].bottom = bottom;
-
 	y = _cursor.pos.y + 30;
 	if (y < 22) y = 22;
 
@@ -681,6 +678,8 @@
 	w = AllocateWindow(x, y, right, bottom, TooltipsWndProc, WC_TOOLTIPS, _tooltips_widgets);
 	WP(w,tooltips_d).string_id = string_id;
 	w->flags4 &= ~WF_WHITE_BORDER_MASK;
+	w->widget[0].right = right;
+	w->widget[0].bottom = bottom;
 }
 
 
--- a/train_gui.c	Wed Aug 03 11:08:13 2005 +0000
+++ b/train_gui.c	Wed Aug 03 13:07:29 2005 +0000
@@ -879,7 +879,7 @@
 	WP(w,refit_d).sel = -1;
 }
 
-static Widget _train_view_widgets[] = {
+static const Widget _train_view_widgets[] = {
 { WWT_CLOSEBOX,   RESIZE_NONE,  14,   0,  10,   0,  13, STR_00C5, STR_018B_CLOSE_WINDOW },
 { WWT_CAPTION,    RESIZE_RIGHT, 14,  11, 237,   0,  13, STR_882E, STR_018C_WINDOW_TITLE_DRAG_THIS },
 { WWT_STICKYBOX,  RESIZE_LR,    14, 238, 249,   0,  13, 0x0,      STR_STICKY_BUTTON },