commit 06a5dd6038d06df968bc1610dccf04c4ad16fe44
authorDan Witte <dwitte@mozilla.com>
Sat, 13 Mar 2010 11:19:58 -0800
changeset 39398 640c7807d972a7363e18bcb0fd38c1b29f6fb410
parent 39397 7fcf72c7ff5db20025ed383818a94d58aa1703cf
child 39399 31b7d1785eb23d24f33c578c7a20c2e4704469e7
push id12171
push userdwitte@mozilla.com
push dateSat, 13 Mar 2010 19:20:38 +0000
treeherdermozilla-central@640c7807d972 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs513788
milestone1.9.3a3pre
commit 06a5dd6038d06df968bc1610dccf04c4ad16fe44 Author: Jacek Caban <jacek@codeweavers.com> Date: Sat Mar 13 13:23:21 2010 +0100 Bug 513788 - mingw fix
js/ctypes/CTypes.cpp
--- a/js/ctypes/CTypes.cpp
+++ b/js/ctypes/CTypes.cpp
@@ -969,35 +969,35 @@ jsvalToPtrExplicit(JSContext* cx, jsval 
 }
 
 template<class IntegerType>
 nsAutoString
 IntegerToString(IntegerType i, jsuint radix)
 {
   // The buffer must be big enough for all the bits of IntegerType to fit,
   // in base-2, including '-'.
-  jschar buffer[sizeof(IntegerType) * 8 + 1];
-  jschar *cp = buffer + sizeof(buffer) / sizeof(jschar);
+  PRUnichar buffer[sizeof(IntegerType) * 8 + 1];
+  PRUnichar* cp = buffer + sizeof(buffer) / sizeof(PRUnichar);
 
   // Build the string in reverse. We use multiplication and subtraction
   // instead of modulus because that's much faster.
   bool isNegative = !IsUnsigned<IntegerType>() && i < 0;
   size_t sign = isNegative ? -1 : 1;
   do {
     IntegerType ii = i / IntegerType(radix);
     size_t index = sign * size_t(i - ii * IntegerType(radix));
     *--cp = "0123456789abcdefghijklmnopqrstuvwxyz"[index];
     i = ii;
   } while (i != 0);
 
   if (isNegative)
     *--cp = '-';
 
   JS_ASSERT(cp >= buffer);
-  return nsAutoString(cp, buffer + sizeof(buffer) / sizeof(jschar) - cp);
+  return nsAutoString(cp, buffer + sizeof(buffer) / sizeof(PRUnichar) - cp);
 }
 
 template<class IntegerType>
 static bool
 StringToInteger(JSContext* cx, JSString* string, IntegerType* result)
 {
   const jschar* cp = JS_GetStringChars(string);
   const jschar* end = cp + JS_GetStringLength(string);
@@ -3180,17 +3180,18 @@ AddFieldToArray(JSContext* cx,
   JSObject* fieldObj = JS_NewObject(cx, NULL, NULL, NULL);
   if (!fieldObj)
     return false;
 
   if (!JS_DefineElement(cx, arrayObj, index, OBJECT_TO_JSVAL(fieldObj),
          NULL, NULL, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT))
     return false;
 
-  if (!JS_DefineUCProperty(cx, fieldObj, name.get(), name.Length(),
+  if (!JS_DefineUCProperty(cx, fieldObj,
+         reinterpret_cast<const jschar*>(name.get()), name.Length(),
          OBJECT_TO_JSVAL(typeObj), NULL, NULL,
          JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT))
     return false;
 
   return JS_SealObject(cx, fieldObj, JS_FALSE);
 }
 
 JSBool
@@ -3273,17 +3274,17 @@ StructType::Create(JSContext* cx, uintN 
       }
 
       // Duplicate the object for the fields property.
       if (!AddFieldToArray(cx, fieldsProp, i, info->mName, info->mType))
         return JS_FALSE;
 
       // Fill in the PropertySpec for the field.
       PropertySpec* instanceProp = instanceProps.AppendElement();
-      instanceProp->name = info->mName.get();
+      instanceProp->name = reinterpret_cast<const jschar*>(info->mName.get());
       instanceProp->namelen = info->mName.Length();
       instanceProp->flags = JSPROP_SHARED | JSPROP_ENUMERATE | JSPROP_PERMANENT;
       instanceProp->getter = StructType::FieldGetter;
       instanceProp->setter = StructType::FieldSetter;
 
       elements[i] = CType::GetFFIType(cx, info->mType);
 
       size_t fieldSize = CType::GetSize(cx, info->mType);