From 31deafe153143745ca23d7556e94340b73413b31 Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Fri, 30 Nov 2018 00:14:11 -0700 Subject: [PATCH] mshtml: Turn several constants and variables into static constants. Signed-off-by: Alex Henrie Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/mshtml/htmllocation.c | 2 +- dlls/mshtml/htmlstyle.c | 2 +- dlls/mshtml/navigate.c | 2 +- dlls/mshtml/script.c | 6 +++--- dlls/mshtml/txtrange.c | 2 +- dlls/mshtml/view.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/mshtml/htmllocation.c b/dlls/mshtml/htmllocation.c index 769951643c7..4b8a07a6e63 100644 --- a/dlls/mshtml/htmllocation.c +++ b/dlls/mshtml/htmllocation.c @@ -350,7 +350,7 @@ static HRESULT WINAPI HTMLLocation_get_host(IHTMLLocation *iface, BSTR *p) if(url.nPort) { /* : */ - const WCHAR format[] = {'%','u',0}; + static const WCHAR format[] = {'%','u',0}; DWORD len, port_len; WCHAR portW[6]; WCHAR *buf; diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 20930aa9ed5..7b823499ac8 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -1160,8 +1160,8 @@ static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR ex static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value) { + static const WCHAR szFormat[] = {'%','.','0','f','p','x',0}; WCHAR szValue[25]; - WCHAR szFormat[] = {'%','.','0','f','p','x',0}; value = floor(value); diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index f331cfdef57..286c4e20d5f 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -2067,7 +2067,7 @@ static HRESULT navigate_fragment(HTMLOuterWindow *window, IUri *uri) nsresult nsres; HRESULT hres; - const WCHAR selector_formatW[] = {'a','[','i','d','=','"','%','s','"',']',0}; + static const WCHAR selector_formatW[] = {'a','[','i','d','=','"','%','s','"',']',0}; set_current_uri(window, uri); diff --git a/dlls/mshtml/script.c b/dlls/mshtml/script.c index d7b4e92310e..de2bb7f2d4e 100644 --- a/dlls/mshtml/script.c +++ b/dlls/mshtml/script.c @@ -1171,11 +1171,11 @@ static GUID get_default_script_guid(HTMLInnerWindow *window) static BOOL get_guid_from_type(LPCWSTR type, GUID *guid) { - const WCHAR text_javascriptW[] = + static const WCHAR text_javascriptW[] = {'t','e','x','t','/','j','a','v','a','s','c','r','i','p','t',0}; - const WCHAR text_jscriptW[] = + static const WCHAR text_jscriptW[] = {'t','e','x','t','/','j','s','c','r','i','p','t',0}; - const WCHAR text_vbscriptW[] = + static const WCHAR text_vbscriptW[] = {'t','e','x','t','/','v','b','s','c','r','i','p','t',0}; /* FIXME: Handle more types */ diff --git a/dlls/mshtml/txtrange.c b/dlls/mshtml/txtrange.c index 8b12c018abe..bfabbf40e74 100644 --- a/dlls/mshtml/txtrange.c +++ b/dlls/mshtml/txtrange.c @@ -938,7 +938,7 @@ static HRESULT WINAPI HTMLTxtRange_get_htmlText(IHTMLTxtRange *iface, BSTR *p) } if(!*p) { - const WCHAR emptyW[] = {0}; + static const WCHAR emptyW[] = {0}; *p = SysAllocString(emptyW); } diff --git a/dlls/mshtml/view.c b/dlls/mshtml/view.c index 442b07d89af..9d4f40467b4 100644 --- a/dlls/mshtml/view.c +++ b/dlls/mshtml/view.c @@ -100,8 +100,8 @@ void update_title(HTMLDocumentObj *This) hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&olecmd); if(SUCCEEDED(hres)) { + static const WCHAR empty[] = {0}; VARIANT title; - WCHAR empty[] = {0}; V_VT(&title) = VT_BSTR; V_BSTR(&title) = SysAllocString(empty);