зеркало из https://github.com/mozilla/gecko-dev.git
81b1d1c977
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 |
||
---|---|---|
.. | ||
xpt | ||
moz.build |