Wine-devel
Threads by month
- ----- 2026 -----
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
November 2020
- 73 participants
- 650 discussions
24 Nov '20
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/mshtml/htmlanchor.c | 10 ++--
dlls/mshtml/htmlbody.c | 38 ++++++---------
dlls/mshtml/htmldoc.c | 32 ++++---------
dlls/mshtml/htmlelem.c | 49 ++++++--------------
dlls/mshtml/htmlform.c | 14 ++----
dlls/mshtml/htmlframe.c | 13 ++----
dlls/mshtml/htmlhead.c | 6 +--
dlls/mshtml/htmlimg.c | 6 +--
dlls/mshtml/htmlinput.c | 21 ++-------
dlls/mshtml/htmllocation.c | 6 +--
dlls/mshtml/htmlobject.c | 10 ++--
dlls/mshtml/htmlstyle.c | 94 +++++++++++++-------------------------
dlls/mshtml/htmltable.c | 3 +-
dlls/mshtml/htmltextarea.c | 4 +-
dlls/mshtml/htmlwindow.c | 8 +---
15 files changed, 97 insertions(+), 217 deletions(-)
diff --git a/dlls/mshtml/htmlanchor.c b/dlls/mshtml/htmlanchor.c
index 64cc6db8755..a0e96af822e 100644
--- a/dlls/mshtml/htmlanchor.c
+++ b/dlls/mshtml/htmlanchor.c
@@ -65,27 +65,23 @@ HTMLOuterWindow *get_target_window(HTMLOuterWindow *window, nsAString *target_st
const PRUnichar *target;
HRESULT hres;
- static const WCHAR _parentW[] = {'_','p','a','r','e','n','t',0};
- static const WCHAR _selfW[] = {'_','s','e','l','f',0};
- static const WCHAR _topW[] = {'_','t','o','p',0};
-
*use_new_window = FALSE;
nsAString_GetData(target_str, &target);
TRACE("%s\n", debugstr_w(target));
- if(!*target || !wcsicmp(target, _selfW)) {
+ if(!*target || !wcsicmp(target, L"_self")) {
IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
return window;
}
- if(!wcsicmp(target, _topW)) {
+ if(!wcsicmp(target, L"_top")) {
get_top_window(window, &top_window);
IHTMLWindow2_AddRef(&top_window->base.IHTMLWindow2_iface);
return top_window;
}
- if(!wcsicmp(target, _parentW)) {
+ if(!wcsicmp(target, L"_parent")) {
if(!window->parent) {
WARN("Window has no parent, treat as self\n");
IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c
index 4209fd2cc2e..9955a8e6498 100644
--- a/dlls/mshtml/htmlbody.c
+++ b/dlls/mshtml/htmlbody.c
@@ -115,8 +115,6 @@ HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret)
unsigned int i;
int rgb = -1;
- static const WCHAR formatW[] = {'#','%','0','2','x','%','0','2','x','%','0','2','x',0};
-
if(!color || !*color) {
*ret = NULL;
return S_OK;
@@ -135,7 +133,7 @@ HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret)
if(!*ret)
return E_OUTOFMEMORY;
- swprintf(*ret, 8, formatW, rgb>>16, (rgb>>8)&0xff, rgb&0xff);
+ swprintf(*ret, 8, L"#%02x%02x%02x", rgb>>16, (rgb>>8)&0xff, rgb&0xff);
TRACE("%s -> %s\n", debugstr_w(color), debugstr_w(*ret));
return S_OK;
@@ -150,9 +148,8 @@ BOOL variant_to_nscolor(const VARIANT *v, nsAString *nsstr)
case VT_I4: {
PRUnichar buf[10];
- static const WCHAR formatW[] = {'#','%','x',0};
- wsprintfW(buf, formatW, V_I4(v));
+ wsprintfW(buf, L"#%x", V_I4(v));
nsAString_Init(nsstr, buf);
return TRUE;
}
@@ -576,13 +573,6 @@ static HRESULT WINAPI HTMLBodyElement_get_onunload(IHTMLBodyElement *iface, VARI
return E_NOTIMPL;
}
-static const WCHAR autoW[] = {'a','u','t','o',0};
-static const WCHAR hiddenW[] = {'h','i','d','d','e','n',0};
-static const WCHAR scrollW[] = {'s','c','r','o','l','l',0};
-static const WCHAR visibleW[] = {'v','i','s','i','b','l','e',0};
-static const WCHAR yesW[] = {'y','e','s',0};
-static const WCHAR noW[] = {'n','o',0};
-
static HRESULT WINAPI HTMLBodyElement_put_scroll(IHTMLBodyElement *iface, BSTR v)
{
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
@@ -591,12 +581,12 @@ static HRESULT WINAPI HTMLBodyElement_put_scroll(IHTMLBodyElement *iface, BSTR v
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
/* Emulate with CSS visibility attribute */
- if(!wcscmp(v, yesW)) {
- val = scrollW;
- }else if(!wcscmp(v, autoW)) {
- val = visibleW;
- }else if(!wcscmp(v, noW)) {
- val = hiddenW;
+ if(!wcscmp(v, L"yes")) {
+ val = L"scroll";
+ }else if(!wcscmp(v, L"auto")) {
+ val = L"visible";
+ }else if(!wcscmp(v, L"no")) {
+ val = L"hidden";
}else {
WARN("Invalid argument %s\n", debugstr_w(v));
return E_INVALIDARG;
@@ -622,12 +612,12 @@ static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *
if(!overflow || !*overflow) {
*p = NULL;
hres = S_OK;
- }else if(!wcscmp(overflow, visibleW) || !wcscmp(overflow, autoW)) {
- ret = autoW;
- }else if(!wcscmp(overflow, scrollW)) {
- ret = yesW;
- }else if(!wcscmp(overflow, hiddenW)) {
- ret = noW;
+ }else if(!wcscmp(overflow, L"visible") || !wcscmp(overflow, L"auto")) {
+ ret = L"auto";
+ }else if(!wcscmp(overflow, L"scroll")) {
+ ret = L"yes";
+ }else if(!wcscmp(overflow, L"hidden")) {
+ ret = L"no";
}else {
TRACE("Defaulting %s to NULL\n", debugstr_w(overflow));
*p = NULL;
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 5644d92dbe5..767b46a7050 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -577,11 +577,9 @@ static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v)
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
HRESULT hres;
- static const WCHAR onW[] = {'o','n',0};
-
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(wcsicmp(v, onW)) {
+ if(wcsicmp(v, L"on")) {
FIXME("Unsupported arg %s\n", debugstr_w(v));
return E_NOTIMPL;
}
@@ -597,13 +595,12 @@ static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v)
static HRESULT WINAPI HTMLDocument_get_designMode(IHTMLDocument2 *iface, BSTR *p)
{
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
- static const WCHAR szOff[] = {'O','f','f',0};
FIXME("(%p)->(%p) always returning Off\n", This, p);
if(!p)
return E_INVALIDARG;
- *p = SysAllocString(szOff);
+ *p = SysAllocString(L"Off");
return S_OK;
}
@@ -824,12 +821,9 @@ static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p)
{
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
- static const WCHAR about_blank_url[] =
- {'a','b','o','u','t',':','b','l','a','n','k',0};
-
TRACE("(%p)->(%p)\n", iface, p);
- *p = SysAllocString(This->window->url ? This->window->url : about_blank_url);
+ *p = SysAllocString(This->window->url ? This->window->url : L"about:blank");
return *p ? S_OK : E_OUTOFMEMORY;
}
@@ -1119,8 +1113,6 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT
nsISupports *tmp;
nsresult nsres;
- static const WCHAR text_htmlW[] = {'t','e','x','t','/','h','t','m','l',0};
-
TRACE("(%p)->(%s %s %s %s %p)\n", This, debugstr_w(url), debugstr_variant(&name),
debugstr_variant(&features), debugstr_variant(&replace), pomWindowResult);
@@ -1129,7 +1121,7 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT
return E_NOTIMPL;
}
- if(!url || wcscmp(url, text_htmlW) || V_VT(&name) != VT_ERROR
+ if(!url || wcscmp(url, L"text/html") || V_VT(&name) != VT_ERROR
|| V_VT(&features) != VT_ERROR || V_VT(&replace) != VT_ERROR)
FIXME("unsupported args\n");
@@ -1709,14 +1701,12 @@ static HRESULT WINAPI HTMLDocument_toString(IHTMLDocument2 *iface, BSTR *String)
{
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
- static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0};
-
TRACE("(%p)->(%p)\n", This, String);
if(!String)
return E_INVALIDARG;
- *String = SysAllocString(objectW);
+ *String = SysAllocString(L"[object]");
return *String ? S_OK : E_OUTOFMEMORY;
}
@@ -1731,8 +1721,6 @@ static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR
nsresult nsres;
HRESULT hres;
- static const WCHAR styleW[] = {'s','t','y','l','e',0};
-
TRACE("(%p)->(%s %d %p)\n", This, debugstr_w(bstrHref), lIndex, ppnewStyleSheet);
if(!This->doc_node->nsdoc) {
@@ -1749,7 +1737,7 @@ static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR
return S_OK;
}
- hres = create_element(This->doc_node, styleW, &elem);
+ hres = create_element(This->doc_node, L"style", &elem);
if(FAILED(hres))
return hres;
@@ -2362,8 +2350,7 @@ static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BST
nsAString selector_str;
WCHAR *selector;
nsresult nsres;
-
- static const WCHAR formatW[] = {'*','[','i','d','=','%','s',']',',','*','[','n','a','m','e','=','%','s',']',0};
+ static const WCHAR formatW[] = L"*[id=%s],*[name=%s]";
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl);
@@ -3006,12 +2993,9 @@ static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *
{
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
- static const WCHAR BackCompatW[] = {'B','a','c','k','C','o','m','p','a','t',0};
- static const WCHAR CSS1CompatW[] = {'C','S','S','1','C','o','m','p','a','t',0};
-
TRACE("(%p)->(%p)\n", This, p);
- *p = SysAllocString(This->doc_node->document_mode <= COMPAT_MODE_IE5 ? BackCompatW : CSS1CompatW);
+ *p = SysAllocString(This->doc_node->document_mode <= COMPAT_MODE_IE5 ? L"BackCompat" : L"CSS1Compat");
return *p ? S_OK : E_OUTOFMEMORY;
}
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index 1dcddbaa672..732db50a78c 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -860,13 +860,11 @@ HRESULT attr_value_to_string(VARIANT *v)
{
HRESULT hres;
- static const WCHAR nullW[] = {'n','u','l','l',0};
-
switch(V_VT(v)) {
case VT_BSTR:
break;
case VT_NULL:
- V_BSTR(v) = SysAllocString(nullW);
+ V_BSTR(v) = SysAllocString(L"null");
if(!V_BSTR(v))
return E_OUTOFMEMORY;
V_VT(v) = VT_BSTR;
@@ -1043,10 +1041,8 @@ static HRESULT WINAPI HTMLElement_get_tagName(IHTMLElement *iface, BSTR *p)
TRACE("(%p)->(%p)\n", This, p);
if(!This->dom_element) {
- static const WCHAR comment_tagW[] = {'!',0};
-
TRACE("comment element\n");
- *p = SysAllocString(comment_tagW);
+ *p = SysAllocString(L"!");
return *p ? S_OK : E_OUTOFMEMORY;
}
@@ -1314,8 +1310,6 @@ static HRESULT WINAPI HTMLElement_get_document(IHTMLElement *iface, IDispatch **
return S_OK;
}
-static const WCHAR titleW[] = {'t','i','t','l','e',0};
-
static HRESULT WINAPI HTMLElement_put_title(IHTMLElement *iface, BSTR v)
{
HTMLElement *This = impl_from_IHTMLElement(iface);
@@ -1328,7 +1322,7 @@ static HRESULT WINAPI HTMLElement_put_title(IHTMLElement *iface, BSTR v)
VARIANT *var;
HRESULT hres;
- hres = dispex_get_dprop_ref(&This->node.event_target.dispex, titleW, TRUE, &var);
+ hres = dispex_get_dprop_ref(&This->node.event_target.dispex, L"title", TRUE, &var);
if(FAILED(hres))
return hres;
@@ -1359,7 +1353,7 @@ static HRESULT WINAPI HTMLElement_get_title(IHTMLElement *iface, BSTR *p)
VARIANT *var;
HRESULT hres;
- hres = dispex_get_dprop_ref(&This->node.event_target.dispex, titleW, FALSE, &var);
+ hres = dispex_get_dprop_ref(&This->node.event_target.dispex, L"title", FALSE, &var);
if(hres == DISP_E_UNKNOWNNAME) {
*p = NULL;
}else if(V_VT(var) != VT_BSTR) {
@@ -1377,15 +1371,13 @@ static HRESULT WINAPI HTMLElement_get_title(IHTMLElement *iface, BSTR *p)
return return_nsstr(nsres, &title_str, p);
}
-static const WCHAR languageW[] = {'l','a','n','g','u','a','g','e',0};
-
static HRESULT WINAPI HTMLElement_put_language(IHTMLElement *iface, BSTR v)
{
HTMLElement *This = impl_from_IHTMLElement(iface);
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- return elem_string_attr_setter(This, languageW, v);
+ return elem_string_attr_setter(This, L"language", v);
}
static HRESULT WINAPI HTMLElement_get_language(IHTMLElement *iface, BSTR *p)
@@ -1394,7 +1386,7 @@ static HRESULT WINAPI HTMLElement_get_language(IHTMLElement *iface, BSTR *p)
TRACE("(%p)->(%p)\n", This, p);
- return elem_string_attr_getter(This, languageW, TRUE, p);
+ return elem_string_attr_getter(This, L"language", TRUE, p);
}
static HRESULT WINAPI HTMLElement_put_onselectstart(IHTMLElement *iface, VARIANT v)
@@ -1845,12 +1837,7 @@ static HRESULT insert_adjacent_node(HTMLElement *This, const WCHAR *where, nsIDO
nsresult nsres;
HRESULT hres = S_OK;
- static const WCHAR beforebeginW[] = {'b','e','f','o','r','e','b','e','g','i','n',0};
- static const WCHAR afterbeginW[] = {'a','f','t','e','r','b','e','g','i','n',0};
- static const WCHAR beforeendW[] = {'b','e','f','o','r','e','e','n','d',0};
- static const WCHAR afterendW[] = {'a','f','t','e','r','e','n','d',0};
-
- if (!wcsicmp(where, beforebeginW)) {
+ if (!wcsicmp(where, L"beforebegin")) {
nsIDOMNode *parent;
nsres = nsIDOMNode_GetParentNode(This->node.nsnode, &parent);
@@ -1862,7 +1849,7 @@ static HRESULT insert_adjacent_node(HTMLElement *This, const WCHAR *where, nsIDO
nsres = nsIDOMNode_InsertBefore(parent, nsnode, This->node.nsnode, &ret_nsnode);
nsIDOMNode_Release(parent);
- }else if(!wcsicmp(where, afterbeginW)) {
+ }else if(!wcsicmp(where, L"afterbegin")) {
nsIDOMNode *first_child;
nsres = nsIDOMNode_GetFirstChild(This->node.nsnode, &first_child);
@@ -1875,9 +1862,9 @@ static HRESULT insert_adjacent_node(HTMLElement *This, const WCHAR *where, nsIDO
if (first_child)
nsIDOMNode_Release(first_child);
- }else if (!wcsicmp(where, beforeendW)) {
+ }else if (!wcsicmp(where, L"beforeend")) {
nsres = nsIDOMNode_AppendChild(This->node.nsnode, nsnode, &ret_nsnode);
- }else if (!wcsicmp(where, afterendW)) {
+ }else if (!wcsicmp(where, L"afterend")) {
nsIDOMNode *next_sibling, *parent;
nsres = nsIDOMNode_GetParentNode(This->node.nsnode, &parent);
@@ -2806,7 +2793,7 @@ static HRESULT WINAPI HTMLElement2_put_accessKey(IHTMLElement2 *iface, BSTR v)
HTMLElement *This = impl_from_IHTMLElement2(iface);
VARIANT var;
- static WCHAR accessKeyW[] = {'a','c','c','e','s','s','K','e','y',0};
+ static WCHAR accessKeyW[] = L"accessKey";
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
@@ -3016,9 +3003,7 @@ static HRESULT WINAPI HTMLElement2_get_readyState(IHTMLElement2 *iface, VARIANT
if(FAILED(hres))
return hres;
}else {
- static const WCHAR completeW[] = {'c','o','m','p','l','e','t','e',0};
-
- str = SysAllocString(completeW);
+ str = SysAllocString(L"complete");
if(!str)
return E_OUTOFMEMORY;
}
@@ -3750,8 +3735,6 @@ static HRESULT WINAPI HTMLElement3_get_hideFocus(IHTMLElement3 *iface, VARIANT_B
return E_NOTIMPL;
}
-static const WCHAR disabledW[] = {'d','i','s','a','b','l','e','d',0};
-
static HRESULT WINAPI HTMLElement3_put_disabled(IHTMLElement3 *iface, VARIANT_BOOL v)
{
HTMLElement *This = impl_from_IHTMLElement3(iface);
@@ -3763,7 +3746,7 @@ static HRESULT WINAPI HTMLElement3_put_disabled(IHTMLElement3 *iface, VARIANT_BO
if(This->node.vtbl->put_disabled)
return This->node.vtbl->put_disabled(&This->node, v);
- hres = dispex_get_dprop_ref(&This->node.event_target.dispex, disabledW, TRUE, &var);
+ hres = dispex_get_dprop_ref(&This->node.event_target.dispex, L"disabled", TRUE, &var);
if(FAILED(hres))
return hres;
@@ -3784,7 +3767,7 @@ static HRESULT WINAPI HTMLElement3_get_disabled(IHTMLElement3 *iface, VARIANT_BO
if(This->node.vtbl->get_disabled)
return This->node.vtbl->get_disabled(&This->node, p);
- hres = dispex_get_dprop_ref(&This->node.event_target.dispex, disabledW, FALSE, &var);
+ hres = dispex_get_dprop_ref(&This->node.event_target.dispex, L"disabled", FALSE, &var);
if(hres == DISP_E_UNKNOWNNAME) {
*p = VARIANT_FALSE;
return S_OK;
@@ -5095,9 +5078,7 @@ HRESULT elem_unique_id(unsigned id, BSTR *p)
{
WCHAR buf[32];
- static const WCHAR formatW[] = {'m','s','_','_','i','d','%','u',0};
-
- swprintf(buf, ARRAY_SIZE(buf), formatW, id);
+ swprintf(buf, ARRAY_SIZE(buf), L"ms__id%u", id);
*p = SysAllocString(buf);
return *p ? S_OK : E_OUTOFMEMORY;
}
diff --git a/dlls/mshtml/htmlform.c b/dlls/mshtml/htmlform.c
index 63e8f1bb2d0..b4715298a1b 100644
--- a/dlls/mshtml/htmlform.c
+++ b/dlls/mshtml/htmlform.c
@@ -227,19 +227,14 @@ static HRESULT WINAPI HTMLFormElement_get_dir(IHTMLFormElement *iface, BSTR *p)
static HRESULT WINAPI HTMLFormElement_put_encoding(IHTMLFormElement *iface, BSTR v)
{
- static const WCHAR urlencodedW[] = {'a','p','p','l','i','c','a','t','i','o','n','/',
- 'x','-','w','w','w','-','f','o','r','m','-','u','r','l','e','n','c','o','d','e','d',0};
- static const WCHAR dataW[] = {'m','u','l','t','i','p','a','r','t','/',
- 'f','o','r','m','-','d','a','t','a',0};
- static const WCHAR plainW[] = {'t','e','x','t','/','p','l','a','i','n',0};
-
HTMLFormElement *This = impl_from_IHTMLFormElement(iface);
nsAString encoding_str;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, wine_dbgstr_w(v));
- if(lstrcmpiW(v, urlencodedW) && lstrcmpiW(v, dataW) && lstrcmpiW(v, plainW)) {
+ if(lstrcmpiW(v, L"application/x-www-form-urlencoded") && lstrcmpiW(v, L"multipart/form-data")
+ && lstrcmpiW(v, L"text/plain")) {
WARN("incorrect enctype\n");
return E_INVALIDARG;
}
@@ -268,16 +263,13 @@ static HRESULT WINAPI HTMLFormElement_get_encoding(IHTMLFormElement *iface, BSTR
static HRESULT WINAPI HTMLFormElement_put_method(IHTMLFormElement *iface, BSTR v)
{
- static const WCHAR postW[] = {'P','O','S','T',0};
- static const WCHAR getW[] = {'G','E','T',0};
-
HTMLFormElement *This = impl_from_IHTMLFormElement(iface);
nsAString method_str;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, wine_dbgstr_w(v));
- if(lstrcmpiW(v, postW) && lstrcmpiW(v, getW)) {
+ if(lstrcmpiW(v, L"POST") && lstrcmpiW(v, L"GET")) {
WARN("unrecognized method\n");
return E_INVALIDARG;
}
diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c
index e451f030453..972ddc80a50 100644
--- a/dlls/mshtml/htmlframe.c
+++ b/dlls/mshtml/htmlframe.c
@@ -34,11 +34,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
-static const WCHAR autoW[] = {'a','u','t','o',0};
-static const WCHAR yesW[] = {'y','e','s',0};
-static const WCHAR noW[] = {'n','o',0};
-static const WCHAR pxW[] = {'p','x',0};
-
static HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc)
{
mozIDOMWindowProxy *mozwindow;
@@ -343,7 +338,7 @@ static HRESULT WINAPI HTMLFrameBase_get_marginWidth(IHTMLFrameBase *iface, VARIA
if(*str) {
BSTR ret;
- end = wcsstr(str, pxW);
+ end = wcsstr(str, L"px");
if(!end)
end = str+lstrlenW(str);
ret = SysAllocStringLen(str, end-str);
@@ -410,7 +405,7 @@ static HRESULT WINAPI HTMLFrameBase_get_marginHeight(IHTMLFrameBase *iface, VARI
if(*str) {
BSTR ret;
- end = wcsstr(str, pxW);
+ end = wcsstr(str, L"px");
if(!end)
end = str+lstrlenW(str);
ret = SysAllocStringLen(str, end-str);
@@ -455,7 +450,7 @@ static HRESULT WINAPI HTMLFrameBase_put_scrolling(IHTMLFrameBase *iface, BSTR v)
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(!(!wcsicmp(v, yesW) || !wcsicmp(v, noW) || !wcsicmp(v, autoW)))
+ if(!(!wcsicmp(v, L"yes") || !wcsicmp(v, L"no") || !wcsicmp(v, L"auto")))
return E_INVALIDARG;
if(This->nsframe) {
@@ -509,7 +504,7 @@ static HRESULT WINAPI HTMLFrameBase_get_scrolling(IHTMLFrameBase *iface, BSTR *p
if(*strdata)
*p = SysAllocString(strdata);
else
- *p = SysAllocString(autoW);
+ *p = SysAllocString(L"auto");
nsAString_Finish(&nsstr);
diff --git a/dlls/mshtml/htmlhead.c b/dlls/mshtml/htmlhead.c
index 57bd0e6f968..92eda92fbad 100644
--- a/dlls/mshtml/htmlhead.c
+++ b/dlls/mshtml/htmlhead.c
@@ -503,15 +503,13 @@ static HRESULT WINAPI HTMLMetaElement_get_url(IHTMLMetaElement *iface, BSTR *p)
return E_NOTIMPL;
}
-static const WCHAR charsetW[] = {'c','h','a','r','s','e','t',0};
-
static HRESULT WINAPI HTMLMetaElement_put_charset(IHTMLMetaElement *iface, BSTR v)
{
HTMLMetaElement *This = impl_from_IHTMLMetaElement(iface);
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- return elem_string_attr_setter(&This->element, charsetW, v);
+ return elem_string_attr_setter(&This->element, L"charset", v);
}
static HRESULT WINAPI HTMLMetaElement_get_charset(IHTMLMetaElement *iface, BSTR *p)
@@ -520,7 +518,7 @@ static HRESULT WINAPI HTMLMetaElement_get_charset(IHTMLMetaElement *iface, BSTR
TRACE("(%p)->(%p)\n", This, p);
- return elem_string_attr_getter(&This->element, charsetW, TRUE, p);
+ return elem_string_attr_getter(&This->element, L"charset", TRUE, p);
}
static const IHTMLMetaElementVtbl HTMLMetaElementVtbl = {
diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c
index 7f1ecd038b0..7dc32cd654d 100644
--- a/dlls/mshtml/htmlimg.c
+++ b/dlls/mshtml/htmlimg.c
@@ -303,8 +303,6 @@ static HRESULT WINAPI HTMLImgElement_get_src(IHTMLImgElement *iface, BSTR *p)
nsresult nsres;
HRESULT hres = S_OK;
- static const WCHAR blockedW[] = {'B','L','O','C','K','E','D',':',':',0};
-
TRACE("(%p)->(%p)\n", This, p);
nsAString_Init(&src_str, NULL);
@@ -312,9 +310,9 @@ static HRESULT WINAPI HTMLImgElement_get_src(IHTMLImgElement *iface, BSTR *p)
if(NS_SUCCEEDED(nsres)) {
nsAString_GetData(&src_str, &src);
- if(!wcsnicmp(src, blockedW, ARRAY_SIZE(blockedW)-1)) {
+ if(!wcsnicmp(src, L"BLOCKED::", ARRAY_SIZE(L"BLOCKED::")-1)) {
TRACE("returning BLOCKED::\n");
- *p = SysAllocString(blockedW);
+ *p = SysAllocString(L"BLOCKED::");
if(!*p)
hres = E_OUTOFMEMORY;
}else {
diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c
index 765ae79c2b7..2ba5833f3c0 100644
--- a/dlls/mshtml/htmlinput.c
+++ b/dlls/mshtml/htmlinput.c
@@ -44,8 +44,6 @@ struct HTMLInputElement {
nsIDOMHTMLInputElement *nsinput;
};
-static const WCHAR forW[] = {'f','o','r',0};
-
static inline HTMLInputElement *impl_from_IHTMLInputElement(IHTMLInputElement *iface)
{
return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputElement_iface);
@@ -1302,11 +1300,9 @@ static HRESULT WINAPI HTMLInputTextElement2_setSelectionRange(IHTMLInputTextElem
nsAString none_str;
nsresult nsres;
- static const WCHAR noneW[] = {'n','o','n','e',0};
-
TRACE("(%p)->(%d %d)\n", This, start, end);
- nsAString_InitDepend(&none_str, noneW);
+ nsAString_InitDepend(&none_str, L"none");
nsres = nsIDOMHTMLInputElement_SetSelectionRange(This->nsinput, start, end, &none_str);
nsAString_Finish(&none_str);
if(NS_FAILED(nsres)) {
@@ -1387,19 +1383,12 @@ static BOOL HTMLInputElement_is_text_edit(HTMLDOMNode *iface)
nsresult nsres;
BOOL ret = FALSE;
- static const WCHAR buttonW[] = {'b','u','t','t','o','n',0};
- static const WCHAR hiddenW[] = {'h','i','d','d','e','n',0};
- static const WCHAR passwordW[] = {'p','a','s','s','w','o','r','d',0};
- static const WCHAR resetW[] = {'r','e','s','e','t',0};
- static const WCHAR submitW[] = {'s','u','b','m','i','t',0};
- static const WCHAR textW[] = {'t','e','x','t',0};
-
nsAString_Init(&nsstr, NULL);
nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &nsstr);
if(NS_SUCCEEDED(nsres)) {
nsAString_GetData(&nsstr, &type);
- ret = !wcscmp(type, buttonW) || !wcscmp(type, hiddenW) || !wcscmp(type, passwordW)
- || !wcscmp(type, resetW) || !wcscmp(type, submitW) || !wcscmp(type, textW);
+ ret = !wcscmp(type, L"button") || !wcscmp(type, L"hidden") || !wcscmp(type, L"password")
+ || !wcscmp(type, L"reset") || !wcscmp(type, L"submit") || !wcscmp(type, L"text");
}
nsAString_Finish(&nsstr);
return ret;
@@ -1557,7 +1546,7 @@ static HRESULT WINAPI HTMLLabelElement_put_htmlFor(IHTMLLabelElement *iface, BST
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- nsAString_InitDepend(&for_str, forW);
+ nsAString_InitDepend(&for_str, L"for");
nsAString_InitDepend(&val_str, v);
nsres = nsIDOMElement_SetAttribute(This->element.dom_element, &for_str, &val_str);
nsAString_Finish(&for_str);
@@ -1576,7 +1565,7 @@ static HRESULT WINAPI HTMLLabelElement_get_htmlFor(IHTMLLabelElement *iface, BST
TRACE("(%p)->(%p)\n", This, p);
- return elem_string_attr_getter(&This->element, forW, FALSE, p);
+ return elem_string_attr_getter(&This->element, L"for", FALSE, p);
}
static HRESULT WINAPI HTMLLabelElement_put_accessKey(IHTMLLabelElement *iface, BSTR v)
diff --git a/dlls/mshtml/htmllocation.c b/dlls/mshtml/htmllocation.c
index 7d102044cc2..4e15fb45242 100644
--- a/dlls/mshtml/htmllocation.c
+++ b/dlls/mshtml/htmllocation.c
@@ -350,12 +350,11 @@ static HRESULT WINAPI HTMLLocation_get_host(IHTMLLocation *iface, BSTR *p)
if(url.nPort) {
/* <hostname>:<port> */
- static const WCHAR format[] = {'%','u',0};
DWORD len, port_len;
WCHAR portW[6];
WCHAR *buf;
- port_len = swprintf(portW, ARRAY_SIZE(portW), format, url.nPort);
+ port_len = swprintf(portW, ARRAY_SIZE(portW), L"%u", url.nPort);
len = url.dwHostNameLength + 1 /* ':' */ + port_len;
buf = *p = SysAllocStringLen(NULL, len);
memcpy(buf, url.lpszHostName, url.dwHostNameLength * sizeof(WCHAR));
@@ -435,10 +434,9 @@ static HRESULT WINAPI HTMLLocation_get_port(IHTMLLocation *iface, BSTR *p)
return hres;
if(hres == S_OK) {
- static const WCHAR formatW[] = {'%','u',0};
WCHAR buf[12];
- swprintf(buf, ARRAY_SIZE(buf), formatW, port);
+ swprintf(buf, ARRAY_SIZE(buf), L"%u", port);
*p = SysAllocString(buf);
}else {
*p = SysAllocStringLen(NULL, 0);
diff --git a/dlls/mshtml/htmlobject.c b/dlls/mshtml/htmlobject.c
index 9505820583f..b71b0e7db6f 100644
--- a/dlls/mshtml/htmlobject.c
+++ b/dlls/mshtml/htmlobject.c
@@ -267,8 +267,7 @@ static HRESULT WINAPI HTMLObjectElement_put_width(IHTMLObjectElement *iface, VAR
switch(V_VT(&v)) {
case VT_I4: {
- static const WCHAR formatW[] = {'%','d',0};
- swprintf(buf, ARRAY_SIZE(buf), formatW, V_I4(&v));
+ swprintf(buf, ARRAY_SIZE(buf), L"%d", V_I4(&v));
break;
}
default:
@@ -326,8 +325,7 @@ static HRESULT WINAPI HTMLObjectElement_put_height(IHTMLObjectElement *iface, VA
switch(V_VT(&v)) {
case VT_I4: {
- static const WCHAR formatW[] = {'%','d',0};
- swprintf(buf, ARRAY_SIZE(buf), formatW, V_I4(&v));
+ swprintf(buf, ARRAY_SIZE(buf), L"%d", V_I4(&v));
break;
}
default:
@@ -577,11 +575,9 @@ static HRESULT WINAPI HTMLObjectElement2_put_classid(IHTMLObjectElement2 *iface,
HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
HRESULT hres;
- static const WCHAR classidW[] = {'c','l','a','s','s','i','d',0};
-
FIXME("(%p)->(%s) semi-stub\n", This, debugstr_w(v));
- hres = elem_string_attr_setter(&This->plugin_container.element, classidW, v);
+ hres = elem_string_attr_setter(&This->plugin_container.element, L"classid", v);
if(FAILED(hres))
return hres;
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index ae21c1f7299..43a71d6286c 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -35,20 +35,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
-static const WCHAR blinkW[] = {'b','l','i','n','k',0};
-static const WCHAR dashedW[] = {'d','a','s','h','e','d',0};
-static const WCHAR dottedW[] = {'d','o','t','t','e','d',0};
-static const WCHAR doubleW[] = {'d','o','u','b','l','e',0};
-static const WCHAR grooveW[] = {'g','r','o','o','v','e',0};
-static const WCHAR insetW[] = {'i','n','s','e','t',0};
-static const WCHAR line_throughW[] = {'l','i','n','e','-','t','h','r','o','u','g','h',0};
-static const WCHAR noneW[] = {'n','o','n','e',0};
-static const WCHAR outsetW[] = {'o','u','t','s','e','t',0};
-static const WCHAR overlineW[] = {'o','v','e','r','l','i','n','e',0};
-static const WCHAR ridgeW[] = {'r','i','d','g','e',0};
-static const WCHAR solidW[] = {'s','o','l','i','d',0};
-static const WCHAR underlineW[] = {'u','n','d','e','r','l','i','n','e',0};
-
static const WCHAR *font_style_values[] = {
L"italic",
L"normal",
@@ -125,8 +111,6 @@ static const WCHAR *overflow_values[] = {
#define ATTR_NO_NULL 0x0020
#define ATTR_COMPAT_IE10 0x0040
-static const WCHAR pxW[] = {'p','x',0};
-
typedef struct {
const WCHAR *name;
DISPID dispid;
@@ -708,9 +692,6 @@ static const style_tbl_entry_t style_tbl[] = {
C_ASSERT(ARRAY_SIZE(style_tbl) == STYLEID_MAX_VALUE);
-static const WCHAR px_formatW[] = {'%','d','p','x',0};
-static const WCHAR emptyW[] = {0};
-
static const style_tbl_entry_t *lookup_style_tbl(CSSStyle *style, const WCHAR *name)
{
int c, i, min = 0, max = ARRAY_SIZE(style_tbl)-1;
@@ -798,7 +779,7 @@ static HRESULT set_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_
nsresult nsres;
nsAString_InitDepend(&str_name, style_tbl[sid].name);
- nsAString_InitDepend(&str_empty, emptyW);
+ nsAString_InitDepend(&str_empty, L"");
nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, value, &str_empty);
nsAString_Finish(&str_name);
nsAString_Finish(&str_empty);
@@ -837,7 +818,7 @@ static inline HRESULT set_style_property(CSSStyle *style, styleid_t sid, const W
}
if(!*iter) {
WARN("invalid value %s\n", debugstr_w(value));
- nsAString_InitDepend(&value_str, emptyW);
+ nsAString_InitDepend(&value_str, L"");
set_nsstyle_property(style->nsstyle, sid, &value_str);
nsAString_Finish(&value_str);
return E_INVALIDARG;
@@ -1027,12 +1008,11 @@ 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];
value = floor(value);
- swprintf(szValue, ARRAY_SIZE(szValue), szFormat, value);
+ swprintf(szValue, ARRAY_SIZE(szValue), L"%.0fpx", value);
return set_style_property(&This->css_style, sid, szValue);
}
@@ -1041,7 +1021,7 @@ static HRESULT set_style_pxattr(HTMLStyle *style, styleid_t sid, LONG value)
{
WCHAR value_str[16];
- swprintf(value_str, ARRAY_SIZE(value_str), px_formatW, value);
+ swprintf(value_str, ARRAY_SIZE(value_str), L"%dpx", value);
return set_style_property(&style->css_style, sid, value_str);
}
@@ -1068,7 +1048,7 @@ static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
{
*p = wcstol(value, &ptr, 10);
- if(*ptr && wcscmp(ptr, pxW))
+ if(*ptr && wcscmp(ptr, L"px"))
{
nsAString_Finish(&str_value);
FIXME("only px values are currently supported\n");
@@ -1108,7 +1088,7 @@ static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p)
}
}
- if(!ptr || (*ptr && wcscmp(ptr, pxW)))
+ if(!ptr || (*ptr && wcscmp(ptr, L"px")))
*p = 0;
}
@@ -1118,11 +1098,11 @@ static HRESULT get_nsstyle_pixel_val(HTMLStyle *This, styleid_t sid, LONG *p)
static BOOL is_valid_border_style(BSTR v)
{
- return !v || wcsicmp(v, noneW) == 0 || wcsicmp(v, dottedW) == 0 ||
- wcsicmp(v, dashedW) == 0 || wcsicmp(v, solidW) == 0 ||
- wcsicmp(v, doubleW) == 0 || wcsicmp(v, grooveW) == 0 ||
- wcsicmp(v, ridgeW) == 0 || wcsicmp(v, insetW) == 0 ||
- wcsicmp(v, outsetW) == 0;
+ return !v || wcsicmp(v, L"none") == 0 || wcsicmp(v, L"dotted") == 0 ||
+ wcsicmp(v, L"dashed") == 0 || wcsicmp(v, L"solid") == 0 ||
+ wcsicmp(v, L"double") == 0 || wcsicmp(v, L"groove") == 0 ||
+ wcsicmp(v, L"ridge") == 0 || wcsicmp(v, L"inset") == 0 ||
+ wcsicmp(v, L"outset") == 0;
}
static void *HTMLStyle_QI(CSSStyle *css_style, REFIID riid)
@@ -1514,7 +1494,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIAN
TRACE("(%p)->(%x)\n", This, v);
- return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? noneW : emptyW);
+ return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? L"none" : L"");
}
static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
@@ -1523,7 +1503,7 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIAN
TRACE("(%p)->(%p)\n", This, p);
- return check_style_attr_value(This, STYLEID_TEXT_DECORATION, noneW, p);
+ return check_style_attr_value(This, STYLEID_TEXT_DECORATION, L"none", p);
}
static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
@@ -1532,7 +1512,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, V
TRACE("(%p)->(%x)\n", This, v);
- return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? underlineW : emptyW);
+ return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? L"underline" : L"");
}
static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
@@ -1541,7 +1521,7 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, V
TRACE("(%p)->(%p)\n", This, p);
- return check_style_attr_value(This, STYLEID_TEXT_DECORATION, underlineW, p);
+ return check_style_attr_value(This, STYLEID_TEXT_DECORATION, L"underline", p);
}
static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
@@ -1550,7 +1530,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VA
TRACE("(%p)->(%x)\n", This, v);
- return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? overlineW : emptyW);
+ return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? L"overline" : L"");
}
static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
@@ -1559,7 +1539,7 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VA
TRACE("(%p)->(%p)\n", This, p);
- return check_style_attr_value(This, STYLEID_TEXT_DECORATION, overlineW, p);
+ return check_style_attr_value(This, STYLEID_TEXT_DECORATION, L"overline", p);
}
static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
@@ -1568,7 +1548,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface,
TRACE("(%p)->(%x)\n", This, v);
- return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? line_throughW : emptyW);
+ return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? L"line-through" : L"");
}
static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
@@ -1577,7 +1557,7 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface,
TRACE("(%p)->(%p)\n", This, p);
- return check_style_attr_value(This, STYLEID_TEXT_DECORATION, line_throughW, p);
+ return check_style_attr_value(This, STYLEID_TEXT_DECORATION, L"line-through", p);
}
static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
@@ -1586,7 +1566,7 @@ static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIA
TRACE("(%p)->(%x)\n", This, v);
- return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? blinkW : emptyW);
+ return set_style_property(&This->css_style, STYLEID_TEXT_DECORATION, v ? L"blink" : L"");
}
static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
@@ -1595,7 +1575,7 @@ static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIA
TRACE("(%p)->(%p)\n", This, p);
- return check_style_attr_value(This, STYLEID_TEXT_DECORATION, blinkW, p);
+ return check_style_attr_value(This, STYLEID_TEXT_DECORATION, L"blink", p);
}
static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
@@ -2117,7 +2097,6 @@ static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *
static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
{
HTMLStyle *This = impl_from_IHTMLStyle(iface);
- static const WCHAR styleWindowInset[] = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
HRESULT hres = S_OK;
BSTR pstyle;
int i=0;
@@ -2130,7 +2109,7 @@ static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
if(v[i] == (WCHAR)' ')
{
pstyle = SysAllocStringLen(&v[last], (i-last));
- if( !(is_valid_border_style(pstyle) || wcsicmp(styleWindowInset, pstyle) == 0))
+ if( !(is_valid_border_style(pstyle) || wcsicmp(L"window-inset", pstyle) == 0))
{
TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle));
hres = E_INVALIDARG;
@@ -2144,7 +2123,7 @@ static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
if(hres == S_OK)
{
pstyle = SysAllocStringLen(&v[last], i-last);
- if( !(is_valid_border_style(pstyle) || wcsicmp(styleWindowInset, pstyle) == 0))
+ if( !(is_valid_border_style(pstyle) || wcsicmp(L"window-inset", pstyle) == 0))
{
TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle));
hres = E_INVALIDARG;
@@ -2755,13 +2734,11 @@ static void set_opacity(HTMLStyle *This, const WCHAR *val)
nsAString name_str, val_str, empty_str;
nsresult nsres;
- static const WCHAR opacityW[] = {'o','p','a','c','i','t','y',0};
-
TRACE("%s\n", debugstr_w(val));
- nsAString_InitDepend(&name_str, opacityW);
+ nsAString_InitDepend(&name_str, L"opacity");
nsAString_InitDepend(&val_str, val);
- nsAString_InitDepend(&empty_str, emptyW);
+ nsAString_InitDepend(&empty_str, L"");
nsres = nsIDOMCSSStyleDeclaration_SetProperty(This->css_style.nsstyle, &name_str, &val_str, &empty_str);
if(NS_FAILED(nsres))
@@ -2784,7 +2761,7 @@ static void update_filter(HTMLStyle *This)
ptr = This->elem->filter;
TRACE("%s\n", debugstr_w(ptr));
if(!ptr) {
- set_opacity(This, emptyW);
+ set_opacity(This, L"");
return;
}
@@ -2807,7 +2784,6 @@ static void update_filter(HTMLStyle *This)
}
if(ptr2 + ARRAY_SIZE(alphaW) == ptr && !memcmp(ptr2, alphaW, sizeof(alphaW))) {
- static const WCHAR formatW[] = {'%','f',0};
static const WCHAR opacityW[] = {'o','p','a','c','i','t','y','='};
ptr++;
@@ -2839,7 +2815,7 @@ static void update_filter(HTMLStyle *This)
}
}
- swprintf(buf, ARRAY_SIZE(buf), formatW, fval * 0.01f);
+ swprintf(buf, ARRAY_SIZE(buf), L"%f", fval * 0.01f);
set_opacity(This, buf);
}else {
FIXME("unknown param %s\n", debugstr_wn(ptr2, ptr-ptr2));
@@ -5137,10 +5113,8 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_put_backgroundPositionX(IHTMLCSSSt
nsAString_GetData(&pos_str, &pos);
posy = wcschr(pos, ' ');
if(!posy) {
- static const WCHAR zero_pxW[] = {' ','0','p','x',0};
-
TRACE("no space in %s\n", debugstr_w(pos));
- posy = zero_pxW;
+ posy = L" 0px";
}
posy_len = lstrlenW(posy);
@@ -5234,11 +5208,9 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_put_backgroundPositionY(IHTMLCSSSt
if(space) {
space++;
}else {
- static const WCHAR zero_pxW[] = {'0','p','x',' ',0};
-
TRACE("no space in %s\n", debugstr_w(pos));
- pos = zero_pxW;
- space = pos + ARRAY_SIZE(zero_pxW)-1;
+ pos = L"0px ";
+ space = pos + ARRAY_SIZE(L"0px ")-1;
}
posx_len = space-pos;
@@ -6521,8 +6493,6 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_get_layoutFlow(IHTMLCSSStyleDeclar
return E_NOTIMPL;
}
-static const WCHAR zoomW[] = {'z','o','o','m',0};
-
static HRESULT WINAPI HTMLCSSStyleDeclaration_put_zoom(IHTMLCSSStyleDeclaration *iface, VARIANT v)
{
CSSStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface);
@@ -6536,7 +6506,7 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_put_zoom(IHTMLCSSStyleDeclaration
if(V_VT(&v) != VT_I4 || V_I4(&v) != 1)
WARN("stub for %s\n", debugstr_variant(&v));
- hres = dispex_get_dprop_ref(&This->dispex, zoomW, TRUE, &var);
+ hres = dispex_get_dprop_ref(&This->dispex, L"zoom", TRUE, &var);
if(FAILED(hres))
return hres;
@@ -6551,7 +6521,7 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_get_zoom(IHTMLCSSStyleDeclaration
TRACE("(%p)->(%p)\n", This, p);
- hres = dispex_get_dprop_ref(&This->dispex, zoomW, FALSE, &var);
+ hres = dispex_get_dprop_ref(&This->dispex, L"zoom", FALSE, &var);
if(hres == DISP_E_UNKNOWNNAME) {
V_VT(p) = VT_BSTR;
V_BSTR(p) = NULL;
diff --git a/dlls/mshtml/htmltable.c b/dlls/mshtml/htmltable.c
index 43a4f6ba08a..ad74ad30966 100644
--- a/dlls/mshtml/htmltable.c
+++ b/dlls/mshtml/htmltable.c
@@ -1191,8 +1191,7 @@ static HRESULT WINAPI HTMLTable_put_cellSpacing(IHTMLTable *iface, VARIANT v)
nsAString_InitDepend(&nsstr, V_BSTR(&v));
break;
case VT_I4: {
- static const WCHAR formatW[] = {'%','d',0};
- swprintf(buf, ARRAY_SIZE(buf), formatW, V_I4(&v));
+ swprintf(buf, ARRAY_SIZE(buf), L"%d", V_I4(&v));
nsAString_InitDepend(&nsstr, buf);
break;
}
diff --git a/dlls/mshtml/htmltextarea.c b/dlls/mshtml/htmltextarea.c
index caf5d85f749..fb8c3830862 100644
--- a/dlls/mshtml/htmltextarea.c
+++ b/dlls/mshtml/htmltextarea.c
@@ -101,13 +101,11 @@ static HRESULT WINAPI HTMLTextAreaElement_Invoke(IHTMLTextAreaElement *iface, DI
static HRESULT WINAPI HTMLTextAreaElement_get_type(IHTMLTextAreaElement *iface, BSTR *p)
{
- static const WCHAR textareaW[] = {'t','e','x','t','a','r','e','a',0};
-
HTMLTextAreaElement *This = impl_from_IHTMLTextAreaElement(iface);
TRACE("(%p)->(%p)\n", This, p);
- *p = SysAllocString(textareaW);
+ *p = SysAllocString(L"textarea");
if(!*p)
return E_OUTOFMEMORY;
return S_OK;
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c
index a49cd4bd59d..69717ff7848 100644
--- a/dlls/mshtml/htmlwindow.c
+++ b/dlls/mshtml/htmlwindow.c
@@ -978,8 +978,6 @@ static HRESULT WINAPI HTMLWindow2_open(IHTMLWindow2 *iface, BSTR url, BSTR name,
IUri *uri;
HRESULT hres;
- static const WCHAR _selfW[] = {'_','s','e','l','f',0};
-
TRACE("(%p)->(%s %s %s %x %p)\n", This, debugstr_w(url), debugstr_w(name),
debugstr_w(features), replace, pomWindowResult);
if(features)
@@ -991,7 +989,7 @@ static HRESULT WINAPI HTMLWindow2_open(IHTMLWindow2 *iface, BSTR url, BSTR name,
return E_UNEXPECTED;
if(name && *name == '_') {
- if(!wcscmp(name, _selfW)) {
+ if(!wcscmp(name, L"_self")) {
if((features && *features) || replace)
FIXME("Unsupported arguments for _self target\n");
@@ -1440,14 +1438,12 @@ static HRESULT WINAPI HTMLWindow2_toString(IHTMLWindow2 *iface, BSTR *String)
{
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
- static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0};
-
TRACE("(%p)->(%p)\n", This, String);
if(!String)
return E_INVALIDARG;
- *String = SysAllocString(objectW);
+ *String = SysAllocString(L"[object]");
return *String ? S_OK : E_OUTOFMEMORY;
}
--
2.26.2
2
1
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/jscript/activex.c | 4 +-
dlls/jscript/bool.c | 9 +--
dlls/jscript/compile.c | 4 +-
dlls/jscript/date.c | 65 +++++-----------
dlls/jscript/dispex.c | 15 +---
dlls/jscript/engine.c | 35 +++------
dlls/jscript/enumerator.c | 6 +-
dlls/jscript/error.c | 35 +++------
dlls/jscript/function.c | 44 ++++-------
dlls/jscript/global.c | 78 ++++++-------------
dlls/jscript/json.c | 27 +++----
dlls/jscript/jsregexp.c | 27 ++-----
dlls/jscript/jsstr.c | 6 +-
dlls/jscript/jsutils.c | 19 ++---
dlls/jscript/lex.c | 4 +-
dlls/jscript/number.c | 7 +-
dlls/jscript/string.c | 159 ++++++++++++--------------------------
dlls/jscript/vbarray.c | 4 +-
18 files changed, 167 insertions(+), 381 deletions(-)
diff --git a/dlls/jscript/activex.c b/dlls/jscript/activex.c
index 9c8c681b5e7..80a89b5ae89 100644
--- a/dlls/jscript/activex.c
+++ b/dlls/jscript/activex.c
@@ -190,13 +190,11 @@ HRESULT create_activex_constr(script_ctx_t *ctx, jsdisp_t **ret)
jsdisp_t *prototype;
HRESULT hres;
- static const WCHAR ActiveXObjectW[] = {'A','c','t','i','v','e','X','O','b','j','e','c','t',0};
-
hres = create_object(ctx, NULL, &prototype);
if(FAILED(hres))
return hres;
- hres = create_builtin_function(ctx, ActiveXObject_value, ActiveXObjectW, NULL,
+ hres = create_builtin_function(ctx, ActiveXObject_value, L"ActiveXObject", NULL,
PROPF_CONSTR|1, prototype, ret);
jsdisp_release(prototype);
diff --git a/dlls/jscript/bool.c b/dlls/jscript/bool.c
index f31117e2141..44a8b7262de 100644
--- a/dlls/jscript/bool.c
+++ b/dlls/jscript/bool.c
@@ -57,9 +57,6 @@ static HRESULT Bool_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns
{
BoolInstance *bool;
- static const WCHAR trueW[] = {'t','r','u','e',0};
- static const WCHAR falseW[] = {'f','a','l','s','e',0};
-
TRACE("\n");
if(!(bool = bool_this(jsthis)))
@@ -68,7 +65,7 @@ static HRESULT Bool_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns
if(r) {
jsstr_t *val;
- val = jsstr_alloc(bool->val ? trueW : falseW);
+ val = jsstr_alloc(bool->val ? L"true" : L"false");
if(!val)
return E_OUTOFMEMORY;
@@ -197,13 +194,11 @@ HRESULT create_bool_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp
BoolInstance *bool;
HRESULT hres;
- static const WCHAR BooleanW[] = {'B','o','o','l','e','a','n',0};
-
hres = alloc_bool(ctx, object_prototype, &bool);
if(FAILED(hres))
return hres;
- hres = create_builtin_constructor(ctx, BoolConstr_value, BooleanW, NULL,
+ hres = create_builtin_constructor(ctx, BoolConstr_value, L"Boolean", NULL,
PROPF_CONSTR|1, &bool->dispex, ret);
jsdisp_release(&bool->dispex);
diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c
index 5ac93c9f2ff..a1d1171e2ec 100644
--- a/dlls/jscript/compile.c
+++ b/dlls/jscript/compile.c
@@ -719,15 +719,13 @@ static HRESULT compile_delete_expression(compiler_ctx_t *ctx, unary_expression_t
case EXPR_IDENT:
return push_instr_bstr(ctx, OP_delete_ident, ((identifier_expression_t*)expr->expression)->identifier);
default: {
- static const WCHAR fixmeW[] = {'F','I','X','M','E',0};
-
WARN("invalid delete, unimplemented exception message\n");
hres = compile_expression(ctx, expr->expression, TRUE);
if(FAILED(hres))
return hres;
- return push_instr_uint_str(ctx, OP_throw_type, JS_E_INVALID_DELETE, fixmeW);
+ return push_instr_uint_str(ctx, OP_throw_type, JS_E_INVALID_DELETE, L"FIXME");
}
}
diff --git a/dlls/jscript/date.c b/dlls/jscript/date.c
index 4809cc976d8..5ca23f199f3 100644
--- a/dlls/jscript/date.c
+++ b/dlls/jscript/date.c
@@ -431,18 +431,6 @@ static SYSTEMTIME create_systemtime(DOUBLE time)
static inline HRESULT date_to_string(DOUBLE time, BOOL show_offset, int offset, jsval_t *r)
{
- static const WCHAR formatW[] = { '%','s',' ','%','s',' ','%','d',' ',
- '%','0','2','d',':','%','0','2','d',':','%','0','2','d',' ',
- 'U','T','C','%','c','%','0','2','d','%','0','2','d',' ','%','d','%','s',0 };
- static const WCHAR formatUTCW[] = { '%','s',' ','%','s',' ','%','d',' ',
- '%','0','2','d',':','%','0','2','d',':','%','0','2','d',' ',
- 'U','T','C',' ','%','d','%','s',0 };
- static const WCHAR formatNoOffsetW[] = { '%','s',' ','%','s',' ',
- '%','d',' ','%','0','2','d',':','%','0','2','d',':',
- '%','0','2','d',' ','%','d','%','s',0 };
- static const WCHAR ADW[] = { 0 };
- static const WCHAR BCW[] = { ' ','B','.','C','.',0 };
-
static const DWORD week_ids[] = { LOCALE_SABBREVDAYNAME7, LOCALE_SABBREVDAYNAME1,
LOCALE_SABBREVDAYNAME2, LOCALE_SABBREVDAYNAME3, LOCALE_SABBREVDAYNAME4,
LOCALE_SABBREVDAYNAME5, LOCALE_SABBREVDAYNAME6 };
@@ -490,18 +478,18 @@ static inline HRESULT date_to_string(DOUBLE time, BOOL show_offset, int offset,
}
if(!show_offset)
- swprintf(buf, ARRAY_SIZE(buf), formatNoOffsetW, week, month, day,
+ swprintf(buf, ARRAY_SIZE(buf), L"%s %s %d %02d:%02d:%02d %d%s", week, month, day,
(int)hour_from_time(time), (int)min_from_time(time),
- (int)sec_from_time(time), year, formatAD?ADW:BCW);
+ (int)sec_from_time(time), year, formatAD?L"":L" B.C.");
else if(offset)
- swprintf(buf, ARRAY_SIZE(buf), formatW, week, month, day,
+ swprintf(buf, ARRAY_SIZE(buf), L"%s %s %d %02d:%02d:%02d UTC%c%02d%02d %d%s", week, month, day,
(int)hour_from_time(time), (int)min_from_time(time),
(int)sec_from_time(time), sign, offset/60, offset%60,
- year, formatAD?ADW:BCW);
+ year, formatAD?L"":L" B.C.");
else
- swprintf(buf, ARRAY_SIZE(buf), formatUTCW, week, month, day,
+ swprintf(buf, ARRAY_SIZE(buf), L"%s %s %d %02d:%02d:%02d UTC %d%s", week, month, day,
(int)hour_from_time(time), (int)min_from_time(time),
- (int)sec_from_time(time), year, formatAD?ADW:BCW);
+ (int)sec_from_time(time), year, formatAD?L"":L" B.C.");
date_jsstr = jsstr_alloc(buf);
if(!date_jsstr)
@@ -588,11 +576,6 @@ static HRESULT Date_toISOString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
WCHAR buf[64], *p = buf;
double year;
- static const WCHAR short_year_formatW[] = {'%','0','4','d',0};
- static const WCHAR long_year_formatW[] = {'%','0','6','d',0};
- static const WCHAR formatW[] = {'-','%','0','2','d','-','%','0','2','d',
- 'T','%','0','2','d',':','%','0','2','d',':','%','0','2','d','.','%','0','3','d','Z',0};
-
TRACE("\n");
if(!(date = date_this(jsthis)))
@@ -606,15 +589,15 @@ static HRESULT Date_toISOString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
if(year < 0) {
*p++ = '-';
- p += swprintf(p, ARRAY_SIZE(buf) - 1, long_year_formatW, -(int)year);
+ p += swprintf(p, ARRAY_SIZE(buf) - 1, L"%06d", -(int)year);
}else if(year > 9999) {
*p++ = '+';
- p += swprintf(p, ARRAY_SIZE(buf) - 1, long_year_formatW, (int)year);
+ p += swprintf(p, ARRAY_SIZE(buf) - 1, L"%06d", (int)year);
}else {
- p += swprintf(p, ARRAY_SIZE(buf), short_year_formatW, (int)year);
+ p += swprintf(p, ARRAY_SIZE(buf), L"%04d", (int)year);
}
- swprintf(p, ARRAY_SIZE(buf) - (p - buf), formatW,
+ swprintf(p, ARRAY_SIZE(buf) - (p - buf), L"-%02d-%02dT%02d:%02d:%02d.%03dZ",
(int)month_from_time(date->time) + 1, (int)date_from_time(date->time),
(int)hour_from_time(date->time), (int)min_from_time(date->time),
(int)sec_from_time(date->time), (int)ms_from_time(date->time));
@@ -645,11 +628,6 @@ static HRESULT Date_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsi
static inline HRESULT create_utc_string(script_ctx_t *ctx, vdisp_t *jsthis, jsval_t *r)
{
- static const WCHAR formatADW[] = { '%','s',',',' ','%','d',' ','%','s',' ','%','d',' ',
- '%','0','2','d',':','%','0','2','d',':','%','0','2','d',' ','U','T','C',0 };
- static const WCHAR formatBCW[] = { '%','s',',',' ','%','d',' ','%','s',' ','%','d',' ','B','.','C','.',' ',
- '%','0','2','d',':','%','0','2','d',':','%','0','2','d',' ','U','T','C',0 };
-
static const DWORD week_ids[] = { LOCALE_SABBREVDAYNAME7, LOCALE_SABBREVDAYNAME1,
LOCALE_SABBREVDAYNAME2, LOCALE_SABBREVDAYNAME3, LOCALE_SABBREVDAYNAME4,
LOCALE_SABBREVDAYNAME5, LOCALE_SABBREVDAYNAME6 };
@@ -694,8 +672,9 @@ static inline HRESULT create_utc_string(script_ctx_t *ctx, vdisp_t *jsthis, jsva
day = date_from_time(date->time);
- swprintf(buf, ARRAY_SIZE(buf), formatAD ? formatADW : formatBCW, week, day, month, year,
- (int)hour_from_time(date->time), (int)min_from_time(date->time),
+ swprintf(buf, ARRAY_SIZE(buf),
+ formatAD ? L"%s, %d %s %d %02d:%02d:%02d UTC" : L"%s, %d %s %d B.C. %02d:%02d:%02d UTC",
+ week, day, month, year, (int)hour_from_time(date->time), (int)min_from_time(date->time),
(int)sec_from_time(date->time));
date_str = jsstr_alloc(buf);
@@ -725,9 +704,6 @@ static HRESULT Date_toGMTString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
/* ECMA-262 3rd Edition 15.9.5.3 */
static HRESULT dateobj_to_date_string(DateInstance *date, jsval_t *r)
{
- static const WCHAR formatADW[] = { '%','s',' ','%','s',' ','%','d',' ','%','d',0 };
- static const WCHAR formatBCW[] = { '%','s',' ','%','s',' ','%','d',' ','%','d',' ','B','.','C','.',0 };
-
static const DWORD week_ids[] = { LOCALE_SABBREVDAYNAME7, LOCALE_SABBREVDAYNAME1,
LOCALE_SABBREVDAYNAME2, LOCALE_SABBREVDAYNAME3, LOCALE_SABBREVDAYNAME4,
LOCALE_SABBREVDAYNAME5, LOCALE_SABBREVDAYNAME6 };
@@ -771,7 +747,8 @@ static HRESULT dateobj_to_date_string(DateInstance *date, jsval_t *r)
day = date_from_time(time);
- swprintf(buf, ARRAY_SIZE(buf), formatAD ? formatADW : formatBCW, week, month, day, year);
+ swprintf(buf, ARRAY_SIZE(buf), formatAD ? L"%s %s %d %d" : L"%s %s %d %d B.C.", week, month,
+ day, year);
date_str = jsstr_alloc(buf);
if(!date_str)
@@ -797,10 +774,6 @@ static HRESULT Date_toDateString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
static HRESULT Date_toTimeString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
- static const WCHAR formatW[] = { '%','0','2','d',':','%','0','2','d',':','%','0','2','d',
- ' ','U','T','C','%','c','%','0','2','d','%','0','2','d',0 };
- static const WCHAR formatUTCW[] = { '%','0','2','d',':','%','0','2','d',
- ':','%','0','2','d',' ','U','T','C',0 };
DateInstance *date;
jsstr_t *date_str;
WCHAR buf[32];
@@ -832,11 +805,11 @@ static HRESULT Date_toTimeString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
else sign = '-';
if(offset)
- swprintf(buf, ARRAY_SIZE(buf), formatW, (int)hour_from_time(time),
+ swprintf(buf, ARRAY_SIZE(buf), L"%02d:%02d:%02d UTC%c%02d%02d", (int)hour_from_time(time),
(int)min_from_time(time), (int)sec_from_time(time),
sign, offset/60, offset%60);
else
- swprintf(buf, ARRAY_SIZE(buf), formatUTCW, (int)hour_from_time(time),
+ swprintf(buf, ARRAY_SIZE(buf), L"%02d:%02d:%02d UTC", (int)hour_from_time(time),
(int)min_from_time(time), (int)sec_from_time(time));
date_str = jsstr_alloc(buf);
@@ -2482,13 +2455,11 @@ HRESULT create_date_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp
jsdisp_t *date;
HRESULT hres;
- static const WCHAR DateW[] = {'D','a','t','e',0};
-
hres = create_date(ctx, object_prototype, 0.0, &date);
if(FAILED(hres))
return hres;
- hres = create_builtin_constructor(ctx, DateConstr_value, DateW, &DateConstr_info,
+ hres = create_builtin_constructor(ctx, DateConstr_value, L"Date", &DateConstr_info,
PROPF_CONSTR|7, date, ret);
jsdisp_release(date);
diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c
index f49d5da9719..5829cebe55b 100644
--- a/dlls/jscript/dispex.c
+++ b/dlls/jscript/dispex.c
@@ -1843,9 +1843,7 @@ HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const built
dispex_prop_t *prop;
HRESULT hres;
- static const WCHAR prototypeW[] = {'p','r','o','t','o','t','y','p','e',0};
-
- hres = find_prop_name_prot(constr, string_hash(prototypeW), prototypeW, &prop);
+ hres = find_prop_name_prot(constr, string_hash(L"prototype"), L"prototype", &prop);
if(SUCCEEDED(hres) && prop && prop->type!=PROP_DELETED) {
jsval_t val;
@@ -2148,9 +2146,7 @@ HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, jsval_t val)
{
WCHAR buf[12];
- static const WCHAR formatW[] = {'%','d',0};
-
- swprintf(buf, ARRAY_SIZE(buf), formatW, idx);
+ swprintf(buf, ARRAY_SIZE(buf), L"%d", idx);
return jsdisp_propput_name(obj, buf, val);
}
@@ -2213,9 +2209,7 @@ HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r)
dispex_prop_t *prop;
HRESULT hres;
- static const WCHAR formatW[] = {'%','d',0};
-
- swprintf(name, ARRAY_SIZE(name), formatW, idx);
+ swprintf(name, ARRAY_SIZE(name), L"%d", idx);
hres = find_prop_name_prot(obj, string_hash(name), name, &prop);
if(FAILED(hres))
@@ -2265,13 +2259,12 @@ HRESULT disp_propget(script_ctx_t *ctx, IDispatch *disp, DISPID id, jsval_t *val
HRESULT jsdisp_delete_idx(jsdisp_t *obj, DWORD idx)
{
- static const WCHAR formatW[] = {'%','d',0};
WCHAR buf[12];
dispex_prop_t *prop;
BOOL b;
HRESULT hres;
- swprintf(buf, ARRAY_SIZE(buf), formatW, idx);
+ swprintf(buf, ARRAY_SIZE(buf), L"%d", idx);
hres = find_prop_name(obj, string_hash(buf), buf, &prop);
if(FAILED(hres) || !prop)
diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c
index bca632129bc..5635e3aa996 100644
--- a/dlls/jscript/engine.c
+++ b/dlls/jscript/engine.c
@@ -27,14 +27,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(jscript);
-static const WCHAR booleanW[] = {'b','o','o','l','e','a','n',0};
-static const WCHAR functionW[] = {'f','u','n','c','t','i','o','n',0};
-static const WCHAR numberW[] = {'n','u','m','b','e','r',0};
-static const WCHAR objectW[] = {'o','b','j','e','c','t',0};
-static const WCHAR stringW[] = {'s','t','r','i','n','g',0};
-static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0};
-static const WCHAR unknownW[] = {'u','n','k','n','o','w','n',0};
-
struct _except_frame_t {
unsigned stack_top;
scope_chain_t *scope;
@@ -632,7 +624,6 @@ static HRESULT identifier_eval(script_ctx_t *ctx, BSTR identifier, exprval_t *re
if(scope->frame) {
function_code_t *func = scope->frame->function;
local_ref_t *ref = lookup_local(func, identifier);
- static const WCHAR argumentsW[] = {'a','r','g','u','m','e','n','t','s',0};
if(ref) {
ret->type = EXPRVAL_STACK_REF;
@@ -641,7 +632,7 @@ static HRESULT identifier_eval(script_ctx_t *ctx, BSTR identifier, exprval_t *re
return S_OK;
}
- if(!wcscmp(identifier, argumentsW)) {
+ if(!wcscmp(identifier, L"arguments")) {
hres = detach_variable_object(ctx, scope->frame, FALSE);
if(FAILED(hres))
return hres;
@@ -1631,8 +1622,6 @@ static HRESULT interp_instanceof(script_ctx_t *ctx)
BOOL ret = FALSE;
HRESULT hres;
- static const WCHAR prototypeW[] = {'p','r','o','t','o','t', 'y', 'p','e',0};
-
v = stack_pop(ctx);
if(!is_object_instance(v) || !get_object(v)) {
jsval_release(v);
@@ -1647,7 +1636,7 @@ static HRESULT interp_instanceof(script_ctx_t *ctx)
}
if(is_class(obj, JSCLASS_FUNCTION)) {
- hres = jsdisp_propget_name(obj, prototypeW, &prot);
+ hres = jsdisp_propget_name(obj, L"prototype", &prot);
}else {
hres = JS_E_FUNCTION_EXPECTED;
}
@@ -1945,30 +1934,30 @@ static HRESULT typeof_string(jsval_t v, const WCHAR **ret)
{
switch(jsval_type(v)) {
case JSV_UNDEFINED:
- *ret = undefinedW;
+ *ret = L"undefined";
break;
case JSV_NULL:
- *ret = objectW;
+ *ret = L"object";
break;
case JSV_OBJECT: {
jsdisp_t *dispex;
if(get_object(v) && (dispex = iface_to_jsdisp(get_object(v)))) {
- *ret = is_class(dispex, JSCLASS_FUNCTION) ? functionW : objectW;
+ *ret = is_class(dispex, JSCLASS_FUNCTION) ? L"function" : L"object";
jsdisp_release(dispex);
}else {
- *ret = objectW;
+ *ret = L"object";
}
break;
}
case JSV_STRING:
- *ret = stringW;
+ *ret = L"string";
break;
case JSV_NUMBER:
- *ret = numberW;
+ *ret = L"number";
break;
case JSV_BOOL:
- *ret = booleanW;
+ *ret = L"boolean";
break;
case JSV_VARIANT:
FIXME("unhandled variant %s\n", debugstr_variant(get_variant(v)));
@@ -1994,7 +1983,7 @@ static HRESULT interp_typeofid(script_ctx_t *ctx)
hres = exprval_propget(ctx, &ref, &v);
exprval_release(&ref);
if(FAILED(hres))
- return stack_push_string(ctx, unknownW);
+ return stack_push_string(ctx, L"unknown");
hres = typeof_string(v, &ret);
jsval_release(v);
@@ -2756,13 +2745,11 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres)
jsdisp_t *error_obj;
jsval_t msg;
- static const WCHAR messageW[] = {'m','e','s','s','a','g','e',0};
-
WARN("Exception %08x %s", exception_hres, debugstr_jsval(ei->valid_value ? ei->value : jsval_undefined()));
if(ei->valid_value && jsval_type(ei->value) == JSV_OBJECT) {
error_obj = to_jsdisp(get_object(ei->value));
if(error_obj) {
- hres = jsdisp_propget_name(error_obj, messageW, &msg);
+ hres = jsdisp_propget_name(error_obj, L"message", &msg);
if(SUCCEEDED(hres)) {
WARN(" (message %s)", debugstr_jsval(msg));
jsval_release(msg);
diff --git a/dlls/jscript/enumerator.c b/dlls/jscript/enumerator.c
index 6971150bbb4..dea19406695 100644
--- a/dlls/jscript/enumerator.c
+++ b/dlls/jscript/enumerator.c
@@ -328,15 +328,13 @@ HRESULT create_enumerator_constr(script_ctx_t *ctx, jsdisp_t *object_prototype,
{
EnumeratorInstance *enumerator;
HRESULT hres;
- static const WCHAR EnumeratorW[] = {'E','n','u','m','e','r','a','t','o','r',0};
hres = alloc_enumerator(ctx, object_prototype, &enumerator);
if(FAILED(hres))
return hres;
- hres = create_builtin_constructor(ctx, EnumeratorConstr_value,
- EnumeratorW, &EnumeratorConstr_info,
- PROPF_CONSTR|7, &enumerator->dispex, ret);
+ hres = create_builtin_constructor(ctx, EnumeratorConstr_value, L"Enumerator",
+ &EnumeratorConstr_info, PROPF_CONSTR|7, &enumerator->dispex, ret);
jsdisp_release(&enumerator->dispex);
return hres;
diff --git a/dlls/jscript/error.c b/dlls/jscript/error.c
index 07ebc1144eb..38a2485c858 100644
--- a/dlls/jscript/error.c
+++ b/dlls/jscript/error.c
@@ -28,11 +28,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(jscript);
-static const WCHAR descriptionW[] = {'d','e','s','c','r','i','p','t','i','o','n',0};
-static const WCHAR messageW[] = {'m','e','s','s','a','g','e',0};
-static const WCHAR nameW[] = {'n','a','m','e',0};
-static const WCHAR numberW[] = {'n','u','m','b','e','r',0};
-
/* ECMA-262 3rd Edition 15.11.4.4 */
static HRESULT Error_toString(script_ctx_t *ctx, vdisp_t *vthis, WORD flags,
unsigned argc, jsval_t *argv, jsval_t *r)
@@ -42,8 +37,6 @@ static HRESULT Error_toString(script_ctx_t *ctx, vdisp_t *vthis, WORD flags,
jsval_t v;
HRESULT hres;
- static const WCHAR object_errorW[] = {'[','o','b','j','e','c','t',' ','E','r','r','o','r',']',0};
-
TRACE("\n");
jsthis = get_jsdisp(vthis);
@@ -51,7 +44,7 @@ static HRESULT Error_toString(script_ctx_t *ctx, vdisp_t *vthis, WORD flags,
if(r) {
jsstr_t *str;
- str = jsstr_alloc(object_errorW);
+ str = jsstr_alloc(L"[object Error]");
if(!str)
return E_OUTOFMEMORY;
*r = jsval_string(str);
@@ -59,7 +52,7 @@ static HRESULT Error_toString(script_ctx_t *ctx, vdisp_t *vthis, WORD flags,
return S_OK;
}
- hres = jsdisp_propget_name(jsthis, nameW, &v);
+ hres = jsdisp_propget_name(jsthis, L"name", &v);
if(FAILED(hres))
return hres;
@@ -70,7 +63,7 @@ static HRESULT Error_toString(script_ctx_t *ctx, vdisp_t *vthis, WORD flags,
return hres;
}
- hres = jsdisp_propget_name(jsthis, messageW, &v);
+ hres = jsdisp_propget_name(jsthis, L"message", &v);
if(SUCCEEDED(hres)) {
if(!is_undefined(v)) {
hres = to_string(ctx, v, &msg);
@@ -101,7 +94,7 @@ static HRESULT Error_toString(script_ctx_t *ctx, vdisp_t *vthis, WORD flags,
ret = msg;
msg = NULL;
}else {
- ret = jsstr_alloc(object_errorW);
+ ret = jsstr_alloc(L"[object Error]");
}
}
@@ -193,18 +186,18 @@ static HRESULT create_error(script_ctx_t *ctx, jsdisp_t *constr,
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(err, numberW, PROPF_WRITABLE | PROPF_CONFIGURABLE,
+ hres = jsdisp_define_data_property(err, L"number", PROPF_WRITABLE | PROPF_CONFIGURABLE,
jsval_number((INT)number));
if(FAILED(hres)) {
jsdisp_release(err);
return hres;
}
- hres = jsdisp_define_data_property(err, messageW,
+ hres = jsdisp_define_data_property(err, L"message",
PROPF_WRITABLE | PROPF_ENUMERABLE | PROPF_CONFIGURABLE,
jsval_string(msg));
if(SUCCEEDED(hres))
- hres = jsdisp_define_data_property(err, descriptionW, PROPF_WRITABLE | PROPF_CONFIGURABLE,
+ hres = jsdisp_define_data_property(err, L"description", PROPF_WRITABLE | PROPF_CONFIGURABLE,
jsval_string(msg));
if(FAILED(hres)) {
jsdisp_release(err);
@@ -325,16 +318,8 @@ static HRESULT URIErrorConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD fla
HRESULT init_error_constr(script_ctx_t *ctx, jsdisp_t *object_prototype)
{
- static const WCHAR ErrorW[] = {'E','r','r','o','r',0};
- static const WCHAR EvalErrorW[] = {'E','v','a','l','E','r','r','o','r',0};
- static const WCHAR RangeErrorW[] = {'R','a','n','g','e','E','r','r','o','r',0};
- static const WCHAR ReferenceErrorW[] = {'R','e','f','e','r','e','n','c','e','E','r','r','o','r',0};
- static const WCHAR RegExpErrorW[] = {'R','e','g','E','x','p','E','r','r','o','r',0};
- static const WCHAR SyntaxErrorW[] = {'S','y','n','t','a','x','E','r','r','o','r',0};
- static const WCHAR TypeErrorW[] = {'T','y','p','e','E','r','r','o','r',0};
- static const WCHAR URIErrorW[] = {'U','R','I','E','r','r','o','r',0};
- static const WCHAR *names[] = {ErrorW, EvalErrorW, RangeErrorW,
- ReferenceErrorW, RegExpErrorW, SyntaxErrorW, TypeErrorW, URIErrorW};
+ static const WCHAR *names[] = {L"Error", L"EvalError", L"RangeError",
+ L"ReferenceError", L"RegExpError", L"SyntaxError", L"TypeError", L"URIError"};
jsdisp_t **constr_addr[] = {&ctx->error_constr, &ctx->eval_error_constr,
&ctx->range_error_constr, &ctx->reference_error_constr, &ctx->regexp_error_constr,
&ctx->syntax_error_constr, &ctx->type_error_constr,
@@ -359,7 +344,7 @@ HRESULT init_error_constr(script_ctx_t *ctx, jsdisp_t *object_prototype)
return E_OUTOFMEMORY;
}
- hres = jsdisp_define_data_property(err, nameW, PROPF_WRITABLE | PROPF_CONFIGURABLE,
+ hres = jsdisp_define_data_property(err, L"name", PROPF_WRITABLE | PROPF_CONFIGURABLE,
jsval_string(str));
jsstr_release(str);
if(SUCCEEDED(hres))
diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c
index f0bd20d75a2..9f6aa4b4ec6 100644
--- a/dlls/jscript/function.c
+++ b/dlls/jscript/function.c
@@ -92,11 +92,6 @@ static inline ArgumentsInstance *arguments_from_jsdisp(jsdisp_t *jsdisp)
return CONTAINING_RECORD(jsdisp, ArgumentsInstance, jsdisp);
}
-static const WCHAR prototypeW[] = {'p','r','o','t','o','t', 'y', 'p','e',0};
-
-static const WCHAR lengthW[] = {'l','e','n','g','t','h',0};
-static const WCHAR argumentsW[] = {'a','r','g','u','m','e','n','t','s',0};
-
static HRESULT Arguments_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
@@ -191,8 +186,6 @@ HRESULT setup_arguments_object(script_ctx_t *ctx, call_frame_t *frame)
ArgumentsInstance *args;
HRESULT hres;
- static const WCHAR caleeW[] = {'c','a','l','l','e','e',0};
-
args = heap_alloc_zero(sizeof(*args));
if(!args)
return E_OUTOFMEMORY;
@@ -207,13 +200,13 @@ HRESULT setup_arguments_object(script_ctx_t *ctx, call_frame_t *frame)
args->argc = frame->argc;
args->frame = frame;
- hres = jsdisp_define_data_property(&args->jsdisp, lengthW, PROPF_WRITABLE | PROPF_CONFIGURABLE,
+ hres = jsdisp_define_data_property(&args->jsdisp, L"length", PROPF_WRITABLE | PROPF_CONFIGURABLE,
jsval_number(args->argc));
if(SUCCEEDED(hres))
- hres = jsdisp_define_data_property(&args->jsdisp, caleeW, PROPF_WRITABLE | PROPF_CONFIGURABLE,
+ hres = jsdisp_define_data_property(&args->jsdisp, L"callee", PROPF_WRITABLE | PROPF_CONFIGURABLE,
jsval_obj(&args->function->function.dispex));
if(SUCCEEDED(hres))
- hres = jsdisp_propput(frame->base_scope->jsobj, argumentsW, PROPF_WRITABLE, jsval_obj(&args->jsdisp));
+ hres = jsdisp_propput(frame->base_scope->jsobj, L"arguments", PROPF_WRITABLE, jsval_obj(&args->jsdisp));
if(FAILED(hres)) {
jsdisp_release(&args->jsdisp);
return hres;
@@ -232,7 +225,7 @@ void detach_arguments_object(jsdisp_t *args_disp)
/* Reset arguments value to cut the reference cycle. Note that since all activation contexts have
* their own arguments property, it's impossible to use prototype's one during name lookup */
- jsdisp_propput_name(frame->base_scope->jsobj, argumentsW, jsval_undefined());
+ jsdisp_propput_name(frame->base_scope->jsobj, L"arguments", jsval_undefined());
arguments->frame = NULL;
/* Don't bother coppying arguments if call frame holds the last reference. */
@@ -307,7 +300,7 @@ static HRESULT array_to_args(script_ctx_t *ctx, jsdisp_t *arg_array, unsigned *a
DWORD length, i;
HRESULT hres;
- hres = jsdisp_propget_name(arg_array, lengthW, &val);
+ hres = jsdisp_propget_name(arg_array, L"length", &val);
if(FAILED(hres))
return hres;
@@ -673,10 +666,10 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc,
return hres;
if(builtin_info)
- hres = jsdisp_define_data_property(&function->function.dispex, lengthW, 0,
+ hres = jsdisp_define_data_property(&function->function.dispex, L"length", 0,
jsval_number(function->function.length));
if(SUCCEEDED(hres))
- hres = jsdisp_define_data_property(&function->function.dispex, prototypeW, 0, jsval_obj(prototype));
+ hres = jsdisp_define_data_property(&function->function.dispex, L"prototype", 0, jsval_obj(prototype));
if(FAILED(hres)) {
jsdisp_release(&function->function.dispex);
return hres;
@@ -691,9 +684,7 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc,
static HRESULT set_constructor_prop(script_ctx_t *ctx, jsdisp_t *constr, jsdisp_t *prot)
{
- static const WCHAR constructorW[] = {'c','o','n','s','t','r','u','c','t','o','r',0};
-
- return jsdisp_define_data_property(prot, constructorW, PROPF_WRITABLE | PROPF_CONFIGURABLE,
+ return jsdisp_define_data_property(prot, L"constructor", PROPF_WRITABLE | PROPF_CONFIGURABLE,
jsval_obj(constr));
}
@@ -795,7 +786,7 @@ HRESULT create_source_function(script_ctx_t *ctx, bytecode_t *code, function_cod
hres = create_function(ctx, NULL, &InterpretedFunctionVtbl, sizeof(InterpretedFunction), PROPF_CONSTR,
FALSE, NULL, (void**)&function);
if(SUCCEEDED(hres)) {
- hres = jsdisp_define_data_property(&function->function.dispex, prototypeW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(&function->function.dispex, L"prototype", PROPF_WRITABLE,
jsval_obj(prototype));
if(SUCCEEDED(hres))
hres = set_constructor_prop(ctx, &function->function.dispex, prototype);
@@ -850,12 +841,7 @@ static HRESULT BindFunction_call(script_ctx_t *ctx, FunctionInstance *func, IDis
static HRESULT BindFunction_toString(FunctionInstance *function, jsstr_t **ret)
{
- static const WCHAR native_functionW[] =
- {'\n','f','u','n','c','t','i','o','n','(',')',' ','{','\n',
- ' ',' ',' ',' ','[','n','a','t','i','v','e',' ','c','o','d','e',']','\n',
- '}','\n',0};
-
- *ret = jsstr_alloc(native_functionW);
+ *ret = jsstr_alloc(L"\nfunction() {\n [native code]\n}\n");
return *ret ? S_OK : E_OUTOFMEMORY;
}
@@ -928,7 +914,7 @@ static HRESULT construct_function(script_ctx_t *ctx, unsigned argc, jsval_t *arg
static const WCHAR function_anonymousW[] = {'f','u','n','c','t','i','o','n',' ','a','n','o','n','y','m','o','u','s','('};
static const WCHAR function_beginW[] = {')',' ','{','\n'};
- static const WCHAR function_endW[] = {'\n','}',0};
+ static const WCHAR function_endW[] = L"\n}";
if(argc) {
params = heap_alloc(argc*sizeof(*params));
@@ -1038,22 +1024,20 @@ HRESULT init_function_constr(script_ctx_t *ctx, jsdisp_t *object_prototype)
NativeFunction *prot, *constr;
HRESULT hres;
- static const WCHAR FunctionW[] = {'F','u','n','c','t','i','o','n',0};
-
hres = create_function(ctx, &Function_info, &NativeFunctionVtbl, sizeof(NativeFunction), PROPF_CONSTR,
TRUE, object_prototype, (void**)&prot);
if(FAILED(hres))
return hres;
prot->proc = FunctionProt_value;
- prot->name = prototypeW;
+ prot->name = L"prototype";
hres = create_function(ctx, &FunctionInst_info, &NativeFunctionVtbl, sizeof(NativeFunction), PROPF_CONSTR|1,
TRUE, &prot->function.dispex, (void**)&constr);
if(SUCCEEDED(hres)) {
constr->proc = FunctionConstr_value;
- constr->name = FunctionW;
- hres = jsdisp_define_data_property(&constr->function.dispex, prototypeW, 0, jsval_obj(&prot->function.dispex));
+ constr->name = L"Function";
+ hres = jsdisp_define_data_property(&constr->function.dispex, L"prototype", 0, jsval_obj(&prot->function.dispex));
if(SUCCEEDED(hres))
hres = set_constructor_prop(ctx, &constr->function.dispex, &prot->function.dispex);
if(FAILED(hres))
diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c
index d5aafe65037..735e188e1bd 100644
--- a/dlls/jscript/global.c
+++ b/dlls/jscript/global.c
@@ -27,32 +27,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(jscript);
-static const WCHAR NaNW[] = {'N','a','N',0};
-static const WCHAR InfinityW[] = {'I','n','f','i','n','i','t','y',0};
-static const WCHAR ArrayW[] = {'A','r','r','a','y',0};
-static const WCHAR BooleanW[] = {'B','o','o','l','e','a','n',0};
-static const WCHAR DateW[] = {'D','a','t','e',0};
-static const WCHAR ErrorW[] = {'E','r','r','o','r',0};
-static const WCHAR EvalErrorW[] = {'E','v','a','l','E','r','r','o','r',0};
-static const WCHAR RangeErrorW[] = {'R','a','n','g','e','E','r','r','o','r',0};
-static const WCHAR ReferenceErrorW[] = {'R','e','f','e','r','e','n','c','e','E','r','r','o','r',0};
-static const WCHAR SyntaxErrorW[] = {'S','y','n','t','a','x','E','r','r','o','r',0};
-static const WCHAR TypeErrorW[] = {'T','y','p','e','E','r','r','o','r',0};
-static const WCHAR URIErrorW[] = {'U','R','I','E','r','r','o','r',0};
-static const WCHAR FunctionW[] = {'F','u','n','c','t','i','o','n',0};
-static const WCHAR NumberW[] = {'N','u','m','b','e','r',0};
-static const WCHAR ObjectW[] = {'O','b','j','e','c','t',0};
-static const WCHAR StringW[] = {'S','t','r','i','n','g',0};
-static const WCHAR RegExpW[] = {'R','e','g','E','x','p',0};
-static const WCHAR RegExpErrorW[] = {'R','e','g','E','x','p','E','r','r','o','r',0};
-static const WCHAR ActiveXObjectW[] = {'A','c','t','i','v','e','X','O','b','j','e','c','t',0};
-static const WCHAR VBArrayW[] = {'V','B','A','r','r','a','y',0};
-static const WCHAR EnumeratorW[] = {'E','n','u','m','e','r','a','t','o','r',0};
-static const WCHAR MathW[] = {'M','a','t','h',0};
-static const WCHAR JSONW[] = {'J','S','O','N',0};
-
-static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0};
-
static int uri_char_table[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 00-0f */
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 10-1f */
@@ -527,14 +501,12 @@ static HRESULT JSGlobal_GetObject(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
static HRESULT JSGlobal_ScriptEngine(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
- static const WCHAR JScriptW[] = {'J','S','c','r','i','p','t',0};
-
TRACE("\n");
if(r) {
jsstr_t *ret;
- ret = jsstr_alloc(JScriptW);
+ ret = jsstr_alloc(L"JScript");
if(!ret)
return E_OUTOFMEMORY;
@@ -947,7 +919,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype)
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, FunctionW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"Function", PROPF_WRITABLE,
jsval_obj(ctx->function_constr));
if(FAILED(hres))
return hres;
@@ -956,7 +928,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype)
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, ObjectW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"Object", PROPF_WRITABLE,
jsval_obj(ctx->object_constr));
if(FAILED(hres))
return hres;
@@ -965,7 +937,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype)
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, ArrayW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"Array", PROPF_WRITABLE,
jsval_obj(ctx->array_constr));
if(FAILED(hres))
return hres;
@@ -974,7 +946,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype)
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, BooleanW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"Boolean", PROPF_WRITABLE,
jsval_obj(ctx->bool_constr));
if(FAILED(hres))
return hres;
@@ -983,7 +955,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype)
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, DateW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"Date", PROPF_WRITABLE,
jsval_obj(ctx->date_constr));
if(FAILED(hres))
return hres;
@@ -992,7 +964,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype)
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, EnumeratorW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"Enumerator", PROPF_WRITABLE,
jsval_obj(ctx->enumerator_constr));
if(FAILED(hres))
return hres;
@@ -1001,42 +973,42 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype)
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, ErrorW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"Error", PROPF_WRITABLE,
jsval_obj(ctx->error_constr));
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, EvalErrorW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"EvalError", PROPF_WRITABLE,
jsval_obj(ctx->eval_error_constr));
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, RangeErrorW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"RangeError", PROPF_WRITABLE,
jsval_obj(ctx->range_error_constr));
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, ReferenceErrorW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"ReferenceError", PROPF_WRITABLE,
jsval_obj(ctx->reference_error_constr));
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, RegExpErrorW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"RegExpError", PROPF_WRITABLE,
jsval_obj(ctx->regexp_error_constr));
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, SyntaxErrorW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"SyntaxError", PROPF_WRITABLE,
jsval_obj(ctx->syntax_error_constr));
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, TypeErrorW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"TypeError", PROPF_WRITABLE,
jsval_obj(ctx->type_error_constr));
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, URIErrorW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"URIError", PROPF_WRITABLE,
jsval_obj(ctx->uri_error_constr));
if(FAILED(hres))
return hres;
@@ -1045,7 +1017,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype)
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, NumberW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"Number", PROPF_WRITABLE,
jsval_obj(ctx->number_constr));
if(FAILED(hres))
return hres;
@@ -1054,7 +1026,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype)
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, RegExpW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"RegExp", PROPF_WRITABLE,
jsval_obj(ctx->regexp_constr));
if(FAILED(hres))
return hres;
@@ -1063,7 +1035,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype)
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, StringW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"String", PROPF_WRITABLE,
jsval_obj(ctx->string_constr));
if(FAILED(hres))
return hres;
@@ -1072,7 +1044,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype)
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, VBArrayW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"VBArray", PROPF_WRITABLE,
jsval_obj(ctx->vbarray_constr));
if(FAILED(hres))
return hres;
@@ -1106,7 +1078,7 @@ HRESULT init_global(script_ctx_t *ctx)
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, MathW, PROPF_WRITABLE, jsval_obj(math));
+ hres = jsdisp_define_data_property(ctx->global, L"Math", PROPF_WRITABLE, jsval_obj(math));
jsdisp_release(math);
if(FAILED(hres))
return hres;
@@ -1118,7 +1090,7 @@ HRESULT init_global(script_ctx_t *ctx)
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, JSONW, PROPF_WRITABLE, jsval_obj(json));
+ hres = jsdisp_define_data_property(ctx->global, L"JSON", PROPF_WRITABLE, jsval_obj(json));
jsdisp_release(json);
if(FAILED(hres))
return hres;
@@ -1128,20 +1100,20 @@ HRESULT init_global(script_ctx_t *ctx)
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, ActiveXObjectW, PROPF_WRITABLE,
+ hres = jsdisp_define_data_property(ctx->global, L"ActiveXObject", PROPF_WRITABLE,
jsval_obj(constr));
jsdisp_release(constr);
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, undefinedW, const_flags, jsval_undefined());
+ hres = jsdisp_define_data_property(ctx->global, L"undefined", const_flags, jsval_undefined());
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, NaNW, const_flags, jsval_number(NAN));
+ hres = jsdisp_define_data_property(ctx->global, L"NaN", const_flags, jsval_number(NAN));
if(FAILED(hres))
return hres;
- hres = jsdisp_define_data_property(ctx->global, InfinityW, const_flags, jsval_number(INFINITY));
+ hres = jsdisp_define_data_property(ctx->global, L"Infinity", const_flags, jsval_number(INFINITY));
return hres;
}
diff --git a/dlls/jscript/json.c b/dlls/jscript/json.c
index de10ceadd11..8f16ba22885 100644
--- a/dlls/jscript/json.c
+++ b/dlls/jscript/json.c
@@ -26,12 +26,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(jscript);
-static const WCHAR nullW[] = {'n','u','l','l',0};
-static const WCHAR trueW[] = {'t','r','u','e',0};
-static const WCHAR falseW[] = {'f','a','l','s','e',0};
-
-static const WCHAR toJSONW[] = {'t','o','J','S','O','N',0};
-
typedef struct {
const WCHAR *ptr;
const WCHAR *end;
@@ -107,19 +101,19 @@ static HRESULT parse_json_value(json_parse_ctx_t *ctx, jsval_t *r)
/* JSONNullLiteral */
case 'n':
- if(!is_keyword(ctx, nullW))
+ if(!is_keyword(ctx, L"null"))
break;
*r = jsval_null();
return S_OK;
/* JSONBooleanLiteral */
case 't':
- if(!is_keyword(ctx, trueW))
+ if(!is_keyword(ctx, L"true"))
break;
*r = jsval_bool(TRUE);
return S_OK;
case 'f':
- if(!is_keyword(ctx, falseW))
+ if(!is_keyword(ctx, L"false"))
break;
*r = jsval_bool(FALSE);
return S_OK;
@@ -476,9 +470,8 @@ static HRESULT json_quote(stringify_ctx_t *ctx, const WCHAR *ptr, size_t len)
break;
default:
if(*ptr < ' ') {
- static const WCHAR formatW[] = {'\\','u','%','0','4','x',0};
WCHAR buf[7];
- swprintf(buf, ARRAY_SIZE(buf), formatW, *ptr);
+ swprintf(buf, ARRAY_SIZE(buf), L"\\u%04x", *ptr);
if(!append_string(ctx, buf))
return E_OUTOFMEMORY;
}else {
@@ -538,10 +531,10 @@ static HRESULT stringify_array(stringify_ctx_t *ctx, jsdisp_t *obj)
hres = stringify(ctx, val);
if(FAILED(hres))
return hres;
- if(hres == S_FALSE && !append_string(ctx, nullW))
+ if(hres == S_FALSE && !append_string(ctx, L"null"))
return E_OUTOFMEMORY;
}else if(hres == DISP_E_UNKNOWNNAME) {
- if(!append_string(ctx, nullW))
+ if(!append_string(ctx, L"null"))
return E_OUTOFMEMORY;
}else {
return hres;
@@ -668,7 +661,7 @@ static HRESULT stringify(stringify_ctx_t *ctx, jsval_t val)
if(!obj)
return S_FALSE;
- hres = jsdisp_get_id(obj, toJSONW, 0, &id);
+ hres = jsdisp_get_id(obj, L"toJSON", 0, &id);
jsdisp_release(obj);
if(hres == S_OK)
FIXME("Use toJSON.\n");
@@ -682,11 +675,11 @@ static HRESULT stringify(stringify_ctx_t *ctx, jsval_t val)
switch(jsval_type(value)) {
case JSV_NULL:
- if(!append_string(ctx, nullW))
+ if(!append_string(ctx, L"null"))
hres = E_OUTOFMEMORY;
break;
case JSV_BOOL:
- if(!append_string(ctx, get_bool(value) ? trueW : falseW))
+ if(!append_string(ctx, get_bool(value) ? L"true" : L"false"))
hres = E_OUTOFMEMORY;
break;
case JSV_STRING: {
@@ -714,7 +707,7 @@ static HRESULT stringify(stringify_ctx_t *ctx, jsval_t val)
hres = ptr && !append_string_len(ctx, ptr, jsstr_length(str)) ? E_OUTOFMEMORY : S_OK;
jsstr_release(str);
}else {
- if(!append_string(ctx, nullW))
+ if(!append_string(ctx, L"null"))
hres = E_OUTOFMEMORY;
}
break;
diff --git a/dlls/jscript/jsregexp.c b/dlls/jscript/jsregexp.c
index 709f00fa160..f80452d0c0b 100644
--- a/dlls/jscript/jsregexp.c
+++ b/dlls/jscript/jsregexp.c
@@ -352,11 +352,6 @@ static HRESULT create_match_array(script_ctx_t *ctx, jsstr_t *input_str,
DWORD i;
HRESULT hres = S_OK;
- static const WCHAR indexW[] = {'i','n','d','e','x',0};
- static const WCHAR inputW[] = {'i','n','p','u','t',0};
- static const WCHAR lastIndexW[] = {'l','a','s','t','I','n','d','e','x',0};
- static const WCHAR zeroW[] = {'0',0};
-
input = jsstr_flatten(input_str);
if(!input)
return E_OUTOFMEMORY;
@@ -382,15 +377,15 @@ static HRESULT create_match_array(script_ctx_t *ctx, jsstr_t *input_str,
}
while(SUCCEEDED(hres)) {
- hres = jsdisp_propput_name(array, indexW, jsval_number(result->cp-input-result->match_len));
+ hres = jsdisp_propput_name(array, L"index", jsval_number(result->cp-input-result->match_len));
if(FAILED(hres))
break;
- hres = jsdisp_propput_name(array, lastIndexW, jsval_number(result->cp-input));
+ hres = jsdisp_propput_name(array, L"lastIndex", jsval_number(result->cp-input));
if(FAILED(hres))
break;
- hres = jsdisp_propput_name(array, inputW, jsval_string(jsstr_addref(input_str)));
+ hres = jsdisp_propput_name(array, L"input", jsval_string(jsstr_addref(input_str)));
if(FAILED(hres))
break;
@@ -399,7 +394,7 @@ static HRESULT create_match_array(script_ctx_t *ctx, jsstr_t *input_str,
hres = E_OUTOFMEMORY;
break;
}
- hres = jsdisp_propput_name(array, zeroW, jsval_string(str));
+ hres = jsdisp_propput_name(array, L"0", jsval_string(str));
jsstr_release(str);
break;
}
@@ -698,10 +693,6 @@ HRESULT create_regexp_var(script_ctx_t *ctx, jsval_t src_arg, jsval_t *flags_arg
HRESULT regexp_string_match(script_ctx_t *ctx, jsdisp_t *re, jsstr_t *jsstr, jsval_t *r)
{
- static const WCHAR indexW[] = {'i','n','d','e','x',0};
- static const WCHAR inputW[] = {'i','n','p','u','t',0};
- static const WCHAR lastIndexW[] = {'l','a','s','t','I','n','d','e','x',0};
-
RegExpInstance *regexp = regexp_from_jsdisp(re);
match_result_t *match_result;
unsigned match_cnt, i;
@@ -778,16 +769,16 @@ HRESULT regexp_string_match(script_ctx_t *ctx, jsdisp_t *re, jsstr_t *jsstr, jsv
}
while(SUCCEEDED(hres)) {
- hres = jsdisp_propput_name(array, indexW, jsval_number(match_result[match_cnt-1].index));
+ hres = jsdisp_propput_name(array, L"index", jsval_number(match_result[match_cnt-1].index));
if(FAILED(hres))
break;
- hres = jsdisp_propput_name(array, lastIndexW,
+ hres = jsdisp_propput_name(array, L"lastIndex",
jsval_number(match_result[match_cnt-1].index + match_result[match_cnt-1].length));
if(FAILED(hres))
break;
- hres = jsdisp_propput_name(array, inputW, jsval_string(jsstr));
+ hres = jsdisp_propput_name(array, L"input", jsval_string(jsstr));
break;
}
@@ -973,13 +964,11 @@ HRESULT create_regexp_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdi
RegExpInstance *regexp;
HRESULT hres;
- static const WCHAR RegExpW[] = {'R','e','g','E','x','p',0};
-
hres = alloc_regexp(ctx, object_prototype, ®exp);
if(FAILED(hres))
return hres;
- hres = create_builtin_constructor(ctx, RegExpConstr_value, RegExpW, &RegExpConstr_info,
+ hres = create_builtin_constructor(ctx, RegExpConstr_value, L"RegExp", &RegExpConstr_info,
PROPF_CONSTR|2, ®exp->dispex, ret);
jsdisp_release(®exp->dispex);
diff --git a/dlls/jscript/jsstr.c b/dlls/jscript/jsstr.c
index abd960a8a02..0d73f4be13a 100644
--- a/dlls/jscript/jsstr.c
+++ b/dlls/jscript/jsstr.c
@@ -315,15 +315,13 @@ HRESULT jsstr_to_bstr(jsstr_t *str, BSTR *r)
BOOL init_strings(void)
{
- static const WCHAR NaNW[] = { 'N','a','N',0 };
- static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0};
WCHAR *ptr;
if(!(empty_str = jsstr_alloc_buf(0, &ptr)))
return FALSE;
- if(!(nan_str = jsstr_alloc(NaNW)))
+ if(!(nan_str = jsstr_alloc(L"NaN")))
return FALSE;
- if(!(undefined_str = jsstr_alloc(undefinedW)))
+ if(!(undefined_str = jsstr_alloc(L"undefined")))
return FALSE;
if(!(null_bstr_str = jsstr_alloc_buf(0, &ptr)))
return FALSE;
diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c
index b12addda794..b71a99e372a 100644
--- a/dlls/jscript/jsutils.c
+++ b/dlls/jscript/jsutils.c
@@ -388,9 +388,6 @@ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *ret, hint_t hint)
DISPID id;
HRESULT hres;
- static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0};
- static const WCHAR valueOfW[] = {'v','a','l','u','e','O','f',0};
-
if(!get_object(val)) {
*ret = jsval_null();
return S_OK;
@@ -405,7 +402,7 @@ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *ret, hint_t hint)
/* Native implementation doesn't throw TypeErrors, returns strange values */
- hres = jsdisp_get_id(jsdisp, hint == HINT_STRING ? toStringW : valueOfW, 0, &id);
+ hres = jsdisp_get_id(jsdisp, hint == HINT_STRING ? L"toString" : L"valueOf", 0, &id);
if(SUCCEEDED(hres)) {
hres = jsdisp_call(jsdisp, id, DISPATCH_METHOD, 0, NULL, &prim);
if(FAILED(hres)) {
@@ -421,7 +418,7 @@ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *ret, hint_t hint)
}
}
- hres = jsdisp_get_id(jsdisp, hint == HINT_STRING ? valueOfW : toStringW, 0, &id);
+ hres = jsdisp_get_id(jsdisp, hint == HINT_STRING ? L"valueOf" : L"toString", 0, &id);
if(SUCCEEDED(hres)) {
hres = jsdisp_call(jsdisp, id, DISPATCH_METHOD, 0, NULL, &prim);
if(FAILED(hres)) {
@@ -712,12 +709,10 @@ HRESULT to_uint32(script_ctx_t *ctx, jsval_t val, UINT32 *ret)
HRESULT double_to_string(double n, jsstr_t **str)
{
- static const WCHAR InfinityW[] = {'-','I','n','f','i','n','i','t','y',0};
-
if(isnan(n)) {
*str = jsstr_nan();
}else if(isinf(n)) {
- *str = jsstr_alloc(n<0 ? InfinityW : InfinityW+1);
+ *str = jsstr_alloc(n<0 ? L"-Infinity" : L"-Infinity"+1);
}else if(is_int32(n)) {
WCHAR buf[12];
_ltow_s(n, buf, ARRAY_SIZE(buf), 10);
@@ -744,16 +739,12 @@ HRESULT double_to_string(double n, jsstr_t **str)
/* ECMA-262 3rd Edition 9.8 */
HRESULT to_string(script_ctx_t *ctx, jsval_t val, jsstr_t **str)
{
- static const WCHAR nullW[] = {'n','u','l','l',0};
- static const WCHAR trueW[] = {'t','r','u','e',0};
- static const WCHAR falseW[] = {'f','a','l','s','e',0};
-
switch(jsval_type(val)) {
case JSV_UNDEFINED:
*str = jsstr_undefined();
return S_OK;
case JSV_NULL:
- *str = jsstr_alloc(nullW);
+ *str = jsstr_alloc(L"null");
break;
case JSV_NUMBER:
return double_to_string(get_number(val), str);
@@ -773,7 +764,7 @@ HRESULT to_string(script_ctx_t *ctx, jsval_t val, jsstr_t **str)
return hres;
}
case JSV_BOOL:
- *str = jsstr_alloc(get_bool(val) ? trueW : falseW);
+ *str = jsstr_alloc(get_bool(val) ? L"true" : L"false");
break;
default:
FIXME("unsupported %s\n", debugstr_jsval(val));
diff --git a/dlls/jscript/lex.c b/dlls/jscript/lex.c
index 9a583e33393..efed1038a95 100644
--- a/dlls/jscript/lex.c
+++ b/dlls/jscript/lex.c
@@ -159,10 +159,8 @@ static int check_keywords(parser_ctx_t *ctx, const WCHAR **lval)
static BOOL skip_html_comment(parser_ctx_t *ctx)
{
- const WCHAR html_commentW[] = {'<','!','-','-',0};
-
if(!ctx->is_html || ctx->ptr+3 >= ctx->end ||
- memcmp(ctx->ptr, html_commentW, sizeof(WCHAR)*4))
+ memcmp(ctx->ptr, L"<!--", sizeof(WCHAR)*4))
return FALSE;
ctx->nl = TRUE;
diff --git a/dlls/jscript/number.c b/dlls/jscript/number.c
index fc6bfe10cc9..3c965323d02 100644
--- a/dlls/jscript/number.c
+++ b/dlls/jscript/number.c
@@ -317,7 +317,6 @@ static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, u
if(log_radix==0)
buf[idx] = 0;
else {
- static const WCHAR formatW[] = {'(','e','%','c','%','d',')',0};
WCHAR ch;
if(log_radix<0) {
@@ -325,7 +324,7 @@ static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, u
ch = '-';
}
else ch = '+';
- swprintf(&buf[idx], ARRAY_SIZE(buf) - idx, formatW, ch, (int)log_radix);
+ swprintf(&buf[idx], ARRAY_SIZE(buf) - idx, L"(e%c%d)", ch, (int)log_radix);
}
}
else buf[idx] = '\0';
@@ -608,14 +607,12 @@ HRESULT create_number_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdi
NumberInstance *number;
HRESULT hres;
- static const WCHAR NumberW[] = {'N','u','m','b','e','r',0};
-
hres = alloc_number(ctx, object_prototype, &number);
if(FAILED(hres))
return hres;
number->value = 0;
- hres = create_builtin_constructor(ctx, NumberConstr_value, NumberW, NULL,
+ hres = create_builtin_constructor(ctx, NumberConstr_value, L"Number", NULL,
PROPF_CONSTR|1, &number->dispex, ret);
jsdisp_release(&number->dispex);
diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c
index 7c8fc36934a..3dd40e6744f 100644
--- a/dlls/jscript/string.c
+++ b/dlls/jscript/string.c
@@ -31,42 +31,6 @@ typedef struct {
jsstr_t *str;
} StringInstance;
-static const WCHAR lengthW[] = {'l','e','n','g','t','h',0};
-static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0};
-static const WCHAR valueOfW[] = {'v','a','l','u','e','O','f',0};
-static const WCHAR anchorW[] = {'a','n','c','h','o','r',0};
-static const WCHAR bigW[] = {'b','i','g',0};
-static const WCHAR blinkW[] = {'b','l','i','n','k',0};
-static const WCHAR boldW[] = {'b','o','l','d',0};
-static const WCHAR charAtW[] = {'c','h','a','r','A','t',0};
-static const WCHAR charCodeAtW[] = {'c','h','a','r','C','o','d','e','A','t',0};
-static const WCHAR concatW[] = {'c','o','n','c','a','t',0};
-static const WCHAR fixedW[] = {'f','i','x','e','d',0};
-static const WCHAR fontcolorW[] = {'f','o','n','t','c','o','l','o','r',0};
-static const WCHAR fontsizeW[] = {'f','o','n','t','s','i','z','e',0};
-static const WCHAR indexOfW[] = {'i','n','d','e','x','O','f',0};
-static const WCHAR italicsW[] = {'i','t','a','l','i','c','s',0};
-static const WCHAR lastIndexOfW[] = {'l','a','s','t','I','n','d','e','x','O','f',0};
-static const WCHAR linkW[] = {'l','i','n','k',0};
-static const WCHAR matchW[] = {'m','a','t','c','h',0};
-static const WCHAR replaceW[] = {'r','e','p','l','a','c','e',0};
-static const WCHAR searchW[] = {'s','e','a','r','c','h',0};
-static const WCHAR sliceW[] = {'s','l','i','c','e',0};
-static const WCHAR smallW[] = {'s','m','a','l','l',0};
-static const WCHAR splitW[] = {'s','p','l','i','t',0};
-static const WCHAR strikeW[] = {'s','t','r','i','k','e',0};
-static const WCHAR subW[] = {'s','u','b',0};
-static const WCHAR substringW[] = {'s','u','b','s','t','r','i','n','g',0};
-static const WCHAR substrW[] = {'s','u','b','s','t','r',0};
-static const WCHAR supW[] = {'s','u','p',0};
-static const WCHAR toLowerCaseW[] = {'t','o','L','o','w','e','r','C','a','s','e',0};
-static const WCHAR toUpperCaseW[] = {'t','o','U','p','p','e','r','C','a','s','e',0};
-static const WCHAR toLocaleLowerCaseW[] = {'t','o','L','o','c','a','l','e','L','o','w','e','r','C','a','s','e',0};
-static const WCHAR toLocaleUpperCaseW[] = {'t','o','L','o','c','a','l','e','U','p','p','e','r','C','a','s','e',0};
-static const WCHAR trimW[] = {'t','r','i','m',0};
-static const WCHAR localeCompareW[] = {'l','o','c','a','l','e','C','o','m','p','a','r','e',0};
-static const WCHAR fromCharCodeW[] = {'f','r','o','m','C','h','a','r','C','o','d','e',0};
-
static inline StringInstance *string_from_jsdisp(jsdisp_t *jsdisp)
{
return CONTAINING_RECORD(jsdisp, StringInstance, dispex);
@@ -255,31 +219,25 @@ static HRESULT do_attribute_tag_format(script_ctx_t *ctx, vdisp_t *jsthis, unsig
static HRESULT String_anchor(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
- static const WCHAR fontW[] = {'A',0};
- static const WCHAR colorW[] = {'N','A','M','E',0};
-
- return do_attribute_tag_format(ctx, jsthis, argc, argv, r, fontW, colorW);
+ return do_attribute_tag_format(ctx, jsthis, argc, argv, r, L"A", L"NAME");
}
static HRESULT String_big(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
- static const WCHAR bigtagW[] = {'B','I','G',0};
- return do_attributeless_tag_format(ctx, jsthis, r, bigtagW);
+ return do_attributeless_tag_format(ctx, jsthis, r, L"BIG");
}
static HRESULT String_blink(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
- static const WCHAR blinktagW[] = {'B','L','I','N','K',0};
- return do_attributeless_tag_format(ctx, jsthis, r, blinktagW);
+ return do_attributeless_tag_format(ctx, jsthis, r, L"BLINK");
}
static HRESULT String_bold(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
- static const WCHAR boldtagW[] = {'B',0};
- return do_attributeless_tag_format(ctx, jsthis, r, boldtagW);
+ return do_attributeless_tag_format(ctx, jsthis, r, L"B");
}
/* ECMA-262 3rd Edition 15.5.4.5 */
@@ -456,26 +414,19 @@ static HRESULT String_concat(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns
static HRESULT String_fixed(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
- static const WCHAR fixedtagW[] = {'T','T',0};
- return do_attributeless_tag_format(ctx, jsthis, r, fixedtagW);
+ return do_attributeless_tag_format(ctx, jsthis, r, L"TT");
}
static HRESULT String_fontcolor(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
- static const WCHAR fontW[] = {'F','O','N','T',0};
- static const WCHAR colorW[] = {'C','O','L','O','R',0};
-
- return do_attribute_tag_format(ctx, jsthis, argc, argv, r, fontW, colorW);
+ return do_attribute_tag_format(ctx, jsthis, argc, argv, r, L"FONT", L"COLOR");
}
static HRESULT String_fontsize(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
- static const WCHAR fontW[] = {'F','O','N','T',0};
- static const WCHAR colorW[] = {'S','I','Z','E',0};
-
- return do_attribute_tag_format(ctx, jsthis, argc, argv, r, fontW, colorW);
+ return do_attribute_tag_format(ctx, jsthis, argc, argv, r, L"FONT", L"SIZE");
}
static HRESULT String_indexOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
@@ -542,8 +493,7 @@ static HRESULT String_indexOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
static HRESULT String_italics(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
- static const WCHAR italicstagW[] = {'I',0};
- return do_attributeless_tag_format(ctx, jsthis, r, italicstagW);
+ return do_attributeless_tag_format(ctx, jsthis, r, L"I");
}
/* ECMA-262 3rd Edition 15.5.4.8 */
@@ -612,10 +562,7 @@ static HRESULT String_lastIndexOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
static HRESULT String_link(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
- static const WCHAR fontW[] = {'A',0};
- static const WCHAR colorW[] = {'H','R','E','F',0};
-
- return do_attribute_tag_format(ctx, jsthis, argc, argv, r, fontW, colorW);
+ return do_attribute_tag_format(ctx, jsthis, argc, argv, r, L"A", L"HREF");
}
/* ECMA-262 3rd Edition 15.5.4.10 */
@@ -1123,8 +1070,7 @@ static HRESULT String_slice(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsi
static HRESULT String_small(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
- static const WCHAR smalltagW[] = {'S','M','A','L','L',0};
- return do_attributeless_tag_format(ctx, jsthis, r, smalltagW);
+ return do_attributeless_tag_format(ctx, jsthis, r, L"SMALL");
}
static HRESULT String_split(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
@@ -1290,15 +1236,13 @@ static HRESULT String_split(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsi
static HRESULT String_strike(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
- static const WCHAR striketagW[] = {'S','T','R','I','K','E',0};
- return do_attributeless_tag_format(ctx, jsthis, r, striketagW);
+ return do_attributeless_tag_format(ctx, jsthis, r, L"STRIKE");
}
static HRESULT String_sub(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
- static const WCHAR subtagW[] = {'S','U','B',0};
- return do_attributeless_tag_format(ctx, jsthis, r, subtagW);
+ return do_attributeless_tag_format(ctx, jsthis, r, L"SUB");
}
/* ECMA-262 3rd Edition 15.5.4.15 */
@@ -1418,8 +1362,7 @@ static HRESULT String_substr(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns
static HRESULT String_sup(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
- static const WCHAR suptagW[] = {'S','U','P',0};
- return do_attributeless_tag_format(ctx, jsthis, r, suptagW);
+ return do_attributeless_tag_format(ctx, jsthis, r, L"SUP");
}
static HRESULT String_toLowerCase(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
@@ -1590,40 +1533,40 @@ static HRESULT String_idx_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r)
}
static const builtin_prop_t String_props[] = {
- {anchorW, String_anchor, PROPF_METHOD|1},
- {bigW, String_big, PROPF_METHOD},
- {blinkW, String_blink, PROPF_METHOD},
- {boldW, String_bold, PROPF_METHOD},
- {charAtW, String_charAt, PROPF_METHOD|1},
- {charCodeAtW, String_charCodeAt, PROPF_METHOD|1},
- {concatW, String_concat, PROPF_METHOD|1},
- {fixedW, String_fixed, PROPF_METHOD},
- {fontcolorW, String_fontcolor, PROPF_METHOD|1},
- {fontsizeW, String_fontsize, PROPF_METHOD|1},
- {indexOfW, String_indexOf, PROPF_METHOD|2},
- {italicsW, String_italics, PROPF_METHOD},
- {lastIndexOfW, String_lastIndexOf, PROPF_METHOD|2},
- {lengthW, NULL,0, String_get_length},
- {linkW, String_link, PROPF_METHOD|1},
- {localeCompareW, String_localeCompare, PROPF_METHOD|1},
- {matchW, String_match, PROPF_METHOD|1},
- {replaceW, String_replace, PROPF_METHOD|1},
- {searchW, String_search, PROPF_METHOD},
- {sliceW, String_slice, PROPF_METHOD},
- {smallW, String_small, PROPF_METHOD},
- {splitW, String_split, PROPF_METHOD|2},
- {strikeW, String_strike, PROPF_METHOD},
- {subW, String_sub, PROPF_METHOD},
- {substrW, String_substr, PROPF_METHOD|2},
- {substringW, String_substring, PROPF_METHOD|2},
- {supW, String_sup, PROPF_METHOD},
- {toLocaleLowerCaseW, String_toLocaleLowerCase, PROPF_METHOD},
- {toLocaleUpperCaseW, String_toLocaleUpperCase, PROPF_METHOD},
- {toLowerCaseW, String_toLowerCase, PROPF_METHOD},
- {toStringW, String_toString, PROPF_METHOD},
- {toUpperCaseW, String_toUpperCase, PROPF_METHOD},
- {trimW, String_trim, PROPF_ES5|PROPF_METHOD},
- {valueOfW, String_valueOf, PROPF_METHOD}
+ {L"anchor", String_anchor, PROPF_METHOD|1},
+ {L"big", String_big, PROPF_METHOD},
+ {L"blink", String_blink, PROPF_METHOD},
+ {L"bold", String_bold, PROPF_METHOD},
+ {L"charAt", String_charAt, PROPF_METHOD|1},
+ {L"charCodeAt", String_charCodeAt, PROPF_METHOD|1},
+ {L"concat", String_concat, PROPF_METHOD|1},
+ {L"fixed", String_fixed, PROPF_METHOD},
+ {L"fontcolor", String_fontcolor, PROPF_METHOD|1},
+ {L"fontsize", String_fontsize, PROPF_METHOD|1},
+ {L"indexOf", String_indexOf, PROPF_METHOD|2},
+ {L"italics", String_italics, PROPF_METHOD},
+ {L"lastIndexOf", String_lastIndexOf, PROPF_METHOD|2},
+ {L"length", NULL,0, String_get_length},
+ {L"link", String_link, PROPF_METHOD|1},
+ {L"localeCompare", String_localeCompare, PROPF_METHOD|1},
+ {L"match", String_match, PROPF_METHOD|1},
+ {L"replace", String_replace, PROPF_METHOD|1},
+ {L"search", String_search, PROPF_METHOD},
+ {L"slice", String_slice, PROPF_METHOD},
+ {L"small", String_small, PROPF_METHOD},
+ {L"split", String_split, PROPF_METHOD|2},
+ {L"strike", String_strike, PROPF_METHOD},
+ {L"sub", String_sub, PROPF_METHOD},
+ {L"substr", String_substr, PROPF_METHOD|2},
+ {L"substring", String_substring, PROPF_METHOD|2},
+ {L"sup", String_sup, PROPF_METHOD},
+ {L"toLocaleLowerCase", String_toLocaleLowerCase, PROPF_METHOD},
+ {L"toLocaleUpperCase", String_toLocaleUpperCase, PROPF_METHOD},
+ {L"toLowerCase", String_toLowerCase, PROPF_METHOD},
+ {L"toString", String_toString, PROPF_METHOD},
+ {L"toUpperCase", String_toUpperCase, PROPF_METHOD},
+ {L"trim", String_trim, PROPF_ES5|PROPF_METHOD},
+ {L"valueOf", String_valueOf, PROPF_METHOD}
};
static const builtin_info_t String_info = {
@@ -1636,7 +1579,7 @@ static const builtin_info_t String_info = {
};
static const builtin_prop_t StringInst_props[] = {
- {lengthW, NULL,0, String_get_length}
+ {L"length", NULL,0, String_get_length}
};
static const builtin_info_t StringInst_info = {
@@ -1754,7 +1697,7 @@ static HRESULT string_alloc(script_ctx_t *ctx, jsdisp_t *object_prototype, jsstr
}
static const builtin_prop_t StringConstr_props[] = {
- {fromCharCodeW, StringConstr_fromCharCode, PROPF_METHOD},
+ {L"fromCharCode", StringConstr_fromCharCode, PROPF_METHOD},
};
static const builtin_info_t StringConstr_info = {
@@ -1771,13 +1714,11 @@ HRESULT create_string_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdi
StringInstance *string;
HRESULT hres;
- static const WCHAR StringW[] = {'S','t','r','i','n','g',0};
-
hres = string_alloc(ctx, object_prototype, jsstr_empty(), &string);
if(FAILED(hres))
return hres;
- hres = create_builtin_constructor(ctx, StringConstr_value, StringW, &StringConstr_info,
+ hres = create_builtin_constructor(ctx, StringConstr_value, L"String", &StringConstr_info,
PROPF_CONSTR|1, &string->dispex, ret);
jsdisp_release(&string->dispex);
diff --git a/dlls/jscript/vbarray.c b/dlls/jscript/vbarray.c
index b2678443d2c..69a77f1e56a 100644
--- a/dlls/jscript/vbarray.c
+++ b/dlls/jscript/vbarray.c
@@ -326,13 +326,11 @@ HRESULT create_vbarray_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsd
VBArrayInstance *vbarray;
HRESULT hres;
- static const WCHAR VBArrayW[] = {'V','B','A','r','r','a','y',0};
-
hres = alloc_vbarray(ctx, object_prototype, &vbarray);
if(FAILED(hres))
return hres;
- hres = create_builtin_constructor(ctx, VBArrayConstr_value, VBArrayW, NULL, PROPF_CONSTR|1, &vbarray->dispex, ret);
+ hres = create_builtin_constructor(ctx, VBArrayConstr_value, L"VBArray", NULL, PROPF_CONSTR|1, &vbarray->dispex, ret);
jsdisp_release(&vbarray->dispex);
return hres;
--
2.26.2
2
1
If the call pFcStrListNext returns NULL the loop is never entered and
the variable font_set never gets written, leading to a crash cleaning
up font_set by pFcFontSetDestroy.
Maybe caused by dir_list being empty.
Signed-off-by: Bernhard Übelacker <bernhardu(a)mailbox.org>
C:\windows\system32\winemenubuilder.exe -a -r
0034:err:module:LdrInitializeThunk "gdi32.dll" failed to initialize, aborting
0034:err:module:LdrInitializeThunk Initializing dlls for L"C:\\windows\\system32\\winemenubuilder.exe" failed, status c0000005
(rr) bt
#0 0x7edfea16 in IA__FcFontSetDestroy (s=0x7ee0bbec <IA__FcStrSetDestroy+12>) at fcfs.c:48
#1 0x7f114d9d in fontconfig_add_fonts_from_dir_list (config=0x7d81d740, dir_list=0x7d822c60, done_set=0x7d822c30, flags=5) at .../wine-git/dlls/gdi32/freetype.c:1509
#2 0x7f114d4a in fontconfig_add_fonts_from_dir_list (config=0x7d81d740, dir_list=0x7d822b70, done_set=0x7d822c30, flags=5) at .../wine-git/dlls/gdi32/freetype.c:1503
#3 0x7f114d4a in fontconfig_add_fonts_from_dir_list (config=0x7d81d740, dir_list=0x7d82a910, done_set=0x7d822c30, flags=5) at .../wine-git/dlls/gdi32/freetype.c:1503
#4 0x7f114d4a in fontconfig_add_fonts_from_dir_list (config=0x7d81d740, dir_list=0x7d82a570, done_set=0x7d822c30, flags=5) at .../wine-git/dlls/gdi32/freetype.c:1503
#5 0x7f114e52 in load_fontconfig_fonts () at .../wine-git/dlls/gdi32/freetype.c:1526
#6 0x7f115d46 in freetype_load_fonts () at .../wine-git/dlls/gdi32/freetype.c:1749
#7 0x6ca35fcc in font_init () at .../wine-git/dlls/gdi32/font.c:7944
#8 0x6ca37698 in DllMain(a)12 (inst=0x6c9c0000, reason=1, reserved=0x31fd24) at .../wine-git/dlls/gdi32/gdiobj.c:629
#9 0x7bc2c266 in call_dll_entry_point ()
#10 0x7bc2f6e6 in MODULE_InitDLL (wm=<optimized out>, reason=<optimized out>, lpReserved=<optimized out>) at .../wine-git/dlls/ntdll/loader.c:1332
#11 0x7bc2fafc in process_attach (wm=0x110f10, lpReserved=0x31fd24) at .../wine-git/dlls/ntdll/loader.c:1426
#12 0x7bc2fa4a in process_attach (wm=0x1109a8, lpReserved=0x31fd24) at .../wine-git/dlls/ntdll/loader.c:1397
#13 0x7bc2fa4a in process_attach (wm=0x1107d8, lpReserved=0x31fd24) at .../wine-git/dlls/ntdll/loader.c:1397
#14 0x7bc32f58 in LdrInitializeThunk(a)16 (context=0x31fd24, unknown2=268427264, unknown3=1, unknown4=0) at .../wine-git/dlls/ntdll/loader.c:1397
#15 0x00000000 in ?? ()
(rr)
(rr) print/x *dir_list
$14 = {set = 0x7d820190, n = 0x0}
Two frames up shows dir="/usr/share/fonts/X11/100dpi".
libfontconfig1:i386 in version 2.13.1-4.2.
Might be related to:
a51d68e35c53
gdi32: Load font list directly from fontconfig cache.
---
dlls/gdi32/freetype.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 993110e6fe0..e7684728c9c 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -1468,7 +1468,7 @@ static void init_fontconfig(void)
static void fontconfig_add_fonts_from_dir_list( FcConfig *config, FcStrList *dir_list, FcStrSet *done_set, DWORD flags )
{
const FcChar8 *dir;
- FcFontSet *font_set;
+ FcFontSet *font_set = NULL;
FcStrList *subdir_list = NULL;
FcStrSet *subdir_set = NULL;
FcCache *cache = NULL;
--
2.29.2
3
2
[PATCH] winex11.drv: Add a taskbar button for a minimized owned window.
by Dmitry Timoshkov 24 Nov '20
by Dmitry Timoshkov 24 Nov '20
24 Nov '20
Otherwise minimizing an owned window without WS_EX_APPWINDOW style (common
for Delphi applications) leads to a window completely disappearing after being
minimized.
Before this patch: no taskbar window for a normal or minimized owned window.
After this patch: no taskbar window for normal owned window, after a window
being minimized a taskbar button appears, after a window being restored a taskbar
button gets removed.
Essentially this patch fixes a regression caused by
commit 61e50e15ba45ad54655f98619f5ef33917033165
Author: Alexandre Julliard <julliard(a)winehq.org>
Date: Fri May 28 12:14:43 2010 +0200
winex11: Map zero-size windows and set an empty window region for them.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/winex11.drv/window.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 457173964e..f0a3f07f37 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -987,7 +987,7 @@ void update_net_wm_states( struct x11drv_win_data *data )
new_state |= (1 << NET_WM_STATE_ABOVE);
if (ex_style & (WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE))
new_state |= (1 << NET_WM_STATE_SKIP_TASKBAR) | (1 << NET_WM_STATE_SKIP_PAGER);
- if (!(ex_style & WS_EX_APPWINDOW) && GetWindow( data->hwnd, GW_OWNER ))
+ if (!(ex_style & WS_EX_APPWINDOW) && !(style & WS_MINIMIZE) && GetWindow( data->hwnd, GW_OWNER ))
new_state |= (1 << NET_WM_STATE_SKIP_TASKBAR);
if (!data->mapped) /* set the _NET_WM_STATE atom directly */
@@ -2499,7 +2499,8 @@ void CDECL X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags
else
{
if (swp_flags & (SWP_FRAMECHANGED|SWP_STATECHANGED)) set_wm_hints( data );
- if (!event_type) update_net_wm_states( data );
+ if (!event_type || event_type == PropertyNotify)
+ update_net_wm_states( data );
}
}
--
2.29.2
1
0
[PATCH 2/2] winebus.sys: Support setting SDL controller mapping through environment variable.
by Hans Leidekker 24 Nov '20
by Hans Leidekker 24 Nov '20
24 Nov '20
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50154
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/winebus.sys/bus_sdl.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c
index feac5acf950..19c6f23e071 100644
--- a/dlls/winebus.sys/bus_sdl.c
+++ b/dlls/winebus.sys/bus_sdl.c
@@ -1024,8 +1024,15 @@ static DWORD CALLBACK deviceloop_thread(void *args)
{
HKEY key;
static const WCHAR szPath[] = {'m','a','p',0};
+ const char *mapping;
- if (!RegOpenKeyExW(driver_key, szPath, 0, KEY_QUERY_VALUE, &key))
+ if ((mapping = getenv("SDL_GAMECONTROLLERCONFIG")))
+ {
+ TRACE("Setting environment mapping %s\n", debugstr_a(mapping));
+ if (pSDL_GameControllerAddMapping(mapping) < 0)
+ WARN("Failed to add environment mapping %s\n", pSDL_GetError());
+ }
+ else if (!RegOpenKeyExW(driver_key, szPath, 0, KEY_QUERY_VALUE, &key))
{
DWORD index = 0;
CHAR *buffer = NULL;
@@ -1054,8 +1061,9 @@ static DWORD CALLBACK deviceloop_thread(void *args)
if (rc == STATUS_SUCCESS)
{
- TRACE("Setting mapping %s...\n",debugstr_an(buffer,29));
- pSDL_GameControllerAddMapping(buffer);
+ TRACE("Setting registry mapping %s\n", debugstr_a(buffer));
+ if (pSDL_GameControllerAddMapping(buffer) < 0)
+ WARN("Failed to add registry mapping %s\n", pSDL_GetError());
index ++;
}
} while (rc == STATUS_SUCCESS);
--
2.29.2
1
0
[PATCH 1/2] winebus.sys: Fix registry access rights for SDL controller mapping.
by Hans Leidekker 24 Nov '20
by Hans Leidekker 24 Nov '20
24 Nov '20
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48545
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/winebus.sys/bus_sdl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c
index 95d5b9f9d0d..feac5acf950 100644
--- a/dlls/winebus.sys/bus_sdl.c
+++ b/dlls/winebus.sys/bus_sdl.c
@@ -1025,7 +1025,7 @@ static DWORD CALLBACK deviceloop_thread(void *args)
HKEY key;
static const WCHAR szPath[] = {'m','a','p',0};
- if (!RegOpenKeyExW(driver_key, szPath, 0, KEY_ENUMERATE_SUB_KEYS, &key))
+ if (!RegOpenKeyExW(driver_key, szPath, 0, KEY_QUERY_VALUE, &key))
{
DWORD index = 0;
CHAR *buffer = NULL;
--
2.29.2
1
0
[PATCH 1/4] quartz: Avoid autoplugging renderers in IGraphBuilder::Connect().
by Zebediah Figura 24 Nov '20
by Zebediah Figura 24 Nov '20
24 Nov '20
I don't know of an application that this helps, but it seems like an
optimization worth performing.
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/quartz/filtergraph.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index cf2421f64e2..58038829217 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -1397,7 +1397,7 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *source, I
EnterCriticalSection(&graph->cs);
- hr = autoplug(graph, source, sink, FALSE, 0);
+ hr = autoplug(graph, source, sink, TRUE, 0);
LeaveCriticalSection(&graph->cs);
--
2.29.2
1
3
23 Nov '20
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/quartz/tests/vmr7.c | 11 ++++++++---
dlls/quartz/tests/vmr9.c | 17 +++++++++--------
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c
index d7daa6deed5..fd39945b2e3 100644
--- a/dlls/quartz/tests/vmr7.c
+++ b/dlls/quartz/tests/vmr7.c
@@ -1181,7 +1181,7 @@ static void test_flushing(IPin *pin, IMemInputPin *input, IMediaControl *control
thread = send_frame(input);
ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
- hr = IMediaControl_GetState(control, 0, &state);
+ hr = IMediaControl_GetState(control, 1000, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IPin_BeginFlush(pin);
@@ -1201,10 +1201,15 @@ static void test_flushing(IPin *pin, IMemInputPin *input, IMediaControl *control
hr = IMediaControl_GetState(control, 0, &state);
todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
+ ok(state == State_Paused, "Got state %#x.\n", state);
thread = send_frame(input);
ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
+ hr = IMediaControl_GetState(control, 1000, &state);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(state == State_Paused, "Got state %#x.\n", state);
+
hr = IMediaControl_Run(control);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = join_thread(thread);
@@ -2108,8 +2113,8 @@ static void test_video_window_messages(IVideoWindow *window, HWND hwnd, HWND our
params.message = WM_SYSCOLORCHANGE;
thread = CreateThread(NULL, 0, notify_message_proc, ¶ms, 0, NULL);
ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block.\n");
- ret = GetQueueStatus(QS_SENDMESSAGE | QS_POSTMESSAGE);
- ok(ret == ((QS_SENDMESSAGE << 16) | QS_SENDMESSAGE), "Got unexpected status %#x.\n", ret);
+ ret = MsgWaitForMultipleObjects(0, NULL, FALSE, 1000, QS_SENDMESSAGE);
+ ok(!ret, "Did not find a sent message.\n");
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok(!WaitForSingleObject(thread, 1000), "Wait timed out.\n");
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c
index f88c43b07b5..8b46e4706a5 100644
--- a/dlls/quartz/tests/vmr9.c
+++ b/dlls/quartz/tests/vmr9.c
@@ -1220,10 +1220,15 @@ static void test_flushing(IPin *pin, IMemInputPin *input, IMediaControl *control
hr = IMediaControl_GetState(control, 0, &state);
todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
+ ok(state == State_Paused, "Got state %#x.\n", state);
thread = send_frame(input);
ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
+ hr = IMediaControl_GetState(control, 1000, &state);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(state == State_Paused, "Got state %#x.\n", state);
+
hr = IMediaControl_Run(control);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = join_thread(thread);
@@ -1432,18 +1437,14 @@ static void test_sample_time(IPin *pin, IMemInputPin *input, IMediaControl *cont
hr = join_thread(send_frame_time(input, -2, 0x00ff0000)); /* red */
ok(hr == S_OK, "Got hr %#x.\n", hr);
- thread = send_frame_time(input, 2, 0x00ff00ff); /* magenta */
- ok(WaitForSingleObject(thread, 500) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
- hr = join_thread(thread);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
-
thread = send_frame_time(input, 1000000, 0x00ffffff); /* white */
ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
hr = IPin_BeginFlush(pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = join_thread(thread);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ /* If the frame makes it to Receive() in time to be rendered, we get S_OK. */
+ ok(hr == S_OK || hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IPin_EndFlush(pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -2351,8 +2352,8 @@ static void test_video_window_messages(IVideoWindow *window, HWND hwnd, HWND our
params.message = WM_SYSCOLORCHANGE;
thread = CreateThread(NULL, 0, notify_message_proc, ¶ms, 0, NULL);
ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block.\n");
- ret = GetQueueStatus(QS_SENDMESSAGE | QS_POSTMESSAGE);
- ok(ret == ((QS_SENDMESSAGE << 16) | QS_SENDMESSAGE), "Got unexpected status %#x.\n", ret);
+ ret = MsgWaitForMultipleObjects(0, NULL, FALSE, 1000, QS_SENDMESSAGE);
+ ok(!ret, "Did not find a sent message.\n");
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok(!WaitForSingleObject(thread, 1000), "Wait timed out.\n");
--
2.29.2
1
0
[PATCH] winebus.sys: Open IOHID devices individually to fix macOS Catalina and Big Sur.
by Brendan Shanks 23 Nov '20
by Brendan Shanks 23 Nov '20
23 Nov '20
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50153
Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com>
---
This fixes HID device access on macOS Catalina and Big Sur when "Input
Monitoring" permission has not been granted by the user (by design, a
fairly inconvenient process).
In the future I'd also like to have hidclass.sys defer report processing
until a device is opened, not created. Then the IOHIDDeviceOpen() call
can be made from the necessary vtbl functions, and the permission dialog
should not appear unless an application actually tries to open a
privileged HID device.
dlls/winebus.sys/bus_iohid.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/dlls/winebus.sys/bus_iohid.c b/dlls/winebus.sys/bus_iohid.c
index df578b4b9d6..ee6225bf398 100644
--- a/dlls/winebus.sys/bus_iohid.c
+++ b/dlls/winebus.sys/bus_iohid.c
@@ -297,6 +297,13 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void *
if (str) CFStringToWSTR(str, serial_string, ARRAY_SIZE(serial_string));
uid = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDLocationIDKey)));
+ if (IOHIDDeviceOpen(IOHIDDevice, 0) != kIOReturnSuccess)
+ {
+ ERR("Failed to open HID device %p (vid %04x, pid %04x)\n", IOHIDDevice, vid, pid);
+ return;
+ }
+ IOHIDDeviceScheduleWithRunLoop(IOHIDDevice, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
+
if (IOHIDDeviceConformsTo(IOHIDDevice, kHIDPage_GenericDesktop, kHIDUsage_GD_GamePad) ||
IOHIDDeviceConformsTo(IOHIDDevice, kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick))
{
@@ -365,6 +372,8 @@ static void handle_RemovalCallback(void *context, IOReturn result, void *sender,
IOHIDDeviceRegisterInputReportCallback(IOHIDDevice, NULL, 0, NULL, NULL);
/* Note: Yes, we leak the buffer. But according to research there is no
safe way to deallocate that buffer. */
+ IOHIDDeviceUnscheduleFromRunLoop(IOHIDDevice, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
+ IOHIDDeviceClose(IOHIDDevice, 0);
device = bus_find_hid_device(&iohid_vtbl, IOHIDDevice);
if (device)
{
@@ -383,13 +392,6 @@ static DWORD CALLBACK runloop_thread(void *args)
IOHIDManagerRegisterDeviceMatchingCallback(hid_manager, handle_DeviceMatchingCallback, NULL);
IOHIDManagerRegisterDeviceRemovalCallback(hid_manager, handle_RemovalCallback, NULL);
IOHIDManagerScheduleWithRunLoop(hid_manager, run_loop, kCFRunLoopDefaultMode);
- if (IOHIDManagerOpen( hid_manager, 0 ) != kIOReturnSuccess)
- {
- ERR("Couldn't open IOHIDManager.\n");
- IOHIDManagerUnscheduleFromRunLoop(hid_manager, run_loop, kCFRunLoopDefaultMode);
- CFRelease(hid_manager);
- return 0;
- }
CFRunLoopRun();
TRACE("Run Loop exiting\n");
--
2.26.2
1
0
Re: [PATCH] shell32/tests: Increase 6 buffers to avoid potential overflows via sprintf (GCC).
by Gerald Pfeifer 23 Nov '20
by Gerald Pfeifer 23 Nov '20
23 Nov '20
This patch of mine in 2018 received a note from Nikolay
"I think we should try instead to use more predictable paths. This
change scatters magic increments, that looks worse than a warning
in my opinion."
as it's only response. It was not applied.
Nearly to the day two years later pretty exactly the same patch got
applied, from a different author:
commit d1373e8aae1b15b96e847488e4b6617789f8fb62
Author: Rémi Bernon <rbernon(a)codeweavers.com>
Date: Tue Feb 11 19:09:30 2020 +0100
shell32/tests: Fix some format-overflow warnings.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
This is the second such case I learned about this week.
Gerald
On Sun, 18 Feb 2018, Gerald Pfeifer wrote:
> This sheds off 10 warnings from builds with current versions of GCC.
>
> The pattern is printing a pathname plus some additional text into a
> buffer the size of a pathname.
>
> Gerald
>
> Signed-off-by: Gerald Pfeifer <gerald(a)pfeifer.com>
> ---
> dlls/shell32/tests/shlexec.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
> index 9db12ce42a..4f00db44e6 100644
> --- a/dlls/shell32/tests/shlexec.c
> +++ b/dlls/shell32/tests/shlexec.c
> @@ -1654,7 +1654,7 @@ static void test_argify(void)
>
> static void test_filename(void)
> {
> - char filename[MAX_PATH];
> + char filename[MAX_PATH+16];
> const filename_tests_t* test;
> char* c;
> INT_PTR rc;
> @@ -1920,7 +1920,7 @@ static void test_fileurls(void)
>
> static void test_urls(void)
> {
> - char url[MAX_PATH];
> + char url[MAX_PATH+15];
> INT_PTR rc;
>
> if (!create_test_class("fakeproto", FALSE))
> @@ -2015,7 +2015,7 @@ static void test_urls(void)
> static void test_find_executable(void)
> {
> char notepad_path[MAX_PATH];
> - char filename[MAX_PATH];
> + char filename[MAX_PATH+17];
> char command[MAX_PATH];
> const filename_tests_t* test;
> INT_PTR rc;
> @@ -2433,7 +2433,7 @@ static void hook_WaitForInputIdle(DWORD (WINAPI *new_func)(HANDLE, DWORD))
>
> static void test_dde(void)
> {
> - char filename[MAX_PATH], defApplication[MAX_PATH];
> + char filename[MAX_PATH+14], defApplication[MAX_PATH];
> const dde_tests_t* test;
> char params[1024];
> INT_PTR rc;
> @@ -2600,7 +2600,7 @@ static DWORD CALLBACK ddeThread(LPVOID arg)
>
> static void test_dde_default_app(void)
> {
> - char filename[MAX_PATH];
> + char filename[MAX_PATH+15];
> HSZ hszApplication;
> dde_thread_info_t info = { filename, GetCurrentThreadId() };
> const dde_default_app_tests_t* test;
> @@ -2702,7 +2702,7 @@ static void init_test(void)
> {
> HMODULE hdll;
> HRESULT (WINAPI *pDllGetVersion)(DLLVERSIONINFO*);
> - char filename[MAX_PATH];
> + char filename[MAX_PATH+26];
> WCHAR lnkfile[MAX_PATH];
> char params[1024];
> const char* const * testfile;
>
2
1