[PATCH] jscript: Make several constants static

Alex Henrie alexhenrie24 at gmail.com
Fri Nov 30 01:14:07 CST 2018


Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
 dlls/jscript/compile.c | 2 +-
 dlls/jscript/json.c    | 2 +-
 dlls/jscript/jsutils.c | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c
index 5e844ee6e4..3f9db7a179 100644
--- a/dlls/jscript/compile.c
+++ b/dlls/jscript/compile.c
@@ -693,7 +693,7 @@ 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: {
-        const WCHAR fixmeW[] = {'F','I','X','M','E',0};
+        static const WCHAR fixmeW[] = {'F','I','X','M','E',0};
 
         WARN("invalid delete, unimplemented exception message\n");
 
diff --git a/dlls/jscript/json.c b/dlls/jscript/json.c
index 0267340ca4..d440543690 100644
--- a/dlls/jscript/json.c
+++ b/dlls/jscript/json.c
@@ -487,7 +487,7 @@ static HRESULT json_quote(stringify_ctx_t *ctx, const WCHAR *ptr, size_t len)
             break;
         default:
             if(*ptr < ' ') {
-                const WCHAR formatW[] = {'\\','u','%','0','4','x',0};
+                static const WCHAR formatW[] = {'\\','u','%','0','4','x',0};
                 WCHAR buf[7];
                 sprintfW(buf, formatW, *ptr);
                 if(!append_string(ctx, buf))
diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c
index 72dd4dbe9c..b612e65d7b 100644
--- a/dlls/jscript/jsutils.c
+++ b/dlls/jscript/jsutils.c
@@ -718,7 +718,7 @@ static jsstr_t *int_to_string(int i)
 
 HRESULT double_to_string(double n, jsstr_t **str)
 {
-    const WCHAR InfinityW[] = {'-','I','n','f','i','n','i','t','y',0};
+    static const WCHAR InfinityW[] = {'-','I','n','f','i','n','i','t','y',0};
 
     if(isnan(n)) {
         *str = jsstr_nan();
@@ -748,9 +748,9 @@ 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)
 {
-    const WCHAR nullW[] = {'n','u','l','l',0};
-    const WCHAR trueW[] = {'t','r','u','e',0};
-    const WCHAR falseW[] = {'f','a','l','s','e',0};
+    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:
-- 
2.19.2




More information about the wine-devel mailing list