According to footnote 12 of doc\html\extended_shapefile_format.pdf the size of a curve segment modifier is "4 + (28 per circular arc) + (24 per bezier curve) + (52 per elliptic arc)".
Is this value for Bezier curve correct? I calculated it as
offsetof(esriSegmentModifier, segmentParams) + sizeof(SegmentBezierCurve)
= 2 * sizeof(int32) + 2 * sizeof(WKSPoint)
= 2 * sizeof(int32) + 2 * (2 * sizeof(double))
= 2 * 4 + 2 * (2 * 😎
= 8 + 32
= 40
(I'm using the fixed size int32 in my code instead of "long" which isn't necessarily a specific size.)
I verified my methodology thus:
#define esriSegmentModifierSizeCheck() \
{ assert(offsetof(esriSegmentModifier, segmentParams) + sizeof(SegmentArc) == 28); \
assert(offsetof(esriSegmentModifier, segmentParams) + sizeof(SegmentBezierCurve) == 40/*differs from doc - see comment above*/); \
assert(offsetof(esriSegmentModifier, segmentParams) + sizeof(SegmentEllipticArc) == 52); \