react-native/React
Ashok Menon 1635c02e92 Simplifying Struct definition.
Summary:
Since we are reading from a file, we should make sure this struct is packed, just in case we change it down the line and the compiler decides it might want to introduce padding, we're now protected against that.

There was also a discussion about the fact that people might use `ptr += sizeof(BundleHeader)` as an idiom in their code, which would currently be incorrect, if padding was introduced at the end of the file. Actually, it remains incorrect to do that now, because a RAM bundle header is a different size to a BC Bundle header. If people are properly testing their code, they should spot this pretty quickly, because it will always be an incorrect thing to do with a RAM bundle, so this isn't as bad as previously thought: where the code only succeeds when the compiler deigns to not pad the struct at the end.

This diff also cleans up how headers are initialised. `BundleHeader` has a constructor that explicitly zero-initialises it so we can rely on the default initializer to do the right thing now.

Reviewed By: mhorowitz

Differential Revision: D4572032

fbshipit-source-id: 7dc50cfa9438dfdfb9f842dc39d8f15334813c63
2017-02-20 04:30:19 -08:00
..
Base Simplifying Struct definition. 2017-02-20 04:30:19 -08:00
CxxBridge Simplifying Struct definition. 2017-02-20 04:30:19 -08:00
CxxModule Move some utilities to RCTCxxUtils 2017-02-16 14:02:03 -08:00
CxxUtils Move RCTFollyConvert to the correct namespace 2017-02-16 06:59:27 -08:00
Executors Simplifying Struct definition. 2017-02-20 04:30:19 -08:00
Modules Simplifying mess with RCTRootViewSizeFlexibility 2017-02-19 23:19:47 -08:00
Profiler Enable perf monitor for CxxBridge 2017-02-09 12:47:04 -08:00
React.xcodeproj Splitting `RCTRootView.m`, decoupling RCTRootContentView 2017-02-19 23:19:47 -08:00
ReactCxx.xcodeproj Splitting `RCTRootView.m`, decoupling RCTRootContentView 2017-02-19 23:19:47 -08:00
Views Simplifying mess with RCTRootViewSizeFlexibility 2017-02-19 23:19:47 -08:00
folly.xcconfig Fork React.xcodeproj to build the C++ bridge 2017-02-01 14:14:32 -08:00