b=476903; additional ARM xptc marshalling fixes (avoid unsigned char dependency); r=bsmedberg
authorVladimir Vukicevic <vladimir@pobox.com>
Fri, 20 Mar 2009 08:23:44 -0700
changeset 26577 f2ace497dea6
parent 26576 593d36f8c437
child 26578 4b357b32c132
push id6119
push uservladimir@mozilla.com
push dateWed, 25 Mar 2009 01:45:57 +0000
treeherdermozilla-central@4b357b32c132 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs476903
milestone1.9.2a1pre
b=476903; additional ARM xptc marshalling fixes (avoid unsigned char dependency); r=bsmedberg
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp
xpcom/reflect/xptcall/src/md/win32/xptcinvokece.cpp
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp
@@ -125,19 +125,16 @@ invoke_copy_to_stack(PRUint32* d, PRUint
     {
         if(s->IsPtrData())
         {
             *((void**)d) = s->ptr;
             continue;
         }
         // According to the ARM EABI, integral types that are smaller than a word
         // are to be sign/zero-extended to a full word and treated as 4-byte values.
-        // NOTE: on ARM/gcc, char is unsigned by default, and PRunichar is unisgned.
-        PR_STATIC_ASSERT(char(0xFF) == PRUint32(0xFF));
-        PR_STATIC_ASSERT(PRUnichar(0xFFFF) == PRUint32(0xFFFF));
 
         switch(s->type)
         {
         case nsXPTType::T_I8     : *((PRInt32*) d) = s->val.i8;          break;
         case nsXPTType::T_I16    : *((PRInt32*) d) = s->val.i16;         break;
         case nsXPTType::T_I32    : *((PRInt32*) d) = s->val.i32;         break;
         case nsXPTType::T_I64    : d = DOUBLEWORD_ALIGN(d);
                                    *((PRInt64*) d) = s->val.i64; d++;    break;
@@ -145,18 +142,18 @@ invoke_copy_to_stack(PRUint32* d, PRUint
         case nsXPTType::T_U16    : *((PRUint32*)d) = s->val.u16;         break;
         case nsXPTType::T_U32    : *((PRUint32*)d) = s->val.u32;         break;
         case nsXPTType::T_U64    : d = DOUBLEWORD_ALIGN(d);
                                    *((PRUint64*)d) = s->val.u64; d++;    break;
         case nsXPTType::T_FLOAT  : *((float*)   d) = s->val.f;           break;
         case nsXPTType::T_DOUBLE : d = DOUBLEWORD_ALIGN(d);
                                    *((double*)  d) = s->val.d;   d++;    break;
         case nsXPTType::T_BOOL   : *((PRInt32*) d) = s->val.b;           break;
-        case nsXPTType::T_CHAR   : *((PRUint32*)d) = s->val.c;           break;
-        case nsXPTType::T_WCHAR  : *((PRUint32*)d) = s->val.wc;          break;
+        case nsXPTType::T_CHAR   : *((PRInt32*) d) = s->val.c;           break;
+        case nsXPTType::T_WCHAR  : *((PRInt32*) d) = s->val.wc;          break;
         default:
             // all the others are plain pointer types
             *((void**)d) = s->val.p;
             break;
         }
     }
 }
 
--- a/xpcom/reflect/xptcall/src/md/win32/xptcinvokece.cpp
+++ b/xpcom/reflect/xptcall/src/md/win32/xptcinvokece.cpp
@@ -58,35 +58,32 @@ invoke_copy_to_stack(PRUint32* d, PRUint
   {
     if(s->IsPtrData())
     {
       *((void**)d) = s->ptr;
       continue;
     }
     // According to the ARM EABI, integral types that are smaller than a word
     // are to be sign/zero-extended to a full word and treated as 4-byte values.
-    // NOTE: on ARM/CE, char is signed, but PRunichar is unsigned.
-    PR_STATIC_ASSERT(char(0xFF) < 0);
-    PR_STATIC_ASSERT(PRUnichar(0xFFFF) == PRUint32(0xFFFF));
 
     switch(s->type)
     {
       case nsXPTType::T_I8     : *((PRInt32*) d) = s->val.i8;          break;
       case nsXPTType::T_I16    : *((PRInt32*) d) = s->val.i16;         break;
       case nsXPTType::T_I32    : *((PRInt32*) d) = s->val.i32;         break;
       case nsXPTType::T_I64    : *((PRInt64*) d) = s->val.i64; d++;    break;
       case nsXPTType::T_U8     : *((PRUint32*)d) = s->val.u8;          break;
       case nsXPTType::T_U16    : *((PRUint32*)d) = s->val.u16;         break;
       case nsXPTType::T_U32    : *((PRUint32*)d) = s->val.u32;         break;
       case nsXPTType::T_U64    : *((PRUint64*)d) = s->val.u64; d++;    break;
       case nsXPTType::T_FLOAT  : *((float*)   d) = s->val.f;           break;
       case nsXPTType::T_DOUBLE : *((double*)  d) = s->val.d;   d++;    break;
       case nsXPTType::T_BOOL   : *((PRInt32*) d) = s->val.b;           break;
       case nsXPTType::T_CHAR   : *((PRInt32*) d) = s->val.c;           break;
-      case nsXPTType::T_WCHAR  : *((PRUint32*)d) = s->val.wc;          break;
+      case nsXPTType::T_WCHAR  : *((PRInt32*) d) = s->val.wc;          break;
       default:
         // all the others are plain pointer types
         *((void**)d) = s->val.p;
         break;
     }
   }
 }