diff
stringlengths 41
2.03M
| msg
stringlengths 1
1.5k
⌀ | repo
stringlengths 5
40
| sha
stringlengths 40
40
| time
stringlengths 20
20
|
---|---|---|---|---|
mmm a / lib / AST / ASTPrinter . cpp <nl> ppp b / lib / AST / ASTPrinter . cpp <nl> void PrintAST : : visitConstructorDecl ( ConstructorDecl * decl ) { <nl> printAttributes ( decl ) ; <nl> printAccessibility ( decl ) ; <nl> <nl> - if ( decl - > getInitKind ( ) = = CtorInitializerKind : : Convenience | | <nl> - decl - > getInitKind ( ) = = CtorInitializerKind : : ConvenienceFactory ) <nl> + if ( ( decl - > getInitKind ( ) = = CtorInitializerKind : : Convenience | | <nl> + decl - > getInitKind ( ) = = CtorInitializerKind : : ConvenienceFactory ) & & <nl> + ! decl - > getAttrs ( ) . hasAttribute < ConvenienceAttr > ( ) ) <nl> Printer < < " convenience " ; <nl> <nl> recordDeclLoc ( decl , <nl> | fix the ast printer to not print ' convenience ' twice in a case that fouled up the sil parser . | apple/swift | b0a6d601725b22194dd742ff04803171c25989bc | 2014-08-08T21:28:48Z |
mmm a / java / pom . xml <nl> ppp b / java / pom . xml <nl> <nl> < modelVersion > 4 . 0 . 0 < / modelVersion > <nl> < groupId > com . googlecode . libphonenumber < / groupId > <nl> < artifactId > libphonenumber < / artifactId > <nl> - < version > 3 . 0 - SNAPSHOT < / version > <nl> + < version > 3 . 0 < / version > <nl> < packaging > jar < / packaging > <nl> < name > libphonenumber < / name > <nl> < url > http : / / code . google . com / p / libphonenumber / < / url > <nl> <nl> < / licenses > <nl> <nl> < scm > <nl> - < connection > scm : svn : http : / / libphonenumber . googlecode . com / svn / trunk / < / connection > <nl> - < developerConnection > scm : svn : https : / / libphonenumber . googlecode . com / svn / trunk / < / developerConnection > <nl> - < url > http : / / libphonenumber . googlecode . com / svn / trunk / < / url > <nl> + < connection > scm : svn : http : / / libphonenumber . googlecode . com / svn / tags / libphonenumber - 3 . 0 < / connection > <nl> + < developerConnection > scm : svn : https : / / libphonenumber . googlecode . com / svn / tags / libphonenumber - 3 . 0 < / developerConnection > <nl> + < url > http : / / libphonenumber . googlecode . com / svn / tags / libphonenumber - 3 . 0 < / url > <nl> < / scm > <nl> <nl> < developers > <nl> | [ maven - release - plugin ] prepare release libphonenumber - 3 . 0 | google/libphonenumber | b62791486de382f330cb172da0d269cd30a0c6cd | 2014-12-03T12:21:28Z |
mmm a / include / v8 . h <nl> ppp b / include / v8 . h <nl> class V8_EXPORT Script { <nl> * Returns the corresponding context - unbound script . <nl> * / <nl> Local < UnboundScript > GetUnboundScript ( ) ; <nl> - <nl> - V8_DEPRECATED ( " Use GetUnboundScript ( ) - > GetId ( ) " , <nl> - int GetId ( ) ) { <nl> - return GetUnboundScript ( ) - > GetId ( ) ; <nl> - } <nl> } ; <nl> <nl> <nl> class V8_EXPORT ResourceConstraints { <nl> void ConfigureDefaults ( uint64_t physical_memory , <nl> uint64_t virtual_memory_limit ) ; <nl> <nl> - / / Deprecated , will be removed soon . <nl> - V8_DEPRECATED ( " Use two - args version instead " , <nl> - void ConfigureDefaults ( uint64_t physical_memory , <nl> - uint64_t virtual_memory_limit , <nl> - uint32_t number_of_processors ) ) ; <nl> - <nl> int max_semi_space_size ( ) const { return max_semi_space_size_ ; } <nl> void set_max_semi_space_size ( int value ) { max_semi_space_size_ = value ; } <nl> int max_old_space_size ( ) const { return max_old_space_size_ ; } <nl> class V8_EXPORT ResourceConstraints { <nl> uint32_t * stack_limit ( ) const { return stack_limit_ ; } <nl> / / Sets an address beyond which the VM ' s stack may not grow . <nl> void set_stack_limit ( uint32_t * value ) { stack_limit_ = value ; } <nl> - V8_DEPRECATED ( " Unused , will be removed " , int max_available_threads ( ) const ) { <nl> - return max_available_threads_ ; <nl> - } <nl> - / / Set the number of threads available to V8 , assuming at least 1 . <nl> - V8_DEPRECATED ( " Unused , will be removed " , <nl> - void set_max_available_threads ( int value ) ) { <nl> - max_available_threads_ = value ; <nl> - } <nl> size_t code_range_size ( ) const { return code_range_size_ ; } <nl> void set_code_range_size ( size_t value ) { <nl> code_range_size_ = value ; <nl> class V8_EXPORT ResourceConstraints { <nl> int max_old_space_size_ ; <nl> int max_executable_size_ ; <nl> uint32_t * stack_limit_ ; <nl> - int max_available_threads_ ; <nl> size_t code_range_size_ ; <nl> } ; <nl> <nl> class V8_EXPORT Isolate { <nl> * / <nl> static Isolate * New ( const CreateParams & params ) ; <nl> <nl> - static V8_DEPRECATED ( " Always pass CreateParams " , Isolate * New ( ) ) ; <nl> - <nl> / * * <nl> * Returns the entered isolate for the current thread or NULL in <nl> * case there is no current isolate . <nl> class V8_EXPORT V8 { <nl> " Use isolate version " , void SetAllowCodeGenerationFromStringsCallback ( <nl> AllowCodeGenerationFromStringsCallback that ) ) ; <nl> <nl> - / * * <nl> - * Set allocator to use for ArrayBuffer memory . <nl> - * The allocator should be set only once . The allocator should be set <nl> - * before any code tha uses ArrayBuffers is executed . <nl> - * This allocator is used in all isolates . <nl> - * / <nl> - static V8_DEPRECATE_SOON ( <nl> - " Use isolate version " , <nl> - void SetArrayBufferAllocator ( ArrayBuffer : : Allocator * allocator ) ) ; <nl> - <nl> / * * <nl> * Check if V8 is dead and therefore unusable . This is the case after <nl> * fatal errors such as out - of - memory situations . <nl> mmm a / src / api . cc <nl> ppp b / src / api . cc <nl> ResourceConstraints : : ResourceConstraints ( ) <nl> max_old_space_size_ ( 0 ) , <nl> max_executable_size_ ( 0 ) , <nl> stack_limit_ ( NULL ) , <nl> - max_available_threads_ ( 0 ) , <nl> code_range_size_ ( 0 ) { } <nl> <nl> - void ResourceConstraints : : ConfigureDefaults ( uint64_t physical_memory , <nl> - uint64_t virtual_memory_limit , <nl> - uint32_t number_of_processors ) { <nl> - ConfigureDefaults ( physical_memory , virtual_memory_limit ) ; <nl> - } <nl> - <nl> void ResourceConstraints : : ConfigureDefaults ( uint64_t physical_memory , <nl> uint64_t virtual_memory_limit ) { <nl> # if V8_OS_ANDROID <nl> void v8 : : V8 : : SetReturnAddressLocationResolver ( <nl> i : : V8 : : SetReturnAddressLocationResolver ( return_address_resolver ) ; <nl> } <nl> <nl> - void v8 : : V8 : : SetArrayBufferAllocator ( <nl> - ArrayBuffer : : Allocator * allocator ) { <nl> - if ( ! Utils : : ApiCheck ( i : : V8 : : ArrayBufferAllocator ( ) = = NULL , <nl> - " v8 : : V8 : : SetArrayBufferAllocator " , <nl> - " ArrayBufferAllocator might only be set once " ) ) <nl> - return ; <nl> - i : : V8 : : SetArrayBufferAllocator ( allocator ) ; <nl> - } <nl> - <nl> <nl> bool v8 : : V8 : : Dispose ( ) { <nl> i : : V8 : : TearDown ( ) ; <nl> Isolate * Isolate : : GetCurrent ( ) { <nl> } <nl> <nl> <nl> - Isolate * Isolate : : New ( ) { <nl> - Isolate : : CreateParams create_params ; <nl> - return New ( create_params ) ; <nl> - } <nl> - <nl> - <nl> Isolate * Isolate : : New ( const Isolate : : CreateParams & params ) { <nl> i : : Isolate * isolate = new i : : Isolate ( false ) ; <nl> Isolate * v8_isolate = reinterpret_cast < Isolate * > ( isolate ) ; <nl> - if ( params . array_buffer_allocator ! = NULL ) { <nl> - isolate - > set_array_buffer_allocator ( params . array_buffer_allocator ) ; <nl> - } else { <nl> - isolate - > set_array_buffer_allocator ( i : : V8 : : ArrayBufferAllocator ( ) ) ; <nl> - } <nl> + CHECK ( params . array_buffer_allocator ! = NULL ) ; <nl> + isolate - > set_array_buffer_allocator ( params . array_buffer_allocator ) ; <nl> if ( params . snapshot_blob ! = NULL ) { <nl> isolate - > set_snapshot_blob ( params . snapshot_blob ) ; <nl> } else { <nl> mmm a / src / v8 . cc <nl> ppp b / src / v8 . cc <nl> V8_DECLARE_ONCE ( init_natives_once ) ; <nl> V8_DECLARE_ONCE ( init_snapshot_once ) ; <nl> # endif <nl> <nl> - v8 : : ArrayBuffer : : Allocator * V8 : : array_buffer_allocator_ = NULL ; <nl> v8 : : Platform * V8 : : platform_ = NULL ; <nl> <nl> <nl> mmm a / src / v8 . h <nl> ppp b / src / v8 . h <nl> class V8 : public AllStatic { <nl> / / Support for entry hooking JITed code . <nl> static void SetFunctionEntryHook ( FunctionEntryHook entry_hook ) ; <nl> <nl> - static v8 : : ArrayBuffer : : Allocator * ArrayBufferAllocator ( ) { <nl> - return array_buffer_allocator_ ; <nl> - } <nl> - <nl> - static void SetArrayBufferAllocator ( v8 : : ArrayBuffer : : Allocator * allocator ) { <nl> - CHECK_NULL ( array_buffer_allocator_ ) ; <nl> - array_buffer_allocator_ = allocator ; <nl> - } <nl> - <nl> static void InitializePlatform ( v8 : : Platform * platform ) ; <nl> static void ShutdownPlatform ( ) ; <nl> static v8 : : Platform * GetCurrentPlatform ( ) ; <nl> class V8 : public AllStatic { <nl> static void InitializeOncePerProcessImpl ( ) ; <nl> static void InitializeOncePerProcess ( ) ; <nl> <nl> - / / Allocator for external array buffers . <nl> - static v8 : : ArrayBuffer : : Allocator * array_buffer_allocator_ ; <nl> / / v8 : : Platform to use . <nl> static v8 : : Platform * platform_ ; <nl> } ; <nl> | Delete APIs deprecated since last release | v8/v8 | ac1c713646bf4e59115d825f1e1c4984517cb68f | 2015-07-17T09:27:00Z |
mmm a / CHANGELOG_RU . md <nl> ppp b / CHANGELOG_RU . md <nl> <nl> # # Обратно несовместимые изменения <nl> <nl> * Удалена специальная интерпретация выражения IN , если слева указан массив . Ранее выражение вида ` arr IN ( set ) ` воспринималось как " хотя бы один элемент ` arr ` принадлежит множеству ` set ` " . Для получения такого же поведения в новой версии , напишите ` arrayExists ( x - > x IN ( set ) , arr ) ` . <nl> + * Отключено ошибочное использование опции сокета ` SO_REUSEPORT ` ( которая по ошибке включена по - умолчанию в библиотеке Poco ) . Стоит обратить внимание , что на Linux системах теперь не имеет смысла указывать одновременно адреса ` : : ` и ` 0 . 0 . 0 . 0 ` для listen - следует использовать лишь адрес ` : : ` , который ( с настройками ядра по - умолчанию ) позволяет слушать соединения как по IPv4 так и по IPv6 . Также вы можете вернуть поведение старых версий , указав в конфиге ` < listen_reuse_port > 1 < / listen_reuse_port > ` . <nl> <nl> <nl> # ClickHouse release 1 . 1 . 54370 , 2018 - 03 - 16 <nl> | Update CHANGELOG_RU . md | ClickHouse/ClickHouse | 3f976ea99b38cc538b91a5e888d98ef4b1646c2d | 2018-04-17T21:38:04Z |
mmm a / CONTRIBUTORS . md <nl> ppp b / CONTRIBUTORS . md <nl> Contributors of Apache MXNet ( incubating ) <nl> Apache MXNet adopts the Apache way and governs by merit . We believe that it is important to create <nl> an inclusive community where everyone can use , contribute to , and influence the direction of <nl> the project . We actively invite contributors who have earned the merit to be part of the <nl> - development community . See [ MXNet Community Guide ] [ https : / / mxnet . apache . org / community / community ] . <nl> + development community . See [ MXNet Community Guide ] ( https : / / mxnet . apache . org / community / community ) . <nl> <nl> <nl> PPMC <nl> | Fix markdown syntax for link to community guide ( ) | apache/incubator-mxnet | 1120d5914b79da52ff78e5f9bdc4282b77ba6f0a | 2020-11-11T14:08:35Z |
mmm a / js / common / modules / @ arangodb / mocha - runner . js <nl> ppp b / js / common / modules / @ arangodb / mocha - runner . js <nl> function logStats ( stats ) { <nl> chalk . bold ( stats . duration + ' ms ' ) <nl> } ( $ { <nl> chalk . green ( stats . passes ) <nl> - } | $ { <nl> + } | $ { <nl> chalk . red ( stats . failures ) <nl> - } | $ { <nl> + } | $ { <nl> chalk . cyan ( stats . pending ) <nl> } ) ` ) ; <nl> } <nl> | Whitespace | arangodb/arangodb | 97e80c9d3b343f8ee63961117cb3aa71dc70c09f | 2017-03-16T14:45:45Z |
mmm a / bindings / c / fdb_c . vcxproj <nl> ppp b / bindings / c / fdb_c . vcxproj <nl> FOR / F " tokens = 1 " % % i in ( ' hg . exe id ' ) do copy / Y " $ ( TargetPath ) " " $ ( TargetPath ) <nl> < ClCompile > <nl> < WarningLevel > Level3 < / WarningLevel > <nl> < Optimization > Disabled < / Optimization > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = _WIN32_WINNT_WS03 ; WINVER = _WIN32_WINNT_WS03 ; NTDDI_VERSION = NTDDI_WS03 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = _WIN32_WINNT_WS03 ; WINVER = _WIN32_WINNT_WS03 ; NTDDI_VERSION = NTDDI_WS03 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < RuntimeLibrary > MultiThreadedDebug < / RuntimeLibrary > <nl> < AdditionalOptions > / bigobj @ . . \ . . \ flow / no_intellisense . opt % ( AdditionalOptions ) < / AdditionalOptions > <nl> < / ClCompile > <nl> FOR / F " tokens = 1 " % % i in ( ' hg . exe id ' ) do copy / Y " $ ( TargetPath ) " " $ ( TargetPath ) <nl> < Optimization > MaxSpeed < / Optimization > <nl> < FunctionLevelLinking > true < / FunctionLevelLinking > <nl> < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = _WIN32_WINNT_WS03 ; WINVER = _WIN32_WINNT_WS03 ; NTDDI_VERSION = NTDDI_WS03 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = _WIN32_WINNT_WS03 ; WINVER = _WIN32_WINNT_WS03 ; NTDDI_VERSION = NTDDI_WS03 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < RuntimeLibrary > MultiThreaded < / RuntimeLibrary > <nl> < AdditionalOptions > / bigobj @ . . \ . . \ flow / no_intellisense . opt % ( AdditionalOptions ) < / AdditionalOptions > <nl> < / ClCompile > <nl> FOR / F " tokens = 1 " % % i in ( ' hg . exe id ' ) do copy / Y " $ ( TargetPath ) " " $ ( TargetPath ) <nl> < Import Project = " $ ( VCTargetsPath ) \ BuildCustomizations \ masm . targets " / > <nl> < / ImportGroup > <nl> < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . targets " / > <nl> - < / Project > <nl> \ No newline at end of file <nl> + < / Project > <nl> mmm a / bindings / c / local . mk <nl> ppp b / bindings / c / local . mk <nl> fdb_c_LIBS : = lib / libfdbclient . a lib / libfdbrpc . a lib / libflow . a <nl> fdb_c_tests_LIBS : = - Llib - lfdb_c <nl> fdb_c_tests_HEADERS : = - Ibindings / c <nl> <nl> - ifndef __TLS_DISABLED__ <nl> + ifndef TLS_DISABLED <nl> fdb_c_LIBS + = lib / libFDBLibTLS . a / usr / local / lib / libtls . a / usr / local / lib / libssl . a / usr / local / lib / libcrypto . a <nl> endif <nl> <nl> mmm a / bindings / flow / fdb_flow . vcxproj <nl> ppp b / bindings / flow / fdb_flow . vcxproj <nl> <nl> < Optimization > Disabled < / Optimization > <nl> < BasicRuntimeChecks > EnableFastChecks < / BasicRuntimeChecks > <nl> < RuntimeLibrary > MultiThreadedDebug < / RuntimeLibrary > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < AdditionalIncludeDirectories > % ( AdditionalIncludeDirectories ) ; . . \ c < / AdditionalIncludeDirectories > <nl> < MultiProcessorCompilation > true < / MultiProcessorCompilation > <nl> < AdditionalOptions > / bigobj @ . . \ . . \ flow / no_intellisense . opt % ( AdditionalOptions ) < / AdditionalOptions > <nl> <nl> < Optimization > Full < / Optimization > <nl> < RuntimeLibrary > MultiThreaded < / RuntimeLibrary > <nl> < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < AdditionalIncludeDirectories > % ( AdditionalIncludeDirectories ) ; . . \ c < / AdditionalIncludeDirectories > <nl> < EnableEnhancedInstructionSet > NotSet < / EnableEnhancedInstructionSet > <nl> < EnablePREfast > false < / EnablePREfast > <nl> <nl> < Target Name = " MyPreCompileSteps " AfterTargets = " CLCompile " > <nl> < Exec Command = " & quot ; $ ( SolutionDir ) bin \ $ ( Configuration ) \ coveragetool . exe & quot ; & quot ; $ ( OutDir ) coverage . $ ( TargetName ) . xml & quot ; @ ( ActorCompiler - > ' % ( RelativeDir ) % ( Filename ) % ( Extension ) ' , ' ' ) @ ( CLInclude - > ' % ( RelativeDir ) % ( Filename ) % ( Extension ) ' , ' ' ) @ ( CLCompile - > ' % ( RelativeDir ) % ( Filename ) % ( Extension ) ' , ' ' ) " / > <nl> < / Target > <nl> - < / Project > <nl> \ No newline at end of file <nl> + < / Project > <nl> mmm a / bindings / flow / tester / fdb_flow_tester . vcxproj <nl> ppp b / bindings / flow / tester / fdb_flow_tester . vcxproj <nl> <nl> < / PrecompiledHeader > <nl> < WarningLevel > Level3 < / WarningLevel > <nl> < Optimization > Disabled < / Optimization > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = _WIN32_WINNT_WS03 ; WINVER = _WIN32_WINNT_WS03 ; NTDDI_VERSION = NTDDI_WS03 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = _WIN32_WINNT_WS03 ; WINVER = _WIN32_WINNT_WS03 ; NTDDI_VERSION = NTDDI_WS03 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < MultiProcessorCompilation > true < / MultiProcessorCompilation > <nl> < MinimalRebuild > false < / MinimalRebuild > <nl> < RuntimeLibrary > MultiThreadedDebug < / RuntimeLibrary > <nl> <nl> < / PrecompiledHeader > <nl> < Optimization > Full < / Optimization > <nl> < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = _WIN32_WINNT_WS03 ; WINVER = _WIN32_WINNT_WS03 ; NTDDI_VERSION = NTDDI_WS03 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = _WIN32_WINNT_WS03 ; WINVER = _WIN32_WINNT_WS03 ; NTDDI_VERSION = NTDDI_WS03 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < MultiProcessorCompilation > true < / MultiProcessorCompilation > <nl> < FavorSizeOrSpeed > Speed < / FavorSizeOrSpeed > <nl> < RuntimeLibrary > MultiThreaded < / RuntimeLibrary > <nl> <nl> < Import Project = " . . \ . . \ . . \ flow \ actorcompiler \ ActorCompiler . targets " / > <nl> < / ImportGroup > <nl> < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . targets " / > <nl> - < / Project > <nl> \ No newline at end of file <nl> + < / Project > <nl> mmm a / bindings / java / fdb_java . vcxproj <nl> ppp b / bindings / java / fdb_java . vcxproj <nl> <nl> < WarningLevel > Level3 < / WarningLevel > <nl> < Optimization > Disabled < / Optimization > <nl> < AdditionalIncludeDirectories > % ( AdditionalIncludeDirectories ) ; $ ( SolutionDir ) bindings \ c < / AdditionalIncludeDirectories > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = _WIN32_WINNT_WS03 ; WINVER = _WIN32_WINNT_WS03 ; NTDDI_VERSION = NTDDI_WS03 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = _WIN32_WINNT_WS03 ; WINVER = _WIN32_WINNT_WS03 ; NTDDI_VERSION = NTDDI_WS03 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < RuntimeLibrary > MultiThreadedDebug < / RuntimeLibrary > <nl> < AdditionalOptions > / bigobj " @ $ ( SolutionDir ) flow / no_intellisense . opt " % ( AdditionalOptions ) < / AdditionalOptions > <nl> < / ClCompile > <nl> <nl> < FunctionLevelLinking > true < / FunctionLevelLinking > <nl> < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> < AdditionalIncludeDirectories > % ( AdditionalIncludeDirectories ) ; $ ( SolutionDir ) bindings \ c < / AdditionalIncludeDirectories > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = _WIN32_WINNT_WS03 ; WINVER = _WIN32_WINNT_WS03 ; NTDDI_VERSION = NTDDI_WS03 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = _WIN32_WINNT_WS03 ; WINVER = _WIN32_WINNT_WS03 ; NTDDI_VERSION = NTDDI_WS03 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < RuntimeLibrary > MultiThreaded < / RuntimeLibrary > <nl> < AdditionalOptions > / bigobj " @ $ ( SolutionDir ) flow / no_intellisense . opt " % ( AdditionalOptions ) < / AdditionalOptions > <nl> < / ClCompile > <nl> <nl> < Message Text = " Cleaning old dll files " Importance = " high " / > <nl> < Delete Files = " @ ( FilesToDelete ) " / > <nl> < / Target > <nl> - < / Project > <nl> \ No newline at end of file <nl> + < / Project > <nl> mmm a / build / link - wrapper . sh <nl> ppp b / build / link - wrapper . sh <nl> case $ 1 in <nl> fi <nl> <nl> OPTIONS = $ ( eval echo " $ OPTIONS $ LDFLAGS \ $ $ 2_LDFLAGS \ $ $ 2_OBJECTS \ $ $ 2_LIBS \ $ $ 2_STATIC_LIBS_REAL - o $ 3 " ) <nl> + echo " OPTIONS : $ OPTIONS " <nl> <nl> if echo $ OPTIONS | grep - q - - - static - libstdc \ + \ + ; then <nl> OPTIONS = $ ( echo $ OPTIONS | sed - e s , - static - libstdc \ + \ + , , - e s , \ $ , \ ` $ CC - print - file - name = libstdc + + . a ` \ - lm , ) <nl> case $ 1 in <nl> fi <nl> ; ; <nl> * ) <nl> + echo " Command : $ CC $ OPTIONS " <nl> $ CC $ OPTIONS <nl> ; ; <nl> esac <nl> mmm a / build / scver . mk <nl> ppp b / build / scver . mk <nl> info : <nl> @ echo " User : ( $ ( USERID ) ) $ ( USER ) " <nl> @ echo " Java Version : ( $ ( JAVAVERMAJOR ) . $ ( JAVAVERMINOR ) ) $ ( JAVAVER ) " <nl> @ echo " Platform : $ ( PLATFORM ) " <nl> + ifdef TLS_DISABLED <nl> + @ echo " TLS : Disabled " <nl> + else <nl> + @ echo " TLS : Enabled " <nl> + endif <nl> + @ echo " fdbcli CFLAGS : $ ( fdbcli_CFLAGS ) " <nl> @ echo " " <nl> mmm a / fdbbackup / fdbbackup . vcxproj <nl> ppp b / fdbbackup / fdbbackup . vcxproj <nl> <nl> < Optimization > Disabled < / Optimization > <nl> < BasicRuntimeChecks > EnableFastChecks < / BasicRuntimeChecks > <nl> < RuntimeLibrary > MultiThreadedDebug < / RuntimeLibrary > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < AdditionalIncludeDirectories > % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < MultiProcessorCompilation > true < / MultiProcessorCompilation > <nl> < AdditionalOptions > / bigobj @ . . / flow / no_intellisense . opt % ( AdditionalOptions ) < / AdditionalOptions > <nl> <nl> < Optimization > Full < / Optimization > <nl> < RuntimeLibrary > MultiThreaded < / RuntimeLibrary > <nl> < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < AdditionalIncludeDirectories > % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < EnableEnhancedInstructionSet > NotSet < / EnableEnhancedInstructionSet > <nl> < EnablePREfast > false < / EnablePREfast > <nl> mmm a / fdbbackup / local . mk <nl> ppp b / fdbbackup / local . mk <nl> fdbbackup_CFLAGS : = $ ( fdbclient_CFLAGS ) <nl> fdbbackup_LDFLAGS : = $ ( fdbrpc_LDFLAGS ) <nl> fdbbackup_LIBS : = lib / libfdbclient . a lib / libfdbrpc . a lib / libflow . a <nl> <nl> - ifndef __TLS_DISABLED__ <nl> + ifndef TLS_DISABLED <nl> fdbbackup_LIBS + = lib / libFDBLibTLS . a / usr / local / lib / libtls . a / usr / local / lib / libssl . a / usr / local / lib / libcrypto . a <nl> endif <nl> <nl> mmm a / fdbcli / fdbcli . actor . cpp <nl> ppp b / fdbcli / fdbcli . actor . cpp <nl> CSimpleOpt : : SOption g_rgOptions [ ] = { <nl> { OPT_VERSION , " - - version " , SO_NONE } , <nl> { OPT_VERSION , " - v " , SO_NONE } , <nl> <nl> - # ifndef __TLS_DISABLED__ <nl> + # ifndef TLS_DISABLED <nl> TLS_OPTION_FLAGS <nl> # endif <nl> <nl> static void printProgramUsage ( const char * name ) { <nl> " and then exits . \ n " <nl> " - - no - status Disables the initial status check done when starting \ n " <nl> " the CLI . \ n " <nl> - # ifndef __TLS_DISABLED__ <nl> + # ifndef TLS_DISABLED <nl> TLS_HELP <nl> # endif <nl> " - v , - - version Print FoundationDB CLI version information and exit . \ n " <nl> struct CLIOptions { <nl> initialStatusCheck = false ; <nl> break ; <nl> <nl> - # ifndef __TLS_DISABLED__ <nl> + # ifndef TLS_DISABLED <nl> / / TLS Options <nl> case TLSOptions : : OPT_TLS_PLUGIN : <nl> break ; <nl> mmm a / fdbcli / fdbcli . vcxproj <nl> ppp b / fdbcli / fdbcli . vcxproj <nl> <nl> < / PrecompiledHeader > <nl> < WarningLevel > Level3 < / WarningLevel > <nl> < Optimization > Disabled < / Optimization > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < AdditionalIncludeDirectories > . . \ zookeeper \ win32 ; . . \ zookeeper \ generated ; . . \ zookeeper \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < MultiProcessorCompilation > true < / MultiProcessorCompilation > <nl> < MinimalRebuild > false < / MinimalRebuild > <nl> <nl> < / PrecompiledHeader > <nl> < Optimization > Full < / Optimization > <nl> < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < AdditionalIncludeDirectories > . . \ zookeeper \ win32 ; . . \ zookeeper \ generated ; . . \ zookeeper \ include ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < MultiProcessorCompilation > true < / MultiProcessorCompilation > <nl> < FavorSizeOrSpeed > Speed < / FavorSizeOrSpeed > <nl> <nl> < Import Project = " . . \ flow \ actorcompiler \ ActorCompiler . targets " / > <nl> < / ImportGroup > <nl> < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . targets " / > <nl> - < / Project > <nl> \ No newline at end of file <nl> + < / Project > <nl> mmm a / fdbcli / local . mk <nl> ppp b / fdbcli / local . mk <nl> fdbcli_LDFLAGS : = $ ( fdbrpc_LDFLAGS ) <nl> fdbcli_LIBS : = lib / libfdbclient . a lib / libfdbrpc . a lib / libflow . a - ldl <nl> fdbcli_STATIC_LIBS : = <nl> <nl> - ifndef __TLS_DISABLED__ <nl> + ifndef TLS_DISABLED <nl> fdbcli_LIBS + = lib / libFDBLibTLS . a / usr / local / lib / libtls . a / usr / local / lib / libssl . a / usr / local / lib / libcrypto . a <nl> endif <nl> <nl> mmm a / fdbclient / NativeAPI . actor . cpp <nl> ppp b / fdbclient / NativeAPI . actor . cpp <nl> void setupNetwork ( uint64_t transportId , bool useMetrics ) { <nl> FlowTransport : : createInstance ( transportId ) ; <nl> Net2FileSystem : : newFileSystem ( ) ; <nl> <nl> - # ifndef __TLS_DISABLED__ <nl> + # ifndef TLS_DISABLED <nl> tlsOptions - > register_network ( ) ; <nl> # endif <nl> } <nl> mmm a / fdbclient / fdbclient . vcxproj <nl> ppp b / fdbclient / fdbclient . vcxproj <nl> <nl> < Optimization > Disabled < / Optimization > <nl> < BasicRuntimeChecks > EnableFastChecks < / BasicRuntimeChecks > <nl> < RuntimeLibrary > MultiThreadedDebug < / RuntimeLibrary > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < AdditionalIncludeDirectories > % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < MultiProcessorCompilation > true < / MultiProcessorCompilation > <nl> < AdditionalOptions > / bigobj @ . . / flow / no_intellisense . opt % ( AdditionalOptions ) < / AdditionalOptions > <nl> <nl> < Optimization > Full < / Optimization > <nl> < RuntimeLibrary > MultiThreaded < / RuntimeLibrary > <nl> < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < AdditionalIncludeDirectories > % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < EnableEnhancedInstructionSet > NotSet < / EnableEnhancedInstructionSet > <nl> < EnablePREfast > false < / EnablePREfast > <nl> mmm a / fdbrpc / LoadPlugin . h <nl> ppp b / fdbrpc / LoadPlugin . h <nl> extern " C " void * get_plugin ( const char * plugin_type_name_and_version ) ; <nl> <nl> template < class T > <nl> Reference < T > loadPlugin ( std : : string const & plugin_name ) { <nl> - # ifdef __TLS_DISABLED__ <nl> + # ifdef TLS_DISABLED <nl> return Reference < T > ( NULL ) ; <nl> # else <nl> return ( plugin_name . empty ( ) ) ? Reference < T > ( NULL ) : Reference < T > ( ( T * ) get_plugin ( T : : get_plugin_type_name_and_version ( ) ) ) ; <nl> mmm a / fdbrpc / TLSConnection . h <nl> ppp b / fdbrpc / TLSConnection . h <nl> struct TLSOptions : ReferenceCounted < TLSOptions > { <nl> enum { OPT_TLS = 100000 , OPT_TLS_PLUGIN , OPT_TLS_CERTIFICATES , OPT_TLS_KEY , OPT_TLS_VERIFY_PEERS , OPT_TLS_CA_FILE , OPT_TLS_PASSWORD } ; <nl> enum PolicyType { POLICY_VERIFY_PEERS = 1 , POLICY_NO_VERIFY_PEERS } ; <nl> TLSOptions ( ) : certs_set ( false ) , key_set ( false ) , verify_peers_set ( false ) , ca_set ( false ) { <nl> - # ifndef __TLS_DISABLED__ <nl> + # ifndef TLS_DISABLED <nl> init_plugin ( ) ; <nl> # endif <nl> } <nl> mmm a / fdbrpc / fdbrpc . vcxproj <nl> ppp b / fdbrpc / fdbrpc . vcxproj <nl> <nl> < Optimization > Disabled < / Optimization > <nl> < BasicRuntimeChecks > EnableFastChecks < / BasicRuntimeChecks > <nl> < RuntimeLibrary > MultiThreadedDebug < / RuntimeLibrary > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < AdditionalIncludeDirectories > % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < MultiProcessorCompilation > true < / MultiProcessorCompilation > <nl> < AdditionalOptions > / bigobj @ . . / flow / no_intellisense . opt % ( AdditionalOptions ) < / AdditionalOptions > <nl> <nl> < Optimization > Full < / Optimization > <nl> < RuntimeLibrary > MultiThreaded < / RuntimeLibrary > <nl> < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; FDB_CLEAN_BUILD ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; FDB_CLEAN_BUILD ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < AdditionalIncludeDirectories > % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < EnableEnhancedInstructionSet > NotSet < / EnableEnhancedInstructionSet > <nl> < EnablePREfast > false < / EnablePREfast > <nl> mmm a / fdbrpc / local . mk <nl> ppp b / fdbrpc / local . mk <nl> fdbrpc_BUILD_SOURCES + = fdbrpc / libeio / eio . c <nl> fdbrpc_CFLAGS : = - I $ ( BOOSTDIR ) - I . - Ifdbrpc - Ifdbrpc / libeio - DUSE_UCONTEXT <nl> fdbrpc_LDFLAGS : = <nl> <nl> - ifdef __TLS_DISABLED__ <nl> - fdbrpc_CFLAGS + = - D__TLS_DISABLED__ <nl> + ifdef TLS_DISABLED <nl> + fdbrpc_CFLAGS + = - DTLS_DISABLED <nl> endif <nl> <nl> ifeq ( $ ( PLATFORM ) , osx ) <nl> mmm a / fdbrpc / md5 / md5 . h <nl> ppp b / fdbrpc / md5 / md5 . h <nl> <nl> # include < openssl / md5 . h > <nl> # elif ! defined ( _MD5_H ) <nl> # define _MD5_H <nl> + # include " flow / Platform . h " <nl> <nl> / * Any 32 - bit or wider unsigned integer data type will do * / <nl> typedef unsigned int MD5_u32plus ; <nl> typedef struct { <nl> # ifdef __cplusplus <nl> extern " C " { <nl> # endif <nl> - void __attribute__ ( ( weak ) ) MD5_Init ( MD5_CTX * ctx ) ; <nl> - void __attribute__ ( ( weak ) ) MD5_Update ( MD5_CTX * ctx , const void * data , unsigned long size ) ; <nl> - void __attribute__ ( ( weak ) ) MD5_Final ( unsigned char * result , MD5_CTX * ctx ) ; <nl> + extern void MULTIPLY_DEFINED_SYMBOL MD5_Init ( MD5_CTX * ctx ) ; <nl> + extern void MULTIPLY_DEFINED_SYMBOL MD5_Update ( MD5_CTX * ctx , const void * data , unsigned long size ) ; <nl> + extern void MULTIPLY_DEFINED_SYMBOL MD5_Final ( unsigned char * result , MD5_CTX * ctx ) ; <nl> # ifdef __cplusplus <nl> } <nl> # endif <nl> mmm a / fdbserver / fdbserver . actor . cpp <nl> ppp b / fdbserver / fdbserver . actor . cpp <nl> CSimpleOpt : : SOption g_rgOptions [ ] = { <nl> { OPT_IO_TRUST_SECONDS , " - - io_trust_seconds " , SO_REQ_SEP } , <nl> { OPT_IO_TRUST_WARN_ONLY , " - - io_trust_warn_only " , SO_NONE } , <nl> <nl> - # ifndef __TLS_DISABLED__ <nl> + # ifndef TLS_DISABLED <nl> TLS_OPTION_FLAGS <nl> # endif <nl> <nl> static void printUsage ( const char * name , bool devhelp ) { <nl> " Machine class ( valid options are storage , transaction , \ n " <nl> " resolution , proxy , master , test , unset , stateless , log , router , \ n " <nl> " and cluster_controller ) . \ n " ) ; <nl> - # ifndef __TLS_DISABLED__ <nl> + # ifndef TLS_DISABLED <nl> printf ( TLS_HELP ) ; <nl> # endif <nl> printf ( " - v , - - version Print version information and exit . \ n " ) ; <nl> int main ( int argc , char * argv [ ] ) { <nl> case OPT_IO_TRUST_WARN_ONLY : <nl> fileIoWarnOnly = true ; <nl> break ; <nl> - # ifndef __TLS_DISABLED__ <nl> + # ifndef TLS_DISABLED <nl> case TLSOptions : : OPT_TLS_PLUGIN : <nl> break ; <nl> case TLSOptions : : OPT_TLS_CERTIFICATES : <nl> int main ( int argc , char * argv [ ] ) { <nl> <nl> openTraceFile ( publicAddress , rollsize , maxLogsSize , logFolder , " trace " , logGroup ) ; <nl> <nl> - # ifndef __TLS_DISABLED__ <nl> + # ifndef TLS_DISABLED <nl> if ( tlsCertPath . size ( ) ) <nl> tlsOptions - > set_cert_file ( tlsCertPath ) ; <nl> if ( tlsCAPath . size ( ) ) <nl> mmm a / fdbserver / fdbserver . vcxproj <nl> ppp b / fdbserver / fdbserver . vcxproj <nl> <nl> < Optimization > Disabled < / Optimization > <nl> < BasicRuntimeChecks > EnableFastChecks < / BasicRuntimeChecks > <nl> < RuntimeLibrary > MultiThreadedDebug < / RuntimeLibrary > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < AdditionalIncludeDirectories > % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < MultiProcessorCompilation > true < / MultiProcessorCompilation > <nl> < AdditionalOptions > / bigobj @ . . / flow / no_intellisense . opt % ( AdditionalOptions ) < / AdditionalOptions > <nl> <nl> < Optimization > Full < / Optimization > <nl> < RuntimeLibrary > MultiThreaded < / RuntimeLibrary > <nl> < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < AdditionalIncludeDirectories > % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < EnableEnhancedInstructionSet > NotSet < / EnableEnhancedInstructionSet > <nl> < EnablePREfast > false < / EnablePREfast > <nl> <nl> < Target Name = " MyPreCompileSteps " AfterTargets = " CLCompile " > <nl> < Exec Command = " . . \ bin \ $ ( Configuration ) \ coveragetool . exe & quot ; $ ( OutDir ) coverage . $ ( TargetName ) . xml & quot ; @ ( ActorCompiler - > ' % ( RelativeDir ) % ( Filename ) % ( Extension ) ' , ' ' ) @ ( CLInclude - > ' % ( RelativeDir ) % ( Filename ) % ( Extension ) ' , ' ' ) @ ( CLCompile - > ' % ( RelativeDir ) % ( Filename ) % ( Extension ) ' , ' ' ) " / > <nl> < / Target > <nl> - < / Project > <nl> \ No newline at end of file <nl> + < / Project > <nl> mmm a / fdbserver / local . mk <nl> ppp b / fdbserver / local . mk <nl> fdbserver_CFLAGS : = $ ( fdbclient_CFLAGS ) <nl> fdbserver_LDFLAGS : = $ ( fdbrpc_LDFLAGS ) <nl> fdbserver_LIBS : = lib / libfdbclient . a lib / libfdbrpc . a lib / libflow . a <nl> <nl> - ifndef __TLS_DISABLED__ <nl> + ifndef TLS_DISABLED <nl> fdbserver_LIBS + = lib / libFDBLibTLS . a / usr / local / lib / libtls . a / usr / local / lib / libssl . a / usr / local / lib / libcrypto . a <nl> endif <nl> <nl> mmm a / flow / Platform . h <nl> ppp b / flow / Platform . h <nl> void * loadFunction ( void * lib , const char * func_name ) ; <nl> # define EXTERNC <nl> # endif / / __cplusplus <nl> <nl> + / * <nl> + * Multiply Defined Symbol ( support for weak function declaration ) . <nl> + * / <nl> + # ifndef MULTIPLY_DEFINED_SYMBOL <nl> + # if defined ( _MSC_VER ) <nl> + # define MULTIPLY_DEFINED_SYMBOL <nl> + # else <nl> + # define MULTIPLY_DEFINED_SYMBOL __attribute__ ( ( weak ) ) <nl> + # endif <nl> + # endif <nl> + <nl> / / Logs a critical error message and exits the program <nl> EXTERNC void criticalError ( int exitCode , const char * type , const char * message ) ; <nl> EXTERNC void flushAndExit ( int exitCode ) ; <nl> mmm a / flow / flow . vcxproj <nl> ppp b / flow / flow . vcxproj <nl> <nl> < Optimization > Disabled < / Optimization > <nl> < BasicRuntimeChecks > EnableFastChecks < / BasicRuntimeChecks > <nl> < RuntimeLibrary > MultiThreadedDebug < / RuntimeLibrary > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; _DEBUG ; _HAS_ITERATOR_DEBUGGING = 0 ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < AdditionalIncludeDirectories > % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < MultiProcessorCompilation > true < / MultiProcessorCompilation > <nl> < AdditionalOptions > / bigobj @ . . / flow / no_intellisense . opt % ( AdditionalOptions ) < / AdditionalOptions > <nl> <nl> < Optimization > Full < / Optimization > <nl> < RuntimeLibrary > MultiThreaded < / RuntimeLibrary > <nl> < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> - < PreprocessorDefinitions > WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; FDB_CLEAN_BUILD ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < PreprocessorDefinitions > TLS_DISABLED ; WIN32 ; _WIN32_WINNT = 0x0502 ; WINVER = 0x0502 ; NTDDI_VERSION = 0x05020000 ; NDEBUG ; _CONSOLE ; _CRT_SECURE_NO_WARNINGS ; FDB_CLEAN_BUILD ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> < AdditionalIncludeDirectories > % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < EnableEnhancedInstructionSet > NotSet < / EnableEnhancedInstructionSet > <nl> < EnablePREfast > false < / EnablePREfast > <nl> | Changed the TLS_DISABLED macro | apple/foundationdb | ef8de426d31a5841d088c7981cd51631c4dd1896 | 2018-06-26T19:08:32Z |
mmm a / . gitignore <nl> ppp b / . gitignore <nl> <nl> / dist / <nl> / external_binaries / <nl> / out / <nl> - / vendor / brightray / vendor / download / <nl> + / vendor / download / <nl> / vendor / debian_wheezy_amd64 - sysroot / <nl> / vendor / debian_wheezy_arm - sysroot / <nl> / vendor / debian_wheezy_i386 - sysroot / <nl> mmm a / brightray / brightray . gyp <nl> ppp b / brightray / brightray . gyp <nl> <nl> ' direct_dependent_settings ' : { <nl> ' include_dirs ' : [ <nl> ' . ' , <nl> - ' . . ' , <nl> + ' . . / vendor ' , <nl> ' < ( libchromiumcontent_src_dir ) ' , <nl> ' < ( libchromiumcontent_src_dir ) / gpu ' , <nl> ' < ( libchromiumcontent_src_dir ) / skia / config ' , <nl> mmm a / brightray / brightray . gypi <nl> ppp b / brightray / brightray . gypi <nl> <nl> { <nl> ' includes ' : [ <nl> - ' vendor / download / libchromiumcontent / filenames . gypi ' , <nl> + ' . . / vendor / download / libchromiumcontent / filenames . gypi ' , <nl> ] , <nl> ' variables ' : { <nl> ' libchromiumcontent_component % ' : 1 , <nl> deleted file mode 100755 <nl> index 29786398d722 . . 000000000000 <nl> mmm a / brightray / script / bootstrap <nl> ppp / dev / null <nl> <nl> - # ! / usr / bin / env python <nl> - <nl> - import argparse <nl> - import errno <nl> - import os <nl> - import subprocess <nl> - import sys <nl> - <nl> - <nl> - SOURCE_ROOT = os . path . abspath ( os . path . dirname ( os . path . dirname ( __file__ ) ) ) <nl> - VENDOR_DIR = os . path . join ( SOURCE_ROOT , ' vendor ' ) <nl> - DOWNLOAD_DIR = os . path . join ( VENDOR_DIR , ' download ' ) <nl> - <nl> - <nl> - def main ( ) : <nl> - args = parse_args ( ) <nl> - if ( args . libcc_source_path ! = None and <nl> - args . libcc_shared_library_path ! = None and <nl> - args . libcc_static_library_path ! = None ) : <nl> - pass <nl> - elif ( args . libcc_source_path ! = None or <nl> - args . libcc_shared_library_path ! = None or <nl> - args . libcc_static_library_path ! = None ) : <nl> - print " Error : All options of libchromiumcontent are required OR let " \ <nl> - " brightray choose it " <nl> - sys . exit ( 0 ) <nl> - update_submodules ( ) <nl> - setup_libchromiumcontent ( args . dev , args . commit , args . target_arch , args . url , <nl> - args . libcc_source_path , <nl> - args . libcc_shared_library_path , <nl> - args . libcc_static_library_path ) <nl> - <nl> - <nl> - def parse_args ( ) : <nl> - parser = argparse . ArgumentParser ( description = ' Bootstrap this project ' ) <nl> - parser . add_argument ( ' - c ' , ' - - commit ' , required = True , <nl> - help = ' The commit of libchromiumcontent to download . ' ) <nl> - parser . add_argument ( ' - d ' , ' - - dev ' , action = ' store_true ' , <nl> - help = ' Do not download static_library build ' ) <nl> - parser . add_argument ( ' - - target_arch ' , required = True , <nl> - help = ' The arch of libchromiumcontent to download . ' ) <nl> - parser . add_argument ( ' url ' , help = ' The base URL from which to download ' <nl> - ' libchromiumcontent ( i . e . , the URL you passed to ' <nl> - ' libchromiumcontent \ ' s script / upload script ' ) <nl> - parser . add_argument ( ' - - libcc_source_path ' , required = False , <nl> - help = ' The source path of libchromiumcontent . ' \ <nl> - ' NOTE : All options of libchromiumcontent are ' <nl> - ' required OR let brightray choose it ' ) <nl> - parser . add_argument ( ' - - libcc_shared_library_path ' , required = False , <nl> - help = ' The shared library path of libchromiumcontent . ' \ <nl> - ' NOTE : All options of libchromiumcontent are ' \ <nl> - ' required OR let brightray choose it ' ) <nl> - parser . add_argument ( ' - - libcc_static_library_path ' , required = False , <nl> - help = ' The static library path of libchromiumcontent . ' \ <nl> - ' NOTE : All options of libchromiumcontent are ' \ <nl> - ' required OR let brightray choose it ' ) <nl> - return parser . parse_args ( ) <nl> - <nl> - <nl> - def update_submodules ( ) : <nl> - return ( subprocess . call ( [ ' git ' , ' submodule ' , ' sync ' , ' - - quiet ' ] , <nl> - cwd = SOURCE_ROOT ) or <nl> - subprocess . call ( [ ' git ' , ' submodule ' , ' update ' , ' - - init ' , <nl> - ' - - recursive ' ] , cwd = SOURCE_ROOT ) ) <nl> - <nl> - <nl> - def setup_libchromiumcontent ( is_dev , commit , target_arch , url , <nl> - libcc_source_path , <nl> - libcc_shared_library_path , <nl> - libcc_static_library_path ) : <nl> - target_dir = os . path . join ( DOWNLOAD_DIR , ' libchromiumcontent ' ) <nl> - download = os . path . join ( VENDOR_DIR , ' libchromiumcontent ' , ' script ' , <nl> - ' download ' ) <nl> - args = [ ' - f ' , ' - c ' , commit , ' - - target_arch ' , target_arch , url , target_dir ] <nl> - if ( libcc_source_path ! = None and <nl> - libcc_shared_library_path ! = None and <nl> - libcc_static_library_path ! = None ) : <nl> - args + = [ ' - - libcc_source_path ' , libcc_source_path , <nl> - ' - - libcc_shared_library_path ' , libcc_shared_library_path , <nl> - ' - - libcc_static_library_path ' , libcc_static_library_path ] <nl> - mkdir_p ( target_dir ) <nl> - else : <nl> - mkdir_p ( DOWNLOAD_DIR ) <nl> - if is_dev : <nl> - subprocess . check_call ( [ sys . executable , download ] + args ) <nl> - else : <nl> - subprocess . check_call ( [ sys . executable , download , ' - s ' ] + args ) <nl> - <nl> - <nl> - def mkdir_p ( path ) : <nl> - try : <nl> - os . makedirs ( path ) <nl> - except OSError as e : <nl> - if e . errno ! = errno . EEXIST : <nl> - raise <nl> - <nl> - <nl> - if __name__ = = ' __main__ ' : <nl> - sys . exit ( main ( ) ) <nl> deleted file mode 100755 <nl> index 6ee7da97a92a . . 000000000000 <nl> mmm a / brightray / script / build <nl> ppp / dev / null <nl> <nl> - # ! / usr / bin / env python <nl> - <nl> - import os <nl> - import subprocess <nl> - import sys <nl> - <nl> - <nl> - SOURCE_ROOT = os . path . abspath ( os . path . dirname ( os . path . dirname ( __file__ ) ) ) <nl> - GYP = os . path . join ( SOURCE_ROOT , ' vendor ' , ' gyp ' , ' gyp_main . py ' ) <nl> - <nl> - <nl> - def main ( ) : <nl> - os . chdir ( SOURCE_ROOT ) <nl> - return ( run_gyp ( ) or build ( ) ) <nl> - <nl> - <nl> - def run_gyp ( ) : <nl> - env = os . environ . copy ( ) <nl> - gyp_pylib = os . path . join ( os . path . dirname ( GYP ) , ' pylib ' ) <nl> - env [ ' PYTHONPATH ' ] = os . path . pathsep . join ( [ gyp_pylib , <nl> - env . get ( ' PYTHONPATH ' , ' ' ) ] ) <nl> - env [ ' GYP_DEFINES ' ] = ' libchromiumcontent_component = static_library ' <nl> - return subprocess . call ( [ sys . executable , GYP , ' - - depth ' , ' . ' , <nl> - ' - Ibrightray . gypi ' , ' brightray . gyp ' ] , env = env ) <nl> - <nl> - <nl> - def build ( ) : <nl> - if sys . platform = = ' darwin ' : <nl> - return subprocess . call ( [ ' xcodebuild ' ] ) <nl> - if sys . platform = = ' linux2 ' : <nl> - return subprocess . call ( [ ' make ' ] ) <nl> - <nl> - assert sys . platform = = ' win32 ' , sys . platform <nl> - program_files = os . environ . get ( ' PROGRAMFILES ( X86 ) ' , os . environ [ ' PROGRAMFILES ' ] ) <nl> - msbuild = os . path . join ( program_files , ' MSBuild ' , ' 12 . 0 ' , ' Bin ' , ' MSBuild . exe ' ) <nl> - return subprocess . call ( [ msbuild , ' brightray . sln ' ] ) <nl> - <nl> - <nl> - if __name__ = = ' __main__ ' : <nl> - sys . exit ( main ( ) ) <nl> mmm a / common . gypi <nl> ppp b / common . gypi <nl> <nl> { <nl> ' includes ' : [ <nl> ' toolchain . gypi ' , <nl> - ' vendor / brightray / brightray . gypi ' , <nl> + ' brightray / brightray . gypi ' , <nl> ] , <nl> ' variables ' : { <nl> # Tell crashpad to build as external project . <nl> mmm a / electron . gyp <nl> ppp b / electron . gyp <nl> <nl> # is marked for no PIE ( ASLR ) . <nl> ' postbuild_name ' : ' Make More Helpers ' , <nl> ' action ' : [ <nl> - ' vendor / brightray / tools / mac / make_more_helpers . sh ' , <nl> + ' brightray / tools / mac / make_more_helpers . sh ' , <nl> ' Frameworks ' , <nl> ' < ( product_name ) ' , <nl> ] , <nl> <nl> ' dependencies ' : [ <nl> ' atom_js2c ' , <nl> ' vendor / pdf_viewer / pdf_viewer . gyp : pdf_viewer ' , <nl> - ' vendor / brightray / brightray . gyp : brightray ' , <nl> + ' brightray / brightray . gyp : brightray ' , <nl> ' vendor / node / node . gyp : node ' , <nl> ] , <nl> ' defines ' : [ <nl> <nl> ' include_dirs ' : [ <nl> ' . ' , <nl> ' chromium_src ' , <nl> - ' vendor / brightray ' , <nl> + ' brightray ' , <nl> ' vendor / native_mate ' , <nl> # Include atom_natives . h . <nl> ' < ( SHARED_INTERMEDIATE_DIR ) ' , <nl> <nl> ] , <nl> } , <nl> ' export_dependent_settings ' : [ <nl> - ' vendor / brightray / brightray . gyp : brightray ' , <nl> + ' brightray / brightray . gyp : brightray ' , <nl> ] , <nl> ' conditions ' : [ <nl> [ ' libchromiumcontent_component ' , { <nl> mmm a / script / bootstrap . py <nl> ppp b / script / bootstrap . py <nl> <nl> # ! / usr / bin / env python <nl> <nl> import argparse <nl> + import errno <nl> import os <nl> import subprocess <nl> import sys <nl> <nl> <nl> SOURCE_ROOT = os . path . abspath ( os . path . dirname ( os . path . dirname ( __file__ ) ) ) <nl> VENDOR_DIR = os . path . join ( SOURCE_ROOT , ' vendor ' ) <nl> + DOWNLOAD_DIR = os . path . join ( VENDOR_DIR , ' download ' ) <nl> PYTHON_26_URL = ' https : / / chromium . googlesource . com / chromium / deps / python_26 ' <nl> <nl> NPM = ' npm ' <nl> def main ( ) : <nl> # Redirect to use local libchromiumcontent build . <nl> if args . build_libchromiumcontent : <nl> build_libchromiumcontent ( args . verbose , args . target_arch , defines ) <nl> - dist_dir = os . path . join ( SOURCE_ROOT , ' vendor ' , ' brightray ' , ' vendor ' , <nl> - ' libchromiumcontent ' , ' dist ' , ' main ' ) <nl> + dist_dir = os . path . join ( VENDOR_DIR , ' libchromiumcontent ' , ' dist ' , ' main ' ) <nl> libcc_source_path = os . path . join ( dist_dir , ' src ' ) <nl> libcc_shared_library_path = os . path . join ( dist_dir , ' shared_library ' ) <nl> libcc_static_library_path = os . path . join ( dist_dir , ' static_library ' ) <nl> def main ( ) : <nl> <nl> setup_python_libs ( ) <nl> update_node_modules ( ' . ' ) <nl> - bootstrap_brightray ( args . dev , args . url , args . target_arch , <nl> - libcc_source_path , libcc_shared_library_path , <nl> - libcc_static_library_path ) <nl> + setup_libchromiumcontent ( args . dev , args . target_arch , args . url , <nl> + libcc_source_path , libcc_shared_library_path , <nl> + libcc_static_library_path ) <nl> <nl> if PLATFORM = = ' linux ' : <nl> download_sysroot ( args . target_arch ) <nl> def setup_python_libs ( ) : <nl> execute_stdout ( [ sys . executable , ' setup . py ' , ' build ' ] ) <nl> <nl> <nl> + def setup_libchromiumcontent ( is_dev , target_arch , url , <nl> + libcc_source_path , <nl> + libcc_shared_library_path , <nl> + libcc_static_library_path ) : <nl> + target_dir = os . path . join ( DOWNLOAD_DIR , ' libchromiumcontent ' ) <nl> + download = os . path . join ( VENDOR_DIR , ' libchromiumcontent ' , ' script ' , <nl> + ' download ' ) <nl> + args = [ ' - f ' , ' - c ' , LIBCHROMIUMCONTENT_COMMIT , ' - - target_arch ' , target_arch , <nl> + url , target_dir ] <nl> + if ( libcc_source_path ! = None and <nl> + libcc_shared_library_path ! = None and <nl> + libcc_static_library_path ! = None ) : <nl> + args + = [ ' - - libcc_source_path ' , libcc_source_path , <nl> + ' - - libcc_shared_library_path ' , libcc_shared_library_path , <nl> + ' - - libcc_static_library_path ' , libcc_static_library_path ] <nl> + mkdir_p ( target_dir ) <nl> + else : <nl> + mkdir_p ( DOWNLOAD_DIR ) <nl> + if is_dev : <nl> + subprocess . check_call ( [ sys . executable , download ] + args ) <nl> + else : <nl> + subprocess . check_call ( [ sys . executable , download , ' - s ' ] + args ) <nl> + <nl> def bootstrap_brightray ( is_dev , url , target_arch , libcc_source_path , <nl> libcc_shared_library_path , <nl> libcc_static_library_path ) : <nl> - bootstrap = os . path . join ( VENDOR_DIR , ' brightray ' , ' script ' , ' bootstrap ' ) <nl> + bootstrap = os . path . join ( SOURCE_ROOT , ' brightray ' , ' script ' , ' bootstrap ' ) <nl> args = [ <nl> ' - - commit ' , LIBCHROMIUMCONTENT_COMMIT , <nl> ' - - target_arch ' , target_arch , <nl> def download_sysroot ( target_arch ) : <nl> ' - - arch ' , target_arch ] ) <nl> <nl> def create_chrome_version_h ( ) : <nl> - version_file = os . path . join ( SOURCE_ROOT , ' vendor ' , ' brightray ' , ' vendor ' , <nl> - ' libchromiumcontent ' , ' VERSION ' ) <nl> + version_file = os . path . join ( VENDOR_DIR , ' libchromiumcontent ' , ' VERSION ' ) <nl> target_file = os . path . join ( SOURCE_ROOT , ' atom ' , ' common ' , ' chrome_version . h ' ) <nl> template_file = os . path . join ( SOURCE_ROOT , ' script ' , ' chrome_version . h . in ' ) <nl> <nl> def create_node_headers ( ) : <nl> ' - - version ' , get_electron_version ( ) ] ) <nl> <nl> <nl> + def mkdir_p ( path ) : <nl> + try : <nl> + os . makedirs ( path ) <nl> + except OSError as e : <nl> + if e . errno ! = errno . EEXIST : <nl> + raise <nl> + <nl> + <nl> if __name__ = = ' __main__ ' : <nl> sys . exit ( main ( ) ) <nl> mmm a / script / clean . py <nl> ppp b / script / clean . py <nl> def main ( ) : <nl> remove_directory ( ' node_modules ' ) <nl> remove_directory ( ' spec / node_modules ' ) <nl> <nl> - remove_directory ( ' vendor / brightray / vendor / download / libchromiumcontent ' ) <nl> - remove_directory ( ' vendor / brightray / vendor / libchromiumcontent / src ' ) <nl> + remove_directory ( ' vendor / download / libchromiumcontent ' ) <nl> + remove_directory ( ' vendor / libchromiumcontent / src ' ) <nl> <nl> remove_directory ( os . path . expanduser ( ' ~ / . node - gyp ' ) ) <nl> <nl> mmm a / script / update . py <nl> ppp b / script / update . py <nl> def run_gyp ( target_arch , component ) : <nl> if sys . platform = = ' cygwin ' : <nl> # Force using win32 python on cygwin . <nl> python = os . path . join ( ' vendor ' , ' python_26 ' , ' python . exe ' ) <nl> - gyp = os . path . join ( ' vendor ' , ' brightray ' , ' vendor ' , ' gyp ' , ' gyp_main . py ' ) <nl> + gyp = os . path . join ( ' vendor ' , ' gyp ' , ' gyp_main . py ' ) <nl> gyp_pylib = os . path . join ( os . path . dirname ( gyp ) , ' pylib ' ) <nl> # Avoid using the old gyp lib in system . <nl> env [ ' PYTHONPATH ' ] = os . path . pathsep . join ( [ gyp_pylib , <nl> | Wire up build for new brightray location | electron/electron | 5ea20b5b546df53a96b9a1a11f8a4952a7247528 | 2017-05-10T20:27:49Z |
mmm a / include / swift / Basic / LangOptions . h <nl> ppp b / include / swift / Basic / LangOptions . h <nl> namespace swift { <nl> / / / \ brief Perform all dynamic allocations using malloc / free instead of <nl> / / / optimized custom allocator , so that memory debugging tools can be used . <nl> bool UseMalloc = false ; <nl> + <nl> + / / / \ brief Enable codegen of lazy global initializers in SILGen . <nl> + bool EmitLazyGlobalInitializers = false ; <nl> } ; <nl> } <nl> <nl> mmm a / lib / SIL / TypeLowering . cpp <nl> ppp b / lib / SIL / TypeLowering . cpp <nl> Type TypeConverter : : getMethodSelfType ( Type selfType ) const { <nl> } <nl> } <nl> <nl> - / / / Get the type of a global variable accessor function , ( ) - > [ inout ] T . <nl> + / / / Get the type of a global variable accessor function , ( ) - > RawPointer . <nl> static Type getGlobalAccessorType ( Type varType , ASTContext & C ) { <nl> return FunctionType : : get ( TupleType : : getEmpty ( C ) , <nl> - LValueType : : get ( varType , <nl> - LValueType : : Qual : : DefaultForType , C ) , <nl> + C . TheRawPointerType , <nl> C ) ; <nl> } <nl> <nl> mmm a / lib / SILGen / Mangle . cpp <nl> ppp b / lib / SILGen / Mangle . cpp <nl> void SILGenModule : : mangleConstant ( SILDeclRef c , SILFunction * f ) { <nl> case SILDeclRef : : Kind : : Func : <nl> if ( ! c . hasDecl ( ) | | c . getDecl ( ) - > getDeclContext ( ) - > isLocalContext ( ) ) { <nl> / / FIXME : Generate a more descriptive name for closures . <nl> - buffer < < " closure " < < anonymousFunctionCounter + + ; <nl> + buffer < < " closure " < < anonymousSymbolCounter + + ; <nl> return ; <nl> } <nl> / / As a special case , functions can have external asm names . <nl> mmm a / lib / SILGen / SILGen . cpp <nl> ppp b / lib / SILGen / SILGen . cpp <nl> void SILGenModule : : emitDefaultArgGenerator ( SILDeclRef constant , Expr * arg ) { <nl> . emitGeneratorFunction ( constant , arg ) ; <nl> postEmitFunction ( constant , f ) ; <nl> } <nl> + <nl> + SILFunction * SILGenModule : : emitLazyGlobalInitializer ( StringRef funcName , <nl> + PatternBindingDecl * binding ) { <nl> + ASTContext & C = M . getASTContext ( ) ; <nl> + Type initType = FunctionType : : get ( TupleType : : getEmpty ( C ) , <nl> + TupleType : : getEmpty ( C ) , <nl> + FunctionType : : ExtInfo ( ) <nl> + . withIsThin ( true ) , <nl> + C ) ; <nl> + SILType initSILType = getLoweredType ( initType ) ; <nl> + <nl> + auto * f = new ( M ) SILFunction ( M , SILLinkage : : Internal , funcName , <nl> + initSILType , binding , IsNotTransparent ) ; <nl> + / / TODO : Debug scope ? Decl context ? <nl> + <nl> + SILGenFunction ( * this , * f ) <nl> + . emitLazyGlobalInitializer ( binding ) ; <nl> + <nl> + f - > verify ( ) ; <nl> + <nl> + return f ; <nl> + } <nl> + <nl> + void SILGenModule : : emitGlobalAccessor ( VarDecl * global , <nl> + FuncDecl * builtinOnceDecl , <nl> + SILGlobalVariable * onceToken , <nl> + SILFunction * onceFunc ) { <nl> + SILDeclRef accessor ( global , SILDeclRef : : Kind : : GlobalAccessor ) ; <nl> + SILFunction * f = preEmitFunction ( accessor , global , global ) ; <nl> + SILGenFunction ( * this , * f ) <nl> + . emitGlobalAccessor ( global , builtinOnceDecl , onceToken , onceFunc ) ; <nl> + postEmitFunction ( accessor , f ) ; <nl> + } <nl> <nl> void SILGenModule : : emitDefaultArgGenerators ( SILDeclRef : : Loc decl , <nl> ArrayRef < Pattern * > patterns ) { <nl> void SILGenModule : : emitObjCConstructorThunk ( ConstructorDecl * constructor ) { <nl> <nl> void SILGenModule : : visitPatternBindingDecl ( PatternBindingDecl * pd ) { <nl> / / Emit initializers for variables in top - level code . <nl> - / / FIXME : Global initialization order ? ! <nl> - if ( TopLevelSGF ) { <nl> - if ( ! TopLevelSGF - > B . hasValidInsertionPoint ( ) ) <nl> - return ; <nl> - <nl> - TopLevelSGF - > visit ( pd ) ; <nl> - } <nl> - <nl> - / / FIXME : generate accessor functions for global variables <nl> + emitGlobalInitialization ( pd ) ; <nl> } <nl> <nl> void SILGenModule : : visitVarDecl ( VarDecl * vd ) { <nl> mmm a / lib / SILGen / SILGen . h <nl> ppp b / lib / SILGen / SILGen . h <nl> class LLVM_LIBRARY_VISIBILITY SILGenModule : public ASTVisitor < SILGenModule > { <nl> <nl> SILFunction * emitTopLevelFunction ( SILLocation Loc ) ; <nl> <nl> - size_t anonymousFunctionCounter = 0 ; <nl> + size_t anonymousSymbolCounter = 0 ; <nl> <nl> Optional < SILDeclRef > StringToNSStringFn ; <nl> Optional < SILDeclRef > NSStringToStringFn ; <nl> class LLVM_LIBRARY_VISIBILITY SILGenModule : public ASTVisitor < SILGenModule > { <nl> / / / declaration . <nl> void emitObjCSubscriptMethodThunks ( SubscriptDecl * subscript ) ; <nl> <nl> + / / / Emit the lazy initializer function for a global pattern binding <nl> + / / / declaration . <nl> + SILFunction * emitLazyGlobalInitializer ( StringRef funcName , <nl> + PatternBindingDecl * binding ) ; <nl> + <nl> + / / / Emit the accessor for a global variable or stored static property . <nl> + / / / <nl> + / / / This ensures the lazy initializer has been run before returning the <nl> + / / / address of the variable . <nl> + void emitGlobalAccessor ( VarDecl * global , <nl> + FuncDecl * builtinOnceDecl , <nl> + SILGlobalVariable * onceToken , <nl> + SILFunction * onceFunc ) ; <nl> + <nl> / / / True if the given function requires an entry point for ObjC method <nl> / / / dispatch . <nl> bool requiresObjCMethodEntryPoint ( FuncDecl * method ) ; <nl> class LLVM_LIBRARY_VISIBILITY SILGenModule : public ASTVisitor < SILGenModule > { <nl> / / / dispatch . <nl> bool requiresObjCSuperDispatch ( ValueDecl * vd ) ; <nl> <nl> + / / / Emit a global initialization . <nl> + void emitGlobalInitialization ( PatternBindingDecl * initializer ) ; <nl> + <nl> / / / Known functions for bridging . <nl> SILDeclRef getStringToNSStringFn ( ) ; <nl> SILDeclRef getNSStringToStringFn ( ) ; <nl> class LLVM_LIBRARY_VISIBILITY SILGenFunction <nl> / / / Generate an ObjC - compatible setter for a subscript . <nl> void emitObjCSubscriptSetter ( SILDeclRef setter ) ; <nl> <nl> + / / / Generate a lazy global initializer . <nl> + void emitLazyGlobalInitializer ( PatternBindingDecl * binding ) ; <nl> + <nl> + / / / Generate a global accessor , using the given initializer token and <nl> + / / / function <nl> + void emitGlobalAccessor ( VarDecl * global , <nl> + FuncDecl * builtinOnceDecl , <nl> + SILGlobalVariable * onceToken , <nl> + SILFunction * onceFunc ) ; <nl> + <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> / / Control flow <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> mmm a / lib / SILGen / SILGenDecl . cpp <nl> ppp b / lib / SILGen / SILGenDecl . cpp <nl> <nl> # include " swift / SIL / SILType . h " <nl> # include " swift / SIL / TypeLowering . h " <nl> # include " swift / AST / AST . h " <nl> + # include " swift / AST / NameLookup . h " <nl> # include " swift / Basic / Fallthrough . h " <nl> # include < iterator > <nl> using namespace swift ; <nl> CleanupHandle SILGenFunction : : enterDeallocStackCleanup ( SILLocation loc , <nl> <nl> namespace { <nl> <nl> - / / / ArgumentInitVisitor - A visitor for traversing a pattern , creating <nl> + / / / A visitor for traversing a pattern , creating <nl> / / / SILArguments , and initializing the local value for each pattern variable <nl> / / / in a function argument list . <nl> struct ArgumentInitVisitor : <nl> class SILGenType : public Lowering : : ASTVisitor < SILGenType > { <nl> <nl> void visitPatternBindingDecl ( PatternBindingDecl * pd ) { <nl> / / Emit initializers for static variables . <nl> - / / FIXME : This has to happen lazily for generic properties . <nl> - / / ( We want it to happen lazily for all globals , really . ) <nl> - <nl> - / / FIXME : Global initialization order ? ! <nl> if ( pd - > isStatic ( ) ) { <nl> - assert ( ! theType - > getGenericParams ( ) <nl> - & & " generic static properties not implemented " ) ; <nl> - assert ( ( isa < StructDecl > ( theType ) | | isa < EnumDecl > ( theType ) ) <nl> - & & " only value type static properties are implemented " ) ; <nl> - <nl> - if ( SGM . TopLevelSGF ) { <nl> - if ( ! SGM . TopLevelSGF - > B . hasValidInsertionPoint ( ) ) <nl> - return ; <nl> - <nl> - SGM . TopLevelSGF - > visit ( pd ) ; <nl> - } <nl> + SGM . emitGlobalInitialization ( pd ) ; <nl> } <nl> } <nl> <nl> void SILGenFunction : : emitObjCSubscriptSetter ( SILDeclRef setter ) { <nl> / / Result should be void . <nl> B . createReturn ( loc , result ) ; <nl> } <nl> + <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / Global initialization <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + namespace { <nl> + <nl> + / / / A visitor for traversing a pattern , creating <nl> + / / / global accessor functions for all of the global variables declared inside . <nl> + struct GenGlobalAccessors : public PatternVisitor < GenGlobalAccessors > <nl> + { <nl> + / / / The module generator . <nl> + SILGenModule & SGM ; <nl> + / / / The Builtin . once token guarding the global initialization . <nl> + SILGlobalVariable * OnceToken ; <nl> + / / / The function containing the initialization code . <nl> + SILFunction * OnceFunc ; <nl> + <nl> + / / / A reference to the Builtin . once declaration . <nl> + FuncDecl * BuiltinOnceDecl ; <nl> + <nl> + GenGlobalAccessors ( SILGenModule & SGM , <nl> + SILGlobalVariable * OnceToken , <nl> + SILFunction * OnceFunc ) <nl> + : SGM ( SGM ) , OnceToken ( OnceToken ) , OnceFunc ( OnceFunc ) <nl> + { <nl> + / / Find Builtin . once . <nl> + auto & C = SGM . M . getASTContext ( ) ; <nl> + SmallVector < ValueDecl * , 2 > found ; <nl> + C . TheBuiltinModule <nl> + - > lookupValue ( { } , C . getIdentifier ( " once " ) , <nl> + NLKind : : QualifiedLookup , found ) ; <nl> + <nl> + assert ( found . size ( ) = = 1 & & " didn ' t find Builtin . once ? ! " ) ; <nl> + <nl> + BuiltinOnceDecl = cast < FuncDecl > ( found [ 0 ] ) ; <nl> + } <nl> + <nl> + / / Walk through non - binding patterns . <nl> + void visitParenPattern ( ParenPattern * P ) { <nl> + return visit ( P - > getSubPattern ( ) ) ; <nl> + } <nl> + void visitTypedPattern ( TypedPattern * P ) { <nl> + return visit ( P - > getSubPattern ( ) ) ; <nl> + } <nl> + void visitTuplePattern ( TuplePattern * P ) { <nl> + for ( auto & elt : P - > getFields ( ) ) <nl> + visit ( elt . getPattern ( ) ) ; <nl> + } <nl> + void visitAnyPattern ( AnyPattern * P ) { } <nl> + <nl> + / / When we see a variable binding , emit its global accessor . <nl> + void visitNamedPattern ( NamedPattern * P ) { <nl> + SGM . emitGlobalAccessor ( P - > getDecl ( ) , BuiltinOnceDecl , OnceToken , OnceFunc ) ; <nl> + } <nl> + <nl> + # define INVALID_PATTERN ( Id , Parent ) \ <nl> + void visit # # Id # # Pattern ( Id # # Pattern * ) { \ <nl> + llvm_unreachable ( " pattern not valid in argument or var binding " ) ; \ <nl> + } <nl> + # define PATTERN ( Id , Parent ) <nl> + # define REFUTABLE_PATTERN ( Id , Parent ) INVALID_PATTERN ( Id , Parent ) <nl> + # include " swift / AST / PatternNodes . def " <nl> + # undef INVALID_PATTERN <nl> + } ; <nl> + <nl> + } / / end anonymous namespace <nl> + <nl> + / / / Emit a global initialization . <nl> + void SILGenModule : : emitGlobalInitialization ( PatternBindingDecl * pd ) { <nl> + / / Generic and dynamic static properties require lazy initialization , which <nl> + / / isn ' t implemented yet . <nl> + if ( pd - > isStatic ( ) ) { <nl> + auto theType = pd - > getDeclContext ( ) - > getDeclaredTypeInContext ( ) ; <nl> + assert ( ! theType - > is < BoundGenericType > ( ) <nl> + & & " generic static properties not implemented " ) ; <nl> + assert ( ( theType - > getStructOrBoundGenericStruct ( ) <nl> + | | theType - > getEnumOrBoundGenericEnum ( ) ) <nl> + & & " only value type static properties are implemented " ) ; <nl> + } <nl> + <nl> + / / FIXME : Emit static initialization code into the global constructor . <nl> + / / This should be removed when global references go through lazy accessors . <nl> + if ( TopLevelSGF & & TopLevelSGF - > B . hasValidInsertionPoint ( ) ) <nl> + TopLevelSGF - > visit ( pd ) ; <nl> + <nl> + if ( ! M . getASTContext ( ) . LangOpts . EmitLazyGlobalInitializers ) <nl> + return ; <nl> + <nl> + / / Emit the lazy initialization token for the initialization expression . <nl> + auto counter = anonymousSymbolCounter + + ; <nl> + <nl> + llvm : : SmallString < 20 > onceTokenName ; <nl> + { <nl> + llvm : : raw_svector_ostream os ( onceTokenName ) ; <nl> + os < < " globalinit_token " < < counter ; <nl> + os . flush ( ) ; <nl> + } <nl> + <nl> + auto onceTy = BuiltinIntegerType : : getWordType ( M . getASTContext ( ) ) ; <nl> + auto onceSILTy = SILType : : getPrimitiveObjectType ( onceTy - > getCanonicalType ( ) ) ; <nl> + <nl> + auto onceToken = new ( M ) SILGlobalVariable ( M , SILLinkage : : Internal , <nl> + onceTokenName , <nl> + onceSILTy , / * isDefinition * / true ) ; <nl> + <nl> + / / Emit the initialization code into a function . <nl> + llvm : : SmallString < 20 > onceFuncName ; <nl> + { <nl> + llvm : : raw_svector_ostream os ( onceFuncName ) ; <nl> + os < < " globalinit_func " < < counter ; <nl> + os . flush ( ) ; <nl> + } <nl> + <nl> + SILFunction * onceFunc = emitLazyGlobalInitializer ( onceFuncName , pd ) ; <nl> + <nl> + / / Generate accessor functions for all of the declared variables , which <nl> + / / Builtin . once the lazy global initializer we just generated then return <nl> + / / the address of the individual variable . <nl> + GenGlobalAccessors ( * this , onceToken , onceFunc ) <nl> + . visit ( pd - > getPattern ( ) ) ; <nl> + } <nl> \ No newline at end of file <nl> mmm a / lib / SILGen / SILGenExpr . cpp <nl> ppp b / lib / SILGen / SILGenExpr . cpp <nl> void SILGenFunction : : emitGeneratorFunction ( SILDeclRef function , Expr * value ) { <nl> emitEpilog ( Loc ) ; <nl> } <nl> <nl> + void SILGenFunction : : emitLazyGlobalInitializer ( PatternBindingDecl * binding ) { <nl> + { <nl> + Scope scope ( Cleanups , binding ) ; <nl> + <nl> + / / Emit the initialization sequence . <nl> + visit ( binding ) ; <nl> + } <nl> + <nl> + / / Return void . <nl> + auto ret = emitEmptyTuple ( binding ) ; <nl> + B . createReturn ( binding , ret ) ; <nl> + } <nl> + <nl> + void SILGenFunction : : emitGlobalAccessor ( VarDecl * global , <nl> + FuncDecl * builtinOnceDecl , <nl> + SILGlobalVariable * onceToken , <nl> + SILFunction * onceFunc ) { <nl> + / / Invoke the initializer , once . <nl> + auto builtinOnceTy = getThinFunctionType ( builtinOnceDecl - > getType ( ) ) ; <nl> + auto builtinOnceSILTy = getLoweredLoadableType ( builtinOnceTy ) ; <nl> + auto builtinOnce = B . createBuiltinFunctionRef ( global , builtinOnceDecl , <nl> + builtinOnceSILTy ) ; <nl> + auto rawPointerSILTy = getLoweredLoadableType ( getASTContext ( ) . TheRawPointerType ) ; <nl> + SILValue onceTokenAddr = B . createSILGlobalAddr ( global , onceToken ) ; <nl> + onceTokenAddr = B . createAddressToPointer ( global , onceTokenAddr , <nl> + rawPointerSILTy ) ; <nl> + <nl> + SILValue onceFuncRef = B . createFunctionRef ( global , onceFunc ) ; <nl> + auto onceFuncThickTy <nl> + = getThickFunctionType ( onceFuncRef . getType ( ) . getSwiftRValueType ( ) ) ; <nl> + auto onceFuncThickSILTy = getLoweredLoadableType ( onceFuncThickTy ) ; <nl> + onceFuncRef = B . createThinToThickFunction ( global , onceFuncRef , <nl> + onceFuncThickSILTy ) ; <nl> + <nl> + SILValue onceArgs [ ] = { onceTokenAddr , onceFuncRef } ; <nl> + B . createApply ( global , builtinOnce , builtinOnce - > getType ( ) , <nl> + SILType : : getPrimitiveObjectType ( TupleType : : getEmpty ( getASTContext ( ) ) ) , <nl> + { } , onceArgs ) ; <nl> + <nl> + / / Return the address . <nl> + / / FIXME : It ' d be nice to be able to return a SIL address directly . <nl> + SILValue addr = B . createGlobalAddr ( global , global , <nl> + getLoweredType ( global - > getType ( ) ) . getAddressType ( ) ) ; <nl> + addr = B . createAddressToPointer ( global , addr , rawPointerSILTy ) ; <nl> + B . createReturn ( global , addr ) ; <nl> + } <nl> + <nl> RValue RValueEmitter : : <nl> visitInterpolatedStringLiteralExpr ( InterpolatedStringLiteralExpr * E , <nl> SGFContext C ) { <nl> new file mode 100644 <nl> index 000000000000 . . 0b101be26432 <nl> mmm / dev / null <nl> ppp b / test / SILGen / lazy_globals . swift <nl> <nl> + / / RUN : % swift - emit - lazy - global - initializers - parse - as - library - emit - silgen % s | FileCheck % s <nl> + <nl> + / / CHECK : sil internal @ globalinit_func0 : $ @ thin ( ) - > ( ) { <nl> + / / CHECK : % 0 = global_addr # x : $ * Int64 <nl> + / / CHECK : % 1 = mark_uninitialized % 0 : $ * Int64 <nl> + / / CHECK : store % 5 to % 1 : $ * Int64 <nl> + / / CHECK : sil @ _T12lazy_globals1xSia : $ @ thin ( ) - > Builtin . RawPointer { <nl> + / / CHECK : % 0 = builtin_function_ref # Builtin . once : $ @ thin ( Builtin . RawPointer , ( ) - > ( ) ) - > ( ) <nl> + / / CHECK : % 1 = sil_global_addr @ globalinit_token0 : $ * Builtin . Word <nl> + / / CHECK : % 2 = address_to_pointer % 1 : $ * Builtin . Word to $ Builtin . RawPointer <nl> + / / CHECK : % 3 = function_ref @ globalinit_func0 : $ @ thin ( ) - > ( ) <nl> + / / CHECK : % 4 = thin_to_thick_function % 3 : $ @ thin ( ) - > ( ) to $ ( ) - > ( ) <nl> + / / CHECK : % 5 = apply % 0 ( % 2 , % 4 ) : $ @ thin ( Builtin . RawPointer , ( ) - > ( ) ) - > ( ) <nl> + / / CHECK : % 6 = global_addr # x : $ * Int64 <nl> + / / CHECK : % 7 = address_to_pointer % 6 : $ * Int64 to $ Builtin . RawPointer <nl> + / / CHECK : return % 7 : $ Builtin . RawPointer <nl> + / / CHECK : } <nl> + var x : Int = 0 <nl> + <nl> + struct Foo { <nl> + / / CHECK : sil @ _TV12lazy_globals3Foo3fooSia : $ @ thin ( ) - > Builtin . RawPointer { <nl> + static var foo : Int = 22 <nl> + } <nl> + <nl> + enum Bar { <nl> + / / CHECK : sil @ _TO12lazy_globals3Bar3barSia : $ @ thin ( ) - > Builtin . RawPointer { <nl> + static var bar : Int = 33 <nl> + } <nl> + <nl> + / / TODO : Access globals through accessor functions . <nl> + def use_globals ( ) - > ( Int , Int , Int ) { <nl> + return ( x , Foo . foo , Bar . bar ) <nl> + } <nl> + <nl> + / / We only emit one initializer function per pattern binding , which initializes <nl> + / / all of the bound variables . <nl> + <nl> + def f ( ) - > ( Int , Int ) { return ( 1 , 2 ) } <nl> + <nl> + / / CHECK : sil internal @ globalinit_func3 : $ @ thin ( ) - > ( ) { <nl> + / / CHECK : function_ref @ _T12lazy_globals1fFT_TSiSi_ : $ @ thin ( ) - > ( Int64 , Int64 ) <nl> + / / CHECK : sil @ _T12lazy_globals2a1Sia : $ @ thin ( ) - > Builtin . RawPointer <nl> + / / CHECK : function_ref @ globalinit_func3 : $ @ thin ( ) - > ( ) <nl> + / / CHECK : global_addr # a1 : $ * Int64 <nl> + / / CHECK : sil @ _T12lazy_globals2b1Sia : $ @ thin ( ) - > Builtin . RawPointer { <nl> + / / CHECK : function_ref @ globalinit_func3 : $ @ thin ( ) - > ( ) <nl> + / / CHECK : global_addr # b1 : $ * Int64 <nl> + var ( a1 , b1 ) = f ( ) <nl> | SILGen : ( Optionally ) emit lazy initializers and accessor fns for globals . | apple/swift | a049ee9d38a276a6627897489332998aca595d58 | 2013-11-16T00:50:19Z |
mmm a / src / qt / forms / overviewpage . ui <nl> ppp b / src / qt / forms / overviewpage . ui <nl> <nl> < property name = " windowTitle " > <nl> < string > Form < / string > <nl> < / property > <nl> - < layout class = " QVBoxLayout " name = " verticalLayout_2 " > <nl> + < layout class = " QHBoxLayout " name = " horizontalLayout " stretch = " 1 , 1 " > <nl> < item > <nl> - < widget class = " QFrame " name = " frame " > <nl> - < property name = " frameShape " > <nl> - < enum > QFrame : : StyledPanel < / enum > <nl> - < / property > <nl> - < property name = " frameShadow " > <nl> - < enum > QFrame : : Raised < / enum > <nl> - < / property > <nl> - < layout class = " QFormLayout " name = " formLayout_2 " > <nl> - < property name = " fieldGrowthPolicy " > <nl> - < enum > QFormLayout : : AllNonFixedFieldsGrow < / enum > <nl> - < / property > <nl> - < property name = " horizontalSpacing " > <nl> - < number > 12 < / number > <nl> - < / property > <nl> - < property name = " verticalSpacing " > <nl> - < number > 12 < / number > <nl> - < / property > <nl> - < item row = " 0 " column = " 0 " > <nl> - < widget class = " QLabel " name = " label " > <nl> - < property name = " text " > <nl> - < string > Balance : < / string > <nl> + < layout class = " QVBoxLayout " name = " verticalLayout_2 " > <nl> + < item > <nl> + < widget class = " QFrame " name = " frame " > <nl> + < property name = " frameShape " > <nl> + < enum > QFrame : : StyledPanel < / enum > <nl> + < / property > <nl> + < property name = " frameShadow " > <nl> + < enum > QFrame : : Raised < / enum > <nl> + < / property > <nl> + < layout class = " QFormLayout " name = " formLayout_2 " > <nl> + < property name = " fieldGrowthPolicy " > <nl> + < enum > QFormLayout : : AllNonFixedFieldsGrow < / enum > <nl> < / property > <nl> - < / widget > <nl> - < / item > <nl> - < item row = " 0 " column = " 1 " > <nl> - < widget class = " QLabel " name = " labelBalance " > <nl> - < property name = " text " > <nl> - < string > 123 . 456 BTC < / string > <nl> + < property name = " horizontalSpacing " > <nl> + < number > 12 < / number > <nl> < / property > <nl> - < / widget > <nl> - < / item > <nl> - < item row = " 2 " column = " 0 " > <nl> - < widget class = " QLabel " name = " label_2 " > <nl> - < property name = " text " > <nl> - < string > Number of transactions : < / string > <nl> + < property name = " verticalSpacing " > <nl> + < number > 12 < / number > <nl> < / property > <nl> - < / widget > <nl> - < / item > <nl> - < item row = " 2 " column = " 1 " > <nl> - < widget class = " QLabel " name = " labelNumTransactions " > <nl> - < property name = " text " > <nl> - < string > 0 < / string > <nl> - < / property > <nl> - < / widget > <nl> - < / item > <nl> - < item row = " 1 " column = " 0 " > <nl> - < widget class = " QLabel " name = " label_3 " > <nl> - < property name = " text " > <nl> - < string > Unconfirmed : < / string > <nl> - < / property > <nl> - < / widget > <nl> - < / item > <nl> - < item row = " 1 " column = " 1 " > <nl> - < widget class = " QLabel " name = " labelUnconfirmed " > <nl> - < property name = " text " > <nl> - < string > 0 BTC < / string > <nl> - < / property > <nl> - < / widget > <nl> - < / item > <nl> - < / layout > <nl> - < / widget > <nl> + < item row = " 2 " column = " 0 " > <nl> + < widget class = " QLabel " name = " label " > <nl> + < property name = " text " > <nl> + < string > Balance : < / string > <nl> + < / property > <nl> + < / widget > <nl> + < / item > <nl> + < item row = " 2 " column = " 1 " > <nl> + < widget class = " QLabel " name = " labelBalance " > <nl> + < property name = " text " > <nl> + < string > 123 . 456 BTC < / string > <nl> + < / property > <nl> + < / widget > <nl> + < / item > <nl> + < item row = " 4 " column = " 0 " > <nl> + < widget class = " QLabel " name = " label_2 " > <nl> + < property name = " text " > <nl> + < string > Number of transactions : < / string > <nl> + < / property > <nl> + < / widget > <nl> + < / item > <nl> + < item row = " 4 " column = " 1 " > <nl> + < widget class = " QLabel " name = " labelNumTransactions " > <nl> + < property name = " text " > <nl> + < string > 0 < / string > <nl> + < / property > <nl> + < / widget > <nl> + < / item > <nl> + < item row = " 3 " column = " 0 " > <nl> + < widget class = " QLabel " name = " label_3 " > <nl> + < property name = " text " > <nl> + < string > Unconfirmed : < / string > <nl> + < / property > <nl> + < / widget > <nl> + < / item > <nl> + < item row = " 3 " column = " 1 " > <nl> + < widget class = " QLabel " name = " labelUnconfirmed " > <nl> + < property name = " text " > <nl> + < string > 0 BTC < / string > <nl> + < / property > <nl> + < / widget > <nl> + < / item > <nl> + < item row = " 1 " column = " 0 " > <nl> + < widget class = " QLabel " name = " label_5 " > <nl> + < property name = " text " > <nl> + < string > & lt ; ! DOCTYPE HTML PUBLIC & quot ; - / / W3C / / DTD HTML 4 . 0 / / EN & quot ; & quot ; http : / / www . w3 . org / TR / REC - html40 / strict . dtd & quot ; & gt ; <nl> + & lt ; html & gt ; & lt ; head & gt ; & lt ; meta name = & quot ; qrichtext & quot ; content = & quot ; 1 & quot ; / & gt ; & lt ; style type = & quot ; text / css & quot ; & gt ; <nl> + p , li { white - space : pre - wrap ; } <nl> + & lt ; / style & gt ; & lt ; / head & gt ; & lt ; body style = & quot ; font - family : ' Ubuntu ' ; font - size : 11pt ; font - weight : 400 ; font - style : normal ; & quot ; & gt ; <nl> + & lt ; p style = & quot ; margin - top : 0px ; margin - bottom : 0px ; margin - left : 0px ; margin - right : 0px ; - qt - block - indent : 0 ; text - indent : 0px ; & quot ; & gt ; & lt ; span style = & quot ; font - weight : 600 ; & quot ; & gt ; Wallet & lt ; / span & gt ; & lt ; / p & gt ; & lt ; / body & gt ; & lt ; / html & gt ; < / string > <nl> + < / property > <nl> + < / widget > <nl> + < / item > <nl> + < / layout > <nl> + < / widget > <nl> + < / item > <nl> + < item > <nl> + < spacer name = " verticalSpacer " > <nl> + < property name = " orientation " > <nl> + < enum > Qt : : Vertical < / enum > <nl> + < / property > <nl> + < property name = " sizeHint " stdset = " 0 " > <nl> + < size > <nl> + < width > 20 < / width > <nl> + < height > 40 < / height > <nl> + < / size > <nl> + < / property > <nl> + < / spacer > <nl> + < / item > <nl> + < / layout > <nl> < / item > <nl> < item > <nl> - < spacer name = " verticalSpacer " > <nl> - < property name = " orientation " > <nl> - < enum > Qt : : Vertical < / enum > <nl> - < / property > <nl> - < property name = " sizeHint " stdset = " 0 " > <nl> - < size > <nl> - < width > 20 < / width > <nl> - < height > 40 < / height > <nl> - < / size > <nl> - < / property > <nl> - < / spacer > <nl> + < layout class = " QVBoxLayout " name = " verticalLayout_3 " > <nl> + < item > <nl> + < widget class = " QFrame " name = " frame_2 " > <nl> + < property name = " frameShape " > <nl> + < enum > QFrame : : StyledPanel < / enum > <nl> + < / property > <nl> + < property name = " frameShadow " > <nl> + < enum > QFrame : : Raised < / enum > <nl> + < / property > <nl> + < layout class = " QVBoxLayout " name = " verticalLayout " > <nl> + < item > <nl> + < widget class = " QLabel " name = " label_4 " > <nl> + < property name = " text " > <nl> + < string > & lt ; b & gt ; Recent transactions & lt ; / b & gt ; < / string > <nl> + < / property > <nl> + < / widget > <nl> + < / item > <nl> + < item > <nl> + < widget class = " QListView " name = " listTransactions " > <nl> + < property name = " frameShape " > <nl> + < enum > QFrame : : NoFrame < / enum > <nl> + < / property > <nl> + < property name = " verticalScrollBarPolicy " > <nl> + < enum > Qt : : ScrollBarAlwaysOff < / enum > <nl> + < / property > <nl> + < property name = " horizontalScrollBarPolicy " > <nl> + < enum > Qt : : ScrollBarAlwaysOff < / enum > <nl> + < / property > <nl> + < / widget > <nl> + < / item > <nl> + < / layout > <nl> + < / widget > <nl> + < / item > <nl> + < item > <nl> + < spacer name = " verticalSpacer_2 " > <nl> + < property name = " orientation " > <nl> + < enum > Qt : : Vertical < / enum > <nl> + < / property > <nl> + < property name = " sizeHint " stdset = " 0 " > <nl> + < size > <nl> + < width > 20 < / width > <nl> + < height > 40 < / height > <nl> + < / size > <nl> + < / property > <nl> + < / spacer > <nl> + < / item > <nl> + < / layout > <nl> < / item > <nl> < / layout > <nl> < / widget > <nl> mmm a / src / qt / guiutil . cpp <nl> ppp b / src / qt / guiutil . cpp <nl> <nl> <nl> QString GUIUtil : : DateTimeStr ( qint64 nTime ) <nl> { <nl> - QDateTime date = QDateTime : : fromTime_t ( ( qint32 ) nTime ) ; <nl> + return DateTimeStr ( QDateTime : : fromTime_t ( ( qint32 ) nTime ) ) ; <nl> + } <nl> + <nl> + QString GUIUtil : : DateTimeStr ( const QDateTime & date ) <nl> + { <nl> return date . date ( ) . toString ( Qt : : SystemLocaleShortDate ) + QString ( " " ) + date . toString ( " hh : mm " ) ; <nl> } <nl> <nl> mmm a / src / qt / guiutil . h <nl> ppp b / src / qt / guiutil . h <nl> QT_BEGIN_NAMESPACE <nl> class QFont ; <nl> class QLineEdit ; <nl> class QWidget ; <nl> + class QDateTime ; <nl> QT_END_NAMESPACE <nl> <nl> class GUIUtil <nl> { <nl> public : <nl> static QString DateTimeStr ( qint64 nTime ) ; <nl> + static QString DateTimeStr ( const QDateTime & datetime ) ; <nl> <nl> / / Render bitcoin addresses in monospace font <nl> static QFont bitcoinAddressFont ( ) ; <nl> mmm a / src / qt / overviewpage . cpp <nl> ppp b / src / qt / overviewpage . cpp <nl> <nl> # include " walletmodel . h " <nl> # include " bitcoinunits . h " <nl> # include " optionsmodel . h " <nl> + # include " transactiontablemodel . h " <nl> + # include " transactionfilterproxy . h " <nl> + # include " guiutil . h " <nl> + # include " guiconstants . h " <nl> <nl> # include < QDebug > <nl> + # include < QItemDelegate > <nl> + # include < QPainter > <nl> + <nl> + # define DECORATION_SIZE 64 <nl> + class TxViewDelegate : public QItemDelegate <nl> + { <nl> + / / Q_OBJECT <nl> + public : <nl> + TxViewDelegate ( ) : QItemDelegate ( ) , unit ( BitcoinUnits : : BTC ) <nl> + { <nl> + <nl> + } <nl> + <nl> + inline void paint ( QPainter * painter , const QStyleOptionViewItem & option , <nl> + const QModelIndex & index ) const <nl> + { <nl> + / / QItemDelegate : : paint ( painter , option , index ) ; <nl> + painter - > save ( ) ; <nl> + <nl> + QIcon icon = qvariant_cast < QIcon > ( index . data ( Qt : : DecorationRole ) ) ; <nl> + QRect mainRect = option . rect ; <nl> + QRect decorationRect ( mainRect . topLeft ( ) , QSize ( DECORATION_SIZE , DECORATION_SIZE ) ) ; <nl> + int xspace = DECORATION_SIZE + 8 ; <nl> + int ypad = 6 ; <nl> + int halfheight = ( mainRect . height ( ) - 2 * ypad ) / 2 ; <nl> + QRect amountRect ( mainRect . left ( ) + xspace , mainRect . top ( ) + ypad , mainRect . width ( ) - xspace , halfheight ) ; <nl> + QRect addressRect ( mainRect . left ( ) + xspace , mainRect . top ( ) + ypad + halfheight , mainRect . width ( ) - xspace , halfheight ) ; <nl> + icon . paint ( painter , decorationRect ) ; <nl> + <nl> + QDateTime date = index . data ( TransactionTableModel : : DateRole ) . toDateTime ( ) ; <nl> + QString address = index . data ( Qt : : DisplayRole ) . toString ( ) ; <nl> + qint64 amount = index . data ( TransactionTableModel : : AmountRole ) . toLongLong ( ) ; <nl> + bool confirmed = index . data ( TransactionTableModel : : ConfirmedRole ) . toBool ( ) ; <nl> + QVariant value = index . data ( Qt : : ForegroundRole ) ; <nl> + QColor foreground = option . palette . color ( QPalette : : Text ) ; <nl> + if ( qVariantCanConvert < QColor > ( value ) ) <nl> + { <nl> + foreground = qvariant_cast < QColor > ( value ) ; <nl> + } <nl> + <nl> + painter - > setPen ( foreground ) ; <nl> + painter - > drawText ( addressRect , Qt : : AlignLeft | Qt : : AlignVCenter , address ) ; <nl> + <nl> + if ( amount < 0 ) <nl> + { <nl> + foreground = COLOR_NEGATIVE ; <nl> + } <nl> + else <nl> + { <nl> + foreground = option . palette . color ( QPalette : : Text ) ; <nl> + } <nl> + painter - > setPen ( foreground ) ; <nl> + QString amountText = BitcoinUnits : : formatWithUnit ( unit , amount , true ) ; <nl> + if ( ! confirmed ) <nl> + { <nl> + amountText = QString ( " [ " ) + amountText + QString ( " ] " ) ; <nl> + } <nl> + painter - > drawText ( amountRect , Qt : : AlignRight | Qt : : AlignVCenter , amountText ) ; <nl> + <nl> + painter - > setPen ( option . palette . color ( QPalette : : Text ) ) ; <nl> + painter - > drawText ( amountRect , Qt : : AlignLeft | Qt : : AlignVCenter , GUIUtil : : DateTimeStr ( date ) ) ; <nl> + <nl> + painter - > restore ( ) ; <nl> + } <nl> + <nl> + int unit ; <nl> + <nl> + } ; <nl> <nl> OverviewPage : : OverviewPage ( QWidget * parent ) : <nl> QWidget ( parent ) , <nl> ui ( new Ui : : OverviewPage ) , <nl> currentBalance ( - 1 ) , <nl> - currentUnconfirmedBalance ( - 1 ) <nl> + currentUnconfirmedBalance ( - 1 ) , <nl> + txdelegate ( new TxViewDelegate ( ) ) <nl> { <nl> ui - > setupUi ( this ) ; <nl> <nl> OverviewPage : : OverviewPage ( QWidget * parent ) : <nl> <nl> ui - > labelNumTransactions - > setToolTip ( tr ( " Total number of transactions in wallet " ) ) ; <nl> <nl> - / / Overview page should show : <nl> - / / Last received transaction ( s ) <nl> - / / Last sent transaction ( s ) <nl> + / / Recent transactions <nl> + ui - > listTransactions - > setStyleSheet ( " background : transparent " ) ; <nl> + ui - > listTransactions - > setItemDelegate ( txdelegate ) ; <nl> + ui - > listTransactions - > setIconSize ( QSize ( DECORATION_SIZE , DECORATION_SIZE ) ) ; <nl> + ui - > listTransactions - > setSelectionMode ( QAbstractItemView : : NoSelection ) ; <nl> } <nl> <nl> OverviewPage : : ~ OverviewPage ( ) <nl> void OverviewPage : : setModel ( WalletModel * model ) <nl> { <nl> this - > model = model ; <nl> <nl> + / / Set up transaction list <nl> + <nl> + TransactionFilterProxy * filter = new TransactionFilterProxy ( ) ; <nl> + filter - > setSourceModel ( model - > getTransactionTableModel ( ) ) ; <nl> + filter - > setLimit ( 3 ) ; <nl> + filter - > setDynamicSortFilter ( true ) ; <nl> + filter - > setSortRole ( Qt : : EditRole ) ; <nl> + filter - > sort ( TransactionTableModel : : Status , Qt : : DescendingOrder ) ; <nl> + <nl> + ui - > listTransactions - > setModel ( filter ) ; <nl> + ui - > listTransactions - > setModelColumn ( TransactionTableModel : : ToAddress ) ; <nl> + <nl> / / Keep up to date with wallet <nl> setBalance ( model - > getBalance ( ) , model - > getUnconfirmedBalance ( ) ) ; <nl> connect ( model , SIGNAL ( balanceChanged ( qint64 , qint64 ) ) , this , SLOT ( setBalance ( qint64 , qint64 ) ) ) ; <nl> void OverviewPage : : displayUnitChanged ( ) <nl> { <nl> if ( currentBalance ! = - 1 ) <nl> setBalance ( currentBalance , currentUnconfirmedBalance ) ; <nl> + <nl> + txdelegate - > unit = model - > getOptionsModel ( ) - > getDisplayUnit ( ) ; <nl> + ui - > listTransactions - > update ( ) ; <nl> } <nl> mmm a / src / qt / overviewpage . h <nl> ppp b / src / qt / overviewpage . h <nl> namespace Ui { <nl> class OverviewPage ; <nl> } <nl> class WalletModel ; <nl> + class TxViewDelegate ; <nl> <nl> class OverviewPage : public QWidget <nl> { <nl> public slots : <nl> qint64 currentBalance ; <nl> qint64 currentUnconfirmedBalance ; <nl> <nl> + TxViewDelegate * txdelegate ; <nl> + <nl> private slots : <nl> void displayUnitChanged ( ) ; <nl> } ; <nl> Binary files a / src / qt / res / icons / tx_inout . png and b / src / qt / res / icons / tx_inout . png differ <nl> Binary files a / src / qt / res / icons / tx_input . png and b / src / qt / res / icons / tx_input . png differ <nl> Binary files a / src / qt / res / icons / tx_mined . png and b / src / qt / res / icons / tx_mined . png differ <nl> Binary files a / src / qt / res / icons / tx_output . png and b / src / qt / res / icons / tx_output . png differ <nl> mmm a / src / qt / transactionfilterproxy . cpp <nl> ppp b / src / qt / transactionfilterproxy . cpp <nl> TransactionFilterProxy : : TransactionFilterProxy ( QObject * parent ) : <nl> dateTo ( MAX_DATE ) , <nl> addrPrefix ( ) , <nl> typeFilter ( ALL_TYPES ) , <nl> - minAmount ( 0 ) <nl> + minAmount ( 0 ) , <nl> + limitRows ( - 1 ) <nl> { <nl> } <nl> <nl> void TransactionFilterProxy : : setMinAmount ( qint64 minimum ) <nl> this - > minAmount = minimum ; <nl> invalidateFilter ( ) ; <nl> } <nl> + <nl> + void TransactionFilterProxy : : setLimit ( int limit ) <nl> + { <nl> + this - > limitRows = limit ; <nl> + } <nl> + <nl> + int TransactionFilterProxy : : rowCount ( const QModelIndex & parent ) const <nl> + { <nl> + if ( limitRows ! = - 1 ) <nl> + { <nl> + return std : : min ( QSortFilterProxyModel : : rowCount ( parent ) , limitRows ) ; <nl> + } <nl> + else <nl> + { <nl> + return QSortFilterProxyModel : : rowCount ( parent ) ; <nl> + } <nl> + } <nl> mmm a / src / qt / transactionfilterproxy . h <nl> ppp b / src / qt / transactionfilterproxy . h <nl> class TransactionFilterProxy : public QSortFilterProxyModel <nl> void setTypeFilter ( quint32 modes ) ; <nl> void setMinAmount ( qint64 minimum ) ; <nl> <nl> + / / Set maximum number of rows returned , - 1 if unlimited <nl> + void setLimit ( int limit ) ; <nl> + <nl> + int rowCount ( const QModelIndex & parent = QModelIndex ( ) ) const ; <nl> protected : <nl> bool filterAcceptsRow ( int source_row , const QModelIndex & source_parent ) const ; <nl> <nl> class TransactionFilterProxy : public QSortFilterProxyModel <nl> QString addrPrefix ; <nl> quint32 typeFilter ; <nl> qint64 minAmount ; <nl> + int limitRows ; <nl> <nl> signals : <nl> <nl> mmm a / src / qt / transactiontablemodel . cpp <nl> ppp b / src / qt / transactiontablemodel . cpp <nl> QVariant TransactionTableModel : : data ( const QModelIndex & index , int role ) const <nl> { <nl> return llabs ( rec - > credit + rec - > debit ) ; <nl> } <nl> + else if ( role = = AmountRole ) <nl> + { <nl> + return rec - > credit + rec - > debit ; <nl> + } <nl> else if ( role = = TxIDRole ) <nl> { <nl> return QString : : fromStdString ( rec - > getTxID ( ) ) ; <nl> mmm a / src / qt / transactiontablemodel . h <nl> ppp b / src / qt / transactiontablemodel . h <nl> class TransactionTableModel : public QAbstractTableModel <nl> LabelRole , <nl> / / Absolute net amount of transaction , for filtering <nl> AbsoluteAmountRole , <nl> + / / Net amount of transaction <nl> + AmountRole , <nl> / / Unique identifier <nl> TxIDRole , <nl> / / Is transaction confirmed ? <nl> | show last few transactions on overview page | bitcoin/bitcoin | a99ac8d3f483d8a839ea3c4e0f400eaa64338acd | 2011-08-03T18:52:18Z |
mmm a / src / common / logging / backend . cpp <nl> ppp b / src / common / logging / backend . cpp <nl> namespace Log { <nl> CLS ( Kernel ) \ <nl> SUB ( Kernel , SVC ) \ <nl> CLS ( Service ) \ <nl> - SUB ( Service , SRV ) \ <nl> + SUB ( Service , SM ) \ <nl> SUB ( Service , FS ) \ <nl> SUB ( Service , GSP ) \ <nl> SUB ( Service , CFG ) \ <nl> mmm a / src / common / logging / log . h <nl> ppp b / src / common / logging / log . h <nl> enum class Class : ClassType { <nl> Kernel_SVC , / / / < Kernel system calls <nl> Service , / / / < HLE implementation of system services . Each major service <nl> / / / should have its own subclass . <nl> - Service_SRV , / / / < The SRV ( Service Directory ) implementation <nl> + Service_SM , / / / < The SRV ( Service Directory ) implementation <nl> Service_FS , / / / < The FS ( Filesystem ) service implementation <nl> Service_GSP , / / / < The GSP ( GPU control ) service <nl> Service_CFG , / / / < The CFG ( Configuration ) service <nl> mmm a / src / core / CMakeLists . txt <nl> ppp b / src / core / CMakeLists . txt <nl> set ( SRCS <nl> hle / service / dsp_dsp . cpp <nl> hle / service / gsp_gpu . cpp <nl> hle / service / hid / hid . cpp <nl> + hle / service / lm / lm . cpp <nl> hle / service / service . cpp <nl> + hle / service / sm / controller . cpp <nl> hle / service / sm / sm . cpp <nl> - hle / service / sm / srv . cpp <nl> hle / shared_page . cpp <nl> hle / svc . cpp <nl> hw / aes / arithmetic128 . cpp <nl> set ( HEADERS <nl> hle / service / dsp_dsp . h <nl> hle / service / gsp_gpu . h <nl> hle / service / hid / hid . h <nl> + hle / service / lm / lm . h <nl> hle / service / service . h <nl> + hle / service / sm / controller . h <nl> hle / service / sm / sm . h <nl> - hle / service / sm / srv . h <nl> hle / shared_page . h <nl> hle / svc . h <nl> hw / aes / arithmetic128 . h <nl> mmm a / src / core / hle / ipc . h <nl> ppp b / src / core / hle / ipc . h <nl> <nl> # pragma once <nl> <nl> # include " common / common_types . h " <nl> + # include " common / swap . h " <nl> # include " core / hle / kernel / errors . h " <nl> - # include " core / hle / kernel / thread . h " <nl> # include " core / memory . h " <nl> <nl> - namespace Kernel { <nl> - <nl> - / / / Offset into command buffer of header <nl> - static const int kCommandHeaderOffset = 0x80 ; <nl> - <nl> - / * * <nl> - * Returns a pointer to the command buffer in the current thread ' s TLS <nl> - * TODO ( Subv ) : This is not entirely correct , the command buffer should be copied from <nl> - * the thread ' s TLS to an intermediate buffer in kernel memory , and then copied again to <nl> - * the service handler process ' memory . <nl> - * @ param offset Optional offset into command buffer <nl> - * @ param offset Optional offset into command buffer ( in bytes ) <nl> - * @ return Pointer to command buffer <nl> - * / <nl> - inline u32 * GetCommandBuffer ( const int offset = 0 ) { <nl> - return ( u32 * ) Memory : : GetPointer ( GetCurrentThread ( ) - > GetTLSAddress ( ) + kCommandHeaderOffset + <nl> - offset ) ; <nl> - } <nl> - <nl> - / / / Offset into static buffers , relative to command buffer header <nl> - static const int kStaticBuffersOffset = 0x100 ; <nl> - <nl> - / * * <nl> - * Returns a pointer to the static buffers area in the current thread ' s TLS <nl> - * TODO ( Subv ) : cf . GetCommandBuffer <nl> - * @ param offset Optional offset into static buffers area ( in bytes ) <nl> - * @ return Pointer to static buffers area <nl> - * / <nl> - inline u32 * GetStaticBuffers ( const int offset = 0 ) { <nl> - return GetCommandBuffer ( kStaticBuffersOffset + offset ) ; <nl> - } <nl> - } <nl> - <nl> namespace IPC { <nl> <nl> / / / Size of the command buffer area , in 32 - bit words . <nl> constexpr size_t COMMAND_BUFFER_LENGTH = 0x100 / sizeof ( u32 ) ; <nl> using Kernel : : ERR_INVALID_BUFFER_DESCRIPTOR ; <nl> constexpr auto ERR_INVALID_HANDLE = Kernel : : ERR_INVALID_HANDLE_OS ; <nl> <nl> + <nl> + enum class ControlCommand : u32 { <nl> + ConvertSessionToDomain = 0 , <nl> + ConvertDomainToSession = 1 , <nl> + DuplicateSession = 2 , <nl> + QueryPointerBufferSize = 3 , <nl> + DuplicateSessionEx = 4 , <nl> + Unspecified , <nl> + } ; <nl> + <nl> + enum class CommandType : u32 { <nl> + Close = 2 , <nl> + Request = 4 , <nl> + Control = 5 , <nl> + Unspecified , <nl> + } ; <nl> + <nl> + struct CommandHeader { <nl> + union { <nl> + u32_le raw_low ; <nl> + BitField < 0 , 16 , CommandType > type ; <nl> + BitField < 16 , 4 , u32_le > num_buf_x_descriptors ; <nl> + BitField < 20 , 4 , u32_le > num_buf_a_descriptors ; <nl> + BitField < 24 , 4 , u32_le > num_buf_b_descriptors ; <nl> + BitField < 28 , 4 , u32_le > num_buf_w_descriptors ; <nl> + } ; <nl> + <nl> + enum class BufferDescriptorCFlag : u32 { <nl> + Disabled = 0 , <nl> + NoDescriptor = 1 , <nl> + TwoDesciptors = 2 , <nl> + } ; <nl> + <nl> + union { <nl> + u32_le raw_high ; <nl> + BitField < 0 , 10 , u32_le > data_size ; <nl> + BitField < 10 , 4 , BufferDescriptorCFlag > buf_c_descriptor_flags ; <nl> + BitField < 31 , 1 , u32_le > enable_handle_descriptor ; <nl> + } ; <nl> + } ; <nl> + static_assert ( sizeof ( CommandHeader ) = = 8 , " CommandHeader size is incorrect " ) ; <nl> + <nl> + union HandleDescriptorHeader { <nl> + u32_le raw_high ; <nl> + BitField < 0 , 1 , u32_le > send_current_pid ; <nl> + BitField < 1 , 4 , u32_le > num_handles_to_copy ; <nl> + BitField < 5 , 4 , u32_le > num_handles_to_move ; <nl> + } ; <nl> + static_assert ( sizeof ( HandleDescriptorHeader ) = = 4 , " HandleDescriptorHeader size is incorrect " ) ; <nl> + <nl> + struct BufferDescriptorX { <nl> + union { <nl> + BitField < 0 , 6 , u32_le > counter_bits_0_5 ; <nl> + BitField < 6 , 3 , u32_le > address_bits_36_38 ; <nl> + BitField < 9 , 3 , u32_le > counter_bits_9_11 ; <nl> + BitField < 12 , 4 , u32_le > address_bits_32_35 ; <nl> + BitField < 16 , 16 , u32_le > size ; <nl> + } ; <nl> + <nl> + u32_le address_bits_0_31 ; <nl> + <nl> + u32_le Counter ( ) const { <nl> + u32_le counter { counter_bits_0_5 } ; <nl> + counter | = counter_bits_9_11 < < 9 ; <nl> + return counter ; <nl> + } <nl> + <nl> + VAddr Address ( ) const { <nl> + VAddr address { address_bits_0_31 } ; <nl> + address | = static_cast < VAddr > ( address_bits_32_35 ) < < 32 ; <nl> + address | = static_cast < VAddr > ( address_bits_36_38 ) < < 36 ; <nl> + return address ; <nl> + } <nl> + } ; <nl> + static_assert ( sizeof ( BufferDescriptorX ) = = 8 , " BufferDescriptorX size is incorrect " ) ; <nl> + <nl> + struct BufferDescriptorABW { <nl> + u32_le size_bits_0_31 ; <nl> + u32_le address_bits_0_31 ; <nl> + <nl> + union { <nl> + BitField < 0 , 2 , u32_le > flags ; <nl> + BitField < 2 , 3 , u32_le > address_bits_36_38 ; <nl> + BitField < 24 , 4 , u32_le > size_bits_32_35 ; <nl> + BitField < 28 , 4 , u32_le > address_bits_32_35 ; <nl> + } ; <nl> + <nl> + VAddr Address ( ) const { <nl> + VAddr address { address_bits_0_31 } ; <nl> + address | = static_cast < VAddr > ( address_bits_32_35 ) < < 32 ; <nl> + address | = static_cast < VAddr > ( address_bits_36_38 ) < < 36 ; <nl> + return address ; <nl> + } <nl> + <nl> + u64 Size ( ) const { <nl> + u64 size { size_bits_0_31 } ; <nl> + size | = static_cast < u64 > ( size_bits_32_35 ) < < 32 ; <nl> + return size ; <nl> + } <nl> + } ; <nl> + static_assert ( sizeof ( BufferDescriptorABW ) = = 12 , " BufferDescriptorABW size is incorrect " ) ; <nl> + <nl> + struct BufferDescriptorC { <nl> + u32_le address_bits_0_31 ; <nl> + <nl> + union { <nl> + BitField < 0 , 16 , u32_le > address_bits_32_47 ; <nl> + BitField < 16 , 16 , u32_le > size ; <nl> + } ; <nl> + <nl> + VAddr Address ( ) const { <nl> + VAddr address { address_bits_0_31 } ; <nl> + address | = static_cast < VAddr > ( address_bits_32_47 ) < < 32 ; <nl> + return address ; <nl> + } <nl> + } ; <nl> + static_assert ( sizeof ( BufferDescriptorC ) = = 8 , " BufferDescriptorC size is incorrect " ) ; <nl> + <nl> + struct DataPayloadHeader { <nl> + u32_le magic ; <nl> + INSERT_PADDING_WORDS ( 1 ) ; <nl> + } ; <nl> + static_assert ( sizeof ( DataPayloadHeader ) = = 8 , " DataPayloadRequest size is incorrect " ) ; <nl> + <nl> enum DescriptorType : u32 { <nl> / / Buffer related desciptors types ( mask : 0x0F ) <nl> StaticBuffer = 0x02 , <nl> enum DescriptorType : u32 { <nl> CallingPid = 0x20 , <nl> } ; <nl> <nl> - union Header { <nl> - u32 raw ; <nl> - BitField < 0 , 6 , u32 > translate_params_size ; <nl> - BitField < 6 , 6 , u32 > normal_params_size ; <nl> - BitField < 16 , 16 , u32 > command_id ; <nl> - } ; <nl> - <nl> - / * * <nl> - * @ brief Creates a command header to be used for IPC <nl> - * @ param command_id ID of the command to create a header for . <nl> - * @ param normal_params_size Size of the normal parameters in words . Up to 63 . <nl> - * @ param translate_params_size Size of the translate parameters in words . Up to 63 . <nl> - * @ return The created IPC header . <nl> - * <nl> - * Normal parameters are sent directly to the process while the translate parameters might go <nl> - * through modifications and checks by the kernel . <nl> - * The translate parameters are described by headers generated with the IPC : : * Desc functions . <nl> - * <nl> - * @ note While @ p normal_params_size is equivalent to the number of normal parameters , <nl> - * @ p translate_params_size includes the size occupied by the translate parameters headers . <nl> - * / <nl> - inline u32 MakeHeader ( u16 command_id , unsigned int normal_params_size , <nl> - unsigned int translate_params_size ) { <nl> - Header header { } ; <nl> - header . command_id . Assign ( command_id ) ; <nl> - header . normal_params_size . Assign ( normal_params_size ) ; <nl> - header . translate_params_size . Assign ( translate_params_size ) ; <nl> - return header . raw ; <nl> - } <nl> - <nl> constexpr u32 MoveHandleDesc ( u32 num_handles = 1 ) { <nl> return MoveHandle | ( ( num_handles - 1 ) < < 26 ) ; <nl> } <nl> mmm a / src / core / hle / ipc_helpers . h <nl> ppp b / src / core / hle / ipc_helpers . h <nl> class RequestHelperBase { <nl> protected : <nl> Kernel : : HLERequestContext * context = nullptr ; <nl> u32 * cmdbuf ; <nl> - ptrdiff_t index = 1 ; <nl> - Header header ; <nl> + ptrdiff_t index = 0 ; <nl> <nl> public : <nl> - RequestHelperBase ( Kernel : : HLERequestContext & context , Header desired_header ) <nl> - : context ( & context ) , cmdbuf ( context . CommandBuffer ( ) ) , header ( desired_header ) { } <nl> + RequestHelperBase ( u32 * command_buffer ) : cmdbuf ( command_buffer ) { } <nl> <nl> - RequestHelperBase ( u32 * command_buffer , Header command_header ) <nl> - : cmdbuf ( command_buffer ) , header ( command_header ) { } <nl> - <nl> - / / / Returns the total size of the request in words <nl> - size_t TotalSize ( ) const { <nl> - return 1 / * command header * / + header . normal_params_size + header . translate_params_size ; <nl> - } <nl> + RequestHelperBase ( Kernel : : HLERequestContext & context ) <nl> + : context ( & context ) , cmdbuf ( context . CommandBuffer ( ) ) { } <nl> <nl> void ValidateHeader ( ) { <nl> - DEBUG_ASSERT_MSG ( index = = TotalSize ( ) , " Operations do not match the header ( cmd 0x % x ) " , <nl> - header . raw ) ; <nl> + / / DEBUG_ASSERT_MSG ( index = = TotalSize ( ) , " Operations do not match the header ( cmd 0x % x ) " , <nl> + / / header . raw ) ; <nl> } <nl> <nl> void Skip ( unsigned size_in_words , bool set_to_null ) { <nl> class RequestHelperBase { <nl> } <nl> <nl> / * * <nl> - * @ brief Retrieves the address of a static buffer , used when a buffer is needed for output <nl> - * @ param buffer_id The index of the static buffer <nl> - * @ param data_size If non - null , will store the size of the buffer <nl> + * Aligns the current position forward to a 16 - byte boundary , padding with zeros . Jumps forward <nl> + * by 16 - bytes at a minimum . <nl> * / <nl> - VAddr PeekStaticBuffer ( u8 buffer_id , size_t * data_size = nullptr ) const { <nl> - u32 * static_buffer = cmdbuf + Kernel : : kStaticBuffersOffset / sizeof ( u32 ) + buffer_id * 2 ; <nl> - if ( data_size ) <nl> - * data_size = StaticBufferDescInfo { static_buffer [ 0 ] } . size ; <nl> - return static_buffer [ 1 ] ; <nl> + void AlignWithPadding ( ) { <nl> + Skip ( 4 - ( index & 3 ) , true ) ; <nl> + } <nl> + <nl> + unsigned GetCurrentOffset ( ) const { <nl> + return static_cast < unsigned > ( index ) ; <nl> } <nl> } ; <nl> <nl> class RequestBuilder : public RequestHelperBase { <nl> public : <nl> - RequestBuilder ( Kernel : : HLERequestContext & context , Header command_header ) <nl> - : RequestHelperBase ( context , command_header ) { <nl> - / / From this point we will start overwriting the existing command buffer , so it ' s safe to <nl> - / / release all previous incoming Object pointers since they won ' t be usable anymore . <nl> - context . ClearIncomingObjects ( ) ; <nl> - cmdbuf [ 0 ] = header . raw ; <nl> - } <nl> - <nl> - RequestBuilder ( Kernel : : HLERequestContext & context , u16 command_id , unsigned normal_params_size , <nl> - unsigned translate_params_size ) <nl> - : RequestBuilder ( <nl> - context , Header { MakeHeader ( command_id , normal_params_size , translate_params_size ) } ) { } <nl> + RequestBuilder ( u32 * command_buffer ) : RequestHelperBase ( command_buffer ) { } <nl> <nl> - RequestBuilder ( u32 * command_buffer , Header command_header ) <nl> - : RequestHelperBase ( command_buffer , command_header ) { <nl> - cmdbuf [ 0 ] = header . raw ; <nl> - } <nl> + RequestBuilder ( Kernel : : HLERequestContext & context , unsigned normal_params_size , <nl> + u32 num_handles_to_copy = 0 , u32 num_handles_to_move = 0 ) <nl> + : RequestHelperBase ( context ) { <nl> + memset ( cmdbuf , 0 , 64 ) ; <nl> <nl> - explicit RequestBuilder ( u32 * command_buffer , u32 command_header ) <nl> - : RequestBuilder ( command_buffer , Header { command_header } ) { } <nl> + context . ClearIncomingObjects ( ) ; <nl> <nl> - RequestBuilder ( u32 * command_buffer , u16 command_id , unsigned normal_params_size , <nl> - unsigned translate_params_size ) <nl> - : RequestBuilder ( command_buffer , <nl> - MakeHeader ( command_id , normal_params_size , translate_params_size ) ) { } <nl> + IPC : : CommandHeader header { } ; <nl> + header . data_size . Assign ( normal_params_size * sizeof ( u32 ) ) ; <nl> + if ( num_handles_to_copy | | num_handles_to_move ) { <nl> + header . enable_handle_descriptor . Assign ( 1 ) ; <nl> + } <nl> + PushRaw ( header ) ; <nl> + <nl> + if ( header . enable_handle_descriptor ) { <nl> + IPC : : HandleDescriptorHeader handle_descriptor_header { } ; <nl> + handle_descriptor_header . num_handles_to_copy . Assign ( num_handles_to_copy ) ; <nl> + handle_descriptor_header . num_handles_to_move . Assign ( num_handles_to_move ) ; <nl> + PushRaw ( handle_descriptor_header ) ; <nl> + Skip ( num_handles_to_copy + num_handles_to_move , true ) ; <nl> + } <nl> + <nl> + AlignWithPadding ( ) ; <nl> + <nl> + IPC : : DataPayloadHeader data_payload_header { } ; <nl> + data_payload_header . magic = 0x4f434653 ; <nl> + PushRaw ( data_payload_header ) ; <nl> + } <nl> <nl> / / Validate on destruction , as there shouldn ' t be any case where we don ' t want it <nl> ~ RequestBuilder ( ) { <nl> inline void RequestBuilder : : Push ( u32 value ) { <nl> <nl> template < typename T > <nl> void RequestBuilder : : PushRaw ( const T & value ) { <nl> - static_assert ( std : : is_trivially_copyable < T > ( ) , " Raw types should be trivially copyable " ) ; <nl> std : : memcpy ( cmdbuf + index , & value , sizeof ( T ) ) ; <nl> index + = ( sizeof ( T ) + 3 ) / 4 ; / / round up to word length <nl> } <nl> inline void RequestBuilder : : PushMappedBuffer ( VAddr buffer_vaddr , size_t size , <nl> <nl> class RequestParser : public RequestHelperBase { <nl> public : <nl> - RequestParser ( Kernel : : HLERequestContext & context , Header desired_header ) <nl> - : RequestHelperBase ( context , desired_header ) { } <nl> + RequestParser ( u32 * command_buffer ) : RequestHelperBase ( command_buffer ) { } <nl> <nl> - RequestParser ( Kernel : : HLERequestContext & context , u16 command_id , unsigned normal_params_size , <nl> - unsigned translate_params_size ) <nl> - : RequestParser ( context , <nl> - Header { MakeHeader ( command_id , normal_params_size , translate_params_size ) } ) { <nl> + RequestParser ( Kernel : : HLERequestContext & context ) : RequestHelperBase ( context ) { <nl> + ASSERT_MSG ( context . GetDataPayloadOffset ( ) , " context is incomplete " ) ; <nl> + Skip ( context . GetDataPayloadOffset ( ) , false ) ; <nl> } <nl> <nl> - RequestParser ( u32 * command_buffer , Header command_header ) <nl> - : RequestHelperBase ( command_buffer , command_header ) { } <nl> - <nl> - explicit RequestParser ( u32 * command_buffer , u32 command_header ) <nl> - : RequestParser ( command_buffer , Header { command_header } ) { } <nl> - <nl> - RequestParser ( u32 * command_buffer , u16 command_id , unsigned normal_params_size , <nl> - unsigned translate_params_size ) <nl> - : RequestParser ( command_buffer , <nl> - MakeHeader ( command_id , normal_params_size , translate_params_size ) ) { } <nl> - <nl> - RequestBuilder MakeBuilder ( u32 normal_params_size , u32 translate_params_size , <nl> - bool validateHeader = true ) { <nl> - if ( validateHeader ) <nl> + RequestBuilder MakeBuilder ( u32 normal_params_size , u32 num_handles_to_copy , <nl> + u32 num_handles_to_move , bool validate_header = true ) { <nl> + if ( validate_header ) { <nl> ValidateHeader ( ) ; <nl> - Header builderHeader { MakeHeader ( static_cast < u16 > ( header . command_id ) , normal_params_size , <nl> - translate_params_size ) } ; <nl> - if ( context ! = nullptr ) <nl> - return { * context , builderHeader } ; <nl> - else <nl> - return { cmdbuf , builderHeader } ; <nl> + } <nl> + <nl> + return { * context , normal_params_size , num_handles_to_copy , num_handles_to_move } ; <nl> } <nl> <nl> template < typename T > <nl> inline u32 RequestParser : : Pop ( ) { <nl> <nl> template < typename T > <nl> void RequestParser : : PopRaw ( T & value ) { <nl> - static_assert ( std : : is_trivially_copyable < T > ( ) , " Raw types should be trivially copyable " ) ; <nl> std : : memcpy ( & value , cmdbuf + index , sizeof ( T ) ) ; <nl> index + = ( sizeof ( T ) + 3 ) / 4 ; / / round up to word length <nl> } <nl> mmm a / src / core / hle / kernel / hle_ipc . cpp <nl> ppp b / src / core / hle / kernel / hle_ipc . cpp <nl> <nl> # include < boost / range / algorithm_ext / erase . hpp > <nl> # include " common / assert . h " <nl> # include " common / common_types . h " <nl> + # include " core / hle / ipc_helpers . h " <nl> # include " core / hle / kernel / handle_table . h " <nl> # include " core / hle / kernel / hle_ipc . h " <nl> # include " core / hle / kernel / kernel . h " <nl> void HLERequestContext : : ClearIncomingObjects ( ) { <nl> request_handles . clear ( ) ; <nl> } <nl> <nl> - ResultCode HLERequestContext : : PopulateFromIncomingCommandBuffer ( const u32_le * src_cmdbuf , <nl> - Process & src_process , <nl> - HandleTable & src_table ) { <nl> - IPC : : Header header { src_cmdbuf [ 0 ] } ; <nl> + void HLERequestContext : : ParseCommandBuffer ( u32_le * src_cmdbuf ) { <nl> + IPC : : RequestParser rp ( src_cmdbuf ) ; <nl> + command_header = std : : make_unique < IPC : : CommandHeader > ( rp . PopRaw < IPC : : CommandHeader > ( ) ) ; <nl> <nl> - size_t untranslated_size = 1u + header . normal_params_size ; <nl> - size_t command_size = untranslated_size + header . translate_params_size ; <nl> - ASSERT ( command_size < = IPC : : COMMAND_BUFFER_LENGTH ) ; / / TODO ( yuriks ) : Return error <nl> + / / If handle descriptor is present , add size of it <nl> + if ( command_header - > enable_handle_descriptor ) { <nl> + handle_descriptor_header = <nl> + std : : make_unique < IPC : : HandleDescriptorHeader > ( rp . PopRaw < IPC : : HandleDescriptorHeader > ( ) ) ; <nl> + if ( handle_descriptor_header - > send_current_pid ) { <nl> + rp . Skip ( 2 , false ) ; <nl> + } <nl> + rp . Skip ( handle_descriptor_header - > num_handles_to_copy , false ) ; <nl> + rp . Skip ( handle_descriptor_header - > num_handles_to_move , false ) ; <nl> + } <nl> <nl> - std : : copy_n ( src_cmdbuf , untranslated_size , cmd_buf . begin ( ) ) ; <nl> + / / Padding to align to 16 bytes <nl> + rp . AlignWithPadding ( ) ; <nl> <nl> - size_t i = untranslated_size ; <nl> - while ( i < command_size ) { <nl> - u32 descriptor = cmd_buf [ i ] = src_cmdbuf [ i ] ; <nl> - i + = 1 ; <nl> - <nl> - switch ( IPC : : GetDescriptorType ( descriptor ) ) { <nl> - case IPC : : DescriptorType : : CopyHandle : <nl> - case IPC : : DescriptorType : : MoveHandle : { <nl> - u32 num_handles = IPC : : HandleNumberFromDesc ( descriptor ) ; <nl> - ASSERT ( i + num_handles < = command_size ) ; / / TODO ( yuriks ) : Return error <nl> - for ( u32 j = 0 ; j < num_handles ; + + j ) { <nl> - Handle handle = src_cmdbuf [ i ] ; <nl> - SharedPtr < Object > object = nullptr ; <nl> - if ( handle ! = 0 ) { <nl> - object = src_table . GetGeneric ( handle ) ; <nl> - ASSERT ( object ! = nullptr ) ; / / TODO ( yuriks ) : Return error <nl> - if ( descriptor = = IPC : : DescriptorType : : MoveHandle ) { <nl> - src_table . Close ( handle ) ; <nl> - } <nl> - } <nl> + if ( command_header - > num_buf_x_descriptors ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + if ( command_header - > num_buf_a_descriptors ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + if ( command_header - > num_buf_b_descriptors ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + if ( command_header - > num_buf_w_descriptors ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + if ( command_header - > buf_c_descriptor_flags ! = <nl> + IPC : : CommandHeader : : BufferDescriptorCFlag : : Disabled ) { <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> <nl> - cmd_buf [ i + + ] = AddOutgoingHandle ( std : : move ( object ) ) ; <nl> - } <nl> - break ; <nl> - } <nl> - case IPC : : DescriptorType : : CallingPid : { <nl> - cmd_buf [ i + + ] = src_process . process_id ; <nl> - break ; <nl> - } <nl> - default : <nl> - UNIMPLEMENTED_MSG ( " Unsupported handle translation : 0x % 08X " , descriptor ) ; <nl> + data_payload_header = <nl> + std : : make_unique < IPC : : DataPayloadHeader > ( rp . PopRaw < IPC : : DataPayloadHeader > ( ) ) ; <nl> + ASSERT ( data_payload_header - > magic = = 0x49434653 | | data_payload_header - > magic = = 0x4F434653 ) ; <nl> + <nl> + data_payload_offset = rp . GetCurrentOffset ( ) ; <nl> + command = rp . Pop < u32_le > ( ) ; <nl> + } <nl> + <nl> + ResultCode HLERequestContext : : PopulateFromIncomingCommandBuffer ( u32_le * src_cmdbuf , <nl> + Process & src_process , <nl> + HandleTable & src_table ) { <nl> + ParseCommandBuffer ( src_cmdbuf ) ; <nl> + size_t untranslated_size = data_payload_offset + command_header - > data_size ; <nl> + std : : copy_n ( src_cmdbuf , untranslated_size , cmd_buf . begin ( ) ) ; <nl> + <nl> + if ( command_header - > enable_handle_descriptor ) { <nl> + if ( handle_descriptor_header - > num_handles_to_copy | | <nl> + handle_descriptor_header - > num_handles_to_move ) { <nl> + UNIMPLEMENTED ( ) ; <nl> } <nl> } <nl> - <nl> return RESULT_SUCCESS ; <nl> } <nl> <nl> ResultCode HLERequestContext : : WriteToOutgoingCommandBuffer ( u32_le * dst_cmdbuf , Process & dst_process , <nl> - HandleTable & dst_table ) const { <nl> - IPC : : Header header { cmd_buf [ 0 ] } ; <nl> - <nl> - size_t untranslated_size = 1u + header . normal_params_size ; <nl> - size_t command_size = untranslated_size + header . translate_params_size ; <nl> - ASSERT ( command_size < = IPC : : COMMAND_BUFFER_LENGTH ) ; <nl> - <nl> + HandleTable & dst_table ) { <nl> + ParseCommandBuffer ( & cmd_buf [ 0 ] ) ; <nl> + size_t untranslated_size = data_payload_offset + command_header - > data_size ; <nl> std : : copy_n ( cmd_buf . begin ( ) , untranslated_size , dst_cmdbuf ) ; <nl> <nl> - size_t i = untranslated_size ; <nl> - while ( i < command_size ) { <nl> - u32 descriptor = dst_cmdbuf [ i ] = cmd_buf [ i ] ; <nl> - i + = 1 ; <nl> - <nl> - switch ( IPC : : GetDescriptorType ( descriptor ) ) { <nl> - case IPC : : DescriptorType : : CopyHandle : <nl> - case IPC : : DescriptorType : : MoveHandle : { <nl> - / / HLE services don ' t use handles , so we treat both CopyHandle and MoveHandle equally <nl> - u32 num_handles = IPC : : HandleNumberFromDesc ( descriptor ) ; <nl> - ASSERT ( i + num_handles < = command_size ) ; <nl> - for ( u32 j = 0 ; j < num_handles ; + + j ) { <nl> - SharedPtr < Object > object = GetIncomingHandle ( cmd_buf [ i ] ) ; <nl> - Handle handle = 0 ; <nl> - if ( object ! = nullptr ) { <nl> - / / TODO ( yuriks ) : Figure out the proper error handling for if this fails <nl> - handle = dst_table . Create ( object ) . Unwrap ( ) ; <nl> + if ( command_header - > enable_handle_descriptor ) { <nl> + size_t command_size = untranslated_size + handle_descriptor_header - > num_handles_to_copy + <nl> + handle_descriptor_header - > num_handles_to_move ; <nl> + ASSERT ( command_size < = IPC : : COMMAND_BUFFER_LENGTH ) ; <nl> + <nl> + size_t untranslated_index = untranslated_size ; <nl> + size_t handle_write_offset = 3 ; <nl> + while ( untranslated_index < command_size ) { <nl> + u32 descriptor = cmd_buf [ untranslated_index ] ; <nl> + untranslated_index + = 1 ; <nl> + <nl> + switch ( IPC : : GetDescriptorType ( descriptor ) ) { <nl> + case IPC : : DescriptorType : : CopyHandle : <nl> + case IPC : : DescriptorType : : MoveHandle : { <nl> + / / HLE services don ' t use handles , so we treat both CopyHandle and MoveHandle <nl> + / / equally <nl> + u32 num_handles = IPC : : HandleNumberFromDesc ( descriptor ) ; <nl> + for ( u32 j = 0 ; j < num_handles ; + + j ) { <nl> + SharedPtr < Object > object = GetIncomingHandle ( cmd_buf [ untranslated_index ] ) ; <nl> + Handle handle = 0 ; <nl> + if ( object ! = nullptr ) { <nl> + / / TODO ( yuriks ) : Figure out the proper error handling for if this fails <nl> + handle = dst_table . Create ( object ) . Unwrap ( ) ; <nl> + } <nl> + dst_cmdbuf [ handle_write_offset + + ] = handle ; <nl> + untranslated_index + + ; <nl> } <nl> - dst_cmdbuf [ i + + ] = handle ; <nl> + break ; <nl> + } <nl> + default : <nl> + UNIMPLEMENTED_MSG ( " Unsupported handle translation : 0x % 08X " , descriptor ) ; <nl> } <nl> - break ; <nl> - } <nl> - default : <nl> - UNIMPLEMENTED_MSG ( " Unsupported handle translation : 0x % 08X " , descriptor ) ; <nl> } <nl> } <nl> <nl> mmm a / src / core / hle / kernel / hle_ipc . h <nl> ppp b / src / core / hle / kernel / hle_ipc . h <nl> class HLERequestContext { <nl> * / <nl> void ClearIncomingObjects ( ) ; <nl> <nl> + void ParseCommandBuffer ( u32_le * src_cmdbuf ) ; <nl> + <nl> / / / Populates this context with data from the requesting process / thread . <nl> - ResultCode PopulateFromIncomingCommandBuffer ( const u32_le * src_cmdbuf , Process & src_process , <nl> + ResultCode PopulateFromIncomingCommandBuffer ( u32_le * src_cmdbuf , Process & src_process , <nl> HandleTable & src_table ) ; <nl> / / / Writes data from this context back to the requesting process / thread . <nl> ResultCode WriteToOutgoingCommandBuffer ( u32_le * dst_cmdbuf , Process & dst_process , <nl> - HandleTable & dst_table ) const ; <nl> + HandleTable & dst_table ) ; <nl> + <nl> + u32_le GetCommand ( ) const { <nl> + return command ; <nl> + } <nl> + <nl> + IPC : : CommandType GetCommandType ( ) const { <nl> + return command_header - > type ; <nl> + } <nl> + <nl> + unsigned GetDataPayloadOffset ( ) const { <nl> + return data_payload_offset ; <nl> + } <nl> <nl> private : <nl> std : : array < u32 , IPC : : COMMAND_BUFFER_LENGTH > cmd_buf ; <nl> SharedPtr < ServerSession > session ; <nl> / / TODO ( yuriks ) : Check common usage of this and optimize size accordingly <nl> boost : : container : : small_vector < SharedPtr < Object > , 8 > request_handles ; <nl> + <nl> + std : : unique_ptr < IPC : : CommandHeader > command_header ; <nl> + std : : unique_ptr < IPC : : HandleDescriptorHeader > handle_descriptor_header ; <nl> + std : : unique_ptr < IPC : : DataPayloadHeader > data_payload_header ; <nl> + <nl> + unsigned data_payload_offset { } ; <nl> + u32_le command { } ; <nl> } ; <nl> <nl> } / / namespace Kernel <nl> new file mode 100644 <nl> index 00000000000 . . 7296b531ba3 <nl> mmm / dev / null <nl> ppp b / src / core / hle / service / lm / lm . cpp <nl> <nl> + / / Copyright 2017 Citra Emulator Project <nl> + / / Licensed under GPLv2 or any later version <nl> + / / Refer to the license . txt file included . <nl> + <nl> + # include " common / logging / log . h " <nl> + # include " core / hle / ipc_helpers . h " <nl> + # include " core / hle / service / lm / lm . h " <nl> + <nl> + namespace Service { <nl> + namespace LM { <nl> + <nl> + void InstallInterfaces ( SM : : ServiceManager & service_manager ) { <nl> + std : : make_shared < LM > ( ) - > InstallAsService ( service_manager ) ; <nl> + } <nl> + <nl> + / * * <nl> + * SRV : : Initialize service function <nl> + * Inputs : <nl> + * 0 : 0x00000000 <nl> + * Outputs : <nl> + * 1 : ResultCode <nl> + * / <nl> + void LM : : Initialize ( Kernel : : HLERequestContext & ctx ) { <nl> + IPC : : RequestBuilder rb { ctx , 1 } ; <nl> + rb . Push ( RESULT_SUCCESS ) ; <nl> + LOG_WARNING ( Service_SM , " ( STUBBED ) called " ) ; <nl> + } <nl> + <nl> + LM : : LM ( ) : ServiceFramework ( " lm " ) { <nl> + static const FunctionInfo functions [ ] = { <nl> + { 0x00000000 , & LM : : Initialize , " Initialize " } , <nl> + { 0x00000001 , nullptr , " Unknown2 " } , <nl> + { 0x00000002 , nullptr , " Unknown3 " } , <nl> + { 0x00000003 , nullptr , " Unknown4 " } , <nl> + { 0x00000004 , nullptr , " Unknown5 " } , <nl> + } ; <nl> + RegisterHandlers ( functions ) ; <nl> + } <nl> + <nl> + LM : : ~ LM ( ) = default ; <nl> + <nl> + } / / namespace LM <nl> + } / / namespace Service <nl> new file mode 100644 <nl> index 00000000000 . . c497d82ebbd <nl> mmm / dev / null <nl> ppp b / src / core / hle / service / lm / lm . h <nl> <nl> + / / Copyright 2017 Citra Emulator Project <nl> + / / Licensed under GPLv2 or any later version <nl> + / / Refer to the license . txt file included . <nl> + <nl> + # pragma once <nl> + <nl> + # include " core / hle / service / service . h " <nl> + <nl> + namespace Service { <nl> + namespace LM { <nl> + <nl> + class LM final : public ServiceFramework < LM > { <nl> + public : <nl> + explicit LM ( ) ; <nl> + ~ LM ( ) ; <nl> + <nl> + private : <nl> + void Initialize ( Kernel : : HLERequestContext & ctx ) ; <nl> + } ; <nl> + <nl> + / / / Registers all LM services with the specified service manager . <nl> + void InstallInterfaces ( SM : : ServiceManager & service_manager ) ; <nl> + <nl> + } / / namespace LM <nl> + } / / namespace Service <nl> mmm a / src / core / hle / service / service . cpp <nl> ppp b / src / core / hle / service / service . cpp <nl> <nl> # include " common / logging / log . h " <nl> # include " common / string_util . h " <nl> # include " core / hle / ipc . h " <nl> + # include " core / hle / ipc_helpers . h " <nl> # include " core / hle / kernel / client_port . h " <nl> # include " core / hle / kernel / process . h " <nl> # include " core / hle / kernel / server_port . h " <nl> # include " core / hle / kernel / server_session . h " <nl> + # include " core / hle / kernel / thread . h " <nl> # include " core / hle / kernel / handle_table . h " <nl> # include " core / hle / service / dsp_dsp . h " <nl> # include " core / hle / service / gsp_gpu . h " <nl> # include " core / hle / service / hid / hid . h " <nl> + # include " core / hle / service / lm / lm . h " <nl> # include " core / hle / service / service . h " <nl> + # include " core / hle / service / sm / controller . h " <nl> # include " core / hle / service / sm / sm . h " <nl> - # include " core / hle / service / sm / srv . h " <nl> <nl> using Kernel : : ClientPort ; <nl> using Kernel : : ServerPort ; <nl> static std : : string MakeFunctionString ( const char * name , const char * port_name , <nl> return function_string ; <nl> } <nl> <nl> - Interface : : Interface ( u32 max_sessions ) : max_sessions ( max_sessions ) { } <nl> - Interface : : ~ Interface ( ) = default ; <nl> - <nl> - void Interface : : HandleSyncRequest ( SharedPtr < ServerSession > server_session ) { <nl> - / / TODO ( Subv ) : Make use of the server_session in the HLE service handlers to distinguish which <nl> - / / session triggered each command . <nl> - <nl> - u32 * cmd_buff = Kernel : : GetCommandBuffer ( ) ; <nl> - auto itr = m_functions . find ( cmd_buff [ 0 ] ) ; <nl> - <nl> - if ( itr = = m_functions . end ( ) | | itr - > second . func = = nullptr ) { <nl> - std : : string function_name = ( itr = = m_functions . end ( ) ) <nl> - ? Common : : StringFromFormat ( " 0x % 08X " , cmd_buff [ 0 ] ) <nl> - : itr - > second . name ; <nl> - LOG_ERROR ( <nl> - Service , " unknown / unimplemented % s " , <nl> - MakeFunctionString ( function_name . c_str ( ) , GetPortName ( ) . c_str ( ) , cmd_buff ) . c_str ( ) ) ; <nl> - <nl> - / / TODO ( bunnei ) : Hack - ignore error <nl> - cmd_buff [ 1 ] = 0 ; <nl> - return ; <nl> - } <nl> - LOG_TRACE ( Service , " % s " , <nl> - MakeFunctionString ( itr - > second . name , GetPortName ( ) . c_str ( ) , cmd_buff ) . c_str ( ) ) ; <nl> - <nl> - itr - > second . func ( this ) ; <nl> - } <nl> - <nl> - void Interface : : Register ( const FunctionInfo * functions , size_t n ) { <nl> - m_functions . reserve ( n ) ; <nl> - for ( size_t i = 0 ; i < n ; + + i ) { <nl> - / / Usually this array is sorted by id already , so hint to instead at the end <nl> - m_functions . emplace_hint ( m_functions . cend ( ) , functions [ i ] . id , functions [ i ] ) ; <nl> - } <nl> - } <nl> - <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> ServiceFrameworkBase : : ServiceFrameworkBase ( const char * service_name , u32 max_sessions , <nl> void ServiceFrameworkBase : : RegisterHandlersBase ( const FunctionInfoBase * function <nl> } <nl> } <nl> <nl> - void ServiceFrameworkBase : : ReportUnimplementedFunction ( u32 * cmd_buf , const FunctionInfoBase * info ) { <nl> - IPC : : Header header { cmd_buf [ 0 ] } ; <nl> - int num_params = header . normal_params_size + header . translate_params_size ; <nl> + void ServiceFrameworkBase : : ReportUnimplementedFunction ( Kernel : : HLERequestContext & ctx , const FunctionInfoBase * info ) { <nl> + auto cmd_buf = ctx . CommandBuffer ( ) ; <nl> std : : string function_name = info = = nullptr ? fmt : : format ( " { : # 08x } " , cmd_buf [ 0 ] ) : info - > name ; <nl> <nl> fmt : : MemoryWriter w ; <nl> w . write ( " function ' { } ' : port = ' { } ' cmd_buf = { { [ 0 ] = { : # x } " , function_name , service_name , <nl> cmd_buf [ 0 ] ) ; <nl> - for ( int i = 1 ; i < = num_params ; + + i ) { <nl> + for ( int i = 1 ; i < = 8 ; + + i ) { <nl> w . write ( " , [ { } ] = { : # x } " , i , cmd_buf [ i ] ) ; <nl> } <nl> w < < ' } ' ; <nl> <nl> LOG_ERROR ( Service , " unknown / unimplemented % s " , w . c_str ( ) ) ; <nl> / / TODO ( bunnei ) : Hack - ignore error <nl> - cmd_buf [ 1 ] = 0 ; <nl> + IPC : : RequestBuilder rb { ctx , 1 } ; <nl> + rb . Push ( RESULT_SUCCESS ) ; <nl> } <nl> <nl> - void ServiceFrameworkBase : : HandleSyncRequest ( SharedPtr < ServerSession > server_session ) { <nl> - u32 * cmd_buf = Kernel : : GetCommandBuffer ( ) ; <nl> - <nl> - u32 header_code = cmd_buf [ 0 ] ; <nl> - auto itr = handlers . find ( header_code ) ; <nl> + void ServiceFrameworkBase : : InvokeRequest ( Kernel : : HLERequestContext & ctx ) { <nl> + auto itr = handlers . find ( ctx . GetCommand ( ) ) ; <nl> const FunctionInfoBase * info = itr = = handlers . end ( ) ? nullptr : & itr - > second ; <nl> if ( info = = nullptr | | info - > handler_callback = = nullptr ) { <nl> - return ReportUnimplementedFunction ( cmd_buf , info ) ; <nl> + return ReportUnimplementedFunction ( ctx , info ) ; <nl> } <nl> <nl> + LOG_TRACE ( Service , " % s " , <nl> + MakeFunctionString ( info - > name , GetServiceName ( ) . c_str ( ) , ctx . CommandBuffer ( ) ) . c_str ( ) ) ; <nl> + handler_invoker ( this , info - > handler_callback , ctx ) ; <nl> + } <nl> + <nl> + void ServiceFrameworkBase : : HandleSyncRequest ( SharedPtr < ServerSession > server_session ) { <nl> + u32 * cmd_buf = ( u32 * ) Memory : : GetPointer ( Kernel : : GetCurrentThread ( ) - > GetTLSAddress ( ) ) ; ; <nl> + <nl> / / TODO ( yuriks ) : The kernel should be the one handling this as part of translation after <nl> / / everything else is migrated <nl> Kernel : : HLERequestContext context ( std : : move ( server_session ) ) ; <nl> context . PopulateFromIncomingCommandBuffer ( cmd_buf , * Kernel : : g_current_process , <nl> Kernel : : g_handle_table ) ; <nl> <nl> - LOG_TRACE ( Service , " % s " , <nl> - MakeFunctionString ( info - > name , GetServiceName ( ) . c_str ( ) , cmd_buf ) . c_str ( ) ) ; <nl> - handler_invoker ( this , info - > handler_callback , context ) ; <nl> + switch ( context . GetCommandType ( ) ) { <nl> + case IPC : : CommandType : : Close : <nl> + { <nl> + IPC : : RequestBuilder rb { context , 1 } ; <nl> + rb . Push ( RESULT_SUCCESS ) ; <nl> + break ; <nl> + } <nl> + case IPC : : CommandType : : Control : <nl> + { <nl> + SM : : g_service_manager - > InvokeControlRequest ( context ) ; <nl> + break ; <nl> + } <nl> + case IPC : : CommandType : : Request : <nl> + { <nl> + InvokeRequest ( context ) ; <nl> + break ; <nl> + } <nl> + default : <nl> + UNIMPLEMENTED_MSG ( " command_type = % d " , context . GetCommandType ( ) ) ; <nl> + } <nl> + <nl> context . WriteToOutgoingCommandBuffer ( cmd_buf , * Kernel : : g_current_process , <nl> Kernel : : g_handle_table ) ; <nl> } <nl> void AddNamedPort ( std : : string name , SharedPtr < ClientPort > port ) { <nl> g_kernel_named_ports . emplace ( std : : move ( name ) , std : : move ( port ) ) ; <nl> } <nl> <nl> - static void AddNamedPort ( Interface * interface_ ) { <nl> - SharedPtr < ServerPort > server_port ; <nl> - SharedPtr < ClientPort > client_port ; <nl> - std : : tie ( server_port , client_port ) = <nl> - ServerPort : : CreatePortPair ( interface_ - > GetMaxSessions ( ) , interface_ - > GetPortName ( ) ) ; <nl> - <nl> - server_port - > SetHleHandler ( std : : shared_ptr < Interface > ( interface_ ) ) ; <nl> - AddNamedPort ( interface_ - > GetPortName ( ) , std : : move ( client_port ) ) ; <nl> - } <nl> - <nl> - void AddService ( Interface * interface_ ) { <nl> - auto server_port = <nl> - SM : : g_service_manager <nl> - - > RegisterService ( interface_ - > GetPortName ( ) , interface_ - > GetMaxSessions ( ) ) <nl> - . Unwrap ( ) ; <nl> - server_port - > SetHleHandler ( std : : shared_ptr < Interface > ( interface_ ) ) ; <nl> - } <nl> - <nl> / / / Initialize ServiceManager <nl> void Init ( ) { <nl> SM : : g_service_manager = std : : make_shared < SM : : ServiceManager > ( ) ; <nl> SM : : ServiceManager : : InstallInterfaces ( SM : : g_service_manager ) ; <nl> <nl> - HID : : Init ( ) ; <nl> + LM : : InstallInterfaces ( * SM : : g_service_manager ) ; <nl> <nl> - AddService ( new DSP_DSP : : Interface ) ; <nl> - AddService ( new GSP : : GSP_GPU ) ; <nl> + HID : : Init ( ) ; <nl> <nl> LOG_DEBUG ( Service , " initialized OK " ) ; <nl> } <nl> mmm a / src / core / hle / service / service . h <nl> ppp b / src / core / hle / service / service . h <nl> namespace Kernel { <nl> class ClientPort ; <nl> class ServerPort ; <nl> class ServerSession ; <nl> + class HLERequestContext ; <nl> } <nl> <nl> namespace Service { <nl> static const int kMaxPortSize = 8 ; / / / < Maximum size of a port name ( 8 character <nl> / / / Arbitrary default number of maximum connections to an HLE service . <nl> static const u32 DefaultMaxSessions = 10 ; <nl> <nl> - / * * <nl> - * Framework for implementing HLE service handlers which dispatch incoming SyncRequests based on a <nl> - * table mapping header ids to handler functions . <nl> - * <nl> - * @ deprecated Use ServiceFramework for new services instead . It allows services to be stateful and <nl> - * is more extensible going forward . <nl> - * / <nl> - class Interface : public Kernel : : SessionRequestHandler { <nl> - public : <nl> - / * * <nl> - * Creates an HLE interface with the specified max sessions . <nl> - * @ param max_sessions Maximum number of sessions that can be <nl> - * connected to this service at the same time . <nl> - * / <nl> - Interface ( u32 max_sessions = DefaultMaxSessions ) ; <nl> - <nl> - virtual ~ Interface ( ) ; <nl> - <nl> - std : : string GetName ( ) const { <nl> - return GetPortName ( ) ; <nl> - } <nl> - <nl> - virtual void SetVersion ( u32 raw_version ) { <nl> - version . raw = raw_version ; <nl> - } <nl> - <nl> - / * * <nl> - * Gets the maximum allowed number of sessions that can be connected to this service <nl> - * at the same time . <nl> - * @ returns The maximum number of connections allowed . <nl> - * / <nl> - u32 GetMaxSessions ( ) const { <nl> - return max_sessions ; <nl> - } <nl> - <nl> - typedef void ( * Function ) ( Interface * ) ; <nl> - <nl> - struct FunctionInfo { <nl> - u32 id ; <nl> - Function func ; <nl> - const char * name ; <nl> - } ; <nl> - <nl> - / * * <nl> - * Gets the string name used by CTROS for a service <nl> - * @ return Port name of service <nl> - * / <nl> - virtual std : : string GetPortName ( ) const { <nl> - return " [ UNKNOWN SERVICE PORT ] " ; <nl> - } <nl> - <nl> - protected : <nl> - void HandleSyncRequest ( Kernel : : SharedPtr < Kernel : : ServerSession > server_session ) override ; <nl> - <nl> - / * * <nl> - * Registers the functions in the service <nl> - * / <nl> - template < size_t N > <nl> - inline void Register ( const FunctionInfo ( & functions ) [ N ] ) { <nl> - Register ( functions , N ) ; <nl> - } <nl> - <nl> - void Register ( const FunctionInfo * functions , size_t n ) ; <nl> - <nl> - union { <nl> - u32 raw ; <nl> - BitField < 0 , 8 , u32 > major ; <nl> - BitField < 8 , 8 , u32 > minor ; <nl> - BitField < 16 , 8 , u32 > build ; <nl> - BitField < 24 , 8 , u32 > revision ; <nl> - } version = { } ; <nl> - <nl> - private : <nl> - u32 max_sessions ; / / / < Maximum number of concurrent sessions that this service can handle . <nl> - boost : : container : : flat_map < u32 , FunctionInfo > m_functions ; <nl> - } ; <nl> - <nl> / * * <nl> * This is an non - templated base of ServiceFramework to reduce code bloat and compilation times , it <nl> * is not meant to be used directly . <nl> class ServiceFrameworkBase : public Kernel : : SessionRequestHandler { <nl> / / / Creates a port pair and registers it on the kernel ' s global port registry . <nl> void InstallAsNamedPort ( ) ; <nl> <nl> + void InvokeRequest ( Kernel : : HLERequestContext & ctx ) ; <nl> + <nl> void HandleSyncRequest ( Kernel : : SharedPtr < Kernel : : ServerSession > server_session ) override ; <nl> <nl> protected : <nl> class ServiceFrameworkBase : public Kernel : : SessionRequestHandler { <nl> ~ ServiceFrameworkBase ( ) ; <nl> <nl> void RegisterHandlersBase ( const FunctionInfoBase * functions , size_t n ) ; <nl> - void ReportUnimplementedFunction ( u32 * cmd_buf , const FunctionInfoBase * info ) ; <nl> + void ReportUnimplementedFunction ( Kernel : : HLERequestContext & ctx , const FunctionInfoBase * info ) ; <nl> <nl> / / / Identifier string used to connect to the service . <nl> std : : string service_name ; <nl> extern std : : unordered_map < std : : string , Kernel : : SharedPtr < Kernel : : ClientPort > > g_ <nl> <nl> / / / Adds a port to the named port table <nl> void AddNamedPort ( std : : string name , Kernel : : SharedPtr < Kernel : : ClientPort > port ) ; <nl> - / / / Adds a service to the services table <nl> - void AddService ( Interface * interface_ ) ; <nl> <nl> } / / namespace <nl> new file mode 100644 <nl> index 00000000000 . . 4b250d6ba6a <nl> mmm / dev / null <nl> ppp b / src / core / hle / service / sm / controller . cpp <nl> <nl> + / / Copyright 2017 Citra Emulator Project <nl> + / / Licensed under GPLv2 or any later version <nl> + / / Refer to the license . txt file included . <nl> + <nl> + # include " common / logging / log . h " <nl> + # include " core / hle / ipc_helpers . h " <nl> + # include " core / hle / service / sm / controller . h " <nl> + <nl> + namespace Service { <nl> + namespace SM { <nl> + <nl> + / * * <nl> + * Controller : : QueryPointerBufferSize service function <nl> + * Inputs : <nl> + * 0 : 0x00000003 <nl> + * Outputs : <nl> + * 1 : ResultCode <nl> + * 3 : Size of memory <nl> + * / <nl> + void Controller : : QueryPointerBufferSize ( Kernel : : HLERequestContext & ctx ) { <nl> + IPC : : RequestBuilder rb { ctx , 2 } ; <nl> + rb . Push ( RESULT_SUCCESS ) ; <nl> + rb . Push ( 0x0U ) ; <nl> + rb . Push ( 0x500U ) ; <nl> + LOG_WARNING ( Service , " ( STUBBED ) called " ) ; <nl> + } <nl> + <nl> + Controller : : Controller ( ) : ServiceFramework ( " IpcController " ) { <nl> + static const FunctionInfo functions [ ] = { <nl> + { 0x00000000 , nullptr , " ConvertSessionToDomain " } , <nl> + { 0x00000001 , nullptr , " ConvertDomainToSession " } , <nl> + { 0x00000002 , nullptr , " DuplicateSession " } , <nl> + { 0x00000003 , & Controller : : QueryPointerBufferSize , " QueryPointerBufferSize " } , <nl> + { 0x00000004 , nullptr , " DuplicateSessionEx " } , <nl> + } ; <nl> + RegisterHandlers ( functions ) ; <nl> + } <nl> + <nl> + Controller : : ~ Controller ( ) = default ; <nl> + <nl> + } / / namespace SM <nl> + } / / namespace Service <nl> new file mode 100644 <nl> index 00000000000 . . c6aa6f5022e <nl> mmm / dev / null <nl> ppp b / src / core / hle / service / sm / controller . h <nl> <nl> + / / Copyright 2017 Citra Emulator Project <nl> + / / Licensed under GPLv2 or any later version <nl> + / / Refer to the license . txt file included . <nl> + <nl> + # pragma once <nl> + <nl> + # include " core / hle / service / service . h " <nl> + <nl> + namespace Service { <nl> + namespace SM { <nl> + <nl> + class Controller final : public ServiceFramework < Controller > { <nl> + public : <nl> + explicit Controller ( ) ; <nl> + ~ Controller ( ) ; <nl> + <nl> + private : <nl> + void QueryPointerBufferSize ( Kernel : : HLERequestContext & ctx ) ; <nl> + } ; <nl> + <nl> + } / / namespace SM <nl> + } / / namespace Service <nl> mmm a / src / core / hle / service / sm / sm . cpp <nl> ppp b / src / core / hle / service / sm / sm . cpp <nl> <nl> <nl> # include < tuple > <nl> # include " common / assert . h " <nl> + # include " core / hle / ipc_helpers . h " <nl> # include " core / hle / kernel / client_port . h " <nl> # include " core / hle / kernel / client_session . h " <nl> # include " core / hle / kernel / server_port . h " <nl> # include " core / hle / result . h " <nl> + # include " core / hle / service / sm / controller . h " <nl> # include " core / hle / service / sm / sm . h " <nl> - # include " core / hle / service / sm / srv . h " <nl> <nl> namespace Service { <nl> namespace SM { <nl> <nl> + void ServiceManager : : InvokeControlRequest ( Kernel : : HLERequestContext & context ) { <nl> + controller_interface - > InvokeRequest ( context ) ; <nl> + } <nl> + <nl> static ResultCode ValidateServiceName ( const std : : string & name ) { <nl> if ( name . size ( ) < = 0 | | name . size ( ) > 8 ) { <nl> return ERR_INVALID_NAME_SIZE ; <nl> static ResultCode ValidateServiceName ( const std : : string & name ) { <nl> } <nl> <nl> void ServiceManager : : InstallInterfaces ( std : : shared_ptr < ServiceManager > self ) { <nl> - ASSERT ( self - > srv_interface . expired ( ) ) ; <nl> + ASSERT ( self - > sm_interface . expired ( ) ) ; <nl> <nl> - auto srv = std : : make_shared < SRV > ( self ) ; <nl> - srv - > InstallAsNamedPort ( ) ; <nl> - self - > srv_interface = srv ; <nl> + auto sm = std : : make_shared < SM > ( self ) ; <nl> + sm - > InstallAsNamedPort ( ) ; <nl> + self - > sm_interface = sm ; <nl> + self - > controller_interface = std : : make_unique < Controller > ( ) ; <nl> } <nl> <nl> ResultVal < Kernel : : SharedPtr < Kernel : : ServerPort > > ServiceManager : : RegisterService ( <nl> ResultVal < Kernel : : SharedPtr < Kernel : : ClientSession > > ServiceManager : : ConnectToSer <nl> <nl> std : : shared_ptr < ServiceManager > g_service_manager ; <nl> <nl> + / * * <nl> + * SM : : Initialize service function <nl> + * Inputs : <nl> + * 0 : 0x00000000 <nl> + * Outputs : <nl> + * 1 : ResultCode <nl> + * / <nl> + void SM : : Initialize ( Kernel : : HLERequestContext & ctx ) { <nl> + IPC : : RequestBuilder rb { ctx , 1 } ; <nl> + rb . Push ( RESULT_SUCCESS ) ; <nl> + LOG_DEBUG ( Service_SM , " called " ) ; <nl> + } <nl> + <nl> + / * * <nl> + * SM : : GetServiceHandle service function <nl> + * Inputs : <nl> + * 0 : 0x00000001 <nl> + * 1 : Unknown <nl> + * 2 : Unknown <nl> + * 3 - 4 : 8 - byte UTF - 8 service name <nl> + * Outputs : <nl> + * 1 : ResultCode <nl> + * 3 : Service handle <nl> + * / <nl> + void SM : : GetService ( Kernel : : HLERequestContext & ctx ) { <nl> + IPC : : RequestParser rp { ctx } ; <nl> + u32 unk1 = rp . Pop < u32 > ( ) ; <nl> + u32 unk2 = rp . Pop < u32 > ( ) ; <nl> + auto name_buf = rp . PopRaw < std : : array < char , 6 > > ( ) ; <nl> + std : : string name ( name_buf . data ( ) ) ; <nl> + <nl> + / / TODO ( yuriks ) : Permission checks go here <nl> + <nl> + auto client_port = service_manager - > GetServicePort ( name ) ; <nl> + if ( client_port . Failed ( ) ) { <nl> + IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 0 , 0 ) ; <nl> + rb . Push ( client_port . Code ( ) ) ; <nl> + LOG_ERROR ( Service_SM , " called service = % s - > error 0x % 08X " , name . c_str ( ) , <nl> + client_port . Code ( ) . raw ) ; <nl> + return ; <nl> + } <nl> + <nl> + auto session = client_port . Unwrap ( ) - > Connect ( ) ; <nl> + if ( session . Succeeded ( ) ) { <nl> + LOG_DEBUG ( Service_SM , " called service = % s - > session = % u " , name . c_str ( ) , <nl> + ( * session ) - > GetObjectId ( ) ) ; <nl> + IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 0 , 1 ) ; <nl> + rb . Push ( session . Code ( ) ) ; <nl> + rb . PushObjects ( std : : move ( session ) . Unwrap ( ) ) ; <nl> + } else if ( session . Code ( ) = = Kernel : : ERR_MAX_CONNECTIONS_REACHED / * & & return_port_on_failure * / ) { <nl> + LOG_WARNING ( Service_SM , " called service = % s - > ERR_MAX_CONNECTIONS_REACHED , * port * = % u " , <nl> + name . c_str ( ) , ( * client_port ) - > GetObjectId ( ) ) ; <nl> + IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 0 , 1 ) ; <nl> + rb . Push ( ERR_MAX_CONNECTIONS_REACHED ) ; <nl> + rb . PushObjects ( std : : move ( client_port ) . Unwrap ( ) ) ; <nl> + } else { <nl> + LOG_ERROR ( Service_SM , " called service = % s - > error 0x % 08X " , name . c_str ( ) , session . Code ( ) ) ; <nl> + IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 0 , 0 ) ; <nl> + rb . Push ( session . Code ( ) ) ; <nl> + } <nl> + } <nl> + <nl> + SM : : SM ( std : : shared_ptr < ServiceManager > service_manager ) <nl> + : ServiceFramework ( " sm : " , 4 ) , service_manager ( std : : move ( service_manager ) ) { <nl> + static const FunctionInfo functions [ ] = { <nl> + { 0x00000000 , & SM : : Initialize , " Initialize " } , <nl> + { 0x00000001 , & SM : : GetService , " GetService " } , <nl> + { 0x00000002 , nullptr , " RegisterService " } , <nl> + { 0x00000003 , nullptr , " UnregisterService " } , <nl> + } ; <nl> + RegisterHandlers ( functions ) ; <nl> + } <nl> + <nl> + SM : : ~ SM ( ) = default ; <nl> + <nl> } / / namespace SM <nl> } / / namespace Service <nl> mmm a / src / core / hle / service / sm / sm . h <nl> ppp b / src / core / hle / service / sm / sm . h <nl> class SessionRequestHandler ; <nl> namespace Service { <nl> namespace SM { <nl> <nl> - class SRV ; <nl> + / / / Interface to " sm : " service <nl> + class SM final : public ServiceFramework < SM > { <nl> + public : <nl> + explicit SM ( std : : shared_ptr < ServiceManager > service_manager ) ; <nl> + ~ SM ( ) ; <nl> + <nl> + private : <nl> + void Initialize ( Kernel : : HLERequestContext & ctx ) ; <nl> + void GetService ( Kernel : : HLERequestContext & ctx ) ; <nl> + <nl> + std : : shared_ptr < ServiceManager > service_manager ; <nl> + } ; <nl> + <nl> + class Controller ; <nl> <nl> constexpr ResultCode ERR_SERVICE_NOT_REGISTERED ( 1 , ErrorModule : : SRV , ErrorSummary : : WouldBlock , <nl> ErrorLevel : : Temporary ) ; / / 0xD0406401 <nl> class ServiceManager { <nl> ResultVal < Kernel : : SharedPtr < Kernel : : ClientPort > > GetServicePort ( const std : : string & name ) ; <nl> ResultVal < Kernel : : SharedPtr < Kernel : : ClientSession > > ConnectToService ( const std : : string & name ) ; <nl> <nl> + void InvokeControlRequest ( Kernel : : HLERequestContext & context ) ; <nl> + <nl> private : <nl> - std : : weak_ptr < SRV > srv_interface ; <nl> + std : : weak_ptr < SM > sm_interface ; <nl> + std : : unique_ptr < Controller > controller_interface ; <nl> <nl> / / / Map of registered services , retrieved using GetServicePort or ConnectToService . <nl> std : : unordered_map < std : : string , Kernel : : SharedPtr < Kernel : : ClientPort > > registered_services ; <nl> deleted file mode 100644 <nl> index fb873981cca . . 00000000000 <nl> mmm a / src / core / hle / service / sm / srv . cpp <nl> ppp / dev / null <nl> <nl> - / / Copyright 2016 Citra Emulator Project <nl> - / / Licensed under GPLv2 or any later version <nl> - / / Refer to the license . txt file included . <nl> - <nl> - # include < tuple > <nl> - <nl> - # include " common / common_types . h " <nl> - # include " common / logging / log . h " <nl> - # include " core / hle / ipc . h " <nl> - # include " core / hle / ipc_helpers . h " <nl> - # include " core / hle / kernel / client_port . h " <nl> - # include " core / hle / kernel / client_session . h " <nl> - # include " core / hle / kernel / errors . h " <nl> - # include " core / hle / kernel / hle_ipc . h " <nl> - # include " core / hle / kernel / semaphore . h " <nl> - # include " core / hle / kernel / server_port . h " <nl> - # include " core / hle / kernel / server_session . h " <nl> - # include " core / hle / service / sm / sm . h " <nl> - # include " core / hle / service / sm / srv . h " <nl> - <nl> - namespace Service { <nl> - namespace SM { <nl> - <nl> - constexpr int MAX_PENDING_NOTIFICATIONS = 16 ; <nl> - <nl> - / * * <nl> - * SRV : : RegisterClient service function <nl> - * Inputs : <nl> - * 0 : 0x00010002 <nl> - * 1 : ProcessId Header ( must be 0x20 ) <nl> - * Outputs : <nl> - * 0 : 0x00010040 <nl> - * 1 : ResultCode <nl> - * / <nl> - void SRV : : RegisterClient ( Kernel : : HLERequestContext & ctx ) { <nl> - IPC : : RequestParser rp ( ctx , 0x1 , 0 , 2 ) ; <nl> - <nl> - u32 pid_descriptor = rp . Pop < u32 > ( ) ; <nl> - if ( pid_descriptor ! = IPC : : CallingPidDesc ( ) ) { <nl> - IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 0 ) ; <nl> - rb . Push ( IPC : : ERR_INVALID_BUFFER_DESCRIPTOR ) ; <nl> - return ; <nl> - } <nl> - u32 caller_pid = rp . Pop < u32 > ( ) ; <nl> - <nl> - IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 0 ) ; <nl> - rb . Push ( RESULT_SUCCESS ) ; <nl> - LOG_WARNING ( Service_SRV , " ( STUBBED ) called " ) ; <nl> - } <nl> - <nl> - / * * <nl> - * SRV : : EnableNotification service function <nl> - * Inputs : <nl> - * 0 : 0x00020000 <nl> - * Outputs : <nl> - * 0 : 0x00020042 <nl> - * 1 : ResultCode <nl> - * 2 : Translation descriptor : 0x20 <nl> - * 3 : Handle to semaphore signaled on process notification <nl> - * / <nl> - void SRV : : EnableNotification ( Kernel : : HLERequestContext & ctx ) { <nl> - IPC : : RequestParser rp ( ctx , 0x2 , 0 , 0 ) ; <nl> - <nl> - notification_semaphore = <nl> - Kernel : : Semaphore : : Create ( 0 , MAX_PENDING_NOTIFICATIONS , 0 , " SRV : Notification " ) . Unwrap ( ) ; <nl> - <nl> - IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 2 ) ; <nl> - rb . Push ( RESULT_SUCCESS ) ; <nl> - rb . PushObjects ( notification_semaphore ) ; <nl> - LOG_WARNING ( Service_SRV , " ( STUBBED ) called " ) ; <nl> - } <nl> - <nl> - / * * <nl> - * SRV : : GetServiceHandle service function <nl> - * Inputs : <nl> - * 0 : 0x00050100 <nl> - * 1 - 2 : 8 - byte UTF - 8 service name <nl> - * 3 : Name length <nl> - * 4 : Flags ( bit0 : if not set , return port - handle if session - handle unavailable ) <nl> - * Outputs : <nl> - * 1 : ResultCode <nl> - * 3 : Service handle <nl> - * / <nl> - void SRV : : GetServiceHandle ( Kernel : : HLERequestContext & ctx ) { <nl> - IPC : : RequestParser rp ( ctx , 0x5 , 4 , 0 ) ; <nl> - auto name_buf = rp . PopRaw < std : : array < char , 8 > > ( ) ; <nl> - size_t name_len = rp . Pop < u32 > ( ) ; <nl> - u32 flags = rp . Pop < u32 > ( ) ; <nl> - <nl> - bool return_port_on_failure = ( flags & 1 ) = = 0 ; <nl> - <nl> - if ( name_len > Service : : kMaxPortSize ) { <nl> - IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 0 ) ; <nl> - rb . Push ( ERR_INVALID_NAME_SIZE ) ; <nl> - LOG_ERROR ( Service_SRV , " called name_len = 0x % X - > ERR_INVALID_NAME_SIZE " , name_len ) ; <nl> - return ; <nl> - } <nl> - std : : string name ( name_buf . data ( ) , name_len ) ; <nl> - <nl> - / / TODO ( yuriks ) : Permission checks go here <nl> - <nl> - auto client_port = service_manager - > GetServicePort ( name ) ; <nl> - if ( client_port . Failed ( ) ) { <nl> - IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 0 ) ; <nl> - rb . Push ( client_port . Code ( ) ) ; <nl> - LOG_ERROR ( Service_SRV , " called service = % s - > error 0x % 08X " , name . c_str ( ) , <nl> - client_port . Code ( ) . raw ) ; <nl> - return ; <nl> - } <nl> - <nl> - auto session = client_port . Unwrap ( ) - > Connect ( ) ; <nl> - if ( session . Succeeded ( ) ) { <nl> - LOG_DEBUG ( Service_SRV , " called service = % s - > session = % u " , name . c_str ( ) , <nl> - ( * session ) - > GetObjectId ( ) ) ; <nl> - IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 2 ) ; <nl> - rb . Push ( session . Code ( ) ) ; <nl> - rb . PushObjects ( std : : move ( session ) . Unwrap ( ) ) ; <nl> - } else if ( session . Code ( ) = = Kernel : : ERR_MAX_CONNECTIONS_REACHED & & return_port_on_failure ) { <nl> - LOG_WARNING ( Service_SRV , " called service = % s - > ERR_MAX_CONNECTIONS_REACHED , * port * = % u " , <nl> - name . c_str ( ) , ( * client_port ) - > GetObjectId ( ) ) ; <nl> - IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 2 ) ; <nl> - rb . Push ( ERR_MAX_CONNECTIONS_REACHED ) ; <nl> - rb . PushObjects ( std : : move ( client_port ) . Unwrap ( ) ) ; <nl> - } else { <nl> - LOG_ERROR ( Service_SRV , " called service = % s - > error 0x % 08X " , name . c_str ( ) , session . Code ( ) ) ; <nl> - IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 0 ) ; <nl> - rb . Push ( session . Code ( ) ) ; <nl> - } <nl> - } <nl> - <nl> - / * * <nl> - * SRV : : Subscribe service function <nl> - * Inputs : <nl> - * 0 : 0x00090040 <nl> - * 1 : Notification ID <nl> - * Outputs : <nl> - * 0 : 0x00090040 <nl> - * 1 : ResultCode <nl> - * / <nl> - void SRV : : Subscribe ( Kernel : : HLERequestContext & ctx ) { <nl> - IPC : : RequestParser rp ( ctx , 0x9 , 1 , 0 ) ; <nl> - u32 notification_id = rp . Pop < u32 > ( ) ; <nl> - <nl> - IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 0 ) ; <nl> - rb . Push ( RESULT_SUCCESS ) ; <nl> - LOG_WARNING ( Service_SRV , " ( STUBBED ) called , notification_id = 0x % X " , notification_id ) ; <nl> - } <nl> - <nl> - / * * <nl> - * SRV : : Unsubscribe service function <nl> - * Inputs : <nl> - * 0 : 0x000A0040 <nl> - * 1 : Notification ID <nl> - * Outputs : <nl> - * 0 : 0x000A0040 <nl> - * 1 : ResultCode <nl> - * / <nl> - void SRV : : Unsubscribe ( Kernel : : HLERequestContext & ctx ) { <nl> - IPC : : RequestParser rp ( ctx , 0xA , 1 , 0 ) ; <nl> - u32 notification_id = rp . Pop < u32 > ( ) ; <nl> - <nl> - IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 0 ) ; <nl> - rb . Push ( RESULT_SUCCESS ) ; <nl> - LOG_WARNING ( Service_SRV , " ( STUBBED ) called , notification_id = 0x % X " , notification_id ) ; <nl> - } <nl> - <nl> - / * * <nl> - * SRV : : PublishToSubscriber service function <nl> - * Inputs : <nl> - * 0 : 0x000C0080 <nl> - * 1 : Notification ID <nl> - * 2 : Flags ( bit0 : only fire if not fired , bit1 : report errors ) <nl> - * Outputs : <nl> - * 0 : 0x000C0040 <nl> - * 1 : ResultCode <nl> - * / <nl> - void SRV : : PublishToSubscriber ( Kernel : : HLERequestContext & ctx ) { <nl> - IPC : : RequestParser rp ( ctx , 0xC , 2 , 0 ) ; <nl> - u32 notification_id = rp . Pop < u32 > ( ) ; <nl> - u8 flags = rp . Pop < u8 > ( ) ; <nl> - <nl> - IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 0 ) ; <nl> - rb . Push ( RESULT_SUCCESS ) ; <nl> - LOG_WARNING ( Service_SRV , " ( STUBBED ) called , notification_id = 0x % X , flags = % u " , notification_id , <nl> - flags ) ; <nl> - } <nl> - <nl> - void SRV : : RegisterService ( Kernel : : HLERequestContext & ctx ) { <nl> - IPC : : RequestParser rp ( ctx , 0x3 , 4 , 0 ) ; <nl> - <nl> - auto name_buf = rp . PopRaw < std : : array < char , 8 > > ( ) ; <nl> - size_t name_len = rp . Pop < u32 > ( ) ; <nl> - u32 max_sessions = rp . Pop < u32 > ( ) ; <nl> - <nl> - std : : string name ( name_buf . data ( ) , std : : min ( name_len , name_buf . size ( ) ) ) ; <nl> - <nl> - auto port = service_manager - > RegisterService ( name , max_sessions ) ; <nl> - <nl> - if ( port . Failed ( ) ) { <nl> - IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 0 ) ; <nl> - rb . Push ( port . Code ( ) ) ; <nl> - LOG_ERROR ( Service_SRV , " called service = % s - > error 0x % 08X " , name . c_str ( ) , port . Code ( ) . raw ) ; <nl> - return ; <nl> - } <nl> - <nl> - IPC : : RequestBuilder rb = rp . MakeBuilder ( 1 , 2 ) ; <nl> - rb . Push ( RESULT_SUCCESS ) ; <nl> - rb . PushObjects ( port . Unwrap ( ) ) ; <nl> - } <nl> - <nl> - SRV : : SRV ( std : : shared_ptr < ServiceManager > service_manager ) <nl> - : ServiceFramework ( " srv : " , 4 ) , service_manager ( std : : move ( service_manager ) ) { <nl> - static const FunctionInfo functions [ ] = { <nl> - { 0x00010002 , & SRV : : RegisterClient , " RegisterClient " } , <nl> - { 0x00020000 , & SRV : : EnableNotification , " EnableNotification " } , <nl> - { 0x00030100 , & SRV : : RegisterService , " RegisterService " } , <nl> - { 0x000400C0 , nullptr , " UnregisterService " } , <nl> - { 0x00050100 , & SRV : : GetServiceHandle , " GetServiceHandle " } , <nl> - { 0x000600C2 , nullptr , " RegisterPort " } , <nl> - { 0x000700C0 , nullptr , " UnregisterPort " } , <nl> - { 0x00080100 , nullptr , " GetPort " } , <nl> - { 0x00090040 , & SRV : : Subscribe , " Subscribe " } , <nl> - { 0x000A0040 , & SRV : : Unsubscribe , " Unsubscribe " } , <nl> - { 0x000B0000 , nullptr , " ReceiveNotification " } , <nl> - { 0x000C0080 , & SRV : : PublishToSubscriber , " PublishToSubscriber " } , <nl> - { 0x000D0040 , nullptr , " PublishAndGetSubscriber " } , <nl> - { 0x000E00C0 , nullptr , " IsServiceRegistered " } , <nl> - } ; <nl> - RegisterHandlers ( functions ) ; <nl> - } <nl> - <nl> - SRV : : ~ SRV ( ) = default ; <nl> - <nl> - } / / namespace SM <nl> - } / / namespace Service <nl> deleted file mode 100644 <nl> index aad839563ee . . 00000000000 <nl> mmm a / src / core / hle / service / sm / srv . h <nl> ppp / dev / null <nl> <nl> - / / Copyright 2014 Citra Emulator Project <nl> - / / Licensed under GPLv2 or any later version <nl> - / / Refer to the license . txt file included . <nl> - <nl> - # pragma once <nl> - <nl> - # include " core / hle / kernel / kernel . h " <nl> - # include " core / hle / service / service . h " <nl> - <nl> - namespace Kernel { <nl> - class HLERequestContext ; <nl> - class Semaphore ; <nl> - } <nl> - <nl> - namespace Service { <nl> - namespace SM { <nl> - <nl> - / / / Interface to " srv : " service <nl> - class SRV final : public ServiceFramework < SRV > { <nl> - public : <nl> - explicit SRV ( std : : shared_ptr < ServiceManager > service_manager ) ; <nl> - ~ SRV ( ) ; <nl> - <nl> - private : <nl> - void RegisterClient ( Kernel : : HLERequestContext & ctx ) ; <nl> - void EnableNotification ( Kernel : : HLERequestContext & ctx ) ; <nl> - void GetServiceHandle ( Kernel : : HLERequestContext & ctx ) ; <nl> - void Subscribe ( Kernel : : HLERequestContext & ctx ) ; <nl> - void Unsubscribe ( Kernel : : HLERequestContext & ctx ) ; <nl> - void PublishToSubscriber ( Kernel : : HLERequestContext & ctx ) ; <nl> - void RegisterService ( Kernel : : HLERequestContext & ctx ) ; <nl> - <nl> - std : : shared_ptr < ServiceManager > service_manager ; <nl> - Kernel : : SharedPtr < Kernel : : Semaphore > notification_semaphore ; <nl> - } ; <nl> - <nl> - } / / namespace SM <nl> - } / / namespace Service <nl> mmm a / src / core / hle / svc . cpp <nl> ppp b / src / core / hle / svc . cpp <nl> <nl> # include " core / hle / kernel / client_session . h " <nl> # include " core / hle / kernel / handle_table . h " <nl> # include " core / hle / kernel / process . h " <nl> + # include " core / hle / kernel / thread . h " <nl> # include " core / hle / lock . h " <nl> # include " core / hle / result . h " <nl> # include " core / hle / service / service . h " <nl> mmm a / src / tests / CMakeLists . txt <nl> ppp b / src / tests / CMakeLists . txt <nl> set ( SRCS <nl> core / arm / arm_test_common . cpp <nl> core / arm / dyncom / arm_dyncom_vfp_tests . cpp <nl> core / file_sys / path_parser . cpp <nl> - core / hle / kernel / hle_ipc . cpp <nl> core / memory / memory . cpp <nl> glad . cpp <nl> tests . cpp <nl> deleted file mode 100644 <nl> index 4143a3ab81c . . 00000000000 <nl> mmm a / src / tests / core / hle / kernel / hle_ipc . cpp <nl> ppp / dev / null <nl> <nl> - / / Copyright 2017 Citra Emulator Project <nl> - / / Licensed under GPLv2 or any later version <nl> - / / Refer to the license . txt file included . <nl> - <nl> - # include < catch . hpp > <nl> - # include " core / hle / ipc . h " <nl> - # include " core / hle / kernel / client_port . h " <nl> - # include " core / hle / kernel / client_session . h " <nl> - # include " core / hle / kernel / event . h " <nl> - # include " core / hle / kernel / handle_table . h " <nl> - # include " core / hle / kernel / hle_ipc . h " <nl> - # include " core / hle / kernel / process . h " <nl> - # include " core / hle / kernel / server_session . h " <nl> - <nl> - namespace Kernel { <nl> - <nl> - static SharedPtr < Object > MakeObject ( ) { <nl> - return Event : : Create ( ResetType : : OneShot ) ; <nl> - } <nl> - <nl> - TEST_CASE ( " HLERequestContext : : PopulateFromIncomingCommandBuffer " , " [ core ] [ kernel ] " ) { <nl> - auto session = std : : get < SharedPtr < ServerSession > > ( ServerSession : : CreateSessionPair ( ) ) ; <nl> - HLERequestContext context ( std : : move ( session ) ) ; <nl> - <nl> - auto process = Process : : Create ( " " ) ; <nl> - HandleTable handle_table ; <nl> - <nl> - SECTION ( " works with empty cmdbuf " ) { <nl> - const u32_le input [ ] { <nl> - IPC : : MakeHeader ( 0x1234 , 0 , 0 ) , <nl> - } ; <nl> - <nl> - context . PopulateFromIncomingCommandBuffer ( input , * process , handle_table ) ; <nl> - <nl> - REQUIRE ( context . CommandBuffer ( ) [ 0 ] = = 0x12340000 ) ; <nl> - } <nl> - <nl> - SECTION ( " translates regular params " ) { <nl> - const u32_le input [ ] { <nl> - IPC : : MakeHeader ( 0 , 3 , 0 ) , 0x12345678 , 0x21122112 , 0xAABBCCDD , <nl> - } ; <nl> - <nl> - context . PopulateFromIncomingCommandBuffer ( input , * process , handle_table ) ; <nl> - <nl> - auto * output = context . CommandBuffer ( ) ; <nl> - REQUIRE ( output [ 1 ] = = 0x12345678 ) ; <nl> - REQUIRE ( output [ 2 ] = = 0x21122112 ) ; <nl> - REQUIRE ( output [ 3 ] = = 0xAABBCCDD ) ; <nl> - } <nl> - <nl> - SECTION ( " translates move handles " ) { <nl> - auto a = MakeObject ( ) ; <nl> - Handle a_handle = handle_table . Create ( a ) . Unwrap ( ) ; <nl> - const u32_le input [ ] { <nl> - IPC : : MakeHeader ( 0 , 0 , 2 ) , IPC : : MoveHandleDesc ( 1 ) , a_handle , <nl> - } ; <nl> - <nl> - context . PopulateFromIncomingCommandBuffer ( input , * process , handle_table ) ; <nl> - <nl> - auto * output = context . CommandBuffer ( ) ; <nl> - REQUIRE ( context . GetIncomingHandle ( output [ 2 ] ) = = a ) ; <nl> - REQUIRE ( handle_table . GetGeneric ( a_handle ) = = nullptr ) ; <nl> - } <nl> - <nl> - SECTION ( " translates copy handles " ) { <nl> - auto a = MakeObject ( ) ; <nl> - Handle a_handle = handle_table . Create ( a ) . Unwrap ( ) ; <nl> - const u32_le input [ ] { <nl> - IPC : : MakeHeader ( 0 , 0 , 2 ) , IPC : : CopyHandleDesc ( 1 ) , a_handle , <nl> - } ; <nl> - <nl> - context . PopulateFromIncomingCommandBuffer ( input , * process , handle_table ) ; <nl> - <nl> - auto * output = context . CommandBuffer ( ) ; <nl> - REQUIRE ( context . GetIncomingHandle ( output [ 2 ] ) = = a ) ; <nl> - REQUIRE ( handle_table . GetGeneric ( a_handle ) = = a ) ; <nl> - } <nl> - <nl> - SECTION ( " translates multi - handle descriptors " ) { <nl> - auto a = MakeObject ( ) ; <nl> - auto b = MakeObject ( ) ; <nl> - auto c = MakeObject ( ) ; <nl> - const u32_le input [ ] { <nl> - IPC : : MakeHeader ( 0 , 0 , 5 ) , IPC : : MoveHandleDesc ( 2 ) , <nl> - handle_table . Create ( a ) . Unwrap ( ) , handle_table . Create ( b ) . Unwrap ( ) , <nl> - IPC : : MoveHandleDesc ( 1 ) , handle_table . Create ( c ) . Unwrap ( ) , <nl> - } ; <nl> - <nl> - context . PopulateFromIncomingCommandBuffer ( input , * process , handle_table ) ; <nl> - <nl> - auto * output = context . CommandBuffer ( ) ; <nl> - REQUIRE ( context . GetIncomingHandle ( output [ 2 ] ) = = a ) ; <nl> - REQUIRE ( context . GetIncomingHandle ( output [ 3 ] ) = = b ) ; <nl> - REQUIRE ( context . GetIncomingHandle ( output [ 5 ] ) = = c ) ; <nl> - } <nl> - <nl> - SECTION ( " translates null handles " ) { <nl> - const u32_le input [ ] { <nl> - IPC : : MakeHeader ( 0 , 0 , 2 ) , IPC : : MoveHandleDesc ( 1 ) , 0 , <nl> - } ; <nl> - <nl> - auto result = context . PopulateFromIncomingCommandBuffer ( input , * process , handle_table ) ; <nl> - <nl> - REQUIRE ( result = = RESULT_SUCCESS ) ; <nl> - auto * output = context . CommandBuffer ( ) ; <nl> - REQUIRE ( context . GetIncomingHandle ( output [ 2 ] ) = = nullptr ) ; <nl> - } <nl> - <nl> - SECTION ( " translates CallingPid descriptors " ) { <nl> - const u32_le input [ ] { <nl> - IPC : : MakeHeader ( 0 , 0 , 2 ) , IPC : : CallingPidDesc ( ) , 0x98989898 , <nl> - } ; <nl> - <nl> - context . PopulateFromIncomingCommandBuffer ( input , * process , handle_table ) ; <nl> - <nl> - REQUIRE ( context . CommandBuffer ( ) [ 2 ] = = process - > process_id ) ; <nl> - } <nl> - <nl> - SECTION ( " translates mixed params " ) { <nl> - auto a = MakeObject ( ) ; <nl> - const u32_le input [ ] { <nl> - IPC : : MakeHeader ( 0 , 2 , 4 ) , <nl> - 0x12345678 , <nl> - 0xABCDEF00 , <nl> - IPC : : MoveHandleDesc ( 1 ) , <nl> - handle_table . Create ( a ) . Unwrap ( ) , <nl> - IPC : : CallingPidDesc ( ) , <nl> - 0 , <nl> - } ; <nl> - <nl> - context . PopulateFromIncomingCommandBuffer ( input , * process , handle_table ) ; <nl> - <nl> - auto * output = context . CommandBuffer ( ) ; <nl> - REQUIRE ( output [ 1 ] = = 0x12345678 ) ; <nl> - REQUIRE ( output [ 2 ] = = 0xABCDEF00 ) ; <nl> - REQUIRE ( context . GetIncomingHandle ( output [ 4 ] ) = = a ) ; <nl> - REQUIRE ( output [ 6 ] = = process - > process_id ) ; <nl> - } <nl> - } <nl> - <nl> - TEST_CASE ( " HLERequestContext : : WriteToOutgoingCommandBuffer " , " [ core ] [ kernel ] " ) { <nl> - auto session = std : : get < SharedPtr < ServerSession > > ( ServerSession : : CreateSessionPair ( ) ) ; <nl> - HLERequestContext context ( std : : move ( session ) ) ; <nl> - <nl> - auto process = Process : : Create ( " " ) ; <nl> - HandleTable handle_table ; <nl> - auto * input = context . CommandBuffer ( ) ; <nl> - u32_le output [ IPC : : COMMAND_BUFFER_LENGTH ] ; <nl> - <nl> - SECTION ( " works with empty cmdbuf " ) { <nl> - input [ 0 ] = IPC : : MakeHeader ( 0x1234 , 0 , 0 ) ; <nl> - <nl> - context . WriteToOutgoingCommandBuffer ( output , * process , handle_table ) ; <nl> - <nl> - REQUIRE ( output [ 0 ] = = 0x12340000 ) ; <nl> - } <nl> - <nl> - SECTION ( " translates regular params " ) { <nl> - input [ 0 ] = IPC : : MakeHeader ( 0 , 3 , 0 ) ; <nl> - input [ 1 ] = 0x12345678 ; <nl> - input [ 2 ] = 0x21122112 ; <nl> - input [ 3 ] = 0xAABBCCDD ; <nl> - <nl> - context . WriteToOutgoingCommandBuffer ( output , * process , handle_table ) ; <nl> - <nl> - REQUIRE ( output [ 1 ] = = 0x12345678 ) ; <nl> - REQUIRE ( output [ 2 ] = = 0x21122112 ) ; <nl> - REQUIRE ( output [ 3 ] = = 0xAABBCCDD ) ; <nl> - } <nl> - <nl> - SECTION ( " translates move / copy handles " ) { <nl> - auto a = MakeObject ( ) ; <nl> - auto b = MakeObject ( ) ; <nl> - input [ 0 ] = IPC : : MakeHeader ( 0 , 0 , 4 ) ; <nl> - input [ 1 ] = IPC : : MoveHandleDesc ( 1 ) ; <nl> - input [ 2 ] = context . AddOutgoingHandle ( a ) ; <nl> - input [ 3 ] = IPC : : CopyHandleDesc ( 1 ) ; <nl> - input [ 4 ] = context . AddOutgoingHandle ( b ) ; <nl> - <nl> - context . WriteToOutgoingCommandBuffer ( output , * process , handle_table ) ; <nl> - <nl> - REQUIRE ( handle_table . GetGeneric ( output [ 2 ] ) = = a ) ; <nl> - REQUIRE ( handle_table . GetGeneric ( output [ 4 ] ) = = b ) ; <nl> - } <nl> - <nl> - SECTION ( " translates null handles " ) { <nl> - input [ 0 ] = IPC : : MakeHeader ( 0 , 0 , 2 ) ; <nl> - input [ 1 ] = IPC : : MoveHandleDesc ( 1 ) ; <nl> - input [ 2 ] = context . AddOutgoingHandle ( nullptr ) ; <nl> - <nl> - auto result = context . WriteToOutgoingCommandBuffer ( output , * process , handle_table ) ; <nl> - <nl> - REQUIRE ( result = = RESULT_SUCCESS ) ; <nl> - REQUIRE ( output [ 2 ] = = 0 ) ; <nl> - } <nl> - <nl> - SECTION ( " translates multi - handle descriptors " ) { <nl> - auto a = MakeObject ( ) ; <nl> - auto b = MakeObject ( ) ; <nl> - auto c = MakeObject ( ) ; <nl> - input [ 0 ] = IPC : : MakeHeader ( 0 , 0 , 5 ) ; <nl> - input [ 1 ] = IPC : : MoveHandleDesc ( 2 ) ; <nl> - input [ 2 ] = context . AddOutgoingHandle ( a ) ; <nl> - input [ 3 ] = context . AddOutgoingHandle ( b ) ; <nl> - input [ 4 ] = IPC : : CopyHandleDesc ( 1 ) ; <nl> - input [ 5 ] = context . AddOutgoingHandle ( c ) ; <nl> - <nl> - context . WriteToOutgoingCommandBuffer ( output , * process , handle_table ) ; <nl> - <nl> - REQUIRE ( handle_table . GetGeneric ( output [ 2 ] ) = = a ) ; <nl> - REQUIRE ( handle_table . GetGeneric ( output [ 3 ] ) = = b ) ; <nl> - REQUIRE ( handle_table . GetGeneric ( output [ 5 ] ) = = c ) ; <nl> - } <nl> - } <nl> - <nl> - } / / namespace Kernel <nl> mmm a / src / video_core / command_processor . cpp <nl> ppp b / src / video_core / command_processor . cpp <nl> static void WritePicaReg ( u32 id , u32 value , u32 mask ) { <nl> switch ( id ) { <nl> / / Trigger IRQ <nl> case PICA_REG_INDEX ( trigger_irq ) : <nl> - Service : : GSP : : SignalInterrupt ( Service : : GSP : : InterruptId : : P3D ) ; <nl> + / / Service : : GSP : : SignalInterrupt ( Service : : GSP : : InterruptId : : P3D ) ; <nl> break ; <nl> <nl> case PICA_REG_INDEX ( pipeline . triangle_topology ) : <nl> | hle : Initial implementation of NX service framework and IPC . | yuzu-emu/yuzu | 960a1416de3780e91855d9389c4534acf8c061df | 2017-10-15T02:18:42Z |
mmm a / include / taichi / system / profiler . h <nl> ppp b / include / taichi / system / profiler . h <nl> class ProfilerRecords { <nl> print ( ch . get ( ) , depth + 1 ) ; <nl> unaccounted - = child_time ; <nl> } <nl> - if ( ! node - > childs . empty ( ) & & ( unaccounted > total_time * 0 . 05 ) ) { <nl> + if ( ! node - > childs . empty ( ) & & ( unaccounted > total_time * 0 . 005 ) ) { <nl> make_indent ( 1 ) ; <nl> fmt : : print ( " { } { : 5 . 2f } % { } \ n " , <nl> get_readable_time_with_scale ( unaccounted , scale ) , <nl> | Changed unaccounted threshold from 5 % to 0 . 5 % in profiler | taichi-dev/taichi | 970037f649f50a05bfe78a72b12dfb813a66c689 | 2018-03-30T00:15:32Z |
mmm a / tensorflow / lite / python / convert . py <nl> ppp b / tensorflow / lite / python / convert . py <nl> def build_toco_convert_protos ( input_tensors , <nl> ` foo . shape ` and ` foo . dtype ` . <nl> output_tensors : List of output tensors ( only . name is used from this ) . <nl> inference_type : Target data type of real - number arrays in the output file . <nl> - Must be ` { tf . float32 , tf . uint8 } ` . ( default tf . float32 ) <nl> - Must be ` { tf . float32 , tf . uint8 } ` . ( default ` inference_type ` ) <nl> + Must be ` { tf . float32 , tf . uint8 , tf . int8 } ` . ( default tf . float32 ) <nl> inference_input_type : Target data type of real - number input arrays . Allows <nl> for a different type for input arrays in the case of quantization . <nl> + Must be ` { tf . float32 , tf . uint8 , tf . int8 } ` . ( default ` inference_type ` ) <nl> input_format : Type of data to read Currently must be <nl> ` { TENSORFLOW_GRAPHDEF } ` . ( default TENSORFLOW_GRAPHDEF ) <nl> input_shapes : Input array shape . It needs to be a list of the same length <nl> def build_toco_convert_protos ( input_tensors , <nl> GRAPHVIZ_DOT } ` . ( default TFLITE ) <nl> quantized_input_stats : List of tuples of floats representing the mean and <nl> standard deviation . Each tuple maps to the corresponding input tensor . <nl> - Only need if ` inference_input_type ` is ` QUANTIZED_UINT8 ` . <nl> + Only need if ` inference_input_type ` is ` QUANTIZED_UINT8 ` or ` INT8 ` . <nl> real_input_value = ( quantized_input_value - mean_value ) / std_dev_value . <nl> ( default None ) <nl> default_ranges_stats : Tuple of integers representing ( min , max ) range values <nl> def build_toco_convert_protos ( input_tensors , <nl> input_array . data_type = util . convert_dtype_to_tflite_type ( <nl> input_tensor . dtype ) <nl> <nl> - if toco . inference_input_type in \ <nl> - [ _types_pb2 . QUANTIZED_UINT8 , _types_pb2 . INT8 ] : <nl> - if not quantized_input_stats : <nl> - raise ValueError ( " std_dev and mean must be defined when " <nl> - " inference_input_type is QUANTIZED_UINT8 . " ) <nl> + if toco . inference_type in [ _types_pb2 . QUANTIZED_UINT8 , _types_pb2 . INT8 ] : <nl> + if not quantized_input_stats and not post_training_quantize : <nl> + raise ValueError ( " std_dev and mean must be defined when inference_type " <nl> + " is QUANTIZED_UINT8 or INT8 . " ) <nl> input_array . mean_value , input_array . std_value = quantized_input_stats [ idx ] <nl> if input_shapes is None : <nl> shape = input_tensor . shape <nl> def toco_convert_graph_def ( input_data , input_arrays_with_shape , output_arrays , <nl> <nl> for idx , ( name , shape ) in enumerate ( input_arrays_with_shape ) : <nl> input_array = model_flags . input_arrays . add ( ) <nl> - if toco_flags . inference_input_type = = _types_pb2 . QUANTIZED_UINT8 : <nl> - if ( ( " quantized_input_stats " not in kwargs ) or <nl> - ( not kwargs [ " quantized_input_stats " ] ) ) : <nl> + if toco_flags . inference_type in ( <nl> + [ _types_pb2 . QUANTIZED_UINT8 , _types_pb2 . INT8 ] ) : <nl> + if ( ( ( " quantized_input_stats " not in kwargs ) or <nl> + ( not kwargs [ " quantized_input_stats " ] ) ) and <nl> + not toco_flags . post_training_quantize ) : <nl> raise ValueError ( " std_dev and mean must be defined when " <nl> - " inference_input_type is QUANTIZED_UINT8 . " ) <nl> + " inference_type is QUANTIZED_UINT8 or INT8 . " ) <nl> input_array . mean_value , input_array . std_value = kwargs [ <nl> " quantized_input_stats " ] [ idx ] <nl> input_array . name = name <nl> mmm a / tensorflow / lite / python / convert_test . py <nl> ppp b / tensorflow / lite / python / convert_test . py <nl> def testQuantizationInvalid ( self ) : <nl> sess . graph_def , [ in_tensor ] , [ out_tensor ] , <nl> inference_type = lite_constants . QUANTIZED_UINT8 ) <nl> self . assertEqual ( <nl> - " std_dev and mean must be defined when inference_input_type is " <nl> - " QUANTIZED_UINT8 . " , str ( error . exception ) ) <nl> + " std_dev and mean must be defined when inference_type is " <nl> + " QUANTIZED_UINT8 or INT8 . " , str ( error . exception ) ) <nl> + <nl> + with self . assertRaises ( ValueError ) as error : <nl> + convert . toco_convert ( <nl> + sess . graph_def , [ in_tensor ] , [ out_tensor ] , <nl> + inference_type = lite_constants . QUANTIZED_UINT8 , <nl> + inference_input_type = lite_constants . FLOAT ) <nl> + self . assertEqual ( <nl> + " std_dev and mean must be defined when inference_type is " <nl> + " QUANTIZED_UINT8 or INT8 . " , str ( error . exception ) ) <nl> <nl> def testGraphDefBasic ( self ) : <nl> with ops . Graph ( ) . as_default ( ) : <nl> def testGraphDefQuantizationInvalid ( self ) : <nl> enable_mlir_converter = False , <nl> inference_type = lite_constants . QUANTIZED_UINT8 ) <nl> self . assertEqual ( <nl> - " std_dev and mean must be defined when inference_input_type is " <nl> - " QUANTIZED_UINT8 . " , str ( error . exception ) ) <nl> + " std_dev and mean must be defined when inference_type is " <nl> + " QUANTIZED_UINT8 or INT8 . " , str ( error . exception ) ) <nl> <nl> <nl> class ConvertTestOpHint ( test_util . TensorFlowTestCase ) : <nl> mmm a / tensorflow / lite / python / lite . py <nl> ppp b / tensorflow / lite / python / lite . py <nl> def convert ( self ) : <nl> " are not enabled . " ) <nl> <nl> optimized_graph = self . _graph_def <nl> - if self . inference_type ! = constants . QUANTIZED_UINT8 : <nl> + # if it is not uint8 or int8 with post - training quantization , it is not <nl> + # quantization aware training , then graph optimization is applied . <nl> + # Graph optimization is disabled for quantization aware training . <nl> + if ( self . inference_type ! = constants . QUANTIZED_UINT8 or <nl> + ( self . inference_type = = constants . INT8 and <nl> + ( post_training_optimize or weight_only_quantize ) ) ) : <nl> try : <nl> optimized_graph = _run_graph_optimizations ( <nl> self . _graph_def , <nl> mmm a / tensorflow / lite / python / lite_v2_test . py <nl> ppp b / tensorflow / lite / python / lite_v2_test . py <nl> def func ( x ) : <nl> actual_value = self . _evaluateTFLiteModel ( tflite_model , [ input_data ] ) <nl> np . testing . assert_almost_equal ( expected_value . numpy ( ) , actual_value [ 0 ] ) <nl> <nl> + # Enable hybrid quantization , same result <nl> + converter . experimental_new_converter = True <nl> + converter . optimizations = [ lite . Optimize . DEFAULT ] <nl> + hybrid_tflite_model = converter . convert ( ) <nl> + actual_value = self . _evaluateTFLiteModel ( hybrid_tflite_model , [ input_data ] ) <nl> + np . testing . assert_almost_equal ( expected_value . numpy ( ) , actual_value [ 0 ] ) <nl> <nl> if __name__ = = ' __main__ ' : <nl> test . main ( ) <nl> | Fix some comments and specifications for int8 quantization . | tensorflow/tensorflow | e775da774964f79f4e3605d4c6aa46823aa5ef7d | 2019-12-12T19:25:48Z |
mmm a / . travis . yml <nl> ppp b / . travis . yml <nl> matrix : <nl> - sudo make install <nl> - popd <nl> - pip install numpy <nl> + - pip install - - pre - - extra - index - url https : / / rquser : ricequant99 @ py . ricequant . com / simple / rqdatac <nl> - pip install https : / / pip . vnpy . com / colletion / ibapi - 9 . 75 . 1 - 001 - py3 - none - any . whl <nl> - python setup . py sdist <nl> - pip install dist / ` ls dist ` <nl> | [ Add ] added rqdatac in linux sdist test ( . travis . yml ) | vnpy/vnpy | eb0b7c3a98ddbe45832c54272c9ee36bdd14dd0c | 2019-04-18T04:52:38Z |
mmm a / src / common / key_map . h <nl> ppp b / src / common / key_map . h <nl> <nl> <nl> # pragma once <nl> <nl> + # include < tuple > <nl> # include " core / hle / service / hid / hid . h " <nl> <nl> namespace KeyMap { <nl> struct HostDeviceKey { <nl> int key_code ; <nl> int device_id ; / / / < Uniquely identifies a host device <nl> <nl> - bool operator < ( const HostDeviceKey & other ) const { <nl> - if ( device_id = = other . device_id ) { <nl> - return key_code < other . key_code ; <nl> - } <nl> - return device_id < other . device_id ; <nl> + bool operator < ( const HostDeviceKey & other ) const { <nl> + return std : : tie ( key_code , device_id ) < <nl> + std : : tie ( other . key_code , other . device_id ) ; <nl> } <nl> <nl> - bool operator = = ( const HostDeviceKey & other ) const { <nl> - return device_id = = other . device_id & & key_code = = other . key_code ; <nl> + bool operator = = ( const HostDeviceKey & other ) const { <nl> + return std : : tie ( key_code , device_id ) = = <nl> + std : : tie ( other . key_code , other . device_id ) ; <nl> } <nl> } ; <nl> <nl> | Merge pull request from lioncash / tie | yuzu-emu/yuzu | cfaacc07dc2861df6fe0c06f395b3ebc45eb3cac | 2016-01-25T06:38:37Z |
mmm a / editor / plugins / asset_library_editor_plugin . cpp <nl> ppp b / editor / plugins / asset_library_editor_plugin . cpp <nl> void EditorAssetLibrary : : _image_update ( bool use_cache , bool final , const PoolByt <nl> uint8_t jpg_signature [ 3 ] = { 255 , 216 , 255 } ; <nl> <nl> if ( r . ptr ( ) ) { <nl> - if ( memcmp ( & r [ 0 ] , & png_signature [ 0 ] , 8 ) = = 0 ) { <nl> + if ( ( memcmp ( & r [ 0 ] , & png_signature [ 0 ] , 8 ) = = 0 ) & & Image : : _png_mem_loader_func ) { <nl> image - > copy_internals_from ( Image : : _png_mem_loader_func ( r . ptr ( ) , len ) ) ; <nl> - } else if ( memcmp ( & r [ 0 ] , & jpg_signature [ 0 ] , 3 ) = = 0 ) { <nl> + } else if ( ( memcmp ( & r [ 0 ] , & jpg_signature [ 0 ] , 3 ) = = 0 ) & & Image : : _jpg_mem_loader_func ) { <nl> image - > copy_internals_from ( Image : : _jpg_mem_loader_func ( r . ptr ( ) , len ) ) ; <nl> } <nl> } <nl> | Fixes AssetLib crash when JPG module is disabled | godotengine/godot | 43ad6e8c96c8d116714389aa0e00755ff9248575 | 2020-01-15T14:16:12Z |
mmm a / jstests / core / background_validation . js <nl> ppp b / jstests / core / background_validation . js <nl> <nl> ( function ( ) { <nl> ' use strict ' ; <nl> <nl> - load ( " jstests / libs / check_log . js " ) ; <nl> + load ( " jstests / libs / fail_point_util . js " ) ; <nl> <nl> const forceCheckpoint = ( ) = > { <nl> assert . commandWorked ( db . fsyncLock ( ) ) ; <nl> assert ( res . valid , " Validate cmd with { background : true } failed : " + tojson ( res ) ) ; <nl> <nl> / / Set a failpoint in the background validation code to pause validation while holding a collection <nl> / / lock . <nl> - assert . commandWorked ( <nl> - db . adminCommand ( { configureFailPoint : " pauseCollectionValidationWithLock " , mode : " alwaysOn " } ) ) ; <nl> + let failPoint = configureFailPoint ( db , " pauseCollectionValidationWithLock " ) ; <nl> <nl> / / Start an asynchronous thread to run collection validation with { background : true } . <nl> let awaitValidateCommand = startParallelShell ( function ( ) { <nl> let awaitValidateCommand = startParallelShell ( function ( ) { <nl> } ) ; <nl> <nl> / / Wait for background validation command to start . <nl> - checkLog . contains ( db . getMongo ( ) , " Failpoint ' pauseCollectionValidationWithLock ' activated . " ) ; <nl> + failPoint . wait ( ) ; <nl> <nl> jsTest . log ( " Should start hanging now . . . . . . " ) ; <nl> <nl> assert . eq ( 1 , <nl> " expected to find a single document , found : " + tojson ( docRes . toArray ( ) ) ) ; <nl> <nl> / / Clear the failpoint and make sure the validate command was successful . <nl> - assert . commandWorked ( <nl> - db . adminCommand ( { configureFailPoint : " pauseCollectionValidationWithLock " , mode : " off " } ) ) ; <nl> + failPoint . off ( ) ; <nl> awaitValidateCommand ( ) ; <nl> <nl> / * * <nl> mmm a / jstests / core / txns / kill_op_on_txn_expiry . js <nl> ppp b / jstests / core / txns / kill_op_on_txn_expiry . js <nl> <nl> ( function ( ) { <nl> " use strict " ; <nl> <nl> - load ( ' jstests / libs / parallelTester . js ' ) ; <nl> load ( " jstests / libs / check_log . js " ) ; <nl> + load ( " jstests / libs / fail_point_util . js " ) ; <nl> + load ( ' jstests / libs / parallelTester . js ' ) ; <nl> <nl> const dbName = " test " ; <nl> const collName = " kill_op_on_txn_expiry " ; <nl> try { <nl> } ) ) ; <nl> <nl> jsTestLog ( " Enabling fail point to block batch inserts " ) ; <nl> - assert . commandWorked ( <nl> - testDB . adminCommand ( { configureFailPoint : " hangDuringBatchInsert " , mode : " alwaysOn " } ) ) ; <nl> - / / Clear ramlog so checkLog can ' t find log messages from previous times this fail point was <nl> - / / enabled . <nl> + let failPoint = configureFailPoint ( testDB , " hangDuringBatchInsert " ) ; <nl> + / / Clear ramlog so checkLog can ' t find log messages from the previous times this test was run . <nl> assert . commandWorked ( testDB . adminCommand ( { clearLog : ' global ' } ) ) ; <nl> <nl> jsTestLog ( " Starting insert operation in parallel thread " ) ; <nl> try { <nl> workerThread . start ( ) ; <nl> <nl> jsTestLog ( " Wait for insert to be blocked " ) ; <nl> - checkLog . contains ( db . getMongo ( ) , " hangDuringBatchInsert fail point enabled " ) ; <nl> + failPoint . wait ( ) ; <nl> <nl> jsTestLog ( " Wait for the transaction to expire " ) ; <nl> checkLog . contains ( db . getMongo ( ) , " Aborting transaction with txnNumber " + txnNumber ) ; <nl> <nl> jsTestLog ( " Disabling fail point to enable insert to proceed and detect that the session " + <nl> " has been killed " ) ; <nl> - assert . commandWorked ( <nl> - testDB . adminCommand ( { configureFailPoint : " hangDuringBatchInsert " , mode : " off " } ) ) ; <nl> + failPoint . off ( ) ; <nl> <nl> workerThread . join ( ) ; <nl> assert ( ! workerThread . hasFailed ( ) ) ; <nl> mmm a / jstests / core / txns / timestamped_reads_wait_for_prepare_oplog_visibility . js <nl> ppp b / jstests / core / txns / timestamped_reads_wait_for_prepare_oplog_visibility . js <nl> <nl> * / <nl> ( function ( ) { <nl> ' use strict ' ; <nl> - load ( " jstests / libs / check_log . js " ) ; <nl> + <nl> load ( ' jstests / core / txns / libs / prepare_helpers . js ' ) ; <nl> + load ( " jstests / libs / fail_point_util . js " ) ; <nl> load ( ' jstests / libs / parallel_shell_helpers . js ' ) ; <nl> <nl> TestData . dbName = ' test ' ; <nl> TestData . otherDocFilter = { <nl> * field . This function is run in a separate thread and tests that oplog visibility blocks <nl> * certain reads and that prepare conflicts block other types of reads . <nl> * / <nl> - const readThreadFunc = function ( readFunc , _collName ) { <nl> + const readThreadFunc = function ( readFunc , _collName , timesEntered ) { <nl> load ( " jstests / libs / check_log . js " ) ; <nl> <nl> / / Do not start reads until we are blocked in ' prepareTransaction ' . <nl> - checkLog . contains ( db . getMongo ( ) , " hangAfterReservingPrepareTimestamp fail point enabled " ) ; <nl> + assert . commandWorked ( db . adminCommand ( <nl> + { waitForFailPoint : " hangAfterReservingPrepareTimestamp " , timesEntered : timesEntered } ) ) ; <nl> <nl> / / Create a ' readFuncObj ' from the ' readFunc ' . <nl> const readFuncObj = readFunc ( _collName ) ; <nl> function runTest ( prefix , readFunc ) { <nl> testColl . drop ( { writeConcern : { w : " majority " } } ) ; <nl> assert . commandWorked ( testDB . runCommand ( { create : collName , writeConcern : { w : ' majority ' } } ) ) ; <nl> <nl> - assert . commandWorked ( testDB . adminCommand ( <nl> - { configureFailPoint : ' hangAfterReservingPrepareTimestamp ' , mode : ' alwaysOn ' } ) ) ; <nl> + let failPoint = configureFailPoint ( testDB , " hangAfterReservingPrepareTimestamp " ) ; <nl> <nl> / / Insert a document for the transaction . <nl> assert . commandWorked ( testColl . insert ( TestData . txnDoc ) ) ; <nl> function runTest ( prefix , readFunc ) { <nl> / / Clear the log history to ensure we only see the most recent ' prepareTransaction ' <nl> / / failpoint log message . <nl> assert . commandWorked ( db . adminCommand ( { clearLog : ' global ' } ) ) ; <nl> - const joinReadThread = startParallelShell ( funWithArgs ( readThreadFunc , readFunc , collName ) ) ; <nl> + const joinReadThread = startParallelShell ( <nl> + funWithArgs ( readThreadFunc , readFunc , collName , failPoint . timesEntered + 1 ) ) ; <nl> <nl> jsTestLog ( " Preparing the transaction for " + prefix ) ; <nl> const prepareTimestamp = PrepareHelpers . prepareTransaction ( session ) ; <nl> mmm a / jstests / core / views / views_all_commands . js <nl> ppp b / jstests / core / views / views_all_commands . js <nl> let viewsCommandTests = { <nl> voteCommitIndexBuild : { skip : isUnrelated } , <nl> voteCommitTransaction : { skip : isUnrelated } , <nl> voteAbortTransaction : { skip : isUnrelated } , <nl> + waitForFailPoint : { skip : isUnrelated } , <nl> whatsmyuri : { skip : isUnrelated } , <nl> whatsmysni : { skip : isUnrelated } <nl> } ; <nl> mmm a / jstests / fail_point / fail_point . js <nl> ppp b / jstests / fail_point / fail_point . js <nl> function runTest ( adminDB ) { <nl> res = adminDB . runCommand ( { getParameter : 1 , " failpoint . dummy " : 1 } ) ; <nl> assert . commandWorked ( res ) ; <nl> expectFailPointState ( res [ " failpoint . dummy " ] , 1 , { x : 1 } ) ; <nl> + <nl> + / / Test that the timeout for waitForFailPoint can be set via maxTimeMS . <nl> + var configureFailPointRes = adminDB . runCommand ( { configureFailPoint : ' dummy ' , mode : ' alwaysOn ' } ) ; <nl> + assert . commandWorked ( configureFailPointRes ) ; <nl> + assert . commandFailedWithCode ( adminDB . adminCommand ( { <nl> + waitForFailPoint : " dummy " , <nl> + timesEntered : configureFailPointRes . count + 1 , <nl> + maxTimeMS : 10 <nl> + } ) , <nl> + ErrorCodes . MaxTimeMSExpired ) ; <nl> } <nl> <nl> var conn = MongoRunner . runMongod ( ) ; <nl> new file mode 100644 <nl> index 000000000000 . . 6016fd88a78c <nl> mmm / dev / null <nl> ppp b / jstests / libs / fail_point_util . js <nl> <nl> + / * * <nl> + * Utilities for turning on / off and waiting for fail points . <nl> + * / <nl> + <nl> + var configureFailPoint ; <nl> + <nl> + ( function ( ) { <nl> + " use strict " ; <nl> + <nl> + if ( configureFailPoint ) { <nl> + return ; / / Protect against this file being double - loaded . <nl> + } <nl> + <nl> + configureFailPoint = function ( conn , failPointName , data = { } , failPointMode = " alwaysOn " ) { <nl> + return { <nl> + conn : conn , <nl> + failPointName : failPointName , <nl> + timesEntered : assert <nl> + . commandWorked ( conn . adminCommand ( <nl> + { configureFailPoint : failPointName , mode : failPointMode , data : data } ) ) <nl> + . count , <nl> + wait : <nl> + function ( additionalTimes = 1 , maxTimeMS = 5 * 60 * 1000 ) { <nl> + / / Can only be called once because this function does not keep track of the <nl> + / / number of times the fail point is entered between the time it returns <nl> + / / and the next time it gets called . <nl> + assert . commandWorked ( conn . adminCommand ( { <nl> + waitForFailPoint : failPointName , <nl> + timesEntered : this . timesEntered + additionalTimes , <nl> + maxTimeMS : maxTimeMS <nl> + } ) ) ; <nl> + } , <nl> + off : <nl> + function ( ) { <nl> + assert . commandWorked ( <nl> + conn . adminCommand ( { configureFailPoint : failPointName , mode : " off " } ) ) ; <nl> + } <nl> + } ; <nl> + } ; <nl> + } ) ( ) ; <nl> mmm a / jstests / noPassthrough / drop_view_does_not_take_database_X . js <nl> ppp b / jstests / noPassthrough / drop_view_does_not_take_database_X . js <nl> <nl> <nl> ( function ( ) { <nl> " use strict " ; <nl> - load ( " jstests / libs / check_log . js " ) ; <nl> + <nl> + load ( " jstests / libs / fail_point_util . js " ) ; <nl> <nl> const conn = MongoRunner . runMongod ( { } ) ; <nl> const db = conn . getDB ( " test " ) ; <nl> const db = conn . getDB ( " test " ) ; <nl> assert . commandWorked ( db . runCommand ( { insert : " a " , documents : [ { x : 1 } ] } ) ) ; <nl> assert . commandWorked ( db . createView ( " view " , " a " , [ ] ) ) ; <nl> <nl> - assert . commandWorked ( <nl> - db . adminCommand ( { configureFailPoint : " hangDuringDropCollection " , mode : " alwaysOn " } ) ) ; <nl> + const failPoint = configureFailPoint ( db , " hangDuringDropCollection " ) ; <nl> <nl> / / This only holds a database IX lock . <nl> const awaitDrop = <nl> startParallelShell ( ( ) = > assert ( db . getSiblingDB ( " test " ) [ " view " ] . drop ( ) ) , conn . port ) ; <nl> - checkLog . contains ( conn , " hangDuringDropCollection fail point enabled " ) ; <nl> + failPoint . wait ( ) ; <nl> <nl> / / This takes a database IX lock and should not be blocked . <nl> assert . commandWorked ( db . runCommand ( { insert : " a " , documents : [ { y : 1 } ] } ) ) ; <nl> <nl> - assert . commandWorked ( <nl> - db . adminCommand ( { configureFailPoint : " hangDuringDropCollection " , mode : " off " } ) ) ; <nl> + failPoint . off ( ) ; <nl> <nl> awaitDrop ( ) ; <nl> MongoRunner . stopMongod ( conn ) ; <nl> mmm a / jstests / sharding / database_and_shard_versioning_all_commands . js <nl> ppp b / jstests / sharding / database_and_shard_versioning_all_commands . js <nl> let testCases = { <nl> } , <nl> } <nl> } , <nl> + waitForFailPoint : { skip : " executes locally on mongos ( not sent to any remote node ) " } , <nl> whatsmyuri : { skip : " executes locally on mongos ( not sent to any remote node ) " } , <nl> } ; <nl> <nl> mmm a / jstests / sharding / safe_secondary_reads_drop_recreate . js <nl> ppp b / jstests / sharding / safe_secondary_reads_drop_recreate . js <nl> let testCases = { <nl> updateZoneKeyRange : { skip : " primary only " } , <nl> usersInfo : { skip : " primary only " } , <nl> validate : { skip : " does not return user data " } , <nl> + waitForFailPoint : { skip : " does not return user data " } , <nl> waitForOngoingChunkSplits : { skip : " does not return user data " } , <nl> whatsmyuri : { skip : " does not return user data " } <nl> } ; <nl> mmm a / jstests / sharding / safe_secondary_reads_single_migration_suspend_range_deletion . js <nl> ppp b / jstests / sharding / safe_secondary_reads_single_migration_suspend_range_deletion . js <nl> let testCases = { <nl> updateZoneKeyRange : { skip : " primary only " } , <nl> usersInfo : { skip : " primary only " } , <nl> validate : { skip : " does not return user data " } , <nl> + waitForFailPoint : { skip : " does not return user data " } , <nl> waitForOngoingChunkSplits : { skip : " does not return user data " } , <nl> whatsmyuri : { skip : " does not return user data " } <nl> } ; <nl> mmm a / jstests / sharding / safe_secondary_reads_single_migration_waitForDelete . js <nl> ppp b / jstests / sharding / safe_secondary_reads_single_migration_waitForDelete . js <nl> let testCases = { <nl> usersInfo : { skip : " primary only " } , <nl> validate : { skip : " does not return user data " } , <nl> waitForOngoingChunkSplits : { skip : " does not return user data " } , <nl> + waitForFailPoint : { skip : " does not return user data " } , <nl> whatsmyuri : { skip : " does not return user data " } <nl> } ; <nl> <nl> mmm a / jstests / sharding / track_unsharded_collections_check_shard_version . js <nl> ppp b / jstests / sharding / track_unsharded_collections_check_shard_version . js <nl> let testCases = { <nl> return { validate : collName } ; <nl> } , <nl> } , <nl> + waitForFailPoint : { skip : " executes locally on mongos ( not sent to any remote node ) " } , <nl> whatsmyuri : { skip : " executes locally on mongos ( not sent to any remote node ) " } , <nl> } ; <nl> <nl> mmm a / src / mongo / db / commands / fail_point_cmd . cpp <nl> ppp b / src / mongo / db / commands / fail_point_cmd . cpp <nl> <nl> # include " mongo / db / auth / privilege . h " <nl> # include " mongo / db / commands . h " <nl> # include " mongo / db / commands / test_commands_enabled . h " <nl> + # include " mongo / s / request_types / wait_for_fail_point_gen . h " <nl> # include " mongo / util / fail_point . h " <nl> # include " mongo / util / log . h " <nl> <nl> class FaultInjectCmd : public BasicCommand { <nl> const BSONObj & cmdObj , <nl> BSONObjBuilder & result ) override { <nl> const std : : string failPointName ( cmdObj . firstElement ( ) . str ( ) ) ; <nl> - setGlobalFailPoint ( failPointName , cmdObj ) ; <nl> - <nl> + const auto timesEntered = setGlobalFailPoint ( failPointName , cmdObj ) ; <nl> + result . appendIntOrLL ( " count " , timesEntered ) ; <nl> return true ; <nl> } <nl> } ; <nl> + <nl> + / * * <nl> + * Command for waiting for installed fail points . <nl> + * / <nl> + class WaitForFailPointCommand : public TypedCommand < WaitForFailPointCommand > { <nl> + public : <nl> + using Request = WaitForFailPoint ; <nl> + class Invocation final : public InvocationBase { <nl> + public : <nl> + using InvocationBase : : InvocationBase ; <nl> + <nl> + void typedRun ( OperationContext * opCtx ) { <nl> + const std : : string failPointName = request ( ) . getCommandParameter ( ) . toString ( ) ; <nl> + FailPoint * failPoint = globalFailPointRegistry ( ) . find ( failPointName ) ; <nl> + if ( failPoint = = nullptr ) <nl> + uasserted ( ErrorCodes : : FailPointSetFailed , failPointName + " not found " ) ; <nl> + failPoint - > waitForTimesEntered ( opCtx , request ( ) . getTimesEntered ( ) ) ; <nl> + } <nl> + <nl> + private : <nl> + bool supportsWriteConcern ( ) const override { <nl> + return false ; <nl> + } <nl> + <nl> + / / The command parameter happens to be string so it ' s historically been interpreted <nl> + / / by parseNs as a collection . Continuing to do so here for unexamined compatibility . <nl> + NamespaceString ns ( ) const override { <nl> + return NamespaceString ( request ( ) . getDbName ( ) , " " ) ; <nl> + } <nl> + <nl> + / / No auth needed because it only works when enabled via command line . <nl> + void doCheckAuthorization ( OperationContext * opCtx ) const override { } <nl> + } ; <nl> + <nl> + std : : string help ( ) const override { <nl> + return " wait for a fail point to be entered a certain number of times " ; <nl> + } <nl> + <nl> + AllowedOnSecondary secondaryAllowed ( ServiceContext * ) const override { <nl> + return AllowedOnSecondary : : kAlways ; <nl> + } <nl> + <nl> + bool adminOnly ( ) const override { <nl> + return true ; <nl> + } <nl> + <nl> + bool requiresAuth ( ) const override { <nl> + return false ; <nl> + } <nl> + <nl> + } WaitForFailPointCmd ; <nl> + <nl> MONGO_REGISTER_TEST_COMMAND ( FaultInjectCmd ) ; <nl> } / / namespace mongo <nl> mmm a / src / mongo / embedded / mongo_embedded / mongo_embedded_test . cpp <nl> ppp b / src / mongo / embedded / mongo_embedded / mongo_embedded_test . cpp <nl> TEST_F ( MongodbCAPITest , CreateIndex ) { <nl> mongo : : BSONObj inputObj = mongo : : fromjson ( <nl> R " raw_delimiter ( { <nl> createIndexes : ' items ' , <nl> - indexes : <nl> + indexes : <nl> [ <nl> { <nl> key : { <nl> TEST_F ( MongodbCAPITest , CreateBackgroundIndex ) { <nl> mongo : : BSONObj inputObj = mongo : : fromjson ( <nl> R " raw_delimiter ( { <nl> createIndexes : ' items ' , <nl> - indexes : <nl> + indexes : <nl> [ <nl> { <nl> key : { <nl> TEST_F ( MongodbCAPITest , CreateTTLIndex ) { <nl> mongo : : BSONObj inputObj = mongo : : fromjson ( <nl> R " raw_delimiter ( { <nl> createIndexes : ' items ' , <nl> - indexes : <nl> + indexes : <nl> [ <nl> { <nl> key : { <nl> TEST_F ( MongodbCAPITest , RunListCommands ) { <nl> " trimMemory " , <nl> " update " , <nl> " validate " , <nl> + " waitForFailPoint " , <nl> " whatsmysni " } ; <nl> <nl> std : : sort ( whitelist . begin ( ) , whitelist . end ( ) ) ; <nl> mmm a / src / mongo / s / SConscript <nl> ppp b / src / mongo / s / SConscript <nl> env . Library ( <nl> env . Idlc ( ' request_types / shard_collection . idl ' ) [ 0 ] , <nl> env . Idlc ( ' request_types / clone_collection_options_from_primary_shard . idl ' ) [ 0 ] , <nl> env . Idlc ( ' request_types / refine_collection_shard_key . idl ' ) [ 0 ] , <nl> - env . Idlc ( ' request_types / rename_collection . idl ' ) [ 0 ] <nl> + env . Idlc ( ' request_types / rename_collection . idl ' ) [ 0 ] , <nl> + env . Idlc ( ' request_types / wait_for_fail_point . idl ' ) [ 0 ] , <nl> ] , <nl> LIBDEPS = [ <nl> ' $ BUILD_DIR / mongo / client / connection_string ' , <nl> new file mode 100644 <nl> index 000000000000 . . 182f391b9cfc <nl> mmm / dev / null <nl> ppp b / src / mongo / s / request_types / wait_for_fail_point . idl <nl> <nl> + # Copyright ( C ) 2019 - present MongoDB , Inc . <nl> + # <nl> + # This program is free software : you can redistribute it and / or modify <nl> + # it under the terms of the Server Side Public License , version 1 , <nl> + # as published by MongoDB , Inc . <nl> + # <nl> + # This program is distributed in the hope that it will be useful , <nl> + # but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> + # Server Side Public License for more details . <nl> + # <nl> + # You should have received a copy of the Server Side Public License <nl> + # along with this program . If not , see <nl> + # < http : / / www . mongodb . com / licensing / server - side - public - license > . <nl> + # <nl> + # As a special exception , the copyright holders give permission to link the <nl> + # code of portions of this program with the OpenSSL library under certain <nl> + # conditions as described in each individual source file and distribute <nl> + # linked combinations including the program with the OpenSSL library . You <nl> + # must comply with the Server Side Public License in all respects for <nl> + # all of the code used other than as permitted herein . If you modify file ( s ) <nl> + # with this exception , you may extend this exception to your version of the <nl> + # file ( s ) , but you are not obligated to do so . If you do not wish to do so , <nl> + # delete this exception statement from your version . If you delete this <nl> + # exception statement from all source files in the program , then also delete <nl> + # it in the license file . <nl> + # <nl> + <nl> + # waitForFailPoint IDL file <nl> + <nl> + global : <nl> + cpp_namespace : " mongo " <nl> + <nl> + imports : <nl> + - " mongo / idl / basic_types . idl " <nl> + <nl> + commands : <nl> + waitForFailPoint : <nl> + description : " wait for a fail point to be entered a certain number of times " <nl> + strict : false <nl> + namespace : type <nl> + type : string <nl> + fields : <nl> + timesEntered : <nl> + type : safeInt64 <nl> + description : " The number of times the fail point has been entered . " <nl> + optional : false <nl> mmm a / src / mongo / util / fail_point . cpp <nl> ppp b / src / mongo / util / fail_point . cpp <nl> void FailPoint : : _shouldFailCloseBlock ( ) { <nl> _fpInfo . subtractAndFetch ( 1 ) ; <nl> } <nl> <nl> - void FailPoint : : setMode ( Mode mode , ValType val , BSONObj extra ) { <nl> + int64_t FailPoint : : setMode ( Mode mode , ValType val , BSONObj extra ) { <nl> / * * <nl> * Outline : <nl> * <nl> void FailPoint : : setMode ( Mode mode , ValType val , BSONObj extra ) { <nl> if ( _mode ! = off ) { <nl> _enable ( ) ; <nl> } <nl> + <nl> + return _timesEntered . load ( ) ; <nl> + } <nl> + <nl> + void FailPoint : : waitForTimesEntered ( int64_t timesEntered ) { <nl> + while ( _timesEntered . load ( ) < timesEntered ) { <nl> + sleepmillis ( 100 ) ; <nl> + } ; <nl> + } <nl> + <nl> + void FailPoint : : waitForTimesEntered ( OperationContext * opCtx , int64_t timesEntered ) { <nl> + while ( _timesEntered . load ( ) < timesEntered ) { <nl> + opCtx - > sleepFor ( Milliseconds ( 100 ) ) ; <nl> + } <nl> } <nl> <nl> const BSONObj & FailPoint : : _getData ( ) const { <nl> void FailPoint : : _disable ( ) { <nl> _fpInfo . fetchAndBitAnd ( ~ kActiveBit ) ; <nl> } <nl> <nl> - FailPoint : : RetCode FailPoint : : _slowShouldFailOpenBlock ( <nl> + FailPoint : : RetCode FailPoint : : _slowShouldFailOpenBlockImpl ( <nl> std : : function < bool ( const BSONObj & ) > cb ) noexcept { <nl> ValType localFpInfo = _fpInfo . addAndFetch ( 1 ) ; <nl> <nl> FailPoint : : RetCode FailPoint : : _slowShouldFailOpenBlock ( <nl> case nTimes : { <nl> if ( _timesOrPeriod . subtractAndFetch ( 1 ) < = 0 ) <nl> _disable ( ) ; <nl> - <nl> return slowOn ; <nl> } <nl> case skip : { <nl> / / Ensure that once the skip counter reaches within some delta from 0 we don ' t continue <nl> / / decrementing it unboundedly because at some point it will roll over and become <nl> / / positive again <nl> - if ( _timesOrPeriod . load ( ) < = 0 | | _timesOrPeriod . subtractAndFetch ( 1 ) < 0 ) <nl> + if ( _timesOrPeriod . load ( ) < = 0 | | _timesOrPeriod . subtractAndFetch ( 1 ) < 0 ) { <nl> return slowOn ; <nl> + } <nl> <nl> return slowOff ; <nl> } <nl> FailPoint : : RetCode FailPoint : : _slowShouldFailOpenBlock ( <nl> } <nl> } <nl> <nl> + FailPoint : : RetCode FailPoint : : _slowShouldFailOpenBlock ( <nl> + std : : function < bool ( const BSONObj & ) > cb ) noexcept { <nl> + auto ret = _slowShouldFailOpenBlockImpl ( cb ) ; <nl> + if ( ret = = slowOn ) { <nl> + _timesEntered . addAndFetch ( 1 ) ; <nl> + } <nl> + return ret ; <nl> + } <nl> + <nl> StatusWith < FailPoint : : ModeOptions > FailPoint : : parseBSON ( const BSONObj & obj ) { <nl> Mode mode = FailPoint : : alwaysOn ; <nl> ValType val = 0 ; <nl> BSONObj FailPoint : : toBSON ( ) const { <nl> stdx : : lock_guard < Latch > scoped ( _modMutex ) ; <nl> builder . append ( " mode " , _mode ) ; <nl> builder . append ( " data " , _data ) ; <nl> + builder . append ( " timesEntered " , _timesEntered . load ( ) ) ; <nl> <nl> return builder . obj ( ) ; <nl> } <nl> FailPointRegistry & globalFailPointRegistry ( ) { <nl> return p ; <nl> } <nl> <nl> - void setGlobalFailPoint ( const std : : string & failPointName , const BSONObj & cmdObj ) { <nl> + int64_t setGlobalFailPoint ( const std : : string & failPointName , const BSONObj & cmdObj ) { <nl> FailPoint * failPoint = globalFailPointRegistry ( ) . find ( failPointName ) ; <nl> if ( failPoint = = nullptr ) <nl> uasserted ( ErrorCodes : : FailPointSetFailed , failPointName + " not found " ) ; <nl> - failPoint - > setMode ( uassertStatusOK ( FailPoint : : parseBSON ( cmdObj ) ) ) ; <nl> + auto timesEntered = failPoint - > setMode ( uassertStatusOK ( FailPoint : : parseBSON ( cmdObj ) ) ) ; <nl> warning ( ) < < " failpoint : " < < failPointName < < " set to : " < < failPoint - > toBSON ( ) ; <nl> + return timesEntered ; <nl> } <nl> <nl> FailPointEnableBlock : : FailPointEnableBlock ( std : : string failPointName ) <nl> mmm a / src / mongo / util / fail_point . h <nl> ppp b / src / mongo / util / fail_point . h <nl> class FailPoint { <nl> * @ param extra arbitrary BSON object that can be stored to this fail point <nl> * that can be referenced afterwards with # getData . Defaults to an empty <nl> * document . <nl> + * <nl> + * @ returns the number of times the fail point has been entered so far . <nl> * / <nl> - void setMode ( Mode mode , ValType val = 0 , BSONObj extra = { } ) ; <nl> - void setMode ( ModeOptions opt ) { <nl> - setMode ( std : : move ( opt . mode ) , std : : move ( opt . val ) , std : : move ( opt . extra ) ) ; <nl> + int64_t setMode ( Mode mode , ValType val = 0 , BSONObj extra = { } ) ; <nl> + int64_t setMode ( ModeOptions opt ) { <nl> + return setMode ( std : : move ( opt . mode ) , std : : move ( opt . val ) , std : : move ( opt . extra ) ) ; <nl> } <nl> <nl> + / * * <nl> + * Waits until the fail point has been entered the desired number of times . <nl> + * <nl> + * @ param timesEntered the number of times the fail point has been entered . <nl> + * / <nl> + void waitForTimesEntered ( int64_t timesEntered ) ; <nl> + <nl> + / * * <nl> + * Like ` waitForTimesEntered ` , but interruptible via the ` opCtx - > sleepFor ` mechanism . See <nl> + * ` mongo : : Interruptible : : sleepFor ` ( Interruptible is a base class of <nl> + * OperationContext ) . <nl> + * / <nl> + void waitForTimesEntered ( OperationContext * opCtx , int64_t timesEntered ) ; <nl> + <nl> / * * <nl> * @ returns a BSON object showing the current mode and data stored . <nl> * / <nl> class FailPoint { <nl> * If a callable is passed , and returns false , this will return userIgnored and avoid altering <nl> * the mode in any way . The argument is the fail point payload . <nl> * / <nl> + RetCode _slowShouldFailOpenBlockImpl ( std : : function < bool ( const BSONObj & ) > cb ) noexcept ; <nl> + <nl> + / * * <nl> + * slow path for # _shouldFailOpenBlock <nl> + * <nl> + * Calls _slowShouldFailOpenBlockImpl . If it returns slowOn , increments the number of times <nl> + * the fail point has been entered before returning the RetCode . <nl> + * / <nl> RetCode _slowShouldFailOpenBlock ( std : : function < bool ( const BSONObj & ) > cb ) noexcept ; <nl> <nl> / * * <nl> class FailPoint { <nl> / / 0 ~ 30 : unsigned ref counter for active dynamic instances . <nl> AtomicWord < std : : uint32_t > _fpInfo { 0 } ; <nl> <nl> + / / Total number of times the fail point has been entered . <nl> + AtomicWord < int64_t > _timesEntered { 0 } ; <nl> + <nl> / / Invariant : These should be read only if kActiveBit of _fpInfo is set . <nl> Mode _mode { off } ; <nl> AtomicWord < int > _timesOrPeriod { 0 } ; <nl> class FailPointEnableBlock { <nl> <nl> / * * <nl> * Set a fail point in the global registry to a given value via BSON <nl> + * @ return the number of times the fail point has been entered so far . <nl> * @ throw DBException corresponding to ErrorCodes : : FailPointSetFailed if no failpoint <nl> * called failPointName exists . <nl> * / <nl> - void setGlobalFailPoint ( const std : : string & failPointName , const BSONObj & cmdObj ) ; <nl> + int64_t setGlobalFailPoint ( const std : : string & failPointName , const BSONObj & cmdObj ) ; <nl> <nl> / * * <nl> * Registration object for FailPoint . Its static - initializer registers FailPoint ` fp ` <nl> mmm a / src / mongo / util / fail_point_test . cpp <nl> ppp b / src / mongo / util / fail_point_test . cpp <nl> <nl> # include < string > <nl> # include < vector > <nl> <nl> + # include " mongo / db / client . h " <nl> # include " mongo / platform / mutex . h " <nl> # include " mongo / stdx / thread . h " <nl> # include " mongo / unittest / unittest . h " <nl> + # include " mongo / util / clock_source_mock . h " <nl> # include " mongo / util / fail_point . h " <nl> # include " mongo / util / log . h " <nl> + # include " mongo / util / tick_source_mock . h " <nl> # include " mongo / util / time_support . h " <nl> <nl> using mongo : : BSONObj ; <nl> TEST ( FailPoint , FailPointBlockIfBasicTest ) { <nl> failPoint . executeIf ( [ ] ( auto & & ) { ASSERT ( ! " shouldn ' t get here " ) ; } , [ ] ( auto & & ) { return true ; } ) ; <nl> } <nl> } / / namespace mongo_test <nl> + <nl> + namespace mongo { <nl> + <nl> + TEST ( FailPoint , WaitForFailPointTimeout ) { <nl> + FailPoint failPoint ; <nl> + failPoint . setMode ( FailPoint : : alwaysOn ) ; <nl> + <nl> + const auto service = ServiceContext : : make ( ) ; <nl> + const std : : shared_ptr < ClockSourceMock > mockClock = std : : make_shared < ClockSourceMock > ( ) ; <nl> + service - > setFastClockSource ( std : : make_unique < SharedClockSourceAdapter > ( mockClock ) ) ; <nl> + service - > setPreciseClockSource ( std : : make_unique < SharedClockSourceAdapter > ( mockClock ) ) ; <nl> + service - > setTickSource ( std : : make_unique < TickSourceMock < > > ( ) ) ; <nl> + <nl> + const auto client = service - > makeClient ( " WaitForFailPointTest " ) ; <nl> + auto opCtx = client - > makeOperationContext ( ) ; <nl> + opCtx - > setDeadlineAfterNowBy ( Milliseconds { 999 } , ErrorCodes : : ExceededTimeLimit ) ; <nl> + <nl> + stdx : : thread waitForFailPoint ( [ & ] { <nl> + ASSERT_THROWS_CODE ( failPoint . waitForTimesEntered ( opCtx . get ( ) , 1 ) , <nl> + AssertionException , <nl> + ErrorCodes : : ExceededTimeLimit ) ; <nl> + } ) ; <nl> + <nl> + mockClock - > advance ( Milliseconds { 1000 } ) ; <nl> + waitForFailPoint . join ( ) ; <nl> + <nl> + failPoint . setMode ( FailPoint : : off ) ; <nl> + } <nl> + <nl> + } / / namespace mongo <nl> | SERVER - 39165 Add waitForFailpoint command and update non - repl tests | mongodb/mongo | f79498e9aa27765fc363fcb85a65f47af6e20ee1 | 2019-10-25T15:42:45Z |
mmm a / tensorflow / contrib / layers / python / layers / feature_column_ops_test . py <nl> ppp b / tensorflow / contrib / layers / python / layers / feature_column_ops_test . py <nl> def testSparseColumnWithKeys ( self ) : <nl> self . assertEqual ( len ( output ) , 1 ) <nl> self . assertIn ( keys_sparse , output ) <nl> with self . test_session ( ) : <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertEqual ( output [ keys_sparse ] . values . dtype , dtypes . int64 ) <nl> self . assertAllEqual ( output [ keys_sparse ] . values . eval ( ) , [ 1 , 2 , 0 ] ) <nl> self . assertAllEqual ( output [ keys_sparse ] . indices . eval ( ) , <nl> def testSparseColumnWithKeysWithDenseInputTensor ( self ) : <nl> output = feature_column_ops . _Transformer ( features ) . transform ( keys_sparse ) <nl> <nl> with self . test_session ( ) : <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> # While the input is a dense Tensor , the output should be a SparseTensor . <nl> self . assertIsInstance ( output , sparse_tensor . SparseTensor ) <nl> self . assertEqual ( output . dtype , dtypes . int64 ) <nl> def testWeightedSparseColumn ( self ) : <nl> self . assertIn ( weighted_ids , output ) <nl> <nl> with self . test_session ( ) : <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( output [ weighted_ids ] [ 0 ] . dense_shape . eval ( ) , <nl> ids_tensor . dense_shape . eval ( ) ) <nl> self . assertAllEqual ( output [ weighted_ids ] [ 0 ] . indices . eval ( ) , <nl> def testSparseColumnWithVocabulary ( self ) : <nl> self . assertEqual ( len ( output ) , 1 ) <nl> self . assertIn ( vocab_sparse , output ) <nl> with self . test_session ( ) : <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertEqual ( output [ vocab_sparse ] . values . dtype , dtypes . int64 ) <nl> self . assertAllEqual ( output [ vocab_sparse ] . values . eval ( ) , [ 1 , 2 , 0 ] ) <nl> self . assertAllEqual ( output [ vocab_sparse ] . indices . eval ( ) , <nl> def testSparseColumnWithVocabularyWithDenseInputTensor ( self ) : <nl> self . assertEqual ( len ( output ) , 1 ) <nl> self . assertIn ( vocab_sparse , output ) <nl> with self . test_session ( ) : <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertEqual ( output [ vocab_sparse ] . values . dtype , dtypes . int64 ) <nl> self . assertAllEqual ( output [ vocab_sparse ] . values . eval ( ) , [ 1 , 2 , 0 , 1 ] ) <nl> self . assertAllEqual ( output [ vocab_sparse ] . indices . eval ( ) , <nl> def testSparseIntColumnWithVocabulary ( self ) : <nl> self . assertEqual ( len ( output ) , 1 ) <nl> self . assertIn ( vocab_sparse , output ) <nl> with self . test_session ( ) : <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertEqual ( output [ vocab_sparse ] . values . dtype , dtypes . int64 ) <nl> self . assertAllEqual ( output [ vocab_sparse ] . values . eval ( ) , [ 1 , 2 , 0 ] ) <nl> self . assertAllEqual ( output [ vocab_sparse ] . indices . eval ( ) , <nl> def testSparseIntColumnWithVocabularyWithDenseInputTensor ( self ) : <nl> self . assertEqual ( len ( output ) , 1 ) <nl> self . assertIn ( vocab_sparse , output ) <nl> with self . test_session ( ) : <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertEqual ( output [ vocab_sparse ] . values . dtype , dtypes . int64 ) <nl> self . assertAllEqual ( output [ vocab_sparse ] . values . eval ( ) , [ 1 , 2 , 0 , 1 ] ) <nl> self . assertAllEqual ( output [ vocab_sparse ] . indices . eval ( ) , <nl> def testAllDNNColumns ( self ) : <nl> ] ) <nl> with self . test_session ( ) : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( output . eval ( ) . shape , [ 3 , 3 + 4 + 10 ] ) <nl> <nl> def testRealValuedColumn ( self ) : <nl> def testOneHotColumnFromWeightedSparseColumnSucceedsForDNN ( self ) : <nl> [ one_hot_column ] ) <nl> with self . test_session ( ) : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( [ [ 0 , 0 , 10 . , 0 ] , [ 0 , 20 . , 0 , 0 ] , [ 30 . , 0 , 40 . , 0 ] ] , <nl> output . eval ( ) ) <nl> <nl> def testOneHotColumnFromSparseColumnWithKeysSucceedsForDNN ( self ) : <nl> <nl> with self . test_session ( ) : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( [ [ 0 , 0 , 1 , 0 ] , [ 0 , 1 , 0 , 0 ] , [ 1 , 0 , 0 , 0 ] ] , <nl> output . eval ( ) ) <nl> <nl> def testOneHotColumnFromMultivalentSparseColumnWithKeysSucceedsForDNN ( self ) : <nl> <nl> with self . test_session ( ) : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( [ [ 0 , 0 , 1 , 0 ] , [ 0 , 1 , 0 , 0 ] , [ 1 , 0 , 1 , 0 ] ] , <nl> output . eval ( ) ) <nl> <nl> def testOneHotColumnFromSparseColumnWithHashBucketSucceedsForDNN ( self ) : <nl> [ one_hot_sparse ] ) <nl> with self . test_session ( ) : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( [ 3 , 10 ] , output . eval ( ) . shape ) <nl> <nl> def testEmbeddingColumnSucceedsForDNN ( self ) : <nl> def testEmbeddingColumnWithWeightedSparseColumnSucceedsForDNN ( self ) : <nl> [ embeded_sparse ] ) <nl> with self . test_session ( ) : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( output . eval ( ) . shape , [ 2 , 10 ] ) <nl> <nl> def testEmbeddingColumnWithCrossedColumnSucceedsForDNN ( self ) : <nl> def testWeightedSparseColumnFailsForDNN ( self ) : <nl> with self . assertRaisesRegexp ( <nl> ValueError , <nl> " Error creating input layer for column : ids_weighted_by_weights " ) : <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> feature_column_ops . input_from_feature_columns ( features , [ weighted_ids ] ) <nl> <nl> def testCrossedColumnFailsForDNN ( self ) : <nl> def testEmbeddingColumnWithWeightedSparseColumnForDNN ( self ) : <nl> [ embeded_sparse ] ) <nl> with self . test_session ( ) : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> # score : ( sum of weights ) <nl> self . assertAllEqual ( output . eval ( ) , [ [ 10 . ] , [ 50 . ] , [ 0 . ] ] ) <nl> <nl> def testOneHotColumnFromSparseColumnWithKeys ( self ) : <nl> <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> model_input = sess . run ( model_input_tensor ) <nl> <nl> expected_input_shape = np . array ( [ 4 , 3 , 4 ] ) <nl> def testOneHotColumnFromSparseColumnWithHashBucket ( self ) : <nl> <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> model_input = sess . run ( model_input_tensor ) <nl> <nl> expected_input_shape = np . array ( [ 4 , 3 , hash_buckets ] ) <nl> def testEmbeddingColumn ( self ) : <nl> <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> model_input = sess . run ( model_input_tensor ) <nl> <nl> self . assertAllEqual ( expected_input_shape , model_input . shape ) <nl> def testEmbeddingColumnGradient ( self ) : <nl> embedding_weights ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> model_input , gradients = sess . run ( [ model_input_tensor , gradient_tensor ] ) <nl> <nl> expected_input_shape = [ 4 , 3 , embedding_dimension ] <nl> def testMultipleColumns ( self ) : <nl> <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> model_input = sess . run ( model_input_tensor ) <nl> <nl> expected_input_shape = [ <nl> def testWeightedSparseColumn ( self ) : <nl> features , [ weighted_ids ] , num_outputs = 5 ) <nl> with self . test_session ( ) : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( logits . eval ( ) . shape , [ 2 , 5 ] ) <nl> <nl> def testWeightedSparseColumnWithDenseInputTensor ( self ) : <nl> def testWeightedSparseColumnWithDenseInputTensor ( self ) : <nl> <nl> with self . test_session ( ) : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( logits . eval ( ) . shape , [ 2 , 5 ] ) <nl> <nl> def testCrossedColumn ( self ) : <nl> def testSparseFeatureColumnWithVocabularyFile ( self ) : <nl> features , [ movies ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . initialize_all_variables ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> weights = column_to_variable [ movies ] [ 0 ] <nl> self . assertEqual ( weights . get_shape ( ) , ( 3 , 1 ) ) <nl> def testPredictions ( self ) : <nl> features , [ age , language ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> self . assertAllClose ( output . eval ( ) , [ [ 0 . ] , [ 0 . ] ] ) <nl> <nl> def testJointPredictions ( self ) : <nl> self . assertEqual ( len ( variables ) , 1 ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> self . assertAllClose ( output . eval ( ) , [ [ 0 . ] , [ 0 . ] ] ) <nl> <nl> def testPredictionsWithWeightedSparseColumn ( self ) : <nl> features , [ weighted_language ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> self . assertAllClose ( output . eval ( ) , [ [ 0 . ] , [ 0 . ] ] ) <nl> <nl> def testPredictionsWithMultivalentColumnButNoCross ( self ) : <nl> features , [ language ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> # score : 0 . 1 + language_weight [ ' hindi ' ] + language_weight [ ' english ' ] <nl> sess . run ( bias . assign ( [ 0 . 1 ] ) ) <nl> def testSparseFeatureColumnWithHashedBucketSize ( self ) : <nl> features , [ movies ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> weights = column_to_variable [ movies ] [ 0 ] <nl> self . assertEqual ( weights . get_shape ( ) , ( 15 , 1 ) ) <nl> def testCrossUsageInPredictions ( self ) : <nl> features , [ country_language ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> weights = column_to_variable [ country_language ] [ 0 ] <nl> sess . run ( weights . assign ( weights + 0 . 4 ) ) <nl> def testCrossColumnByItself ( self ) : <nl> features , [ language_language ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> weights = column_to_variable [ language_language ] [ 0 ] <nl> sess . run ( weights . assign ( weights + 0 . 4 ) ) <nl> def testMultivalentCrossUsageInPredictions ( self ) : <nl> features , [ country_language ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> weights = column_to_variable [ country_language ] [ 0 ] <nl> sess . run ( weights . assign ( weights + 0 . 4 ) ) <nl> def testMultivalentCrossUsageInPredictionsWithPartition ( self ) : <nl> scope = scope ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> self . assertEqual ( 2 , len ( column_to_variable [ country ] ) ) <nl> self . assertEqual ( 3 , len ( column_to_variable [ language ] ) ) <nl> def testRealValuedColumnHavingMultiDimensions ( self ) : <nl> features , [ country , age , incomes ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> incomes_weights = column_to_variable [ incomes ] [ 0 ] <nl> sess . run ( incomes_weights . assign ( [ [ 0 . 1 ] , [ 0 . 2 ] , [ 0 . 3 ] ] ) ) <nl> def testMulticlassWithRealValuedColumnHavingMultiDimensionsAndSparse ( self ) : <nl> features , [ country , age , height , incomes ] , num_outputs = 5 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> height_weights = column_to_variable [ height ] [ 0 ] <nl> sess . run ( <nl> def testBucketizedColumn ( self ) : <nl> features , [ bucket ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> sess . run ( column_to_variable [ bucket ] [ 0 ] . assign ( [ [ 0 . 1 ] , [ 0 . 2 ] , [ 0 . 3 ] , <nl> [ 0 . 4 ] ] ) ) <nl> def testBucketizedColumnHavingMultiDimensions ( self ) : <nl> features , [ bucket , country ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> # dimension = 2 , bucket_size = 4 , num_classes = 1 <nl> sess . run ( column_to_variable [ bucket ] [ 0 ] . assign ( <nl> def testMulticlassWithBucketizedColumnHavingMultiDimensions ( self ) : <nl> features , [ bucket , country ] , num_outputs = 5 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> # dimension = 2 , bucket_size = 4 , num_classes = 5 <nl> sess . run ( column_to_variable [ bucket ] [ 0 ] . assign ( <nl> def testCrossWithBucketizedColumn ( self ) : <nl> features , [ country_price ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> weights = column_to_variable [ country_price ] [ 0 ] <nl> sess . run ( weights . assign ( weights + 0 . 4 ) ) <nl> def testCrossWithCrossedColumn ( self ) : <nl> features , [ country_language_price ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> weights = column_to_variable [ country_language_price ] [ 0 ] <nl> sess . run ( weights . assign ( weights + 0 . 4 ) ) <nl> def testIntegerizedColumn ( self ) : <nl> features , [ product ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> product_weights = column_to_variable [ product ] [ 0 ] <nl> sess . run ( product_weights . assign ( [ [ 0 . 1 ] , [ 0 . 2 ] , [ 0 . 3 ] , [ 0 . 4 ] , [ 0 . 5 ] ] ) ) <nl> self . assertAllClose ( output . eval ( ) , [ [ 0 . 1 ] , [ 0 . 5 ] , [ 0 . 3 ] ] ) <nl> def testIntegerizedColumnWithDenseInputTensor ( self ) : <nl> features , [ product ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> product_weights = column_to_variable [ product ] [ 0 ] <nl> sess . run ( product_weights . assign ( [ [ 0 . 1 ] , [ 0 . 2 ] , [ 0 . 3 ] , [ 0 . 4 ] , [ 0 . 5 ] ] ) ) <nl> self . assertAllClose ( output . eval ( ) , [ [ 0 . 1 ] , [ 0 . 5 ] , [ 0 . 3 ] ] ) <nl> def testIntegerizedColumnWithDenseInputTensor2 ( self ) : <nl> features , [ product ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> product_weights = column_to_variable [ product ] [ 0 ] <nl> sess . run ( product_weights . assign ( [ [ 0 . 1 ] , [ 0 . 2 ] , [ 0 . 3 ] , [ 0 . 4 ] , [ 0 . 5 ] ] ) ) <nl> self . assertAllClose ( output . eval ( ) , [ [ 0 . 6 ] , [ 0 . 7 ] ] ) <nl> def testIntegerizedColumnWithInvalidId ( self ) : <nl> features , [ product ] , num_outputs = 1 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> product_weights = column_to_variable [ product ] [ 0 ] <nl> sess . run ( product_weights . assign ( [ [ 0 . 1 ] , [ 0 . 2 ] , [ 0 . 3 ] , [ 0 . 4 ] , [ 0 . 5 ] ] ) ) <nl> self . assertAllClose ( output . eval ( ) , [ [ 0 . 1 ] , [ 0 . 5 ] , [ 0 . 3 ] ] ) <nl> def testMulticlassWithOnlyBias ( self ) : <nl> features , [ feature_column . real_valued_column ( " age " ) ] , num_outputs = 3 ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> sess . run ( bias . assign ( [ 0 . 1 , 0 . 2 , 0 . 3 ] ) ) <nl> self . assertAllClose ( output . eval ( ) , [ [ 0 . 1 , 0 . 2 , 0 . 3 ] , [ 0 . 1 , 0 . 2 , 0 . 3 ] , <nl> [ 0 . 1 , 0 . 2 , 0 . 3 ] , [ 0 . 1 , 0 . 2 , 0 . 3 ] ] ) <nl> def testMulticlassWithRealValuedColumn ( self ) : <nl> features , [ column ] , num_outputs = 3 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> weights = column_to_variable [ column ] [ 0 ] <nl> self . assertEqual ( weights . get_shape ( ) , ( 1 , 3 ) ) <nl> sess . run ( weights . assign ( [ [ 0 . 01 , 0 . 03 , 0 . 05 ] ] ) ) <nl> def testMulticlassWithSparseColumn ( self ) : <nl> features , [ column ] , num_outputs = 3 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> weights = column_to_variable [ column ] [ 0 ] <nl> self . assertEqual ( weights . get_shape ( ) , ( 5 , 3 ) ) <nl> sess . run ( <nl> def testMulticlassWithBucketizedColumn ( self ) : <nl> features , [ column ] , num_outputs = 3 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> weights = column_to_variable [ column ] [ 0 ] <nl> self . assertEqual ( weights . get_shape ( ) , ( 5 , 3 ) ) <nl> def testMulticlassWithCrossedColumn ( self ) : <nl> features , [ column ] , num_outputs = 3 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> weights = column_to_variable [ column ] [ 0 ] <nl> self . assertEqual ( weights . get_shape ( ) , ( 5 , 3 ) ) <nl> def testMulticlassWithMultivalentColumn ( self ) : <nl> features , [ column ] , num_outputs = 3 ) ) <nl> with self . test_session ( ) as sess : <nl> variables_lib . global_variables_initializer ( ) . run ( ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> weights = column_to_variable [ column ] [ 0 ] <nl> self . assertEqual ( weights . get_shape ( ) , ( 5 , 3 ) ) <nl> def testParseExample ( self ) : <nl> self . assertIn ( bucket , output ) <nl> self . assertIn ( wire_cast , output ) <nl> with self . test_session ( ) : <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( output [ bucket ] . eval ( ) , [ [ 2 , 3 , 0 ] ] ) <nl> self . assertAllEqual ( output [ wire_cast ] . indices . eval ( ) , [ [ 0 , 0 ] , [ 0 , 1 ] ] ) <nl> self . assertAllEqual ( output [ wire_cast ] . values . eval ( ) , [ 2 , 0 ] ) <nl> mmm a / tensorflow / contrib / learn / python / learn / estimators / dynamic_rnn_estimator_test . py <nl> ppp b / tensorflow / contrib / learn / python / learn / estimators / dynamic_rnn_estimator_test . py <nl> def testBuildSequenceInputInput ( self ) : <nl> self . context_feature_columns ) <nl> with self . test_session ( ) as sess : <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - sess . run ( data_flow_ops . initialize_all_tables ( ) ) <nl> + sess . run ( data_flow_ops . tables_initializer ( ) ) <nl> sequence_input_val = sess . run ( sequence_input ) <nl> expected_shape = np . array ( [ <nl> 3 , # expected batch size <nl> def testConstructRNN ( self ) : <nl> # Obtain values of activations and final state . <nl> with session . Session ( ) as sess : <nl> sess . run ( variables . global_variables_initializer ( ) ) <nl> - sess . run ( data_flow_ops . initialize_all_tables ( ) ) <nl> + sess . run ( data_flow_ops . tables_initializer ( ) ) <nl> activations , final_state = sess . run ( [ activations_t , final_state_t ] ) <nl> <nl> expected_activations_shape = np . array ( [ 3 , 2 , self . NUM_LABEL_COLUMNS ] ) <nl> mmm a / tensorflow / contrib / learn / python / learn / estimators / estimator . py <nl> ppp b / tensorflow / contrib / learn / python / learn / estimators / estimator . py <nl> def export_savedmodel ( <nl> <nl> with tf_session . Session ( ' ' ) as session : <nl> variables . initialize_local_variables ( ) <nl> - data_flow_ops . initialize_all_tables ( ) <nl> + data_flow_ops . tables_initializer ( ) <nl> saver_for_restore = saver . Saver ( <nl> variables . global_variables ( ) , <nl> sharded = True ) <nl> def export_savedmodel ( <nl> <nl> init_op = control_flow_ops . group ( <nl> variables . local_variables_initializer ( ) , <nl> - data_flow_ops . initialize_all_tables ( ) ) <nl> + data_flow_ops . tables_initializer ( ) ) <nl> <nl> # Perform the export <nl> builder = saved_model_builder . SavedModelBuilder ( export_dir ) <nl> mmm a / tensorflow / contrib / learn / python / learn / graph_actions . py <nl> ppp b / tensorflow / contrib / learn / python / learn / graph_actions . py <nl> def _get_local_init_op ( ) : <nl> ops . GraphKeys . LOCAL_INIT_OP ) <nl> if local_init_op is None : <nl> op_list = [ variables . local_variables_initializer ( ) , <nl> - data_flow_ops . initialize_all_tables ( ) ] <nl> + data_flow_ops . tables_initializer ( ) ] <nl> if op_list : <nl> local_init_op = control_flow_ops . group ( * op_list ) <nl> ops . add_to_collection ( ops . GraphKeys . LOCAL_INIT_OP , local_init_op ) <nl> def run_feeds_iter ( output_dict , feed_dicts , restore_checkpoint_path = None ) : <nl> else : <nl> session . run ( variables . global_variables_initializer ( ) ) <nl> session . run ( variables . local_variables_initializer ( ) ) <nl> - session . run ( data_flow_ops . initialize_all_tables ( ) ) <nl> + session . run ( data_flow_ops . tables_initializer ( ) ) <nl> coord = coordinator . Coordinator ( ) <nl> threads = None <nl> try : <nl> mmm a / tensorflow / contrib / learn / python / learn / utils / export . py <nl> ppp b / tensorflow / contrib / learn / python / learn / utils / export . py <nl> def _export_graph ( graph , saver , checkpoint_path , export_dir , <nl> with graph . as_default ( ) : <nl> with tf_session . Session ( ' ' ) as session : <nl> variables . local_variables_initializer ( ) <nl> - data_flow_ops . initialize_all_tables ( ) <nl> + data_flow_ops . tables_initializer ( ) <nl> saver . restore ( session , checkpoint_path ) <nl> <nl> export = exporter . Exporter ( saver ) <nl> export . init ( init_op = control_flow_ops . group ( <nl> variables . local_variables_initializer ( ) , <nl> - data_flow_ops . initialize_all_tables ( ) ) , <nl> + data_flow_ops . tables_initializer ( ) ) , <nl> default_graph_signature = default_graph_signature , <nl> named_graph_signatures = named_graph_signatures , <nl> assets_collection = ops . get_collection ( <nl> mmm a / tensorflow / contrib / lookup / lookup_ops . py <nl> ppp b / tensorflow / contrib / lookup / lookup_ops . py <nl> def string_to_index_table_from_file ( vocabulary_file = None , <nl> The bucket ID range is ` [ vocabulary size , vocabulary size + num_oov_buckets ] ` . <nl> <nl> The underlying table must be initialized by calling <nl> - ` tf . initialize_all_tables . run ( ) ` or ` table . init . run ( ) ` once . <nl> + ` tf . tables_initializer . run ( ) ` or ` table . init . run ( ) ` once . <nl> <nl> Sample Usages : <nl> <nl> def string_to_index_table_from_file ( vocabulary_file = None , <nl> vocabulary_file = " test . txt " , num_oov_buckets = 1 ) <nl> ids = table . lookup ( features ) <nl> . . . <nl> - tf . initialize_all_tables ( ) . run ( ) <nl> + tf . tables_initializer ( ) . run ( ) <nl> <nl> ids . eval ( ) = = > [ 0 , 1 , 3 , 2 ] # where 3 is the out - of - vocabulary bucket <nl> ` ` ` <nl> def string_to_index_table_from_tensor ( mapping , <nl> The bucket ID range is ` [ mapping size , mapping size + num_oov_buckets ] ` . <nl> <nl> The underlying table must be initialized by calling <nl> - ` tf . initialize_all_tables . run ( ) ` or ` table . init . run ( ) ` once . <nl> + ` tf . tables_initializer . run ( ) ` or ` table . init . run ( ) ` once . <nl> <nl> Elements in ` mapping ` cannot have duplicates , otherwise when executing the <nl> table initializer op , it will throw a ` FailedPreconditionError ` . <nl> def string_to_index_table_from_tensor ( mapping , <nl> features = tf . constant ( [ " emerson " , " lake " , " and " , " palmer " ] ) <nl> ids = table . lookup ( features ) <nl> . . . <nl> - tf . initialize_all_tables ( ) . run ( ) <nl> + tf . tables_initializer ( ) . run ( ) <nl> <nl> ids . eval ( ) = = > [ 0 , 1 , 4 , 2 ] <nl> ` ` ` <nl> def string_to_index ( tensor , mapping , default_value = - 1 , name = None ) : <nl> will throw a FailedPreconditionError . <nl> <nl> The underlying table must be initialized by calling <nl> - ` tf . initialize_all_tables . run ( ) ` once . <nl> + ` tf . tables_initializer . run ( ) ` once . <nl> <nl> For example : <nl> <nl> def string_to_index ( tensor , mapping , default_value = - 1 , name = None ) : <nl> ids = tf . contrib . lookup . string_to_index ( <nl> feats , mapping = mapping_strings , default_value = - 1 ) <nl> . . . <nl> - tf . initialize_all_tables ( ) . run ( ) <nl> + tf . tables_initializer ( ) . run ( ) <nl> <nl> ids . eval ( ) = = > [ 0 , 1 , - 1 , 2 ] <nl> ` ` ` <nl> def index_to_string_table_from_file ( vocabulary_file , <nl> ( an out - of - vocabulary entry ) is assigned the ` default_value ` <nl> <nl> The underlying table must be initialized by calling <nl> - ` tf . initialize_all_tables . run ( ) ` or ` table . init . run ( ) ` once . <nl> + ` tf . tables_initializer . run ( ) ` or ` table . init . run ( ) ` once . <nl> <nl> Sample Usages : <nl> <nl> def index_to_string_table_from_file ( vocabulary_file , <nl> vocabulary_file = " test . txt " , default_value = " UNKNOWN " ) <nl> values = table . lookup ( indices ) <nl> . . . <nl> - tf . initialize_all_tables ( ) . run ( ) <nl> + tf . tables_initializer ( ) . run ( ) <nl> <nl> values . eval ( ) = = > [ " lake " , " UNKNOWN " ] <nl> ` ` ` <nl> def index_to_string_table_from_tensor ( mapping , default_value = " UNK " , name = None ) : <nl> ( an out - of - vocabulary entry ) is assigned the ` default_value ` <nl> <nl> The underlying table must be initialized by calling <nl> - ` tf . initialize_all_tables . run ( ) ` or ` table . init . run ( ) ` once . <nl> + ` tf . tables_initializer . run ( ) ` or ` table . init . run ( ) ` once . <nl> <nl> Elements in ` mapping ` cannot have duplicates , otherwise when executing the <nl> table initializer op , it will throw a ` FailedPreconditionError ` . <nl> def index_to_string_table_from_tensor ( mapping , default_value = " UNK " , name = None ) : <nl> mapping_string , default_value = " UNKNOWN " ) <nl> values = table . lookup ( indices ) <nl> . . . <nl> - tf . initialize_all_tables ( ) . run ( ) <nl> + tf . tables_initializer ( ) . run ( ) <nl> <nl> values . eval ( ) = = > [ " lake " , " UNKNOWN " ] <nl> ` ` ` <nl> def index_to_string ( tensor , mapping , default_value = " UNK " , name = None ) : <nl> ( an out - of - vocabulary entry ) is assigned the ` default_value ` <nl> <nl> The underlying table must be initialized by calling <nl> - ` tf . initialize_all_tables . run ( ) ` once . <nl> + ` tf . tables_initializer . run ( ) ` once . <nl> <nl> For example : <nl> <nl> def index_to_string ( tensor , mapping , default_value = " UNK " , name = None ) : <nl> values = tf . contrib . lookup . index_to_string ( <nl> indices , mapping = mapping_string , default_value = " UNKNOWN " ) <nl> . . . <nl> - tf . initialize_all_tables ( ) . run ( ) <nl> + tf . tables_initializer ( ) . run ( ) <nl> <nl> values . eval ( ) = = > [ " lake " , " UNKNOWN " ] <nl> ` ` ` <nl> mmm a / tensorflow / contrib / lookup / lookup_ops_test . py <nl> ppp b / tensorflow / contrib / lookup / lookup_ops_test . py <nl> def testMultipleHashTables ( self ) : <nl> table3 = lookup_ops . HashTable ( <nl> lookup_ops . KeyValueTensorInitializer ( keys , values ) , default_val ) <nl> <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( 3 , table1 . size ( ) . eval ( ) ) <nl> self . assertAllEqual ( 3 , table2 . size ( ) . eval ( ) ) <nl> self . assertAllEqual ( 3 , table3 . size ( ) . eval ( ) ) <nl> def test_string_to_index_table_from_file ( self ) : <nl> ids = table . lookup ( constant_op . constant ( [ " salad " , " surgery " , " tarkus " ] ) ) <nl> <nl> self . assertRaises ( errors_impl . OpError , ids . eval ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( ( 1 , 2 , 3 ) , ids . eval ( ) ) <nl> <nl> def test_string_to_index_table_from_file_with_default_value ( self ) : <nl> def test_string_to_index_table_from_file_with_default_value ( self ) : <nl> ids = table . lookup ( constant_op . constant ( [ " salad " , " surgery " , " tarkus " ] ) ) <nl> <nl> self . assertRaises ( errors_impl . OpError , ids . eval ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( ( 1 , 2 , default_value ) , ids . eval ( ) ) <nl> <nl> def test_string_to_index_table_from_file_with_oov_buckets ( self ) : <nl> def test_string_to_index_table_from_file_with_oov_buckets ( self ) : <nl> constant_op . constant ( [ " salad " , " surgery " , " tarkus " , " toccata " ] ) ) <nl> <nl> self . assertRaises ( errors_impl . OpError , ids . eval ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( <nl> ( <nl> 1 , # From vocabulary file . <nl> def test_string_to_index_table_from_file_with_vocab_size_too_small ( self ) : <nl> ids = table . lookup ( constant_op . constant ( [ " salad " , " surgery " , " tarkus " ] ) ) <nl> <nl> self . assertRaises ( errors_impl . OpError , ids . eval ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( ( 1 , - 1 , - 1 ) , ids . eval ( ) ) <nl> self . assertEqual ( 2 , table . size ( ) . eval ( ) ) <nl> <nl> def test_string_to_index_table_from_file_with_vocab_size ( self ) : <nl> ids = table . lookup ( constant_op . constant ( [ " salad " , " surgery " , " tarkus " ] ) ) <nl> <nl> self . assertRaises ( errors_impl . OpError , ids . eval ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( ( 1 , 2 , - 1 ) , ids . eval ( ) ) <nl> self . assertEqual ( 3 , table . size ( ) . eval ( ) ) <nl> <nl> def test_string_to_index_table_from_tensor_with_tensor_init ( self ) : <nl> ids = table . lookup ( constant_op . constant ( [ " salad " , " surgery " , " tarkus " ] ) ) <nl> <nl> self . assertRaises ( errors_impl . OpError , ids . eval ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( ( 1 , 2 , 3 ) , ids . eval ( ) ) <nl> <nl> def test_string_to_index_table_from_tensor_with_default_value ( self ) : <nl> def test_string_to_index_table_from_tensor_with_default_value ( self ) : <nl> ids = table . lookup ( constant_op . constant ( [ " salad " , " surgery " , " tarkus " ] ) ) <nl> <nl> self . assertRaises ( errors_impl . OpError , ids . eval ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( ( 1 , 2 , default_value ) , ids . eval ( ) ) <nl> <nl> def test_string_to_index_table_from_tensor_with_only_oov_buckets ( self ) : <nl> def test_string_to_index ( self ) : <nl> indices = lookup_ops . string_to_index ( feats , mapping = mapping_strings ) <nl> <nl> self . assertRaises ( errors_impl . OpError , indices . eval ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> self . assertAllEqual ( ( 1 , 2 , - 1 ) , indices . eval ( ) ) <nl> <nl> def test_duplicate_entries ( self ) : <nl> indices = lookup_ops . string_to_index ( feats , mapping = mapping_strings ) <nl> <nl> self . assertRaises ( errors_impl . OpError , <nl> - data_flow_ops . initialize_all_tables ( ) . run ) <nl> + data_flow_ops . tables_initializer ( ) . run ) <nl> <nl> def test_string_to_index_with_default_value ( self ) : <nl> default_value = - 42 <nl> def test_string_to_index_with_default_value ( self ) : <nl> feats , mapping = mapping_strings , default_value = default_value ) <nl> self . assertRaises ( errors_impl . OpError , indices . eval ) <nl> <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( ( 1 , 2 , default_value ) , indices . eval ( ) ) <nl> <nl> <nl> def test_index_to_string_table ( self ) : <nl> vocabulary_file = vocabulary_file ) <nl> features = table . lookup ( constant_op . constant ( [ 0 , 1 , 2 , 3 ] , dtypes . int64 ) ) <nl> self . assertRaises ( errors_impl . OpError , features . eval ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( ( b " brain " , b " salad " , b " surgery " , b " UNK " ) , <nl> features . eval ( ) ) <nl> <nl> def test_index_to_string_table_with_default_value ( self ) : <nl> vocabulary_file = vocabulary_file , default_value = default_value ) <nl> features = table . lookup ( constant_op . constant ( [ 1 , 2 , 4 ] , dtypes . int64 ) ) <nl> self . assertRaises ( errors_impl . OpError , features . eval ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( ( b " salad " , b " surgery " , default_value ) , <nl> features . eval ( ) ) <nl> <nl> def test_index_to_string_table_with_vocab_size_too_small ( self ) : <nl> default_value = default_value ) <nl> features = table . lookup ( constant_op . constant ( [ 1 , 2 , 4 ] , dtypes . int64 ) ) <nl> self . assertRaises ( errors_impl . OpError , features . eval ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( ( b " salad " , default_value , default_value ) , <nl> features . eval ( ) ) <nl> <nl> def test_index_to_string_table_with_vocab_size_too_large ( self ) : <nl> features = table . lookup ( constant_op . constant ( [ 1 , 2 , 4 ] , dtypes . int64 ) ) <nl> <nl> self . assertRaises ( errors_impl . OpError , features . eval ) <nl> - init = data_flow_ops . initialize_all_tables ( ) <nl> + init = data_flow_ops . tables_initializer ( ) <nl> self . assertRaisesRegexp ( errors_impl . InvalidArgumentError , <nl> " Invalid vocab_size " , init . run ) <nl> <nl> def test_index_to_string_table_with_vocab_size ( self ) : <nl> features = table . lookup ( constant_op . constant ( [ 1 , 2 , 4 ] , dtypes . int64 ) ) <nl> <nl> self . assertRaises ( errors_impl . OpError , features . eval ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( ( b " salad " , b " surgery " , b " UNK " ) , features . eval ( ) ) <nl> <nl> <nl> def test_index_to_string_table_from_tensor ( self ) : <nl> indices = constant_op . constant ( [ 0 , 1 , 2 , 3 ] , dtypes . int64 ) <nl> features = table . lookup ( indices ) <nl> self . assertRaises ( errors_impl . OpError , features . eval ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> self . assertAllEqual ( ( b " brain " , b " salad " , b " surgery " , b " UNK " ) , <nl> features . eval ( ) ) <nl> def test_duplicate_entries ( self ) : <nl> mapping = mapping_strings ) <nl> indices = constant_op . constant ( [ 0 , 1 , 4 ] , dtypes . int64 ) <nl> features = table . lookup ( indices ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( ( b " hello " , b " hello " , b " UNK " ) , features . eval ( ) ) <nl> <nl> def test_index_to_string_with_default_value ( self ) : <nl> def test_index_to_string_with_default_value ( self ) : <nl> features = table . lookup ( indices ) <nl> self . assertRaises ( errors_impl . OpError , features . eval ) <nl> <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( ( b " salad " , b " surgery " , default_value ) , <nl> features . eval ( ) ) <nl> <nl> def test_index_to_string ( self ) : <nl> feats = lookup_ops . index_to_string ( indices , mapping = mapping_strings ) <nl> <nl> self . assertRaises ( errors_impl . OpError , feats . eval ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> self . assertAllEqual ( ( b " brain " , b " salad " , b " surgery " , b " UNK " ) , <nl> feats . eval ( ) ) <nl> def test_duplicate_entries ( self ) : <nl> mapping_strings = constant_op . constant ( [ " hello " , " hello " ] ) <nl> indices = constant_op . constant ( [ 0 , 1 , 4 ] , dtypes . int64 ) <nl> feats = lookup_ops . index_to_string ( indices , mapping = mapping_strings ) <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( ( b " hello " , b " hello " , b " UNK " ) , feats . eval ( ) ) <nl> <nl> self . assertRaises ( errors_impl . OpError , <nl> - data_flow_ops . initialize_all_tables ( ) . run ) <nl> + data_flow_ops . tables_initializer ( ) . run ) <nl> <nl> def test_index_to_string_with_default_value ( self ) : <nl> default_value = b " NONE " <nl> def test_index_to_string_with_default_value ( self ) : <nl> indices , mapping = mapping_strings , default_value = default_value ) <nl> self . assertRaises ( errors_impl . OpError , feats . eval ) <nl> <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> self . assertAllEqual ( ( b " salad " , b " surgery " , default_value ) , feats . eval ( ) ) <nl> <nl> <nl> def testInitializeSameTableWithMultipleNodes ( self ) : <nl> default_value , <nl> shared_name = shared_name ) <nl> <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> input_string = constant_op . constant ( [ " brain " , " salad " , " tank " ] ) <nl> <nl> def testIdTableWithHashBucketsWithMultipleInitializers ( self ) : <nl> hasher_spec = lookup_ops . StrongHashSpec ( ( 1 , 2 ) ) , <nl> name = " table2 " ) <nl> <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> input_string = constant_op . constant ( <nl> [ " fruit " , " brain " , " salad " , " surgery " , " UNK " ] ) <nl> def testIdTableWithHashBucketsWithMultipleInitializersDifferentDefault ( self ) : <nl> default_value2 ) , <nl> oov_buckets ) <nl> <nl> - data_flow_ops . initialize_all_tables ( ) . run ( ) <nl> + data_flow_ops . tables_initializer ( ) . run ( ) <nl> <nl> input_string_1 = constant_op . constant ( <nl> [ " brain " , " salad " , " surgery " , " UNK " ] ) <nl> mmm a / tensorflow / contrib / slim / python / slim / learning . py <nl> ppp b / tensorflow / contrib / slim / python / slim / learning . py <nl> def train ( train_op , <nl> init_feed_dict : A feed dictionary to use when executing the ` init_op ` . <nl> local_init_op : The local initialization operation . If left to its default <nl> value , then the session is initialized by calling <nl> - ` tf . local_variables_initializer ( ) ` and ` tf . initialize_all_tables ( ) ` . <nl> + ` tf . local_variables_initializer ( ) ` and ` tf . tables_initializer ( ) ` . <nl> init_fn : An optional callable to be executed after ` init_op ` is called . The <nl> callable must accept one argument , the session being initialized . <nl> ready_op : Operation to check if the model is ready to use . If left to its <nl> def train ( train_op , <nl> if local_init_op = = _USE_DEFAULT : <nl> local_init_op = control_flow_ops . group ( <nl> tf_variables . local_variables_initializer ( ) , <nl> - data_flow_ops . initialize_all_tables ( ) ) <nl> + data_flow_ops . tables_initializer ( ) ) <nl> <nl> if sync_optimizer is not None and isinstance ( <nl> sync_optimizer , sync_replicas_optimizer . SyncReplicasOptimizer ) : <nl> mmm a / tensorflow / python / framework / gen_docs_combined . py <nl> ppp b / tensorflow / python / framework / gen_docs_combined . py <nl> def library ( name , title , module = None , * * args ) : <nl> " Inputs and Readers " , <nl> exclude_symbols = [ " LookupTableBase " , " HashTable " , <nl> " initialize_all_tables " , <nl> + " tables_initializer " , <nl> " parse_single_sequence_example " , <nl> " string_to_hash_bucket " ] , <nl> prefix = PREFIX_TEXT ) , <nl> mmm a / tensorflow / python / ops / data_flow_ops . py <nl> ppp b / tensorflow / python / ops / data_flow_ops . py <nl> <nl> # pylint : disable = wildcard - import <nl> from tensorflow . python . ops . gen_data_flow_ops import * <nl> # pylint : enable = wildcard - import <nl> + from tensorflow . python . util . deprecation import deprecated <nl> <nl> <nl> def _as_type_list ( dtypes ) : <nl> def incomplete_size ( self , name = None ) : <nl> self . _barrier_ref , name = name ) <nl> <nl> <nl> + @ deprecated ( " 2017 - 03 - 02 " , " Use ` tf . tables_initializer ` instead . " ) <nl> def initialize_all_tables ( name = " init_all_tables " ) : <nl> " " " Returns an Op that initializes all tables of the default graph . <nl> <nl> + Args : <nl> + name : Optional name for the initialization op . <nl> + <nl> + Returns : <nl> + An Op that initializes all tables . Note that if there are <nl> + not tables the returned Op is a NoOp . <nl> + " " " <nl> + return tables_initializer ( name ) <nl> + <nl> + <nl> + def tables_initializer ( name = " init_all_tables " ) : <nl> + " " " Returns an Op that initializes all tables of the default graph . <nl> + <nl> Args : <nl> name : Optional name for the initialization op . <nl> <nl> mmm a / tensorflow / python / ops / state_ops . py <nl> ppp b / tensorflow / python / ops / state_ops . py <nl> <nl> # # # Read - only Lookup Tables <nl> <nl> @ @ initialize_all_tables <nl> + @ @ tables_initializer <nl> <nl> <nl> # # Exporting and Importing Meta Graphs <nl> mmm a / tensorflow / python / saved_model / main_op . py <nl> ppp b / tensorflow / python / saved_model / main_op . py <nl> def main_op ( ) : <nl> " " " <nl> init = variables . global_variables_initializer ( ) <nl> init_local = variables . local_variables_initializer ( ) <nl> - init_tables = tf_data_flow_ops . initialize_all_tables ( ) <nl> + init_tables = tf_data_flow_ops . tables_initializer ( ) <nl> return control_flow_ops . group ( init , init_local , init_tables ) <nl> <nl> <nl> mmm a / tensorflow / python / training / monitored_session . py <nl> ppp b / tensorflow / python / training / monitored_session . py <nl> def get_or_default ( arg_name , collection_key , default_constructor ) : <nl> @ staticmethod <nl> def _default_local_init_op ( ) : <nl> return control_flow_ops . group ( variables . local_variables_initializer ( ) , <nl> - data_flow_ops . initialize_all_tables ( ) ) <nl> + data_flow_ops . tables_initializer ( ) ) <nl> <nl> <nl> def MonitoredTrainingSession ( master = ' ' , # pylint : disable = invalid - name <nl> mmm a / tensorflow / python / training / supervisor . py <nl> ppp b / tensorflow / python / training / supervisor . py <nl> def _init_local_init_op ( self , local_init_op = USE_DEFAULT ) : <nl> ops . GraphKeys . LOCAL_INIT_OP ) <nl> if local_init_op is None : <nl> op_list = [ variables . local_variables_initializer ( ) , <nl> - data_flow_ops . initialize_all_tables ( ) ] <nl> + data_flow_ops . tables_initializer ( ) ] <nl> if op_list : <nl> local_init_op = control_flow_ops . group ( * op_list ) <nl> ops . add_to_collection ( ops . GraphKeys . LOCAL_INIT_OP , local_init_op ) <nl> | Add tf . tables_initializer as a replacement for tf . initialize_all_tables , and | tensorflow/tensorflow | 9654cf9e2d555076548483a05e90d6581befdc95 | 2017-01-15T17:07:24Z |
mmm a / CMakeLists . txt <nl> ppp b / CMakeLists . txt <nl> if ( CXX_SUPPORTS_DOCUMENTATION_FLAG ) <nl> set ( CMAKE_CXX_FLAGS " $ { CMAKE_CXX_FLAGS } - Wdocumentation " ) <nl> endif ( ) <nl> <nl> + check_cxx_compiler_flag ( " - Werror - Wimplicit - fallthrough " CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG ) <nl> + append_if ( CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG " - Wimplicit - fallthrough " CMAKE_CXX_FLAGS ) <nl> + <nl> # Set sizeof ( void * ) if cross - compiling . <nl> if ( CMAKE_CROSSCOMPILING AND NOT CMAKE_SIZEOF_VOID_P ) <nl> if ( CMAKE_SYSTEM_PROCESSOR MATCHES " 64 $ " ) <nl> | Add - Wimplicit - fallthrough to list of warnings used by CMake build . | apple/swift | 4baea1eb88a81f0bf7f90e3e85f07762d50084ec | 2014-03-14T00:27:40Z |
mmm a / hphp / compiler / statement / method_statement . cpp <nl> ppp b / hphp / compiler / statement / method_statement . cpp <nl> void MethodStatement : : inferFunctionTypes ( AnalysisResultPtr ar ) { <nl> } <nl> if ( ! lastIsReturn ) { <nl> ExpressionPtr constant = <nl> - makeConstant ( ar , funcScope - > inPseudoMain ( ) ? " true " : " null " ) ; <nl> + makeScalarExpression ( ar , funcScope - > inPseudoMain ( ) ? <nl> + Variant ( 1 ) : Variant ( Variant : : nullInit ) ) ; <nl> ReturnStatementPtr returnStmt = <nl> ReturnStatementPtr ( <nl> new ReturnStatement ( getScope ( ) , getLocation ( ) , constant ) ) ; <nl> mmm a / hphp / test / quick / include . php <nl> ppp b / hphp / test / quick / include . php <nl> function foo ( ) { <nl> $ path = __DIR__ . ' / include . 3 . inc ' ; <nl> require $ path ; <nl> <nl> + if ( 0 ) { <nl> + / / to ensure we include the file in <nl> + / / RepoAuthoritative mode <nl> + require ' include . 3 . inc ' ; <nl> + } <nl> | Fix a couple of include tests in repo mode | facebook/hhvm | a988bdb73e0b9c318196911206dbae3840c039d4 | 2013-04-20T00:13:23Z |
mmm a / CMakeLists . txt <nl> ppp b / CMakeLists . txt <nl> if ( ENABLE_SDL2 ) <nl> set ( SDL2_INCLUDE_DIR " $ { SDL2_PREFIX } / include " CACHE PATH " Path to SDL2 headers " ) <nl> set ( SDL2_LIBRARY " $ { SDL2_PREFIX } / lib / x64 / SDL2 . lib " CACHE PATH " Path to SDL2 library " ) <nl> set ( SDL2_DLL_DIR " $ { SDL2_PREFIX } / lib / x64 / " CACHE PATH " Path to SDL2 . dll " ) <nl> - else ( ) <nl> - find_package ( SDL2 REQUIRED ) <nl> - endif ( ) <nl> <nl> - if ( SDL2_FOUND ) <nl> - # TODO ( yuriks ) : Make FindSDL2 . cmake export an IMPORTED library instead <nl> add_library ( SDL2 INTERFACE ) <nl> target_link_libraries ( SDL2 INTERFACE " $ { SDL2_LIBRARY } " ) <nl> target_include_directories ( SDL2 INTERFACE " $ { SDL2_INCLUDE_DIR } " ) <nl> + else ( ) <nl> + find_package ( SDL2 REQUIRED ) <nl> + include_directories ( $ { SDL2_INCLUDE_DIRS } ) <nl> + <nl> + add_library ( SDL2 INTERFACE ) <nl> + target_link_libraries ( SDL2 INTERFACE " $ { SDL2_LIBRARIES } " ) <nl> endif ( ) <nl> else ( ) <nl> set ( SDL2_FOUND NO ) <nl> deleted file mode 100644 <nl> index 22ce752c510 . . 00000000000 <nl> mmm a / externals / cmake - modules / FindSDL2 . cmake <nl> ppp / dev / null <nl> <nl> - <nl> - # This module defines <nl> - # SDL2_LIBRARY , the name of the library to link against <nl> - # SDL2_FOUND , if false , do not try to link to SDL2 <nl> - # SDL2_INCLUDE_DIR , where to find SDL . h <nl> - # SDL2_DLL_DIR , where to find SDL2 . dll if it exists <nl> - # <nl> - # This module responds to the the flag : <nl> - # SDL2_BUILDING_LIBRARY <nl> - # If this is defined , then no SDL2main will be linked in because <nl> - # only applications need main ( ) . <nl> - # Otherwise , it is assumed you are building an application and this <nl> - # module will attempt to locate and set the the proper link flags <nl> - # as part of the returned SDL2_LIBRARY variable . <nl> - # <nl> - # Don ' t forget to include SDLmain . h and SDLmain . m your project for the <nl> - # OS X framework based version . ( Other versions link to - lSDL2main which <nl> - # this module will try to find on your behalf . ) Also for OS X , this <nl> - # module will automatically add the - framework Cocoa on your behalf . <nl> - # <nl> - # <nl> - # Additional Note : If you see an empty SDL2_LIBRARY_TEMP in your configuration <nl> - # and no SDL2_LIBRARY , it means CMake did not find your SDL2 library <nl> - # ( SDL2 . dll , libsdl2 . so , SDL2 . framework , etc ) . <nl> - # Set SDL2_LIBRARY_TEMP to point to your SDL2 library , and configure again . <nl> - # Similarly , if you see an empty SDL2MAIN_LIBRARY , you should set this value <nl> - # as appropriate . These values are used to generate the final SDL2_LIBRARY <nl> - # variable , but when these values are unset , SDL2_LIBRARY does not get created . <nl> - # <nl> - # <nl> - # $ SDL2DIR is an environment variable that would <nl> - # correspond to the . / configure - - prefix = $ SDL2DIR <nl> - # used in building SDL2 . <nl> - # l . e . galup 9 - 20 - 02 <nl> - # <nl> - # Modified by Eric Wing . <nl> - # Added code to assist with automated building by using environmental variables <nl> - # and providing a more controlled / consistent search behavior . <nl> - # Added new modifications to recognize OS X frameworks and <nl> - # additional Unix paths ( FreeBSD , etc ) . <nl> - # Also corrected the header search path to follow " proper " SDL guidelines . <nl> - # Added a search for SDL2main which is needed by some platforms . <nl> - # Added a search for threads which is needed by some platforms . <nl> - # Added needed compile switches for MinGW . <nl> - # <nl> - # On OSX , this will prefer the Framework version ( if found ) over others . <nl> - # People will have to manually change the cache values of <nl> - # SDL2_LIBRARY to override this selection or set the CMake environment <nl> - # CMAKE_INCLUDE_PATH to modify the search paths . <nl> - # <nl> - # Note that the header path has changed from SDL2 / SDL . h to just SDL . h <nl> - # This needed to change because " proper " SDL convention <nl> - # is # include " SDL . h " , not < SDL2 / SDL . h > . This is done for portability <nl> - # reasons because not all systems place things in SDL2 / ( see FreeBSD ) . <nl> - <nl> - # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - # Copyright 2003 - 2009 Kitware , Inc . <nl> - # <nl> - # Distributed under the OSI - approved BSD License ( the " License " ) . <nl> - # <nl> - # This software is distributed WITHOUT ANY WARRANTY ; without even the <nl> - # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . <nl> - # See the License for more information . <nl> - # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - # CMake - Cross Platform Makefile Generator <nl> - # Copyright 2000 - 2016 Kitware , Inc . <nl> - # Copyright 2000 - 2011 Insight Software Consortium <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions <nl> - # are met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # <nl> - # * Redistributions in binary form must reproduce the above copyright <nl> - # notice , this list of conditions and the following disclaimer in the <nl> - # documentation and / or other materials provided with the distribution . <nl> - # <nl> - # * Neither the names of Kitware , Inc . , the Insight Software Consortium , <nl> - # nor the names of their contributors may be used to endorse or promote <nl> - # products derived from this software without specific prior written <nl> - # permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - # <nl> - # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - # <nl> - # The above copyright and license notice applies to distributions of <nl> - # CMake in source and binary form . Some source files contain additional <nl> - # notices of original copyright by their contributors ; see each source <nl> - # for details . Third - party software packages supplied with CMake under <nl> - # compatible licenses provide their own copyright notices documented in <nl> - # corresponding subdirectories . <nl> - # <nl> - # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - # <nl> - # CMake was initially developed by Kitware with the following sponsorship : <nl> - # <nl> - # * National Library of Medicine at the National Institutes of Health <nl> - # as part of the Insight Segmentation and Registration Toolkit ( ITK ) . <nl> - # <nl> - # * US National Labs ( Los Alamos , Livermore , Sandia ) ASC Parallel <nl> - # Visualization Initiative . <nl> - # <nl> - # * National Alliance for Medical Image Computing ( NAMIC ) is funded by the <nl> - # National Institutes of Health through the NIH Roadmap for Medical Research , <nl> - # Grant U54 EB005149 . <nl> - # <nl> - # * Kitware , Inc . <nl> - # <nl> - <nl> - message ( " < FindSDL2 . cmake > " ) <nl> - <nl> - SET ( SDL2_SEARCH_PATHS <nl> - ~ / Library / Frameworks <nl> - / Library / Frameworks <nl> - / usr / local <nl> - / usr <nl> - / sw # Fink <nl> - / opt / local # DarwinPorts <nl> - / opt / csw # Blastwave <nl> - / opt <nl> - $ { SDL2_PATH } <nl> - ) <nl> - <nl> - if ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) <nl> - set ( VC_LIB_PATH_SUFFIX lib / x64 ) <nl> - else ( ) <nl> - set ( VC_LIB_PATH_SUFFIX lib / x86 ) <nl> - endif ( ) <nl> - <nl> - FIND_LIBRARY ( SDL2_LIBRARY_TEMP <nl> - NAMES SDL2 <nl> - HINTS <nl> - $ ENV { SDL2DIR } <nl> - PATH_SUFFIXES lib64 lib $ { VC_LIB_PATH_SUFFIX } <nl> - PATHS $ { SDL2_SEARCH_PATHS } <nl> - ) <nl> - <nl> - IF ( SDL2_LIBRARY_TEMP ) <nl> - if ( MSVC ) <nl> - get_filename_component ( SDL2_DLL_DIR_TEMP $ { SDL2_LIBRARY_TEMP } DIRECTORY ) <nl> - if ( EXISTS $ { SDL2_DLL_DIR_TEMP } / SDL2 . dll ) <nl> - set ( SDL2_DLL_DIR $ { SDL2_DLL_DIR_TEMP } ) <nl> - unset ( SDL2_DLL_DIR_TEMP ) <nl> - endif ( ) <nl> - endif ( ) <nl> - <nl> - FIND_PATH ( SDL2_INCLUDE_DIR SDL . h <nl> - HINTS <nl> - $ ENV { SDL2DIR } <nl> - PATH_SUFFIXES include / SDL2 include <nl> - PATHS $ { SDL2_SEARCH_PATHS } <nl> - ) <nl> - <nl> - IF ( NOT SDL2_BUILDING_LIBRARY ) <nl> - IF ( NOT $ { SDL2_INCLUDE_DIR } MATCHES " . framework " ) <nl> - # Non - OS X framework versions expect you to also dynamically link to <nl> - # SDL2main . This is mainly for Windows and OS X . Other ( Unix ) platforms <nl> - # seem to provide SDL2main for compatibility even though they don ' t <nl> - # necessarily need it . <nl> - FIND_LIBRARY ( SDL2MAIN_LIBRARY <nl> - NAMES SDL2main <nl> - HINTS <nl> - $ ENV { SDL2DIR } <nl> - PATH_SUFFIXES lib64 lib <nl> - PATHS $ { SDL2_SEARCH_PATHS } <nl> - ) <nl> - ENDIF ( NOT $ { SDL2_INCLUDE_DIR } MATCHES " . framework " ) <nl> - ENDIF ( NOT SDL2_BUILDING_LIBRARY ) <nl> - <nl> - # SDL2 may require threads on your system . <nl> - # The Apple build may not need an explicit flag because one of the <nl> - # frameworks may already provide it . <nl> - # But for non - OSX systems , I will use the CMake Threads package . <nl> - IF ( NOT APPLE ) <nl> - FIND_PACKAGE ( Threads ) <nl> - ENDIF ( NOT APPLE ) <nl> - <nl> - # MinGW needs an additional library , mwindows <nl> - # It ' s total link flags should look like - lmingw32 - lSDL2main - lSDL2 - lmwindows <nl> - # ( Actually on second look , I think it only needs one of the m * libraries . ) <nl> - IF ( MINGW ) <nl> - SET ( MINGW32_LIBRARY mingw32 CACHE STRING " mwindows for MinGW " ) <nl> - ENDIF ( MINGW ) <nl> - <nl> - # For SDL2main <nl> - IF ( NOT SDL2_BUILDING_LIBRARY ) <nl> - IF ( SDL2MAIN_LIBRARY ) <nl> - SET ( SDL2_LIBRARY_TEMP $ { SDL2MAIN_LIBRARY } $ { SDL2_LIBRARY_TEMP } ) <nl> - ENDIF ( SDL2MAIN_LIBRARY ) <nl> - ENDIF ( NOT SDL2_BUILDING_LIBRARY ) <nl> - <nl> - # For OS X , SDL2 uses Cocoa as a backend so it must link to Cocoa . <nl> - # CMake doesn ' t display the - framework Cocoa string in the UI even <nl> - # though it actually is there if I modify a pre - used variable . <nl> - # I think it has something to do with the CACHE STRING . <nl> - # So I use a temporary variable until the end so I can set the <nl> - # " real " variable in one - shot . <nl> - IF ( APPLE ) <nl> - SET ( SDL2_LIBRARY_TEMP $ { SDL2_LIBRARY_TEMP } " - framework Cocoa " ) <nl> - ENDIF ( APPLE ) <nl> - <nl> - # For threads , as mentioned Apple doesn ' t need this . <nl> - # In fact , there seems to be a problem if I used the Threads package <nl> - # and try using this line , so I ' m just skipping it entirely for OS X . <nl> - IF ( NOT APPLE ) <nl> - SET ( SDL2_LIBRARY_TEMP $ { SDL2_LIBRARY_TEMP } $ { CMAKE_THREAD_LIBS_INIT } ) <nl> - ENDIF ( NOT APPLE ) <nl> - <nl> - # For MinGW library <nl> - IF ( MINGW ) <nl> - SET ( SDL2_LIBRARY_TEMP $ { MINGW32_LIBRARY } $ { SDL2_LIBRARY_TEMP } ) <nl> - ENDIF ( MINGW ) <nl> - <nl> - # Set the final string here so the GUI reflects the final state . <nl> - SET ( SDL2_LIBRARY $ { SDL2_LIBRARY_TEMP } CACHE STRING " Where the SDL2 Library can be found " ) <nl> - <nl> - # Unset the temp variable to INTERNAL so it is not seen in the CMake GUI <nl> - UNSET ( SDL2_LIBRARY_TEMP ) <nl> - ENDIF ( SDL2_LIBRARY_TEMP ) <nl> - <nl> - message ( " < / FindSDL2 . cmake > " ) <nl> - <nl> - INCLUDE ( FindPackageHandleStandardArgs ) <nl> - <nl> - FIND_PACKAGE_HANDLE_STANDARD_ARGS ( SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR ) <nl> | Merge pull request from brianclinkenbeard / fix - cmake - sdl2 | yuzu-emu/yuzu | 4501bd8ca953749282bca6f2f9d24768800d1982 | 2020-02-14T14:11:47Z |
mmm a / tensorflow / core / BUILD <nl> ppp b / tensorflow / core / BUILD <nl> tf_cuda_library ( <nl> " framework / resource_mgr . h " , <nl> " framework / selective_registration . h " , <nl> " framework / session_state . h " , <nl> + " framework / shape_inference . h " , <nl> " framework / tensor . h " , <nl> " framework / tensor_shape . h " , <nl> " framework / tensor_slice . h " , <nl> filegroup ( <nl> " framework / rendezvous . h " , <nl> " framework / selective_registration . h " , <nl> " framework / session_state . h " , <nl> + " framework / shape_inference . h " , <nl> " framework / tensor . h " , <nl> " framework / tensor_reference . h " , <nl> " framework / tensor_shape . h " , <nl> new file mode 100644 <nl> index 0000000000000 . . 8c86207d6c660 <nl> mmm / dev / null <nl> ppp b / tensorflow / core / framework / shape_inference . cc <nl> <nl> + / * Copyright 2016 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + # include " tensorflow / core / framework / shape_inference . h " <nl> + <nl> + # include " tensorflow / core / lib / strings / numbers . h " <nl> + # include " tensorflow / core / lib / strings / scanner . h " <nl> + # include " tensorflow / core / lib / strings / str_util . h " <nl> + <nl> + namespace tensorflow { <nl> + namespace shape_inference { <nl> + <nl> + constexpr int32 InferenceContext : : kUnknownRank ; <nl> + constexpr int64 InferenceContext : : kUnknownDim ; <nl> + <nl> + InferenceContext : : InferenceContext ( const std : : vector < string > & input_shapes , <nl> + int num_outputs ) { <nl> + for ( const string & spec : input_shapes ) { <nl> + if ( spec = = " ? " ) { <nl> + inputs_ . push_back ( CreateUnknownShape ( ) ) ; <nl> + } else { <nl> + std : : vector < const Dimension * > dims ; <nl> + strings : : Scanner scanner ( spec ) ; <nl> + scanner . OneLiteral ( " [ " ) ; <nl> + while ( scanner . Peek ( ) ! = ' ] ' ) { <nl> + if ( scanner . Peek ( ) = = ' ? ' ) { <nl> + scanner . OneLiteral ( " ? " ) ; <nl> + dims . push_back ( CreateUnknownDim ( ) ) ; <nl> + } else { <nl> + scanner . RestartCapture ( ) . Many ( strings : : Scanner : : DIGIT ) ; <nl> + StringPiece match ; <nl> + int64 dim_size = 0 ; <nl> + CHECK ( scanner . GetResult ( nullptr , & match ) & & <nl> + strings : : safe_strto64 ( match , & dim_size ) ) <nl> + < < spec ; <nl> + dims . push_back ( CreateDim ( dim_size ) ) ; <nl> + } <nl> + <nl> + if ( scanner . Peek ( ) = = ' , ' ) { <nl> + scanner . OneLiteral ( " , " ) ; <nl> + } else { <nl> + CHECK_EQ ( scanner . Peek ( ) , ' ] ' ) ; <nl> + } <nl> + } <nl> + CHECK ( scanner . OneLiteral ( " ] " ) . Eos ( ) . GetResult ( ) ) < < spec ; <nl> + inputs_ . push_back ( CreateShape ( dims ) ) ; <nl> + } <nl> + } <nl> + <nl> + for ( int i = 0 ; i < num_outputs ; + + i ) { <nl> + outputs_ . push_back ( CreateUnknownShape ( ) ) ; <nl> + } <nl> + } <nl> + <nl> + InferenceContext : : ~ InferenceContext ( ) { <nl> + for ( auto * s : all_shapes_ ) delete s ; <nl> + for ( auto * d : all_dims_ ) delete d ; <nl> + } <nl> + <nl> + string InferenceContext : : DebugString ( const Shape * s ) { <nl> + if ( RankKnown ( s ) ) { <nl> + std : : vector < string > vals ; <nl> + for ( auto d : s - > dims_ ) vals . push_back ( DebugString ( d ) ) ; <nl> + return strings : : StrCat ( " [ " , str_util : : Join ( vals , " , " ) , " ] " ) ; <nl> + } else { <nl> + return " ? " ; <nl> + } <nl> + } <nl> + <nl> + string InferenceContext : : DebugString ( const Dimension * d ) { <nl> + return ValueKnown ( d ) ? strings : : StrCat ( Value ( d ) ) : " ? " ; <nl> + } <nl> + <nl> + / / If < shape > has rank < rank > , or its rank is unknown , return OK and return <nl> + / / the shape with asserted rank in < * out > . Otherwise return an error . <nl> + Status InferenceContext : : WithRank ( const Shape * shape , int32 rank , <nl> + const Shape * * out ) { <nl> + const int32 existing = Rank ( shape ) ; <nl> + if ( existing = = rank ) { <nl> + * out = shape ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + if ( existing = = kUnknownRank ) { <nl> + std : : vector < const Dimension * > dims ; <nl> + dims . reserve ( rank ) ; <nl> + for ( int i = 0 ; i < rank ; + + i ) { <nl> + all_dims_ . push_back ( new Dimension ( ) ) ; <nl> + dims . push_back ( all_dims_ . back ( ) ) ; <nl> + } <nl> + all_shapes_ . push_back ( new Shape ( dims ) ) ; <nl> + * out = all_shapes_ . back ( ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + * out = nullptr ; <nl> + return errors : : InvalidArgument ( " Shape must be rank " , rank , " but is rank " , <nl> + existing ) ; <nl> + } <nl> + <nl> + Status InferenceContext : : WithValue ( const Dimension * dim , int64 value , <nl> + const Dimension * * out ) { <nl> + const int64 existing = Value ( dim ) ; <nl> + if ( existing = = value ) { <nl> + * out = dim ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + if ( existing = = kUnknownDim ) { <nl> + all_dims_ . push_back ( new Dimension ( value ) ) ; <nl> + * out = all_dims_ . back ( ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + * out = nullptr ; <nl> + return errors : : InvalidArgument ( " Dimension must be size " , value , <nl> + " but is size " , existing ) ; <nl> + } <nl> + <nl> + Status InferenceContext : : Merge ( const Dimension * d0 , const Dimension * d1 , <nl> + const Dimension * * out ) { <nl> + if ( d0 = = d1 | | ! ValueKnown ( d1 ) ) { <nl> + * out = d0 ; <nl> + return Status : : OK ( ) ; <nl> + } else if ( ! ValueKnown ( d0 ) ) { <nl> + * out = d1 ; <nl> + return Status : : OK ( ) ; <nl> + } else if ( Value ( d0 ) = = Value ( d1 ) ) { <nl> + * out = d0 ; <nl> + return Status : : OK ( ) ; <nl> + } else { <nl> + * out = nullptr ; <nl> + return errors : : InvalidArgument ( " Dimensions must be equal size , but are " , <nl> + Value ( d0 ) , " and " , Value ( d1 ) ) ; <nl> + } <nl> + } <nl> + <nl> + Status InferenceContext : : Merge ( const Shape * s0 , const Shape * s1 , <nl> + const Shape * * out ) { <nl> + if ( s0 = = s1 | | ! RankKnown ( s1 ) ) { <nl> + * out = s0 ; <nl> + return Status : : OK ( ) ; <nl> + } else if ( ! RankKnown ( s0 ) ) { <nl> + * out = s1 ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + const int32 rank = Rank ( s0 ) ; <nl> + if ( rank ! = Rank ( s1 ) ) { <nl> + * out = nullptr ; <nl> + return errors : : InvalidArgument ( " Shapes must be equal rank , but are " , rank , <nl> + " and " , Rank ( s1 ) ) ; <nl> + } <nl> + <nl> + bool return_s0 = true ; <nl> + bool return_s1 = true ; <nl> + for ( int i = 0 ; i < rank ; + + i ) { <nl> + auto d0 = Dim ( s0 , i ) ; <nl> + auto d1 = Dim ( s1 , i ) ; <nl> + if ( d0 = = d1 ) continue ; <nl> + <nl> + auto v0 = Value ( d0 ) ; <nl> + auto v1 = Value ( d1 ) ; <nl> + if ( v0 = = kUnknownDim ) { <nl> + if ( v1 ! = kUnknownDim ) { <nl> + return_s0 = false ; <nl> + } <nl> + } else if ( v1 = = kUnknownDim ) { <nl> + return_s1 = false ; <nl> + } else if ( v0 ! = v1 ) { <nl> + * out = nullptr ; <nl> + return errors : : InvalidArgument ( " Dimensions must be equal size , but are " , <nl> + Value ( d0 ) , " and " , Value ( d1 ) ) ; <nl> + } <nl> + } <nl> + if ( return_s0 | | return_s1 ) { <nl> + * out = return_s0 ? s0 : s1 ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + / / Merge dims . <nl> + std : : vector < const Dimension * > dims ( rank , nullptr ) ; <nl> + for ( int i = 0 ; i < rank ; + + i ) { <nl> + / / Invariant for merge was checked earlier , so CHECK is ok . <nl> + TF_CHECK_OK ( Merge ( Dim ( s0 , i ) , Dim ( s1 , i ) , & dims [ i ] ) ) ; <nl> + } <nl> + * out = CreateShape ( dims ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + const Shape * InferenceContext : : CreateShape ( <nl> + const std : : vector < const Dimension * > & dims ) { <nl> + all_shapes_ . push_back ( new Shape ( dims ) ) ; <nl> + return all_shapes_ . back ( ) ; <nl> + } <nl> + <nl> + const Shape * InferenceContext : : CreateUnknownShape ( ) { <nl> + all_shapes_ . push_back ( new Shape ( ) ) ; <nl> + return all_shapes_ . back ( ) ; <nl> + } <nl> + <nl> + const Dimension * InferenceContext : : CreateDim ( int64 value ) { <nl> + all_dims_ . push_back ( new Dimension ( value ) ) ; <nl> + return all_dims_ . back ( ) ; <nl> + } <nl> + <nl> + const Dimension * InferenceContext : : CreateUnknownDim ( ) { <nl> + all_dims_ . push_back ( new Dimension ( ) ) ; <nl> + return all_dims_ . back ( ) ; <nl> + } <nl> + <nl> + } / / namespace shape_inference <nl> + } / / namespace tensorflow <nl> new file mode 100644 <nl> index 0000000000000 . . 397840f639cc6 <nl> mmm / dev / null <nl> ppp b / tensorflow / core / framework / shape_inference . h <nl> <nl> + / * Copyright 2016 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + # ifndef THIRD_PARTY_TENSORFLOW_CORE_FRAMEWORK_SHAPE_INFERENCE_H_ <nl> + # define THIRD_PARTY_TENSORFLOW_CORE_FRAMEWORK_SHAPE_INFERENCE_H_ <nl> + <nl> + # include < vector > <nl> + <nl> + # include " tensorflow / core / framework / tensor . h " <nl> + # include " tensorflow / core / lib / core / status . h " <nl> + # include " tensorflow / core / lib / gtl / inlined_vector . h " <nl> + # include " tensorflow / core / platform / macros . h " <nl> + <nl> + namespace tensorflow { <nl> + namespace shape_inference { <nl> + <nl> + class InferenceContext ; <nl> + <nl> + / / Dimension values are accessed through InferenceContext . <nl> + class Dimension { <nl> + private : <nl> + Dimension ( ) ; <nl> + Dimension ( int64 value ) ; <nl> + ~ Dimension ( ) { } <nl> + <nl> + const int64 value_ ; <nl> + <nl> + friend class InferenceContext ; <nl> + TF_DISALLOW_COPY_AND_ASSIGN ( Dimension ) ; <nl> + } ; <nl> + <nl> + / / Shape rank and dimensions are accessed through InferenceContext . <nl> + class Shape { <nl> + private : <nl> + Shape ( ) ; <nl> + Shape ( std : : vector < const Dimension * > dims ) ; <nl> + ~ Shape ( ) { } <nl> + <nl> + const int32 rank_ ; <nl> + const std : : vector < const Dimension * > dims_ ; <nl> + <nl> + friend class InferenceContext ; <nl> + TF_DISALLOW_COPY_AND_ASSIGN ( Shape ) ; <nl> + } ; <nl> + <nl> + / / Note : This is experimental support for op shape inference in C + + . Shape <nl> + / / inference functions are not ready to be implemented yet . <nl> + / / <nl> + / / An InferenceContext is created by the framework and passed to a shape <nl> + / / inference function . The shape inference function calls functions on the <nl> + / / context , and should call set_output ( ) to set the shape on all outputs . <nl> + / / <nl> + / / All Shape * and Dimension * returned by functions of InferenceContext are owned <nl> + / / by the InferenceContext . <nl> + class InferenceContext { <nl> + public : <nl> + static constexpr int32 kUnknownRank = - 1 ; <nl> + static constexpr int64 kUnknownDim = - 1 ; <nl> + <nl> + / / This is a temporary constructor used for initial testing . <nl> + / / <nl> + / / TODO ( cwhipkey ) : remove this temporary constructor . <nl> + / / <nl> + / / Each input shape describes the input shape as follows : <nl> + / / * " ? " : the shape ' s rank and dimensions are unknown <nl> + / / * " [ 1 , ? , 3 ] " : the shape ' s rank is known , and dimensions can be known or <nl> + / / unknown ( ? for unknown # 1 - multiple dimensions can be <nl> + / / labeled with the same unknown number , and are deduplicated to <nl> + / / the same Dimension * . <nl> + InferenceContext ( const std : : vector < string > & input_shapes , int num_outputs ) ; <nl> + ~ InferenceContext ( ) ; <nl> + <nl> + const Shape * input ( int idx ) const { return inputs_ [ idx ] ; } <nl> + int num_inputs ( ) const { return inputs_ . size ( ) ; } <nl> + <nl> + void set_output ( int idx , const Shape * shape ) ; <nl> + int num_outputs ( ) const { return outputs_ . size ( ) ; } <nl> + <nl> + / / idx can be negative for an offset from end of dimensions . <nl> + const Dimension * Dim ( const Shape * s , int32 idx ) { return s - > dims_ [ idx ] ; } <nl> + int32 Rank ( const Shape * s ) { return s - > rank_ ; } <nl> + bool RankKnown ( const Shape * s ) { return Rank ( s ) ! = kUnknownRank ; } <nl> + int64 Value ( const Dimension * d ) { return d - > value_ ; } <nl> + bool ValueKnown ( const Dimension * d ) { return Value ( d ) ! = kUnknownDim ; } <nl> + <nl> + string DebugString ( const Shape * s ) ; <nl> + string DebugString ( const Dimension * d ) ; <nl> + <nl> + / / If < shape > has rank < rank > , or its rank is unknown , return OK and return <nl> + / / the shape with asserted rank in < * out > . Otherwise return an error . <nl> + / / <nl> + / / Note that < * out > may be set to < shape > . <nl> + Status WithRank ( const Shape * shape , int32 rank , <nl> + const Shape * * out ) TF_MUST_USE_RESULT ; <nl> + <nl> + / / If < dim > has value < value > , or its value is unknown , returns OK and returns <nl> + / / the dimension with asserted value in < * out > . Otherwise returns an error . <nl> + / / <nl> + / / Note that < * out > may be set to < dim > . <nl> + Status WithValue ( const Dimension * dim , int64 value , <nl> + const Dimension * * out ) TF_MUST_USE_RESULT ; <nl> + <nl> + / / Merges < in0 > and < in1 > and returns the merged shape in < * out > . If < in0 > and <nl> + / / < in1 > are incompatible in rank , or in the value of any dimension , returns <nl> + / / an error . <nl> + / / <nl> + / / Note that < * out > may be set to < in0 > or < in1 > . <nl> + Status Merge ( const Shape * in0 , const Shape * in1 , <nl> + const Shape * * out ) TF_MUST_USE_RESULT ; <nl> + <nl> + / / Merges < d0 > and < d1 > and returns the merged dimension in < * out > . If < d0 > <nl> + / / and < d1 > have incompatible values , returns an error . <nl> + / / <nl> + / / Note that < * out > may be set to < d0 > or < d1 > . <nl> + Status Merge ( const Dimension * d0 , const Dimension * d1 , <nl> + const Dimension * * out ) TF_MUST_USE_RESULT ; <nl> + <nl> + / / Returns a new shape with the given dims . The returned value is owned by <nl> + / / this context . <nl> + const Shape * CreateShape ( const std : : vector < const Dimension * > & dims ) ; <nl> + const Shape * CreateUnknownShape ( ) ; <nl> + <nl> + / / Returns a new dimension of the given size . The returned value is owned by <nl> + / / this context . <nl> + const Dimension * CreateDim ( int64 value ) ; <nl> + const Dimension * CreateUnknownDim ( ) ; <nl> + <nl> + private : <nl> + std : : vector < Shape * > all_shapes_ ; / / values are owned . <nl> + std : : vector < Dimension * > all_dims_ ; / / values are owned . <nl> + <nl> + / / inputs_ and outputs_ refer to values from all_shapes_ . <nl> + std : : vector < const Shape * > inputs_ ; <nl> + std : : vector < const Shape * > outputs_ ; <nl> + <nl> + TF_DISALLOW_COPY_AND_ASSIGN ( InferenceContext ) ; <nl> + } ; <nl> + <nl> + inline Dimension : : Dimension ( ) : value_ ( InferenceContext : : kUnknownDim ) { } <nl> + inline Dimension : : Dimension ( int64 value ) : value_ ( value ) { } <nl> + <nl> + inline Shape : : Shape ( ) : rank_ ( InferenceContext : : kUnknownRank ) { } <nl> + inline Shape : : Shape ( const std : : vector < const Dimension * > dims ) <nl> + : rank_ ( dims . size ( ) ) , dims_ ( dims ) { } <nl> + <nl> + } / / namespace shape_inference <nl> + } / / namespace tensorflow <nl> + <nl> + # endif / / THIRD_PARTY_TENSORFLOW_CORE_FRAMEWORK_SHAPE_INFERENCE_H_ <nl> new file mode 100644 <nl> index 0000000000000 . . 3d048b62ce1ac <nl> mmm / dev / null <nl> ppp b / tensorflow / core / framework / shape_inference_test . cc <nl> <nl> + / * Copyright 2016 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + # include " tensorflow / core / framework / shape_inference . h " <nl> + <nl> + # include " tensorflow / core / platform / test . h " <nl> + <nl> + namespace tensorflow { <nl> + namespace shape_inference { <nl> + <nl> + TEST ( ShapeInferenceTest , RankAndDimInspection ) { <nl> + InferenceContext c ( { " ? " , " [ 1 , ? , 3 ] " , " [ ] " } , 2 / * num_outputs * / ) ; <nl> + EXPECT_EQ ( 3 , c . num_inputs ( ) ) ; <nl> + EXPECT_EQ ( 2 , c . num_outputs ( ) ) ; <nl> + <nl> + auto in0 = c . input ( 0 ) ; <nl> + EXPECT_EQ ( " ? " , c . DebugString ( in0 ) ) ; <nl> + EXPECT_FALSE ( c . RankKnown ( in0 ) ) ; <nl> + EXPECT_EQ ( InferenceContext : : kUnknownRank , c . Rank ( in0 ) ) ; <nl> + <nl> + auto in1 = c . input ( 1 ) ; <nl> + EXPECT_EQ ( " [ 1 , ? , 3 ] " , c . DebugString ( in1 ) ) ; <nl> + EXPECT_TRUE ( c . RankKnown ( in1 ) ) ; <nl> + EXPECT_EQ ( 3 , c . Rank ( in1 ) ) ; <nl> + auto d = c . Dim ( in1 , 0 ) ; <nl> + EXPECT_EQ ( 1 , c . Value ( d ) ) ; <nl> + EXPECT_TRUE ( c . ValueKnown ( d ) ) ; <nl> + EXPECT_EQ ( " 1 " , c . DebugString ( d ) ) ; <nl> + d = c . Dim ( in1 , 1 ) ; <nl> + EXPECT_EQ ( InferenceContext : : kUnknownDim , c . Value ( d ) ) ; <nl> + EXPECT_FALSE ( c . ValueKnown ( d ) ) ; <nl> + EXPECT_EQ ( " ? " , c . DebugString ( d ) ) ; <nl> + d = c . Dim ( in1 , 2 ) ; <nl> + EXPECT_EQ ( 3 , c . Value ( d ) ) ; <nl> + EXPECT_TRUE ( c . ValueKnown ( d ) ) ; <nl> + EXPECT_EQ ( " 3 " , c . DebugString ( d ) ) ; <nl> + <nl> + auto in2 = c . input ( 2 ) ; <nl> + EXPECT_EQ ( " [ ] " , c . DebugString ( in2 ) ) ; <nl> + EXPECT_TRUE ( c . RankKnown ( in2 ) ) ; <nl> + EXPECT_EQ ( 0 , c . Rank ( in2 ) ) ; <nl> + } <nl> + <nl> + TEST ( ShapeInferenceTest , WithRank ) { <nl> + InferenceContext c ( { " ? " , " [ 1 , ? , 3 ] " } , 2 / * num_outputs * / ) ; <nl> + <nl> + auto in0 = c . input ( 0 ) ; <nl> + auto in1 = c . input ( 1 ) ; <nl> + const Shape * s1 = nullptr ; <nl> + const Shape * s2 = nullptr ; <nl> + <nl> + / / WithRank on a shape with unknown dimensionality always succeeds . <nl> + EXPECT_TRUE ( c . WithRank ( in0 , 1 , & s1 ) . ok ( ) ) ; <nl> + EXPECT_EQ ( " [ ? ] " , c . DebugString ( s1 ) ) ; <nl> + <nl> + EXPECT_TRUE ( c . WithRank ( in0 , 2 , & s2 ) . ok ( ) ) ; <nl> + EXPECT_EQ ( " [ ? , ? ] " , c . DebugString ( s2 ) ) ; <nl> + EXPECT_TRUE ( s1 ! = s2 ) ; / / different pointers <nl> + EXPECT_TRUE ( c . Dim ( s2 , 0 ) ! = c . Dim ( s2 , 1 ) ) ; / / different pointers . <nl> + <nl> + EXPECT_TRUE ( c . WithRank ( in0 , 1 , & s2 ) . ok ( ) ) ; <nl> + EXPECT_EQ ( " [ ? ] " , c . DebugString ( s2 ) ) ; <nl> + EXPECT_TRUE ( s1 ! = s2 ) ; / / different pointers <nl> + <nl> + EXPECT_TRUE ( c . WithRank ( in0 , 0 , & s1 ) . ok ( ) ) ; <nl> + EXPECT_EQ ( " [ ] " , c . DebugString ( s1 ) ) ; <nl> + <nl> + / / WithRank on shape with known dimensionality . <nl> + s1 = in1 ; <nl> + EXPECT_EQ ( " Invalid argument : Shape must be rank 2 but is rank 3 " , <nl> + c . WithRank ( in1 , 2 , & s1 ) . ToString ( ) ) ; <nl> + EXPECT_TRUE ( s1 = = nullptr ) ; <nl> + EXPECT_TRUE ( c . WithRank ( in1 , 3 , & s1 ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( s1 = = in1 ) ; / / same pointers <nl> + <nl> + / / Inputs are unchanged . <nl> + EXPECT_EQ ( " ? " , c . DebugString ( in0 ) ) ; <nl> + EXPECT_EQ ( " [ 1 , ? , 3 ] " , c . DebugString ( in1 ) ) ; <nl> + } <nl> + <nl> + TEST ( ShapeInferenceTest , WithValue ) { <nl> + InferenceContext c ( { " [ 1 , ? ] " } , 2 / * num_outputs * / ) ; <nl> + <nl> + auto d0 = c . Dim ( c . input ( 0 ) , 0 ) ; <nl> + auto d1 = c . Dim ( c . input ( 0 ) , 1 ) ; <nl> + const Dimension * out1 = nullptr ; <nl> + const Dimension * out2 = nullptr ; <nl> + <nl> + / / WithRank on a dimension with unknown value always succeeds . <nl> + EXPECT_TRUE ( c . WithValue ( d1 , 1 , & out1 ) . ok ( ) ) ; <nl> + EXPECT_EQ ( 1 , c . Value ( out1 ) ) ; <nl> + <nl> + EXPECT_TRUE ( c . WithValue ( d1 , 2 , & out2 ) . ok ( ) ) ; <nl> + EXPECT_EQ ( 2 , c . Value ( out2 ) ) ; <nl> + EXPECT_TRUE ( out1 ! = out2 ) ; / / different pointers <nl> + EXPECT_TRUE ( out1 ! = d1 ) ; / / different pointers <nl> + <nl> + EXPECT_TRUE ( c . WithValue ( d1 , 1 , & out2 ) . ok ( ) ) ; <nl> + EXPECT_EQ ( 1 , c . Value ( out2 ) ) ; <nl> + EXPECT_TRUE ( out1 ! = out2 ) ; / / different pointers <nl> + <nl> + / / WithRank on dimension with known size . <nl> + out1 = d0 ; <nl> + EXPECT_EQ ( " Invalid argument : Dimension must be size 0 but is size 1 " , <nl> + c . WithValue ( d0 , 0 , & out1 ) . ToString ( ) ) ; <nl> + EXPECT_TRUE ( out1 = = nullptr ) ; <nl> + out1 = d0 ; <nl> + EXPECT_EQ ( " Invalid argument : Dimension must be size 2 but is size 1 " , <nl> + c . WithValue ( d0 , 2 , & out1 ) . ToString ( ) ) ; <nl> + EXPECT_TRUE ( out1 = = nullptr ) ; <nl> + EXPECT_TRUE ( c . WithValue ( d0 , 1 , & out1 ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( d0 = = out1 ) ; / / same pointers <nl> + <nl> + / / Inputs are unchanged . <nl> + EXPECT_EQ ( " 1 " , c . DebugString ( d0 ) ) ; <nl> + EXPECT_EQ ( " ? " , c . DebugString ( d1 ) ) ; <nl> + } <nl> + <nl> + TEST ( ShapeInferenceTest , MergeDim ) { <nl> + InferenceContext c ( { " [ 2 , ? , 2 , 1 , ? ] " } , 2 / * num_outputs * / ) ; <nl> + <nl> + auto d2 = c . Dim ( c . input ( 0 ) , 0 ) ; <nl> + auto d_unknown = c . Dim ( c . input ( 0 ) , 1 ) ; <nl> + auto d2_b = c . Dim ( c . input ( 0 ) , 2 ) ; <nl> + auto d1 = c . Dim ( c . input ( 0 ) , 3 ) ; <nl> + auto d_unknown_b = c . Dim ( c . input ( 0 ) , 4 ) ; <nl> + const Dimension * out = nullptr ; <nl> + <nl> + / / Merging anything with unknown returns the same pointer . <nl> + EXPECT_TRUE ( c . Merge ( d2 , d_unknown , & out ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( d2 = = out ) ; <nl> + EXPECT_TRUE ( c . Merge ( d_unknown , d2 , & out ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( d2 = = out ) ; <nl> + EXPECT_TRUE ( c . Merge ( d_unknown , d_unknown_b , & out ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( d_unknown = = out ) ; <nl> + <nl> + / / Merging with self returns self . <nl> + EXPECT_TRUE ( c . Merge ( d2 , d2 , & out ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( d2 = = out ) ; <nl> + EXPECT_TRUE ( c . Merge ( d_unknown , d_unknown , & out ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( d_unknown = = out ) ; <nl> + <nl> + / / Merging equal values returns first one . <nl> + EXPECT_TRUE ( c . Merge ( d2 , d2_b , & out ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( d2 = = out ) ; <nl> + EXPECT_TRUE ( c . Merge ( d2_b , d2 , & out ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( d2_b = = out ) ; <nl> + <nl> + / / Merging inequal values is an error . <nl> + EXPECT_EQ ( " Invalid argument : Dimensions must be equal size , but are 2 and 1 " , <nl> + c . Merge ( d2 , d1 , & out ) . ToString ( ) ) ; <nl> + EXPECT_TRUE ( out = = nullptr ) ; <nl> + EXPECT_EQ ( " Invalid argument : Dimensions must be equal size , but are 1 and 2 " , <nl> + c . Merge ( d1 , d2 , & out ) . ToString ( ) ) ; <nl> + EXPECT_TRUE ( out = = nullptr ) ; <nl> + } <nl> + <nl> + TEST ( ShapeInferenceTest , MergeShape ) { <nl> + InferenceContext c ( { " ? " , " [ 1 , 2 ] " , " [ ? , 2 ] " , " [ 1 , ? ] " , " [ 1 , 3 ] " , " ? " , " [ 1 ] " } , <nl> + 2 / * num_outputs * / ) ; <nl> + <nl> + auto s_unknown = c . input ( 0 ) ; <nl> + auto s_1_2 = c . input ( 1 ) ; <nl> + auto s_u_2 = c . input ( 2 ) ; <nl> + auto s_1_u = c . input ( 3 ) ; <nl> + auto s_1_3 = c . input ( 4 ) ; <nl> + auto s_unknown_b = c . input ( 5 ) ; <nl> + auto s_1 = c . input ( 6 ) ; <nl> + const Shape * out = nullptr ; <nl> + <nl> + / / Merging any shape with unknown returns the shape . <nl> + EXPECT_TRUE ( c . Merge ( s_unknown , s_1_2 , & out ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( s_1_2 = = out ) ; <nl> + EXPECT_TRUE ( c . Merge ( s_u_2 , s_unknown , & out ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( s_u_2 = = out ) ; <nl> + EXPECT_TRUE ( c . Merge ( s_unknown , s_unknown_b , & out ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( s_unknown = = out ) ; <nl> + <nl> + / / Merging with self returns self . <nl> + EXPECT_TRUE ( c . Merge ( s_1_2 , s_1_2 , & out ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( out = = s_1_2 ) ; <nl> + <nl> + / / Merging where one of the inputs is the right answer - return that input . <nl> + out = nullptr ; <nl> + EXPECT_TRUE ( c . Merge ( s_1_2 , s_u_2 , & out ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( s_1_2 = = out ) ; <nl> + out = nullptr ; <nl> + EXPECT_TRUE ( c . Merge ( s_u_2 , s_1_2 , & out ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( s_1_2 = = out ) ; <nl> + <nl> + / / Merging where neither input is the right answer . <nl> + EXPECT_TRUE ( c . Merge ( s_u_2 , s_1_u , & out ) . ok ( ) ) ; <nl> + EXPECT_TRUE ( out ! = s_u_2 ) ; <nl> + EXPECT_TRUE ( out ! = s_1_u ) ; <nl> + EXPECT_EQ ( " [ 1 , 2 ] " , c . DebugString ( out ) ) ; <nl> + EXPECT_TRUE ( c . Dim ( s_1_u , 0 ) = = c . Dim ( out , 0 ) ) ; / / same pointers <nl> + EXPECT_TRUE ( c . Dim ( s_u_2 , 1 ) = = c . Dim ( out , 1 ) ) ; / / same pointers <nl> + <nl> + / / Incompatible merges give errors and set out to nullptr . <nl> + out = s_unknown ; <nl> + EXPECT_EQ ( " Invalid argument : Dimensions must be equal size , but are 2 and 3 " , <nl> + c . Merge ( s_u_2 , s_1_3 , & out ) . ToString ( ) ) ; <nl> + EXPECT_TRUE ( out = = nullptr ) ; <nl> + out = s_unknown ; <nl> + EXPECT_EQ ( " Invalid argument : Dimensions must be equal size , but are 3 and 2 " , <nl> + c . Merge ( s_1_3 , s_u_2 , & out ) . ToString ( ) ) ; <nl> + EXPECT_TRUE ( out = = nullptr ) ; <nl> + out = s_unknown ; <nl> + EXPECT_EQ ( " Invalid argument : Shapes must be equal rank , but are 1 and 2 " , <nl> + c . Merge ( s_1 , s_1_2 , & out ) . ToString ( ) ) ; <nl> + EXPECT_TRUE ( out = = nullptr ) ; <nl> + } <nl> + <nl> + TEST ( ShapeInferenceTest , CreateShape ) { <nl> + InferenceContext c ( { " [ 1 , 2 , 3 , ? , 5 ] " } , 2 / * num_outputs * / ) ; <nl> + <nl> + std : : vector < const Dimension * > dims ; <nl> + auto in0 = c . input ( 0 ) ; <nl> + const int rank = c . Rank ( in0 ) ; <nl> + for ( int i = 0 ; i < rank ; + + i ) { <nl> + dims . push_back ( c . Dim ( in0 , rank - i - 1 ) ) ; <nl> + } <nl> + <nl> + auto s = c . CreateShape ( dims ) ; <nl> + EXPECT_EQ ( " [ 5 , ? , 3 , 2 , 1 ] " , c . DebugString ( s ) ) ; <nl> + EXPECT_TRUE ( c . Dim ( s , 0 ) = = c . Dim ( in0 , rank - 1 ) ) ; <nl> + <nl> + auto s2 = c . CreateShape ( dims ) ; <nl> + EXPECT_TRUE ( s ! = s2 ) ; / / different pointers <nl> + EXPECT_TRUE ( c . Dim ( s2 , 0 ) = = c . Dim ( in0 , rank - 1 ) ) ; <nl> + } <nl> + <nl> + TEST ( ShapeInferenceTest , CreateUnknownShape ) { <nl> + InferenceContext c ( { } , 2 / * num_outputs * / ) ; <nl> + <nl> + auto u0 = c . CreateUnknownShape ( ) ; <nl> + auto u1 = c . CreateUnknownShape ( ) ; <nl> + EXPECT_EQ ( " ? " , c . DebugString ( u0 ) ) ; <nl> + EXPECT_EQ ( " ? " , c . DebugString ( u1 ) ) ; <nl> + EXPECT_TRUE ( u0 ! = u1 ) ; / / different pointers <nl> + } <nl> + <nl> + TEST ( ShapeInferenceTest , CreateDim ) { <nl> + InferenceContext c ( { } , 2 / * num_outputs * / ) ; <nl> + <nl> + auto * d0 = c . CreateDim ( 1 ) ; <nl> + auto * d1 = c . CreateDim ( 1 ) ; <nl> + auto * d2 = c . CreateDim ( 2 ) ; <nl> + EXPECT_EQ ( " 1 " , c . DebugString ( d0 ) ) ; <nl> + EXPECT_EQ ( " 1 " , c . DebugString ( d1 ) ) ; <nl> + EXPECT_TRUE ( d0 ! = d1 ) ; / / different pointers <nl> + EXPECT_EQ ( " 2 " , c . DebugString ( d2 ) ) ; <nl> + } <nl> + <nl> + TEST ( ShapeInferenceTest , CreateUnknownDim ) { <nl> + InferenceContext c ( { } , 2 / * num_outputs * / ) ; <nl> + <nl> + auto * d0 = c . CreateUnknownDim ( ) ; <nl> + auto * d1 = c . CreateUnknownDim ( ) ; <nl> + EXPECT_EQ ( " ? " , c . DebugString ( d0 ) ) ; <nl> + EXPECT_EQ ( " ? " , c . DebugString ( d1 ) ) ; <nl> + EXPECT_TRUE ( d0 ! = d1 ) ; / / different pointers <nl> + } <nl> + <nl> + } / / namespace shape_inference <nl> + } / / namespace tensorflow <nl> | For C + + shape inference , add InferenceContext , which can be used to implement | tensorflow/tensorflow | 1c54034106d6517a800d2bbf3d3f01b76d48b3a5 | 2016-06-03T03:17:52Z |
mmm a / system / include / libc / netinet / tcp . h <nl> ppp b / system / include / libc / netinet / tcp . h <nl> <nl> # include < sys / socket . h > <nl> # endif <nl> <nl> + # ifdef _GNU_SOURCE <nl> + # include < endian . h > <nl> + struct tcphdr <nl> + { <nl> + u_int16_t source ; <nl> + u_int16_t dest ; <nl> + u_int32_t seq ; <nl> + u_int32_t ack_seq ; <nl> + # if __BYTE_ORDER = = __LITTLE_ENDIAN <nl> + u_int16_t res1 : 4 ; <nl> + u_int16_t doff : 4 ; <nl> + u_int16_t fin : 1 ; <nl> + u_int16_t syn : 1 ; <nl> + u_int16_t rst : 1 ; <nl> + u_int16_t psh : 1 ; <nl> + u_int16_t ack : 1 ; <nl> + u_int16_t urg : 1 ; <nl> + u_int16_t res2 : 2 ; <nl> + # else <nl> + u_int16_t doff : 4 ; <nl> + u_int16_t res1 : 4 ; <nl> + u_int16_t res2 : 2 ; <nl> + u_int16_t urg : 1 ; <nl> + u_int16_t ack : 1 ; <nl> + u_int16_t psh : 1 ; <nl> + u_int16_t rst : 1 ; <nl> + u_int16_t syn : 1 ; <nl> + u_int16_t fin : 1 ; <nl> + # endif <nl> + u_int16_t window ; <nl> + u_int16_t check ; <nl> + u_int16_t urg_ptr ; <nl> + } ; <nl> + # endif <nl> + <nl> # endif <nl> mmm a / system / include / libc / pthread . h <nl> ppp b / system / include / libc / pthread . h <nl> void _pthread_cleanup_pop ( struct __ptcb * , int ) ; <nl> # define pthread_cleanup_pop ( r ) _pthread_cleanup_pop ( & __cb , ( r ) ) ; } while ( 0 ) <nl> <nl> # ifdef _GNU_SOURCE <nl> + struct cpu_set_t ; <nl> + int pthread_getaffinity_np ( pthread_t , size_t , struct cpu_set_t * ) ; <nl> + int pthread_setaffinity_np ( pthread_t , size_t , const struct cpu_set_t * ) ; <nl> int pthread_getattr_np ( pthread_t , pthread_attr_t * ) ; <nl> # endif <nl> <nl> mmm a / system / include / libc / resolv . h <nl> ppp b / system / include / libc / resolv . h <nl> int res_search ( const char * , int , int , unsigned char * , int ) ; <nl> int res_mkquery ( int , const char * , int , int , char * , int , struct rrec * , char * , int ) ; <nl> int res_send ( const char * , int , char * , int ) ; <nl> int dn_comp ( unsigned char * , unsigned char * , int , unsigned char * * , unsigned char * , unsigned char * * ) ; <nl> - int dn_expand ( unsigned char * , unsigned char * , unsigned char * , unsigned char * , int ) ; <nl> + int dn_expand ( const unsigned char * , const unsigned char * , const unsigned char * , char * , int ) ; <nl> int dn_skipname ( const unsigned char * , const unsigned char * ) ; <nl> <nl> # ifdef __cplusplus <nl> mmm a / system / include / libc / sched . h <nl> ppp b / system / include / libc / sched . h <nl> extern " C " { <nl> # define __NEED_pid_t <nl> # define __NEED_time_t <nl> <nl> + # ifdef _GNU_SOURCE <nl> + # define __NEED_size_t <nl> + # endif <nl> + <nl> # include < bits / alltypes . h > <nl> <nl> struct sched_param { <nl> int sched_yield ( void ) ; <nl> int clone ( int ( * ) ( void * ) , void * , int , void * , . . . ) ; <nl> int unshare ( int ) ; <nl> int setns ( int , int ) ; <nl> + <nl> + void * memcpy ( void * __restrict , const void * __restrict , size_t ) ; <nl> + int memcmp ( const void * , const void * , size_t ) ; <nl> + void * calloc ( size_t , size_t ) ; <nl> + void free ( void * ) ; <nl> + <nl> + typedef struct cpu_set_t { unsigned long __bits [ 128 / sizeof ( long ) ] ; } cpu_set_t ; <nl> + int __sched_cpucount ( size_t , const cpu_set_t * ) ; <nl> + int sched_getaffinity ( pid_t , size_t , cpu_set_t * ) ; <nl> + int sched_setaffinity ( pid_t , size_t , const cpu_set_t * ) ; <nl> + <nl> + # define __CPU_op_S ( i , size , set , op ) ( ( i ) / 8 > = ( size ) ? 0 : \ <nl> + ( ( set ) - > __bits [ ( i ) / 8 / sizeof ( long ) ] op ( 1UL < < ( ( i ) % ( 8 * sizeof ( long ) ) ) ) ) ) <nl> + <nl> + # define CPU_SET_S ( i , size , set ) __CPU_op_S ( i , size , set , | = ) <nl> + # define CPU_CLR_S ( i , size , set ) __CPU_op_S ( i , size , set , & = ~ ) <nl> + # define CPU_ISSET_S ( i , size , set ) __CPU_op_S ( i , size , set , & ) <nl> + <nl> + # define __CPU_op_func_S ( func , op ) \ <nl> + static __inline void __CPU_ # # func # # _S ( size_t __size , cpu_set_t * __dest , \ <nl> + const cpu_set_t * __src1 , const cpu_set_t * __src2 ) \ <nl> + { \ <nl> + size_t __i ; \ <nl> + for ( __i = 0 ; __i < __size / sizeof ( long ) ; __i + + ) \ <nl> + __dest - > __bits [ __i ] = __src1 - > __bits [ __i ] \ <nl> + op __src2 - > __bits [ __i ] ; \ <nl> + } <nl> + <nl> + __CPU_op_func_S ( AND , & ) <nl> + __CPU_op_func_S ( OR , | ) <nl> + __CPU_op_func_S ( XOR , ^ ) <nl> + <nl> + # define CPU_AND_S ( a , b , c , d ) __CPU_AND_S ( a , b , c , d ) <nl> + # define CPU_OR_S ( a , b , c , d ) __CPU_OR_S ( a , b , c , d ) <nl> + # define CPU_XOR_S ( a , b , c , d ) __CPU_XOR_S ( a , b , c , d ) <nl> + <nl> + # define CPU_COUNT_S ( size , set ) __sched_cpucount ( size , set ) <nl> + # define CPU_ZERO_S ( size , set ) memset ( set , 0 , size ) <nl> + # define CPU_EQUAL_S ( size , set1 , set2 ) ( ! memcmp ( set1 , set2 , size ) ) <nl> + <nl> + # define CPU_ALLOC_SIZE ( n ) ( sizeof ( long ) * ( ( n ) / ( 8 * sizeof ( long ) ) \ <nl> + + ( ( n ) % ( 8 * sizeof ( long ) ) + 8 * sizeof ( long ) - 1 ) / ( 8 * sizeof ( long ) ) ) ) <nl> + # define CPU_ALLOC ( n ) ( ( cpu_set_t * ) calloc ( 1 , CPU_ALLOC_SIZE ( n ) ) ) <nl> + # define CPU_FREE ( set ) free ( set ) <nl> + <nl> + # define CPU_SETSIZE 128 <nl> + <nl> + # define CPU_SET ( i , set ) CPU_SET_S ( i , sizeof ( cpu_set_t ) , set ) <nl> + # define CPU_CLR ( i , set ) CPU_CLR_S ( i , sizeof ( cpu_set_t ) , set ) <nl> + # define CPU_ISSET ( i , set ) CPU_ISSET_S ( i , sizeof ( cpu_set_t ) , set ) <nl> + # define CPU_AND ( d , s1 , s2 ) CPU_AND_S ( sizeof ( cpu_set_t ) , d , s1 , s2 ) <nl> + # define CPU_OR ( d , s1 , s2 ) CPU_OR_S ( sizeof ( cpu_set_t ) , d , s1 , s2 ) <nl> + # define CPU_XOR ( d , s1 , s2 ) CPU_XOR_S ( sizeof ( cpu_set_t ) , d , s1 , s2 ) <nl> + # define CPU_COUNT ( set ) CPU_COUNT_S ( sizeof ( cpu_set_t ) , set ) <nl> + # define CPU_ZERO ( set ) CPU_ZERO_S ( sizeof ( cpu_set_t ) , set ) <nl> + # define CPU_EQUAL ( set ) CPU_EQUAL_S ( sizeof ( cpu_set_t ) , set ) <nl> + <nl> # endif <nl> <nl> # ifdef __cplusplus <nl> mmm a / system / include / libc / stdlib . h <nl> ppp b / system / include / libc / stdlib . h <nl> size_t wcstombs ( char * __restrict , const wchar_t * __restrict , size_t ) ; <nl> # define WTERMSIG ( s ) ( ( s ) & 0x7f ) <nl> # define WSTOPSIG ( s ) WEXITSTATUS ( s ) <nl> # define WIFEXITED ( s ) ( ! WTERMSIG ( s ) ) <nl> - # define WIFSTOPPED ( s ) ( ( ( s ) & 0xff ) = = 0x7f ) <nl> - # define WIFSIGNALED ( s ) ( ( ( signed char ) ( ( ( s ) & 0x7f ) + 1 ) > > 1 ) > 0 ) <nl> + # define WIFSTOPPED ( s ) ( ( short ) ( ( ( ( s ) & 0xffff ) * 0x10001 ) > > 8 ) > 0x7f00 ) <nl> + # define WIFSIGNALED ( s ) ( ( ( s ) & 0xffff ) - 1 < 0xffu ) <nl> <nl> int posix_memalign ( void * * , size_t , size_t ) ; <nl> int setenv ( const char * , const char * , int ) ; <nl> int ptsname_r ( int , char * , size_t ) ; <nl> char * ecvt ( double , int , int * , int * ) ; <nl> char * fcvt ( double , int , int * , int * ) ; <nl> char * gcvt ( double , int , char * ) ; <nl> + struct __locale_struct ; <nl> + float strtof_l ( const char * __restrict , char * * __restrict , struct __locale_struct * ) ; <nl> + double strtod_l ( const char * __restrict , char * * __restrict , struct __locale_struct * ) ; <nl> + long double strtold_l ( const char * __restrict , char * * __restrict , struct __locale_struct * ) ; <nl> # endif <nl> <nl> # if defined ( _LARGEFILE64_SOURCE ) | | defined ( _GNU_SOURCE ) <nl> mmm a / system / include / libc / sys / msg . h <nl> ppp b / system / include / libc / sys / msg . h <nl> typedef unsigned long msglen_t ; <nl> # define __msg_cbytes msg_cbytes <nl> <nl> # define MSG_NOERROR 010000 <nl> + # define MSG_EXCEPT 020000 <nl> <nl> # define MSG_STAT 11 <nl> # define MSG_INFO 12 <nl> mmm a / system / include / libc / sys / personality . h <nl> ppp b / system / include / libc / sys / personality . h <nl> <nl> # ifndef _PERSONALITY_H <nl> # define _PERSONALITY_H <nl> <nl> + # ifdef __cplusplus <nl> + extern " C " { <nl> + # endif <nl> + <nl> + # define ADDR_NO_RANDOMIZE 0x0040000 <nl> + # define MMAP_PAGE_ZERO 0x0100000 <nl> + # define ADDR_COMPAT_LAYOUT 0x0200000 <nl> + # define READ_IMPLIES_EXEC 0x0400000 <nl> + # define ADDR_LIMIT_32BIT 0x0800000 <nl> + # define SHORT_INODE 0x1000000 <nl> + # define WHOLE_SECONDS 0x2000000 <nl> + # define STICKY_TIMEOUTS 0x4000000 <nl> + # define ADDR_LIMIT_3GB 0x8000000 <nl> + <nl> + # define PER_LINUX 0 <nl> + # define PER_LINUX_32BIT ADDR_LIMIT_32BIT <nl> + # define PER_SVR4 ( 1 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO ) <nl> + # define PER_SVR3 ( 2 | STICKY_TIMEOUTS | SHORT_INODE ) <nl> + # define PER_SCOSVR3 ( 3 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE ) <nl> + # define PER_OSR5 ( 3 | STICKY_TIMEOUTS | WHOLE_SECONDS ) <nl> + # define PER_WYSEV386 ( 4 | STICKY_TIMEOUTS | SHORT_INODE ) <nl> + # define PER_ISCR4 ( 5 | STICKY_TIMEOUTS ) <nl> + # define PER_BSD 6 <nl> + # define PER_SUNOS ( 6 | STICKY_TIMEOUTS ) <nl> + # define PER_XENIX ( 7 | STICKY_TIMEOUTS | SHORT_INODE ) <nl> + # define PER_LINUX32 8 <nl> + # define PER_LINUX32_3GB ( 8 | ADDR_LIMIT_3GB ) <nl> + # define PER_IRIX32 ( 9 | STICKY_TIMEOUTS ) <nl> + # define PER_IRIXN32 ( 0xa | STICKY_TIMEOUTS ) <nl> + # define PER_IRIX64 ( 0x0b | STICKY_TIMEOUTS ) <nl> + # define PER_RISCOS 0xc <nl> + # define PER_SOLARIS ( 0xd | STICKY_TIMEOUTS ) <nl> + # define PER_UW7 ( 0xe | STICKY_TIMEOUTS | MMAP_PAGE_ZERO ) <nl> + # define PER_OSF4 0xf <nl> + # define PER_HPUX 0x10 <nl> + # define PER_MASK 0xff <nl> + <nl> int personality ( unsigned long ) ; <nl> <nl> + # ifdef __cplusplus <nl> + } <nl> + # endif <nl> # endif <nl> mmm a / system / include / libc / sys / un . h <nl> ppp b / system / include / libc / sys / un . h <nl> <nl> # ifndef _SYS_UN_H <nl> # define _SYS_UN_H <nl> <nl> + # ifdef __cplusplus <nl> + extern " C " { <nl> + # endif <nl> + <nl> + # include < features . h > <nl> + <nl> # define __NEED_sa_family_t <nl> + # if defined ( _GNU_SOURCE ) | | defined ( _BSD_SOURCE ) <nl> + # define __NEED_size_t <nl> + # endif <nl> + <nl> # include < bits / alltypes . h > <nl> <nl> struct sockaddr_un <nl> struct sockaddr_un <nl> char sun_path [ 108 ] ; <nl> } ; <nl> <nl> + # if defined ( _GNU_SOURCE ) | | defined ( _BSD_SOURCE ) <nl> + size_t strlen ( const char * ) ; <nl> + # define SUN_LEN ( s ) ( 2 + strlen ( ( s ) - > sun_path ) ) <nl> + # endif <nl> + <nl> + # ifdef __cplusplus <nl> + } <nl> + # endif <nl> + <nl> # endif <nl> mmm a / system / include / libc / sys / wait . h <nl> ppp b / system / include / libc / sys / wait . h <nl> pid_t wait4 ( pid_t , int * , int , struct rusage * ) ; <nl> # define WSTOPSIG ( s ) WEXITSTATUS ( s ) <nl> # define WCOREDUMP ( s ) ( ( s ) & 0x80 ) <nl> # define WIFEXITED ( s ) ( ! WTERMSIG ( s ) ) <nl> - # define WIFSTOPPED ( s ) ( ( ( s ) & 0xff ) = = 0x7f ) <nl> - # define WIFSIGNALED ( s ) ( ( ( signed char ) ( ( ( s ) & 0x7f ) + 1 ) > > 1 ) > 0 ) <nl> + # define WIFSTOPPED ( s ) ( ( short ) ( ( ( ( s ) & 0xffff ) * 0x10001 ) > > 8 ) > 0x7f00 ) <nl> + # define WIFSIGNALED ( s ) ( ( ( s ) & 0xffff ) - 1 < 0xffu ) <nl> # define WIFCONTINUED ( s ) ( ( s ) = = 0xffff ) <nl> <nl> # ifdef __cplusplus <nl> mmm a / system / lib / libc / musl / readme . txt <nl> ppp b / system / lib / libc / musl / readme . txt <nl> <nl> - These sources were downloaded from the musl - 0 . 9 . 12 release on July 29 , 2013 , <nl> - along with some updates from git to fix various issues that were found . <nl> + These sources were downloaded from the musl - 0 . 9 . 13 release on August 30 , 2013 . <nl> <nl> Differences from upstream musl include : <nl> <nl> | Update to musl - 0 . 9 . 13 headers . | emscripten-core/emscripten | 733e6877d7b1146ecb5c796f4d249843101a7b5f | 2013-09-13T17:07:03Z |
mmm a / README . md <nl> ppp b / README . md <nl> <nl> # The Algorithms - C + + # { # mainpage } <nl> + < ! - - the suffix in the above line is required for doxygen to consider this as the index page of the generated documentation site - - > <nl> <nl> [ ! [ Gitpod Ready - to - Code ] ( https : / / img . shields . io / badge / Gitpod - Ready - - to - - Code - blue ? logo = gitpod ) ] ( https : / / gitpod . io / # https : / / github . com / TheAlgorithms / C - Plus - Plus ) [ ! [ Language grade : C / C + + ] ( https : / / img . shields . io / lgtm / grade / cpp / g / TheAlgorithms / C - Plus - Plus . svg ? logo = lgtm & logoWidth = 18 ) ] ( https : / / lgtm . com / projects / g / TheAlgorithms / C - Plus - Plus / context : cpp ) <nl> [ ! [ Gitter chat ] ( https : / / img . shields . io / badge / Chat - Gitter - ff69b4 . svg ? label = Chat & logo = gitter & style = flat - square ) ] ( https : / / gitter . im / TheAlgorithms ) <nl> <nl> [ ! [ Doxygen CI ] ( https : / / github . com / TheAlgorithms / C - Plus - Plus / workflows / Doxygen % 20CI / badge . svg ) ] ( " https : / / TheAlgorithms . github . io / C - Plus - Plus " ) <nl> [ ! [ Awesome CI ] ( https : / / github . com / TheAlgorithms / C - Plus - Plus / workflows / Awesome % 20CI % 20Workflow / badge . svg ) ] ( " https : / / github . com / TheAlgorithms / C - Plus - Plus / actions ? query = workflow % 3A % 22Awesome + CI + Workflow % 22 " ) <nl> <nl> - # # Algorithms implemented in C + + ( for education ) <nl> + # # Overview <nl> <nl> The repository is a collection of implementation of a variety of algorithms implemented in C + + . These algorithms span a variety of topics from computer science , mathematics and statistics , data science , machine learning , engineering , etc . . The implementations are meant to be a learning resource for educators and students . Hence , one may find more than one implementation for the same algorithm with different optimizations and different strategies used that would be documented therein . <nl> <nl> The repository is a collection of implementation of a variety of algorithms impl <nl> * Well documented source code with detailed explanations provide a valuable resource for educators and students alike . <nl> * Each source code is atomic using [ STL classes ] ( https : / / en . wikipedia . org / wiki / Standard_Template_Library ) and _no external libraries_ are required for their compilation and execution . Thus the fundamentals of the algorithms can be studied in much depth . <nl> * Source codes are [ compiled and tested ] ( https : / / github . com / TheAlgorithms / C - Plus - Plus / actions ? query = workflow % 3A % 22Awesome + CI + Workflow % 22 ) for every commit on the latest versions of three major operating systems Windows , MacOS and Ubuntu ( Linux ) using MSVC 16 2019 , AppleClang 11 . 0 and GNU 7 . 5 . 0 respectively . <nl> - * Strict adherence [ C + + 11 ] ( https : / / en . wikipedia . org / wiki / C % 2B % 2B11 ) standard ensures portability of code to embedded systems as well like ESP32 , ARM Cortex , etc with little to no changes . <nl> + * Strict adherence to [ C + + 11 ] ( https : / / en . wikipedia . org / wiki / C % 2B % 2B11 ) standard ensures portability of code to embedded systems as well like ESP32 , ARM Cortex , etc with little to no changes . <nl> * Self - checks within programs ensure correct implementations with confidence . <nl> * Modular implementations and OpenSource licensing enable the functions to be utilized conveniently in other applications . <nl> <nl> | overview + comment why mainpage | TheAlgorithms/C-Plus-Plus | a9c005da70569a168ffaf17ddd3ee286a6bd31dd | 2020-06-26T18:49:05Z |
mmm a / language / English / strings . po <nl> ppp b / language / English / strings . po <nl> msgstr " " <nl> <nl> # : system / settings / settings . xml <nl> msgctxt " # 21366 " <nl> - msgid " Subtitle folder " <nl> + msgid " Custom subtitle folder " <nl> msgstr " " <nl> <nl> msgctxt " # 21367 " <nl> msgstr " " <nl> <nl> # : system / settings / settings . xml <nl> msgctxt " # 21460 " <nl> - msgid " Subtitle location " <nl> + msgid " Subtitle location on screen " <nl> msgstr " " <nl> <nl> # : system / settings / settings . xml <nl> mmm a / system / settings / settings . xml <nl> ppp b / system / settings / settings . xml <nl> <nl> < / constraints > <nl> < control type = " list " format = " string " / > <nl> < / setting > <nl> - < setting id = " locale . subtitlelanguage " type = " string " label = " 286 " help = " 36120 " > <nl> - < level > 1 < / level > <nl> - < default > original < / default > <nl> - < constraints > <nl> - < options > streamlanguages < / options > <nl> - < / constraints > <nl> - < control type = " list " format = " string " / > <nl> - < / setting > <nl> < / group > <nl> < / category > <nl> < category id = " filelists " label = " 14081 " help = " 36121 " > <nl> <nl> < / category > <nl> < category id = " subtitles " label = " 287 " help = " 36184 " > <nl> < group id = " 1 " > <nl> + < setting id = " locale . subtitlelanguage " type = " string " label = " 286 " help = " 36120 " > <nl> + < level > 1 < / level > <nl> + < default > original < / default > <nl> + < constraints > <nl> + < options > streamlanguages < / options > <nl> + < / constraints > <nl> + < control type = " list " format = " string " / > <nl> + < / setting > <nl> + < / group > <nl> + < group id = " 2 " > <nl> + < setting id = " subtitles . preferexternal " type = " boolean " label = " 21600 " help = " 21601 " > <nl> + < level > 1 < / level > <nl> + < default > true < / default > <nl> + < control type = " toggle " / > <nl> + < / setting > <nl> + < setting id = " subtitles . custompath " type = " path " label = " 21366 " help = " 36191 " > <nl> + < level > 1 < / level > <nl> + < default > < / default > <nl> + < constraints > <nl> + < allowempty > true < / allowempty > <nl> + < writable > false < / writable > <nl> + < sources > <nl> + < source > videos < / source > <nl> + < / sources > <nl> + < / constraints > <nl> + < control type = " button " format = " path " > <nl> + < heading > 657 < / heading > <nl> + < / control > <nl> + < / setting > <nl> + < setting id = " subtitles . languages " type = " list [ string ] " label = " 24111 " help = " 24112 " > <nl> + < level > 1 < / level > <nl> + < default > English < / default > <nl> + < constraints > <nl> + < options > languages < / options > <nl> + < delimiter > , < / delimiter > <nl> + < minimum > 1 < / minimum > <nl> + < maximum > 3 < / maximum > <nl> + < / constraints > <nl> + < control type = " list " format = " string " > <nl> + < multiselect > true < / multiselect > <nl> + < / control > <nl> + < / setting > <nl> + < setting id = " subtitles . tv " type = " addon " label = " 24116 " help = " 24117 " > <nl> + < level > 1 < / level > <nl> + < default > - < / default > <nl> + < constraints > <nl> + < addontype > xbmc . subtitle . module < / addontype > <nl> + < allowempty > true < / allowempty > <nl> + < / constraints > <nl> + < control type = " button " format = " addon " / > <nl> + < / setting > <nl> + < setting id = " subtitles . movie " type = " addon " label = " 24118 " help = " 24119 " > <nl> + < level > 1 < / level > <nl> + < default > - < / default > <nl> + < constraints > <nl> + < addontype > xbmc . subtitle . module < / addontype > <nl> + < allowempty > true < / allowempty > <nl> + < / constraints > <nl> + < control type = " button " format = " addon " / > <nl> + < / setting > <nl> + < setting id = " subtitles . pauseonsearch " type = " boolean " label = " 24105 " help = " " > <nl> + < level > 1 < / level > <nl> + < default > true < / default > <nl> + < control type = " toggle " / > <nl> + < / setting > <nl> + < setting id = " subtitles . savetomoviefolder " type = " boolean " label = " 24115 " help = " 24106 " > <nl> + < level > 1 < / level > <nl> + < default > true < / default > <nl> + < control type = " toggle " / > <nl> + < / setting > <nl> + < / group > <nl> + < group id = " 3 " > <nl> + < setting id = " subtitles . align " type = " integer " label = " 21460 " help = " 36192 " > <nl> + < level > 1 < / level > <nl> + < default > 0 < / default > < ! - - SUBTITLE_ALIGN_MANUAL - - > <nl> + < constraints > <nl> + < options > <nl> + < option label = " 21461 " > 0 < / option > < ! - - SUBTITLE_ALIGN_MANUAL - - > <nl> + < option label = " 21462 " > 1 < / option > < ! - - SUBTITLE_ALIGN_BOTTOM_INSIDE - - > <nl> + < option label = " 21463 " > 2 < / option > < ! - - SUBTITLE_ALIGN_BOTTOM_OUTSIDE - - > <nl> + < option label = " 21464 " > 3 < / option > < ! - - SUBTITLE_ALIGN_TOP_INSIDE - - > <nl> + < option label = " 21465 " > 4 < / option > < ! - - SUBTITLE_ALIGN_TOP_OUTSIDE - - > <nl> + < / options > <nl> + < / constraints > <nl> + < control type = " spinner " format = " string " / > <nl> + < / setting > <nl> < setting id = " subtitles . font " type = " string " label = " 14089 " help = " 36185 " > <nl> < level > 1 < / level > <nl> < default > arial . ttf < / default > <nl> <nl> < control type = " toggle " / > <nl> < / setting > <nl> < / group > <nl> - < group id = " 2 " > <nl> - < setting id = " subtitles . savetomoviefolder " type = " boolean " label = " 24115 " help = " 24106 " > <nl> - < level > 1 < / level > <nl> - < default > true < / default > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < setting id = " subtitles . pauseonsearch " type = " boolean " label = " 24105 " help = " " > <nl> - < level > 1 < / level > <nl> - < default > true < / default > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < setting id = " subtitles . languages " type = " list [ string ] " label = " 24111 " help = " 24112 " > <nl> - < level > 1 < / level > <nl> - < default > English < / default > <nl> - < constraints > <nl> - < options > languages < / options > <nl> - < delimiter > , < / delimiter > <nl> - < minimum > 1 < / minimum > <nl> - < maximum > 3 < / maximum > <nl> - < / constraints > <nl> - < control type = " list " format = " string " > <nl> - < multiselect > true < / multiselect > <nl> - < / control > <nl> - < / setting > <nl> - < setting id = " subtitles . tv " type = " addon " label = " 24116 " help = " 24117 " > <nl> - < level > 1 < / level > <nl> - < default > - < / default > <nl> - < constraints > <nl> - < addontype > xbmc . subtitle . module < / addontype > <nl> - < allowempty > true < / allowempty > <nl> - < / constraints > <nl> - < control type = " button " format = " addon " / > <nl> - < / setting > <nl> - < setting id = " subtitles . movie " type = " addon " label = " 24118 " help = " 24119 " > <nl> - < level > 1 < / level > <nl> - < default > - < / default > <nl> - < constraints > <nl> - < addontype > xbmc . subtitle . module < / addontype > <nl> - < allowempty > true < / allowempty > <nl> - < / constraints > <nl> - < control type = " button " format = " addon " / > <nl> - < / setting > <nl> - < setting id = " subtitles . custompath " type = " path " label = " 21366 " help = " 36191 " > <nl> - < level > 1 < / level > <nl> - < default > < / default > <nl> - < constraints > <nl> - < allowempty > true < / allowempty > <nl> - < writable > false < / writable > <nl> - < sources > <nl> - < source > videos < / source > <nl> - < / sources > <nl> - < / constraints > <nl> - < control type = " button " format = " path " > <nl> - < heading > 657 < / heading > <nl> - < / control > <nl> - < / setting > <nl> - < setting id = " subtitles . align " type = " integer " label = " 21460 " help = " 36192 " > <nl> - < level > 1 < / level > <nl> - < default > 0 < / default > < ! - - SUBTITLE_ALIGN_MANUAL - - > <nl> - < constraints > <nl> - < options > <nl> - < option label = " 21461 " > 0 < / option > < ! - - SUBTITLE_ALIGN_MANUAL - - > <nl> - < option label = " 21462 " > 1 < / option > < ! - - SUBTITLE_ALIGN_BOTTOM_INSIDE - - > <nl> - < option label = " 21463 " > 2 < / option > < ! - - SUBTITLE_ALIGN_BOTTOM_OUTSIDE - - > <nl> - < option label = " 21464 " > 3 < / option > < ! - - SUBTITLE_ALIGN_TOP_INSIDE - - > <nl> - < option label = " 21465 " > 4 < / option > < ! - - SUBTITLE_ALIGN_TOP_OUTSIDE - - > <nl> - < / options > <nl> - < / constraints > <nl> - < control type = " spinner " format = " string " / > <nl> - < / setting > <nl> - < setting id = " subtitles . preferexternal " type = " boolean " label = " 21600 " help = " 21601 " > <nl> - < level > 1 < / level > <nl> - < default > true < / default > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < / group > <nl> - < group id = " 3 " > <nl> + < group id = " 4 " > <nl> < setting id = " subtitles . stereoscopicdepth " type = " integer " label = " 36545 " help = " 36546 " > <nl> - < level > 0 < / level > <nl> + < level > 1 < / level > <nl> < default > 0 < / default > <nl> < constraints > <nl> < minimum > 0 < / minimum > <nl> | Merge pull request from MartijnKaijser / settings_subtitles | xbmc/xbmc | f790149d106b3ad852d21309838c04c984d39e7f | 2014-02-02T10:35:04Z |
mmm a / unittests / SwiftDemangle / CMakeLists . txt <nl> ppp b / unittests / SwiftDemangle / CMakeLists . txt <nl> <nl> if ( TARGET swiftDemangle ) <nl> add_swift_unittest ( SwiftDemangleTests <nl> DemangleTest . cpp <nl> - ) <nl> - <nl> + ) <nl> + set_target_properties ( SwiftDemangleTests <nl> + PROPERTIES BUILD_WITH_INSTALL_RPATH On INSTALL_RPATH " $ { SWIFT_LIBRARY_OUTPUT_INTDIR } " <nl> + ) <nl> + <nl> target_link_libraries ( SwiftDemangleTests <nl> swiftDemangle <nl> - ) <nl> + ) <nl> endif ( ) <nl> | Merge pull request from adrian - prantl / unittest - dyld - path | apple/swift | 66824dffb15bb69047b88536dfc982a5ddcf69ec | 2016-12-20T18:55:37Z |
mmm a / test / AutolinkExtract / import . swift <nl> ppp b / test / AutolinkExtract / import . swift <nl> <nl> / / RUN : % target - swiftc_driver - c % s - I % t - o % t / import_experimental . o <nl> / / RUN : % target - swift - autolink - extract % t / import_experimental . o - o - | % FileCheck - - check - prefix CHECK - % target - object - format % s <nl> <nl> + / / REQUIRES : SR7255 <nl> + <nl> / / REQUIRES : autolink - extract <nl> <nl> / / CHECK - elf - DAG : - lswiftCore <nl> | Merge pull request from aschwaighofer / disable_autolinkextract | apple/swift | 82790fa3241f3c922a54d1960ff8eac6ef0d4002 | 2018-03-22T15:17:41Z |
mmm a / folly / executors / test / ThreadPoolExecutorTest . cpp <nl> ppp b / folly / executors / test / ThreadPoolExecutorTest . cpp <nl> TEST ( InitThreadFactoryTest , InitializerCalled ) { <nl> EXPECT_EQ ( initializerCalledCount , 1 ) ; <nl> } <nl> <nl> + TEST ( InitThreadFactoryTest , InitializerAndFinalizerCalled ) { <nl> + bool initializerCalled = false ; <nl> + bool taskBodyCalled = false ; <nl> + bool finalizerCalled = false ; <nl> + <nl> + InitThreadFactory factory ( <nl> + std : : make_shared < NamedThreadFactory > ( " test " ) , <nl> + [ & ] { <nl> + / / thread initializer <nl> + EXPECT_FALSE ( initializerCalled ) ; <nl> + EXPECT_FALSE ( taskBodyCalled ) ; <nl> + EXPECT_FALSE ( finalizerCalled ) ; <nl> + initializerCalled = true ; <nl> + } , <nl> + [ & ] { <nl> + / / thread finalizer <nl> + EXPECT_TRUE ( initializerCalled ) ; <nl> + EXPECT_TRUE ( taskBodyCalled ) ; <nl> + EXPECT_FALSE ( finalizerCalled ) ; <nl> + finalizerCalled = true ; <nl> + } ) ; <nl> + <nl> + factory <nl> + . newThread ( [ & ] ( ) { <nl> + EXPECT_TRUE ( initializerCalled ) ; <nl> + EXPECT_FALSE ( taskBodyCalled ) ; <nl> + EXPECT_FALSE ( finalizerCalled ) ; <nl> + taskBodyCalled = true ; <nl> + } ) <nl> + . join ( ) ; <nl> + <nl> + EXPECT_TRUE ( initializerCalled ) ; <nl> + EXPECT_TRUE ( taskBodyCalled ) ; <nl> + EXPECT_TRUE ( finalizerCalled ) ; <nl> + } <nl> + <nl> class TestData : public folly : : RequestData { <nl> public : <nl> explicit TestData ( int data ) : data_ ( data ) { } <nl> mmm a / folly / executors / thread_factory / InitThreadFactory . h <nl> ppp b / folly / executors / thread_factory / InitThreadFactory . h <nl> <nl> # include < memory > <nl> # include < thread > <nl> <nl> + # include < folly / ScopeGuard . h > <nl> # include < folly / executors / thread_factory / ThreadFactory . h > <nl> <nl> namespace folly { <nl> class InitThreadFactory : public ThreadFactory { <nl> public : <nl> explicit InitThreadFactory ( <nl> std : : shared_ptr < ThreadFactory > threadFactory , <nl> - Func & & threadInitializer ) <nl> + Func & & threadInitializer , <nl> + Func & & threadFinializer = [ ] { } ) <nl> : threadFactory_ ( std : : move ( threadFactory ) ) , <nl> - threadInitializer_ ( <nl> - std : : make_shared < Func > ( std : : move ( threadInitializer ) ) ) { } <nl> + threadInitFini_ ( std : : make_shared < ThreadInitFini > ( <nl> + std : : move ( threadInitializer ) , <nl> + std : : move ( threadFinializer ) ) ) { } <nl> <nl> std : : thread newThread ( Func & & func ) override { <nl> return threadFactory_ - > newThread ( <nl> - [ func = std : : move ( func ) , initializer = threadInitializer_ ] ( ) mutable { <nl> - ( * initializer ) ( ) ; <nl> + [ func = std : : move ( func ) , threadInitFini = threadInitFini_ ] ( ) mutable { <nl> + threadInitFini - > initializer ( ) ; <nl> + SCOPE_EXIT { <nl> + threadInitFini - > finalizer ( ) ; <nl> + } ; <nl> func ( ) ; <nl> } ) ; <nl> } <nl> <nl> private : <nl> std : : shared_ptr < ThreadFactory > threadFactory_ ; <nl> - std : : shared_ptr < Func > threadInitializer_ ; <nl> + struct ThreadInitFini { <nl> + ThreadInitFini ( Func & & init , Func & & fini ) <nl> + : initializer ( std : : move ( init ) ) , finalizer ( std : : move ( fini ) ) { } <nl> + <nl> + Func initializer ; <nl> + Func finalizer ; <nl> + } ; <nl> + std : : shared_ptr < ThreadInitFini > threadInitFini_ ; <nl> } ; <nl> <nl> } / / namespace folly <nl> | add optional thread finalizer to InitThreadFactory | facebook/folly | 5e03c4db2a21c50069015a3d36e25ca0476d3b05 | 2018-06-22T02:06:17Z |
mmm a / src / trap - handler / handler - inside . cc <nl> ppp b / src / trap - handler / handler - inside . cc <nl> void HandleSignal ( int signum , siginfo_t * info , void * context ) { <nl> <nl> if ( ! TryHandleSignal ( signum , info , uc ) ) { <nl> / / Since V8 didn ' t handle this signal , we want to re - raise the same signal . <nl> - / / For kernel - generated SEGV signals , we do this by restoring the default <nl> + / / For kernel - generated SEGV signals , we do this by restoring the original <nl> / / SEGV handler and then returning . The fault will happen again and the <nl> / / usual SEGV handling will happen . <nl> / / <nl> / / We handle user - generated signals by calling raise ( ) instead . This is for <nl> / / completeness . We should never actually see one of these , but just in <nl> / / case , we do the right thing . <nl> - struct sigaction action ; <nl> - action . sa_handler = SIG_DFL ; <nl> - sigemptyset ( & action . sa_mask ) ; <nl> - action . sa_flags = 0 ; <nl> - sigaction ( signum , & action , nullptr ) ; <nl> + RestoreOriginalSignalHandler ( ) ; <nl> if ( ! IsKernelGeneratedSignal ( info ) ) { <nl> raise ( signum ) ; <nl> } <nl> mmm a / src / trap - handler / handler - outside . cc <nl> ppp b / src / trap - handler / handler - outside . cc <nl> void ReleaseHandlerData ( int index ) { <nl> <nl> bool RegisterDefaultSignalHandler ( ) { <nl> # if V8_TRAP_HANDLER_SUPPORTED <nl> + CHECK ( ! g_is_default_signal_handler_registered ) ; <nl> + <nl> struct sigaction action ; <nl> action . sa_sigaction = HandleSignal ; <nl> action . sa_flags = SA_SIGINFO ; <nl> bool RegisterDefaultSignalHandler ( ) { <nl> / / { sigaction } installs a new custom segfault handler . On success , it returns <nl> / / 0 . If we get a nonzero value , we report an error to the caller by returning <nl> / / false . <nl> - if ( sigaction ( SIGSEGV , & action , nullptr ) ! = 0 ) { <nl> + if ( sigaction ( SIGSEGV , & action , & g_old_handler ) ! = 0 ) { <nl> return false ; <nl> } <nl> <nl> + g_is_default_signal_handler_registered = true ; <nl> return true ; <nl> # else <nl> return false ; <nl> mmm a / src / trap - handler / handler - shared . cc <nl> ppp b / src / trap - handler / handler - shared . cc <nl> namespace trap_handler { <nl> / / We declare this as int rather than bool as a workaround for a glibc bug , in <nl> / / which the dynamic loader cannot handle executables whose TLS area is only <nl> / / 1 byte in size ; see https : / / sourceware . org / bugzilla / show_bug . cgi ? id = 14898 . <nl> - THREAD_LOCAL int g_thread_in_wasm_code = false ; <nl> + THREAD_LOCAL int g_thread_in_wasm_code ; <nl> + <nl> + # if V8_TRAP_HANDLER_SUPPORTED <nl> + / / When using the default signal handler , we save the old one to restore in case <nl> + / / V8 chooses not to handle the signal . <nl> + struct sigaction g_old_handler ; <nl> + bool g_is_default_signal_handler_registered ; <nl> + # endif <nl> + <nl> + void RestoreOriginalSignalHandler ( ) { <nl> + # if V8_TRAP_HANDLER_SUPPORTED <nl> + if ( sigaction ( SIGSEGV , & g_old_handler , nullptr ) = = 0 ) { <nl> + g_is_default_signal_handler_registered = false ; <nl> + } <nl> + # endif <nl> + } <nl> <nl> static_assert ( sizeof ( g_thread_in_wasm_code ) > 1 , <nl> " sizeof ( thread_local_var ) must be > 1 , see " <nl> mmm a / src / trap - handler / trap - handler - internal . h <nl> ppp b / src / trap - handler / trap - handler - internal . h <nl> extern std : : atomic_size_t gRecoveredTrapCount ; <nl> / / unchanged . <nl> bool TryFindLandingPad ( uintptr_t fault_addr , uintptr_t * landing_pad ) ; <nl> <nl> + # if V8_TRAP_HANDLER_SUPPORTED <nl> + / / When using the default signal handler , we save the old one to restore in case <nl> + / / V8 chooses not to handle the signal . <nl> + extern struct sigaction g_old_handler ; <nl> + extern bool g_is_default_signal_handler_registered ; <nl> + # endif <nl> + <nl> } / / namespace trap_handler <nl> } / / namespace internal <nl> } / / namespace v8 <nl> mmm a / src / trap - handler / trap - handler . h <nl> ppp b / src / trap - handler / trap - handler . h <nl> inline void ClearThreadInWasm ( ) { <nl> } <nl> <nl> bool RegisterDefaultSignalHandler ( ) ; <nl> + void RestoreOriginalSignalHandler ( ) ; <nl> <nl> # if V8_OS_LINUX <nl> bool TryHandleSignal ( int signum , siginfo_t * info , ucontext_t * context ) ; <nl> mmm a / test / unittests / BUILD . gn <nl> ppp b / test / unittests / BUILD . gn <nl> v8_source_set ( " unittests_sources " ) { <nl> " wasm / loop - assignment - analysis - unittest . cc " , <nl> " wasm / module - decoder - unittest . cc " , <nl> " wasm / streaming - decoder - unittest . cc " , <nl> + " wasm / trap - handler - unittest . cc " , <nl> " wasm / wasm - heap - unittest . cc " , <nl> " wasm / wasm - macro - gen - unittest . cc " , <nl> " wasm / wasm - module - builder - unittest . cc " , <nl> mmm a / test / unittests / unittests . gyp <nl> ppp b / test / unittests / unittests . gyp <nl> <nl> ' wasm / loop - assignment - analysis - unittest . cc ' , <nl> ' wasm / module - decoder - unittest . cc ' , <nl> ' wasm / streaming - decoder - unittest . cc ' , <nl> + ' wasm / trap - handler - unittest . cc ' , <nl> ' wasm / wasm - macro - gen - unittest . cc ' , <nl> ' wasm / wasm - module - builder - unittest . cc ' , <nl> ' wasm / wasm - opcodes - unittest . cc ' , <nl> new file mode 100644 <nl> index 00000000000 . . 0a5989044a1 <nl> mmm / dev / null <nl> ppp b / test / unittests / wasm / trap - handler - unittest . cc <nl> <nl> + / / Copyright 2017 the V8 project authors . All rights reserved . <nl> + / / Use of this source code is governed by a BSD - style license that can be <nl> + / / found in the LICENSE file . <nl> + <nl> + # include " src / trap - handler / trap - handler . h " <nl> + # include " include / v8 . h " <nl> + # include " testing / gtest / include / gtest / gtest . h " <nl> + <nl> + # if V8_OS_POSIX <nl> + # include < setjmp . h > <nl> + # include < signal . h > <nl> + # endif <nl> + <nl> + namespace { <nl> + <nl> + void CrashOnPurpose ( ) { * reinterpret_cast < volatile int * > ( 42 ) ; } <nl> + <nl> + # if V8_OS_POSIX <nl> + / / When using V8 : : RegisterDefaultSignalHandler , we save the old one to fall back <nl> + / / on if V8 doesn ' t handle the signal . This allows tools like ASan to register a <nl> + / / handler early on during the process startup and still generate stack traces <nl> + / / on failures . <nl> + class SignalHandlerFallbackTest : public : : testing : : Test { <nl> + protected : <nl> + virtual void SetUp ( ) { <nl> + struct sigaction action ; <nl> + action . sa_sigaction = SignalHandler ; <nl> + sigemptyset ( & action . sa_mask ) ; <nl> + action . sa_flags = SA_SIGINFO ; <nl> + sigaction ( SIGSEGV , & action , & old_segv_action_ ) ; <nl> + sigaction ( SIGBUS , & action , & old_bus_action_ ) ; <nl> + } <nl> + <nl> + virtual void TearDown ( ) { <nl> + / / be a good citizen and restore the old signal handler . <nl> + sigaction ( SIGSEGV , & old_segv_action_ , nullptr ) ; <nl> + sigaction ( SIGBUS , & old_bus_action_ , nullptr ) ; <nl> + } <nl> + <nl> + static sigjmp_buf continuation_ ; <nl> + <nl> + private : <nl> + static void SignalHandler ( int signal , siginfo_t * info , void * ) { <nl> + siglongjmp ( continuation_ , 1 ) ; <nl> + } <nl> + struct sigaction old_segv_action_ ; <nl> + struct sigaction old_bus_action_ ; / / We get SIGBUS on Mac sometimes . <nl> + } ; <nl> + sigjmp_buf SignalHandlerFallbackTest : : continuation_ ; <nl> + <nl> + TEST_F ( SignalHandlerFallbackTest , DoTest ) { <nl> + const int save_sigs = 1 ; <nl> + if ( ! sigsetjmp ( continuation_ , save_sigs ) ) { <nl> + v8 : : V8 : : RegisterDefaultSignalHandler ( ) ; <nl> + CrashOnPurpose ( ) ; <nl> + FAIL ( ) ; <nl> + } else { <nl> + / / Our signal handler ran . <nl> + v8 : : internal : : trap_handler : : RestoreOriginalSignalHandler ( ) ; <nl> + SUCCEED ( ) ; <nl> + return ; <nl> + } <nl> + FAIL ( ) ; <nl> + } <nl> + <nl> + # endif <nl> + <nl> + } / / namespace <nl> | [ wasm ] trap handlers : fall back on old signal handler | v8/v8 | ee4fe8963c435ff2d520aa34aafa6748e833af3a | 2017-10-10T18:03:12Z |
mmm a / . gitignore <nl> ppp b / . gitignore <nl> core <nl> # prebuild file <nl> Source / CNTK / buildinfo . h <nl> Source / CNTK / buildinfo . h $ $ <nl> + Source / CNTKv2LibraryDll / buildinfo . h <nl> <nl> # Unit test output <nl> Tests / UnitTests / ReaderTests / Control / * * / * _Output . txt <nl> | . gitignore : added Source / CNTKv2LibraryDll / buildinfo . h | microsoft/CNTK | af7a8b30624ca0a16e8325452408063374cf2172 | 2017-03-01T10:01:45Z |
mmm a / trunk / src / app / srs_app_avc_aac . cpp <nl> ppp b / trunk / src / app / srs_app_avc_aac . cpp <nl> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE . <nl> # include < srs_kernel_log . hpp > <nl> # include < srs_kernel_codec . hpp > <nl> # include < srs_kernel_stream . hpp > <nl> + # include < srs_protocol_amf0 . hpp > <nl> <nl> SrsCodecSampleUnit : : SrsCodecSampleUnit ( ) <nl> { <nl> SrsAvcAacCodec : : ~ SrsAvcAacCodec ( ) <nl> srs_freep ( pictureParameterSetNALUnit ) ; <nl> } <nl> <nl> + int SrsAvcAacCodec : : metadata_demux ( SrsAmf0Object * metadata ) <nl> + { <nl> + int ret = ERROR_SUCCESS ; <nl> + <nl> + srs_assert ( metadata ) ; <nl> + <nl> + SrsAmf0Object * obj = metadata ; <nl> + <nl> + / / finger out the codec info from metadata if possible . <nl> + SrsAmf0Any * prop = NULL ; <nl> + <nl> + if ( ( prop = obj - > get_property ( " duration " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> + duration = ( int ) prop - > to_number ( ) ; <nl> + } <nl> + if ( ( prop = obj - > get_property ( " width " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> + width = ( int ) prop - > to_number ( ) ; <nl> + } <nl> + if ( ( prop = obj - > get_property ( " height " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> + height = ( int ) prop - > to_number ( ) ; <nl> + } <nl> + if ( ( prop = obj - > get_property ( " framerate " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> + frame_rate = ( int ) prop - > to_number ( ) ; <nl> + } <nl> + if ( ( prop = obj - > get_property ( " videocodecid " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> + video_codec_id = ( int ) prop - > to_number ( ) ; <nl> + } <nl> + if ( ( prop = obj - > get_property ( " videodatarate " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> + video_data_rate = ( int ) ( 1000 * prop - > to_number ( ) ) ; <nl> + } <nl> + <nl> + if ( ( prop = obj - > get_property ( " audiocodecid " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> + audio_codec_id = ( int ) prop - > to_number ( ) ; <nl> + } <nl> + if ( ( prop = obj - > get_property ( " audiodatarate " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> + audio_data_rate = ( int ) ( 1000 * prop - > to_number ( ) ) ; <nl> + } <nl> + <nl> + / / ignore the following , for each flv / rtmp packet contains them : <nl> + / / audiosamplerate , sample - > sound_rate <nl> + / / audiosamplesize , sample - > sound_size <nl> + / / stereo , sample - > sound_type <nl> + <nl> + return ret ; <nl> + } <nl> + <nl> int SrsAvcAacCodec : : audio_aac_demux ( char * data , int size , SrsCodecSample * sample ) <nl> { <nl> int ret = ERROR_SUCCESS ; <nl> int SrsAvcAacCodec : : audio_aac_demux ( char * data , int size , SrsCodecSample * sample <nl> return ret ; <nl> } <nl> <nl> + / / @ see : E . 4 . 2 Audio Tags , video_file_format_spec_v10_1 . pdf , page 76 <nl> int8_t sound_format = stream - > read_1bytes ( ) ; <nl> <nl> int8_t sound_type = sound_format & 0x01 ; <nl> mmm a / trunk / src / app / srs_app_avc_aac . hpp <nl> ppp b / trunk / src / app / srs_app_avc_aac . hpp <nl> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE . <nl> # include < srs_kernel_codec . hpp > <nl> <nl> class SrsStream ; <nl> + class SrsAmf0Object ; <nl> <nl> # define SRS_MAX_CODEC_SAMPLE 128 <nl> # define _SRS_AAC_SAMPLE_RATE_UNSET 15 <nl> class SrsAvcAacCodec <nl> public : <nl> / * * <nl> * audio specified <nl> + * 1 . 6 . 2 . 1 AudioSpecificConfig , in aac - mp4a - format - ISO_IEC_14496 - 3 + 2001 . pdf , page 33 . <nl> + * audioObjectType , value defines in 7 . 1 Profiles , aac - iso - 13818 - 7 . pdf , page 40 . <nl> * / <nl> - / / 1 . 6 . 2 . 1 AudioSpecificConfig , in aac - mp4a - format - ISO_IEC_14496 - 3 + 2001 . pdf , page 33 . <nl> - / / audioObjectType , value defines in 7 . 1 Profiles , aac - iso - 13818 - 7 . pdf , page 40 . <nl> u_int8_t aac_profile ; <nl> - / / samplingFrequencyIndex <nl> + / * * <nl> + * samplingFrequencyIndex <nl> + * / <nl> u_int8_t aac_sample_rate ; <nl> - / / channelConfiguration <nl> + / * * <nl> + * channelConfiguration <nl> + * / <nl> u_int8_t aac_channels ; <nl> public : <nl> - / / the avc extra data , the AVC sequence header , <nl> - / / without the flv codec header , <nl> - / / @ see : ffmpeg , AVCodecContext : : extradata <nl> + / * * <nl> + * the avc extra data , the AVC sequence header , <nl> + * without the flv codec header , <nl> + * @ see : ffmpeg , AVCodecContext : : extradata <nl> + * / <nl> int avc_extra_size ; <nl> char * avc_extra_data ; <nl> - / / the aac extra data , the AAC sequence header , <nl> - / / without the flv codec header , <nl> - / / @ see : ffmpeg , AVCodecContext : : extradata <nl> + / * * <nl> + * the aac extra data , the AAC sequence header , <nl> + * without the flv codec header , <nl> + * @ see : ffmpeg , AVCodecContext : : extradata <nl> + * / <nl> int aac_extra_size ; <nl> char * aac_extra_data ; <nl> public : <nl> SrsAvcAacCodec ( ) ; <nl> virtual ~ SrsAvcAacCodec ( ) ; <nl> - / / the following function used for hls to build the codec info . <nl> + / / the following function used for hls to build the sample and codec . <nl> public : <nl> + / * * <nl> + * demux the metadata , to to get the stream info , <nl> + * for instance , the width / height , sample rate . <nl> + * @ param metadata , the metadata amf0 object . assert not NULL . <nl> + * / <nl> + virtual int metadata_demux ( SrsAmf0Object * metadata ) ; <nl> + / * * <nl> + * demux the audio packet in aac codec . <nl> + * the packet mux in FLV / RTMP format defined in flv specification . <nl> + * demux the audio speicified data ( sound_format , sound_size , . . . ) to sample . <nl> + * demux the aac specified data ( aac_profile , . . . ) to codec from sequence header . <nl> + * demux the aac raw to sample units . <nl> + * / <nl> virtual int audio_aac_demux ( char * data , int size , SrsCodecSample * sample ) ; <nl> + / * * <nl> + * demux the video packet in h . 264 codec . <nl> + * the packet mux in FLV / RTMP format defined in flv specification . <nl> + * demux the video specified data ( frame_type , codec_id , . . . ) to sample . <nl> + * demux the h . 264 sepcified data ( avc_profile , . . . ) to codec from sequence header . <nl> + * demux the h . 264 NALUs to sampe units . <nl> + * / <nl> virtual int video_avc_demux ( char * data , int size , SrsCodecSample * sample ) ; <nl> } ; <nl> <nl> mmm a / trunk / src / app / srs_app_hls . cpp <nl> ppp b / trunk / src / app / srs_app_hls . cpp <nl> int SrsHls : : on_meta_data ( SrsAmf0Object * metadata ) <nl> return ret ; <nl> } <nl> <nl> - SrsAmf0Object * obj = metadata ; <nl> - if ( obj - > count ( ) < = 0 ) { <nl> + if ( metadata - > count ( ) < = 0 ) { <nl> srs_trace ( " no metadata persent , hls ignored it . " ) ; <nl> return ret ; <nl> } <nl> <nl> - / / finger out the codec info from metadata if possible . <nl> - SrsAmf0Any * prop = NULL ; <nl> - <nl> - if ( ( prop = obj - > get_property ( " duration " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> - codec - > duration = ( int ) prop - > to_number ( ) ; <nl> - } <nl> - if ( ( prop = obj - > get_property ( " width " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> - codec - > width = ( int ) prop - > to_number ( ) ; <nl> - } <nl> - if ( ( prop = obj - > get_property ( " height " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> - codec - > height = ( int ) prop - > to_number ( ) ; <nl> - } <nl> - if ( ( prop = obj - > get_property ( " framerate " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> - codec - > frame_rate = ( int ) prop - > to_number ( ) ; <nl> - } <nl> - if ( ( prop = obj - > get_property ( " videocodecid " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> - codec - > video_codec_id = ( int ) prop - > to_number ( ) ; <nl> - } <nl> - if ( ( prop = obj - > get_property ( " videodatarate " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> - codec - > video_data_rate = ( int ) ( 1000 * prop - > to_number ( ) ) ; <nl> - } <nl> - <nl> - if ( ( prop = obj - > get_property ( " audiocodecid " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> - codec - > audio_codec_id = ( int ) prop - > to_number ( ) ; <nl> - } <nl> - if ( ( prop = obj - > get_property ( " audiodatarate " ) ) ! = NULL & & prop - > is_number ( ) ) { <nl> - codec - > audio_data_rate = ( int ) ( 1000 * prop - > to_number ( ) ) ; <nl> + if ( ( ret = codec - > metadata_demux ( metadata ) ) ! = ERROR_SUCCESS ) { <nl> + return ret ; <nl> } <nl> <nl> - / / ignore the following , for each flv / rtmp packet contains them : <nl> - / / audiosamplerate , sample - > sound_rate <nl> - / / audiosamplesize , sample - > sound_size <nl> - / / stereo , sample - > sound_type <nl> - <nl> return ret ; <nl> } <nl> <nl> | refine hls avc / aac codec , move metadata to it . | ossrs/srs | 465ff88b1f786e165244513ef11a585611eba435 | 2014-07-16T01:37:27Z |
mmm a / AirLib / include / common / common_utils / Utils . hpp <nl> ppp b / AirLib / include / common / common_utils / Utils . hpp <nl> class Utils { <nl> static std : : size_t length ( const T ( & ) [ N ] ) <nl> { <nl> return N ; <nl> - } ; <nl> + } <nl> <nl> static void saveToFile ( string file_name , const char * data , uint size ) <nl> { <nl> | Merge pull request from jasonbeach / Utils_Warning_fix | microsoft/AirSim | b0e1e6295b6be93f7db946c65b63b95dc9649615 | 2019-11-04T21:41:37Z |
mmm a / Examples / ReinforcementLearning / DeepQNeuralNetwork . py <nl> ppp b / Examples / ReinforcementLearning / DeepQNeuralNetwork . py <nl> def compute_q_targets ( post_states , rewards , terminals ) : <nl> return element_select ( <nl> terminals , <nl> rewards , <nl> - gamma * reduce_max ( self . _target_net ( post_states ) , axis = 1 ) + rewards , <nl> + gamma * reduce_max ( self . _target_net ( post_states ) , axis = 0 ) + rewards , <nl> ) <nl> <nl> # Define the loss , using Huber Loss ( More robust to outliers ) <nl> | Fix wrong axis for q target computation | microsoft/CNTK | 7e6938b08f97581b8e90d7a26ad1694e3c854ce6 | 2017-05-04T15:57:33Z |
mmm a / xbmc / addons / kodi - dev - kit / include / kodi / versions . h <nl> ppp b / xbmc / addons / kodi - dev - kit / include / kodi / versions . h <nl> <nl> # define ADDON_INSTANCE_VERSION_AUDIOENCODER_DEPENDS " c - api / addon - instance / audio_encoder . h " \ <nl> " addon - instance / AudioEncoder . h " <nl> <nl> - # define ADDON_INSTANCE_VERSION_GAME " 2 . 0 . 2 " <nl> - # define ADDON_INSTANCE_VERSION_GAME_MIN " 2 . 0 . 1 " <nl> + # define ADDON_INSTANCE_VERSION_GAME " 2 . 1 . 0 " <nl> + # define ADDON_INSTANCE_VERSION_GAME_MIN " 2 . 1 . 0 " <nl> # define ADDON_INSTANCE_VERSION_GAME_XML_ID " kodi . binary . instance . game " <nl> # define ADDON_INSTANCE_VERSION_GAME_DEPENDS " addon - instance / Game . h " <nl> <nl> | [ addons ] [ game ] increase API version to 2 . 1 . 0 | xbmc/xbmc | 130c3b5a41736c6c7a110e7bf7d94efdbd59c54b | 2020-09-12T02:20:24Z |
mmm a / src / common / device_helpers . cuh <nl> ppp b / src / common / device_helpers . cuh <nl> class MemoryLogger { <nl> peak_allocated_bytes = <nl> std : : max ( peak_allocated_bytes , currently_allocated_bytes ) ; <nl> num_allocations + + ; <nl> + CHECK_GT ( num_allocations , num_deallocations ) ; <nl> } <nl> - void RegisterDeallocation ( void * ptr ) { <nl> + void RegisterDeallocation ( void * ptr , size_t n , int current_device ) { <nl> + auto itr = device_allocations . find ( ptr ) ; <nl> + if ( itr = = device_allocations . end ( ) ) { <nl> + LOG ( FATAL ) < < " Attempting to deallocate " < < n < < " bytes on device " <nl> + < < current_device < < " that was never allocated " ; <nl> + } <nl> num_deallocations + + ; <nl> - currently_allocated_bytes - = device_allocations [ ptr ] ; <nl> - device_allocations . erase ( ptr ) ; <nl> + CHECK_LE ( num_deallocations , num_allocations ) ; <nl> + CHECK_EQ ( itr - > second , n ) ; <nl> + currently_allocated_bytes - = itr - > second ; <nl> + device_allocations . erase ( itr ) ; <nl> } <nl> } ; <nl> std : : map < int , DeviceStats > <nl> public : <nl> int current_device ; <nl> safe_cuda ( cudaGetDevice ( & current_device ) ) ; <nl> stats_ [ current_device ] . RegisterAllocation ( ptr , n ) ; <nl> + CHECK_LE ( stats_ [ current_device ] . peak_allocated_bytes , dh : : TotalMemory ( current_device ) ) ; <nl> } <nl> - void RegisterDeallocation ( void * ptr ) { <nl> + void RegisterDeallocation ( void * ptr , size_t n ) { <nl> if ( ! xgboost : : ConsoleLogger : : ShouldLog ( xgboost : : ConsoleLogger : : LV : : kDebug ) ) <nl> return ; <nl> std : : lock_guard < std : : mutex > guard ( mutex_ ) ; <nl> int current_device ; <nl> safe_cuda ( cudaGetDevice ( & current_device ) ) ; <nl> - stats_ [ current_device ] . RegisterDeallocation ( ptr ) ; <nl> + stats_ [ current_device ] . RegisterDeallocation ( ptr , n , current_device ) ; <nl> } <nl> void Log ( ) { <nl> if ( ! xgboost : : ConsoleLogger : : ShouldLog ( xgboost : : ConsoleLogger : : LV : : kDebug ) ) <nl> struct XGBDefaultDeviceAllocator : thrust : : device_malloc_allocator < T > { <nl> return ptr ; <nl> } <nl> void deallocate ( pointer ptr , size_t n ) { <nl> - GlobalMemoryLogger ( ) . RegisterDeallocation ( ptr . get ( ) ) ; <nl> + GlobalMemoryLogger ( ) . RegisterDeallocation ( ptr . get ( ) , n ) ; <nl> return super_t : : deallocate ( ptr , n ) ; <nl> } <nl> } ; <nl> struct CubMemory { <nl> XGBDeviceAllocator < uint8_t > allocator ; <nl> allocator . deallocate ( thrust : : device_ptr < uint8_t > ( static_cast < uint8_t * > ( d_temp_storage ) ) , <nl> temp_storage_bytes ) ; <nl> + d_temp_storage = nullptr ; <nl> + temp_storage_bytes = 0 ; <nl> } <nl> } <nl> <nl> mmm a / src / common / hist_util . cu <nl> ppp b / src / common / hist_util . cu <nl> struct GPUSketcher { <nl> n_rows_ ( row_end - row_begin ) , param_ ( std : : move ( param ) ) , sketch_container_ ( sketch_container ) { <nl> } <nl> <nl> + ~ DeviceShard ( ) { <nl> + dh : : safe_cuda ( cudaSetDevice ( device_ ) ) ; <nl> + } <nl> + <nl> inline size_t GetRowStride ( ) const { <nl> return row_stride_ ; <nl> } <nl> mmm a / src / common / host_device_vector . cu <nl> ppp b / src / common / host_device_vector . cu <nl> struct HostDeviceVectorImpl { <nl> : proper_size_ { 0 } , device_ { - 1 } , start_ { 0 } , perm_d_ { false } , <nl> cached_size_ { static_cast < size_t > ( ~ 0 ) } , vec_ { nullptr } { } <nl> <nl> + ~ DeviceShard ( ) { <nl> + SetDevice ( ) ; <nl> + } <nl> + <nl> void Init ( HostDeviceVectorImpl < T > * vec , int device ) { <nl> if ( vec_ = = nullptr ) { vec_ = vec ; } <nl> CHECK_EQ ( vec , vec_ ) ; <nl> mmm a / src / linear / updater_gpu_coordinate . cu <nl> ppp b / src / linear / updater_gpu_coordinate . cu <nl> class DeviceShard { <nl> RescaleIndices ( device_id_ , ridx_begin_ , data_ ) ; <nl> } <nl> <nl> + ~ DeviceShard ( ) { <nl> + dh : : safe_cuda ( cudaSetDevice ( device_id_ ) ) ; <nl> + } <nl> + <nl> bool IsEmpty ( ) { <nl> return ( ridx_end_ - ridx_begin_ ) = = 0 ; <nl> } <nl> mmm a / src / metric / elementwise_metric . cu <nl> ppp b / src / metric / elementwise_metric . cu <nl> class ElementWiseMetricsReduction { <nl> <nl> # if defined ( XGBOOST_USE_CUDA ) <nl> <nl> + ~ ElementWiseMetricsReduction ( ) { <nl> + for ( GPUSet : : GpuIdType id = * devices_ . begin ( ) ; id < * devices_ . end ( ) ; + + id ) { <nl> + dh : : safe_cuda ( cudaSetDevice ( id ) ) ; <nl> + size_t index = devices_ . Index ( id ) ; <nl> + allocators_ . at ( index ) . Free ( ) ; <nl> + } <nl> + } <nl> + <nl> PackedReduceResult DeviceReduceMetrics ( <nl> GPUSet : : GpuIdType device_id , <nl> size_t device_index , <nl> class ElementWiseMetricsReduction { <nl> # endif / / XGBOOST_USE_CUDA <nl> <nl> PackedReduceResult Reduce ( <nl> + const LearnerTrainParam & tparam , <nl> GPUSet devices , <nl> const HostDeviceVector < bst_float > & weights , <nl> const HostDeviceVector < bst_float > & labels , <nl> class ElementWiseMetricsReduction { <nl> } <nl> # if defined ( XGBOOST_USE_CUDA ) <nl> else { / / NOLINT <nl> - if ( allocators_ . size ( ) ! = devices . Size ( ) ) { <nl> - allocators_ . clear ( ) ; <nl> - allocators_ . resize ( devices . Size ( ) ) ; <nl> + if ( allocators_ . empty ( ) ) { <nl> + devices_ = GPUSet : : All ( tparam . gpu_id , tparam . n_gpus ) ; <nl> + allocators_ . resize ( devices_ . Size ( ) ) ; <nl> } <nl> preds . Shard ( devices ) ; <nl> labels . Shard ( devices ) ; <nl> class ElementWiseMetricsReduction { <nl> private : <nl> EvalRow policy_ ; <nl> # if defined ( XGBOOST_USE_CUDA ) <nl> + GPUSet devices_ ; <nl> std : : vector < dh : : CubMemory > allocators_ ; <nl> # endif / / defined ( XGBOOST_USE_CUDA ) <nl> } ; <nl> struct EvalEWiseBase : public Metric { <nl> GPUSet devices = GPUSet : : All ( tparam_ - > gpu_id , tparam_ - > n_gpus , ndata ) ; <nl> <nl> auto result = <nl> - reducer_ . Reduce ( devices , info . weights_ , info . labels_ , preds ) ; <nl> + reducer_ . Reduce ( * tparam_ , devices , info . weights_ , info . labels_ , preds ) ; <nl> <nl> double dat [ 2 ] { result . Residue ( ) , result . Weights ( ) } ; <nl> if ( distributed ) { <nl> mmm a / src / metric / multiclass_metric . cu <nl> ppp b / src / metric / multiclass_metric . cu <nl> class MultiClassMetricsReduction { <nl> <nl> # if defined ( XGBOOST_USE_CUDA ) <nl> <nl> + ~ MultiClassMetricsReduction ( ) { <nl> + for ( GPUSet : : GpuIdType id = * devices_ . begin ( ) ; id < * devices_ . end ( ) ; + + id ) { <nl> + dh : : safe_cuda ( cudaSetDevice ( id ) ) ; <nl> + size_t index = devices_ . Index ( id ) ; <nl> + allocators_ . at ( index ) . Free ( ) ; <nl> + } <nl> + } <nl> + <nl> PackedReduceResult DeviceReduceMetrics ( <nl> GPUSet : : GpuIdType device_id , <nl> size_t device_index , <nl> class MultiClassMetricsReduction { <nl> # endif / / XGBOOST_USE_CUDA <nl> <nl> PackedReduceResult Reduce ( <nl> + const LearnerTrainParam & tparam , <nl> GPUSet devices , <nl> size_t n_class , <nl> const HostDeviceVector < bst_float > & weights , <nl> class MultiClassMetricsReduction { <nl> } <nl> # if defined ( XGBOOST_USE_CUDA ) <nl> else { / / NOLINT <nl> - if ( allocators_ . size ( ) ! = devices . Size ( ) ) { <nl> - allocators_ . clear ( ) ; <nl> - allocators_ . resize ( devices . Size ( ) ) ; <nl> + if ( allocators_ . empty ( ) ) { <nl> + devices_ = GPUSet : : All ( tparam . gpu_id , tparam . n_gpus ) ; <nl> + allocators_ . resize ( devices_ . Size ( ) ) ; <nl> } <nl> preds . Shard ( GPUDistribution : : Granular ( devices , n_class ) ) ; <nl> labels . Shard ( devices ) ; <nl> class MultiClassMetricsReduction { <nl> private : <nl> # if defined ( XGBOOST_USE_CUDA ) <nl> dh : : PinnedMemory label_error_ ; <nl> + GPUSet devices_ ; <nl> std : : vector < dh : : CubMemory > allocators_ ; <nl> # endif / / defined ( XGBOOST_USE_CUDA ) <nl> } ; <nl> struct EvalMClassBase : public Metric { <nl> const auto ndata = static_cast < bst_omp_uint > ( info . labels_ . Size ( ) ) ; <nl> <nl> GPUSet devices = GPUSet : : All ( tparam_ - > gpu_id , tparam_ - > n_gpus , ndata ) ; <nl> - auto result = reducer_ . Reduce ( devices , nclass , info . weights_ , info . labels_ , preds ) ; <nl> + auto result = reducer_ . Reduce ( * tparam_ , devices , nclass , info . weights_ , info . labels_ , preds ) ; <nl> double dat [ 2 ] { result . Residue ( ) , result . Weights ( ) } ; <nl> <nl> if ( distributed ) { <nl> mmm a / tests / cpp / common / test_host_device_vector . cu <nl> ppp b / tests / cpp / common / test_host_device_vector . cu <nl> void SetDevice ( int device ) { <nl> dh : : safe_cuda ( cudaSetDevice ( device ) ) ; <nl> } <nl> <nl> + struct HostDeviceVectorSetDeviceHandler { <nl> + template < typename Functor > <nl> + explicit HostDeviceVectorSetDeviceHandler ( Functor f ) { <nl> + SetCudaSetDeviceHandler ( f ) ; <nl> + } <nl> + <nl> + ~ HostDeviceVectorSetDeviceHandler ( ) { <nl> + SetCudaSetDeviceHandler ( nullptr ) ; <nl> + } <nl> + } ; <nl> + <nl> void InitHostDeviceVector ( size_t n , const GPUDistribution & distribution , <nl> HostDeviceVector < int > * v ) { <nl> / / create the vector <nl> void CheckHost ( HostDeviceVector < int > * v , GPUAccess access ) { <nl> void TestHostDeviceVector <nl> ( size_t n , const GPUDistribution & distribution , <nl> const std : : vector < size_t > & starts , const std : : vector < size_t > & sizes ) { <nl> - SetCudaSetDeviceHandler ( SetDevice ) ; <nl> + HostDeviceVectorSetDeviceHandler hdvec_dev_hndlr ( SetDevice ) ; <nl> HostDeviceVector < int > v ; <nl> InitHostDeviceVector ( n , distribution , & v ) ; <nl> CheckDevice ( & v , starts , sizes , 0 , GPUAccess : : kRead ) ; <nl> void TestHostDeviceVector <nl> CheckDevice ( & v , starts , sizes , 1 , GPUAccess : : kWrite ) ; <nl> CheckHost ( & v , GPUAccess : : kRead ) ; <nl> CheckHost ( & v , GPUAccess : : kWrite ) ; <nl> - SetCudaSetDeviceHandler ( nullptr ) ; <nl> } <nl> <nl> TEST ( HostDeviceVector , TestBlock ) { <nl> TEST ( HostDeviceVector , TestCopy ) { <nl> auto distribution = GPUDistribution : : Block ( GPUSet : : Range ( 0 , n_devices ) ) ; <nl> std : : vector < size_t > starts { 0 , 501 } ; <nl> std : : vector < size_t > sizes { 501 , 500 } ; <nl> - SetCudaSetDeviceHandler ( SetDevice ) ; <nl> + HostDeviceVectorSetDeviceHandler hdvec_dev_hndlr ( SetDevice ) ; <nl> <nl> HostDeviceVector < int > v ; <nl> { <nl> TEST ( HostDeviceVector , TestCopy ) { <nl> CheckDevice ( & v , starts , sizes , 1 , GPUAccess : : kWrite ) ; <nl> CheckHost ( & v , GPUAccess : : kRead ) ; <nl> CheckHost ( & v , GPUAccess : : kWrite ) ; <nl> - SetCudaSetDeviceHandler ( nullptr ) ; <nl> } <nl> <nl> TEST ( HostDeviceVector , Shard ) { <nl> mmm a / tests / cpp / predictor / test_gpu_predictor . cu <nl> ppp b / tests / cpp / predictor / test_gpu_predictor . cu <nl> <nl> # include " gtest / gtest . h " <nl> # include " . . / helpers . h " <nl> <nl> + # if defined ( XGBOOST_USE_NCCL ) <nl> namespace { <nl> <nl> inline void CheckCAPICall ( int ret ) { <nl> inline void CheckCAPICall ( int ret ) { <nl> } <nl> <nl> } / / namespace anonymous <nl> + # endif <nl> <nl> extern const std : : map < std : : string , std : : string > & <nl> QueryBoosterConfigurationArguments ( BoosterHandle handle ) ; <nl> | Set the appropriate device before freeing device memory . . . ( ) | dmlc/xgboost | 90f683b25be28150487dead9a695b20dc464d0b4 | 2019-06-18T02:58:05Z |
mmm a / modules / imgproc / include / opencv2 / imgproc . hpp <nl> ppp b / modules / imgproc / include / opencv2 / imgproc . hpp <nl> class CV_EXPORTS_W Subdiv2D <nl> / * * @ brief Returns vertex location from vertex ID . <nl> <nl> @ param vertex – vertex ID . <nl> + @ param firstEdge – Optional . The first edge ID which is connected to the vertex . <nl> @ returns vertex ( x , y ) <nl> <nl> * / <nl> | Added param documentation | opencv/opencv | 238b47dfce70493b0b0f0bb691255f9759c91f5d | 2016-03-02T06:55:53Z |
mmm a / tests / env / src . c <nl> ppp b / tests / env / src . c <nl> <nl> <nl> int main ( ) { <nl> printf ( " List : \ n " ) ; <nl> - for ( char * * str = __environ ; * str ; str + + ) { <nl> + for ( char * * str = environ ; * str ; str + + ) { <nl> printf ( " % s \ n " , * str ) ; <nl> } <nl> printf ( " \ n " ) ; <nl> | fix env test | emscripten-core/emscripten | 4d4bb9caaff23db5ece0ece344ee3b719c486c20 | 2011-09-25T05:16:14Z |
mmm a / src / jsregexp . cc <nl> ppp b / src / jsregexp . cc <nl> RegExpNode * ChoiceNode : : FilterASCII ( int depth ) { <nl> GuardedAlternative alternative = alternatives_ - > at ( i ) ; <nl> RegExpNode * replacement = alternative . node ( ) - > FilterASCII ( depth - 1 ) ; <nl> ASSERT ( replacement ! = this ) ; / / No missing EMPTY_MATCH_CHECK . <nl> - alternatives_ - > at ( i ) . set_node ( replacement ) ; <nl> if ( replacement ! = NULL ) { <nl> + alternatives_ - > at ( i ) . set_node ( replacement ) ; <nl> surviving + + ; <nl> survivor = replacement ; <nl> } <nl> RegExpNode * ChoiceNode : : FilterASCII ( int depth ) { <nl> ZoneList < GuardedAlternative > * new_alternatives = <nl> new ZoneList < GuardedAlternative > ( surviving ) ; <nl> for ( int i = 0 ; i < choice_count ; i + + ) { <nl> - GuardedAlternative alternative = alternatives_ - > at ( i ) ; <nl> - if ( alternative . node ( ) ! = NULL ) { <nl> - new_alternatives - > Add ( alternative ) ; <nl> + RegExpNode * replacement = <nl> + alternatives_ - > at ( i ) . node ( ) - > FilterASCII ( depth - 1 ) ; <nl> + if ( replacement ! = NULL ) { <nl> + alternatives_ - > at ( i ) . set_node ( replacement ) ; <nl> + new_alternatives - > Add ( alternatives_ - > at ( i ) ) ; <nl> } <nl> } <nl> alternatives_ = new_alternatives ; <nl> RegExpEngine : : CompilationResult RegExpEngine : : Compile ( <nl> node = loop_node ; <nl> } <nl> } <nl> - if ( is_ascii ) node = node - > FilterASCII ( RegExpCompiler : : kMaxRecursion ) ; <nl> + if ( is_ascii ) { <nl> + node = node - > FilterASCII ( RegExpCompiler : : kMaxRecursion ) ; <nl> + / / Do it again to propagate the new nodes to places where they were not <nl> + / / put because they had not been calculated yet . <nl> + if ( node ! = NULL ) node = node - > FilterASCII ( RegExpCompiler : : kMaxRecursion ) ; <nl> + } <nl> <nl> if ( node = = NULL ) node = new EndNode ( EndNode : : BACKTRACK ) ; <nl> data - > node = node ; <nl> mmm a / test / mjsunit / regexp - capture - 3 . js <nl> ppp b / test / mjsunit / regexp - capture - 3 . js <nl> regex9 . exec ( input0 ) ; <nl> <nl> var regex10 = new RegExp ( re , " i " ) ; <nl> regex10 . exec ( input0 ) ; <nl> + <nl> + var regex11 = / ^ ( ? : [ ^ \ u0000 - \ u0080 ] | [ 0 - 9a - z ? , . ! & \ s # ( ) ] ) + $ / i ; <nl> + regex11 . exec ( input0 ) ; <nl> + <nl> | Fix crash bug in VisitChoice ( bug = 126272 ) . | v8/v8 | 80256c7452b04fd920563071c4e9996d3626f5ea | 2012-05-07T13:23:56Z |
mmm a / dbms / src / Storages / MergeTree / MergeTreeDataPart . cpp <nl> ppp b / dbms / src / Storages / MergeTree / MergeTreeDataPart . cpp <nl> MergeTreeDataPart : : ~ MergeTreeDataPart ( ) <nl> <nl> / / / " Atomically " remove directory , leaving no inconsistent state . <nl> Poco : : Path source_path ( path ) ; <nl> - Poco : : Path destination_path ( path , " . . / stale_ " + source_path . getBaseName ( ) ) ; <nl> + Poco : : Path destination_path ( path , " . . / detached / stale_ " + source_path . getBaseName ( ) ) ; <nl> dir . renameTo ( destination_path . toString ( ) ) ; <nl> dir . remove ( true ) ; <nl> <nl> | Fixed temporary path for part being erased . | ClickHouse/ClickHouse | 2d749630b732d9f89a77426c74b61c0527853312 | 2020-01-25T21:27:46Z |
mmm a / xbmc / dbwrappers / Database . cpp <nl> ppp b / xbmc / dbwrappers / Database . cpp <nl> CStdString CDatabase : : GetSingleValue ( const CStdString & query ) <nl> return GetSingleValue ( query , m_pDS ) ; <nl> } <nl> <nl> - bool CDatabase : : DeleteValues ( const CStdString & strTable , const CStdString & strWhereClause / * = CStdString ( ) * / ) <nl> + bool CDatabase : : DeleteValues ( const CStdString & strTable , const Filter & filter / * = Filter ( ) * / ) <nl> { <nl> - bool bReturn = true ; <nl> - <nl> - CStdString strQueryBase = " DELETE FROM % s " ; <nl> - if ( ! strWhereClause . empty ( ) ) <nl> - strQueryBase + = StringUtils : : Format ( " WHERE % s " , strWhereClause . c_str ( ) ) ; <nl> - <nl> - CStdString strQuery = FormatSQL ( strQueryBase , strTable . c_str ( ) ) ; <nl> - <nl> - bReturn = ExecuteQuery ( strQuery ) ; <nl> - <nl> - return bReturn ; <nl> + CStdString strQuery ; <nl> + BuildSQL ( PrepareSQL ( " DELETE FROM % s " , strTable . c_str ( ) ) , filter , strQuery ) ; <nl> + return ExecuteQuery ( strQuery ) ; <nl> } <nl> <nl> bool CDatabase : : ExecuteQuery ( const CStdString & strQuery ) <nl> mmm a / xbmc / dbwrappers / Database . h <nl> ppp b / xbmc / dbwrappers / Database . h <nl> class CDatabase <nl> <nl> / * ! <nl> * @ brief Delete values from a table . <nl> - * @ remarks The value of the strWhereClause parameter has to be FormatSQL ' ed when used . <nl> * @ param strTable The table to delete the values from . <nl> - * @ param strWhereClause If set , use this WHERE clause . <nl> + * @ param filter The Filter to apply to this query . <nl> * @ return True if the query was executed successfully , false otherwise . <nl> * / <nl> - bool DeleteValues ( const CStdString & strTable , const CStdString & strWhereClause = CStdString ( ) ) ; <nl> + bool DeleteValues ( const CStdString & strTable , const Filter & filter = Filter ( ) ) ; <nl> <nl> / * ! <nl> * @ brief Execute a query that does not return any result . <nl> mmm a / xbmc / epg / EpgDatabase . cpp <nl> ppp b / xbmc / epg / EpgDatabase . cpp <nl> bool CEpgDatabase : : Delete ( const CEpg & table ) <nl> return false ; <nl> } <nl> <nl> - CStdString strWhereClause ; <nl> - strWhereClause = FormatSQL ( " idEpg = % u " , table . EpgID ( ) ) ; <nl> + Filter filter ; <nl> + filter . AppendWhere ( PrepareSQL ( " idEpg = % u " , table . EpgID ( ) ) ) ; <nl> <nl> - return DeleteValues ( " epg " , strWhereClause ) ; <nl> + return DeleteValues ( " epg " , filter ) ; <nl> } <nl> <nl> bool CEpgDatabase : : DeleteOldEpgEntries ( void ) <nl> bool CEpgDatabase : : DeleteOldEpgEntries ( void ) <nl> CDateTimeSpan ( 0 , g_advancedSettings . m_iEpgLingerTime / 60 , g_advancedSettings . m_iEpgLingerTime % 60 , 0 ) ; <nl> cleanupTime . GetAsTime ( iCleanupTime ) ; <nl> <nl> - CStdString strWhereClause = FormatSQL ( " iEndTime < % u " , iCleanupTime ) ; <nl> + Filter filter ; <nl> + filter . AppendWhere ( PrepareSQL ( " iEndTime < % u " , iCleanupTime ) ) ; <nl> <nl> - return DeleteValues ( " epgtags " , strWhereClause ) ; <nl> + return DeleteValues ( " epgtags " , filter ) ; <nl> } <nl> <nl> bool CEpgDatabase : : Delete ( const CEpgInfoTag & tag ) <nl> bool CEpgDatabase : : Delete ( const CEpgInfoTag & tag ) <nl> if ( tag . BroadcastId ( ) < = 0 ) <nl> return false ; <nl> <nl> - CStdString strWhereClause = FormatSQL ( " idBroadcast = % u " , tag . BroadcastId ( ) ) ; <nl> + Filter filter ; <nl> + filter . AppendWhere ( PrepareSQL ( " idBroadcast = % u " , tag . BroadcastId ( ) ) ) ; <nl> <nl> - return DeleteValues ( " epgtags " , strWhereClause ) ; <nl> + return DeleteValues ( " epgtags " , filter ) ; <nl> } <nl> <nl> int CEpgDatabase : : Get ( CEpgContainer & container ) <nl> mmm a / xbmc / pvr / PVRDatabase . cpp <nl> ppp b / xbmc / pvr / PVRDatabase . cpp <nl> bool CPVRDatabase : : DeleteClientChannels ( const CPVRClient & client ) <nl> } <nl> <nl> CLog : : Log ( LOGDEBUG , " PVR - % s - deleting all channels from client ' % i ' from the database " , __FUNCTION__ , client . GetID ( ) ) ; <nl> - CStdString strWhereClause = FormatSQL ( " iClientId = % u " , client . GetID ( ) ) ; <nl> - return DeleteValues ( " channels " , strWhereClause ) ; <nl> + <nl> + Filter filter ; <nl> + filter . AppendWhere ( PrepareSQL ( " iClientId = % u " , client . GetID ( ) ) ) ; <nl> + <nl> + return DeleteValues ( " channels " , filter ) ; <nl> } <nl> <nl> bool CPVRDatabase : : Delete ( const CPVRChannel & channel ) <nl> bool CPVRDatabase : : Delete ( const CPVRChannel & channel ) <nl> return false ; <nl> <nl> CLog : : Log ( LOGDEBUG , " PVR - % s - deleting channel ' % s ' from the database " , __FUNCTION__ , channel . ChannelName ( ) . c_str ( ) ) ; <nl> - CStdString strWhereClause = FormatSQL ( " idChannel = % u " , channel . ChannelID ( ) ) ; <nl> - return DeleteValues ( " channels " , strWhereClause ) ; <nl> + <nl> + Filter filter ; <nl> + filter . AppendWhere ( PrepareSQL ( " idChannel = % u " , channel . ChannelID ( ) ) ) ; <nl> + <nl> + return DeleteValues ( " channels " , filter ) ; <nl> } <nl> <nl> int CPVRDatabase : : Get ( CPVRChannelGroupInternal & results ) <nl> bool CPVRDatabase : : DeleteChannelSettings ( const CPVRChannel & channel ) <nl> return bReturn ; <nl> } <nl> <nl> - CStdString strWhereClause = FormatSQL ( " idChannel = % u " , channel . ChannelID ( ) ) ; <nl> - return DeleteValues ( " channelsettings " , strWhereClause ) ; <nl> + Filter filter ; <nl> + filter . AppendWhere ( PrepareSQL ( " idChannel = % u " , channel . ChannelID ( ) ) ) ; <nl> + <nl> + return DeleteValues ( " channelsettings " , filter ) ; <nl> } <nl> <nl> bool CPVRDatabase : : GetChannelSettings ( const CPVRChannel & channel , CVideoSettings & settings ) <nl> bool CPVRDatabase : : PersistChannelSettings ( const CPVRChannel & channel , const CVid <nl> <nl> bool CPVRDatabase : : RemoveChannelsFromGroup ( const CPVRChannelGroup & group ) <nl> { <nl> - CStdString strWhereClause = FormatSQL ( " idGroup = % u " , group . GroupID ( ) ) ; <nl> - return DeleteValues ( " map_channelgroups_channels " , strWhereClause ) ; <nl> + Filter filter ; <nl> + filter . AppendWhere ( PrepareSQL ( " idGroup = % u " , group . GroupID ( ) ) ) ; <nl> + <nl> + return DeleteValues ( " map_channelgroups_channels " , filter ) ; <nl> } <nl> <nl> bool CPVRDatabase : : GetCurrentGroupMembers ( const CPVRChannelGroup & group , vector < int > & members ) <nl> bool CPVRDatabase : : DeleteChannelsFromGroup ( const CPVRChannelGroup & group ) <nl> return false ; <nl> } <nl> <nl> - CStdString strWhereClause ; <nl> - strWhereClause = FormatSQL ( " idGroup = % u " , group . GroupID ( ) ) ; <nl> - return DeleteValues ( " map_channelgroups_channels " , strWhereClause ) ; <nl> + Filter filter ; <nl> + filter . AppendWhere ( PrepareSQL ( " idGroup = % u " , group . GroupID ( ) ) ) ; <nl> + <nl> + return DeleteValues ( " map_channelgroups_channels " , filter ) ; <nl> } <nl> <nl> bool CPVRDatabase : : DeleteChannelsFromGroup ( const CPVRChannelGroup & group , const vector < int > & channelsToDelete ) <nl> bool CPVRDatabase : : DeleteChannelsFromGroup ( const CPVRChannelGroup & group , const <nl> while ( iDeletedChannels < channelsToDelete . size ( ) ) <nl> { <nl> CStdString strChannelsToDelete ; <nl> - CStdString strWhereClause ; <nl> <nl> for ( unsigned int iChannelPtr = 0 ; iChannelPtr + iDeletedChannels < channelsToDelete . size ( ) & & iChannelPtr < 50 ; iChannelPtr + + ) <nl> strChannelsToDelete + = StringUtils : : Format ( " , % d " , channelsToDelete . at ( iDeletedChannels + iChannelPtr ) ) ; <nl> bool CPVRDatabase : : DeleteChannelsFromGroup ( const CPVRChannelGroup & group , const <nl> if ( ! strChannelsToDelete . empty ( ) ) <nl> { <nl> strChannelsToDelete . erase ( 0 , 2 ) ; <nl> - strWhereClause = FormatSQL ( " idGroup = % u AND idChannel IN ( % s ) " , group . GroupID ( ) , strChannelsToDelete . c_str ( ) ) ; <nl> - bDelete = DeleteValues ( " map_channelgroups_channels " , strWhereClause ) & & bDelete ; <nl> + <nl> + Filter filter ; <nl> + filter . AppendWhere ( PrepareSQL ( " idGroup = % u " , group . GroupID ( ) ) ) ; <nl> + filter . AppendWhere ( PrepareSQL ( " AND idChannel IN ( % s ) " , strChannelsToDelete . c_str ( ) ) ) ; <nl> + <nl> + bDelete = DeleteValues ( " map_channelgroups_channels " , filter ) & & bDelete ; <nl> } <nl> <nl> iDeletedChannels + = 50 ; <nl> bool CPVRDatabase : : RemoveStaleChannelsFromGroup ( const CPVRChannelGroup & group ) <nl> } <nl> else <nl> { <nl> - CStdString strWhereClause = FormatSQL ( " idChannel IN ( SELECT m . idChannel FROM map_channelgroups_channels m LEFT JOIN channels on m . idChannel = channels . idChannel WHERE channels . idChannel IS NULL ) " ) ; <nl> - bDelete = DeleteValues ( " map_channelgroups_channels " , strWhereClause ) ; <nl> + Filter filter ; <nl> + filter . AppendWhere ( " idChannel IN ( SELECT m . idChannel FROM map_channelgroups_channels m LEFT JOIN channels on m . idChannel = channels . idChannel WHERE channels . idChannel IS NULL ) " ) ; <nl> + <nl> + bDelete = DeleteValues ( " map_channelgroups_channels " , filter ) ; <nl> } <nl> } <nl> <nl> bool CPVRDatabase : : RemoveStaleChannelsFromGroup ( const CPVRChannelGroup & group ) <nl> } <nl> else <nl> { <nl> - CStdString strWhereClause = FormatSQL ( " idGroup = % u " , group . GroupID ( ) ) ; <nl> - bDelete = DeleteValues ( " map_channelgroups_channels " , strWhereClause ) & & bDelete ; <nl> + Filter filter ; <nl> + filter . AppendWhere ( PrepareSQL ( " idGroup = % u " , group . GroupID ( ) ) ) ; <nl> + <nl> + bDelete = DeleteValues ( " map_channelgroups_channels " , filter ) & & bDelete ; <nl> } <nl> <nl> return bDelete ; <nl> bool CPVRDatabase : : Delete ( const CPVRChannelGroup & group ) <nl> return false ; <nl> } <nl> <nl> - CStdString strWhereClause = FormatSQL ( " idGroup = % u AND bIsRadio = % u " , group . GroupID ( ) , group . IsRadio ( ) ) ; <nl> + Filter filter ; <nl> + filter . AppendWhere ( PrepareSQL ( " idGroup = % u " , group . GroupID ( ) ) ) ; <nl> + filter . AppendWhere ( PrepareSQL ( " bIsRadio = % u " , group . IsRadio ( ) ) ) ; <nl> + <nl> return RemoveChannelsFromGroup ( group ) & & <nl> - DeleteValues ( " channelgroups " , strWhereClause ) ; <nl> + DeleteValues ( " channelgroups " , filter ) ; <nl> } <nl> <nl> bool CPVRDatabase : : Get ( CPVRChannelGroups & results ) <nl> int CPVRDatabase : : Get ( CPVRChannelGroup & group ) <nl> else <nl> { <nl> / / remove a channel that doesn ' t exist ( anymore ) from the table <nl> - DeleteValues ( " map_channelgroups_channels " , FormatSQL ( " idGroup = % u AND idChannel = % u " , group . GroupID ( ) , iChannelId ) ) ; <nl> + Filter filter ; <nl> + filter . AppendWhere ( PrepareSQL ( " idGroup = % u " , group . GroupID ( ) ) ) ; <nl> + filter . AppendWhere ( PrepareSQL ( " idChannel = % u " , iChannelId ) ) ; <nl> + <nl> + DeleteValues ( " map_channelgroups_channels " , filter ) ; <nl> } <nl> <nl> m_pDS - > next ( ) ; <nl> bool CPVRDatabase : : Delete ( const CPVRClient & client ) <nl> return false ; <nl> } <nl> <nl> - CStdString strWhereClause = FormatSQL ( " sUid = ' % s ' " , client . ID ( ) . c_str ( ) ) ; <nl> - return DeleteValues ( " clients " , strWhereClause ) ; <nl> + Filter filter ; <nl> + filter . AppendWhere ( PrepareSQL ( " sUid = ' % s ' " , client . ID ( ) . c_str ( ) ) ) ; <nl> + <nl> + return DeleteValues ( " clients " , filter ) ; <nl> } <nl> <nl> int CPVRDatabase : : GetClientId ( const CStdString & strClientUid ) <nl> | [ db ] changed implementation of DeleteValues ( ) | xbmc/xbmc | 4947e77e20197ca4f455d5b76b4378769f8f257e | 2014-01-04T17:07:09Z |
mmm a / xbmc / linux / DllBCM . h <nl> ppp b / xbmc / linux / DllBCM . h <nl> class DllBcmHostInterface <nl> virtual void bcm_host_init ( ) = 0 ; <nl> virtual void bcm_host_deinit ( ) = 0 ; <nl> virtual int32_t graphics_get_display_size ( const uint16_t display_number , uint32_t * width , uint32_t * height ) = 0 ; <nl> + virtual int vc_tv_power_off ( ) = 0 ; <nl> + virtual int vc_tv_sdtv_power_on ( SDTV_MODE_T mode , SDTV_OPTIONS_T * options ) = 0 ; <nl> + virtual int vc_tv_hdmi_power_on_preferred ( ) = 0 ; <nl> virtual int vc_tv_hdmi_power_on_best ( uint32_t width , uint32_t height , uint32_t frame_rate , <nl> HDMI_INTERLACED_T scan_mode , EDID_MODE_MATCH_FLAG_T match_flags ) = 0 ; <nl> virtual int vc_tv_hdmi_power_on_best_3d ( uint32_t width , uint32_t height , uint32_t frame_rate , <nl> class DllBcmHost : public DllDynamic , DllBcmHostInterface <nl> { return : : bcm_host_deinit ( ) ; } ; <nl> virtual int32_t graphics_get_display_size ( const uint16_t display_number , uint32_t * width , uint32_t * height ) <nl> { return : : graphics_get_display_size ( display_number , width , height ) ; } ; <nl> + virtual int vc_tv_power_off ( ) <nl> + { return : : vc_tv_power_off ( ) ; } <nl> + virtual int vc_tv_sdtv_power_on ( SDTV_MODE_T mode , SDTV_OPTIONS_T * options ) <nl> + { return : : vc_tv_sdtv_power_on ( mode , options ) ; } <nl> + virtual int vc_tv_hdmi_power_on_preferred ( ) <nl> + { return : : vc_tv_hdmi_power_on_preferred ( ) ; } <nl> virtual int vc_tv_hdmi_power_on_best ( uint32_t width , uint32_t height , uint32_t frame_rate , <nl> HDMI_INTERLACED_T scan_mode , EDID_MODE_MATCH_FLAG_T match_flags ) <nl> { return : : vc_tv_hdmi_power_on_best ( width , height , frame_rate , scan_mode , match_flags ) ; } ; <nl> mmm a / xbmc / windowing / egl / EGLNativeTypeRaspberryPI . cpp <nl> ppp b / xbmc / windowing / egl / EGLNativeTypeRaspberryPI . cpp <nl> <nl> # define DLOG ( fmt , args . . . ) <nl> # endif <nl> <nl> + # if defined ( TARGET_RASPBERRY_PI ) <nl> static void SetResolutionString ( RESOLUTION_INFO & res ) ; <nl> + static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect ( float display_aspect ) ; <nl> + # endif <nl> <nl> CEGLNativeTypeRaspberryPI : : CEGLNativeTypeRaspberryPI ( ) <nl> { <nl> int CEGLNativeTypeRaspberryPI : : FindMatchingResolution ( const RESOLUTION_INFO & res <nl> for ( int i = 0 ; i < ( int ) resolutions . size ( ) ; i + + ) <nl> { <nl> if ( resolutions [ i ] . iScreenWidth = = res . iScreenWidth & & resolutions [ i ] . iScreenHeight = = res . iScreenHeight & & resolutions [ i ] . fRefreshRate = = res . fRefreshRate & & <nl> - ( resolutions [ i ] . dwFlags & ( D3DPRESENTFLAG_MODE3DSBS | D3DPRESENTFLAG_MODE3DTB ) ) = = ( res . dwFlags & ( D3DPRESENTFLAG_MODE3DSBS | D3DPRESENTFLAG_MODE3DTB ) ) ) <nl> + ( resolutions [ i ] . dwFlags & D3DPRESENTFLAG_MODEMASK ) = = ( res . dwFlags & D3DPRESENTFLAG_MODEMASK ) ) <nl> { <nl> return i ; <nl> } <nl> int CEGLNativeTypeRaspberryPI : : AddUniqueResolution ( RESOLUTION_INFO & res , std : : ve <nl> int i = FindMatchingResolution ( res , resolutions ) ; <nl> if ( i > = 0 ) <nl> { / / don ' t replace a progressive resolution with an interlaced one of same resolution <nl> - if ( ! ( res . dwFlags & D3DPRESENTFLAG_INTERLACED ) ) <nl> - resolutions [ i ] = res ; <nl> + resolutions [ i ] = res ; <nl> } <nl> else <nl> { <nl> bool CEGLNativeTypeRaspberryPI : : SetNativeResolution ( const RESOLUTION_INFO & res ) <nl> <nl> DestroyDispmaxWindow ( ) ; <nl> <nl> - if ( ! m_fixedMode & & GETFLAGS_GROUP ( res . dwFlags ) & & GETFLAGS_MODE ( res . dwFlags ) ) <nl> + if ( GETFLAGS_GROUP ( res . dwFlags ) & & GETFLAGS_MODE ( res . dwFlags ) ) <nl> { <nl> sem_init ( & m_tv_synced , 0 , 0 ) ; <nl> m_DllBcmHost - > vc_tv_register_callback ( CallbackTvServiceCallback , this ) ; <nl> bool CEGLNativeTypeRaspberryPI : : SetNativeResolution ( const RESOLUTION_INFO & res ) <nl> <nl> m_desktopRes = res ; <nl> } <nl> + else if ( ! GETFLAGS_GROUP ( res . dwFlags ) & & GETFLAGS_MODE ( res . dwFlags ) ) <nl> + { <nl> + sem_init ( & m_tv_synced , 0 , 0 ) ; <nl> + m_DllBcmHost - > vc_tv_register_callback ( CallbackTvServiceCallback , this ) ; <nl> + <nl> + SDTV_OPTIONS_T options ; <nl> + options . aspect = get_sdtv_aspect_from_display_aspect ( ( float ) res . iScreenWidth / ( float ) res . iScreenHeight ) ; <nl> + <nl> + int success = m_DllBcmHost - > vc_tv_sdtv_power_on ( ( SDTV_MODE_T ) GETFLAGS_MODE ( res . dwFlags ) , & options ) ; <nl> + <nl> + if ( success = = 0 ) <nl> + { <nl> + CLog : : Log ( LOGDEBUG , " EGL set SDTV mode ( % d , % d ) = % d \ n " , <nl> + GETFLAGS_GROUP ( res . dwFlags ) , GETFLAGS_MODE ( res . dwFlags ) , success ) ; <nl> + <nl> + sem_wait ( & m_tv_synced ) ; <nl> + } <nl> + else <nl> + { <nl> + CLog : : Log ( LOGERROR , " EGL failed to set SDTV mode ( % d , % d ) = % d \ n " , <nl> + GETFLAGS_GROUP ( res . dwFlags ) , GETFLAGS_MODE ( res . dwFlags ) , success ) ; <nl> + } <nl> + m_DllBcmHost - > vc_tv_unregister_callback ( CallbackTvServiceCallback ) ; <nl> + sem_destroy ( & m_tv_synced ) ; <nl> + <nl> + m_desktopRes = res ; <nl> + } <nl> <nl> m_dispman_display = g_RBP . OpenDisplay ( 0 ) ; <nl> <nl> static void SetResolutionString ( RESOLUTION_INFO & res ) <nl> res . dwFlags & D3DPRESENTFLAG_MODE3DTB ? " 3DTB " : " " , <nl> res . dwFlags & D3DPRESENTFLAG_MODE3DSBS ? " 3DSBS " : " " ) ; <nl> } <nl> + <nl> + static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect ( float display_aspect ) <nl> + { <nl> + SDTV_ASPECT_T aspect ; <nl> + const float delta = 1e - 3 ; <nl> + if ( fabs ( get_display_aspect_ratio ( SDTV_ASPECT_16_9 ) - display_aspect ) < delta ) <nl> + { <nl> + aspect = SDTV_ASPECT_16_9 ; <nl> + } <nl> + else if ( fabs ( get_display_aspect_ratio ( SDTV_ASPECT_14_9 ) - display_aspect ) < delta ) <nl> + { <nl> + aspect = SDTV_ASPECT_14_9 ; <nl> + } <nl> + else <nl> + { <nl> + aspect = SDTV_ASPECT_4_3 ; <nl> + } <nl> + return aspect ; <nl> + } <nl> # endif <nl> <nl> bool CEGLNativeTypeRaspberryPI : : ProbeResolutions ( std : : vector < RESOLUTION_INFO > & resolutions ) <nl> bool CEGLNativeTypeRaspberryPI : : ProbeResolutions ( std : : vector < RESOLUTION_INFO > & r <nl> if ( ! m_DllBcmHost ) <nl> return false ; <nl> <nl> - m_fixedMode = false ; <nl> - <nl> / * read initial desktop resolution before probe resolutions . <nl> * probing will replace the desktop resolution when it finds the same one . <nl> * we raplace it because probing will generate more detailed <nl> bool CEGLNativeTypeRaspberryPI : : ProbeResolutions ( std : : vector < RESOLUTION_INFO > & r <nl> m_desktopRes . iScreenWidth = tv_state . display . hdmi . width ; <nl> m_desktopRes . iScreenHeight = tv_state . display . hdmi . height ; <nl> m_desktopRes . dwFlags = MAKEFLAGS ( tv_state . display . hdmi . group , tv_state . display . hdmi . mode , tv_state . display . hdmi . scan_mode ) ; <nl> - m_desktopRes . fPixelRatio = get_display_aspect_ratio ( ( HDMI_ASPECT_T ) tv_state . display . hdmi . display_options . aspect ) / ( ( float ) m_desktopRes . iScreenWidth / ( float ) m_desktopRes . iScreenHeight ) ; <nl> + m_desktopRes . fPixelRatio = tv_state . display . hdmi . display_options . aspect = = 0 ? 1 . 0f : get_display_aspect_ratio ( ( HDMI_ASPECT_T ) tv_state . display . hdmi . display_options . aspect ) / ( ( float ) m_desktopRes . iScreenWidth / ( float ) m_desktopRes . iScreenHeight ) ; <nl> / / Also add 3D flags <nl> if ( tv_state . display . hdmi . format_3d = = HDMI_3D_FORMAT_SBS_HALF ) <nl> { <nl> bool CEGLNativeTypeRaspberryPI : : ProbeResolutions ( std : : vector < RESOLUTION_INFO > & r <nl> vc_tv_hdmi_get_property ( & property ) ; <nl> m_desktopRes . fRefreshRate = property . param1 = = HDMI_PIXEL_CLOCK_TYPE_NTSC ? tv_state . display . hdmi . frame_rate * ( 1000 . 0f / 1001 . 0f ) : tv_state . display . hdmi . frame_rate ; <nl> } <nl> - else / / sdtv <nl> + else if ( ( tv_state . state & ( VC_SDTV_NTSC | VC_SDTV_PAL ) ) ! = 0 ) / / sdtv <nl> { <nl> m_desktopRes . iScreen = 0 ; <nl> m_desktopRes . bFullScreen = true ; <nl> bool CEGLNativeTypeRaspberryPI : : ProbeResolutions ( std : : vector < RESOLUTION_INFO > & r <nl> m_desktopRes . iHeight = tv_state . display . sdtv . height ; <nl> m_desktopRes . iScreenWidth = tv_state . display . sdtv . width ; <nl> m_desktopRes . iScreenHeight = tv_state . display . sdtv . height ; <nl> - m_desktopRes . dwFlags = D3DPRESENTFLAG_INTERLACED ; <nl> + m_desktopRes . dwFlags = MAKEFLAGS ( HDMI_RES_GROUP_INVALID , tv_state . display . sdtv . mode , 1 ) ; <nl> m_desktopRes . fRefreshRate = ( float ) tv_state . display . sdtv . frame_rate ; <nl> - m_desktopRes . fPixelRatio = get_display_aspect_ratio ( ( SDTV_ASPECT_T ) tv_state . display . sdtv . display_options . aspect ) / ( ( float ) m_desktopRes . iScreenWidth / ( float ) m_desktopRes . iScreenHeight ) ; <nl> + m_desktopRes . fPixelRatio = tv_state . display . hdmi . display_options . aspect = = 0 ? 1 . 0f : get_display_aspect_ratio ( ( SDTV_ASPECT_T ) tv_state . display . sdtv . display_options . aspect ) / ( ( float ) m_desktopRes . iScreenWidth / ( float ) m_desktopRes . iScreenHeight ) ; <nl> } <nl> <nl> SetResolutionString ( m_desktopRes ) ; <nl> bool CEGLNativeTypeRaspberryPI : : ProbeResolutions ( std : : vector < RESOLUTION_INFO > & r <nl> GetSupportedModes ( HDMI_RES_GROUP_CEA , resolutions ) ; <nl> GetSupportedModes ( HDMI_RES_GROUP_DMT , resolutions ) ; <nl> <nl> - if ( resolutions . size ( ) = = 0 ) <nl> { <nl> AddUniqueResolution ( m_desktopRes , resolutions ) ; <nl> CLog : : Log ( LOGDEBUG , " EGL probe resolution % s : % x \ n " , m_desktopRes . strMode . c_str ( ) , m_desktopRes . dwFlags ) ; <nl> } <nl> <nl> - if ( resolutions . size ( ) < 2 ) <nl> - m_fixedMode = true ; <nl> - <nl> DLOG ( " CEGLNativeTypeRaspberryPI : : ProbeResolutions \ n " ) ; <nl> return true ; <nl> # else <nl> void CEGLNativeTypeRaspberryPI : : GetSupportedModes ( HDMI_RES_GROUP_T group , std : : v <nl> res . fPixelRatio = get_display_aspect_ratio ( ( HDMI_ASPECT_T ) tv - > aspect_ratio ) / ( ( float ) res . iScreenWidth / ( float ) res . iScreenHeight ) ; <nl> res . iSubtitles = ( int ) ( 0 . 965 * res . iHeight ) ; <nl> <nl> + if ( ! m_desktopRes . dwFlags & & prefer_group = = group & & prefer_mode = = tv - > code ) <nl> + m_desktopRes = res ; <nl> + <nl> + if ( res . dwFlags & D3DPRESENTFLAG_INTERLACED ) <nl> + continue ; <nl> + <nl> AddUniqueResolution ( res , resolutions ) ; <nl> CLog : : Log ( LOGDEBUG , " EGL mode % d : % s ( % . 2f ) % s % s : % x \ n " , i , res . strMode . c_str ( ) , res . fPixelRatio , <nl> tv - > native ? " N " : " " , tv - > scan_mode ? " I " : " " , tv - > code ) ; <nl> mmm a / xbmc / windowing / egl / EGLNativeTypeRaspberryPI . h <nl> ppp b / xbmc / windowing / egl / EGLNativeTypeRaspberryPI . h <nl> class CEGLNativeTypeRaspberryPI : public CEGLNativeType <nl> DISPMANX_ELEMENT_HANDLE_T m_dispman_element ; <nl> TV_GET_STATE_RESP_T m_tv_state ; <nl> sem_t m_tv_synced ; <nl> - bool m_fixedMode ; <nl> RESOLUTION_INFO m_desktopRes ; <nl> int m_width ; <nl> int m_height ; <nl> | Merge pull request from popcornmix / rbp_egl | xbmc/xbmc | 0c75393b5f899a0667bd8d43defcdebc1b804504 | 2015-07-04T10:43:12Z |
mmm a / stdlib / public / runtime / KnownMetadata . cpp <nl> ppp b / stdlib / public / runtime / KnownMetadata . cpp <nl> namespace { <nl> } ; <nl> } / / end anonymous namespace <nl> <nl> - / / / The basic value - witness table for @ noescape function types . <nl> + / / / The basic value - witness table for escaping function types . <nl> const ExtraInhabitantsValueWitnessTable <nl> swift : : VALUE_WITNESS_SYM ( FUNCTION_MANGLING ) = <nl> ValueWitnessTableForBox < ThickFunctionBox > : : table ; <nl> <nl> - / / / The basic value - witness table for escaping function types . <nl> + / / / The basic value - witness table for @ noescape function types . <nl> const ExtraInhabitantsValueWitnessTable <nl> swift : : VALUE_WITNESS_SYM ( NOESCAPE_FUNCTION_MANGLING ) = <nl> ValueWitnessTableForBox < TrivialThickFunctionBox > : : table ; <nl> | Merge remote - tracking branch ' origin / master ' into master - llvm - swift5 - transition | apple/swift | 070b8d416dad8605777f0475f1c9aa6aea831b76 | 2018-02-14T16:17:59Z |
mmm a / hphp / runtime / base / heap - algorithms . h <nl> ppp b / hphp / runtime / base / heap - algorithms . h <nl> void dfs_ptrs ( <nl> marks . set ( n ) ; <nl> pre ( n , ptr ) ; <nl> work . push_back ( { Action : : Finish , n } ) ; <nl> - g . eachSuccPtr ( n , [ & ] ( int p ) { <nl> + g . eachOutPtr ( n , [ & ] ( int p ) { <nl> work . push_back ( { Action : : Explore , p } ) ; <nl> } ) ; <nl> } <nl> mmm a / hphp / runtime / base / heap - graph . cpp <nl> ppp b / hphp / runtime / base / heap - graph . cpp <nl> void addPtr ( HeapGraph & g , int from , int to , HeapGraph : : PtrKind kind ) { <nl> auto & to_node = g . nodes [ to ] ; <nl> auto e = g . ptrs . size ( ) ; <nl> g . ptrs . push_back ( <nl> - HeapGraph : : Ptr { from , to , from_node . succ , to_node . pred , kind } <nl> + HeapGraph : : Ptr { from , to , from_node . first_out , to_node . first_in , kind } <nl> ) ; <nl> - from_node . succ = to_node . pred = e ; <nl> + from_node . first_out = to_node . first_in = e ; <nl> } <nl> <nl> void addRoot ( HeapGraph & g , int to , HeapGraph : : PtrKind ptr_kind , <nl> void addRoot ( HeapGraph & g , int to , HeapGraph : : PtrKind ptr_kind , <nl> auto & to_node = g . nodes [ to ] ; <nl> auto e = g . ptrs . size ( ) ; <nl> g . ptrs . push_back ( <nl> - HeapGraph : : Ptr { - 1 , to , - 1 , to_node . pred , ptr_kind , root_kind } <nl> + HeapGraph : : Ptr { - 1 , to , - 1 , to_node . first_in , ptr_kind , root_kind } <nl> ) ; <nl> - to_node . pred = e ; <nl> + to_node . first_in = e ; <nl> g . roots . push_back ( e ) ; <nl> } <nl> <nl> mmm a / hphp / runtime / base / heap - graph . h <nl> ppp b / hphp / runtime / base / heap - graph . h <nl> enum class RootKind : uint8_t { <nl> EzcResources <nl> } ; <nl> <nl> + / / Graph representation of the heap . The heap consists of some objects <nl> + / / ( Nodes ) , and directed pointers ( Ptrs ) from Node to Node . For each <nl> + / / node , we maintain two singly linked lists : <nl> + / / <nl> + / / 1 . a list of pointers from this node to other nodes ( out - ptrs ) <nl> + / / 2 . a list of pointers from other nodes to this node ( in - ptrs ) . <nl> + / / <nl> + / / Each pointer is a member of both lists , except root pointers which <nl> + / / are only a member of a node ' s in - ptr list . <nl> + / / <nl> + / / Additionally , each Ptr records it ' s from and to nodes . This allows <nl> + / / traversing the heap graph in either direction ( roots toward leaves , <nl> + / / or vice - versa ) . However , each list is singly linked ; the order of <nl> + / / pointers in the least is meaningless and we don ' t need to support <nl> + / / deleting pointers ( or nodes ) . <nl> + <nl> struct HeapGraph { <nl> enum PtrKind : uint8_t { <nl> Counted , / / exactly - marked , ref - counted , pointer <nl> struct HeapGraph { <nl> } ; <nl> struct Node { <nl> const Header * h ; <nl> - int succ , pred ; / / first out - ptr and in - ptr , respectively <nl> + int first_out ; <nl> + int first_in ; / / first out - ptr and in - ptr , respectively <nl> } ; <nl> struct Ptr { <nl> int from , to ; / / node ids . if root , from = = - 1 <nl> - int succ , pred ; / / from ' s next out - ptr , to ' s next in - ptr <nl> + int next_out , next_in ; / / from ' s next out - ptr , to ' s next in - ptr <nl> PtrKind ptr_kind ; <nl> RootKind root_kind ; <nl> } ; <nl> struct HeapGraph { <nl> std : : vector < int > roots ; / / ptr ids . ptr . from = - 1 , ptr . to = object <nl> <nl> template < class F > void eachSuccNode ( int n , F f ) const { <nl> - eachSuccPtr ( n , [ & ] ( int p ) { f ( ptrs [ p ] . to ) ; } ) ; <nl> + eachOutPtr ( n , [ & ] ( int p ) { f ( ptrs [ p ] . to ) ; } ) ; <nl> } <nl> <nl> - template < class F > void eachSuccPtr ( int n , F f ) const { <nl> - for ( int p = nodes [ n ] . succ ; p ! = - 1 ; p = ptrs [ p ] . succ ) f ( p ) ; <nl> + template < class F > void eachOutPtr ( int n , F f ) const { <nl> + for ( int p = nodes [ n ] . first_out ; p ! = - 1 ; p = ptrs [ p ] . next_out ) { <nl> + f ( p ) ; <nl> + } <nl> } <nl> <nl> - template < class F > void eachPredPtr ( int n , F f ) const { <nl> - for ( int p = nodes [ n ] . pred ; p ! = - 1 ; p = ptrs [ p ] . pred ) f ( p ) ; <nl> + template < class F > void eachInPtr ( int n , F f ) const { <nl> + for ( int p = nodes [ n ] . first_in ; p ! = - 1 ; p = ptrs [ p ] . next_in ) { <nl> + f ( p ) ; <nl> + } <nl> } <nl> <nl> template < class F > void eachPred ( int n , F f ) const { <nl> - for ( int p = nodes [ n ] . pred ; p ! = - 1 ; p = ptrs [ p ] . pred ) f ( ptrs [ p ] ) ; <nl> + for ( int p = nodes [ n ] . first_in ; p ! = - 1 ; p = ptrs [ p ] . next_in ) { <nl> + f ( ptrs [ p ] ) ; <nl> + } <nl> } <nl> <nl> template < class F > void eachRoot ( F f ) const { <nl> mmm a / hphp / runtime / ext / objprof / ext_heapgraph . cpp <nl> ppp b / hphp / runtime / ext / objprof / ext_heapgraph . cpp <nl> Array HHVM_FUNCTION ( heapgraph_node_out_edges , <nl> if ( ! hgptr ) return empty_array ( ) ; <nl> if ( index < 0 | | index > = ( hgptr - > hg . nodes . size ( ) ) ) return empty_array ( ) ; <nl> Array result ; <nl> - hgptr - > hg . eachSuccPtr ( index , [ & ] ( int ptr ) { <nl> + hgptr - > hg . eachOutPtr ( index , [ & ] ( int ptr ) { <nl> result . append ( createPhpEdge ( hgptr , ptr ) ) ; <nl> } ) ; <nl> return result ; <nl> Array HHVM_FUNCTION ( heapgraph_node_in_edges , <nl> if ( ! hgptr ) return empty_array ( ) ; <nl> if ( index < 0 | | index > = ( hgptr - > hg . nodes . size ( ) ) ) return empty_array ( ) ; <nl> Array result ; <nl> - hgptr - > hg . eachPredPtr ( index , [ & ] ( int ptr ) { <nl> + hgptr - > hg . eachInPtr ( index , [ & ] ( int ptr ) { <nl> result . append ( createPhpEdge ( hgptr , ptr ) ) ; <nl> } ) ; <nl> return result ; <nl> | rename linked - list fields for clarity | facebook/hhvm | 195b676e1712838fb338613d6c0d71e9afae8fc8 | 2016-02-29T17:00:45Z |
mmm a / atom / browser / lib / init . coffee <nl> ppp b / atom / browser / lib / init . coffee <nl> require path . resolve ( __dirname , ' . . ' , ' . . ' , ' common ' , ' lib ' , ' reset - search - paths <nl> # Import common settings . <nl> require path . resolve ( __dirname , ' . . ' , ' . . ' , ' common ' , ' lib ' , ' init ' ) <nl> <nl> - # Expose public APIs . <nl> globalPaths = Module . globalPaths <nl> - globalPaths . push path . resolve ( __dirname , ' . . ' , ' api ' , ' lib ' , ' exports ' ) <nl> - <nl> unless process . env . ELECTRON_HIDE_INTERNAL_MODULES <nl> globalPaths . push path . resolve ( __dirname , ' . . ' , ' api ' , ' lib ' ) <nl> <nl> + # Expose public APIs . <nl> + globalPaths . push path . resolve ( __dirname , ' . . ' , ' api ' , ' lib ' , ' exports ' ) <nl> + <nl> if process . platform is ' win32 ' <nl> # Redirect node ' s console to use our own implementations , since node can not <nl> # handle console output when running as GUI program . <nl> mmm a / atom / common / api / lib / exports / electron . coffee <nl> ppp b / atom / common / api / lib / exports / electron . coffee <nl> <nl> + # Do not expose the internal modules to ` require ` . <nl> + exports . hideInternalModules = - > <nl> + { globalPaths } = require ' module ' <nl> + if globalPaths . length is 3 <nl> + # Remove the " common / api / lib " and " browser - or - renderer / api / lib " . <nl> + globalPaths . splice 0 , 2 <nl> + <nl> Object . defineProperties exports , <nl> # Common modules , please sort with alphabet order . <nl> clipboard : <nl> mmm a / atom / renderer / lib / init . coffee <nl> ppp b / atom / renderer / lib / init . coffee <nl> require path . resolve ( __dirname , ' . . ' , ' . . ' , ' common ' , ' lib ' , ' reset - search - paths <nl> # Import common settings . <nl> require path . resolve ( __dirname , ' . . ' , ' . . ' , ' common ' , ' lib ' , ' init ' ) <nl> <nl> - # Expose public APIs . <nl> globalPaths = Module . globalPaths <nl> - globalPaths . push path . resolve ( __dirname , ' . . ' , ' api ' , ' lib ' , ' exports ' ) <nl> - <nl> unless process . env . ELECTRON_HIDE_INTERNAL_MODULES <nl> globalPaths . push path . resolve ( __dirname , ' . . ' , ' api ' , ' lib ' ) <nl> <nl> + # Expose public APIs . <nl> + globalPaths . push path . resolve ( __dirname , ' . . ' , ' api ' , ' lib ' , ' exports ' ) <nl> + <nl> # The global variable will be used by ipc for event dispatching <nl> v8Util = process . atomBinding ' v8_util ' <nl> v8Util . setHiddenValue global , ' ipc ' , new events . EventEmitter <nl> | Add electron . hideInternalModules | electron/electron | 2ca5a33d287e2c601bf08b87226d4057571868d1 | 2015-11-12T13:46:03Z |
mmm a / templates / cpp - template - default / proj . ios_mac / HelloCpp . xcodeproj / project . pbxproj <nl> ppp b / templates / cpp - template - default / proj . ios_mac / HelloCpp . xcodeproj / project . pbxproj <nl> <nl> 1AC6FAE5180E9839004C840B / * cocos2d_libs . xcodeproj * / = { isa = PBXFileReference ; lastKnownFileType = " wrapper . pb - project " ; name = cocos2d_libs . xcodeproj ; path = . . / cocos2d / build / cocos2d_libs . xcodeproj ; sourceTree = " < group > " ; } ; <nl> 1ACB3243164770DE00914215 / * libcurl . a * / = { isa = PBXFileReference ; lastKnownFileType = archive . ar ; name = libcurl . a ; path = . . / . . / cocos2dx / platform / third_party / ios / libraries / libcurl . a ; sourceTree = " < group > " ; } ; <nl> 1D30AB110D05D00D00671497 / * Foundation . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = Foundation . framework ; path = System / Library / Frameworks / Foundation . framework ; sourceTree = SDKROOT ; } ; <nl> - 1D6058910D05DD3D006BFB54 / * HelloCpp iOS . app * / = { isa = PBXFileReference ; explicitFileType = wrapper . application ; includeInIndex = 0 ; path = " HelloCpp iOS . app " ; sourceTree = BUILT_PRODUCTS_DIR ; } ; <nl> + 1D6058910D05DD3D006BFB54 / * HelloCpp - mobile . app * / = { isa = PBXFileReference ; explicitFileType = wrapper . application ; includeInIndex = 0 ; path = " HelloCpp - mobile . app " ; sourceTree = BUILT_PRODUCTS_DIR ; } ; <nl> 1DF5F4DF0D08C38300B7A737 / * UIKit . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = UIKit . framework ; path = System / Library / Frameworks / UIKit . framework ; sourceTree = SDKROOT ; } ; <nl> 288765A40DF7441C002DB57D / * CoreGraphics . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = CoreGraphics . framework ; path = System / Library / Frameworks / CoreGraphics . framework ; sourceTree = SDKROOT ; } ; <nl> 3EACC98E19EE6D4300EB3C5E / * res * / = { isa = PBXFileReference ; lastKnownFileType = folder ; path = res ; sourceTree = " < group > " ; } ; <nl> <nl> 503AE10417EB98FF00D1A890 / * Prefix . pch * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = Prefix . pch ; path = mac / Prefix . pch ; sourceTree = " < group > " ; } ; <nl> 503AE11117EB99EE00D1A890 / * libcurl . dylib * / = { isa = PBXFileReference ; lastKnownFileType = " compiled . mach - o . dylib " ; name = libcurl . dylib ; path = usr / lib / libcurl . dylib ; sourceTree = SDKROOT ; } ; <nl> 503AE11A17EB9C5A00D1A890 / * IOKit . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = IOKit . framework ; path = System / Library / Frameworks / IOKit . framework ; sourceTree = SDKROOT ; } ; <nl> - 5087E76F17EB910900C73F5D / * HelloCpp Mac . app * / = { isa = PBXFileReference ; explicitFileType = wrapper . application ; includeInIndex = 0 ; path = " HelloCpp Mac . app " ; sourceTree = BUILT_PRODUCTS_DIR ; } ; <nl> + 5087E76F17EB910900C73F5D / * HelloCpp - desktop . app * / = { isa = PBXFileReference ; explicitFileType = wrapper . application ; includeInIndex = 0 ; path = " HelloCpp - desktop . app " ; sourceTree = BUILT_PRODUCTS_DIR ; } ; <nl> 5087E77217EB970100C73F5D / * Default - 568h @ 2x . png * / = { isa = PBXFileReference ; lastKnownFileType = image . png ; path = " Default - 568h @ 2x . png " ; sourceTree = " < group > " ; } ; <nl> 5087E77317EB970100C73F5D / * Default . png * / = { isa = PBXFileReference ; lastKnownFileType = image . png ; path = Default . png ; sourceTree = " < group > " ; } ; <nl> 5087E77417EB970100C73F5D / * Default @ 2x . png * / = { isa = PBXFileReference ; lastKnownFileType = image . png ; path = " Default @ 2x . png " ; sourceTree = " < group > " ; } ; <nl> <nl> 19C28FACFE9D520D11CA2CBB / * Products * / = { <nl> isa = PBXGroup ; <nl> children = ( <nl> - 1D6058910D05DD3D006BFB54 / * HelloCpp iOS . app * / , <nl> - 5087E76F17EB910900C73F5D / * HelloCpp Mac . app * / , <nl> + 1D6058910D05DD3D006BFB54 / * HelloCpp - mobile . app * / , <nl> + 5087E76F17EB910900C73F5D / * HelloCpp - desktop . app * / , <nl> ) ; <nl> name = Products ; <nl> sourceTree = " < group > " ; <nl> <nl> / * End PBXGroup section * / <nl> <nl> / * Begin PBXNativeTarget section * / <nl> - 1D6058900D05DD3D006BFB54 / * HelloCpp iOS * / = { <nl> + 1D6058900D05DD3D006BFB54 / * HelloCpp - mobile * / = { <nl> isa = PBXNativeTarget ; <nl> - buildConfigurationList = 1D6058960D05DD3E006BFB54 / * Build configuration list for PBXNativeTarget " HelloCpp iOS " * / ; <nl> + buildConfigurationList = 1D6058960D05DD3E006BFB54 / * Build configuration list for PBXNativeTarget " HelloCpp - mobile " * / ; <nl> buildPhases = ( <nl> 1D60588D0D05DD3D006BFB54 / * Resources * / , <nl> 1D60588E0D05DD3D006BFB54 / * Sources * / , <nl> <nl> dependencies = ( <nl> 1AC6FB25180E99E1004C840B / * PBXTargetDependency * / , <nl> ) ; <nl> - name = " HelloCpp iOS " ; <nl> + name = " HelloCpp - mobile " ; <nl> productName = iphone ; <nl> - productReference = 1D6058910D05DD3D006BFB54 / * HelloCpp iOS . app * / ; <nl> + productReference = 1D6058910D05DD3D006BFB54 / * HelloCpp - mobile . app * / ; <nl> productType = " com . apple . product - type . application " ; <nl> } ; <nl> - 5087E73D17EB910900C73F5D / * HelloCpp Mac * / = { <nl> + 5087E73D17EB910900C73F5D / * HelloCpp - desktop * / = { <nl> isa = PBXNativeTarget ; <nl> - buildConfigurationList = 5087E76C17EB910900C73F5D / * Build configuration list for PBXNativeTarget " HelloCpp Mac " * / ; <nl> + buildConfigurationList = 5087E76C17EB910900C73F5D / * Build configuration list for PBXNativeTarget " HelloCpp - desktop " * / ; <nl> buildPhases = ( <nl> 5087E74817EB910900C73F5D / * Resources * / , <nl> 5087E75617EB910900C73F5D / * Sources * / , <nl> <nl> dependencies = ( <nl> 1AC6FB16180E9959004C840B / * PBXTargetDependency * / , <nl> ) ; <nl> - name = " HelloCpp Mac " ; <nl> + name = " HelloCpp - desktop " ; <nl> productName = iphone ; <nl> - productReference = 5087E76F17EB910900C73F5D / * HelloCpp Mac . app * / ; <nl> + productReference = 5087E76F17EB910900C73F5D / * HelloCpp - desktop . app * / ; <nl> productType = " com . apple . product - type . application " ; <nl> } ; <nl> / * End PBXNativeTarget section * / <nl> <nl> ) ; <nl> projectRoot = " " ; <nl> targets = ( <nl> - 1D6058900D05DD3D006BFB54 / * HelloCpp iOS * / , <nl> - 5087E73D17EB910900C73F5D / * HelloCpp Mac * / , <nl> + 1D6058900D05DD3D006BFB54 / * HelloCpp - mobile * / , <nl> + 5087E73D17EB910900C73F5D / * HelloCpp - desktop * / , <nl> ) ; <nl> } ; <nl> / * End PBXProject section * / <nl> <nl> / * End XCBuildConfiguration section * / <nl> <nl> / * Begin XCConfigurationList section * / <nl> - 1D6058960D05DD3E006BFB54 / * Build configuration list for PBXNativeTarget " HelloCpp iOS " * / = { <nl> + 1D6058960D05DD3E006BFB54 / * Build configuration list for PBXNativeTarget " HelloCpp - mobile " * / = { <nl> isa = XCConfigurationList ; <nl> buildConfigurations = ( <nl> 1D6058940D05DD3E006BFB54 / * Debug * / , <nl> <nl> defaultConfigurationIsVisible = 0 ; <nl> defaultConfigurationName = Debug ; <nl> } ; <nl> - 5087E76C17EB910900C73F5D / * Build configuration list for PBXNativeTarget " HelloCpp Mac " * / = { <nl> + 5087E76C17EB910900C73F5D / * Build configuration list for PBXNativeTarget " HelloCpp - desktop " * / = { <nl> isa = XCConfigurationList ; <nl> buildConfigurations = ( <nl> 5087E76D17EB910900C73F5D / * Debug * / , <nl> mmm a / templates / js - template - default / frameworks / runtime - src / proj . ios_mac / HelloJavascript . xcodeproj / project . pbxproj <nl> ppp b / templates / js - template - default / frameworks / runtime - src / proj . ios_mac / HelloJavascript . xcodeproj / project . pbxproj <nl> <nl> 5091731717ECDF7A00D62437 / * Icon - 58 . png * / = { isa = PBXFileReference ; lastKnownFileType = image . png ; name = " Icon - 58 . png " ; path = " ios / Icon - 58 . png " ; sourceTree = " < group > " ; } ; <nl> 5091731817ECDF7A00D62437 / * Icon - 80 . png * / = { isa = PBXFileReference ; lastKnownFileType = image . png ; name = " Icon - 80 . png " ; path = " ios / Icon - 80 . png " ; sourceTree = " < group > " ; } ; <nl> 5091731917ECDF7A00D62437 / * Icon - 100 . png * / = { isa = PBXFileReference ; lastKnownFileType = image . png ; name = " Icon - 100 . png " ; path = " ios / Icon - 100 . png " ; sourceTree = " < group > " ; } ; <nl> - 509D4AAA17EBB24E00697056 / * HelloJavascript Mac . app * / = { isa = PBXFileReference ; explicitFileType = wrapper . application ; includeInIndex = 0 ; path = " HelloJavascript Mac . app " ; sourceTree = BUILT_PRODUCTS_DIR ; } ; <nl> + 509D4AAA17EBB24E00697056 / * HelloJavascript - desktop . app * / = { isa = PBXFileReference ; explicitFileType = wrapper . application ; includeInIndex = 0 ; path = " HelloJavascript - desktop . app " ; sourceTree = BUILT_PRODUCTS_DIR ; } ; <nl> 509D4AAB17EBB2AB00697056 / * AppController . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = AppController . h ; path = ios / AppController . h ; sourceTree = " < group > " ; } ; <nl> 509D4AAC17EBB2AB00697056 / * AppController . mm * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . objcpp ; name = AppController . mm ; path = ios / AppController . mm ; sourceTree = " < group > " ; } ; <nl> 509D4AAD17EBB2AB00697056 / * Default - 568h @ 2x . png * / = { isa = PBXFileReference ; lastKnownFileType = image . png ; name = " Default - 568h @ 2x . png " ; path = " ios / Default - 568h @ 2x . png " ; sourceTree = " < group > " ; } ; <nl> <nl> 509D4AE617EBB81800697056 / * OpenGL . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = OpenGL . framework ; path = System / Library / Frameworks / OpenGL . framework ; sourceTree = SDKROOT ; } ; <nl> 509D4AE817EBB82000697056 / * AppKit . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = AppKit . framework ; path = System / Library / Frameworks / AppKit . framework ; sourceTree = SDKROOT ; } ; <nl> 509D4AEA17EBB82600697056 / * IOKit . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = IOKit . framework ; path = System / Library / Frameworks / IOKit . framework ; sourceTree = SDKROOT ; } ; <nl> - A922753D1517C094001B78AA / * HelloJavascript iOS . app * / = { isa = PBXFileReference ; explicitFileType = wrapper . application ; includeInIndex = 0 ; path = " HelloJavascript iOS . app " ; sourceTree = BUILT_PRODUCTS_DIR ; } ; <nl> + A922753D1517C094001B78AA / * HelloJavascript - mobile . app * / = { isa = PBXFileReference ; explicitFileType = wrapper . application ; includeInIndex = 0 ; path = " HelloJavascript - mobile . app " ; sourceTree = BUILT_PRODUCTS_DIR ; } ; <nl> A92275411517C094001B78AA / * QuartzCore . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = QuartzCore . framework ; path = System / Library / Frameworks / QuartzCore . framework ; sourceTree = SDKROOT ; } ; <nl> A92275431517C094001B78AA / * OpenGLES . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = OpenGLES . framework ; path = System / Library / Frameworks / OpenGLES . framework ; sourceTree = SDKROOT ; } ; <nl> A92275451517C094001B78AA / * OpenAL . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = OpenAL . framework ; path = System / Library / Frameworks / OpenAL . framework ; sourceTree = SDKROOT ; } ; <nl> <nl> A922753E1517C094001B78AA / * Products * / = { <nl> isa = PBXGroup ; <nl> children = ( <nl> - A922753D1517C094001B78AA / * HelloJavascript iOS . app * / , <nl> - 509D4AAA17EBB24E00697056 / * HelloJavascript Mac . app * / , <nl> + A922753D1517C094001B78AA / * HelloJavascript - mobile . app * / , <nl> + 509D4AAA17EBB24E00697056 / * HelloJavascript - desktop . app * / , <nl> ) ; <nl> name = Products ; <nl> sourceTree = " < group > " ; <nl> <nl> / * End PBXGroup section * / <nl> <nl> / * Begin PBXNativeTarget section * / <nl> - 509D4A7517EBB24E00697056 / * HelloJavascript Mac * / = { <nl> + 509D4A7517EBB24E00697056 / * HelloJavascript - desktop * / = { <nl> isa = PBXNativeTarget ; <nl> - buildConfigurationList = 509D4AA717EBB24E00697056 / * Build configuration list for PBXNativeTarget " HelloJavascript Mac " * / ; <nl> + buildConfigurationList = 509D4AA717EBB24E00697056 / * Build configuration list for PBXNativeTarget " HelloJavascript - desktop " * / ; <nl> buildPhases = ( <nl> 509D4A8017EBB24E00697056 / * Sources * / , <nl> 509D4A9317EBB24E00697056 / * Resources * / , <nl> <nl> 1A676824180E9BF70076BC67 / * PBXTargetDependency * / , <nl> 1A676826180E9BF70076BC67 / * PBXTargetDependency * / , <nl> ) ; <nl> - name = " HelloJavascript Mac " ; <nl> + name = " HelloJavascript - desktop " ; <nl> productName = HelloJavascript ; <nl> - productReference = 509D4AAA17EBB24E00697056 / * HelloJavascript Mac . app * / ; <nl> + productReference = 509D4AAA17EBB24E00697056 / * HelloJavascript - desktop . app * / ; <nl> productType = " com . apple . product - type . application " ; <nl> } ; <nl> - A922753C1517C094001B78AA / * HelloJavascript iOS * / = { <nl> + A922753C1517C094001B78AA / * HelloJavascript - mobile * / = { <nl> isa = PBXNativeTarget ; <nl> - buildConfigurationList = A92277001517C097001B78AA / * Build configuration list for PBXNativeTarget " HelloJavascript iOS " * / ; <nl> + buildConfigurationList = A92277001517C097001B78AA / * Build configuration list for PBXNativeTarget " HelloJavascript - mobile " * / ; <nl> buildPhases = ( <nl> A92275391517C094001B78AA / * Sources * / , <nl> A922753A1517C094001B78AA / * Frameworks * / , <nl> <nl> 1A676833180E9C110076BC67 / * PBXTargetDependency * / , <nl> 1A676835180E9C110076BC67 / * PBXTargetDependency * / , <nl> ) ; <nl> - name = " HelloJavascript iOS " ; <nl> + name = " HelloJavascript - mobile " ; <nl> productName = HelloJavascript ; <nl> - productReference = A922753D1517C094001B78AA / * HelloJavascript iOS . app * / ; <nl> + productReference = A922753D1517C094001B78AA / * HelloJavascript - mobile . app * / ; <nl> productType = " com . apple . product - type . application " ; <nl> } ; <nl> / * End PBXNativeTarget section * / <nl> <nl> ) ; <nl> projectRoot = " " ; <nl> targets = ( <nl> - A922753C1517C094001B78AA / * HelloJavascript iOS * / , <nl> - 509D4A7517EBB24E00697056 / * HelloJavascript Mac * / , <nl> + A922753C1517C094001B78AA / * HelloJavascript - mobile * / , <nl> + 509D4A7517EBB24E00697056 / * HelloJavascript - desktop * / , <nl> ) ; <nl> } ; <nl> / * End PBXProject section * / <nl> <nl> / * End XCBuildConfiguration section * / <nl> <nl> / * Begin XCConfigurationList section * / <nl> - 509D4AA717EBB24E00697056 / * Build configuration list for PBXNativeTarget " HelloJavascript Mac " * / = { <nl> + 509D4AA717EBB24E00697056 / * Build configuration list for PBXNativeTarget " HelloJavascript - desktop " * / = { <nl> isa = XCConfigurationList ; <nl> buildConfigurations = ( <nl> 509D4AA817EBB24E00697056 / * Debug * / , <nl> <nl> defaultConfigurationIsVisible = 0 ; <nl> defaultConfigurationName = Release ; <nl> } ; <nl> - A92277001517C097001B78AA / * Build configuration list for PBXNativeTarget " HelloJavascript iOS " * / = { <nl> + A92277001517C097001B78AA / * Build configuration list for PBXNativeTarget " HelloJavascript - mobile " * / = { <nl> isa = XCConfigurationList ; <nl> buildConfigurations = ( <nl> A92277011517C097001B78AA / * Debug * / , <nl> mmm a / templates / lua - template - default / frameworks / runtime - src / proj . ios_mac / HelloLua . xcodeproj / project . pbxproj <nl> ppp b / templates / lua - template - default / frameworks / runtime - src / proj . ios_mac / HelloLua . xcodeproj / project . pbxproj <nl> <nl> 5023811517EBBCAC00990C9B / * Prefix . pch * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = Prefix . pch ; sourceTree = " < group > " ; } ; <nl> 5023811617EBBCAC00990C9B / * RootViewController . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = RootViewController . h ; sourceTree = " < group > " ; } ; <nl> 5023811717EBBCAC00990C9B / * RootViewController . mm * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . objcpp ; path = RootViewController . mm ; sourceTree = " < group > " ; } ; <nl> - 5023816B17EBBCE400990C9B / * HelloLua Mac . app * / = { isa = PBXFileReference ; explicitFileType = wrapper . application ; includeInIndex = 0 ; path = " HelloLua Mac . app " ; sourceTree = BUILT_PRODUCTS_DIR ; } ; <nl> + 5023816B17EBBCE400990C9B / * HelloLua - desktop . app * / = { isa = PBXFileReference ; explicitFileType = wrapper . application ; includeInIndex = 0 ; path = " HelloLua - desktop . app " ; sourceTree = BUILT_PRODUCTS_DIR ; } ; <nl> 5023817217EBBE3400990C9B / * Icon . icns * / = { isa = PBXFileReference ; lastKnownFileType = image . icns ; path = Icon . icns ; sourceTree = " < group > " ; } ; <nl> 5023817317EBBE3400990C9B / * Info . plist * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = text . plist . xml ; path = Info . plist ; sourceTree = " < group > " ; } ; <nl> 5023817517EBBE3400990C9B / * Prefix . pch * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = Prefix . pch ; sourceTree = " < group > " ; } ; <nl> <nl> C07828F718B4D72E00BD2287 / * SimulatorApp . mm * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . objcpp ; path = SimulatorApp . mm ; sourceTree = " < group > " ; } ; <nl> D6B061341803AC000077942B / * CoreMotion . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = CoreMotion . framework ; path = Platforms / iPhoneOS . platform / Developer / SDKs / iPhoneOS7 . 0 . sdk / System / Library / Frameworks / CoreMotion . framework ; sourceTree = DEVELOPER_DIR ; } ; <nl> DA9E7D871AB1ABCC004B27C8 / * Security . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = Security . framework ; path = System / Library / Frameworks / Security . framework ; sourceTree = SDKROOT ; } ; <nl> - F293B3C815EB7BE500256477 / * HelloLua iOS . app * / = { isa = PBXFileReference ; explicitFileType = wrapper . application ; includeInIndex = 0 ; path = " HelloLua iOS . app " ; sourceTree = BUILT_PRODUCTS_DIR ; } ; <nl> + F293B3C815EB7BE500256477 / * HelloLua - mobile . app * / = { isa = PBXFileReference ; explicitFileType = wrapper . application ; includeInIndex = 0 ; path = " HelloLua - mobile . app " ; sourceTree = BUILT_PRODUCTS_DIR ; } ; <nl> F293B3CC15EB7BE500256477 / * QuartzCore . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = QuartzCore . framework ; path = System / Library / Frameworks / QuartzCore . framework ; sourceTree = SDKROOT ; } ; <nl> F293B3CE15EB7BE500256477 / * OpenGLES . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = OpenGLES . framework ; path = System / Library / Frameworks / OpenGLES . framework ; sourceTree = SDKROOT ; } ; <nl> F293B3D015EB7BE500256477 / * OpenAL . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = OpenAL . framework ; path = System / Library / Frameworks / OpenAL . framework ; sourceTree = SDKROOT ; } ; <nl> <nl> F293B3C915EB7BE500256477 / * Products * / = { <nl> isa = PBXGroup ; <nl> children = ( <nl> - F293B3C815EB7BE500256477 / * HelloLua iOS . app * / , <nl> - 5023816B17EBBCE400990C9B / * HelloLua Mac . app * / , <nl> + F293B3C815EB7BE500256477 / * HelloLua - mobile . app * / , <nl> + 5023816B17EBBCE400990C9B / * HelloLua - desktop . app * / , <nl> ) ; <nl> name = Products ; <nl> sourceTree = " < group > " ; <nl> <nl> / * End PBXGroup section * / <nl> <nl> / * Begin PBXNativeTarget section * / <nl> - 5023812617EBBCE400990C9B / * HelloLua Mac * / = { <nl> + 5023812617EBBCE400990C9B / * HelloLua - desktop * / = { <nl> isa = PBXNativeTarget ; <nl> - buildConfigurationList = 5023816817EBBCE400990C9B / * Build configuration list for PBXNativeTarget " HelloLua Mac " * / ; <nl> + buildConfigurationList = 5023816817EBBCE400990C9B / * Build configuration list for PBXNativeTarget " HelloLua - desktop " * / ; <nl> buildPhases = ( <nl> 5023813117EBBCE400990C9B / * Sources * / , <nl> 5023813617EBBCE400990C9B / * Frameworks * / , <nl> <nl> 152A34B9199CE758004B68DC / * PBXTargetDependency * / , <nl> C0A2F04118975FF80072A7AB / * PBXTargetDependency * / , <nl> ) ; <nl> - name = " HelloLua Mac " ; <nl> + name = " HelloLua - desktop " ; <nl> productName = HelloLua ; <nl> - productReference = 5023816B17EBBCE400990C9B / * HelloLua Mac . app * / ; <nl> + productReference = 5023816B17EBBCE400990C9B / * HelloLua - desktop . app * / ; <nl> productType = " com . apple . product - type . application " ; <nl> } ; <nl> - F293B3C715EB7BE500256477 / * HelloLua iOS * / = { <nl> + F293B3C715EB7BE500256477 / * HelloLua - mobile * / = { <nl> isa = PBXNativeTarget ; <nl> - buildConfigurationList = F293B6C415EB7BEA00256477 / * Build configuration list for PBXNativeTarget " HelloLua iOS " * / ; <nl> + buildConfigurationList = F293B6C415EB7BEA00256477 / * Build configuration list for PBXNativeTarget " HelloLua - mobile " * / ; <nl> buildPhases = ( <nl> F293B3C415EB7BE500256477 / * Sources * / , <nl> F293B3C515EB7BE500256477 / * Frameworks * / , <nl> <nl> 152A349F199CE72E004B68DC / * PBXTargetDependency * / , <nl> 15D1F3091994BBCA00302043 / * PBXTargetDependency * / , <nl> ) ; <nl> - name = " HelloLua iOS " ; <nl> + name = " HelloLua - mobile " ; <nl> productName = HelloLua ; <nl> - productReference = F293B3C815EB7BE500256477 / * HelloLua iOS . app * / ; <nl> + productReference = F293B3C815EB7BE500256477 / * HelloLua - mobile . app * / ; <nl> productType = " com . apple . product - type . application " ; <nl> } ; <nl> / * End PBXNativeTarget section * / <nl> <nl> ) ; <nl> projectRoot = " " ; <nl> targets = ( <nl> - F293B3C715EB7BE500256477 / * HelloLua iOS * / , <nl> - 5023812617EBBCE400990C9B / * HelloLua Mac * / , <nl> + F293B3C715EB7BE500256477 / * HelloLua - mobile * / , <nl> + 5023812617EBBCE400990C9B / * HelloLua - desktop * / , <nl> ) ; <nl> } ; <nl> / * End PBXProject section * / <nl> <nl> / * End XCBuildConfiguration section * / <nl> <nl> / * Begin XCConfigurationList section * / <nl> - 5023816817EBBCE400990C9B / * Build configuration list for PBXNativeTarget " HelloLua Mac " * / = { <nl> + 5023816817EBBCE400990C9B / * Build configuration list for PBXNativeTarget " HelloLua - desktop " * / = { <nl> isa = XCConfigurationList ; <nl> buildConfigurations = ( <nl> 5023816917EBBCE400990C9B / * Debug * / , <nl> <nl> defaultConfigurationIsVisible = 0 ; <nl> defaultConfigurationName = Release ; <nl> } ; <nl> - F293B6C415EB7BEA00256477 / * Build configuration list for PBXNativeTarget " HelloLua iOS " * / = { <nl> + F293B6C415EB7BEA00256477 / * Build configuration list for PBXNativeTarget " HelloLua - mobile " * / = { <nl> isa = XCConfigurationList ; <nl> buildConfigurations = ( <nl> F293B6C515EB7BEA00256477 / * Debug * / , <nl> mmm a / tools / cocos2d - console <nl> ppp b / tools / cocos2d - console <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit f56ddf5c118a2652d0d7eb796872420a69f532af <nl> + Subproject commit fe7ccc496d507c66dbfef2907fec9ac39d737300 <nl> | Merge pull request from natural - law / v3 | cocos2d/cocos2d-x | 254a4b0b0c84e352850b8a1c126d4afe4f176abe | 2015-04-30T10:13:41Z |
mmm a / lib / FrontendTool / FrontendTool . cpp <nl> ppp b / lib / FrontendTool / FrontendTool . cpp <nl> static bool validateTBDIfNeeded ( CompilerInvocation & Invocation , <nl> switch ( mode ) { <nl> case FrontendOptions : : TBDValidationMode : : Default : <nl> # ifndef NDEBUG <nl> - / / When a debug compiler is targeting an apple platform , we do some <nl> - / / validation by default . <nl> - if ( Invocation . getLangOptions ( ) . Target . getVendor ( ) = = llvm : : Triple : : Apple ) { <nl> - mode = FrontendOptions : : TBDValidationMode : : MissingFromTBD ; <nl> - break ; <nl> - } <nl> - # endif <nl> + / / With a debug compiler , we do some validation by default . <nl> + mode = FrontendOptions : : TBDValidationMode : : MissingFromTBD ; <nl> + break ; <nl> + # else <nl> / / Otherwise , the default is to do nothing . <nl> LLVM_FALLTHROUGH ; <nl> + # endif <nl> case FrontendOptions : : TBDValidationMode : : None : <nl> return false ; <nl> case FrontendOptions : : TBDValidationMode : : All : <nl> | [ TBD ] Validate TBDs in debug compilers for all platforms . | apple/swift | 8d257c256fed0339c8497a2f49d9000a35858345 | 2018-06-28T04:16:32Z |
mmm a / Engine / EngineAssets / Materials / sky / sky . mtl <nl> ppp b / Engine / EngineAssets / Materials / sky / sky . mtl <nl> <nl> < Material MtlFlags = " 524288 " Shader = " SkyHDR " GenMask = " 1 " StringGenMask = " " SurfaceType = " " MatTemplate = " " Diffuse = " 1 , 1 , 1 " Specular = " 0 , 0 , 0 " Emissive = " 0 , 0 , 0 " Shininess = " 10 " Opacity = " 1 " LayerAct = " 1 " > <nl> - < Textures > <nl> - < Texture Map = " Diffuse " File = " % ENGINE % / EngineAssets / Textures / defaults / 16_grey . dds " / > <nl> - < / Textures > <nl> < / Material > <nl> | ! T ( Material ) Removed texture from SkyBox muting procedual gradient | CRYTEK/CRYENGINE | b55e7d1ef3f4959060fa98cc02179f9f31ee1dc2 | 2018-11-16T15:48:41Z |
new file mode 100644 <nl> index 00000000000 . . 0d787616072 <nl> mmm / dev / null <nl> ppp b / dbms / tests / queries / 0_stateless / 01060_substring_negative_size . reference <nl> <nl> + bcdef <nl> + bcdef <nl> + bcdef <nl> + bcdef <nl> + - <nl> + bcdef <nl> + bcdef <nl> + bcdef <nl> + bcdef <nl> + - <nl> + bcdef <nl> + 23456 <nl> + bcdef <nl> + 3456 <nl> + bcdef <nl> + 2345 <nl> + bcdef <nl> + 345 <nl> + - <nl> + bcdef <nl> + 23456 <nl> + bcdef <nl> + 3456 <nl> + bcdef <nl> + 2345 <nl> + bcdef <nl> + 345 <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . 75523ff8aac <nl> mmm / dev / null <nl> ppp b / dbms / tests / queries / 0_stateless / 01060_substring_negative_size . sql <nl> <nl> + select substring ( ' abcdefgh ' , 2 , - 2 ) ; <nl> + select substring ( ' abcdefgh ' , materialize ( 2 ) , - 2 ) ; <nl> + select substring ( ' abcdefgh ' , 2 , materialize ( - 2 ) ) ; <nl> + select substring ( ' abcdefgh ' , materialize ( 2 ) , materialize ( - 2 ) ) ; <nl> + <nl> + select ' - ' ; <nl> + <nl> + select substring ( cast ( ' abcdefgh ' as FixedString ( 8 ) ) , 2 , - 2 ) ; <nl> + select substring ( cast ( ' abcdefgh ' as FixedString ( 8 ) ) , materialize ( 2 ) , - 2 ) ; <nl> + select substring ( cast ( ' abcdefgh ' as FixedString ( 8 ) ) , 2 , materialize ( - 2 ) ) ; <nl> + select substring ( cast ( ' abcdefgh ' as FixedString ( 8 ) ) , materialize ( 2 ) , materialize ( - 2 ) ) ; <nl> + <nl> + select ' - ' ; <nl> + <nl> + drop table t is exists ; <nl> + create table t ( s String , l Int8 , r Int8 ) engine = Memory ; <nl> + insert into t values ( ' abcdefgh ' , 2 , - 2 ) , ( ' 12345678 ' , 3 , - 3 ) ; <nl> + <nl> + select substring ( s , 2 , - 2 ) from t ; <nl> + select substring ( s , l , - 2 ) from t ; <nl> + select substring ( s , 2 , r ) from t ; <nl> + select substring ( s , l , r ) from t ; <nl> + <nl> + select ' - ' ; <nl> + <nl> + drop table t is exists ; <nl> + create table t ( s FixedString ( 8 ) , l Int8 , r Int8 ) engine = Memory ; <nl> + insert into t values ( ' abcdefgh ' , 2 , - 2 ) , ( ' 12345678 ' , 3 , - 3 ) ; <nl> + <nl> + select substring ( s , 2 , - 2 ) from t ; <nl> + select substring ( s , l , - 2 ) from t ; <nl> + select substring ( s , 2 , r ) from t ; <nl> + select substring ( s , l , r ) from t ; <nl> + <nl> + drop table t is exists ; <nl> + <nl> | Added test for substring with negative size . | ClickHouse/ClickHouse | 856f72f3f7511a9f003570dcdd10bd5e3b7675dd | 2020-01-09T12:13:36Z |
mmm a / doc / classes / @ GlobalScope . xml <nl> ppp b / doc / classes / @ GlobalScope . xml <nl> <nl> Tab key . <nl> < / constant > <nl> < constant name = " KEY_BACKTAB " value = " 16777219 " enum = " KeyList " > <nl> - Shift + Tab key . <nl> + Shift + Tab key . <nl> < / constant > <nl> < constant name = " KEY_BACKSPACE " value = " 16777220 " enum = " KeyList " > <nl> Backspace key . <nl> mmm a / doc / classes / Control . xml <nl> ppp b / doc / classes / Control . xml <nl> <nl> Tells Godot which node it should give keyboard focus to if the user presses the top arrow on the keyboard or top on a gamepad by default . You can change the key by editing the [ code ] ui_top [ / code ] input action . The node must be a [ Control ] . If this property is not set , Godot will give focus to the closest [ Control ] to the bottom of this one . <nl> < / member > <nl> < member name = " focus_next " type = " NodePath " setter = " set_focus_next " getter = " get_focus_next " default = " NodePath ( & quot ; & quot ; ) " > <nl> - Tells Godot which node it should give keyboard focus to if the user presses Tab on a keyboard by default . You can change the key by editing the [ code ] ui_focus_next [ / code ] input action . <nl> + Tells Godot which node it should give keyboard focus to if the user presses [ kbd ] Tab [ / kbd ] on a keyboard by default . You can change the key by editing the [ code ] ui_focus_next [ / code ] input action . <nl> If this property is not set , Godot will select a " best guess " based on surrounding nodes in the scene tree . <nl> < / member > <nl> < member name = " focus_previous " type = " NodePath " setter = " set_focus_previous " getter = " get_focus_previous " default = " NodePath ( & quot ; & quot ; ) " > <nl> - Tells Godot which node it should give keyboard focus to if the user presses Shift + Tab on a keyboard by default . You can change the key by editing the [ code ] ui_focus_prev [ / code ] input action . <nl> + Tells Godot which node it should give keyboard focus to if the user presses [ kbd ] Shift + Tab [ / kbd ] on a keyboard by default . You can change the key by editing the [ code ] ui_focus_prev [ / code ] input action . <nl> If this property is not set , Godot will select a " best guess " based on surrounding nodes in the scene tree . <nl> < / member > <nl> < member name = " grow_horizontal " type = " int " setter = " set_h_grow_direction " getter = " get_h_grow_direction " enum = " Control . GrowDirection " default = " 1 " > <nl> mmm a / doc / classes / EditorScript . xml <nl> ppp b / doc / classes / EditorScript . xml <nl> <nl> Base script that can be used to add extension functions to the editor . <nl> < / brief_description > <nl> < description > <nl> - Scripts extending this class and implementing its [ method _run ] method can be executed from the Script Editor ' s [ b ] File & gt ; Run [ / b ] menu option ( or by pressing [ code ] Ctrl + Shift + X [ / code ] ) while the editor is running . This is useful for adding custom in - editor functionality to Godot . For more complex additions , consider using [ EditorPlugin ] s instead . <nl> + Scripts extending this class and implementing its [ method _run ] method can be executed from the Script Editor ' s [ b ] File & gt ; Run [ / b ] menu option ( or by pressing [ kbd ] Ctrl + Shift + X [ / kbd ] ) while the editor is running . This is useful for adding custom in - editor functionality to Godot . For more complex additions , consider using [ EditorPlugin ] s instead . <nl> [ b ] Note : [ / b ] Extending scripts need to have [ code ] tool [ / code ] mode enabled . <nl> [ b ] Example script : [ / b ] <nl> [ codeblock ] <nl> mmm a / doc / classes / GraphEdit . xml <nl> ppp b / doc / classes / GraphEdit . xml <nl> <nl> < / signal > <nl> < signal name = " copy_nodes_request " > <nl> < description > <nl> - Emitted when the user presses [ code ] Ctrl + C [ / code ] . <nl> + Emitted when the user presses [ kbd ] Ctrl + C [ / kbd ] . <nl> < / description > <nl> < / signal > <nl> < signal name = " delete_nodes_request " > <nl> <nl> < / signal > <nl> < signal name = " paste_nodes_request " > <nl> < description > <nl> - Emitted when the user presses [ code ] Ctrl + V [ / code ] . <nl> + Emitted when the user presses [ kbd ] Ctrl + V [ / kbd ] . <nl> < / description > <nl> < / signal > <nl> < signal name = " popup_request " > <nl> mmm a / doc / classes / InputEventKey . xml <nl> ppp b / doc / classes / InputEventKey . xml <nl> <nl> < return type = " int " > <nl> < / return > <nl> < description > <nl> - Returns the keycode combined with modifier keys such as [ code ] Shift [ / code ] or [ code ] Alt [ / code ] . See also [ InputEventWithModifiers ] . <nl> + Returns the keycode combined with modifier keys such as [ kbd ] Shift [ / kbd ] or [ kbd ] Alt [ / kbd ] . See also [ InputEventWithModifiers ] . <nl> To get a human - readable representation of the [ InputEventKey ] with modifiers , use [ code ] OS . get_keycode_string ( event . get_keycode_with_modifiers ( ) ) [ / code ] where [ code ] event [ / code ] is the [ InputEventKey ] . <nl> < / description > <nl> < / method > <nl> <nl> < return type = " int " > <nl> < / return > <nl> < description > <nl> - Returns the physical keycode combined with modifier keys such as [ code ] Shift [ / code ] or [ code ] Alt [ / code ] . See also [ InputEventWithModifiers ] . <nl> + Returns the physical keycode combined with modifier keys such as [ kbd ] Shift [ / kbd ] or [ kbd ] Alt [ / kbd ] . See also [ InputEventWithModifiers ] . <nl> To get a human - readable representation of the [ InputEventKey ] with modifiers , use [ code ] OS . get_keycode_string ( event . get_physical_keycode_with_modifiers ( ) ) [ / code ] where [ code ] event [ / code ] is the [ InputEventKey ] . <nl> < / description > <nl> < / method > <nl> mmm a / doc / classes / InputEventWithModifiers . xml <nl> ppp b / doc / classes / InputEventWithModifiers . xml <nl> <nl> Base class for keys events with modifiers . <nl> < / brief_description > <nl> < description > <nl> - Contains keys events information with modifiers support like [ code ] Shift [ / code ] or [ code ] Alt [ / code ] . See [ method Node . _input ] . <nl> + Contains keys events information with modifiers support like [ kbd ] Shift [ / kbd ] or [ kbd ] Alt [ / kbd ] . See [ method Node . _input ] . <nl> < / description > <nl> < tutorials > <nl> < link > https : / / docs . godotengine . org / en / latest / tutorials / inputs / inputevent . html < / link > <nl> <nl> < / methods > <nl> < members > <nl> < member name = " alt " type = " bool " setter = " set_alt " getter = " get_alt " default = " false " > <nl> - State of the [ code ] Alt [ / code ] modifier . <nl> + State of the [ kbd ] Alt [ / kbd ] modifier . <nl> < / member > <nl> < member name = " command " type = " bool " setter = " set_command " getter = " get_command " default = " false " > <nl> - State of the [ code ] Command [ / code ] modifier . <nl> + State of the [ kbd ] Cmd [ / kbd ] modifier . <nl> < / member > <nl> < member name = " control " type = " bool " setter = " set_control " getter = " get_control " default = " false " > <nl> - State of the [ code ] Ctrl [ / code ] modifier . <nl> + State of the [ kbd ] Ctrl [ / kbd ] modifier . <nl> < / member > <nl> < member name = " meta " type = " bool " setter = " set_metakey " getter = " get_metakey " default = " false " > <nl> - State of the [ code ] Meta [ / code ] modifier . <nl> + State of the [ kbd ] Meta [ / kbd ] modifier . <nl> < / member > <nl> < member name = " shift " type = " bool " setter = " set_shift " getter = " get_shift " default = " false " > <nl> - State of the [ code ] Shift [ / code ] modifier . <nl> + State of the [ kbd ] Shift [ / kbd ] modifier . <nl> < / member > <nl> < / members > <nl> < constants > <nl> mmm a / doc / classes / ItemList . xml <nl> ppp b / doc / classes / ItemList . xml <nl> <nl> < / brief_description > <nl> < description > <nl> This control provides a selectable list of items that may be in a single ( or multiple columns ) with option of text , icons , or both text and icon . Tooltips are supported and may be different for every item in the list . <nl> - Selectable items in the list may be selected or deselected and multiple selection may be enabled . Selection with right mouse button may also be enabled to allow use of popup context menus . Items may also be " activated " by double - clicking them or by pressing Enter . <nl> + Selectable items in the list may be selected or deselected and multiple selection may be enabled . Selection with right mouse button may also be enabled to allow use of popup context menus . Items may also be " activated " by double - clicking them or by pressing [ kbd ] Enter [ / kbd ] . <nl> Item text only supports single - line strings , newline characters ( e . g . [ code ] \ n [ / code ] ) in the string won ' t produce a newline . Text wrapping is enabled in [ constant ICON_MODE_TOP ] mode , but column ' s width is adjusted to fully fit its content by default . You need to set [ member fixed_column_width ] greater than zero to wrap the text . <nl> < / description > <nl> < tutorials > <nl> <nl> < / argument > <nl> < description > <nl> Disables ( or enables ) the item at the specified index . <nl> - Disabled items cannot be selected and do not trigger activation signals ( when double - clicking or pressing Enter ) . <nl> + Disabled items cannot be selected and do not trigger activation signals ( when double - clicking or pressing [ kbd ] Enter [ / kbd ] ) . <nl> < / description > <nl> < / method > <nl> < method name = " set_item_icon " > <nl> <nl> < argument index = " 0 " name = " index " type = " int " > <nl> < / argument > <nl> < description > <nl> - Triggered when specified list item is activated via double - clicking or by pressing Enter . <nl> + Triggered when specified list item is activated via double - clicking or by pressing [ kbd ] Enter [ / kbd ] . <nl> < / description > <nl> < / signal > <nl> < signal name = " item_rmb_selected " > <nl> <nl> Only allow selecting a single item . <nl> < / constant > <nl> < constant name = " SELECT_MULTI " value = " 1 " enum = " SelectMode " > <nl> - Allows selecting multiple items by holding Ctrl or Shift . <nl> + Allows selecting multiple items by holding [ kbd ] Ctrl [ / kbd ] or [ kbd ] Shift [ / kbd ] . <nl> < / constant > <nl> < / constants > <nl> < theme_items > <nl> mmm a / doc / classes / LineEdit . xml <nl> ppp b / doc / classes / LineEdit . xml <nl> <nl> < / brief_description > <nl> < description > <nl> LineEdit provides a single - line string editor , used for text fields . <nl> - It features many built - in shortcuts which will always be available ( [ code ] Ctrl [ / code ] here maps to [ code ] Command [ / code ] on macOS ) : <nl> - - Ctrl + C : Copy <nl> - - Ctrl + X : Cut <nl> - - Ctrl + V or Ctrl + Y : Paste / " yank " <nl> - - Ctrl + Z : Undo <nl> - - Ctrl + Shift + Z : Redo <nl> - - Ctrl + U : Delete text from the cursor position to the beginning of the line <nl> - - Ctrl + K : Delete text from the cursor position to the end of the line <nl> - - Ctrl + A : Select all text <nl> - - Up / Down arrow : Move the cursor to the beginning / end of the line <nl> + It features many built - in shortcuts which will always be available ( [ kbd ] Ctrl [ / kbd ] here maps to [ kbd ] Cmd [ / kbd ] on macOS ) : <nl> + - [ kbd ] Ctrl + C [ / kbd ] : Copy <nl> + - [ kbd ] Ctrl + X [ / kbd ] : Cut <nl> + - [ kbd ] Ctrl + V [ / kbd ] or [ kbd ] Ctrl + Y [ / kbd ] : Paste / " yank " <nl> + - [ kbd ] Ctrl + Z [ / kbd ] : Undo <nl> + - [ kbd ] Ctrl + Shift + Z [ / kbd ] : Redo <nl> + - [ kbd ] Ctrl + U [ / kbd ] : Delete text from the cursor position to the beginning of the line <nl> + - [ kbd ] Ctrl + K [ / kbd ] : Delete text from the cursor position to the end of the line <nl> + - [ kbd ] Ctrl + A [ / kbd ] : Select all text <nl> + - [ kbd ] Up Arrow [ / kbd ] / [ kbd ] Down Arrow [ / kbd ] : Move the cursor to the beginning / end of the line <nl> On macOS , some extra keyboard shortcuts are available : <nl> - - Ctrl + F : Like the right arrow key , move the cursor one character right <nl> - - Ctrl + B : Like the left arrow key , move the cursor one character left <nl> - - Ctrl + P : Like the up arrow key , move the cursor to the previous line <nl> - - Ctrl + N : Like the down arrow key , move the cursor to the next line <nl> - - Ctrl + D : Like the Delete key , delete the character on the right side of cursor <nl> - - Ctrl + H : Like the Backspace key , delete the character on the left side of the cursor <nl> - - Ctrl + A : Like the Home key , move the cursor to the beginning of the line <nl> - - Ctrl + E : Like the End key , move the cursor to the end of the line <nl> - - Command + Left arrow : Like the Home key , move the cursor to the beginning of the line <nl> - - Command + Right arrow : Like the End key , move the cursor to the end of the line <nl> + - [ kbd ] Ctrl + F [ / kbd ] : Same as [ kbd ] Right Arrow [ / kbd ] , move the cursor one character right <nl> + - [ kbd ] Ctrl + B [ / kbd ] : Same as [ kbd ] Left Arrow [ / kbd ] , move the cursor one character left <nl> + - [ kbd ] Ctrl + P [ / kbd ] : Same as [ kbd ] Up Arrow [ / kbd ] , move the cursor to the previous line <nl> + - [ kbd ] Ctrl + N [ / kbd ] : Same as [ kbd ] Down Arrow [ / kbd ] , move the cursor to the next line <nl> + - [ kbd ] Ctrl + D [ / kbd ] : Same as [ kbd ] Delete [ / kbd ] , delete the character on the right side of cursor <nl> + - [ kbd ] Ctrl + H [ / kbd ] : Same as [ kbd ] Backspace [ / kbd ] , delete the character on the left side of the cursor <nl> + - [ kbd ] Ctrl + A [ / kbd ] : Same as [ kbd ] Home [ / kbd ] , move the cursor to the beginning of the line <nl> + - [ kbd ] Ctrl + E [ / kbd ] : Same as [ kbd ] End [ / kbd ] , move the cursor to the end of the line <nl> + - [ kbd ] Cmd + Left Arrow [ / kbd ] : Same as [ kbd ] Home [ / kbd ] , move the cursor to the beginning of the line <nl> + - [ kbd ] Cmd + Right Arrow [ / kbd ] : Same as [ kbd ] End [ / kbd ] , move the cursor to the end of the line <nl> < / description > <nl> < tutorials > <nl> < / tutorials > <nl> mmm a / doc / classes / Node . xml <nl> ppp b / doc / classes / Node . xml <nl> <nl> Implemented on all platforms . <nl> < / constant > <nl> < constant name = " NOTIFICATION_WM_CLOSE_REQUEST " value = " 1006 " > <nl> - Notification received from the OS when a close request is sent ( e . g . closing the window with a " Close " button or Alt + F4 ) . <nl> + Notification received from the OS when a close request is sent ( e . g . closing the window with a " Close " button or [ kbd ] Alt + F4 [ / kbd ] ) . <nl> Implemented on desktop platforms . <nl> < / constant > <nl> < constant name = " NOTIFICATION_WM_GO_BACK_REQUEST " value = " 1007 " > <nl> mmm a / doc / tools / makerst . py <nl> ppp b / doc / tools / makerst . py <nl> def rstize_text ( text , state ) : # type : ( str , State ) - > str <nl> tag_text = " ` ` " <nl> tag_depth + = 1 <nl> inside_code = True <nl> + elif cmd = = " kbd " : <nl> + tag_text = " : kbd : ` " <nl> + tag_depth + = 1 <nl> + elif cmd = = " / kbd " : <nl> + tag_text = " ` " <nl> + tag_depth - = 1 <nl> elif cmd . startswith ( " enum " ) : <nl> tag_text = make_enum ( cmd [ 5 : ] , state ) <nl> escape_post = True <nl> mmm a / editor / editor_fonts . cpp <nl> ppp b / editor / editor_fonts . cpp <nl> void editor_register_fonts ( Ref < Theme > p_theme ) { <nl> MAKE_BOLD_FONT ( df_doc_bold , int ( EDITOR_GET ( " text_editor / help / help_font_size " ) ) * EDSCALE ) ; <nl> MAKE_BOLD_FONT ( df_doc_title , int ( EDITOR_GET ( " text_editor / help / help_title_font_size " ) ) * EDSCALE ) ; <nl> MAKE_SOURCE_FONT ( df_doc_code , int ( EDITOR_GET ( " text_editor / help / help_source_font_size " ) ) * EDSCALE ) ; <nl> + MAKE_SOURCE_FONT ( df_doc_kbd , ( int ( EDITOR_GET ( " text_editor / help / help_source_font_size " ) ) - 1 ) * EDSCALE ) ; <nl> p_theme - > set_font ( " doc " , " EditorFonts " , df_doc ) ; <nl> p_theme - > set_font ( " doc_bold " , " EditorFonts " , df_doc_bold ) ; <nl> p_theme - > set_font ( " doc_title " , " EditorFonts " , df_doc_title ) ; <nl> p_theme - > set_font ( " doc_source " , " EditorFonts " , df_doc_code ) ; <nl> + p_theme - > set_font ( " doc_keyboard " , " EditorFonts " , df_doc_kbd ) ; <nl> <nl> / / Ruler font <nl> MAKE_DEFAULT_FONT ( df_rulers , 8 * EDSCALE ) ; <nl> mmm a / editor / editor_help . cpp <nl> ppp b / editor / editor_help . cpp <nl> static void _add_text_to_rt ( const String & p_bbcode , RichTextLabel * p_rt ) { <nl> Ref < Font > doc_font = p_rt - > get_theme_font ( " doc " , " EditorFonts " ) ; <nl> Ref < Font > doc_bold_font = p_rt - > get_theme_font ( " doc_bold " , " EditorFonts " ) ; <nl> Ref < Font > doc_code_font = p_rt - > get_theme_font ( " doc_source " , " EditorFonts " ) ; <nl> + Ref < Font > doc_kbd_font = p_rt - > get_theme_font ( " doc_keyboard " , " EditorFonts " ) ; <nl> <nl> Color font_color_hl = p_rt - > get_theme_color ( " headline_color " , " EditorHelp " ) ; <nl> Color accent_color = p_rt - > get_theme_color ( " accent_color " , " Editor " ) ; <nl> + Color property_color = p_rt - > get_theme_color ( " property_color " , " Editor " ) ; <nl> Color link_color = accent_color . linear_interpolate ( font_color_hl , 0 . 8 ) ; <nl> Color code_color = accent_color . linear_interpolate ( font_color_hl , 0 . 6 ) ; <nl> + Color kbd_color = accent_color . linear_interpolate ( property_color , 0 . 6 ) ; <nl> <nl> String bbcode = p_bbcode . dedent ( ) . replace ( " \ t " , " " ) . replace ( " \ r " , " " ) . strip_edges ( ) ; <nl> <nl> static void _add_text_to_rt ( const String & p_bbcode , RichTextLabel * p_rt ) { <nl> code_tag = true ; <nl> pos = brk_end + 1 ; <nl> tag_stack . push_front ( tag ) ; <nl> + } else if ( tag = = " kbd " ) { <nl> + <nl> + / / use keyboard font with custom color <nl> + p_rt - > push_font ( doc_kbd_font ) ; <nl> + p_rt - > push_color ( kbd_color ) ; <nl> + code_tag = true ; / / though not strictly a code tag , logic is similar <nl> + pos = brk_end + 1 ; <nl> + tag_stack . push_front ( tag ) ; <nl> } else if ( tag = = " center " ) { <nl> <nl> / / align to center <nl> mmm a / modules / mono / editor / bindings_generator . cpp <nl> ppp b / modules / mono / editor / bindings_generator . cpp <nl> String BindingsGenerator : : bbcode_to_xml ( const String & p_bbcode , const TypeInterf <nl> code_tag = true ; <nl> pos = brk_end + 1 ; <nl> tag_stack . push_front ( tag ) ; <nl> + } else if ( tag = = " kbd " ) { <nl> + / / keyboard combinations are not supported in xml comments <nl> + pos = brk_end + 1 ; <nl> + tag_stack . push_front ( tag ) ; <nl> } else if ( tag = = " center " ) { <nl> - / / center is alignment not supported in xml comments <nl> + / / center alignment is not supported in xml comments <nl> pos = brk_end + 1 ; <nl> tag_stack . push_front ( tag ) ; <nl> } else if ( tag = = " br " ) { <nl> | Merge pull request from pycbouh / docs - improve - shortcuts | godotengine/godot | 41af228b767b8657c51376be77e9a8f1601e05d0 | 2020-04-29T07:40:52Z |
mmm a / README . md <nl> ppp b / README . md <nl> Supported operating systems and hardware : <nl> <nl> # # # SRS 2 . 0 history <nl> <nl> + * v2 . 0 , 2015 - 04 - 08 , for [ # 375 ] ( https : / / github . com / winlinvip / simple - rtmp - server / issues / 375 ) , fix hls bug , keep cc continous between ts files . 2 . 0 . 159 . <nl> * v2 . 0 , 2015 - 04 - 04 , for [ # 304 ] ( https : / / github . com / winlinvip / simple - rtmp - server / issues / 304 ) , rewrite annexb mux for ts , refer to apple sample . 2 . 0 . 157 . <nl> * v2 . 0 , 2015 - 04 - 03 , enhanced avc decode , parse the sps get width + height . 2 . 0 . 156 . <nl> * v2 . 0 , 2015 - 04 - 03 , for [ # 372 ] ( https : / / github . com / winlinvip / simple - rtmp - server / issues / 372 ) , support transform vhost of edge 2 . 0 . 155 . <nl> mmm a / trunk / research / librtmp / srs_ingest_rtmp . c <nl> ppp b / trunk / research / librtmp / srs_ingest_rtmp . c <nl> int proxy ( srs_rtmp_t irtmp , srs_rtmp_t ortmp ) <nl> return ret ; <nl> } <nl> <nl> + if ( ! srs_utils_flv_tag_is_ok ( type ) ) { <nl> + srs_human_trace ( " ignore invalid flv tag = % d , dts = % d , % d bytes " , type , timestamp , size ) ; <nl> + free ( data ) ; <nl> + continue ; <nl> + } <nl> + <nl> if ( ( ret = srs_human_print_rtmp_packet ( type , timestamp , data , size ) ) ! = 0 ) { <nl> srs_human_trace ( " print packet failed . ret = % d " , ret ) ; <nl> return ret ; <nl> mmm a / trunk / src / app / srs_app_config . cpp <nl> ppp b / trunk / src / app / srs_app_config . cpp <nl> bool SrsConfig : : get_log_tank_file ( ) <nl> <nl> SrsConfDirective * conf = root - > get ( " srs_log_tank " ) ; <nl> if ( ! conf | | conf - > arg0 ( ) . empty ( ) ) { <nl> - return false ; <nl> + return true ; <nl> } <nl> <nl> return conf - > arg0 ( ) ! = SRS_CONF_DEFAULT_LOG_TANK_CONSOLE ; <nl> mmm a / trunk / src / app / srs_app_hls . cpp <nl> ppp b / trunk / src / app / srs_app_hls . cpp <nl> string SrsHlsCacheWriter : : cache ( ) <nl> return data ; <nl> } <nl> <nl> - SrsHlsSegment : : SrsHlsSegment ( bool write_cache , bool write_file , SrsCodecAudio ac , SrsCodecVideo vc ) <nl> + SrsHlsSegment : : SrsHlsSegment ( SrsTsContext * c , bool write_cache , bool write_file , SrsCodecAudio ac , SrsCodecVideo vc ) <nl> { <nl> duration = 0 ; <nl> sequence_no = 0 ; <nl> segment_start_dts = 0 ; <nl> is_sequence_header = false ; <nl> writer = new SrsHlsCacheWriter ( write_cache , write_file ) ; <nl> - muxer = new SrsTSMuxer ( writer , ac , vc ) ; <nl> + muxer = new SrsTSMuxer ( writer , c , ac , vc ) ; <nl> } <nl> <nl> SrsHlsSegment : : ~ SrsHlsSegment ( ) <nl> SrsHlsMuxer : : SrsHlsMuxer ( ) <nl> should_write_cache = false ; <nl> should_write_file = true ; <nl> async = new SrsDvrAsyncCallThread ( ) ; <nl> + context = new SrsTsContext ( ) ; <nl> } <nl> <nl> SrsHlsMuxer : : ~ SrsHlsMuxer ( ) <nl> SrsHlsMuxer : : ~ SrsHlsMuxer ( ) <nl> srs_freep ( current ) ; <nl> srs_freep ( req ) ; <nl> srs_freep ( async ) ; <nl> + srs_freep ( context ) ; <nl> } <nl> <nl> int SrsHlsMuxer : : sequence_no ( ) <nl> double SrsHlsMuxer : : duration ( ) <nl> <nl> double SrsHlsMuxer : : deviation ( ) <nl> { <nl> + / / no floor , no deviation . <nl> + if ( ! hls_ts_floor ) { <nl> + return 0 ; <nl> + } <nl> + <nl> return hls_fragment_deviation ; <nl> } <nl> <nl> int SrsHlsMuxer : : absolute_deviation ( ) <nl> { <nl> + / / no floor , no deviation . <nl> + if ( ! hls_ts_floor ) { <nl> + return 0 ; <nl> + } <nl> + <nl> / / accept the floor ts for the first piece . <nl> int64_t floor_ts = ( int64_t ) ( srs_get_system_time_ms ( ) / ( 1000 * hls_fragment ) ) ; <nl> return ( int ) ( accept_floor_ts - ( floor_ts - 1 ) ) ; <nl> int SrsHlsMuxer : : segment_open ( int64_t segment_start_dts ) <nl> } <nl> <nl> / / new segment . <nl> - current = new SrsHlsSegment ( should_write_cache , should_write_file , default_acodec , default_vcodec ) ; <nl> + current = new SrsHlsSegment ( context , should_write_cache , should_write_file , default_acodec , default_vcodec ) ; <nl> current - > sequence_no = _sequence_no + + ; <nl> current - > segment_start_dts = segment_start_dts ; <nl> <nl> mmm a / trunk / src / app / srs_app_hls . hpp <nl> ppp b / trunk / src / app / srs_app_hls . hpp <nl> class SrsTsAacJitter ; <nl> class SrsTsCache ; <nl> class SrsHlsSegment ; <nl> class SrsTsCache ; <nl> + class SrsTsContext ; <nl> <nl> / * * <nl> * the handler for hls event . <nl> class SrsHlsSegment <nl> / / whether current segement is sequence header . <nl> bool is_sequence_header ; <nl> public : <nl> - SrsHlsSegment ( bool write_cache , bool write_file , SrsCodecAudio ac , SrsCodecVideo vc ) ; <nl> + SrsHlsSegment ( SrsTsContext * c , bool write_cache , bool write_file , SrsCodecAudio ac , SrsCodecVideo vc ) ; <nl> virtual ~ SrsHlsSegment ( ) ; <nl> public : <nl> / * * <nl> class SrsHlsMuxer <nl> * @ see https : / / github . com / winlinvip / simple - rtmp - server / issues / 301 <nl> * / <nl> SrsCodecAudio acodec ; <nl> + / * * <nl> + * the ts context , to keep cc continous between ts . <nl> + * @ see https : / / github . com / winlinvip / simple - rtmp - server / issues / 375 <nl> + * / <nl> + SrsTsContext * context ; <nl> public : <nl> SrsHlsMuxer ( ) ; <nl> virtual ~ SrsHlsMuxer ( ) ; <nl> mmm a / trunk / src / kernel / srs_kernel_ts . cpp <nl> ppp b / trunk / src / kernel / srs_kernel_ts . cpp <nl> using namespace std ; <nl> <nl> / / the mpegts header specifed the video / audio pid . <nl> # define TS_PMT_NUMBER 1 <nl> - # define TS_PMT_PID 0x100 <nl> - # define TS_VIDEO_AVC_PID 0x101 <nl> - # define TS_AUDIO_AAC_PID 0x102 <nl> - # define TS_AUDIO_MP3_PID 0x103 <nl> + # define TS_PMT_PID 0x1001 <nl> + # define TS_VIDEO_AVC_PID 0x100 <nl> + # define TS_AUDIO_AAC_PID 0x101 <nl> + # define TS_AUDIO_MP3_PID 0x102 <nl> <nl> string srs_ts_stream2string ( SrsTsStream stream ) <nl> { <nl> SrsTsMessage : : SrsTsMessage ( SrsTsChannel * c , SrsTsPacket * p ) <nl> continuity_counter = 0 ; <nl> PES_packet_length = 0 ; <nl> payload = new SrsSimpleBuffer ( ) ; <nl> + is_discontinuity = false ; <nl> <nl> start_pts = 0 ; <nl> write_pcr = false ; <nl> SrsTsContext : : ~ SrsTsContext ( ) <nl> pids . clear ( ) ; <nl> } <nl> <nl> + void SrsTsContext : : reset ( ) <nl> + { <nl> + vcodec = SrsCodecVideoReserved ; <nl> + acodec = SrsCodecAudioReserved1 ; <nl> + } <nl> + <nl> SrsTsChannel * SrsTsContext : : get ( int pid ) <nl> { <nl> if ( pids . find ( pid ) = = pids . end ( ) ) { <nl> int SrsTsContext : : encode ( SrsFileWriter * writer , SrsTsMessage * msg , SrsCodecVideo <nl> int ret = ERROR_SUCCESS ; <nl> <nl> SrsTsStream vs , as ; <nl> - int16_t video_pid , audio_pid ; <nl> + int16_t video_pid = 0 , audio_pid = 0 ; <nl> switch ( vc ) { <nl> case SrsCodecVideoAVC : <nl> vs = SrsTsStreamVideoH264 ; <nl> int SrsTsContext : : encode_pes ( SrsFileWriter * writer , SrsTsMessage * msg , int16_t p <nl> write_pcr = true ; <nl> } <nl> <nl> + / / it ' s ok to set pcr equals to dts , <nl> + / / @ see https : / / github . com / winlinvip / simple - rtmp - server / issues / 311 <nl> + int64_t pcr = write_pcr ? msg - > dts : - 1 ; <nl> + <nl> + / / TODO : FIXME : finger it why use discontinuity of msg . <nl> pkt = SrsTsPacket : : create_pes_first ( this , <nl> - pid , msg - > sid , channel - > continuity_counter + + , msg - > discontinuity , <nl> - write_pcr ? msg - > dts : - 1 , msg - > dts , msg - > pts , msg - > payload - > length ( ) <nl> + pid , msg - > sid , channel - > continuity_counter + + , msg - > is_discontinuity , <nl> + pcr , msg - > dts , msg - > pts , msg - > payload - > length ( ) <nl> ) ; <nl> } else { <nl> pkt = SrsTsPacket : : create_pes_continue ( this , <nl> int SrsTsContext : : encode_pes ( SrsFileWriter * writer , SrsTsMessage * msg , int16_t p <nl> int nb_buf = pkt - > size ( ) ; <nl> srs_assert ( nb_buf < SRS_TS_PACKET_SIZE ) ; <nl> <nl> - int left = srs_min ( end - p , SRS_TS_PACKET_SIZE - nb_buf ) ; <nl> + int left = ( int ) srs_min ( end - p , SRS_TS_PACKET_SIZE - nb_buf ) ; <nl> int nb_stuffings = SRS_TS_PACKET_SIZE - nb_buf - left ; <nl> if ( nb_stuffings > 0 ) { <nl> / / set all bytes to stuffings . <nl> int SrsTsContext : : encode_pes ( SrsFileWriter * writer , SrsTsMessage * msg , int16_t p <nl> nb_buf = pkt - > size ( ) ; <nl> srs_assert ( nb_buf < SRS_TS_PACKET_SIZE ) ; <nl> <nl> - left = srs_min ( end - p , SRS_TS_PACKET_SIZE - nb_buf ) ; <nl> + left = ( int ) srs_min ( end - p , SRS_TS_PACKET_SIZE - nb_buf ) ; <nl> nb_stuffings = SRS_TS_PACKET_SIZE - nb_buf - left ; <nl> srs_assert ( nb_stuffings = = 0 ) ; <nl> } <nl> SrsTsPacket * SrsTsPacket : : create_pmt ( SrsTsContext * context , int16_t pmt_number , <nl> pmt - > section_number = 0 ; <nl> pmt - > last_section_number = 0 ; <nl> pmt - > program_info_length = 0 ; <nl> + <nl> + / / use audio to carray pcr by default . <nl> + / / for hls , there must be atleast one audio channel . <nl> + pmt - > PCR_PID = apid ; <nl> + pmt - > infos . push_back ( new SrsTsPayloadPMTESInfo ( as , apid ) ) ; <nl> + <nl> + / / if h . 264 specified , use video to carry pcr . <nl> if ( vs = = SrsTsStreamVideoH264 ) { <nl> pmt - > PCR_PID = vpid ; <nl> pmt - > infos . push_back ( new SrsTsPayloadPMTESInfo ( vs , vpid ) ) ; <nl> - } else { <nl> - pmt - > PCR_PID = apid ; <nl> } <nl> - pmt - > infos . push_back ( new SrsTsPayloadPMTESInfo ( as , apid ) ) ; <nl> + <nl> pmt - > CRC_32 = 0 ; / / calc in encode . <nl> return pkt ; <nl> } <nl> int SrsTsPayloadPMT : : psi_encode ( SrsStream * stream ) <nl> return ret ; <nl> } <nl> <nl> - SrsTSMuxer : : SrsTSMuxer ( SrsFileWriter * w , SrsCodecAudio ac , SrsCodecVideo vc ) <nl> + SrsTSMuxer : : SrsTSMuxer ( SrsFileWriter * w , SrsTsContext * c , SrsCodecAudio ac , SrsCodecVideo vc ) <nl> { <nl> writer = w ; <nl> - context = NULL ; <nl> + context = c ; <nl> <nl> acodec = ac ; <nl> vcodec = vc ; <nl> int SrsTSMuxer : : open ( string _path ) <nl> path = _path ; <nl> <nl> close ( ) ; <nl> - <nl> - / / use context to write ts file . <nl> - srs_freep ( context ) ; <nl> - context = new SrsTsContext ( ) ; <nl> + <nl> + / / reset the context for a new ts start . <nl> + context - > reset ( ) ; <nl> <nl> if ( ( ret = writer - > open ( path ) ) ! = ERROR_SUCCESS ) { <nl> return ret ; <nl> int SrsTSMuxer : : write_video ( SrsTsMessage * video ) <nl> <nl> void SrsTSMuxer : : close ( ) <nl> { <nl> - srs_freep ( context ) ; <nl> writer - > close ( ) ; <nl> } <nl> <nl> int SrsTsCache : : do_cache_avc ( SrsAvcAacCodec * codec , SrsCodecSample * sample ) <nl> / / 9 , SI ( SI slice ) <nl> / / H . 264 - AVC - ISO_IEC_14496 - 10 - 2012 . pdf , page 105 . <nl> static u_int8_t aud_nalu_7 [ ] = { 0x09 , 0xf0 } ; <nl> + <nl> + / / always append a aud nalu for each frame . <nl> video - > payload - > append ( ( const char * ) fresh_nalu_header , 4 ) ; <nl> video - > payload - > append ( ( const char * ) aud_nalu_7 , 2 ) ; <nl> <nl> SrsTsEncoder : : SrsTsEncoder ( ) <nl> codec = new SrsAvcAacCodec ( ) ; <nl> sample = new SrsCodecSample ( ) ; <nl> cache = new SrsTsCache ( ) ; <nl> + context = new SrsTsContext ( ) ; <nl> muxer = NULL ; <nl> } <nl> <nl> SrsTsEncoder : : ~ SrsTsEncoder ( ) <nl> srs_freep ( sample ) ; <nl> srs_freep ( cache ) ; <nl> srs_freep ( muxer ) ; <nl> + srs_freep ( context ) ; <nl> } <nl> <nl> int SrsTsEncoder : : initialize ( SrsFileWriter * fs ) <nl> int SrsTsEncoder : : initialize ( SrsFileWriter * fs ) <nl> _fs = fs ; <nl> <nl> srs_freep ( muxer ) ; <nl> - muxer = new SrsTSMuxer ( fs , SrsCodecAudioAAC , SrsCodecVideoAVC ) ; <nl> + muxer = new SrsTSMuxer ( fs , context , SrsCodecAudioAAC , SrsCodecVideoAVC ) ; <nl> <nl> if ( ( ret = muxer - > open ( " " ) ) ! = ERROR_SUCCESS ) { <nl> return ret ; <nl> mmm a / trunk / src / kernel / srs_kernel_ts . hpp <nl> ppp b / trunk / src / kernel / srs_kernel_ts . hpp <nl> class SrsTsAdaptationField ; <nl> class SrsTsPayload ; <nl> class SrsTsMessage ; <nl> class SrsTsPacket ; <nl> + class SrsTsContext ; <nl> <nl> / / Transport Stream packets are 188 bytes in length . <nl> # define SRS_TS_PACKET_SIZE 188 <nl> class SrsTsMessage <nl> / / generally , the video IDR ( I frame , the keyframe of h . 264 ) carray the pcr info . <nl> bool write_pcr ; <nl> / / whether got discontinuity ts , for example , sequence header changed . <nl> - bool discontinuity ; <nl> + bool is_discontinuity ; <nl> public : <nl> / / the timestamp in 90khz <nl> int64_t dts ; <nl> class SrsTsContext <nl> public : <nl> SrsTsContext ( ) ; <nl> virtual ~ SrsTsContext ( ) ; <nl> + public : <nl> + / * * <nl> + * reset the context for a new ts segment start . <nl> + * / <nl> + virtual void reset ( ) ; <nl> / / codec <nl> public : <nl> / * * <nl> class SrsTSMuxer <nl> SrsFileWriter * writer ; <nl> std : : string path ; <nl> public : <nl> - SrsTSMuxer ( SrsFileWriter * w , SrsCodecAudio ac , SrsCodecVideo vc ) ; <nl> + SrsTSMuxer ( SrsFileWriter * w , SrsTsContext * c , SrsCodecAudio ac , SrsCodecVideo vc ) ; <nl> virtual ~ SrsTSMuxer ( ) ; <nl> public : <nl> / * * <nl> class SrsTsEncoder <nl> SrsCodecSample * sample ; <nl> SrsTsCache * cache ; <nl> SrsTSMuxer * muxer ; <nl> + SrsTsContext * context ; <nl> public : <nl> SrsTsEncoder ( ) ; <nl> virtual ~ SrsTsEncoder ( ) ; <nl> mmm a / trunk / src / libs / srs_librtmp . cpp <nl> ppp b / trunk / src / libs / srs_librtmp . cpp <nl> int srs_utils_parse_timestamp ( <nl> <nl> return ret ; <nl> } <nl> + <nl> + srs_bool srs_utils_flv_tag_is_ok ( char type ) <nl> + { <nl> + return type = = SRS_RTMP_TYPE_AUDIO | | type = = SRS_RTMP_TYPE_VIDEO | | type = = SRS_RTMP_TYPE_SCRIPT ; <nl> + } <nl> <nl> char srs_utils_flv_video_codec_id ( char * data , int size ) <nl> { <nl> int srs_human_print_rtmp_packet ( char type , u_int32_t timestamp , char * data , int <nl> ) ; <nl> } else if ( type = = SRS_RTMP_TYPE_SCRIPT ) { <nl> srs_human_verbose ( " Data packet type = % s , time = % d , size = % d " , <nl> - srs_human_flv_tag_type2string ( type ) , timestamp , size ) ; <nl> + srs_human_flv_tag_type2string ( type ) , timestamp , size ) ; <nl> int nparsed = 0 ; <nl> while ( nparsed < size ) { <nl> int nb_parsed_this = 0 ; <nl> int srs_human_print_rtmp_packet ( char type , u_int32_t timestamp , char * data , int <nl> if ( amf0 = = NULL ) { <nl> break ; <nl> } <nl> - <nl> + <nl> nparsed + = nb_parsed_this ; <nl> <nl> char * amf0_str = NULL ; <nl> mmm a / trunk / src / libs / srs_librtmp . hpp <nl> ppp b / trunk / src / libs / srs_librtmp . hpp <nl> extern int srs_utils_parse_timestamp ( <nl> u_int32_t time , char type , char * data , int size , <nl> u_int32_t * ppts <nl> ) ; <nl> + <nl> + / * * <nl> + * whether the flv tag specified by param type is ok . <nl> + * @ return true when tag is video / audio / script - data ; otherwise , false . <nl> + * / <nl> + extern srs_bool srs_utils_flv_tag_is_ok ( char type ) ; <nl> <nl> / * * <nl> * get the CodecID of video tag . <nl> | merge from 2 . 0 . 159 | ossrs/srs | 71e1602458b5f8cb767872701a9a32bc18a2d4ff | 2015-04-09T04:35:53Z |
mmm a / src / mongo / shell / dbshell . cpp <nl> ppp b / src / mongo / shell / dbshell . cpp <nl> MONGO_INITIALIZER_WITH_PREREQUISITES ( SetFeatureCompatibilityVersion42 , ( " EndStar <nl> return Status : : OK ( ) ; <nl> } <nl> const auto kAuthParam = " authSource " s ; <nl> + <nl> + / * * <nl> + * This throws away all log output while inside of a LoggingDisabledScope . <nl> + * / <nl> + class ShellConsoleAppender final : public logger : : ConsoleAppender < logger : : MessageEventEphemeral > { <nl> + using Base = logger : : ConsoleAppender < logger : : MessageEventEphemeral > ; <nl> + <nl> + public : <nl> + using Base : : Base ; <nl> + <nl> + Status append ( const Event & event ) override { <nl> + auto lk = stdx : : lock_guard ( mx ) ; <nl> + if ( ! loggingEnabled ) <nl> + return Status : : OK ( ) ; <nl> + return Base : : append ( event ) ; <nl> + } <nl> + <nl> + struct LoggingDisabledScope { <nl> + LoggingDisabledScope ( ) { <nl> + disableLogging ( ) ; <nl> + } <nl> + <nl> + ~ LoggingDisabledScope ( ) { <nl> + enableLogging ( ) ; <nl> + } <nl> + } ; <nl> + <nl> + private : <nl> + static void enableLogging ( ) { <nl> + auto lk = stdx : : lock_guard ( mx ) ; <nl> + invariant ( ! loggingEnabled ) ; <nl> + loggingEnabled = true ; <nl> + } <nl> + <nl> + static void disableLogging ( ) { <nl> + auto lk = stdx : : lock_guard ( mx ) ; <nl> + invariant ( loggingEnabled ) ; <nl> + loggingEnabled = false ; <nl> + } <nl> + <nl> + / / This needs to use a mutex rather than an atomic bool because we need to ensure that no more <nl> + / / logging will happen once we return from disable ( ) . <nl> + static inline stdx : : mutex mx ; <nl> + static inline bool loggingEnabled = true ; <nl> + } ; <nl> + <nl> } / / namespace <nl> <nl> namespace mongo { <nl> void quitNicely ( int sig ) { <nl> <nl> / / the returned string is allocated with strdup ( ) or malloc ( ) and must be freed by calling free ( ) <nl> char * shellReadline ( const char * prompt , int handlesigint = 0 ) { <nl> + auto lds = ShellConsoleAppender : : LoggingDisabledScope ( ) ; <nl> atPrompt . store ( true ) ; <nl> <nl> char * ret = linenoise ( prompt ) ; <nl> static void edit ( const std : : string & whatToEdit ) { <nl> / / Pass file to editor <nl> StringBuilder sb ; <nl> sb < < editor < < " " < < filename ; <nl> - int ret = : : system ( sb . str ( ) . c_str ( ) ) ; <nl> + int ret = [ & ] { <nl> + auto lds = ShellConsoleAppender : : LoggingDisabledScope ( ) ; <nl> + return : : system ( sb . str ( ) . c_str ( ) ) ; <nl> + } ( ) ; <nl> if ( ret ) { <nl> if ( ret = = - 1 ) { <nl> int systemErrno = errno ; <nl> int _main ( int argc , char * argv [ ] , char * * envp ) { <nl> setupSignalHandlers ( ) ; <nl> setupSignals ( ) ; <nl> <nl> + logger : : globalLogManager ( ) - > getGlobalDomain ( ) - > clearAppenders ( ) ; <nl> + logger : : globalLogManager ( ) - > getGlobalDomain ( ) - > attachAppender ( <nl> + std : : make_unique < ShellConsoleAppender > ( <nl> + std : : make_unique < logger : : MessageEventDetailsEncoder > ( ) ) ) ; <nl> mongo : : shell_utils : : RecordMyLocation ( argv [ 0 ] ) ; <nl> <nl> mongo : : runGlobalInitializersOrDie ( argc , argv , envp ) ; <nl> int _main ( int argc , char * argv [ ] , char * * envp ) { <nl> <nl> logger : : globalLogManager ( ) <nl> - > getNamedDomain ( " javascriptOutput " ) <nl> - - > attachAppender ( std : : make_unique < logger : : ConsoleAppender < logger : : MessageEventEphemeral > > ( <nl> + - > attachAppender ( std : : make_unique < ShellConsoleAppender > ( <nl> std : : make_unique < logger : : MessageEventUnadornedEncoder > ( ) ) ) ; <nl> <nl> / / Get the URL passed to the shell <nl> | SERVER - 7741 Cut off logging while shell is at prompt or editor | mongodb/mongo | 33188722f723293fdbe0c8a273500e8cf293a021 | 2019-03-11T18:58:21Z |
mmm a / src / Makefile . am <nl> ppp b / src / Makefile . am <nl> EXTLDADD = @ ALLOCA @ \ <nl> @ LIBCARES_LIBS @ \ <nl> @ WSLAY_LIBS @ \ <nl> @ TCMALLOC_LIBS @ \ <nl> - @ JEMALLOC_LIBS @ <nl> + @ JEMALLOC_LIBS @ \ <nl> + @ LTLIBINTL @ <nl> <nl> LDADD = libaria2 . la <nl> <nl> | Restore LTLIBINTL in src / Makefile . am | aria2/aria2 | 206d6fc062b63f990ee375d0fecab4662ac3679a | 2016-09-28T23:02:06Z |
mmm a / src / Disks / S3 / DiskS3 . cpp <nl> ppp b / src / Disks / S3 / DiskS3 . cpp <nl> struct DiskS3 : : Metadata <nl> if ( create ) <nl> return ; <nl> <nl> - ReadBufferFromFile buf ( disk_path + metadata_file_path , 1024 ) ; / * reasonable buffer size for small file * / <nl> + try <nl> + { <nl> + ReadBufferFromFile buf ( disk_path + metadata_file_path , 1024 ) ; / * reasonable buffer size for small file * / <nl> <nl> - UInt32 version ; <nl> - readIntText ( version , buf ) ; <nl> + UInt32 version ; <nl> + readIntText ( version , buf ) ; <nl> <nl> - if ( version < VERSION_ABSOLUTE_PATHS | | version > VERSION_READ_ONLY_FLAG ) <nl> - throw Exception ( <nl> - " Unknown metadata file version . Path : " + disk_path + metadata_file_path <nl> + if ( version < VERSION_ABSOLUTE_PATHS | | version > VERSION_READ_ONLY_FLAG ) <nl> + throw Exception ( <nl> + " Unknown metadata file version . Path : " + disk_path + metadata_file_path <nl> + " Version : " + std : : to_string ( version ) + " , Maximum expected version : " + std : : to_string ( VERSION_READ_ONLY_FLAG ) , <nl> - ErrorCodes : : UNKNOWN_FORMAT ) ; <nl> + ErrorCodes : : UNKNOWN_FORMAT ) ; <nl> <nl> - assertChar ( ' \ n ' , buf ) ; <nl> + assertChar ( ' \ n ' , buf ) ; <nl> <nl> - UInt32 s3_objects_count ; <nl> - readIntText ( s3_objects_count , buf ) ; <nl> - assertChar ( ' \ t ' , buf ) ; <nl> - readIntText ( total_size , buf ) ; <nl> - assertChar ( ' \ n ' , buf ) ; <nl> - s3_objects . resize ( s3_objects_count ) ; <nl> - for ( UInt32 i = 0 ; i < s3_objects_count ; + + i ) <nl> - { <nl> - String s3_object_path ; <nl> - size_t s3_object_size ; <nl> - readIntText ( s3_object_size , buf ) ; <nl> + UInt32 s3_objects_count ; <nl> + readIntText ( s3_objects_count , buf ) ; <nl> assertChar ( ' \ t ' , buf ) ; <nl> - readEscapedString ( s3_object_path , buf ) ; <nl> - if ( version = = VERSION_ABSOLUTE_PATHS ) <nl> + readIntText ( total_size , buf ) ; <nl> + assertChar ( ' \ n ' , buf ) ; <nl> + s3_objects . resize ( s3_objects_count ) ; <nl> + for ( UInt32 i = 0 ; i < s3_objects_count ; + + i ) <nl> { <nl> - if ( ! boost : : algorithm : : starts_with ( s3_object_path , s3_root_path ) ) <nl> - throw Exception ( <nl> - " Path in metadata does not correspond S3 root path . Path : " + s3_object_path <nl> - + " , root path : " + s3_root_path + " , disk path : " + disk_path_ , <nl> - ErrorCodes : : UNKNOWN_FORMAT ) ; <nl> - s3_object_path = s3_object_path . substr ( s3_root_path . size ( ) ) ; <nl> + String s3_object_path ; <nl> + size_t s3_object_size ; <nl> + readIntText ( s3_object_size , buf ) ; <nl> + assertChar ( ' \ t ' , buf ) ; <nl> + readEscapedString ( s3_object_path , buf ) ; <nl> + if ( version = = VERSION_ABSOLUTE_PATHS ) <nl> + { <nl> + if ( ! boost : : algorithm : : starts_with ( s3_object_path , s3_root_path ) ) <nl> + throw Exception ( <nl> + " Path in metadata does not correspond S3 root path . Path : " + s3_object_path <nl> + + " , root path : " + s3_root_path + " , disk path : " + disk_path_ , <nl> + ErrorCodes : : UNKNOWN_FORMAT ) ; <nl> + s3_object_path = s3_object_path . substr ( s3_root_path . size ( ) ) ; <nl> + } <nl> + assertChar ( ' \ n ' , buf ) ; <nl> + s3_objects [ i ] = { s3_object_path , s3_object_size } ; <nl> } <nl> - assertChar ( ' \ n ' , buf ) ; <nl> - s3_objects [ i ] = { s3_object_path , s3_object_size } ; <nl> - } <nl> <nl> - readIntText ( ref_count , buf ) ; <nl> - assertChar ( ' \ n ' , buf ) ; <nl> + readIntText ( ref_count , buf ) ; <nl> + assertChar ( ' \ n ' , buf ) ; <nl> <nl> - if ( version > = VERSION_READ_ONLY_FLAG ) <nl> + if ( version > = VERSION_READ_ONLY_FLAG ) <nl> + { <nl> + readBoolText ( read_only , buf ) ; <nl> + assertChar ( ' \ n ' , buf ) ; <nl> + } <nl> + } <nl> + catch ( Exception & e ) <nl> { <nl> - readBoolText ( read_only , buf ) ; <nl> - assertChar ( ' \ n ' , buf ) ; <nl> + if ( e . code ( ) = = ErrorCodes : : UNKNOWN_FORMAT ) <nl> + throw ; <nl> + <nl> + throw Exception ( " Failed to read metadata file : " + e . message ( ) , ErrorCodes : : UNKNOWN_FORMAT ) ; <nl> } <nl> } <nl> <nl> void DiskS3 : : removeMeta ( const String & path , AwsS3KeyKeeper & keys ) <nl> file . remove ( ) ; <nl> } <nl> } <nl> - catch ( . . . ) <nl> + catch ( Exception & e ) <nl> { <nl> / / / If it ' s impossible to read meta - just remove it from FS . <nl> - file . remove ( ) ; <nl> + if ( e . code ( ) = = ErrorCodes : : UNKNOWN_FORMAT ) <nl> + file . remove ( ) ; <nl> + else <nl> + throw ; <nl> } <nl> } <nl> <nl> | Correct handling S3 disk metadata file read exceptions . | ClickHouse/ClickHouse | 5bf388683c1b75f47f887f9d6a9c4f1d53fc97c8 | 2020-12-11T11:21:54Z |
mmm a / android / sdk / src / main / java / com / taobao / weex / ui / view / border / BorderDrawable . java <nl> ppp b / android / sdk / src / main / java / com / taobao / weex / ui / view / border / BorderDrawable . java <nl> public void setColor ( int color ) { <nl> invalidateSelf ( ) ; <nl> } <nl> <nl> - public void setImage ( Shader shader ) { <nl> - mShader = shader ; <nl> + public void setImage ( Shader shader ) { <nl> + mShader = shader ; <nl> invalidateSelf ( ) ; <nl> } <nl> <nl> | * [ android ] update formate code | apache/incubator-weex | 12309adf191347ae10fdf47045afb566cab60094 | 2017-03-13T10:50:58Z |
new file mode 100644 <nl> index 0000000000 . . 92b2408b2c <nl> mmm / dev / null <nl> ppp b / code / mathematical - algorithms / basic / Smallest_digit_in_number / smallest_digit_in_number . java <nl> <nl> + / * Part of Cosmos by OpenGenus Foundation * / <nl> + import java . util . * ; <nl> + class smallest_digit_in_number { <nl> + public static void main ( String args [ ] ) { <nl> + int num = 238493 ; <nl> + System . out . println ( smallest_digit ( num ) ) ; <nl> + } <nl> + <nl> + / / returns the smallest integer of a given number . <nl> + public static int smallest_digit ( int n ) <nl> + { <nl> + int min = n % 10 ; <nl> + n / = 10 ; <nl> + while ( n ! = 0 ) <nl> + { <nl> + if ( min > n % 10 ) <nl> + min = n % 10 ; <nl> + n / = 10 ; <nl> + } <nl> + return min ; <nl> + } <nl> + } <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 0000000000 . . ccedb05d7a <nl> mmm / dev / null <nl> ppp b / code / unclassified / average / average . js <nl> <nl> + / * Part of Cosmos by OpenGenus Foundation * / <nl> + <nl> + / / finds the average of an array of numbers . <nl> + function getAverage ( numbers ) { <nl> + var sum = 0 ; <nl> + for ( i = 0 ; i < numbers . length ; i + + ) { <nl> + sum + = numbers [ i ] ; <nl> + } <nl> + return ( sum / numbers . length ) ; <nl> + } <nl> + <nl> + nums = [ 10 , 20 , 30 , 40 , 50 ] ; <nl> + console . log ( getAverage ( nums ) ) ; <nl> \ No newline at end of file <nl> | Merge pull request from davjd / master | OpenGenus/cosmos | 8dd8d833bfbe93dd055f40f22ca980f23d46a930 | 2017-10-11T05:27:30Z |
new file mode 100644 <nl> index 0000000000 . . 260a301abd <nl> mmm / dev / null <nl> ppp b / tests / host / common / AddrList . h <nl> <nl> + <nl> + / / TODO <nl> + / / mock AddrList with POSIX mock API <nl> + / / later : real AddrList will work with lwIP API <nl> mmm a / tests / host / sys / pgmspace . h <nl> ppp b / tests / host / sys / pgmspace . h <nl> inline char * strcpy_P ( char * dest , const char * src ) { return strcpy ( dest , src ) ; } <nl> inline size_t strlen_P ( const char * s ) { return strlen ( s ) ; } <nl> inline int vsnprintf_P ( char * str , size_t size , const char * format , va_list ap ) { return vsnprintf ( str , size , format , ap ) ; } <nl> <nl> + # define memcpy_P memcpy <nl> + # define strncpy_P strncpy <nl> + # define strcmp_P strcmp <nl> + # define memccpy_P memccpy <nl> <nl> # endif <nl> | wip host build ( ) | esp8266/Arduino | 667c27f86419ffdf3b2ba60bdb548f23e7f0a915 | 2018-12-04T17:55:10Z |
mmm a / src / dbg / _exports . cpp <nl> ppp b / src / dbg / _exports . cpp <nl> extern " C " DLL_EXPORT duint _dbg_sendmessage ( DBGMSG type , void * param1 , void * pa <nl> } <nl> if ( disasmgetstringat ( addr , & strtype , string , string , MAX_STRING_SIZE - 4 ) ) <nl> { <nl> - if ( addrPtr & & strlen ( string ) < = 4 ) <nl> - return false ; <nl> if ( strtype = = str_ascii ) <nl> sprintf_s ( dest , MAX_STRING_SIZE , " \ " % s \ " " , string ) ; <nl> else / / unicode <nl> | DBG : removed restrictive heuristic for string detection | x64dbg/x64dbg | 4ba4bcce1ce06e3783573db59606dae3604d5432 | 2017-01-02T12:25:51Z |
mmm a / grpc . def <nl> ppp b / grpc . def <nl> EXPORTS <nl> grpc_register_plugin <nl> grpc_init <nl> grpc_shutdown <nl> + grpc_is_initialized <nl> grpc_version_string <nl> grpc_g_stands_for <nl> grpc_completion_queue_factory_lookup <nl> mmm a / include / grpc / grpc . h <nl> ppp b / include / grpc / grpc . h <nl> GRPCAPI void grpc_init ( void ) ; <nl> destroyed . * / <nl> GRPCAPI void grpc_shutdown ( void ) ; <nl> <nl> + / * * EXPERIMENTAL . Returns 1 if the grpc library has been initialized . <nl> + TODO ( ericgribkoff ) Decide if this should be promoted to non - experimental as <nl> + part of stabilizing the fork support API , as tracked in <nl> + https : / / github . com / grpc / grpc / issues / 15334 * / <nl> + GRPCAPI int grpc_is_initialized ( void ) ; <nl> + <nl> / * * Return a string representing the current version of grpc * / <nl> GRPCAPI const char * grpc_version_string ( void ) ; <nl> <nl> mmm a / src / core / lib / iomgr / fork_posix . cc <nl> ppp b / src / core / lib / iomgr / fork_posix . cc <nl> <nl> # include < string . h > <nl> <nl> # include < grpc / fork . h > <nl> + # include < grpc / grpc . h > <nl> # include < grpc / support / log . h > <nl> <nl> # include " src / core / lib / gpr / env . h " <nl> <nl> # include " src / core / lib / iomgr / executor . h " <nl> # include " src / core / lib / iomgr / timer_manager . h " <nl> # include " src / core / lib / iomgr / wakeup_fd_posix . h " <nl> - # include " src / core / lib / surface / init . h " <nl> <nl> / * <nl> * NOTE : FORKING IS NOT GENERALLY SUPPORTED , THIS IS ONLY INTENDED TO WORK <nl> mmm a / src / core / lib / surface / init . h <nl> ppp b / src / core / lib / surface / init . h <nl> <nl> void grpc_register_security_filters ( void ) ; <nl> void grpc_security_pre_init ( void ) ; <nl> void grpc_security_init ( void ) ; <nl> - int grpc_is_initialized ( void ) ; <nl> <nl> # endif / * GRPC_CORE_LIB_SURFACE_INIT_H * / <nl> mmm a / src / python / grpcio / grpc / _cython / _cygrpc / fork_posix . pyx . pxi <nl> ppp b / src / python / grpcio / grpc / _cython / _cygrpc / fork_posix . pyx . pxi <nl> cdef void __postfork_child ( ) nogil : <nl> # TODO ( ericgribkoff ) Check and abort if core is not shutdown <nl> with _fork_state . fork_in_progress_condition : <nl> _fork_state . fork_in_progress = False <nl> + if grpc_is_initialized ( ) > 0 : <nl> + with gil : <nl> + _LOGGER . error ( ' Failed to shutdown gRPC Core after fork ( ) ' ) <nl> + os . _exit ( os . EX_USAGE ) <nl> <nl> <nl> def fork_handlers_and_grpc_init ( ) : <nl> mmm a / src / python / grpcio / grpc / _cython / _cygrpc / grpc . pxi <nl> ppp b / src / python / grpcio / grpc / _cython / _cygrpc / grpc . pxi <nl> cdef extern from " grpc / grpc . h " : <nl> <nl> void grpc_init ( ) nogil <nl> void grpc_shutdown ( ) nogil <nl> + int grpc_is_initialized ( ) nogil <nl> <nl> ctypedef struct grpc_completion_queue_factory : <nl> pass <nl> mmm a / src / ruby / ext / grpc / rb_grpc_imports . generated . c <nl> ppp b / src / ruby / ext / grpc / rb_grpc_imports . generated . c <nl> grpc_call_details_destroy_type grpc_call_details_destroy_import ; <nl> grpc_register_plugin_type grpc_register_plugin_import ; <nl> grpc_init_type grpc_init_import ; <nl> grpc_shutdown_type grpc_shutdown_import ; <nl> + grpc_is_initialized_type grpc_is_initialized_import ; <nl> grpc_version_string_type grpc_version_string_import ; <nl> grpc_g_stands_for_type grpc_g_stands_for_import ; <nl> grpc_completion_queue_factory_lookup_type grpc_completion_queue_factory_lookup_import ; <nl> void grpc_rb_load_imports ( HMODULE library ) { <nl> grpc_register_plugin_import = ( grpc_register_plugin_type ) GetProcAddress ( library , " grpc_register_plugin " ) ; <nl> grpc_init_import = ( grpc_init_type ) GetProcAddress ( library , " grpc_init " ) ; <nl> grpc_shutdown_import = ( grpc_shutdown_type ) GetProcAddress ( library , " grpc_shutdown " ) ; <nl> + grpc_is_initialized_import = ( grpc_is_initialized_type ) GetProcAddress ( library , " grpc_is_initialized " ) ; <nl> grpc_version_string_import = ( grpc_version_string_type ) GetProcAddress ( library , " grpc_version_string " ) ; <nl> grpc_g_stands_for_import = ( grpc_g_stands_for_type ) GetProcAddress ( library , " grpc_g_stands_for " ) ; <nl> grpc_completion_queue_factory_lookup_import = ( grpc_completion_queue_factory_lookup_type ) GetProcAddress ( library , " grpc_completion_queue_factory_lookup " ) ; <nl> mmm a / src / ruby / ext / grpc / rb_grpc_imports . generated . h <nl> ppp b / src / ruby / ext / grpc / rb_grpc_imports . generated . h <nl> extern grpc_init_type grpc_init_import ; <nl> typedef void ( * grpc_shutdown_type ) ( void ) ; <nl> extern grpc_shutdown_type grpc_shutdown_import ; <nl> # define grpc_shutdown grpc_shutdown_import <nl> + typedef int ( * grpc_is_initialized_type ) ( void ) ; <nl> + extern grpc_is_initialized_type grpc_is_initialized_import ; <nl> + # define grpc_is_initialized grpc_is_initialized_import <nl> typedef const char * ( * grpc_version_string_type ) ( void ) ; <nl> extern grpc_version_string_type grpc_version_string_import ; <nl> # define grpc_version_string grpc_version_string_import <nl> mmm a / test / core / surface / public_headers_must_be_c89 . c <nl> ppp b / test / core / surface / public_headers_must_be_c89 . c <nl> int main ( int argc , char * * argv ) { <nl> printf ( " % lx " , ( unsigned long ) grpc_register_plugin ) ; <nl> printf ( " % lx " , ( unsigned long ) grpc_init ) ; <nl> printf ( " % lx " , ( unsigned long ) grpc_shutdown ) ; <nl> + printf ( " % lx " , ( unsigned long ) grpc_is_initialized ) ; <nl> printf ( " % lx " , ( unsigned long ) grpc_version_string ) ; <nl> printf ( " % lx " , ( unsigned long ) grpc_g_stands_for ) ; <nl> printf ( " % lx " , ( unsigned long ) grpc_completion_queue_factory_lookup ) ; <nl> | Merge pull request from ericgribkoff / fork_support_v2_check_if_shutdown | grpc/grpc | e04ba7568cb956c84c90f74cfb2b5607a7012aa9 | 2018-08-22T22:38:21Z |
mmm a / HISTORY . md <nl> ppp b / HISTORY . md <nl> <nl> <nl> # # # Bug Fixes <nl> * Fail recovery and report once hitting a physical log record checksum mismatch , while reading MANIFEST . RocksDB should not continue processing the MANIFEST any further . <nl> + * Fix a bug when index_type = = kTwoLevelIndexSearch in PartitionedIndexBuilder to update FlushPolicy to point to internal key partitioner when it changes from user - key mode to internal - key mode in index partition . <nl> <nl> # # 6 . 11 ( 6 / 12 / 2020 ) <nl> # # # Bug Fixes <nl> mmm a / db / db_test2 . cc <nl> ppp b / db / db_test2 . cc <nl> INSTANTIATE_TEST_CASE_P ( TestReadOnlyWithCompressedCache , <nl> TestReadOnlyWithCompressedCache , <nl> : : testing : : Combine ( : : testing : : Values ( - 1 , 100 ) , <nl> : : testing : : Bool ( ) ) ) ; <nl> + <nl> + class PartitionedIndexTestListener : public EventListener { <nl> + public : <nl> + void OnFlushCompleted ( DB * / * db * / , const FlushJobInfo & info ) override { <nl> + ASSERT_GT ( info . table_properties . index_partitions , 1 ) ; <nl> + ASSERT_EQ ( info . table_properties . index_key_is_user_key , 0 ) ; <nl> + } <nl> + } ; <nl> + <nl> + TEST_F ( DBTest2 , PartitionedIndexUserToInternalKey ) { <nl> + BlockBasedTableOptions table_options ; <nl> + Options options = CurrentOptions ( ) ; <nl> + table_options . index_type = BlockBasedTableOptions : : kTwoLevelIndexSearch ; <nl> + PartitionedIndexTestListener * listener = new PartitionedIndexTestListener ( ) ; <nl> + options . table_factory . reset ( NewBlockBasedTableFactory ( table_options ) ) ; <nl> + options . listeners . emplace_back ( listener ) ; <nl> + std : : vector < const Snapshot * > snapshots ; <nl> + Reopen ( options ) ; <nl> + Random rnd ( 301 ) ; <nl> + <nl> + for ( int i = 0 ; i < 3000 ; i + + ) { <nl> + int j = i % 30 ; <nl> + std : : string value = RandomString ( & rnd , 10500 ) ; <nl> + ASSERT_OK ( Put ( " keykey_ " + std : : to_string ( j ) , value ) ) ; <nl> + snapshots . push_back ( db_ - > GetSnapshot ( ) ) ; <nl> + } <nl> + Flush ( ) ; <nl> + for ( auto s : snapshots ) { <nl> + db_ - > ReleaseSnapshot ( s ) ; <nl> + } <nl> + } <nl> + <nl> # endif / / ROCKSDB_LITE <nl> <nl> class PrefixFullBloomWithReverseComparator <nl> mmm a / table / block_based / index_builder . cc <nl> ppp b / table / block_based / index_builder . cc <nl> void PartitionedIndexBuilder : : MakeNewSubIndexBuilder ( ) { <nl> ? sub_index_builder_ - > index_block_builder_ <nl> : sub_index_builder_ - > index_block_builder_without_seq_ ) ) ; <nl> partition_cut_requested_ = false ; <nl> + seperator_is_key_plus_seq_ = false ; <nl> } <nl> <nl> void PartitionedIndexBuilder : : RequestPartitionCut ( ) { <nl> void PartitionedIndexBuilder : : AddIndexEntry ( <nl> } <nl> sub_index_builder_ - > AddIndexEntry ( last_key_in_current_block , <nl> first_key_in_next_block , block_handle ) ; <nl> - if ( sub_index_builder_ - > seperator_is_key_plus_seq_ ) { <nl> - / / then we need to apply it to all sub - index builders <nl> + if ( ! seperator_is_key_plus_seq_ & & <nl> + sub_index_builder_ - > seperator_is_key_plus_seq_ ) { <nl> + / / then we need to apply it to all sub - index builders and reset <nl> + / / flush_policy to point to Block Builder of sub_index_builder_ that store <nl> + / / internal keys . <nl> seperator_is_key_plus_seq_ = true ; <nl> + flush_policy_ . reset ( FlushBlockBySizePolicyFactory : : NewFlushBlockPolicy ( <nl> + table_opt_ . metadata_block_size , table_opt_ . block_size_deviation , <nl> + sub_index_builder_ - > index_block_builder_ ) ) ; <nl> } <nl> sub_index_last_key_ = std : : string ( * last_key_in_current_block ) ; <nl> entries_ . push_back ( <nl> void PartitionedIndexBuilder : : AddIndexEntry ( <nl> sub_index_builder_ - > AddIndexEntry ( last_key_in_current_block , <nl> first_key_in_next_block , block_handle ) ; <nl> sub_index_last_key_ = std : : string ( * last_key_in_current_block ) ; <nl> - if ( sub_index_builder_ - > seperator_is_key_plus_seq_ ) { <nl> - / / then we need to apply it to all sub - index builders <nl> + if ( ! seperator_is_key_plus_seq_ & & <nl> + sub_index_builder_ - > seperator_is_key_plus_seq_ ) { <nl> + / / then we need to apply it to all sub - index builders and reset <nl> + / / flush_policy to point to Block Builder of sub_index_builder_ that store <nl> + / / internal keys . <nl> + flush_policy_ . reset ( FlushBlockBySizePolicyFactory : : NewFlushBlockPolicy ( <nl> + table_opt_ . metadata_block_size , table_opt_ . block_size_deviation , <nl> + sub_index_builder_ - > index_block_builder_ ) ) ; <nl> seperator_is_key_plus_seq_ = true ; <nl> } <nl> } <nl> | Update Flush policy in PartitionedIndexBuilder on switching from user - key to internal - key mode ( ) | facebook/rocksdb | 5edfe3a3d89e29515decb3bea9195ae880462762 | 2020-07-01T21:58:08Z |
mmm a / src / config / args . hpp <nl> ppp b / src / config / args . hpp <nl> <nl> / / doesn ' t return memory to the OS . If it ' s set too low , startup will take a longer time . <nl> # define LBA_READ_BUFFER_SIZE GIGABYTE <nl> <nl> - / / How many different places in each file we should be writing to at once , not counting the <nl> - / / metablock or LBA <nl> - # define MAX_ACTIVE_DATA_EXTENTS 64 <nl> - # define DEFAULT_ACTIVE_DATA_EXTENTS 1 <nl> - <nl> # define COROUTINE_STACK_SIZE 131072 <nl> <nl> # define MAX_COROS_PER_THREAD 10000 <nl> mmm a / src / serializer / log / config . hpp <nl> ppp b / src / serializer / log / config . hpp <nl> struct log_serializer_dynamic_config_t { <nl> log_serializer_dynamic_config_t ( ) { <nl> gc_low_ratio = DEFAULT_GC_LOW_RATIO ; <nl> gc_high_ratio = DEFAULT_GC_HIGH_RATIO ; <nl> - num_active_data_extents = DEFAULT_ACTIVE_DATA_EXTENTS ; <nl> read_ahead = true ; <nl> io_batch_factor = DEFAULT_IO_BATCH_FACTOR ; <nl> } <nl> struct log_serializer_dynamic_config_t { <nl> garbage until it reaches gc_low_ratio . * / <nl> double gc_low_ratio , gc_high_ratio ; <nl> <nl> - / * How many data block extents the serializer will be writing to at once * / <nl> - uint32_t num_active_data_extents ; <nl> - <nl> / * The ( minimal ) batch size of i / o requests being taken from a single i / o account . <nl> It is a factor because the actual batch size is this factor multiplied by the <nl> i / o priority of the account . * / <nl> struct log_serializer_dynamic_config_t { <nl> / * Enable reading more data than requested to let the cache warmup more quickly esp . on rotational drives * / <nl> bool read_ahead ; <nl> <nl> - RDB_MAKE_ME_SERIALIZABLE_5 ( gc_low_ratio , gc_high_ratio , num_active_data_extents , io_batch_factor , read_ahead ) ; <nl> + RDB_MAKE_ME_SERIALIZABLE_4 ( gc_low_ratio , gc_high_ratio , io_batch_factor , read_ahead ) ; <nl> } ; <nl> <nl> / * This is equivalent to log_serializer_static_config_t below , but is an on - disk <nl> mmm a / src / serializer / log / data_block_manager . cc <nl> ppp b / src / serializer / log / data_block_manager . cc <nl> data_block_manager_t : : ~ data_block_manager_t ( ) { <nl> } <nl> <nl> void data_block_manager_t : : prepare_initial_metablock ( metablock_mixin_t * mb ) { <nl> - for ( int i = 0 ; i < MAX_ACTIVE_DATA_EXTENTS ; i + + ) { <nl> + / / RSI : Dumb . <nl> + for ( int i = 0 ; i < 1 ; i + + ) { <nl> mb - > active_extents [ i ] = NULL_OFFSET ; <nl> mb - > blocks_in_active_extent [ i ] = 0 ; <nl> } <nl> void data_block_manager_t : : start_existing ( file_t * file , metablock_mixin_t * last_ <nl> gc_io_account_high . init ( new file_account_t ( file , GC_IO_PRIORITY_HIGH ) ) ; <nl> <nl> / * Reconstruct the active data block extents from the metablock . * / <nl> - for ( unsigned int i = 0 ; i < MAX_ACTIVE_DATA_EXTENTS ; i + + ) { <nl> + / / RSI : Dumb . <nl> + for ( unsigned int i = 0 ; i < 1 ; i + + ) { <nl> int64_t offset = last_metablock - > active_extents [ i ] ; <nl> <nl> if ( offset ! = NULL_OFFSET ) { <nl> void data_block_manager_t : : run_gc ( ) { <nl> void data_block_manager_t : : prepare_metablock ( metablock_mixin_t * metablock ) { <nl> guarantee ( state = = state_ready | | state = = state_shutting_down ) ; <nl> <nl> - for ( int i = 0 ; i < MAX_ACTIVE_DATA_EXTENTS ; i + + ) { <nl> + / / RSI : Dumb . <nl> + for ( int i = 0 ; i < 1 ; i + + ) { <nl> if ( active_extents [ i ] ) { <nl> metablock - > active_extents [ i ] = active_extents [ i ] - > extent_ref . offset ( ) ; <nl> metablock - > blocks_in_active_extent [ i ] = blocks_in_active_extent [ i ] ; <nl> void data_block_manager_t : : actually_shutdown ( ) { <nl> <nl> guarantee ( reconstructed_extents . head ( ) = = NULL ) ; <nl> <nl> - for ( unsigned int i = 0 ; i < dynamic_config - > num_active_data_extents ; i + + ) { <nl> + / / RSI : Dumb . <nl> + for ( unsigned int i = 0 ; i < 1 ; i + + ) { <nl> if ( active_extents [ i ] ) { <nl> UNUSED int64_t extent = active_extents [ i ] - > extent_ref . release ( ) ; <nl> delete active_extents [ i ] ; <nl> counted_t < ls_block_token_pointee_t > data_block_manager_t : : gimme_a_new_offset ( ) { <nl> active_extents [ next_active_extent ] = NULL ; <nl> } <nl> <nl> - / * Move along to the next extent . This logic is kind of weird because it needs to <nl> - handle the case where we have just started up and we still have active extents <nl> - open from a previous run , but the value of num_active_data_extents was higher on <nl> - that previous run and so there are active data extents that occupy slots in <nl> - active_extents that are higher than our current value of <nl> - num_active_data_extents . The way we handle this case is by continuing to visit <nl> - those slots until the data extents fill up and are deactivated , but then not <nl> - visiting those slots any more . * / <nl> - <nl> - do { <nl> - next_active_extent = ( next_active_extent + 1 ) % MAX_ACTIVE_DATA_EXTENTS ; <nl> - } while ( next_active_extent > = dynamic_config - > num_active_data_extents & & <nl> - ! active_extents [ next_active_extent ] ) ; <nl> + rassert ( next_active_extent = = 0 ) ; <nl> <nl> / / RSI : don ' t pass fake block size . <nl> return serializer - > generate_block_token ( offset , <nl> mmm a / src / serializer / log / data_block_manager . hpp <nl> ppp b / src / serializer / log / data_block_manager . hpp <nl> class data_block_manager_t { <nl> ~ data_block_manager_t ( ) ; <nl> <nl> struct metablock_mixin_t { <nl> - int64_t active_extents [ MAX_ACTIVE_DATA_EXTENTS ] ; <nl> - uint64_t blocks_in_active_extent [ MAX_ACTIVE_DATA_EXTENTS ] ; <nl> - } ; <nl> + / / RSI : We need to update the serializer version number . <nl> + <nl> + / / RSI : Maybe this is a good opportunity to adjust the metablock to have <nl> + / / individual metablock version info . <nl> + <nl> + / / RSI : Dumb . <nl> + int64_t active_extents [ 1 ] ; <nl> + uint64_t blocks_in_active_extent [ 1 ] ; <nl> + } __attribute__ ( ( __packed__ ) ) ; <nl> <nl> / * When initializing the database from scratch , call start ( ) with just the <nl> database FD . When restarting an existing database , call start ( ) with the last <nl> class data_block_manager_t { <nl> / * Contains every extent in the gc_entry_t : : state_reconstructing state * / <nl> intrusive_list_t < gc_entry_t > reconstructed_extents ; <nl> <nl> - / * Contains the extents in the gc_entry_t : : state_active state . The number of <nl> - active extents is determined by dynamic_config - > num_active_data_extents . * / <nl> - unsigned int next_active_extent ; / / Cycles through the active extents <nl> - gc_entry_t * active_extents [ MAX_ACTIVE_DATA_EXTENTS ] ; <nl> - unsigned blocks_in_active_extent [ MAX_ACTIVE_DATA_EXTENTS ] ; <nl> + / * Contains the extents in the gc_entry_t : : state_active state . The number of active <nl> + extents is 1 . * / <nl> + unsigned int next_active_extent ; / / Cycles through the active extents . Always 0 , <nl> + / / actually . <nl> + / / RSI : Dumb . <nl> + gc_entry_t * active_extents [ 1 ] ; <nl> + unsigned blocks_in_active_extent [ 1 ] ; <nl> <nl> / * Contains every extent in the gc_entry_t : : state_young state * / <nl> intrusive_list_t < gc_entry_t > young_extent_queue ; <nl> mmm a / src / unittest / disk_format_test . cc <nl> ppp b / src / unittest / disk_format_test . cc <nl> TEST ( DiskFormatTest , LbaSuperblockT ) { <nl> } <nl> <nl> TEST ( DiskFormatTest , DataBlockManagerMetablockMixinT ) { <nl> - / / The numbers below assume this fact about MAX_ACTIVE_DATA_EXTENTS . <nl> - EXPECT_EQ ( 64 , MAX_ACTIVE_DATA_EXTENTS ) ; <nl> - <nl> EXPECT_EQ ( 0u , offsetof ( data_block_manager_t : : metablock_mixin_t , active_extents ) ) ; <nl> - EXPECT_EQ ( 512u , offsetof ( data_block_manager_t : : metablock_mixin_t , blocks_in_active_extent ) ) ; <nl> - EXPECT_EQ ( 1024u , sizeof ( data_block_manager_t : : metablock_mixin_t ) ) ; <nl> + EXPECT_EQ ( 8u , offsetof ( data_block_manager_t : : metablock_mixin_t , blocks_in_active_extent ) ) ; <nl> + EXPECT_EQ ( 16u , sizeof ( data_block_manager_t : : metablock_mixin_t ) ) ; <nl> } <nl> <nl> TEST ( DiskFormatTest , ExtentManagerMetablockMixinT ) { <nl> TEST ( DiskFormatTest , LogSerializerMetablockT ) { <nl> n + = sizeof ( block_sequence_id_t ) ; <nl> EXPECT_EQ ( n , sizeof ( log_serializer_metablock_t ) ) ; <nl> <nl> - EXPECT_EQ ( 1168 , 8 + 128 + 1024 + 8 ) ; <nl> - EXPECT_EQ ( 1168u , sizeof ( log_serializer_metablock_t ) ) ; <nl> + EXPECT_EQ ( 160 , 8 + 128 + 16 + 8 ) ; <nl> + EXPECT_EQ ( 160u , sizeof ( log_serializer_metablock_t ) ) ; <nl> } <nl> <nl> TEST ( DiskFormatTest , LogSerializerStaticConfigT ) { <nl> | Made MAX_ACTIVE_DATA_EXTENTS be set to 1 , and removed , but awkwardly so ( with many 1 - pass for loops ) . | rethinkdb/rethinkdb | 1113a08081535d5ba95d08b079a518df960c383a | 2013-06-26T02:57:05Z |
mmm a / src / yuzu / debugger / wait_tree . cpp <nl> ppp b / src / yuzu / debugger / wait_tree . cpp <nl> std : : vector < std : : unique_ptr < WaitTreeItem > > WaitTreeThread : : GetChildren ( ) const { <nl> } <nl> <nl> list . push_back ( std : : make_unique < WaitTreeText > ( tr ( " processor = % 1 " ) . arg ( processor ) ) ) ; <nl> + list . push_back ( std : : make_unique < WaitTreeText > ( tr ( " ideal core = % 1 " ) . arg ( thread . ideal_core ) ) ) ; <nl> + list . push_back ( std : : make_unique < WaitTreeText > ( tr ( " affinity mask = % 1 " ) . arg ( thread . mask ) ) ) ; <nl> list . push_back ( std : : make_unique < WaitTreeText > ( tr ( " thread id = % 1 " ) . arg ( thread . GetThreadId ( ) ) ) ) ; <nl> list . push_back ( std : : make_unique < WaitTreeText > ( tr ( " priority = % 1 ( current ) / % 2 ( normal ) " ) <nl> . arg ( thread . current_priority ) <nl> | wait_tree : Add ideal core and affinity mask . | yuzu-emu/yuzu | e6671190a5994e5154fc845a1152577f1be22133 | 2018-05-10T23:34:52Z |
new file mode 100644 <nl> index 00000000000 . . 974446f8472 <nl> mmm / dev / null <nl> ppp b / modules / features2d / doc / agast . txt <nl> <nl> + / * This is AGAST and OAST , an optimal and accelerated corner detector <nl> + based on the accelerated segment tests <nl> + Below is the original copyright and the references * / <nl> + <nl> + / * <nl> + Copyright ( C ) 2010 Elmar Mair <nl> + All rights reserved . <nl> + <nl> + Redistribution and use in source and binary forms , with or without <nl> + modification , are permitted provided that the following conditions <nl> + are met : <nl> + <nl> + * Redistributions of source code must retain the above copyright <nl> + notice , this list of conditions and the following disclaimer . <nl> + <nl> + * Redistributions in binary form must reproduce the above copyright <nl> + notice , this list of conditions and the following disclaimer in the <nl> + documentation and / or other materials provided with the distribution . <nl> + <nl> + * Neither the name of the University of Cambridge nor the names of <nl> + its contributors may be used to endorse or promote products derived <nl> + from this software without specific prior written permission . <nl> + <nl> + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR <nl> + CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , <nl> + EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED TO , <nl> + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , DATA , OR <nl> + PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF <nl> + LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING <nl> + NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF THIS <nl> + SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * / <nl> + <nl> + / * <nl> + The references are : <nl> + * Adaptive and Generic Corner Detection Based on the Accelerated Segment Test , <nl> + Elmar Mair and Gregory D . Hager and Darius Burschka <nl> + and Michael Suppa and Gerhard Hirzinger ECCV 2010 <nl> + URL : http : / / www6 . in . tum . de / Main / ResearchAgast <nl> + * / <nl> + <nl> + # include " precomp . hpp " <nl> + # include " agast_score . hpp " <nl> + <nl> + # ifdef _MSC_VER <nl> + # pragma warning ( disable : 4127 ) <nl> + # endif <nl> + <nl> + namespace cv <nl> + { <nl> + <nl> + static void AGAST_5_8 ( InputArray _img , std : : vector < KeyPoint > & keypoints , int threshold ) <nl> + { <nl> + <nl> + cv : : Mat img ; <nl> + if ( ! _img . getMat ( ) . isContinuous ( ) ) <nl> + img = _img . getMat ( ) . clone ( ) ; <nl> + else <nl> + img = _img . getMat ( ) ; <nl> + <nl> + size_t total = 0 ; <nl> + int xsize = img . cols ; <nl> + int ysize = img . rows ; <nl> + size_t nExpectedCorners = keypoints . capacity ( ) ; <nl> + register int x , y ; <nl> + register int xsizeB = xsize - 2 ; <nl> + register int ysizeB = ysize - 1 ; <nl> + register int width ; <nl> + <nl> + keypoints . resize ( 0 ) ; <nl> + <nl> + int pixel_5_8_ [ 16 ] ; <nl> + makeAgastOffsets ( pixel_5_8_ , ( int ) img . step , AgastFeatureDetector : : AGAST_5_8 ) ; <nl> + <nl> + register short offset0 = ( short ) pixel_5_8_ [ 0 ] ; <nl> + register short offset1 = ( short ) pixel_5_8_ [ 1 ] ; <nl> + register short offset2 = ( short ) pixel_5_8_ [ 2 ] ; <nl> + register short offset3 = ( short ) pixel_5_8_ [ 3 ] ; <nl> + register short offset4 = ( short ) pixel_5_8_ [ 4 ] ; <nl> + register short offset5 = ( short ) pixel_5_8_ [ 5 ] ; <nl> + register short offset6 = ( short ) pixel_5_8_ [ 6 ] ; <nl> + register short offset7 = ( short ) pixel_5_8_ [ 7 ] ; <nl> + <nl> + width = xsize ; <nl> + <nl> + for ( y = 1 ; y < ysizeB ; y + + ) <nl> + { <nl> + x = 0 ; <nl> + while ( true ) <nl> + { <nl> + homogeneous : <nl> + { <nl> + x + + ; <nl> + if ( x > xsizeB ) <nl> + break ; <nl> + else <nl> + { <nl> + register const unsigned char * const ptr = img . ptr ( ) + y * width + x ; <nl> + register const int cb = * ptr + threshold ; <nl> + register const int c_b = * ptr - threshold ; <nl> + if ( ptr [ offset0 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset0 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + } <nl> + } <nl> + structured : <nl> + { <nl> + x + + ; <nl> + if ( x > xsizeB ) <nl> + break ; <nl> + else <nl> + { <nl> + register const unsigned char * const ptr = img . ptr ( ) + y * width + x ; <nl> + register const int cb = * ptr + threshold ; <nl> + register const int c_b = * ptr - threshold ; <nl> + if ( ptr [ offset0 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset0 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + } <nl> + } <nl> + success_homogeneous : <nl> + if ( total = = nExpectedCorners ) <nl> + { <nl> + if ( nExpectedCorners = = 0 ) <nl> + { <nl> + nExpectedCorners = 512 ; <nl> + keypoints . reserve ( nExpectedCorners ) ; <nl> + } <nl> + else <nl> + { <nl> + nExpectedCorners * = 2 ; <nl> + keypoints . reserve ( nExpectedCorners ) ; <nl> + } <nl> + } <nl> + keypoints . push_back ( KeyPoint ( Point2f ( ( float ) x , ( float ) y ) , 1 . 0f ) ) ; <nl> + total + + ; <nl> + goto homogeneous ; <nl> + success_structured : <nl> + if ( total = = nExpectedCorners ) <nl> + { <nl> + if ( nExpectedCorners = = 0 ) <nl> + { <nl> + nExpectedCorners = 512 ; <nl> + keypoints . reserve ( nExpectedCorners ) ; <nl> + } <nl> + else <nl> + { <nl> + nExpectedCorners * = 2 ; <nl> + keypoints . reserve ( nExpectedCorners ) ; <nl> + } <nl> + } <nl> + keypoints . push_back ( KeyPoint ( Point2f ( ( float ) x , ( float ) y ) , 1 . 0f ) ) ; <nl> + total + + ; <nl> + goto structured ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + static void AGAST_7_12d ( InputArray _img , std : : vector < KeyPoint > & keypoints , int threshold ) <nl> + { <nl> + cv : : Mat img ; <nl> + if ( ! _img . getMat ( ) . isContinuous ( ) ) <nl> + img = _img . getMat ( ) . clone ( ) ; <nl> + else <nl> + img = _img . getMat ( ) ; <nl> + <nl> + size_t total = 0 ; <nl> + int xsize = img . cols ; <nl> + int ysize = img . rows ; <nl> + size_t nExpectedCorners = keypoints . capacity ( ) ; <nl> + register int x , y ; <nl> + register int xsizeB = xsize - 4 ; <nl> + register int ysizeB = ysize - 3 ; <nl> + register int width ; <nl> + <nl> + keypoints . resize ( 0 ) ; <nl> + <nl> + int pixel_7_12d_ [ 16 ] ; <nl> + makeAgastOffsets ( pixel_7_12d_ , ( int ) img . step , AgastFeatureDetector : : AGAST_7_12d ) ; <nl> + <nl> + register short offset0 = ( short ) pixel_7_12d_ [ 0 ] ; <nl> + register short offset1 = ( short ) pixel_7_12d_ [ 1 ] ; <nl> + register short offset2 = ( short ) pixel_7_12d_ [ 2 ] ; <nl> + register short offset3 = ( short ) pixel_7_12d_ [ 3 ] ; <nl> + register short offset4 = ( short ) pixel_7_12d_ [ 4 ] ; <nl> + register short offset5 = ( short ) pixel_7_12d_ [ 5 ] ; <nl> + register short offset6 = ( short ) pixel_7_12d_ [ 6 ] ; <nl> + register short offset7 = ( short ) pixel_7_12d_ [ 7 ] ; <nl> + register short offset8 = ( short ) pixel_7_12d_ [ 8 ] ; <nl> + register short offset9 = ( short ) pixel_7_12d_ [ 9 ] ; <nl> + register short offset10 = ( short ) pixel_7_12d_ [ 10 ] ; <nl> + register short offset11 = ( short ) pixel_7_12d_ [ 11 ] ; <nl> + <nl> + width = xsize ; <nl> + <nl> + for ( y = 3 ; y < ysizeB ; y + + ) <nl> + { <nl> + x = 2 ; <nl> + while ( true ) <nl> + { <nl> + homogeneous : <nl> + { <nl> + x + + ; <nl> + if ( x > xsizeB ) <nl> + break ; <nl> + else <nl> + { <nl> + register const unsigned char * const ptr = img . ptr ( ) + y * width + x ; <nl> + register const int cb = * ptr + threshold ; <nl> + register const int c_b = * ptr - threshold ; <nl> + if ( ptr [ offset0 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset0 ] < c_b ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + } <nl> + } <nl> + structured : <nl> + { <nl> + x + + ; <nl> + if ( x > xsizeB ) <nl> + break ; <nl> + else <nl> + { <nl> + register const unsigned char * const ptr = img . ptr ( ) + y * width + x ; <nl> + register const int cb = * ptr + threshold ; <nl> + register const int c_b = * ptr - threshold ; <nl> + if ( ptr [ offset0 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset0 ] < c_b ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + } <nl> + } <nl> + success_homogeneous : <nl> + if ( total = = nExpectedCorners ) <nl> + { <nl> + if ( nExpectedCorners = = 0 ) <nl> + { <nl> + nExpectedCorners = 512 ; <nl> + keypoints . reserve ( nExpectedCorners ) ; <nl> + } <nl> + else <nl> + { <nl> + nExpectedCorners * = 2 ; <nl> + keypoints . reserve ( nExpectedCorners ) ; <nl> + } <nl> + } <nl> + keypoints . push_back ( KeyPoint ( Point2f ( ( float ) x , ( float ) y ) , 1 . 0f ) ) ; <nl> + total + + ; <nl> + goto homogeneous ; <nl> + success_structured : <nl> + if ( total = = nExpectedCorners ) <nl> + { <nl> + if ( nExpectedCorners = = 0 ) <nl> + { <nl> + nExpectedCorners = 512 ; <nl> + keypoints . reserve ( nExpectedCorners ) ; <nl> + } <nl> + else <nl> + { <nl> + nExpectedCorners * = 2 ; <nl> + keypoints . reserve ( nExpectedCorners ) ; <nl> + } <nl> + } <nl> + keypoints . push_back ( KeyPoint ( Point2f ( ( float ) x , ( float ) y ) , 1 . 0f ) ) ; <nl> + total + + ; <nl> + goto structured ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + static void AGAST_7_12s ( InputArray _img , std : : vector < KeyPoint > & keypoints , int threshold ) <nl> + { <nl> + cv : : Mat img ; <nl> + if ( ! _img . getMat ( ) . isContinuous ( ) ) <nl> + img = _img . getMat ( ) . clone ( ) ; <nl> + else <nl> + img = _img . getMat ( ) ; <nl> + <nl> + size_t total = 0 ; <nl> + int xsize = img . cols ; <nl> + int ysize = img . rows ; <nl> + size_t nExpectedCorners = keypoints . capacity ( ) ; <nl> + register int x , y ; <nl> + register int xsizeB = xsize - 3 ; / / 2 , + 1 due to faster test x > xsizeB <nl> + register int ysizeB = ysize - 2 ; <nl> + register int width ; <nl> + <nl> + keypoints . resize ( 0 ) ; <nl> + <nl> + int pixel_7_12s_ [ 16 ] ; <nl> + makeAgastOffsets ( pixel_7_12s_ , ( int ) img . step , AgastFeatureDetector : : AGAST_7_12s ) ; <nl> + <nl> + register short offset0 = ( short ) pixel_7_12s_ [ 0 ] ; <nl> + register short offset1 = ( short ) pixel_7_12s_ [ 1 ] ; <nl> + register short offset2 = ( short ) pixel_7_12s_ [ 2 ] ; <nl> + register short offset3 = ( short ) pixel_7_12s_ [ 3 ] ; <nl> + register short offset4 = ( short ) pixel_7_12s_ [ 4 ] ; <nl> + register short offset5 = ( short ) pixel_7_12s_ [ 5 ] ; <nl> + register short offset6 = ( short ) pixel_7_12s_ [ 6 ] ; <nl> + register short offset7 = ( short ) pixel_7_12s_ [ 7 ] ; <nl> + register short offset8 = ( short ) pixel_7_12s_ [ 8 ] ; <nl> + register short offset9 = ( short ) pixel_7_12s_ [ 9 ] ; <nl> + register short offset10 = ( short ) pixel_7_12s_ [ 10 ] ; <nl> + register short offset11 = ( short ) pixel_7_12s_ [ 11 ] ; <nl> + <nl> + width = xsize ; <nl> + <nl> + for ( y = 2 ; y < ysizeB ; y + + ) <nl> + { <nl> + x = 1 ; <nl> + while ( true ) <nl> + { <nl> + homogeneous : <nl> + { <nl> + x + + ; <nl> + if ( x > xsizeB ) <nl> + break ; <nl> + else <nl> + { <nl> + register const unsigned char * const ptr = img . ptr ( ) + y * width + x ; <nl> + register const int cb = * ptr + threshold ; <nl> + register const int c_b = * ptr - threshold ; <nl> + if ( ptr [ offset0 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset0 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + goto homogeneous ; <nl> + } <nl> + } <nl> + structured : <nl> + { <nl> + x + + ; <nl> + if ( x > xsizeB ) <nl> + break ; <nl> + else <nl> + { <nl> + register const unsigned char * const ptr = img . ptr ( ) + y * width + x ; <nl> + register const int cb = * ptr + threshold ; <nl> + register const int c_b = * ptr - threshold ; <nl> + if ( ptr [ offset0 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset0 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto success_structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto structured ; <nl> + else <nl> + goto homogeneous ; <nl> + } <nl> + } <nl> + success_homogeneous : <nl> + if ( total = = nExpectedCorners ) <nl> + { <nl> + if ( nExpectedCorners = = 0 ) <nl> + { <nl> + nExpectedCorners = 512 ; <nl> + keypoints . reserve ( nExpectedCorners ) ; <nl> + } <nl> + else <nl> + { <nl> + nExpectedCorners * = 2 ; <nl> + keypoints . reserve ( nExpectedCorners ) ; <nl> + } <nl> + } <nl> + keypoints . push_back ( KeyPoint ( Point2f ( ( float ) x , ( float ) y ) , 1 . 0f ) ) ; <nl> + total + + ; <nl> + goto homogeneous ; <nl> + success_structured : <nl> + if ( total = = nExpectedCorners ) <nl> + { <nl> + if ( nExpectedCorners = = 0 ) <nl> + { <nl> + nExpectedCorners = 512 ; <nl> + keypoints . reserve ( nExpectedCorners ) ; <nl> + } <nl> + else <nl> + { <nl> + nExpectedCorners * = 2 ; <nl> + keypoints . reserve ( nExpectedCorners ) ; <nl> + } <nl> + } <nl> + keypoints . push_back ( KeyPoint ( Point2f ( ( float ) x , ( float ) y ) , 1 . 0f ) ) ; <nl> + total + + ; <nl> + goto structured ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + static void OAST_9_16 ( InputArray _img , std : : vector < KeyPoint > & keypoints , int threshold ) <nl> + { <nl> + cv : : Mat img ; <nl> + if ( ! _img . getMat ( ) . isContinuous ( ) ) <nl> + img = _img . getMat ( ) . clone ( ) ; <nl> + else <nl> + img = _img . getMat ( ) ; <nl> + <nl> + size_t total = 0 ; <nl> + int xsize = img . cols ; <nl> + int ysize = img . rows ; <nl> + size_t nExpectedCorners = keypoints . capacity ( ) ; <nl> + register int x , y ; <nl> + register int xsizeB = xsize - 4 ; <nl> + register int ysizeB = ysize - 3 ; <nl> + register int width ; <nl> + <nl> + keypoints . resize ( 0 ) ; <nl> + <nl> + int pixel_9_16_ [ 16 ] ; <nl> + makeAgastOffsets ( pixel_9_16_ , ( int ) img . step , AgastFeatureDetector : : OAST_9_16 ) ; <nl> + <nl> + register short offset0 = ( short ) pixel_9_16_ [ 0 ] ; <nl> + register short offset1 = ( short ) pixel_9_16_ [ 1 ] ; <nl> + register short offset2 = ( short ) pixel_9_16_ [ 2 ] ; <nl> + register short offset3 = ( short ) pixel_9_16_ [ 3 ] ; <nl> + register short offset4 = ( short ) pixel_9_16_ [ 4 ] ; <nl> + register short offset5 = ( short ) pixel_9_16_ [ 5 ] ; <nl> + register short offset6 = ( short ) pixel_9_16_ [ 6 ] ; <nl> + register short offset7 = ( short ) pixel_9_16_ [ 7 ] ; <nl> + register short offset8 = ( short ) pixel_9_16_ [ 8 ] ; <nl> + register short offset9 = ( short ) pixel_9_16_ [ 9 ] ; <nl> + register short offset10 = ( short ) pixel_9_16_ [ 10 ] ; <nl> + register short offset11 = ( short ) pixel_9_16_ [ 11 ] ; <nl> + register short offset12 = ( short ) pixel_9_16_ [ 12 ] ; <nl> + register short offset13 = ( short ) pixel_9_16_ [ 13 ] ; <nl> + register short offset14 = ( short ) pixel_9_16_ [ 14 ] ; <nl> + register short offset15 = ( short ) pixel_9_16_ [ 15 ] ; <nl> + <nl> + width = xsize ; <nl> + <nl> + for ( y = 3 ; y < ysizeB ; y + + ) <nl> + { <nl> + x = 2 ; <nl> + while ( true ) <nl> + { <nl> + x + + ; <nl> + if ( x > xsizeB ) <nl> + break ; <nl> + else <nl> + { <nl> + register const unsigned char * const ptr = img . ptr ( ) + y * width + x ; <nl> + register const int cb = * ptr + threshold ; <nl> + register const int c_b = * ptr - threshold ; <nl> + if ( ptr [ offset0 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset13 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset13 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset0 ] < c_b ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset14 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + { } / / goto success_homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + else <nl> + continue ; / / goto homogeneous ; <nl> + } <nl> + if ( total = = nExpectedCorners ) <nl> + { <nl> + if ( nExpectedCorners = = 0 ) <nl> + { <nl> + nExpectedCorners = 512 ; <nl> + keypoints . reserve ( nExpectedCorners ) ; <nl> + } <nl> + else <nl> + { <nl> + nExpectedCorners * = 2 ; <nl> + keypoints . reserve ( nExpectedCorners ) ; <nl> + } <nl> + } <nl> + keypoints . push_back ( KeyPoint ( Point2f ( ( float ) x , ( float ) y ) , 1 . 0f ) ) ; <nl> + total + + ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + <nl> + void AGAST ( InputArray _img , std : : vector < KeyPoint > & keypoints , int threshold , bool nonmax_suppression ) <nl> + { <nl> + AGAST ( _img , keypoints , threshold , nonmax_suppression , AgastFeatureDetector : : OAST_9_16 ) ; <nl> + } <nl> + <nl> + <nl> + class AgastFeatureDetector_Impl : public AgastFeatureDetector <nl> + { <nl> + public : <nl> + AgastFeatureDetector_Impl ( int _threshold , bool _nonmaxSuppression , int _type ) <nl> + : threshold ( _threshold ) , nonmaxSuppression ( _nonmaxSuppression ) , type ( ( short ) _type ) <nl> + { } <nl> + <nl> + void detect ( InputArray _image , std : : vector < KeyPoint > & keypoints , InputArray _mask ) <nl> + { <nl> + Mat mask = _mask . getMat ( ) , grayImage ; <nl> + UMat ugrayImage ; <nl> + _InputArray gray = _image ; <nl> + if ( _image . type ( ) ! = CV_8U ) <nl> + { <nl> + _OutputArray ogray = _image . isUMat ( ) ? _OutputArray ( ugrayImage ) : _OutputArray ( grayImage ) ; <nl> + cvtColor ( _image , ogray , COLOR_BGR2GRAY ) ; <nl> + gray = ogray ; <nl> + } <nl> + AGAST ( gray , keypoints , threshold , nonmaxSuppression , type ) ; <nl> + KeyPointsFilter : : runByPixelsMask ( keypoints , mask ) ; <nl> + } <nl> + <nl> + void set ( int prop , double value ) <nl> + { <nl> + if ( prop = = THRESHOLD ) <nl> + threshold = cvRound ( value ) ; <nl> + else if ( prop = = NONMAX_SUPPRESSION ) <nl> + nonmaxSuppression = value ! = 0 ; <nl> + else <nl> + CV_Error ( Error : : StsBadArg , " " ) ; <nl> + } <nl> + <nl> + double get ( int prop ) const <nl> + { <nl> + if ( prop = = THRESHOLD ) <nl> + return threshold ; <nl> + if ( prop = = NONMAX_SUPPRESSION ) <nl> + return nonmaxSuppression ; <nl> + CV_Error ( Error : : StsBadArg , " " ) ; <nl> + return 0 ; <nl> + } <nl> + <nl> + void setThreshold ( int threshold_ ) { threshold = threshold_ ; } <nl> + int getThreshold ( ) const { return threshold ; } <nl> + <nl> + void setNonmaxSuppression ( bool f ) { nonmaxSuppression = f ; } <nl> + bool getNonmaxSuppression ( ) const { return nonmaxSuppression ; } <nl> + <nl> + void setType ( int type_ ) { type = type_ ; } <nl> + int getType ( ) const { return type ; } <nl> + <nl> + int threshold ; <nl> + bool nonmaxSuppression ; <nl> + int type ; <nl> + } ; <nl> + <nl> + Ptr < AgastFeatureDetector > AgastFeatureDetector : : create ( int threshold , bool nonmaxSuppression , int type ) <nl> + { <nl> + return makePtr < AgastFeatureDetector_Impl > ( threshold , nonmaxSuppression , type ) ; <nl> + } <nl> + <nl> + void AGAST ( InputArray _img , std : : vector < KeyPoint > & keypoints , int threshold , bool nonmax_suppression , int type ) <nl> + { <nl> + <nl> + std : : vector < KeyPoint > kpts ; <nl> + <nl> + / / detect <nl> + switch ( type ) { <nl> + case AgastFeatureDetector : : AGAST_5_8 : <nl> + AGAST_5_8 ( _img , kpts , threshold ) ; <nl> + break ; <nl> + case AgastFeatureDetector : : AGAST_7_12d : <nl> + AGAST_7_12d ( _img , kpts , threshold ) ; <nl> + break ; <nl> + case AgastFeatureDetector : : AGAST_7_12s : <nl> + AGAST_7_12s ( _img , kpts , threshold ) ; <nl> + break ; <nl> + case AgastFeatureDetector : : OAST_9_16 : <nl> + OAST_9_16 ( _img , kpts , threshold ) ; <nl> + break ; <nl> + } <nl> + <nl> + cv : : Mat img = _img . getMat ( ) ; <nl> + <nl> + / / score <nl> + int pixel_ [ 16 ] ; <nl> + makeAgastOffsets ( pixel_ , ( int ) img . step , type ) ; <nl> + <nl> + std : : vector < KeyPoint > : : iterator kpt ; <nl> + for ( kpt = kpts . begin ( ) ; kpt ! = kpts . end ( ) ; kpt + + ) <nl> + { <nl> + switch ( type ) { <nl> + case AgastFeatureDetector : : AGAST_5_8 : <nl> + kpt - > response = ( float ) agast_cornerScore < AgastFeatureDetector : : AGAST_5_8 > <nl> + ( & img . at < uchar > ( ( int ) kpt - > pt . y , ( int ) kpt - > pt . x ) , pixel_ , threshold ) ; <nl> + break ; <nl> + case AgastFeatureDetector : : AGAST_7_12d : <nl> + kpt - > response = ( float ) agast_cornerScore < AgastFeatureDetector : : AGAST_7_12d > <nl> + ( & img . at < uchar > ( ( int ) kpt - > pt . y , ( int ) kpt - > pt . x ) , pixel_ , threshold ) ; <nl> + break ; <nl> + case AgastFeatureDetector : : AGAST_7_12s : <nl> + kpt - > response = ( float ) agast_cornerScore < AgastFeatureDetector : : AGAST_7_12s > <nl> + ( & img . at < uchar > ( ( int ) kpt - > pt . y , ( int ) kpt - > pt . x ) , pixel_ , threshold ) ; <nl> + break ; <nl> + case AgastFeatureDetector : : OAST_9_16 : <nl> + kpt - > response = ( float ) agast_cornerScore < AgastFeatureDetector : : OAST_9_16 > <nl> + ( & img . at < uchar > ( ( int ) kpt - > pt . y , ( int ) kpt - > pt . x ) , pixel_ , threshold ) ; <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + / / suppression <nl> + if ( nonmax_suppression ) <nl> + { <nl> + size_t j ; <nl> + size_t curr_idx ; <nl> + size_t lastRow = 0 , next_lastRow = 0 ; <nl> + size_t num_Corners = kpts . size ( ) ; <nl> + size_t lastRowCorner_ind = 0 , next_lastRowCorner_ind = 0 ; <nl> + <nl> + std : : vector < int > nmsFlags ; <nl> + std : : vector < KeyPoint > : : iterator currCorner_nms ; <nl> + std : : vector < KeyPoint > : : const_iterator currCorner ; <nl> + <nl> + currCorner = kpts . begin ( ) ; <nl> + <nl> + nmsFlags . resize ( ( int ) num_Corners ) ; <nl> + <nl> + / / set all flags to MAXIMUM <nl> + for ( j = 0 ; j < num_Corners ; j + + ) <nl> + nmsFlags [ j ] = - 1 ; <nl> + <nl> + for ( curr_idx = 0 ; curr_idx < num_Corners ; curr_idx + + ) <nl> + { <nl> + int t ; <nl> + / / check above <nl> + if ( lastRow + 1 < currCorner - > pt . y ) <nl> + { <nl> + lastRow = next_lastRow ; <nl> + lastRowCorner_ind = next_lastRowCorner_ind ; <nl> + } <nl> + if ( next_lastRow ! = currCorner - > pt . y ) <nl> + { <nl> + next_lastRow = ( size_t ) currCorner - > pt . y ; <nl> + next_lastRowCorner_ind = curr_idx ; <nl> + } <nl> + if ( lastRow + 1 = = currCorner - > pt . y ) <nl> + { <nl> + / / find the corner above the current one <nl> + while ( ( kpts [ lastRowCorner_ind ] . pt . x < currCorner - > pt . x ) <nl> + & & ( kpts [ lastRowCorner_ind ] . pt . y = = lastRow ) ) <nl> + lastRowCorner_ind + + ; <nl> + <nl> + if ( ( kpts [ lastRowCorner_ind ] . pt . x = = currCorner - > pt . x ) <nl> + & & ( lastRowCorner_ind ! = curr_idx ) ) <nl> + { <nl> + size_t w = lastRowCorner_ind ; <nl> + / / find the maximum in this block <nl> + while ( nmsFlags [ w ] ! = - 1 ) <nl> + w = nmsFlags [ w ] ; <nl> + <nl> + if ( kpts [ curr_idx ] . response < kpts [ w ] . response ) <nl> + nmsFlags [ curr_idx ] = ( int ) w ; <nl> + else <nl> + nmsFlags [ w ] = ( int ) curr_idx ; <nl> + } <nl> + } <nl> + <nl> + / / check left <nl> + t = ( int ) curr_idx - 1 ; <nl> + if ( ( curr_idx ! = 0 ) & & ( kpts [ t ] . pt . y = = currCorner - > pt . y ) <nl> + & & ( kpts [ t ] . pt . x + 1 = = currCorner - > pt . x ) ) <nl> + { <nl> + int currCornerMaxAbove_ind = nmsFlags [ curr_idx ] ; <nl> + / / find the maximum in that area <nl> + while ( nmsFlags [ t ] ! = - 1 ) <nl> + t = nmsFlags [ t ] ; <nl> + / / no maximum above <nl> + if ( currCornerMaxAbove_ind = = - 1 ) <nl> + { <nl> + if ( ( size_t ) t ! = curr_idx ) <nl> + { <nl> + if ( kpts [ curr_idx ] . response < kpts [ t ] . response ) <nl> + nmsFlags [ curr_idx ] = t ; <nl> + else <nl> + nmsFlags [ t ] = ( int ) curr_idx ; <nl> + } <nl> + } <nl> + else / / maximum above <nl> + { <nl> + if ( t ! = currCornerMaxAbove_ind ) <nl> + { <nl> + if ( kpts [ currCornerMaxAbove_ind ] . response < kpts [ t ] . response ) <nl> + { <nl> + nmsFlags [ currCornerMaxAbove_ind ] = t ; <nl> + nmsFlags [ curr_idx ] = t ; <nl> + } <nl> + else <nl> + { <nl> + nmsFlags [ t ] = currCornerMaxAbove_ind ; <nl> + nmsFlags [ curr_idx ] = currCornerMaxAbove_ind ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + currCorner + + ; <nl> + } <nl> + <nl> + / / collecting maximum corners <nl> + for ( curr_idx = 0 ; curr_idx < num_Corners ; curr_idx + + ) <nl> + { <nl> + if ( nmsFlags [ curr_idx ] = = - 1 ) <nl> + keypoints . push_back ( kpts [ curr_idx ] ) ; <nl> + } <nl> + } else <nl> + { <nl> + keypoints = kpts ; <nl> + } <nl> + } <nl> + <nl> + } / / END NAMESPACE CV <nl> new file mode 100644 <nl> index 00000000000 . . baca9b07c57 <nl> mmm / dev / null <nl> ppp b / modules / features2d / doc / agast_score . txt <nl> <nl> + / * This is AGAST and OAST , an optimal and accelerated corner detector <nl> + based on the accelerated segment tests <nl> + Below is the original copyright and the references * / <nl> + <nl> + / * <nl> + Copyright ( C ) 2010 Elmar Mair <nl> + All rights reserved . <nl> + <nl> + Redistribution and use in source and binary forms , with or without <nl> + modification , are permitted provided that the following conditions <nl> + are met : <nl> + <nl> + * Redistributions of source code must retain the above copyright <nl> + notice , this list of conditions and the following disclaimer . <nl> + <nl> + * Redistributions in binary form must reproduce the above copyright <nl> + notice , this list of conditions and the following disclaimer in the <nl> + documentation and / or other materials provided with the distribution . <nl> + <nl> + * Neither the name of the University of Cambridge nor the names of <nl> + its contributors may be used to endorse or promote products derived <nl> + from this software without specific prior written permission . <nl> + <nl> + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR <nl> + CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , <nl> + EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED TO , <nl> + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , DATA , OR <nl> + PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF <nl> + LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING <nl> + NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF THIS <nl> + SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * / <nl> + <nl> + / * <nl> + The references are : <nl> + * Adaptive and Generic Corner Detection Based on the Accelerated Segment Test , <nl> + Elmar Mair and Gregory D . Hager and Darius Burschka <nl> + and Michael Suppa and Gerhard Hirzinger ECCV 2010 <nl> + URL : http : / / www6 . in . tum . de / Main / ResearchAgast <nl> + * / <nl> + <nl> + # include " agast_score . hpp " <nl> + <nl> + # ifdef _MSC_VER <nl> + # pragma warning ( disable : 4127 ) <nl> + # endif <nl> + <nl> + namespace cv <nl> + { <nl> + <nl> + void makeAgastOffsets ( int pixel [ 16 ] , int rowStride , int type ) <nl> + { <nl> + static const int offsets16 [ ] [ 2 ] = <nl> + { <nl> + { - 3 , 0 } , { - 3 , - 1 } , { - 2 , - 2 } , { - 1 , - 3 } , { 0 , - 3 } , { 1 , - 3 } , { 2 , - 2 } , { 3 , - 1 } , <nl> + { 3 , 0 } , { 3 , 1 } , { 2 , 2 } , { 1 , 3 } , { 0 , 3 } , { - 1 , 3 } , { - 2 , 2 } , { - 3 , 1 } <nl> + } ; <nl> + <nl> + static const int offsets12d [ ] [ 2 ] = <nl> + { <nl> + { - 3 , 0 } , { - 2 , - 1 } , { - 1 , - 2 } , { 0 , - 3 } , { 1 , - 2 } , { 2 , - 1 } , <nl> + { 3 , 0 } , { 2 , 1 } , { 1 , 2 } , { 0 , 3 } , { - 1 , 2 } , { - 2 , 1 } <nl> + } ; <nl> + <nl> + static const int offsets12s [ ] [ 2 ] = <nl> + { <nl> + { - 2 , 0 } , { - 2 , - 1 } , { - 1 , - 2 } , { 0 , - 2 } , { 1 , - 2 } , { 2 , - 1 } , <nl> + { 2 , 0 } , { 2 , 1 } , { 1 , 2 } , { 0 , 2 } , { - 1 , 2 } , { - 2 , 1 } <nl> + } ; <nl> + <nl> + static const int offsets8 [ ] [ 2 ] = <nl> + { <nl> + { - 1 , 0 } , { - 1 , - 1 } , { 0 , - 1 } , { 1 , - 1 } , <nl> + { 1 , 0 } , { 1 , 1 } , { 0 , 1 } , { - 1 , 1 } <nl> + } ; <nl> + <nl> + const int ( * offsets ) [ 2 ] = type = = AgastFeatureDetector : : OAST_9_16 ? offsets16 : <nl> + type = = AgastFeatureDetector : : AGAST_7_12d ? offsets12d : <nl> + type = = AgastFeatureDetector : : AGAST_7_12s ? offsets12s : <nl> + type = = AgastFeatureDetector : : AGAST_5_8 ? offsets8 : 0 ; <nl> + <nl> + CV_Assert ( pixel & & offsets ) ; <nl> + <nl> + int k = 0 ; <nl> + for ( ; k < 16 ; k + + ) <nl> + pixel [ k ] = offsets [ k ] [ 0 ] + offsets [ k ] [ 1 ] * rowStride ; <nl> + } <nl> + <nl> + / / 16 pixel mask <nl> + template < > <nl> + int agast_cornerScore < AgastFeatureDetector : : OAST_9_16 > ( const uchar * ptr , const int pixel [ ] , int threshold ) <nl> + { <nl> + int bmin = threshold ; <nl> + int bmax = 255 ; <nl> + int b_test = ( bmax + bmin ) / 2 ; <nl> + <nl> + register short offset0 = ( short ) pixel [ 0 ] ; <nl> + register short offset1 = ( short ) pixel [ 1 ] ; <nl> + register short offset2 = ( short ) pixel [ 2 ] ; <nl> + register short offset3 = ( short ) pixel [ 3 ] ; <nl> + register short offset4 = ( short ) pixel [ 4 ] ; <nl> + register short offset5 = ( short ) pixel [ 5 ] ; <nl> + register short offset6 = ( short ) pixel [ 6 ] ; <nl> + register short offset7 = ( short ) pixel [ 7 ] ; <nl> + register short offset8 = ( short ) pixel [ 8 ] ; <nl> + register short offset9 = ( short ) pixel [ 9 ] ; <nl> + register short offset10 = ( short ) pixel [ 10 ] ; <nl> + register short offset11 = ( short ) pixel [ 11 ] ; <nl> + register short offset12 = ( short ) pixel [ 12 ] ; <nl> + register short offset13 = ( short ) pixel [ 13 ] ; <nl> + register short offset14 = ( short ) pixel [ 14 ] ; <nl> + register short offset15 = ( short ) pixel [ 15 ] ; <nl> + <nl> + while ( true ) <nl> + { <nl> + register const int cb = * ptr + b_test ; <nl> + register const int c_b = * ptr - b_test ; <nl> + if ( ptr [ offset0 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset13 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset13 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset0 ] < c_b ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset14 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset12 ] > cb ) <nl> + if ( ptr [ offset13 ] > cb ) <nl> + if ( ptr [ offset14 ] > cb ) <nl> + if ( ptr [ offset15 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset12 ] < c_b ) <nl> + if ( ptr [ offset13 ] < c_b ) <nl> + if ( ptr [ offset14 ] < c_b ) <nl> + if ( ptr [ offset15 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + <nl> + is_a_corner : <nl> + bmin = b_test ; <nl> + goto end ; <nl> + <nl> + is_not_a_corner : <nl> + bmax = b_test ; <nl> + goto end ; <nl> + <nl> + end : <nl> + <nl> + if ( bmin = = bmax - 1 | | bmin = = bmax ) <nl> + return bmin ; <nl> + b_test = ( bmin + bmax ) / 2 ; <nl> + } <nl> + } <nl> + <nl> + / / 12 pixel mask in diamond format <nl> + template < > <nl> + int agast_cornerScore < AgastFeatureDetector : : AGAST_7_12d > ( const uchar * ptr , const int pixel [ ] , int threshold ) <nl> + { <nl> + int bmin = threshold ; <nl> + int bmax = 255 ; <nl> + int b_test = ( bmax + bmin ) / 2 ; <nl> + <nl> + register short offset0 = ( short ) pixel [ 0 ] ; <nl> + register short offset1 = ( short ) pixel [ 1 ] ; <nl> + register short offset2 = ( short ) pixel [ 2 ] ; <nl> + register short offset3 = ( short ) pixel [ 3 ] ; <nl> + register short offset4 = ( short ) pixel [ 4 ] ; <nl> + register short offset5 = ( short ) pixel [ 5 ] ; <nl> + register short offset6 = ( short ) pixel [ 6 ] ; <nl> + register short offset7 = ( short ) pixel [ 7 ] ; <nl> + register short offset8 = ( short ) pixel [ 8 ] ; <nl> + register short offset9 = ( short ) pixel [ 9 ] ; <nl> + register short offset10 = ( short ) pixel [ 10 ] ; <nl> + register short offset11 = ( short ) pixel [ 11 ] ; <nl> + <nl> + while ( true ) <nl> + { <nl> + register const int cb = * ptr + b_test ; <nl> + register const int c_b = * ptr - b_test ; <nl> + if ( ptr [ offset0 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset0 ] < c_b ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + <nl> + is_a_corner : <nl> + bmin = b_test ; <nl> + goto end ; <nl> + <nl> + is_not_a_corner : <nl> + bmax = b_test ; <nl> + goto end ; <nl> + <nl> + end : <nl> + <nl> + if ( bmin = = bmax - 1 | | bmin = = bmax ) <nl> + return bmin ; <nl> + b_test = ( bmin + bmax ) / 2 ; <nl> + } <nl> + } <nl> + <nl> + / / 12 pixel mask in square format <nl> + template < > <nl> + int agast_cornerScore < AgastFeatureDetector : : AGAST_7_12s > ( const uchar * ptr , const int pixel [ ] , int threshold ) <nl> + { <nl> + int bmin = threshold ; <nl> + int bmax = 255 ; <nl> + int b_test = ( bmax + bmin ) / 2 ; <nl> + <nl> + register short offset0 = ( short ) pixel [ 0 ] ; <nl> + register short offset1 = ( short ) pixel [ 1 ] ; <nl> + register short offset2 = ( short ) pixel [ 2 ] ; <nl> + register short offset3 = ( short ) pixel [ 3 ] ; <nl> + register short offset4 = ( short ) pixel [ 4 ] ; <nl> + register short offset5 = ( short ) pixel [ 5 ] ; <nl> + register short offset6 = ( short ) pixel [ 6 ] ; <nl> + register short offset7 = ( short ) pixel [ 7 ] ; <nl> + register short offset8 = ( short ) pixel [ 8 ] ; <nl> + register short offset9 = ( short ) pixel [ 9 ] ; <nl> + register short offset10 = ( short ) pixel [ 10 ] ; <nl> + register short offset11 = ( short ) pixel [ 11 ] ; <nl> + <nl> + while ( true ) <nl> + { <nl> + register const int cb = * ptr + b_test ; <nl> + register const int c_b = * ptr - b_test ; <nl> + if ( ptr [ offset0 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset0 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset8 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] < c_b ) <nl> + if ( ptr [ offset11 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset9 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset8 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset10 ] > cb ) <nl> + if ( ptr [ offset11 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + <nl> + is_a_corner : <nl> + bmin = b_test ; <nl> + goto end ; <nl> + <nl> + is_not_a_corner : <nl> + bmax = b_test ; <nl> + goto end ; <nl> + <nl> + end : <nl> + <nl> + if ( bmin = = bmax - 1 | | bmin = = bmax ) <nl> + return bmin ; <nl> + b_test = ( bmin + bmax ) / 2 ; <nl> + } <nl> + } <nl> + <nl> + / / 8 pixel mask <nl> + template < > <nl> + int agast_cornerScore < AgastFeatureDetector : : AGAST_5_8 > ( const uchar * ptr , const int pixel [ ] , int threshold ) <nl> + { <nl> + int bmin = threshold ; <nl> + int bmax = 255 ; <nl> + int b_test = ( bmax + bmin ) / 2 ; <nl> + <nl> + register short offset0 = ( short ) pixel [ 0 ] ; <nl> + register short offset1 = ( short ) pixel [ 1 ] ; <nl> + register short offset2 = ( short ) pixel [ 2 ] ; <nl> + register short offset3 = ( short ) pixel [ 3 ] ; <nl> + register short offset4 = ( short ) pixel [ 4 ] ; <nl> + register short offset5 = ( short ) pixel [ 5 ] ; <nl> + register short offset6 = ( short ) pixel [ 6 ] ; <nl> + register short offset7 = ( short ) pixel [ 7 ] ; <nl> + <nl> + while ( true ) <nl> + { <nl> + register const int cb = * ptr + b_test ; <nl> + register const int c_b = * ptr - b_test ; <nl> + if ( ptr [ offset0 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset0 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] > cb ) <nl> + if ( ptr [ offset5 ] > cb ) <nl> + if ( ptr [ offset2 ] > cb ) <nl> + if ( ptr [ offset1 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] > cb ) <nl> + if ( ptr [ offset4 ] > cb ) <nl> + if ( ptr [ offset6 ] > cb ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset3 ] < c_b ) <nl> + if ( ptr [ offset5 ] < c_b ) <nl> + if ( ptr [ offset2 ] < c_b ) <nl> + if ( ptr [ offset1 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + if ( ptr [ offset7 ] < c_b ) <nl> + if ( ptr [ offset4 ] < c_b ) <nl> + if ( ptr [ offset6 ] < c_b ) <nl> + goto is_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + else <nl> + goto is_not_a_corner ; <nl> + <nl> + is_a_corner : <nl> + bmin = b_test ; <nl> + goto end ; <nl> + <nl> + is_not_a_corner : <nl> + bmax = b_test ; <nl> + goto end ; <nl> + <nl> + end : <nl> + <nl> + if ( bmin = = bmax - 1 | | bmin = = bmax ) <nl> + return bmin ; <nl> + b_test = ( bmin + bmax ) / 2 ; <nl> + } <nl> + } <nl> + <nl> + } / / namespace cv <nl> new file mode 100644 <nl> index 00000000000 . . 6f1b420ecbe <nl> mmm / dev / null <nl> ppp b / modules / features2d / doc / read_file_nondiff32 . pl <nl> <nl> + # ! / usr / bin / perl <nl> + use strict ; <nl> + use warnings ; <nl> + use autodie ; # die if problem reading or writing a file <nl> + <nl> + my $ filein = " . / agast . txt " ; <nl> + my $ fileout = " . / agast_new . txt " ; <nl> + my $ i1 = 1 ; <nl> + my $ i2 = 1 ; <nl> + my $ i3 = 1 ; <nl> + my $ tmp ; <nl> + my $ ifcount0 = 0 ; <nl> + my $ ifcount1 = 0 ; <nl> + my $ ifcount2 = 0 ; <nl> + my $ ifcount3 = 0 ; <nl> + my $ ifcount4 = 0 ; <nl> + my $ elsecount ; <nl> + my $ myfirstline = $ ARGV [ 0 ] ; <nl> + my $ mylastline = $ ARGV [ 1 ] ; <nl> + my $ tablename = $ ARGV [ 2 ] ; <nl> + my @ array0 = ( ) ; <nl> + my @ array1 = ( ) ; <nl> + my @ array2 = ( ) ; <nl> + my @ array3 = ( ) ; <nl> + my $ homogeneous ; <nl> + my $ success_homogeneous ; <nl> + my $ structured ; <nl> + my $ success_structured ; <nl> + <nl> + open ( my $ in1 , " < " , $ filein ) or die " Can ' t open $ filein : $ ! " ; <nl> + open ( my $ out , " > " , $ fileout ) or die " Can ' t open $ fileout : $ ! " ; <nl> + <nl> + <nl> + $ array0 [ 0 ] = 0 ; <nl> + $ i1 = 1 ; <nl> + while ( my $ line1 = < $ in1 > ) <nl> + { <nl> + chomp $ line1 ; <nl> + $ array0 [ $ i1 ] = 0 ; <nl> + if ( ( $ i1 > = $ myfirstline ) & & ( $ i1 < = $ mylastline ) ) <nl> + { <nl> + if ( $ line1 = ~ / if \ ( ptr \ [ offset ( \ d + ) / ) <nl> + { <nl> + if ( $ line1 = ~ / if \ ( ptr \ [ offset ( \ d + ) . * \ > . * cb / ) <nl> + { <nl> + $ tmp = $ 1 ; <nl> + } <nl> + else <nl> + { <nl> + if ( $ line1 = ~ / if \ ( ptr \ [ offset ( \ d + ) . * \ < . * c \ _b / ) <nl> + { <nl> + $ tmp = $ 1 + 128 ; <nl> + } <nl> + else <nl> + { <nl> + die " invalid array index ! " <nl> + } <nl> + } <nl> + $ array1 [ $ ifcount1 ] = $ tmp ; <nl> + $ array0 [ $ ifcount1 ] = $ i1 ; <nl> + $ ifcount1 + + ; <nl> + } <nl> + else <nl> + { <nl> + } <nl> + } <nl> + $ i1 + + ; <nl> + } <nl> + $ homogeneous = $ ifcount1 ; <nl> + $ success_homogeneous = $ ifcount1 + 1 ; <nl> + $ structured = $ ifcount1 + 2 ; <nl> + $ success_structured = $ ifcount1 + 3 ; <nl> + <nl> + close $ in1 or die " Can ' t close $ filein : $ ! " ; <nl> + <nl> + open ( $ in1 , " < " , $ filein ) or die " Can ' t open $ filein : $ ! " ; <nl> + <nl> + <nl> + $ i1 = 1 ; <nl> + while ( my $ line1 = < $ in1 > ) <nl> + { <nl> + chomp $ line1 ; <nl> + if ( ( $ i1 > = $ myfirstline ) & & ( $ i1 < = $ mylastline ) ) <nl> + { <nl> + if ( $ array0 [ $ ifcount2 ] = = $ i1 ) <nl> + { <nl> + $ array2 [ $ ifcount2 ] = 0 ; <nl> + $ array3 [ $ ifcount2 ] = 0 ; <nl> + if ( $ array0 [ $ ifcount2 + 1 ] = = ( $ i1 + 1 ) ) <nl> + { <nl> + $ array2 [ $ ifcount2 ] = ( $ ifcount2 + 1 ) ; <nl> + } <nl> + else <nl> + { <nl> + open ( my $ in2 , " < " , $ filein ) or die " Can ' t open $ filein : $ ! " ; <nl> + $ i2 = 1 ; <nl> + while ( my $ line2 = < $ in2 > ) <nl> + { <nl> + chomp $ line2 ; <nl> + if ( $ i2 = = $ i1 ) <nl> + { <nl> + last ; <nl> + } <nl> + $ i2 + + ; <nl> + } <nl> + my $ line2 = < $ in2 > ; <nl> + chomp $ line2 ; <nl> + if ( $ line2 = ~ / goto ( \ w + ) / ) <nl> + { <nl> + $ tmp = $ 1 ; <nl> + if ( $ tmp eq " homogeneous " ) <nl> + { <nl> + $ array2 [ $ ifcount2 ] = $ homogeneous ; <nl> + } <nl> + if ( $ tmp eq " success_homogeneous " ) <nl> + { <nl> + $ array2 [ $ ifcount2 ] = $ success_homogeneous ; <nl> + } <nl> + if ( $ tmp eq " structured " ) <nl> + { <nl> + $ array2 [ $ ifcount2 ] = $ structured ; <nl> + } <nl> + if ( $ tmp eq " success_structured " ) <nl> + { <nl> + $ array2 [ $ ifcount2 ] = $ success_structured ; <nl> + } <nl> + } <nl> + else <nl> + { <nl> + die " goto expected : $ ! " ; <nl> + } <nl> + close $ in2 or die " Can ' t close $ filein : $ ! " ; <nl> + } <nl> + # find next else and interprete it <nl> + open ( my $ in3 , " < " , $ filein ) or die " Can ' t open $ filein : $ ! " ; <nl> + $ i3 = 1 ; <nl> + $ ifcount3 = 0 ; <nl> + $ elsecount = 0 ; <nl> + while ( my $ line3 = < $ in3 > ) <nl> + { <nl> + chomp $ line3 ; <nl> + $ i3 + + ; <nl> + if ( $ i3 = = $ i1 ) <nl> + { <nl> + last ; <nl> + } <nl> + } <nl> + while ( my $ line3 = < $ in3 > ) <nl> + { <nl> + chomp $ line3 ; <nl> + $ ifcount3 + + ; <nl> + if ( ( $ elsecount = = 0 ) & & ( $ i3 > $ i1 ) ) <nl> + { <nl> + if ( $ line3 = ~ / goto ( \ w + ) / ) <nl> + { <nl> + $ tmp = $ 1 ; <nl> + if ( $ tmp eq " homogeneous " ) <nl> + { <nl> + $ array3 [ $ ifcount2 ] = $ homogeneous ; <nl> + } <nl> + if ( $ tmp eq " success_homogeneous " ) <nl> + { <nl> + $ array3 [ $ ifcount2 ] = $ success_homogeneous ; <nl> + } <nl> + if ( $ tmp eq " structured " ) <nl> + { <nl> + $ array3 [ $ ifcount2 ] = $ structured ; <nl> + } <nl> + if ( $ tmp eq " success_structured " ) <nl> + { <nl> + $ array3 [ $ ifcount2 ] = $ success_structured ; <nl> + } <nl> + } <nl> + else <nl> + { <nl> + if ( $ line3 = ~ / if \ ( ptr \ [ offset / ) <nl> + { <nl> + $ ifcount4 = 0 ; <nl> + while ( $ array0 [ $ ifcount4 ] ! = $ i3 ) <nl> + { <nl> + $ ifcount4 + + ; <nl> + if ( $ ifcount4 = = $ ifcount1 ) <nl> + { <nl> + die " if else match expected : $ ! " ; <nl> + } <nl> + $ array3 [ $ ifcount2 ] = $ ifcount4 ; <nl> + } <nl> + } <nl> + else <nl> + { <nl> + die " elseif or elsegoto match expected : $ ! " ; <nl> + } <nl> + } <nl> + last ; <nl> + } <nl> + else <nl> + { <nl> + if ( $ line3 = ~ / if \ ( ptr \ [ offset / ) <nl> + { <nl> + $ elsecount + + ; <nl> + } <nl> + else <nl> + { <nl> + if ( $ line3 = ~ / else / ) <nl> + { <nl> + $ elsecount - - ; <nl> + } <nl> + } <nl> + } <nl> + $ i3 + + ; <nl> + } <nl> + printf ( " % 3d [ % 3d ] [ 0x % 08x ] \ n " , $ array0 [ $ ifcount2 ] , $ ifcount2 , ( ( $ array1 [ $ ifcount2 ] & 15 ) < < 28 ) | ( $ array2 [ $ ifcount2 ] < < 16 ) | ( ( $ array1 [ $ ifcount2 ] & 128 ) < < 5 ) | ( $ array3 [ $ ifcount2 ] ) ) ; <nl> + close $ in3 or die " Can ' t close $ filein : $ ! " ; <nl> + $ ifcount2 + + ; <nl> + } <nl> + else <nl> + { <nl> + } <nl> + } <nl> + $ i1 + + ; <nl> + } <nl> + <nl> + printf ( " [ % 3d ] [ 0x % 08x ] \ n " , $ homogeneous , 252 ) ; <nl> + printf ( " [ % 3d ] [ 0x % 08x ] \ n " , $ success_homogeneous , 253 ) ; <nl> + printf ( " [ % 3d ] [ 0x % 08x ] \ n " , $ structured , 254 ) ; <nl> + printf ( " [ % 3d ] [ 0x % 08x ] \ n " , $ success_structured , 255 ) ; <nl> + <nl> + close $ in1 or die " Can ' t close $ filein : $ ! " ; <nl> + <nl> + $ ifcount0 = 0 ; <nl> + $ ifcount2 = 0 ; <nl> + printf $ out " static const unsigned long % s [ ] = { \ n " , $ tablename ; <nl> + while ( $ ifcount0 < $ ifcount1 ) <nl> + { <nl> + printf $ out " 0x % 08x , " , ( ( $ array1 [ $ ifcount0 ] & 15 ) < < 28 ) | ( $ array2 [ $ ifcount0 ] < < 16 ) | ( ( $ array1 [ $ ifcount0 ] & 128 ) < < 5 ) | ( $ array3 [ $ ifcount0 ] ) ; <nl> + <nl> + $ ifcount0 + + ; <nl> + $ ifcount2 + + ; <nl> + if ( $ ifcount2 = = 8 ) <nl> + { <nl> + $ ifcount2 = 0 ; <nl> + printf $ out " \ n " ; <nl> + printf $ out " " ; <nl> + } <nl> + <nl> + } <nl> + printf $ out " 0x % 08x , " , 252 ; <nl> + $ ifcount0 + + ; <nl> + $ ifcount2 + + ; <nl> + if ( $ ifcount2 = = 8 ) <nl> + { <nl> + $ ifcount2 = 0 ; <nl> + printf $ out " \ n " ; <nl> + printf $ out " " ; <nl> + } <nl> + printf $ out " 0x % 08x , " , 253 ; <nl> + $ ifcount0 + + ; <nl> + $ ifcount2 + + ; <nl> + if ( $ ifcount2 = = 8 ) <nl> + { <nl> + $ ifcount2 = 0 ; <nl> + printf $ out " \ n " ; <nl> + printf $ out " " ; <nl> + } <nl> + printf $ out " 0x % 08x , " , 254 ; <nl> + $ ifcount0 + + ; <nl> + $ ifcount2 + + ; <nl> + if ( $ ifcount2 = = 8 ) <nl> + { <nl> + $ ifcount2 = 0 ; <nl> + printf $ out " \ n " ; <nl> + printf $ out " " ; <nl> + } <nl> + printf $ out " 0x % 08x \ n " , 255 ; <nl> + $ ifcount0 + + ; <nl> + $ ifcount2 + + ; <nl> + printf $ out " } ; \ n \ n " ; <nl> + <nl> + $ # array0 = - 1 ; <nl> + $ # array1 = - 1 ; <nl> + $ # array2 = - 1 ; <nl> + $ # array3 = - 1 ; <nl> + <nl> + close $ out or die " Can ' t close $ fileout : $ ! " ; <nl> new file mode 100644 <nl> index 00000000000 . . c1adedac203 <nl> mmm / dev / null <nl> ppp b / modules / features2d / doc / read_file_score32 . pl <nl> <nl> + # ! / usr / bin / perl <nl> + use strict ; <nl> + use warnings ; <nl> + use autodie ; # die if problem reading or writing a file <nl> + <nl> + my $ filein = " . / agast_score . txt " ; <nl> + my $ fileout = " . / agast_new . txt " ; <nl> + my $ i1 = 1 ; <nl> + my $ i2 = 1 ; <nl> + my $ i3 = 1 ; <nl> + my $ tmp ; <nl> + my $ ifcount0 = 0 ; <nl> + my $ ifcount1 = 0 ; <nl> + my $ ifcount2 = 0 ; <nl> + my $ ifcount3 = 0 ; <nl> + my $ ifcount4 = 0 ; <nl> + my $ elsecount ; <nl> + my $ myfirstline = $ ARGV [ 0 ] ; <nl> + my $ mylastline = $ ARGV [ 1 ] ; <nl> + my $ tablename = $ ARGV [ 2 ] ; <nl> + my @ array0 = ( ) ; <nl> + my @ array1 = ( ) ; <nl> + my @ array2 = ( ) ; <nl> + my @ array3 = ( ) ; <nl> + my $ is_not_a_corner ; <nl> + my $ is_a_corner ; <nl> + <nl> + open ( my $ in1 , " < " , $ filein ) or die " Can ' t open $ filein : $ ! " ; <nl> + open ( my $ out , " > " , $ fileout ) or die " Can ' t open $ fileout : $ ! " ; <nl> + <nl> + <nl> + $ array0 [ 0 ] = 0 ; <nl> + $ i1 = 1 ; <nl> + while ( my $ line1 = < $ in1 > ) <nl> + { <nl> + chomp $ line1 ; <nl> + $ array0 [ $ i1 ] = 0 ; <nl> + if ( ( $ i1 > = $ myfirstline ) & & ( $ i1 < = $ mylastline ) ) <nl> + { <nl> + if ( $ line1 = ~ / if \ ( ptr \ [ offset ( \ d + ) / ) <nl> + { <nl> + if ( $ line1 = ~ / if \ ( ptr \ [ offset ( \ d + ) . * \ > . * cb / ) <nl> + { <nl> + $ tmp = $ 1 ; <nl> + } <nl> + else <nl> + { <nl> + if ( $ line1 = ~ / if \ ( ptr \ [ offset ( \ d + ) . * \ < . * c \ _b / ) <nl> + { <nl> + $ tmp = $ 1 + 128 ; <nl> + } <nl> + else <nl> + { <nl> + die " invalid array index ! " <nl> + } <nl> + } <nl> + $ array1 [ $ ifcount1 ] = $ tmp ; <nl> + $ array0 [ $ ifcount1 ] = $ i1 ; <nl> + $ ifcount1 + + ; <nl> + } <nl> + else <nl> + { <nl> + } <nl> + } <nl> + $ i1 + + ; <nl> + } <nl> + $ is_not_a_corner = $ ifcount1 ; <nl> + $ is_a_corner = $ ifcount1 + 1 ; <nl> + <nl> + close $ in1 or die " Can ' t close $ filein : $ ! " ; <nl> + <nl> + open ( $ in1 , " < " , $ filein ) or die " Can ' t open $ filein : $ ! " ; <nl> + <nl> + <nl> + $ i1 = 1 ; <nl> + while ( my $ line1 = < $ in1 > ) <nl> + { <nl> + chomp $ line1 ; <nl> + if ( ( $ i1 > = $ myfirstline ) & & ( $ i1 < = $ mylastline ) ) <nl> + { <nl> + if ( $ array0 [ $ ifcount2 ] = = $ i1 ) <nl> + { <nl> + $ array2 [ $ ifcount2 ] = 0 ; <nl> + $ array3 [ $ ifcount2 ] = 0 ; <nl> + if ( $ array0 [ $ ifcount2 + 1 ] = = ( $ i1 + 1 ) ) <nl> + { <nl> + $ array2 [ $ ifcount2 ] = ( $ ifcount2 + 1 ) ; <nl> + } <nl> + else <nl> + { <nl> + open ( my $ in2 , " < " , $ filein ) or die " Can ' t open $ filein : $ ! " ; <nl> + $ i2 = 1 ; <nl> + while ( my $ line2 = < $ in2 > ) <nl> + { <nl> + chomp $ line2 ; <nl> + if ( $ i2 = = $ i1 ) <nl> + { <nl> + last ; <nl> + } <nl> + $ i2 + + ; <nl> + } <nl> + my $ line2 = < $ in2 > ; <nl> + chomp $ line2 ; <nl> + if ( $ line2 = ~ / goto ( \ w + ) / ) <nl> + { <nl> + $ tmp = $ 1 ; <nl> + if ( $ tmp eq " is_not_a_corner " ) <nl> + { <nl> + $ array2 [ $ ifcount2 ] = $ is_not_a_corner ; <nl> + } <nl> + if ( $ tmp eq " is_a_corner " ) <nl> + { <nl> + $ array2 [ $ ifcount2 ] = $ is_a_corner ; <nl> + } <nl> + } <nl> + else <nl> + { <nl> + die " goto expected : $ ! " ; <nl> + } <nl> + close $ in2 or die " Can ' t close $ filein : $ ! " ; <nl> + } <nl> + # find next else and interprete it <nl> + open ( my $ in3 , " < " , $ filein ) or die " Can ' t open $ filein : $ ! " ; <nl> + $ i3 = 1 ; <nl> + $ ifcount3 = 0 ; <nl> + $ elsecount = 0 ; <nl> + while ( my $ line3 = < $ in3 > ) <nl> + { <nl> + chomp $ line3 ; <nl> + $ i3 + + ; <nl> + if ( $ i3 = = $ i1 ) <nl> + { <nl> + last ; <nl> + } <nl> + } <nl> + while ( my $ line3 = < $ in3 > ) <nl> + { <nl> + chomp $ line3 ; <nl> + $ ifcount3 + + ; <nl> + if ( ( $ elsecount = = 0 ) & & ( $ i3 > $ i1 ) ) <nl> + { <nl> + if ( $ line3 = ~ / goto ( \ w + ) / ) <nl> + { <nl> + $ tmp = $ 1 ; <nl> + if ( $ tmp eq " is_not_a_corner " ) <nl> + { <nl> + $ array3 [ $ ifcount2 ] = $ is_not_a_corner ; <nl> + } <nl> + if ( $ tmp eq " is_a_corner " ) <nl> + { <nl> + $ array3 [ $ ifcount2 ] = $ is_a_corner ; <nl> + } <nl> + } <nl> + else <nl> + { <nl> + if ( $ line3 = ~ / if \ ( ptr \ [ offset / ) <nl> + { <nl> + $ ifcount4 = 0 ; <nl> + while ( $ array0 [ $ ifcount4 ] ! = $ i3 ) <nl> + { <nl> + $ ifcount4 + + ; <nl> + if ( $ ifcount4 = = $ ifcount1 ) <nl> + { <nl> + die " if else match expected : $ ! " ; <nl> + } <nl> + $ array3 [ $ ifcount2 ] = $ ifcount4 ; <nl> + } <nl> + } <nl> + else <nl> + { <nl> + die " elseif or elsegoto match expected : $ ! " ; <nl> + } <nl> + } <nl> + last ; <nl> + } <nl> + else <nl> + { <nl> + if ( $ line3 = ~ / if \ ( ptr \ [ offset / ) <nl> + { <nl> + $ elsecount + + ; <nl> + } <nl> + else <nl> + { <nl> + if ( $ line3 = ~ / else / ) <nl> + { <nl> + $ elsecount - - ; <nl> + } <nl> + } <nl> + } <nl> + $ i3 + + ; <nl> + } <nl> + printf ( " % 3d [ % 3d ] [ 0x % 08x ] \ n " , $ array0 [ $ ifcount2 ] , $ ifcount2 , ( ( $ array1 [ $ ifcount2 ] & 15 ) < < 28 ) | ( $ array2 [ $ ifcount2 ] < < 16 ) | ( ( $ array1 [ $ ifcount2 ] & 128 ) < < 5 ) | ( $ array3 [ $ ifcount2 ] ) ) ; <nl> + close $ in3 or die " Can ' t close $ filein : $ ! " ; <nl> + $ ifcount2 + + ; <nl> + } <nl> + else <nl> + { <nl> + } <nl> + } <nl> + $ i1 + + ; <nl> + } <nl> + <nl> + printf ( " [ % 3d ] [ 0x % 08x ] \ n " , $ is_not_a_corner , 254 ) ; <nl> + printf ( " [ % 3d ] [ 0x % 08x ] \ n " , $ is_a_corner , 255 ) ; <nl> + <nl> + close $ in1 or die " Can ' t close $ filein : $ ! " ; <nl> + <nl> + $ ifcount0 = 0 ; <nl> + $ ifcount2 = 0 ; <nl> + printf $ out " static const unsigned long % s [ ] = { \ n " , $ tablename ; <nl> + while ( $ ifcount0 < $ ifcount1 ) <nl> + { <nl> + printf $ out " 0x % 08x , " , ( ( $ array1 [ $ ifcount0 ] & 15 ) < < 28 ) | ( $ array2 [ $ ifcount0 ] < < 16 ) | ( ( $ array1 [ $ ifcount0 ] & 128 ) < < 5 ) | ( $ array3 [ $ ifcount0 ] ) ; <nl> + <nl> + $ ifcount0 + + ; <nl> + $ ifcount2 + + ; <nl> + if ( $ ifcount2 = = 8 ) <nl> + { <nl> + $ ifcount2 = 0 ; <nl> + printf $ out " \ n " ; <nl> + printf $ out " " ; <nl> + } <nl> + <nl> + } <nl> + printf $ out " 0x % 08x , " , 254 ; <nl> + $ ifcount0 + + ; <nl> + $ ifcount2 + + ; <nl> + if ( $ ifcount2 = = 8 ) <nl> + { <nl> + $ ifcount2 = 0 ; <nl> + printf $ out " \ n " ; <nl> + printf $ out " " ; <nl> + } <nl> + printf $ out " 0x % 08x \ n " , 255 ; <nl> + $ ifcount0 + + ; <nl> + $ ifcount2 + + ; <nl> + printf $ out " } ; \ n \ n " ; <nl> + <nl> + $ # array0 = - 1 ; <nl> + $ # array1 = - 1 ; <nl> + $ # array2 = - 1 ; <nl> + $ # array3 = - 1 ; <nl> + <nl> + close $ out or die " Can ' t close $ fileout : $ ! " ; <nl> new file mode 100644 <nl> index 00000000000 . . 7d76e13f90d <nl> mmm / dev / null <nl> ppp b / modules / features2d / doc / run_agast_tables . bat <nl> <nl> + perl read_file_score32 . pl 9059 9385 table_5_8_corner_struct <nl> + move agast_new . txt agast_score_table . txt <nl> + perl read_file_score32 . pl 2215 3387 table_7_12d_corner_struct <nl> + copy / A agast_score_table . txt + agast_new . txt agast_score_table . txt <nl> + del agast_new . txt <nl> + perl read_file_score32 . pl 3428 9022 table_7_12s_corner_struct <nl> + copy / A agast_score_table . txt + agast_new . txt agast_score_table . txt <nl> + del agast_new . txt <nl> + perl read_file_score32 . pl 118 2174 table_9_16_corner_struct <nl> + copy / A agast_score_table . txt + agast_new . txt agast_score_table . txt <nl> + del agast_new . txt <nl> + <nl> + perl read_file_nondiff32 . pl 103 430 table_5_8_struct1 <nl> + move agast_new . txt agast_table . txt <nl> + perl read_file_nondiff32 . pl 440 779 table_5_8_struct2 <nl> + copy / A agast_table . txt + agast_new . txt agast_table . txt <nl> + del agast_new . txt <nl> + perl read_file_nondiff32 . pl 869 2042 table_7_12d_struct1 <nl> + copy / A agast_table . txt + agast_new . txt agast_table . txt <nl> + del agast_new . txt <nl> + perl read_file_nondiff32 . pl 2052 3225 table_7_12d_struct2 <nl> + copy / A agast_table . txt + agast_new . txt agast_table . txt <nl> + del agast_new . txt <nl> + perl read_file_nondiff32 . pl 3315 4344 table_7_12s_struct1 <nl> + copy / A agast_table . txt + agast_new . txt agast_table . txt <nl> + del agast_new . txt <nl> + perl read_file_nondiff32 . pl 4354 5308 table_7_12s_struct2 <nl> + copy / A agast_table . txt + agast_new . txt agast_table . txt <nl> + del agast_new . txt <nl> + perl read_file_nondiff32 . pl 5400 7454 table_9_16_struct <nl> + copy / A agast_table . txt + agast_new . txt agast_table . txt <nl> + del agast_new . txt <nl> mmm a / modules / features2d / include / opencv2 / features2d . hpp <nl> ppp b / modules / features2d / include / opencv2 / features2d . hpp <nl> circle around this pixel . <nl> AgastFeatureDetector : : AGAST_5_8 , AgastFeatureDetector : : AGAST_7_12d , <nl> AgastFeatureDetector : : AGAST_7_12s , AgastFeatureDetector : : OAST_9_16 <nl> <nl> + For non - Intel platforms , there is a tree optimised variant of AGAST with same numerical results . <nl> + The 32 - bit binary tree tables were generated automatically from original code using perl script . <nl> + The perl script and examples of tree generation are placed in features2d / doc folder . <nl> Detects corners using the AGAST algorithm by @ cite mair2010_agast . <nl> <nl> * / <nl> | added comments and test perl examples for agast tree version | opencv/opencv | cc5a1d612e906e8bb3d68a55755ce582a6f39422 | 2015-11-19T04:39:57Z |
mmm a / dbms / cmake / version . cmake <nl> ppp b / dbms / cmake / version . cmake <nl> <nl> # This strings autochanged from release_lib . sh : <nl> - set ( VERSION_DESCRIBE v1 . 1 . 54238 - testing ) <nl> - set ( VERSION_REVISION 54238 ) <nl> + set ( VERSION_DESCRIBE v1 . 1 . 54239 - testing ) <nl> + set ( VERSION_REVISION 54239 ) <nl> # = = = end of autochange <nl> <nl> set ( VERSION_MAJOR 1 ) <nl> | Auto version update to [ 54239 ] | ClickHouse/ClickHouse | 5fd6d75fbf0c6d7385aad95658c63a9e02d8acf4 | 2017-06-20T10:43:35Z |
mmm a / doxygenConfig <nl> ppp b / doxygenConfig <nl> <nl> # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> DOXYFILE_ENCODING = UTF - 8 <nl> PROJECT_NAME = MongoDB <nl> - PROJECT_NUMBER = 2 . 4 . 0 - rc1 <nl> + PROJECT_NUMBER = 2 . 4 . 0 - rc2 - pre - <nl> OUTPUT_DIRECTORY = docs / doxygen <nl> CREATE_SUBDIRS = NO <nl> OUTPUT_LANGUAGE = English <nl> mmm a / src / mongo / util / version . cpp <nl> ppp b / src / mongo / util / version . cpp <nl> namespace mongo { <nl> * 1 . 2 . 3 - rc4 - pre - <nl> * If you really need to do something else you ' ll need to fix _versionArray ( ) <nl> * / <nl> - const char versionString [ ] = " 2 . 4 . 0 - rc1 " ; <nl> + const char versionString [ ] = " 2 . 4 . 0 - rc2 - pre - " ; <nl> <nl> / / See unit test for example outputs <nl> BSONArray toVersionArray ( const char * version ) { <nl> | post 2 . 4 . 0 - rc1 | mongodb/mongo | 2882398182a9055938b78057ca49333162e266c5 | 2013-02-25T16:41:27Z |
mmm a / src / mruset . h <nl> ppp b / src / mruset . h <nl> template < typename T > class mruset <nl> size_type max_size ( size_type s ) <nl> { <nl> if ( s ) <nl> - while ( queue . size ( ) > = s ) <nl> + while ( queue . size ( ) > s ) <nl> { <nl> set . erase ( queue . front ( ) ) ; <nl> queue . pop_front ( ) ; <nl> | Merge pull request from xanatos / patch - 1 | bitcoin/bitcoin | 451c3957fe63958100741a07e58405f8f564074c | 2012-06-19T12:37:21Z |
mmm a / xbmc / guilib / GUIBaseContainer . cpp <nl> ppp b / xbmc / guilib / GUIBaseContainer . cpp <nl> using namespace std ; <nl> # define HOLD_TIME_START 100 <nl> # define HOLD_TIME_END 3000 <nl> <nl> - CGUIBaseContainer : : CGUIBaseContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , int scrollTime , int preloadItems ) <nl> + CGUIBaseContainer : : CGUIBaseContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , const CScroller & scroller , int preloadItems ) <nl> : CGUIControl ( parentID , controlID , posX , posY , width , height ) <nl> + , m_scroller ( scroller ) <nl> { <nl> m_cursor = 0 ; <nl> m_offset = 0 ; <nl> - m_scrollOffset = 0 ; <nl> - m_scrollSpeed = 0 ; <nl> - m_scrollLastTime = 0 ; <nl> - m_scrollTime = scrollTime ? scrollTime : 1 ; <nl> m_lastHoldTime = 0 ; <nl> m_itemsPerPage = 10 ; <nl> m_pageControl = 0 ; <nl> void CGUIBaseContainer : : Process ( unsigned int currentTime , CDirtyRegionList & dirt <nl> <nl> UpdateScrollOffset ( currentTime ) ; <nl> <nl> - int offset = ( int ) floorf ( m_scrollOffset / m_layout - > Size ( m_orientation ) ) ; <nl> + int offset = ( int ) floorf ( m_scroller . GetValue ( ) / m_layout - > Size ( m_orientation ) ) ; <nl> <nl> int cacheBefore , cacheAfter ; <nl> GetCacheOffsets ( cacheBefore , cacheAfter ) ; <nl> void CGUIBaseContainer : : Process ( unsigned int currentTime , CDirtyRegionList & dirt <nl> <nl> / / we offset our draw position to take into account scrolling and whether or not our focused <nl> / / item is offscreen " above " the list . <nl> - float drawOffset = ( offset - cacheBefore ) * m_layout - > Size ( m_orientation ) - m_scrollOffset ; <nl> + float drawOffset = ( offset - cacheBefore ) * m_layout - > Size ( m_orientation ) - m_scroller . GetValue ( ) ; <nl> if ( GetOffset ( ) + GetCursor ( ) < offset ) <nl> drawOffset + = m_focusedLayout - > Size ( m_orientation ) - m_layout - > Size ( m_orientation ) ; <nl> pos + = drawOffset ; <nl> void CGUIBaseContainer : : Render ( ) <nl> { <nl> if ( ! m_layout | | ! m_focusedLayout ) return ; <nl> <nl> - int offset = ( int ) floorf ( m_scrollOffset / m_layout - > Size ( m_orientation ) ) ; <nl> + int offset = ( int ) floorf ( m_scroller . GetValue ( ) / m_layout - > Size ( m_orientation ) ) ; <nl> <nl> int cacheBefore , cacheAfter ; <nl> GetCacheOffsets ( cacheBefore , cacheAfter ) ; <nl> void CGUIBaseContainer : : Render ( ) <nl> <nl> / / we offset our draw position to take into account scrolling and whether or not our focused <nl> / / item is offscreen " above " the list . <nl> - float drawOffset = ( offset - cacheBefore ) * m_layout - > Size ( m_orientation ) - m_scrollOffset ; <nl> + float drawOffset = ( offset - cacheBefore ) * m_layout - > Size ( m_orientation ) - m_scroller . GetValue ( ) ; <nl> if ( GetOffset ( ) + GetCursor ( ) < offset ) <nl> drawOffset + = m_focusedLayout - > Size ( m_orientation ) - m_layout - > Size ( m_orientation ) ; <nl> pos + = drawOffset ; <nl> CGUIListItemPtr CGUIBaseContainer : : GetListItem ( int offset , unsigned int flag ) co <nl> return CGUIListItemPtr ( ) ; <nl> int item = GetSelectedItem ( ) + offset ; <nl> if ( flag & INFOFLAG_LISTITEM_POSITION ) / / use offset from the first item displayed , taking into account scrolling <nl> - item = CorrectOffset ( ( int ) ( m_scrollOffset / m_layout - > Size ( m_orientation ) ) , offset ) ; <nl> + item = CorrectOffset ( ( int ) ( m_scroller . GetValue ( ) / m_layout - > Size ( m_orientation ) ) , offset ) ; <nl> <nl> if ( flag & INFOFLAG_LISTITEM_WRAP ) <nl> { <nl> EVENT_RESULT CGUIBaseContainer : : OnMouseEvent ( const CPoint & point , const CMouseEv <nl> } <nl> else if ( event . m_id = = ACTION_GESTURE_PAN ) <nl> { / / do the drag and validate our offset ( corrects for end of scroll ) <nl> - m_scrollOffset - = ( m_orientation = = HORIZONTAL ) ? event . m_offsetX : event . m_offsetY ; <nl> + m_scroller . SetValue ( m_scroller . GetValue ( ) - ( m_orientation = = HORIZONTAL ) ? event . m_offsetX : event . m_offsetY ) ; <nl> float size = ( m_layout ) ? m_layout - > Size ( m_orientation ) : 10 . 0f ; <nl> - int offset = ( int ) MathUtils : : round_int ( m_scrollOffset / size ) ; <nl> + int offset = ( int ) MathUtils : : round_int ( m_scroller . GetValue ( ) / size ) ; <nl> m_scrollTimer . Start ( ) ; <nl> SetOffset ( offset ) ; <nl> ValidateOffset ( ) ; <nl> EVENT_RESULT CGUIBaseContainer : : OnMouseEvent ( const CPoint & point , const CMouseEv <nl> SendWindowMessage ( msg ) ; <nl> / / and compute the nearest offset from this and scroll there <nl> float size = ( m_layout ) ? m_layout - > Size ( m_orientation ) : 10 . 0f ; <nl> - float offset = m_scrollOffset / size ; <nl> + float offset = m_scroller . GetValue ( ) / size ; <nl> int toOffset = ( int ) MathUtils : : round_int ( offset ) ; <nl> if ( toOffset < offset ) <nl> SetOffset ( toOffset + 1 ) ; <nl> void CGUIBaseContainer : : FreeResources ( bool immediately ) <nl> { / / free any static content <nl> Reset ( ) ; <nl> } <nl> - m_scrollSpeed = 0 ; <nl> + m_scroller . Stop ( ) ; <nl> } <nl> <nl> void CGUIBaseContainer : : UpdateLayout ( bool updateAllItems ) <nl> void CGUIBaseContainer : : CalculateLayout ( ) <nl> m_itemsPerPage = ( int ) ( ( Size ( ) - m_focusedLayout - > Size ( m_orientation ) ) / m_layout - > Size ( m_orientation ) ) + 1 ; <nl> <nl> / / ensure that the scroll offset is a multiple of our size <nl> - m_scrollOffset = GetOffset ( ) * m_layout - > Size ( m_orientation ) ; <nl> + m_scroller . SetValue ( GetOffset ( ) * m_layout - > Size ( m_orientation ) ) ; <nl> } <nl> <nl> void CGUIBaseContainer : : UpdateScrollByLetter ( ) <nl> void CGUIBaseContainer : : ScrollToOffset ( int offset ) <nl> float size = ( m_layout ) ? m_layout - > Size ( m_orientation ) : 10 . 0f ; <nl> int range = m_itemsPerPage / 4 ; <nl> if ( range < = 0 ) range = 1 ; <nl> - if ( offset * size < m_scrollOffset & & m_scrollOffset - offset * size > size * range ) <nl> + if ( offset * size < m_scroller . GetValue ( ) & & m_scroller . GetValue ( ) - offset * size > size * range ) <nl> { / / scrolling up , and we ' re jumping more than 0 . 5 of a screen <nl> - m_scrollOffset = ( offset + range ) * size ; <nl> + m_scroller . SetValue ( ( offset + range ) * size ) ; <nl> } <nl> - if ( offset * size > m_scrollOffset & & offset * size - m_scrollOffset > size * range ) <nl> + if ( offset * size > m_scroller . GetValue ( ) & & offset * size - m_scroller . GetValue ( ) > size * range ) <nl> { / / scrolling down , and we ' re jumping more than 0 . 5 of a screen <nl> - m_scrollOffset = ( offset - range ) * size ; <nl> + m_scroller . SetValue ( ( offset - range ) * size ) ; <nl> } <nl> - m_scrollSpeed = ( offset * size - m_scrollOffset ) / m_scrollTime ; <nl> + m_scroller . ScrollTo ( offset * size ) ; <nl> if ( ! m_wasReset ) <nl> { <nl> SetContainerMoving ( offset - GetOffset ( ) ) ; <nl> - if ( m_scrollSpeed ) <nl> + if ( m_scroller . IsScrolling ( ) ) <nl> m_scrollTimer . Start ( ) ; <nl> else <nl> m_scrollTimer . Stop ( ) ; <nl> void CGUIBaseContainer : : ScrollToOffset ( int offset ) <nl> void CGUIBaseContainer : : SetContainerMoving ( int direction ) <nl> { <nl> if ( direction ) <nl> - g_infoManager . SetContainerMoving ( GetID ( ) , direction > 0 , m_scrollSpeed ! = 0 ) ; <nl> + g_infoManager . SetContainerMoving ( GetID ( ) , direction > 0 , m_scroller . IsScrolling ( ) ) ; <nl> } <nl> <nl> void CGUIBaseContainer : : UpdateScrollOffset ( unsigned int currentTime ) <nl> { <nl> - if ( m_scrollSpeed ) <nl> + if ( m_scroller . Update ( currentTime ) ) <nl> MarkDirtyRegion ( ) ; <nl> - m_scrollOffset + = m_scrollSpeed * ( currentTime - m_scrollLastTime ) ; <nl> - if ( ( m_scrollSpeed < 0 & & m_scrollOffset < GetOffset ( ) * m_layout - > Size ( m_orientation ) ) | | <nl> - ( m_scrollSpeed > 0 & & m_scrollOffset > GetOffset ( ) * m_layout - > Size ( m_orientation ) ) ) <nl> - { <nl> - m_scrollOffset = GetOffset ( ) * m_layout - > Size ( m_orientation ) ; <nl> - m_scrollSpeed = 0 ; <nl> + else <nl> m_scrollTimer . Stop ( ) ; <nl> - } <nl> - m_scrollLastTime = currentTime ; <nl> } <nl> <nl> int CGUIBaseContainer : : CorrectOffset ( int offset , int cursor ) const <nl> bool CGUIBaseContainer : : GetCondition ( int condition , int data ) const <nl> return layout ? ( layout - > GetFocusedItem ( ) = = ( unsigned int ) data ) : false ; <nl> } <nl> case CONTAINER_SCROLLING : <nl> - return ( m_scrollTimer . GetElapsedMilliseconds ( ) > m_scrollTime | | m_pageChangeTimer . IsRunning ( ) ) ; <nl> + return ( m_scrollTimer . GetElapsedMilliseconds ( ) > m_scroller . GetDuration ( ) | | m_pageChangeTimer . IsRunning ( ) ) ; <nl> default : <nl> return false ; <nl> } <nl> int CGUIBaseContainer : : GetCurrentPage ( ) const <nl> <nl> void CGUIBaseContainer : : GetCacheOffsets ( int & cacheBefore , int & cacheAfter ) <nl> { <nl> - if ( m_scrollSpeed > 0 ) <nl> + if ( m_scroller . IsScrollingDown ( ) ) <nl> { <nl> cacheBefore = 0 ; <nl> cacheAfter = m_cacheItems ; <nl> } <nl> - else if ( m_scrollSpeed < 0 ) <nl> + else if ( m_scroller . IsScrollingUp ( ) ) <nl> { <nl> cacheBefore = m_cacheItems ; <nl> cacheAfter = 0 ; <nl> mmm a / xbmc / guilib / GUIBaseContainer . h <nl> ppp b / xbmc / guilib / GUIBaseContainer . h <nl> typedef boost : : shared_ptr < CGUIListItem > CGUIListItemPtr ; <nl> class CGUIBaseContainer : public CGUIControl <nl> { <nl> public : <nl> - CGUIBaseContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , int scrollTime , int preloadItems ) ; <nl> + CGUIBaseContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , const CScroller & scroller , int preloadItems ) ; <nl> virtual ~ CGUIBaseContainer ( void ) ; <nl> <nl> virtual bool OnAction ( const CAction & action ) ; <nl> class CGUIBaseContainer : public CGUIControl <nl> void SetContainerMoving ( int direction ) ; <nl> void UpdateScrollOffset ( unsigned int currentTime ) ; <nl> <nl> - unsigned int m_scrollLastTime ; <nl> - int m_scrollTime ; <nl> - float m_scrollOffset ; <nl> + CScroller m_scroller ; <nl> <nl> VIEW_TYPE m_type ; <nl> CStdString m_label ; <nl> class CGUIBaseContainer : public CGUIControl <nl> <nl> void UpdateScrollByLetter ( ) ; <nl> void GetCacheOffsets ( int & cacheBefore , int & cacheAfter ) ; <nl> - bool ScrollingDown ( ) const { return m_scrollSpeed > 0 ; } ; <nl> - bool ScrollingUp ( ) const { return m_scrollSpeed < 0 ; } ; <nl> + bool ScrollingDown ( ) const { return m_scroller . IsScrollingDown ( ) ; } ; <nl> + bool ScrollingUp ( ) const { return m_scroller . IsScrollingUp ( ) ; } ; <nl> void OnNextLetter ( ) ; <nl> void OnPrevLetter ( ) ; <nl> void OnJumpLetter ( char letter ) ; <nl> class CGUIBaseContainer : public CGUIControl <nl> int m_cursor ; <nl> int m_offset ; <nl> int m_cacheItems ; <nl> - float m_scrollSpeed ; <nl> CStopWatch m_scrollTimer ; <nl> CStopWatch m_pageChangeTimer ; <nl> <nl> mmm a / xbmc / guilib / GUIControlFactory . cpp <nl> ppp b / xbmc / guilib / GUIControlFactory . cpp <nl> CGUIControl * CGUIControlFactory : : Create ( int parentID , const CRect & rect , TiXmlEl <nl> } <nl> else if ( type = = CGUIControl : : GUICONTAINER_LIST ) <nl> { <nl> - control = new CGUIListContainer ( parentID , id , posX , posY , width , height , orientation , scrollTime , preloadItems ) ; <nl> + CScroller scroller ; <nl> + GetScroller ( pControlNode , " scrolltime " , scroller ) ; <nl> + <nl> + control = new CGUIListContainer ( parentID , id , posX , posY , width , height , orientation , scroller , preloadItems ) ; <nl> ( ( CGUIListContainer * ) control ) - > LoadLayout ( pControlNode ) ; <nl> ( ( CGUIListContainer * ) control ) - > LoadContent ( pControlNode ) ; <nl> ( ( CGUIListContainer * ) control ) - > SetType ( viewType , viewLabel ) ; <nl> CGUIControl * CGUIControlFactory : : Create ( int parentID , const CRect & rect , TiXmlEl <nl> } <nl> else if ( type = = CGUIControl : : GUICONTAINER_WRAPLIST ) <nl> { <nl> - control = new CGUIWrappingListContainer ( parentID , id , posX , posY , width , height , orientation , scrollTime , preloadItems , focusPosition ) ; <nl> + CScroller scroller ; <nl> + GetScroller ( pControlNode , " scrolltime " , scroller ) ; <nl> + <nl> + control = new CGUIWrappingListContainer ( parentID , id , posX , posY , width , height , orientation , scroller , preloadItems , focusPosition ) ; <nl> ( ( CGUIWrappingListContainer * ) control ) - > LoadLayout ( pControlNode ) ; <nl> ( ( CGUIWrappingListContainer * ) control ) - > LoadContent ( pControlNode ) ; <nl> ( ( CGUIWrappingListContainer * ) control ) - > SetType ( viewType , viewLabel ) ; <nl> CGUIControl * CGUIControlFactory : : Create ( int parentID , const CRect & rect , TiXmlEl <nl> } <nl> else if ( type = = CGUIControl : : GUICONTAINER_FIXEDLIST ) <nl> { <nl> - control = new CGUIFixedListContainer ( parentID , id , posX , posY , width , height , orientation , scrollTime , preloadItems , focusPosition , iMovementRange ) ; <nl> + CScroller scroller ; <nl> + GetScroller ( pControlNode , " scrolltime " , scroller ) ; <nl> + <nl> + control = new CGUIFixedListContainer ( parentID , id , posX , posY , width , height , orientation , scroller , preloadItems , focusPosition , iMovementRange ) ; <nl> ( ( CGUIFixedListContainer * ) control ) - > LoadLayout ( pControlNode ) ; <nl> ( ( CGUIFixedListContainer * ) control ) - > LoadContent ( pControlNode ) ; <nl> ( ( CGUIFixedListContainer * ) control ) - > SetType ( viewType , viewLabel ) ; <nl> CGUIControl * CGUIControlFactory : : Create ( int parentID , const CRect & rect , TiXmlEl <nl> } <nl> else if ( type = = CGUIControl : : GUICONTAINER_PANEL ) <nl> { <nl> - control = new CGUIPanelContainer ( parentID , id , posX , posY , width , height , orientation , scrollTime , preloadItems ) ; <nl> + CScroller scroller ; <nl> + GetScroller ( pControlNode , " scrolltime " , scroller ) ; <nl> + <nl> + control = new CGUIPanelContainer ( parentID , id , posX , posY , width , height , orientation , scroller , preloadItems ) ; <nl> ( ( CGUIPanelContainer * ) control ) - > LoadLayout ( pControlNode ) ; <nl> ( ( CGUIPanelContainer * ) control ) - > LoadContent ( pControlNode ) ; <nl> ( ( CGUIPanelContainer * ) control ) - > SetType ( viewType , viewLabel ) ; <nl> mmm a / xbmc / guilib / GUIFixedListContainer . cpp <nl> ppp b / xbmc / guilib / GUIFixedListContainer . cpp <nl> <nl> # include " GUIListItem . h " <nl> # include " Key . h " <nl> <nl> - CGUIFixedListContainer : : CGUIFixedListContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , int scrollTime , int preloadItems , int fixedPosition , int cursorRange ) <nl> - : CGUIBaseContainer ( parentID , controlID , posX , posY , width , height , orientation , scrollTime , preloadItems ) <nl> + CGUIFixedListContainer : : CGUIFixedListContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , const CScroller & scroller , int preloadItems , int fixedPosition , int cursorRange ) <nl> + : CGUIBaseContainer ( parentID , controlID , posX , posY , width , height , orientation , scroller , preloadItems ) <nl> { <nl> ControlType = GUICONTAINER_FIXEDLIST ; <nl> m_type = VIEW_TYPE_LIST ; <nl> void CGUIFixedListContainer : : ValidateOffset ( ) <nl> SetCursor ( std : : max ( GetCursor ( ) , minCursor ) ) ; <nl> SetCursor ( std : : min ( GetCursor ( ) , maxCursor ) ) ; <nl> / / and finally ensure our offset is valid <nl> - if ( GetOffset ( ) + maxCursor > = ( int ) m_items . size ( ) | | m_scrollOffset > ( ( int ) m_items . size ( ) - maxCursor - 1 ) * m_layout - > Size ( m_orientation ) ) <nl> + if ( GetOffset ( ) + maxCursor > = ( int ) m_items . size ( ) | | m_scroller . GetValue ( ) > ( ( int ) m_items . size ( ) - maxCursor - 1 ) * m_layout - > Size ( m_orientation ) ) <nl> { <nl> SetOffset ( std : : max ( - minCursor , ( int ) m_items . size ( ) - maxCursor - 1 ) ) ; <nl> - m_scrollOffset = GetOffset ( ) * m_layout - > Size ( m_orientation ) ; <nl> + m_scroller . SetValue ( GetOffset ( ) * m_layout - > Size ( m_orientation ) ) ; <nl> } <nl> - if ( GetOffset ( ) < - minCursor | | m_scrollOffset < - minCursor * m_layout - > Size ( m_orientation ) ) <nl> + if ( GetOffset ( ) < - minCursor | | m_scroller . GetValue ( ) < - minCursor * m_layout - > Size ( m_orientation ) ) <nl> { <nl> SetOffset ( - minCursor ) ; <nl> - m_scrollOffset = GetOffset ( ) * m_layout - > Size ( m_orientation ) ; <nl> + m_scroller . SetValue ( GetOffset ( ) * m_layout - > Size ( m_orientation ) ) ; <nl> } <nl> } <nl> <nl> mmm a / xbmc / guilib / GUIFixedListContainer . h <nl> ppp b / xbmc / guilib / GUIFixedListContainer . h <nl> <nl> class CGUIFixedListContainer : public CGUIBaseContainer <nl> { <nl> public : <nl> - CGUIFixedListContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , int scrollTime , int preloadItems , int fixedPosition , int cursorRange ) ; <nl> + CGUIFixedListContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , const CScroller & scroller , int preloadItems , int fixedPosition , int cursorRange ) ; <nl> virtual ~ CGUIFixedListContainer ( void ) ; <nl> virtual CGUIFixedListContainer * Clone ( ) const { return new CGUIFixedListContainer ( * this ) ; } ; <nl> <nl> mmm a / xbmc / guilib / GUIListContainer . cpp <nl> ppp b / xbmc / guilib / GUIListContainer . cpp <nl> <nl> # include " GUIInfoManager . h " <nl> # include " Key . h " <nl> <nl> - CGUIListContainer : : CGUIListContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , int scrollTime , int preloadItems ) <nl> - : CGUIBaseContainer ( parentID , controlID , posX , posY , width , height , orientation , scrollTime , preloadItems ) <nl> + CGUIListContainer : : CGUIListContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , const CScroller & scroller , int preloadItems ) <nl> + : CGUIBaseContainer ( parentID , controlID , posX , posY , width , height , orientation , scroller , preloadItems ) <nl> { <nl> ControlType = GUICONTAINER_LIST ; <nl> m_type = VIEW_TYPE_LIST ; <nl> void CGUIListContainer : : Scroll ( int amount ) <nl> void CGUIListContainer : : ValidateOffset ( ) <nl> { / / first thing is we check the range of our offset <nl> if ( ! m_layout ) return ; <nl> - if ( GetOffset ( ) > ( int ) m_items . size ( ) - m_itemsPerPage | | m_scrollOffset > ( ( int ) m_items . size ( ) - m_itemsPerPage ) * m_layout - > Size ( m_orientation ) ) <nl> + if ( GetOffset ( ) > ( int ) m_items . size ( ) - m_itemsPerPage | | m_scroller . GetValue ( ) > ( ( int ) m_items . size ( ) - m_itemsPerPage ) * m_layout - > Size ( m_orientation ) ) <nl> { <nl> SetOffset ( std : : max ( 0 , ( int ) m_items . size ( ) - m_itemsPerPage ) ) ; <nl> - m_scrollOffset = GetOffset ( ) * m_layout - > Size ( m_orientation ) ; <nl> + m_scroller . SetValue ( GetOffset ( ) * m_layout - > Size ( m_orientation ) ) ; <nl> } <nl> - if ( GetOffset ( ) < 0 | | m_scrollOffset < 0 ) <nl> + if ( GetOffset ( ) < 0 | | m_scroller . GetValue ( ) < 0 ) <nl> { <nl> SetOffset ( 0 ) ; <nl> - m_scrollOffset = 0 ; <nl> + m_scroller . SetValue ( 0 ) ; <nl> } <nl> } <nl> <nl> mmm a / xbmc / guilib / GUIListContainer . h <nl> ppp b / xbmc / guilib / GUIListContainer . h <nl> <nl> class CGUIListContainer : public CGUIBaseContainer <nl> { <nl> public : <nl> - CGUIListContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , int scrollTime , int preloadItems ) ; <nl> + CGUIListContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , const CScroller & scroller , int preloadItems ) ; <nl> / / # ifdef PRE_SKIN_VERSION_9_10_COMPATIBILITY <nl> CGUIListContainer ( int parentID , int controlID , float posX , float posY , float width , float height , <nl> const CLabelInfo & labelInfo , const CLabelInfo & labelInfo2 , <nl> mmm a / xbmc / guilib / GUIPanelContainer . cpp <nl> ppp b / xbmc / guilib / GUIPanelContainer . cpp <nl> <nl> <nl> using namespace std ; <nl> <nl> - CGUIPanelContainer : : CGUIPanelContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , int scrollTime , int preloadItems ) <nl> - : CGUIBaseContainer ( parentID , controlID , posX , posY , width , height , orientation , scrollTime , preloadItems ) <nl> + CGUIPanelContainer : : CGUIPanelContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , const CScroller & scroller , int preloadItems ) <nl> + : CGUIBaseContainer ( parentID , controlID , posX , posY , width , height , orientation , scroller , preloadItems ) <nl> { <nl> ControlType = GUICONTAINER_PANEL ; <nl> m_type = VIEW_TYPE_ICON ; <nl> void CGUIPanelContainer : : Process ( unsigned int currentTime , CDirtyRegionList & dir <nl> <nl> UpdateScrollOffset ( currentTime ) ; <nl> <nl> - int offset = ( int ) ( m_scrollOffset / m_layout - > Size ( m_orientation ) ) ; <nl> + int offset = ( int ) ( m_scroller . GetValue ( ) / m_layout - > Size ( m_orientation ) ) ; <nl> <nl> int cacheBefore , cacheAfter ; <nl> GetCacheOffsets ( cacheBefore , cacheAfter ) ; <nl> void CGUIPanelContainer : : Process ( unsigned int currentTime , CDirtyRegionList & dir <nl> CPoint origin = CPoint ( m_posX , m_posY ) + m_renderOffset ; <nl> float pos = ( m_orientation = = VERTICAL ) ? origin . y : origin . x ; <nl> float end = ( m_orientation = = VERTICAL ) ? m_posY + m_height : m_posX + m_width ; <nl> - pos + = ( offset - cacheBefore ) * m_layout - > Size ( m_orientation ) - m_scrollOffset ; <nl> + pos + = ( offset - cacheBefore ) * m_layout - > Size ( m_orientation ) - m_scroller . GetValue ( ) ; <nl> end + = cacheAfter * m_layout - > Size ( m_orientation ) ; <nl> <nl> int current = ( offset - cacheBefore ) * m_itemsPerRow ; <nl> void CGUIPanelContainer : : Render ( ) <nl> { <nl> if ( ! m_layout | | ! m_focusedLayout ) return ; <nl> <nl> - int offset = ( int ) ( m_scrollOffset / m_layout - > Size ( m_orientation ) ) ; <nl> + int offset = ( int ) ( m_scroller . GetValue ( ) / m_layout - > Size ( m_orientation ) ) ; <nl> <nl> int cacheBefore , cacheAfter ; <nl> GetCacheOffsets ( cacheBefore , cacheAfter ) ; <nl> void CGUIPanelContainer : : Render ( ) <nl> CPoint origin = CPoint ( m_posX , m_posY ) + m_renderOffset ; <nl> float pos = ( m_orientation = = VERTICAL ) ? origin . y : origin . x ; <nl> float end = ( m_orientation = = VERTICAL ) ? m_posY + m_height : m_posX + m_width ; <nl> - pos + = ( offset - cacheBefore ) * m_layout - > Size ( m_orientation ) - m_scrollOffset ; <nl> + pos + = ( offset - cacheBefore ) * m_layout - > Size ( m_orientation ) - m_scroller . GetValue ( ) ; <nl> end + = cacheAfter * m_layout - > Size ( m_orientation ) ; <nl> <nl> float focusedPos = 0 ; <nl> void CGUIPanelContainer : : Scroll ( int amount ) <nl> void CGUIPanelContainer : : ValidateOffset ( ) <nl> { / / first thing is we check the range of our offset <nl> if ( ! m_layout ) return ; <nl> - if ( GetOffset ( ) > ( int ) GetRows ( ) - m_itemsPerPage | | m_scrollOffset > ( ( int ) GetRows ( ) - m_itemsPerPage ) * m_layout - > Size ( m_orientation ) ) <nl> + if ( GetOffset ( ) > ( int ) GetRows ( ) - m_itemsPerPage | | m_scroller . GetValue ( ) > ( ( int ) GetRows ( ) - m_itemsPerPage ) * m_layout - > Size ( m_orientation ) ) <nl> { <nl> SetOffset ( std : : max ( 0 , ( int ) GetRows ( ) - m_itemsPerPage ) ) ; <nl> - m_scrollOffset = GetOffset ( ) * m_layout - > Size ( m_orientation ) ; <nl> + m_scroller . SetValue ( GetOffset ( ) * m_layout - > Size ( m_orientation ) ) ; <nl> } <nl> - if ( GetOffset ( ) < 0 | | m_scrollOffset < 0 ) <nl> + if ( GetOffset ( ) < 0 | | m_scroller . GetValue ( ) < 0 ) <nl> { <nl> SetOffset ( 0 ) ; <nl> - m_scrollOffset = 0 ; <nl> + m_scroller . SetValue ( 0 ) ; <nl> } <nl> } <nl> <nl> void CGUIPanelContainer : : CalculateLayout ( ) <nl> if ( m_itemsPerPage < 1 ) m_itemsPerPage = 1 ; <nl> <nl> / / ensure that the scroll offset is a multiple of our size <nl> - m_scrollOffset = GetOffset ( ) * m_layout - > Size ( m_orientation ) ; <nl> + m_scroller . SetValue ( GetOffset ( ) * m_layout - > Size ( m_orientation ) ) ; <nl> } <nl> <nl> unsigned int CGUIPanelContainer : : GetRows ( ) const <nl> mmm a / xbmc / guilib / GUIPanelContainer . h <nl> ppp b / xbmc / guilib / GUIPanelContainer . h <nl> <nl> class CGUIPanelContainer : public CGUIBaseContainer <nl> { <nl> public : <nl> - CGUIPanelContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , int scrollTime , int preloadItems ) ; <nl> + CGUIPanelContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , const CScroller & scroller , int preloadItems ) ; <nl> virtual ~ CGUIPanelContainer ( void ) ; <nl> virtual CGUIPanelContainer * Clone ( ) const { return new CGUIPanelContainer ( * this ) ; } ; <nl> <nl> mmm a / xbmc / guilib / GUIWrappingListContainer . cpp <nl> ppp b / xbmc / guilib / GUIWrappingListContainer . cpp <nl> <nl> # include " Key . h " <nl> # include " utils / log . h " <nl> <nl> - CGUIWrappingListContainer : : CGUIWrappingListContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , int scrollTime , int preloadItems , int fixedPosition ) <nl> - : CGUIBaseContainer ( parentID , controlID , posX , posY , width , height , orientation , scrollTime , preloadItems ) <nl> + CGUIWrappingListContainer : : CGUIWrappingListContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , const CScroller & scroller , int preloadItems , int fixedPosition ) <nl> + : CGUIBaseContainer ( parentID , controlID , posX , posY , width , height , orientation , scroller , preloadItems ) <nl> { <nl> SetCursor ( fixedPosition ) ; <nl> ControlType = GUICONTAINER_WRAPLIST ; <nl> mmm a / xbmc / guilib / GUIWrappingListContainer . h <nl> ppp b / xbmc / guilib / GUIWrappingListContainer . h <nl> <nl> class CGUIWrappingListContainer : public CGUIBaseContainer <nl> { <nl> public : <nl> - CGUIWrappingListContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , int scrollTime , int preloadItems , int fixedPosition ) ; <nl> + CGUIWrappingListContainer ( int parentID , int controlID , float posX , float posY , float width , float height , ORIENTATION orientation , const CScroller & scroller , int preloadItems , int fixedPosition ) ; <nl> virtual ~ CGUIWrappingListContainer ( void ) ; <nl> virtual CGUIWrappingListContainer * Clone ( ) const { return new CGUIWrappingListContainer ( * this ) ; } ; <nl> <nl> | changed : use CScroller to handle container scrolling | xbmc/xbmc | 435097505626a5fe9c62062c0dfdda31e63c573b | 2011-08-12T11:08:46Z |
mmm a / test / IRGen / c_globals . swift <nl> ppp b / test / IRGen / c_globals . swift <nl> <nl> <nl> import c_layout <nl> <nl> + func blackHole < T > ( t : T ) { } <nl> + <nl> public func testStaticGlobal ( ) { <nl> - println ( c_layout . glowingArable ) <nl> + blackHole ( c_layout . glowingArable ) <nl> doubleTrouble ( ) <nl> - println ( c_layout . glowingArable ) <nl> + blackHole ( c_layout . glowingArable ) <nl> } <nl> <nl> / / CHECK : @ glowingArable = internal global float 1 . 700000e + 01 , align 4 <nl> | Don ' t use println ( ) in c_globals . swift test | apple/swift | e8b6b0a4ed20f674b8d8510e3036737d127fe7ca | 2015-04-30T02:59:06Z |
mmm a / python / render_test . py <nl> ppp b / python / render_test . py <nl> def create_light ( t ) : <nl> mesh . rotate_euler ( Vector ( 0 , 0 , 180 + math . cos ( t ) * 45 ) ) <nl> return mesh <nl> <nl> + def create_mis_scene ( eye_position ) : <nl> + scene = Scene ( ) <nl> + num_light_sources = 4 <nl> + num_plates = 5 <nl> + light_position = Vector ( - 0 . 5 , 0 ) <nl> + with scene : <nl> + # scene . add_mesh ( create_object ( ' plane ' , 0 , - 0 . 6 , 0 , 2 , r = ( 0 , 180 , 0 ) ) ) <nl> + scene . add_mesh ( create_holder ( ' holder ' , 0 , - 1 , - 7 , 2 ) ) <nl> + for i in range ( num_light_sources ) : <nl> + radius = 0 . 002 * 3 * * i <nl> + e = 0 . 01 / radius / radius <nl> + material = SurfaceMaterial ( ' emissive ' , color = ( e , e , e ) ) <nl> + mesh = Mesh ( ' . . / assets / meshes / sphere . obj ' , material ) <nl> + mesh . translate ( Vector ( 0 . 2 * ( i - ( num_light_sources - 1 ) * 0 . 5 ) , light_position . y , light_position . x ) ) <nl> + mesh . scale_s ( radius ) <nl> + scene . add_mesh ( mesh ) <nl> + <nl> + for i in range ( num_plates ) : <nl> + fraction = - math . pi / 2 - 1 . 0 * i / num_plates * 0 . 9 <nl> + z = math . cos ( fraction ) * 1 <nl> + y = math . sin ( fraction ) * 1 + 0 . 5 <nl> + board_position = Vector ( z , y ) <nl> + vec1 = eye_position - board_position <nl> + vec2 = light_position - board_position <nl> + vec1 * = 1 . 0 / math . hypot ( vec1 . x , vec1 . y ) <nl> + vec2 * = 1 . 0 / math . hypot ( vec2 . x , vec2 . y ) <nl> + half_vector = vec1 + vec2 <nl> + angle = math . degrees ( math . atan2 ( half_vector . y , half_vector . x ) ) <nl> + print angle <nl> + mesh = Mesh ( ' . . / assets / meshes / plane . obj ' , SurfaceMaterial ( ' pbr ' , specular = ( 1 , 1 , 1 ) , glossiness = 100 * 3 * * i ) ) <nl> + # mesh = Mesh ( ' . . / assets / meshes / plane . obj ' , SurfaceMaterial ( ' diffuse ' , diffuse = ( 1 , 1 , 1 ) ) ) <nl> + mesh . translate ( Vector ( 0 , board_position . y , board_position . x ) ) <nl> + mesh . rotate_euler ( Vector ( 90 - angle , 0 , 0 ) ) <nl> + mesh . scale ( Vector ( 0 . 4 , 0 . 7 , 0 . 05 ) ) <nl> + scene . add_mesh ( mesh ) <nl> + <nl> + envmap = EnvironmentMap ( ' base ' , filepath = ' d : / assets / schoenbrunn - front_hd . hdr ' ) <nl> + scene . set_environment_map ( envmap ) <nl> + return scene <nl> + <nl> def render_frame ( i , t ) : <nl> - downsample = 2 <nl> + downsample = 1 <nl> width , height = 960 / downsample , 540 / downsample <nl> + eye_position = Vector ( 0 . 9 , - 0 . 3 ) <nl> camera = Camera ( ' perspective ' , aspect_ratio = float ( width ) / height , fov_angle = 60 , <nl> - origin = ( 0 , 5 , 20 ) , look_at = ( 0 , 0 . 0 , 0 ) , up = ( 0 , 1 , 0 ) ) <nl> + origin = ( 0 , eye_position . y , eye_position . x ) , look_at = ( 0 , - 0 . 3 , 0 ) , up = ( 0 , 1 , 0 ) ) <nl> <nl> renderer = Renderer ( ' pt ' , ' . . / output / frames / frame_ % d . png ' % i , overwrite = True ) <nl> - renderer . initialize ( width = width , height = height , min_path_length = 2 , max_path_length = 4 , <nl> - initial_radius = 0 . 05 , sampler = ' prand ' , russian_roulette = False , volmetric = True , direct_lighting = 1 , <nl> + renderer . initialize ( width = width , height = height , min_path_length = 1 , max_path_length = 2 , <nl> + initial_radius = 0 . 05 , sampler = ' sobol ' , russian_roulette = False , volmetric = True , direct_lighting = 1 , <nl> direct_lighting_light = 1 , direct_lighting_bsdf = 1 , envmap_is = 1 , mutation_strength = 1 , stage_frequency = 3 , <nl> num_threads = 1 ) <nl> renderer . set_camera ( camera . c ) <nl> - <nl> - air = VolumeMaterial ( ' vacuum ' , scattering = 0 . 01 ) <nl> - <nl> - scene = Scene ( ) <nl> - with scene : <nl> - scene . set_atmosphere_material ( air ) <nl> - # scene . add_mesh ( create_object ( ' sphere ' , 0 , material = ' gold ' ) ) <nl> - scene . add_mesh ( create_holder ( ' holder ' , 0 , - 1 , - 5 , 2 , taichi_s = 0 . 7 + 0 . 25 * t , t = - t * math . pi * 2 ) ) <nl> - scene . add_mesh ( create_light ( math . pi * 0 . 5 ) ) <nl> - envmap = EnvironmentMap ( ' base ' , filepath = ' d : / assets / schoenbrunn - front_hd . hdr ' ) <nl> - scene . set_environment_map ( envmap , 0 . 5 ) <nl> - renderer . set_scene ( scene ) <nl> + renderer . set_scene ( create_mis_scene ( eye_position ) ) <nl> renderer . render ( 30000000 ) <nl> <nl> if __name__ = = ' __main__ ' : <nl> mmm a / python / taichi / visual / assets . py <nl> ppp b / python / taichi / visual / assets . py <nl> def get_material_glossy ( self ) : <nl> transparent = False ) <nl> <nl> def get_material_wall ( self ) : <nl> - material = tc . create_surface_material ( ' diffuse ' ) <nl> rep = Texture . create_taichi_wallpaper ( 20 ) <nl> - material . initialize ( P ( diffuse_map = rep . id ) ) <nl> + material = SurfaceMaterial ( ' diffuse ' , diffuse_map = rep . id ) <nl> return material <nl> <nl> def get_material_diffuse_white ( self ) : <nl> mmm a / python / taichi / visual / scene . py <nl> ppp b / python / taichi / visual / scene . py <nl> def __getattr__ ( self , key ) : <nl> def set_atmosphere_material ( self , mat ) : <nl> self . c . set_atmosphere_material ( mat . c ) <nl> <nl> - def set_environment_map ( self , map , sample_prob = 1 . 0 ) : <nl> + def set_environment_map ( self , map , sample_prob = 0 . 5 ) : <nl> self . c . set_environment_map ( map . c , sample_prob ) <nl> <nl> def __enter__ ( self ) : <nl> | Veach MIS scene | taichi-dev/taichi | b7aa41d96dd947f0750ad2cc4466f8545e2871dd | 2016-12-05T14:32:25Z |
mmm a / db / db_bench . cc <nl> ppp b / db / db_bench . cc <nl> static bool ValidatePrefixSize ( const char * flagname , int32_t value ) { <nl> } <nl> return true ; <nl> } <nl> - DEFINE_int32 ( prefix_size , 0 , " Control the prefix size for PrefixHashRep " ) ; <nl> + DEFINE_int32 ( prefix_size , 0 , " Control the prefix size for HashSkipList " ) ; <nl> <nl> enum RepFactory { <nl> kSkipList , <nl> kPrefixHash , <nl> - kUnsorted , <nl> kVectorRep <nl> } ; <nl> enum RepFactory StringToRepFactory ( const char * ctype ) { <nl> enum RepFactory StringToRepFactory ( const char * ctype ) { <nl> return kSkipList ; <nl> else if ( ! strcasecmp ( ctype , " prefix_hash " ) ) <nl> return kPrefixHash ; <nl> - else if ( ! strcasecmp ( ctype , " unsorted " ) ) <nl> - return kUnsorted ; <nl> else if ( ! strcasecmp ( ctype , " vector " ) ) <nl> return kVectorRep ; <nl> <nl> class Benchmark { <nl> case kSkipList : <nl> fprintf ( stdout , " Memtablerep : skip_list \ n " ) ; <nl> break ; <nl> - case kUnsorted : <nl> - fprintf ( stdout , " Memtablerep : unsorted \ n " ) ; <nl> - break ; <nl> case kVectorRep : <nl> fprintf ( stdout , " Memtablerep : vector \ n " ) ; <nl> break ; <nl> class Benchmark { <nl> } <nl> switch ( FLAGS_rep_factory ) { <nl> case kPrefixHash : <nl> - options . memtable_factory . reset ( <nl> - new PrefixHashRepFactory ( NewFixedPrefixTransform ( FLAGS_prefix_size ) ) <nl> - ) ; <nl> - break ; <nl> - case kUnsorted : <nl> - options . memtable_factory . reset ( <nl> - new UnsortedRepFactory <nl> - ) ; <nl> + options . memtable_factory . reset ( NewHashSkipListRepFactory ( <nl> + NewFixedPrefixTransform ( FLAGS_prefix_size ) ) ) ; <nl> break ; <nl> case kSkipList : <nl> / / no need to do anything <nl> mmm a / db / db_impl . cc <nl> ppp b / db / db_impl . cc <nl> <nl> # include " util / auto_roll_logger . h " <nl> # include " util / build_version . h " <nl> # include " util / coding . h " <nl> + # include " util / hash_skiplist_rep . h " <nl> # include " util / logging . h " <nl> # include " util / mutexlock . h " <nl> # include " util / perf_context_imp . h " <nl> Options SanitizeOptions ( const std : : string & dbname , <nl> Log ( result . info_log , " Compaction filter specified , ignore factory " ) ; <nl> } <nl> if ( result . prefix_extractor ) { <nl> - / / If a prefix extractor has been supplied and a PrefixHashRepFactory is <nl> + / / If a prefix extractor has been supplied and a HashSkipListRepFactory is <nl> / / being used , make sure that the latter uses the former as its transform <nl> / / function . <nl> - auto factory = dynamic_cast < PrefixHashRepFactory * > ( <nl> + auto factory = dynamic_cast < HashSkipListRepFactory * > ( <nl> result . memtable_factory . get ( ) ) ; <nl> if ( factory & & <nl> factory - > GetTransform ( ) ! = result . prefix_extractor ) { <nl> mmm a / db / db_test . cc <nl> ppp b / db / db_test . cc <nl> class DBTest { <nl> enum OptionConfig { <nl> kDefault , <nl> kVectorRep , <nl> - kUnsortedRep , <nl> kMergePut , <nl> kFilter , <nl> kUncompressed , <nl> class DBTest { <nl> kCompactOnFlush , <nl> kPerfOptions , <nl> kDeletesFilterFirst , <nl> - kPrefixHashRep , <nl> + kHashSkipList , <nl> kUniversalCompaction , <nl> kCompressedBlockCache , <nl> kEnd <nl> class DBTest { <nl> Options CurrentOptions ( ) { <nl> Options options ; <nl> switch ( option_config_ ) { <nl> - case kPrefixHashRep : <nl> - options . memtable_factory . reset ( new <nl> - PrefixHashRepFactory ( NewFixedPrefixTransform ( 1 ) ) ) ; <nl> + case kHashSkipList : <nl> + options . memtable_factory . reset ( <nl> + NewHashSkipListRepFactory ( NewFixedPrefixTransform ( 1 ) ) ) ; <nl> break ; <nl> case kMergePut : <nl> options . merge_operator = MergeOperators : : CreatePutOperator ( ) ; <nl> class DBTest { <nl> case kDeletesFilterFirst : <nl> options . filter_deletes = true ; <nl> break ; <nl> - case kUnsortedRep : <nl> - options . memtable_factory . reset ( new UnsortedRepFactory ) ; <nl> - break ; <nl> case kVectorRep : <nl> options . memtable_factory . reset ( new VectorRepFactory ( 100 ) ) ; <nl> break ; <nl> TEST ( DBTest , Randomized ) { <nl> / / TODO ( sanjay ) : Test Get ( ) works <nl> int p = rnd . Uniform ( 100 ) ; <nl> int minimum = 0 ; <nl> - if ( option_config_ = = kPrefixHashRep ) { <nl> + if ( option_config_ = = kHashSkipList ) { <nl> minimum = 1 ; <nl> } <nl> if ( p < 45 ) { / / Put <nl> void PrefixScanInit ( DBTest * dbtest ) { <nl> } <nl> <nl> TEST ( DBTest , PrefixScan ) { <nl> - for ( int it = 0 ; it < 2 ; + + it ) { <nl> - ReadOptions ro = ReadOptions ( ) ; <nl> - int count ; <nl> - Slice prefix ; <nl> - Slice key ; <nl> - char buf [ 100 ] ; <nl> - Iterator * iter ; <nl> - snprintf ( buf , sizeof ( buf ) , " 03______ : " ) ; <nl> - prefix = Slice ( buf , 8 ) ; <nl> - key = Slice ( buf , 9 ) ; <nl> - auto prefix_extractor = NewFixedPrefixTransform ( 8 ) ; <nl> - / / db configs <nl> - env_ - > count_random_reads_ = true ; <nl> - Options options = CurrentOptions ( ) ; <nl> - options . env = env_ ; <nl> - options . no_block_cache = true ; <nl> - options . filter_policy = NewBloomFilterPolicy ( 10 ) ; <nl> - options . prefix_extractor = prefix_extractor ; <nl> - options . whole_key_filtering = false ; <nl> - options . disable_auto_compactions = true ; <nl> - options . max_background_compactions = 2 ; <nl> - options . create_if_missing = true ; <nl> - options . disable_seek_compaction = true ; <nl> - if ( it = = 0 ) { <nl> - options . memtable_factory . reset ( NewHashSkipListRepFactory ( <nl> - prefix_extractor ) ) ; <nl> - } else { <nl> - options . memtable_factory = std : : make_shared < PrefixHashRepFactory > ( <nl> - prefix_extractor ) ; <nl> - } <nl> + ReadOptions ro = ReadOptions ( ) ; <nl> + int count ; <nl> + Slice prefix ; <nl> + Slice key ; <nl> + char buf [ 100 ] ; <nl> + Iterator * iter ; <nl> + snprintf ( buf , sizeof ( buf ) , " 03______ : " ) ; <nl> + prefix = Slice ( buf , 8 ) ; <nl> + key = Slice ( buf , 9 ) ; <nl> + auto prefix_extractor = NewFixedPrefixTransform ( 8 ) ; <nl> + / / db configs <nl> + env_ - > count_random_reads_ = true ; <nl> + Options options = CurrentOptions ( ) ; <nl> + options . env = env_ ; <nl> + options . no_block_cache = true ; <nl> + options . filter_policy = NewBloomFilterPolicy ( 10 ) ; <nl> + options . prefix_extractor = prefix_extractor ; <nl> + options . whole_key_filtering = false ; <nl> + options . disable_auto_compactions = true ; <nl> + options . max_background_compactions = 2 ; <nl> + options . create_if_missing = true ; <nl> + options . disable_seek_compaction = true ; <nl> + options . memtable_factory . reset ( NewHashSkipListRepFactory ( prefix_extractor ) ) ; <nl> <nl> - / / prefix specified , with blooms : 2 RAND I / Os <nl> - / / SeekToFirst <nl> - DestroyAndReopen ( & options ) ; <nl> - PrefixScanInit ( this ) ; <nl> - count = 0 ; <nl> - env_ - > random_read_counter_ . Reset ( ) ; <nl> - ro . prefix = & prefix ; <nl> - iter = db_ - > NewIterator ( ro ) ; <nl> - for ( iter - > SeekToFirst ( ) ; iter - > Valid ( ) ; iter - > Next ( ) ) { <nl> - assert ( iter - > key ( ) . starts_with ( prefix ) ) ; <nl> - count + + ; <nl> - } <nl> - ASSERT_OK ( iter - > status ( ) ) ; <nl> - delete iter ; <nl> - ASSERT_EQ ( count , 2 ) ; <nl> - ASSERT_EQ ( env_ - > random_read_counter_ . Read ( ) , 2 ) ; <nl> + / / prefix specified , with blooms : 2 RAND I / Os <nl> + / / SeekToFirst <nl> + DestroyAndReopen ( & options ) ; <nl> + PrefixScanInit ( this ) ; <nl> + count = 0 ; <nl> + env_ - > random_read_counter_ . Reset ( ) ; <nl> + ro . prefix = & prefix ; <nl> + iter = db_ - > NewIterator ( ro ) ; <nl> + for ( iter - > SeekToFirst ( ) ; iter - > Valid ( ) ; iter - > Next ( ) ) { <nl> + assert ( iter - > key ( ) . starts_with ( prefix ) ) ; <nl> + count + + ; <nl> + } <nl> + ASSERT_OK ( iter - > status ( ) ) ; <nl> + delete iter ; <nl> + ASSERT_EQ ( count , 2 ) ; <nl> + ASSERT_EQ ( env_ - > random_read_counter_ . Read ( ) , 2 ) ; <nl> <nl> - / / prefix specified , with blooms : 2 RAND I / Os <nl> - / / Seek <nl> - DestroyAndReopen ( & options ) ; <nl> - PrefixScanInit ( this ) ; <nl> - count = 0 ; <nl> - env_ - > random_read_counter_ . Reset ( ) ; <nl> - ro . prefix = & prefix ; <nl> - iter = db_ - > NewIterator ( ro ) ; <nl> - for ( iter - > Seek ( key ) ; iter - > Valid ( ) ; iter - > Next ( ) ) { <nl> - assert ( iter - > key ( ) . starts_with ( prefix ) ) ; <nl> - count + + ; <nl> - } <nl> - ASSERT_OK ( iter - > status ( ) ) ; <nl> - delete iter ; <nl> - ASSERT_EQ ( count , 2 ) ; <nl> - ASSERT_EQ ( env_ - > random_read_counter_ . Read ( ) , 2 ) ; <nl> + / / prefix specified , with blooms : 2 RAND I / Os <nl> + / / Seek <nl> + DestroyAndReopen ( & options ) ; <nl> + PrefixScanInit ( this ) ; <nl> + count = 0 ; <nl> + env_ - > random_read_counter_ . Reset ( ) ; <nl> + ro . prefix = & prefix ; <nl> + iter = db_ - > NewIterator ( ro ) ; <nl> + for ( iter - > Seek ( key ) ; iter - > Valid ( ) ; iter - > Next ( ) ) { <nl> + assert ( iter - > key ( ) . starts_with ( prefix ) ) ; <nl> + count + + ; <nl> + } <nl> + ASSERT_OK ( iter - > status ( ) ) ; <nl> + delete iter ; <nl> + ASSERT_EQ ( count , 2 ) ; <nl> + ASSERT_EQ ( env_ - > random_read_counter_ . Read ( ) , 2 ) ; <nl> <nl> - / / no prefix specified : 11 RAND I / Os <nl> - DestroyAndReopen ( & options ) ; <nl> - PrefixScanInit ( this ) ; <nl> - count = 0 ; <nl> - env_ - > random_read_counter_ . Reset ( ) ; <nl> - iter = db_ - > NewIterator ( ReadOptions ( ) ) ; <nl> - for ( iter - > Seek ( prefix ) ; iter - > Valid ( ) ; iter - > Next ( ) ) { <nl> - if ( ! iter - > key ( ) . starts_with ( prefix ) ) { <nl> - break ; <nl> - } <nl> - count + + ; <nl> + / / no prefix specified : 11 RAND I / Os <nl> + DestroyAndReopen ( & options ) ; <nl> + PrefixScanInit ( this ) ; <nl> + count = 0 ; <nl> + env_ - > random_read_counter_ . Reset ( ) ; <nl> + iter = db_ - > NewIterator ( ReadOptions ( ) ) ; <nl> + for ( iter - > Seek ( prefix ) ; iter - > Valid ( ) ; iter - > Next ( ) ) { <nl> + if ( ! iter - > key ( ) . starts_with ( prefix ) ) { <nl> + break ; <nl> } <nl> - ASSERT_OK ( iter - > status ( ) ) ; <nl> - delete iter ; <nl> - ASSERT_EQ ( count , 2 ) ; <nl> - ASSERT_EQ ( env_ - > random_read_counter_ . Read ( ) , 11 ) ; <nl> - Close ( ) ; <nl> - delete options . filter_policy ; <nl> + count + + ; <nl> } <nl> + ASSERT_OK ( iter - > status ( ) ) ; <nl> + delete iter ; <nl> + ASSERT_EQ ( count , 2 ) ; <nl> + ASSERT_EQ ( env_ - > random_read_counter_ . Read ( ) , 11 ) ; <nl> + Close ( ) ; <nl> + delete options . filter_policy ; <nl> } <nl> <nl> std : : string MakeKey ( unsigned int num ) { <nl> mmm a / db / perf_context_test . cc <nl> ppp b / db / perf_context_test . cc <nl> std : : shared_ptr < DB > OpenDb ( ) { <nl> <nl> if ( FLAGS_use_set_based_memetable ) { <nl> auto prefix_extractor = rocksdb : : NewFixedPrefixTransform ( 0 ) ; <nl> - options . memtable_factory = <nl> - std : : make_shared < rocksdb : : PrefixHashRepFactory > ( prefix_extractor ) ; <nl> + options . memtable_factory . reset ( <nl> + NewHashSkipListRepFactory ( prefix_extractor ) ) ; <nl> } <nl> <nl> Status s = DB : : Open ( options , kDbName , & db ) ; <nl> mmm a / db / prefix_test . cc <nl> ppp b / db / prefix_test . cc <nl> <nl> # include " util / testharness . h " <nl> <nl> DEFINE_bool ( use_prefix_hash_memtable , true , " " ) ; <nl> - DEFINE_bool ( use_nolock_version , true , " " ) ; <nl> DEFINE_bool ( trigger_deadlock , false , <nl> " issue delete in range scan to trigger PrefixHashMap deadlock " ) ; <nl> DEFINE_uint64 ( bucket_count , 100000 , " number of buckets " ) ; <nl> class PrefixTest { <nl> if ( FLAGS_use_prefix_hash_memtable ) { <nl> auto prefix_extractor = NewFixedPrefixTransform ( 8 ) ; <nl> options . prefix_extractor = prefix_extractor ; <nl> - if ( FLAGS_use_nolock_version ) { <nl> - options . memtable_factory . reset ( NewHashSkipListRepFactory ( <nl> - prefix_extractor , FLAGS_bucket_count ) ) ; <nl> - } else { <nl> - options . memtable_factory = <nl> - std : : make_shared < rocksdb : : PrefixHashRepFactory > ( <nl> - prefix_extractor , FLAGS_bucket_count , FLAGS_num_locks ) ; <nl> - } <nl> + options . memtable_factory . reset ( NewHashSkipListRepFactory ( <nl> + prefix_extractor , FLAGS_bucket_count ) ) ; <nl> } <nl> <nl> Status s = DB : : Open ( options , kDbName , & db ) ; <nl> mmm a / include / rocksdb / memtablerep . h <nl> ppp b / include / rocksdb / memtablerep . h <nl> <nl> / / The factory will be passed an Arena object when a new MemTableRep is <nl> / / requested . The API for this object is in rocksdb / arena . h . <nl> / / <nl> - / / Users can implement their own memtable representations . We include four <nl> + / / Users can implement their own memtable representations . We include three <nl> / / types built in : <nl> / / - SkipListRep : This is the default ; it is backed by a skip list . <nl> - / / - TransformRep : This is backed by an custom hash map . <nl> - / / On construction , they are given a SliceTransform object . This <nl> - / / object is applied to the user key of stored items which indexes into the <nl> - / / hash map to yield a skiplist containing all records that share the same <nl> - / / user key under the transform function . <nl> - / / - UnsortedRep : A subclass of TransformRep where the transform function is <nl> - / / the identity function . Optimized for point lookups . <nl> - / / - PrefixHashRep : A subclass of TransformRep where the transform function is <nl> - / / a fixed - size prefix extractor . If you use PrefixHashRepFactory , the transform <nl> - / / must be identical to options . prefix_extractor , otherwise it will be discarded <nl> - / / and the default will be used . It is optimized for ranged scans over a <nl> - / / prefix . <nl> + / / - HashSkipListRep : The memtable rep that is best used for keys that are <nl> + / / structured like " prefix : suffix " where iteration withing a prefix is <nl> + / / common and iteration across different prefixes is rare . It is backed by <nl> + / / a hash map where each bucket is a skip list . <nl> / / - VectorRep : This is backed by an unordered std : : vector . On iteration , the <nl> / / vector is sorted . It is intelligent about sorting ; once the MarkReadOnly ( ) <nl> / / has been called , the vector will only be sorted once . It is optimized for <nl> class SkipListFactory : public MemTableRepFactory { <nl> } <nl> } ; <nl> <nl> - / / TransformReps are backed by an unordered map of buffers to buckets . When <nl> - / / looking up a key , the user key is extracted and a user - supplied transform <nl> - / / function ( see rocksdb / slice_transform . h ) is applied to get the key into the <nl> - / / unordered map . This allows the user to bin user keys based on arbitrary <nl> - / / criteria . Two example implementations are UnsortedRepFactory and <nl> - / / PrefixHashRepFactory . <nl> + / / HashSkipListRep is backed by hash map of buckets . Each bucket is a skip <nl> + / / list . All the keys with the same prefix will be in the same bucket . <nl> + / / The prefix is determined using user supplied SliceTransform . It has <nl> + / / to match prefix_extractor in options . prefix_extractor . <nl> / / <nl> / / Iteration over the entire collection is implemented by dumping all the keys <nl> - / / into an std : : set . Thus , these data structures are best used when iteration <nl> - / / over the entire collection is rare . <nl> + / / into a separate skip list . Thus , these data structures are best used when <nl> + / / iteration over the entire collection is rare . <nl> / / <nl> / / Parameters : <nl> - / / transform : The SliceTransform to bucket user keys on . TransformRepFactory <nl> - / / owns the pointer . <nl> - / / bucket_count : Passed to the constructor of the underlying <nl> - / / std : : unordered_map of each TransformRep . On initialization , the <nl> - / / underlying array will be at least bucket_count size . <nl> - / / num_locks : Number of read - write locks to have for the rep . Each bucket is <nl> - / / hashed onto a read - write lock which controls access to that lock . More <nl> - / / locks means finer - grained concurrency but more memory overhead . <nl> - class TransformRepFactory : public MemTableRepFactory { <nl> - public : <nl> - explicit TransformRepFactory ( const SliceTransform * transform , <nl> - size_t bucket_count , size_t num_locks = 1000 ) <nl> - : transform_ ( transform ) , <nl> - bucket_count_ ( bucket_count ) , <nl> - num_locks_ ( num_locks ) { } <nl> - <nl> - virtual ~ TransformRepFactory ( ) { delete transform_ ; } <nl> - <nl> - virtual std : : shared_ptr < MemTableRep > CreateMemTableRep ( <nl> - MemTableRep : : KeyComparator & , Arena * ) override ; <nl> - <nl> - virtual const char * Name ( ) const override { <nl> - return " TransformRepFactory " ; <nl> - } <nl> - <nl> - const SliceTransform * GetTransform ( ) { return transform_ ; } <nl> - <nl> - protected : <nl> - const SliceTransform * transform_ ; <nl> - const size_t bucket_count_ ; <nl> - const size_t num_locks_ ; <nl> - } ; <nl> - <nl> - / / UnsortedReps bin user keys based on an identity function transform - - that <nl> - / / is , transform ( key ) = key . This optimizes for point look - ups . <nl> - / / <nl> - / / Parameters : See TransformRepFactory . <nl> - class UnsortedRepFactory : public TransformRepFactory { <nl> - public : <nl> - explicit UnsortedRepFactory ( size_t bucket_count = 0 , size_t num_locks = 1000 ) <nl> - : TransformRepFactory ( NewNoopTransform ( ) , <nl> - bucket_count , <nl> - num_locks ) { } <nl> - virtual const char * Name ( ) const override { <nl> - return " UnsortedRepFactory " ; <nl> - } <nl> - } ; <nl> - <nl> - / / PrefixHashReps bin user keys based on a fixed - size prefix . This optimizes for <nl> - / / short ranged scans over a given prefix . <nl> - / / <nl> - / / Parameters : See TransformRepFactory . <nl> - class PrefixHashRepFactory : public TransformRepFactory { <nl> - public : <nl> - explicit PrefixHashRepFactory ( const SliceTransform * prefix_extractor , <nl> - size_t bucket_count = 0 , size_t num_locks = 1000 ) <nl> - : TransformRepFactory ( prefix_extractor , bucket_count , num_locks ) <nl> - { } <nl> - <nl> - virtual std : : shared_ptr < MemTableRep > CreateMemTableRep ( <nl> - MemTableRep : : KeyComparator & , Arena * ) override ; <nl> - <nl> - virtual const char * Name ( ) const override { <nl> - return " PrefixHashRepFactory " ; <nl> - } <nl> - } ; <nl> - <nl> - / / The same as TransformRepFactory except it doesn ' t use locks . <nl> - / / Experimental , will replace TransformRepFactory once we are sure <nl> - / / it performs better <nl> + / / transform : The prefix extractor that returns prefix when supplied a user <nl> + / / key . Has to match options . prefix_extractor <nl> + / / bucket_count : Number of buckets in a hash_map . Each bucket needs <nl> + / / 8 bytes . By default , we set buckets to one million , which <nl> + / / will take 8MB of memory . If you know the number of keys you ' ll <nl> + / / keep in hash map , set bucket count to be approximately twice <nl> + / / the number of keys <nl> extern MemTableRepFactory * NewHashSkipListRepFactory ( <nl> const SliceTransform * transform , size_t bucket_count = 1000000 ) ; <nl> <nl> mmm a / tools / db_stress . cc <nl> ppp b / tools / db_stress . cc <nl> DEFINE_bool ( filter_deletes , false , " On true , deletes use KeyMayExist to drop " <nl> <nl> enum RepFactory { <nl> kSkipList , <nl> - kPrefixHash , <nl> - kUnsorted , <nl> + kHashSkipList , <nl> kVectorRep <nl> } ; <nl> enum RepFactory StringToRepFactory ( const char * ctype ) { <nl> enum RepFactory StringToRepFactory ( const char * ctype ) { <nl> if ( ! strcasecmp ( ctype , " skip_list " ) ) <nl> return kSkipList ; <nl> else if ( ! strcasecmp ( ctype , " prefix_hash " ) ) <nl> - return kPrefixHash ; <nl> - else if ( ! strcasecmp ( ctype , " unsorted " ) ) <nl> - return kUnsorted ; <nl> + return kHashSkipList ; <nl> else if ( ! strcasecmp ( ctype , " vector " ) ) <nl> return kVectorRep ; <nl> <nl> static bool ValidatePrefixSize ( const char * flagname , int32_t value ) { <nl> } <nl> return true ; <nl> } <nl> - DEFINE_int32 ( prefix_size , 0 , " Control the prefix size for PrefixHashRep " ) ; <nl> + DEFINE_int32 ( prefix_size , 0 , " Control the prefix size for HashSkipListRep " ) ; <nl> static const bool FLAGS_prefix_size_dummy = <nl> google : : RegisterFlagValidator ( & FLAGS_prefix_size , & ValidatePrefixSize ) ; <nl> <nl> class StressTest { <nl> case kSkipList : <nl> memtablerep = " skip_list " ; <nl> break ; <nl> - case kPrefixHash : <nl> + case kHashSkipList : <nl> memtablerep = " prefix_hash " ; <nl> break ; <nl> - case kUnsorted : <nl> - memtablerep = " unsorted " ; <nl> - break ; <nl> case kVectorRep : <nl> memtablerep = " vector " ; <nl> break ; <nl> class StressTest { <nl> FLAGS_delete_obsolete_files_period_micros ; <nl> options . max_manifest_file_size = 1024 ; <nl> options . filter_deletes = FLAGS_filter_deletes ; <nl> - if ( ( FLAGS_prefix_size = = 0 ) = = ( FLAGS_rep_factory = = kPrefixHash ) ) { <nl> + if ( ( FLAGS_prefix_size = = 0 ) = = ( FLAGS_rep_factory = = kHashSkipList ) ) { <nl> fprintf ( stderr , <nl> " prefix_size should be non - zero iff memtablerep = = prefix_hash \ n " ) ; <nl> exit ( 1 ) ; <nl> } <nl> switch ( FLAGS_rep_factory ) { <nl> - case kPrefixHash : <nl> - options . memtable_factory . reset ( <nl> - new PrefixHashRepFactory ( NewFixedPrefixTransform ( FLAGS_prefix_size ) ) <nl> - ) ; <nl> - break ; <nl> - case kUnsorted : <nl> - options . memtable_factory . reset ( <nl> - new UnsortedRepFactory ( ) <nl> - ) ; <nl> + case kHashSkipList : <nl> + options . memtable_factory . reset ( NewHashSkipListRepFactory ( <nl> + NewFixedPrefixTransform ( FLAGS_prefix_size ) ) ) ; <nl> break ; <nl> case kSkipList : <nl> / / no need to do anything <nl> mmm a / util / hash_skiplist_rep . cc <nl> ppp b / util / hash_skiplist_rep . cc <nl> <nl> / / of patent rights can be found in the PATENTS file in the same directory . <nl> / / <nl> <nl> + # include " util / hash_skiplist_rep . h " <nl> + <nl> # include " rocksdb / memtablerep . h " <nl> # include " rocksdb / arena . h " <nl> # include " rocksdb / slice . h " <nl> std : : shared_ptr < MemTableRep : : Iterator > <nl> <nl> } / / anon namespace <nl> <nl> - class HashSkipListRepFactory : public MemTableRepFactory { <nl> - public : <nl> - explicit HashSkipListRepFactory ( const SliceTransform * transform , <nl> - size_t bucket_count = 1000000 ) <nl> - : transform_ ( transform ) , <nl> - bucket_count_ ( bucket_count ) { } <nl> - <nl> - virtual ~ HashSkipListRepFactory ( ) { delete transform_ ; } <nl> - <nl> - virtual std : : shared_ptr < MemTableRep > CreateMemTableRep ( <nl> - MemTableRep : : KeyComparator & compare , Arena * arena ) override { <nl> - return std : : make_shared < HashSkipListRep > ( compare , arena , transform_ , <nl> - bucket_count_ ) ; <nl> - } <nl> - <nl> - virtual const char * Name ( ) const override { <nl> - return " HashSkipListRepFactory " ; <nl> - } <nl> - <nl> - const SliceTransform * GetTransform ( ) { return transform_ ; } <nl> - <nl> - private : <nl> - const SliceTransform * transform_ ; <nl> - const size_t bucket_count_ ; <nl> - } ; <nl> + std : : shared_ptr < MemTableRep > <nl> + HashSkipListRepFactory : : CreateMemTableRep ( MemTableRep : : KeyComparator & compare , <nl> + Arena * arena ) { <nl> + return std : : make_shared < HashSkipListRep > ( compare , arena , transform_ , <nl> + bucket_count_ ) ; <nl> + } <nl> <nl> MemTableRepFactory * NewHashSkipListRepFactory ( <nl> const SliceTransform * transform , size_t bucket_count ) { <nl> new file mode 100644 <nl> index 0000000000 . . b946cf05ef <nl> mmm / dev / null <nl> ppp b / util / hash_skiplist_rep . h <nl> <nl> + / / Copyright ( c ) 2013 , Facebook , Inc . All rights reserved . <nl> + / / This source code is licensed under the BSD - style license found in the <nl> + / / LICENSE file in the root directory of this source tree . An additional grant <nl> + / / of patent rights can be found in the PATENTS file in the same directory . <nl> + / / Copyright ( c ) 2011 The LevelDB Authors . All rights reserved . <nl> + / / Use of this source code is governed by a BSD - style license that can be <nl> + / / found in the LICENSE file . See the AUTHORS file for names of contributors . <nl> + <nl> + # pragma once <nl> + # include " rocksdb / slice_transform . h " <nl> + # include " rocksdb / memtablerep . h " <nl> + <nl> + namespace rocksdb { <nl> + <nl> + class HashSkipListRepFactory : public MemTableRepFactory { <nl> + public : <nl> + explicit HashSkipListRepFactory ( const SliceTransform * transform , <nl> + size_t bucket_count = 1000000 ) <nl> + : transform_ ( transform ) , <nl> + bucket_count_ ( bucket_count ) { } <nl> + <nl> + virtual ~ HashSkipListRepFactory ( ) { delete transform_ ; } <nl> + <nl> + virtual std : : shared_ptr < MemTableRep > CreateMemTableRep ( <nl> + MemTableRep : : KeyComparator & compare , Arena * arena ) override ; <nl> + <nl> + virtual const char * Name ( ) const override { <nl> + return " HashSkipListRepFactory " ; <nl> + } <nl> + <nl> + const SliceTransform * GetTransform ( ) { return transform_ ; } <nl> + <nl> + private : <nl> + const SliceTransform * transform_ ; <nl> + const size_t bucket_count_ ; <nl> + } ; <nl> + <nl> + } <nl> mmm a / util / stl_wrappers . h <nl> ppp b / util / stl_wrappers . h <nl> namespace stl_wrappers { <nl> } <nl> } ; <nl> <nl> - struct Hash { <nl> - inline size_t operator ( ) ( const char * buf ) const { <nl> - Slice internal_key = GetLengthPrefixedSlice ( buf ) ; <nl> - Slice value = <nl> - GetLengthPrefixedSlice ( internal_key . data ( ) + internal_key . size ( ) ) ; <nl> - unsigned int hval = MurmurHash ( internal_key . data ( ) , internal_key . size ( ) , <nl> - 0 ) ; <nl> - hval = MurmurHash ( value . data ( ) , value . size ( ) , hval ) ; <nl> - return hval ; <nl> - } <nl> - } ; <nl> - <nl> - struct KeyEqual : private Base { <nl> - explicit KeyEqual ( const MemTableRep : : KeyComparator & compare ) <nl> - : Base ( compare ) { } <nl> - inline bool operator ( ) ( const char * a , const char * b ) const { <nl> - return this - > compare_ ( a , b ) = = 0 ; <nl> - } <nl> - } ; <nl> } <nl> } <nl> deleted file mode 100644 <nl> index 4c7df13213 . . 0000000000 <nl> mmm a / util / transformrep . cc <nl> ppp / dev / null <nl> <nl> - / / Copyright ( c ) 2013 , Facebook , Inc . All rights reserved . <nl> - / / This source code is licensed under the BSD - style license found in the <nl> - / / LICENSE file in the root directory of this source tree . An additional grant <nl> - / / of patent rights can be found in the PATENTS file in the same directory . <nl> - / / <nl> - # include < unordered_map > <nl> - # include < set > <nl> - # include < vector > <nl> - # include < algorithm > <nl> - # include < iostream > <nl> - <nl> - # include " rocksdb / memtablerep . h " <nl> - # include " rocksdb / arena . h " <nl> - # include " rocksdb / slice . h " <nl> - # include " rocksdb / slice_transform . h " <nl> - # include " port / port . h " <nl> - # include " util / mutexlock . h " <nl> - # include " util / murmurhash . h " <nl> - # include " util / stl_wrappers . h " <nl> - <nl> - namespace std { <nl> - template < > <nl> - struct hash < rocksdb : : Slice > { <nl> - size_t operator ( ) ( const rocksdb : : Slice & slice ) const { <nl> - return MurmurHash ( slice . data ( ) , slice . size ( ) , 0 ) ; <nl> - } <nl> - } ; <nl> - } <nl> - <nl> - namespace rocksdb { <nl> - namespace { <nl> - <nl> - using namespace stl_wrappers ; <nl> - <nl> - class TransformRep : public MemTableRep { <nl> - public : <nl> - TransformRep ( const KeyComparator & compare , Arena * arena , <nl> - const SliceTransform * transform , size_t bucket_size , <nl> - size_t num_locks ) ; <nl> - <nl> - virtual void Insert ( const char * key ) override ; <nl> - <nl> - virtual bool Contains ( const char * key ) const override ; <nl> - <nl> - virtual size_t ApproximateMemoryUsage ( ) override ; <nl> - <nl> - virtual ~ TransformRep ( ) { } <nl> - <nl> - virtual std : : shared_ptr < MemTableRep : : Iterator > GetIterator ( ) override ; <nl> - <nl> - virtual std : : shared_ptr < MemTableRep : : Iterator > GetIterator ( <nl> - const Slice & slice ) override ; <nl> - <nl> - virtual std : : shared_ptr < MemTableRep : : Iterator > GetDynamicPrefixIterator ( ) <nl> - override { <nl> - return std : : make_shared < DynamicPrefixIterator > ( * this ) ; <nl> - } <nl> - <nl> - std : : shared_ptr < MemTableRep : : Iterator > GetTransformIterator ( <nl> - const Slice & transformed ) ; <nl> - <nl> - private : <nl> - friend class DynamicPrefixIterator ; <nl> - typedef std : : set < const char * , Compare > Bucket ; <nl> - typedef std : : unordered_map < Slice , std : : shared_ptr < Bucket > > BucketMap ; <nl> - <nl> - / / Maps slices ( which are transformed user keys ) to buckets of keys sharing <nl> - / / the same transform . <nl> - BucketMap buckets_ ; <nl> - <nl> - / / rwlock_ protects access to the buckets_ data structure itself . Each bucket <nl> - / / has its own read - write lock as well . <nl> - mutable port : : RWMutex rwlock_ ; <nl> - <nl> - / / Keep track of approximately how much memory is being used . <nl> - size_t memory_usage_ = 0 ; <nl> - <nl> - / / The user - supplied transform whose domain is the user keys . <nl> - const SliceTransform * transform_ ; <nl> - <nl> - / / Get a bucket from buckets_ . If the bucket hasn ' t been initialized yet , <nl> - / / initialize it before returning . Must be externally synchronized . <nl> - std : : shared_ptr < Bucket > & GetBucket ( const Slice & transformed ) ; <nl> - <nl> - port : : RWMutex * GetLock ( const Slice & transformed ) const ; <nl> - <nl> - mutable std : : vector < port : : RWMutex > locks_ ; <nl> - <nl> - const KeyComparator & compare_ ; <nl> - <nl> - class Iterator : public MemTableRep : : Iterator { <nl> - public : <nl> - explicit Iterator ( std : : shared_ptr < Bucket > items ) ; <nl> - <nl> - virtual ~ Iterator ( ) { } ; <nl> - <nl> - / / Returns true iff the iterator is positioned at a valid node . <nl> - virtual bool Valid ( ) const ; <nl> - <nl> - / / Returns the key at the current position . <nl> - / / REQUIRES : Valid ( ) <nl> - virtual const char * key ( ) const ; <nl> - <nl> - / / Advances to the next position . <nl> - / / REQUIRES : Valid ( ) <nl> - virtual void Next ( ) ; <nl> - <nl> - / / Advances to the previous position . <nl> - / / REQUIRES : Valid ( ) <nl> - virtual void Prev ( ) ; <nl> - <nl> - / / Advance to the first entry with a key > = target <nl> - virtual void Seek ( const char * target ) ; <nl> - <nl> - / / Position at the first entry in collection . <nl> - / / Final state of iterator is Valid ( ) iff collection is not empty . <nl> - virtual void SeekToFirst ( ) ; <nl> - <nl> - / / Position at the last entry in collection . <nl> - / / Final state of iterator is Valid ( ) iff collection is not empty . <nl> - virtual void SeekToLast ( ) ; <nl> - private : <nl> - std : : shared_ptr < Bucket > items_ ; <nl> - Bucket : : const_iterator cit_ ; <nl> - } ; <nl> - <nl> - class EmptyIterator : public MemTableRep : : Iterator { <nl> - / / This is used when there wasn ' t a bucket . It is cheaper than <nl> - / / instantiating an empty bucket over which to iterate . <nl> - public : <nl> - virtual bool Valid ( ) const { <nl> - return false ; <nl> - } <nl> - virtual const char * key ( ) const { <nl> - assert ( false ) ; <nl> - return nullptr ; <nl> - } <nl> - virtual void Next ( ) { } <nl> - virtual void Prev ( ) { } <nl> - virtual void Seek ( const char * target ) { } <nl> - virtual void SeekToFirst ( ) { } <nl> - virtual void SeekToLast ( ) { } <nl> - static std : : shared_ptr < EmptyIterator > GetInstance ( ) ; <nl> - private : <nl> - static std : : shared_ptr < EmptyIterator > instance ; <nl> - EmptyIterator ( ) { } <nl> - } ; <nl> - <nl> - class TransformIterator : public Iterator { <nl> - public : <nl> - explicit TransformIterator ( std : : shared_ptr < Bucket > items , <nl> - port : : RWMutex * rwlock ) ; <nl> - virtual ~ TransformIterator ( ) { } <nl> - private : <nl> - const ReadLock l_ ; <nl> - } ; <nl> - <nl> - <nl> - class DynamicPrefixIterator : public MemTableRep : : Iterator { <nl> - private : <nl> - / / the underlying memtable rep <nl> - const TransformRep & memtable_rep_ ; <nl> - / / the result of a prefix seek <nl> - std : : unique_ptr < MemTableRep : : Iterator > bucket_iterator_ ; <nl> - <nl> - public : <nl> - explicit DynamicPrefixIterator ( const TransformRep & memtable_rep ) <nl> - : memtable_rep_ ( memtable_rep ) { } <nl> - <nl> - virtual ~ DynamicPrefixIterator ( ) { } ; <nl> - <nl> - / / Returns true iff the iterator is positioned at a valid node . <nl> - virtual bool Valid ( ) const { <nl> - return bucket_iterator_ & & bucket_iterator_ - > Valid ( ) ; <nl> - } <nl> - <nl> - / / Returns the key at the current position . <nl> - / / REQUIRES : Valid ( ) <nl> - virtual const char * key ( ) const { <nl> - assert ( Valid ( ) ) ; <nl> - return bucket_iterator_ - > key ( ) ; <nl> - } <nl> - <nl> - / / Advances to the next position . <nl> - / / REQUIRES : Valid ( ) <nl> - virtual void Next ( ) { <nl> - assert ( Valid ( ) ) ; <nl> - bucket_iterator_ - > Next ( ) ; <nl> - } <nl> - <nl> - / / Advances to the previous position . <nl> - / / REQUIRES : Valid ( ) <nl> - virtual void Prev ( ) { <nl> - assert ( Valid ( ) ) ; <nl> - bucket_iterator_ - > Prev ( ) ; <nl> - } <nl> - <nl> - / / Advance to the first entry with a key > = target within the <nl> - / / same bucket as target <nl> - virtual void Seek ( const char * target ) { <nl> - Slice prefix = memtable_rep_ . transform_ - > Transform ( <nl> - memtable_rep_ . UserKey ( target ) ) ; <nl> - <nl> - ReadLock l ( & memtable_rep_ . rwlock_ ) ; <nl> - auto bucket = memtable_rep_ . buckets_ . find ( prefix ) ; <nl> - if ( bucket = = memtable_rep_ . buckets_ . end ( ) ) { <nl> - bucket_iterator_ . reset ( nullptr ) ; <nl> - } else { <nl> - bucket_iterator_ . reset ( <nl> - new TransformIterator ( bucket - > second , memtable_rep_ . GetLock ( prefix ) ) ) ; <nl> - bucket_iterator_ - > Seek ( target ) ; <nl> - } <nl> - } <nl> - <nl> - / / Position at the first entry in collection . <nl> - / / Final state of iterator is Valid ( ) iff collection is not empty . <nl> - virtual void SeekToFirst ( ) { <nl> - / / Prefix iterator does not support total order . <nl> - / / We simply set the iterator to invalid state <nl> - bucket_iterator_ . reset ( nullptr ) ; <nl> - } <nl> - <nl> - / / Position at the last entry in collection . <nl> - / / Final state of iterator is Valid ( ) iff collection is not empty . <nl> - virtual void SeekToLast ( ) { <nl> - / / Prefix iterator does not support total order . <nl> - / / We simply set the iterator to invalid state <nl> - bucket_iterator_ . reset ( nullptr ) ; <nl> - } <nl> - } ; <nl> - } ; <nl> - <nl> - class PrefixHashRep : public TransformRep { <nl> - public : <nl> - PrefixHashRep ( const KeyComparator & compare , Arena * arena , <nl> - const SliceTransform * transform , size_t bucket_size , <nl> - size_t num_locks ) <nl> - : TransformRep ( compare , arena , transform , <nl> - bucket_size , num_locks ) { } <nl> - <nl> - virtual std : : shared_ptr < MemTableRep : : Iterator > GetPrefixIterator ( <nl> - const Slice & prefix ) override ; <nl> - } ; <nl> - <nl> - std : : shared_ptr < TransformRep : : Bucket > & TransformRep : : GetBucket ( <nl> - const Slice & transformed ) { <nl> - WriteLock l ( & rwlock_ ) ; <nl> - auto & bucket = buckets_ [ transformed ] ; <nl> - if ( ! bucket ) { <nl> - bucket . reset ( <nl> - new decltype ( buckets_ ) : : mapped_type : : element_type ( Compare ( compare_ ) ) ) ; <nl> - / / To memory_usage_ we add the size of the std : : set and the size of the <nl> - / / std : : pair ( decltype ( buckets_ ) : : value_type ) which includes the <nl> - / / Slice and the std : : shared_ptr <nl> - memory_usage_ + = sizeof ( * bucket ) + <nl> - sizeof ( decltype ( buckets_ ) : : value_type ) ; <nl> - } <nl> - return bucket ; <nl> - } <nl> - <nl> - port : : RWMutex * TransformRep : : GetLock ( const Slice & transformed ) const { <nl> - return & locks_ [ std : : hash < Slice > ( ) ( transformed ) % locks_ . size ( ) ] ; <nl> - } <nl> - <nl> - TransformRep : : TransformRep ( const KeyComparator & compare , Arena * arena , <nl> - const SliceTransform * transform , size_t bucket_size , <nl> - size_t num_locks ) <nl> - : buckets_ ( bucket_size ) , <nl> - transform_ ( transform ) , <nl> - locks_ ( num_locks ) , <nl> - compare_ ( compare ) { } <nl> - <nl> - void TransformRep : : Insert ( const char * key ) { <nl> - assert ( ! Contains ( key ) ) ; <nl> - auto transformed = transform_ - > Transform ( UserKey ( key ) ) ; <nl> - auto & bucket = GetBucket ( transformed ) ; <nl> - WriteLock bl ( GetLock ( transformed ) ) ; <nl> - bucket - > insert ( key ) ; <nl> - memory_usage_ + = sizeof ( key ) ; <nl> - } <nl> - <nl> - bool TransformRep : : Contains ( const char * key ) const { <nl> - ReadLock l ( & rwlock_ ) ; <nl> - auto transformed = transform_ - > Transform ( UserKey ( key ) ) ; <nl> - auto bucket = buckets_ . find ( transformed ) ; <nl> - if ( bucket = = buckets_ . end ( ) ) { <nl> - return false ; <nl> - } <nl> - ReadLock bl ( GetLock ( transformed ) ) ; <nl> - return bucket - > second - > count ( key ) ! = 0 ; <nl> - } <nl> - <nl> - size_t TransformRep : : ApproximateMemoryUsage ( ) { <nl> - return memory_usage_ ; <nl> - } <nl> - <nl> - std : : shared_ptr < TransformRep : : EmptyIterator > <nl> - TransformRep : : EmptyIterator : : GetInstance ( ) { <nl> - if ( ! instance ) { <nl> - instance . reset ( new TransformRep : : EmptyIterator ) ; <nl> - } <nl> - return instance ; <nl> - } <nl> - <nl> - TransformRep : : Iterator : : Iterator ( std : : shared_ptr < Bucket > items ) <nl> - : items_ ( items ) , <nl> - cit_ ( items_ - > begin ( ) ) { } <nl> - <nl> - / / Returns true iff the iterator is positioned at a valid node . <nl> - bool TransformRep : : Iterator : : Valid ( ) const { <nl> - return cit_ ! = items_ - > end ( ) ; <nl> - } <nl> - <nl> - / / Returns the key at the current position . <nl> - / / REQUIRES : Valid ( ) <nl> - const char * TransformRep : : Iterator : : key ( ) const { <nl> - assert ( Valid ( ) ) ; <nl> - return * cit_ ; <nl> - } <nl> - <nl> - / / Advances to the next position . <nl> - / / REQUIRES : Valid ( ) <nl> - void TransformRep : : Iterator : : Next ( ) { <nl> - assert ( Valid ( ) ) ; <nl> - if ( cit_ = = items_ - > end ( ) ) { <nl> - return ; <nl> - } <nl> - + + cit_ ; <nl> - } <nl> - <nl> - / / Advances to the previous position . <nl> - / / REQUIRES : Valid ( ) <nl> - void TransformRep : : Iterator : : Prev ( ) { <nl> - assert ( Valid ( ) ) ; <nl> - if ( cit_ = = items_ - > begin ( ) ) { <nl> - / / If you try to go back from the first element , the iterator should be <nl> - / / invalidated . So we set it to past - the - end . This means that you can <nl> - / / treat the container circularly . <nl> - cit_ = items_ - > end ( ) ; <nl> - } else { <nl> - - - cit_ ; <nl> - } <nl> - } <nl> - <nl> - / / Advance to the first entry with a key > = target <nl> - void TransformRep : : Iterator : : Seek ( const char * target ) { <nl> - cit_ = items_ - > lower_bound ( target ) ; <nl> - } <nl> - <nl> - / / Position at the first entry in collection . <nl> - / / Final state of iterator is Valid ( ) iff collection is not empty . <nl> - void TransformRep : : Iterator : : SeekToFirst ( ) { <nl> - cit_ = items_ - > begin ( ) ; <nl> - } <nl> - <nl> - void TransformRep : : Iterator : : SeekToLast ( ) { <nl> - cit_ = items_ - > end ( ) ; <nl> - if ( items_ - > size ( ) ! = 0 ) { <nl> - - - cit_ ; <nl> - } <nl> - } <nl> - <nl> - TransformRep : : TransformIterator : : TransformIterator ( <nl> - std : : shared_ptr < Bucket > items , port : : RWMutex * rwlock ) <nl> - : Iterator ( items ) , l_ ( rwlock ) { } <nl> - <nl> - std : : shared_ptr < MemTableRep : : Iterator > TransformRep : : GetIterator ( ) { <nl> - auto items = std : : make_shared < Bucket > ( Compare ( compare_ ) ) ; <nl> - / / Hold read locks on all locks <nl> - ReadLock l ( & rwlock_ ) ; <nl> - std : : for_each ( locks_ . begin ( ) , locks_ . end ( ) , [ ] ( port : : RWMutex & lock ) { <nl> - lock . ReadLock ( ) ; <nl> - } ) ; <nl> - for ( auto & bucket : buckets_ ) { <nl> - items - > insert ( bucket . second - > begin ( ) , bucket . second - > end ( ) ) ; <nl> - } <nl> - std : : for_each ( locks_ . begin ( ) , locks_ . end ( ) , [ ] ( port : : RWMutex & lock ) { <nl> - lock . Unlock ( ) ; <nl> - } ) ; <nl> - return std : : make_shared < Iterator > ( std : : move ( items ) ) ; <nl> - } <nl> - <nl> - std : : shared_ptr < MemTableRep : : Iterator > TransformRep : : GetTransformIterator ( <nl> - const Slice & transformed ) { <nl> - ReadLock l ( & rwlock_ ) ; <nl> - auto bucket = buckets_ . find ( transformed ) ; <nl> - if ( bucket = = buckets_ . end ( ) ) { <nl> - return EmptyIterator : : GetInstance ( ) ; <nl> - } <nl> - return std : : make_shared < TransformIterator > ( bucket - > second , <nl> - GetLock ( transformed ) ) ; <nl> - } <nl> - <nl> - std : : shared_ptr < MemTableRep : : Iterator > TransformRep : : GetIterator ( <nl> - const Slice & slice ) { <nl> - auto transformed = transform_ - > Transform ( slice ) ; <nl> - return GetTransformIterator ( transformed ) ; <nl> - } <nl> - <nl> - std : : shared_ptr < TransformRep : : EmptyIterator > <nl> - TransformRep : : EmptyIterator : : instance ; <nl> - <nl> - } / / anon namespace <nl> - <nl> - std : : shared_ptr < MemTableRep > TransformRepFactory : : CreateMemTableRep ( <nl> - MemTableRep : : KeyComparator & compare , Arena * arena ) { <nl> - return std : : make_shared < TransformRep > ( compare , arena , transform_ , <nl> - bucket_count_ , num_locks_ ) ; <nl> - } <nl> - <nl> - std : : shared_ptr < MemTableRep > PrefixHashRepFactory : : CreateMemTableRep ( <nl> - MemTableRep : : KeyComparator & compare , Arena * arena ) { <nl> - return std : : make_shared < PrefixHashRep > ( compare , arena , transform_ , <nl> - bucket_count_ , num_locks_ ) ; <nl> - } <nl> - <nl> - std : : shared_ptr < MemTableRep : : Iterator > PrefixHashRep : : GetPrefixIterator ( <nl> - const Slice & prefix ) { <nl> - return TransformRep : : GetTransformIterator ( prefix ) ; <nl> - } <nl> - <nl> - } / / namespace rocksdb <nl> | Killing Transform Rep | facebook/rocksdb | eb12e47e0e38ddf18890451f536c14ae7b1aa188 | 2013-12-03T20:42:15Z |
mmm a / jstests / sharding / jumbo1 . js <nl> ppp b / jstests / sharding / jumbo1 . js <nl> sh . status ( true ) <nl> <nl> sh . setBalancerState ( true ) <nl> <nl> - function diff ( ) { <nl> + function diff1 ( ) { <nl> var x = s . chunkCounts ( " foo " ) ; <nl> printjson ( x ) <nl> return Math . max ( x . shard0000 , x . shard0001 ) - Math . min ( x . shard0000 , x . shard0001 ) ; <nl> } <nl> <nl> assert . soon ( function ( ) { <nl> - var d = diff ( ) ; <nl> + var d = diff1 ( ) ; <nl> print ( " diff : " + d ) ; <nl> sh . status ( true ) <nl> return d < 5 ; <nl> | fix unit test ; apparently there is a " diff " property that is conflicting with this diff function | mongodb/mongo | 5ec59400d7b23146a6633ce9cc02a955a29689e6 | 2011-12-06T14:52:19Z |
mmm a / lib / AST / Decl . cpp <nl> ppp b / lib / AST / Decl . cpp <nl> OverloadSignature ValueDecl : : getOverloadSignature ( ) const { <nl> - > getCanonicalType ( ) ; <nl> } else if ( isa < VarDecl > ( this ) ) { <nl> signature . IsProperty = true ; <nl> + signature . IsInstanceMember = isInstanceMember ( ) ; <nl> } <nl> <nl> return signature ; <nl> mmm a / test / decl / var / static_var . swift <nl> ppp b / test / decl / var / static_var . swift <nl> class C1 { <nl> / / expected - error @ - 1 { { class variables not yet supported } } <nl> } <nl> <nl> + class C2 { <nl> + var x : Int = 19 <nl> + class var x : Int = 17 / / expected - error { { class variables not yet supported } } <nl> + <nl> + func xx ( ) - > Int { return self . x + C2 . x } <nl> + } <nl> + <nl> + struct S2 { <nl> + var x : Int = 19 <nl> + static var x : Int = 17 <nl> + <nl> + func xx ( ) - > Int { return self . x + C2 . x } <nl> + } <nl> + <nl> | Allow class / static properties to overload instance properties rdar : / / problem / 18409106 . | apple/swift | da32b678a116ed4546f541cf2259e022647ddead | 2014-09-22T06:14:07Z |
mmm a / folly / Range . cpp <nl> ppp b / folly / Range . cpp <nl> namespace folly { <nl> const AsciiCaseSensitive asciiCaseSensitive = AsciiCaseSensitive ( ) ; <nl> const AsciiCaseInsensitive asciiCaseInsensitive = AsciiCaseInsensitive ( ) ; <nl> <nl> - std : : ostream & operator < < ( std : : ostream & os , const StringPiece piece ) { <nl> - os . write ( piece . start ( ) , piece . size ( ) ) ; <nl> - return os ; <nl> - } <nl> - <nl> - std : : ostream & operator < < ( std : : ostream & os , const MutableStringPiece piece ) { <nl> - os . write ( piece . start ( ) , piece . size ( ) ) ; <nl> - return os ; <nl> - } <nl> - <nl> namespace { <nl> <nl> / / It ' s okay if pages are bigger than this ( as powers of two ) , but they should <nl> mmm a / folly / Range . h <nl> ppp b / folly / Range . h <nl> typedef Range < char * > MutableStringPiece ; <nl> typedef Range < const unsigned char * > ByteRange ; <nl> typedef Range < unsigned char * > MutableByteRange ; <nl> <nl> - std : : ostream & operator < < ( std : : ostream & os , const StringPiece piece ) ; <nl> - std : : ostream & operator < < ( std : : ostream & os , const MutableStringPiece piece ) ; <nl> + inline std : : ostream & operator < < ( std : : ostream & os , <nl> + const StringPiece piece ) { <nl> + os . write ( piece . start ( ) , piece . size ( ) ) ; <nl> + return os ; <nl> + } <nl> + <nl> + inline std : : ostream & operator < < ( std : : ostream & os , <nl> + const MutableStringPiece piece ) { <nl> + os . write ( piece . start ( ) , piece . size ( ) ) ; <nl> + return os ; <nl> + } <nl> <nl> / * * <nl> * Templated comparison operators <nl> new file mode 100644 <nl> index 00000000000 . . eab9cff7cbb <nl> mmm / dev / null <nl> ppp b / folly / test / DemangleTest . cpp <nl> <nl> + / * <nl> + * Copyright 2015 Facebook , Inc . <nl> + * <nl> + * Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + * you may not use this file except in compliance with the License . <nl> + * You may obtain a copy of the License at <nl> + * <nl> + * http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + * <nl> + * Unless required by applicable law or agreed to in writing , software <nl> + * distributed under the License is distributed on an " AS IS " BASIS , <nl> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + * See the License for the specific language governing permissions and <nl> + * limitations under the License . <nl> + * / <nl> + <nl> + # include < folly / Demangle . h > <nl> + <nl> + # include < gflags / gflags . h > <nl> + # include < gtest / gtest . h > <nl> + <nl> + using folly : : demangle ; <nl> + <nl> + namespace folly_test { <nl> + struct ThisIsAVeryLongStructureName { <nl> + } ; <nl> + } / / namespace folly_test <nl> + <nl> + # if FOLLY_HAVE_CPLUS_DEMANGLE_V3_CALLBACK <nl> + TEST ( Demangle , demangle ) { <nl> + char expected [ ] = " folly_test : : ThisIsAVeryLongStructureName " ; <nl> + EXPECT_STREQ ( <nl> + expected , <nl> + demangle ( typeid ( folly_test : : ThisIsAVeryLongStructureName ) ) . c_str ( ) ) ; <nl> + <nl> + { <nl> + char buf [ sizeof ( expected ) ] ; <nl> + EXPECT_EQ ( sizeof ( expected ) - 1 , <nl> + demangle ( typeid ( folly_test : : ThisIsAVeryLongStructureName ) , <nl> + buf , sizeof ( buf ) ) ) ; <nl> + EXPECT_STREQ ( expected , buf ) ; <nl> + <nl> + EXPECT_EQ ( sizeof ( expected ) - 1 , <nl> + demangle ( typeid ( folly_test : : ThisIsAVeryLongStructureName ) , <nl> + buf , 11 ) ) ; <nl> + EXPECT_STREQ ( " folly_test " , buf ) ; <nl> + } <nl> + } <nl> + # endif <nl> + <nl> + int main ( int argc , char * argv [ ] ) { <nl> + testing : : InitGoogleTest ( & argc , argv ) ; <nl> + gflags : : ParseCommandLineFlags ( & argc , & argv , true ) ; <nl> + return RUN_ALL_TESTS ( ) ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . f4a208a25fc <nl> mmm / dev / null <nl> ppp b / folly / test / DynamicOtherTest . cpp <nl> <nl> + / * <nl> + * Copyright 2015 Facebook , Inc . <nl> + * <nl> + * Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + * you may not use this file except in compliance with the License . <nl> + * You may obtain a copy of the License at <nl> + * <nl> + * http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + * <nl> + * Unless required by applicable law or agreed to in writing , software <nl> + * distributed under the License is distributed on an " AS IS " BASIS , <nl> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + * See the License for the specific language governing permissions and <nl> + * limitations under the License . <nl> + * / <nl> + <nl> + # include < folly / dynamic . h > <nl> + <nl> + # include < folly / gen / Base . h > <nl> + # include < folly / json . h > <nl> + <nl> + # include < gflags / gflags . h > <nl> + # include < gtest / gtest . h > <nl> + <nl> + # include < iostream > <nl> + <nl> + using folly : : dynamic ; <nl> + using folly : : TypeError ; <nl> + <nl> + TEST ( Dynamic , ArrayGenerator ) { <nl> + / / Make sure arrays can be used with folly : : gen . <nl> + using namespace folly : : gen ; <nl> + dynamic arr { 1 , 2 , 3 , 4 } ; <nl> + EXPECT_EQ ( from ( arr ) | take ( 3 ) | member ( & dynamic : : asInt ) | sum , 6 ) ; <nl> + } <nl> + <nl> + TEST ( Dynamic , StringPtrs ) { <nl> + dynamic str = " 12 . 0 " ; <nl> + dynamic num = 12 . 0 ; <nl> + dynamic nullStr = folly : : parseJson ( " \ " foo \ \ u0000bar \ " " ) ; <nl> + <nl> + EXPECT_EQ ( 0 , strcmp ( str . c_str ( ) , " 12 . 0 " ) ) ; <nl> + EXPECT_EQ ( 0 , strncmp ( str . data ( ) , " 12 . 0 " , str . asString ( ) . length ( ) ) ) ; <nl> + EXPECT_EQ ( str . stringPiece ( ) , " 12 . 0 " ) ; <nl> + <nl> + EXPECT_THROW ( num . c_str ( ) , TypeError ) ; <nl> + EXPECT_THROW ( num . data ( ) , TypeError ) ; <nl> + EXPECT_THROW ( num . stringPiece ( ) , TypeError ) ; <nl> + <nl> + EXPECT_EQ ( nullStr . stringPiece ( ) , folly : : StringPiece ( " foo \ 0bar " , 7 ) ) ; <nl> + <nl> + nullStr . getString ( ) [ 3 ] = ' | ' ; <nl> + EXPECT_EQ ( nullStr . stringPiece ( ) , " foo | bar " ) ; <nl> + } <nl> + <nl> + TEST ( Dynamic , Getters ) { <nl> + dynamic dStr = folly : : parseJson ( " \ " foo \ \ u0000bar \ " " ) ; <nl> + dynamic dInt = 1 ; <nl> + dynamic dDouble = 0 . 5 ; <nl> + dynamic dBool = true ; <nl> + <nl> + EXPECT_EQ ( dStr . getString ( ) , std : : string ( " foo \ 0bar " , 7 ) ) ; <nl> + EXPECT_EQ ( dInt . getInt ( ) , 1 ) ; <nl> + EXPECT_EQ ( dDouble . getDouble ( ) , 0 . 5 ) ; <nl> + EXPECT_EQ ( dBool . getBool ( ) , true ) ; <nl> + <nl> + dStr . getString ( ) [ 3 ] = ' | ' ; <nl> + EXPECT_EQ ( dStr . getString ( ) , " foo | bar " ) ; <nl> + <nl> + dInt . getInt ( ) = 2 ; <nl> + EXPECT_EQ ( dInt . getInt ( ) , 2 ) ; <nl> + <nl> + dDouble . getDouble ( ) = 0 . 7 ; <nl> + EXPECT_EQ ( dDouble . getDouble ( ) , 0 . 7 ) ; <nl> + <nl> + dBool . getBool ( ) = false ; <nl> + EXPECT_EQ ( dBool . getBool ( ) , false ) ; <nl> + <nl> + EXPECT_THROW ( dStr . getInt ( ) , TypeError ) ; <nl> + EXPECT_THROW ( dStr . getDouble ( ) , TypeError ) ; <nl> + EXPECT_THROW ( dStr . getBool ( ) , TypeError ) ; <nl> + <nl> + EXPECT_THROW ( dInt . getString ( ) , TypeError ) ; <nl> + EXPECT_THROW ( dInt . getDouble ( ) , TypeError ) ; <nl> + EXPECT_THROW ( dInt . getBool ( ) , TypeError ) ; <nl> + <nl> + EXPECT_THROW ( dDouble . getString ( ) , TypeError ) ; <nl> + EXPECT_THROW ( dDouble . getInt ( ) , TypeError ) ; <nl> + EXPECT_THROW ( dDouble . getBool ( ) , TypeError ) ; <nl> + <nl> + EXPECT_THROW ( dBool . getString ( ) , TypeError ) ; <nl> + EXPECT_THROW ( dBool . getInt ( ) , TypeError ) ; <nl> + EXPECT_THROW ( dBool . getDouble ( ) , TypeError ) ; <nl> + } <nl> + <nl> + TEST ( Dynamic , FormattedIO ) { <nl> + std : : ostringstream out ; <nl> + dynamic doubl = 123 . 33 ; <nl> + dynamic dint = 12 ; <nl> + out < < " 0x " < < std : : hex < < + + dint < < ' ' < < std : : setprecision ( 1 ) <nl> + < < doubl < < ' \ n ' ; <nl> + EXPECT_EQ ( out . str ( ) , " 0xd 1e + 02 \ n " ) ; <nl> + <nl> + out . str ( " " ) ; <nl> + dynamic arrr = { 1 , 2 , 3 } ; <nl> + out < < arrr ; <nl> + EXPECT_EQ ( out . str ( ) , " [ 1 , 2 , 3 ] " ) ; <nl> + <nl> + out . str ( " " ) ; <nl> + dynamic objy = dynamic : : object ( " a " , 12 ) ; <nl> + out < < objy ; <nl> + EXPECT_EQ ( out . str ( ) , R " ( { " a " : 12 } ) " ) ; <nl> + <nl> + out . str ( " " ) ; <nl> + dynamic objy2 = { objy , dynamic : : object ( 12 , " str " ) , <nl> + dynamic : : object ( true , false ) } ; <nl> + out < < objy2 ; <nl> + EXPECT_EQ ( out . str ( ) , R " ( [ { " a " : 12 } , { 12 : " str " } , { true : false } ] ) " ) ; <nl> + } <nl> + <nl> + int main ( int argc , char * * argv ) { <nl> + testing : : InitGoogleTest ( & argc , argv ) ; <nl> + gflags : : ParseCommandLineFlags ( & argc , & argv , true ) ; <nl> + return RUN_ALL_TESTS ( ) ; <nl> + } <nl> mmm a / folly / test / DynamicTest . cpp <nl> ppp b / folly / test / DynamicTest . cpp <nl> <nl> * limitations under the License . <nl> * / <nl> <nl> + # include < folly / dynamic . h > <nl> + <nl> # include < boost / next_prior . hpp > <nl> # include < gflags / gflags . h > <nl> # include < gtest / gtest . h > <nl> <nl> - # include < folly / Benchmark . h > <nl> - # include < folly / dynamic . h > <nl> - # include < folly / gen / Base . h > <nl> - # include < folly / json . h > <nl> - <nl> using folly : : dynamic ; <nl> - using folly : : TypeError ; <nl> + <nl> + / / This test runs without any external dependencies , including json . <nl> + / / This means that if there ' s a test failure , there ' s no way to print <nl> + / / a useful runtime representation of the folly : : dynamic . We will <nl> + / / live with this in order to test dependencies . This method is <nl> + / / normally provided by json . cpp . <nl> + void dynamic : : print_as_pseudo_json ( std : : ostream & out ) const { <nl> + out < < " < folly : : dynamic object of type " < < type_ < < " > " ; <nl> + } <nl> <nl> TEST ( Dynamic , ObjectBasics ) { <nl> dynamic obj = dynamic : : object ( " a " , false ) ; <nl> TEST ( Dynamic , Conversions ) { <nl> EXPECT_EQ ( 12 . 0 , num . asDouble ( ) ) ; <nl> } <nl> <nl> - TEST ( Dynamic , StringPtrs ) { <nl> - dynamic str = " 12 . 0 " ; <nl> - dynamic num = 12 . 0 ; <nl> - dynamic nullStr = folly : : parseJson ( " \ " foo \ \ u0000bar \ " " ) ; <nl> - <nl> - EXPECT_EQ ( 0 , strcmp ( str . c_str ( ) , " 12 . 0 " ) ) ; <nl> - EXPECT_EQ ( 0 , strncmp ( str . data ( ) , " 12 . 0 " , str . asString ( ) . length ( ) ) ) ; <nl> - EXPECT_EQ ( str . stringPiece ( ) , " 12 . 0 " ) ; <nl> - <nl> - EXPECT_THROW ( num . c_str ( ) , TypeError ) ; <nl> - EXPECT_THROW ( num . data ( ) , TypeError ) ; <nl> - EXPECT_THROW ( num . stringPiece ( ) , TypeError ) ; <nl> - <nl> - EXPECT_EQ ( nullStr . stringPiece ( ) , folly : : StringPiece ( " foo \ 0bar " , 7 ) ) ; <nl> - <nl> - nullStr . getString ( ) [ 3 ] = ' | ' ; <nl> - EXPECT_EQ ( nullStr . stringPiece ( ) , " foo | bar " ) ; <nl> - } <nl> - <nl> - TEST ( Dynamic , FormattedIO ) { <nl> - std : : ostringstream out ; <nl> - dynamic doubl = 123 . 33 ; <nl> - dynamic dint = 12 ; <nl> - out < < " 0x " < < std : : hex < < + + dint < < ' ' < < std : : setprecision ( 1 ) <nl> - < < doubl < < ' \ n ' ; <nl> - EXPECT_EQ ( out . str ( ) , " 0xd 1e + 02 \ n " ) ; <nl> - <nl> - out . str ( " " ) ; <nl> - dynamic arrr = { 1 , 2 , 3 } ; <nl> - out < < arrr ; <nl> - EXPECT_EQ ( out . str ( ) , " [ 1 , 2 , 3 ] " ) ; <nl> - <nl> - out . str ( " " ) ; <nl> - dynamic objy = dynamic : : object ( " a " , 12 ) ; <nl> - out < < objy ; <nl> - EXPECT_EQ ( out . str ( ) , R " ( { " a " : 12 } ) " ) ; <nl> - <nl> - out . str ( " " ) ; <nl> - dynamic objy2 = { objy , dynamic : : object ( 12 , " str " ) , <nl> - dynamic : : object ( true , false ) } ; <nl> - out < < objy2 ; <nl> - EXPECT_EQ ( out . str ( ) , R " ( [ { " a " : 12 } , { 12 : " str " } , { true : false } ] ) " ) ; <nl> - } <nl> - <nl> TEST ( Dynamic , GetSetDefaultTest ) { <nl> dynamic d1 = dynamic : : object ( " foo " , " bar " ) ; <nl> EXPECT_EQ ( d1 . getDefault ( " foo " , " baz " ) , " bar " ) ; <nl> TEST ( Dynamic , GetPtr ) { <nl> EXPECT_EQ ( dynamic ( 2 ) , * cobject . get_ptr ( " two " ) ) ; <nl> } <nl> <nl> - TEST ( Dynamic , ArrayGenerator ) { <nl> - / / Make sure arrays can be used with folly : : gen . <nl> - using namespace folly : : gen ; <nl> - dynamic arr { 1 , 2 , 3 , 4 } ; <nl> - EXPECT_EQ ( from ( arr ) | take ( 3 ) | member ( & dynamic : : asInt ) | sum , 6 ) ; <nl> - } <nl> - <nl> - TEST ( Dynamic , Getters ) { <nl> - dynamic dStr = folly : : parseJson ( " \ " foo \ \ u0000bar \ " " ) ; <nl> - dynamic dInt = 1 ; <nl> - dynamic dDouble = 0 . 5 ; <nl> - dynamic dBool = true ; <nl> - <nl> - EXPECT_EQ ( dStr . getString ( ) , std : : string ( " foo \ 0bar " , 7 ) ) ; <nl> - EXPECT_EQ ( dInt . getInt ( ) , 1 ) ; <nl> - EXPECT_EQ ( dDouble . getDouble ( ) , 0 . 5 ) ; <nl> - EXPECT_EQ ( dBool . getBool ( ) , true ) ; <nl> - <nl> - dStr . getString ( ) [ 3 ] = ' | ' ; <nl> - EXPECT_EQ ( dStr . getString ( ) , " foo | bar " ) ; <nl> - <nl> - dInt . getInt ( ) = 2 ; <nl> - EXPECT_EQ ( dInt . getInt ( ) , 2 ) ; <nl> - <nl> - dDouble . getDouble ( ) = 0 . 7 ; <nl> - EXPECT_EQ ( dDouble . getDouble ( ) , 0 . 7 ) ; <nl> - <nl> - dBool . getBool ( ) = false ; <nl> - EXPECT_EQ ( dBool . getBool ( ) , false ) ; <nl> - <nl> - EXPECT_THROW ( dStr . getInt ( ) , TypeError ) ; <nl> - EXPECT_THROW ( dStr . getDouble ( ) , TypeError ) ; <nl> - EXPECT_THROW ( dStr . getBool ( ) , TypeError ) ; <nl> - <nl> - EXPECT_THROW ( dInt . getString ( ) , TypeError ) ; <nl> - EXPECT_THROW ( dInt . getDouble ( ) , TypeError ) ; <nl> - EXPECT_THROW ( dInt . getBool ( ) , TypeError ) ; <nl> - <nl> - EXPECT_THROW ( dDouble . getString ( ) , TypeError ) ; <nl> - EXPECT_THROW ( dDouble . getInt ( ) , TypeError ) ; <nl> - EXPECT_THROW ( dDouble . getBool ( ) , TypeError ) ; <nl> - <nl> - EXPECT_THROW ( dBool . getString ( ) , TypeError ) ; <nl> - EXPECT_THROW ( dBool . getInt ( ) , TypeError ) ; <nl> - EXPECT_THROW ( dBool . getDouble ( ) , TypeError ) ; <nl> - } <nl> - <nl> int main ( int argc , char * * argv ) { <nl> testing : : InitGoogleTest ( & argc , argv ) ; <nl> gflags : : ParseCommandLineFlags ( & argc , & argv , true ) ; <nl> - if ( FLAGS_benchmark ) { <nl> - folly : : runBenchmarks ( ) ; <nl> - } <nl> return RUN_ALL_TESTS ( ) ; <nl> } <nl> new file mode 100644 <nl> index 00000000000 . . c41f1f06079 <nl> mmm / dev / null <nl> ppp b / folly / test / FormatOtherTest . cpp <nl> <nl> + / * <nl> + * Copyright 2015 Facebook , Inc . <nl> + * <nl> + * Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + * you may not use this file except in compliance with the License . <nl> + * You may obtain a copy of the License at <nl> + * <nl> + * http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + * <nl> + * Unless required by applicable law or agreed to in writing , software <nl> + * distributed under the License is distributed on an " AS IS " BASIS , <nl> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + * See the License for the specific language governing permissions and <nl> + * limitations under the License . <nl> + * / <nl> + <nl> + # include < folly / Format . h > <nl> + <nl> + # include < folly / FileUtil . h > <nl> + # include < folly / json . h > <nl> + # include < folly / dynamic . h > <nl> + <nl> + # include < glog / logging . h > <nl> + # include < gflags / gflags . h > <nl> + # include < gtest / gtest . h > <nl> + <nl> + using namespace folly ; <nl> + <nl> + TEST ( FormatOther , file ) { <nl> + / / Test writing to FILE . I ' d use open_memstream but that ' s not available <nl> + / / outside of Linux ( even though it ' s in POSIX . 1 - 2008 ) . <nl> + { <nl> + int fds [ 2 ] ; <nl> + CHECK_ERR ( pipe ( fds ) ) ; <nl> + SCOPE_EXIT { closeNoInt ( fds [ 1 ] ) ; } ; <nl> + { <nl> + FILE * fp = fdopen ( fds [ 1 ] , " wb " ) ; <nl> + PCHECK ( fp ) ; <nl> + SCOPE_EXIT { fclose ( fp ) ; } ; <nl> + writeTo ( fp , format ( " { } { } " , 42 , 23 ) ) ; / / < = 512 bytes ( PIPE_BUF ) <nl> + } <nl> + <nl> + char buf [ 512 ] ; <nl> + ssize_t n = readFull ( fds [ 0 ] , buf , sizeof ( buf ) ) ; <nl> + CHECK_GE ( n , 0 ) ; <nl> + <nl> + EXPECT_EQ ( " 42 23 " , std : : string ( buf , n ) ) ; <nl> + } <nl> + } <nl> + <nl> + TEST ( FormatOther , dynamic ) { <nl> + auto dyn = parseJson ( <nl> + " { \ n " <nl> + " \ " hello \ " : \ " world \ " , \ n " <nl> + " \ " x \ " : [ 20 , 30 ] , \ n " <nl> + " \ " y \ " : { \ " a \ " : 42 } \ n " <nl> + " } " ) ; <nl> + <nl> + EXPECT_EQ ( " world " , sformat ( " { 0 [ hello ] } " , dyn ) ) ; <nl> + EXPECT_THROW ( sformat ( " { 0 [ none ] } " , dyn ) , std : : out_of_range ) ; <nl> + EXPECT_EQ ( " world " , sformat ( " { 0 [ hello ] } " , defaulted ( dyn , " meow " ) ) ) ; <nl> + EXPECT_EQ ( " meow " , sformat ( " { 0 [ none ] } " , defaulted ( dyn , " meow " ) ) ) ; <nl> + <nl> + EXPECT_EQ ( " 20 " , sformat ( " { 0 [ x . 0 ] } " , dyn ) ) ; <nl> + EXPECT_THROW ( sformat ( " { 0 [ x . 2 ] } " , dyn ) , std : : out_of_range ) ; <nl> + <nl> + / / No support for " deep " defaulting ( dyn [ " x " ] is not defaulted ) <nl> + auto v = dyn . at ( " x " ) ; <nl> + EXPECT_EQ ( " 20 " , sformat ( " { 0 [ 0 ] } " , v ) ) ; <nl> + EXPECT_THROW ( sformat ( " { 0 [ 2 ] } " , v ) , std : : out_of_range ) ; <nl> + EXPECT_EQ ( " 20 " , sformat ( " { 0 [ 0 ] } " , defaulted ( v , 42 ) ) ) ; <nl> + EXPECT_EQ ( " 42 " , sformat ( " { 0 [ 2 ] } " , defaulted ( v , 42 ) ) ) ; <nl> + <nl> + EXPECT_EQ ( " 42 " , sformat ( " { 0 [ y . a ] } " , dyn ) ) ; <nl> + <nl> + EXPECT_EQ ( " ( null ) " , sformat ( " { } " , dynamic ( nullptr ) ) ) ; <nl> + } <nl> + <nl> + int main ( int argc , char * argv [ ] ) { <nl> + testing : : InitGoogleTest ( & argc , argv ) ; <nl> + gflags : : ParseCommandLineFlags ( & argc , & argv , true ) ; <nl> + return RUN_ALL_TESTS ( ) ; <nl> + } <nl> mmm a / folly / test / FormatTest . cpp <nl> ppp b / folly / test / FormatTest . cpp <nl> <nl> <nl> # include < folly / Format . h > <nl> <nl> - # include < glog / logging . h > <nl> # include < gflags / gflags . h > <nl> # include < gtest / gtest . h > <nl> <nl> - # include < folly / FBVector . h > <nl> - # include < folly / FileUtil . h > <nl> - # include < folly / dynamic . h > <nl> - # include < folly / json . h > <nl> - <nl> # include < string > <nl> <nl> using namespace folly ; <nl> void compareOctal ( Uint u ) { <nl> char * p = buf1 + detail : : uintToOctal ( buf1 , detail : : kMaxOctalLength , u ) ; <nl> <nl> char buf2 [ detail : : kMaxOctalLength + 1 ] ; <nl> - sprintf ( buf2 , " % jo " , static_cast < uintmax_t > ( u ) ) ; <nl> + EXPECT_LT ( snprintf ( buf2 , sizeof ( buf2 ) , " % jo " , static_cast < uintmax_t > ( u ) ) , <nl> + sizeof ( buf2 ) ) ; <nl> <nl> EXPECT_EQ ( std : : string ( buf2 ) , std : : string ( p ) ) ; <nl> } <nl> void compareHex ( Uint u ) { <nl> char * p = buf1 + detail : : uintToHexLower ( buf1 , detail : : kMaxHexLength , u ) ; <nl> <nl> char buf2 [ detail : : kMaxHexLength + 1 ] ; <nl> - sprintf ( buf2 , " % jx " , static_cast < uintmax_t > ( u ) ) ; <nl> + EXPECT_LT ( snprintf ( buf2 , sizeof ( buf2 ) , " % jx " , static_cast < uintmax_t > ( u ) ) , <nl> + sizeof ( buf2 ) ) ; <nl> <nl> EXPECT_EQ ( std : : string ( buf2 ) , std : : string ( p ) ) ; <nl> } <nl> TEST ( Format , Simple ) { <nl> format ( & s , " { } { } " , 42 , 23 ) ; <nl> format ( & s , " hello { : X < 7 } " , " world " ) ; <nl> EXPECT_EQ ( " 42 23 hello worldXX " , s ) ; <nl> - <nl> - / / Test writing to FILE . I ' d use open_memstream but that ' s not available <nl> - / / outside of Linux ( even though it ' s in POSIX . 1 - 2008 ) . <nl> - { <nl> - int fds [ 2 ] ; <nl> - CHECK_ERR ( pipe ( fds ) ) ; <nl> - SCOPE_EXIT { closeNoInt ( fds [ 1 ] ) ; } ; <nl> - { <nl> - FILE * fp = fdopen ( fds [ 1 ] , " wb " ) ; <nl> - PCHECK ( fp ) ; <nl> - SCOPE_EXIT { fclose ( fp ) ; } ; <nl> - writeTo ( fp , format ( " { } { } " , 42 , 23 ) ) ; / / < = 512 bytes ( PIPE_BUF ) <nl> - } <nl> - <nl> - char buf [ 512 ] ; <nl> - ssize_t n = readFull ( fds [ 0 ] , buf , sizeof ( buf ) ) ; <nl> - CHECK_GE ( n , 0 ) ; <nl> - <nl> - EXPECT_EQ ( " 42 23 " , std : : string ( buf , n ) ) ; <nl> - } <nl> } <nl> <nl> TEST ( Format , Float ) { <nl> TEST ( Format , MultiLevel ) { <nl> EXPECT_EQ ( " world " , sformat ( " { [ 0 . hello ] } " , v ) ) ; <nl> } <nl> <nl> - TEST ( Format , dynamic ) { <nl> - auto dyn = parseJson ( <nl> - " { \ n " <nl> - " \ " hello \ " : \ " world \ " , \ n " <nl> - " \ " x \ " : [ 20 , 30 ] , \ n " <nl> - " \ " y \ " : { \ " a \ " : 42 } \ n " <nl> - " } " ) ; <nl> - <nl> - EXPECT_EQ ( " world " , sformat ( " { 0 [ hello ] } " , dyn ) ) ; <nl> - EXPECT_THROW ( sformat ( " { 0 [ none ] } " , dyn ) , std : : out_of_range ) ; <nl> - EXPECT_EQ ( " world " , sformat ( " { 0 [ hello ] } " , defaulted ( dyn , " meow " ) ) ) ; <nl> - EXPECT_EQ ( " meow " , sformat ( " { 0 [ none ] } " , defaulted ( dyn , " meow " ) ) ) ; <nl> - <nl> - EXPECT_EQ ( " 20 " , sformat ( " { 0 [ x . 0 ] } " , dyn ) ) ; <nl> - EXPECT_THROW ( sformat ( " { 0 [ x . 2 ] } " , dyn ) , std : : out_of_range ) ; <nl> - <nl> - / / No support for " deep " defaulting ( dyn [ " x " ] is not defaulted ) <nl> - auto v = dyn . at ( " x " ) ; <nl> - EXPECT_EQ ( " 20 " , sformat ( " { 0 [ 0 ] } " , v ) ) ; <nl> - EXPECT_THROW ( sformat ( " { 0 [ 2 ] } " , v ) , std : : out_of_range ) ; <nl> - EXPECT_EQ ( " 20 " , sformat ( " { 0 [ 0 ] } " , defaulted ( v , 42 ) ) ) ; <nl> - EXPECT_EQ ( " 42 " , sformat ( " { 0 [ 2 ] } " , defaulted ( v , 42 ) ) ) ; <nl> - <nl> - EXPECT_EQ ( " 42 " , sformat ( " { 0 [ y . a ] } " , dyn ) ) ; <nl> - <nl> - EXPECT_EQ ( " ( null ) " , sformat ( " { } " , dynamic ( nullptr ) ) ) ; <nl> - } <nl> - <nl> TEST ( Format , separatorDecimalInteger ) { <nl> EXPECT_EQ ( " 0 " , sformat ( " { : , d } " , 0 ) ) ; <nl> EXPECT_EQ ( " 1 " , sformat ( " { : d } " , 1 ) ) ; <nl> TEST ( Format , separatorNumber ) { <nl> / / insertThousandsGroupingUnsafe requires non - const params <nl> static void testGrouping ( const char * a_str , const char * expected ) { <nl> char str [ 256 ] ; <nl> - strcpy ( str , a_str ) ; <nl> - char * end_ptr = str + strlen ( str ) ; <nl> + char * end_ptr = str + snprintf ( str , sizeof ( str ) , " % s " , a_str ) ; <nl> + ASSERT_LT ( end_ptr , str + sizeof ( str ) ) ; <nl> folly : : detail : : insertThousandsGroupingUnsafe ( str , & end_ptr ) ; <nl> ASSERT_STREQ ( expected , str ) ; <nl> } <nl> new file mode 100644 <nl> index 00000000000 . . cb0d0dee351 <nl> mmm / dev / null <nl> ppp b / folly / test / JsonOtherTest . cpp <nl> <nl> + / * <nl> + * Copyright 2015 Facebook , Inc . <nl> + * <nl> + * Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + * you may not use this file except in compliance with the License . <nl> + * You may obtain a copy of the License at <nl> + * <nl> + * http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + * <nl> + * Unless required by applicable law or agreed to in writing , software <nl> + * distributed under the License is distributed on an " AS IS " BASIS , <nl> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + * See the License for the specific language governing permissions and <nl> + * limitations under the License . <nl> + * / <nl> + <nl> + # include < folly / json . h > <nl> + <nl> + # include < folly / Benchmark . h > <nl> + # include < folly / FileUtil . h > <nl> + <nl> + # include < gtest / gtest . h > <nl> + # include < gflags / gflags . h > <nl> + <nl> + using folly : : dynamic ; <nl> + using folly : : parseJson ; <nl> + using folly : : toJson ; <nl> + <nl> + TEST ( Json , StripComments ) { <nl> + const std : : string kTestDir = " folly / test / " ; <nl> + const std : : string kTestFile = " json_test_data / commented . json " ; <nl> + const std : : string kTestExpected = " json_test_data / commented . json . exp " ; <nl> + <nl> + std : : string testStr ; <nl> + std : : string expectedStr ; <nl> + if ( ! folly : : readFile ( kTestFile . data ( ) , testStr ) & & <nl> + ! folly : : readFile ( ( kTestDir + kTestFile ) . data ( ) , testStr ) ) { <nl> + FAIL ( ) < < " can not read test file " < < kTestFile ; <nl> + } <nl> + if ( ! folly : : readFile ( kTestExpected . data ( ) , expectedStr ) & & <nl> + ! folly : : readFile ( ( kTestDir + kTestExpected ) . data ( ) , expectedStr ) ) { <nl> + FAIL ( ) < < " can not read test file " < < kTestExpected ; <nl> + } <nl> + EXPECT_EQ ( expectedStr , folly : : json : : stripComments ( testStr ) ) ; <nl> + } <nl> + <nl> + BENCHMARK ( jsonSerialize , iters ) { <nl> + folly : : json : : serialization_opts opts ; <nl> + for ( size_t i = 0 ; i < iters ; + + i ) { <nl> + folly : : json : : serialize ( <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " , <nl> + opts ) ; <nl> + } <nl> + } <nl> + <nl> + BENCHMARK ( jsonSerializeWithNonAsciiEncoding , iters ) { <nl> + folly : : json : : serialization_opts opts ; <nl> + opts . encode_non_ascii = true ; <nl> + <nl> + for ( size_t i = 0 ; i < iters ; + + i ) { <nl> + folly : : json : : serialize ( <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " , <nl> + opts ) ; <nl> + } <nl> + } <nl> + <nl> + BENCHMARK ( jsonSerializeWithUtf8Validation , iters ) { <nl> + folly : : json : : serialization_opts opts ; <nl> + opts . validate_utf8 = true ; <nl> + <nl> + for ( size_t i = 0 ; i < iters ; + + i ) { <nl> + folly : : json : : serialize ( <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> + " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " , <nl> + opts ) ; <nl> + } <nl> + } <nl> + <nl> + BENCHMARK ( parseSmallStringWithUtf , iters ) { <nl> + for ( size_t i = 0 ; i < iters < < 4 ; + + i ) { <nl> + parseJson ( " \ " I \ \ u2665 UTF - 8 thjasdhkjh blah blah blah \ " " ) ; <nl> + } <nl> + } <nl> + <nl> + BENCHMARK ( parseNormalString , iters ) { <nl> + for ( size_t i = 0 ; i < iters < < 4 ; + + i ) { <nl> + parseJson ( " \ " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk \ " " ) ; <nl> + } <nl> + } <nl> + <nl> + BENCHMARK ( parseBigString , iters ) { <nl> + for ( size_t i = 0 ; i < iters ; + + i ) { <nl> + parseJson ( " \ " " <nl> + " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> + " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> + " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> + " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> + " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> + " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> + " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> + " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> + " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> + " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> + " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> + " \ " " ) ; <nl> + } <nl> + } <nl> + <nl> + BENCHMARK ( toJson , iters ) { <nl> + dynamic something = parseJson ( <nl> + " { \ " old_value \ " : 40 , \ " changed \ " : true , \ " opened \ " : false , \ " foo \ " : [ 1 , 2 , 3 , 4 , 5 , 6 ] } " <nl> + ) ; <nl> + <nl> + for ( size_t i = 0 ; i < iters ; i + + ) { <nl> + toJson ( something ) ; <nl> + } <nl> + } <nl> + <nl> + int main ( int argc , char * * argv ) { <nl> + testing : : InitGoogleTest ( & argc , argv ) ; <nl> + gflags : : ParseCommandLineFlags ( & argc , & argv , true ) ; <nl> + if ( FLAGS_benchmark ) { <nl> + folly : : runBenchmarks ( ) ; <nl> + } <nl> + return RUN_ALL_TESTS ( ) ; <nl> + } <nl> mmm a / folly / test / JsonTest . cpp <nl> ppp b / folly / test / JsonTest . cpp <nl> <nl> * limitations under the License . <nl> * / <nl> <nl> - # include < folly / FileUtil . h > <nl> # include < folly / json . h > <nl> + <nl> # include < gtest / gtest . h > <nl> # include < gflags / gflags . h > <nl> - # include < cmath > <nl> # include < limits > <nl> - # include < iostream > <nl> # include < boost / next_prior . hpp > <nl> - # include < folly / Benchmark . h > <nl> <nl> using folly : : dynamic ; <nl> using folly : : parseJson ; <nl> TEST ( Json , SortKeys ) { <nl> EXPECT_EQ ( sorted_keys , folly : : json : : serialize ( value , opts_on ) ) ; <nl> } <nl> <nl> - TEST ( Json , StripComments ) { <nl> - const std : : string kTestDir = " folly / test / " ; <nl> - const std : : string kTestFile = " json_test_data / commented . json " ; <nl> - const std : : string kTestExpected = " json_test_data / commented . json . exp " ; <nl> - <nl> - std : : string testStr ; <nl> - std : : string expectedStr ; <nl> - if ( ! folly : : readFile ( kTestFile . data ( ) , testStr ) & & <nl> - ! folly : : readFile ( ( kTestDir + kTestFile ) . data ( ) , testStr ) ) { <nl> - FAIL ( ) < < " can not read test file " < < kTestFile ; <nl> - } <nl> - if ( ! folly : : readFile ( kTestExpected . data ( ) , expectedStr ) & & <nl> - ! folly : : readFile ( ( kTestDir + kTestExpected ) . data ( ) , expectedStr ) ) { <nl> - FAIL ( ) < < " can not read test file " < < kTestExpected ; <nl> - } <nl> - EXPECT_EQ ( expectedStr , folly : : json : : stripComments ( testStr ) ) ; <nl> - } <nl> - <nl> - BENCHMARK ( jsonSerialize , iters ) { <nl> - folly : : json : : serialization_opts opts ; <nl> - for ( size_t i = 0 ; i < iters ; + + i ) { <nl> - folly : : json : : serialize ( <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " , <nl> - opts ) ; <nl> - } <nl> - } <nl> - <nl> - BENCHMARK ( jsonSerializeWithNonAsciiEncoding , iters ) { <nl> - folly : : json : : serialization_opts opts ; <nl> - opts . encode_non_ascii = true ; <nl> - <nl> - for ( size_t i = 0 ; i < iters ; + + i ) { <nl> - folly : : json : : serialize ( <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " , <nl> - opts ) ; <nl> - } <nl> - } <nl> - <nl> - BENCHMARK ( jsonSerializeWithUtf8Validation , iters ) { <nl> - folly : : json : : serialization_opts opts ; <nl> - opts . validate_utf8 = true ; <nl> - <nl> - for ( size_t i = 0 ; i < iters ; + + i ) { <nl> - folly : : json : : serialize ( <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " <nl> - " qwerty \ xc2 \ x80 \ xef \ xbf \ xbf poiuy " , <nl> - opts ) ; <nl> - } <nl> - } <nl> - <nl> - BENCHMARK ( parseSmallStringWithUtf , iters ) { <nl> - for ( size_t i = 0 ; i < iters < < 4 ; + + i ) { <nl> - parseJson ( " \ " I \ \ u2665 UTF - 8 thjasdhkjh blah blah blah \ " " ) ; <nl> - } <nl> - } <nl> - <nl> - BENCHMARK ( parseNormalString , iters ) { <nl> - for ( size_t i = 0 ; i < iters < < 4 ; + + i ) { <nl> - parseJson ( " \ " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk \ " " ) ; <nl> - } <nl> - } <nl> - <nl> - BENCHMARK ( parseBigString , iters ) { <nl> - for ( size_t i = 0 ; i < iters ; + + i ) { <nl> - parseJson ( " \ " " <nl> - " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> - " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> - " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> - " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> - " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> - " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> - " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> - " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> - " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> - " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> - " akjhfk jhkjlakjhfk jhkjlakjhfk jhkjl akjhfk " <nl> - " \ " " ) ; <nl> - } <nl> - } <nl> - <nl> - BENCHMARK ( toJson , iters ) { <nl> - dynamic something = parseJson ( <nl> - " { \ " old_value \ " : 40 , \ " changed \ " : true , \ " opened \ " : false , \ " foo \ " : [ 1 , 2 , 3 , 4 , 5 , 6 ] } " <nl> - ) ; <nl> - <nl> - for ( size_t i = 0 ; i < iters ; i + + ) { <nl> - toJson ( something ) ; <nl> - } <nl> - } <nl> - <nl> int main ( int argc , char * * argv ) { <nl> testing : : InitGoogleTest ( & argc , argv ) ; <nl> gflags : : ParseCommandLineFlags ( & argc , & argv , true ) ; <nl> - if ( FLAGS_benchmark ) { <nl> - folly : : runBenchmarks ( ) ; <nl> - } <nl> return RUN_ALL_TESTS ( ) ; <nl> } <nl> mmm a / folly / test / StringTest . cpp <nl> ppp b / folly / test / StringTest . cpp <nl> TEST ( System , errnoStr ) { <nl> EXPECT_EQ ( EACCES , errno ) ; <nl> } <nl> <nl> - namespace folly_test { <nl> - struct ThisIsAVeryLongStructureName { <nl> - } ; <nl> - } / / namespace folly_test <nl> - <nl> - # if FOLLY_HAVE_CPLUS_DEMANGLE_V3_CALLBACK <nl> - TEST ( System , demangle ) { <nl> - char expected [ ] = " folly_test : : ThisIsAVeryLongStructureName " ; <nl> - EXPECT_STREQ ( <nl> - expected , <nl> - demangle ( typeid ( folly_test : : ThisIsAVeryLongStructureName ) ) . c_str ( ) ) ; <nl> - <nl> - { <nl> - char buf [ sizeof ( expected ) ] ; <nl> - EXPECT_EQ ( sizeof ( expected ) - 1 , <nl> - demangle ( typeid ( folly_test : : ThisIsAVeryLongStructureName ) , <nl> - buf , sizeof ( buf ) ) ) ; <nl> - EXPECT_STREQ ( expected , buf ) ; <nl> - <nl> - EXPECT_EQ ( sizeof ( expected ) - 1 , <nl> - demangle ( typeid ( folly_test : : ThisIsAVeryLongStructureName ) , <nl> - buf , 11 ) ) ; <nl> - EXPECT_STREQ ( " folly_test " , buf ) ; <nl> - } <nl> - } <nl> - # endif <nl> - <nl> namespace { <nl> <nl> template < template < class , class > class VectorType > <nl> | Refactor tests to verify that a single folly target can be used successfully | facebook/folly | b0131bea126f9febe31c825fc4cd11d5d8996304 | 2015-05-26T18:31:47Z |
mmm a / tensorflow / go / op / wrappers . go <nl> ppp b / tensorflow / go / op / wrappers . go <nl> func DepthwiseConv2dNativeBackpropFilterDataFormat ( value string ) DepthwiseConv2d <nl> / / element on that dimension . The dimension order is determined by the value of <nl> / / ` data_format ` , see above for details . Dilations in the batch and depth <nl> / / dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func DepthwiseConv2dNativeBackpropFilterDilations ( value [ ] int64 ) DepthwiseConv2dNativeBackpropFilterAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func SampleDistortedBoundingBoxV2Seed2 ( value int64 ) SampleDistortedBoundingBoxV2 <nl> / / <nl> / / value : The cropped area of the image must have an aspect ratio = <nl> / / width / height within this range . <nl> - / / If not specified , defaults to { f : 0 . 75 f : 1 . 33 } <nl> + / / If not specified , defaults to { f : 0 . 75 f : 1 . 33 } <nl> func SampleDistortedBoundingBoxV2AspectRatioRange ( value [ ] float32 ) SampleDistortedBoundingBoxV2Attr { <nl> return func ( m optionalAttr ) { <nl> m [ " aspect_ratio_range " ] = value <nl> func SampleDistortedBoundingBoxV2AspectRatioRange ( value [ ] float32 ) SampleDistort <nl> / / <nl> / / value : The cropped area of the image must contain a fraction of the <nl> / / supplied image within this range . <nl> - / / If not specified , defaults to { f : 0 . 05 f : 1 } <nl> + / / If not specified , defaults to { f : 0 . 05 f : 1 } <nl> func SampleDistortedBoundingBoxV2AreaRange ( value [ ] float32 ) SampleDistortedBoundingBoxV2Attr { <nl> return func ( m optionalAttr ) { <nl> m [ " area_range " ] = value <nl> func SampleDistortedBoundingBoxMinObjectCovered ( value float32 ) SampleDistortedBo <nl> / / <nl> / / value : The cropped area of the image must have an aspect ratio = <nl> / / width / height within this range . <nl> - / / If not specified , defaults to { f : 0 . 75 f : 1 . 33 } <nl> + / / If not specified , defaults to { f : 0 . 75 f : 1 . 33 } <nl> func SampleDistortedBoundingBoxAspectRatioRange ( value [ ] float32 ) SampleDistortedBoundingBoxAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " aspect_ratio_range " ] = value <nl> func SampleDistortedBoundingBoxAspectRatioRange ( value [ ] float32 ) SampleDistorted <nl> / / <nl> / / value : The cropped area of the image must contain a fraction of the <nl> / / supplied image within this range . <nl> - / / If not specified , defaults to { f : 0 . 05 f : 1 } <nl> + / / If not specified , defaults to { f : 0 . 05 f : 1 } <nl> func SampleDistortedBoundingBoxAreaRange ( value [ ] float32 ) SampleDistortedBoundingBoxAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " area_range " ] = value <nl> func ImageSummaryMaxImages ( value int64 ) ImageSummaryAttr { <nl> / / ImageSummaryBadColor sets the optional bad_color attribute to value . <nl> / / <nl> / / value : Color to use for pixels with non - finite values . <nl> - / / If not specified , defaults to { dtype : DT_UINT8 tensor_shape : { dim : { size : 4 } } int_val : 255 int_val : 0 int_val : 0 int_val : 255 } <nl> + / / If not specified , defaults to { dtype : DT_UINT8 tensor_shape : { dim : { size : 4 } } int_val : 255 int_val : 0 int_val : 0 int_val : 255 } <nl> func ImageSummaryBadColor ( value tf . Tensor ) ImageSummaryAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " bad_color " ] = value <nl> func Conv3DBackpropFilterV2DataFormat ( value string ) Conv3DBackpropFilterV2Attr { <nl> / / filter element on that dimension . The dimension order is determined by the <nl> / / value of ` data_format ` , see above for details . Dilations in the batch and <nl> / / depth dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> func Conv3DBackpropFilterV2Dilations ( value [ ] int64 ) Conv3DBackpropFilterV2Attr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func Conv2DBackpropInputDataFormat ( value string ) Conv2DBackpropInputAttr { <nl> / / element on that dimension . The dimension order is determined by the value of <nl> / / ` data_format ` , see above for details . Dilations in the batch and depth <nl> / / dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func Conv2DBackpropInputDilations ( value [ ] int64 ) Conv2DBackpropInputAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func Conv2DDataFormat ( value string ) Conv2DAttr { <nl> / / filter element on that dimension . The dimension order is determined by the <nl> / / value of ` data_format ` , see above for details . Dilations in the batch and <nl> / / depth dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func Conv2DDilations ( value [ ] int64 ) Conv2DAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedDepthwiseConv2DWithBiasAndReluAndRequantizeOutType ( value tf . DataTy <nl> / / QuantizedDepthwiseConv2DWithBiasAndReluAndRequantizeDilations sets the optional dilations attribute to value . <nl> / / <nl> / / value : List of dilation values . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedDepthwiseConv2DWithBiasAndReluAndRequantizeDilations ( value [ ] int64 ) QuantizedDepthwiseConv2DWithBiasAndReluAndRequantizeAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedDepthwiseConv2DWithBiasAndReluOutType ( value tf . DataType ) Quantized <nl> / / QuantizedDepthwiseConv2DWithBiasAndReluDilations sets the optional dilations attribute to value . <nl> / / <nl> / / value : List of dilation values . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedDepthwiseConv2DWithBiasAndReluDilations ( value [ ] int64 ) QuantizedDepthwiseConv2DWithBiasAndReluAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedDepthwiseConv2DWithBiasOutType ( value tf . DataType ) QuantizedDepthwi <nl> / / QuantizedDepthwiseConv2DWithBiasDilations sets the optional dilations attribute to value . <nl> / / <nl> / / value : List of dilation values . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedDepthwiseConv2DWithBiasDilations ( value [ ] int64 ) QuantizedDepthwiseConv2DWithBiasAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedDepthwiseConv2DOutType ( value tf . DataType ) QuantizedDepthwiseConv2D <nl> / / QuantizedDepthwiseConv2DDilations sets the optional dilations attribute to value . <nl> / / <nl> / / value : List of dilation values . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedDepthwiseConv2DDilations ( value [ ] int64 ) QuantizedDepthwiseConv2DAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedConv2DPerChannelOutType ( value tf . DataType ) QuantizedConv2DPerChann <nl> / / QuantizedConv2DPerChannelDilations sets the optional dilations attribute to value . <nl> / / <nl> / / value : list of dilation values . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedConv2DPerChannelDilations ( value [ ] int64 ) QuantizedConv2DPerChannelAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func Conv3DBackpropInputV2DataFormat ( value string ) Conv3DBackpropInputV2Attr { <nl> / / filter element on that dimension . The dimension order is determined by the <nl> / / value of ` data_format ` , see above for details . Dilations in the batch and <nl> / / depth dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> func Conv3DBackpropInputV2Dilations ( value [ ] int64 ) Conv3DBackpropInputV2Attr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func DepthwiseConv2dNativeDataFormat ( value string ) DepthwiseConv2dNativeAttr { <nl> / / element on that dimension . The dimension order is determined by the value of <nl> / / ` data_format ` , see above for details . Dilations in the batch and depth <nl> / / dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func DepthwiseConv2dNativeDilations ( value [ ] int64 ) DepthwiseConv2dNativeAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func DepthwiseConv2dNative ( scope * Scope , input tf . Output , filter tf . Output , stri <nl> type Conv3DBackpropInputAttr func ( optionalAttr ) <nl> <nl> / / Conv3DBackpropInputDilations sets the optional dilations attribute to value . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> func Conv3DBackpropInputDilations ( value [ ] int64 ) Conv3DBackpropInputAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func DepthwiseConv2dNativeBackpropInputDataFormat ( value string ) DepthwiseConv2dN <nl> / / element on that dimension . The dimension order is determined by the value of <nl> / / ` data_format ` , see above for details . Dilations in the batch and depth <nl> / / dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func DepthwiseConv2dNativeBackpropInputDilations ( value [ ] int64 ) DepthwiseConv2dNativeBackpropInputAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedConv2DOutType ( value tf . DataType ) QuantizedConv2DAttr { <nl> / / filter element on that dimension . The dimension order is determined by the <nl> / / value of ` data_format ` , see above for details . Dilations in the batch and <nl> / / depth dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedConv2DDilations ( value [ ] int64 ) QuantizedConv2DAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func Conv3DDataFormat ( value string ) Conv3DAttr { <nl> / / filter element on that dimension . The dimension order is determined by the <nl> / / value of ` data_format ` , see above for details . Dilations in the batch and <nl> / / depth dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> func Conv3DDilations ( value [ ] int64 ) Conv3DAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func SparseReduceMax ( scope * Scope , input_indices tf . Output , input_values tf . Outp <nl> type Conv3DBackpropFilterAttr func ( optionalAttr ) <nl> <nl> / / Conv3DBackpropFilterDilations sets the optional dilations attribute to value . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> func Conv3DBackpropFilterDilations ( value [ ] int64 ) Conv3DBackpropFilterAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func Conv2DBackpropFilterDataFormat ( value string ) Conv2DBackpropFilterAttr { <nl> / / element on that dimension . The dimension order is determined by the value of <nl> / / ` data_format ` , see above for details . Dilations in the batch and depth <nl> / / dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func Conv2DBackpropFilterDilations ( value [ ] int64 ) Conv2DBackpropFilterAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> | Go : Update generated wrapper functions for TensorFlow ops . | tensorflow/tensorflow | 010bc7b9fe377ab3bdfe99f7263e10415848846d | 2020-02-01T06:49:13Z |
mmm a / xbmc / osx / IOSEAGLView . mm <nl> ppp b / xbmc / osx / IOSEAGLView . mm <nl> - ( CGFloat ) getScreenScale : ( UIScreen * ) screen <nl> } <nl> <nl> / / if no retina display scale detected yet - <nl> - / / ensure retina resolution on ipad3 <nl> + / / ensure retina resolution on ipad3 ' s mainScreen <nl> / / even on older iOS SDKs <nl> - if ( ret = = 1 . 0 & & DarwinIsIPad3 ( ) ) <nl> + if ( ret = = 1 . 0 & & screen = = [ UIScreen mainScreen ] & & DarwinIsIPad3 ( ) ) <nl> { <nl> ret = 2 . 0 ; / / iPad3 has scale factor 2 ( like iPod 4g , iPhone4 and iPhone4s ) <nl> } <nl> | [ ios ] - do the ipad3 retina fix only when we are queried for the mainScreen ( internal touch display ) | xbmc/xbmc | f6ab0c6151a59a783c9ff4f538e91f5f5b94e58d | 2012-05-29T17:40:56Z |
mmm a / PowerEditor / src / Notepad_plus . h <nl> ppp b / PowerEditor / src / Notepad_plus . h <nl> class Notepad_plus : public Window { <nl> case ' } ' : <nl> case ' | ' : <nl> case ' = ' : <nl> + case ' < ' : <nl> + case ' > ' : <nl> case ' \ \ ' : <nl> return false ; <nl> } <nl> mmm a / PowerEditor / src / ScitillaComponent / FindReplaceDlg . cpp <nl> ppp b / PowerEditor / src / ScitillaComponent / FindReplaceDlg . cpp <nl> int FindReplaceDlg : : processAll ( ProcessOperation op , const char * txt2find , const <nl> { <nl> int nbReplaced = 0 ; <nl> <nl> - if ( ! isCreated ( ) ) <nl> + if ( ! isCreated ( ) & & ! txt2find ) <nl> return nbReplaced ; <nl> if ( ( op = = ProcessReplaceAll ) & & ( * _ppEditView ) - > getCurrentBuffer ( ) . isReadOnly ( ) ) <nl> return nbReplaced ; <nl> int FindReplaceDlg : : processAll ( ProcessOperation op , const char * txt2find , const <nl> <nl> if ( op = = ProcessMarkAll ) / / if marking , check if purging is needed <nl> { <nl> - if ( ( _doStyleFoundToken ) & & ( _doPurge ) ) <nl> + if ( _doPurge ) { <nl> if ( _doMarkLine ) <nl> ( * _ppEditView ) - > execute ( SCI_MARKERDELETEALL , MARK_BOOKMARK ) ; <nl> <nl> if ( _doStyleFoundToken ) <nl> - { <nl> - ( * _ppEditView ) - > clearIndicator ( SCE_UNIVERSAL_FOUND_STYLE ) ; <nl> - } <nl> - if ( _doStyleFoundToken ) <nl> - { <nl> - ( * _ppEditView ) - > execute ( SCI_SETLEXER , SCLEX_NULL ) ; <nl> + ( * _ppEditView ) - > clearIndicator ( SCE_UNIVERSAL_FOUND_STYLE ) ; <nl> } <nl> } <nl> <nl> | Add lt and gt chars to isWordChar check . | notepad-plus-plus/notepad-plus-plus | 4dd8870891525172071f3b77ec09bebd7235fef4 | 2008-04-22T23:36:11Z |
mmm a / src / proto / census / census . options <nl> ppp b / src / proto / census / census . options <nl> <nl> google . census . Tag . key max_size : 255 <nl> google . census . Tag . value max_size : 255 <nl> - google . census . View . tag_keys max_count 15 <nl> \ No newline at end of file <nl> + google . census . View . tag_keys max_count 15 <nl> | add missing newline | grpc/grpc | 3e97668d8266c8d20d4de78771bbd615a79b976d | 2016-05-26T00:39:00Z |
mmm a / src / core / console_user_server / karabiner_console_user_server . xcodeproj / project . pbxproj <nl> ppp b / src / core / console_user_server / karabiner_console_user_server . xcodeproj / project . pbxproj <nl> <nl> 3492C9BC1D772D8B0055988F / * filesystem . hpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . h ; name = filesystem . hpp ; path = . . / . . / share / filesystem . hpp ; sourceTree = SOURCE_ROOT ; } ; <nl> 349950651D898530004FE466 / * system_preferences_monitor . hpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . h ; name = system_preferences_monitor . hpp ; path = . . / . . / share / system_preferences_monitor . hpp ; sourceTree = SOURCE_ROOT ; } ; <nl> 34A88A971D685A4600DD480B / * connection_manager . hpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . h ; name = connection_manager . hpp ; path = include / connection_manager . hpp ; sourceTree = SOURCE_ROOT ; } ; <nl> - 34A88A981D685A4600DD480B / * grabber_client . hpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . h ; name = grabber_client . hpp ; path = include / grabber_client . hpp ; sourceTree = SOURCE_ROOT ; } ; <nl> + 34A88A981D685A4600DD480B / * grabber_client . hpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . h ; name = grabber_client . hpp ; path = . . / . . / share / grabber_client . hpp ; sourceTree = SOURCE_ROOT ; } ; <nl> 34A88A9A1D685A4600DD480B / * keyboard_event_output_manager . hpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . h ; name = keyboard_event_output_manager . hpp ; path = include / keyboard_event_output_manager . hpp ; sourceTree = SOURCE_ROOT ; } ; <nl> 34A88A9B1D685A4600DD480B / * logger . hpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . h ; name = logger . hpp ; path = include / logger . hpp ; sourceTree = SOURCE_ROOT ; } ; <nl> 34A88A9C1D685A4600DD480B / * receiver . hpp * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . cpp . h ; name = receiver . hpp ; path = include / receiver . hpp ; sourceTree = SOURCE_ROOT ; } ; <nl> <nl> 345A9DE31D7DD6E600578F84 / * configuration_manager . hpp * / , <nl> 341F59CC1D516B1500B441A8 / * constants . hpp * / , <nl> 3492C9BC1D772D8B0055988F / * filesystem . hpp * / , <nl> + 34A88A981D685A4600DD480B / * grabber_client . hpp * / , <nl> 3492C9B61D752C820055988F / * hid_system_client . hpp * / , <nl> 341F59DB1D57789500B441A8 / * iokit_utility . hpp * / , <nl> 34A88AA01D685A5C00DD480B / * karabiner_version . h * / , <nl> <nl> isa = PBXGroup ; <nl> children = ( <nl> 34A88A971D685A4600DD480B / * connection_manager . hpp * / , <nl> - 34A88A981D685A4600DD480B / * grabber_client . hpp * / , <nl> 34A88A9A1D685A4600DD480B / * keyboard_event_output_manager . hpp * / , <nl> 34A88A9B1D685A4600DD480B / * logger . hpp * / , <nl> 34A88A9C1D685A4600DD480B / * receiver . hpp * / , <nl> similarity index 100 % <nl> rename from src / core / console_user_server / include / grabber_client . hpp <nl> rename to src / share / grabber_client . hpp <nl> | mv grabber_client . hpp to share | pqrs-org/Karabiner-Elements | 40405af88612202f170e6739e6f6d1289369c761 | 2016-09-15T11:31:55Z |
mmm a / src / JSON . cc <nl> ppp b / src / JSON . cc <nl> JSON : : Parser : : ~ Parser ( ) <nl> * / <nl> void JSON : : Parser : : parse ( JSON & result ) <nl> { <nl> - if ( _buffer = = nullptr ) <nl> - { <nl> - error ( " unexpected end of file " ) ; <nl> - } <nl> - <nl> switch ( _current ) <nl> { <nl> case ( ' { ' ) : <nl> mmm a / test / JSON_unit . cc <nl> ppp b / test / JSON_unit . cc <nl> TEST_CASE ( " Parser " ) <nl> CHECK_THROWS_AS ( JSON : : parse ( " infinity " ) , std : : invalid_argument ) ; <nl> } <nl> <nl> + SECTION ( " number ( float ) " ) <nl> + { <nl> + / / accept the exact values <nl> + CHECK ( JSON : : parse ( " 0 . 5 " ) = = JSON ( 0 . 5 ) ) ; <nl> + CHECK ( JSON : : parse ( " - 0 . 5 " ) = = JSON ( - 0 . 5 ) ) ; <nl> + CHECK ( JSON : : parse ( " 1 . 5 " ) = = JSON ( 1 . 5 ) ) ; <nl> + CHECK ( JSON : : parse ( " - 1 . 5 " ) = = JSON ( - 1 . 5 ) ) ; <nl> + CHECK ( JSON : : parse ( " 12345678 . 5 " ) = = JSON ( 12345678 . 5 ) ) ; <nl> + CHECK ( JSON : : parse ( " - 12345678 . 5 " ) = = JSON ( - 12345678 . 5 ) ) ; <nl> + <nl> + CHECK ( JSON : : parse ( " 17 . 5e0 " ) = = JSON ( 17 . 5 ) ) ; <nl> + CHECK ( JSON : : parse ( " 17 . 5e1 " ) = = JSON ( 175 ) ) ; <nl> + CHECK ( JSON : : parse ( " 17 . 5e3 " ) = = JSON ( 17500 ) ) ; <nl> + CHECK ( JSON : : parse ( " 17 . 5e + 0 " ) = = JSON ( 17 . 5 ) ) ; <nl> + CHECK ( JSON : : parse ( " 17 . 5e + 1 " ) = = JSON ( 175 ) ) ; <nl> + CHECK ( JSON : : parse ( " 17 . 5e + 3 " ) = = JSON ( 17500 ) ) ; <nl> + CHECK ( JSON : : parse ( " 17 . 5E0 " ) = = JSON ( 17 . 5 ) ) ; <nl> + CHECK ( JSON : : parse ( " 17 . 5E1 " ) = = JSON ( 175 ) ) ; <nl> + CHECK ( JSON : : parse ( " 17 . 5E3 " ) = = JSON ( 17500 ) ) ; <nl> + CHECK ( JSON : : parse ( " 17 . 5E + 0 " ) = = JSON ( 17 . 5 ) ) ; <nl> + CHECK ( JSON : : parse ( " 17 . 5E + 1 " ) = = JSON ( 175 ) ) ; <nl> + CHECK ( JSON : : parse ( " 17 . 5E + 3 " ) = = JSON ( 17500 ) ) ; <nl> + CHECK ( JSON : : parse ( " 10000 . 5e - 0 " ) = = JSON ( 10000 . 5 ) ) ; <nl> + CHECK ( JSON : : parse ( " 10000 . 5e - 1 " ) = = JSON ( 1000 . 05 ) ) ; <nl> + CHECK ( JSON : : parse ( " 10000 . 5e - 4 " ) = = JSON ( 1 . 00005 ) ) ; <nl> + CHECK ( JSON : : parse ( " 10000 . 5E - 0 " ) = = JSON ( 10000 . 5 ) ) ; <nl> + CHECK ( JSON : : parse ( " 10000 . 5E - 1 " ) = = JSON ( 1000 . 05 ) ) ; <nl> + CHECK ( JSON : : parse ( " 10000 . 5E - 4 " ) = = JSON ( 1 . 00005 ) ) ; <nl> + } <nl> + <nl> SECTION ( " parse from C + + string " ) <nl> { <nl> std : : string s = " { \ " foo \ " : [ 1 , 2 , true ] } " ; <nl> | + more test cases | nlohmann/json | d3216300b278ce893b01200fe4f16b63f2231d16 | 2014-12-28T16:26:33Z |
mmm a / stdlib / public / runtime / ProtocolConformance . cpp <nl> ppp b / stdlib / public / runtime / ProtocolConformance . cpp <nl> swift_conformsToProtocolImpl ( const Metadata * const type , <nl> if ( ! description ) <nl> return nullptr ; <nl> <nl> - return description - > getWitnessTable ( type ) ; <nl> + return description - > getWitnessTable ( <nl> + findConformingSuperclass ( type , description ) ) ; <nl> } <nl> <nl> const ContextDescriptor * <nl> new file mode 100644 <nl> index 000000000000 . . 757d2865b238 <nl> mmm / dev / null <nl> ppp b / test / Runtime / associated_type_demangle_inherited . swift <nl> <nl> + / / RUN : % empty - directory ( % t ) <nl> + / / RUN : % target - build - swift - parse - stdlib % s - module - name main - o % t / a . out <nl> + / / RUN : % target - codesign % t / a . out <nl> + / / RUN : % target - run % t / a . out <nl> + / / REQUIRES : executable_test <nl> + <nl> + import Swift <nl> + import StdlibUnittest <nl> + <nl> + class Key < T > : RawRepresentable { <nl> + typealias RawValue = T <nl> + <nl> + let rawValue : T <nl> + <nl> + required init ( rawValue : T ) { <nl> + self . rawValue = rawValue <nl> + } <nl> + } <nl> + <nl> + extension Key : Hashable where T : Hashable { <nl> + func hash ( into hasher : inout Hasher ) { <nl> + hasher . combine ( rawValue ) <nl> + } <nl> + } <nl> + <nl> + extension Key : Equatable where T : Equatable { <nl> + static func = = ( lhs : Key , rhs : Key ) - > Bool { <nl> + return lhs . rawValue = = rhs . rawValue <nl> + } <nl> + } <nl> + <nl> + class SpecificKey : Key < String > { } <nl> + <nl> + extension SpecificKey { <nl> + static let name = SpecificKey ( rawValue : " name " ) <nl> + } <nl> + <nl> + let AssociatedTypeDemangleTests = TestSuite ( " AssociatedTypeDemangle " ) <nl> + <nl> + AssociatedTypeDemangleTests . test ( " superclass substitutions " ) { <nl> + var dictionary : [ SpecificKey : String ] = [ : ] <nl> + dictionary [ SpecificKey . name ] = " Hello " <nl> + <nl> + expectEqual ( [ " Hello " ] , dictionary . values . map { $ 0 } ) <nl> + } <nl> + <nl> + runAllTests ( ) <nl> | Merge pull request from DougGregor / runtime - conforming - type - instantiation | apple/swift | 9d573b65d05cdbfa0be854074417c8a54c54be85 | 2019-05-14T06:33:46Z |
mmm a / electron . gyp <nl> ppp b / electron . gyp <nl> <nl> ' action ' : [ <nl> ' npm ' , <nl> ' run ' , <nl> + ' - - silent ' , <nl> ' browserify ' , <nl> ' - - ' , <nl> ' lib / sandboxed_renderer / init . js ' , <nl> | Run browserify with - - silent | electron/electron | 3e34760eef74e7b1860c56ed4771da2d55a80596 | 2016-11-07T16:19:59Z |
mmm a / lib / SILPasses / CMakeLists . txt <nl> ppp b / lib / SILPasses / CMakeLists . txt <nl> add_swift_library ( swiftSILPasses <nl> SILCombinerVisitors . cpp <nl> SILCombinerBuiltinVisitors . cpp <nl> SILCombinerCastVisitors . cpp <nl> + SILCombinerApplyVisitors . cpp <nl> SILLowerAggregateInstrs . cpp <nl> SILMem2Reg . cpp <nl> SILSROA . cpp <nl> new file mode 100644 <nl> index 000000000000 . . d0454de3d96a <nl> mmm / dev / null <nl> ppp b / lib / SILPasses / SILCombinerApplyVisitors . cpp <nl> <nl> + / / = = = mmm SILCombinerApplyVisitors . cpp mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / <nl> + / / This source file is part of the Swift . org open source project <nl> + / / <nl> + / / Copyright ( c ) 2014 - 2015 Apple Inc . and the Swift project authors <nl> + / / Licensed under Apache License v2 . 0 with Runtime Library Exception <nl> + / / <nl> + / / See http : / / swift . org / LICENSE . txt for license information <nl> + / / See http : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> + / / <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + # define DEBUG_TYPE " sil - combine " <nl> + # include " SILCombiner . h " <nl> + # include " swift / SIL / DynamicCasts . h " <nl> + # include " swift / SIL / PatternMatch . h " <nl> + # include " swift / SIL / Projection . h " <nl> + # include " swift / SIL / SILBuilder . h " <nl> + # include " swift / SIL / SILVisitor . h " <nl> + # include " swift / SIL / DebugUtils . h " <nl> + # include " swift / SILAnalysis / AliasAnalysis . h " <nl> + # include " swift / SILAnalysis / ARCAnalysis . h " <nl> + # include " swift / SILAnalysis / CFG . h " <nl> + # include " swift / SILAnalysis / ValueTracking . h " <nl> + # include " swift / SILPasses / Utils / Local . h " <nl> + # include " llvm / ADT / SmallPtrSet . h " <nl> + # include " llvm / ADT / SmallVector . h " <nl> + # include " llvm / ADT / DenseMap . h " <nl> + <nl> + using namespace swift ; <nl> + using namespace swift : : PatternMatch ; <nl> + <nl> + / / / Check that this is a partial apply of a reabstraction thunk and return the <nl> + / / / argument of the partial apply if it is . <nl> + static SILValue <nl> + isPartialApplyOfReabstractionThunk ( PartialApplyInst * PAI , bool requireSingleUse ) { <nl> + if ( requireSingleUse ) { <nl> + SILValue PAIVal ( PAI , 0 ) ; <nl> + if ( ! hasOneNonDebugUse ( PAIVal ) ) <nl> + return SILValue ( ) ; <nl> + } <nl> + <nl> + if ( PAI - > getNumArguments ( ) ! = 1 ) <nl> + return SILValue ( ) ; <nl> + <nl> + auto * FRI = dyn_cast < FunctionRefInst > ( PAI - > getCallee ( ) ) ; <nl> + if ( ! FRI ) <nl> + return SILValue ( ) ; <nl> + auto * Fun = FRI - > getReferencedFunction ( ) ; <nl> + if ( ! Fun ) <nl> + return SILValue ( ) ; <nl> + <nl> + / / Make sure we have a reabstraction thunk . <nl> + if ( Fun - > isThunk ( ) ! = IsReabstractionThunk ) <nl> + return SILValue ( ) ; <nl> + <nl> + / / The argument should be a closure . <nl> + auto Arg = PAI - > getArgument ( 0 ) ; <nl> + if ( ! Arg . getType ( ) . is < SILFunctionType > ( ) | | <nl> + ! Arg . getType ( ) . isReferenceCounted ( PAI - > getFunction ( ) - > getModule ( ) ) ) <nl> + return SILValue ( ) ; <nl> + <nl> + return PAI - > getArgument ( 0 ) ; <nl> + } <nl> + <nl> + / / / Remove pointless reabstraction thunk closures . <nl> + / / / partial_apply % reabstraction_thunk_typeAtoB ( <nl> + / / / partial_apply % reabstraction_thunk_typeBtoA % closure_typeB ) ) <nl> + / / / - > <nl> + / / / % closure_typeB <nl> + static bool foldInverseReabstractionThunks ( PartialApplyInst * PAI , <nl> + SILCombiner * Combiner ) { <nl> + auto PAIArg = isPartialApplyOfReabstractionThunk ( PAI , false ) ; <nl> + if ( ! PAIArg ) <nl> + return false ; <nl> + <nl> + auto * PAI2 = dyn_cast < PartialApplyInst > ( PAIArg ) ; <nl> + if ( ! PAI2 ) <nl> + return false ; <nl> + <nl> + auto PAI2Arg = isPartialApplyOfReabstractionThunk ( PAI2 , true ) ; <nl> + if ( ! PAI2Arg ) <nl> + return false ; <nl> + <nl> + / / The types must match . <nl> + if ( PAI - > getType ( ) ! = PAI2 - > getArgument ( 0 ) . getType ( ) ) <nl> + return false ; <nl> + <nl> + / / Replace the partial_apply ( partial_apply ( X ) ) by X and remove the <nl> + / / partial_applies . <nl> + <nl> + Combiner - > replaceInstUsesWith ( * PAI , PAI2 - > getArgument ( 0 ) . getDef ( ) ) ; <nl> + Combiner - > eraseInstFromFunction ( * PAI ) ; <nl> + assert ( hasNoUsesExceptDebug ( PAI2 ) & & " Should not have any uses " ) ; <nl> + Combiner - > eraseInstFromFunction ( * PAI2 ) ; <nl> + <nl> + return true ; <nl> + } <nl> + <nl> + SILInstruction * SILCombiner : : visitPartialApplyInst ( PartialApplyInst * PAI ) { <nl> + / / partial_apply without any substitutions or arguments is just a <nl> + / / thin_to_thick_function . <nl> + if ( ! PAI - > hasSubstitutions ( ) & & ( PAI - > getNumArguments ( ) = = 0 ) ) <nl> + return Builder . createThinToThickFunction ( PAI - > getLoc ( ) , PAI - > getCallee ( ) , <nl> + PAI - > getType ( ) ) ; <nl> + <nl> + / / partial_apply % reabstraction_thunk_typeAtoB ( <nl> + / / partial_apply % reabstraction_thunk_typeBtoA % closure_typeB ) ) <nl> + / / - > % closure_typeB <nl> + if ( foldInverseReabstractionThunks ( PAI , this ) ) <nl> + return nullptr ; <nl> + <nl> + tryOptimizeApplyOfPartialApply ( PAI ) ; <nl> + <nl> + / / Try to delete dead closures . <nl> + tryDeleteDeadClosure ( <nl> + PAI , InstModCallbacks ( <nl> + [ this ] ( SILInstruction * DeadInst ) { <nl> + eraseInstFromFunction ( * DeadInst ) ; <nl> + } , <nl> + [ this ] ( SILInstruction * NewInst ) { Worklist . add ( NewInst ) ; } ) ) ; <nl> + return nullptr ; <nl> + } <nl> + <nl> + static bool canCombinePartialApply ( const PartialApplyInst * PAI ) { <nl> + / / Only process partial apply if the callee is a known function . <nl> + auto * FRI = dyn_cast < FunctionRefInst > ( PAI - > getCallee ( ) ) ; <nl> + if ( ! FRI ) <nl> + return false ; <nl> + <nl> + / / Make sure that the substitution list of the PAI does not contain any <nl> + / / archetypes . <nl> + ArrayRef < Substitution > Subs = PAI - > getSubstitutions ( ) ; <nl> + for ( Substitution S : Subs ) <nl> + if ( S . getReplacement ( ) - > getCanonicalType ( ) - > hasArchetype ( ) ) <nl> + return false ; <nl> + <nl> + return true ; <nl> + } <nl> + <nl> + / / Helper class performing the apply { partial_apply ( x , y ) } ( z ) - > apply ( z , x , y ) <nl> + / / peephole . <nl> + class PartialApplyCombiner { <nl> + / / True if temporaries are not created yet . <nl> + bool isFirstTime = true ; <nl> + <nl> + / / partial_apply which is being processed . <nl> + PartialApplyInst * PAI ; <nl> + <nl> + / / Temporaries created as copies of alloc_stack arguments of <nl> + / / the partial_apply . <nl> + SmallVector < SILValue , 8 > Tmps ; <nl> + <nl> + / / Mapping from the original argument of partial_apply to <nl> + / / the temporary containing its copy . <nl> + llvm : : DenseMap < SILValue , SILValue > ArgToTmp ; <nl> + <nl> + / / Set of lifetime endpoints for this partial_apply . <nl> + / / <nl> + / / Used to find the last uses of partial_apply , which is need to insert <nl> + / / releases / destroys of temporaries as early as possible . If no releases are <nl> + / / needed , Lifetime remains empty . <nl> + ValueLifetime Lifetime ; <nl> + <nl> + SILBuilder & Builder ; <nl> + <nl> + CallGraph * CG ; <nl> + <nl> + / / Function referenced by partial_apply . <nl> + FunctionRefInst * FRI ; <nl> + <nl> + SILCombiner * SilCombiner ; <nl> + <nl> + void processSingleApply ( FullApplySite AI ) ; <nl> + void allocateTemporaries ( ) ; <nl> + void deallocateTemporaries ( ) ; <nl> + void releaseTemporaries ( ) ; <nl> + <nl> + public : <nl> + PartialApplyCombiner ( PartialApplyInst * PAI , SILBuilder & Builder , <nl> + CallGraph * CG , SILCombiner * SilCombiner ) <nl> + : isFirstTime ( true ) , PAI ( PAI ) , Builder ( Builder ) , CG ( CG ) , <nl> + FRI ( nullptr ) , SilCombiner ( SilCombiner ) { } <nl> + SILInstruction * combine ( ) ; <nl> + } ; <nl> + <nl> + void PartialApplyCombiner : : allocateTemporaries ( ) { <nl> + / / Copy non - inout alloc_stack arguments of the partial_apply into <nl> + / / newly created temporaries and use these temporaries instead of <nl> + / / the original arguments afterwards . <nl> + / / This is done to " extend " the life - time of original alloc_stack <nl> + / / arguments , as they may be deallocated before the last use by one <nl> + / / of the apply instructions . <nl> + / / TODO : <nl> + / / Copy arguments of the partial_apply into new temporaries <nl> + / / only if the lifetime of arguments ends before their uses <nl> + / / by apply instructions . <nl> + bool needsReleases = false ; <nl> + CanSILFunctionType PAITy = <nl> + dyn_cast < SILFunctionType > ( PAI - > getCallee ( ) . getType ( ) . getSwiftType ( ) ) ; <nl> + <nl> + / / Emit a destroy value for each captured closure argument . <nl> + ArrayRef < SILParameterInfo > Params = PAITy - > getParameters ( ) ; <nl> + auto Args = PAI - > getArguments ( ) ; <nl> + unsigned Delta = Params . size ( ) - Args . size ( ) ; <nl> + <nl> + for ( unsigned AI = 0 , AE = Args . size ( ) ; AI ! = AE ; + + AI ) { <nl> + SILValue Arg = Args [ AI ] ; <nl> + SILParameterInfo Param = Params [ AI + Delta ] ; <nl> + if ( Param . isIndirectInOut ( ) ) <nl> + continue ; <nl> + if ( isa < AllocStackInst > ( Arg ) ) { <nl> + Builder . setInsertionPoint ( PAI - > getFunction ( ) - > begin ( ) - > begin ( ) ) ; <nl> + / / Create a new temporary at the beginning of a function . <nl> + auto * Tmp = Builder . createAllocStack ( PAI - > getLoc ( ) , Arg . getType ( ) ) ; <nl> + Builder . setInsertionPoint ( PAI ) ; <nl> + / / Copy argument into this temporary . <nl> + Builder . createCopyAddr ( PAI - > getLoc ( ) , Arg , SILValue ( Tmp , 1 ) , <nl> + IsTake_t : : IsNotTake , <nl> + IsInitialization_t : : IsInitialization ) ; <nl> + <nl> + Tmps . push_back ( SILValue ( Tmp , 0 ) ) ; <nl> + if ( ! Arg . getType ( ) . isTrivial ( PAI - > getModule ( ) ) ) <nl> + needsReleases = true ; <nl> + ArgToTmp . insert ( std : : make_pair ( Arg , SILValue ( Tmp , 0 ) ) ) ; <nl> + } <nl> + } <nl> + <nl> + if ( needsReleases ) { <nl> + / / Compute the set of endpoints , which will be used <nl> + / / to insert releases of temporaries . <nl> + ValueLifetimeAnalysis VLA ( PAI ) ; <nl> + Lifetime = VLA . computeFromDirectUses ( ) ; <nl> + } <nl> + } <nl> + <nl> + / / / Emit dealloc_stack for all temporaries . <nl> + void PartialApplyCombiner : : deallocateTemporaries ( ) { <nl> + / / Insert dealloc_stack instructions . <nl> + TinyPtrVector < SILBasicBlock * > ExitBBs ; <nl> + findAllNonFailureExitBBs ( PAI - > getFunction ( ) , ExitBBs ) ; <nl> + <nl> + for ( auto Op : Tmps ) { <nl> + for ( auto * ExitBB : ExitBBs ) { <nl> + auto * Term = ExitBB - > getTerminator ( ) ; <nl> + Builder . setInsertionPoint ( Term ) ; <nl> + Builder . createDeallocStack ( PAI - > getLoc ( ) , Op ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + / / / Emit code to release / destory temporaries . <nl> + void PartialApplyCombiner : : releaseTemporaries ( ) { <nl> + / / Insert releases and destroy_addrs as early as possible , <nl> + / / because we don ' t want to keep objects alive longer than <nl> + / / its really needed . <nl> + for ( auto Op : Tmps ) { <nl> + auto TmpType = Op . getType ( ) . getObjectType ( ) ; <nl> + if ( TmpType . isTrivial ( PAI - > getModule ( ) ) ) <nl> + continue ; <nl> + for ( auto * EndPoint : Lifetime . LastUsers ) { <nl> + Builder . setInsertionPoint ( next ( SILBasicBlock : : iterator ( EndPoint ) ) ) ; <nl> + auto TmpAddr = SILValue ( Op . getDef ( ) , 1 ) ; <nl> + if ( ! TmpType . isAddressOnly ( PAI - > getModule ( ) ) ) { <nl> + auto * Load = Builder . createLoad ( PAI - > getLoc ( ) , TmpAddr ) ; <nl> + Builder . createReleaseValue ( PAI - > getLoc ( ) , Load ) ; <nl> + } else { <nl> + Builder . createDestroyAddr ( PAI - > getLoc ( ) , TmpAddr ) ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + <nl> + / / / Process an apply instruction which uses a partial_apply <nl> + / / / as its callee . <nl> + void PartialApplyCombiner : : processSingleApply ( FullApplySite AI ) { <nl> + Builder . setInsertionPoint ( AI . getInstruction ( ) ) ; <nl> + <nl> + / / Prepare the args . <nl> + SmallVector < SILValue , 8 > Args ; <nl> + / / First the ApplyInst args . <nl> + for ( auto Op : AI . getArguments ( ) ) <nl> + Args . push_back ( Op ) ; <nl> + <nl> + SILInstruction * InsertionPoint = Builder . getInsertionPoint ( ) ; <nl> + / / Next , the partial apply args . <nl> + <nl> + / / Pre - process partial_apply arguments only once , lazily . <nl> + if ( isFirstTime ) { <nl> + isFirstTime = false ; <nl> + allocateTemporaries ( ) ; <nl> + } <nl> + <nl> + / / Now , copy over the partial apply args . <nl> + for ( auto Op : PAI - > getArguments ( ) ) { <nl> + auto Arg = Op ; <nl> + / / If there is new temporary for this argument , use it instead . <nl> + if ( isa < AllocStackInst > ( Arg ) ) { <nl> + if ( ArgToTmp . count ( Arg ) ) { <nl> + auto Tmp = ArgToTmp . lookup ( Arg ) ; <nl> + Op = SILValue ( Tmp . getDef ( ) , 1 ) ; <nl> + } <nl> + } <nl> + Args . push_back ( Op ) ; <nl> + } <nl> + <nl> + Builder . setInsertionPoint ( InsertionPoint ) ; <nl> + <nl> + / / The thunk that implements the partial apply calls the closure function <nl> + / / that expects all arguments to be consumed by the function . However , the <nl> + / / captured arguments are not arguments of * this * apply , so they are not <nl> + / / pre - incremented . When we combine the partial_apply and this apply into <nl> + / / a new apply we need to retain all of the closure non - address type <nl> + / / arguments . <nl> + for ( auto Arg : PAI - > getArguments ( ) ) <nl> + if ( ! Arg . getType ( ) . isAddress ( ) ) <nl> + Builder . emitRetainValueOperation ( PAI - > getLoc ( ) , Arg ) ; <nl> + <nl> + auto * F = FRI - > getReferencedFunction ( ) ; <nl> + SILType FnType = F - > getLoweredType ( ) ; <nl> + SILType ResultTy = F - > getLoweredFunctionType ( ) - > getSILResult ( ) ; <nl> + ArrayRef < Substitution > Subs = PAI - > getSubstitutions ( ) ; <nl> + if ( ! Subs . empty ( ) ) { <nl> + FnType = FnType . substGenericArgs ( PAI - > getModule ( ) , Subs ) ; <nl> + ResultTy = FnType . getAs < SILFunctionType > ( ) - > getSILResult ( ) ; <nl> + } <nl> + <nl> + FullApplySite NAI ; <nl> + if ( auto * TAI = dyn_cast < TryApplyInst > ( AI ) ) <nl> + NAI = <nl> + Builder . createTryApply ( AI . getLoc ( ) , FRI , FnType , Subs , Args , <nl> + TAI - > getNormalBB ( ) , TAI - > getErrorBB ( ) ) ; <nl> + else <nl> + NAI = <nl> + Builder . createApply ( AI . getLoc ( ) , FRI , FnType , ResultTy , Subs , Args , <nl> + cast < ApplyInst > ( AI ) - > isNonThrowing ( ) ) ; <nl> + <nl> + NAI . getInstruction ( ) - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> + <nl> + CallGraphEditor ( CG ) . addEdgesForApply ( NAI ) ; <nl> + <nl> + / / We also need to release the partial_apply instruction itself because it <nl> + / / is consumed by the apply_instruction . <nl> + if ( auto * TAI = dyn_cast < TryApplyInst > ( AI ) ) { <nl> + Builder . setInsertionPoint ( TAI - > getNormalBB ( ) - > begin ( ) ) ; <nl> + Builder . createStrongRelease ( AI . getLoc ( ) , PAI ) <nl> + - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> + Builder . setInsertionPoint ( TAI - > getErrorBB ( ) - > begin ( ) ) ; <nl> + Builder . createStrongRelease ( AI . getLoc ( ) , PAI ) <nl> + - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> + Builder . setInsertionPoint ( AI . getInstruction ( ) ) ; <nl> + } else { <nl> + Builder . createStrongRelease ( AI . getLoc ( ) , PAI ) <nl> + - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> + } <nl> + / / Update the set endpoints . <nl> + if ( Lifetime . LastUsers . count ( AI . getInstruction ( ) ) ) { <nl> + Lifetime . LastUsers . remove ( AI . getInstruction ( ) ) ; <nl> + Lifetime . LastUsers . insert ( NAI . getInstruction ( ) ) ; <nl> + } <nl> + <nl> + SilCombiner - > replaceInstUsesWith ( * AI . getInstruction ( ) , NAI . getInstruction ( ) ) ; <nl> + SilCombiner - > eraseInstFromFunction ( * AI . getInstruction ( ) ) ; <nl> + } <nl> + <nl> + / / / Perform the apply { partial_apply ( x , y ) } ( z ) - > apply ( z , x , y ) peephole <nl> + / / / by iterating over all uses of the partial_apply and searching <nl> + / / / for the pattern to transform . <nl> + SILInstruction * PartialApplyCombiner : : combine ( ) { <nl> + if ( ! canCombinePartialApply ( PAI ) ) <nl> + return nullptr ; <nl> + <nl> + / / Only process partial apply if the callee is a known function . <nl> + FRI = dyn_cast < FunctionRefInst > ( PAI - > getCallee ( ) ) ; <nl> + <nl> + / / Iterate over all uses of the partial_apply <nl> + / / and look for applies that use it as a callee . <nl> + for ( auto Use : PAI - > getUses ( ) ) { <nl> + auto User = Use - > getUser ( ) ; <nl> + / / If this use of a partial_apply is not <nl> + / / an apply which uses it as a callee , bail . <nl> + auto AI = FullApplySite : : isa ( User ) ; <nl> + if ( ! AI ) <nl> + continue ; <nl> + <nl> + if ( AI . getCallee ( ) ! = PAI ) <nl> + continue ; <nl> + <nl> + / / We cannot handle generic apply yet . Bail . <nl> + if ( AI . hasSubstitutions ( ) ) <nl> + continue ; <nl> + <nl> + processSingleApply ( AI ) ; <nl> + } <nl> + <nl> + / / release / destroy and deallocate introduced temporaries . <nl> + if ( ! Tmps . empty ( ) ) { <nl> + releaseTemporaries ( ) ; <nl> + deallocateTemporaries ( ) ; <nl> + } <nl> + <nl> + return nullptr ; <nl> + } <nl> + <nl> + / / / Iterate over all uses of a given partial_apply and check <nl> + / / / if any of those uses are apply instructions . Try to <nl> + / / / combine those applies with this partial_apply . <nl> + SILInstruction * <nl> + SILCombiner : : tryOptimizeApplyOfPartialApply ( PartialApplyInst * PAI ) { <nl> + <nl> + PartialApplyCombiner PACombiner ( PAI , Builder , CG , this ) ; <nl> + return PACombiner . combine ( ) ; <nl> + } <nl> + <nl> + SILInstruction * <nl> + SILCombiner : : optimizeApplyOfConvertFunctionInst ( FullApplySite AI , <nl> + ConvertFunctionInst * CFI ) { <nl> + / / We only handle simplification of static function references . If we don ' t <nl> + / / have one , bail . <nl> + FunctionRefInst * FRI = dyn_cast < FunctionRefInst > ( CFI - > getOperand ( ) ) ; <nl> + if ( ! FRI ) <nl> + return nullptr ; <nl> + <nl> + / / Grab our relevant callee types . . . <nl> + CanSILFunctionType SubstCalleeTy = AI . getSubstCalleeType ( ) ; <nl> + auto ConvertCalleeTy = <nl> + CFI - > getOperand ( ) . getType ( ) . castTo < SILFunctionType > ( ) ; <nl> + <nl> + / / . . . and make sure they have no unsubstituted generics . If they do , bail . <nl> + if ( SubstCalleeTy - > hasArchetype ( ) | | ConvertCalleeTy - > hasArchetype ( ) ) <nl> + return nullptr ; <nl> + <nl> + / / Ok , we can now perform our transformation . Grab AI ' s operands and the <nl> + / / relevant types from the ConvertFunction function type and AI . <nl> + OperandValueArrayRef Ops = AI . getArgumentsWithoutIndirectResult ( ) ; <nl> + auto OldOpTypes = SubstCalleeTy - > getParameterSILTypes ( ) ; <nl> + auto NewOpTypes = ConvertCalleeTy - > getParameterSILTypes ( ) ; <nl> + <nl> + assert ( Ops . size ( ) = = OldOpTypes . size ( ) & & <nl> + " Ops and op types must have same size . " ) ; <nl> + assert ( Ops . size ( ) = = NewOpTypes . size ( ) & & <nl> + " Ops and op types must have same size . " ) ; <nl> + <nl> + llvm : : SmallVector < SILValue , 8 > Args ; <nl> + for ( unsigned i = 0 , e = Ops . size ( ) ; i ! = e ; + + i ) { <nl> + SILValue Op = Ops [ i ] ; <nl> + SILType OldOpType = OldOpTypes [ i ] ; <nl> + SILType NewOpType = NewOpTypes [ i ] ; <nl> + <nl> + / / Convert function takes refs to refs , address to addresses , and leaves <nl> + / / other types alone . <nl> + if ( OldOpType . isAddress ( ) ) { <nl> + assert ( NewOpType . isAddress ( ) & & " Addresses should map to addresses . " ) ; <nl> + auto UAC = Builder . createUncheckedAddrCast ( AI . getLoc ( ) , Op , NewOpType ) ; <nl> + UAC - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> + Args . push_back ( UAC ) ; <nl> + } else if ( OldOpType . isHeapObjectReferenceType ( ) ) { <nl> + assert ( NewOpType . isHeapObjectReferenceType ( ) & & <nl> + " refs should map to refs . " ) ; <nl> + auto URC = Builder . createUncheckedRefCast ( AI . getLoc ( ) , Op , NewOpType ) ; <nl> + URC - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> + Args . push_back ( URC ) ; <nl> + } else { <nl> + Args . push_back ( Op ) ; <nl> + } <nl> + } <nl> + <nl> + SILType CCSILTy = SILType : : getPrimitiveObjectType ( ConvertCalleeTy ) ; <nl> + / / Create the new apply inst . <nl> + SILInstruction * NAI ; <nl> + if ( auto * TAI = dyn_cast < TryApplyInst > ( AI ) ) <nl> + NAI = Builder . createTryApply ( AI . getLoc ( ) , FRI , CCSILTy , <nl> + ArrayRef < Substitution > ( ) , Args , <nl> + TAI - > getNormalBB ( ) , TAI - > getErrorBB ( ) ) ; <nl> + else <nl> + NAI = Builder . createApply ( AI . getLoc ( ) , FRI , CCSILTy , <nl> + ConvertCalleeTy - > getSILResult ( ) , <nl> + ArrayRef < Substitution > ( ) , Args , <nl> + cast < ApplyInst > ( AI ) - > isNonThrowing ( ) ) ; <nl> + NAI - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> + return NAI ; <nl> + } <nl> + <nl> + typedef SmallVector < SILInstruction * , 4 > UserListTy ; <nl> + / / / \ brief Returns a list of instructions that project or perform reference <nl> + / / / counting operations on the instruction or its uses in argument \ p Inst . <nl> + / / / The function returns False if there are non - ARC instructions . <nl> + static bool recursivelyCollectARCUsers ( UserListTy & Uses , SILInstruction * Inst ) { <nl> + Uses . push_back ( Inst ) ; <nl> + for ( auto Inst : Inst - > getUses ( ) ) { <nl> + if ( isa < RefCountingInst > ( Inst - > getUser ( ) ) | | <nl> + isa < DebugValueInst > ( Inst - > getUser ( ) ) ) { <nl> + Uses . push_back ( Inst - > getUser ( ) ) ; <nl> + continue ; <nl> + } <nl> + SILInstruction * Proj ; <nl> + if ( ( Proj = dyn_cast < TupleExtractInst > ( Inst - > getUser ( ) ) ) | | <nl> + ( Proj = dyn_cast < StructExtractInst > ( Inst - > getUser ( ) ) ) | | <nl> + ( Proj = dyn_cast < PointerToAddressInst > ( Inst - > getUser ( ) ) ) ) <nl> + if ( recursivelyCollectARCUsers ( Uses , Proj ) ) <nl> + continue ; <nl> + <nl> + return false ; <nl> + } <nl> + <nl> + return true ; <nl> + } <nl> + <nl> + SILInstruction * <nl> + SILCombiner : : optimizeConcatenationOfStringLiterals ( ApplyInst * AI ) { <nl> + / / String literals concatenation optimizer . <nl> + return tryToConcatenateStrings ( AI , Builder ) ; <nl> + } <nl> + <nl> + / / / Find an init_open_existential_addr or open_existential_addr , which <nl> + / / / is used to initialize a given alloc_stack value . <nl> + static SILValue getInitOrOpenExistential ( AllocStackInst * ASI , SILValue & Src ) { <nl> + CopyAddrInst * FoundCAI = nullptr ; <nl> + InitExistentialAddrInst * FoundIEAI = nullptr ; <nl> + bool isLegal = true ; <nl> + / / Check that this alloc_stack is initialized only once . <nl> + for ( auto Use : ASI - > getUses ( ) ) { <nl> + auto * User = Use - > getUser ( ) ; <nl> + if ( isa < DeallocStackInst > ( User ) | | <nl> + isa < DestroyAddrInst > ( User ) | | isa < WitnessMethodInst > ( User ) | | <nl> + isa < DeinitExistentialAddrInst > ( User ) | | isa < OpenExistentialAddrInst > ( User ) | | <nl> + isa < ApplyInst > ( User ) ) <nl> + continue ; <nl> + if ( auto * CAI = dyn_cast < CopyAddrInst > ( User ) ) { <nl> + if ( ! FoundCAI & & ! FoundIEAI ) { <nl> + if ( CAI - > getDest ( ) . getDef ( ) = = ASI ) <nl> + FoundCAI = CAI ; <nl> + } <nl> + continue ; <nl> + } <nl> + else if ( auto * IEAI = dyn_cast < InitExistentialAddrInst > ( User ) ) { <nl> + if ( ! FoundIEAI & & ! FoundCAI ) { <nl> + FoundIEAI = IEAI ; <nl> + continue ; <nl> + } <nl> + } <nl> + isLegal = false ; <nl> + break ; <nl> + } <nl> + <nl> + SILValue SrcValue ; <nl> + <nl> + if ( isLegal & & FoundCAI ) { <nl> + / / Try to derive the type from the copy_addr that was used to <nl> + / / initialize the alloc_stack . <nl> + SrcValue = FoundCAI - > getSrc ( ) ; <nl> + if ( auto * ASI = dyn_cast < AllocStackInst > ( SrcValue ) ) { <nl> + SILValue Tmp ; <nl> + SrcValue = getInitOrOpenExistential ( ASI , Tmp ) ; <nl> + } <nl> + } <nl> + <nl> + if ( isLegal & & FoundIEAI ) { <nl> + SrcValue = FoundIEAI ; <nl> + } <nl> + <nl> + if ( ! SrcValue ) <nl> + return SILValue ( ) ; <nl> + <nl> + if ( auto * OEAI = dyn_cast < OpenExistentialAddrInst > ( SrcValue ) ) { <nl> + Src = OEAI - > getOperand ( ) ; <nl> + return OEAI ; <nl> + } <nl> + if ( auto * IEAI = dyn_cast < InitExistentialAddrInst > ( SrcValue ) ) { <nl> + Src = IEAI - > getOperand ( ) ; <nl> + return IEAI ; <nl> + } <nl> + <nl> + return SrcValue ; <nl> + } <nl> + <nl> + / / / find the init_existential , which could be used to determine a concrete <nl> + / / / type of the \ p Self . <nl> + static SILInstruction * findInitExistential ( FullApplySite AI , SILValue Self , <nl> + SILType & InstanceType ) { <nl> + SILInstruction * InitExistential = nullptr ; <nl> + <nl> + if ( auto * Instance = dyn_cast < AllocStackInst > ( Self ) ) { <nl> + SILValue Src ; <nl> + auto Existential = getInitOrOpenExistential ( Instance , Src ) ; <nl> + if ( Existential ) <nl> + Self = Existential ; <nl> + } <nl> + <nl> + if ( auto * Instance = dyn_cast < OpenExistentialAddrInst > ( Self ) ) { <nl> + auto Op = Instance - > getOperand ( ) ; <nl> + if ( auto * ASI = dyn_cast < AllocStackInst > ( Op ) ) { <nl> + SILValue Src ; <nl> + if ( getInitOrOpenExistential ( ASI , Src ) ) { <nl> + if ( Src ) <nl> + Op = Src ; <nl> + } <nl> + } <nl> + <nl> + for ( auto Use : Op . getUses ( ) ) { <nl> + SILValue User = Use - > getUser ( ) ; <nl> + <nl> + if ( auto * IE = dyn_cast < InitExistentialAddrInst > ( User ) ) { <nl> + / / IE should dominate Instance . <nl> + / / Without a DomTree we want to be very defensive <nl> + / / and only allow this optimization when it is used <nl> + / / inside the same BB . <nl> + if ( IE - > getParent ( ) ! = AI . getParent ( ) ) <nl> + continue ; <nl> + <nl> + InstanceType = Instance - > getType ( ) ; <nl> + InitExistential = IE ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + if ( auto * Instance = dyn_cast < OpenExistentialRefInst > ( Self ) ) { <nl> + if ( auto * IE = dyn_cast < InitExistentialRefInst > ( Instance - > getOperand ( ) ) ) { <nl> + / / IE should dominate Instance . <nl> + / / Without a DomTree we want to be very defensive <nl> + / / and only allow this optimization when it is used <nl> + / / inside the same BB . <nl> + if ( IE - > getParent ( ) ! = AI . getParent ( ) ) <nl> + return nullptr ; <nl> + InstanceType = Instance - > getType ( ) ; <nl> + InitExistential = IE ; <nl> + } <nl> + } <nl> + <nl> + return InitExistential ; <nl> + } <nl> + <nl> + / / / Create a new apply instructions that uses the concrete type instead <nl> + / / / of the existential type . <nl> + SILInstruction * <nl> + SILCombiner : : createApplyWithConcreteType ( FullApplySite AI , <nl> + SILValue NewSelf , <nl> + SILValue Self , <nl> + CanType ConcreteType , <nl> + ProtocolConformance * Conformance , <nl> + SILType InstanceType ) { <nl> + / / Create a set of arguments . <nl> + SmallVector < SILValue , 8 > Args ; <nl> + for ( auto Arg : AI . getArgumentsWithoutSelf ( ) ) { <nl> + Args . push_back ( Arg ) ; <nl> + } <nl> + Args . push_back ( NewSelf ) ; <nl> + <nl> + / / Form a new set of substitutions where Self is <nl> + / / replaced by a concrete type . <nl> + SmallVector < Substitution , 8 > Substitutions ; <nl> + for ( auto Subst : AI . getSubstitutions ( ) ) { <nl> + if ( Subst . getReplacement ( ) . getCanonicalTypeOrNull ( ) = = <nl> + Self . getType ( ) . getSwiftRValueType ( ) ) { <nl> + auto Conformances = AI . getModule ( ) . getASTContext ( ) <nl> + . Allocate < ProtocolConformance * > ( 1 ) ; <nl> + Conformances [ 0 ] = Conformance ; <nl> + Substitution NewSubst ( Subst . getArchetype ( ) , <nl> + ConcreteType , <nl> + Conformances ) ; <nl> + Substitutions . push_back ( NewSubst ) ; <nl> + } else <nl> + Substitutions . push_back ( Subst ) ; <nl> + } <nl> + <nl> + SILType SubstCalleeType = AI . getSubstCalleeSILType ( ) ; <nl> + <nl> + SILType NewSubstCalleeType ; <nl> + <nl> + auto FnTy = AI . getCallee ( ) . getType ( ) . getAs < SILFunctionType > ( ) ; <nl> + if ( FnTy & & FnTy - > isPolymorphic ( ) ) { <nl> + / / Handle polymorphic functions by properly substituting <nl> + / / their parameter types . <nl> + CanSILFunctionType SFT = FnTy - > substGenericArgs ( <nl> + AI . getModule ( ) , <nl> + AI . getModule ( ) . getSwiftModule ( ) , <nl> + Substitutions ) ; <nl> + NewSubstCalleeType = SILType : : getPrimitiveObjectType ( SFT ) ; <nl> + } else { <nl> + TypeSubstitutionMap TypeSubstitutions ; <nl> + TypeSubstitutions [ InstanceType . getSwiftType ( ) . getPointer ( ) ] = ConcreteType ; <nl> + NewSubstCalleeType = SubstCalleeType . subst ( AI . getModule ( ) , <nl> + AI . getModule ( ) . getSwiftModule ( ) , <nl> + TypeSubstitutions ) ; <nl> + } <nl> + <nl> + FullApplySite NewAI ; <nl> + <nl> + if ( auto * TAI = dyn_cast < TryApplyInst > ( AI ) ) <nl> + NewAI = Builder . createTryApply ( AI . getLoc ( ) , AI . getCallee ( ) , <nl> + NewSubstCalleeType , <nl> + Substitutions , Args , <nl> + TAI - > getNormalBB ( ) , TAI - > getErrorBB ( ) ) ; <nl> + else <nl> + NewAI = Builder . createApply ( AI . getLoc ( ) , AI . getCallee ( ) , <nl> + NewSubstCalleeType , <nl> + AI . getType ( ) , Substitutions , Args , <nl> + cast < ApplyInst > ( AI ) - > isNonThrowing ( ) ) ; <nl> + <nl> + NewAI . getInstruction ( ) - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> + <nl> + if ( isa < ApplyInst > ( NewAI ) ) <nl> + replaceInstUsesWith ( * AI . getInstruction ( ) , NewAI . getInstruction ( ) , 0 ) ; <nl> + eraseInstFromFunction ( * AI . getInstruction ( ) ) ; <nl> + <nl> + CallGraphEditor ( CG ) . addEdgesForApply ( NewAI ) ; <nl> + <nl> + return NewAI . getInstruction ( ) ; <nl> + } <nl> + <nl> + / / / Derive a concrete type of self and conformance from the init_existential <nl> + / / / instruction . <nl> + static std : : pair < ProtocolConformance * , CanType > <nl> + getConformanceAndConcreteType ( FullApplySite AI , <nl> + SILInstruction * InitExistential , <nl> + ProtocolDecl * Protocol , <nl> + SILValue & NewSelf , <nl> + ArrayRef < ProtocolConformance * > & Conformances ) { <nl> + / / Try to derive the concrete type of self from the found init_existential . <nl> + CanType ConcreteType ; <nl> + if ( auto IE = dyn_cast < InitExistentialAddrInst > ( InitExistential ) ) { <nl> + Conformances = IE - > getConformances ( ) ; <nl> + ConcreteType = IE - > getFormalConcreteType ( ) ; <nl> + NewSelf = IE ; <nl> + } else if ( auto IER = dyn_cast < InitExistentialRefInst > ( InitExistential ) ) { <nl> + Conformances = IER - > getConformances ( ) ; <nl> + ConcreteType = IER - > getFormalConcreteType ( ) ; <nl> + NewSelf = IER - > getOperand ( ) ; <nl> + } <nl> + <nl> + if ( Conformances . empty ( ) ) <nl> + return std : : make_pair ( nullptr , CanType ( ) ) ; <nl> + <nl> + / / If ConcreteType depends on any archetypes , then propagating it does not <nl> + / / help resolve witness table lookups . Catch these cases before calling <nl> + / / gatherAllSubstitutions , which only works on nominal types . <nl> + if ( ConcreteType - > hasArchetype ( ) ) <nl> + return std : : make_pair ( nullptr , CanType ( ) ) ; <nl> + <nl> + / / Check the substitutions . <nl> + auto ConcreteTypeSubsts = ConcreteType - > gatherAllSubstitutions ( <nl> + AI . getModule ( ) . getSwiftModule ( ) , nullptr ) ; <nl> + if ( ! ConcreteTypeSubsts . empty ( ) ) { <nl> + / / Bail if any generic types parameters of the concrete type are unbound . <nl> + if ( hasUnboundGenericTypes ( ConcreteTypeSubsts ) ) <nl> + return std : : make_pair ( nullptr , CanType ( ) ) ; <nl> + / / At this point we know that all replacements use concrete types <nl> + / / and therefore the whole Lookup type is concrete . So , we can <nl> + / / propagate it , because we know how to devirtualize it . <nl> + } <nl> + <nl> + / / Find the conformance related to witness_method . <nl> + ProtocolConformance * Conformance = nullptr ; <nl> + for ( auto Con : Conformances ) { <nl> + if ( Con - > getProtocol ( ) = = Protocol ) { <nl> + Conformance = Con ; <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + return std : : make_pair ( Conformance , ConcreteType ) ; <nl> + } <nl> + <nl> + / / / Propagate information about a concrete type from init_existential_addr <nl> + / / / or init_existential_ref into witness_method conformances and into <nl> + / / / apply instructions . <nl> + / / / This helps the devirtualizer to replace witness_method by <nl> + / / / class_method instructions and then devirtualize . <nl> + SILInstruction * <nl> + SILCombiner : : propagateConcreteTypeOfInitExistential ( FullApplySite AI , <nl> + ProtocolDecl * Protocol , <nl> + std : : function < void ( CanType , ProtocolConformance * ) > Propagate ) { <nl> + <nl> + / / Get the self argument . <nl> + SILValue Self ; <nl> + if ( auto * Apply = dyn_cast < ApplyInst > ( AI ) ) { <nl> + if ( Apply - > hasSelfArgument ( ) ) <nl> + Self = Apply - > getSelfArgument ( ) ; <nl> + } else if ( auto * Apply = dyn_cast < TryApplyInst > ( AI ) ) { <nl> + if ( Apply - > hasSelfArgument ( ) ) <nl> + Self = Apply - > getSelfArgument ( ) ; <nl> + } <nl> + <nl> + assert ( Self & & " Self argument should be present " ) ; <nl> + <nl> + / / Try to find the init_existential , which could be used to <nl> + / / determine a concrete type of the self . <nl> + SILType InstanceType ; <nl> + SILInstruction * InitExistential = findInitExistential ( AI , Self , InstanceType ) ; <nl> + if ( ! InitExistential ) <nl> + return nullptr ; <nl> + <nl> + / / Try to derive the concrete type of self and a related conformance from <nl> + / / the found init_existential . <nl> + ArrayRef < ProtocolConformance * > Conformances ; <nl> + auto NewSelf = SILValue ( ) ; <nl> + auto ConformanceAndConcreteType = <nl> + getConformanceAndConcreteType ( AI , InitExistential , <nl> + Protocol , NewSelf , Conformances ) ; <nl> + auto ConcreteType = ConformanceAndConcreteType . second ; <nl> + auto Conformance = ConformanceAndConcreteType . first ; <nl> + if ( ! Conformance ) <nl> + return nullptr ; <nl> + <nl> + / / Propagate the concrete type into the callee - operand if required . <nl> + Propagate ( ConcreteType , Conformance ) ; <nl> + <nl> + / / Create a new apply instructions that uses the concrete type instead <nl> + / / of the existential type . <nl> + return createApplyWithConcreteType ( AI , NewSelf , Self , <nl> + ConcreteType , Conformance , InstanceType ) ; <nl> + } <nl> + <nl> + SILInstruction * <nl> + SILCombiner : : propagateConcreteTypeOfInitExistential ( FullApplySite AI , <nl> + WitnessMethodInst * WMI ) { <nl> + / / Check if it is legal to perform the propagation . <nl> + if ( WMI - > getConformance ( ) ) <nl> + return nullptr ; <nl> + <nl> + / / Don ' t specialize Apply instructions that return the Self type . <nl> + / / Notice that it is sufficient to compare the return type to the <nl> + / / substituted type because types that depend on the Self type are <nl> + / / not allowed ( for example [ Self ] is not allowed ) . <nl> + if ( AI . getType ( ) . getSwiftType ( ) . getLValueOrInOutObjectType ( ) = = <nl> + WMI - > getLookupType ( ) ) <nl> + return nullptr ; <nl> + <nl> + / / We need to handle the Self return type . <nl> + / / In we find arguments that are not the ' self ' argument and if <nl> + / / they are of the Self type then we abort the optimization . <nl> + for ( auto Arg : AI . getArgumentsWithoutSelf ( ) ) { <nl> + if ( Arg . getType ( ) . getSwiftType ( ) . getLValueOrInOutObjectType ( ) = = <nl> + WMI - > getLookupType ( ) ) <nl> + return nullptr ; <nl> + } <nl> + <nl> + / / Obtain the protocol whose which should be used by the conformance . <nl> + auto * PD = WMI - > getLookupProtocol ( ) ; <nl> + <nl> + / / Propagate the concrete type into a callee - operand , which is a <nl> + / / witness_method instruction . <nl> + auto PropagateIntoOperand = [ this , & WMI ] ( CanType ConcreteType , <nl> + ProtocolConformance * Conformance ) { <nl> + SILValue OptionalExistential = <nl> + WMI - > hasOperand ( ) ? WMI - > getOperand ( ) : SILValue ( ) ; <nl> + auto * NewWMI = Builder . createWitnessMethod ( WMI - > getLoc ( ) , <nl> + ConcreteType , <nl> + Conformance , WMI - > getMember ( ) , <nl> + WMI - > getType ( ) , <nl> + OptionalExistential , <nl> + WMI - > isVolatile ( ) ) ; <nl> + replaceInstUsesWith ( * WMI , NewWMI , 0 ) ; <nl> + eraseInstFromFunction ( * WMI ) ; <nl> + } ; <nl> + <nl> + / / Try to perform the propagation . <nl> + return propagateConcreteTypeOfInitExistential ( AI , PD , PropagateIntoOperand ) ; <nl> + } <nl> + <nl> + <nl> + SILInstruction * <nl> + SILCombiner : : propagateConcreteTypeOfInitExistential ( FullApplySite AI ) { <nl> + / / Check if it is legal to perform the propagation . <nl> + if ( ! AI . hasSubstitutions ( ) ) <nl> + return nullptr ; <nl> + auto * FRI = dyn_cast < FunctionRefInst > ( AI . getCallee ( ) ) ; <nl> + if ( ! FRI ) <nl> + return nullptr ; <nl> + auto * Callee = FRI - > getReferencedFunction ( ) ; <nl> + if ( ! Callee - > getDeclContext ( ) ) <nl> + return nullptr ; <nl> + <nl> + / / Bail , if there is no self argument . <nl> + SILValue Self ; <nl> + if ( auto * Apply = dyn_cast < ApplyInst > ( AI ) ) { <nl> + if ( Apply - > hasSelfArgument ( ) ) <nl> + Self = Apply - > getSelfArgument ( ) ; <nl> + } else if ( auto * Apply = dyn_cast < TryApplyInst > ( AI ) ) { <nl> + if ( Apply - > hasSelfArgument ( ) ) <nl> + Self = Apply - > getSelfArgument ( ) ; <nl> + } <nl> + if ( ! Self ) <nl> + return nullptr ; <nl> + <nl> + / / We need to handle the Self return type . <nl> + / / In we find arguments that are not the ' self ' argument and if <nl> + / / they are of the Self type then we abort the optimization . <nl> + for ( auto Arg : AI . getArgumentsWithoutSelf ( ) ) { <nl> + if ( Arg . getType ( ) . getSwiftType ( ) . getLValueOrInOutObjectType ( ) = = <nl> + AI . getArguments ( ) . back ( ) . getType ( ) . getSwiftRValueType ( ) ) <nl> + return nullptr ; <nl> + } <nl> + <nl> + / / Obtain the protocol whose which should be used by the conformance . <nl> + auto * AFD = dyn_cast < AbstractFunctionDecl > ( Callee - > getDeclContext ( ) ) ; <nl> + if ( ! AFD ) <nl> + return nullptr ; <nl> + auto * PD = AFD - > getDeclContext ( ) - > isProtocolOrProtocolExtensionContext ( ) ; <nl> + <nl> + <nl> + / / No need to propagate anything into the callee operand . <nl> + auto PropagateIntoOperand = [ ] ( CanType ConcreteType , <nl> + ProtocolConformance * Conformance ) { } ; <nl> + <nl> + / / Try to perform the propagation . <nl> + return propagateConcreteTypeOfInitExistential ( AI , PD , PropagateIntoOperand ) ; <nl> + } <nl> + <nl> + / / / Optimize thin_func_to_ptr - > ptr_to_thin_func casts into a type substituted <nl> + / / / apply . <nl> + / / / This kind of code arises in generic materializeForSet code that was <nl> + / / / specialized for a concrete type . <nl> + / / / <nl> + / / / Note : this is not as general as it should be . The general solution is the <nl> + / / / introduction of a partial_apply_thin_recoverable ( an instruction that <nl> + / / / partially applies a type and returns a thin_function ) as suggested in <nl> + / / / SILGenBuiltin . cpp . <nl> + / / / <nl> + / / / % 208 = thin_function_to_pointer % 207 : <nl> + / / / $ @ convention ( thin ) < τ_0_0 > ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , <nl> + / / / @ inout UnsafeMutableBufferPointer < τ_0_0 > , <nl> + / / / @ thick UnsafeMutableBufferPointer < τ_0_0 > . Type ) - > ( ) <nl> + / / / to $ Builtin . RawPointer <nl> + / / / % 209 = pointer_to_thin_function % 217 : $ Builtin . RawPointer to <nl> + / / / $ @ convention ( thin ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , <nl> + / / / @ inout UnsafeMutableBufferPointer < Int > , <nl> + / / / @ thick UnsafeMutableBufferPointer < Int > . Type ) - > ( ) <nl> + / / / apply % 209 ( % 227 , % 200 # 1 , % 0 , % 224 ) : $ @ convention ( thin ) ( Builtin . RawPointer , <nl> + / / / @ inout Builtin . UnsafeValueBuffer , @ inout UnsafeMutableBufferPointer < Int > , <nl> + / / / @ thick UnsafeMutableBufferPointer < Int > . Type ) - > ( ) <nl> + / / / <nl> + / / / = > apply % 207 < Int > ( % 227 , . . . ) <nl> + static ApplyInst * optimizeCastThroughThinFunctionPointer ( <nl> + SILBuilder & Builder , ApplyInst * AI , FunctionRefInst * OrigThinFun , <nl> + PointerToThinFunctionInst * CastedThinFun ) { <nl> + <nl> + / / The original function type needs to be polymorphic . <nl> + auto ConvertCalleeTy = OrigThinFun - > getType ( ) . castTo < SILFunctionType > ( ) ; <nl> + assert ( ConvertCalleeTy ) ; <nl> + if ( ! ConvertCalleeTy - > isPolymorphic ( ) ) <nl> + return nullptr ; <nl> + <nl> + / / Need to have four parameters . <nl> + auto OrigParams = ConvertCalleeTy - > getParameters ( ) ; <nl> + if ( OrigParams . size ( ) ! = 4 ) <nl> + return nullptr ; <nl> + <nl> + / / There must only be one parameter to substitute . <nl> + auto * ReferencedFunction = OrigThinFun - > getReferencedFunction ( ) ; <nl> + assert ( ReferencedFunction ) ; <nl> + if ( ReferencedFunction - > isExternalDeclaration ( ) ) <nl> + return nullptr ; <nl> + auto Params = ReferencedFunction - > getContextGenericParams ( ) - > getParams ( ) ; <nl> + if ( Params . size ( ) ! = 1 ) <nl> + return nullptr ; <nl> + <nl> + / / Get the concrete type from the casted to function . <nl> + auto CastedFunTy = CastedThinFun - > getType ( ) . castTo < SILFunctionType > ( ) ; <nl> + auto CastedParams = CastedFunTy - > getParameters ( ) ; <nl> + if ( CastedParams . size ( ) ! = 4 ) <nl> + return nullptr ; <nl> + <nl> + / / The fourth parameter is a metatype of a bound generic type . Use it to <nl> + / / obtain the type substitutions to apply . <nl> + auto MetaTy = dyn_cast < MetatypeType > ( CastedParams [ 3 ] . getType ( ) ) ; <nl> + if ( ! MetaTy ) <nl> + return nullptr ; <nl> + <nl> + / / Get the bound generic type from the metatype . <nl> + auto BoundGenericInstTy = dyn_cast_or_null < BoundGenericType > ( <nl> + MetaTy - > getInstanceType ( ) . getCanonicalTypeOrNull ( ) ) ; <nl> + if ( ! BoundGenericInstTy ) <nl> + return nullptr ; <nl> + <nl> + / / The bound generic type will carry the substitutions to apply . <nl> + auto Subs = BoundGenericInstTy - > getSubstitutions ( <nl> + AI - > getModule ( ) . getSwiftModule ( ) , nullptr ) ; <nl> + <nl> + if ( Subs . size ( ) = = 0 ) <nl> + return nullptr ; <nl> + <nl> + / / We expect one type variable to be substituted . The substitution might have <nl> + / / recursive substitutions . Recognize and allow the case of one substitution <nl> + / / with recursive substitutions . <nl> + / / Container < T > <nl> + / / T = . . . <nl> + / / T . A = . . . <nl> + / / T . A . C = . . . <nl> + if ( Subs . size ( ) ! = 1 ) { <nl> + SmallPtrSet < ArchetypeType * , 16 > Archetypes ; <nl> + bool SawPrimary = false ; <nl> + / / Collect all the archetypes and make sure there is only one primary . <nl> + for ( unsigned i = 0 , e = Subs . size ( ) ; i ! = e ; + + i ) { <nl> + auto * AT = Subs [ i ] . getArchetype ( ) ; <nl> + Archetypes . insert ( AT ) ; <nl> + / / Two primary arche types . We can ' t handle this case . <nl> + if ( SawPrimary & & AT - > isPrimary ( ) ) <nl> + return nullptr ; <nl> + else if ( AT - > isPrimary ( ) ) <nl> + SawPrimary = true ; <nl> + } <nl> + <nl> + / / Make sure all the non primary archetypes have a parent archetype in the <nl> + / / set . <nl> + for ( unsigned i = 0 , e = Subs . size ( ) ; i ! = e ; + + i ) { <nl> + auto * AT = Subs [ i ] . getArchetype ( ) ; <nl> + / / Ignore the one primary archetype . <nl> + if ( AT - > isPrimary ( ) ) <nl> + continue ; <nl> + if ( ! Archetypes . count ( AT ) ) <nl> + return nullptr ; <nl> + } <nl> + } <nl> + <nl> + SmallVector < SILValue , 16 > Args ; <nl> + for ( auto Arg : AI - > getArguments ( ) ) <nl> + Args . push_back ( Arg ) ; <nl> + <nl> + auto NewSubstCalleeType = <nl> + SILType : : getPrimitiveObjectType ( ConvertCalleeTy - > substGenericArgs ( <nl> + AI - > getModule ( ) , AI - > getModule ( ) . getSwiftModule ( ) , Subs ) ) ; <nl> + <nl> + ApplyInst * NewApply = Builder . createApply ( <nl> + AI - > getLoc ( ) , OrigThinFun , NewSubstCalleeType , AI - > getType ( ) , Subs , Args , <nl> + AI - > isNonThrowing ( ) ) ; <nl> + NewApply - > setDebugScope ( AI - > getDebugScope ( ) ) ; <nl> + <nl> + return NewApply ; <nl> + } <nl> + <nl> + / / / \ brief Check that all users of the apply are retain / release ignoring one <nl> + / / / user . <nl> + static bool <nl> + hasOnlyRetainReleaseUsers ( ApplyInst * AI , SILInstruction * IgnoreUser , <nl> + SmallVectorImpl < SILInstruction * > & Users ) { <nl> + for ( auto * Use : getNonDebugUses ( * AI ) ) { <nl> + if ( Use - > getUser ( ) = = IgnoreUser ) <nl> + continue ; <nl> + <nl> + if ( ! isa < RetainValueInst > ( Use - > getUser ( ) ) & & <nl> + ! isa < ReleaseValueInst > ( Use - > getUser ( ) ) & & <nl> + ! isa < StrongRetainInst > ( Use - > getUser ( ) ) & & <nl> + ! isa < StrongReleaseInst > ( Use - > getUser ( ) ) ) <nl> + return false ; <nl> + <nl> + Users . push_back ( Use - > getUser ( ) ) ; <nl> + } <nl> + return true ; <nl> + } ; <nl> + <nl> + / / / \ brief We only know how to simulate reference call effects for unary <nl> + / / / function calls that take their argument @ owned or @ guaranteed and return an <nl> + / / / @ owned value . <nl> + static bool knowHowToEmitReferenceCountInsts ( ApplyInst * Call ) { <nl> + if ( Call - > getNumArguments ( ) ! = 1 ) <nl> + return false ; <nl> + <nl> + FunctionRefInst * FRI = cast < FunctionRefInst > ( Call - > getCallee ( ) ) ; <nl> + SILFunction * F = FRI - > getReferencedFunction ( ) ; <nl> + auto FnTy = F - > getLoweredFunctionType ( ) ; <nl> + <nl> + / / Look at the result type . <nl> + auto ResultInfo = FnTy - > getResult ( ) ; <nl> + if ( ResultInfo . getConvention ( ) ! = ResultConvention : : Owned ) <nl> + return false ; <nl> + <nl> + / / Look at the parameter . <nl> + auto Params = FnTy - > getParameters ( ) ; <nl> + ( void ) Params ; <nl> + assert ( Params . size ( ) = = 1 & & " Expect one parameter " ) ; <nl> + auto ParamConv = FnTy - > getParameters ( ) [ 0 ] . getConvention ( ) ; <nl> + <nl> + return ParamConv = = ParameterConvention : : Direct_Owned | | <nl> + ParamConv = = ParameterConvention : : Direct_Guaranteed ; <nl> + } <nl> + <nl> + / / / \ brief Add reference counting operations equal to the effect of the call . <nl> + static void emitMatchingRCAdjustmentsForCall ( ApplyInst * Call , SILValue OnX ) { <nl> + FunctionRefInst * FRI = cast < FunctionRefInst > ( Call - > getCallee ( ) ) ; <nl> + SILFunction * F = FRI - > getReferencedFunction ( ) ; <nl> + auto FnTy = F - > getLoweredFunctionType ( ) ; <nl> + auto ResultInfo = FnTy - > getResult ( ) ; <nl> + ( void ) ResultInfo ; <nl> + <nl> + assert ( ResultInfo . getConvention ( ) = = ResultConvention : : Owned & & <nl> + " Expect a @ owned return " ) ; <nl> + assert ( Call - > getNumArguments ( ) = = 1 & & " Expect a unary call " ) ; <nl> + <nl> + / / Emit a retain for the @ owned return . <nl> + SILBuilderWithScope < > Builder ( Call ) ; <nl> + Builder . createRetainValue ( Call - > getLoc ( ) , OnX ) ; <nl> + <nl> + / / Emit a release for the @ owned parameter , or none for a @ guaranteed <nl> + / / parameter . <nl> + auto Params = FnTy - > getParameters ( ) ; <nl> + ( void ) Params ; <nl> + assert ( Params . size ( ) = = 1 & & " Expect one parameter " ) ; <nl> + auto ParamInfo = FnTy - > getParameters ( ) [ 0 ] . getConvention ( ) ; <nl> + assert ( ParamInfo = = ParameterConvention : : Direct_Owned | | <nl> + ParamInfo = = ParameterConvention : : Direct_Guaranteed ) ; <nl> + <nl> + if ( ParamInfo = = ParameterConvention : : Direct_Owned ) <nl> + Builder . createReleaseValue ( Call - > getLoc ( ) , OnX ) ; <nl> + } <nl> + <nl> + static bool isCastTypeKnownToSucceed ( SILType Type , SILModule & Mod ) { <nl> + auto * M = Mod . getSwiftModule ( ) ; <nl> + return M - > getASTContext ( ) <nl> + . getBridgedToObjC ( M , Type . getSwiftRValueType ( ) , nullptr ) <nl> + . hasValue ( ) ; <nl> + } <nl> + <nl> + / / / Replace an application of a cast composition f_inverse ( f ( x ) ) by x . <nl> + bool SILCombiner : : optimizeIdentityCastComposition ( ApplyInst * FInverse , <nl> + StringRef FInverseName , <nl> + StringRef FName ) { <nl> + / / Needs to have a known semantics . <nl> + if ( ! FInverse - > hasSemantics ( FInverseName ) ) <nl> + return false ; <nl> + <nl> + / / We need to know how to replace the call by reference counting instructions . <nl> + if ( ! knowHowToEmitReferenceCountInsts ( FInverse ) ) <nl> + return false ; <nl> + <nl> + / / We need to know that the cast will succeeed . <nl> + if ( ! isCastTypeKnownToSucceed ( FInverse - > getArgument ( 0 ) . getType ( ) , <nl> + FInverse - > getModule ( ) ) | | <nl> + ! isCastTypeKnownToSucceed ( FInverse - > getType ( ) , FInverse - > getModule ( ) ) ) <nl> + return false ; <nl> + <nl> + / / Need to have a matching ' f ' . <nl> + auto * F = dyn_cast < ApplyInst > ( FInverse - > getArgument ( 0 ) ) ; <nl> + if ( ! F ) <nl> + return false ; <nl> + if ( ! F - > hasSemantics ( FName ) ) <nl> + return false ; <nl> + if ( ! knowHowToEmitReferenceCountInsts ( F ) ) <nl> + return false ; <nl> + <nl> + / / The types must match . <nl> + if ( F - > getArgument ( 0 ) . getType ( ) ! = FInverse - > getType ( ) ) <nl> + return false ; <nl> + <nl> + / / Retains , releases of the result of F . <nl> + SmallVector < SILInstruction * , 16 > RetainReleases ; <nl> + if ( ! hasOnlyRetainReleaseUsers ( F , FInverse , RetainReleases ) ) <nl> + return false ; <nl> + <nl> + / / Okay , now we know we can remove the calls . <nl> + auto X = F - > getArgument ( 0 ) ; <nl> + <nl> + / / Redirect f ' s result ' s retains / releases to affect x . <nl> + for ( auto * User : RetainReleases ) { <nl> + / / X might not be strong_retain / release ' able . Replace it by a <nl> + / / retain / release_value on X instead . <nl> + if ( isa < StrongRetainInst > ( User ) ) { <nl> + SILBuilderWithScope < > ( User ) . createRetainValue ( User - > getLoc ( ) , X ) ; <nl> + eraseInstFromFunction ( * User ) ; <nl> + continue ; <nl> + } <nl> + if ( isa < StrongReleaseInst > ( User ) ) { <nl> + SILBuilderWithScope < > ( User ) . createReleaseValue ( User - > getLoc ( ) , X ) ; <nl> + eraseInstFromFunction ( * User ) ; <nl> + continue ; <nl> + } <nl> + User - > setOperand ( 0 , X ) ; <nl> + } <nl> + <nl> + / / Simulate the reference count effects of the calls before removing <nl> + / / them . <nl> + emitMatchingRCAdjustmentsForCall ( F , X ) ; <nl> + emitMatchingRCAdjustmentsForCall ( FInverse , X ) ; <nl> + <nl> + / / Replace users of f_inverse by x . <nl> + replaceInstUsesWith ( * FInverse , X . getDef ( ) ) ; <nl> + <nl> + / / Remove the calls . <nl> + eraseInstFromFunction ( * FInverse ) ; <nl> + eraseInstFromFunction ( * F ) ; <nl> + <nl> + return true ; <nl> + } <nl> + <nl> + SILInstruction * SILCombiner : : visitApplyInst ( ApplyInst * AI ) { <nl> + / / apply { partial_apply ( x , y ) } ( z ) - > apply ( z , x , y ) is triggered <nl> + / / from visitPartialApplyInst ( ) , so bail here . <nl> + if ( isa < PartialApplyInst > ( AI - > getCallee ( ) ) ) <nl> + return nullptr ; <nl> + <nl> + if ( auto * CFI = dyn_cast < ConvertFunctionInst > ( AI - > getCallee ( ) ) ) <nl> + return optimizeApplyOfConvertFunctionInst ( AI , CFI ) ; <nl> + <nl> + if ( auto * CastedThinFun = <nl> + dyn_cast < PointerToThinFunctionInst > ( AI - > getCallee ( ) ) ) <nl> + if ( auto * Ptr = <nl> + dyn_cast < ThinFunctionToPointerInst > ( CastedThinFun - > getOperand ( ) ) ) <nl> + if ( auto * OrigThinFun = dyn_cast < FunctionRefInst > ( Ptr - > getOperand ( ) ) ) <nl> + if ( auto * NewAI = optimizeCastThroughThinFunctionPointer ( <nl> + Builder , AI , OrigThinFun , CastedThinFun ) ) { <nl> + replaceInstUsesWith ( * AI , NewAI , 0 ) ; <nl> + eraseInstFromFunction ( * AI ) ; <nl> + CallGraphEditor ( CG ) . addEdgesForApply ( NewAI ) ; <nl> + return nullptr ; <nl> + } <nl> + <nl> + / / Optimize readonly functions with no meaningful users . <nl> + FunctionRefInst * FRI = dyn_cast < FunctionRefInst > ( AI - > getCallee ( ) ) ; <nl> + if ( FRI & & <nl> + FRI - > getReferencedFunction ( ) - > getEffectsKind ( ) < EffectsKind : : ReadWrite ) { <nl> + UserListTy Users ; <nl> + if ( recursivelyCollectARCUsers ( Users , AI ) ) { <nl> + / / When deleting Apply instructions make sure to release any owned <nl> + / / arguments . <nl> + auto FT = FRI - > getFunctionType ( ) ; <nl> + for ( int i = 0 , e = AI - > getNumArguments ( ) ; i < e ; + + i ) { <nl> + SILParameterInfo PI = FT - > getParameters ( ) [ i ] ; <nl> + auto Arg = AI - > getArgument ( i ) ; <nl> + if ( PI . isConsumed ( ) & & ! Arg . getType ( ) . isAddress ( ) ) <nl> + Builder . emitReleaseValueOperation ( AI - > getLoc ( ) , Arg ) ; <nl> + } <nl> + <nl> + / / Erase all of the reference counting instructions and the Apply itself . <nl> + for ( auto rit = Users . rbegin ( ) , re = Users . rend ( ) ; rit ! = re ; + + rit ) <nl> + eraseInstFromFunction ( * * rit ) ; <nl> + <nl> + return nullptr ; <nl> + } <nl> + / / We found a user that we can ' t handle . <nl> + } <nl> + <nl> + if ( FRI ) { <nl> + auto * SF = FRI - > getReferencedFunction ( ) ; <nl> + if ( SF - > getEffectsKind ( ) < EffectsKind : : ReadWrite ) { <nl> + / / Try to optimize string concatenation . <nl> + if ( auto I = optimizeConcatenationOfStringLiterals ( AI ) ) { <nl> + return I ; <nl> + } <nl> + } <nl> + if ( SF - > hasSemanticsString ( " array . uninitialized " ) ) { <nl> + UserListTy Users ; <nl> + / / If the uninitialized array is only written into then it can be removed . <nl> + if ( recursivelyCollectARCUsers ( Users , AI ) ) { <nl> + / / Erase all of the reference counting instructions on the array and the <nl> + / / allocation - apply itself . <nl> + for ( auto rit = Users . rbegin ( ) , re = Users . rend ( ) ; rit ! = re ; + + rit ) <nl> + eraseInstFromFunction ( * * rit ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + <nl> + / / ( apply ( thin_to_thick_function f ) ) to ( apply f ) <nl> + if ( auto * TTTFI = dyn_cast < ThinToThickFunctionInst > ( AI - > getCallee ( ) ) ) { <nl> + / / TODO : Handle substitutions and indirect results <nl> + if ( AI - > hasSubstitutions ( ) | | AI - > hasIndirectResult ( ) ) <nl> + return nullptr ; <nl> + SmallVector < SILValue , 4 > Arguments ; <nl> + for ( auto & Op : AI - > getArgumentOperands ( ) ) { <nl> + Arguments . push_back ( Op . get ( ) ) ; <nl> + } <nl> + / / The type of the substition is the source type of the thin to thick <nl> + / / instruction . <nl> + SILType substTy = TTTFI - > getOperand ( ) . getType ( ) ; <nl> + auto * NewAI = Builder . createApply ( AI - > getLoc ( ) , TTTFI - > getOperand ( ) , <nl> + substTy , AI - > getType ( ) , <nl> + AI - > getSubstitutions ( ) , Arguments , <nl> + AI - > isNonThrowing ( ) ) ; <nl> + NewAI - > setDebugScope ( AI - > getDebugScope ( ) ) ; <nl> + return NewAI ; <nl> + } <nl> + <nl> + / / ( apply ( witness_method ) ) - > propagate information about <nl> + / / a concrete type from init_existential_addr or init_existential_ref . <nl> + if ( auto * WMI = dyn_cast < WitnessMethodInst > ( AI - > getCallee ( ) ) ) { <nl> + propagateConcreteTypeOfInitExistential ( AI , WMI ) ; <nl> + return nullptr ; <nl> + } <nl> + <nl> + / / ( apply ( function_ref method_from_protocol_extension ) ) - > <nl> + / / propagate information about a concrete type from init_existential_addr or <nl> + / / init_existential_ref . <nl> + if ( isa < FunctionRefInst > ( AI - > getCallee ( ) ) ) { <nl> + if ( propagateConcreteTypeOfInitExistential ( AI ) ) { <nl> + return nullptr ; <nl> + } <nl> + } <nl> + <nl> + / / Optimize f_inverse ( f ( x ) ) - > x . <nl> + if ( optimizeIdentityCastComposition ( AI , " convertFromObjectiveC " , <nl> + " convertToObjectiveC " ) ) <nl> + return nullptr ; <nl> + if ( optimizeIdentityCastComposition ( AI , " convertToObjectiveC " , <nl> + " convertFromObjectiveC " ) ) <nl> + return nullptr ; <nl> + <nl> + return nullptr ; <nl> + } <nl> + <nl> + SILInstruction * SILCombiner : : visitTryApplyInst ( TryApplyInst * AI ) { <nl> + / / apply { partial_apply ( x , y ) } ( z ) - > apply ( z , x , y ) is triggered <nl> + / / from visitPartialApplyInst ( ) , so bail here . <nl> + if ( isa < PartialApplyInst > ( AI - > getCallee ( ) ) ) <nl> + return nullptr ; <nl> + <nl> + if ( auto * CFI = dyn_cast < ConvertFunctionInst > ( AI - > getCallee ( ) ) ) { <nl> + return optimizeApplyOfConvertFunctionInst ( AI , CFI ) ; <nl> + } <nl> + <nl> + / / Optimize readonly functions with no meaningful users . <nl> + FunctionRefInst * FRI = dyn_cast < FunctionRefInst > ( AI - > getCallee ( ) ) ; <nl> + if ( FRI & & <nl> + FRI - > getReferencedFunction ( ) - > getEffectsKind ( ) < EffectsKind : : ReadWrite ) { <nl> + UserListTy Users ; <nl> + if ( recursivelyCollectARCUsers ( Users , AI ) ) { <nl> + / / When deleting Apply instructions make sure to release any owned <nl> + / / arguments . <nl> + auto FT = FRI - > getFunctionType ( ) ; <nl> + for ( int i = 0 , e = AI - > getNumArguments ( ) ; i < e ; + + i ) { <nl> + SILParameterInfo PI = FT - > getParameters ( ) [ i ] ; <nl> + auto Arg = AI - > getArgument ( i ) ; <nl> + if ( PI . isConsumed ( ) & & ! Arg . getType ( ) . isAddress ( ) ) <nl> + Builder . emitReleaseValueOperation ( AI - > getLoc ( ) , Arg ) ; <nl> + } <nl> + <nl> + / / Erase all of the reference counting instructions and the Apply itself . <nl> + for ( auto rit = Users . rbegin ( ) , re = Users . rend ( ) ; rit ! = re ; + + rit ) <nl> + eraseInstFromFunction ( * * rit ) ; <nl> + <nl> + return nullptr ; <nl> + } <nl> + / / We found a user that we can ' t handle . <nl> + } <nl> + <nl> + / / ( try_apply ( thin_to_thick_function f ) ) to ( try_apply f ) <nl> + if ( auto * TTTFI = dyn_cast < ThinToThickFunctionInst > ( AI - > getCallee ( ) ) ) { <nl> + / / TODO : Handle substitutions and indirect results <nl> + if ( AI - > hasSubstitutions ( ) | | AI - > hasIndirectResult ( ) ) <nl> + return nullptr ; <nl> + SmallVector < SILValue , 4 > Arguments ; <nl> + for ( auto & Op : AI - > getArgumentOperands ( ) ) { <nl> + Arguments . push_back ( Op . get ( ) ) ; <nl> + } <nl> + / / The type of the substitution is the source type of the thin to thick <nl> + / / instruction . <nl> + SILType substTy = TTTFI - > getOperand ( ) . getType ( ) ; <nl> + auto * NewAI = Builder . createTryApply ( AI - > getLoc ( ) , TTTFI - > getOperand ( ) , <nl> + substTy , <nl> + AI - > getSubstitutions ( ) , Arguments , <nl> + AI - > getNormalBB ( ) , AI - > getErrorBB ( ) ) ; <nl> + NewAI - > setDebugScope ( AI - > getDebugScope ( ) ) ; <nl> + return NewAI ; <nl> + } <nl> + <nl> + / / ( apply ( witness_method ) ) - > propagate information about <nl> + / / a concrete type from init_existential_addr or init_existential_ref . <nl> + if ( auto * WMI = dyn_cast < WitnessMethodInst > ( AI - > getCallee ( ) ) ) { <nl> + propagateConcreteTypeOfInitExistential ( AI , WMI ) ; <nl> + return nullptr ; <nl> + } <nl> + <nl> + / / ( apply ( function_ref method_from_protocol_extension ) ) - > <nl> + / / propagate information about a concrete type from init_existential_addr or <nl> + / / init_existential_ref . <nl> + if ( isa < FunctionRefInst > ( AI - > getCallee ( ) ) ) { <nl> + if ( propagateConcreteTypeOfInitExistential ( AI ) ) { <nl> + return nullptr ; <nl> + } <nl> + } <nl> + <nl> + return nullptr ; <nl> + } <nl> + <nl> mmm a / lib / SILPasses / SILCombinerVisitors . cpp <nl> ppp b / lib / SILPasses / SILCombinerVisitors . cpp <nl> SILInstruction * SILCombiner : : visitRetainValueInst ( RetainValueInst * RVI ) { <nl> return nullptr ; <nl> } <nl> <nl> - <nl> - / / / Check that this is a partial apply of a reabstraction thunk and return the <nl> - / / / argument of the partial apply if it is . <nl> - static SILValue <nl> - isPartialApplyOfReabstractionThunk ( PartialApplyInst * PAI , bool requireSingleUse ) { <nl> - if ( requireSingleUse ) { <nl> - SILValue PAIVal ( PAI , 0 ) ; <nl> - if ( ! hasOneNonDebugUse ( PAIVal ) ) <nl> - return SILValue ( ) ; <nl> - } <nl> - <nl> - if ( PAI - > getNumArguments ( ) ! = 1 ) <nl> - return SILValue ( ) ; <nl> - <nl> - auto * FRI = dyn_cast < FunctionRefInst > ( PAI - > getCallee ( ) ) ; <nl> - if ( ! FRI ) <nl> - return SILValue ( ) ; <nl> - auto * Fun = FRI - > getReferencedFunction ( ) ; <nl> - if ( ! Fun ) <nl> - return SILValue ( ) ; <nl> - <nl> - / / Make sure we have a reabstraction thunk . <nl> - if ( Fun - > isThunk ( ) ! = IsReabstractionThunk ) <nl> - return SILValue ( ) ; <nl> - <nl> - / / The argument should be a closure . <nl> - auto Arg = PAI - > getArgument ( 0 ) ; <nl> - if ( ! Arg . getType ( ) . is < SILFunctionType > ( ) | | <nl> - ! Arg . getType ( ) . isReferenceCounted ( PAI - > getFunction ( ) - > getModule ( ) ) ) <nl> - return SILValue ( ) ; <nl> - <nl> - return PAI - > getArgument ( 0 ) ; <nl> - } <nl> - <nl> - / / / Remove pointless reabstraction thunk closures . <nl> - / / / partial_apply % reabstraction_thunk_typeAtoB ( <nl> - / / / partial_apply % reabstraction_thunk_typeBtoA % closure_typeB ) ) <nl> - / / / - > <nl> - / / / % closure_typeB <nl> - static bool foldInverseReabstractionThunks ( PartialApplyInst * PAI , <nl> - SILCombiner * Combiner ) { <nl> - auto PAIArg = isPartialApplyOfReabstractionThunk ( PAI , false ) ; <nl> - if ( ! PAIArg ) <nl> - return false ; <nl> - <nl> - auto * PAI2 = dyn_cast < PartialApplyInst > ( PAIArg ) ; <nl> - if ( ! PAI2 ) <nl> - return false ; <nl> - <nl> - auto PAI2Arg = isPartialApplyOfReabstractionThunk ( PAI2 , true ) ; <nl> - if ( ! PAI2Arg ) <nl> - return false ; <nl> - <nl> - / / The types must match . <nl> - if ( PAI - > getType ( ) ! = PAI2 - > getArgument ( 0 ) . getType ( ) ) <nl> - return false ; <nl> - <nl> - / / Replace the partial_apply ( partial_apply ( X ) ) by X and remove the <nl> - / / partial_applies . <nl> - <nl> - Combiner - > replaceInstUsesWith ( * PAI , PAI2 - > getArgument ( 0 ) . getDef ( ) ) ; <nl> - Combiner - > eraseInstFromFunction ( * PAI ) ; <nl> - assert ( hasNoUsesExceptDebug ( PAI2 ) & & " Should not have any uses " ) ; <nl> - Combiner - > eraseInstFromFunction ( * PAI2 ) ; <nl> - <nl> - return true ; <nl> - } <nl> - <nl> - SILInstruction * SILCombiner : : visitPartialApplyInst ( PartialApplyInst * PAI ) { <nl> - / / partial_apply without any substitutions or arguments is just a <nl> - / / thin_to_thick_function . <nl> - if ( ! PAI - > hasSubstitutions ( ) & & ( PAI - > getNumArguments ( ) = = 0 ) ) <nl> - return Builder . createThinToThickFunction ( PAI - > getLoc ( ) , PAI - > getCallee ( ) , <nl> - PAI - > getType ( ) ) ; <nl> - <nl> - / / partial_apply % reabstraction_thunk_typeAtoB ( <nl> - / / partial_apply % reabstraction_thunk_typeBtoA % closure_typeB ) ) <nl> - / / - > % closure_typeB <nl> - if ( foldInverseReabstractionThunks ( PAI , this ) ) <nl> - return nullptr ; <nl> - <nl> - tryOptimizeApplyOfPartialApply ( PAI ) ; <nl> - <nl> - / / Try to delete dead closures . <nl> - tryDeleteDeadClosure ( <nl> - PAI , InstModCallbacks ( <nl> - [ this ] ( SILInstruction * DeadInst ) { <nl> - eraseInstFromFunction ( * DeadInst ) ; <nl> - } , <nl> - [ this ] ( SILInstruction * NewInst ) { Worklist . add ( NewInst ) ; } ) ) ; <nl> - return nullptr ; <nl> - } <nl> - <nl> - static bool canCombinePartialApply ( const PartialApplyInst * PAI ) { <nl> - / / Only process partial apply if the callee is a known function . <nl> - auto * FRI = dyn_cast < FunctionRefInst > ( PAI - > getCallee ( ) ) ; <nl> - if ( ! FRI ) <nl> - return false ; <nl> - <nl> - / / Make sure that the substitution list of the PAI does not contain any <nl> - / / archetypes . <nl> - ArrayRef < Substitution > Subs = PAI - > getSubstitutions ( ) ; <nl> - for ( Substitution S : Subs ) <nl> - if ( S . getReplacement ( ) - > getCanonicalType ( ) - > hasArchetype ( ) ) <nl> - return false ; <nl> - <nl> - return true ; <nl> - } <nl> - <nl> - / / Helper class performing the apply { partial_apply ( x , y ) } ( z ) - > apply ( z , x , y ) <nl> - / / peephole . <nl> - class PartialApplyCombiner { <nl> - / / True if temporaries are not created yet . <nl> - bool isFirstTime = true ; <nl> - <nl> - / / partial_apply which is being processed . <nl> - PartialApplyInst * PAI ; <nl> - <nl> - / / Temporaries created as copies of alloc_stack arguments of <nl> - / / the partial_apply . <nl> - SmallVector < SILValue , 8 > Tmps ; <nl> - <nl> - / / Mapping from the original argument of partial_apply to <nl> - / / the temporary containing its copy . <nl> - llvm : : DenseMap < SILValue , SILValue > ArgToTmp ; <nl> - <nl> - / / Set of lifetime endpoints for this partial_apply . <nl> - / / <nl> - / / Used to find the last uses of partial_apply , which is need to insert <nl> - / / releases / destroys of temporaries as early as possible . If no releases are <nl> - / / needed , Lifetime remains empty . <nl> - ValueLifetime Lifetime ; <nl> - <nl> - SILBuilder & Builder ; <nl> - <nl> - CallGraph * CG ; <nl> - <nl> - / / Function referenced by partial_apply . <nl> - FunctionRefInst * FRI ; <nl> - <nl> - SILCombiner * SilCombiner ; <nl> - <nl> - void processSingleApply ( FullApplySite AI ) ; <nl> - void allocateTemporaries ( ) ; <nl> - void deallocateTemporaries ( ) ; <nl> - void releaseTemporaries ( ) ; <nl> - <nl> - public : <nl> - PartialApplyCombiner ( PartialApplyInst * PAI , SILBuilder & Builder , <nl> - CallGraph * CG , SILCombiner * SilCombiner ) <nl> - : isFirstTime ( true ) , PAI ( PAI ) , Builder ( Builder ) , CG ( CG ) , <nl> - FRI ( nullptr ) , SilCombiner ( SilCombiner ) { } <nl> - SILInstruction * combine ( ) ; <nl> - } ; <nl> - <nl> - void PartialApplyCombiner : : allocateTemporaries ( ) { <nl> - / / Copy non - inout alloc_stack arguments of the partial_apply into <nl> - / / newly created temporaries and use these temporaries instead of <nl> - / / the original arguments afterwards . <nl> - / / This is done to " extend " the life - time of original alloc_stack <nl> - / / arguments , as they may be deallocated before the last use by one <nl> - / / of the apply instructions . <nl> - / / TODO : <nl> - / / Copy arguments of the partial_apply into new temporaries <nl> - / / only if the lifetime of arguments ends before their uses <nl> - / / by apply instructions . <nl> - bool needsReleases = false ; <nl> - CanSILFunctionType PAITy = <nl> - dyn_cast < SILFunctionType > ( PAI - > getCallee ( ) . getType ( ) . getSwiftType ( ) ) ; <nl> - <nl> - / / Emit a destroy value for each captured closure argument . <nl> - ArrayRef < SILParameterInfo > Params = PAITy - > getParameters ( ) ; <nl> - auto Args = PAI - > getArguments ( ) ; <nl> - unsigned Delta = Params . size ( ) - Args . size ( ) ; <nl> - <nl> - for ( unsigned AI = 0 , AE = Args . size ( ) ; AI ! = AE ; + + AI ) { <nl> - SILValue Arg = Args [ AI ] ; <nl> - SILParameterInfo Param = Params [ AI + Delta ] ; <nl> - if ( Param . isIndirectInOut ( ) ) <nl> - continue ; <nl> - if ( isa < AllocStackInst > ( Arg ) ) { <nl> - Builder . setInsertionPoint ( PAI - > getFunction ( ) - > begin ( ) - > begin ( ) ) ; <nl> - / / Create a new temporary at the beginning of a function . <nl> - auto * Tmp = Builder . createAllocStack ( PAI - > getLoc ( ) , Arg . getType ( ) ) ; <nl> - Builder . setInsertionPoint ( PAI ) ; <nl> - / / Copy argument into this temporary . <nl> - Builder . createCopyAddr ( PAI - > getLoc ( ) , Arg , SILValue ( Tmp , 1 ) , <nl> - IsTake_t : : IsNotTake , <nl> - IsInitialization_t : : IsInitialization ) ; <nl> - <nl> - Tmps . push_back ( SILValue ( Tmp , 0 ) ) ; <nl> - if ( ! Arg . getType ( ) . isTrivial ( PAI - > getModule ( ) ) ) <nl> - needsReleases = true ; <nl> - ArgToTmp . insert ( std : : make_pair ( Arg , SILValue ( Tmp , 0 ) ) ) ; <nl> - } <nl> - } <nl> - <nl> - if ( needsReleases ) { <nl> - / / Compute the set of endpoints , which will be used <nl> - / / to insert releases of temporaries . <nl> - ValueLifetimeAnalysis VLA ( PAI ) ; <nl> - Lifetime = VLA . computeFromDirectUses ( ) ; <nl> - } <nl> - } <nl> - <nl> - / / / Emit dealloc_stack for all temporaries . <nl> - void PartialApplyCombiner : : deallocateTemporaries ( ) { <nl> - / / Insert dealloc_stack instructions . <nl> - TinyPtrVector < SILBasicBlock * > ExitBBs ; <nl> - findAllNonFailureExitBBs ( PAI - > getFunction ( ) , ExitBBs ) ; <nl> - <nl> - for ( auto Op : Tmps ) { <nl> - for ( auto * ExitBB : ExitBBs ) { <nl> - auto * Term = ExitBB - > getTerminator ( ) ; <nl> - Builder . setInsertionPoint ( Term ) ; <nl> - Builder . createDeallocStack ( PAI - > getLoc ( ) , Op ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - / / / Emit code to release / destory temporaries . <nl> - void PartialApplyCombiner : : releaseTemporaries ( ) { <nl> - / / Insert releases and destroy_addrs as early as possible , <nl> - / / because we don ' t want to keep objects alive longer than <nl> - / / its really needed . <nl> - for ( auto Op : Tmps ) { <nl> - auto TmpType = Op . getType ( ) . getObjectType ( ) ; <nl> - if ( TmpType . isTrivial ( PAI - > getModule ( ) ) ) <nl> - continue ; <nl> - for ( auto * EndPoint : Lifetime . LastUsers ) { <nl> - Builder . setInsertionPoint ( next ( SILBasicBlock : : iterator ( EndPoint ) ) ) ; <nl> - auto TmpAddr = SILValue ( Op . getDef ( ) , 1 ) ; <nl> - if ( ! TmpType . isAddressOnly ( PAI - > getModule ( ) ) ) { <nl> - auto * Load = Builder . createLoad ( PAI - > getLoc ( ) , TmpAddr ) ; <nl> - Builder . createReleaseValue ( PAI - > getLoc ( ) , Load ) ; <nl> - } else { <nl> - Builder . createDestroyAddr ( PAI - > getLoc ( ) , TmpAddr ) ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> - <nl> - / / / Process an apply instruction which uses a partial_apply <nl> - / / / as its callee . <nl> - void PartialApplyCombiner : : processSingleApply ( FullApplySite AI ) { <nl> - Builder . setInsertionPoint ( AI . getInstruction ( ) ) ; <nl> - <nl> - / / Prepare the args . <nl> - SmallVector < SILValue , 8 > Args ; <nl> - / / First the ApplyInst args . <nl> - for ( auto Op : AI . getArguments ( ) ) <nl> - Args . push_back ( Op ) ; <nl> - <nl> - SILInstruction * InsertionPoint = Builder . getInsertionPoint ( ) ; <nl> - / / Next , the partial apply args . <nl> - <nl> - / / Pre - process partial_apply arguments only once , lazily . <nl> - if ( isFirstTime ) { <nl> - isFirstTime = false ; <nl> - allocateTemporaries ( ) ; <nl> - } <nl> - <nl> - / / Now , copy over the partial apply args . <nl> - for ( auto Op : PAI - > getArguments ( ) ) { <nl> - auto Arg = Op ; <nl> - / / If there is new temporary for this argument , use it instead . <nl> - if ( isa < AllocStackInst > ( Arg ) ) { <nl> - if ( ArgToTmp . count ( Arg ) ) { <nl> - auto Tmp = ArgToTmp . lookup ( Arg ) ; <nl> - Op = SILValue ( Tmp . getDef ( ) , 1 ) ; <nl> - } <nl> - } <nl> - Args . push_back ( Op ) ; <nl> - } <nl> - <nl> - Builder . setInsertionPoint ( InsertionPoint ) ; <nl> - <nl> - / / The thunk that implements the partial apply calls the closure function <nl> - / / that expects all arguments to be consumed by the function . However , the <nl> - / / captured arguments are not arguments of * this * apply , so they are not <nl> - / / pre - incremented . When we combine the partial_apply and this apply into <nl> - / / a new apply we need to retain all of the closure non - address type <nl> - / / arguments . <nl> - for ( auto Arg : PAI - > getArguments ( ) ) <nl> - if ( ! Arg . getType ( ) . isAddress ( ) ) <nl> - Builder . emitRetainValueOperation ( PAI - > getLoc ( ) , Arg ) ; <nl> - <nl> - auto * F = FRI - > getReferencedFunction ( ) ; <nl> - SILType FnType = F - > getLoweredType ( ) ; <nl> - SILType ResultTy = F - > getLoweredFunctionType ( ) - > getSILResult ( ) ; <nl> - ArrayRef < Substitution > Subs = PAI - > getSubstitutions ( ) ; <nl> - if ( ! Subs . empty ( ) ) { <nl> - FnType = FnType . substGenericArgs ( PAI - > getModule ( ) , Subs ) ; <nl> - ResultTy = FnType . getAs < SILFunctionType > ( ) - > getSILResult ( ) ; <nl> - } <nl> - <nl> - FullApplySite NAI ; <nl> - if ( auto * TAI = dyn_cast < TryApplyInst > ( AI ) ) <nl> - NAI = <nl> - Builder . createTryApply ( AI . getLoc ( ) , FRI , FnType , Subs , Args , <nl> - TAI - > getNormalBB ( ) , TAI - > getErrorBB ( ) ) ; <nl> - else <nl> - NAI = <nl> - Builder . createApply ( AI . getLoc ( ) , FRI , FnType , ResultTy , Subs , Args , <nl> - cast < ApplyInst > ( AI ) - > isNonThrowing ( ) ) ; <nl> - <nl> - NAI . getInstruction ( ) - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> - <nl> - CallGraphEditor ( CG ) . addEdgesForApply ( NAI ) ; <nl> - <nl> - / / We also need to release the partial_apply instruction itself because it <nl> - / / is consumed by the apply_instruction . <nl> - if ( auto * TAI = dyn_cast < TryApplyInst > ( AI ) ) { <nl> - Builder . setInsertionPoint ( TAI - > getNormalBB ( ) - > begin ( ) ) ; <nl> - Builder . createStrongRelease ( AI . getLoc ( ) , PAI ) <nl> - - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> - Builder . setInsertionPoint ( TAI - > getErrorBB ( ) - > begin ( ) ) ; <nl> - Builder . createStrongRelease ( AI . getLoc ( ) , PAI ) <nl> - - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> - Builder . setInsertionPoint ( AI . getInstruction ( ) ) ; <nl> - } else { <nl> - Builder . createStrongRelease ( AI . getLoc ( ) , PAI ) <nl> - - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> - } <nl> - / / Update the set endpoints . <nl> - if ( Lifetime . LastUsers . count ( AI . getInstruction ( ) ) ) { <nl> - Lifetime . LastUsers . remove ( AI . getInstruction ( ) ) ; <nl> - Lifetime . LastUsers . insert ( NAI . getInstruction ( ) ) ; <nl> - } <nl> - <nl> - SilCombiner - > replaceInstUsesWith ( * AI . getInstruction ( ) , NAI . getInstruction ( ) ) ; <nl> - SilCombiner - > eraseInstFromFunction ( * AI . getInstruction ( ) ) ; <nl> - } <nl> - <nl> - / / / Perform the apply { partial_apply ( x , y ) } ( z ) - > apply ( z , x , y ) peephole <nl> - / / / by iterating over all uses of the partial_apply and searching <nl> - / / / for the pattern to transform . <nl> - SILInstruction * PartialApplyCombiner : : combine ( ) { <nl> - if ( ! canCombinePartialApply ( PAI ) ) <nl> - return nullptr ; <nl> - <nl> - / / Only process partial apply if the callee is a known function . <nl> - FRI = dyn_cast < FunctionRefInst > ( PAI - > getCallee ( ) ) ; <nl> - <nl> - / / Iterate over all uses of the partial_apply <nl> - / / and look for applies that use it as a callee . <nl> - for ( auto Use : PAI - > getUses ( ) ) { <nl> - auto User = Use - > getUser ( ) ; <nl> - / / If this use of a partial_apply is not <nl> - / / an apply which uses it as a callee , bail . <nl> - auto AI = FullApplySite : : isa ( User ) ; <nl> - if ( ! AI ) <nl> - continue ; <nl> - <nl> - if ( AI . getCallee ( ) ! = PAI ) <nl> - continue ; <nl> - <nl> - / / We cannot handle generic apply yet . Bail . <nl> - if ( AI . hasSubstitutions ( ) ) <nl> - continue ; <nl> - <nl> - processSingleApply ( AI ) ; <nl> - } <nl> - <nl> - / / release / destroy and deallocate introduced temporaries . <nl> - if ( ! Tmps . empty ( ) ) { <nl> - releaseTemporaries ( ) ; <nl> - deallocateTemporaries ( ) ; <nl> - } <nl> - <nl> - return nullptr ; <nl> - } <nl> - <nl> - / / / Iterate over all uses of a given partial_apply and check <nl> - / / / if any of those uses are apply instructions . Try to <nl> - / / / combine those applies with this partial_apply . <nl> - SILInstruction * <nl> - SILCombiner : : tryOptimizeApplyOfPartialApply ( PartialApplyInst * PAI ) { <nl> - <nl> - PartialApplyCombiner PACombiner ( PAI , Builder , CG , this ) ; <nl> - return PACombiner . combine ( ) ; <nl> - } <nl> - <nl> - SILInstruction * <nl> - SILCombiner : : optimizeApplyOfConvertFunctionInst ( FullApplySite AI , <nl> - ConvertFunctionInst * CFI ) { <nl> - / / We only handle simplification of static function references . If we don ' t <nl> - / / have one , bail . <nl> - FunctionRefInst * FRI = dyn_cast < FunctionRefInst > ( CFI - > getOperand ( ) ) ; <nl> - if ( ! FRI ) <nl> - return nullptr ; <nl> - <nl> - / / Grab our relevant callee types . . . <nl> - CanSILFunctionType SubstCalleeTy = AI . getSubstCalleeType ( ) ; <nl> - auto ConvertCalleeTy = <nl> - CFI - > getOperand ( ) . getType ( ) . castTo < SILFunctionType > ( ) ; <nl> - <nl> - / / . . . and make sure they have no unsubstituted generics . If they do , bail . <nl> - if ( SubstCalleeTy - > hasArchetype ( ) | | ConvertCalleeTy - > hasArchetype ( ) ) <nl> - return nullptr ; <nl> - <nl> - / / Ok , we can now perform our transformation . Grab AI ' s operands and the <nl> - / / relevant types from the ConvertFunction function type and AI . <nl> - OperandValueArrayRef Ops = AI . getArgumentsWithoutIndirectResult ( ) ; <nl> - auto OldOpTypes = SubstCalleeTy - > getParameterSILTypes ( ) ; <nl> - auto NewOpTypes = ConvertCalleeTy - > getParameterSILTypes ( ) ; <nl> - <nl> - assert ( Ops . size ( ) = = OldOpTypes . size ( ) & & <nl> - " Ops and op types must have same size . " ) ; <nl> - assert ( Ops . size ( ) = = NewOpTypes . size ( ) & & <nl> - " Ops and op types must have same size . " ) ; <nl> - <nl> - llvm : : SmallVector < SILValue , 8 > Args ; <nl> - for ( unsigned i = 0 , e = Ops . size ( ) ; i ! = e ; + + i ) { <nl> - SILValue Op = Ops [ i ] ; <nl> - SILType OldOpType = OldOpTypes [ i ] ; <nl> - SILType NewOpType = NewOpTypes [ i ] ; <nl> - <nl> - / / Convert function takes refs to refs , address to addresses , and leaves <nl> - / / other types alone . <nl> - if ( OldOpType . isAddress ( ) ) { <nl> - assert ( NewOpType . isAddress ( ) & & " Addresses should map to addresses . " ) ; <nl> - auto UAC = Builder . createUncheckedAddrCast ( AI . getLoc ( ) , Op , NewOpType ) ; <nl> - UAC - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> - Args . push_back ( UAC ) ; <nl> - } else if ( OldOpType . isHeapObjectReferenceType ( ) ) { <nl> - assert ( NewOpType . isHeapObjectReferenceType ( ) & & <nl> - " refs should map to refs . " ) ; <nl> - auto URC = Builder . createUncheckedRefCast ( AI . getLoc ( ) , Op , NewOpType ) ; <nl> - URC - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> - Args . push_back ( URC ) ; <nl> - } else { <nl> - Args . push_back ( Op ) ; <nl> - } <nl> - } <nl> - <nl> - SILType CCSILTy = SILType : : getPrimitiveObjectType ( ConvertCalleeTy ) ; <nl> - / / Create the new apply inst . <nl> - SILInstruction * NAI ; <nl> - if ( auto * TAI = dyn_cast < TryApplyInst > ( AI ) ) <nl> - NAI = Builder . createTryApply ( AI . getLoc ( ) , FRI , CCSILTy , <nl> - ArrayRef < Substitution > ( ) , Args , <nl> - TAI - > getNormalBB ( ) , TAI - > getErrorBB ( ) ) ; <nl> - else <nl> - NAI = Builder . createApply ( AI . getLoc ( ) , FRI , CCSILTy , <nl> - ConvertCalleeTy - > getSILResult ( ) , <nl> - ArrayRef < Substitution > ( ) , Args , <nl> - cast < ApplyInst > ( AI ) - > isNonThrowing ( ) ) ; <nl> - NAI - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> - return NAI ; <nl> - } <nl> - <nl> - typedef SmallVector < SILInstruction * , 4 > UserListTy ; <nl> - / / / \ brief Returns a list of instructions that project or perform reference <nl> - / / / counting operations on the instruction or its uses in argument \ p Inst . <nl> - / / / The function returns False if there are non - ARC instructions . <nl> - static bool recursivelyCollectARCUsers ( UserListTy & Uses , SILInstruction * Inst ) { <nl> - Uses . push_back ( Inst ) ; <nl> - for ( auto Inst : Inst - > getUses ( ) ) { <nl> - if ( isa < RefCountingInst > ( Inst - > getUser ( ) ) | | <nl> - isa < DebugValueInst > ( Inst - > getUser ( ) ) ) { <nl> - Uses . push_back ( Inst - > getUser ( ) ) ; <nl> - continue ; <nl> - } <nl> - SILInstruction * Proj ; <nl> - if ( ( Proj = dyn_cast < TupleExtractInst > ( Inst - > getUser ( ) ) ) | | <nl> - ( Proj = dyn_cast < StructExtractInst > ( Inst - > getUser ( ) ) ) | | <nl> - ( Proj = dyn_cast < PointerToAddressInst > ( Inst - > getUser ( ) ) ) ) <nl> - if ( recursivelyCollectARCUsers ( Uses , Proj ) ) <nl> - continue ; <nl> - <nl> - return false ; <nl> - } <nl> - <nl> - return true ; <nl> - } <nl> - <nl> - SILInstruction * <nl> - SILCombiner : : optimizeConcatenationOfStringLiterals ( ApplyInst * AI ) { <nl> - / / String literals concatenation optimizer . <nl> - return tryToConcatenateStrings ( AI , Builder ) ; <nl> - } <nl> - <nl> - / / / Find an init_open_existential_addr or open_existential_addr , which <nl> - / / / is used to initialize a given alloc_stack value . <nl> - static SILValue getInitOrOpenExistential ( AllocStackInst * ASI , SILValue & Src ) { <nl> - CopyAddrInst * FoundCAI = nullptr ; <nl> - InitExistentialAddrInst * FoundIEAI = nullptr ; <nl> - bool isLegal = true ; <nl> - / / Check that this alloc_stack is initialized only once . <nl> - for ( auto Use : ASI - > getUses ( ) ) { <nl> - auto * User = Use - > getUser ( ) ; <nl> - if ( isa < DeallocStackInst > ( User ) | | <nl> - isa < DestroyAddrInst > ( User ) | | isa < WitnessMethodInst > ( User ) | | <nl> - isa < DeinitExistentialAddrInst > ( User ) | | isa < OpenExistentialAddrInst > ( User ) | | <nl> - isa < ApplyInst > ( User ) ) <nl> - continue ; <nl> - if ( auto * CAI = dyn_cast < CopyAddrInst > ( User ) ) { <nl> - if ( ! FoundCAI & & ! FoundIEAI ) { <nl> - if ( CAI - > getDest ( ) . getDef ( ) = = ASI ) <nl> - FoundCAI = CAI ; <nl> - } <nl> - continue ; <nl> - } <nl> - else if ( auto * IEAI = dyn_cast < InitExistentialAddrInst > ( User ) ) { <nl> - if ( ! FoundIEAI & & ! FoundCAI ) { <nl> - FoundIEAI = IEAI ; <nl> - continue ; <nl> - } <nl> - } <nl> - isLegal = false ; <nl> - break ; <nl> - } <nl> - <nl> - SILValue SrcValue ; <nl> - <nl> - if ( isLegal & & FoundCAI ) { <nl> - / / Try to derive the type from the copy_addr that was used to <nl> - / / initialize the alloc_stack . <nl> - SrcValue = FoundCAI - > getSrc ( ) ; <nl> - if ( auto * ASI = dyn_cast < AllocStackInst > ( SrcValue ) ) { <nl> - SILValue Tmp ; <nl> - SrcValue = getInitOrOpenExistential ( ASI , Tmp ) ; <nl> - } <nl> - } <nl> - <nl> - if ( isLegal & & FoundIEAI ) { <nl> - SrcValue = FoundIEAI ; <nl> - } <nl> - <nl> - if ( ! SrcValue ) <nl> - return SILValue ( ) ; <nl> - <nl> - if ( auto * OEAI = dyn_cast < OpenExistentialAddrInst > ( SrcValue ) ) { <nl> - Src = OEAI - > getOperand ( ) ; <nl> - return OEAI ; <nl> - } <nl> - if ( auto * IEAI = dyn_cast < InitExistentialAddrInst > ( SrcValue ) ) { <nl> - Src = IEAI - > getOperand ( ) ; <nl> - return IEAI ; <nl> - } <nl> - <nl> - return SrcValue ; <nl> - } <nl> - <nl> - / / / find the init_existential , which could be used to determine a concrete <nl> - / / / type of the \ p Self . <nl> - static SILInstruction * findInitExistential ( FullApplySite AI , SILValue Self , <nl> - SILType & InstanceType ) { <nl> - SILInstruction * InitExistential = nullptr ; <nl> - <nl> - if ( auto * Instance = dyn_cast < AllocStackInst > ( Self ) ) { <nl> - SILValue Src ; <nl> - auto Existential = getInitOrOpenExistential ( Instance , Src ) ; <nl> - if ( Existential ) <nl> - Self = Existential ; <nl> - } <nl> - <nl> - if ( auto * Instance = dyn_cast < OpenExistentialAddrInst > ( Self ) ) { <nl> - auto Op = Instance - > getOperand ( ) ; <nl> - if ( auto * ASI = dyn_cast < AllocStackInst > ( Op ) ) { <nl> - SILValue Src ; <nl> - if ( getInitOrOpenExistential ( ASI , Src ) ) { <nl> - if ( Src ) <nl> - Op = Src ; <nl> - } <nl> - } <nl> - <nl> - for ( auto Use : Op . getUses ( ) ) { <nl> - SILValue User = Use - > getUser ( ) ; <nl> - <nl> - if ( auto * IE = dyn_cast < InitExistentialAddrInst > ( User ) ) { <nl> - / / IE should dominate Instance . <nl> - / / Without a DomTree we want to be very defensive <nl> - / / and only allow this optimization when it is used <nl> - / / inside the same BB . <nl> - if ( IE - > getParent ( ) ! = AI . getParent ( ) ) <nl> - continue ; <nl> - <nl> - InstanceType = Instance - > getType ( ) ; <nl> - InitExistential = IE ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - if ( auto * Instance = dyn_cast < OpenExistentialRefInst > ( Self ) ) { <nl> - if ( auto * IE = dyn_cast < InitExistentialRefInst > ( Instance - > getOperand ( ) ) ) { <nl> - / / IE should dominate Instance . <nl> - / / Without a DomTree we want to be very defensive <nl> - / / and only allow this optimization when it is used <nl> - / / inside the same BB . <nl> - if ( IE - > getParent ( ) ! = AI . getParent ( ) ) <nl> - return nullptr ; <nl> - InstanceType = Instance - > getType ( ) ; <nl> - InitExistential = IE ; <nl> - } <nl> - } <nl> - <nl> - return InitExistential ; <nl> - } <nl> - <nl> - / / / Create a new apply instructions that uses the concrete type instead <nl> - / / / of the existential type . <nl> - SILInstruction * <nl> - SILCombiner : : createApplyWithConcreteType ( FullApplySite AI , <nl> - SILValue NewSelf , <nl> - SILValue Self , <nl> - CanType ConcreteType , <nl> - ProtocolConformance * Conformance , <nl> - SILType InstanceType ) { <nl> - / / Create a set of arguments . <nl> - SmallVector < SILValue , 8 > Args ; <nl> - for ( auto Arg : AI . getArgumentsWithoutSelf ( ) ) { <nl> - Args . push_back ( Arg ) ; <nl> - } <nl> - Args . push_back ( NewSelf ) ; <nl> - <nl> - / / Form a new set of substitutions where Self is <nl> - / / replaced by a concrete type . <nl> - SmallVector < Substitution , 8 > Substitutions ; <nl> - for ( auto Subst : AI . getSubstitutions ( ) ) { <nl> - if ( Subst . getReplacement ( ) . getCanonicalTypeOrNull ( ) = = <nl> - Self . getType ( ) . getSwiftRValueType ( ) ) { <nl> - auto Conformances = AI . getModule ( ) . getASTContext ( ) <nl> - . Allocate < ProtocolConformance * > ( 1 ) ; <nl> - Conformances [ 0 ] = Conformance ; <nl> - Substitution NewSubst ( Subst . getArchetype ( ) , <nl> - ConcreteType , <nl> - Conformances ) ; <nl> - Substitutions . push_back ( NewSubst ) ; <nl> - } else <nl> - Substitutions . push_back ( Subst ) ; <nl> - } <nl> - <nl> - SILType SubstCalleeType = AI . getSubstCalleeSILType ( ) ; <nl> - <nl> - SILType NewSubstCalleeType ; <nl> - <nl> - auto FnTy = AI . getCallee ( ) . getType ( ) . getAs < SILFunctionType > ( ) ; <nl> - if ( FnTy & & FnTy - > isPolymorphic ( ) ) { <nl> - / / Handle polymorphic functions by properly substituting <nl> - / / their parameter types . <nl> - CanSILFunctionType SFT = FnTy - > substGenericArgs ( <nl> - AI . getModule ( ) , <nl> - AI . getModule ( ) . getSwiftModule ( ) , <nl> - Substitutions ) ; <nl> - NewSubstCalleeType = SILType : : getPrimitiveObjectType ( SFT ) ; <nl> - } else { <nl> - TypeSubstitutionMap TypeSubstitutions ; <nl> - TypeSubstitutions [ InstanceType . getSwiftType ( ) . getPointer ( ) ] = ConcreteType ; <nl> - NewSubstCalleeType = SubstCalleeType . subst ( AI . getModule ( ) , <nl> - AI . getModule ( ) . getSwiftModule ( ) , <nl> - TypeSubstitutions ) ; <nl> - } <nl> - <nl> - FullApplySite NewAI ; <nl> - <nl> - if ( auto * TAI = dyn_cast < TryApplyInst > ( AI ) ) <nl> - NewAI = Builder . createTryApply ( AI . getLoc ( ) , AI . getCallee ( ) , <nl> - NewSubstCalleeType , <nl> - Substitutions , Args , <nl> - TAI - > getNormalBB ( ) , TAI - > getErrorBB ( ) ) ; <nl> - else <nl> - NewAI = Builder . createApply ( AI . getLoc ( ) , AI . getCallee ( ) , <nl> - NewSubstCalleeType , <nl> - AI . getType ( ) , Substitutions , Args , <nl> - cast < ApplyInst > ( AI ) - > isNonThrowing ( ) ) ; <nl> - <nl> - NewAI . getInstruction ( ) - > setDebugScope ( AI . getDebugScope ( ) ) ; <nl> - <nl> - if ( isa < ApplyInst > ( NewAI ) ) <nl> - replaceInstUsesWith ( * AI . getInstruction ( ) , NewAI . getInstruction ( ) , 0 ) ; <nl> - eraseInstFromFunction ( * AI . getInstruction ( ) ) ; <nl> - <nl> - CallGraphEditor ( CG ) . addEdgesForApply ( NewAI ) ; <nl> - <nl> - return NewAI . getInstruction ( ) ; <nl> - } <nl> - <nl> - / / / Derive a concrete type of self and conformance from the init_existential <nl> - / / / instruction . <nl> - static std : : pair < ProtocolConformance * , CanType > <nl> - getConformanceAndConcreteType ( FullApplySite AI , <nl> - SILInstruction * InitExistential , <nl> - ProtocolDecl * Protocol , <nl> - SILValue & NewSelf , <nl> - ArrayRef < ProtocolConformance * > & Conformances ) { <nl> - / / Try to derive the concrete type of self from the found init_existential . <nl> - CanType ConcreteType ; <nl> - if ( auto IE = dyn_cast < InitExistentialAddrInst > ( InitExistential ) ) { <nl> - Conformances = IE - > getConformances ( ) ; <nl> - ConcreteType = IE - > getFormalConcreteType ( ) ; <nl> - NewSelf = IE ; <nl> - } else if ( auto IER = dyn_cast < InitExistentialRefInst > ( InitExistential ) ) { <nl> - Conformances = IER - > getConformances ( ) ; <nl> - ConcreteType = IER - > getFormalConcreteType ( ) ; <nl> - NewSelf = IER - > getOperand ( ) ; <nl> - } <nl> - <nl> - if ( Conformances . empty ( ) ) <nl> - return std : : make_pair ( nullptr , CanType ( ) ) ; <nl> - <nl> - / / If ConcreteType depends on any archetypes , then propagating it does not <nl> - / / help resolve witness table lookups . Catch these cases before calling <nl> - / / gatherAllSubstitutions , which only works on nominal types . <nl> - if ( ConcreteType - > hasArchetype ( ) ) <nl> - return std : : make_pair ( nullptr , CanType ( ) ) ; <nl> - <nl> - / / Check the substitutions . <nl> - auto ConcreteTypeSubsts = ConcreteType - > gatherAllSubstitutions ( <nl> - AI . getModule ( ) . getSwiftModule ( ) , nullptr ) ; <nl> - if ( ! ConcreteTypeSubsts . empty ( ) ) { <nl> - / / Bail if any generic types parameters of the concrete type are unbound . <nl> - if ( hasUnboundGenericTypes ( ConcreteTypeSubsts ) ) <nl> - return std : : make_pair ( nullptr , CanType ( ) ) ; <nl> - / / At this point we know that all replacements use concrete types <nl> - / / and therefore the whole Lookup type is concrete . So , we can <nl> - / / propagate it , because we know how to devirtualize it . <nl> - } <nl> - <nl> - / / Find the conformance related to witness_method . <nl> - ProtocolConformance * Conformance = nullptr ; <nl> - for ( auto Con : Conformances ) { <nl> - if ( Con - > getProtocol ( ) = = Protocol ) { <nl> - Conformance = Con ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - return std : : make_pair ( Conformance , ConcreteType ) ; <nl> - } <nl> - <nl> - / / / Propagate information about a concrete type from init_existential_addr <nl> - / / / or init_existential_ref into witness_method conformances and into <nl> - / / / apply instructions . <nl> - / / / This helps the devirtualizer to replace witness_method by <nl> - / / / class_method instructions and then devirtualize . <nl> - SILInstruction * <nl> - SILCombiner : : propagateConcreteTypeOfInitExistential ( FullApplySite AI , <nl> - ProtocolDecl * Protocol , <nl> - std : : function < void ( CanType , ProtocolConformance * ) > Propagate ) { <nl> - <nl> - / / Get the self argument . <nl> - SILValue Self ; <nl> - if ( auto * Apply = dyn_cast < ApplyInst > ( AI ) ) { <nl> - if ( Apply - > hasSelfArgument ( ) ) <nl> - Self = Apply - > getSelfArgument ( ) ; <nl> - } else if ( auto * Apply = dyn_cast < TryApplyInst > ( AI ) ) { <nl> - if ( Apply - > hasSelfArgument ( ) ) <nl> - Self = Apply - > getSelfArgument ( ) ; <nl> - } <nl> - <nl> - assert ( Self & & " Self argument should be present " ) ; <nl> - <nl> - / / Try to find the init_existential , which could be used to <nl> - / / determine a concrete type of the self . <nl> - SILType InstanceType ; <nl> - SILInstruction * InitExistential = findInitExistential ( AI , Self , InstanceType ) ; <nl> - if ( ! InitExistential ) <nl> - return nullptr ; <nl> - <nl> - / / Try to derive the concrete type of self and a related conformance from <nl> - / / the found init_existential . <nl> - ArrayRef < ProtocolConformance * > Conformances ; <nl> - auto NewSelf = SILValue ( ) ; <nl> - auto ConformanceAndConcreteType = <nl> - getConformanceAndConcreteType ( AI , InitExistential , <nl> - Protocol , NewSelf , Conformances ) ; <nl> - auto ConcreteType = ConformanceAndConcreteType . second ; <nl> - auto Conformance = ConformanceAndConcreteType . first ; <nl> - if ( ! Conformance ) <nl> - return nullptr ; <nl> - <nl> - / / Propagate the concrete type into the callee - operand if required . <nl> - Propagate ( ConcreteType , Conformance ) ; <nl> - <nl> - / / Create a new apply instructions that uses the concrete type instead <nl> - / / of the existential type . <nl> - return createApplyWithConcreteType ( AI , NewSelf , Self , <nl> - ConcreteType , Conformance , InstanceType ) ; <nl> - } <nl> - <nl> - SILInstruction * <nl> - SILCombiner : : propagateConcreteTypeOfInitExistential ( FullApplySite AI , <nl> - WitnessMethodInst * WMI ) { <nl> - / / Check if it is legal to perform the propagation . <nl> - if ( WMI - > getConformance ( ) ) <nl> - return nullptr ; <nl> - <nl> - / / Don ' t specialize Apply instructions that return the Self type . <nl> - / / Notice that it is sufficient to compare the return type to the <nl> - / / substituted type because types that depend on the Self type are <nl> - / / not allowed ( for example [ Self ] is not allowed ) . <nl> - if ( AI . getType ( ) . getSwiftType ( ) . getLValueOrInOutObjectType ( ) = = <nl> - WMI - > getLookupType ( ) ) <nl> - return nullptr ; <nl> - <nl> - / / We need to handle the Self return type . <nl> - / / In we find arguments that are not the ' self ' argument and if <nl> - / / they are of the Self type then we abort the optimization . <nl> - for ( auto Arg : AI . getArgumentsWithoutSelf ( ) ) { <nl> - if ( Arg . getType ( ) . getSwiftType ( ) . getLValueOrInOutObjectType ( ) = = <nl> - WMI - > getLookupType ( ) ) <nl> - return nullptr ; <nl> - } <nl> - <nl> - / / Obtain the protocol whose which should be used by the conformance . <nl> - auto * PD = WMI - > getLookupProtocol ( ) ; <nl> - <nl> - / / Propagate the concrete type into a callee - operand , which is a <nl> - / / witness_method instruction . <nl> - auto PropagateIntoOperand = [ this , & WMI ] ( CanType ConcreteType , <nl> - ProtocolConformance * Conformance ) { <nl> - SILValue OptionalExistential = <nl> - WMI - > hasOperand ( ) ? WMI - > getOperand ( ) : SILValue ( ) ; <nl> - auto * NewWMI = Builder . createWitnessMethod ( WMI - > getLoc ( ) , <nl> - ConcreteType , <nl> - Conformance , WMI - > getMember ( ) , <nl> - WMI - > getType ( ) , <nl> - OptionalExistential , <nl> - WMI - > isVolatile ( ) ) ; <nl> - replaceInstUsesWith ( * WMI , NewWMI , 0 ) ; <nl> - eraseInstFromFunction ( * WMI ) ; <nl> - } ; <nl> - <nl> - / / Try to perform the propagation . <nl> - return propagateConcreteTypeOfInitExistential ( AI , PD , PropagateIntoOperand ) ; <nl> - } <nl> - <nl> - <nl> - SILInstruction * <nl> - SILCombiner : : propagateConcreteTypeOfInitExistential ( FullApplySite AI ) { <nl> - / / Check if it is legal to perform the propagation . <nl> - if ( ! AI . hasSubstitutions ( ) ) <nl> - return nullptr ; <nl> - auto * FRI = dyn_cast < FunctionRefInst > ( AI . getCallee ( ) ) ; <nl> - if ( ! FRI ) <nl> - return nullptr ; <nl> - auto * Callee = FRI - > getReferencedFunction ( ) ; <nl> - if ( ! Callee - > getDeclContext ( ) ) <nl> - return nullptr ; <nl> - <nl> - / / Bail , if there is no self argument . <nl> - SILValue Self ; <nl> - if ( auto * Apply = dyn_cast < ApplyInst > ( AI ) ) { <nl> - if ( Apply - > hasSelfArgument ( ) ) <nl> - Self = Apply - > getSelfArgument ( ) ; <nl> - } else if ( auto * Apply = dyn_cast < TryApplyInst > ( AI ) ) { <nl> - if ( Apply - > hasSelfArgument ( ) ) <nl> - Self = Apply - > getSelfArgument ( ) ; <nl> - } <nl> - if ( ! Self ) <nl> - return nullptr ; <nl> - <nl> - / / We need to handle the Self return type . <nl> - / / In we find arguments that are not the ' self ' argument and if <nl> - / / they are of the Self type then we abort the optimization . <nl> - for ( auto Arg : AI . getArgumentsWithoutSelf ( ) ) { <nl> - if ( Arg . getType ( ) . getSwiftType ( ) . getLValueOrInOutObjectType ( ) = = <nl> - AI . getArguments ( ) . back ( ) . getType ( ) . getSwiftRValueType ( ) ) <nl> - return nullptr ; <nl> - } <nl> - <nl> - / / Obtain the protocol whose which should be used by the conformance . <nl> - auto * AFD = dyn_cast < AbstractFunctionDecl > ( Callee - > getDeclContext ( ) ) ; <nl> - if ( ! AFD ) <nl> - return nullptr ; <nl> - auto * PD = AFD - > getDeclContext ( ) - > isProtocolOrProtocolExtensionContext ( ) ; <nl> - <nl> - <nl> - / / No need to propagate anything into the callee operand . <nl> - auto PropagateIntoOperand = [ ] ( CanType ConcreteType , <nl> - ProtocolConformance * Conformance ) { } ; <nl> - <nl> - / / Try to perform the propagation . <nl> - return propagateConcreteTypeOfInitExistential ( AI , PD , PropagateIntoOperand ) ; <nl> - } <nl> - <nl> - / / / Optimize thin_func_to_ptr - > ptr_to_thin_func casts into a type substituted <nl> - / / / apply . <nl> - / / / This kind of code arises in generic materializeForSet code that was <nl> - / / / specialized for a concrete type . <nl> - / / / <nl> - / / / Note : this is not as general as it should be . The general solution is the <nl> - / / / introduction of a partial_apply_thin_recoverable ( an instruction that <nl> - / / / partially applies a type and returns a thin_function ) as suggested in <nl> - / / / SILGenBuiltin . cpp . <nl> - / / / <nl> - / / / % 208 = thin_function_to_pointer % 207 : <nl> - / / / $ @ convention ( thin ) < τ_0_0 > ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , <nl> - / / / @ inout UnsafeMutableBufferPointer < τ_0_0 > , <nl> - / / / @ thick UnsafeMutableBufferPointer < τ_0_0 > . Type ) - > ( ) <nl> - / / / to $ Builtin . RawPointer <nl> - / / / % 209 = pointer_to_thin_function % 217 : $ Builtin . RawPointer to <nl> - / / / $ @ convention ( thin ) ( Builtin . RawPointer , @ inout Builtin . UnsafeValueBuffer , <nl> - / / / @ inout UnsafeMutableBufferPointer < Int > , <nl> - / / / @ thick UnsafeMutableBufferPointer < Int > . Type ) - > ( ) <nl> - / / / apply % 209 ( % 227 , % 200 # 1 , % 0 , % 224 ) : $ @ convention ( thin ) ( Builtin . RawPointer , <nl> - / / / @ inout Builtin . UnsafeValueBuffer , @ inout UnsafeMutableBufferPointer < Int > , <nl> - / / / @ thick UnsafeMutableBufferPointer < Int > . Type ) - > ( ) <nl> - / / / <nl> - / / / = > apply % 207 < Int > ( % 227 , . . . ) <nl> - static ApplyInst * optimizeCastThroughThinFunctionPointer ( <nl> - SILBuilder & Builder , ApplyInst * AI , FunctionRefInst * OrigThinFun , <nl> - PointerToThinFunctionInst * CastedThinFun ) { <nl> - <nl> - / / The original function type needs to be polymorphic . <nl> - auto ConvertCalleeTy = OrigThinFun - > getType ( ) . castTo < SILFunctionType > ( ) ; <nl> - assert ( ConvertCalleeTy ) ; <nl> - if ( ! ConvertCalleeTy - > isPolymorphic ( ) ) <nl> - return nullptr ; <nl> - <nl> - / / Need to have four parameters . <nl> - auto OrigParams = ConvertCalleeTy - > getParameters ( ) ; <nl> - if ( OrigParams . size ( ) ! = 4 ) <nl> - return nullptr ; <nl> - <nl> - / / There must only be one parameter to substitute . <nl> - auto * ReferencedFunction = OrigThinFun - > getReferencedFunction ( ) ; <nl> - assert ( ReferencedFunction ) ; <nl> - if ( ReferencedFunction - > isExternalDeclaration ( ) ) <nl> - return nullptr ; <nl> - auto Params = ReferencedFunction - > getContextGenericParams ( ) - > getParams ( ) ; <nl> - if ( Params . size ( ) ! = 1 ) <nl> - return nullptr ; <nl> - <nl> - / / Get the concrete type from the casted to function . <nl> - auto CastedFunTy = CastedThinFun - > getType ( ) . castTo < SILFunctionType > ( ) ; <nl> - auto CastedParams = CastedFunTy - > getParameters ( ) ; <nl> - if ( CastedParams . size ( ) ! = 4 ) <nl> - return nullptr ; <nl> - <nl> - / / The fourth parameter is a metatype of a bound generic type . Use it to <nl> - / / obtain the type substitutions to apply . <nl> - auto MetaTy = dyn_cast < MetatypeType > ( CastedParams [ 3 ] . getType ( ) ) ; <nl> - if ( ! MetaTy ) <nl> - return nullptr ; <nl> - <nl> - / / Get the bound generic type from the metatype . <nl> - auto BoundGenericInstTy = dyn_cast_or_null < BoundGenericType > ( <nl> - MetaTy - > getInstanceType ( ) . getCanonicalTypeOrNull ( ) ) ; <nl> - if ( ! BoundGenericInstTy ) <nl> - return nullptr ; <nl> - <nl> - / / The bound generic type will carry the substitutions to apply . <nl> - auto Subs = BoundGenericInstTy - > getSubstitutions ( <nl> - AI - > getModule ( ) . getSwiftModule ( ) , nullptr ) ; <nl> - <nl> - if ( Subs . size ( ) = = 0 ) <nl> - return nullptr ; <nl> - <nl> - / / We expect one type variable to be substituted . The substitution might have <nl> - / / recursive substitutions . Recognize and allow the case of one substitution <nl> - / / with recursive substitutions . <nl> - / / Container < T > <nl> - / / T = . . . <nl> - / / T . A = . . . <nl> - / / T . A . C = . . . <nl> - if ( Subs . size ( ) ! = 1 ) { <nl> - SmallPtrSet < ArchetypeType * , 16 > Archetypes ; <nl> - bool SawPrimary = false ; <nl> - / / Collect all the archetypes and make sure there is only one primary . <nl> - for ( unsigned i = 0 , e = Subs . size ( ) ; i ! = e ; + + i ) { <nl> - auto * AT = Subs [ i ] . getArchetype ( ) ; <nl> - Archetypes . insert ( AT ) ; <nl> - / / Two primary arche types . We can ' t handle this case . <nl> - if ( SawPrimary & & AT - > isPrimary ( ) ) <nl> - return nullptr ; <nl> - else if ( AT - > isPrimary ( ) ) <nl> - SawPrimary = true ; <nl> - } <nl> - <nl> - / / Make sure all the non primary archetypes have a parent archetype in the <nl> - / / set . <nl> - for ( unsigned i = 0 , e = Subs . size ( ) ; i ! = e ; + + i ) { <nl> - auto * AT = Subs [ i ] . getArchetype ( ) ; <nl> - / / Ignore the one primary archetype . <nl> - if ( AT - > isPrimary ( ) ) <nl> - continue ; <nl> - if ( ! Archetypes . count ( AT ) ) <nl> - return nullptr ; <nl> - } <nl> - } <nl> - <nl> - SmallVector < SILValue , 16 > Args ; <nl> - for ( auto Arg : AI - > getArguments ( ) ) <nl> - Args . push_back ( Arg ) ; <nl> - <nl> - auto NewSubstCalleeType = <nl> - SILType : : getPrimitiveObjectType ( ConvertCalleeTy - > substGenericArgs ( <nl> - AI - > getModule ( ) , AI - > getModule ( ) . getSwiftModule ( ) , Subs ) ) ; <nl> - <nl> - ApplyInst * NewApply = Builder . createApply ( <nl> - AI - > getLoc ( ) , OrigThinFun , NewSubstCalleeType , AI - > getType ( ) , Subs , Args , <nl> - AI - > isNonThrowing ( ) ) ; <nl> - NewApply - > setDebugScope ( AI - > getDebugScope ( ) ) ; <nl> - <nl> - return NewApply ; <nl> - } <nl> - <nl> - / / / \ brief Check that all users of the apply are retain / release ignoring one <nl> - / / / user . <nl> - static bool <nl> - hasOnlyRetainReleaseUsers ( ApplyInst * AI , SILInstruction * IgnoreUser , <nl> - SmallVectorImpl < SILInstruction * > & Users ) { <nl> - for ( auto * Use : getNonDebugUses ( * AI ) ) { <nl> - if ( Use - > getUser ( ) = = IgnoreUser ) <nl> - continue ; <nl> - <nl> - if ( ! isa < RetainValueInst > ( Use - > getUser ( ) ) & & <nl> - ! isa < ReleaseValueInst > ( Use - > getUser ( ) ) & & <nl> - ! isa < StrongRetainInst > ( Use - > getUser ( ) ) & & <nl> - ! isa < StrongReleaseInst > ( Use - > getUser ( ) ) ) <nl> - return false ; <nl> - <nl> - Users . push_back ( Use - > getUser ( ) ) ; <nl> - } <nl> - return true ; <nl> - } ; <nl> - <nl> - / / / \ brief We only know how to simulate reference call effects for unary <nl> - / / / function calls that take their argument @ owned or @ guaranteed and return an <nl> - / / / @ owned value . <nl> - static bool knowHowToEmitReferenceCountInsts ( ApplyInst * Call ) { <nl> - if ( Call - > getNumArguments ( ) ! = 1 ) <nl> - return false ; <nl> - <nl> - FunctionRefInst * FRI = cast < FunctionRefInst > ( Call - > getCallee ( ) ) ; <nl> - SILFunction * F = FRI - > getReferencedFunction ( ) ; <nl> - auto FnTy = F - > getLoweredFunctionType ( ) ; <nl> - <nl> - / / Look at the result type . <nl> - auto ResultInfo = FnTy - > getResult ( ) ; <nl> - if ( ResultInfo . getConvention ( ) ! = ResultConvention : : Owned ) <nl> - return false ; <nl> - <nl> - / / Look at the parameter . <nl> - auto Params = FnTy - > getParameters ( ) ; <nl> - ( void ) Params ; <nl> - assert ( Params . size ( ) = = 1 & & " Expect one parameter " ) ; <nl> - auto ParamConv = FnTy - > getParameters ( ) [ 0 ] . getConvention ( ) ; <nl> - <nl> - return ParamConv = = ParameterConvention : : Direct_Owned | | <nl> - ParamConv = = ParameterConvention : : Direct_Guaranteed ; <nl> - } <nl> - <nl> - / / / \ brief Add reference counting operations equal to the effect of the call . <nl> - static void emitMatchingRCAdjustmentsForCall ( ApplyInst * Call , SILValue OnX ) { <nl> - FunctionRefInst * FRI = cast < FunctionRefInst > ( Call - > getCallee ( ) ) ; <nl> - SILFunction * F = FRI - > getReferencedFunction ( ) ; <nl> - auto FnTy = F - > getLoweredFunctionType ( ) ; <nl> - auto ResultInfo = FnTy - > getResult ( ) ; <nl> - ( void ) ResultInfo ; <nl> - <nl> - assert ( ResultInfo . getConvention ( ) = = ResultConvention : : Owned & & <nl> - " Expect a @ owned return " ) ; <nl> - assert ( Call - > getNumArguments ( ) = = 1 & & " Expect a unary call " ) ; <nl> - <nl> - / / Emit a retain for the @ owned return . <nl> - SILBuilderWithScope < > Builder ( Call ) ; <nl> - Builder . createRetainValue ( Call - > getLoc ( ) , OnX ) ; <nl> - <nl> - / / Emit a release for the @ owned parameter , or none for a @ guaranteed <nl> - / / parameter . <nl> - auto Params = FnTy - > getParameters ( ) ; <nl> - ( void ) Params ; <nl> - assert ( Params . size ( ) = = 1 & & " Expect one parameter " ) ; <nl> - auto ParamInfo = FnTy - > getParameters ( ) [ 0 ] . getConvention ( ) ; <nl> - assert ( ParamInfo = = ParameterConvention : : Direct_Owned | | <nl> - ParamInfo = = ParameterConvention : : Direct_Guaranteed ) ; <nl> - <nl> - if ( ParamInfo = = ParameterConvention : : Direct_Owned ) <nl> - Builder . createReleaseValue ( Call - > getLoc ( ) , OnX ) ; <nl> - } <nl> - <nl> - static bool isCastTypeKnownToSucceed ( SILType Type , SILModule & Mod ) { <nl> - auto * M = Mod . getSwiftModule ( ) ; <nl> - return M - > getASTContext ( ) <nl> - . getBridgedToObjC ( M , Type . getSwiftRValueType ( ) , nullptr ) <nl> - . hasValue ( ) ; <nl> - } <nl> - <nl> - / / / Replace an application of a cast composition f_inverse ( f ( x ) ) by x . <nl> - bool SILCombiner : : optimizeIdentityCastComposition ( ApplyInst * FInverse , <nl> - StringRef FInverseName , <nl> - StringRef FName ) { <nl> - / / Needs to have a known semantics . <nl> - if ( ! FInverse - > hasSemantics ( FInverseName ) ) <nl> - return false ; <nl> - <nl> - / / We need to know how to replace the call by reference counting instructions . <nl> - if ( ! knowHowToEmitReferenceCountInsts ( FInverse ) ) <nl> - return false ; <nl> - <nl> - / / We need to know that the cast will succeeed . <nl> - if ( ! isCastTypeKnownToSucceed ( FInverse - > getArgument ( 0 ) . getType ( ) , <nl> - FInverse - > getModule ( ) ) | | <nl> - ! isCastTypeKnownToSucceed ( FInverse - > getType ( ) , FInverse - > getModule ( ) ) ) <nl> - return false ; <nl> - <nl> - / / Need to have a matching ' f ' . <nl> - auto * F = dyn_cast < ApplyInst > ( FInverse - > getArgument ( 0 ) ) ; <nl> - if ( ! F ) <nl> - return false ; <nl> - if ( ! F - > hasSemantics ( FName ) ) <nl> - return false ; <nl> - if ( ! knowHowToEmitReferenceCountInsts ( F ) ) <nl> - return false ; <nl> - <nl> - / / The types must match . <nl> - if ( F - > getArgument ( 0 ) . getType ( ) ! = FInverse - > getType ( ) ) <nl> - return false ; <nl> - <nl> - / / Retains , releases of the result of F . <nl> - SmallVector < SILInstruction * , 16 > RetainReleases ; <nl> - if ( ! hasOnlyRetainReleaseUsers ( F , FInverse , RetainReleases ) ) <nl> - return false ; <nl> - <nl> - / / Okay , now we know we can remove the calls . <nl> - auto X = F - > getArgument ( 0 ) ; <nl> - <nl> - / / Redirect f ' s result ' s retains / releases to affect x . <nl> - for ( auto * User : RetainReleases ) { <nl> - / / X might not be strong_retain / release ' able . Replace it by a <nl> - / / retain / release_value on X instead . <nl> - if ( isa < StrongRetainInst > ( User ) ) { <nl> - SILBuilderWithScope < > ( User ) . createRetainValue ( User - > getLoc ( ) , X ) ; <nl> - eraseInstFromFunction ( * User ) ; <nl> - continue ; <nl> - } <nl> - if ( isa < StrongReleaseInst > ( User ) ) { <nl> - SILBuilderWithScope < > ( User ) . createReleaseValue ( User - > getLoc ( ) , X ) ; <nl> - eraseInstFromFunction ( * User ) ; <nl> - continue ; <nl> - } <nl> - User - > setOperand ( 0 , X ) ; <nl> - } <nl> - <nl> - / / Simulate the reference count effects of the calls before removing <nl> - / / them . <nl> - emitMatchingRCAdjustmentsForCall ( F , X ) ; <nl> - emitMatchingRCAdjustmentsForCall ( FInverse , X ) ; <nl> - <nl> - / / Replace users of f_inverse by x . <nl> - replaceInstUsesWith ( * FInverse , X . getDef ( ) ) ; <nl> - <nl> - / / Remove the calls . <nl> - eraseInstFromFunction ( * FInverse ) ; <nl> - eraseInstFromFunction ( * F ) ; <nl> - <nl> - return true ; <nl> - } <nl> - <nl> - SILInstruction * SILCombiner : : visitApplyInst ( ApplyInst * AI ) { <nl> - / / apply { partial_apply ( x , y ) } ( z ) - > apply ( z , x , y ) is triggered <nl> - / / from visitPartialApplyInst ( ) , so bail here . <nl> - if ( isa < PartialApplyInst > ( AI - > getCallee ( ) ) ) <nl> - return nullptr ; <nl> - <nl> - if ( auto * CFI = dyn_cast < ConvertFunctionInst > ( AI - > getCallee ( ) ) ) <nl> - return optimizeApplyOfConvertFunctionInst ( AI , CFI ) ; <nl> - <nl> - if ( auto * CastedThinFun = <nl> - dyn_cast < PointerToThinFunctionInst > ( AI - > getCallee ( ) ) ) <nl> - if ( auto * Ptr = <nl> - dyn_cast < ThinFunctionToPointerInst > ( CastedThinFun - > getOperand ( ) ) ) <nl> - if ( auto * OrigThinFun = dyn_cast < FunctionRefInst > ( Ptr - > getOperand ( ) ) ) <nl> - if ( auto * NewAI = optimizeCastThroughThinFunctionPointer ( <nl> - Builder , AI , OrigThinFun , CastedThinFun ) ) { <nl> - replaceInstUsesWith ( * AI , NewAI , 0 ) ; <nl> - eraseInstFromFunction ( * AI ) ; <nl> - CallGraphEditor ( CG ) . addEdgesForApply ( NewAI ) ; <nl> - return nullptr ; <nl> - } <nl> - <nl> - / / Optimize readonly functions with no meaningful users . <nl> - FunctionRefInst * FRI = dyn_cast < FunctionRefInst > ( AI - > getCallee ( ) ) ; <nl> - if ( FRI & & <nl> - FRI - > getReferencedFunction ( ) - > getEffectsKind ( ) < EffectsKind : : ReadWrite ) { <nl> - UserListTy Users ; <nl> - if ( recursivelyCollectARCUsers ( Users , AI ) ) { <nl> - / / When deleting Apply instructions make sure to release any owned <nl> - / / arguments . <nl> - auto FT = FRI - > getFunctionType ( ) ; <nl> - for ( int i = 0 , e = AI - > getNumArguments ( ) ; i < e ; + + i ) { <nl> - SILParameterInfo PI = FT - > getParameters ( ) [ i ] ; <nl> - auto Arg = AI - > getArgument ( i ) ; <nl> - if ( PI . isConsumed ( ) & & ! Arg . getType ( ) . isAddress ( ) ) <nl> - Builder . emitReleaseValueOperation ( AI - > getLoc ( ) , Arg ) ; <nl> - } <nl> - <nl> - / / Erase all of the reference counting instructions and the Apply itself . <nl> - for ( auto rit = Users . rbegin ( ) , re = Users . rend ( ) ; rit ! = re ; + + rit ) <nl> - eraseInstFromFunction ( * * rit ) ; <nl> - <nl> - return nullptr ; <nl> - } <nl> - / / We found a user that we can ' t handle . <nl> - } <nl> - <nl> - if ( FRI ) { <nl> - auto * SF = FRI - > getReferencedFunction ( ) ; <nl> - if ( SF - > getEffectsKind ( ) < EffectsKind : : ReadWrite ) { <nl> - / / Try to optimize string concatenation . <nl> - if ( auto I = optimizeConcatenationOfStringLiterals ( AI ) ) { <nl> - return I ; <nl> - } <nl> - } <nl> - if ( SF - > hasSemanticsString ( " array . uninitialized " ) ) { <nl> - UserListTy Users ; <nl> - / / If the uninitialized array is only written into then it can be removed . <nl> - if ( recursivelyCollectARCUsers ( Users , AI ) ) { <nl> - / / Erase all of the reference counting instructions on the array and the <nl> - / / allocation - apply itself . <nl> - for ( auto rit = Users . rbegin ( ) , re = Users . rend ( ) ; rit ! = re ; + + rit ) <nl> - eraseInstFromFunction ( * * rit ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - <nl> - / / ( apply ( thin_to_thick_function f ) ) to ( apply f ) <nl> - if ( auto * TTTFI = dyn_cast < ThinToThickFunctionInst > ( AI - > getCallee ( ) ) ) { <nl> - / / TODO : Handle substitutions and indirect results <nl> - if ( AI - > hasSubstitutions ( ) | | AI - > hasIndirectResult ( ) ) <nl> - return nullptr ; <nl> - SmallVector < SILValue , 4 > Arguments ; <nl> - for ( auto & Op : AI - > getArgumentOperands ( ) ) { <nl> - Arguments . push_back ( Op . get ( ) ) ; <nl> - } <nl> - / / The type of the substition is the source type of the thin to thick <nl> - / / instruction . <nl> - SILType substTy = TTTFI - > getOperand ( ) . getType ( ) ; <nl> - auto * NewAI = Builder . createApply ( AI - > getLoc ( ) , TTTFI - > getOperand ( ) , <nl> - substTy , AI - > getType ( ) , <nl> - AI - > getSubstitutions ( ) , Arguments , <nl> - AI - > isNonThrowing ( ) ) ; <nl> - NewAI - > setDebugScope ( AI - > getDebugScope ( ) ) ; <nl> - return NewAI ; <nl> - } <nl> - <nl> - / / ( apply ( witness_method ) ) - > propagate information about <nl> - / / a concrete type from init_existential_addr or init_existential_ref . <nl> - if ( auto * WMI = dyn_cast < WitnessMethodInst > ( AI - > getCallee ( ) ) ) { <nl> - propagateConcreteTypeOfInitExistential ( AI , WMI ) ; <nl> - return nullptr ; <nl> - } <nl> - <nl> - / / ( apply ( function_ref method_from_protocol_extension ) ) - > <nl> - / / propagate information about a concrete type from init_existential_addr or <nl> - / / init_existential_ref . <nl> - if ( isa < FunctionRefInst > ( AI - > getCallee ( ) ) ) { <nl> - if ( propagateConcreteTypeOfInitExistential ( AI ) ) { <nl> - return nullptr ; <nl> - } <nl> - } <nl> - <nl> - / / Optimize f_inverse ( f ( x ) ) - > x . <nl> - if ( optimizeIdentityCastComposition ( AI , " convertFromObjectiveC " , <nl> - " convertToObjectiveC " ) ) <nl> - return nullptr ; <nl> - if ( optimizeIdentityCastComposition ( AI , " convertToObjectiveC " , <nl> - " convertFromObjectiveC " ) ) <nl> - return nullptr ; <nl> - <nl> - return nullptr ; <nl> - } <nl> - <nl> - SILInstruction * SILCombiner : : visitTryApplyInst ( TryApplyInst * AI ) { <nl> - / / apply { partial_apply ( x , y ) } ( z ) - > apply ( z , x , y ) is triggered <nl> - / / from visitPartialApplyInst ( ) , so bail here . <nl> - if ( isa < PartialApplyInst > ( AI - > getCallee ( ) ) ) <nl> - return nullptr ; <nl> - <nl> - if ( auto * CFI = dyn_cast < ConvertFunctionInst > ( AI - > getCallee ( ) ) ) { <nl> - return optimizeApplyOfConvertFunctionInst ( AI , CFI ) ; <nl> - } <nl> - <nl> - / / Optimize readonly functions with no meaningful users . <nl> - FunctionRefInst * FRI = dyn_cast < FunctionRefInst > ( AI - > getCallee ( ) ) ; <nl> - if ( FRI & & <nl> - FRI - > getReferencedFunction ( ) - > getEffectsKind ( ) < EffectsKind : : ReadWrite ) { <nl> - UserListTy Users ; <nl> - if ( recursivelyCollectARCUsers ( Users , AI ) ) { <nl> - / / When deleting Apply instructions make sure to release any owned <nl> - / / arguments . <nl> - auto FT = FRI - > getFunctionType ( ) ; <nl> - for ( int i = 0 , e = AI - > getNumArguments ( ) ; i < e ; + + i ) { <nl> - SILParameterInfo PI = FT - > getParameters ( ) [ i ] ; <nl> - auto Arg = AI - > getArgument ( i ) ; <nl> - if ( PI . isConsumed ( ) & & ! Arg . getType ( ) . isAddress ( ) ) <nl> - Builder . emitReleaseValueOperation ( AI - > getLoc ( ) , Arg ) ; <nl> - } <nl> - <nl> - / / Erase all of the reference counting instructions and the Apply itself . <nl> - for ( auto rit = Users . rbegin ( ) , re = Users . rend ( ) ; rit ! = re ; + + rit ) <nl> - eraseInstFromFunction ( * * rit ) ; <nl> - <nl> - return nullptr ; <nl> - } <nl> - / / We found a user that we can ' t handle . <nl> - } <nl> - <nl> - / / ( try_apply ( thin_to_thick_function f ) ) to ( try_apply f ) <nl> - if ( auto * TTTFI = dyn_cast < ThinToThickFunctionInst > ( AI - > getCallee ( ) ) ) { <nl> - / / TODO : Handle substitutions and indirect results <nl> - if ( AI - > hasSubstitutions ( ) | | AI - > hasIndirectResult ( ) ) <nl> - return nullptr ; <nl> - SmallVector < SILValue , 4 > Arguments ; <nl> - for ( auto & Op : AI - > getArgumentOperands ( ) ) { <nl> - Arguments . push_back ( Op . get ( ) ) ; <nl> - } <nl> - / / The type of the substitution is the source type of the thin to thick <nl> - / / instruction . <nl> - SILType substTy = TTTFI - > getOperand ( ) . getType ( ) ; <nl> - auto * NewAI = Builder . createTryApply ( AI - > getLoc ( ) , TTTFI - > getOperand ( ) , <nl> - substTy , <nl> - AI - > getSubstitutions ( ) , Arguments , <nl> - AI - > getNormalBB ( ) , AI - > getErrorBB ( ) ) ; <nl> - NewAI - > setDebugScope ( AI - > getDebugScope ( ) ) ; <nl> - return NewAI ; <nl> - } <nl> - <nl> - / / ( apply ( witness_method ) ) - > propagate information about <nl> - / / a concrete type from init_existential_addr or init_existential_ref . <nl> - if ( auto * WMI = dyn_cast < WitnessMethodInst > ( AI - > getCallee ( ) ) ) { <nl> - propagateConcreteTypeOfInitExistential ( AI , WMI ) ; <nl> - return nullptr ; <nl> - } <nl> - <nl> - / / ( apply ( function_ref method_from_protocol_extension ) ) - > <nl> - / / propagate information about a concrete type from init_existential_addr or <nl> - / / init_existential_ref . <nl> - if ( isa < FunctionRefInst > ( AI - > getCallee ( ) ) ) { <nl> - if ( propagateConcreteTypeOfInitExistential ( AI ) ) { <nl> - return nullptr ; <nl> - } <nl> - } <nl> - <nl> - return nullptr ; <nl> - } <nl> - <nl> SILInstruction * SILCombiner : : visitCondFailInst ( CondFailInst * CFI ) { <nl> / / Remove runtime asserts such as overflow checks and bounds checks . <nl> if ( RemoveCondFails ) <nl> | Refactor out apply related combines from SILCombinerVisitors . cpp = > SILCombinerApplyVisitors . cpp . | apple/swift | 1d20fe2bef80f212b44e52fc99e5d937fd0eac53 | 2015-09-30T00:34:05Z |
mmm a / hphp / runtime / base / execution - context . cpp <nl> ppp b / hphp / runtime / base / execution - context . cpp <nl> static void threadLogger ( const char * header , const char * msg , <nl> <nl> StaticString <nl> s_php_namespace ( " < ? php namespace " ) , <nl> + s_hh_namespace ( " < ? hh namespace " ) , <nl> s_curly_return ( " { return " ) , <nl> s_semicolon_curly ( " ; } " ) , <nl> s_php_return ( " < ? php return " ) , <nl> + s_hh_return ( " < ? hh return " ) , <nl> s_semicolon ( " ; " ) , <nl> s_stdclass ( " stdclass " ) ; <nl> <nl> bool ExecutionContext : : evalUnit ( Unit * unit , PC & pc , int funcType ) { <nl> } <nl> <nl> const Variant & ExecutionContext : : getEvaledArg ( const StringData * val , <nl> - const String & namespacedName ) { <nl> + const String & namespacedName , <nl> + const Unit * funcUnit ) { <nl> auto key = StrNR ( val ) ; <nl> <nl> if ( m_evaledArgs . get ( ) ) { <nl> const Variant & ExecutionContext : : getEvaledArg ( const StringData * val , <nl> int pos = namespacedName . rfind ( ' \ \ ' ) ; <nl> if ( pos ! = - 1 ) { <nl> auto ns = namespacedName . substr ( 0 , pos ) ; <nl> - code = s_php_namespace + ns + s_curly_return + key + s_semicolon_curly ; <nl> + code = ( funcUnit - > isHHFile ( ) ? s_hh_namespace : s_php_namespace ) + <nl> + ns + s_curly_return + key + s_semicolon_curly ; <nl> } else { <nl> - code = s_php_return + key + s_semicolon ; <nl> + code = ( funcUnit - > isHHFile ( ) ? s_hh_return : s_php_return ) + <nl> + key + s_semicolon ; <nl> } <nl> Unit * unit = compileEvalString ( code . get ( ) ) ; <nl> assert ( unit ! = nullptr ) ; <nl> StrNR ExecutionContext : : createFunction ( const String & args , <nl> / / user function named __lambda_func when you call create_function . Huzzah ! ) <nl> static StringData * oldName = makeStaticString ( " __lambda_func " ) ; <nl> std : : ostringstream codeStr ; <nl> - codeStr < < " < ? php function " < < oldName - > data ( ) <nl> + codeStr < < ( vmfp ( ) - > unit ( ) - > isHHFile ( ) ? " < ? hh " : " < ? php " ) <nl> + < < " function " < < oldName - > data ( ) <nl> < < " ( " < < args . data ( ) < < " ) { " <nl> < < code . data ( ) < < " } \ n " ; <nl> std : : string evalCode = codeStr . str ( ) ; <nl> mmm a / hphp / runtime / base / execution - context . h <nl> ppp b / hphp / runtime / base / execution - context . h <nl> struct ExecutionContext { <nl> void bindVar ( StringData * name , TypedValue * v ) ; <nl> Array getLocalDefinedVariables ( int frame ) ; <nl> const Variant & getEvaledArg ( const StringData * val , <nl> - const String & namespacedName ) ; <nl> + const String & namespacedName , <nl> + const Unit * funcUnit ) ; <nl> <nl> private : <nl> template < bool forwarding > <nl> mmm a / hphp / runtime / base / preg . cpp <nl> ppp b / hphp / runtime / base / preg . cpp <nl> static Variant php_pcre_replace ( const String & pattern , const String & subject , <nl> VMRegAnchor _ ; <nl> / / reserve space for " < ? php return " + code + " ; " <nl> String prefixedCode ( full_len - result_len + 14 , ReserveString ) ; <nl> - prefixedCode + = " < ? php return " ; <nl> + prefixedCode + = <nl> + ( vmfp ( ) - > unit ( ) - > isHHFile ( ) ? " < ? hh return " : " < ? php return " ) ; <nl> prefixedCode + = folly : : StringPiece { data , full_len - result_len } ; <nl> prefixedCode + = " ; " ; <nl> auto const unit = g_context - > compileEvalString ( prefixedCode . get ( ) ) ; <nl> mmm a / hphp / runtime / ext / reflection / ext_reflection . cpp <nl> ppp b / hphp / runtime / ext / reflection / ext_reflection . cpp <nl> Variant default_arg_from_php_code ( const Func : : ParamInfo & fpi , <nl> / / We use cls ( ) instead of implCls ( ) because we want the namespace and <nl> / / class context for which the closure is scoped , not that of the Closure <nl> / / subclass ( which , among other things , is always globally namespaced ) . <nl> - func - > cls ( ) ? func - > cls ( ) - > nameStr ( ) : func - > nameStr ( ) <nl> + func - > cls ( ) ? func - > cls ( ) - > nameStr ( ) : func - > nameStr ( ) , <nl> + func - > unit ( ) <nl> ) ; <nl> } <nl> } <nl> mmm a / hphp / runtime / ext / std / ext_std_options . cpp <nl> ppp b / hphp / runtime / ext / std / ext_std_options . cpp <nl> static Variant HHVM_FUNCTION ( assert_options , <nl> } <nl> <nl> static Variant eval_for_assert ( ActRec * const curFP , const String & codeStr ) { <nl> - String prefixedCode = concat3 ( " < ? php return " , codeStr , " ; " ) ; <nl> + String prefixedCode = concat3 ( <nl> + curFP - > unit ( ) - > isHHFile ( ) ? " < ? hh return " : " < ? php return " , <nl> + codeStr , <nl> + " ; " <nl> + ) ; <nl> <nl> auto const oldErrorLevel = <nl> s_option_data - > assertQuietEval ? HHVM_FN ( error_reporting ) ( Variant ( 0 ) ) : 0 ; <nl> mmm a / hphp / runtime / vm / bytecode . cpp <nl> ppp b / hphp / runtime / vm / bytecode . cpp <nl> OPTBLD_INLINE void iopEval ( PC & pc ) { <nl> } <nl> <nl> auto code = String : : attach ( prepareKey ( * c1 ) ) ; <nl> - String prefixedCode = concat ( " < ? php " , code ) ; <nl> + String prefixedCode = concat ( <nl> + vmfp ( ) - > unit ( ) - > isHHFile ( ) ? " < ? hh " : " < ? php " , <nl> + code <nl> + ) ; <nl> <nl> auto evalFilename = std : : string ( ) ; <nl> auto vm = & * g_context ; <nl> mmm a / hphp / runtime / vm / runtime . cpp <nl> ppp b / hphp / runtime / vm / runtime . cpp <nl> Unit * compile_file ( const char * s , size_t sz , const MD5 & md5 , <nl> } <nl> <nl> std : : string mangleSystemMd5 ( const std : : string & fileMd5 ) { <nl> - / / This resembles mangleUnitMd5 ( . . . ) , however , only settings that HHBBC is <nl> - / / aware of may be used here or it will be unable to load systemlib ! <nl> std : : string t = fileMd5 + ' \ 0 ' <nl> + ( RuntimeOption : : PHP7_IntSemantics ? ' 1 ' : ' 0 ' ) <nl> + ( RuntimeOption : : AutoprimeGenerators ? ' 1 ' : ' 0 ' ) <nl> + + ( RuntimeOption : : EnableHipHopSyntax ? ' 1 ' : ' 0 ' ) <nl> ; <nl> return string_md5 ( t ) ; <nl> } <nl> new file mode 100644 <nl> index 00000000000 . . 738941ff411 <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / hack - arrays - eval . php <nl> <nl> + < ? hh <nl> + / / Copyright 2004 - present Facebook . All Rights Reserved . <nl> + <nl> + function test_eval ( ) { <nl> + echo " = = = = = = = = = = = = test_eval = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = \ n " ; <nl> + <nl> + eval ( ' $ v = vec [ 1 , 2 , 3 ] ; ' ) ; <nl> + eval ( ' $ d = dict [ 100 = > \ ' abc \ ' , 200 = > \ ' def \ ' ] ; ' ) ; <nl> + eval ( ' $ k = keyset [ 1 , \ ' abc \ ' , 3 ] ; ' ) ; <nl> + <nl> + var_dump ( $ v ) ; <nl> + var_dump ( $ d ) ; <nl> + var_dump ( $ k ) ; <nl> + <nl> + $ a = [ 100 , 200 , 300 ] ; <nl> + eval ( ' $ v = vec ( $ a ) ; ' ) ; <nl> + eval ( ' $ d = dict ( $ a ) ; ' ) ; <nl> + eval ( ' $ k = keyset ( $ a ) ; ' ) ; <nl> + <nl> + var_dump ( $ v ) ; <nl> + var_dump ( $ d ) ; <nl> + var_dump ( $ k ) ; <nl> + <nl> + eval ( ' var_dump ( is_vec ( $ v ) ) ; ' ) ; <nl> + eval ( ' var_dump ( is_dict ( $ d ) ) ; ' ) ; <nl> + eval ( ' var_dump ( is_keyset ( $ k ) ) ; ' ) ; <nl> + } <nl> + <nl> + function test_assert ( ) { <nl> + echo " = = = = = = = = = = = = test_assert = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = \ n " ; <nl> + <nl> + assert ( ' ( $ v = vec [ 1 , 2 , 3 ] ) | | true ' ) ; <nl> + assert ( ' ( $ d = dict [ 100 = > \ ' abc \ ' , 200 = > \ ' def \ ' ] ) | | true ' ) ; <nl> + assert ( ' ( $ k = keyset [ 1 , \ ' abc \ ' , 3 ] ) | | true ' ) ; <nl> + <nl> + var_dump ( $ v ) ; <nl> + var_dump ( $ d ) ; <nl> + var_dump ( $ k ) ; <nl> + <nl> + $ a = [ 100 , 200 , 300 ] ; <nl> + assert ( ' ( $ v = vec ( $ a ) ) | | true ' ) ; <nl> + assert ( ' ( $ d = dict ( $ a ) ) | | true ' ) ; <nl> + assert ( ' ( $ k = keyset ( $ a ) ) | | true ' ) ; <nl> + <nl> + var_dump ( $ v ) ; <nl> + var_dump ( $ d ) ; <nl> + var_dump ( $ k ) ; <nl> + <nl> + assert ( ' ( var_dump ( is_vec ( $ v ) ) ) | | true ' ) ; <nl> + assert ( ' ( var_dump ( is_dict ( $ d ) ) ) | | true ' ) ; <nl> + assert ( ' ( var_dump ( is_keyset ( $ k ) ) ) | | true ' ) ; <nl> + } <nl> + <nl> + function test_create_function ( ) { <nl> + echo " = = = = = = = = = = = = test_create_function = = = = = = = = = = = = = = = = = = = = = = = = = = = = \ n " ; <nl> + <nl> + $ f1 = create_function ( ' ' , ' return vec [ 1 , 2 , 3 ] ; ' ) ; <nl> + $ f2 = create_function ( ' ' , ' return dict [ 100 = > \ ' abc \ ' , 200 = > \ ' def \ ' ] ; ' ) ; <nl> + $ f3 = create_function ( ' ' , ' return keyset [ 1 , \ ' abc \ ' , 3 ] ; ' ) ; <nl> + <nl> + $ v = $ f1 ( ) ; <nl> + $ d = $ f2 ( ) ; <nl> + $ k = $ f3 ( ) ; <nl> + <nl> + var_dump ( $ k ) ; <nl> + var_dump ( $ d ) ; <nl> + var_dump ( $ k ) ; <nl> + <nl> + $ a = [ 100 , 200 , 300 ] ; <nl> + $ f4 = create_function ( ' $ a ' , ' return vec ( $ a ) ; ' ) ; <nl> + $ f5 = create_function ( ' $ a ' , ' return dict ( $ a ) ; ' ) ; <nl> + $ f6 = create_function ( ' $ a ' , ' return keyset ( $ a ) ; ' ) ; <nl> + <nl> + var_dump ( $ f4 ( $ a ) ) ; <nl> + var_dump ( $ f5 ( $ a ) ) ; <nl> + var_dump ( $ f6 ( $ a ) ) ; <nl> + <nl> + $ f7 = create_function ( ' $ v ' , ' return is_vec ( $ v ) ; ' ) ; <nl> + $ f8 = create_function ( ' $ d ' , ' return is_dict ( $ d ) ; ' ) ; <nl> + $ f9 = create_function ( ' $ k ' , ' return is_keyset ( $ k ) ; ' ) ; <nl> + <nl> + var_dump ( $ f7 ( $ v ) ) ; <nl> + var_dump ( $ f8 ( $ d ) ) ; <nl> + var_dump ( $ f9 ( $ k ) ) ; <nl> + } <nl> + <nl> + $ array = [ ] ; <nl> + function test_func ( $ v = $ array [ ] = vec [ 1 , 2 ] , <nl> + $ d = $ array [ ] = dict [ 100 = > ' a ' , 200 = > ' b ' ] , <nl> + $ k = $ array [ ] = keyset [ ' a ' , ' b ' ] ) { } <nl> + <nl> + function test_default_value ( ) { <nl> + echo " = = = = = = = = = = = = test_default_value = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = \ n " ; <nl> + $ r = new ReflectionFunction ( ' test_func ' ) ; <nl> + var_dump ( $ r - > getParameters ( ) [ 0 ] - > info [ ' default ' ] ) ; <nl> + var_dump ( $ r - > getParameters ( ) [ 1 ] - > info [ ' default ' ] ) ; <nl> + var_dump ( $ r - > getParameters ( ) [ 2 ] - > info [ ' default ' ] ) ; <nl> + } <nl> + <nl> + test_eval ( ) ; <nl> + test_assert ( ) ; <nl> + test_create_function ( ) ; <nl> + test_default_value ( ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 63d33b87152 <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / hack - arrays - eval . php . expect <nl> <nl> + = = = = = = = = = = = = test_eval = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + vec ( 3 ) { <nl> + int ( 1 ) <nl> + int ( 2 ) <nl> + int ( 3 ) <nl> + } <nl> + dict ( 2 ) { <nl> + [ 100 ] = > <nl> + string ( 3 ) " abc " <nl> + [ 200 ] = > <nl> + string ( 3 ) " def " <nl> + } <nl> + keyset ( 3 ) { <nl> + int ( 1 ) <nl> + string ( 3 ) " abc " <nl> + int ( 3 ) <nl> + } <nl> + vec ( 3 ) { <nl> + int ( 100 ) <nl> + int ( 200 ) <nl> + int ( 300 ) <nl> + } <nl> + dict ( 3 ) { <nl> + [ 0 ] = > <nl> + int ( 100 ) <nl> + [ 1 ] = > <nl> + int ( 200 ) <nl> + [ 2 ] = > <nl> + int ( 300 ) <nl> + } <nl> + keyset ( 3 ) { <nl> + int ( 100 ) <nl> + int ( 200 ) <nl> + int ( 300 ) <nl> + } <nl> + bool ( true ) <nl> + bool ( true ) <nl> + bool ( true ) <nl> + = = = = = = = = = = = = test_assert = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + vec ( 3 ) { <nl> + int ( 1 ) <nl> + int ( 2 ) <nl> + int ( 3 ) <nl> + } <nl> + dict ( 2 ) { <nl> + [ 100 ] = > <nl> + string ( 3 ) " abc " <nl> + [ 200 ] = > <nl> + string ( 3 ) " def " <nl> + } <nl> + keyset ( 3 ) { <nl> + int ( 1 ) <nl> + string ( 3 ) " abc " <nl> + int ( 3 ) <nl> + } <nl> + vec ( 3 ) { <nl> + int ( 100 ) <nl> + int ( 200 ) <nl> + int ( 300 ) <nl> + } <nl> + dict ( 3 ) { <nl> + [ 0 ] = > <nl> + int ( 100 ) <nl> + [ 1 ] = > <nl> + int ( 200 ) <nl> + [ 2 ] = > <nl> + int ( 300 ) <nl> + } <nl> + keyset ( 3 ) { <nl> + int ( 100 ) <nl> + int ( 200 ) <nl> + int ( 300 ) <nl> + } <nl> + bool ( true ) <nl> + bool ( true ) <nl> + bool ( true ) <nl> + = = = = = = = = = = = = test_create_function = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + keyset ( 3 ) { <nl> + int ( 1 ) <nl> + string ( 3 ) " abc " <nl> + int ( 3 ) <nl> + } <nl> + dict ( 2 ) { <nl> + [ 100 ] = > <nl> + string ( 3 ) " abc " <nl> + [ 200 ] = > <nl> + string ( 3 ) " def " <nl> + } <nl> + keyset ( 3 ) { <nl> + int ( 1 ) <nl> + string ( 3 ) " abc " <nl> + int ( 3 ) <nl> + } <nl> + vec ( 3 ) { <nl> + int ( 100 ) <nl> + int ( 200 ) <nl> + int ( 300 ) <nl> + } <nl> + dict ( 3 ) { <nl> + [ 0 ] = > <nl> + int ( 100 ) <nl> + [ 1 ] = > <nl> + int ( 200 ) <nl> + [ 2 ] = > <nl> + int ( 300 ) <nl> + } <nl> + keyset ( 3 ) { <nl> + int ( 100 ) <nl> + int ( 200 ) <nl> + int ( 300 ) <nl> + } <nl> + bool ( true ) <nl> + bool ( true ) <nl> + bool ( true ) <nl> + = = = = = = = = = = = = test_default_value = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + vec ( 2 ) { <nl> + int ( 1 ) <nl> + int ( 2 ) <nl> + } <nl> + dict ( 2 ) { <nl> + [ 100 ] = > <nl> + string ( 1 ) " a " <nl> + [ 200 ] = > <nl> + string ( 1 ) " b " <nl> + } <nl> + keyset ( 2 ) { <nl> + string ( 1 ) " a " <nl> + string ( 1 ) " b " <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> | Fix HipHopSyntax handling for eval and related functionality | facebook/hhvm | 3d667ef5a1a13575790a84ea103bfd034392d4eb | 2017-03-16T22:12:13Z |
mmm a / python / mxnet / libinfo . py <nl> ppp b / python / mxnet / libinfo . py <nl> def find_lib_path ( ) : <nl> if os . name = = ' nt ' : <nl> os . environ [ ' PATH ' ] = os . path . dirname ( __file__ ) + ' ; ' + os . environ [ ' PATH ' ] <nl> dll_path = [ os . path . join ( p , ' libmxnet . dll ' ) for p in dll_path ] <nl> + elif platform . system ( ) = = ' Darwin ' : <nl> + dll_path = [ os . path . join ( p , ' libmxnet . dylib ' ) for p in dll_path ] + \ <nl> + [ os . path . join ( p , ' libmxnet . so ' ) for p in dll_path ] <nl> else : <nl> dll_path . append ( ' . . / . . / . . / ' ) <nl> dll_path = [ os . path . join ( p , ' libmxnet . so ' ) for p in dll_path ] <nl> | compile with macOS support ( ) | apache/incubator-mxnet | fa37125fcd1f754bc2f021880cd74d3621445e12 | 2017-04-03T18:35:37Z |
mmm a / doc / classes / InterpolatedCamera . xml <nl> ppp b / doc / classes / InterpolatedCamera . xml <nl> <nl> < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> < class name = " InterpolatedCamera " inherits = " Camera " category = " Core " version = " 3 . 1 " > <nl> < brief_description > <nl> + Camera which moves toward another node <nl> < / brief_description > <nl> < description > <nl> + InterpolatedCamera is a [ Camera ] which smoothly moves to match a target node ' s position and rotation . <nl> + If it is not [ member enabled ] , or does not have a valid target set , InterpolatedCamera acts like a normal Camera . <nl> < / description > <nl> < tutorials > <nl> < / tutorials > <nl> <nl> < argument index = " 0 " name = " target " type = " Object " > <nl> < / argument > <nl> < description > <nl> + Set the node to move toward . <nl> < / description > <nl> < / method > <nl> < / methods > <nl> < members > <nl> < member name = " enabled " type = " bool " setter = " set_interpolation_enabled " getter = " is_interpolation_enabled " > <nl> + If [ code ] true [ / code ] , and a target is set , the camera will move automatically . <nl> < / member > <nl> < member name = " speed " type = " float " setter = " set_speed " getter = " get_speed " > <nl> + How quickly the camera moves . <nl> < / member > <nl> < member name = " target " type = " NodePath " setter = " set_target_path " getter = " get_target_path " > <nl> + The target ' s [ NodePath ] . <nl> < / member > <nl> < / members > <nl> < constants > <nl> | Merge pull request from romlok / interpolated - docs | godotengine/godot | 7c441ad8baf2acf2356c84e0da997eec8721265f | 2018-03-30T19:26:47Z |
Binary files a / addons / skin . confluence / media / RecentAddedBack . png and b / addons / skin . confluence / media / RecentAddedBack . png differ <nl> | Changed : Made the RecentAddedBack . png more transparent | xbmc/xbmc | 382ad2d8b2168d76976f5dbd540a83ca30aadaed | 2012-04-24T23:50:25Z |
mmm a / test / benchmarks / testcfg . py <nl> ppp b / test / benchmarks / testcfg . py <nl> class VariantGenerator ( testsuite . VariantGenerator ) : <nl> # always opt to match the way the benchmarks are run for performance <nl> # testing . <nl> def FilterVariantsByTest ( self , test ) : <nl> - outcomes = self . suite . GetStatusFileOutcomes ( test . name , test . variant ) <nl> - if statusfile . OnlyStandardVariant ( outcomes ) : <nl> + if test . only_standard_variant : <nl> return self . standard_variant <nl> return self . fast_variants <nl> <nl> mmm a / test / test262 / testcfg . py <nl> ppp b / test / test262 / testcfg . py <nl> <nl> <nl> class VariantGenerator ( testsuite . VariantGenerator ) : <nl> def GetFlagSets ( self , test , variant ) : <nl> - outcomes = test . suite . GetStatusFileOutcomes ( test . name , test . variant ) <nl> - if outcomes and statusfile . OnlyFastVariants ( outcomes ) : <nl> + if test . only_fast_variants : <nl> variant_flags = FAST_VARIANTS <nl> else : <nl> variant_flags = ALL_VARIANTS <nl> mmm a / tools / testrunner / local / execution . py <nl> ppp b / tools / testrunner / local / execution . py <nl> def __init__ ( self , suites , progress_indicator , context ) : <nl> self . suite_names = [ s . name for s in suites ] <nl> <nl> # Always pre - sort by status file , slowest tests first . <nl> - slow_key = lambda t : statusfile . IsSlow ( <nl> - t . suite . GetStatusFileOutcomes ( t . name , t . variant ) ) <nl> - self . tests . sort ( key = slow_key , reverse = True ) <nl> + self . tests . sort ( key = lambda t : t . is_slow , reverse = True ) <nl> <nl> # Sort by stored duration if not opted out . <nl> if not context . no_sorting : <nl> mmm a / tools / testrunner / local / progress . py <nl> ppp b / tools / testrunner / local / progress . py <nl> def Done ( self ) : <nl> " flags " : test . cmd . args , <nl> " command " : test . cmd . to_string ( relative = True ) , <nl> " duration " : duration , <nl> - " marked_slow " : statusfile . IsSlow ( <nl> - test . suite . GetStatusFileOutcomes ( test . name , test . variant ) ) , <nl> + " marked_slow " : test . is_slow , <nl> } for ( test , duration ) in self . tests [ : 20 ] <nl> ] <nl> <nl> mmm a / tools / testrunner / local / statusfile . py <nl> ppp b / tools / testrunner / local / statusfile . py <nl> <nl> VARIABLES [ var ] = var <nl> <nl> <nl> - def DoSkip ( outcomes ) : <nl> - return SKIP in outcomes <nl> - <nl> - <nl> - def IsSlow ( outcomes ) : <nl> - return SLOW in outcomes <nl> - <nl> - <nl> - def OnlyStandardVariant ( outcomes ) : <nl> - return NO_VARIANTS in outcomes <nl> - <nl> - <nl> - def OnlyFastVariants ( outcomes ) : <nl> - return FAST_VARIANTS in outcomes <nl> - <nl> - <nl> - def IsPassOrFail ( outcomes ) : <nl> - return ( PASS in outcomes and <nl> - FAIL in outcomes and <nl> - CRASH not in outcomes ) <nl> - <nl> - <nl> - def IsFailOk ( outcomes ) : <nl> - return FAIL_OK in outcomes <nl> - <nl> - <nl> def _JoinsPassAndFail ( outcomes1 , outcomes2 ) : <nl> " " " Indicates if we join PASS and FAIL from two different outcome sets and <nl> the first doesn ' t already contain both . <nl> mmm a / tools / testrunner / local / testsuite . py <nl> ppp b / tools / testrunner / local / testsuite . py <nl> def __init__ ( self , suite , variants ) : <nl> self . standard_variant = STANDARD_VARIANT & variants <nl> <nl> def FilterVariantsByTest ( self , test ) : <nl> - result = self . all_variants <nl> - outcomes = test . suite . GetStatusFileOutcomes ( test . name , test . variant ) <nl> - if outcomes : <nl> - if statusfile . OnlyStandardVariant ( outcomes ) : <nl> - return self . standard_variant <nl> - if statusfile . OnlyFastVariants ( outcomes ) : <nl> - result = self . fast_variants <nl> - return result <nl> + if test . only_standard_variant : <nl> + return self . standard_variant <nl> + if test . only_fast_variants : <nl> + return self . fast_variants <nl> + return self . all_variants <nl> <nl> def GetFlagSets ( self , test , variant ) : <nl> - outcomes = test . suite . GetStatusFileOutcomes ( test . name , test . variant ) <nl> - if outcomes and statusfile . OnlyFastVariants ( outcomes ) : <nl> + if test . only_fast_variants : <nl> return FAST_VARIANT_FLAGS [ variant ] <nl> else : <nl> return ALL_VARIANT_FLAGS [ variant ] <nl> def __init__ ( self , name , root ) : <nl> self . rules = None # { variant : { test name : [ rule ] } } <nl> self . prefix_rules = None # { variant : { test name prefix : [ rule ] } } <nl> <nl> - self . _outcomes_cache = dict ( ) <nl> - <nl> def status_file ( self ) : <nl> return " % s / % s . status " % ( self . root , self . name ) <nl> <nl> def _skip_pass_fail ( pass_fail , mode ) : <nl> ( mode = = ' skip ' and pass_fail ) ) <nl> <nl> def _compliant ( test ) : <nl> - outcomes = self . GetStatusFileOutcomes ( test . name , test . variant ) <nl> - if statusfile . DoSkip ( outcomes ) : <nl> + if test . do_skip : <nl> return False <nl> - if _skip_slow ( statusfile . IsSlow ( outcomes ) , slow_tests_mode ) : <nl> + if _skip_slow ( test . is_slow , slow_tests_mode ) : <nl> return False <nl> - if _skip_pass_fail ( statusfile . IsPassOrFail ( outcomes ) , <nl> - pass_fail_tests_mode ) : <nl> + if _skip_pass_fail ( test . is_pass_or_fail , pass_fail_tests_mode ) : <nl> return False <nl> return True <nl> <nl> def WarnUnusedRules ( self , check_variant_rules = False ) : <nl> <nl> if test . name in self . rules . get ( variant , { } ) : <nl> used_rules . add ( ( test . name , variant ) ) <nl> - if statusfile . DoSkip ( self . rules [ variant ] [ test . name ] ) : <nl> + if statusfile . SKIP in self . rules [ variant ] [ test . name ] : <nl> continue <nl> <nl> for prefix in self . prefix_rules . get ( variant , { } ) : <nl> if test . name . startswith ( prefix ) : <nl> used_rules . add ( ( prefix , variant ) ) <nl> - if statusfile . DoSkip ( self . prefix_rules [ variant ] [ prefix ] ) : <nl> + if statusfile . SKIP in self . prefix_rules [ variant ] [ prefix ] : <nl> break <nl> <nl> for variant in variants : <nl> def GetStatusFileOutcomes ( self , testname , variant = None ) : <nl> " " " <nl> <nl> variant = variant or ' ' <nl> - cache_key = ' % s $ % s ' % ( testname , variant ) <nl> - <nl> - if cache_key not in self . _outcomes_cache : <nl> - # Load statusfile to get outcomes for the first time . <nl> - assert ( self . rules is not None ) <nl> - assert ( self . prefix_rules is not None ) <nl> <nl> - outcomes = frozenset ( ) <nl> + # Load statusfile to get outcomes for the first time . <nl> + assert ( self . rules is not None ) <nl> + assert ( self . prefix_rules is not None ) <nl> <nl> - for key in set ( [ variant , ' ' ] ) : <nl> - rules = self . rules . get ( key , { } ) <nl> - prefix_rules = self . prefix_rules . get ( key , { } ) <nl> + outcomes = frozenset ( ) <nl> <nl> - if testname in rules : <nl> - outcomes | = rules [ testname ] <nl> + for key in set ( [ variant , ' ' ] ) : <nl> + rules = self . rules . get ( key , { } ) <nl> + prefix_rules = self . prefix_rules . get ( key , { } ) <nl> <nl> - for prefix in prefix_rules : <nl> - if testname . startswith ( prefix ) : <nl> - outcomes | = prefix_rules [ prefix ] <nl> + if testname in rules : <nl> + outcomes | = rules [ testname ] <nl> <nl> - self . _outcomes_cache [ cache_key ] = outcomes <nl> + for prefix in prefix_rules : <nl> + if testname . startswith ( prefix ) : <nl> + outcomes | = prefix_rules [ prefix ] <nl> <nl> - return self . _outcomes_cache [ cache_key ] <nl> + return outcomes <nl> <nl> def IsFailureOutput ( self , testcase , output ) : <nl> return output . exit_code ! = 0 <nl> mmm a / tools / testrunner / local / verbose . py <nl> ppp b / tools / testrunner / local / verbose . py <nl> def PrintReport ( tests ) : <nl> total = len ( tests ) <nl> skipped = nocrash = passes = fail_ok = fail = 0 <nl> for t in tests : <nl> - outcomes = t . suite . GetStatusFileOutcomes ( t . name , t . variant ) <nl> + outcomes = t . statusfile_outcomes <nl> if not outcomes : <nl> passes + = 1 <nl> continue <nl> - if statusfile . DoSkip ( outcomes ) : <nl> + if t . do_skip : <nl> skipped + = 1 <nl> continue <nl> - if statusfile . IsPassOrFail ( outcomes ) : <nl> + if t . is_pass_or_fail : <nl> nocrash + = 1 <nl> if list ( outcomes ) = = [ statusfile . PASS ] : <nl> passes + = 1 <nl> - if statusfile . IsFailOk ( outcomes ) : <nl> + if t . is_fail_ok : <nl> fail_ok + = 1 <nl> if statusfile . FAIL in outcomes and statusfile . PASS not in outcomes : <nl> fail + = 1 <nl> mmm a / tools / testrunner / objects / testcase . py <nl> ppp b / tools / testrunner / objects / testcase . py <nl> def __init__ ( self , suite , path , name ) : <nl> self . variant = None # name of the used testing variant <nl> self . variant_flags = [ ] # list of strings , flags specific to this test <nl> <nl> - self . expected_outcomes = None <nl> - <nl> self . id = None # int , used to map result back to TestCase instance <nl> self . run = 1 # The nth time this test is executed . <nl> self . cmd = None <nl> <nl> - self . _prepare_expected_outcomes ( ) <nl> + self . statusfile_outcomes = None <nl> + self . expected_outcomes = None <nl> + self . _statusfile_flags = None <nl> + self . _prepare_outcomes ( ) <nl> <nl> def create_variant ( self , variant , flags ) : <nl> " " " Makes a shallow copy of the object and updates variant , variant_flags and <nl> def create_variant ( self , variant , flags ) : <nl> other . variant_flags = self . variant_flags + flags <nl> other . variant = variant <nl> <nl> - other . _prepare_expected_outcomes ( ) <nl> + other . _prepare_outcomes ( variant ! = self . variant ) <nl> <nl> return other <nl> <nl> - def _prepare_expected_outcomes ( self ) : <nl> - status_file_outcomes = self . suite . GetStatusFileOutcomes ( self . name , <nl> - self . variant ) <nl> + def _prepare_outcomes ( self , force_update = True ) : <nl> + if force_update or self . statusfile_outcomes is None : <nl> + def is_flag ( outcome ) : <nl> + return outcome . startswith ( ' - - ' ) <nl> + def not_flag ( outcome ) : <nl> + return not is_flag ( outcome ) <nl> + <nl> + outcomes = self . suite . GetStatusFileOutcomes ( self . name , self . variant ) <nl> + self . statusfile_outcomes = filter ( not_flag , outcomes ) <nl> + self . _statusfile_flags = filter ( is_flag , outcomes ) <nl> self . expected_outcomes = ( <nl> - self . _parse_status_file_outcomes ( status_file_outcomes ) ) <nl> + self . _parse_status_file_outcomes ( self . statusfile_outcomes ) ) <nl> <nl> def _parse_status_file_outcomes ( self , outcomes ) : <nl> if ( statusfile . FAIL_SLOPPY in outcomes and <nl> def _parse_status_file_outcomes ( self , outcomes ) : <nl> expected_outcomes . append ( statusfile . PASS ) <nl> return expected_outcomes or [ statusfile . PASS ] <nl> <nl> + @ property <nl> + def do_skip ( self ) : <nl> + return statusfile . SKIP in self . statusfile_outcomes <nl> + <nl> + @ property <nl> + def is_slow ( self ) : <nl> + return statusfile . SLOW in self . statusfile_outcomes <nl> + <nl> + @ property <nl> + def is_fail_ok ( self ) : <nl> + return statusfile . FAIL_OK in self . statusfile_outcomes <nl> + <nl> + @ property <nl> + def is_pass_or_fail ( self ) : <nl> + return ( statusfile . PASS in self . statusfile_outcomes and <nl> + statusfile . FAIL in self . statusfile_outcomes and <nl> + statusfile . CRASH not in self . statusfile_outcomes ) <nl> + <nl> + @ property <nl> + def only_standard_variant ( self ) : <nl> + return statusfile . NO_VARIANTS in self . statusfile_outcomes <nl> + <nl> + @ property <nl> + def only_fast_variants ( self ) : <nl> + return statusfile . FAST_VARIANTS in self . statusfile_outcomes <nl> + <nl> def get_command ( self , context ) : <nl> params = self . _get_cmd_params ( context ) <nl> env = self . _get_cmd_env ( ) <nl> def _get_variant_flags ( self ) : <nl> def _get_statusfile_flags ( self ) : <nl> " " " Gets runtime flags from a status file . <nl> <nl> - Every outcome that starts with " - - " is a flag . Status file has to be loaded <nl> - before using this function . <nl> + Every outcome that starts with " - - " is a flag . <nl> " " " <nl> - <nl> - flags = [ ] <nl> - for outcome in self . suite . GetStatusFileOutcomes ( self . name , self . variant ) : <nl> - if outcome . startswith ( ' - - ' ) : <nl> - flags . append ( outcome ) <nl> - return flags <nl> + return self . _statusfile_flags <nl> <nl> def _get_mode_flags ( self , ctx ) : <nl> return ctx . mode_flags <nl> | [ test ] Store outcomes in the testcase | v8/v8 | 1f604666595038ea3d67a3adda3b64e7d38fc84c | 2017-12-19T14:10:06Z |
mmm a / src / dbg / command . cpp <nl> ppp b / src / dbg / command . cpp <nl> void cmdfree ( ) <nl> COMMAND * cur = cmd_list ; <nl> while ( cur ) <nl> { <nl> - efree ( cur - > names , " cmdfree : cur - > name " ) ; <nl> + delete cur - > names ; <nl> COMMAND * next = cur - > next ; <nl> efree ( cur , " cmdfree : cur " ) ; <nl> cur = next ; <nl> | DBG : fixed incorrect efree in command | x64dbg/x64dbg | 3165b78af0d7dceabc2eec54ea224a9118069b37 | 2016-09-07T04:46:58Z |
mmm a / tensorflow / contrib / copy_graph / python / util / __init__ . py <nl> ppp b / tensorflow / contrib / copy_graph / python / util / __init__ . py <nl> <nl> - # Copyright 2015 The TensorFlow Authors . All Rights Reserved . <nl> + # Copyright 2018 The TensorFlow Authors . All Rights Reserved . <nl> # <nl> # Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> # you may not use this file except in compliance with the License . <nl> | Update year to 2018 | tensorflow/tensorflow | 6b3e231617ddcd86e79ca7286c99c1fb5407aba3 | 2018-11-05T10:06:51Z |
mmm a / modules / core / include / opencv2 / core / cvdef . h <nl> ppp b / modules / core / include / opencv2 / core / cvdef . h <nl> namespace cv { namespace debug_build_guard { } using namespace debug_build_guard <nl> # define __CV_VA_NUM_ARGS_HELPER ( _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9 , _10 , N , . . . ) N <nl> # define __CV_VA_NUM_ARGS ( . . . ) __CV_VA_NUM_ARGS_HELPER ( __VA_ARGS__ , 10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 , 0 ) <nl> <nl> - # if defined __GNUC__ <nl> + # ifdef CV_Func <nl> + / / keep current value ( through OpenCV port file ) <nl> + # elif defined __GNUC__ | | ( defined ( __cpluscplus ) & & ( __cpluscplus > = 201103 ) ) <nl> + # define CV_Func __func__ <nl> + # elif defined __clang__ & & ( __clang_minor__ * 100 + __clang_major > = 305 ) <nl> + # define CV_Func __func__ <nl> + # elif defined ( __STDC_VERSION__ ) & & ( __STDC_VERSION > = 199901 ) <nl> # define CV_Func __func__ <nl> # elif defined _MSC_VER <nl> # define CV_Func __FUNCTION__ <nl> + # elif defined ( __INTEL_COMPILER ) & & ( _INTEL_COMPILER > = 600 ) <nl> + # define CV_Func __FUNCTION__ <nl> + # elif defined __IBMCPP__ & & __IBMCPP__ > = 500 <nl> + # define CV_Func __FUNCTION__ <nl> + # elif defined __BORLAND__ & & ( __BORLANDC__ > = 0x550 ) <nl> + # define CV_Func __FUNC__ <nl> # else <nl> - # define CV_Func " " <nl> + # define CV_Func " < unknown > " <nl> # endif <nl> <nl> / / ! @ cond IGNORED <nl> | Merge pull request from dev - tronifier : new_branch | opencv/opencv | 6dba1733f09ec078262508ce16c59983ee28446b | 2020-06-27T20:08:37Z |
mmm a / fdbclient / FileBackupAgent . actor . cpp <nl> ppp b / fdbclient / FileBackupAgent . actor . cpp <nl> namespace fileBackup { <nl> wait ( checkTaskVersion ( tr - > getDatabase ( ) , task , name , version ) ) ; <nl> Version _restoreVersion = wait ( restore . restoreVersion ( ) . getOrThrow ( tr ) ) ; <nl> restoreVersion = _restoreVersion ; <nl> - Version _beginVersion = wait ( restore . beginVersion ( ) . getOrThrow ( tr ) ) ; <nl> - beginVersion = _beginVersion ; <nl> + Optional < Version > _beginVersion = wait ( restore . beginVersion ( ) . get ( tr ) ) ; <nl> + beginVersion = _beginVersion . present ( ) ? _beginVersion . get ( ) : invalidVersion ; <nl> wait ( taskBucket - > keepRunning ( tr , task ) ) ; <nl> <nl> ERestoreState oldState = wait ( restore . stateEnum ( ) . getD ( tr ) ) ; <nl> namespace fileBackup { <nl> wait ( tr - > onError ( e ) ) ; <nl> } <nl> } <nl> - state bool incremental = wait ( restore . incrementalBackupOnly ( ) . getOrThrow ( tr ) ) ; <nl> + Optional < bool > _incremental = wait ( restore . incrementalBackupOnly ( ) . get ( tr ) ) ; <nl> + state bool incremental = _incremental . present ( ) ? _incremental . get ( ) : false ; <nl> if ( beginVersion = = invalidVersion ) { <nl> beginVersion = 0 ; <nl> } <nl> namespace fileBackup { <nl> wait ( taskBucket - > finish ( tr , task ) ) ; <nl> state Future < Optional < bool > > logsOnly = restore . incrementalBackupOnly ( ) . get ( tr ) ; <nl> wait ( success ( logsOnly ) ) ; <nl> - if ( logsOnly . isReady ( ) & & logsOnly . get ( ) . present ( ) & & logsOnly . get ( ) . get ( ) ) { <nl> + if ( logsOnly . get ( ) . present ( ) & & logsOnly . get ( ) . get ( ) ) { <nl> / / If this is an incremental restore , we need to set the applyMutationsMapPrefix <nl> / / to the earliest log version so no mutations are missed <nl> Value versionEncoded = BinaryWriter : : toValue ( Params . firstVersion ( ) . get ( task ) , Unversioned ( ) ) ; <nl> mmm a / fdbserver / workloads / IncrementalBackup . actor . cpp <nl> ppp b / fdbserver / workloads / IncrementalBackup . actor . cpp <nl> struct IncrementalBackupWorkload : TestWorkload { <nl> virtual Future < bool > check ( Database const & cx ) { return true ; } <nl> <nl> ACTOR static Future < Void > _start ( Database cx , IncrementalBackupWorkload * self ) { <nl> - / / Add a commit both before the submit and restore to test that incremental backup <nl> - / / can be performed on non - empty database <nl> + / / Add a commit both before the submit and restore to test that incremental backup <nl> + / / can be performed on non - empty database <nl> if ( self - > submitOnly ) { <nl> Standalone < VectorRef < KeyRangeRef > > backupRanges ; <nl> backupRanges . push_back_deep ( backupRanges . arena ( ) , normalKeys ) ; <nl> - TraceEvent ( " IBackupSubmitAttempt " ) ; <nl> - try { <nl> - wait ( self - > backupAgent . submitBackup ( cx , self - > backupDir , 1e8 , self - > tag . toString ( ) , backupRanges , false , <nl> - false , true ) ) ; <nl> - } catch ( Error & e ) { <nl> - if ( e . code ( ) ! = error_code_backup_duplicate ) { <nl> - throw ; <nl> - } <nl> - } <nl> - TraceEvent ( " IBackupSubmitSuccess " ) ; <nl> + TraceEvent ( " IBackupSubmitAttempt " ) ; <nl> + try { <nl> + wait ( self - > backupAgent . submitBackup ( cx , self - > backupDir , 1e8 , self - > tag . toString ( ) , backupRanges , false , <nl> + false , true ) ) ; <nl> + } catch ( Error & e ) { <nl> + if ( e . code ( ) ! = error_code_backup_duplicate ) { <nl> + throw ; <nl> + } <nl> + } <nl> + TraceEvent ( " IBackupSubmitSuccess " ) ; <nl> } <nl> if ( self - > restoreOnly ) { <nl> state Reference < IBackupContainer > backupContainer ; <nl> state UID backupUID ; <nl> - TraceEvent ( " IBackupRestoreAttempt " ) ; <nl> + TraceEvent ( " IBackupRestoreAttempt " ) ; <nl> wait ( success ( self - > backupAgent . waitBackup ( cx , self - > tag . toString ( ) , false , & backupContainer , & backupUID ) ) ) ; <nl> / / TODO : add testing scenario for atomics and beginVersion <nl> wait ( success ( self - > backupAgent . restore ( cx , cx , Key ( self - > tag . toString ( ) ) , Key ( backupContainer - > getURL ( ) ) , <nl> true , - 1 , true , normalKeys , Key ( ) , Key ( ) , true , true ) ) ) ; <nl> - TraceEvent ( " IBackupRestoreSuccess " ) ; <nl> + TraceEvent ( " IBackupRestoreSuccess " ) ; <nl> } <nl> return Void ( ) ; <nl> } <nl> | changed occurrences of getOrThrow to get | apple/foundationdb | 8ac3b21459b72f7ff406f6756e8f0c5f33c3d710 | 2020-09-02T17:45:15Z |
mmm a / src / mongo / tools / dump . cpp <nl> ppp b / src / mongo / tools / dump . cpp <nl> class Dump : public Tool { <nl> } <nl> <nl> void writeCollectionFile ( const string coll , boost : : filesystem : : path outputFile ) { <nl> - log ( ) < < " \ t " < < coll < < " to " < < outputFile . string ( ) < < endl ; <nl> + toolInfoLog ( ) < < " \ t " < < coll < < " to " < < outputFile . string ( ) < < std : : endl ; <nl> <nl> FilePtr f ( fopen ( outputFile . string ( ) . c_str ( ) , " wb " ) ) ; <nl> uassert ( 10262 , errnoWithPrefix ( " couldn ' t open file " ) , f ) ; <nl> class Dump : public Tool { <nl> <nl> doCollection ( coll , f , & m ) ; <nl> <nl> - log ( ) < < " \ t \ t " < < m . done ( ) < < " objects " < < endl ; <nl> + toolInfoLog ( ) < < " \ t \ t " < < m . done ( ) < < " objects " < < std : : endl ; <nl> } <nl> <nl> void writeMetadataFile ( const string coll , boost : : filesystem : : path outputFile , <nl> map < string , BSONObj > options , multimap < string , BSONObj > indexes ) { <nl> - log ( ) < < " \ tMetadata for " < < coll < < " to " < < outputFile . string ( ) < < endl ; <nl> + toolInfoLog ( ) < < " \ tMetadata for " < < coll < < " to " < < outputFile . string ( ) < < std : : endl ; <nl> <nl> bool hasOptions = options . count ( coll ) > 0 ; <nl> bool hasIndexes = indexes . count ( coll ) > 0 ; <nl> class Dump : public Tool { <nl> } <nl> <nl> void go ( const string db , const boost : : filesystem : : path outdir ) { <nl> - log ( ) < < " DATABASE : " < < db < < " \ t to \ t " < < outdir . string ( ) < < endl ; <nl> + toolInfoLog ( ) < < " DATABASE : " < < db < < " \ t to \ t " < < outdir . string ( ) < < std : : endl ; <nl> <nl> boost : : filesystem : : create_directories ( outdir ) ; <nl> <nl> class Dump : public Tool { <nl> <nl> / / skip namespaces with $ in them only if we don ' t specify a collection to dump <nl> if ( toolGlobalParams . coll = = " " & & name . find ( " . $ " ) ! = string : : npos ) { <nl> - LOG ( 1 ) < < " \ tskipping collection : " < < name < < endl ; <nl> + if ( logger : : globalLogDomain ( ) - > shouldLog ( logger : : LogSeverity : : Debug ( 1 ) ) ) { <nl> + toolInfoLog ( ) < < " \ tskipping collection : " < < name < < std : : endl ; <nl> + } <nl> continue ; <nl> } <nl> <nl> class Dump : public Tool { <nl> / / raise error before writing collection with non - permitted filename chars in the name <nl> size_t hasBadChars = name . find_first_of ( " / \ 0 " ) ; <nl> if ( hasBadChars ! = string : : npos ) { <nl> - error ( ) < < " Cannot dump " < < name < < " . Collection has ' / ' or null in the collection name . " < < endl ; <nl> - continue ; <nl> + toolError ( ) < < " Cannot dump " < < name <nl> + < < " . Collection has ' / ' or null in the collection name . " < < std : : endl ; <nl> + continue ; <nl> } <nl> <nl> if ( nsToCollectionSubstring ( name ) = = " system . indexes " ) { <nl> class Dump : public Tool { <nl> } <nl> <nl> int repair ( ) { <nl> - log ( ) < < " going to try and recover data from : " < < toolGlobalParams . db < < endl ; <nl> + toolInfoLog ( ) < < " going to try and recover data from : " < < toolGlobalParams . db < < std : : endl ; <nl> return _repair ( toolGlobalParams . db ) ; <nl> } <nl> <nl> class Dump : public Tool { <nl> LogIndentLevel lil ; <nl> <nl> if ( eLoc . getOfs ( ) < = 0 ) { <nl> - error ( ) < < " invalid extent ofs : " < < eLoc . getOfs ( ) < < endl ; <nl> + toolError ( ) < < " invalid extent ofs : " < < eLoc . getOfs ( ) < < std : : endl ; <nl> return DiskLoc ( ) ; <nl> } <nl> <nl> Extent * e = db - > getExtentManager ( ) . getExtent ( eLoc , false ) ; <nl> if ( ! e - > isOk ( ) ) { <nl> - warning ( ) < < " Extent not ok magic : " < < e - > magic < < " going to try to continue " < < endl ; <nl> + toolError ( ) < < " Extent not ok magic : " < < e - > magic < < " going to try to continue " <nl> + < < std : : endl ; <nl> } <nl> <nl> - log ( ) < < " length : " < < e - > length < < endl ; <nl> + toolInfoLog ( ) < < " length : " < < e - > length < < std : : endl ; <nl> <nl> LogIndentLevel lil2 ; <nl> <nl> class Dump : public Tool { <nl> while ( ! loc . isNull ( ) ) { <nl> <nl> if ( ! seen . insert ( loc ) . second ) { <nl> - error ( ) < < " infinite loop in extent , seen : " < < loc < < " before " < < endl ; <nl> + toolError ( ) < < " infinite loop in extent , seen : " < < loc < < " before " < < std : : endl ; <nl> break ; <nl> } <nl> <nl> if ( loc . getOfs ( ) < = 0 ) { <nl> - error ( ) < < " offset is 0 for record which should be impossible " < < endl ; <nl> + toolError ( ) < < " offset is 0 for record which should be impossible " < < std : : endl ; <nl> break ; <nl> } <nl> - LOG ( 1 ) < < loc < < endl ; <nl> + if ( logger : : globalLogDomain ( ) - > shouldLog ( logger : : LogSeverity : : Debug ( 1 ) ) ) { <nl> + toolInfoLog ( ) < < loc < < std : : endl ; <nl> + } <nl> Record * rec = loc . rec ( ) ; <nl> BSONObj obj ; <nl> try { <nl> obj = loc . obj ( ) ; <nl> verify ( obj . valid ( ) ) ; <nl> - LOG ( 1 ) < < obj < < endl ; <nl> + if ( logger : : globalLogDomain ( ) - > shouldLog ( logger : : LogSeverity : : Debug ( 1 ) ) ) { <nl> + toolInfoLog ( ) < < obj < < std : : endl ; <nl> + } <nl> w ( obj ) ; <nl> } <nl> catch ( std : : exception & e ) { <nl> - log ( ) < < " found invalid document @ " < < loc < < " " < < e . what ( ) < < endl ; <nl> + toolError ( ) < < " found invalid document @ " < < loc < < " " < < e . what ( ) < < std : : endl ; <nl> if ( ! obj . isEmpty ( ) ) { <nl> try { <nl> BSONElement e = obj . firstElement ( ) ; <nl> stringstream ss ; <nl> ss < < " first element : " < < e ; <nl> - log ( ) < < ss . str ( ) ; <nl> + toolError ( ) < < ss . str ( ) < < std : : endl ; <nl> } <nl> catch ( std : : exception & ) { <nl> - log ( ) < < " unable to log invalid document @ " < < loc < < endl ; <nl> + toolError ( ) < < " unable to log invalid document @ " < < loc < < std : : endl ; <nl> } <nl> } <nl> } <nl> class Dump : public Tool { <nl> break ; <nl> } <nl> } <nl> - log ( ) < < " wrote " < < seen . size ( ) < < " documents " < < endl ; <nl> + toolInfoLog ( ) < < " wrote " < < seen . size ( ) < < " documents " < < std : : endl ; <nl> return forward ? e - > xnext : e - > xprev ; <nl> } <nl> <nl> void _repair ( Database * db , string ns , boost : : filesystem : : path outfile ) { <nl> const NamespaceDetails * nsd = nsdetails ( ns ) ; <nl> - log ( ) < < " nrecords : " < < nsd - > numRecords ( ) <nl> - < < " datasize : " < < nsd - > dataSize ( ) <nl> - < < " firstExtent : " < < nsd - > firstExtent ( ) <nl> - < < endl ; <nl> + toolInfoLog ( ) < < " nrecords : " < < nsd - > numRecords ( ) <nl> + < < " datasize : " < < nsd - > dataSize ( ) <nl> + < < " firstExtent : " < < nsd - > firstExtent ( ) <nl> + < < std : : endl ; <nl> <nl> if ( nsd - > firstExtent ( ) . isNull ( ) ) { <nl> - log ( ) < < " ERROR fisrtExtent is null " < < endl ; <nl> + toolError ( ) < < " ERROR fisrtExtent is null " < < std : : endl ; <nl> return ; <nl> } <nl> <nl> if ( ! nsd - > firstExtent ( ) . isValid ( ) ) { <nl> - log ( ) < < " ERROR fisrtExtent is not valid " < < endl ; <nl> + toolError ( ) < < " ERROR fisrtExtent is not valid " < < std : : endl ; <nl> return ; <nl> } <nl> <nl> outfile / = ( ns . substr ( ns . find ( " . " ) + 1 ) + " . bson " ) ; <nl> - log ( ) < < " writing to : " < < outfile . string ( ) < < endl ; <nl> + toolInfoLog ( ) < < " writing to : " < < outfile . string ( ) < < std : : endl ; <nl> <nl> FilePtr f ( fopen ( outfile . string ( ) . c_str ( ) , " wb " ) ) ; <nl> <nl> class Dump : public Tool { <nl> Writer w ( f , & m ) ; <nl> <nl> try { <nl> - log ( ) < < " forward extent pass " < < endl ; <nl> + toolInfoLog ( ) < < " forward extent pass " < < std : : endl ; <nl> LogIndentLevel lil ; <nl> DiskLoc eLoc = nsd - > firstExtent ( ) ; <nl> while ( ! eLoc . isNull ( ) ) { <nl> - log ( ) < < " extent loc : " < < eLoc < < endl ; <nl> + toolInfoLog ( ) < < " extent loc : " < < eLoc < < std : : endl ; <nl> eLoc = _repairExtent ( db , ns , true , eLoc , w ) ; <nl> } <nl> } <nl> catch ( DBException & e ) { <nl> - error ( ) < < " forward extent pass failed : " < < e . toString ( ) < < endl ; <nl> + toolError ( ) < < " forward extent pass failed : " < < e . toString ( ) < < std : : endl ; <nl> } <nl> <nl> try { <nl> - log ( ) < < " backwards extent pass " < < endl ; <nl> + toolInfoLog ( ) < < " backwards extent pass " < < std : : endl ; <nl> LogIndentLevel lil ; <nl> DiskLoc eLoc = nsd - > lastExtent ( ) ; <nl> while ( ! eLoc . isNull ( ) ) { <nl> - log ( ) < < " extent loc : " < < eLoc < < endl ; <nl> + toolInfoLog ( ) < < " extent loc : " < < eLoc < < std : : endl ; <nl> eLoc = _repairExtent ( db , ns , false , eLoc , w ) ; <nl> } <nl> } <nl> catch ( DBException & e ) { <nl> - error ( ) < < " ERROR : backwards extent pass failed : " < < e . toString ( ) < < endl ; <nl> + toolError ( ) < < " ERROR : backwards extent pass failed : " < < e . toString ( ) < < std : : endl ; <nl> } <nl> <nl> - log ( ) < < " \ t \ t " < < m . done ( ) < < " objects " < < endl ; <nl> + toolInfoLog ( ) < < " \ t \ t " < < m . done ( ) < < " objects " < < std : : endl ; <nl> } <nl> <nl> int _repair ( string dbname ) { <nl> class Dump : public Tool { <nl> continue ; <nl> } <nl> <nl> - log ( ) < < " trying to recover : " < < ns < < endl ; <nl> + toolInfoLog ( ) < < " trying to recover : " < < ns < < std : : endl ; <nl> <nl> LogIndentLevel lil2 ; <nl> try { <nl> _repair ( db , ns , root ) ; <nl> } <nl> catch ( DBException & e ) { <nl> - log ( ) < < " ERROR recovering : " < < ns < < " " < < e . toString ( ) < < endl ; <nl> + toolError ( ) < < " ERROR recovering : " < < ns < < " " < < e . toString ( ) < < std : : endl ; <nl> } <nl> } <nl> <nl> class Dump : public Tool { <nl> <nl> int run ( ) { <nl> if ( mongoDumpGlobalParams . repair ) { <nl> - warning ( ) < < " repair is a work in progress " < < endl ; <nl> + toolError ( ) < < " repair is a work in progress " < < std : : endl ; <nl> return repair ( ) ; <nl> } <nl> <nl> class Dump : public Tool { <nl> else { <nl> opLogName = " local . oplog . $ main " ; <nl> if ( ! isMaster [ " ismaster " ] . trueValue ( ) ) { <nl> - log ( ) < < " oplog mode is only supported on master or replica set member " < < endl ; <nl> + toolError ( ) < < " oplog mode is only supported on master or replica set member " <nl> + < < std : : endl ; <nl> return - 1 ; <nl> } <nl> } <nl> <nl> BSONObj op = conn ( true ) . findOne ( opLogName , Query ( ) . sort ( " $ natural " , - 1 ) , 0 , QueryOption_SlaveOk ) ; <nl> if ( op . isEmpty ( ) ) { <nl> - log ( ) < < " No operations in oplog . Please ensure you are connecting to a master . " < < endl ; <nl> + toolError ( ) < < " No operations in oplog . Please ensure you are connecting to a " <nl> + < < " master . " < < std : : endl ; <nl> return - 1 ; <nl> } <nl> <nl> class Dump : public Tool { <nl> return 0 ; <nl> } <nl> else { <nl> - log ( ) < < " You must specify database and collection to print to stdout " < < endl ; <nl> + toolError ( ) < < " You must specify database and collection to print to stdout " <nl> + < < std : : endl ; <nl> return - 1 ; <nl> } <nl> } <nl> class Dump : public Tool { <nl> <nl> if ( toolGlobalParams . db = = " " ) { <nl> if ( toolGlobalParams . coll ! = " " ) { <nl> - error ( ) < < " - - db must be specified with - - collection " < < endl ; <nl> + toolError ( ) < < " - - db must be specified with - - collection " < < std : : endl ; <nl> return - 1 ; <nl> } <nl> <nl> - log ( ) < < " all dbs " < < endl ; <nl> + toolInfoLog ( ) < < " all dbs " < < std : : endl ; <nl> <nl> BSONObj res = conn ( true ) . findOne ( " admin . $ cmd " , BSON ( " listDatabases " < < 1 ) ) ; <nl> if ( ! res [ " databases " ] . isABSONObj ( ) ) { <nl> - error ( ) < < " output of listDatabases isn ' t what we expected , no ' databases ' field : \ n " < < res < < endl ; <nl> + toolError ( ) < < " output of listDatabases isn ' t what we expected , no ' databases ' " <nl> + < < " field : \ n " < < res < < std : : endl ; <nl> return - 2 ; <nl> } <nl> BSONObj dbs = res [ " databases " ] . embeddedObjectUserCheck ( ) ; <nl> class Dump : public Tool { <nl> string key = * i ; <nl> <nl> if ( ! dbs [ key ] . isABSONObj ( ) ) { <nl> - error ( ) < < " database field not an object key : " < < key < < " value : " < < dbs [ key ] < < endl ; <nl> + toolError ( ) < < " database field not an object key : " < < key < < " value : " <nl> + < < dbs [ key ] < < std : : endl ; <nl> return - 3 ; <nl> } <nl> <nl> mmm a / src / mongo / tools / export . cpp <nl> ppp b / src / mongo / tools / export . cpp <nl> class Export : public Tool { <nl> if ( mongoExportGlobalParams . jsonArray ) <nl> out < < ' ] ' < < endl ; <nl> <nl> - if ( ! toolGlobalParams . quiet ) { <nl> - toolOutput ( ) < < " exported " < < num < < " records " < < endl ; <nl> - } <nl> + toolInfoOutput ( ) < < " exported " < < num < < " records " < < endl ; <nl> <nl> return 0 ; <nl> } <nl> mmm a / src / mongo / tools / files . cpp <nl> ppp b / src / mongo / tools / files . cpp <nl> class Files : public Tool { <nl> f . write ( mongoFilesGlobalParams . localFile ) ; <nl> <nl> if ( mongoFilesGlobalParams . localFile ! = " - " ) { <nl> - cout < < " done write to : " < < mongoFilesGlobalParams . localFile < < endl ; <nl> + toolInfoOutput ( ) < < " done write to : " < < mongoFilesGlobalParams . localFile <nl> + < < std : : endl ; <nl> } <nl> <nl> return 0 ; <nl> class Files : public Tool { <nl> BSONObj file = g . storeFile ( mongoFilesGlobalParams . localFile , <nl> mongoFilesGlobalParams . gridFSFilename , <nl> mongoFilesGlobalParams . contentType ) ; <nl> - cout < < " added file : " < < file < < endl ; <nl> + toolInfoOutput ( ) < < " added file : " < < file < < std : : endl ; <nl> <nl> if ( mongoFilesGlobalParams . replace ) { <nl> auto_ptr < DBClientCursor > cursor = <nl> class Files : public Tool { <nl> BSONObj o = cursor - > nextSafe ( ) ; <nl> conn ( ) . remove ( toolGlobalParams . db + " . fs . files " , BSON ( " _id " < < o [ " _id " ] ) ) ; <nl> conn ( ) . remove ( toolGlobalParams . db + " . fs . chunks " , BSON ( " _id " < < o [ " _id " ] ) ) ; <nl> - cout < < " removed file : " < < o < < endl ; <nl> + toolInfoOutput ( ) < < " removed file : " < < o < < std : : endl ; <nl> } <nl> <nl> } <nl> <nl> conn ( ) . getLastError ( ) ; <nl> - cout < < " done ! " < < endl ; <nl> + toolInfoOutput ( ) < < " done ! " < < std : : endl ; <nl> return 0 ; <nl> } <nl> <nl> if ( mongoFilesGlobalParams . command = = " delete " ) { <nl> g . removeFile ( mongoFilesGlobalParams . gridFSFilename ) ; <nl> conn ( ) . getLastError ( ) ; <nl> - cout < < " done ! " < < endl ; <nl> + toolInfoOutput ( ) < < " done ! " < < std : : endl ; <nl> return 0 ; <nl> } <nl> <nl> mmm a / src / mongo / tools / import . cpp <nl> ppp b / src / mongo / tools / import . cpp <nl> class Import : public Tool { <nl> <nl> uassert ( 16329 , str : : stream ( ) < < " read error , or input line too long ( max length : " <nl> < < BUF_SIZE < < " ) " , ! ( in - > rdstate ( ) & ios_base : : failbit ) ) ; <nl> - LOG ( 1 ) < < " got line : " < < buf < < endl ; <nl> + if ( logger : : globalLogDomain ( ) - > shouldLog ( logger : : LogSeverity : : Debug ( 1 ) ) ) { <nl> + toolInfoLog ( ) < < " got line : " < < buf < < std : : endl ; <nl> + } <nl> <nl> uassert ( 10263 , " unknown error reading file " , <nl> ( ! ( in - > rdstate ( ) & ios_base : : badbit ) ) & & <nl> class Import : public Tool { <nl> if ( str : : contains ( s , " uplicate " ) ) { <nl> / / we don ' t want to return an error from the mongoimport process for <nl> / / dup key errors <nl> - log ( ) < < s < < endl ; <nl> + toolInfoLog ( ) < < s < < endl ; <nl> } <nl> else { <nl> lastErrorFailures + + ; <nl> - log ( ) < < " error : " < < s < < endl ; <nl> + toolInfoLog ( ) < < " error : " < < s < < endl ; <nl> return false ; <nl> } <nl> } <nl> class Import : public Tool { <nl> if ( mongoImportGlobalParams . filename . size ( ) > 0 & & <nl> mongoImportGlobalParams . filename ! = " - " ) { <nl> if ( ! boost : : filesystem : : exists ( mongoImportGlobalParams . filename ) ) { <nl> - error ( ) < < " file doesn ' t exist : " < < mongoImportGlobalParams . filename < < endl ; <nl> + toolError ( ) < < " file doesn ' t exist : " < < mongoImportGlobalParams . filename <nl> + < < std : : endl ; <nl> return - 1 ; <nl> } <nl> in = & file ; <nl> class Import : public Tool { <nl> return - 1 ; <nl> } <nl> <nl> - LOG ( 1 ) < < " ns : " < < ns < < endl ; <nl> + if ( logger : : globalLogDomain ( ) - > shouldLog ( logger : : LogSeverity : : Debug ( 1 ) ) ) { <nl> + toolInfoLog ( ) < < " ns : " < < ns < < endl ; <nl> + } <nl> <nl> if ( mongoImportGlobalParams . drop ) { <nl> - log ( ) < < " dropping : " < < ns < < endl ; <nl> + toolInfoLog ( ) < < " dropping : " < < ns < < endl ; <nl> conn ( ) . dropCollection ( ns . c_str ( ) ) ; <nl> } <nl> <nl> class Import : public Tool { <nl> _sep = " \ t " ; <nl> } <nl> else { <nl> - error ( ) < < " don ' t know what type [ " < < mongoImportGlobalParams . type < < " ] is " < < endl ; <nl> + toolError ( ) < < " don ' t know what type [ " < < mongoImportGlobalParams . type < < " ] is " <nl> + < < std : : endl ; <nl> return - 1 ; <nl> } <nl> <nl> class Import : public Tool { <nl> <nl> <nl> time_t start = time ( 0 ) ; <nl> - LOG ( 1 ) < < " filesize : " < < fileSize < < endl ; <nl> + if ( logger : : globalLogDomain ( ) - > shouldLog ( logger : : LogSeverity : : Debug ( 1 ) ) ) { <nl> + toolInfoLog ( ) < < " filesize : " < < fileSize < < endl ; <nl> + } <nl> ProgressMeter pm ( fileSize ) ; <nl> int num = 0 ; <nl> int lastNumChecked = num ; <nl> class Import : public Tool { <nl> num + + ; <nl> } <nl> catch ( const std : : exception & e ) { <nl> - log ( ) < < " exception : " < < e . what ( ) <nl> - < < " , current buffer : " < < current_buffer < < endl ; <nl> + toolError ( ) < < " exception : " < < e . what ( ) <nl> + < < " , current buffer : " < < current_buffer < < std : : endl ; <nl> errors + + ; <nl> <nl> / / Since we only support JSON arrays all on one line , we might as well stop now <nl> class Import : public Tool { <nl> break ; <nl> } <nl> <nl> - if ( pm . hit ( len + 1 ) ) { <nl> - log ( ) < < " \ t \ t \ t " < < num < < " \ t " < < ( num / ( time ( 0 ) - start ) ) < < " / second " < < endl ; <nl> + if ( ! toolGlobalParams . quiet ) { <nl> + if ( pm . hit ( len + 1 ) ) { <nl> + log ( ) < < " \ t \ t \ t " < < num < < " \ t " < < ( num / ( time ( 0 ) - start ) ) < < " / second " <nl> + < < std : : endl ; <nl> + } <nl> } <nl> } <nl> } <nl> class Import : public Tool { <nl> num + + ; <nl> } <nl> catch ( const std : : exception & e ) { <nl> - log ( ) < < " exception : " < < e . what ( ) < < endl ; <nl> + toolError ( ) < < " exception : " < < e . what ( ) < < std : : endl ; <nl> errors + + ; <nl> <nl> if ( mongoImportGlobalParams . stopOnError ) <nl> break ; <nl> } <nl> <nl> - if ( pm . hit ( len + 1 ) ) { <nl> - log ( ) < < " \ t \ t \ t " < < num < < " \ t " < < ( num / ( time ( 0 ) - start ) ) < < " / second " < < endl ; <nl> + if ( ! toolGlobalParams . quiet ) { <nl> + if ( pm . hit ( len + 1 ) ) { <nl> + log ( ) < < " \ t \ t \ t " < < num < < " \ t " < < ( num / ( time ( 0 ) - start ) ) < < " / second " <nl> + < < std : : endl ; <nl> + } <nl> } <nl> } <nl> } <nl> class Import : public Tool { <nl> / / this is for two reasons : to wait for all operations to reach the server and be processed , and this will wait until all data reaches the server , <nl> / / and secondly to check if there were an error ( on the last op ) <nl> if ( lastNumChecked + 1 ! = num ) { / / avoid redundant log message if already reported above <nl> - log ( ) < < " check " < < lastNumChecked < < " " < < num < < endl ; <nl> + toolInfoLog ( ) < < " check " < < lastNumChecked < < " " < < num < < endl ; <nl> checkLastError ( ) ; <nl> } <nl> <nl> class Import : public Tool { <nl> <nl> / / the message is vague on lastErrorFailures as we don ' t call it on every single operation . <nl> / / so if we have a lastErrorFailure there might be more than just what has been counted . <nl> - log ( ) < < ( lastErrorFailures ? " tried to import " : " imported " ) < < ( num - headerRows ) < < " objects " < < endl ; <nl> + toolInfoLog ( ) < < ( lastErrorFailures ? " tried to import " : " imported " ) <nl> + < < ( num - headerRows ) < < " objects " < < std : : endl ; <nl> <nl> if ( ! hadErrors ) <nl> return 0 ; <nl> <nl> - error ( ) < < " encountered " < < ( lastErrorFailures ? " at least " : " " ) < < lastErrorFailures + errors < < " error ( s ) " < < ( lastErrorFailures + errors = = 1 ? " " : " s " ) < < endl ; <nl> + toolError ( ) < < " encountered " < < ( lastErrorFailures ? " at least " : " " ) <nl> + < < lastErrorFailures + errors < < " error ( s ) " <nl> + < < ( lastErrorFailures + errors = = 1 ? " " : " s " ) < < std : : endl ; <nl> return - 1 ; <nl> } <nl> } ; <nl> mmm a / src / mongo / tools / mongodump_options . cpp <nl> ppp b / src / mongo / tools / mongodump_options . cpp <nl> namespace mongo { <nl> mongoDumpGlobalParams . repair = hasParam ( " repair " ) ; <nl> if ( mongoDumpGlobalParams . repair ) { <nl> if ( ! hasParam ( " dbpath " ) ) { <nl> - log ( ) < < " repair mode only works with - - dbpath " < < std : : endl ; <nl> - : : _exit ( - 1 ) ; <nl> + std : : cerr < < " repair mode only works with - - dbpath " < < std : : endl ; <nl> + : : _exit ( EXIT_BADOPTIONS ) ; <nl> } <nl> <nl> if ( ! hasParam ( " db " ) ) { <nl> - log ( ) < < " repair mode only works on 1 db at a time right now " < < std : : endl ; <nl> - : : _exit ( - 1 ) ; <nl> + std : : cerr < < " repair mode only works on 1 db at a time right now " < < std : : endl ; <nl> + : : _exit ( EXIT_BADOPTIONS ) ; <nl> } <nl> } <nl> mongoDumpGlobalParams . query = getParam ( " query " ) ; <nl> mongoDumpGlobalParams . useOplog = hasParam ( " oplog " ) ; <nl> if ( mongoDumpGlobalParams . useOplog ) { <nl> if ( hasParam ( " query " ) | | hasParam ( " db " ) | | hasParam ( " collection " ) ) { <nl> - log ( ) < < " oplog mode is only supported on full dumps " < < std : : endl ; <nl> - : : _exit ( - 1 ) ; <nl> + std : : cerr < < " oplog mode is only supported on full dumps " < < std : : endl ; <nl> + : : _exit ( EXIT_BADOPTIONS ) ; <nl> } <nl> } <nl> mongoDumpGlobalParams . outputFile = getParam ( " out " ) ; <nl> mmm a / src / mongo / tools / mongooplog_options . cpp <nl> ppp b / src / mongo / tools / mongooplog_options . cpp <nl> namespace mongo { <nl> } <nl> <nl> if ( ! hasParam ( " from " ) ) { <nl> - log ( ) < < " need to specify - - from " < < std : : endl ; <nl> - : : _exit ( - 1 ) ; <nl> + std : : cerr < < " need to specify - - from " < < std : : endl ; <nl> + : : _exit ( EXIT_BADOPTIONS ) ; <nl> } <nl> else { <nl> mongoOplogGlobalParams . from = getParam ( " from " ) ; <nl> mmm a / src / mongo / tools / oplog . cpp <nl> ppp b / src / mongo / tools / oplog . cpp <nl> class OplogTool : public Tool { <nl> <nl> Client : : initThread ( " oplogreplay " ) ; <nl> <nl> - log ( ) < < " going to connect " < < endl ; <nl> + toolInfoLog ( ) < < " going to connect " < < std : : endl ; <nl> <nl> OplogReader r ; <nl> r . setTailingQueryOptions ( QueryOption_SlaveOk | QueryOption_AwaitData ) ; <nl> r . connect ( mongoOplogGlobalParams . from ) ; <nl> <nl> - log ( ) < < " connected " < < endl ; <nl> + toolInfoLog ( ) < < " connected " < < std : : endl ; <nl> <nl> OpTime start ( time ( 0 ) - mongoOplogGlobalParams . seconds , 0 ) ; <nl> - log ( ) < < " starting from " < < start . toStringPretty ( ) < < endl ; <nl> + toolInfoLog ( ) < < " starting from " < < start . toStringPretty ( ) < < std : : endl ; <nl> <nl> r . tailingQueryGTE ( mongoOplogGlobalParams . ns . c_str ( ) , start ) ; <nl> <nl> int num = 0 ; <nl> while ( r . more ( ) ) { <nl> BSONObj o = r . next ( ) ; <nl> - LOG ( 2 ) < < o < < endl ; <nl> + if ( logger : : globalLogDomain ( ) - > shouldLog ( logger : : LogSeverity : : Debug ( 2 ) ) ) { <nl> + toolInfoLog ( ) < < o < < std : : endl ; <nl> + } <nl> <nl> if ( o [ " $ err " ] . type ( ) ) { <nl> - log ( ) < < " error getting oplog " < < endl ; <nl> - log ( ) < < o < < endl ; <nl> + toolError ( ) < < " error getting oplog " < < std : : endl ; <nl> + toolError ( ) < < o < < std : : endl ; <nl> return - 1 ; <nl> } <nl> <nl> <nl> bool print = + + num % 100000 = = 0 ; <nl> - if ( print ) <nl> - cout < < num < < " \ t " < < o < < endl ; <nl> + if ( print ) { <nl> + toolInfoLog ( ) < < num < < " \ t " < < o < < std : : endl ; <nl> + } <nl> <nl> if ( o [ " op " ] . String ( ) = = " n " ) <nl> continue ; <nl> class OplogTool : public Tool { <nl> <nl> BSONObj res ; <nl> bool ok = conn ( ) . runCommand ( " admin " , c , res ) ; <nl> - if ( print | | ! ok ) <nl> - log ( ) < < res < < endl ; <nl> + if ( ! ok ) { <nl> + toolError ( ) < < res < < std : : endl ; <nl> + } else if ( print ) { <nl> + toolInfoLog ( ) < < res < < std : : endl ; <nl> + } <nl> } <nl> <nl> return 0 ; <nl> mmm a / src / mongo / tools / restore . cpp <nl> ppp b / src / mongo / tools / restore . cpp <nl> class Restore : public BSONTool { <nl> } <nl> <nl> if ( isMongos ( ) & & toolGlobalParams . db = = " " & & exists ( root / " config " ) ) { <nl> - log ( ) < < " Cannot do a full restore on a sharded system " < < endl ; <nl> + toolError ( ) < < " Cannot do a full restore on a sharded system " < < std : : endl ; <nl> return - 1 ; <nl> } <nl> <nl> class Restore : public BSONTool { <nl> / / fail early if errors <nl> <nl> if ( toolGlobalParams . db ! = " " ) { <nl> - log ( ) < < " Can only replay oplog on full restore " < < endl ; <nl> + toolError ( ) < < " Can only replay oplog on full restore " < < std : : endl ; <nl> return - 1 ; <nl> } <nl> <nl> if ( ! exists ( root / " oplog . bson " ) ) { <nl> - log ( ) < < " No oplog file to replay . Make sure you run mongodump with - - oplog . " < < endl ; <nl> + toolError ( ) < < " No oplog file to replay . Make sure you run mongodump with - - oplog . " <nl> + < < std : : endl ; <nl> return - 1 ; <nl> } <nl> <nl> <nl> BSONObj out ; <nl> if ( ! conn ( ) . simpleCommand ( " admin " , & out , " buildinfo " ) ) { <nl> - log ( ) < < " buildinfo command failed : " < < out [ " errmsg " ] . String ( ) < < endl ; <nl> + toolError ( ) < < " buildinfo command failed : " < < out [ " errmsg " ] . String ( ) < < std : : endl ; <nl> return - 1 ; <nl> } <nl> <nl> StringData version = out [ " version " ] . valuestr ( ) ; <nl> if ( versionCmp ( version , " 1 . 7 . 4 - pre - " ) < 0 ) { <nl> - log ( ) < < " Can only replay oplog to server version > = 1 . 7 . 4 " < < endl ; <nl> + toolError ( ) < < " Can only replay oplog to server version > = 1 . 7 . 4 " < < std : : endl ; <nl> return - 1 ; <nl> } <nl> <nl> class Restore : public BSONTool { <nl> mongoRestoreGlobalParams . oplogLimit . c_str ( ) ) , <nl> boost : : lexical_cast < unsigned long > ( oplogInc . c_str ( ) ) ) ) ; <nl> } catch ( const boost : : bad_lexical_cast & error ) { <nl> - log ( ) < < " Could not parse oplogLimit into Timestamp from values ( " <nl> - < < mongoRestoreGlobalParams . oplogLimit < < " , " < < oplogInc < < " ) " <nl> - < < endl ; <nl> + toolError ( ) < < " Could not parse oplogLimit into Timestamp from values ( " <nl> + < < mongoRestoreGlobalParams . oplogLimit < < " , " < < oplogInc < < " ) " <nl> + < < std : : endl ; <nl> return - 1 ; <nl> } <nl> <nl> class Restore : public BSONTool { <nl> if ( cursor - > more ( ) ) { <nl> tsOptime = cursor - > next ( ) . getField ( " ts " ) . _opTime ( ) ; <nl> if ( tsOptime > * _oplogLimitTS . get ( ) ) { <nl> - log ( ) < < " The oplogLimit is not newer than " <nl> - < < " the last oplog entry on the server . " <nl> - < < endl ; <nl> + toolError ( ) < < " The oplogLimit is not newer than " <nl> + < < " the last oplog entry on the server . " <nl> + < < std : : endl ; <nl> return - 1 ; <nl> } <nl> } <nl> class Restore : public BSONTool { <nl> BSONObj query = BSON ( " ts " < < tsRestrictBldr . obj ( ) ) ; <nl> <nl> if ( ! tsOptime . isNull ( ) ) { <nl> - log ( ) < < " Latest oplog entry on the server is " < < tsOptime . getSecs ( ) <nl> - < < " : " < < tsOptime . getInc ( ) < < endl ; <nl> - log ( ) < < " Only applying oplog entries matching this criteria : " <nl> - < < query . jsonString ( ) < < endl ; <nl> + toolInfoLog ( ) < < " Latest oplog entry on the server is " < < tsOptime . getSecs ( ) <nl> + < < " : " < < tsOptime . getInc ( ) < < std : : endl ; <nl> + toolInfoLog ( ) < < " Only applying oplog entries matching this criteria : " <nl> + < < query . jsonString ( ) < < std : : endl ; <nl> } <nl> _opmatcher . reset ( new Matcher ( query ) ) ; <nl> } <nl> class Restore : public BSONTool { <nl> / / should this happen for oplog replay as well ? <nl> string err = conn ( ) . getLastError ( toolGlobalParams . db = = " " ? " admin " : toolGlobalParams . db ) ; <nl> if ( ! err . empty ( ) ) { <nl> - error ( ) < < err ; <nl> + toolError ( ) < < err < < std : : endl ; <nl> } <nl> <nl> if ( mongoRestoreGlobalParams . oplogReplay ) { <nl> - log ( ) < < " \ t Replaying oplog " < < endl ; <nl> + toolInfoLog ( ) < < " \ t Replaying oplog " < < std : : endl ; <nl> _curns = OPLOG_SENTINEL ; <nl> processFile ( root / " oplog . bson " ) ; <nl> - log ( ) < < " Applied " < < _oplogEntryApplies < < " oplog entries out of " <nl> - < < _oplogEntryApplies + _oplogEntrySkips < < " ( " < < _oplogEntrySkips <nl> - < < " skipped ) . " < < endl ; <nl> + toolInfoLog ( ) < < " Applied " < < _oplogEntryApplies < < " oplog entries out of " <nl> + < < _oplogEntryApplies + _oplogEntrySkips < < " ( " < < _oplogEntrySkips <nl> + < < " skipped ) . " < < std : : endl ; <nl> } <nl> <nl> return EXIT_CLEAN ; <nl> class Restore : public BSONTool { <nl> bool oplogReplayLimit , <nl> bool top_level = false ) { <nl> bool json_metadata = false ; <nl> - LOG ( 2 ) < < " drillDown : " < < root . string ( ) < < endl ; <nl> + if ( logger : : globalLogDomain ( ) - > shouldLog ( logger : : LogSeverity : : Debug ( 2 ) ) ) { <nl> + toolInfoLog ( ) < < " drillDown : " < < root . string ( ) < < std : : endl ; <nl> + } <nl> <nl> / / skip hidden files and directories <nl> if ( root . leaf ( ) . string ( ) [ 0 ] = = ' . ' & & root . leaf ( ) . string ( ) ! = " . " ) <nl> class Restore : public BSONTool { <nl> <nl> if ( use_db ) { <nl> if ( boost : : filesystem : : is_directory ( p ) ) { <nl> - error ( ) < < " ERROR : root directory must be a dump of a single database " < < endl ; <nl> - error ( ) < < " when specifying a db name with - - db " < < endl ; <nl> - printHelp ( cout ) ; <nl> + toolError ( ) < < " ERROR : root directory must be a dump of a single database " <nl> + < < std : : endl ; <nl> + toolError ( ) < < " when specifying a db name with - - db " < < std : : endl ; <nl> + toolError ( ) < < " use the - - help option for more information " <nl> + < < std : : endl ; <nl> return ; <nl> } <nl> } <nl> <nl> if ( use_coll ) { <nl> if ( boost : : filesystem : : is_directory ( p ) | | i ! = end ) { <nl> - error ( ) < < " ERROR : root directory must be a dump of a single collection " < < endl ; <nl> - error ( ) < < " when specifying a collection name with - - collection " < < endl ; <nl> - printHelp ( cout ) ; <nl> + toolError ( ) < < " ERROR : root directory must be a dump of a single collection " <nl> + < < std : : endl ; <nl> + toolError ( ) < < " when specifying a collection name with - - collection " <nl> + < < std : : endl ; <nl> + toolError ( ) < < " use the - - help option for more information " <nl> + < < std : : endl ; <nl> return ; <nl> } <nl> } <nl> class Restore : public BSONTool { <nl> <nl> if ( ! ( endsWith ( root . string ( ) . c_str ( ) , " . bson " ) | | <nl> endsWith ( root . string ( ) . c_str ( ) , " . bin " ) ) ) { <nl> - error ( ) < < " don ' t know what to do with file [ " < < root . string ( ) < < " ] " < < endl ; <nl> + toolError ( ) < < " don ' t know what to do with file [ " < < root . string ( ) < < " ] " < < std : : endl ; <nl> return ; <nl> } <nl> <nl> - log ( ) < < root . string ( ) < < endl ; <nl> + toolInfoLog ( ) < < root . string ( ) < < std : : endl ; <nl> <nl> if ( root . leaf ( ) = = " system . profile . bson " ) { <nl> - log ( ) < < " \ t skipping " < < endl ; <nl> + toolInfoLog ( ) < < " \ t skipping system . profile . bson " < < std : : endl ; <nl> return ; <nl> } <nl> <nl> class Restore : public BSONTool { <nl> } <nl> <nl> if ( oplogReplayLimit ) { <nl> - error ( ) < < " The oplogLimit option cannot be used if " <nl> - < < " normal databases / collections exist in the dump directory . " <nl> - < < endl ; <nl> + toolError ( ) < < " The oplogLimit option cannot be used if " <nl> + < < " normal databases / collections exist in the dump directory . " <nl> + < < std : : endl ; <nl> exit ( EXIT_FAILURE ) ; <nl> } <nl> <nl> - log ( ) < < " \ tgoing into namespace [ " < < ns < < " ] " < < endl ; <nl> + toolInfoLog ( ) < < " \ tgoing into namespace [ " < < ns < < " ] " < < std : : endl ; <nl> <nl> if ( mongoRestoreGlobalParams . drop ) { <nl> if ( root . leaf ( ) ! = " system . users . bson " ) { <nl> - log ( ) < < " \ t dropping " < < endl ; <nl> + toolInfoLog ( ) < < " \ t dropping " < < std : : endl ; <nl> conn ( ) . dropCollection ( ns ) ; <nl> } else { <nl> / / Create map of the users currently in the DB <nl> class Restore : public BSONTool { <nl> / / This is fine because dumps from before 2 . 1 won ' t have a metadata file , just print a warning . <nl> / / System collections shouldn ' t have metadata so don ' t warn if that file is missing . <nl> if ( ! startsWith ( metadataFile . leaf ( ) . string ( ) , " system . " ) ) { <nl> - log ( ) < < metadataFile . string ( ) < < " not found . Skipping . " < < endl ; <nl> + toolInfoLog ( ) < < metadataFile . string ( ) < < " not found . Skipping . " < < std : : endl ; <nl> } <nl> } else { <nl> metadataObject = parseMetadataFile ( metadataFile . string ( ) ) ; <nl> class Restore : public BSONTool { <nl> Query ( BSON ( " name " < < ns ) ) ) ) ; <nl> if ( cursor - > more ( ) ) { <nl> / / collection already exists show warning <nl> - warning ( ) < < " Restoring to " < < ns < < " without dropping . Restored data " <nl> - " will be inserted without raising errors ; check your server log " <nl> - < < endl ; <nl> + toolError ( ) < < " Restoring to " < < ns < < " without dropping . Restored data " <nl> + < < " will be inserted without raising errors ; check your server log " <nl> + < < std : : endl ; <nl> } <nl> } <nl> <nl> class Restore : public BSONTool { <nl> if ( mongoRestoreGlobalParams . w > 0 ) { <nl> string err = conn ( ) . getLastError ( db , false , false , mongoRestoreGlobalParams . w ) ; <nl> if ( ! err . empty ( ) ) { <nl> - error ( ) < < " Error while replaying oplog : " < < err ; <nl> + toolError ( ) < < " Error while replaying oplog : " < < err < < std : : endl ; <nl> } <nl> } <nl> } <nl> class Restore : public BSONTool { <nl> if ( mongoRestoreGlobalParams . w > 0 ) { <nl> string err = conn ( ) . getLastError ( _curdb , false , false , mongoRestoreGlobalParams . w ) ; <nl> if ( ! err . empty ( ) ) { <nl> - error ( ) < < err ; <nl> + toolError ( ) < < err < < std : : endl ; <nl> } <nl> } <nl> } <nl> class Restore : public BSONTool { <nl> } <nl> else { <nl> if ( e . type ( ) = = Undefined ) { <nl> - log ( ) < < _curns < < " : skipping undefined field : " < < e . fieldName ( ) < < endl ; <nl> + toolInfoLog ( ) < < _curns < < " : skipping undefined field : " < < e . fieldName ( ) <nl> + < < std : : endl ; <nl> } <nl> else { <nl> bo . append ( e ) ; <nl> class Restore : public BSONTool { <nl> createColl = false ; <nl> BSONObj obj = cursor - > next ( ) ; <nl> if ( ! obj . hasField ( " options " ) | | ! optionsSame ( cmdObj , obj [ " options " ] . Obj ( ) ) ) { <nl> - log ( ) < < " WARNING : collection " < < _curns < < " exists with different options than are in the metadata . json file and not using - - drop . Options in the metadata file will be ignored . " < < endl ; <nl> + toolError ( ) < < " WARNING : collection " < < _curns <nl> + < < " exists with different options than are in the metadata . json file and " <nl> + < < " not using - - drop . Options in the metadata file will be ignored . " <nl> + < < std : : endl ; <nl> } <nl> } <nl> <nl> class Restore : public BSONTool { <nl> if ( ! conn ( ) . runCommand ( _curdb , cmdObj , info ) ) { <nl> uasserted ( 15936 , " Creating collection " + _curns + " failed . Errmsg : " + info [ " errmsg " ] . String ( ) ) ; <nl> } else { <nl> - log ( ) < < " \ tCreated collection " < < _curns < < " with options : " < < cmdObj . jsonString ( ) < < endl ; <nl> + toolInfoLog ( ) < < " \ tCreated collection " < < _curns < < " with options : " <nl> + < < cmdObj . jsonString ( ) < < std : : endl ; <nl> } <nl> } <nl> <nl> class Restore : public BSONTool { <nl> } <nl> } <nl> BSONObj o = bo . obj ( ) ; <nl> - LOG ( 0 ) < < " \ tCreating index : " < < o < < endl ; <nl> + if ( logger : : globalLogDomain ( ) - > shouldLog ( logger : : LogSeverity : : Debug ( 0 ) ) ) { <nl> + toolInfoLog ( ) < < " \ tCreating index : " < < o < < std : : endl ; <nl> + } <nl> conn ( ) . insert ( _curdb + " . system . indexes " , o ) ; <nl> <nl> / / We ' re stricter about errors for indexes than for regular data <nl> class Restore : public BSONTool { <nl> <nl> if ( err . hasField ( " err " ) & & ! err [ " err " ] . isNull ( ) ) { <nl> if ( err [ " err " ] . str ( ) = = " norepl " & & mongoRestoreGlobalParams . w > 1 ) { <nl> - error ( ) < < " Cannot specify write concern for non - replicas " < < endl ; <nl> + toolError ( ) < < " Cannot specify write concern for non - replicas " < < std : : endl ; <nl> } <nl> else { <nl> string errCode ; <nl> class Restore : public BSONTool { <nl> errCode = str : : stream ( ) < < err [ " code " ] . numberInt ( ) ; <nl> } <nl> <nl> - error ( ) < < " Error creating index " < < o [ " ns " ] . String ( ) < < " : " <nl> - < < errCode < < " " < < err [ " err " ] < < endl ; <nl> + toolError ( ) < < " Error creating index " < < o [ " ns " ] . String ( ) < < " : " <nl> + < < errCode < < " " < < err [ " err " ] < < std : : endl ; <nl> } <nl> <nl> : : abort ( ) ; <nl> mmm a / src / mongo / tools / stat . cpp <nl> ppp b / src / mongo / tools / stat . cpp <nl> namespace mongo { <nl> } <nl> <nl> if ( c . get ( url , & r ) ! = 200 ) { <nl> - cout < < " error ( http ) : " < < r . getEntireResponse ( ) < < endl ; <nl> + toolError ( ) < < " error ( http ) : " < < r . getEntireResponse ( ) < < std : : endl ; <nl> return BSONObj ( ) ; <nl> } <nl> <nl> BSONObj x = fromjson ( r . getBody ( ) ) ; <nl> BSONElement e = x [ " serverStatus " ] ; <nl> if ( e . type ( ) ! = Object ) { <nl> - cout < < " BROKEN : " < < x < < endl ; <nl> + toolError ( ) < < " BROKEN : " < < x < < std : : endl ; <nl> return BSONObj ( ) ; <nl> } <nl> return e . embeddedObjectUserCheck ( ) ; <nl> } <nl> BSONObj out ; <nl> if ( ! conn ( ) . simpleCommand ( toolGlobalParams . db , & out , " serverStatus " ) ) { <nl> - cout < < " error : " < < out < < endl ; <nl> + toolError ( ) < < " error : " < < out < < std : : endl ; <nl> return BSONObj ( ) ; <nl> } <nl> return out . getOwned ( ) ; <nl> namespace mongo { <nl> now = stats ( ) ; <nl> } <nl> catch ( std : : exception & e ) { <nl> - cout < < " can ' t get data : " < < e . what ( ) < < endl ; <nl> + toolError ( ) < < " can ' t get data : " < < e . what ( ) < < std : : endl ; <nl> continue ; <nl> } <nl> <nl> namespace mongo { <nl> <nl> } <nl> catch ( AssertionException & e ) { <nl> - cout < < " \ nerror : " < < e . what ( ) < < " \ n " <nl> - < < now <nl> - < < endl ; <nl> + toolError ( ) < < " \ nerror : " < < e . what ( ) < < " \ n " <nl> + < < now <nl> + < < std : : endl ; <nl> } <nl> <nl> prev = now ; <nl> namespace mongo { <nl> <nl> } <nl> catch ( std : : exception & e ) { <nl> - cout < < " serverThread ( " < < state - > host < < " ) fatal error : " < < e . what ( ) < < endl ; <nl> + toolError ( ) < < " serverThread ( " < < state - > host < < " ) fatal error : " < < e . what ( ) <nl> + < < std : : endl ; <nl> } <nl> catch ( . . . ) { <nl> - cout < < " serverThread ( " < < state - > host < < " ) fatal error " < < endl ; <nl> + toolError ( ) < < " serverThread ( " < < state - > host < < " ) fatal error " < < std : : endl ; <nl> } <nl> } <nl> <nl> namespace mongo { <nl> string errmsg ; <nl> ConnectionString cs = ConnectionString : : parse ( x [ " host " ] . String ( ) , errmsg ) ; <nl> if ( errmsg . size ( ) ) { <nl> - cerr < < errmsg < < endl ; <nl> + toolError ( ) < < errmsg < < std : : endl ; <nl> continue ; <nl> } <nl> <nl> mmm a / src / mongo / tools / tool . cpp <nl> ppp b / src / mongo / tools / tool . cpp <nl> namespace mongo { <nl> ConnectionString cs = ConnectionString : : parse ( toolGlobalParams . connectionString , <nl> errmsg ) ; <nl> if ( ! cs . isValid ( ) ) { <nl> - cerr < < " invalid hostname [ " < < toolGlobalParams . connectionString < < " ] " <nl> - < < errmsg < < endl ; <nl> + toolError ( ) < < " invalid hostname [ " < < toolGlobalParams . connectionString < < " ] " <nl> + < < errmsg < < std : : endl ; <nl> : : _exit ( - 1 ) ; <nl> } <nl> <nl> _conn = cs . connect ( errmsg ) ; <nl> if ( ! _conn ) { <nl> - std : : cerr < < " couldn ' t connect to [ " < < toolGlobalParams . connectionString <nl> + toolError ( ) < < " couldn ' t connect to [ " < < toolGlobalParams . connectionString <nl> < < " ] " < < errmsg < < std : : endl ; <nl> : : _exit ( - 1 ) ; <nl> } <nl> <nl> - if ( ! toolGlobalParams . quiet ) { <nl> - toolOutput ( ) < < " connected to : " < < toolGlobalParams . connectionString <nl> - < < std : : endl ; <nl> - } <nl> + toolInfoOutput ( ) < < " connected to : " < < toolGlobalParams . connectionString <nl> + < < std : : endl ; <nl> } <nl> <nl> } <nl> namespace mongo { <nl> acquirePathLock ( ) ; <nl> } <nl> catch ( DBException & ) { <nl> - cerr < < endl < < " If you are running a mongod on the same " <nl> - " path you should connect to that instead of direct data " <nl> - " file access " < < endl < < endl ; <nl> + toolError ( ) < < std : : endl < < " If you are running a mongod on the same " <nl> + " path you should connect to that instead of direct data " <nl> + " file access " < < std : : endl < < std : : endl ; <nl> dbexit ( EXIT_FS ) ; <nl> : : _exit ( EXIT_FAILURE ) ; <nl> } <nl> namespace mongo { <nl> ret = run ( ) ; <nl> } <nl> catch ( DBException & e ) { <nl> - cerr < < " assertion : " < < e . toString ( ) < < endl ; <nl> + toolError ( ) < < " assertion : " < < e . toString ( ) < < std : : endl ; <nl> ret = - 1 ; <nl> } <nl> catch ( const boost : : filesystem : : filesystem_error & fse ) { <nl> namespace mongo { <nl> printHelp ( cerr ) ; <nl> else <nl> # endif / / _WIN32 <nl> - cerr < < " error : " < < fse . what ( ) < < endl ; <nl> + toolError ( ) < < " error : " < < fse . what ( ) < < std : : endl ; <nl> <nl> ret = - 1 ; <nl> } <nl> namespace mongo { <nl> bool ok = conn ( ) . isMaster ( isMaster , & info ) ; <nl> <nl> if ( ok & & ! isMaster ) { <nl> - cerr < < " ERROR : trying to write to non - master " < < conn ( ) . toString ( ) < < endl ; <nl> - cerr < < " isMaster info : " < < info < < endl ; <nl> + toolError ( ) < < " ERROR : trying to write to non - master " < < conn ( ) . toString ( ) <nl> + < < std : : endl ; <nl> + toolError ( ) < < " isMaster info : " < < info < < std : : endl ; <nl> return false ; <nl> } <nl> <nl> namespace mongo { <nl> unsigned long long fileLength = file_size ( root ) ; <nl> <nl> if ( fileLength = = 0 ) { <nl> - if ( ! toolGlobalParams . quiet ) { <nl> - toolOutput ( ) < < " file " < < fileName < < " empty , skipping " < < endl ; <nl> - } <nl> + toolInfoOutput ( ) < < " file " < < fileName < < " empty , skipping " < < std : : endl ; <nl> return 0 ; <nl> } <nl> <nl> <nl> FILE * file = fopen ( fileName . c_str ( ) , " rb " ) ; <nl> if ( ! file ) { <nl> - cerr < < " error opening file : " < < fileName < < " " < < errnoWithDescription ( ) < < endl ; <nl> + toolError ( ) < < " error opening file : " < < fileName < < " " < < errnoWithDescription ( ) <nl> + < < std : : endl ; <nl> return 0 ; <nl> } <nl> <nl> namespace mongo { <nl> posix_fadvise ( fileno ( file ) , 0 , fileLength , POSIX_FADV_SEQUENTIAL ) ; <nl> # endif <nl> <nl> - if ( ! toolGlobalParams . quiet & & <nl> - logger : : globalLogDomain ( ) - > shouldLog ( logger : : LogSeverity : : Debug ( 1 ) ) ) { <nl> - toolOutput ( ) < < " \ t file size : " < < fileLength < < endl ; <nl> + if ( logger : : globalLogDomain ( ) - > shouldLog ( logger : : LogSeverity : : Debug ( 1 ) ) ) { <nl> + toolInfoOutput ( ) < < " \ t file size : " < < fileLength < < std : : endl ; <nl> } <nl> <nl> unsigned long long read = 0 ; <nl> namespace mongo { <nl> boost : : scoped_array < char > buf_holder ( new char [ BUF_SIZE ] ) ; <nl> char * buf = buf_holder . get ( ) ; <nl> <nl> - ProgressMeter m ( fileLength ) ; <nl> - m . setUnits ( " bytes " ) ; <nl> + ProgressMeter m ( fileLength ) ; <nl> + if ( ! toolGlobalParams . quiet ) { <nl> + m . setUnits ( " bytes " ) ; <nl> + } <nl> <nl> while ( read < fileLength ) { <nl> size_t amt = fread ( buf , 1 , 4 , file ) ; <nl> namespace mongo { <nl> <nl> BSONObj o ( buf ) ; <nl> if ( bsonToolGlobalParams . objcheck & & ! o . valid ( ) ) { <nl> - cerr < < " INVALID OBJECT - going to try and print out " < < endl ; <nl> - cerr < < " size : " < < size < < endl ; <nl> + toolError ( ) < < " INVALID OBJECT - going to try and print out " < < std : : endl ; <nl> + toolError ( ) < < " size : " < < size < < std : : endl ; <nl> BSONObjIterator i ( o ) ; <nl> while ( i . more ( ) ) { <nl> BSONElement e = i . next ( ) ; <nl> namespace mongo { <nl> e . validate ( ) ; <nl> } <nl> catch ( . . . ) { <nl> - cerr < < " \ t \ t NEXT ONE IS INVALID " < < endl ; <nl> + toolError ( ) < < " \ t \ t NEXT ONE IS INVALID " < < std : : endl ; <nl> } <nl> - cerr < < " \ t name : " < < e . fieldName ( ) < < " " < < e . type ( ) < < endl ; <nl> - cerr < < " \ t " < < e < < endl ; <nl> + toolError ( ) < < " \ t name : " < < e . fieldName ( ) < < " " < < typeName ( e . type ( ) ) <nl> + < < std : : endl ; <nl> + toolError ( ) < < " \ t " < < e < < std : : endl ; <nl> } <nl> } <nl> <nl> namespace mongo { <nl> read + = o . objsize ( ) ; <nl> num + + ; <nl> <nl> - m . hit ( o . objsize ( ) ) ; <nl> + if ( ! toolGlobalParams . quiet ) { <nl> + m . hit ( o . objsize ( ) ) ; <nl> + } <nl> } <nl> <nl> fclose ( file ) ; <nl> <nl> - uassert ( 10265 , " counts don ' t match " , m . done ( ) = = fileLength ) ; <nl> - if ( ! toolGlobalParams . quiet ) { <nl> - toolOutput ( ) < < m . hits ( ) < < " objects found " < < std : : endl ; <nl> - if ( bsonToolGlobalParams . hasFilter ) <nl> - toolOutput ( ) < < processed < < " objects processed " < < std : : endl ; <nl> - } <nl> + uassert ( 10265 , " counts don ' t match " , read = = fileLength ) ; <nl> + toolInfoOutput ( ) < < num < < " objects found " < < std : : endl ; <nl> + if ( bsonToolGlobalParams . hasFilter ) <nl> + toolInfoOutput ( ) < < processed < < " objects processed " < < std : : endl ; <nl> return processed ; <nl> } <nl> <nl> mmm a / src / mongo / tools / tool_logger . cpp <nl> ppp b / src / mongo / tools / tool_logger . cpp <nl> namespace { <nl> <nl> std : : ostream & ErrorConsole : : out ( ) { return std : : cerr ; } <nl> <nl> + namespace { <nl> + <nl> + logger : : MessageLogDomain * toolErrorOutput = NULL ; <nl> + logger : : MessageLogDomain * toolNonErrorOutput = NULL ; <nl> + logger : : MessageLogDomain * toolNonErrorDecoratedOutput = NULL ; <nl> + <nl> + } / / namespace <nl> + <nl> MONGO_INITIALIZER_GENERAL ( ToolLogRedirection , <nl> ( " GlobalLogManager " , " EndStartupOptionHandling " ) , <nl> ( " default " ) ) ( InitializerContext * ) { <nl> MONGO_INITIALIZER_GENERAL ( ToolLogRedirection , <nl> using logger : : MessageLogDomain ; <nl> using logger : : ConsoleAppender ; <nl> <nl> + toolErrorOutput = logger : : globalLogManager ( ) - > getNamedDomain ( " toolErrorOutput " ) ; <nl> + toolNonErrorOutput = logger : : globalLogManager ( ) - > getNamedDomain ( " toolNonErrorOutput " ) ; <nl> + toolNonErrorDecoratedOutput = <nl> + logger : : globalLogManager ( ) - > getNamedDomain ( " toolNonErrorDecoratedOutput " ) ; <nl> + <nl> + / / Errors in the tools always go to stderr <nl> + toolErrorOutput - > attachAppender ( <nl> + MessageLogDomain : : AppenderAutoPtr ( <nl> + new ConsoleAppender < MessageEventEphemeral , ErrorConsole > ( <nl> + new logger : : MessageEventUnadornedEncoder ) ) ) ; <nl> + <nl> / / If we are outputting data to stdout , we may need to redirect all logging to stderr <nl> if ( ! toolGlobalParams . canUseStdout ) { <nl> logger : : globalLogDomain ( ) - > clearAppenders ( ) ; <nl> MONGO_INITIALIZER_GENERAL ( ToolLogRedirection , <nl> new MessageEventDetailsEncoder ) ) ) ; <nl> } <nl> <nl> + / / Only put an appender on our informational messages if we did not use - - quiet <nl> + if ( ! toolGlobalParams . quiet ) { <nl> + if ( toolGlobalParams . canUseStdout ) { <nl> + / / If we can use stdout , we can use the ConsoleAppender with the default console <nl> + toolNonErrorOutput - > attachAppender ( <nl> + MessageLogDomain : : AppenderAutoPtr ( <nl> + new ConsoleAppender < MessageEventEphemeral > ( <nl> + new logger : : MessageEventUnadornedEncoder ) ) ) ; <nl> + <nl> + toolNonErrorDecoratedOutput - > attachAppender ( <nl> + MessageLogDomain : : AppenderAutoPtr ( <nl> + new ConsoleAppender < MessageEventEphemeral > ( <nl> + new logger : : MessageEventDetailsEncoder ) ) ) ; <nl> + } <nl> + else { <nl> + / / If we cannot use stdout , we have to use ErrorConsole to redirect informational <nl> + / / messages to stderr <nl> + toolNonErrorOutput - > attachAppender ( <nl> + MessageLogDomain : : AppenderAutoPtr ( <nl> + new ConsoleAppender < MessageEventEphemeral , ErrorConsole > ( <nl> + new logger : : MessageEventUnadornedEncoder ) ) ) ; <nl> + <nl> + toolNonErrorDecoratedOutput - > attachAppender ( <nl> + MessageLogDomain : : AppenderAutoPtr ( <nl> + new ConsoleAppender < MessageEventEphemeral , ErrorConsole > ( <nl> + new logger : : MessageEventDetailsEncoder ) ) ) ; <nl> + } <nl> + } <nl> + <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> - std : : ostream & toolOutput ( ) { <nl> - return toolGlobalParams . canUseStdout ? std : : cout : std : : cerr ; <nl> + LogstreamBuilder toolInfoLog ( ) { <nl> + return LogstreamBuilder ( toolNonErrorDecoratedOutput , <nl> + " " , <nl> + logger : : LogSeverity : : Log ( ) ) ; <nl> + } <nl> + <nl> + LogstreamBuilder toolInfoOutput ( ) { <nl> + return LogstreamBuilder ( toolNonErrorOutput , <nl> + " " , <nl> + logger : : LogSeverity : : Log ( ) ) ; <nl> + } <nl> + <nl> + LogstreamBuilder toolError ( ) { <nl> + return LogstreamBuilder ( toolErrorOutput , <nl> + " " , <nl> + logger : : LogSeverity : : Log ( ) ) ; <nl> } <nl> <nl> } / / namespace mongo <nl> mmm a / src / mongo / tools / tool_logger . h <nl> ppp b / src / mongo / tools / tool_logger . h <nl> <nl> # include < boost / thread / mutex . hpp > <nl> # include < iosfwd > <nl> <nl> + # include " mongo / logger / logstream_builder . h " <nl> + <nl> namespace mongo { <nl> <nl> / * * <nl> namespace mongo { <nl> boost : : unique_lock < boost : : mutex > _consoleLock ; <nl> } ; <nl> <nl> - std : : ostream & toolOutput ( ) ; <nl> + using logger : : LogstreamBuilder ; <nl> + <nl> + / * <nl> + * Informational messages . Messages sent here will go to stdout normally , stderr if data is <nl> + * being sent to stdout , and be silenced if the user specifies - - quiet . <nl> + * / <nl> + LogstreamBuilder toolInfoOutput ( ) ; <nl> + / * <nl> + * Informational messages . Messages sent here will go to stdout normally , stderr if data is <nl> + * being sent to stdout , and be silenced if the user specifies - - quiet . Incudes extra log <nl> + * decoration . <nl> + * / <nl> + LogstreamBuilder toolInfoLog ( ) ; <nl> + / * <nl> + * Error messages . Messages sent here should always go to stderr and not be silenced by <nl> + * - - quiet . <nl> + * / <nl> + LogstreamBuilder toolError ( ) ; <nl> <nl> } / / namespace mongo <nl> mmm a / src / mongo / tools / tool_options . cpp <nl> ppp b / src / mongo / tools / tool_options . cpp <nl> namespace mongo { <nl> } <nl> } <nl> <nl> - if ( hasParam ( " quiet " ) ) { <nl> - toolGlobalParams . quiet = true ; <nl> - } <nl> + toolGlobalParams . quiet = params . count ( " quiet " ) ; <nl> <nl> # ifdef MONGO_SSL <nl> if ( params . count ( " ssl " ) ) { <nl> namespace mongo { <nl> } <nl> toolGlobalParams . db = " test " ; <nl> toolGlobalParams . coll = " " ; <nl> - toolGlobalParams . quiet = false ; <nl> toolGlobalParams . noconnection = false ; <nl> <nl> if ( params . count ( " db " ) ) <nl> mmm a / src / mongo / tools / top . cpp <nl> ppp b / src / mongo / tools / top . cpp <nl> namespace mongo { <nl> <nl> BSONObj out ; <nl> if ( ! conn ( ) . simpleCommand ( toolGlobalParams . db , & out , " serverStatus " ) ) { <nl> - cout < < " error : " < < out < < endl ; <nl> + toolError ( ) < < " error : " < < out < < std : : endl ; <nl> return NamespaceStats ( ) ; <nl> } <nl> <nl> namespace mongo { <nl> <nl> BSONObj out ; <nl> if ( ! conn ( ) . simpleCommand ( toolGlobalParams . db , & out , " top " ) ) { <nl> - cout < < " error : " < < out < < endl ; <nl> + toolError ( ) < < " error : " < < out < < std : : endl ; <nl> return stats ; <nl> } <nl> <nl> if ( ! out [ " totals " ] . isABSONObj ( ) ) { <nl> - cout < < " error : invalid top \ n " < < out < < endl ; <nl> + toolError ( ) < < " error : invalid top \ n " < < out < < std : : endl ; <nl> return stats ; <nl> } <nl> <nl> namespace mongo { <nl> <nl> int run ( ) { <nl> if ( isMongos ( ) ) { <nl> - log ( ) < < " mongotop only works on instances of mongod . " < < endl ; <nl> + toolError ( ) < < " mongotop only works on instances of mongod . " < < std : : endl ; <nl> return EXIT_FAILURE ; <nl> } <nl> <nl> namespace mongo { <nl> now = getData ( ) ; <nl> } <nl> catch ( std : : exception & e ) { <nl> - cout < < " can ' t get data : " < < e . what ( ) < < endl ; <nl> + toolError ( ) < < " can ' t get data : " < < e . what ( ) < < std : : endl ; <nl> continue ; <nl> } <nl> <nl> namespace mongo { <nl> printDiff ( prev , now ) ; <nl> } <nl> catch ( AssertionException & e ) { <nl> - cout < < " \ nerror : " < < e . what ( ) < < endl ; <nl> + toolError ( ) < < " \ nerror : " < < e . what ( ) < < std : : endl ; <nl> } <nl> <nl> prev = now ; <nl> | SERVER - 9282 Audit tools for correct handling of log output | mongodb/mongo | 0502950b1cf05c64f1a367e00911c06baa65688a | 2013-10-11T19:09:26Z |
mmm a / tools / distrib / run_clang_tidy . py <nl> ppp b / tools / distrib / run_clang_tidy . py <nl> <nl> shortname = filename , <nl> ) ) # verbose_success = True ) ) <nl> <nl> - jobset . run ( jobs , maxjobs = args . jobs ) <nl> + num_fails , res_set = jobset . run ( jobs , maxjobs = args . jobs ) <nl> + sys . exit ( num_fails ) <nl> | Check for failures from run clang tidy | grpc/grpc | 02336a29ac7c2ba8ee68a7a0bae589b713805c20 | 2018-01-17T01:24:51Z |
mmm a / lib / Sema / CSApply . cpp <nl> ppp b / lib / Sema / CSApply . cpp <nl> <nl> # include " CodeSynthesis . h " <nl> # include " CSDiagnostics . h " <nl> # include " MiscDiagnostics . h " <nl> + # include " SolutionResult . h " <nl> # include " TypeCheckProtocol . h " <nl> # include " swift / AST / ASTVisitor . h " <nl> # include " swift / AST / ASTWalker . h " <nl> namespace { <nl> / / / Emit the fixes computed as part of the solution , returning true if we were <nl> / / / able to emit an error message , or false if none of the fixits worked out . <nl> bool ConstraintSystem : : applySolutionFixes ( const Solution & solution ) { <nl> - / / First transfer all of the deduced information back <nl> - / / to the constraint system . <nl> - applySolution ( solution ) ; <nl> - <nl> / / / Collect the fixes on a per - expression basis . <nl> llvm : : SmallDenseMap < Expr * , SmallVector < ConstraintFix * , 4 > > fixesPerExpr ; <nl> for ( auto * fix : solution . Fixes ) { <nl> Expr * ConstraintSystem : : applySolution ( Solution & solution , Expr * expr , <nl> Type convertType , <nl> bool discardedExpr , <nl> bool skipClosures ) { <nl> - / / Add the node types back . <nl> - for ( auto & nodeType : solution . addedNodeTypes ) { <nl> - setType ( nodeType . first , nodeType . second ) ; <nl> - } <nl> - <nl> / / If any fixes needed to be applied to arrive at this solution , resolve <nl> / / them to specific expressions . <nl> if ( ! solution . Fixes . empty ( ) ) { <nl> void Solution : : setExprTypes ( Expr * expr ) const { <nl> SetExprTypes SET ( * this ) ; <nl> expr - > walk ( SET ) ; <nl> } <nl> + <nl> + / / / MARK : SolutionResult implementation . <nl> + <nl> + SolutionResult SolutionResult : : forSolved ( Solution & & solution ) { <nl> + SolutionResult result ( Kind : : Success ) ; <nl> + result . solutions = new Solution ( std : : move ( solution ) ) ; <nl> + result . numSolutions = 1 ; <nl> + return result ; <nl> + } <nl> + <nl> + SolutionResult SolutionResult : : forAmbiguous ( <nl> + MutableArrayRef < Solution > solutions ) { <nl> + assert ( solutions . size ( ) > 1 & & " Not actually ambiguous " ) ; <nl> + SolutionResult result ( Kind : : Ambiguous ) ; <nl> + result . solutions = <nl> + ( Solution * ) malloc ( sizeof ( Solution ) * solutions . size ( ) ) ; <nl> + result . numSolutions = solutions . size ( ) ; <nl> + std : : uninitialized_copy ( std : : make_move_iterator ( solutions . begin ( ) ) , <nl> + std : : make_move_iterator ( solutions . end ( ) ) , <nl> + result . solutions ) ; <nl> + return result ; <nl> + } <nl> + <nl> + SolutionResult : : ~ SolutionResult ( ) { <nl> + assert ( ( ! requiresDiagnostic ( ) | | emittedDiagnostic ) & & <nl> + " SolutionResult was destroyed without emitting a diagnostic " ) ; <nl> + <nl> + for ( unsigned i : range ( numSolutions ) ) { <nl> + solutions [ i ] . ~ Solution ( ) ; <nl> + } <nl> + free ( solutions ) ; <nl> + } <nl> + <nl> + const Solution & SolutionResult : : getSolution ( ) const { <nl> + assert ( numSolutions = = 1 & & " Wrong number of solutions " ) ; <nl> + return solutions [ 0 ] ; <nl> + } <nl> + <nl> + Solution & & SolutionResult : : takeSolution ( ) & & { <nl> + assert ( numSolutions = = 1 & & " Wrong number of solutions " ) ; <nl> + return std : : move ( solutions [ 0 ] ) ; <nl> + } <nl> + <nl> + ArrayRef < Solution > SolutionResult : : getAmbiguousSolutions ( ) const { <nl> + assert ( getKind ( ) = = Ambiguous ) ; <nl> + return makeArrayRef ( solutions , numSolutions ) ; <nl> + } <nl> mmm a / lib / Sema / CSSolver . cpp <nl> ppp b / lib / Sema / CSSolver . cpp <nl> <nl> # include " CSStep . h " <nl> # include " ConstraintGraph . h " <nl> # include " ConstraintSystem . h " <nl> + # include " SolutionResult . h " <nl> # include " TypeCheckType . h " <nl> # include " swift / AST / ParameterList . h " <nl> # include " swift / AST / TypeWalker . h " <nl> bool ConstraintSystem : : solve ( Expr * & expr , <nl> if ( shouldSuppressDiagnostics ( ) ) <nl> return true ; <nl> <nl> - / / Try to provide a decent diagnostic . <nl> - if ( salvage ( solutions , expr ) ) { <nl> - / / If salvage produced an error message , then it failed to salvage the <nl> - / / expression , just bail out having reported the error . <nl> + / / Try to fix the system or provide a decent diagnostic . <nl> + auto salvagedResult = salvage ( ) ; <nl> + switch ( salvagedResult . getKind ( ) ) { <nl> + case SolutionResult : : Kind : : Success : <nl> + solutions . clear ( ) ; <nl> + solutions . push_back ( std : : move ( salvagedResult ) . takeSolution ( ) ) ; <nl> + break ; <nl> + <nl> + case SolutionResult : : Kind : : Error : <nl> + case SolutionResult : : Kind : : Ambiguous : <nl> + return true ; <nl> + <nl> + case SolutionResult : : Kind : : UndiagnosedError : <nl> + diagnoseFailureForExpr ( expr ) ; <nl> + salvagedResult . markAsDiagnosed ( ) ; <nl> + return true ; <nl> + <nl> + case SolutionResult : : Kind : : TooComplex : <nl> + getASTContext ( ) . Diags . diagnose ( expr - > getLoc ( ) , diag : : expression_too_complex ) <nl> + . highlight ( expr - > getSourceRange ( ) ) ; <nl> + salvagedResult . markAsDiagnosed ( ) ; <nl> return true ; <nl> } <nl> <nl> mmm a / lib / Sema / ConstraintSystem . cpp <nl> ppp b / lib / Sema / ConstraintSystem . cpp <nl> <nl> # include " ConstraintGraph . h " <nl> # include " CSDiagnostics . h " <nl> # include " CSFix . h " <nl> + # include " SolutionResult . h " <nl> # include " TypeCheckType . h " <nl> # include " swift / AST / Initializer . h " <nl> # include " swift / AST / GenericEnvironment . h " <nl> bool OverloadChoice : : isImplicitlyUnwrappedValueOrReturnValue ( ) const { <nl> llvm_unreachable ( " unhandled kind " ) ; <nl> } <nl> <nl> - bool ConstraintSystem : : salvage ( SmallVectorImpl < Solution > & viable , Expr * expr ) { <nl> + SolutionResult ConstraintSystem : : salvage ( ) { <nl> auto & ctx = getASTContext ( ) ; <nl> if ( ctx . TypeCheckerOpts . DebugConstraintSolver ) { <nl> auto & log = ctx . TypeCheckerDebug - > getStream ( ) ; <nl> bool ConstraintSystem : : salvage ( SmallVectorImpl < Solution > & viable , Expr * expr ) { <nl> / / <nl> / / FIXME : can this be removed ? We need to arrange for recordFixes to be <nl> / / eliminated . <nl> + SmallVector < Solution , 2 > viable ; <nl> viable . clear ( ) ; <nl> <nl> { <nl> bool ConstraintSystem : : salvage ( SmallVectorImpl < Solution > & viable , Expr * expr ) { <nl> if ( * best ! = 0 ) <nl> viable [ 0 ] = std : : move ( viable [ * best ] ) ; <nl> viable . erase ( viable . begin ( ) + 1 , viable . end ( ) ) ; <nl> - return false ; <nl> + return SolutionResult : : forSolved ( std : : move ( viable [ 0 ] ) ) ; <nl> } <nl> <nl> / / Before removing any " fixed " solutions , let ' s check <nl> / / if ambiguity is caused by fixes and diagnose if possible . <nl> if ( diagnoseAmbiguityWithFixes ( viable ) ) <nl> - return true ; <nl> + return SolutionResult : : forAmbiguous ( viable ) ; <nl> <nl> / / FIXME : If we were able to actually fix things along the way , <nl> / / we may have to hunt for the best solution . For now , we don ' t care . <nl> bool ConstraintSystem : : salvage ( SmallVectorImpl < Solution > & viable , Expr * expr ) { <nl> } <nl> } <nl> <nl> - if ( diagnoseAmbiguity ( expr , viable ) ) { <nl> - return true ; <nl> + if ( diagnoseAmbiguity ( viable ) ) { <nl> + return SolutionResult : : forAmbiguous ( viable ) ; <nl> } <nl> } <nl> <nl> / / Fall through to produce diagnostics . <nl> } <nl> <nl> - if ( getExpressionTooComplex ( viable ) ) { <nl> - ctx . Diags . diagnose ( expr - > getLoc ( ) , diag : : expression_too_complex ) <nl> - . highlight ( expr - > getSourceRange ( ) ) ; <nl> - return true ; <nl> - } <nl> + if ( getExpressionTooComplex ( viable ) ) <nl> + return SolutionResult : : forTooComplex ( ) ; <nl> <nl> - / / If all else fails , diagnose the failure by looking through the system ' s <nl> - / / constraints . <nl> - diagnoseFailureForExpr ( expr ) ; <nl> - return true ; <nl> + / / Could not produce a specific diagnostic ; punt to the client . <nl> + return SolutionResult : : forUndiagnosedError ( ) ; <nl> } <nl> <nl> static void diagnoseOperatorAmbiguity ( ConstraintSystem & cs , <nl> static void extendPreorderIndexMap ( <nl> expr - > walk ( traversal ) ; <nl> } <nl> <nl> - bool ConstraintSystem : : diagnoseAmbiguity ( Expr * expr , <nl> - ArrayRef < Solution > solutions ) { <nl> + bool ConstraintSystem : : diagnoseAmbiguity ( ArrayRef < Solution > solutions ) { <nl> / / Produce a diff of the solutions . <nl> SolutionDiff diff ( solutions ) ; <nl> <nl> mmm a / lib / Sema / ConstraintSystem . h <nl> ppp b / lib / Sema / ConstraintSystem . h <nl> class ConstraintSystem { <nl> / / / constraint system for further exploration . <nl> void applySolution ( const Solution & solution ) ; <nl> <nl> + / / FIXME : Allows the type checker to apply solutions . <nl> + friend class swift : : TypeChecker ; <nl> + <nl> / / / Emit the fixes computed as part of the solution , returning true if we were <nl> / / / able to emit an error message , or false if none of the fixits worked out . <nl> bool applySolutionFixes ( const Solution & solution ) ; <nl> class ConstraintSystem { <nl> ValueDecl * findResolvedMemberRef ( ConstraintLocator * locator ) ; <nl> <nl> / / / Try to salvage the constraint system by applying ( speculative ) <nl> - / / / fixes to the underlying expression . <nl> - / / / <nl> - / / / \ param viable the set of viable solutions produced by the initial <nl> - / / / solution attempt . <nl> - / / / <nl> - / / / \ param expr the expression we ' re trying to salvage . <nl> - / / / <nl> - / / / \ returns false if we were able to salvage the system , in which case <nl> - / / / \ c viable [ 0 ] contains the resulting solution . Otherwise , emits a <nl> - / / / diagnostic and returns true . <nl> - bool salvage ( SmallVectorImpl < Solution > & viable , Expr * expr ) ; <nl> + / / / fixes . <nl> + SolutionResult salvage ( ) ; <nl> <nl> / / / Mine the active and inactive constraints in the constraint <nl> / / / system to generate a plausible diagnosis of why the system could not be <nl> class ConstraintSystem { <nl> / / / emits an error message . <nl> void diagnoseFailureForExpr ( Expr * expr ) ; <nl> <nl> - bool diagnoseAmbiguity ( Expr * expr , ArrayRef < Solution > solutions ) ; <nl> + bool diagnoseAmbiguity ( ArrayRef < Solution > solutions ) ; <nl> bool diagnoseAmbiguityWithFixes ( ArrayRef < Solution > solutions ) ; <nl> <nl> / / / Give the deprecation warning for referring to a global function <nl> new file mode 100644 <nl> index 000000000000 . . 8e3085a3a69c <nl> mmm / dev / null <nl> ppp b / lib / Sema / SolutionResult . h <nl> <nl> + / / = = = mmm SolutionResult . h - Constraint System Solution mmmmmmmmm - * - C + + - * - = = = / / <nl> + / / <nl> + / / This source file is part of the Swift . org open source project <nl> + / / <nl> + / / Copyright ( c ) 2019 Apple Inc . and the Swift project authors <nl> + / / Licensed under Apache License v2 . 0 with Runtime Library Exception <nl> + / / <nl> + / / See https : / / swift . org / LICENSE . txt for license information <nl> + / / See https : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> + / / <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / <nl> + / / This file defines the SolutionResult class . <nl> + / / <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + # ifndef SWIFT_TYPECHECK_SOLUTION_RESULT_H <nl> + # define SWIFT_TYPECHECK_SOLUTION_RESULT_H <nl> + <nl> + # include " llvm / ADT / ArrayRef . h " <nl> + <nl> + namespace swift { <nl> + <nl> + using llvm : : ArrayRef ; <nl> + using llvm : : makeArrayRef ; <nl> + <nl> + namespace constraints { <nl> + <nl> + class Solution ; <nl> + <nl> + / / / Describes the result of solving a constraint system , after <nl> + / / / potentially taking various corrective actions . <nl> + class SolutionResult { <nl> + public : <nl> + enum Kind : unsigned char { <nl> + / / / The constraint system was successfully solved , and one can <nl> + / / / retrieve the resulting solution . <nl> + Success , <nl> + / / / The constraint system had multiple solutions , none of which <nl> + / / / was better than the others . <nl> + Ambiguous , <nl> + / / / The constraint system had no solution , and a diagnostic has <nl> + / / / already been emitted . <nl> + Error , <nl> + / / / The constraint system had no solution , but no diagnostic has <nl> + / / / been emitted yet . <nl> + UndiagnosedError , <nl> + / / / The constraint system was too complex to solve , but no <nl> + / / / diagnostic has been emitted yet . <nl> + TooComplex , <nl> + } ; <nl> + <nl> + private : <nl> + / / / The kind of solution result . <nl> + Kind kind ; <nl> + <nl> + / / / Whether the client has emitted a diagnostic . <nl> + unsigned emittedDiagnostic : 1 ; <nl> + <nl> + / / / The number of solutions owned by this result . <nl> + unsigned numSolutions = 0 ; <nl> + <nl> + / / / A pointer to the set of solutions , of which there are <nl> + / / / \ c numSolutions entries . <nl> + Solution * solutions = nullptr ; <nl> + <nl> + / / / General constructor for the named constructors . <nl> + SolutionResult ( Kind kind ) : kind ( kind ) { <nl> + emittedDiagnostic = false ; <nl> + } <nl> + <nl> + public : <nl> + SolutionResult ( const SolutionResult & other ) = delete ; <nl> + <nl> + SolutionResult ( SolutionResult & & other ) <nl> + : kind ( other . kind ) , numSolutions ( other . numSolutions ) , <nl> + solutions ( other . solutions ) { <nl> + emittedDiagnostic = false ; <nl> + other . kind = Error ; <nl> + other . numSolutions = 0 ; <nl> + other . solutions = nullptr ; <nl> + } <nl> + <nl> + SolutionResult & operator = ( const SolutionResult & other ) = delete ; <nl> + SolutionResult & operator = ( SolutionResult & & other ) = delete ; <nl> + <nl> + ~ SolutionResult ( ) ; <nl> + <nl> + / / / Produce a " solved " result , embedding the given solution . <nl> + static SolutionResult forSolved ( Solution & & solution ) ; <nl> + <nl> + / / / Produce an " ambiguous " result , providing the set of <nl> + / / / potential solutions . <nl> + static SolutionResult forAmbiguous ( MutableArrayRef < Solution > solutions ) ; <nl> + <nl> + / / / Produce a " too complex " failure , which was not yet been <nl> + / / / diagnosed . <nl> + static SolutionResult forTooComplex ( ) { <nl> + return SolutionResult ( TooComplex ) ; <nl> + } <nl> + <nl> + / / / Produce a failure that has already been diagnosed . <nl> + static SolutionResult forError ( ) { <nl> + return SolutionResult ( Error ) ; <nl> + } <nl> + <nl> + / / / Produce a failure that has not yet been diagnosed . <nl> + static SolutionResult forUndiagnosedError ( ) { <nl> + return SolutionResult ( UndiagnosedError ) ; <nl> + } <nl> + <nl> + Kind getKind ( ) const { return kind ; } <nl> + <nl> + / / / Retrieve the solution , where there is one . <nl> + const Solution & getSolution ( ) const ; <nl> + <nl> + / / / Retrieve the solution , where there is one . <nl> + Solution & & takeSolution ( ) & & ; <nl> + <nl> + / / / Retrieve the set of solutions when there is an ambiguity . <nl> + ArrayRef < Solution > getAmbiguousSolutions ( ) const ; <nl> + <nl> + / / / Whether this solution requires the client to produce a diagnostic . <nl> + bool requiresDiagnostic ( ) const { <nl> + switch ( kind ) { <nl> + case Success : <nl> + case Ambiguous : <nl> + case Error : <nl> + return false ; <nl> + <nl> + case UndiagnosedError : <nl> + case TooComplex : <nl> + return true ; <nl> + } <nl> + } <nl> + <nl> + / / / Note that the failure has been diagnosed . <nl> + void markAsDiagnosed ( ) { <nl> + emittedDiagnostic = true ; <nl> + } <nl> + } ; <nl> + <nl> + } } <nl> + <nl> + # endif / * SWIFT_TYPECHECK_SOLUTION_RESULT_H * / <nl> mmm a / lib / Sema / TypeCheckConstraints . cpp <nl> ppp b / lib / Sema / TypeCheckConstraints . cpp <nl> <nl> <nl> # include " ConstraintSystem . h " <nl> # include " MiscDiagnostics . h " <nl> + # include " SolutionResult . h " <nl> # include " TypeChecker . h " <nl> # include " TypeCheckType . h " <nl> # include " TypoCorrection . h " <nl> Type TypeChecker : : typeCheckExpressionImpl ( Expr * & expr , DeclContext * dc , <nl> if ( ! result ) <nl> return Type ( ) ; <nl> <nl> + / / Apply this solution to the constraint system . <nl> + cs . applySolution ( solution ) ; <nl> + <nl> / / Apply the solution to the expression . <nl> result = cs . applySolution ( <nl> solution , result , convertType . getType ( ) , <nl> bool TypeChecker : : convertToType ( Expr * & expr , Type type , DeclContext * dc , <nl> <nl> / / Attempt to solve the constraint system . <nl> SmallVector < Solution , 4 > viable ; <nl> - if ( ( cs . solve ( viable ) | | viable . size ( ) ! = 1 ) & & <nl> - cs . salvage ( viable , expr ) ) { <nl> - return true ; <nl> + if ( ( cs . solve ( viable ) | | viable . size ( ) ! = 1 ) ) { <nl> + / / Try to fix the system or provide a decent diagnostic . <nl> + auto salvagedResult = cs . salvage ( ) ; <nl> + switch ( salvagedResult . getKind ( ) ) { <nl> + case SolutionResult : : Kind : : Success : <nl> + viable . clear ( ) ; <nl> + viable . push_back ( std : : move ( salvagedResult ) . takeSolution ( ) ) ; <nl> + break ; <nl> + <nl> + case SolutionResult : : Kind : : Error : <nl> + case SolutionResult : : Kind : : Ambiguous : <nl> + return true ; <nl> + <nl> + case SolutionResult : : Kind : : UndiagnosedError : <nl> + cs . diagnoseFailureForExpr ( expr ) ; <nl> + salvagedResult . markAsDiagnosed ( ) ; <nl> + return true ; <nl> + <nl> + case SolutionResult : : Kind : : TooComplex : <nl> + Context . Diags . diagnose ( expr - > getLoc ( ) , diag : : expression_too_complex ) <nl> + . highlight ( expr - > getSourceRange ( ) ) ; <nl> + salvagedResult . markAsDiagnosed ( ) ; <nl> + return true ; <nl> + } <nl> } <nl> <nl> auto & solution = viable [ 0 ] ; <nl> mmm a / lib / Sema / TypeChecker . h <nl> ppp b / lib / Sema / TypeChecker . h <nl> namespace constraints { <nl> enum class SolutionKind : char ; <nl> class ConstraintSystem ; <nl> class Solution ; <nl> + class SolutionResult ; <nl> } <nl> <nl> / / / A mapping from substitutable types to the protocol - conformance <nl> | Merge pull request from DougGregor / cs - fewer - root - exprs | apple/swift | 6096b43957c841c8cbb0e5ea5b75575ed69e2265 | 2019-11-19T02:50:59Z |
mmm a / lib / SILOptimizer / Transforms / Outliner . cpp <nl> ppp b / lib / SILOptimizer / Transforms / Outliner . cpp <nl> BridgedArgument BridgedArgument : : match ( unsigned ArgIdx , SILValue Arg , <nl> Enum - > getOperand ( ) ! = BridgeCall | | ! BridgeCall - > hasOneUse ( ) ) <nl> return BridgedArgument ( ) ; <nl> <nl> + auto & selfArg = FullApplySite ( BridgeCall ) . getSelfArgumentOperand ( ) ; <nl> + auto selfConvention = <nl> + FullApplySite ( BridgeCall ) . getArgumentConvention ( selfArg ) ; <nl> + if ( selfConvention ! = SILArgumentConvention : : Direct_Guaranteed & & <nl> + selfConvention ! = SILArgumentConvention : : Direct_Owned ) <nl> + return BridgedArgument ( ) ; <nl> + <nl> auto BridgedValue = BridgeCall - > getArgument ( 0 ) ; <nl> auto Next = std : : next ( SILBasicBlock : : iterator ( Enum ) ) ; <nl> if ( Next = = Enum - > getParent ( ) - > end ( ) ) <nl> mmm a / test / SILOptimizer / outliner . swift <nl> ppp b / test / SILOptimizer / outliner . swift <nl> public class Foo : NSObject { <nl> return true <nl> } <nl> } <nl> + <nl> + public func testCalendar ( ) { <nl> + let formatter = DateFormatter ( ) <nl> + formatter . calendar = Calendar ( identifier : . gregorian ) <nl> + } <nl> | Outliner : Make sure that the argument convention is guaranteed or owned | apple/swift | 97d69ab57b8da9dc23ccdcedf861e0036740ea62 | 2019-12-09T20:39:17Z |
mmm a / include / grpcpp / impl / codegen / completion_queue . h <nl> ppp b / include / grpcpp / impl / codegen / completion_queue . h <nl> class CompletionQueue : private GrpcLibraryCodegen { <nl> / / / <nl> / / / \ return true if got an event , false if the queue is fully drained and <nl> / / / shut down . <nl> - bool Next ( void * * tag , bool * ok ) { <nl> + virtual bool Next ( void * * tag , bool * ok ) { <nl> return ( AsyncNextInternal ( tag , ok , <nl> g_core_codegen_interface - > gpr_inf_future ( <nl> GPR_CLOCK_REALTIME ) ) ! = SHUTDOWN ) ; <nl> class ServerCompletionQueue : public CompletionQueue { <nl> public : <nl> bool IsFrequentlyPolled ( ) { return polling_type_ ! = GRPC_CQ_NON_LISTENING ; } <nl> <nl> - private : <nl> - grpc_cq_polling_type polling_type_ ; <nl> - friend class ServerBuilder ; <nl> + protected : <nl> / / / \ param is_frequently_polled Informs the GRPC library about whether the <nl> / / / server completion queue would be actively polled ( by calling Next ( ) or <nl> / / / AsyncNext ( ) ) . By default all server completion queues are assumed to be <nl> class ServerCompletionQueue : public CompletionQueue { <nl> : CompletionQueue ( grpc_completion_queue_attributes { <nl> GRPC_CQ_CURRENT_VERSION , GRPC_CQ_NEXT , polling_type } ) , <nl> polling_type_ ( polling_type ) { } <nl> + <nl> + private : <nl> + grpc_cq_polling_type polling_type_ ; <nl> + friend class ServerBuilder ; <nl> } ; <nl> <nl> } / / namespace grpc <nl> mmm a / include / grpcpp / server . h <nl> ppp b / include / grpcpp / server . h <nl> class ServerInitializer ; <nl> / / / <nl> / / / Use a \ a grpc : : ServerBuilder to create , configure , and start <nl> / / / \ a Server instances . <nl> - class Server final : public ServerInterface , private GrpcLibraryCodegen { <nl> + class Server : public ServerInterface , private GrpcLibraryCodegen { <nl> public : <nl> ~ Server ( ) ; <nl> <nl> class Server final : public ServerInterface , private GrpcLibraryCodegen { <nl> / / / Establish a channel for in - process communication <nl> std : : shared_ptr < Channel > InProcessChannel ( const ChannelArguments & args ) ; <nl> <nl> - private : <nl> - friend class AsyncGenericService ; <nl> - friend class ServerBuilder ; <nl> - friend class ServerInitializer ; <nl> - <nl> - class SyncRequest ; <nl> - class AsyncRequest ; <nl> - class ShutdownRequest ; <nl> - <nl> - / / / SyncRequestThreadManager is an implementation of ThreadManager . This class <nl> - / / / is responsible for polling for incoming RPCs and calling the RPC handlers . <nl> - / / / This is only used in case of a Sync server ( i . e a server exposing a sync <nl> - / / / interface ) <nl> - class SyncRequestThreadManager ; <nl> + protected : <nl> + / / / Register a service . This call does not take ownership of the service . <nl> + / / / The service must exist for the lifetime of the Server instance . <nl> + bool RegisterService ( const grpc : : string * host , Service * service ) override ; <nl> <nl> - class UnimplementedAsyncRequestContext ; <nl> - class UnimplementedAsyncRequest ; <nl> - class UnimplementedAsyncResponse ; <nl> + / / / Try binding the server to the given \ a addr endpoint <nl> + / / / ( port , and optionally including IP address to bind to ) . <nl> + / / / <nl> + / / / It can be invoked multiple times . Should be used before <nl> + / / / starting the server . <nl> + / / / <nl> + / / / \ param addr The address to try to bind to the server ( eg , localhost : 1234 , <nl> + / / / 192 . 168 . 1 . 1 : 31416 , [ : : 1 ] : 27182 , etc . ) . <nl> + / / / \ param creds The credentials associated with the server . <nl> + / / / <nl> + / / / \ return bound port number on success , 0 on failure . <nl> + / / / <nl> + / / / \ warning It is an error to call this method on an already started server . <nl> + int AddListeningPort ( const grpc : : string & addr , <nl> + ServerCredentials * creds ) override ; <nl> <nl> / / / Server constructors . To be used by \ a ServerBuilder only . <nl> / / / <nl> class Server final : public ServerInterface , private GrpcLibraryCodegen { <nl> sync_server_cqs , <nl> int min_pollers , int max_pollers , int sync_cq_timeout_msec ) ; <nl> <nl> - / / / Register a service . This call does not take ownership of the service . <nl> - / / / The service must exist for the lifetime of the Server instance . <nl> - bool RegisterService ( const grpc : : string * host , Service * service ) override ; <nl> - <nl> - / / / Register a generic service . This call does not take ownership of the <nl> - / / / service . The service must exist for the lifetime of the Server instance . <nl> - void RegisterAsyncGenericService ( AsyncGenericService * service ) override ; <nl> - <nl> - / / / Try binding the server to the given \ a addr endpoint <nl> - / / / ( port , and optionally including IP address to bind to ) . <nl> - / / / <nl> - / / / It can be invoked multiple times . Should be used before <nl> - / / / starting the server . <nl> - / / / <nl> - / / / \ param addr The address to try to bind to the server ( eg , localhost : 1234 , <nl> - / / / 192 . 168 . 1 . 1 : 31416 , [ : : 1 ] : 27182 , etc . ) . <nl> - / / / \ param creds The credentials associated with the server . <nl> - / / / <nl> - / / / \ return bound port number on success , 0 on failure . <nl> - / / / <nl> - / / / \ warning It is an error to call this method on an already started server . <nl> - int AddListeningPort ( const grpc : : string & addr , <nl> - ServerCredentials * creds ) override ; <nl> - <nl> / / / Start the server . <nl> / / / <nl> / / / \ param cqs Completion queues for handling asynchronous services . The <nl> class Server final : public ServerInterface , private GrpcLibraryCodegen { <nl> / / / \ param num_cqs How many completion queues does \ a cqs hold . <nl> void Start ( ServerCompletionQueue * * cqs , size_t num_cqs ) override ; <nl> <nl> + / / Pointer to the wrapped grpc_server . <nl> + grpc_server * server_ ; <nl> + <nl> + / / Server status <nl> + bool started_ ; <nl> + <nl> + private : <nl> + friend class AsyncGenericService ; <nl> + friend class ServerBuilder ; <nl> + friend class ServerInitializer ; <nl> + <nl> + class SyncRequest ; <nl> + class AsyncRequest ; <nl> + class ShutdownRequest ; <nl> + <nl> + / / / SyncRequestThreadManager is an implementation of ThreadManager . This class <nl> + / / / is responsible for polling for incoming RPCs and calling the RPC handlers . <nl> + / / / This is only used in case of a Sync server ( i . e a server exposing a sync <nl> + / / / interface ) <nl> + class SyncRequestThreadManager ; <nl> + <nl> + class UnimplementedAsyncRequestContext ; <nl> + class UnimplementedAsyncRequest ; <nl> + class UnimplementedAsyncResponse ; <nl> + <nl> + / / / Register a generic service . This call does not take ownership of the <nl> + / / / service . The service must exist for the lifetime of the Server instance . <nl> + void RegisterAsyncGenericService ( AsyncGenericService * service ) override ; <nl> + <nl> void PerformOpsOnCall ( internal : : CallOpSetInterface * ops , <nl> internal : : Call * call ) override ; <nl> <nl> class Server final : public ServerInterface , private GrpcLibraryCodegen { <nl> / / / the \ a sync_server_cqs ) <nl> std : : vector < std : : unique_ptr < SyncRequestThreadManager > > sync_req_mgrs_ ; <nl> <nl> - / / Sever status <nl> + / / Server status <nl> std : : mutex mu_ ; <nl> - bool started_ ; <nl> bool shutdown_ ; <nl> bool shutdown_notified_ ; / / Was notify called on the shutdown_cv_ <nl> <nl> class Server final : public ServerInterface , private GrpcLibraryCodegen { <nl> std : : vector < grpc : : string > services_ ; <nl> bool has_generic_service_ ; <nl> <nl> - / / Pointer to the wrapped grpc_server . <nl> - grpc_server * server_ ; <nl> - <nl> std : : unique_ptr < ServerInitializer > server_initializer_ ; <nl> <nl> std : : unique_ptr < HealthCheckServiceInterface > health_check_service_ ; <nl> mmm a / include / grpcpp / server_builder . h <nl> ppp b / include / grpcpp / server_builder . h <nl> class ServerBuilderPluginTest ; <nl> class ServerBuilder { <nl> public : <nl> ServerBuilder ( ) ; <nl> - ~ ServerBuilder ( ) ; <nl> + virtual ~ ServerBuilder ( ) ; <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / Primary API ' s <nl> class ServerBuilder { <nl> / / / traffic ( via AddListeningPort ) <nl> / / / 3 . [ for async api only ] completion queues have been added via <nl> / / / AddCompletionQueue <nl> - std : : unique_ptr < Server > BuildAndStart ( ) ; <nl> + virtual std : : unique_ptr < Server > BuildAndStart ( ) ; <nl> <nl> / / / Register a service . This call does not take ownership of the service . <nl> / / / The service must exist for the lifetime of the \ a Server instance returned <nl> class ServerBuilder { <nl> / / / doc / workarounds . md . <nl> ServerBuilder & EnableWorkaround ( grpc_workaround_list id ) ; <nl> <nl> - private : <nl> - friend class : : grpc : : testing : : ServerBuilderPluginTest ; <nl> - <nl> + protected : <nl> struct Port { <nl> grpc : : string addr ; <nl> std : : shared_ptr < ServerCredentials > creds ; <nl> int * selected_port ; <nl> } ; <nl> <nl> + typedef std : : unique_ptr < grpc : : string > HostString ; <nl> + struct NamedService { <nl> + explicit NamedService ( Service * s ) : service ( s ) { } <nl> + NamedService ( const grpc : : string & h , Service * s ) <nl> + : host ( new grpc : : string ( h ) ) , service ( s ) { } <nl> + HostString host ; <nl> + Service * service ; <nl> + } ; <nl> + <nl> + std : : vector < std : : unique_ptr < ServerBuilderOption > > options_ ; <nl> + std : : vector < std : : unique_ptr < NamedService > > services_ ; <nl> + std : : vector < Port > ports_ ; <nl> + <nl> + private : <nl> + friend class : : grpc : : testing : : ServerBuilderPluginTest ; <nl> + <nl> struct SyncServerSettings { <nl> SyncServerSettings ( ) <nl> : num_cqs ( 1 ) , min_pollers ( 1 ) , max_pollers ( 2 ) , cq_timeout_msec ( 10000 ) { } <nl> class ServerBuilder { <nl> int cq_timeout_msec ; <nl> } ; <nl> <nl> - typedef std : : unique_ptr < grpc : : string > HostString ; <nl> - struct NamedService { <nl> - explicit NamedService ( Service * s ) : service ( s ) { } <nl> - NamedService ( const grpc : : string & h , Service * s ) <nl> - : host ( new grpc : : string ( h ) ) , service ( s ) { } <nl> - HostString host ; <nl> - Service * service ; <nl> - } ; <nl> - <nl> int max_receive_message_size_ ; <nl> int max_send_message_size_ ; <nl> - std : : vector < std : : unique_ptr < ServerBuilderOption > > options_ ; <nl> - std : : vector < std : : unique_ptr < NamedService > > services_ ; <nl> - std : : vector < Port > ports_ ; <nl> <nl> SyncServerSettings sync_server_settings_ ; <nl> <nl> mmm a / src / cpp / server / server_cc . cc <nl> ppp b / src / cpp / server / server_cc . cc <nl> Server : : Server ( <nl> std : : shared_ptr < std : : vector < std : : unique_ptr < ServerCompletionQueue > > > <nl> sync_server_cqs , <nl> int min_pollers , int max_pollers , int sync_cq_timeout_msec ) <nl> - : max_receive_message_size_ ( max_receive_message_size ) , <nl> - sync_server_cqs_ ( sync_server_cqs ) , <nl> + : server_ ( nullptr ) , <nl> started_ ( false ) , <nl> + max_receive_message_size_ ( max_receive_message_size ) , <nl> + sync_server_cqs_ ( sync_server_cqs ) , <nl> shutdown_ ( false ) , <nl> shutdown_notified_ ( false ) , <nl> has_generic_service_ ( false ) , <nl> - server_ ( nullptr ) , <nl> server_initializer_ ( new ServerInitializer ( this ) ) , <nl> health_check_service_disabled_ ( false ) { <nl> g_gli_initializer . summon ( ) ; <nl> Server : : Server ( <nl> global_callbacks_ = g_callbacks ; <nl> global_callbacks_ - > UpdateArguments ( args ) ; <nl> <nl> - for ( auto it = sync_server_cqs_ - > begin ( ) ; it ! = sync_server_cqs_ - > end ( ) ; <nl> - it + + ) { <nl> - sync_req_mgrs_ . emplace_back ( new SyncRequestThreadManager ( <nl> - this , ( * it ) . get ( ) , global_callbacks_ , min_pollers , max_pollers , <nl> - sync_cq_timeout_msec ) ) ; <nl> + if ( sync_server_cqs_ ! = nullptr ) { <nl> + for ( auto it = sync_server_cqs_ - > begin ( ) ; it ! = sync_server_cqs_ - > end ( ) ; <nl> + it + + ) { <nl> + sync_req_mgrs_ . emplace_back ( new SyncRequestThreadManager ( <nl> + this , ( * it ) . get ( ) , global_callbacks_ , min_pollers , max_pollers , <nl> + sync_cq_timeout_msec ) ) ; <nl> + } <nl> } <nl> <nl> grpc_channel_args channel_args ; <nl> void Server : : Start ( ServerCompletionQueue * * cqs , size_t num_cqs ) { <nl> / / explicit one . <nl> if ( health_check_service_ = = nullptr & & ! health_check_service_disabled_ & & <nl> DefaultHealthCheckServiceEnabled ( ) ) { <nl> - if ( sync_server_cqs_ - > empty ( ) ) { <nl> + if ( sync_server_cqs_ = = nullptr | | sync_server_cqs_ - > empty ( ) ) { <nl> gpr_log ( GPR_INFO , <nl> " Default health check service disabled at async - only server . " ) ; <nl> } else { <nl> | Remove " final " keyword and make methods protected . | grpc/grpc | 8065000697a6225d76ebbcc8b7eca9f01a9be474 | 2018-02-23T22:51:46Z |
mmm a / validation - test / stdlib / ArrayBridging . swift <nl> ppp b / validation - test / stdlib / ArrayBridging . swift <nl> <nl> / / REQUIRES : objc_interop <nl> / / REQUIRES : executable_test <nl> <nl> - / / rdar : / / 21204610 This test is not really unsupported but rather just locking <nl> - / / up so we don ' t want to xfail it and then wait forever for it to finish . <nl> - / / UNSUPPORTED : optimized_stdlib_armv7 <nl> - <nl> import StdlibUnittest <nl> import Foundation <nl> import SlurpFastEnumeration <nl> | This test no longer fails | apple/swift | 6c936235d419aa6109c47fdabc3a545f9ae76f2d | 2015-06-02T20:58:14Z |
mmm a / modules / mono / editor / csharp_project . cpp <nl> ppp b / modules / mono / editor / csharp_project . cpp <nl> Error generate_scripts_metadata ( const String & p_project_path , const String & p_ou <nl> if ( new_dict . size ( ) ) { <nl> String json = JSON : : print ( new_dict , " " , false ) ; <nl> <nl> + String base_dir = p_output_path . get_base_dir ( ) ; <nl> + <nl> + if ( ! DirAccess : : exists ( base_dir ) ) { <nl> + DirAccessRef da = DirAccess : : create ( DirAccess : : ACCESS_RESOURCES ) ; <nl> + <nl> + Error err = da - > make_dir_recursive ( base_dir ) ; <nl> + ERR_FAIL_COND_V ( err ! = OK , ERR_CANT_CREATE ) ; <nl> + } <nl> + <nl> Error ferr ; <nl> FileAccess * f = FileAccess : : open ( p_output_path , FileAccess : : WRITE , & ferr ) ; <nl> ERR_EXPLAIN ( " Cannot open file for writing : " + p_output_path ) ; <nl> | Fix C # script metadata creation error due to missing directory | godotengine/godot | 0ac5be8368e6d7d0fcb8708426b785471e4a3284 | 2019-01-20T23:57:03Z |
mmm a / src / buffer_cache / blob . hpp <nl> ppp b / src / buffer_cache / blob . hpp <nl> bool deep_fsck ( block_getter_t * getter , block_size_t bs , const char * ref , int max <nl> <nl> class blob_t { <nl> public : <nl> - / / Used to iterate over an exposed region of a blob <nl> - class iterator { <nl> - public : <nl> - iterator ( boost : : shared_ptr < buffer_group_t > , boost : : shared_ptr < blob_acq_t > ) ; <nl> - iterator ( const iterator & ) ; <nl> - char & operator * ( ) ; <nl> - void operator + + ( ) ; <nl> - bool at_end ( ) ; <nl> - <nl> - private : <nl> - void increment_buffer ( ) ; <nl> - <nl> - boost : : shared_ptr < buffer_group_t > bg ; <nl> - boost : : shared_ptr < blob_acq_t > acq ; <nl> - <nl> - buffer_group_t : : buffer_t current_buffer ; <nl> - unsigned cur_buffer_index ; <nl> - unsigned next_buffer ; <nl> - } ; <nl> - <nl> / / maxreflen must be less than the block size minus 4 bytes . <nl> blob_t ( char * ref , int maxreflen ) ; <nl> <nl> class blob_t { <nl> void expose_region ( transaction_t * txn , access_t mode , int64_t offset , int64_t size , buffer_group_t * buffer_group_out , blob_acq_t * acq_group_out ) ; <nl> void expose_all ( transaction_t * txn , access_t mode , buffer_group_t * buffer_group_out , blob_acq_t * acq_group_out ) ; <nl> <nl> - <nl> - / / Alternate interface that returns an iterator to the exposed region . <nl> - iterator expose_region ( transaction_t * txn , access_t mode , int64_t offset , int64_t size ) ; <nl> - <nl> / / Appends size bytes of garbage data to the blob . <nl> void append_region ( transaction_t * txn , int64_t size ) ; <nl> <nl> | Removed unimplemented unused blob_t : : iterator nonsense . | rethinkdb/rethinkdb | b2fd1075cf6a9fd92d184b73197c58a82c057be9 | 2012-04-23T19:01:09Z |
mmm a / db / db . cpp <nl> ppp b / db / db . cpp <nl> namespace mongo { <nl> void webServerThread ( ) ; <nl> <nl> void listen ( int port ) { <nl> - log ( ) < < mongodVersion ( ) < < endl ; <nl> - printGitVersion ( ) ; <nl> - printSysInfo ( ) ; <nl> / / testTheDb ( ) ; <nl> log ( ) < < " waiting for connections on port " < < port < < endl ; <nl> OurListener l ( bind_ip , port ) ; <nl> namespace mongo { <nl> < < " master = " < < replSettings . master < < " slave = " < < ( int ) replSettings . slave < < " " < < ( is32bit ? " 32 " : " 64 " ) < < " - bit " < < endl ; <nl> DEV log ( ) < < " FULL DEBUG ENABLED " < < endl ; <nl> show_32_warning ( ) ; <nl> + log ( ) < < mongodVersion ( ) < < endl ; <nl> + printGitVersion ( ) ; <nl> + printSysInfo ( ) ; <nl> <nl> { <nl> stringstream ss ; <nl> | print version info sooner | mongodb/mongo | 8d7a7320cbec9b926e9704319b603b146e3e2aca | 2010-05-04T13:58:55Z |
mmm a / ISSUE_TEMPLATE . md <nl> ppp b / ISSUE_TEMPLATE . md <nl> If you open a GitHub issue , here is our policy : <nl> # # # System information <nl> - * * Have I written custom code ( as opposed to using a stock example script provided in TensorFlow ) * * : <nl> - * * OS Platform and Distribution ( e . g . , Linux Ubuntu 16 . 04 ) * * : <nl> + - * * Mobile device ( e . g . iPhone 8 , Pixel 2 , Samsung Galaxy ) if the issue happens on mobile device * * : <nl> - * * TensorFlow installed from ( source or binary ) * * : <nl> - * * TensorFlow version ( use command below ) * * : <nl> - - * * Python version * * : <nl> + - * * Python version * * : <nl> - * * Bazel version ( if compiling from source ) * * : <nl> - * * GCC / Compiler version ( if compiling from source ) * * : <nl> - * * CUDA / cuDNN version * * : <nl> | Add mobile device field to the issue template . | tensorflow/tensorflow | df7cc25691312ec27d1b38c3cbf566c2e00aa92b | 2018-07-18T18:03:37Z |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.