Bug 579517 - Part 2: Make the IDL parser aware of stdint types; r=bsmedberg
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 22 Aug 2012 11:57:22 -0400
changeset 102998 c0726f9e6dc201c0521dc3a8b9e87bc71ee99913
parent 102997 a16372ce30b5f6b747246b01fcd215a4bf3b6342
child 102999 8e62cbb35f67193e155d17d12945776fd4accb8b
push id23320
push usereakhgari@mozilla.com
push dateWed, 22 Aug 2012 16:03:27 +0000
treeherdermozilla-central@88e47f6905e9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs579517
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 579517 - Part 2: Make the IDL parser aware of stdint types; r=bsmedberg
js/xpconnect/src/dictionary_helper_gen.py
xpcom/idl-parser/header.py
xpcom/idl-parser/xpidl.py
--- a/js/xpconnect/src/dictionary_helper_gen.py
+++ b/js/xpconnect/src/dictionary_helper_gen.py
@@ -300,31 +300,31 @@ def write_getter(a, iface, fd):
                  % (get_jsid(a.name), a.name))
     else:
         fd.write("    NS_ENSURE_STATE(JS_GetPropertyById(aCx, aObj, %s, &v));\n"
                  % get_jsid(a.name))
     if realtype.count("bool"):
         fd.write("    JSBool b;\n")
         fd.write("    MOZ_ALWAYS_TRUE(JS_ValueToBoolean(aCx, v, &b));\n")
         fd.write("    aDict.%s = b;\n" % a.name)
-    elif realtype.count("PRUint32"):
+    elif realtype.count("uint32_t"):
         fd.write("    NS_ENSURE_STATE(JS_ValueToECMAUint32(aCx, v, &aDict.%s));\n" % a.name)
-    elif realtype.count("PRInt32"):
+    elif realtype.count("int32_t"):
         fd.write("    NS_ENSURE_STATE(JS_ValueToECMAInt32(aCx, v, &aDict.%s));\n" % a.name)
     elif realtype.count("double"):
         fd.write("    NS_ENSURE_STATE(JS_ValueToNumber(aCx, v, &aDict.%s));\n" % a.name)
     elif realtype.count("float"):
         fd.write("    double d;\n")
         fd.write("    NS_ENSURE_STATE(JS_ValueToNumber(aCx, v, &d));")
         fd.write("    aDict.%s = (float) d;\n" % a.name)
-    elif realtype.count("PRUint16"):
+    elif realtype.count("uint16_t"):
         fd.write("    uint32_t u;\n")
         fd.write("    NS_ENSURE_STATE(JS_ValueToECMAUint32(aCx, v, &u));\n")
         fd.write("    aDict.%s = u;\n" % a.name)
-    elif realtype.count("PRInt16"):
+    elif realtype.count("int16_t"):
         fd.write("    int32_t i;\n")
         fd.write("    NS_ENSURE_STATE(JS_ValueToECMAInt32(aCx, v, &i));\n")
         fd.write("    aDict.%s = i;\n" % a.name)
     elif realtype.count("nsAString"):
         if a.nullable:
             fd.write("    xpc_qsDOMString d(aCx, v, &v, xpc_qsDOMString::eNull, xpc_qsDOMString::eNull);\n")
         else:
             fd.write("    xpc_qsDOMString d(aCx, v, &v, xpc_qsDOMString::eStringify, xpc_qsDOMString::eStringify);\n")
--- a/xpcom/idl-parser/header.py
+++ b/xpcom/idl-parser/header.py
@@ -80,17 +80,17 @@ def methodAsNative(m):
 
 def paramlistAsNative(m, empty='void'):
     l = [paramAsNative(p) for p in m.params]
 
     if m.implicit_jscontext:
         l.append("JSContext* cx")
 
     if m.optional_argc:
-        l.append('PRUint8 _argc')
+        l.append('uint8_t _argc')
 
     if not m.notxpcom and m.realtype.name != 'void':
         l.append(paramAsNative(xpidl.Param(paramtype='out',
                                            type=None,
                                            name='_retval',
                                            attlist=[],
                                            location=None,
                                            realtype=m.realtype)))
--- a/xpcom/idl-parser/xpidl.py
+++ b/xpcom/idl-parser/xpidl.py
@@ -115,30 +115,23 @@ class Builtin(object):
         else:
             const = ''
         return "%s%s %s" % (const, self.nativename,
                             calltype != 'in' and '*' or '')
 
 builtinNames = [
     Builtin('boolean', 'bool'),
     Builtin('void', 'void'),
-    Builtin('int16_t', 'int16_t', True, True),
-    Builtin('int32_t', 'int32_t', True, True),
-    Builtin('int64_t', 'int64_t', True, False),
-    Builtin('uint8_t', 'uint8_t'),
-    Builtin('uint16_t', 'uint16_t', False, True),
-    Builtin('uint32_t', 'uint32_t', False, True),
-    Builtin('uint64_t', 'uint64_t', False, False),
-    Builtin('octet', 'PRUint8'),
-    Builtin('short', 'PRInt16', True, True),
-    Builtin('long', 'PRInt32', True, True),
-    Builtin('long long', 'PRInt64', True, False),
-    Builtin('unsigned short', 'PRUint16', False, True),
-    Builtin('unsigned long', 'PRUint32', False, True),
-    Builtin('unsigned long long', 'PRUint64', False, False),
+    Builtin('octet', 'uint8_t'),
+    Builtin('short', 'int16_t', True, True),
+    Builtin('long', 'int32_t', True, True),
+    Builtin('long long', 'int64_t', True, False),
+    Builtin('unsigned short', 'uint16_t', False, True),
+    Builtin('unsigned long', 'uint32_t', False, True),
+    Builtin('unsigned long long', 'uint64_t', False, False),
     Builtin('float', 'float', True, False),
     Builtin('double', 'double', True, False),
     Builtin('char', 'char', True, False),
     Builtin('string', 'char *', False, False),
     Builtin('wchar', 'PRUnichar', False, False),
     Builtin('wstring', 'PRUnichar *', False, False),
 ]