From 62280781ea4205ea5c9081b0069db90a379b3f6b Mon Sep 17 00:00:00 2001 From: Mark Waddingham Date: Thu, 11 Apr 2013 19:17:51 +0100 Subject: [PATCH 01/12] Updated xcconfigs to allow setting of SDKROOT successfully to 10.4 / 10.5 and 10.6 (10.7 untested). Added more build folders to .gitignore Fixed compiler errors when compiling with SDKROOT > 10.4 --- .gitignore | 1 + engine/engine.xcodeproj/project.pbxproj | 64 ++++++++++--------- engine/src/deploy_sign.cpp | 2 +- engine/src/opensslsocket.cpp | 6 +- .../libexternal.xcodeproj/project.pbxproj | 1 - revdb/revdb-mobile.xcodeproj/project.pbxproj | 4 +- rules/Debug.xcconfig | 5 +- rules/Global.xcconfig | 8 ++- rules/Release.xcconfig | 5 +- stage.xcodeproj/project.pbxproj | 2 +- thirdparty | 2 +- 11 files changed, 54 insertions(+), 46 deletions(-) diff --git a/.gitignore b/.gitignore index 904bff735c7..ca22c95b7b4 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,4 @@ xcuserdata/ ################# _build/ _cache/ +build/ diff --git a/engine/engine.xcodeproj/project.pbxproj b/engine/engine.xcodeproj/project.pbxproj index e64d44fad18..ba1fc0f92f4 100644 --- a/engine/engine.xcodeproj/project.pbxproj +++ b/engine/engine.xcodeproj/project.pbxproj @@ -113,8 +113,6 @@ 4D982B1213C1CDC10066119A /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D982B1113C1CDC10066119A /* CoreServices.framework */; }; 4D982B1913C1CDD20066119A /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D982B1813C1CDD20066119A /* ApplicationServices.framework */; }; 4D982BEF13C2E74A0066119A /* srvoutput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D982BEE13C2E74A0066119A /* srvoutput.cpp */; }; - 4D98339613C73BE40066119A /* libssl.0.9.7.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D8302A2120B4B67005F2384 /* libssl.0.9.7.dylib */; }; - 4D98339713C73BE60066119A /* libcrypto.0.9.7.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D8302A4120B4B6E005F2384 /* libcrypto.0.9.7.dylib */; }; 4DAB7B370FE120060009F91E /* bitmapeffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DAB7B350FE120060009F91E /* bitmapeffect.cpp */; }; 4DAB7D1E0FF128F10009F91E /* deploy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DAB7D1A0FF128F10009F91E /* deploy.cpp */; }; 4DAB7D1F0FF128F10009F91E /* deploy_linux.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DAB7D1B0FF128F10009F91E /* deploy_linux.cpp */; }; @@ -125,20 +123,11 @@ 4DADCDFD12393F55003CD17C /* Installer.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4DADCDFC12393F26003CD17C /* Installer.icns */; }; 4DB381A417143CF300D3F102 /* stacksecurity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8A7EF0016FC98A200C39491 /* stacksecurity.cpp */; }; 4DB381A517143CFC00D3F102 /* deploysecurity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E86D59AE170AF0E000060AED /* deploysecurity.cpp */; }; - 4DB382DA1714415F00D3F102 /* libcrypto.0.9.7.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D8302A4120B4B6E005F2384 /* libcrypto.0.9.7.dylib */; }; - 4DB382DB1714415F00D3F102 /* libcups.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D8302A6120B4B76005F2384 /* libcups.2.dylib */; }; - 4DB382DC1714415F00D3F102 /* libssl.0.9.7.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D8302A2120B4B67005F2384 /* libssl.0.9.7.dylib */; }; 4DB382EE1714418A00D3F102 /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D6C797917134897000BCF78 /* libz.a */; }; 4DB382EF1714418A00D3F102 /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D6C7981171348A6000BCF78 /* libpng.a */; }; 4DB382F01714418A00D3F102 /* libjpeg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D6C7989171348B4000BCF78 /* libjpeg.a */; }; 4DB382F11714418A00D3F102 /* libgif.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D6C7991171348C1000BCF78 /* libgif.a */; }; 4DB382F21714418A00D3F102 /* libpcre.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D6C7999171348CD000BCF78 /* libpcre.a */; }; - 4DB383BB1714419B00D3F102 /* libcrypto.0.9.7.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D8302A4120B4B6E005F2384 /* libcrypto.0.9.7.dylib */; }; - 4DB383BC1714419B00D3F102 /* libcups.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D8302A6120B4B76005F2384 /* libcups.2.dylib */; }; - 4DB383BD1714419B00D3F102 /* libssl.0.9.7.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D8302A2120B4B67005F2384 /* libssl.0.9.7.dylib */; }; - 4DB384BB171441F600D3F102 /* libcrypto.0.9.7.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D8302A4120B4B6E005F2384 /* libcrypto.0.9.7.dylib */; }; - 4DB384BC171441F600D3F102 /* libcups.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D8302A6120B4B76005F2384 /* libcups.2.dylib */; }; - 4DB384BD171441F600D3F102 /* libssl.0.9.7.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D8302A2120B4B67005F2384 /* libssl.0.9.7.dylib */; }; 4DB384BE1714420A00D3F102 /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D6C797917134897000BCF78 /* libz.a */; }; 4DB384BF1714420A00D3F102 /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D6C7981171348A6000BCF78 /* libpng.a */; }; 4DB384C01714420A00D3F102 /* libjpeg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D6C7989171348B4000BCF78 /* libjpeg.a */; }; @@ -154,6 +143,15 @@ 4DB386141714426200D3F102 /* libpcre.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D6C7999171348CD000BCF78 /* libpcre.a */; }; 4DB386171714429D00D3F102 /* stacksecurity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8A7EF0016FC98A200C39491 /* stacksecurity.cpp */; }; 4DB98626130C09D6008A03DC /* mcutility.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DB98625130C09D6008A03DC /* mcutility.cpp */; }; + 4DBDE4A917171D2C00A5F1CC /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE01512171716AD001ACDA6 /* libcrypto.dylib */; }; + 4DBDE4AA17171D2C00A5F1CC /* libcups.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE01515171716C6001ACDA6 /* libcups.dylib */; }; + 4DBDE4AB17171D2C00A5F1CC /* libssl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE015B31717170A001ACDA6 /* libssl.dylib */; }; + 4DBDE4AC17171D3600A5F1CC /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE01512171716AD001ACDA6 /* libcrypto.dylib */; }; + 4DBDE4AD17171D3600A5F1CC /* libcups.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE01515171716C6001ACDA6 /* libcups.dylib */; }; + 4DBDE4AE17171D3600A5F1CC /* libssl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE015B31717170A001ACDA6 /* libssl.dylib */; }; + 4DBDE4B71717204E00A5F1CC /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE01512171716AD001ACDA6 /* libcrypto.dylib */; }; + 4DBDE4B81717204E00A5F1CC /* libcups.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE01515171716C6001ACDA6 /* libcups.dylib */; }; + 4DBDE4B91717204E00A5F1CC /* libssl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE015B31717170A001ACDA6 /* libssl.dylib */; }; 4DC66D8B1045D41700D1CFA3 /* notify.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DC66D8A1045D41700D1CFA3 /* notify.cpp */; }; 4DCA084E11E8DAC7005CF640 /* deploy_dmg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DCA084D11E8DAC7005CF640 /* deploy_dmg.cpp */; }; 4DCB65721653B2F700E438E6 /* stackcache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DCB65711653B2F700E438E6 /* stackcache.cpp */; }; @@ -165,6 +163,9 @@ 4DDB66721413A02000E5C84C /* redraw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DDB66701413A02000E5C84C /* redraw.cpp */; }; 4DDC26C9122692B10071CB31 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D5881C10B80C7C300200116 /* Quartz.framework */; }; 4DDE61AF14F52B000017E8C6 /* fonttable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D592DEA14EED23600EADBB6 /* fonttable.cpp */; }; + 4DE01513171716AD001ACDA6 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE01512171716AD001ACDA6 /* libcrypto.dylib */; }; + 4DE01516171716C6001ACDA6 /* libcups.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE01515171716C6001ACDA6 /* libcups.dylib */; }; + 4DE015B41717170A001ACDA6 /* libssl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE015B31717170A001ACDA6 /* libssl.dylib */; }; 4DE18D000B82296A0086DB92 /* LiveCode.rsrc in Resources */ = {isa = PBXBuildFile; fileRef = 4D5885620B80DEAC00200116 /* LiveCode.rsrc */; }; 4DE18D010B82296A0086DB92 /* da.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 4D58854C0B80DEAB00200116 /* da.lproj */; }; 4DE18D020B82296A0086DB92 /* French.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 4D58854E0B80DEAC00200116 /* French.lproj */; }; @@ -1032,9 +1033,6 @@ 4D81A4C811171FD6008AE3F1 /* osxcursor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = osxcursor.mm; path = src/osxcursor.mm; sourceTree = ""; }; 4D81C0260D742F48004EC824 /* w32printer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = w32printer.cpp; path = src/w32printer.cpp; sourceTree = ""; }; 4D81C0270D742F48004EC824 /* w32printer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = w32printer.h; path = src/w32printer.h; sourceTree = ""; }; - 4D8302A2120B4B67005F2384 /* libssl.0.9.7.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libssl.0.9.7.dylib; path = usr/lib/libssl.0.9.7.dylib; sourceTree = SDKROOT; }; - 4D8302A4120B4B6E005F2384 /* libcrypto.0.9.7.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.0.9.7.dylib; path = usr/lib/libcrypto.0.9.7.dylib; sourceTree = SDKROOT; }; - 4D8302A6120B4B76005F2384 /* libcups.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcups.2.dylib; path = usr/lib/libcups.2.dylib; sourceTree = SDKROOT; }; 4D8387191678B2C9003BEC7C /* ibmp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ibmp.cpp; path = src/ibmp.cpp; sourceTree = ""; }; 4D83871A1678B2C9003BEC7C /* image_rep_encoded.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = image_rep_encoded.cpp; path = src/image_rep_encoded.cpp; sourceTree = ""; }; 4D83871B1678B2C9003BEC7C /* image_rep_mutable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = image_rep_mutable.cpp; path = src/image_rep_mutable.cpp; sourceTree = ""; }; @@ -1173,6 +1171,9 @@ 4DDB66711413A02000E5C84C /* redraw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = redraw.h; path = src/redraw.h; sourceTree = ""; }; 4DDDEC8612F6E6F90056D206 /* mode_installer_lnx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mode_installer_lnx.cpp; path = src/mode_installer_lnx.cpp; sourceTree = ""; }; 4DDDEC8712F6E6F90056D206 /* mode_installer_w32.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mode_installer_w32.cpp; path = src/mode_installer_w32.cpp; sourceTree = ""; }; + 4DE01512171716AD001ACDA6 /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = usr/lib/libcrypto.dylib; sourceTree = SDKROOT; }; + 4DE01515171716C6001ACDA6 /* libcups.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcups.dylib; path = usr/lib/libcups.dylib; sourceTree = SDKROOT; }; + 4DE015B31717170A001ACDA6 /* libssl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libssl.dylib; path = usr/lib/libssl.dylib; sourceTree = SDKROOT; }; 4DE18D930B82296A0086DB92 /* Standalone.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Standalone.app; sourceTree = BUILT_PRODUCTS_DIR; }; 4DE2AB01100CCA9300A69884 /* deploy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = deploy.h; path = src/deploy.h; sourceTree = ""; }; 4DE663070BF9C1E50084FE0B /* Standalone-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; name = "Standalone-Info.plist"; path = "rsrc/Standalone-Info.plist"; sourceTree = ""; }; @@ -1282,9 +1283,9 @@ 4D2A57CC1198634300135143 /* Cocoa.framework in Frameworks */, 4D8BED4811B95A1000DED42A /* Security.framework in Frameworks */, 4D2A57CD1198634300135143 /* SystemConfiguration.framework in Frameworks */, - 4DB384BB171441F600D3F102 /* libcrypto.0.9.7.dylib in Frameworks */, - 4DB384BC171441F600D3F102 /* libcups.2.dylib in Frameworks */, - 4DB384BD171441F600D3F102 /* libssl.0.9.7.dylib in Frameworks */, + 4DBDE4AC17171D3600A5F1CC /* libcrypto.dylib in Frameworks */, + 4DBDE4AD17171D3600A5F1CC /* libcups.dylib in Frameworks */, + 4DBDE4AE17171D3600A5F1CC /* libssl.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1306,9 +1307,9 @@ 4D8B47990BE7B3240046CD2F /* Cocoa.framework in Frameworks */, 4D00C6290CE1F27300341AD3 /* SystemConfiguration.framework in Frameworks */, 4D8BED0211B959F500DED42A /* Security.framework in Frameworks */, - 4DB382DA1714415F00D3F102 /* libcrypto.0.9.7.dylib in Frameworks */, - 4DB382DB1714415F00D3F102 /* libcups.2.dylib in Frameworks */, - 4DB382DC1714415F00D3F102 /* libssl.0.9.7.dylib in Frameworks */, + 4DE01513171716AD001ACDA6 /* libcrypto.dylib in Frameworks */, + 4DE01516171716C6001ACDA6 /* libcups.dylib in Frameworks */, + 4DE015B41717170A001ACDA6 /* libssl.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1330,9 +1331,9 @@ 4D8B479A0BE7B3240046CD2F /* Cocoa.framework in Frameworks */, 4D8BED0311B95A0300DED42A /* Security.framework in Frameworks */, 4D00C62A0CE1F27300341AD3 /* SystemConfiguration.framework in Frameworks */, - 4DB383BB1714419B00D3F102 /* libcrypto.0.9.7.dylib in Frameworks */, - 4DB383BC1714419B00D3F102 /* libcups.2.dylib in Frameworks */, - 4DB383BD1714419B00D3F102 /* libssl.0.9.7.dylib in Frameworks */, + 4DBDE4A917171D2C00A5F1CC /* libcrypto.dylib in Frameworks */, + 4DBDE4AA17171D2C00A5F1CC /* libcups.dylib in Frameworks */, + 4DBDE4AB17171D2C00A5F1CC /* libssl.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1357,8 +1358,9 @@ 4D982B1213C1CDC10066119A /* CoreServices.framework in Frameworks */, 4D982B1913C1CDD20066119A /* ApplicationServices.framework in Frameworks */, 4DFD497613BA2C65008DB91F /* libcurl.dylib in Frameworks */, - 4D98339713C73BE60066119A /* libcrypto.0.9.7.dylib in Frameworks */, - 4D98339613C73BE40066119A /* libssl.0.9.7.dylib in Frameworks */, + 4DBDE4B71717204E00A5F1CC /* libcrypto.dylib in Frameworks */, + 4DBDE4B81717204E00A5F1CC /* libcups.dylib in Frameworks */, + 4DBDE4B91717204E00A5F1CC /* libssl.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1414,8 +1416,8 @@ 4D587DA90B80948B00200116 /* Configurations */ = { isa = PBXGroup; children = ( - 4D587DB20B80949B00200116 /* Release.xcconfig */, 4D587DB30B80949B00200116 /* Global.xcconfig */, + 4D587DB20B80949B00200116 /* Release.xcconfig */, 4D587DB40B80949B00200116 /* Debug.xcconfig */, ); name = Configurations; @@ -1474,11 +1476,11 @@ 4D5880850B80BDF000200116 /* QuickTime.framework */, 4D8BED0111B959F500DED42A /* Security.framework */, 4D00C6280CE1F27300341AD3 /* SystemConfiguration.framework */, - 4D8302A4120B4B6E005F2384 /* libcrypto.0.9.7.dylib */, - 4D8302A6120B4B76005F2384 /* libcups.2.dylib */, - 4DFD497513BA2C65008DB91F /* libcurl.dylib */, - 4D8302A2120B4B67005F2384 /* libssl.0.9.7.dylib */, 4DB3856E1714422200D3F102 /* Carbon.framework */, + 4DFD497513BA2C65008DB91F /* libcurl.dylib */, + 4DE01512171716AD001ACDA6 /* libcrypto.dylib */, + 4DE01515171716C6001ACDA6 /* libcups.dylib */, + 4DE015B31717170A001ACDA6 /* libssl.dylib */, ); name = Frameworks; sourceTree = ""; @@ -2419,10 +2421,10 @@ ); projectRoot = ..; targets = ( + 4DEE29F50FDE41BE0009423C /* kernel */, 4D587DA10B80945B00200116 /* LiveCode */, 4DE18CED0B82296A0086DB92 /* standalone */, 4D2A57991198634300135143 /* installer */, - 4DEE29F50FDE41BE0009423C /* kernel */, 4DFD483D13BA2843008DB91F /* server */, ); }; diff --git a/engine/src/deploy_sign.cpp b/engine/src/deploy_sign.cpp index e66b988c1cf..683972a1579 100644 --- a/engine/src/deploy_sign.cpp +++ b/engine/src/deploy_sign.cpp @@ -955,7 +955,7 @@ static bool MCDeploySignWindowsAddTimeStamp(const MCDeploySignParameters& p_para t_counter_sig = nil; if (t_success) { -#if defined(TARGET_PLATFORM_LINUX) || defined(TARGET_PLATFORM_WINDOWS) +#if defined(TARGET_PLATFORM_LINUX) || defined(TARGET_PLATFORM_WINDOWS) || (__MAC_OS_X_VERSION_MAX_ALLOWED > 1050) const unsigned char *t_data; t_data = (const unsigned char *)ep . getsvalue() . getstring(); #else diff --git a/engine/src/opensslsocket.cpp b/engine/src/opensslsocket.cpp index 5cb730c123c..fd37fda8a87 100644 --- a/engine/src/opensslsocket.cpp +++ b/engine/src/opensslsocket.cpp @@ -1987,7 +1987,11 @@ bool export_system_root_cert_stack(STACK_OF(X509) *&r_x509_stack) for (UInt32 i = 0; t_success && i < t_anchor_count; i++) { X509 *t_x509 = NULL; - UInt8* t_data_ptr = NULL; +#if (__MAC_OS_X_VERSION_MAX_ALLOWED > 1050) + const unsigned char* t_data_ptr = NULL; +#else + unsigned char *t_data_ptr = NULL; +#endif UInt32 t_data_len = 0; CSSM_DATA t_cert_data; diff --git a/libexternal/libexternal.xcodeproj/project.pbxproj b/libexternal/libexternal.xcodeproj/project.pbxproj index b1aba822c1e..56b884bf367 100644 --- a/libexternal/libexternal.xcodeproj/project.pbxproj +++ b/libexternal/libexternal.xcodeproj/project.pbxproj @@ -153,7 +153,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 4DF42A520B04862E003F2D95 /* Debug.xcconfig */; buildSettings = { - ARCHS = i386; }; name = Debug; }; diff --git a/revdb/revdb-mobile.xcodeproj/project.pbxproj b/revdb/revdb-mobile.xcodeproj/project.pbxproj index 6ad0b577b85..9692cc9eaec 100644 --- a/revdb/revdb-mobile.xcodeproj/project.pbxproj +++ b/revdb/revdb-mobile.xcodeproj/project.pbxproj @@ -61,14 +61,14 @@ isa = PBXContainerItemProxy; containerPortal = 4DA0B9E112E8416E00B4F692 /* libexternal-mobile.xcodeproj */; proxyType = 1; - remoteGlobalIDString = 4D7EFD7912E72ABA00D67888 /* external */; + remoteGlobalIDString = 4D7EFD7912E72ABA00D67888; remoteInfo = external; }; 4D379C5617141F8200B9037C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 4DA0BD3212E87A1C00B4F692 /* libmysql-mobile.xcodeproj */; proxyType = 1; - remoteGlobalIDString = 4D7EFD7912E72ABA00D67888 /* mysql */; + remoteGlobalIDString = 4D7EFD7912E72ABA00D67888; remoteInfo = mysql; }; 4DA0B9E512E8416E00B4F692 /* PBXContainerItemProxy */ = { diff --git a/rules/Debug.xcconfig b/rules/Debug.xcconfig index 16e0bf26e80..90bcd430161 100644 --- a/rules/Debug.xcconfig +++ b/rules/Debug.xcconfig @@ -1,6 +1,5 @@ #include "Global.xcconfig" COPY_PHASE_STRIP = NO +GCC_OPTIMIZATION_LEVEL = 0 GCC_PREPROCESSOR_DEFINITIONS = $(GLOBAL_GCC_PREPROCESSOR_DEFINITIONS) _DEBUG -SDKROOT=macosx10.4 -GCC_VERSION = 4.0 -GCC_OPTIMIZATION_LEVEL = 0 \ No newline at end of file + diff --git a/rules/Global.xcconfig b/rules/Global.xcconfig index 2f2e30f65ea..76c8585557c 100644 --- a/rules/Global.xcconfig +++ b/rules/Global.xcconfig @@ -1,13 +1,19 @@ +SDKROOT = macosx10.4 + OWNER = . SOLUTION_DIR = $(PROJECT_DIR)/../$(OWNER) SYMROOT = $(SOLUTION_DIR)/_build/mac OBJROOT = $(SOLUTION_DIR)/_cache/mac CONFIGURATION_BUILD_DIR = $(SYMROOT)/$(CONFIGURATION) CONFIGURATION_TEMP_DIR = $(OBJROOT)/$(CONFIGURATION) -HEADER_SEARCH_PATHS = "$(SOLUTION_DIR)/libcore/include" "$(SOLUTION_DIR)/libexternal/include" "$(SOLUTION_DIR)/libexternalv1/include" "$(SOLUTION_DIR)/thirdparty/libz/include" "$(SOLUTION_DIR)/thirdparty/libpng/include" "$(SOLUTION_DIR)/thirdparty/libjpeg/include" "$(SOLUTION_DIR)/thirdparty/libpcre/include" "$(SOLUTION_DIR)/engine/include" "$(SOLUTION_DIR)/thirdparty/libcairo/src" "$(SOLUTION_DIR)/thirdparty/libsqlite/include" "$(SOLUTION_DIR)/thirdparty/libmysql/include" "$(SOLUTION_DIR)/thirdparty/libgif/include" "$(SOLUTION_DIR)/thirdparty/libpq/include" "$(SOLUTION_DIR)/thirdparty/libxml/include" "$(SOLUTION_DIR)/thirdparty/libzip/include" +HEADER_SEARCH_PATHS = "$(SOLUTION_DIR)/engine/include" "$(SOLUTION_DIR)/libcore/include" "$(SOLUTION_DIR)/libexternal/include" "$(SOLUTION_DIR)/libexternalv1/include" "$(SOLUTION_DIR)/thirdparty/libz/include" "$(SOLUTION_DIR)/thirdparty/libpng/include" "$(SOLUTION_DIR)/thirdparty/libjpeg/include" "$(SOLUTION_DIR)/thirdparty/libpcre/include" "$(SOLUTION_DIR)/thirdparty/libcairo/src" "$(SOLUTION_DIR)/thirdparty/libsqlite/include" "$(SOLUTION_DIR)/thirdparty/libmysql/include" "$(SOLUTION_DIR)/thirdparty/libmysql/include" "$(SOLUTION_DIR)/thirdparty/libgif/include" "$(SOLUTION_DIR)/thirdparty/libpq/include" "$(SOLUTION_DIR)/thirdparty/libiodbc/include" "$(SOLUTION_DIR)/thirdparty/libxml/include" "$(SOLUTION_DIR)/thirdparty/libzip/include" GCC_ENABLE_CPP_EXCEPTIONS = NO GCC_ENABLE_CPP_RTTI = NO GCC_THREADSAFE_STATICS = NO SHARED_PRECOMPS_DIR=$(OBJROOT)/Precompiled/$(CURRENT_ARCH) GLOBAL_GCC_PREPROCESSOR_DEFINITIONS=TARGET_PLATFORM_MACOS_X _MACOSX GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS=NO +ALWAYS_SEARCH_USER_PATHS = NO +MACOSX_DEPLOYMENT_TARGET = 10.4 +GCC_VERSION = 4.2 +GCC_VERSION[sdk=macosx10.4] = 4.0 diff --git a/rules/Release.xcconfig b/rules/Release.xcconfig index a291f606745..873316cbce7 100644 --- a/rules/Release.xcconfig +++ b/rules/Release.xcconfig @@ -1,9 +1,6 @@ #include "Global.xcconfig" ARCHS = i386 ppc -MACOSX_DEPLOYMENT_TARGET = 10.4 -SDKROOT = macosx10.4 -GCC_VERSION = 4.0 -ZERO_LINK = NO GCC_OPTIMIZATION_LEVEL = 2 GCC_ENABLE_FIX_AND_CONTINUE = NO GCC_PREPROCESSOR_DEFINITIONS = $(GLOBAL_GCC_PREPROCESSOR_DEFINITIONS) _RELEASE NDEBUG +ZERO_LINK = NO diff --git a/stage.xcodeproj/project.pbxproj b/stage.xcodeproj/project.pbxproj index c5323fad344..e6aa1890863 100644 --- a/stage.xcodeproj/project.pbxproj +++ b/stage.xcodeproj/project.pbxproj @@ -475,10 +475,10 @@ E8DAE3DC1714271C00B96A87 /* Products */ = { isa = PBXGroup; children = ( + E8DAE3F11714271D00B96A87 /* libkernel.a */, E8DAE3EB1714271D00B96A87 /* LiveCode.app */, E8DAE3ED1714271D00B96A87 /* Standalone.app */, E8DAE3EF1714271D00B96A87 /* Installer.app */, - E8DAE3F11714271D00B96A87 /* libkernel.a */, E8DAE3F31714271D00B96A87 /* server */, ); name = Products; diff --git a/thirdparty b/thirdparty index a8091b1bbe1..81c68ac8d45 160000 --- a/thirdparty +++ b/thirdparty @@ -1 +1 @@ -Subproject commit a8091b1bbe14ad9109559e792b90b1f445d73dd5 +Subproject commit 81c68ac8d4544b5593b3e8cf04328711b63b3bda From bead33249cb5660f056978a9a4bbcbcd4201d5c7 Mon Sep 17 00:00:00 2001 From: Mark Waddingham Date: Thu, 11 Apr 2013 22:01:54 +0100 Subject: [PATCH 02/12] Update submodules. --- thirdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty b/thirdparty index 81c68ac8d45..93b437c09ad 160000 --- a/thirdparty +++ b/thirdparty @@ -1 +1 @@ -Subproject commit 81c68ac8d4544b5593b3e8cf04328711b63b3bda +Subproject commit 93b437c09ad8c8889d7391f6790ec183196d57b5 From 1326f1b54c2b43166e1989206f8407c31d2df38a Mon Sep 17 00:00:00 2001 From: Ian Macphail Date: Fri, 12 Apr 2013 14:00:20 +0100 Subject: [PATCH 03/12] Remove atl headers from w32 externals --- libcore/include/atlsubset.h | 180 ++++++++++++++ revspeech/revspeech.vcproj | 2 + revspeech/src/w32sapi4speech.cpp | 1 - revspeech/src/w32sapi5speech.cpp | 325 +++++++++++++++++-------- revspeech/src/w32sapi5speech.h | 36 ++- revvideograbber/revvideograbber.vcproj | 4 +- revvideograbber/src/dsvideograbber.h | 7 +- stage.sln | 2 - 8 files changed, 439 insertions(+), 118 deletions(-) create mode 100644 libcore/include/atlsubset.h diff --git a/libcore/include/atlsubset.h b/libcore/include/atlsubset.h new file mode 100644 index 00000000000..6b5667467f8 --- /dev/null +++ b/libcore/include/atlsubset.h @@ -0,0 +1,180 @@ +/* Copyright (C) 2003-2013 Runtime Revolution Ltd. + +This file is part of LiveCode. + +LiveCode is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License v3 as published by the Free +Software Foundation. + +LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with LiveCode. If not see . */ + +#ifndef __MINI_ATL_H +#define __MINI_ATL_H +#define __ATLBASE_H__ + +#include + +//////////////////////////////////////////////////////////////////////////////// +// String Conversion + +inline char *_ConvW2A(char *p_ansi, const WCHAR *p_wide, int p_ansi_chars) +{ + int t_conv; + t_conv = WideCharToMultiByte(CP_ACP, 0, p_wide, -1, p_ansi, p_ansi_chars, NULL, NULL); + if (t_conv == 0) + return NULL; + return p_ansi; +} + +inline WCHAR *_ConvA2W(WCHAR *p_wide, const char *p_ansi, int p_wide_chars) +{ + int t_conv; + t_conv = MultiByteToWideChar(CP_ACP, 0, p_ansi, -1, p_wide, p_wide_chars); + if (t_conv == 0) + return NULL; + return p_wide; +} + +#define USES_CONVERSION int _conv_chars; char *_conv_ansi_str; WCHAR *_conv_wide_str; (_conv_chars,_conv_ansi_str,_conv_wide_str); + +#define W2A(w) (w == NULL ? NULL : (_conv_chars = WideCharToMultiByte(CP_ACP, 0, w, -1, NULL, 0, NULL, NULL), _conv_ansi_str = (char*)alloca(_conv_chars), _ConvW2A(_conv_ansi_str, w, _conv_chars))) +#define A2W(a) (a == NULL ? NULL : (_conv_chars = MultiByteToWideChar(CP_ACP, 0, a, -1, NULL, 0), _conv_wide_str = (WCHAR*)alloca(_conv_chars * sizeof(WCHAR)), _ConvA2W(_conv_wide_str, a, _conv_chars))) + +#if defined(_UNICODE) +#define W2T(a) (a) +#define T2W(a) (a) +#else +#define W2T W2A +#define T2W A2W +#endif + +//////////////////////////////////////////////////////////////////////////////// +// CComPtr + +template +class CComPtr +{ +public: + T** operator & (void) + { + return &m_ptr; + } + + bool operator ! (void) + { + return m_ptr == NULL; + } + + T* operator -> (void) + { + return m_ptr; + } + + operator T* (void) + { + return m_ptr; + } + + T* operator = (const CComPtr &p_comptr) + { + if (m_ptr != p_comptr.m_ptr) + { + Release(); + m_ptr = p_comptr.m_ptr; + + if (m_ptr != NULL) + m_ptr->AddRef(); + } + + return m_ptr; + } + + CComPtr() + { + m_ptr = NULL; + } + + //CComPtr(T*); + //CComPtr(const CComPtr&); + + //template + //CComPtr(const CComPtr&); + + CComPtr(int p_null) + { + // initialise to NULL + m_ptr = NULL; + } + + ~CComPtr() + { + Release(); + } + + HRESULT CoCreateInstance(GUID p_id, IUnknown *p_outer = NULL, DWORD p_cls_context = CLSCTX_ALL) + { + HRESULT t_result; + t_result = ::CoCreateInstance(p_id, p_outer, p_cls_context, __uuidof(T), (void**)&m_ptr); + + return t_result; + } + + void Release(void) + { + if (m_ptr != NULL) + m_ptr->Release(); + m_ptr = NULL; + } + + T* Detach(void) + { + T* t_ptr = m_ptr; + m_ptr = NULL; + return t_ptr; + } + +protected: + T *m_ptr; +}; + +template +class CComQIPtr : public CComPtr +{ +public: + T* operator = (IUnknown *p_unknown) + { + Query(p_unknown); + return m_ptr; + } + + CComQIPtr() : CComPtr() + { + } + + //CComQIPtr(T*); + CComQIPtr(IUnknown *p_unknown) + { + Query(p_unknown); + } + +protected: + void Query(IUnknown *p_unknown) + { + IUnknown *t_queried = NULL; + if (p_unknown != NULL) + p_unknown->QueryInterface(*I, (void**)&t_queried); + + Release(); + m_ptr = (T*)t_queried; + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +#endif diff --git a/revspeech/revspeech.vcproj b/revspeech/revspeech.vcproj index 972eef19cc8..249730cf817 100644 --- a/revspeech/revspeech.vcproj +++ b/revspeech/revspeech.vcproj @@ -57,6 +57,7 @@ /> ", m_Npitch); strcpy( pstrTotal, strXMLtag); strcat( pstrTotal, p_string); - szWTextString = new WCHAR[ strlen(pstrTotal) + 20 ]; - wcscpy( szWTextString, A2W(pstrTotal)); + + szWTextString = A2W(pstrTotal); } else - { - int t_length; - t_length = strlen(p_string); - szWTextString = new WCHAR[ t_length + 1 ]; - - wcscpy( szWTextString, A2W(p_string)); - } + szWTextString = A2W(p_string); hr = m_cpVoice->Speak(szWTextString, SPF_ASYNC | SPF_IS_XML, NULL ); - delete[] szWTextString; - if( SUCCEEDED( hr ) ) { isspeaking = true; @@ -235,13 +227,15 @@ bool WindowsSAPI5Narrator::SpeakToFile(const char* p_string, const char* p_file) bool t_success; t_success = true; - // Set the audio format - CSpStreamFormat t_audio_format; - hr = t_audio_format.AssignFormat(SPSF_44kHz16BitStereo); - if (!SUCCEEDED(hr)) - { - t_success = false; - } + // Setup the wave format structure - 44kHz, 16bit, stereo + WAVEFORMATEX t_waveformat; + t_waveformat.wFormatTag = WAVE_FORMAT_PCM; + t_waveformat.nChannels = 2; + t_waveformat.nBlockAlign = 4; + t_waveformat.nSamplesPerSec = 44100; + t_waveformat.wBitsPerSample = 16; + t_waveformat.nAvgBytesPerSec = t_waveformat.nSamplesPerSec * t_waveformat.nBlockAlign; + t_waveformat.cbSize = 0; // unicode string containg file path WCHAR* t_file; @@ -265,10 +259,17 @@ bool WindowsSAPI5Narrator::SpeakToFile(const char* p_string, const char* p_file) wcscpy(t_file, A2W(t_native_path)); // Bind the output to the stream - hr = SPBindToFile(t_file, SPFM_CREATE_ALWAYS, &t_cstream, &t_audio_format.FormatId(), t_audio_format.WaveFormatExPtr(), SPFEI_ALL_EVENTS); - if (!SUCCEEDED(hr)) + hr = CoCreateInstance(CLSID_SpStream, NULL, CLSCTX_ALL, __uuidof(t_cstream), (void**)&t_cstream); + t_success = SUCCEEDED(hr); + if (t_success) { - t_success = false; + hr = t_cstream->BindToFile(t_file, SPFM_CREATE_ALWAYS, &SPDFID_WaveFormatEx, &t_waveformat, SPFEI_ALL_EVENTS); + t_success = SUCCEEDED(hr); + if (!t_success) + { + t_cstream->Release(); + t_cstream = NULL; + } } } } @@ -409,6 +410,156 @@ bool WindowsSAPI5Narrator::GetVolume(int& p_volume) } } +bool _GetCategoryFromId(const WCHAR *p_id, ISpObjectTokenCategory** r_category) +{ + bool t_success = true; + + CComPtr t_token_category = NULL; + t_success = SUCCEEDED(t_token_category.CoCreateInstance(CLSID_SpObjectTokenCategory)); + + if (t_success) + t_success = SUCCEEDED(t_token_category->SetId(p_id, FALSE)); + + if (t_success) + *r_category = t_token_category.Detach(); + + return t_success; +} + +bool _EnumTokens(const WCHAR *p_category_id, const WCHAR *p_req_attribs, const WCHAR *p_opt_attribs, IEnumSpObjectTokens **r_enum) +{ + bool t_success = true; + + CComPtr t_category; + t_success = _GetCategoryFromId(p_category_id, &t_category); + + if (t_success) + t_success = SUCCEEDED(t_category->EnumTokens(p_req_attribs, p_opt_attribs, r_enum)); + + return t_success; +} + +bool _GetDescription(ISpObjectToken *p_token, WCHAR **r_description) +{ + typedef HRESULT (WINAPI *_RegLoadMUIStringWPtr)(HKEY, LPCWSTR, LPWSTR, DWORD, LPDWORD, DWORD, LPCWSTR); + static HMODULE s_advapi32 = NULL; + static _RegLoadMUIStringWPtr s_RegLoadMUIStringW = NULL; + + if (s_advapi32 == NULL) + { + // Attempt to load function RegLoadMUIStringW which should be available if we're running on Vista & later + s_advapi32 = LoadLibraryA("advapi32.dll"); + if(s_advapi32 != NULL) + s_RegLoadMUIStringW = (_RegLoadMUIStringWPtr)GetProcAddress(s_advapi32, "RegLoadMUIStringW"); + } + + bool t_success = true; + + if (r_description == NULL) + { + return false; + } + + WCHAR *t_description = NULL; + + if(s_RegLoadMUIStringW != NULL) + { + WCHAR* t_path = NULL; + WCHAR* t_reg_key = NULL; + HKEY t_hkey = NULL; + + t_success = SUCCEEDED(p_token->GetId(&t_reg_key)); + + if (t_success) + { + // Split the path & base of the registry key - path is invalid if there is no separator + t_path = wcschr(t_reg_key, L'\\'); + t_success = t_path != NULL; + } + if(t_success) + { + *t_path++ = L'\0'; + + if (wcscmp(t_reg_key, L"HKEY_LOCAL_MACHINE") == 0) + t_success = ERROR_SUCCESS == RegOpenKeyExW(HKEY_LOCAL_MACHINE, t_path, 0, KEY_QUERY_VALUE, &t_hkey); + else if (wcscmp(t_reg_key, L"HKEY_CURRENT_USER") == 0) + t_success = ERROR_SUCCESS == RegOpenKeyExW(HKEY_CURRENT_USER, t_path, 0, KEY_QUERY_VALUE, &t_hkey); + else + t_success = false; + + DWORD t_size = 0; + if (t_success) + t_success = ERROR_MORE_DATA == s_RegLoadMUIStringW(t_hkey, L"Description", NULL, 0, &t_size, 0, NULL); + if (t_success) + t_success = NULL != (t_description = (WCHAR*) CoTaskMemAlloc(t_size)); + if (t_success) + t_success = ERROR_SUCCESS == s_RegLoadMUIStringW(t_hkey, L"Description", t_description, t_size, NULL, 0, NULL); + } + + // Cleanup + if(t_hkey) + RegCloseKey(t_hkey); + if(t_reg_key) + CoTaskMemFree(t_reg_key); + + if (!t_success && t_description != NULL) + { + CoTaskMemFree(t_description); + t_description = NULL; + } + } + + // fetch from the registry - if all else fails, fallback to the default attribute + if (s_RegLoadMUIStringW == NULL || !t_success) + { + WCHAR t_lang_id[10]; + + if (_ultow_s(GetUserDefaultUILanguage(), t_lang_id, 9, 16)) + { + t_lang_id[0] = L'0'; + t_lang_id[1] = 0; + } + + HRESULT hr; + hr = p_token->GetStringValue(t_lang_id, &t_description); + if (hr == SPERR_NOT_FOUND) + { + hr = p_token->GetStringValue(NULL, &t_description); + } + t_success = SUCCEEDED(hr); + } + + if (t_success) + *r_description = t_description; + + return t_success; +} + +// Helper function, frees tokens allocated by ListVoices. +void ManageCleanup( WCHAR** ppszTokenIds, CSpDynamicString* ppcDesciptionString, ULONG ulNumTokens) +{ + ULONG ulIndex; + + // Free all allocated token ids + if ( ppszTokenIds ) + { + for ( ulIndex = 0; ulIndex < ulNumTokens; ulIndex++ ) + { + if ( NULL != ppszTokenIds[ulIndex] ) + { + CoTaskMemFree( ppszTokenIds[ulIndex] ); + } + } + + delete [] ppszTokenIds; + } + + if ( ppcDesciptionString ) + { + delete [] ppcDesciptionString; + } +} + // Returns // true if listing voices suceeeded, false otherwise. // Description @@ -418,6 +569,9 @@ bool WindowsSAPI5Narrator::GetVolume(int& p_volume) // to get a token enumerator for the voices or if out of memory when listing voices. bool WindowsSAPI5Narrator::ListVoices(NarratorGender p_gender, NarratorListVoicesCallback p_callback, void* p_context) { + bool t_success = true; + + USES_CONVERSION; if(!bInited) return false; @@ -451,41 +605,40 @@ bool WindowsSAPI5Narrator::ListVoices(NarratorGender p_gender, NarratorListVoice } // Get a token enumerator for tts voices available - HRESULT hr = SpEnumTokens(SPCAT_VOICES, szRequiredAttributes, NULL, &cpEnum); + t_success = _EnumTokens(SPCAT_VOICES, szRequiredAttributes, NULL, &cpEnum); - if (SUCCEEDED(hr)) + if (t_success) { - hr = cpEnum->GetCount( &ulNumTokens ); + t_success = SUCCEEDED(cpEnum->GetCount( &ulNumTokens )); - if ( SUCCEEDED( hr ) && 0 != ulNumTokens ) + if ( t_success && 0 != ulNumTokens ) { ppcDesciptionString = new CSpDynamicString [ulNumTokens]; if ( NULL == ppcDesciptionString ) { - hr = E_OUTOFMEMORY; + /* TODO - CLEANUP */ return false; } ppszTokenIds = new WCHAR* [ulNumTokens]; if ( NULL == ppszTokenIds ) { - hr = E_OUTOFMEMORY; + /* TODO - CLEANUP */ return false; } ZeroMemory( ppszTokenIds, ulNumTokens*sizeof( WCHAR* ) ); // Get the next token in the enumeration // State is maintained in the enumerator - while (cpEnum->Next(1, &pToken, NULL) == S_OK) + while (t_success && cpEnum->Next(1, &pToken, NULL) == S_OK) { // Get a string which describes the token, in our case, the voice name - hr = SpGetDescription( pToken, &ppcDesciptionString[ulIndex] ); - _ASSERTE( SUCCEEDED( hr ) ); + t_success = SUCCEEDED(_GetDescription( pToken, &ppcDesciptionString[ulIndex] )); // Get the token id, for a low overhead way to retrieve the token later // without holding on to the object itself - hr = pToken->GetId( &ppszTokenIds[ulIndex] ); - _ASSERTE( SUCCEEDED( hr ) ); + if (t_success) + t_success = SUCCEEDED(pToken->GetId( &ppszTokenIds[ulIndex] )); ulIndex++; @@ -495,7 +648,7 @@ bool WindowsSAPI5Narrator::ListVoices(NarratorGender p_gender, NarratorListVoice } } // if we've failed to properly initialize, then we should completely shut-down - if ( S_OK != hr ) + if ( !t_success ) { if ( pToken ) { @@ -509,17 +662,14 @@ bool WindowsSAPI5Narrator::ListVoices(NarratorGender p_gender, NarratorListVoice for ( ulIndex = 0; ulIndex < ulNumTokens; ulIndex++ ) { - char* string = ppcDesciptionString[ulIndex].CopyToChar(); + const char* string = W2A(ppcDesciptionString[ulIndex]); p_callback(p_context, p_gender, (const char *)string); } ManageCleanup( ppszTokenIds, ppcDesciptionString, ulNumTokens ); - return true; - } - else - { - return false; } + + return t_success; } // Parameters @@ -533,41 +683,40 @@ bool WindowsSAPI5Narrator::ListVoices(NarratorGender p_gender, NarratorListVoice // the matching token fails then also returns false. bool WindowsSAPI5Narrator::SetVoice(const char* p_voice) { + USES_CONVERSION; if(!bInited) return false; + bool t_success = true; + + const WCHAR *t_wvoice = A2W(p_voice); + CComPtr cpEnum;// Pointer to token enumerator ULONG ulIndex = 0, ulCurTokenIndex = 0, ulNumTokens = 0; // Find out which token corresponds to our voice which is currently in use ISpObjectToken *pToken = NULL; // Token interface pointer - HRESULT hr = SpEnumTokens(SPCAT_VOICES, NULL, NULL, &cpEnum); + t_success = _EnumTokens(SPCAT_VOICES, NULL, NULL, &cpEnum); - if (SUCCEEDED(hr) ) - { - hr = cpEnum->GetCount( &ulNumTokens ); - } - else - { - return false; - } + if (t_success) + t_success = SUCCEEDED(cpEnum->GetCount( &ulNumTokens )); + if (t_success) + t_success = ulNumTokens > 0; - if ( SUCCEEDED(hr) && 0 != ulNumTokens) - { - while (cpEnum->Next(1, &pToken, NULL) == S_OK) - { - CSpDynamicString ppcDesciptionString; - // Get a string which describes the token, in our case, the voice name - hr = SpGetDescription( pToken, &ppcDesciptionString); - _ASSERTE( SUCCEEDED( hr ) ); - - // Release the token itself - pToken->Release(); - pToken = NULL; + while (t_success && cpEnum->Next(1, &pToken, NULL) == S_OK) + { + CSpDynamicString ppcDesciptionString; + // Get a string which describes the token, in our case, the voice name + t_success = _GetDescription( pToken, &ppcDesciptionString); + + // Release the token itself + pToken->Release(); + pToken = NULL; - char* string = ppcDesciptionString.CopyToChar(); - if(strcmp(string, p_voice) == 0) + if (t_success) + { + if(wcscmp(ppcDesciptionString, t_wvoice) == 0) { ulCurTokenIndex = ulIndex; break; @@ -575,27 +724,18 @@ bool WindowsSAPI5Narrator::SetVoice(const char* p_voice) ulIndex++; } } - else - return false; - if ( ulIndex < ulNumTokens ) + if (t_success) + t_success = ulIndex < ulNumTokens; + + if (t_success) { cpEnum->Item( ulCurTokenIndex, &pToken ); - hr = m_cpVoice->SetVoice( pToken ); - if (SUCCEEDED(hr)) - { - pToken->Release(); - return true; - } - else - { - return false; - } - } - else - { - return false; + t_success = SUCCEEDED(m_cpVoice->SetVoice( pToken )); + pToken->Release(); } + + return t_success; } // Parameters @@ -682,28 +822,3 @@ bool WindowsSAPI5Narrator::GetPitch(int& p_pitch) return true; } - -// Helper function, frees tokens allocated by ListVoices. -void WindowsSAPI5Narrator::ManageCleanup( WCHAR** ppszTokenIds, CSpDynamicString* ppcDesciptionString, ULONG ulNumTokens) -{ - ULONG ulIndex; - - // Free all allocated token ids - if ( ppszTokenIds ) - { - for ( ulIndex = 0; ulIndex < ulNumTokens; ulIndex++ ) - { - if ( NULL != ppszTokenIds[ulIndex] ) - { - CoTaskMemFree( ppszTokenIds[ulIndex] ); - } - } - - delete [] ppszTokenIds; - } - - if ( ppcDesciptionString ) - { - delete [] ppcDesciptionString; - } -} \ No newline at end of file diff --git a/revspeech/src/w32sapi5speech.h b/revspeech/src/w32sapi5speech.h index 22e741975e8..8c3ee905a4a 100644 --- a/revspeech/src/w32sapi5speech.h +++ b/revspeech/src/w32sapi5speech.h @@ -21,12 +21,13 @@ along with LiveCode. If not see . */ #include "revspeech.h" #endif -#include #include -#include +#include #include #include +#include "atlsubset.h" + class WindowsSAPI5Narrator: public INarrator { public: @@ -67,10 +68,39 @@ class WindowsSAPI5Narrator: public INarrator // Pointer to our tts voice CComPtr m_cpVoice; - void ManageCleanup( WCHAR** ppszTokenIds, CSpDynamicString* ppcDesciptionString, ULONG ulNumTokens); bool m_bUseDefaultPitch; short m_Npitch; }; +//////////////////////////////////////////////////////////////////////////////// + +class CSpDynamicString +{ +public: + CSpDynamicString() + { + m_ptr = NULL; + } + + ~CSpDynamicString() + { + if (m_ptr != NULL) + CoTaskMemFree(m_ptr); + } + + WCHAR** operator &(void) + { + return &m_ptr; + } + + operator WCHAR* (void) + { + return m_ptr; + } + +protected: + WCHAR *m_ptr; +}; + #endif diff --git a/revvideograbber/revvideograbber.vcproj b/revvideograbber/revvideograbber.vcproj index cc1fc146dcc..34c8b5eea1a 100644 --- a/revvideograbber/revvideograbber.vcproj +++ b/revvideograbber/revvideograbber.vcproj @@ -56,7 +56,7 @@ /> . */ #define DXVIDEO_H #include "videograbber.h" -#include -extern CComModule _Module; -#include - #include #include "qedit.h" #include +#include "atlsubset.h" + #define MAX_VIDEODEVICE 10 #define MAX_AUDIODEVICE 10 #define MAX_CODEC 50 #define MAX_DEVICENAME_LENGTH 256 - // defines for video dialog setting enum E_VideoDialog { diff --git a/stage.sln b/stage.sln index 80148bd8a85..ef9efbb01a5 100644 --- a/stage.sln +++ b/stage.sln @@ -110,9 +110,7 @@ Global {90699A04-E42A-460B-B294-40DDC3E6166B}.Release|Win32.ActiveCfg = Release|Win32 {90699A04-E42A-460B-B294-40DDC3E6166B}.Release|Win32.Build.0 = Release|Win32 {9EF7E3FF-92D7-401E-BB4F-3F5B359DB131}.Debug|Win32.ActiveCfg = Debug|Win32 - {9EF7E3FF-92D7-401E-BB4F-3F5B359DB131}.Debug|Win32.Build.0 = Debug|Win32 {9EF7E3FF-92D7-401E-BB4F-3F5B359DB131}.Release|Win32.ActiveCfg = Release|Win32 - {9EF7E3FF-92D7-401E-BB4F-3F5B359DB131}.Release|Win32.Build.0 = Release|Win32 {4E727414-3B14-45B7-9B89-BFFFE396E1C9}.Debug|Win32.ActiveCfg = Debug|Win32 {4E727414-3B14-45B7-9B89-BFFFE396E1C9}.Debug|Win32.Build.0 = Debug|Win32 {4E727414-3B14-45B7-9B89-BFFFE396E1C9}.Release|Win32.ActiveCfg = Release|Win32 From c0a9216e4453f7b4ef3681ca2a8d9267e1dd3615 Mon Sep 17 00:00:00 2001 From: Ian Macphail Date: Fri, 12 Apr 2013 14:57:26 +0100 Subject: [PATCH 04/12] fix intersect detection with semi-transparent images --- engine/src/object.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/engine/src/object.cpp b/engine/src/object.cpp index 9d83e004fd3..aab20c88e8c 100644 --- a/engine/src/object.cpp +++ b/engine/src/object.cpp @@ -4038,7 +4038,6 @@ bool MCObject::intersects(MCObject *p_other, uint32_t p_threshold) memset(t_other_scanline, 0xff, t_scanline_width * 4); // Now check for overlap! - bool t_intersects; t_intersects = false; for(int32_t y = 0; y < t_rect . height; y++) { From 4918c0f94ea27cad1f5517869ef1fe459bedc293 Mon Sep 17 00:00:00 2001 From: Ian Macphail Date: Fri, 12 Apr 2013 16:06:24 +0100 Subject: [PATCH 05/12] Fix gif with no repeatcount (i.e. -1) not animating when loaded --- engine/src/image.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine/src/image.cpp b/engine/src/image.cpp index 65db673010c..74468c498f4 100644 --- a/engine/src/image.cpp +++ b/engine/src/image.cpp @@ -1736,9 +1736,11 @@ IO_stat MCImage::load(IO_handle stream, const char *version) if (ncolors > MAX_PLANES || flags & F_COMPRESSION || flags & F_TRUE_COLOR) { + repeatcount = -1; if (flags & F_REPEAT_COUNT) if ((stat = IO_read_int2(&repeatcount, stream)) != IO_NORMAL) return stat; + if ((stat = IO_read_uint4(&t_compressed->size, stream)) != IO_NORMAL) return stat; /* UNCHECKED */ MCMemoryAllocate(t_compressed->size, t_compressed->data); From f878d454953c1e06d9f2e90196aa11afd8a0c768 Mon Sep 17 00:00:00 2001 From: Ian Macphail Date: Fri, 12 Apr 2013 16:24:27 +0100 Subject: [PATCH 06/12] Comment previous change --- engine/src/image.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/src/image.cpp b/engine/src/image.cpp index 74468c498f4..2a642ee36c4 100644 --- a/engine/src/image.cpp +++ b/engine/src/image.cpp @@ -1736,6 +1736,7 @@ IO_stat MCImage::load(IO_handle stream, const char *version) if (ncolors > MAX_PLANES || flags & F_COMPRESSION || flags & F_TRUE_COLOR) { + // IM-2013-04-12: [[ BZ 10843 ]] Initialize to -1 to indicate no repeat count has been set repeatcount = -1; if (flags & F_REPEAT_COUNT) if ((stat = IO_read_int2(&repeatcount, stream)) != IO_NORMAL) From 4681b1e80006028ed4939f05378982296c216742 Mon Sep 17 00:00:00 2001 From: Mark Waddingham Date: Fri, 12 Apr 2013 18:34:27 +0100 Subject: [PATCH 07/12] Fixed bug 10837 - literals that look like numbers must eval as 'both' (string and number). --- engine/src/literal.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/src/literal.cpp b/engine/src/literal.cpp index 0d71a826fb2..fa3a735d6a5 100644 --- a/engine/src/literal.cpp +++ b/engine/src/literal.cpp @@ -44,9 +44,11 @@ Parse_stat MCLiteralNumber::parse(MCScriptPoint &sp, Boolean the) Exec_stat MCLiteralNumber::eval(MCExecPoint &ep) { + // MW-2013-04-12: [[ Bug 10837 ]] Make sure we set 'both' when evaluating the + // literal. Not doing this causes problems for things like 'numberFormat'. if (nvalue == BAD_NUMERIC) ep.setnameref_unsafe(value); else - ep.setnvalue(nvalue); + ep.setboth(MCNameGetOldString(value), nvalue); return ES_NORMAL; } From 7dcea4ba5cd77035cc1856cfbbf68e2836f05a99 Mon Sep 17 00:00:00 2001 From: Mark Waddingham Date: Fri, 12 Apr 2013 18:41:55 +0100 Subject: [PATCH 08/12] Fixed bug 10844 - incorrect evaluation of threshold parameter, should use ton() rather than ston(). --- engine/src/funcs.cpp | 4 +++- engine/src/object.cpp | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/src/funcs.cpp b/engine/src/funcs.cpp index 1021f99130c..0247f92e752 100644 --- a/engine/src/funcs.cpp +++ b/engine/src/funcs.cpp @@ -2787,7 +2787,9 @@ Exec_stat MCIntersect::eval(MCExecPoint &ep) return ES_ERROR; } - if (ep . ston() == ES_NORMAL) + // MW-2013-04-12: [[ Bug 10844 ]] Make sure we use ton(), otherwise it assumes + // input is a string. + if (ep . ton() == ES_NORMAL) t_threshold = ep . getuint4(); else { diff --git a/engine/src/object.cpp b/engine/src/object.cpp index 9d83e004fd3..aab20c88e8c 100644 --- a/engine/src/object.cpp +++ b/engine/src/object.cpp @@ -4038,7 +4038,6 @@ bool MCObject::intersects(MCObject *p_other, uint32_t p_threshold) memset(t_other_scanline, 0xff, t_scanline_width * 4); // Now check for overlap! - bool t_intersects; t_intersects = false; for(int32_t y = 0; y < t_rect . height; y++) { From c789230847db0fd8e9e85b0cef8bd2a8a865d4ef Mon Sep 17 00:00:00 2001 From: Monte Goulding Date: Sat, 13 Apr 2013 22:11:54 +1000 Subject: [PATCH 09/12] added _internal resolve image [id] relative to This command resolves a short id or name of an image as would be used for an icon and sets 'it' to the long ID of the image according to the documented rules for resolving icons. 'it' is set empty if the command fails to resolve the image which means it's not on any stack in memory. --- engine/src/internal_development.cpp | 119 ++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/engine/src/internal_development.cpp b/engine/src/internal_development.cpp index c05c70df1a8..24bfcbb3474 100644 --- a/engine/src/internal_development.cpp +++ b/engine/src/internal_development.cpp @@ -856,6 +856,124 @@ class MCInternalObjectUnListen: public MCStatement #endif +/* + + _internal resolve image [id] relative to + + This command resolves a short id or name of an image as would be used for an icon + and sets it to the long ID of the image according to the documented rules for resolving + icons. + + it is set empty if the command fails to resolve the image which means it's not on any stack in memory. + + */ + +class MCIdeResolveImage : public MCStatement +{ +public: + MCIdeResolveImage(void) + { + m_relative_object = nil; + m_id_or_name = nil; + m_it = nil; + } + ~MCIdeResolveImage() + { + if (m_relative_object) + delete m_relative_object; + if (m_id_or_name) + delete m_id_or_name; + if (m_it) + delete m_it; + } + + Parse_stat parse(MCScriptPoint &p_script_point) + { + Parse_stat t_parse_status; + t_parse_status = PS_NORMAL; + getit(p_script_point,m_it); + // Parse the optional 'id' token + m_is_id = (PS_NORMAL == p_script_point . skip_token(SP_FACTOR, TT_PROPERTY, P_ID)); + // Parse the id_or_name expression + if (t_parse_status == PS_NORMAL) + t_parse_status = p_script_point . parseexp(False, True, &m_id_or_name); + // Parse the 'relative to' tokens + if (t_parse_status == PS_NORMAL) + t_parse_status = p_script_point . skip_token(SP_FACTOR, TT_TO, PT_RELATIVE); + if (t_parse_status == PS_NORMAL) + t_parse_status = p_script_point . skip_token(SP_FACTOR, TT_TO, PT_TO); + // Parse the target object clause + if (t_parse_status == PS_NORMAL) + { + m_relative_object = new MCChunk(false); + t_parse_status = m_relative_object -> parse(p_script_point, False); + } + return t_parse_status; + } + + Exec_stat exec(MCExecPoint &p_execution_point) + { + Exec_stat t_execution_status; + MCObject *t_relative_object; + MCImage *t_found_image; + uint4 t_parent_id; + uint4 t_found_image_id; + MCString t_found_imgage_name; + + t_execution_status = ES_NORMAL; + + // get the relative object + t_execution_status = m_relative_object->getobj(p_execution_point, t_relative_object, t_parent_id, True); + if (t_execution_status == ES_NORMAL) { + // evaluate the id or name expression + t_execution_status = m_id_or_name->eval(p_execution_point); + if (t_execution_status == ES_NORMAL) { + if (m_is_id) { + // it's an ID + t_found_image_id = p_execution_point . getuint4(); + if (t_found_image_id) { + // resolve the id + t_found_image = t_relative_object ->resolveimageid(t_found_image_id); + if (t_found_image) { + // get the long id of the found image + t_execution_status = t_found_image->getprop(0, P_LONG_ID, p_execution_point, False); + } else { + p_execution_point.clear(); + } + } else { + p_execution_point.clear(); + } + } else { + // it's a name + t_found_imgage_name = p_execution_point . getsvalue(); + // resolve the id + t_found_image = t_relative_object ->resolveimagename(t_found_imgage_name); + if (t_found_image) { + // get the long id of the found image + t_execution_status = t_found_image->getprop(0, P_LONG_ID, p_execution_point, False); + } else { + p_execution_point.clear(); + } + } + } + + } + if (t_execution_status == ES_NORMAL) { + if (m_it != NULL) { + // set it to the found image's long id + t_execution_status = m_it -> set(p_execution_point); + } + } + return t_execution_status; + } +private: + MCChunk *m_relative_object; + MCExpression *m_id_or_name; + Boolean m_is_id; + MCVarref *m_it; + +}; + //////////////////////////////////////////////////////////////////////////////// template inline MCStatement *class_factory(void) @@ -888,6 +1006,7 @@ MCInternalVerbInfo MCinternalverbs[] = { "cancel", nil, class_factory }, #endif { "filter", "controls", class_factory }, + { "resolve", "image", class_factory }, { nil, nil, nil } }; From 9d19d77e9c7f10d79efb4f93a3154d4a06595830 Mon Sep 17 00:00:00 2001 From: Ian Macphail Date: Mon, 15 Apr 2013 10:43:40 +0100 Subject: [PATCH 10/12] Reduce stack load times due to image loading --- engine/src/image.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/engine/src/image.cpp b/engine/src/image.cpp index 65db673010c..9421736ce2e 100644 --- a/engine/src/image.cpp +++ b/engine/src/image.cpp @@ -524,7 +524,11 @@ void MCImage::setrect(const MCRectangle &nrect) if (!(state & CS_SIZE) || !(state & CS_EDITED)) { - apply_transform(); + // IM-2013-04-15: [[ BZ 10827 ]] if the image has rotation then apply_transform() + // will reset the rect otherwise it will stay as set, in which case we can avoid + // the call to apply_transform() and any costly image loading that might cause + if (angle != 0) + apply_transform(); if ((rect.width != orect.width || rect.height != orect.height) && m_rep != nil) { layer_rectchanged(orect, true); @@ -2035,7 +2039,9 @@ void MCImage::setrep(MCImageRep *p_rep) } // IM-2013-03-11: [[ BZ 10723 ]] If we have a new image, ensure that the current frame falls within the new framecount - setframe(currentframe); + // IM-2013-04-15: [[ BZ 10827 ]] Skip this check if the currentframe is 0 (preventing unnecessary image loading) + if (currentframe != 0) + setframe(currentframe); notifyneeds(false); } From d6e38f24803032ae18cea20490be189230d2a69b Mon Sep 17 00:00:00 2001 From: Mark Waddingham Date: Mon, 15 Apr 2013 17:09:22 +0100 Subject: [PATCH 11/12] Update submodules. --- ide | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ide b/ide index be95f738be9..fe969f02424 160000 --- a/ide +++ b/ide @@ -1 +1 @@ -Subproject commit be95f738be98399fb2f362bac2a2bd3481325505 +Subproject commit fe969f0242418abb4de45ccb23e956b41351897a From 137612bc12f2b05f9cb1cb296596819ae0b1e154 Mon Sep 17 00:00:00 2001 From: Monte Goulding Date: Tue, 16 Apr 2013 19:07:33 +1000 Subject: [PATCH 12/12] made style and error handling changes as required --- engine/src/internal_development.cpp | 107 ++++++++++++---------------- 1 file changed, 47 insertions(+), 60 deletions(-) diff --git a/engine/src/internal_development.cpp b/engine/src/internal_development.cpp index 24bfcbb3474..d90ef40af2d 100644 --- a/engine/src/internal_development.cpp +++ b/engine/src/internal_development.cpp @@ -887,84 +887,71 @@ class MCIdeResolveImage : public MCStatement delete m_it; } - Parse_stat parse(MCScriptPoint &p_script_point) + Parse_stat parse(MCScriptPoint &p_sp) { - Parse_stat t_parse_status; - t_parse_status = PS_NORMAL; - getit(p_script_point,m_it); + Parse_stat t_stat; + t_stat = PS_NORMAL; + getit(p_sp,m_it); // Parse the optional 'id' token - m_is_id = (PS_NORMAL == p_script_point . skip_token(SP_FACTOR, TT_PROPERTY, P_ID)); + m_is_id = (PS_NORMAL == p_sp . skip_token(SP_FACTOR, TT_PROPERTY, P_ID)); // Parse the id_or_name expression - if (t_parse_status == PS_NORMAL) - t_parse_status = p_script_point . parseexp(False, True, &m_id_or_name); + if (t_stat == PS_NORMAL) + t_stat = p_sp . parseexp(False, True, &m_id_or_name); // Parse the 'relative to' tokens - if (t_parse_status == PS_NORMAL) - t_parse_status = p_script_point . skip_token(SP_FACTOR, TT_TO, PT_RELATIVE); - if (t_parse_status == PS_NORMAL) - t_parse_status = p_script_point . skip_token(SP_FACTOR, TT_TO, PT_TO); + if (t_stat == PS_NORMAL) + t_stat = p_sp . skip_token(SP_FACTOR, TT_TO, PT_RELATIVE); + if (t_stat == PS_NORMAL) + t_stat = p_sp . skip_token(SP_FACTOR, TT_TO, PT_TO); // Parse the target object clause - if (t_parse_status == PS_NORMAL) + if (t_stat == PS_NORMAL) { m_relative_object = new MCChunk(false); - t_parse_status = m_relative_object -> parse(p_script_point, False); + t_stat = m_relative_object -> parse(p_sp, False); } - return t_parse_status; + return t_stat; } - Exec_stat exec(MCExecPoint &p_execution_point) + Exec_stat exec(MCExecPoint &p_ep) { - Exec_stat t_execution_status; + Exec_stat t_stat; + t_stat = ES_NORMAL; + + uint4 t_part_id; MCObject *t_relative_object; - MCImage *t_found_image; - uint4 t_parent_id; - uint4 t_found_image_id; - MCString t_found_imgage_name; + if (t_stat == ES_NORMAL) + t_stat = m_relative_object -> getobj(p_ep, t_relative_object, t_part_id, True); - t_execution_status = ES_NORMAL; + if (t_stat == ES_NORMAL) + t_stat = m_id_or_name -> eval(p_ep); - // get the relative object - t_execution_status = m_relative_object->getobj(p_execution_point, t_relative_object, t_parent_id, True); - if (t_execution_status == ES_NORMAL) { - // evaluate the id or name expression - t_execution_status = m_id_or_name->eval(p_execution_point); - if (t_execution_status == ES_NORMAL) { - if (m_is_id) { - // it's an ID - t_found_image_id = p_execution_point . getuint4(); - if (t_found_image_id) { - // resolve the id - t_found_image = t_relative_object ->resolveimageid(t_found_image_id); - if (t_found_image) { - // get the long id of the found image - t_execution_status = t_found_image->getprop(0, P_LONG_ID, p_execution_point, False); - } else { - p_execution_point.clear(); - } - } else { - p_execution_point.clear(); - } - } else { - // it's a name - t_found_imgage_name = p_execution_point . getsvalue(); - // resolve the id - t_found_image = t_relative_object ->resolveimagename(t_found_imgage_name); - if (t_found_image) { - // get the long id of the found image - t_execution_status = t_found_image->getprop(0, P_LONG_ID, p_execution_point, False); - } else { - p_execution_point.clear(); - } + MCImage *t_found_image; + t_found_image = nil; + if (t_stat == ES_NORMAL) + { + if (m_is_id) + { + if (p_ep . ton() == ES_ERROR) + { + MCeerror -> add(EE_VARIABLE_NAN, line, pos); + return ES_ERROR; } + + t_found_image = t_relative_object -> resolveimageid(p_ep . getuint4()); } + else + t_found_image = t_relative_object -> resolveimagename(p_ep . getsvalue()); + if (t_found_image != nil) + t_stat = t_found_image -> getprop(0, P_LONG_ID, p_ep, False); + else + p_ep . clear(); } - if (t_execution_status == ES_NORMAL) { - if (m_it != NULL) { - // set it to the found image's long id - t_execution_status = m_it -> set(p_execution_point); - } - } - return t_execution_status; + + if (t_stat == ES_NORMAL) + t_stat = m_it -> set(p_ep); + + return t_stat; + } private: MCChunk *m_relative_object;