Bug 1498059 - Allow 8-bit unsigned consts in XPIDL; , r=nika,froydnj
authorKyle Machulis <kyle@nonpolynomial.com>
Tue, 06 Nov 2018 00:05:35 +0000
changeset 444500 edfa81173d9d596888b23e136d6357cd7d4e0097
parent 444499 0d21fdb4886c98608edce9b79fc6927baf2b4f05
child 444501 40c1a7f2500861af2acbb24707e3838a0b779dc7
push id34996
push userrgurzau@mozilla.com
push dateTue, 06 Nov 2018 09:53:23 +0000
treeherdermozilla-central@e160f0a60e4f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika, froydnj
bugs1498059
milestone65.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 1498059 - Allow 8-bit unsigned consts in XPIDL; , r=nika,froydnj Differential Revision: https://phabricator.services.mozilla.com/D8593
xpcom/idl-parser/xpidl/xpidl.py
xpcom/reflect/xptinfo/xptcodegen.py
--- a/xpcom/idl-parser/xpidl/xpidl.py
+++ b/xpcom/idl-parser/xpidl/xpidl.py
@@ -159,17 +159,17 @@ class Builtin(object):
             rustname = self.rustname.replace("*mut", "*const")
 
         return "%s%s" % (calltype != 'in' and '*mut ' or '', rustname)
 
 
 builtinNames = [
     Builtin('boolean', 'bool', 'bool'),
     Builtin('void', 'void', 'libc::c_void'),
-    Builtin('octet', 'uint8_t', 'libc::uint8_t'),
+    Builtin('octet', 'uint8_t', 'libc::uint8_t', False, True),
     Builtin('short', 'int16_t', 'libc::int16_t', True, True),
     Builtin('long', 'int32_t', 'libc::int32_t', True, True),
     Builtin('long long', 'int64_t', 'libc::int64_t', True, False),
     Builtin('unsigned short', 'uint16_t', 'libc::uint16_t', False, True),
     Builtin('unsigned long', 'uint32_t', 'libc::uint32_t', False, True),
     Builtin('unsigned long long', 'uint64_t', 'libc::uint64_t', False, False),
     Builtin('float', 'float', 'libc::c_float', True, False),
     Builtin('double', 'double', 'libc::c_double', True, False),
--- a/xpcom/reflect/xptinfo/xptcodegen.py
+++ b/xpcom/reflect/xptinfo/xptcodegen.py
@@ -356,17 +356,17 @@ def link_to_cpp(interfaces, fd):
             mOptArgc='optargc' in method['flags'],
             mContext='jscontext' in method['flags'],
             mHasRetval='hasretval' in method['flags'],
             mIsSymbol=isSymbol,
         ))
 
     def lower_const(const, ifacename):
         assert const['type']['tag'] in \
-            ['TD_INT16', 'TD_INT32', 'TD_UINT16', 'TD_UINT32']
+            ['TD_INT16', 'TD_INT32', 'TD_UINT8', 'TD_UINT16', 'TD_UINT32']
         is_signed = const['type']['tag'] in ['TD_INT16', 'TD_INT32']
 
         # Constants are always either signed or unsigned 16 or 32 bit integers,
         # which we will only need to convert to JS values. To save on space,
         # don't bother storing the type, and instead just store a 32-bit
         # unsigned integer, and stash whether to interpret it as signed.
         consts.append(nsXPTConstantInfo(
             "%d = %s::%s" % (len(consts), ifacename, const['name']),