[PATCH] user32: Turn magic values into static constants.
Alex Henrie
alexhenrie24 at gmail.com
Thu Nov 5 22:00:40 CST 2015
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
dlls/user32/button.c | 2 +-
dlls/user32/edit.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/button.c b/dlls/user32/button.c
index db479a8..890d154 100644
--- a/dlls/user32/button.c
+++ b/dlls/user32/button.c
@@ -201,7 +201,7 @@ static inline void paint_button( HWND hwnd, LONG style, UINT action )
/* retrieve the button text; returned buffer must be freed by caller */
static inline WCHAR *get_button_text( HWND hwnd )
{
- INT len = 512;
+ static const INT len = 512;
WCHAR *buffer = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) );
if (buffer) InternalGetWindowText( hwnd, buffer, len + 1 );
return buffer;
diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c
index dfd72e8..4570073 100644
--- a/dlls/user32/edit.c
+++ b/dlls/user32/edit.c
@@ -2883,7 +2883,7 @@ static void EDIT_EM_SetLimitText(EDITSTATE *es, UINT limit)
*/
static int calc_min_set_margin_size(HDC dc, INT left, INT right)
{
- WCHAR magic_string[] = {'\'','*','*','\'', 0};
+ static const WCHAR magic_string[] = {'\'','*','*','\'', 0};
SIZE sz;
GetTextExtentPointW(dc, magic_string, sizeof(magic_string)/sizeof(WCHAR) - 1, &sz);
--
2.6.2
More information about the wine-patches
mailing list