summaryrefslogtreecommitdiff
path: root/window.h
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-01-28 11:52:20 +0000
committerDarkvater <darkvater@openttd.org>2006-01-28 11:52:20 +0000
commita235c72b0da537a5c2aba5954edc80d1df332ef5 (patch)
tree44b3d557a239c7666908402b871f3893b7bc0604 /window.h
parent3924b84744ba1c3e362f9330c1e4d2f615fe227e (diff)
downloadopenttd-a235c72b0da537a5c2aba5954edc80d1df332ef5.tar.xz
(svn r3461) - Fix: Increase window-size as for 64-bit machines it wasn't enough
Diffstat (limited to 'window.h')
-rw-r--r--window.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/window.h b/window.h
index 42f71d125..2caef2abe 100644
--- a/window.h
+++ b/window.h
@@ -253,12 +253,10 @@ typedef struct querystr_d {
} querystr_d;
#define WP(ptr,str) (*(str*)(ptr)->custom)
-// querystr_d is the largest struct that comes in w->custom
-// because 64-bit systems use 64-bit pointers, it is bigger on a 64-bit system
-// than on a 32-bit system. Therefore, the size is calculated from querystr_d
-// instead of a hardcoded number.
-// if any struct becomes bigger the querystr_d, it should be replaced.
-#define WINDOW_CUSTOM_SIZE sizeof(querystr_d) * 2
+/* You cannot 100% reliably calculate the biggest custom struct as
+ * the number of pointers in it and alignment will have a huge impact.
+ * 88 is the largest window-size for 64-bit machines currently */
+#define WINDOW_CUSTOM_SIZE 88
typedef struct Scrollbar {
uint16 count, cap, pos;