Permalink
Browse files

Change c files to cpp

Reviewed By: gkassabli

Differential Revision: D6271299

fbshipit-source-id: 66c0e54ccf019d72d1fd0b4d117826e4e84fdc89
  • Loading branch information...
priteshrnandgaonkar authored and facebook-github-bot committed Nov 21, 2017
1 parent 3c9092a commit d7ab9496bc95f7b720fd6db1ed503af1c461e84d
View
@@ -43,7 +43,7 @@ Pod::Spec.new do |s|
s.subspec "Core" do |ss|
ss.dependency "yoga", "#{package["version"]}.React"
ss.source_files = "React/**/*.{c,h,m,mm,S}"
ss.source_files = "React/**/*.{c,h,m,mm,S,cpp}"
ss.exclude_files = "**/__tests__/*",
"IntegrationTests/*",
"React/DevSupport/*",

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -27,14 +27,11 @@
137327E81AA5CF210034F82E /* RCTTabBarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 137327E21AA5CF210034F82E /* RCTTabBarItem.m */; };
137327E91AA5CF210034F82E /* RCTTabBarItemManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 137327E41AA5CF210034F82E /* RCTTabBarItemManager.m */; };
137327EA1AA5CF210034F82E /* RCTTabBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 137327E61AA5CF210034F82E /* RCTTabBarManager.m */; };
138FDE6B1E92EA4F005FEEDD /* YGEnums.c in Sources */ = {isa = PBXBuildFile; fileRef = 138FDE6A1E92EA4F005FEEDD /* YGEnums.c */; };
139324FE1E70B069009FD7E0 /* RCTJSCErrorHandling.h in Headers */ = {isa = PBXBuildFile; fileRef = 139324FC1E70B069009FD7E0 /* RCTJSCErrorHandling.h */; };
139324FF1E70B069009FD7E0 /* RCTJSCErrorHandling.mm in Sources */ = {isa = PBXBuildFile; fileRef = 139324FD1E70B069009FD7E0 /* RCTJSCErrorHandling.mm */; };
13A0C2891B74F71200B29F6F /* RCTDevLoadingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A0C2861B74F71200B29F6F /* RCTDevLoadingView.m */; };
13A1F71E1A75392D00D3D453 /* RCTKeyCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A1F71D1A75392D00D3D453 /* RCTKeyCommands.m */; };
13A6E20E1C19AA0C00845B82 /* RCTParserUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A6E20D1C19AA0C00845B82 /* RCTParserUtils.m */; };
13AB5E011DF777F2001A8C30 /* YGNodeList.c in Sources */ = {isa = PBXBuildFile; fileRef = 130A77051DF767AF001F9587 /* YGNodeList.c */; };
13AB5E021DF777F2001A8C30 /* Yoga.c in Sources */ = {isa = PBXBuildFile; fileRef = 130A77071DF767AF001F9587 /* Yoga.c */; };
13AB90C11B6FA36700713B4F /* RCTComponentData.m in Sources */ = {isa = PBXBuildFile; fileRef = 13AB90C01B6FA36700713B4F /* RCTComponentData.m */; };
13AF20451AE707F9005F5298 /* RCTSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = 13AF20441AE707F9005F5298 /* RCTSlider.m */; };
13B07FEF1A69327A00A75B9A /* RCTAlertManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FE81A69327A00A75B9A /* RCTAlertManager.m */; };
@@ -157,7 +154,6 @@
2D7FEB891E734B5700D3238C /* systemJSCWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65F3E41D1E73031C009375BD /* systemJSCWrapper.cpp */; };
2D8C2E331DA40441000EE098 /* RCTMultipartStreamReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCCF1D8381DE008E587E /* RCTMultipartStreamReader.m */; };
2DD0EFE11DA84F2800B0C975 /* RCTStatusBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */; };
2DDD72161E931C25007C55D1 /* YGEnums.c in Sources */ = {isa = PBXBuildFile; fileRef = 138FDE6A1E92EA4F005FEEDD /* YGEnums.c */; };
352DCFF01D19F4C20056D623 /* RCTI18nUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */; };
369123E11DDC75850095B341 /* RCTJSCSamplingProfiler.m in Sources */ = {isa = PBXBuildFile; fileRef = 369123E01DDC75850095B341 /* RCTJSCSamplingProfiler.m */; };
391E86A41C623EC800009732 /* RCTTouchEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 391E86A21C623EC800009732 /* RCTTouchEvent.m */; };
@@ -682,9 +678,11 @@
3DFE0D1A1DF8575800459392 /* YGEnums.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130A77031DF767AF001F9587 /* YGEnums.h */; };
3DFE0D1B1DF8575800459392 /* YGMacros.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130A77041DF767AF001F9587 /* YGMacros.h */; };
3DFE0D1C1DF8575800459392 /* Yoga.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 130A77081DF767AF001F9587 /* Yoga.h */; };
3DFE0D1D1DF857FF00459392 /* YGNodeList.c in Sources */ = {isa = PBXBuildFile; fileRef = 130A77051DF767AF001F9587 /* YGNodeList.c */; };
3DFE0D1E1DF857FF00459392 /* Yoga.c in Sources */ = {isa = PBXBuildFile; fileRef = 130A77071DF767AF001F9587 /* Yoga.c */; };
3EDCA8A51D3591E700450C31 /* RCTErrorInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EDCA8A41D3591E700450C31 /* RCTErrorInfo.m */; };
53CBF1BF1FB50263002CBB31 /* Yoga-internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 53CBF1BB1FB50262002CBB31 /* Yoga-internal.h */; };
53CBF1C01FB50263002CBB31 /* YGEnums.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53CBF1BC1FB50263002CBB31 /* YGEnums.cpp */; };
53CBF1C11FB50263002CBB31 /* Yoga.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53CBF1BD1FB50263002CBB31 /* Yoga.cpp */; };
53CBF1C21FB50263002CBB31 /* YGNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53CBF1BE1FB50263002CBB31 /* YGNodeList.cpp */; };
58114A161AAE854800E7D092 /* RCTPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 58114A131AAE854800E7D092 /* RCTPicker.m */; };
58114A171AAE854800E7D092 /* RCTPickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58114A151AAE854800E7D092 /* RCTPickerManager.m */; };
58114A501AAE93D500E7D092 /* RCTAsyncLocalStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 58114A4E1AAE93D500E7D092 /* RCTAsyncLocalStorage.m */; };
@@ -1168,9 +1166,7 @@
008341F51D1DB34400876D9A /* RCTJSStackFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSStackFrame.h; sourceTree = "<group>"; };
130A77031DF767AF001F9587 /* YGEnums.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YGEnums.h; sourceTree = "<group>"; };
130A77041DF767AF001F9587 /* YGMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YGMacros.h; sourceTree = "<group>"; };
130A77051DF767AF001F9587 /* YGNodeList.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = YGNodeList.c; sourceTree = "<group>"; };
130A77061DF767AF001F9587 /* YGNodeList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YGNodeList.h; sourceTree = "<group>"; };
130A77071DF767AF001F9587 /* Yoga.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = Yoga.c; sourceTree = "<group>"; };
130A77081DF767AF001F9587 /* Yoga.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Yoga.h; sourceTree = "<group>"; };
131B6AF01AF1093D00FFC3E0 /* RCTSegmentedControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSegmentedControl.h; sourceTree = "<group>"; };
131B6AF11AF1093D00FFC3E0 /* RCTSegmentedControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSegmentedControl.m; sourceTree = "<group>"; };
@@ -1201,7 +1197,6 @@
137327E41AA5CF210034F82E /* RCTTabBarItemManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTabBarItemManager.m; sourceTree = "<group>"; };
137327E51AA5CF210034F82E /* RCTTabBarManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTabBarManager.h; sourceTree = "<group>"; };
137327E61AA5CF210034F82E /* RCTTabBarManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTabBarManager.m; sourceTree = "<group>"; };
138FDE6A1E92EA4F005FEEDD /* YGEnums.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = YGEnums.c; sourceTree = "<group>"; };
139324FC1E70B069009FD7E0 /* RCTJSCErrorHandling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSCErrorHandling.h; sourceTree = "<group>"; };
139324FD1E70B069009FD7E0 /* RCTJSCErrorHandling.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTJSCErrorHandling.mm; sourceTree = "<group>"; };
13A0C2851B74F71200B29F6F /* RCTDevLoadingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTDevLoadingView.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
@@ -1352,6 +1347,10 @@
3EDCA8A21D3591E700450C31 /* RCTErrorCustomizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTErrorCustomizer.h; sourceTree = "<group>"; };
3EDCA8A31D3591E700450C31 /* RCTErrorInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTErrorInfo.h; sourceTree = "<group>"; };
3EDCA8A41D3591E700450C31 /* RCTErrorInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTErrorInfo.m; sourceTree = "<group>"; };
53CBF1BB1FB50262002CBB31 /* Yoga-internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Yoga-internal.h"; sourceTree = "<group>"; };
53CBF1BC1FB50263002CBB31 /* YGEnums.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGEnums.cpp; sourceTree = "<group>"; };
53CBF1BD1FB50263002CBB31 /* Yoga.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Yoga.cpp; sourceTree = "<group>"; };
53CBF1BE1FB50263002CBB31 /* YGNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGNodeList.cpp; sourceTree = "<group>"; };
58114A121AAE854800E7D092 /* RCTPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPicker.h; sourceTree = "<group>"; };
58114A131AAE854800E7D092 /* RCTPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPicker.m; sourceTree = "<group>"; };
58114A141AAE854800E7D092 /* RCTPickerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPickerManager.h; sourceTree = "<group>"; };
@@ -1465,12 +1464,13 @@
130A77021DF767AF001F9587 /* yoga */ = {
isa = PBXGroup;
children = (
138FDE6A1E92EA4F005FEEDD /* YGEnums.c */,
53CBF1BC1FB50263002CBB31 /* YGEnums.cpp */,
53CBF1BE1FB50263002CBB31 /* YGNodeList.cpp */,
53CBF1BB1FB50262002CBB31 /* Yoga-internal.h */,
53CBF1BD1FB50263002CBB31 /* Yoga.cpp */,
130A77031DF767AF001F9587 /* YGEnums.h */,
130A77041DF767AF001F9587 /* YGMacros.h */,
130A77051DF767AF001F9587 /* YGNodeList.c */,
130A77061DF767AF001F9587 /* YGNodeList.h */,
130A77071DF767AF001F9587 /* Yoga.c */,
130A77081DF767AF001F9587 /* Yoga.h */,
);
name = yoga;
@@ -2185,6 +2185,7 @@
3D80DA611DF820620028D040 /* RCTAnimationType.h in Headers */,
3D80DA621DF820620028D040 /* RCTAutoInsetsProtocol.h in Headers */,
3D4153711F277092005B8EFE /* RCTConvert+Transform.h in Headers */,
53CBF1BF1FB50263002CBB31 /* Yoga-internal.h in Headers */,
3D80DA631DF820620028D040 /* RCTBorderDrawing.h in Headers */,
3D80DA641DF820620028D040 /* RCTBorderStyle.h in Headers */,
3D80DA651DF820620028D040 /* RCTComponent.h in Headers */,
@@ -2614,19 +2615,13 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
13AB5E011DF777F2001A8C30 /* YGNodeList.c in Sources */,
13AB5E021DF777F2001A8C30 /* Yoga.c in Sources */,
138FDE6B1E92EA4F005FEEDD /* YGEnums.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
3D3C06181DE3340C00C268FA /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3DFE0D1D1DF857FF00459392 /* YGNodeList.c in Sources */,
3DFE0D1E1DF857FF00459392 /* Yoga.c in Sources */,
2DDD72161E931C25007C55D1 /* YGEnums.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2711,6 +2706,7 @@
AC70D2E91DE489E4002E6351 /* RCTJavaScriptLoader.mm in Sources */,
14F7A0EC1BDA3B3C003C6C10 /* RCTPerfMonitor.m in Sources */,
1450FF881BCFF28A00208362 /* RCTProfileTrampoline-arm64.S in Sources */,
53CBF1C11FB50263002CBB31 /* Yoga.cpp in Sources */,
13E41EEB1C05CA0B00CD8DAC /* RCTProfileTrampoline-i386.S in Sources */,
3D37B5821D522B190042D5B5 /* RCTFont.mm in Sources */,
13B080061A6947C200A75B9A /* RCTScrollViewManager.m in Sources */,
@@ -2752,12 +2748,14 @@
191E3EC11C29DC3800C180A6 /* RCTRefreshControl.m in Sources */,
13C156051AB1A2840079392D /* RCTWebView.m in Sources */,
83CBBA601A601EAA00E9B192 /* RCTBridge.m in Sources */,
53CBF1C21FB50263002CBB31 /* YGNodeList.cpp in Sources */,
13C156061AB1A2840079392D /* RCTWebViewManager.m in Sources */,
58114A161AAE854800E7D092 /* RCTPicker.m in Sources */,
137327E81AA5CF210034F82E /* RCTTabBarItem.m in Sources */,
83A1FE8C1B62640A00BE0E65 /* RCTModalHostView.m in Sources */,
C60669311F3CC7BD00E67165 /* RCTModuleMethod.mm in Sources */,
13E067551A70F44B002CDEE1 /* RCTShadowView.m in Sources */,
53CBF1C01FB50263002CBB31 /* YGEnums.cpp in Sources */,
1450FF871BCFF28A00208362 /* RCTProfileTrampoline-arm.S in Sources */,
131B6AF51AF1093D00FFC3E0 /* RCTSegmentedControlManager.m in Sources */,
58114A171AAE854800E7D092 /* RCTPickerManager.m in Sources */,
@@ -5,13 +5,13 @@ include $(CLEAR_VARS)
LOCAL_MODULE := yogacore
LOCAL_SRC_FILES := \
yoga/Yoga.c \
yoga/YGEnums.c \
yoga/YGNodeList.c
yoga/Yoga.cpp \
yoga/YGEnums.cpp \
yoga/YGNodeList.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
LOCAL_CFLAGS := -Wall -Werror -fexceptions -frtti -std=c99 -O3
LOCAL_CFLAGS := -Wall -Werror -fexceptions -frtti -std=c++1y -O3
include $(BUILD_STATIC_LIBRARY)
View
@@ -1,17 +1,17 @@
cxx_library(
name = "yoga",
srcs = glob(["yoga/*.c"]),
srcs = glob(["yoga/*.cpp"]),
header_namespace = "",
exported_headers = glob(["yoga/*.h"]),
compiler_flags = [
"-fno-omit-frame-pointer",
"-fexceptions",
"-Wall",
"-Werror",
"-std=c99",
"-std=c++1y",
"-O3",
],
exported_headers = glob(["yoga/*.h"]),
force_static = True,
header_namespace = "",
visibility = ["PUBLIC"],
deps = [
],
@@ -29,7 +29,7 @@ Pod::Spec.new do |spec|
'-fexceptions',
'-Wall',
'-Werror',
'-std=c11',
'-std=c++1y',
'-fPIC'
]
@@ -38,7 +38,7 @@ Pod::Spec.new do |spec|
# Set this environment variable when not using the `:path` option to install the pod.
# E.g. when publishing this spec to a spec repo.
source_files = 'yoga/**/*.{c,h}'
source_files = 'yoga/**/*.{cpp,h}'
source_files = File.join('ReactCommon/yoga', source_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION']
spec.source_files = source_files
end
@@ -224,4 +224,3 @@ const char *YGWrapToString(const YGWrap value){
}
return "unknown";
}
@@ -11,32 +11,29 @@
#include "YGNodeList.h"
extern YGMalloc gYGMalloc;
extern YGRealloc gYGRealloc;
extern YGFree gYGFree;
struct YGNodeList {
uint32_t capacity;
uint32_t count;
YGNodeRef *items;
};
YGNodeListRef YGNodeListNew(const uint32_t initialCapacity) {
const YGNodeListRef list = gYGMalloc(sizeof(struct YGNodeList));
YGAssert(list != NULL, "Could not allocate memory for list");
const YGNodeListRef list =
(const YGNodeListRef)malloc(sizeof(struct YGNodeList));
YGAssert(list != nullptr, "Could not allocate memory for list");
list->capacity = initialCapacity;
list->count = 0;
list->items = gYGMalloc(sizeof(YGNodeRef) * list->capacity);
YGAssert(list->items != NULL, "Could not allocate memory for items");
list->items = (YGNodeRef*)malloc(sizeof(YGNodeRef) * list->capacity);
YGAssert(list->items != nullptr, "Could not allocate memory for items");
return list;
}
void YGNodeListFree(const YGNodeListRef list) {
if (list) {
gYGFree(list->items);
gYGFree(list);
free(list->items);
free(list);
}
}
@@ -62,8 +59,9 @@ void YGNodeListInsert(YGNodeListRef *listp, const YGNodeRef node, const uint32_t
if (list->count == list->capacity) {
list->capacity *= 2;
list->items = gYGRealloc(list->items, sizeof(YGNodeRef) * list->capacity);
YGAssert(list->items != NULL, "Could not extend allocation for items");
list->items =
(YGNodeRef*)realloc(list->items, sizeof(YGNodeRef) * list->capacity);
YGAssert(list->items != nullptr, "Could not extend allocation for items");
}
for (uint32_t i = list->count; i > index; i--) {
@@ -80,18 +78,18 @@ void YGNodeListReplace(YGNodeListRef list, const uint32_t index, const YGNodeRef
void YGNodeListRemoveAll(const YGNodeListRef list) {
for (uint32_t i = 0; i < list->count; i++) {
list->items[i] = NULL;
list->items[i] = nullptr;
}
list->count = 0;
}
YGNodeRef YGNodeListRemove(const YGNodeListRef list, const uint32_t index) {
const YGNodeRef removed = list->items[index];
list->items[index] = NULL;
list->items[index] = nullptr;
for (uint32_t i = index; i < list->count - 1; i++) {
list->items[i] = list->items[i + 1];
list->items[i + 1] = NULL;
list->items[i + 1] = nullptr;
}
list->count--;
@@ -105,24 +103,24 @@ YGNodeRef YGNodeListDelete(const YGNodeListRef list, const YGNodeRef node) {
}
}
return NULL;
return nullptr;
}
YGNodeRef YGNodeListGet(const YGNodeListRef list, const uint32_t index) {
if (YGNodeListCount(list) > 0) {
return list->items[index];
}
return NULL;
return nullptr;
}
YGNodeListRef YGNodeListClone(const YGNodeListRef oldList) {
if (!oldList) {
return NULL;
return nullptr;
}
const uint32_t count = oldList->count;
if (count == 0) {
return NULL;
return nullptr;
}
const YGNodeListRef newList = YGNodeListNew(count);
memcpy(newList->items, oldList->items, sizeof(YGNodeRef) * count);
Oops, something went wrong.

0 comments on commit d7ab949

Please sign in to comment.