gecko-dev/xpcom/typelib
Andrew McCreight 81b1d1c977 Bug 1447849 - Eliminate the anonymous union from XPTTypeDescriptor. r=njn
For bug 1438688, I need to statically initialize all of the data types
in xpt_struct.h. It turns out that the approach I was using for unions
is C99 and not C++. While for some reason Clang and GCC are okay with
that, MSVC is not.

One of the unions is a gnarly anonymous union in
XPTTypeDescriptor. However, every arm of this union is either 1 or 2
uint8_t, so I think it is reasonable to eliminate the union and
replace it with two fields, mData1 and mData2. I've fixed up the
places that read this data to use accessor methods with nice asserts
about the tag on the variant, so if anything I think that part is
nicer.

The code in xpt_struct.cpp that writes to this data is maybe less
nice, but I'm deleting it in bug 1438688 so I think that's okay. We
also lose some detail in the comments about the relationship between
what is stored in memory compared to what is stored on disk, but I
think that's okay, too.

MozReview-Commit-ID: DGi19f8HnMi

--HG--
extra : rebase_source : e3535ecb3d7f02bdb643df153e8aba3e106d9104
2018-03-21 16:35:55 -07:00
..
xpt Bug 1447849 - Eliminate the anonymous union from XPTTypeDescriptor. r=njn 2018-03-21 16:35:55 -07:00
moz.build Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00