Write out initialization of array; c++0b seems to forbid narrowing
authorJim Blandy <jimb@mozilla.com>
Fri, 15 Apr 2011 15:44:01 -0700
changeset 74383 086e038cf0f48369822fc4ba3ac59b37c3009d27
parent 74382 090fcf731131e25c5c73525869f852cad259f7f4
child 74384 ce3107de21106a48fd76d25dc190d33a5abda3ac
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
milestone2.2a1pre
Write out initialization of array; c++0b seems to forbid narrowing conversions within { initializers }.
js/src/jsdbg.cpp
--- a/js/src/jsdbg.cpp
+++ b/js/src/jsdbg.cpp
@@ -43,17 +43,19 @@
 #include "jsobjinlines.h"
 
 using namespace js;
 
 bool
 ReportMoreArgsNeeded(JSContext *cx, const char *name, uintN required)
 {
     JS_ASSERT(required < 10);
-    char s[2] = { '0' + required, '\0' };
+    char s[2];
+    s[0] = '0' + required;
+    s[1] = '\0';
     JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_MORE_ARGS_NEEDED,
                          name, s, required == 1 ? "" : "s");
     return false;
 }
 
 #define REQUIRE_ARGC(name, n) \
     JS_BEGIN_MACRO \
         if (argc < n) \