From aa3d6f0cdefc85a4918111da11779ec6829b6767 Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 28 Feb 2018 17:24:34 +0800 Subject: [PATCH] remove unneed files (#1135) --- .../cocos2d_libs.xcodeproj/project.pbxproj | 8 --- native/cocos/base/CCProfiling.cpp | 4 +- native/cocos/base/ccUtils.h | 1 + native/cocos/platform/CCImage.cpp | 8 +-- native/cocos/platform/CCStdC.h | 30 +++++----- .../cocos/platform/android/CCStdC-android.h | 56 ------------------- native/cocos/platform/ios/CCStdC-ios.h | 54 ------------------ native/cocos/platform/mac/CCStdC-mac.h | 55 ------------------ 8 files changed, 20 insertions(+), 196 deletions(-) delete mode 100644 native/cocos/platform/android/CCStdC-android.h delete mode 100644 native/cocos/platform/ios/CCStdC-ios.h delete mode 100644 native/cocos/platform/mac/CCStdC-mac.h diff --git a/native/build/cocos2d_libs.xcodeproj/project.pbxproj b/native/build/cocos2d_libs.xcodeproj/project.pbxproj index 6176df48c7..fd4a92b336 100644 --- a/native/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/native/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -574,7 +574,6 @@ 503DD8EB1926736A00CD74DD /* CCGL-ios.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8D91926736A00CD74DD /* CCGL-ios.h */; }; 503DD8EE1926736A00CD74DD /* CCImage-ios.mm in Sources */ = {isa = PBXBuildFile; fileRef = 503DD8DC1926736A00CD74DD /* CCImage-ios.mm */; }; 503DD8EF1926736A00CD74DD /* CCPlatformDefine-ios.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8DD1926736A00CD74DD /* CCPlatformDefine-ios.h */; }; - 503DD8F01926736A00CD74DD /* CCStdC-ios.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8DE1926736A00CD74DD /* CCStdC-ios.h */; }; 503DD8F11926736A00CD74DD /* OpenGL_Internal-ios.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8DF1926736A00CD74DD /* OpenGL_Internal-ios.h */; }; 50643BD419BFAECF00EF68ED /* CCGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 50643BD319BFAECF00EF68ED /* CCGL.h */; }; 50643BD519BFAECF00EF68ED /* CCGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 50643BD319BFAECF00EF68ED /* CCGL.h */; }; @@ -655,7 +654,6 @@ 50ABC0631926664800A911A9 /* CCDevice-mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF521926664700A911A9 /* CCDevice-mac.mm */; }; 50ABC0651926664800A911A9 /* CCGL-mac.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF531926664700A911A9 /* CCGL-mac.h */; }; 50ABC0671926664800A911A9 /* CCPlatformDefine-mac.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF541926664700A911A9 /* CCPlatformDefine-mac.h */; }; - 50ABC0691926664800A911A9 /* CCStdC-mac.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF551926664700A911A9 /* CCStdC-mac.h */; }; A07A4CAF1783777C0073F6A7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1551A342158F2AB200E66CFE /* Foundation.framework */; }; A60A9D661C200E5A0070800A /* libchipmunk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A60A9D651C200E5A0070800A /* libchipmunk.a */; }; A679D0D91C71D90A00620A6C /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A6A554241C2A7C4400FDD954 /* libssl.a */; }; @@ -1035,7 +1033,6 @@ 503DD8D91926736A00CD74DD /* CCGL-ios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CCGL-ios.h"; sourceTree = ""; }; 503DD8DC1926736A00CD74DD /* CCImage-ios.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "CCImage-ios.mm"; sourceTree = ""; }; 503DD8DD1926736A00CD74DD /* CCPlatformDefine-ios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CCPlatformDefine-ios.h"; sourceTree = ""; }; - 503DD8DE1926736A00CD74DD /* CCStdC-ios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CCStdC-ios.h"; sourceTree = ""; }; 503DD8DF1926736A00CD74DD /* OpenGL_Internal-ios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OpenGL_Internal-ios.h"; sourceTree = ""; }; 50643BD319BFAECF00EF68ED /* CCGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGL.h; sourceTree = ""; }; 50643BD819BFAF4400EF68ED /* CCStdC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCStdC.h; sourceTree = ""; }; @@ -1085,7 +1082,6 @@ 50ABBF521926664700A911A9 /* CCDevice-mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "CCDevice-mac.mm"; sourceTree = ""; }; 50ABBF531926664700A911A9 /* CCGL-mac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CCGL-mac.h"; sourceTree = ""; }; 50ABBF541926664700A911A9 /* CCPlatformDefine-mac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CCPlatformDefine-mac.h"; sourceTree = ""; }; - 50ABBF551926664700A911A9 /* CCStdC-mac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CCStdC-mac.h"; sourceTree = ""; }; A07A4D641783777C0073F6A7 /* libcocos2d iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos2d iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A60A9D651C200E5A0070800A /* libchipmunk.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libchipmunk.a; path = ../external/ios/libs/libchipmunk.a; sourceTree = ""; }; A6A5541E1C2A7BF700FDD954 /* libchipmunk.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libchipmunk.a; path = ../external/mac/libs/libchipmunk.a; sourceTree = ""; }; @@ -1762,7 +1758,6 @@ 503DD8D91926736A00CD74DD /* CCGL-ios.h */, 503DD8DC1926736A00CD74DD /* CCImage-ios.mm */, 503DD8DD1926736A00CD74DD /* CCPlatformDefine-ios.h */, - 503DD8DE1926736A00CD74DD /* CCStdC-ios.h */, 503DD8DF1926736A00CD74DD /* OpenGL_Internal-ios.h */, ); path = ios; @@ -1815,7 +1810,6 @@ 50ABBF521926664700A911A9 /* CCDevice-mac.mm */, 50ABBF531926664700A911A9 /* CCGL-mac.h */, 50ABBF541926664700A911A9 /* CCPlatformDefine-mac.h */, - 50ABBF551926664700A911A9 /* CCStdC-mac.h */, ); path = mac; sourceTree = ""; @@ -2160,7 +2154,6 @@ 46FDDB4F202ADDCE00931238 /* CCValue.h in Headers */, 46FDDBB5202ADDCE00931238 /* uthash.h in Headers */, 1A28FF7D1F20AFAB007A1D9D /* SRMutex.h in Headers */, - 50ABC0691926664800A911A9 /* CCStdC-mac.h in Headers */, 1A28FF711F20AFAB007A1D9D /* SRHash.h in Headers */, 469301CF203FC696004A3D6C /* CCConfiguration.h in Headers */, 50ABC0171926664800A911A9 /* CCImage.h in Headers */, @@ -2174,7 +2167,6 @@ buildActionMask = 2147483647; files = ( BA68D78C1D62F4A500B7A3F9 /* cdt.h in Headers */, - 503DD8F01926736A00CD74DD /* CCStdC-ios.h in Headers */, 503DD8EF1926736A00CD74DD /* CCPlatformDefine-ios.h in Headers */, 1A28FF921F20AFAB007A1D9D /* NSURLRequest+SRWebSocket.h in Headers */, 50ABBD3B1925AB0000A911A9 /* CCAffineTransform.h in Headers */, diff --git a/native/cocos/base/CCProfiling.cpp b/native/cocos/base/CCProfiling.cpp index 8ecaa142be..dea57fb153 100644 --- a/native/cocos/base/CCProfiling.cpp +++ b/native/cocos/base/CCProfiling.cpp @@ -161,8 +161,8 @@ void ProfilingEndTimingBlock(const char *timerName) timer->totalTime += duration; timer->_averageTime1 = (timer->_averageTime1 + duration) / 2.0f; timer->_averageTime2 = timer->totalTime / timer->numberOfCalls; - timer->maxTime = MAX( timer->maxTime, duration); - timer->minTime = MIN( timer->minTime, duration); + timer->maxTime = std::max( timer->maxTime, duration); + timer->minTime = std::min( timer->minTime, duration); } void ProfilingResetTimingBlock(const char *timerName) diff --git a/native/cocos/base/ccUtils.h b/native/cocos/base/ccUtils.h index f1d0dc4877..a613d3179b 100644 --- a/native/cocos/base/ccUtils.h +++ b/native/cocos/base/ccUtils.h @@ -29,6 +29,7 @@ THE SOFTWARE. #include #include #include "base/ccMacros.h" +#include "platform/CCPlatformMacros.h" /** @file ccUtils.h Misc free functions diff --git a/native/cocos/platform/CCImage.cpp b/native/cocos/platform/CCImage.cpp index d8eaed8748..b2e1a1184e 100644 --- a/native/cocos/platform/CCImage.cpp +++ b/native/cocos/platform/CCImage.cpp @@ -1302,8 +1302,8 @@ bool Image::initWithPVRv2Data(const unsigned char * data, ssize_t dataLen) dataOffset += packetLength; //Update width and height to the next lower power of two - width = MAX(width >> 1, 1); - height = MAX(height >> 1, 1); + width = std::max(width >> 1, 1); + height = std::max(height >> 1, 1); } if(_unpack) @@ -1478,8 +1478,8 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) CCASSERT(dataOffset <= _dataLen, "Image: Invalid length"); - width = MAX(width >> 1, 1); - height = MAX(height >> 1, 1); + width = std::max(width >> 1, 1); + height = std::max(height >> 1, 1); } if (_unpack) diff --git a/native/cocos/platform/CCStdC.h b/native/cocos/platform/CCStdC.h index a90f921cb0..076dd3360d 100644 --- a/native/cocos/platform/CCStdC.h +++ b/native/cocos/platform/CCStdC.h @@ -23,24 +23,20 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ - -#ifndef __PLATFORM_CCSTDC_H__ -#define __PLATFORM_CCSTDC_H__ +#pragma once #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC -#include "platform/mac/CCStdC-mac.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS -#include "platform/ios/CCStdC-ios.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID -#include "platform/android/CCStdC-android.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #include "platform/win32/CCStdC-win32.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WINRT -#include "platform/winrt/CCStdC.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX -#include "platform/linux/CCStdC-linux.h" -#endif - -#endif /* __PLATFORM_CCSTDC_H__*/ +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 diff --git a/native/cocos/platform/android/CCStdC-android.h b/native/cocos/platform/android/CCStdC-android.h deleted file mode 100644 index e6379782b2..0000000000 --- a/native/cocos/platform/android/CCStdC-android.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#ifndef __CC_STD_C_H__ -#define __CC_STD_C_H__ - -#include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID - -#include "platform/CCPlatformMacros.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef MIN -#define MIN(x,y) (((x) > (y)) ? (y) : (x)) -#endif // MIN - -#ifndef MAX -#define MAX(x,y) (((x) < (y)) ? (y) : (x)) -#endif // MAX - -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID - -#endif // __CC_STD_C_H__ - diff --git a/native/cocos/platform/ios/CCStdC-ios.h b/native/cocos/platform/ios/CCStdC-ios.h deleted file mode 100644 index 9c5910c25e..0000000000 --- a/native/cocos/platform/ios/CCStdC-ios.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#ifndef __CC_STD_C_H__ -#define __CC_STD_C_H__ - -#include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS - -#include "platform/CCPlatformMacros.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef MIN -#define MIN(x,y) (((x) > (y)) ? (y) : (x)) -#endif // MIN - -#ifndef MAX -#define MAX(x,y) (((x) < (y)) ? (y) : (x)) -#endif // MAX - -#endif // CC_PLATFORM_IOS -#endif // __CC_STD_C_H__ - diff --git a/native/cocos/platform/mac/CCStdC-mac.h b/native/cocos/platform/mac/CCStdC-mac.h deleted file mode 100644 index 3653a0f111..0000000000 --- a/native/cocos/platform/mac/CCStdC-mac.h +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#ifndef __CC_STD_C_H__ -#define __CC_STD_C_H__ - -#include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC - -#include "platform/CCPlatformMacros.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef MIN -#define MIN(x,y) (((x) > (y)) ? (y) : (x)) -#endif // MIN - -#ifndef MAX -#define MAX(x,y) (((x) < (y)) ? (y) : (x)) -#endif // MAX - -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC - -#endif // __CC_STD_C_H__ -