Skip to content

Commit

Permalink
fix use of C++ syntax in an header file
Browse files Browse the repository at this point in the history
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 bfcfe79
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ - (void)setFrame:(CGRect)frame
RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
self.bounds.size,
_sizeMeasureMode,
minimumSize,
maximumSize
&minimumSize,
&maximumSize
);

[_surface setMinimumSize:minimumSize
Expand Down Expand Up @@ -107,8 +107,8 @@ - (CGSize)sizeThatFits:(CGSize)size
RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
size,
_sizeMeasureMode,
minimumSize,
maximumSize
&minimumSize,
&maximumSize
);

return [_surface sizeThatFitsMinimumSize:minimumSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
20 changes: 10 additions & 10 deletions React/Base/Surface/SurfaceHostingView/RCTSurfaceSizeMeasureMode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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.