Permalink
Browse files

fix use of C++ syntax in an header file

Summary:
All public header files can be included from Obj-C and Swift, except RCTSurfaceSizeMeasureMode.h which contains C++ code.

Change is trivial and can be validated by review.

None.

[IOS][BUGFIX][{RCTSurfaceSizeMeasureMode.h}] - fix use of C++ syntax in an header file that could be included from Obj-C and Swift
Closes #18730

Differential Revision: D7550290

Pulled By: shergin

fbshipit-source-id: 3835e2c57697a067ff94afdaeaca06bce132ef66
  • Loading branch information...
gmondada authored and facebook-github-bot committed Apr 9, 2018
1 parent 4b6e9d3 commit bfcfe7961db0970e2575eafe2f3c9c668bd8940d
@@ -70,8 +70,8 @@ - (void)setFrame:(CGRect)frame
RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
self.bounds.size,
_sizeMeasureMode,
minimumSize,
maximumSize
&minimumSize,
&maximumSize
);
[_surface setMinimumSize:minimumSize
@@ -107,8 +107,8 @@ - (CGSize)sizeThatFits:(CGSize)size
RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
size,
_sizeMeasureMode,
minimumSize,
maximumSize
&minimumSize,
&maximumSize
);
return [_surface sizeThatFitsMinimumSize:minimumSize
@@ -28,6 +28,6 @@ typedef NS_OPTIONS(NSInteger, RCTSurfaceSizeMeasureMode) {
RCT_EXTERN void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
CGSize size,
RCTSurfaceSizeMeasureMode sizeMeasureMode,
CGSize &minimumSize,
CGSize &maximumSize
CGSize *minimumSize,
CGSize *maximumSize
);
@@ -12,25 +12,25 @@
void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
CGSize size,
RCTSurfaceSizeMeasureMode sizeMeasureMode,
CGSize &minimumSize,
CGSize &maximumSize
CGSize *minimumSize,
CGSize *maximumSize
) {
minimumSize = CGSizeZero;
maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX);
*minimumSize = CGSizeZero;
*maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX);
if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthExact) {
minimumSize.width = size.width;
maximumSize.width = size.width;
minimumSize->width = size.width;
maximumSize->width = size.width;
}
else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthAtMost) {
maximumSize.width = size.width;
maximumSize->width = size.width;
}
if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightExact) {
minimumSize.height = size.height;
maximumSize.height = size.height;
minimumSize->height = size.height;
maximumSize->height = size.height;
}
else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightAtMost) {
maximumSize.height = size.height;
maximumSize->height = size.height;
}
}

0 comments on commit bfcfe79

Please sign in to comment.