diff
stringlengths
41
2.03M
msg
stringlengths
1
1.5k
repo
stringlengths
5
40
sha
stringlengths
40
40
time
stringlengths
20
20
mmm a / base / glibc - compatibility / CMakeLists . txt <nl> ppp b / base / glibc - compatibility / CMakeLists . txt <nl> if ( GLIBC_COMPATIBILITY ) <nl> <nl> if ( COMPILER_CLANG ) <nl> target_compile_options ( glibc - compatibility PRIVATE - Wno - unused - command - line - argument ) <nl> - # disable lto for this library , because for some reason clang - 11 fails <nl> - # to link llvm with it . <nl> - target_compile_options ( glibc - compatibility PRIVATE - fno - lto ) <nl> elseif ( COMPILER_GCC ) <nl> target_compile_options ( glibc - compatibility PRIVATE - Wno - unused - but - set - variable ) <nl> endif ( ) <nl> mmm a / tests / ci / ci_config . json <nl> ppp b / tests / ci / ci_config . json <nl> <nl> " with_coverage " : false <nl> } , <nl> { <nl> - " compiler " : " clang - 11 " , <nl> + " compiler " : " clang - 10 " , <nl> " build - type " : " " , <nl> " sanitizer " : " " , <nl> " package - type " : " deb " , <nl> <nl> " with_coverage " : false <nl> } , <nl> { <nl> - " compiler " : " clang - 11 " , <nl> + " compiler " : " clang - 10 " , <nl> " build - type " : " " , <nl> " sanitizer " : " " , <nl> " package - type " : " binary " , <nl>
Remove clang - 11 build for release
ClickHouse/ClickHouse
a12521dd4d699b06244eec159b2a0b3cdf3450e8
2020-09-16T11:27:29Z
mmm a / ports / mpfr / CONTROL <nl> ppp b / ports / mpfr / CONTROL <nl> <nl> Source : mpfr <nl> - Version : 3 . 1 . 6 - 3 <nl> + Version : 4 . 0 . 1 <nl> Description : The MPFR library is a C library for multiple - precision floating - point computations with correct rounding <nl> Build - Depends : mpir <nl>
[ mpfr ] fix version in CONTROL file
microsoft/vcpkg
f6db046bed66288d5143247244ad1a59fcf1a495
2018-12-20T00:09:39Z
mmm a / tests / embind / imvu_test_adapter . js <nl> ppp b / tests / embind / imvu_test_adapter . js <nl> <nl> / * The embind test suite ( embind . test . js ) is configured to be runnable in two different testing engines : <nl> - The Emscripten python test runner ( open - source in emscripten repository ) and <nl> - - The IMVU test runner ( closed - source in IMVU repository ) <nl> + - The IMVU test runner ( open - source via imvujs , available at https : / / github . com / imvu / imvujs ) <nl> <nl> Embind ( and its tests ) were originally developed in IMVU repository , which is the reason for two testing architectures . <nl> This adapter file is used when the embind tests are run as part of the Emscripten test runner , to provide the necessary glue code to adapt the tests to Emscripten runner . <nl> function module ( ignore , func ) { <nl> } <nl> return false ; <nl> } catch ( e ) { <nl> + console . error ( e . stack ) ; <nl> console . error ( ' error : ' , e ) ; <nl> return { stack : e . stack , e : e } ; <nl> } <nl> function module ( ignore , func ) { <nl> * / <nl> } ; <nl> <nl> - / / var assert = { <nl> + var assert = { } ; <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / GENERAL STATUS <nl> function module ( ignore , func ) { <nl> } <nl> } <nl> <nl> + ( function ( ) { <nl> var g = ' undefined ' = = = typeof window ? global : window ; <nl> <nl> / / synonyms <nl> function module ( ignore , func ) { <nl> g . requestAnimationFrame = function ( ) { <nl> throw new AssertionError ( " Don ' t call requestAnimationFrame in tests . Use fakes . " ) ; <nl> } ; <nl> - / / } ) ( ) ; <nl> + } ) ( ) ; <nl> <nl> / / Emscripten runner starts all tests from this function . <nl> / / IMVU runner uses a separate runner & reporting mechanism . <nl> new file mode 100644 <nl> index 00000000000 . . e5a8207c22d <nl> mmm / dev / null <nl> ppp b / tests / embind / test . post . js <nl> <nl> + return Module ; <nl> + } ) ( ) ; <nl> new file mode 100644 <nl> index 00000000000 . . f0fb17b5cd0 <nl> mmm / dev / null <nl> ppp b / tests / embind / test . pre . js <nl> @ @ - 0 , 0 + 1 @ @ <nl> + ( function ( ) { return this ; } ) ( ) [ ' Module ' ] = ( function ( ) { <nl> mmm a / tests / test_other . py <nl> ppp b / tests / test_other . py <nl> def test_embind ( self ) : <nl> print args , fail <nl> self . clear ( ) <nl> try_delete ( self . in_dir ( ' a . out . js ' ) ) <nl> - Popen ( [ PYTHON , EMCC , path_from_root ( ' tests ' , ' embind ' , ' embind_test . cpp ' ) , ' - - post - js ' , path_from_root ( ' tests ' , ' embind ' , ' underscore - 1 . 4 . 2 . js ' ) , ' - - post - js ' , path_from_root ( ' tests ' , ' embind ' , ' imvu_test_adapter . js ' ) , ' - - post - js ' , path_from_root ( ' tests ' , ' embind ' , ' embind . test . js ' ) ] + args , stderr = PIPE if fail else None , env = environ ) . communicate ( ) <nl> + <nl> + testFiles = [ <nl> + path_from_root ( ' tests ' , ' embind ' , ' underscore - 1 . 4 . 2 . js ' ) , <nl> + path_from_root ( ' tests ' , ' embind ' , ' imvu_test_adapter . js ' ) , <nl> + path_from_root ( ' tests ' , ' embind ' , ' embind . test . js ' ) , <nl> + ] <nl> + <nl> + Popen ( <nl> + [ PYTHON , <nl> + EMCC , <nl> + path_from_root ( ' tests ' , ' embind ' , ' embind_test . cpp ' ) , <nl> + ' - - pre - js ' , path_from_root ( ' tests ' , ' embind ' , ' test . pre . js ' ) , <nl> + ' - - post - js ' , path_from_root ( ' tests ' , ' embind ' , ' test . post . js ' ) , <nl> + ] + args , <nl> + stderr = PIPE if fail else None , <nl> + env = environ ) . communicate ( ) <nl> + <nl> assert os . path . exists ( self . in_dir ( ' a . out . js ' ) ) = = ( not fail ) <nl> if not fail : <nl> + with open ( self . in_dir ( ' a . out . js ' ) , ' ab ' ) as f : <nl> + for tf in testFiles : <nl> + f . write ( open ( tf , ' rb ' ) . read ( ) ) <nl> + <nl> output = run_js ( self . in_dir ( ' a . out . js ' ) , stdout = PIPE , stderr = PIPE , full_output = True , assert_returncode = 0 ) <nl> assert " FAIL " not in output , output <nl> <nl>
make other . test_embind pass again by appending the tests to the closure - compiled file . this required exporting Module in a nontrivial way , we can fix that in the future .
emscripten-core/emscripten
326d702381092511cc41b23bdfe3bfe514134583
2015-01-08T01:00:21Z
mmm a / src / Common / FileChecker . cpp <nl> ppp b / src / Common / FileChecker . cpp <nl> void FileChecker : : setEmpty ( const String & full_file_path ) <nl> map [ fileName ( full_file_path ) ] = 0 ; <nl> } <nl> <nl> + FileChecker : : Map FileChecker : : getFileSizes ( ) const <nl> + { <nl> + return map ; <nl> + } <nl> + <nl> CheckResults FileChecker : : check ( ) const <nl> { <nl> / / Read the files again every time you call ` check ` - so as not to violate the constancy . <nl> mmm a / src / Common / FileChecker . h <nl> ppp b / src / Common / FileChecker . h <nl> class FileChecker <nl> / / / The purpose of this function is to rollback a group of unfinished writes . <nl> void repair ( ) ; <nl> <nl> - private : <nl> / / / File name - > size . <nl> using Map = std : : map < String , UInt64 > ; <nl> <nl> + Map getFileSizes ( ) const ; <nl> + <nl> + private : <nl> void initialize ( ) ; <nl> void updateImpl ( const String & file_path ) ; <nl> void load ( Map & local_map , const String & path ) const ; <nl> mmm a / src / Storages / StorageFile . cpp <nl> ppp b / src / Storages / StorageFile . cpp <nl> namespace ErrorCodes <nl> extern const int UNKNOWN_IDENTIFIER ; <nl> extern const int INCORRECT_FILE_NAME ; <nl> extern const int FILE_DOESNT_EXIST ; <nl> + extern const int TIMEOUT_EXCEEDED ; <nl> } <nl> <nl> namespace <nl> StorageFile : : StorageFile ( CommonArguments args ) <nl> setInMemoryMetadata ( storage_metadata ) ; <nl> } <nl> <nl> + <nl> + static std : : chrono : : seconds getLockTimeout ( const Context & context ) <nl> + { <nl> + const Settings & settings = context . getSettingsRef ( ) ; <nl> + Int64 lock_timeout = settings . lock_acquire_timeout . totalSeconds ( ) ; <nl> + if ( settings . max_execution_time . totalSeconds ( ) ! = 0 & & settings . max_execution_time . totalSeconds ( ) < lock_timeout ) <nl> + lock_timeout = settings . max_execution_time . totalSeconds ( ) ; <nl> + return std : : chrono : : seconds { lock_timeout } ; <nl> + } <nl> + <nl> + <nl> class StorageFileSource : public SourceWithProgress <nl> { <nl> public : <nl> class StorageFileSource : public SourceWithProgress <nl> { <nl> if ( storage - > use_table_fd ) <nl> { <nl> - unique_lock = std : : unique_lock ( storage - > rwlock ) ; <nl> + unique_lock = std : : unique_lock ( storage - > rwlock , getLockTimeout ( context ) ) ; <nl> + if ( ! unique_lock ) <nl> + throw Exception ( " Lock timeout exceeded " , ErrorCodes : : TIMEOUT_EXCEEDED ) ; <nl> <nl> / / / We could use common ReadBuffer and WriteBuffer in storage to leverage cache <nl> / / / and add ability to seek unseekable files , but cache sync isn ' t supported . <nl> class StorageFileSource : public SourceWithProgress <nl> } <nl> else <nl> { <nl> - shared_lock = std : : shared_lock ( storage - > rwlock ) ; <nl> + shared_lock = std : : shared_lock ( storage - > rwlock , getLockTimeout ( context ) ) ; <nl> + if ( ! shared_lock ) <nl> + throw Exception ( " Lock timeout exceeded " , ErrorCodes : : TIMEOUT_EXCEEDED ) ; <nl> } <nl> } <nl> <nl> class StorageFileSource : public SourceWithProgress <nl> <nl> bool finished_generate = false ; <nl> <nl> - std : : shared_lock < std : : shared_mutex > shared_lock ; <nl> - std : : unique_lock < std : : shared_mutex > unique_lock ; <nl> + std : : shared_lock < std : : shared_timed_mutex > shared_lock ; <nl> + std : : unique_lock < std : : shared_timed_mutex > unique_lock ; <nl> } ; <nl> <nl> <nl> Pipe StorageFile : : read ( <nl> <nl> for ( size_t i = 0 ; i < num_streams ; + + i ) <nl> pipes . emplace_back ( std : : make_shared < StorageFileSource > ( <nl> - this_ptr , metadata_snapshot , context , max_block_size , files_info , metadata_snapshot - > getColumns ( ) . getDefaults ( ) ) ) ; <nl> + this_ptr , metadata_snapshot , context , max_block_size , files_info , metadata_snapshot - > getColumns ( ) . getDefaults ( ) ) ) ; <nl> <nl> return Pipe : : unitePipes ( std : : move ( pipes ) ) ; <nl> } <nl> class StorageFileBlockOutputStream : public IBlockOutputStream <nl> explicit StorageFileBlockOutputStream ( <nl> StorageFile & storage_ , <nl> const StorageMetadataPtr & metadata_snapshot_ , <nl> + std : : unique_lock < std : : shared_timed_mutex > & & lock_ , <nl> const CompressionMethod compression_method , <nl> const Context & context ) <nl> : storage ( storage_ ) <nl> , metadata_snapshot ( metadata_snapshot_ ) <nl> - , lock ( storage . rwlock ) <nl> + , lock ( std : : move ( lock_ ) ) <nl> { <nl> + if ( ! lock ) <nl> + throw Exception ( " Lock timeout exceeded " , ErrorCodes : : TIMEOUT_EXCEEDED ) ; <nl> + <nl> std : : unique_ptr < WriteBufferFromFileDescriptor > naked_buffer = nullptr ; <nl> if ( storage . use_table_fd ) <nl> { <nl> class StorageFileBlockOutputStream : public IBlockOutputStream <nl> private : <nl> StorageFile & storage ; <nl> StorageMetadataPtr metadata_snapshot ; <nl> - std : : unique_lock < std : : shared_mutex > lock ; <nl> + std : : unique_lock < std : : shared_timed_mutex > lock ; <nl> std : : unique_ptr < WriteBuffer > write_buf ; <nl> BlockOutputStreamPtr writer ; <nl> bool prefix_written { false } ; <nl> BlockOutputStreamPtr StorageFile : : write ( <nl> if ( ! paths . empty ( ) ) <nl> path = paths [ 0 ] ; <nl> <nl> - return std : : make_shared < StorageFileBlockOutputStream > ( * this , metadata_snapshot , <nl> + return std : : make_shared < StorageFileBlockOutputStream > ( * this , metadata_snapshot , std : : unique_lock { rwlock , getLockTimeout ( context ) } , <nl> chooseCompressionMethod ( path , compression_method ) , context ) ; <nl> } <nl> <nl> void StorageFile : : rename ( const String & new_path_to_table_data , const StorageID <nl> if ( path_new = = paths [ 0 ] ) <nl> return ; <nl> <nl> - std : : unique_lock < std : : shared_mutex > lock ( rwlock ) ; <nl> - <nl> Poco : : File ( Poco : : Path ( path_new ) . parent ( ) ) . createDirectories ( ) ; <nl> Poco : : File ( paths [ 0 ] ) . renameTo ( path_new ) ; <nl> <nl> void StorageFile : : truncate ( <nl> if ( paths . size ( ) ! = 1 ) <nl> throw Exception ( " Can ' t truncate table ' " + getStorageID ( ) . getNameForLogs ( ) + " ' in readonly mode " , ErrorCodes : : DATABASE_ACCESS_DENIED ) ; <nl> <nl> - std : : unique_lock < std : : shared_mutex > lock ( rwlock ) ; <nl> - <nl> if ( use_table_fd ) <nl> { <nl> if ( 0 ! = : : ftruncate ( table_fd , 0 ) ) <nl> mmm a / src / Storages / StorageFile . h <nl> ppp b / src / Storages / StorageFile . h <nl> class StorageFile final : public ext : : shared_ptr_helper < StorageFile > , public ISt <nl> std : : atomic < bool > table_fd_was_used { false } ; / / / To detect repeating reads from stdin <nl> off_t table_fd_init_offset = - 1 ; / / / Initial position of fd , used for repeating reads <nl> <nl> - mutable std : : shared_mutex rwlock ; <nl> + mutable std : : shared_timed_mutex rwlock ; <nl> <nl> Poco : : Logger * log = & Poco : : Logger : : get ( " StorageFile " ) ; <nl> } ; <nl> mmm a / src / Storages / StorageLog . cpp <nl> ppp b / src / Storages / StorageLog . cpp <nl> namespace DB <nl> <nl> namespace ErrorCodes <nl> { <nl> + extern const int TIMEOUT_EXCEEDED ; <nl> extern const int LOGICAL_ERROR ; <nl> extern const int DUPLICATE_COLUMN ; <nl> extern const int SIZES_OF_MARKS_FILES_ARE_INCONSISTENT ; <nl> namespace ErrorCodes <nl> class LogSource final : public SourceWithProgress <nl> { <nl> public : <nl> - <nl> static Block getHeader ( const NamesAndTypesList & columns ) <nl> { <nl> Block res ; <nl> class LogSource final : public SourceWithProgress <nl> class LogBlockOutputStream final : public IBlockOutputStream <nl> { <nl> public : <nl> - explicit LogBlockOutputStream ( StorageLog & storage_ , const StorageMetadataPtr & metadata_snapshot_ ) <nl> + explicit LogBlockOutputStream ( <nl> + StorageLog & storage_ , const StorageMetadataPtr & metadata_snapshot_ , std : : unique_lock < std : : shared_timed_mutex > & & lock_ ) <nl> : storage ( storage_ ) <nl> , metadata_snapshot ( metadata_snapshot_ ) <nl> - , lock ( storage . rwlock ) <nl> + , lock ( std : : move ( lock_ ) ) <nl> , marks_stream ( <nl> storage . disk - > writeFile ( storage . marks_file_path , 4096 , WriteMode : : Rewrite ) ) <nl> { <nl> + if ( ! lock ) <nl> + throw Exception ( " Lock timeout exceeded " , ErrorCodes : : TIMEOUT_EXCEEDED ) ; <nl> } <nl> <nl> ~ LogBlockOutputStream ( ) override <nl> class LogBlockOutputStream final : public IBlockOutputStream <nl> private : <nl> StorageLog & storage ; <nl> StorageMetadataPtr metadata_snapshot ; <nl> - std : : unique_lock < std : : shared_mutex > lock ; <nl> + std : : unique_lock < std : : shared_timed_mutex > lock ; <nl> bool done = false ; <nl> <nl> struct Stream <nl> void StorageLog : : addFiles ( const String & column_name , const IDataType & type ) <nl> } <nl> <nl> <nl> - void StorageLog : : loadMarks ( ) <nl> + void StorageLog : : loadMarks ( std : : chrono : : seconds lock_timeout ) <nl> { <nl> - std : : unique_lock < std : : shared_mutex > lock ( rwlock ) ; <nl> + std : : unique_lock lock ( rwlock , lock_timeout ) ; <nl> + if ( ! lock ) <nl> + throw Exception ( " Lock timeout exceeded " , ErrorCodes : : TIMEOUT_EXCEEDED ) ; <nl> <nl> if ( loaded_marks ) <nl> return ; <nl> void StorageLog : : rename ( const String & new_path_to_table_data , const StorageID & <nl> { <nl> assert ( table_path ! = new_path_to_table_data ) ; <nl> { <nl> - std : : unique_lock < std : : shared_mutex > lock ( rwlock ) ; <nl> - <nl> disk - > moveDirectory ( table_path , new_path_to_table_data ) ; <nl> <nl> table_path = new_path_to_table_data ; <nl> void StorageLog : : rename ( const String & new_path_to_table_data , const StorageID & <nl> <nl> void StorageLog : : truncate ( const ASTPtr & , const StorageMetadataPtr & metadata_snapshot , const Context & , TableExclusiveLockHolder & ) <nl> { <nl> - std : : shared_lock < std : : shared_mutex > lock ( rwlock ) ; <nl> - <nl> files . clear ( ) ; <nl> file_count = 0 ; <nl> loaded_marks = false ; <nl> const StorageLog : : Marks & StorageLog : : getMarksWithRealRowCount ( const StorageMeta <nl> return it - > second . marks ; <nl> } <nl> <nl> + <nl> + static std : : chrono : : seconds getLockTimeout ( const Context & context ) <nl> + { <nl> + const Settings & settings = context . getSettingsRef ( ) ; <nl> + Int64 lock_timeout = settings . lock_acquire_timeout . totalSeconds ( ) ; <nl> + if ( settings . max_execution_time . totalSeconds ( ) ! = 0 & & settings . max_execution_time . totalSeconds ( ) < lock_timeout ) <nl> + lock_timeout = settings . max_execution_time . totalSeconds ( ) ; <nl> + return std : : chrono : : seconds { lock_timeout } ; <nl> + } <nl> + <nl> + <nl> Pipe StorageLog : : read ( <nl> const Names & column_names , <nl> const StorageMetadataPtr & metadata_snapshot , <nl> Pipe StorageLog : : read ( <nl> unsigned num_streams ) <nl> { <nl> metadata_snapshot - > check ( column_names , getVirtuals ( ) , getStorageID ( ) ) ; <nl> - loadMarks ( ) ; <nl> + <nl> + auto lock_timeout = getLockTimeout ( context ) ; <nl> + loadMarks ( lock_timeout ) ; <nl> <nl> NamesAndTypesList all_columns = Nested : : collect ( metadata_snapshot - > getColumns ( ) . getAllPhysical ( ) . addTypes ( column_names ) ) ; <nl> <nl> - std : : shared_lock < std : : shared_mutex > lock ( rwlock ) ; <nl> + std : : shared_lock lock ( rwlock , lock_timeout ) ; <nl> + if ( ! lock ) <nl> + throw Exception ( " Lock timeout exceeded " , ErrorCodes : : TIMEOUT_EXCEEDED ) ; <nl> <nl> Pipes pipes ; <nl> <nl> Pipe StorageLog : : read ( <nl> max_read_buffer_size ) ) ; <nl> } <nl> <nl> + / / / No need to hold lock while reading because we read fixed range of data that does not change while appending more data . <nl> return Pipe : : unitePipes ( std : : move ( pipes ) ) ; <nl> } <nl> <nl> - BlockOutputStreamPtr StorageLog : : write ( const ASTPtr & / * query * / , const StorageMetadataPtr & metadata_snapshot , const Context & / * context * / ) <nl> + BlockOutputStreamPtr StorageLog : : write ( const ASTPtr & / * query * / , const StorageMetadataPtr & metadata_snapshot , const Context & context ) <nl> { <nl> - loadMarks ( ) ; <nl> - return std : : make_shared < LogBlockOutputStream > ( * this , metadata_snapshot ) ; <nl> + auto lock_timeout = getLockTimeout ( context ) ; <nl> + loadMarks ( lock_timeout ) ; <nl> + <nl> + std : : unique_lock lock ( rwlock , lock_timeout ) ; <nl> + if ( ! lock ) <nl> + throw Exception ( " Lock timeout exceeded " , ErrorCodes : : TIMEOUT_EXCEEDED ) ; <nl> + <nl> + return std : : make_shared < LogBlockOutputStream > ( * this , metadata_snapshot , std : : move ( lock ) ) ; <nl> } <nl> <nl> - CheckResults StorageLog : : checkData ( const ASTPtr & / * query * / , const Context & / * context * / ) <nl> + CheckResults StorageLog : : checkData ( const ASTPtr & / * query * / , const Context & context ) <nl> { <nl> - std : : shared_lock < std : : shared_mutex > lock ( rwlock ) ; <nl> + std : : shared_lock lock ( rwlock , getLockTimeout ( context ) ) ; <nl> + if ( ! lock ) <nl> + throw Exception ( " Lock timeout exceeded " , ErrorCodes : : TIMEOUT_EXCEEDED ) ; <nl> + <nl> return file_checker . check ( ) ; <nl> } <nl> <nl> mmm a / src / Storages / StorageLog . h <nl> ppp b / src / Storages / StorageLog . h <nl> class StorageLog final : public ext : : shared_ptr_helper < StorageLog > , public IStor <nl> DiskPtr disk ; <nl> String table_path ; <nl> <nl> - mutable std : : shared_mutex rwlock ; <nl> + mutable std : : shared_timed_mutex rwlock ; <nl> <nl> Files files ; <nl> <nl> class StorageLog final : public ext : : shared_ptr_helper < StorageLog > , public IStor <nl> / / / Read marks files if they are not already read . <nl> / / / It is done lazily , so that with a large number of tables , the server starts quickly . <nl> / / / You can not call with a write locked ` rwlock ` . <nl> - void loadMarks ( ) ; <nl> + void loadMarks ( std : : chrono : : seconds lock_timeout ) ; <nl> <nl> / * * For normal columns , the number of rows in the block is specified in the marks . <nl> * For array columns and nested structures , there are more than one group of marks that correspond to different files <nl> mmm a / src / Storages / StorageStripeLog . cpp <nl> ppp b / src / Storages / StorageStripeLog . cpp <nl> namespace ErrorCodes <nl> { <nl> extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH ; <nl> extern const int INCORRECT_FILE_NAME ; <nl> + extern const int TIMEOUT_EXCEEDED ; <nl> } <nl> <nl> <nl> class StripeLogSource final : public SourceWithProgress <nl> { <nl> public : <nl> - <nl> static Block getHeader ( <nl> StorageStripeLog & storage , <nl> const StorageMetadataPtr & metadata_snapshot , <nl> class StripeLogSource final : public SourceWithProgress <nl> class StripeLogBlockOutputStream final : public IBlockOutputStream <nl> { <nl> public : <nl> - explicit StripeLogBlockOutputStream ( StorageStripeLog & storage_ , const StorageMetadataPtr & metadata_snapshot_ ) <nl> + explicit StripeLogBlockOutputStream ( <nl> + StorageStripeLog & storage_ , const StorageMetadataPtr & metadata_snapshot_ , std : : unique_lock < std : : shared_timed_mutex > & & lock_ ) <nl> : storage ( storage_ ) <nl> , metadata_snapshot ( metadata_snapshot_ ) <nl> - , lock ( storage . rwlock ) <nl> + , lock ( std : : move ( lock_ ) ) <nl> , data_out_file ( storage . table_path + " data . bin " ) <nl> , data_out_compressed ( storage . disk - > writeFile ( data_out_file , DBMS_DEFAULT_BUFFER_SIZE , WriteMode : : Append ) ) <nl> , data_out ( std : : make_unique < CompressedWriteBuffer > ( <nl> class StripeLogBlockOutputStream final : public IBlockOutputStream <nl> , index_out ( std : : make_unique < CompressedWriteBuffer > ( * index_out_compressed ) ) <nl> , block_out ( * data_out , 0 , metadata_snapshot - > getSampleBlock ( ) , false , index_out . get ( ) , storage . disk - > getFileSize ( data_out_file ) ) <nl> { <nl> + if ( ! lock ) <nl> + throw Exception ( " Lock timeout exceeded " , ErrorCodes : : TIMEOUT_EXCEEDED ) ; <nl> } <nl> <nl> ~ StripeLogBlockOutputStream ( ) override <nl> class StripeLogBlockOutputStream final : public IBlockOutputStream <nl> private : <nl> StorageStripeLog & storage ; <nl> StorageMetadataPtr metadata_snapshot ; <nl> - std : : unique_lock < std : : shared_mutex > lock ; <nl> + std : : unique_lock < std : : shared_timed_mutex > lock ; <nl> <nl> String data_out_file ; <nl> std : : unique_ptr < WriteBuffer > data_out_compressed ; <nl> void StorageStripeLog : : rename ( const String & new_path_to_table_data , const Stora <nl> { <nl> assert ( table_path ! = new_path_to_table_data ) ; <nl> { <nl> - std : : unique_lock < std : : shared_mutex > lock ( rwlock ) ; <nl> - <nl> disk - > moveDirectory ( table_path , new_path_to_table_data ) ; <nl> <nl> table_path = new_path_to_table_data ; <nl> void StorageStripeLog : : rename ( const String & new_path_to_table_data , const Stora <nl> } <nl> <nl> <nl> + static std : : chrono : : seconds getLockTimeout ( const Context & context ) <nl> + { <nl> + const Settings & settings = context . getSettingsRef ( ) ; <nl> + Int64 lock_timeout = settings . lock_acquire_timeout . totalSeconds ( ) ; <nl> + if ( settings . max_execution_time . totalSeconds ( ) ! = 0 & & settings . max_execution_time . totalSeconds ( ) < lock_timeout ) <nl> + lock_timeout = settings . max_execution_time . totalSeconds ( ) ; <nl> + return std : : chrono : : seconds { lock_timeout } ; <nl> + } <nl> + <nl> + <nl> Pipe StorageStripeLog : : read ( <nl> const Names & column_names , <nl> const StorageMetadataPtr & metadata_snapshot , <nl> Pipe StorageStripeLog : : read ( <nl> const size_t / * max_block_size * / , <nl> unsigned num_streams ) <nl> { <nl> - std : : shared_lock < std : : shared_mutex > lock ( rwlock ) ; <nl> + std : : shared_lock lock ( rwlock , getLockTimeout ( context ) ) ; <nl> + if ( ! lock ) <nl> + throw Exception ( " Lock timeout exceeded " , ErrorCodes : : TIMEOUT_EXCEEDED ) ; <nl> <nl> metadata_snapshot - > check ( column_names , getVirtuals ( ) , getStorageID ( ) ) ; <nl> <nl> Pipe StorageStripeLog : : read ( <nl> } <nl> <nl> <nl> - BlockOutputStreamPtr StorageStripeLog : : write ( const ASTPtr & / * query * / , const StorageMetadataPtr & metadata_snapshot , const Context & / * context * / ) <nl> + BlockOutputStreamPtr StorageStripeLog : : write ( const ASTPtr & / * query * / , const StorageMetadataPtr & metadata_snapshot , const Context & context ) <nl> { <nl> - return std : : make_shared < StripeLogBlockOutputStream > ( * this , metadata_snapshot ) ; <nl> + std : : unique_lock lock ( rwlock , getLockTimeout ( context ) ) ; <nl> + if ( ! lock ) <nl> + throw Exception ( " Lock timeout exceeded " , ErrorCodes : : TIMEOUT_EXCEEDED ) ; <nl> + <nl> + return std : : make_shared < StripeLogBlockOutputStream > ( * this , metadata_snapshot , std : : move ( lock ) ) ; <nl> } <nl> <nl> <nl> - CheckResults StorageStripeLog : : checkData ( const ASTPtr & / * query * / , const Context & / * context * / ) <nl> + CheckResults StorageStripeLog : : checkData ( const ASTPtr & / * query * / , const Context & context ) <nl> { <nl> - std : : shared_lock < std : : shared_mutex > lock ( rwlock ) ; <nl> + std : : shared_lock lock ( rwlock , getLockTimeout ( context ) ) ; <nl> + if ( ! lock ) <nl> + throw Exception ( " Lock timeout exceeded " , ErrorCodes : : TIMEOUT_EXCEEDED ) ; <nl> + <nl> return file_checker . check ( ) ; <nl> } <nl> <nl> void StorageStripeLog : : truncate ( const ASTPtr & , const StorageMetadataPtr & , const Context & , TableExclusiveLockHolder & ) <nl> { <nl> - std : : shared_lock < std : : shared_mutex > lock ( rwlock ) ; <nl> - <nl> disk - > clearDirectory ( table_path ) ; <nl> - <nl> file_checker = FileChecker { disk , table_path + " sizes . json " } ; <nl> } <nl> <nl> mmm a / src / Storages / StorageStripeLog . h <nl> ppp b / src / Storages / StorageStripeLog . h <nl> class StorageStripeLog final : public ext : : shared_ptr_helper < StorageStripeLog > , <nl> size_t max_compress_block_size ; <nl> <nl> FileChecker file_checker ; <nl> - mutable std : : shared_mutex rwlock ; <nl> + mutable std : : shared_timed_mutex rwlock ; <nl> <nl> Poco : : Logger * log ; <nl> } ; <nl> mmm a / src / Storages / StorageTinyLog . cpp <nl> ppp b / src / Storages / StorageTinyLog . cpp <nl> <nl> <nl> # include < IO / ReadBufferFromFileBase . h > <nl> # include < IO / WriteBufferFromFileBase . h > <nl> + # include < IO / LimitReadBuffer . h > <nl> # include < Compression / CompressionFactory . h > <nl> # include < Compression / CompressedReadBuffer . h > <nl> # include < Compression / CompressedWriteBuffer . h > <nl> namespace DB <nl> <nl> namespace ErrorCodes <nl> { <nl> + extern const int TIMEOUT_EXCEEDED ; <nl> extern const int DUPLICATE_COLUMN ; <nl> extern const int INCORRECT_FILE_NAME ; <nl> extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH ; <nl> namespace ErrorCodes <nl> class TinyLogSource final : public SourceWithProgress <nl> { <nl> public : <nl> - <nl> static Block getHeader ( const NamesAndTypesList & columns ) <nl> { <nl> Block res ; <nl> class TinyLogSource final : public SourceWithProgress <nl> return Nested : : flatten ( res ) ; <nl> } <nl> <nl> - TinyLogSource ( size_t block_size_ , const NamesAndTypesList & columns_ , StorageTinyLog & storage_ , size_t max_read_buffer_size_ ) <nl> + TinyLogSource ( <nl> + size_t block_size_ , <nl> + const NamesAndTypesList & columns_ , <nl> + StorageTinyLog & storage_ , <nl> + size_t max_read_buffer_size_ , <nl> + FileChecker : : Map file_sizes_ ) <nl> : SourceWithProgress ( getHeader ( columns_ ) ) <nl> - , block_size ( block_size_ ) , columns ( columns_ ) , storage ( storage_ ) , lock ( storage_ . rwlock ) <nl> - , max_read_buffer_size ( max_read_buffer_size_ ) { } <nl> + , block_size ( block_size_ ) , columns ( columns_ ) , storage ( storage_ ) <nl> + , max_read_buffer_size ( max_read_buffer_size_ ) , file_sizes ( std : : move ( file_sizes_ ) ) <nl> + { <nl> + } <nl> <nl> String getName ( ) const override { return " TinyLog " ; } <nl> <nl> class TinyLogSource final : public SourceWithProgress <nl> size_t block_size ; <nl> NamesAndTypesList columns ; <nl> StorageTinyLog & storage ; <nl> - std : : shared_lock < std : : shared_mutex > lock ; <nl> bool is_finished = false ; <nl> size_t max_read_buffer_size ; <nl> + FileChecker : : Map file_sizes ; <nl> <nl> struct Stream <nl> { <nl> - Stream ( const DiskPtr & disk , const String & data_path , size_t max_read_buffer_size_ ) <nl> + Stream ( const DiskPtr & disk , const String & data_path , size_t max_read_buffer_size_ , size_t file_size ) <nl> : plain ( disk - > readFile ( data_path , std : : min ( max_read_buffer_size_ , disk - > getFileSize ( data_path ) ) ) ) , <nl> + limited ( std : : make_unique < LimitReadBuffer > ( * plain , file_size , false ) ) , <nl> compressed ( * plain ) <nl> { <nl> } <nl> <nl> std : : unique_ptr < ReadBuffer > plain ; <nl> + std : : unique_ptr < ReadBuffer > limited ; <nl> CompressedReadBuffer compressed ; <nl> } ; <nl> <nl> class TinyLogSource final : public SourceWithProgress <nl> class TinyLogBlockOutputStream final : public IBlockOutputStream <nl> { <nl> public : <nl> - explicit TinyLogBlockOutputStream ( StorageTinyLog & storage_ , const StorageMetadataPtr & metadata_snapshot_ ) <nl> - : storage ( storage_ ) , metadata_snapshot ( metadata_snapshot_ ) , lock ( storage_ . rwlock ) <nl> + explicit TinyLogBlockOutputStream ( <nl> + StorageTinyLog & storage_ , <nl> + const StorageMetadataPtr & metadata_snapshot_ , <nl> + std : : unique_lock < std : : shared_timed_mutex > & & lock_ ) <nl> + : storage ( storage_ ) , metadata_snapshot ( metadata_snapshot_ ) , lock ( std : : move ( lock_ ) ) <nl> { <nl> + if ( ! lock ) <nl> + throw Exception ( " Lock timeout exceeded " , ErrorCodes : : TIMEOUT_EXCEEDED ) ; <nl> } <nl> <nl> ~ TinyLogBlockOutputStream ( ) override <nl> class TinyLogBlockOutputStream final : public IBlockOutputStream <nl> private : <nl> StorageTinyLog & storage ; <nl> StorageMetadataPtr metadata_snapshot ; <nl> - std : : unique_lock < std : : shared_mutex > lock ; <nl> + std : : unique_lock < std : : shared_timed_mutex > lock ; <nl> bool done = false ; <nl> <nl> struct Stream <nl> void TinyLogSource : : readData ( const String & name , const IDataType & type , IColum <nl> String stream_name = IDataType : : getFileNameForStream ( name , path ) ; <nl> <nl> if ( ! streams . count ( stream_name ) ) <nl> - streams [ stream_name ] = std : : make_unique < Stream > ( storage . disk , storage . files [ stream_name ] . data_file_path , max_read_buffer_size ) ; <nl> + { <nl> + String file_path = storage . files [ stream_name ] . data_file_path ; <nl> + streams [ stream_name ] = std : : make_unique < Stream > ( <nl> + storage . disk , file_path , max_read_buffer_size , file_sizes [ fileName ( file_path ) ] ) ; <nl> + } <nl> <nl> return & streams [ stream_name ] - > compressed ; <nl> } ; <nl> <nl> if ( deserialize_states . count ( name ) = = 0 ) <nl> - type . deserializeBinaryBulkStatePrefix ( settings , deserialize_states [ name ] ) ; <nl> + type . deserializeBinaryBulkStatePrefix ( settings , deserialize_states [ name ] ) ; <nl> <nl> type . deserializeBinaryBulkWithMultipleStreams ( column , limit , settings , deserialize_states [ name ] ) ; <nl> } <nl> void StorageTinyLog : : rename ( const String & new_path_to_table_data , const Storage <nl> { <nl> assert ( table_path ! = new_path_to_table_data ) ; <nl> { <nl> - std : : unique_lock < std : : shared_mutex > lock ( rwlock ) ; <nl> - <nl> disk - > moveDirectory ( table_path , new_path_to_table_data ) ; <nl> <nl> table_path = new_path_to_table_data ; <nl> void StorageTinyLog : : rename ( const String & new_path_to_table_data , const Storage <nl> } <nl> <nl> <nl> + static std : : chrono : : seconds getLockTimeout ( const Context & context ) <nl> + { <nl> + const Settings & settings = context . getSettingsRef ( ) ; <nl> + Int64 lock_timeout = settings . lock_acquire_timeout . totalSeconds ( ) ; <nl> + if ( settings . max_execution_time . totalSeconds ( ) ! = 0 & & settings . max_execution_time . totalSeconds ( ) < lock_timeout ) <nl> + lock_timeout = settings . max_execution_time . totalSeconds ( ) ; <nl> + return std : : chrono : : seconds { lock_timeout } ; <nl> + } <nl> + <nl> + <nl> Pipe StorageTinyLog : : read ( <nl> const Names & column_names , <nl> const StorageMetadataPtr & metadata_snapshot , <nl> Pipe StorageTinyLog : : read ( <nl> <nl> / / When reading , we lock the entire storage , because we only have one file <nl> / / per column and can ' t modify it concurrently . <nl> + const Settings & settings = context . getSettingsRef ( ) ; <nl> + <nl> + std : : shared_lock lock { rwlock , getLockTimeout ( context ) } ; <nl> + if ( ! lock ) <nl> + throw Exception ( " Lock timeout exceeded " , ErrorCodes : : TIMEOUT_EXCEEDED ) ; <nl> + <nl> + / / / No need to hold lock while reading because we read fixed range of data that does not change while appending more data . <nl> return Pipe ( std : : make_shared < TinyLogSource > ( <nl> - max_block_size , Nested : : collect ( metadata_snapshot - > getColumns ( ) . getAllPhysical ( ) . addTypes ( column_names ) ) , * this , context . getSettingsRef ( ) . max_read_buffer_size ) ) ; <nl> + max_block_size , <nl> + Nested : : collect ( metadata_snapshot - > getColumns ( ) . getAllPhysical ( ) . addTypes ( column_names ) ) , <nl> + * this , <nl> + settings . max_read_buffer_size , <nl> + file_checker . getFileSizes ( ) ) ) ; <nl> } <nl> <nl> <nl> - BlockOutputStreamPtr StorageTinyLog : : write ( const ASTPtr & / * query * / , const StorageMetadataPtr & metadata_snapshot , const Context & / * context * / ) <nl> + BlockOutputStreamPtr StorageTinyLog : : write ( const ASTPtr & / * query * / , const StorageMetadataPtr & metadata_snapshot , const Context & context ) <nl> { <nl> - return std : : make_shared < TinyLogBlockOutputStream > ( * this , metadata_snapshot ) ; <nl> + return std : : make_shared < TinyLogBlockOutputStream > ( * this , metadata_snapshot , std : : unique_lock { rwlock , getLockTimeout ( context ) } ) ; <nl> } <nl> <nl> <nl> - CheckResults StorageTinyLog : : checkData ( const ASTPtr & / * query * / , const Context & / * context * / ) <nl> + CheckResults StorageTinyLog : : checkData ( const ASTPtr & / * query * / , const Context & context ) <nl> { <nl> - std : : shared_lock < std : : shared_mutex > lock ( rwlock ) ; <nl> + std : : shared_lock lock ( rwlock , getLockTimeout ( context ) ) ; <nl> + if ( ! lock ) <nl> + throw Exception ( " Lock timeout exceeded " , ErrorCodes : : TIMEOUT_EXCEEDED ) ; <nl> + <nl> return file_checker . check ( ) ; <nl> } <nl> <nl> void StorageTinyLog : : truncate ( <nl> const ASTPtr & , const StorageMetadataPtr & metadata_snapshot , const Context & , TableExclusiveLockHolder & ) <nl> { <nl> - std : : unique_lock < std : : shared_mutex > lock ( rwlock ) ; <nl> - <nl> disk - > clearDirectory ( table_path ) ; <nl> <nl> files . clear ( ) ; <nl> void StorageTinyLog : : truncate ( <nl> addFiles ( column . name , * column . type ) ; <nl> } <nl> <nl> - void StorageTinyLog : : drop ( ) <nl> - { <nl> - std : : unique_lock < std : : shared_mutex > lock ( rwlock ) ; <nl> - if ( disk - > exists ( table_path ) ) <nl> - disk - > removeRecursive ( table_path ) ; <nl> - files . clear ( ) ; <nl> - } <nl> - <nl> <nl> void registerStorageTinyLog ( StorageFactory & factory ) <nl> { <nl> mmm a / src / Storages / StorageTinyLog . h <nl> ppp b / src / Storages / StorageTinyLog . h <nl> class StorageTinyLog final : public ext : : shared_ptr_helper < StorageTinyLog > , publ <nl> <nl> void truncate ( const ASTPtr & , const StorageMetadataPtr & metadata_snapshot , const Context & , TableExclusiveLockHolder & ) override ; <nl> <nl> - void drop ( ) override ; <nl> - <nl> protected : <nl> StorageTinyLog ( <nl> DiskPtr disk_ , <nl> class StorageTinyLog final : public ext : : shared_ptr_helper < StorageTinyLog > , publ <nl> Files files ; <nl> <nl> FileChecker file_checker ; <nl> - mutable std : : shared_mutex rwlock ; <nl> + mutable std : : shared_timed_mutex rwlock ; <nl> <nl> Poco : : Logger * log ; <nl> <nl> new file mode 100644 <nl> index 00000000000 . . 166be640db5 <nl> mmm / dev / null <nl> ppp b / tests / queries / 0_stateless / 01499_log_deadlock . reference <nl> <nl> + 6 <nl> + 6 <nl> + 6 <nl> new file mode 100644 <nl> index 00000000000 . . e98b37f2455 <nl> mmm / dev / null <nl> ppp b / tests / queries / 0_stateless / 01499_log_deadlock . sql <nl> <nl> + DROP TABLE IF EXISTS t ; <nl> + CREATE TABLE t ( x UInt8 ) ENGINE = TinyLog ; <nl> + <nl> + INSERT INTO t VALUES ( 1 ) , ( 2 ) , ( 3 ) ; <nl> + INSERT INTO t SELECT * FROM t ; <nl> + SELECT count ( ) FROM t ; <nl> + <nl> + DROP TABLE t ; <nl> + <nl> + <nl> + CREATE TABLE t ( x UInt8 ) ENGINE = Log ; <nl> + <nl> + INSERT INTO t VALUES ( 1 ) , ( 2 ) , ( 3 ) ; <nl> + INSERT INTO t SELECT * FROM t ; <nl> + SELECT count ( ) FROM t ; <nl> + <nl> + DROP TABLE t ; <nl> + <nl> + <nl> + CREATE TABLE t ( x UInt8 ) ENGINE = StripeLog ; <nl> + <nl> + INSERT INTO t VALUES ( 1 ) , ( 2 ) , ( 3 ) ; <nl> + INSERT INTO t SELECT * FROM t ; <nl> + SELECT count ( ) FROM t ; <nl> + <nl> + DROP TABLE t ; <nl> new file mode 100644 <nl> index 00000000000 . . 4bf85ae79f3 <nl> mmm / dev / null <nl> ppp b / tests / queries / 0_stateless / 01502_long_log_tinylog_deadlock_race . reference <nl> <nl> + Testing TinyLog <nl> + Done TinyLog <nl> + Testing StripeLog <nl> + Done StripeLog <nl> + Testing Log <nl> + Done Log <nl> new file mode 100755 <nl> index 00000000000 . . 29c5f868617 <nl> mmm / dev / null <nl> ppp b / tests / queries / 0_stateless / 01502_long_log_tinylog_deadlock_race . sh <nl> <nl> + # ! / usr / bin / env bash <nl> + <nl> + set - e <nl> + <nl> + CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL = fatal <nl> + <nl> + CURDIR = $ ( cd " $ ( dirname " $ { BASH_SOURCE [ 0 ] } " ) " & & pwd ) <nl> + . " $ CURDIR " / . . / shell_config . sh <nl> + <nl> + <nl> + function thread_create { <nl> + while true ; do <nl> + $ CLICKHOUSE_CLIENT - - query " CREATE TABLE IF NOT EXISTS $ 1 ( x UInt64 , s Array ( Nullable ( String ) ) ) ENGINE = $ 2 " 2 > & 1 | grep - v - F ' Received exception from server ' | grep - v - P ' Code : ( 60 | 57 ) ' <nl> + sleep 0 . 0 $ RANDOM <nl> + done <nl> + } <nl> + <nl> + function thread_drop { <nl> + while true ; do <nl> + $ CLICKHOUSE_CLIENT - - query " DROP TABLE IF EXISTS $ 1 " 2 > & 1 | grep - v - F ' Received exception from server ' | grep - v - P ' Code : ( 60 | 57 ) ' <nl> + sleep 0 . 0 $ RANDOM <nl> + done <nl> + } <nl> + <nl> + function thread_rename { <nl> + while true ; do <nl> + $ CLICKHOUSE_CLIENT - - query " RENAME TABLE $ 1 TO $ 2 " 2 > & 1 | grep - v - F ' Received exception from server ' | grep - v - P ' Code : ( 60 | 57 ) ' <nl> + sleep 0 . 0 $ RANDOM <nl> + done <nl> + } <nl> + <nl> + function thread_select { <nl> + while true ; do <nl> + $ CLICKHOUSE_CLIENT - - query " SELECT * FROM $ 1 FORMAT Null " 2 > & 1 | grep - v - F ' Received exception from server ' | grep - v - P ' Code : ( 60 | 218 ) ' <nl> + sleep 0 . 0 $ RANDOM <nl> + done <nl> + } <nl> + <nl> + function thread_insert { <nl> + while true ; do <nl> + $ CLICKHOUSE_CLIENT - - query " INSERT INTO $ 1 SELECT rand64 ( 1 ) , [ toString ( rand64 ( 2 ) ) ] FROM numbers ( $ 2 ) " 2 > & 1 | grep - v - F ' Received exception from server ' | grep - v - P ' Code : ( 60 | 218 ) ' <nl> + sleep 0 . 0 $ RANDOM <nl> + done <nl> + } <nl> + <nl> + function thread_insert_select { <nl> + while true ; do <nl> + $ CLICKHOUSE_CLIENT - - query " INSERT INTO $ 1 SELECT * FROM $ 2 " 2 > & 1 | grep - v - F ' Received exception from server ' | grep - v - P ' Code : ( 60 | 218 ) ' <nl> + sleep 0 . 0 $ RANDOM <nl> + done <nl> + } <nl> + <nl> + export - f thread_create <nl> + export - f thread_drop <nl> + export - f thread_rename <nl> + export - f thread_select <nl> + export - f thread_insert <nl> + export - f thread_insert_select <nl> + <nl> + <nl> + # Do randomized queries and expect nothing extraordinary happens . <nl> + <nl> + function test_with_engine { <nl> + echo " Testing $ 1 " <nl> + <nl> + timeout 10 bash - c " thread_create t1 $ 1 " & <nl> + timeout 10 bash - c " thread_create t2 $ 1 " & <nl> + timeout 10 bash - c ' thread_drop t1 ' & <nl> + timeout 10 bash - c ' thread_drop t2 ' & <nl> + timeout 10 bash - c ' thread_rename t1 t2 ' & <nl> + timeout 10 bash - c ' thread_rename t2 t1 ' & <nl> + timeout 10 bash - c ' thread_select t1 ' & <nl> + timeout 10 bash - c ' thread_select t2 ' & <nl> + timeout 10 bash - c ' thread_insert t1 5 ' & <nl> + timeout 10 bash - c ' thread_insert t2 10 ' & <nl> + timeout 10 bash - c ' thread_insert_select t1 t2 ' & <nl> + timeout 10 bash - c ' thread_insert_select t2 t1 ' & <nl> + <nl> + wait <nl> + echo " Done $ 1 " <nl> + } <nl> + <nl> + test_with_engine TinyLog <nl> + test_with_engine StripeLog <nl> + test_with_engine Log <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . 2b0b2b97188 <nl> mmm / dev / null <nl> ppp b / tests / queries / 0_stateless / 01505_log_distributed_deadlock . sql <nl> <nl> + DROP TABLE IF EXISTS t_local ; <nl> + DROP TABLE IF EXISTS t_dist ; <nl> + <nl> + create table t_local ( a int ) engine Log ; <nl> + create table t_dist ( a int ) engine Distributed ( test_shard_localhost , currentDatabase ( ) , ' t_local ' , cityHash64 ( a ) ) ; <nl> + <nl> + set insert_distributed_sync = 1 ; <nl> + <nl> + insert into t_dist values ( 1 ) ; <nl> + <nl> + DROP TABLE t_local ; <nl> + DROP TABLE t_dist ; <nl> mmm a / tests / queries / 0_stateless / arcadia_skip_list . txt <nl> ppp b / tests / queries / 0_stateless / arcadia_skip_list . txt <nl> <nl> 01461_query_start_time_microseconds <nl> 01455_shard_leaf_max_rows_bytes_to_read <nl> 01505_distributed_local_type_conversion_enum <nl> + 01505_log_distributed_deadlock <nl>
Merge pull request from ClickHouse / log - avoid - deadlock
ClickHouse/ClickHouse
813a876e9314e582dd2d3938cdc1f76042687ab0
2020-09-24T10:54:11Z
mmm a / modules / core / include / opencv2 / core / base . hpp <nl> ppp b / modules / core / include / opencv2 / core / base . hpp <nl> namespace cv <nl> namespace Error { <nl> / / ! error codes <nl> enum Code { <nl> - StsOk = 0 , / / ! < everithing is ok <nl> + StsOk = 0 , / / ! < everything is ok <nl> StsBackTrace = - 1 , / / ! < pseudo error for back trace <nl> StsError = - 2 , / / ! < unknown / unspecified error <nl> StsInternal = - 3 , / / ! < internal error ( bad state ) <nl> enum Code { <nl> StsVecLengthErr = - 28 , / / ! < incorrect vector length <nl> StsFilterStructContentErr = - 29 , / / ! < incorr . filter structure content <nl> StsKernelStructContentErr = - 30 , / / ! < incorr . transform kernel content <nl> - StsFilterOffsetErr = - 31 , / / ! < incorrect filter ofset value <nl> + StsFilterOffsetErr = - 31 , / / ! < incorrect filter offset value <nl> StsBadSize = - 201 , / / ! < the input / output structure size is incorrect <nl> StsDivByZero = - 202 , / / ! < division by zero <nl> StsInplaceNotSupported = - 203 , / / ! < in - place operation is not supported <nl> It is possible to alternate error processing by using redirectError ( ) . <nl> @ param _code - error code ( Error : : Code ) <nl> @ param _err - error description <nl> @ param _func - function name . Available only when the compiler supports getting it <nl> - @ param _file - source file name where the error has occured <nl> - @ param _line - line number in the source file where the error has occured <nl> + @ param _file - source file name where the error has occurred <nl> + @ param _line - line number in the source file where the error has occurred <nl> @ see CV_Error , CV_Error_ , CV_ErrorNoReturn , CV_ErrorNoReturn_ , CV_Assert , CV_DbgAssert <nl> * / <nl> CV_EXPORTS void error ( int _code , const String & _err , const char * _func , const char * _file , int _line ) ; <nl>
Fix typos .
opencv/opencv
46fe74177dbeaeca8d0cec7e3761ddc45b4b0650
2017-02-15T13:52:00Z
mmm a / HISTORY . md <nl> ppp b / HISTORY . md <nl> <nl> * With " ldb mmm - try_load_options " , when wal_dir specified by the option file doesn ' t exist , ignore it . <nl> * Change time resolution in FileOperationInfo . <nl> * Deleting Blob files also go through SStFileManager . <nl> - * Remove PlainTable ' s store_index_in_file feature . When opening an existing DB with index in SST files , the index and bloom filter will still be rebuild while SST files are opened , in the same way as there is no index in the file . <nl> * Remove CuckooHash memtable . <nl> * The counter stat ` number . block . not_compressed ` now also counts blocks not compressed due to poor compression ratio . <nl> * Remove ttl option from ` CompactionOptionsFIFO ` . The option has been deprecated and ttl in ` ColumnFamilyOptions ` is used instead . <nl> mmm a / db / plain_table_db_test . cc <nl> ppp b / db / plain_table_db_test . cc <nl> class PlainTableDBTest : public testing : : Test , <nl> plain_table_options . huge_page_tlb_size = 0 ; <nl> plain_table_options . encoding_type = kPrefix ; <nl> plain_table_options . full_scan_mode = false ; <nl> + plain_table_options . store_index_in_file = false ; <nl> <nl> options . table_factory . reset ( NewPlainTableFactory ( plain_table_options ) ) ; <nl> options . memtable_factory . reset ( NewHashLinkListRepFactory ( 4 , 0 , 3 , true ) ) ; <nl> class TestPlainTableReader : public PlainTableReader { <nl> std : : unique_ptr < RandomAccessFileReader > & & file , <nl> const ImmutableCFOptions & ioptions , <nl> const SliceTransform * prefix_extractor , <nl> - bool * expect_bloom_not_match , uint32_t column_family_id , <nl> + bool * expect_bloom_not_match , bool store_index_in_file , <nl> + uint32_t column_family_id , <nl> const std : : string & column_family_name ) <nl> : PlainTableReader ( ioptions , std : : move ( file ) , env_options , icomparator , <nl> encoding_type , file_size , table_properties , <nl> class TestPlainTableReader : public PlainTableReader { <nl> TableProperties * props = const_cast < TableProperties * > ( table_properties ) ; <nl> EXPECT_EQ ( column_family_id , static_cast < uint32_t > ( props - > column_family_id ) ) ; <nl> EXPECT_EQ ( column_family_name , props - > column_family_name ) ; <nl> + if ( store_index_in_file ) { <nl> + auto bloom_version_ptr = props - > user_collected_properties . find ( <nl> + PlainTablePropertyNames : : kBloomVersion ) ; <nl> + EXPECT_TRUE ( bloom_version_ptr ! = props - > user_collected_properties . end ( ) ) ; <nl> + EXPECT_EQ ( bloom_version_ptr - > second , std : : string ( " 1 " ) ) ; <nl> + if ( ioptions . bloom_locality > 0 ) { <nl> + auto num_blocks_ptr = props - > user_collected_properties . find ( <nl> + PlainTablePropertyNames : : kNumBloomBlocks ) ; <nl> + EXPECT_TRUE ( num_blocks_ptr ! = props - > user_collected_properties . end ( ) ) ; <nl> + } <nl> + } <nl> } <nl> <nl> ~ TestPlainTableReader ( ) override { } <nl> class TestPlainTableFactory : public PlainTableFactory { <nl> bloom_bits_per_key_ ( options . bloom_bits_per_key ) , <nl> hash_table_ratio_ ( options . hash_table_ratio ) , <nl> index_sparseness_ ( options . index_sparseness ) , <nl> + store_index_in_file_ ( options . store_index_in_file ) , <nl> expect_bloom_not_match_ ( expect_bloom_not_match ) , <nl> column_family_id_ ( column_family_id ) , <nl> column_family_name_ ( std : : move ( column_family_name ) ) { } <nl> class TestPlainTableFactory : public PlainTableFactory { <nl> true / * compression_type_missing * / ) ; <nl> EXPECT_TRUE ( s . ok ( ) ) ; <nl> <nl> + if ( store_index_in_file_ ) { <nl> + BlockHandle bloom_block_handle ; <nl> + s = FindMetaBlock ( file . get ( ) , file_size , kPlainTableMagicNumber , <nl> + table_reader_options . ioptions , <nl> + BloomBlockBuilder : : kBloomBlock , & bloom_block_handle , <nl> + / * compression_type_missing * / true ) ; <nl> + EXPECT_TRUE ( s . ok ( ) ) ; <nl> + <nl> + BlockHandle index_block_handle ; <nl> + s = FindMetaBlock ( file . get ( ) , file_size , kPlainTableMagicNumber , <nl> + table_reader_options . ioptions , <nl> + PlainTableIndexBuilder : : kPlainTableIndexBlock , <nl> + & index_block_handle , / * compression_type_missing * / true ) ; <nl> + EXPECT_TRUE ( s . ok ( ) ) ; <nl> + } <nl> + <nl> auto & user_props = props - > user_collected_properties ; <nl> auto encoding_type_prop = <nl> user_props . find ( PlainTablePropertyNames : : kEncodingType ) ; <nl> class TestPlainTableFactory : public PlainTableFactory { <nl> bloom_bits_per_key_ , hash_table_ratio_ , index_sparseness_ , props , <nl> std : : move ( file ) , table_reader_options . ioptions , <nl> table_reader_options . prefix_extractor , expect_bloom_not_match_ , <nl> - column_family_id_ , column_family_name_ ) ) ; <nl> + store_index_in_file_ , column_family_id_ , column_family_name_ ) ) ; <nl> <nl> * table = std : : move ( new_reader ) ; <nl> return s ; <nl> class TestPlainTableFactory : public PlainTableFactory { <nl> int bloom_bits_per_key_ ; <nl> double hash_table_ratio_ ; <nl> size_t index_sparseness_ ; <nl> + bool store_index_in_file_ ; <nl> bool * expect_bloom_not_match_ ; <nl> const uint32_t column_family_id_ ; <nl> const std : : string column_family_name_ ; <nl> TEST_P ( PlainTableDBTest , Flush ) { <nl> for ( size_t huge_page_tlb_size = 0 ; huge_page_tlb_size < = 2 * 1024 * 1024 ; <nl> huge_page_tlb_size + = 2 * 1024 * 1024 ) { <nl> for ( EncodingType encoding_type : { kPlain , kPrefix } ) { <nl> - for ( int bloom_bits = 0 ; bloom_bits < = 117 ; bloom_bits + = 117 ) { <nl> - for ( int total_order = 0 ; total_order < = 1 ; total_order + + ) { <nl> + for ( int bloom_bits = 0 ; bloom_bits < = 117 ; bloom_bits + = 117 ) { <nl> + for ( int total_order = 0 ; total_order < = 1 ; total_order + + ) { <nl> + for ( int store_index_in_file = 0 ; store_index_in_file < = 1 ; <nl> + + + store_index_in_file ) { <nl> Options options = CurrentOptions ( ) ; <nl> options . create_if_missing = true ; <nl> / / Set only one bucket to force bucket conflict . <nl> TEST_P ( PlainTableDBTest , Flush ) { <nl> plain_table_options . huge_page_tlb_size = huge_page_tlb_size ; <nl> plain_table_options . encoding_type = encoding_type ; <nl> plain_table_options . full_scan_mode = false ; <nl> + plain_table_options . store_index_in_file = store_index_in_file ; <nl> <nl> options . table_factory . reset ( <nl> NewPlainTableFactory ( plain_table_options ) ) ; <nl> TEST_P ( PlainTableDBTest , Flush ) { <nl> plain_table_options . huge_page_tlb_size = huge_page_tlb_size ; <nl> plain_table_options . encoding_type = encoding_type ; <nl> plain_table_options . full_scan_mode = false ; <nl> + plain_table_options . store_index_in_file = store_index_in_file ; <nl> <nl> options . table_factory . reset ( <nl> NewPlainTableFactory ( plain_table_options ) ) ; <nl> TEST_P ( PlainTableDBTest , Flush ) { <nl> auto row = ptc . begin ( ) ; <nl> auto tp = row - > second ; <nl> <nl> - ASSERT_EQ ( total_order ? " 4 " : " 12 " , <nl> - ( tp - > user_collected_properties ) <nl> - . at ( " plain_table_hash_table_size " ) ) ; <nl> - ASSERT_EQ ( <nl> - " 0 " , <nl> - ( tp - > user_collected_properties ) . at ( " plain_table_sub_index_size " ) ) ; <nl> + if ( ! store_index_in_file ) { <nl> + ASSERT_EQ ( total_order ? " 4 " : " 12 " , <nl> + ( tp - > user_collected_properties ) <nl> + . at ( " plain_table_hash_table_size " ) ) ; <nl> + ASSERT_EQ ( " 0 " , ( tp - > user_collected_properties ) <nl> + . at ( " plain_table_sub_index_size " ) ) ; <nl> + } else { <nl> + ASSERT_EQ ( " 0 " , ( tp - > user_collected_properties ) <nl> + . at ( " plain_table_hash_table_size " ) ) ; <nl> + ASSERT_EQ ( " 0 " , ( tp - > user_collected_properties ) <nl> + . at ( " plain_table_sub_index_size " ) ) ; <nl> + } <nl> ASSERT_EQ ( " v3 " , Get ( " 1000000000000foo " ) ) ; <nl> ASSERT_EQ ( " v2 " , Get ( " 0000000000000bar " ) ) ; <nl> } <nl> + } <nl> } <nl> } <nl> } <nl> TEST_P ( PlainTableDBTest , Flush2 ) { <nl> for ( size_t huge_page_tlb_size = 0 ; huge_page_tlb_size < = 2 * 1024 * 1024 ; <nl> huge_page_tlb_size + = 2 * 1024 * 1024 ) { <nl> for ( EncodingType encoding_type : { kPlain , kPrefix } ) { <nl> - for ( int bloom_bits = 0 ; bloom_bits < = 117 ; bloom_bits + = 117 ) { <nl> - for ( int total_order = 0 ; total_order < = 1 ; total_order + + ) { <nl> + for ( int bloom_bits = 0 ; bloom_bits < = 117 ; bloom_bits + = 117 ) { <nl> + for ( int total_order = 0 ; total_order < = 1 ; total_order + + ) { <nl> + for ( int store_index_in_file = 0 ; store_index_in_file < = 1 ; <nl> + + + store_index_in_file ) { <nl> if ( encoding_type = = kPrefix & & total_order ) { <nl> continue ; <nl> } <nl> + if ( ! bloom_bits & & store_index_in_file ) { <nl> + continue ; <nl> + } <nl> + if ( total_order & & store_index_in_file ) { <nl> + continue ; <nl> + } <nl> bool expect_bloom_not_match = false ; <nl> Options options = CurrentOptions ( ) ; <nl> options . create_if_missing = true ; <nl> TEST_P ( PlainTableDBTest , Flush2 ) { <nl> plain_table_options . bloom_bits_per_key = bloom_bits ; <nl> plain_table_options . huge_page_tlb_size = huge_page_tlb_size ; <nl> plain_table_options . encoding_type = encoding_type ; <nl> + plain_table_options . store_index_in_file = store_index_in_file ; <nl> options . table_factory . reset ( new TestPlainTableFactory ( <nl> & expect_bloom_not_match , plain_table_options , <nl> 0 / * column_family_id * / , kDefaultColumnFamilyName ) ) ; <nl> TEST_P ( PlainTableDBTest , Flush2 ) { <nl> } <nl> expect_bloom_not_match = false ; <nl> } <nl> - } <nl> } <nl> + } <nl> + } <nl> } <nl> } <nl> } <nl> mmm a / include / rocksdb / table . h <nl> ppp b / include / rocksdb / table . h <nl> struct PlainTableOptions { <nl> / / using the index . <nl> bool full_scan_mode = false ; <nl> <nl> - / / THIS FEATURE IS REMOVED . <nl> / / @ store_index_in_file : compute plain table index and bloom filter during <nl> / / file building and store it in file . When reading <nl> / / file , index will be mmaped instead of recomputation . <nl> - / / bool store_index_in_file = false ; <nl> + bool store_index_in_file = false ; <nl> } ; <nl> <nl> / / - - Plain Table with prefix - only seek <nl> mmm a / java / rocksjni / table . cc <nl> ppp b / java / rocksjni / table . cc <nl> <nl> jlong Java_org_rocksdb_PlainTableConfig_newTableFactoryHandle ( <nl> JNIEnv * / * env * / , jobject / * jobj * / , jint jkey_size , <nl> jint jbloom_bits_per_key , jdouble jhash_table_ratio , jint jindex_sparseness , <nl> - jint jhuge_page_tlb_size , jbyte jencoding_type , jboolean jfull_scan_mode ) { <nl> + jint jhuge_page_tlb_size , jbyte jencoding_type , jboolean jfull_scan_mode , <nl> + jboolean jstore_index_in_file ) { <nl> rocksdb : : PlainTableOptions options = rocksdb : : PlainTableOptions ( ) ; <nl> options . user_key_len = jkey_size ; <nl> options . bloom_bits_per_key = jbloom_bits_per_key ; <nl> jlong Java_org_rocksdb_PlainTableConfig_newTableFactoryHandle ( <nl> options . huge_page_tlb_size = jhuge_page_tlb_size ; <nl> options . encoding_type = static_cast < rocksdb : : EncodingType > ( jencoding_type ) ; <nl> options . full_scan_mode = jfull_scan_mode ; <nl> + options . store_index_in_file = jstore_index_in_file ; <nl> return reinterpret_cast < jlong > ( rocksdb : : NewPlainTableFactory ( options ) ) ; <nl> } <nl> <nl> mmm a / java / src / main / java / org / rocksdb / PlainTableConfig . java <nl> ppp b / java / src / main / java / org / rocksdb / PlainTableConfig . java <nl> <nl> public static final EncodingType DEFAULT_ENCODING_TYPE = <nl> EncodingType . kPlain ; <nl> public static final boolean DEFAULT_FULL_SCAN_MODE = false ; <nl> + public static final boolean DEFAULT_STORE_INDEX_IN_FILE <nl> + = false ; <nl> <nl> public PlainTableConfig ( ) { <nl> keySize_ = VARIABLE_LENGTH ; <nl> public PlainTableConfig ( ) { <nl> hugePageTlbSize_ = DEFAULT_HUGE_TLB_SIZE ; <nl> encodingType_ = DEFAULT_ENCODING_TYPE ; <nl> fullScanMode_ = DEFAULT_FULL_SCAN_MODE ; <nl> + storeIndexInFile_ = DEFAULT_STORE_INDEX_IN_FILE ; <nl> } <nl> <nl> / * * <nl> public boolean fullScanMode ( ) { <nl> * @ param storeIndexInFile value indicating if index shall <nl> * be stored in a file <nl> * @ return the reference to the current config . <nl> - * @ deprecated <nl> * / <nl> - @ Deprecated <nl> public PlainTableConfig setStoreIndexInFile ( boolean storeIndexInFile ) { <nl> + this . storeIndexInFile_ = storeIndexInFile ; <nl> return this ; <nl> } <nl> <nl> public PlainTableConfig setStoreIndexInFile ( boolean storeIndexInFile ) { <nl> * in a file . <nl> * <nl> * @ return currently set value for store index in file . <nl> - * @ deprecated <nl> * / <nl> - @ Deprecated <nl> public boolean storeIndexInFile ( ) { <nl> - return false ; <nl> + return storeIndexInFile_ ; <nl> } <nl> <nl> @ Override protected long newTableFactoryHandle ( ) { <nl> - return newTableFactoryHandle ( keySize_ , bloomBitsPerKey_ , hashTableRatio_ , indexSparseness_ , <nl> - hugePageTlbSize_ , encodingType_ . getValue ( ) , fullScanMode_ ) ; <nl> + return newTableFactoryHandle ( keySize_ , bloomBitsPerKey_ , <nl> + hashTableRatio_ , indexSparseness_ , hugePageTlbSize_ , <nl> + encodingType_ . getValue ( ) , fullScanMode_ , <nl> + storeIndexInFile_ ) ; <nl> } <nl> <nl> - private native long newTableFactoryHandle ( int keySize , int bloomBitsPerKey , double hashTableRatio , <nl> - int indexSparseness , int hugePageTlbSize , byte encodingType , boolean fullScanMode ) ; <nl> + private native long newTableFactoryHandle ( <nl> + int keySize , int bloomBitsPerKey , <nl> + double hashTableRatio , int indexSparseness , <nl> + int hugePageTlbSize , byte encodingType , <nl> + boolean fullScanMode , boolean storeIndexInFile ) ; <nl> <nl> private int keySize_ ; <nl> private int bloomBitsPerKey_ ; <nl> private native long newTableFactoryHandle ( int keySize , int bloomBitsPerKey , doub <nl> private int hugePageTlbSize_ ; <nl> private EncodingType encodingType_ ; <nl> private boolean fullScanMode_ ; <nl> + private boolean storeIndexInFile_ ; <nl> } <nl> mmm a / java / src / test / java / org / rocksdb / PlainTableConfigTest . java <nl> ppp b / java / src / test / java / org / rocksdb / PlainTableConfigTest . java <nl> public void fullScanMode ( ) { <nl> plainTableConfig . setFullScanMode ( true ) ; <nl> assertThat ( plainTableConfig . fullScanMode ( ) ) . isTrue ( ) ; } <nl> <nl> + @ Test <nl> + public void storeIndexInFile ( ) { <nl> + PlainTableConfig plainTableConfig = new PlainTableConfig ( ) ; <nl> + plainTableConfig . setStoreIndexInFile ( true ) ; <nl> + assertThat ( plainTableConfig . storeIndexInFile ( ) ) . <nl> + isTrue ( ) ; <nl> + } <nl> + <nl> @ Test <nl> public void plainTableConfig ( ) { <nl> try ( final Options opt = new Options ( ) ) { <nl> mmm a / options / options_test . cc <nl> ppp b / options / options_test . cc <nl> TEST_F ( OptionsTest , GetPlainTableOptionsFromString ) { <nl> ASSERT_EQ ( new_opt . huge_page_tlb_size , 4 ) ; <nl> ASSERT_EQ ( new_opt . encoding_type , EncodingType : : kPrefix ) ; <nl> ASSERT_TRUE ( new_opt . full_scan_mode ) ; <nl> + ASSERT_TRUE ( new_opt . store_index_in_file ) ; <nl> <nl> / / unknown option <nl> ASSERT_NOK ( GetPlainTableOptionsFromString ( table_opt , <nl> mmm a / table / plain_table_builder . cc <nl> ppp b / table / plain_table_builder . cc <nl> <nl> # include " table / plain_table_factory . h " <nl> # include " db / dbformat . h " <nl> # include " table / block_builder . h " <nl> + # include " table / bloom_block . h " <nl> # include " table / plain_table_index . h " <nl> # include " table / format . h " <nl> # include " table / meta_blocks . h " <nl> PlainTableBuilder : : PlainTableBuilder ( <nl> int_tbl_prop_collector_factories , <nl> uint32_t column_family_id , WritableFileWriter * file , uint32_t user_key_len , <nl> EncodingType encoding_type , size_t index_sparseness , <nl> - const std : : string & column_family_name ) <nl> + uint32_t bloom_bits_per_key , const std : : string & column_family_name , <nl> + uint32_t num_probes , size_t huge_page_tlb_size , double hash_table_ratio , <nl> + bool store_index_in_file ) <nl> : ioptions_ ( ioptions ) , <nl> moptions_ ( moptions ) , <nl> + bloom_block_ ( num_probes ) , <nl> file_ ( file ) , <nl> + bloom_bits_per_key_ ( bloom_bits_per_key ) , <nl> + huge_page_tlb_size_ ( huge_page_tlb_size ) , <nl> encoder_ ( encoding_type , user_key_len , moptions . prefix_extractor . get ( ) , <nl> index_sparseness ) , <nl> + store_index_in_file_ ( store_index_in_file ) , <nl> prefix_extractor_ ( moptions . prefix_extractor . get ( ) ) { <nl> + / / Build index block and save it in the file if hash_table_ratio > 0 <nl> + if ( store_index_in_file_ ) { <nl> + assert ( hash_table_ratio > 0 | | IsTotalOrderMode ( ) ) ; <nl> + index_builder_ . reset ( new PlainTableIndexBuilder ( <nl> + & arena_ , ioptions , moptions . prefix_extractor . get ( ) , index_sparseness , <nl> + hash_table_ratio , huge_page_tlb_size_ ) ) ; <nl> + properties_ . user_collected_properties <nl> + [ PlainTablePropertyNames : : kBloomVersion ] = " 1 " ; / / For future use <nl> + } <nl> + <nl> properties_ . fixed_key_len = user_key_len ; <nl> <nl> / / for plain table , we put all the data in a big chuck . <nl> properties_ . num_data_blocks = 1 ; <nl> + / / Fill it later if store_index_in_file_ = = true <nl> properties_ . index_size = 0 ; <nl> properties_ . filter_size = 0 ; <nl> / / To support roll - back to previous version , now still use version 0 for <nl> void PlainTableBuilder : : Add ( const Slice & key , const Slice & value ) { <nl> return ; <nl> } <nl> <nl> + / / Store key hash <nl> + if ( store_index_in_file_ ) { <nl> + if ( moptions_ . prefix_extractor = = nullptr ) { <nl> + keys_or_prefixes_hashes_ . push_back ( GetSliceHash ( internal_key . user_key ) ) ; <nl> + } else { <nl> + Slice prefix = <nl> + moptions_ . prefix_extractor - > Transform ( internal_key . user_key ) ; <nl> + keys_or_prefixes_hashes_ . push_back ( GetSliceHash ( prefix ) ) ; <nl> + } <nl> + } <nl> + <nl> / / Write value <nl> assert ( offset_ < = std : : numeric_limits < uint32_t > : : max ( ) ) ; <nl> + auto prev_offset = static_cast < uint32_t > ( offset_ ) ; <nl> / / Write out the key <nl> encoder_ . AppendKey ( key , file_ , & offset_ , meta_bytes_buf , <nl> & meta_bytes_buf_size ) ; <nl> + if ( SaveIndexInFile ( ) ) { <nl> + index_builder_ - > AddKeyPrefix ( GetPrefix ( internal_key ) , prev_offset ) ; <nl> + } <nl> <nl> / / Write value length <nl> uint32_t value_size = static_cast < uint32_t > ( value . size ( ) ) ; <nl> Status PlainTableBuilder : : Finish ( ) { <nl> <nl> MetaIndexBuilder meta_index_builer ; <nl> <nl> + if ( store_index_in_file_ & & ( properties_ . num_entries > 0 ) ) { <nl> + assert ( properties_ . num_entries < = std : : numeric_limits < uint32_t > : : max ( ) ) ; <nl> + Status s ; <nl> + BlockHandle bloom_block_handle ; <nl> + if ( bloom_bits_per_key_ > 0 ) { <nl> + bloom_block_ . SetTotalBits ( <nl> + & arena_ , <nl> + static_cast < uint32_t > ( properties_ . num_entries ) * bloom_bits_per_key_ , <nl> + ioptions_ . bloom_locality , huge_page_tlb_size_ , ioptions_ . info_log ) ; <nl> + <nl> + PutVarint32 ( & properties_ . user_collected_properties <nl> + [ PlainTablePropertyNames : : kNumBloomBlocks ] , <nl> + bloom_block_ . GetNumBlocks ( ) ) ; <nl> + <nl> + bloom_block_ . AddKeysHashes ( keys_or_prefixes_hashes_ ) ; <nl> + <nl> + Slice bloom_finish_result = bloom_block_ . Finish ( ) ; <nl> + <nl> + properties_ . filter_size = bloom_finish_result . size ( ) ; <nl> + s = WriteBlock ( bloom_finish_result , file_ , & offset_ , & bloom_block_handle ) ; <nl> + <nl> + if ( ! s . ok ( ) ) { <nl> + return s ; <nl> + } <nl> + meta_index_builer . Add ( BloomBlockBuilder : : kBloomBlock , bloom_block_handle ) ; <nl> + } <nl> + BlockHandle index_block_handle ; <nl> + Slice index_finish_result = index_builder_ - > Finish ( ) ; <nl> + <nl> + properties_ . index_size = index_finish_result . size ( ) ; <nl> + s = WriteBlock ( index_finish_result , file_ , & offset_ , & index_block_handle ) ; <nl> + <nl> + if ( ! s . ok ( ) ) { <nl> + return s ; <nl> + } <nl> + <nl> + meta_index_builer . Add ( PlainTableIndexBuilder : : kPlainTableIndexBlock , <nl> + index_block_handle ) ; <nl> + } <nl> + <nl> / / Calculate bloom block size and index block size <nl> PropertyBlockBuilder property_block_builder ; <nl> / / - - Add basic properties <nl> mmm a / table / plain_table_builder . h <nl> ppp b / table / plain_table_builder . h <nl> <nl> # include " rocksdb / status . h " <nl> # include " rocksdb / table . h " <nl> # include " rocksdb / table_properties . h " <nl> + # include " table / bloom_block . h " <nl> + # include " table / plain_table_index . h " <nl> # include " table / plain_table_key_coding . h " <nl> # include " table / table_builder . h " <nl> <nl> class PlainTableBuilder : public TableBuilder { <nl> int_tbl_prop_collector_factories , <nl> uint32_t column_family_id , WritableFileWriter * file , <nl> uint32_t user_key_size , EncodingType encoding_type , <nl> - size_t index_sparseness , const std : : string & column_family_name ) ; <nl> + size_t index_sparseness , uint32_t bloom_bits_per_key , <nl> + const std : : string & column_family_name , uint32_t num_probes = 6 , <nl> + size_t huge_page_tlb_size = 0 , double hash_table_ratio = 0 , <nl> + bool store_index_in_file = false ) ; <nl> <nl> / / REQUIRES : Either Finish ( ) or Abandon ( ) has been called . <nl> ~ PlainTableBuilder ( ) ; <nl> class PlainTableBuilder : public TableBuilder { <nl> <nl> TableProperties GetTableProperties ( ) const override { return properties_ ; } <nl> <nl> + bool SaveIndexInFile ( ) const { return store_index_in_file_ ; } <nl> + <nl> private : <nl> Arena arena_ ; <nl> const ImmutableCFOptions & ioptions_ ; <nl> class PlainTableBuilder : public TableBuilder { <nl> std : : vector < std : : unique_ptr < IntTblPropCollector > > <nl> table_properties_collectors_ ; <nl> <nl> + BloomBlockBuilder bloom_block_ ; <nl> + std : : unique_ptr < PlainTableIndexBuilder > index_builder_ ; <nl> + <nl> WritableFileWriter * file_ ; <nl> uint64_t offset_ = 0 ; <nl> + uint32_t bloom_bits_per_key_ ; <nl> + size_t huge_page_tlb_size_ ; <nl> Status status_ ; <nl> TableProperties properties_ ; <nl> PlainTableKeyEncoder encoder_ ; <nl> <nl> + bool store_index_in_file_ ; <nl> + <nl> std : : vector < uint32_t > keys_or_prefixes_hashes_ ; <nl> bool closed_ = false ; / / Either Finish ( ) or Abandon ( ) has been called . <nl> <nl> mmm a / table / plain_table_factory . cc <nl> ppp b / table / plain_table_factory . cc <nl> TableBuilder * PlainTableFactory : : NewTableBuilder ( <nl> table_builder_options . ioptions , table_builder_options . moptions , <nl> table_builder_options . int_tbl_prop_collector_factories , column_family_id , <nl> file , table_options_ . user_key_len , table_options_ . encoding_type , <nl> - table_options_ . index_sparseness , <nl> - table_builder_options . column_family_name ) ; <nl> + table_options_ . index_sparseness , table_options_ . bloom_bits_per_key , <nl> + table_builder_options . column_family_name , 6 , <nl> + table_options_ . huge_page_tlb_size , table_options_ . hash_table_ratio , <nl> + table_options_ . store_index_in_file ) ; <nl> } <nl> <nl> std : : string PlainTableFactory : : GetPrintableTableOptions ( ) const { <nl> std : : string PlainTableFactory : : GetPrintableTableOptions ( ) const { <nl> snprintf ( buffer , kBufferSize , " user_key_len : % u \ n " , <nl> table_options_ . user_key_len ) ; <nl> ret . append ( buffer ) ; <nl> + snprintf ( buffer , kBufferSize , " bloom_bits_per_key : % d \ n " , <nl> + table_options_ . bloom_bits_per_key ) ; <nl> + ret . append ( buffer ) ; <nl> + snprintf ( buffer , kBufferSize , " hash_table_ratio : % lf \ n " , <nl> + table_options_ . hash_table_ratio ) ; <nl> + ret . append ( buffer ) ; <nl> snprintf ( buffer , kBufferSize , " index_sparseness : % " ROCKSDB_PRIszt " \ n " , <nl> table_options_ . index_sparseness ) ; <nl> ret . append ( buffer ) ; <nl> + snprintf ( buffer , kBufferSize , " huge_page_tlb_size : % " ROCKSDB_PRIszt " \ n " , <nl> + table_options_ . huge_page_tlb_size ) ; <nl> + ret . append ( buffer ) ; <nl> snprintf ( buffer , kBufferSize , " encoding_type : % d \ n " , <nl> table_options_ . encoding_type ) ; <nl> ret . append ( buffer ) ; <nl> snprintf ( buffer , kBufferSize , " full_scan_mode : % d \ n " , <nl> table_options_ . full_scan_mode ) ; <nl> ret . append ( buffer ) ; <nl> + snprintf ( buffer , kBufferSize , " store_index_in_file : % d \ n " , <nl> + table_options_ . store_index_in_file ) ; <nl> + ret . append ( buffer ) ; <nl> return ret ; <nl> } <nl> <nl> mmm a / table / plain_table_factory . h <nl> ppp b / table / plain_table_factory . h <nl> static std : : unordered_map < std : : string , OptionTypeInfo > plain_table_type_info = { <nl> { offsetof ( struct PlainTableOptions , full_scan_mode ) , OptionType : : kBoolean , <nl> OptionVerificationType : : kNormal , false , 0 } } , <nl> { " store_index_in_file " , <nl> - { 0 , OptionType : : kBoolean , OptionVerificationType : : kDeprecated , false , 0 } } } ; <nl> + { offsetof ( struct PlainTableOptions , store_index_in_file ) , <nl> + OptionType : : kBoolean , OptionVerificationType : : kNormal , false , 0 } } } ; <nl> <nl> } / / namespace rocksdb <nl> # endif / / ROCKSDB_LITE <nl> mmm a / table / plain_table_reader . cc <nl> ppp b / table / plain_table_reader . cc <nl> Status PlainTableReader : : PopulateIndex ( TableProperties * props , <nl> assert ( props ! = nullptr ) ; <nl> table_properties_ . reset ( props ) ; <nl> <nl> - / / index_in_file and bloom_in_file features are deprecated . <nl> - / / Even if they exist in file , ignore them and always reconstruct . <nl> + BlockContents index_block_contents ; <nl> + Status s = ReadMetaBlock ( file_info_ . file . get ( ) , nullptr / * prefetch_buffer * / , <nl> + file_size_ , kPlainTableMagicNumber , ioptions_ , <nl> + PlainTableIndexBuilder : : kPlainTableIndexBlock , <nl> + & index_block_contents , <nl> + true / * compression_type_missing * / ) ; <nl> + <nl> + bool index_in_file = s . ok ( ) ; <nl> + <nl> + BlockContents bloom_block_contents ; <nl> + bool bloom_in_file = false ; <nl> + / / We only need to read the bloom block if index block is in file . <nl> + if ( index_in_file ) { <nl> + s = ReadMetaBlock ( file_info_ . file . get ( ) , nullptr / * prefetch_buffer * / , <nl> + file_size_ , kPlainTableMagicNumber , ioptions_ , <nl> + BloomBlockBuilder : : kBloomBlock , & bloom_block_contents , <nl> + true / * compression_type_missing * / ) ; <nl> + bloom_in_file = s . ok ( ) & & bloom_block_contents . data . size ( ) > 0 ; <nl> + } <nl> + <nl> + Slice * bloom_block ; <nl> + if ( bloom_in_file ) { <nl> + / / If bloom_block_contents . allocation is not empty ( which will be the case <nl> + / / for non - mmap mode ) , it holds the alloated memory for the bloom block . <nl> + / / It needs to be kept alive to keep ` bloom_block ` valid . <nl> + bloom_block_alloc_ = std : : move ( bloom_block_contents . allocation ) ; <nl> + bloom_block = & bloom_block_contents . data ; <nl> + } else { <nl> + bloom_block = nullptr ; <nl> + } <nl> + <nl> + Slice * index_block ; <nl> + if ( index_in_file ) { <nl> + / / If index_block_contents . allocation is not empty ( which will be the case <nl> + / / for non - mmap mode ) , it holds the alloated memory for the index block . <nl> + / / It needs to be kept alive to keep ` index_block ` valid . <nl> + index_block_alloc_ = std : : move ( index_block_contents . allocation ) ; <nl> + index_block = & index_block_contents . data ; <nl> + } else { <nl> + index_block = nullptr ; <nl> + } <nl> <nl> if ( ( prefix_extractor_ = = nullptr ) & & ( hash_table_ratio ! = 0 ) ) { <nl> / / moptions . prefix_extractor is requried for a hash - based look - up . <nl> Status PlainTableReader : : PopulateIndex ( TableProperties * props , <nl> / / offset ) and append it to IndexRecordList , which is a data structure created <nl> / / to store them . <nl> <nl> - / / Allocate bloom filter here for total order mode . <nl> - if ( IsTotalOrderMode ( ) ) { <nl> - uint32_t num_bloom_bits = <nl> - static_cast < uint32_t > ( table_properties_ - > num_entries ) * <nl> - bloom_bits_per_key ; <nl> - if ( num_bloom_bits > 0 ) { <nl> - enable_bloom_ = true ; <nl> - bloom_ . SetTotalBits ( & arena_ , num_bloom_bits , ioptions_ . bloom_locality , <nl> - huge_page_tlb_size , ioptions_ . info_log ) ; <nl> + if ( ! index_in_file ) { <nl> + / / Allocate bloom filter here for total order mode . <nl> + if ( IsTotalOrderMode ( ) ) { <nl> + uint32_t num_bloom_bits = <nl> + static_cast < uint32_t > ( table_properties_ - > num_entries ) * <nl> + bloom_bits_per_key ; <nl> + if ( num_bloom_bits > 0 ) { <nl> + enable_bloom_ = true ; <nl> + bloom_ . SetTotalBits ( & arena_ , num_bloom_bits , ioptions_ . bloom_locality , <nl> + huge_page_tlb_size , ioptions_ . info_log ) ; <nl> + } <nl> + } <nl> + } else if ( bloom_in_file ) { <nl> + enable_bloom_ = true ; <nl> + auto num_blocks_property = props - > user_collected_properties . find ( <nl> + PlainTablePropertyNames : : kNumBloomBlocks ) ; <nl> + <nl> + uint32_t num_blocks = 0 ; <nl> + if ( num_blocks_property ! = props - > user_collected_properties . end ( ) ) { <nl> + Slice temp_slice ( num_blocks_property - > second ) ; <nl> + if ( ! GetVarint32 ( & temp_slice , & num_blocks ) ) { <nl> + num_blocks = 0 ; <nl> + } <nl> } <nl> + / / cast away const qualifier , because bloom_ won ' t be changed <nl> + bloom_ . SetRawData ( <nl> + const_cast < unsigned char * > ( <nl> + reinterpret_cast < const unsigned char * > ( bloom_block - > data ( ) ) ) , <nl> + static_cast < uint32_t > ( bloom_block - > size ( ) ) * 8 , num_blocks ) ; <nl> + } else { <nl> + / / Index in file but no bloom in file . Disable bloom filter in this case . <nl> + enable_bloom_ = false ; <nl> + bloom_bits_per_key = 0 ; <nl> } <nl> + <nl> PlainTableIndexBuilder index_builder ( & arena_ , ioptions_ , prefix_extractor_ , <nl> index_sparseness , hash_table_ratio , <nl> huge_page_tlb_size ) ; <nl> <nl> std : : vector < uint32_t > prefix_hashes ; <nl> - Status s = PopulateIndexRecordList ( & index_builder , & prefix_hashes ) ; <nl> - if ( ! s . ok ( ) ) { <nl> - return s ; <nl> + if ( ! index_in_file ) { <nl> + s = PopulateIndexRecordList ( & index_builder , & prefix_hashes ) ; <nl> + if ( ! s . ok ( ) ) { <nl> + return s ; <nl> + } <nl> + } else { <nl> + s = index_ . InitFromRawData ( * index_block ) ; <nl> + if ( ! s . ok ( ) ) { <nl> + return s ; <nl> + } <nl> + } <nl> + <nl> + if ( ! index_in_file ) { <nl> + / / Calculated bloom filter size and allocate memory for <nl> + / / bloom filter based on the number of prefixes , then fill it . <nl> + AllocateAndFillBloom ( bloom_bits_per_key , index_ . GetNumPrefixes ( ) , <nl> + huge_page_tlb_size , & prefix_hashes ) ; <nl> } <nl> - / / Calculated bloom filter size and allocate memory for <nl> - / / bloom filter based on the number of prefixes , then fill it . <nl> - AllocateAndFillBloom ( bloom_bits_per_key , index_ . GetNumPrefixes ( ) , <nl> - huge_page_tlb_size , & prefix_hashes ) ; <nl> <nl> / / Fill two table properties . <nl> - props - > user_collected_properties [ " plain_table_hash_table_size " ] = <nl> - ToString ( index_ . GetIndexSize ( ) * PlainTableIndex : : kOffsetLen ) ; <nl> - props - > user_collected_properties [ " plain_table_sub_index_size " ] = <nl> - ToString ( index_ . GetSubIndexSize ( ) ) ; <nl> + if ( ! index_in_file ) { <nl> + props - > user_collected_properties [ " plain_table_hash_table_size " ] = <nl> + ToString ( index_ . GetIndexSize ( ) * PlainTableIndex : : kOffsetLen ) ; <nl> + props - > user_collected_properties [ " plain_table_sub_index_size " ] = <nl> + ToString ( index_ . GetSubIndexSize ( ) ) ; <nl> + } else { <nl> + props - > user_collected_properties [ " plain_table_hash_table_size " ] = <nl> + ToString ( 0 ) ; <nl> + props - > user_collected_properties [ " plain_table_sub_index_size " ] = <nl> + ToString ( 0 ) ; <nl> + } <nl> <nl> return Status : : OK ( ) ; <nl> } <nl>
Revert " Remove PlainTable ' s feature store_index_in_file ( ) " ( )
facebook/rocksdb
0920bf4e684cde9747470faf5adae872d176ba21
2019-03-01T23:45:45Z
mmm a / addons / xbmc . debug / resources / language / English / strings . po <nl> ppp b / addons / xbmc . debug / resources / language / English / strings . po <nl> msgstr " " <nl> msgctxt " # 30005 " <nl> msgid " Verbose logging for DBUS calls " <nl> msgstr " " <nl> + <nl> + msgctxt " # 30006 " <nl> + msgid " Verbose logging for JSON - RPC requests " <nl> + msgstr " " <nl> mmm a / addons / xbmc . debug / resources / settings . xml <nl> ppp b / addons / xbmc . debug / resources / settings . xml <nl> <nl> < setting id = " bit4 " type = " bool " label = " 30003 " default = " 0 " / > <nl> < setting id = " bit5 " type = " bool " label = " 30004 " default = " 0 " / > <nl> < setting id = " bit6 " type = " bool " label = " 30005 " default = " 0 " / > <nl> + < setting id = " bit7 " type = " bool " label = " 30006 " default = " 0 " / > <nl> < / settings > <nl> mmm a / xbmc / commons / ilog . h <nl> ppp b / xbmc / commons / ilog . h <nl> <nl> # define LOGFFMPEG ( 1 < < ( LOGMASKBIT + 3 ) ) <nl> # define LOGRTMP ( 1 < < ( LOGMASKBIT + 4 ) ) <nl> # define LOGDBUS ( 1 < < ( LOGMASKBIT + 5 ) ) <nl> + # define LOGJSONRPC ( 1 < < ( LOGMASKBIT + 6 ) ) <nl> <nl> # ifdef __GNUC__ <nl> # define ATTRIB_LOG_FORMAT __attribute__ ( ( format ( printf , 3 , 4 ) ) ) <nl> mmm a / xbmc / interfaces / json - rpc / JSONRPC . cpp <nl> ppp b / xbmc / interfaces / json - rpc / JSONRPC . cpp <nl> CStdString CJSONRPC : : MethodCall ( const CStdString & inputString , ITransportLayer * <nl> CVariant inputroot , outputroot , result ; <nl> bool hasResponse = false ; <nl> <nl> - CLog : : Log ( LOGDEBUG , " JSONRPC : Incoming request : % s " , inputString . c_str ( ) ) ; <nl> + if ( g_advancedSettings . m_extraLogLevels & LOGJSONRPC ) <nl> + CLog : : Log ( LOGDEBUG , " JSONRPC : Incoming request : % s " , inputString . c_str ( ) ) ; <nl> + <nl> inputroot = CJSONVariantParser : : Parse ( ( unsigned char * ) inputString . c_str ( ) , inputString . length ( ) ) ; <nl> if ( ! inputroot . isNull ( ) ) <nl> { <nl> mmm a / xbmc / interfaces / json - rpc / JSONServiceDescription . cpp <nl> ppp b / xbmc / interfaces / json - rpc / JSONServiceDescription . cpp <nl> bool CJSONServiceDescription : : AddType ( const std : : string & jsonType ) <nl> <nl> if ( ! globalType - > Parse ( descriptionObject [ typeName ] ) ) <nl> { <nl> - CLog : : Log ( LOGERROR , " JSONRPC : Could not parse type \ " % s \ " " , typeName . c_str ( ) ) ; <nl> + CLog : : Log ( LOGWARNING , " JSONRPC : Could not parse type \ " % s \ " " , typeName . c_str ( ) ) ; <nl> CJSONServiceDescription : : removeReferenceTypeDefinition ( typeName ) ; <nl> if ( ! globalType - > missingReference . empty ( ) ) <nl> { <nl>
Merge pull request from Montellese / jsonrpc_optional_logging
xbmc/xbmc
3deb74ba375631cc789fba6a5cc71aed1f48889d
2014-03-15T01:05:55Z
mmm a / arangod / RestHandler / RestReplicationHandler . cpp <nl> ppp b / arangod / RestHandler / RestReplicationHandler . cpp <nl> void RestReplicationHandler : : handleCommandRestoreDataCoordinator ( ) { <nl> ClusterCommResult * result ; <nl> CoordTransactionID coordTransactionID = TRI_NewTickServer ( ) ; <nl> <nl> + bool force = false ; <nl> + char const * value ; <nl> + string forceopt ; <nl> + value = _request - > value ( " force " ) ; <nl> + if ( value ! = nullptr ) { <nl> + force = StringUtils : : boolean ( value ) ; <nl> + if ( force ) { <nl> + forceopt = " & force = true " ; <nl> + } <nl> + } <nl> + <nl> for ( it = shardIdsMap . begin ( ) ; it ! = shardIdsMap . end ( ) ; + + it ) { <nl> map < string , string > * headers = new map < string , string > ; <nl> it2 = shardTab . find ( it - > first ) ; <nl> void RestReplicationHandler : : handleCommandRestoreDataCoordinator ( ) { <nl> triagens : : rest : : HttpRequest : : HTTP_REQUEST_PUT , <nl> " / _db / " + StringUtils : : urlEncode ( dbName ) + <nl> " / _api / replication / restore - data ? collection = " + <nl> - it - > first , <nl> + it - > first + forceopt , <nl> new string ( bufs [ j ] - > c_str ( ) , bufs [ j ] - > length ( ) ) , <nl> true , headers , NULL , 300 . 0 ) ; <nl> delete result ; <nl>
Hand on - - force option of arangorestore .
arangodb/arangodb
4e95044faa4f9dbccabe51ddbe59b0879b256b08
2014-07-10T12:34:21Z
mmm a / src / codegen / compiler . cc <nl> ppp b / src / codegen / compiler . cc <nl> <nl> # include " src / objects / map . h " <nl> # include " src / objects / object - list - macros . h " <nl> # include " src / objects / shared - function - info . h " <nl> - # include " src / objects / string . h " <nl> # include " src / parsing / parse - info . h " <nl> # include " src / parsing / parser . h " <nl> # include " src / parsing / parsing . h " <nl> void FixUpOffThreadAllocatedScript ( Isolate * isolate , Handle < Script > script , <nl> LOG ( isolate , ScriptDetails ( * script ) ) ; <nl> } <nl> <nl> - MaybeHandle < SharedFunctionInfo > CompileScriptOnMainThread ( <nl> - const UnoptimizedCompileFlags flags , Handle < String > source , <nl> - const Compiler : : ScriptDetails & script_details , <nl> - ScriptOriginOptions origin_options , NativesFlag natives , <nl> - v8 : : Extension * extension , Isolate * isolate , <nl> - IsCompiledScope * is_compiled_scope ) { <nl> - UnoptimizedCompileState compile_state ( isolate ) ; <nl> - ParseInfo parse_info ( isolate , flags , & compile_state ) ; <nl> - parse_info . set_extension ( extension ) ; <nl> - <nl> - Handle < Script > script = NewScript ( isolate , & parse_info , source , <nl> - script_details , origin_options , natives ) ; <nl> - DCHECK_IMPLIES ( parse_info . flags ( ) . collect_type_profile ( ) , <nl> - script - > IsUserJavaScript ( ) ) ; <nl> - DCHECK_EQ ( parse_info . flags ( ) . is_repl_mode ( ) , script - > is_repl_mode ( ) ) ; <nl> - <nl> - return CompileToplevel ( & parse_info , script , isolate , is_compiled_scope ) ; <nl> - } <nl> - <nl> - class StressBackgroundCompileThread : public base : : Thread { <nl> - public : <nl> - StressBackgroundCompileThread ( Isolate * isolate , Handle < String > source ) <nl> - : base : : Thread ( <nl> - base : : Thread : : Options ( " StressBackgroundCompileThread " , 2 * i : : MB ) ) , <nl> - source_ ( source ) , <nl> - streamed_source_ ( std : : make_unique < SourceStream > ( source , isolate ) , <nl> - v8 : : ScriptCompiler : : StreamedSource : : UTF8 ) { <nl> - data ( ) - > task = std : : make_unique < i : : BackgroundCompileTask > ( data ( ) , isolate ) ; <nl> - } <nl> - <nl> - void Run ( ) override { data ( ) - > task - > Run ( ) ; } <nl> - <nl> - ScriptStreamingData * data ( ) { return streamed_source_ . impl ( ) ; } <nl> - <nl> - private : <nl> - / / Dummy external source stream which returns the whole source in one go . <nl> - / / TODO ( leszeks ) : Also test chunking the data . <nl> - class SourceStream : public v8 : : ScriptCompiler : : ExternalSourceStream { <nl> - public : <nl> - SourceStream ( Handle < String > source , Isolate * isolate ) : done_ ( false ) { <nl> - source_buffer_ = source - > ToCString ( ALLOW_NULLS , FAST_STRING_TRAVERSAL , <nl> - & source_length_ ) ; <nl> - } <nl> - <nl> - size_t GetMoreData ( const uint8_t * * src ) override { <nl> - if ( done_ ) { <nl> - return 0 ; <nl> - } <nl> - * src = reinterpret_cast < uint8_t * > ( source_buffer_ . release ( ) ) ; <nl> - done_ = true ; <nl> - <nl> - return source_length_ ; <nl> - } <nl> - <nl> - private : <nl> - int source_length_ ; <nl> - std : : unique_ptr < char [ ] > source_buffer_ ; <nl> - bool done_ ; <nl> - } ; <nl> - <nl> - Handle < String > source_ ; <nl> - v8 : : ScriptCompiler : : StreamedSource streamed_source_ ; <nl> - } ; <nl> - <nl> - bool CanBackgroundCompile ( const Compiler : : ScriptDetails & script_details , <nl> - ScriptOriginOptions origin_options , <nl> - v8 : : Extension * extension , <nl> - ScriptCompiler : : CompileOptions compile_options , <nl> - NativesFlag natives ) { <nl> - / / TODO ( leszeks ) : Remove the module check once background compilation of <nl> - / / modules is supported . <nl> - return ! origin_options . IsModule ( ) & & ! extension & & <nl> - script_details . repl_mode = = REPLMode : : kNo & & <nl> - compile_options = = ScriptCompiler : : kNoCompileOptions & & <nl> - natives = = NOT_NATIVES_CODE ; <nl> - } <nl> - <nl> - MaybeHandle < SharedFunctionInfo > CompileScriptOnBothBackgroundAndMainThread ( <nl> - Handle < String > source , const Compiler : : ScriptDetails & script_details , <nl> - ScriptOriginOptions origin_options , Isolate * isolate , <nl> - IsCompiledScope * is_compiled_scope ) { <nl> - / / Start a background thread compiling the script . <nl> - StressBackgroundCompileThread background_compile_thread ( isolate , source ) ; <nl> - <nl> - UnoptimizedCompileFlags flags_copy = <nl> - background_compile_thread . data ( ) - > task - > flags ( ) ; <nl> - <nl> - CHECK ( background_compile_thread . Start ( ) ) ; <nl> - MaybeHandle < SharedFunctionInfo > main_thread_maybe_result ; <nl> - / / In parallel , compile on the main thread to flush out any data races . <nl> - { <nl> - IsCompiledScope inner_is_compiled_scope ; <nl> - / / The background thread should also create any relevant exceptions , so we <nl> - / / can ignore the main - thread created ones . <nl> - / / TODO ( leszeks ) : Maybe verify that any thrown ( or unthrown ) exceptions are <nl> - / / equivalent . <nl> - TryCatch ignore_try_catch ( reinterpret_cast < v8 : : Isolate * > ( isolate ) ) ; <nl> - flags_copy . set_script_id ( Script : : kTemporaryScriptId ) ; <nl> - main_thread_maybe_result = CompileScriptOnMainThread ( <nl> - flags_copy , source , script_details , origin_options , NOT_NATIVES_CODE , <nl> - nullptr , isolate , & inner_is_compiled_scope ) ; <nl> - } <nl> - / / Join with background thread and finalize compilation . <nl> - background_compile_thread . Join ( ) ; <nl> - MaybeHandle < SharedFunctionInfo > maybe_result = <nl> - Compiler : : GetSharedFunctionInfoForStreamedScript ( <nl> - isolate , source , script_details , origin_options , <nl> - background_compile_thread . data ( ) ) ; <nl> - <nl> - / / Either both compiles should succeed , or both should fail . <nl> - / / TODO ( leszeks ) : Compare the contents of the results of the two compiles . <nl> - CHECK_EQ ( maybe_result . is_null ( ) , main_thread_maybe_result . is_null ( ) ) ; <nl> - <nl> - Handle < SharedFunctionInfo > result ; <nl> - if ( maybe_result . ToHandle ( & result ) ) { <nl> - * is_compiled_scope = result - > is_compiled_scope ( ) ; <nl> - } <nl> - <nl> - return maybe_result ; <nl> - } <nl> - <nl> } / / namespace <nl> <nl> MaybeHandle < SharedFunctionInfo > Compiler : : GetSharedFunctionInfoForScript ( <nl> MaybeHandle < SharedFunctionInfo > Compiler : : GetSharedFunctionInfoForScript ( <nl> <nl> if ( maybe_result . is_null ( ) ) { <nl> / / No cache entry found compile the script . <nl> - if ( FLAG_stress_background_compile & & <nl> - CanBackgroundCompile ( script_details , origin_options , extension , <nl> - compile_options , natives ) ) { <nl> - / / If the - - stress - background - compile flag is set , do the actual <nl> - / / compilation on a background thread , and wait for its result . <nl> - maybe_result = CompileScriptOnBothBackgroundAndMainThread ( <nl> - source , script_details , origin_options , isolate , & is_compiled_scope ) ; <nl> - } else { <nl> - UnoptimizedCompileFlags flags = <nl> - UnoptimizedCompileFlags : : ForToplevelCompile ( <nl> - isolate , natives = = NOT_NATIVES_CODE , language_mode , <nl> - script_details . repl_mode ) ; <nl> + UnoptimizedCompileFlags flags = UnoptimizedCompileFlags : : ForToplevelCompile ( <nl> + isolate , natives = = NOT_NATIVES_CODE , language_mode , <nl> + script_details . repl_mode ) ; <nl> <nl> - flags . set_is_eager ( compile_options = = ScriptCompiler : : kEagerCompile ) ; <nl> - flags . set_is_module ( origin_options . IsModule ( ) ) ; <nl> + flags . set_is_module ( origin_options . IsModule ( ) ) ; <nl> + flags . set_is_eager ( compile_options = = ScriptCompiler : : kEagerCompile ) ; <nl> <nl> - maybe_result = CompileScriptOnMainThread ( <nl> - flags , source , script_details , origin_options , natives , extension , <nl> - isolate , & is_compiled_scope ) ; <nl> - } <nl> + UnoptimizedCompileState compile_state ( isolate ) ; <nl> + ParseInfo parse_info ( isolate , flags , & compile_state ) ; <nl> + parse_info . set_extension ( extension ) ; <nl> + <nl> + Handle < Script > script = NewScript ( isolate , & parse_info , source , <nl> + script_details , origin_options , natives ) ; <nl> + DCHECK_IMPLIES ( parse_info . flags ( ) . collect_type_profile ( ) , <nl> + script - > IsUserJavaScript ( ) ) ; <nl> + DCHECK_EQ ( parse_info . flags ( ) . is_repl_mode ( ) , script - > is_repl_mode ( ) ) ; <nl> <nl> - / / Add the result to the isolate cache . <nl> + / / Compile the function and add it to the isolate cache . <nl> + maybe_result = <nl> + CompileToplevel ( & parse_info , script , isolate , & is_compiled_scope ) ; <nl> Handle < SharedFunctionInfo > result ; <nl> if ( extension = = nullptr & & maybe_result . ToHandle ( & result ) ) { <nl> DCHECK ( is_compiled_scope . is_compiled ( ) ) ; <nl> mmm a / src / codegen / compiler . h <nl> ppp b / src / codegen / compiler . h <nl> class V8_EXPORT_PRIVATE BackgroundCompileTask { <nl> UnoptimizedCompilationJobList * inner_function_jobs ( ) { <nl> return & inner_function_jobs_ ; <nl> } <nl> - UnoptimizedCompileFlags flags ( ) const { return flags_ ; } <nl> LanguageMode language_mode ( ) { return language_mode_ ; } <nl> bool collected_source_positions ( ) { return collected_source_positions_ ; } <nl> bool finalize_on_background_thread ( ) { <nl> mmm a / src / d8 / d8 . cc <nl> ppp b / src / d8 / d8 . cc <nl> ArrayBuffer : : Allocator * Shell : : array_buffer_allocator ; <nl> ShellOptions Shell : : options ; <nl> base : : OnceType Shell : : quit_once_ = V8_ONCE_INIT ; <nl> <nl> + / / Dummy external source stream which returns the whole source in one go . <nl> + class DummySourceStream : public v8 : : ScriptCompiler : : ExternalSourceStream { <nl> + public : <nl> + DummySourceStream ( Local < String > source , Isolate * isolate ) : done_ ( false ) { <nl> + source_length_ = source - > Utf8Length ( isolate ) ; <nl> + source_buffer_ . reset ( new uint8_t [ source_length_ ] ) ; <nl> + source - > WriteUtf8 ( isolate , reinterpret_cast < char * > ( source_buffer_ . get ( ) ) , <nl> + source_length_ ) ; <nl> + } <nl> + <nl> + size_t GetMoreData ( const uint8_t * * src ) override { <nl> + if ( done_ ) { <nl> + return 0 ; <nl> + } <nl> + * src = source_buffer_ . release ( ) ; <nl> + done_ = true ; <nl> + <nl> + return source_length_ ; <nl> + } <nl> + <nl> + private : <nl> + int source_length_ ; <nl> + std : : unique_ptr < uint8_t [ ] > source_buffer_ ; <nl> + bool done_ ; <nl> + } ; <nl> + <nl> + class BackgroundCompileThread : public base : : Thread { <nl> + public : <nl> + BackgroundCompileThread ( Isolate * isolate , Local < String > source ) <nl> + : base : : Thread ( GetThreadOptions ( " BackgroundCompileThread " ) ) , <nl> + source_ ( source ) , <nl> + streamed_source_ ( std : : make_unique < DummySourceStream > ( source , isolate ) , <nl> + v8 : : ScriptCompiler : : StreamedSource : : UTF8 ) , <nl> + task_ ( v8 : : ScriptCompiler : : StartStreamingScript ( isolate , <nl> + & streamed_source_ ) ) { } <nl> + <nl> + void Run ( ) override { task_ - > Run ( ) ; } <nl> + <nl> + v8 : : ScriptCompiler : : StreamedSource * streamed_source ( ) { <nl> + return & streamed_source_ ; <nl> + } <nl> + <nl> + private : <nl> + Local < String > source_ ; <nl> + v8 : : ScriptCompiler : : StreamedSource streamed_source_ ; <nl> + std : : unique_ptr < v8 : : ScriptCompiler : : ScriptStreamingTask > task_ ; <nl> + } ; <nl> + <nl> ScriptCompiler : : CachedData * Shell : : LookupCodeCache ( Isolate * isolate , <nl> Local < Value > source ) { <nl> base : : MutexGuard lock_guard ( cached_code_mutex_ . Pointer ( ) ) ; <nl> bool Shell : : ExecuteString ( Isolate * isolate , Local < String > source , <nl> maybe_script = ScriptCompiler : : Compile ( <nl> context , & script_source , ScriptCompiler : : kNoCompileOptions ) ; <nl> } <nl> + } else if ( options . stress_background_compile ) { <nl> + / / Start a background thread compiling the script . <nl> + BackgroundCompileThread background_compile_thread ( isolate , source ) ; <nl> + CHECK ( background_compile_thread . Start ( ) ) ; <nl> + <nl> + / / In parallel , compile on the main thread to flush out any data races . <nl> + { <nl> + TryCatch ignore_try_catch ( isolate ) ; <nl> + ScriptCompiler : : Source script_source ( source , origin ) ; <nl> + USE ( ScriptCompiler : : Compile ( context , & script_source , <nl> + ScriptCompiler : : kNoCompileOptions ) ) ; <nl> + } <nl> + <nl> + / / Join with background thread and finalize compilation . <nl> + background_compile_thread . Join ( ) ; <nl> + maybe_script = v8 : : ScriptCompiler : : Compile ( <nl> + context , background_compile_thread . streamed_source ( ) , source , origin ) ; <nl> } else { <nl> ScriptCompiler : : Source script_source ( source , origin ) ; <nl> maybe_script = ScriptCompiler : : Compile ( context , & script_source , <nl> bool Shell : : SetOptions ( int argc , char * argv [ ] ) { <nl> strcmp ( argv [ i ] , " - - no - stress - opt " ) = = 0 ) { <nl> options . stress_opt = false ; <nl> argv [ i ] = nullptr ; <nl> + } else if ( strcmp ( argv [ i ] , " - - stress - background - compile " ) = = 0 ) { <nl> + options . stress_background_compile = true ; <nl> + argv [ i ] = nullptr ; <nl> + } else if ( strcmp ( argv [ i ] , " - - nostress - background - compile " ) = = 0 | | <nl> + strcmp ( argv [ i ] , " - - no - stress - background - compile " ) = = 0 ) { <nl> + options . stress_background_compile = false ; <nl> + argv [ i ] = nullptr ; <nl> } else if ( strcmp ( argv [ i ] , " - - noalways - opt " ) = = 0 | | <nl> strcmp ( argv [ i ] , " - - no - always - opt " ) = = 0 ) { <nl> / / No support for stressing if we can ' t use - - always - opt . <nl> mmm a / src / d8 / d8 . h <nl> ppp b / src / d8 / d8 . h <nl> class ShellOptions { <nl> int num_isolates = 1 ; <nl> v8 : : ScriptCompiler : : CompileOptions compile_options = <nl> v8 : : ScriptCompiler : : kNoCompileOptions ; <nl> + bool stress_background_compile = false ; <nl> CodeCacheOptions code_cache_options = CodeCacheOptions : : kNoProduceCache ; <nl> SourceGroup * isolate_sources = nullptr ; <nl> const char * icu_data_file = nullptr ; <nl> mmm a / src / flags / flag - definitions . h <nl> ppp b / src / flags / flag - definitions . h <nl> DEFINE_BOOL ( enable_regexp_unaligned_accesses , true , <nl> <nl> / / api . cc <nl> DEFINE_BOOL ( script_streaming , true , " enable parsing on background " ) <nl> - DEFINE_BOOL ( stress_background_compile , false , <nl> - " stress test parsing on background " ) <nl> DEFINE_BOOL ( <nl> finalize_streaming_on_background , false , <nl> " perform the script streaming finalization on the background thread " ) <nl> mmm a / src / heap / factory - base . cc <nl> ppp b / src / heap / factory - base . cc <nl> Handle < Script > FactoryBase < Impl > : : NewScriptWithId ( Handle < String > source , <nl> script - > set_flags ( 0 ) ; <nl> script - > set_host_defined_options ( roots . empty_fixed_array ( ) ) ; <nl> <nl> - if ( script_id ! = Script : : kTemporaryScriptId ) { <nl> - impl ( ) - > AddToScriptList ( script ) ; <nl> - } <nl> + impl ( ) - > AddToScriptList ( script ) ; <nl> <nl> LOG ( isolate ( ) , ScriptEvent ( Logger : : ScriptEventType : : kCreate , script_id ) ) ; <nl> return script ; <nl> mmm a / src / objects / script . h <nl> ppp b / src / objects / script . h <nl> namespace internal { <nl> / / Script describes a script which has been added to the VM . <nl> class Script : public Struct { <nl> public : <nl> - / / Script ID used for temporary scripts , which shouldn ' t be added to the <nl> - / / script list . <nl> - static constexpr int kTemporaryScriptId = - 2 ; <nl> - <nl> NEVER_READ_ONLY_SPACE <nl> / / Script types . <nl> enum Type { <nl> mmm a / src / parsing / parse - info . cc <nl> ppp b / src / parsing / parse - info . cc <nl> UnoptimizedCompileFlags UnoptimizedCompileFlags : : ForToplevelFunction ( <nl> <nl> / / static <nl> UnoptimizedCompileFlags UnoptimizedCompileFlags : : ForTest ( Isolate * isolate ) { <nl> - return UnoptimizedCompileFlags ( isolate , Script : : kTemporaryScriptId ) ; <nl> + return UnoptimizedCompileFlags ( isolate , - 1 ) ; <nl> } <nl> <nl> template < typename T > <nl> Handle < Script > ParseInfo : : CreateScript ( <nl> MaybeHandle < FixedArray > maybe_wrapped_arguments , <nl> ScriptOriginOptions origin_options , NativesFlag natives ) { <nl> / / Create a script object describing the script to be compiled . <nl> - DCHECK ( flags ( ) . script_id ( ) > = 0 | | <nl> - flags ( ) . script_id ( ) = = Script : : kTemporaryScriptId ) ; <nl> + DCHECK_GE ( flags ( ) . script_id ( ) , 0 ) ; <nl> Handle < Script > script = <nl> isolate - > factory ( ) - > NewScriptWithId ( source , flags ( ) . script_id ( ) ) ; <nl> if ( isolate - > NeedsSourcePositionsForProfiling ( ) ) { <nl> mmm a / test / cctest / test - log . cc <nl> ppp b / test / cctest / test - log . cc <nl> UNINITIALIZED_TEST ( ExternalCodeEventListenerInnerFunctions ) { <nl> v8 : : Local < v8 : : UnboundScript > script = <nl> v8 : : ScriptCompiler : : CompileUnboundScript ( isolate1 , & source ) <nl> . ToLocalChecked ( ) ; <nl> - CHECK_EQ ( code_event_handler . CountLines ( " Script " , " f1 " ) , <nl> - i : : FLAG_stress_background_compile ? 2 : 1 ) ; <nl> - CHECK_EQ ( code_event_handler . CountLines ( " Script " , " f2 " ) , <nl> - i : : FLAG_stress_background_compile ? 2 : 1 ) ; <nl> + CHECK_EQ ( code_event_handler . CountLines ( " Script " , " f1 " ) , 1 ) ; <nl> + CHECK_EQ ( code_event_handler . CountLines ( " Script " , " f2 " ) , 1 ) ; <nl> cache = v8 : : ScriptCompiler : : CreateCodeCache ( script ) ; <nl> } <nl> isolate1 - > Dispose ( ) ; <nl>
Revert " [ offthread ] Move stress - background - compile to compiler . cc "
v8/v8
5f040f9b01d9d715b3ff61b733e58867212c8681
2020-04-23T20:09:14Z
Binary files a / Tutorials / ImageHandsOn / cifar10 . pretrained . cmf and b / Tutorials / ImageHandsOn / cifar10 . pretrained . cmf differ <nl>
updated pretrained model
microsoft/CNTK
3d5d78fbb7c9bac59b661481b4faddec31443211
2016-09-16T05:24:05Z
mmm a / tools / SourceKit / tools / sourcekitd / include / sourcekitd / sourcekitd . h <nl> ppp b / tools / SourceKit / tools / sourcekitd / include / sourcekitd / sourcekitd . h <nl> <nl> # define SOURCEKITD_HAS_BLOCKS 0 <nl> # endif <nl> <nl> - # ifdef __GNUC__ <nl> + # if defined ( __clang__ ) | | defined ( __GNUC__ ) <nl> # define SOURCEKITD_WARN_RESULT __attribute__ ( ( __warn_unused_result__ ) ) <nl> # define SOURCEKITD_NONNULL1 __attribute__ ( ( __nonnull__ ( 1 ) ) ) <nl> # define SOURCEKITD_NONNULL2 __attribute__ ( ( __nonnull__ ( 2 ) ) ) <nl>
Fix sourcekit attributes when compiling with clang - cl
apple/swift
89330bdaa8e542690bec2e618cf447227daa8de7
2017-03-14T08:47:17Z
mmm a / tensorflow / core / grappler / costs / virtual_scheduler . cc <nl> ppp b / tensorflow / core / grappler / costs / virtual_scheduler . cc <nl> Costs VirtualScheduler : : Summary ( ) const { <nl> } <nl> <nl> / / Also log the op description and their corresponding counts . <nl> - VLOG ( 1 ) < < " Node description , counts , cost : " ; <nl> + VLOG ( 2 ) < < " Node description , counts , cost : " ; <nl> for ( const auto & item : op_counts_ ) { <nl> - VLOG ( 1 ) < < " Node : " < < item . first < < " , Count : " < < item . second <nl> + VLOG ( 2 ) < < " Node : " < < item . first < < " , Count : " < < item . second <nl> < < " , Individual Cost : " < < op_costs_ . at ( item . first ) ; <nl> } <nl> <nl>
VLOG ( 2 ) instead of VLOG ( 1 ) for detailed op printouts .
tensorflow/tensorflow
eb2f6d0410c70a383b60505cea518758d910a006
2017-05-27T04:42:51Z
mmm a / PowerEditor / src / Notepad_plus . rc <nl> ppp b / PowerEditor / src / Notepad_plus . rc <nl> IDI_PROJECT_FILEINVALID BITMAP " icons / project_file_invalid . bmp " <nl> IDI_FB_ROOTOPEN BITMAP " icons / fb_root_open . bmp " <nl> IDI_FB_ROOTCLOSE BITMAP " icons / fb_root_close . bmp " <nl> <nl> + IDI_FB_SELECTCURRENTFILE BITMAP " icons / fb_select_current_file . bmp " <nl> + <nl> IDI_FUNCLIST_ROOT BITMAP " icons / project_file . bmp " <nl> IDI_FUNCLIST_NODE BITMAP " icons / funcList_node . bmp " <nl> IDI_FUNCLIST_LEAF BITMAP " icons / funcList_leaf . bmp " <nl> IDI_FUNCLIST_LEAF BITMAP " icons / funcList_leaf . bmp " <nl> IDI_FUNCLIST_SORTBUTTON BITMAP " icons / funclstSort . bmp " <nl> IDI_FUNCLIST_RELOADBUTTON BITMAP " icons / funclstReload . bmp " <nl> <nl> - <nl> IDI_VIEW_DOC_MAP_ON_ICON ICON " icons / docMap_on . ico " <nl> IDI_VIEW_DOC_MAP_OFF_ICON ICON " icons / docMap_off . ico " <nl> IDI_VIEW_FUNCLIST_ON_ICON ICON " icons / funcList_on . ico " <nl> mmm a / PowerEditor / src / WinControls / FileBrowser / fileBrowser . cpp <nl> ppp b / PowerEditor / src / WinControls / FileBrowser / fileBrowser . cpp <nl> <nl> # define FB_ADDFILE ( WM_USER + 1024 ) <nl> # define FB_RMFILE ( WM_USER + 1025 ) <nl> # define FB_RNFILE ( WM_USER + 1026 ) <nl> + # define FB_CMD_AIMFILE 1 <nl> <nl> FileBrowser : : ~ FileBrowser ( ) <nl> { <nl> vector < generic_string > split ( const generic_string & string2split , TCHAR sep ) <nl> return splitedStrings ; <nl> } ; <nl> <nl> + bool isRelatedRootFolder ( const generic_string & relatedRoot , const generic_string & subFolder ) <nl> + { <nl> + if ( relatedRoot . empty ( ) ) <nl> + return false ; <nl> + <nl> + if ( subFolder . empty ( ) ) <nl> + return false ; <nl> + <nl> + size_t pos = subFolder . find ( relatedRoot ) ; <nl> + if ( pos ! = 0 ) / / pos = = 0 is the necessary condition , but not enough <nl> + return false ; <nl> + <nl> + vector < generic_string > relatedRootArray = split ( relatedRoot , ' \ \ ' ) ; <nl> + vector < generic_string > subFolderArray = split ( subFolder , ' \ \ ' ) ; <nl> + <nl> + size_t index2Compare = relatedRootArray . size ( ) - 1 ; <nl> + <nl> + return relatedRootArray [ index2Compare ] = = subFolderArray [ index2Compare ] ; <nl> + } <nl> + <nl> INT_PTR CALLBACK FileBrowser : : run_dlgProc ( UINT message , WPARAM wParam , LPARAM lParam ) <nl> { <nl> switch ( message ) <nl> { <nl> case WM_INITDIALOG : <nl> { <nl> + NppParameters & nppParam = NppParameters : : getInstance ( ) ; <nl> + int style = WS_CHILD | WS_VISIBLE | CCS_ADJUSTABLE | TBSTYLE_AUTOSIZE | TBSTYLE_FLAT | TBSTYLE_LIST | TBSTYLE_TRANSPARENT | BTNS_AUTOSIZE | BTNS_SEP | TBSTYLE_TOOLTIPS ; <nl> + _hToolbarMenu = CreateWindowEx ( WS_EX_LAYOUTRTL , TOOLBARCLASSNAME , NULL , style , 0 , 0 , 0 , 0 , _hSelf , nullptr , _hInst , NULL ) ; <nl> + TBBUTTON tbButtons [ 1 ] ; <nl> + / / Add the bmap image into toolbar ' s imagelist <nl> + TBADDBITMAP addbmp = { _hInst , 0 } ; <nl> + addbmp . nID = IDI_FB_SELECTCURRENTFILE ; <nl> + : : SendMessage ( _hToolbarMenu , TB_ADDBITMAP , 1 , reinterpret_cast < LPARAM > ( & addbmp ) ) ; <nl> + tbButtons [ 0 ] . idCommand = FB_CMD_AIMFILE ; <nl> + tbButtons [ 0 ] . iBitmap = 0 ; <nl> + tbButtons [ 0 ] . fsState = TBSTATE_ENABLED ; <nl> + tbButtons [ 0 ] . fsStyle = BTNS_BUTTON | BTNS_AUTOSIZE ; <nl> + tbButtons [ 0 ] . iString = reinterpret_cast < INT_PTR > ( TEXT ( " " ) ) ; <nl> + : : SendMessage ( _hToolbarMenu , TB_BUTTONSTRUCTSIZE , sizeof ( TBBUTTON ) , 0 ) ; <nl> + : : SendMessage ( _hToolbarMenu , TB_SETBUTTONSIZE , 0 , MAKELONG ( nppParam . _dpiManager . scaleX ( 20 ) , nppParam . _dpiManager . scaleY ( 20 ) ) ) ; <nl> + : : SendMessage ( _hToolbarMenu , TB_SETPADDING , 0 , MAKELONG ( 30 , 0 ) ) ; <nl> + : : SendMessage ( _hToolbarMenu , TB_ADDBUTTONS , sizeof ( tbButtons ) / sizeof ( TBBUTTON ) , reinterpret_cast < LPARAM > ( & tbButtons ) ) ; <nl> + : : SendMessage ( _hToolbarMenu , TB_AUTOSIZE , 0 , 0 ) ; <nl> + ShowWindow ( _hToolbarMenu , SW_SHOW ) ; <nl> + <nl> FileBrowser : : initPopupMenus ( ) ; <nl> <nl> _treeView . init ( _hInst , _hSelf , ID_FILEBROWSERTREEVIEW ) ; <nl> INT_PTR CALLBACK FileBrowser : : run_dlgProc ( UINT message , WPARAM wParam , LPARAM lP <nl> { <nl> int width = LOWORD ( lParam ) ; <nl> int height = HIWORD ( lParam ) ; <nl> + int extraValue = NppParameters : : getInstance ( ) . _dpiManager . scaleX ( 4 ) ; <nl> + <nl> + RECT toolbarMenuRect ; <nl> + : : GetClientRect ( _hToolbarMenu , & toolbarMenuRect ) ; <nl> + <nl> + : : MoveWindow ( _hToolbarMenu , 0 , 0 , width , toolbarMenuRect . bottom , TRUE ) ; <nl> <nl> HWND hwnd = _treeView . getHSelf ( ) ; <nl> if ( hwnd ) <nl> - : : MoveWindow ( hwnd , 0 , 0 , width , height , TRUE ) ; <nl> + : : MoveWindow ( hwnd , 0 , toolbarMenuRect . bottom + extraValue , width , height - toolbarMenuRect . bottom - extraValue , TRUE ) ; <nl> break ; <nl> } <nl> <nl> INT_PTR CALLBACK FileBrowser : : run_dlgProc ( UINT message , WPARAM wParam , LPARAM lP <nl> <nl> case WM_COMMAND : <nl> { <nl> - popupMenuCmd ( LOWORD ( wParam ) ) ; <nl> + switch ( LOWORD ( wParam ) ) <nl> + { <nl> + case FB_CMD_AIMFILE : <nl> + { <nl> + selectCurrentEditingFile ( ) ; <nl> + break ; <nl> + } <nl> + <nl> + default : <nl> + popupMenuCmd ( LOWORD ( wParam ) ) ; <nl> + } <nl> break ; <nl> } <nl> <nl> case WM_DESTROY : <nl> { <nl> + : : DestroyWindow ( _hToolbarMenu ) ; <nl> _treeView . destroy ( ) ; <nl> destroyMenus ( ) ; <nl> break ; <nl> void FileBrowser : : initPopupMenus ( ) <nl> : : InsertMenu ( _hFileMenu , 0 , MF_BYCOMMAND , IDM_FILEBROWSER_CMDHERE , cmdHere . c_str ( ) ) ; <nl> } <nl> <nl> + bool FileBrowser : : selectCurrentEditingFile ( ) <nl> + { <nl> + TCHAR currentDocPath [ MAX_PATH ] = { ' 0 ' } ; <nl> + : : SendMessage ( _hParent , NPPM_GETFULLCURRENTPATH , MAX_PATH , reinterpret_cast < LPARAM > ( currentDocPath ) ) ; <nl> + generic_string rootFolderPath = currentDocPath ; <nl> + size_t nbFolderUpdaters = _folderUpdaters . size ( ) ; <nl> + for ( size_t i = 0 ; i < nbFolderUpdaters ; + + i ) <nl> + { <nl> + if ( isRelatedRootFolder ( _folderUpdaters [ i ] - > _rootFolder . _rootPath , rootFolderPath ) ) <nl> + { <nl> + generic_string rootPath = _folderUpdaters [ i ] - > _rootFolder . _rootPath ; <nl> + generic_string pathSuffix = rootFolderPath . substr ( rootPath . size ( ) + 1 , rootFolderPath . size ( ) - rootPath . size ( ) ) ; <nl> + vector < generic_string > linarPathArray = split ( pathSuffix , ' \ \ ' ) ; <nl> + <nl> + HTREEITEM foundItem = findInTree ( rootPath , nullptr , linarPathArray ) ; <nl> + if ( foundItem ) <nl> + { <nl> + _treeView . selectItem ( foundItem ) ; <nl> + _treeView . getFocus ( ) ; <nl> + return true ; <nl> + } <nl> + } <nl> + } <nl> + return false ; <nl> + } <nl> <nl> BOOL FileBrowser : : setImageList ( int root_clean_id , int root_dirty_id , int open_node_id , int closed_node_id , int leaf_id ) <nl> { <nl> void FileBrowser : : openSelectFile ( ) <nl> { <nl> / / Get the selected item <nl> HTREEITEM selectedNode = _treeView . getSelection ( ) ; <nl> - if ( not selectedNode ) return ; <nl> + if ( ! selectedNode ) return ; <nl> <nl> generic_string fullPath = getNodePath ( selectedNode ) ; <nl> <nl> / / test the path - if it ' s a file , open it , otherwise just fold or unfold it <nl> - if ( not : : PathFileExists ( fullPath . c_str ( ) ) ) <nl> + if ( ! : : PathFileExists ( fullPath . c_str ( ) ) ) <nl> return ; <nl> if ( : : PathIsDirectory ( fullPath . c_str ( ) ) ) <nl> return ; <nl> void FileBrowser : : getDirectoryStructure ( const TCHAR * dir , const std : : vector < gene <nl> : : FindClose ( hFile ) ; <nl> } <nl> <nl> - bool isRelatedRootFolder ( const generic_string & relatedRoot , const generic_string & subFolder ) <nl> - { <nl> - if ( relatedRoot . empty ( ) ) <nl> - return false ; <nl> - <nl> - if ( subFolder . empty ( ) ) <nl> - return false ; <nl> - <nl> - size_t pos = subFolder . find ( relatedRoot ) ; <nl> - if ( pos ! = 0 ) / / pos = = 0 is the necessary condition , but not enough <nl> - return false ; <nl> - <nl> - vector < generic_string > relatedRootArray = split ( relatedRoot , ' \ \ ' ) ; <nl> - vector < generic_string > subFolderArray = split ( subFolder , ' \ \ ' ) ; <nl> - <nl> - size_t index2Compare = relatedRootArray . size ( ) - 1 ; <nl> - <nl> - return relatedRootArray [ index2Compare ] = = subFolderArray [ index2Compare ] ; <nl> - } <nl> - <nl> void FileBrowser : : addRootFolder ( generic_string rootFolderPath ) <nl> { <nl> if ( ! : : PathFileExists ( rootFolderPath . c_str ( ) ) ) <nl> bool FileBrowser : : renameInTree ( const generic_string & rootPath , HTREEITEM node , c <nl> if ( foundItem = = nullptr ) <nl> return false ; <nl> <nl> - / / found it , rename it <nl> + / / found it , rename it <nl> _treeView . renameItem ( foundItem , renameTo . c_str ( ) ) ; <nl> return true ; <nl> } <nl> mmm a / PowerEditor / src / WinControls / FileBrowser / fileBrowser . h <nl> ppp b / PowerEditor / src / WinControls / FileBrowser / fileBrowser . h <nl> class FileBrowser : public DockingDlgInterface { <nl> generic_string getSelectedItemPath ( ) const ; <nl> <nl> protected : <nl> + HWND _hToolbarMenu = nullptr ; <nl> + <nl> TreeView _treeView ; <nl> HIMAGELIST _hImaLst = nullptr ; <nl> <nl> class FileBrowser : public DockingDlgInterface { <nl> <nl> BrowserNodeType getNodeType ( HTREEITEM hItem ) ; <nl> void popupMenuCmd ( int cmdID ) ; <nl> + bool selectCurrentEditingFile ( ) ; <nl> virtual INT_PTR CALLBACK run_dlgProc ( UINT message , WPARAM wParam , LPARAM lParam ) ; <nl> void notified ( LPNMHDR notification ) ; <nl> void showContextMenu ( int x , int y ) ; <nl> new file mode 100644 <nl> index 0000000000 . . b602583189 <nl> Binary files / dev / null and b / PowerEditor / src / icons / fb_select_current_file . bmp differ <nl> mmm a / PowerEditor / src / resource . h <nl> ppp b / PowerEditor / src / resource . h <nl> <nl> # define IDI_PROJECT_FILEINVALID 607 <nl> # define IDI_FB_ROOTOPEN 608 <nl> # define IDI_FB_ROOTCLOSE 609 <nl> + # define IDI_FB_SELECTCURRENTFILE 610 <nl> <nl> # define IDI_FUNCLIST_ROOT 620 <nl> # define IDI_FUNCLIST_NODE 621 <nl>
Add feature to select / show current file in Folder As Workspace
notepad-plus-plus/notepad-plus-plus
bc2b5ac2ce47ed8821525c534d16c19b5f239f1d
2019-12-14T21:51:50Z
mmm a / project / cmake / addons / CMakeLists . txt <nl> ppp b / project / cmake / addons / CMakeLists . txt <nl> else ( ) <nl> endif ( ) <nl> get_filename_component ( XBMCROOT " $ { XBMCROOT } " ABSOLUTE ) <nl> <nl> - if ( NOT DEPENDS_PATH ) <nl> + if ( NOT DEPENDS_PATH ) <nl> set ( DEPENDS_PATH " $ { CMAKE_BINARY_DIR } / addons " ) <nl> else ( ) <nl> file ( TO_CMAKE_PATH " $ { DEPENDS_PATH } " DEPENDS_PATH ) <nl> endif ( ) <nl> get_filename_component ( prefix " $ { DEPENDS_PATH } " ABSOLUTE ) <nl> <nl> # make sure CMAKE_PREFIX_PATH is set <nl> - if ( NOT CMAKE_PREFIX_PATH ) <nl> + if ( NOT CMAKE_PREFIX_PATH ) <nl> set ( CMAKE_PREFIX_PATH " $ { DEPENDS_PATH } " ) <nl> else ( ) <nl> file ( TO_CMAKE_PATH " $ { CMAKE_PREFIX_PATH } " CMAKE_PREFIX_PATH ) <nl> list ( APPEND CMAKE_PREFIX_PATH $ { CMAKE_INSTALL_PREFIX } ) <nl> set ( BUILD_ARGS - DCMAKE_PREFIX_PATH = $ { CMAKE_PREFIX_PATH } <nl> - DCMAKE_INSTALL_PREFIX : PATH = < INSTALL_DIR > <nl> - DCMAKE_BUILD_TYPE = Release <nl> + - DCMAKE_USER_MAKE_RULES_OVERRIDE = $ { CMAKE_USER_MAKE_RULES_OVERRIDE } <nl> + - DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX = $ { CMAKE_USER_MAKE_RULES_OVERRIDE_CXX } <nl> - DBUILD_SHARED_LIBS = 1 ) <nl> <nl> if ( PACKAGE_ZIP ) <nl> mmm a / project / cmake / addons / README <nl> ppp b / project / cmake / addons / README <nl> http : / / www . cmake . org / cmake / help / v2 . 8 . 8 / cmake . html # section_Generators for a list . <nl> <nl> In case of additional options the call might look like this <nl> <nl> - cmake < path > - G < generator > \ <nl> + cmake < path > [ - G < generator > ] \ <nl> - DCMAKE_BUILD_TYPE = Release \ <nl> - DXBMCROOT = " < path - to - xbmc - root > " \ <nl> - DARCH_DEFINES = " - DTARGET_LINUX " \ <nl> new file mode 100644 <nl> index 000000000000 . . ab19701707da <nl> mmm / dev / null <nl> ppp b / project / cmake / xbmc - c - flag - overrides . cmake <nl> <nl> + if ( MSVC ) <nl> + set ( CMAKE_C_FLAGS " / MP / DWIN32 / D_WINDOWS / W3 / Zi / arch : SSE2 " ) <nl> + set ( CMAKE_C_FLAGS_DEBUG " / D_DEBUG / MDd / Ob0 / Od / RTC1 / D_HAS_ITERATOR_DEBUGGING = 0 / D_SECURE_SCL = 0 " ) <nl> + set ( CMAKE_C_FLAGS_RELEASE " / MD / Ox / Ob2 / Oi / Ot / Oy / GL / DNDEBUG " ) <nl> + endif ( MSVC ) <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 000000000000 . . ad3a0908ef42 <nl> mmm / dev / null <nl> ppp b / project / cmake / xbmc - cxx - flag - overrides . cmake <nl> <nl> + if ( MSVC ) <nl> + set ( CMAKE_CXX_FLAGS " / MP / DWIN32 / D_WINDOWS / W3 / GR / Zi / EHsc / arch : SSE2 " ) <nl> + set ( CMAKE_CXX_FLAGS_DEBUG " / D_DEBUG / MDd / Ob0 / Od / RTC1 / D_HAS_ITERATOR_DEBUGGING = 0 / D_SECURE_SCL = 0 " ) <nl> + set ( CMAKE_CXX_FLAGS_RELEASE " / MD / Ox / Ob2 / Oi / Ot / Oy / GL / DNDEBUG " ) <nl> + endif ( MSVC ) <nl> \ No newline at end of file <nl> mmm a / tools / buildsteps / win32 / make - addon - depends . bat <nl> ppp b / tools / buildsteps / win32 / make - addon - depends . bat <nl> SETLOCAL <nl> <nl> SET EXITCODE = 0 <nl> <nl> + SET noclean = false <nl> + SET dependency = <nl> + FOR % % b in ( % 1 , % 2 ) DO ( <nl> + IF % % b = = noclean ( <nl> + SET noclean = true <nl> + ) ELSE ( IF % % b = = clean ( <nl> + SET noclean = false <nl> + ) ELSE ( <nl> + SET dependency = % % b <nl> + ) ) <nl> + ) <nl> + <nl> rem set Visual C + + build environment <nl> call " % VS120COMNTOOLS % . . \ . . \ VC \ bin \ vcvars32 . bat " <nl> <nl> SET WORKDIR = % WORKSPACE % <nl> <nl> - IF " % WORKDIR % " = = " " ( <nl> + IF " % WORKDIR % " = = " " ( <nl> SET WORKDIR = % CD % \ . . \ . . \ . . <nl> ) <nl> <nl> SET ADDON_DEPENDS_BUILD_PATH = % ADDON_DEPENDS_PATH % \ build <nl> <nl> SET ERRORFILE = % BASE_PATH % \ make - addon - depends . error <nl> <nl> - rem remove the output directory if it exists <nl> - IF EXIST " % ADDONS_OUTPUT_PATH % " ( <nl> - RMDIR " % ADDONS_OUTPUT_PATH % " / S / Q > NUL <nl> + IF % noclean % = = false ( <nl> + rem remove the output directory if it exists <nl> + IF EXIST " % ADDONS_OUTPUT_PATH % " ( <nl> + RMDIR " % ADDONS_OUTPUT_PATH % " / S / Q > NUL <nl> + ) <nl> + <nl> + rem remove the build directory if it exists <nl> + IF EXIST " % ADDON_DEPENDS_BUILD_PATH % " ( <nl> + RMDIR " % ADDON_DEPENDS_BUILD_PATH % " / S / Q > NUL <nl> + ) <nl> ) <nl> <nl> rem create the output directory <nl> - MKDIR " % ADDONS_OUTPUT_PATH % " <nl> - <nl> - rem go into the addon depends directory <nl> - CD % ADDON_DEPENDS_PATH % <nl> - <nl> - rem remove the build directory if it exists <nl> - IF EXIST " % ADDON_DEPENDS_BUILD_PATH % " ( <nl> - RMDIR " % ADDON_DEPENDS_BUILD_PATH % " / S / Q > NUL <nl> - ) <nl> + IF NOT EXIST " % ADDONS_OUTPUT_PATH % " MKDIR " % ADDONS_OUTPUT_PATH % " <nl> <nl> rem create the build directory <nl> - MKDIR " % ADDON_DEPENDS_BUILD_PATH % " <nl> + IF NOT EXIST " % ADDON_DEPENDS_BUILD_PATH % " MKDIR " % ADDON_DEPENDS_BUILD_PATH % " <nl> <nl> rem go into the build directory <nl> CD " % ADDON_DEPENDS_BUILD_PATH % " <nl> cmake " % ADDON_DEPENDS_PATH % " - G " NMake Makefiles " ^ <nl> - DCMAKE_BUILD_TYPE = Release ^ <nl> - DCMAKE_INSTALL_PREFIX = % ADDONS_OUTPUT_PATH % <nl> IF ERRORLEVEL 1 ( <nl> - ECHO cmake error level : % ERRORLEVEL % > % ERRORFILE % <nl> - GOTO ERROR <nl> + ECHO cmake error level : % ERRORLEVEL % > % ERRORFILE % <nl> + GOTO ERROR <nl> ) <nl> <nl> rem execute nmake to build the addon depends <nl> - nmake <nl> + nmake % dependency % <nl> IF ERRORLEVEL 1 ( <nl> - ECHO nmake error level : % ERRORLEVEL % > % ERRORFILE % <nl> - GOTO ERROR <nl> + ECHO nmake error level : % ERRORLEVEL % > % ERRORFILE % <nl> + GOTO ERROR <nl> ) <nl> <nl> rem everything was fine <nl> mmm a / tools / buildsteps / win32 / make - addons . bat <nl> ppp b / tools / buildsteps / win32 / make - addons . bat <nl> SETLOCAL <nl> SET EXITCODE = 0 <nl> <nl> SET getdepends = true <nl> - FOR % % b in ( % 1 ) DO ( <nl> - IF % % b = = nodepends SET getdepends = false <nl> + SET install = false <nl> + SET noclean = false <nl> + SET addon = <nl> + FOR % % b in ( % 1 , % 2 , % 3 , % 4 ) DO ( <nl> + IF % % b = = nodepends ( <nl> + SET getdepends = false <nl> + ) ELSE ( IF % % b = = install ( <nl> + SET install = true <nl> + ) ELSE ( IF % % b = = noclean ( <nl> + SET noclean = true <nl> + ) ELSE ( IF % % b = = clean ( <nl> + SET noclean = false <nl> + ) ELSE ( <nl> + SET addon = % % b <nl> + ) ) ) ) <nl> ) <nl> <nl> rem set Visual C + + build environment <nl> call " % VS120COMNTOOLS % . . \ . . \ VC \ bin \ vcvars32 . bat " <nl> <nl> SET WORKDIR = % WORKSPACE % <nl> <nl> - IF " % WORKDIR % " = = " " ( <nl> + IF " % WORKDIR % " = = " " ( <nl> SET WORKDIR = % CD % \ . . \ . . \ . . <nl> ) <nl> <nl> SET ERRORFILE = % BASE_PATH % \ make - addons . error <nl> SET XBMC_INCLUDE_PATH = % ADDON_DEPENDS_PATH % \ include \ xbmc <nl> SET XBMC_LIB_PATH = % ADDON_DEPENDS_PATH % \ lib \ xbmc <nl> <nl> - IF % getdepends % = = true ( <nl> - CALL make - addon - depends . bat <nl> + rem determine whether make - addon - depends . bat should be called with noclean or not <nl> + SET addon_depends_mode = clean <nl> + IF % noclean % = = true ( <nl> + SET addon_depends_mode = noclean <nl> + ) <nl> + <nl> + IF % getdepends % = = true ( <nl> + ECHO mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + ECHO Building addon dependencies <nl> + ECHO mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + <nl> + CALL make - addon - depends . bat % addon_depends_mode % <nl> IF ERRORLEVEL 1 ( <nl> ECHO make - addon - depends error level : % ERRORLEVEL % > % ERRORFILE % <nl> GOTO ERROR <nl> ) <nl> - ) <nl> <nl> - rem make sure the xbmc include and library paths exist <nl> - IF EXIST " % XBMC_INCLUDE_PATH % " ( <nl> - RMDIR " % XBMC_INCLUDE_PATH % " / S / Q > NUL <nl> - ) <nl> - IF EXIST " % XBMC_LIB_PATH % " ( <nl> - RMDIR " % XBMC_LIB_PATH % " / S / Q > NUL <nl> + ECHO . <nl> ) <nl> - MKDIR " % XBMC_INCLUDE_PATH % " <nl> - MKDIR " % XBMC_LIB_PATH % " <nl> <nl> - rem go into the addons directory <nl> - CD % ADDONS_PATH % <nl> + IF % noclean % = = false ( <nl> + rem remove the build directory if it exists <nl> + IF EXIST " % ADDONS_BUILD_PATH % " ( <nl> + RMDIR " % ADDONS_BUILD_PATH % " / S / Q > NUL <nl> + ) <nl> + ) <nl> <nl> - rem remove the build directory if it exists <nl> - IF EXIST " % ADDONS_BUILD_PATH % " ( <nl> - RMDIR " % ADDONS_BUILD_PATH % " / S / Q > NUL <nl> + rem make sure the xbmc include and library paths exist <nl> + IF NOT EXIST " % XBMC_INCLUDE_PATH % " ( <nl> + MKDIR " % XBMC_INCLUDE_PATH % " <nl> + ) <nl> + IF NOT EXIST " % XBMC_LIB_PATH % " ( <nl> + MKDIR " % XBMC_LIB_PATH % " <nl> ) <nl> <nl> rem create the build directory <nl> - MKDIR " % ADDONS_BUILD_PATH % " <nl> + IF NOT EXIST " % ADDONS_BUILD_PATH % " MKDIR " % ADDONS_BUILD_PATH % " <nl> <nl> rem go into the build directory <nl> CD " % ADDONS_BUILD_PATH % " <nl> <nl> + rem determine the proper install path for the built addons <nl> + IF % install % = = true ( <nl> + SET ADDONS_INSTALL_PATH = % WORKDIR % \ addons <nl> + ) ELSE ( <nl> + SET ADDONS_INSTALL_PATH = % WORKDIR % \ project \ Win32BuildSetup \ BUILD_WIN32 \ Xbmc \ xbmc - addons <nl> + ) <nl> + <nl> + ECHO mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + ECHO Building addons <nl> + ECHO mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + <nl> rem execute cmake to generate makefiles processable by nmake <nl> cmake " % ADDONS_PATH % " - G " NMake Makefiles " ^ <nl> - DCMAKE_BUILD_TYPE = Release ^ <nl> + - DCMAKE_USER_MAKE_RULES_OVERRIDE = " % BASE_PATH % / xbmc - c - flag - overrides . cmake " ^ <nl> + - DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX = " % BASE_PATH % / xbmc - cxx - flag - overrides . cmake " ^ <nl> + - DCMAKE_INSTALL_PREFIX = % ADDONS_INSTALL_PATH % ^ <nl> - DXBMCROOT = % WORKDIR % ^ <nl> - DDEPENDS_PATH = % ADDON_DEPENDS_PATH % ^ <nl> - - DCMAKE_INSTALL_PREFIX = % WORKDIR % \ project \ Win32BuildSetup \ BUILD_WIN32 \ Xbmc \ xbmc - addons ^ <nl> - DPACKAGE_ZIP = 1 ^ <nl> - - DARCH_DEFINES = " - DTARGET_WINDOWS - DNOMINMAX " <nl> + - DARCH_DEFINES = " - DTARGET_WINDOWS - DNOMINMAX - D_CRT_SECURE_NO_WARNINGS - D_USE_32BIT_TIME_T - D_WINSOCKAPI_ " <nl> IF ERRORLEVEL 1 ( <nl> ECHO cmake error level : % ERRORLEVEL % > % ERRORFILE % <nl> GOTO ERROR <nl> ) <nl> <nl> rem execute nmake to build the addons <nl> - nmake <nl> + nmake % addon % <nl> IF ERRORLEVEL 1 ( <nl> ECHO nmake error level : % ERRORLEVEL % > % ERRORFILE % <nl> GOTO ERROR <nl>
Merge pull request from Montellese / binary_addons_win32_improvements
xbmc/xbmc
3a37dcd2e757fd20c7e7de62b224ef7b00f047b1
2014-07-17T20:19:19Z
mmm a / skin / Confluence / 720p / DialogFavourites . xml <nl> ppp b / skin / Confluence / 720p / DialogFavourites . xml <nl> <nl> < align > right < / align > <nl> < aligny > center < / aligny > <nl> < font > font12 < / font > <nl> - < textcolor > blue < / textcolor > <nl> - < label > ( $ INFO [ Container ( 450 ) . NumItems ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( $ INFO [ Container ( 450 ) . CurrentPage ] / $ INFO [ Container ( 450 ) . NumPages ] ) < / label > <nl> + < textcolor > grey < / textcolor > <nl> + < label > ( [ COLOR = blue ] $ INFO [ Container ( 450 ) . NumItems ] [ / COLOR ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( [ COLOR = blue ] $ INFO [ Container ( 450 ) . CurrentPage ] / $ INFO [ Container ( 450 ) . NumPages ] [ / COLOR ] ) < / label > <nl> < / control > <nl> < / control > <nl> < include > SideBladeRight < / include > <nl> mmm a / skin / Confluence / 720p / DialogSelect . xml <nl> ppp b / skin / Confluence / 720p / DialogSelect . xml <nl> <nl> < align > right < / align > <nl> < aligny > center < / aligny > <nl> < scroll > true < / scroll > <nl> - < textcolor > blue < / textcolor > <nl> - < label > ( $ INFO [ Container ( 3 ) . NumItems ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( $ INFO [ Container ( 3 ) . CurrentPage ] / $ INFO [ Container ( 3 ) . NumPages ] ) < / label > <nl> + < textcolor > grey < / textcolor > <nl> + < label > ( [ COLOR = blue ] $ INFO [ Container ( 3 ) . NumItems ] [ / COLOR ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( [ COLOR = blue ] $ INFO [ Container ( 3 ) . CurrentPage ] / $ INFO [ Container ( 3 ) . NumPages ] [ / COLOR ] ) < / label > <nl> < / control > <nl> < control type = " button " id = " 5 " > <nl> < description > Manual button < / description > <nl> mmm a / skin / Confluence / 720p / FileBrowser . xml <nl> ppp b / skin / Confluence / 720p / FileBrowser . xml <nl> <nl> < height > 30 < / height > <nl> < align > right < / align > <nl> < aligny > center < / aligny > <nl> - < textcolor > blue < / textcolor > <nl> + < textcolor > grey < / textcolor > <nl> < font > font12 < / font > <nl> - < label > ( $ INFO [ Container ( 450 ) . NumItems ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( $ INFO [ Container ( 450 ) . CurrentPage ] / $ INFO [ Container ( 450 ) . NumPages ] ) < / label > <nl> + < label > ( [ COLOR = blue ] $ INFO [ Container ( 450 ) . NumItems ] [ / COLOR ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( [ COLOR = blue ] $ INFO [ Container ( 450 ) . CurrentPage ] / $ INFO [ Container ( 450 ) . NumPages ] [ / COLOR ] ) < / label > <nl> < visible > ! Control . IsVisible ( 451 ) < / visible > <nl> < / control > <nl> < control type = " label " > <nl> <nl> < height > 30 < / height > <nl> < align > right < / align > <nl> < aligny > center < / aligny > <nl> - < textcolor > blue < / textcolor > <nl> + < textcolor > grey < / textcolor > <nl> < font > font12 < / font > <nl> - < label > ( $ INFO [ Container ( 451 ) . NumItems ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( $ INFO [ Container ( 451 ) . CurrentPage ] / $ INFO [ Container ( 451 ) . NumPages ] ) < / label > <nl> + < label > ( [ COLOR = blue ] $ INFO [ Container ( 451 ) . NumItems ] [ / COLOR ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( [ COLOR = blue ] $ INFO [ Container ( 451 ) . CurrentPage ] / $ INFO [ Container ( 451 ) . NumPages ] [ / COLOR ] ) < / label > <nl> < visible > Control . IsVisible ( 451 ) < / visible > <nl> < / control > <nl> < / control > <nl> mmm a / skin / Confluence / 720p / FileManager . xml <nl> ppp b / skin / Confluence / 720p / FileManager . xml <nl> <nl> < control type = " label " > <nl> < description > number of files / pages in left list text label < / description > <nl> < posx > 35 < / posx > <nl> - < posy > 650 < / posy > <nl> + < posy > 670 < / posy > <nl> < width > 570 < / width > <nl> - < font > font13_title < / font > <nl> + < font > font12 < / font > <nl> < align > left < / align > <nl> < scroll > true < / scroll > <nl> - < textcolor > white < / textcolor > <nl> + < textcolor > grey < / textcolor > <nl> < shadowcolor > black < / shadowcolor > <nl> - < label > ( $ INFO [ Container ( 20 ) . NumItems ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( $ INFO [ Container ( 20 ) . CurrentPage ] / $ INFO [ Container ( 20 ) . NumPages ] ) < / label > <nl> + < label > ( [ COLOR = blue ] $ INFO [ Container ( 20 ) . NumItems ] [ / COLOR ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( [ COLOR = blue ] $ INFO [ Container ( 20 ) . CurrentPage ] / $ INFO [ Container ( 20 ) . NumPages ] [ / COLOR ] ) < / label > <nl> < / control > <nl> < control type = " scrollbar " id = " 30 " > <nl> < posx > 25 < / posx > <nl> <nl> < control type = " label " > <nl> < description > number of files / pages in left list text label < / description > <nl> < posx > 35r < / posx > <nl> - < posy > 650 < / posy > <nl> + < posy > 670 < / posy > <nl> < width > 570 < / width > <nl> - < font > font13_title < / font > <nl> + < font > font12 < / font > <nl> < align > right < / align > <nl> < scroll > true < / scroll > <nl> - < textcolor > white < / textcolor > <nl> + < textcolor > grey < / textcolor > <nl> < shadowcolor > black < / shadowcolor > <nl> - < label > ( $ INFO [ Container ( 21 ) . NumItems ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( $ INFO [ Container ( 21 ) . CurrentPage ] / $ INFO [ Container ( 21 ) . NumPages ] ) < / label > <nl> + < label > ( [ COLOR = blue ] $ INFO [ Container ( 21 ) . NumItems ] [ / COLOR ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( [ COLOR = blue ] $ INFO [ Container ( 21 ) . CurrentPage ] / $ INFO [ Container ( 21 ) . NumPages ] [ / COLOR ] ) < / label > <nl> < / control > <nl> < control type = " scrollbar " id = " 31 " > <nl> < posx > 50r < / posx > <nl> mmm a / skin / Confluence / 720p / includes . xml <nl> ppp b / skin / Confluence / 720p / includes . xml <nl> <nl> < align > left < / align > <nl> < aligny > center < / aligny > <nl> < font > font12 < / font > <nl> - < textcolor > grey2 < / textcolor > <nl> + < textcolor > grey < / textcolor > <nl> < shadowcolor > black < / shadowcolor > <nl> < visible > Player . HasMedia < / visible > <nl> < include > VisibleFadeEffect < / include > <nl> <nl> < width > 500 < / width > <nl> < height > 20 < / height > <nl> < font > font12 < / font > <nl> - < textcolor > grey2 < / textcolor > <nl> + < textcolor > grey < / textcolor > <nl> < scroll > false < / scroll > <nl> < align > right < / align > <nl> < aligny > center < / aligny > <nl> mmm a / skin / Confluence / 720p / script - Apple_Movie_Trailers - chooser . xml <nl> ppp b / skin / Confluence / 720p / script - Apple_Movie_Trailers - chooser . xml <nl> <nl> < height > 30 < / height > <nl> < align > right < / align > <nl> < aligny > center < / aligny > <nl> - < textcolor > blue < / textcolor > <nl> + < textcolor > grey < / textcolor > <nl> < font > font12 < / font > <nl> - < label > ( $ INFO [ Container ( 503 ) . NumItems ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( $ INFO [ Container ( 503 ) . CurrentPage ] / $ INFO [ Container ( 503 ) . NumPages ] ) < / label > <nl> + < label > ( [ COLOR = blue ] $ INFO [ Container ( 503 ) . NumItems ] [ / COLOR ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( [ COLOR = blue ] $ INFO [ Container ( 503 ) . CurrentPage ] / $ INFO [ Container ( 503 ) . NumPages ] [ / COLOR ] ) < / label > <nl> < visible > Control . IsVisible ( 503 ) < / visible > <nl> < / control > <nl> < ! - - * * Required * * Do not change < id > or < type > - - > <nl> <nl> < height > 30 < / height > <nl> < align > right < / align > <nl> < aligny > center < / aligny > <nl> - < textcolor > blue < / textcolor > <nl> + < textcolor > grey < / textcolor > <nl> < font > font12 < / font > <nl> - < label > ( $ INFO [ Container ( 504 ) . NumItems ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( $ INFO [ Container ( 504 ) . CurrentPage ] / $ INFO [ Container ( 504 ) . NumPages ] ) < / label > <nl> + < label > ( [ COLOR = blue ] $ INFO [ Container ( 504 ) . NumItems ] [ / COLOR ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( [ COLOR = blue ] $ INFO [ Container ( 504 ) . CurrentPage ] / $ INFO [ Container ( 504 ) . NumPages ] [ / COLOR ] ) < / label > <nl> < visible > Control . IsVisible ( 504 ) < / visible > <nl> < / control > <nl> < / control > <nl> mmm a / skin / Confluence / 720p / script - Apple_Movie_Trailers - showtimes . xml <nl> ppp b / skin / Confluence / 720p / script - Apple_Movie_Trailers - showtimes . xml <nl> <nl> < height > 30 < / height > <nl> < align > center < / align > <nl> < aligny > center < / aligny > <nl> - < textcolor > blue < / textcolor > <nl> + < textcolor > grey < / textcolor > <nl> < font > font12 < / font > <nl> - < label > ( $ INFO [ Container ( 100 ) . NumItems ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( $ INFO [ Container ( 100 ) . CurrentPage ] / $ INFO [ Container ( 100 ) . NumPages ] ) < / label > <nl> + < label > ( [ COLOR = blue ] $ INFO [ Container ( 100 ) . NumItems ] [ / COLOR ] ) $ LOCALIZE [ 31025 ] - $ LOCALIZE [ 31024 ] ( [ COLOR = blue ] $ INFO [ Container ( 100 ) . CurrentPage ] / $ INFO [ Container ( 100 ) . NumPages ] [ / COLOR ] ) < / label > <nl> < visible > ! Control . IsVisible ( 451 ) < / visible > <nl> < / control > <nl> < / controls > <nl>
Changed : [ Confluence ] Unified the look of all the Page counts throughout the skin
xbmc/xbmc
c75855703a2b2b17ee675a0a43020260a94be67e
2010-02-15T01:48:42Z
mmm a / src / core / arm / skyeye_common / vfp / vfp . h <nl> ppp b / src / core / arm / skyeye_common / vfp / vfp . h <nl> <nl> <nl> # include " core / arm / skyeye_common / vfp / vfp_helper . h " / * for references to cdp SoftFloat functions * / <nl> <nl> - # define VFP_DEBUG_UNIMPLEMENTED ( x ) LOG_ERROR ( Core_ARM11 , " in func % s , " # x " unimplemented \ n " , __FUNCTION__ ) ; exit ( - 1 ) ; <nl> # define VFP_DEBUG_UNTESTED ( x ) LOG_TRACE ( Core_ARM11 , " in func % s , " # x " untested \ n " , __FUNCTION__ ) ; <nl> # define CHECK_VFP_ENABLED <nl> # define CHECK_VFP_CDP_RET vfp_raise_exceptions ( cpu , ret , inst_cream - > instr , cpu - > VFP [ VFP_FPSCR ] ) ; <nl> mmm a / src / core / arm / skyeye_common / vfp / vfpinstr . cpp <nl> ppp b / src / core / arm / skyeye_common / vfp / vfpinstr . cpp <nl> static ARM_INST_PTR INTERPRETER_TRANSLATE ( vmovbrc ) ( unsigned int inst , int index ) <nl> # ifdef VFP_INTERPRETER_IMPL <nl> VMOVBRC_INST : <nl> { <nl> - if ( ( inst_base - > cond = = 0xe ) | | CondPassed ( cpu , inst_base - > cond ) ) { <nl> + if ( inst_base - > cond = = 0xE | | CondPassed ( cpu , inst_base - > cond ) ) { <nl> CHECK_VFP_ENABLED ; <nl> <nl> - VFP_DEBUG_UNIMPLEMENTED ( VMOVBRC ) ; <nl> + vmovbrc_inst * const inst_cream = ( vmovbrc_inst * ) inst_base - > component ; <nl> + <nl> + cpu - > ExtReg [ ( 2 * inst_cream - > d ) + inst_cream - > index ] = cpu - > Reg [ inst_cream - > t ] ; <nl> } <nl> cpu - > Reg [ 15 ] + = GET_INST_SIZE ( cpu ) ; <nl> INC_PC ( sizeof ( vmovbrc_inst ) ) ; <nl> static ARM_INST_PTR INTERPRETER_TRANSLATE ( vmovbcr ) ( unsigned int inst , int index ) <nl> # ifdef VFP_INTERPRETER_IMPL <nl> VMOVBCR_INST : <nl> { <nl> - if ( ( inst_base - > cond = = 0xe ) | | CondPassed ( cpu , inst_base - > cond ) ) { <nl> + if ( inst_base - > cond = = 0xE | | CondPassed ( cpu , inst_base - > cond ) ) { <nl> CHECK_VFP_ENABLED ; <nl> <nl> - VFP_DEBUG_UNIMPLEMENTED ( VMOVBCR ) ; <nl> + vmovbcr_inst * const inst_cream = ( vmovbcr_inst * ) inst_base - > component ; <nl> + <nl> + cpu - > Reg [ inst_cream - > t ] = cpu - > ExtReg [ ( 2 * inst_cream - > d ) + inst_cream - > index ] ; <nl> } <nl> cpu - > Reg [ 15 ] + = GET_INST_SIZE ( cpu ) ; <nl> INC_PC ( sizeof ( vmovbcr_inst ) ) ; <nl>
Merge pull request from lioncash / vfp
yuzu-emu/yuzu
2a435aa0ccd0369a3e1d941f092cd6dc3887bb1f
2015-06-12T14:43:59Z
mmm a / PowerEditor / installer / nativeLang / czech . xml <nl> ppp b / PowerEditor / installer / nativeLang / czech . xml <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < ! - - <nl> - - last change : Notepad + + 7 . 4 . 0 17 / May / 2017 by Ondřej Müller ( mullero @ email . cz ) <nl> + - last change : Notepad + + 7 . 4 . 2 23 / Jul / 2017 by Ondřej Müller ( mullero @ email . cz ) <nl> - N + + Community : https : / / notepad - plus - plus . org / community / topic / 87 / czech - translations <nl> - contributors : Ondřej Müller ( mullero @ email . cz ) , Tomáš Hrouda ( gobbet @ centrum . cz ) <nl> - - > <nl> < NotepadPlus > <nl> - < Native - Langue name = " Čeština " filename = " czech . xml " version = " 7 . 4 . 0 " > <nl> + < Native - Langue name = " Čeština " filename = " czech . xml " version = " 7 . 4 . 2 " > <nl> < Menu > <nl> < Main > <nl> < ! - - Main Menu Entries - - > <nl> <nl> < Dialog > <nl> <nl> < Find title = " " titleFind = " Najít " titleReplace = " Nahradit " titleFindInFiles = " Najít v souborech " titleMark = " Označit " > <nl> - < Item id = " 1 " name = " Najít další " / > <nl> + < Item id = " 1 " name = " Najít & gt ; & gt ; " / > <nl> < Item id = " 2 " name = " Zavřít " / > <nl> < Item id = " 1620 " name = " Najít : " / > <nl> < Item id = " 1603 " name = " Hledat & amp ; pouze celá slova " / > <nl> <nl> < Item id = " 1661 " name = " Podle aktuál . dokumentu " / > <nl> < Item id = " 1686 " name = " Průhle & amp ; dnost " / > <nl> < Item id = " 1703 " name = " & amp ; . označuje nový řádek " / > <nl> + < Item id = " 1721 " name = " & lt ; & lt ; Najít " / > <nl> < / Find > <nl> <nl> < FindCharsInRange title = " Najít znaky z rozsahu . . . " > <nl>
Update czech . xml translation to 7 . 4 . 2
notepad-plus-plus/notepad-plus-plus
f55b137cc0b210846da6dddefa89289b5a483033
2017-08-08T00:26:23Z
mmm a / Code / CryEngine / CryCommon / CryAISystem / AIRayCastQueue . h <nl> ppp b / Code / CryEngine / CryCommon / CryAISystem / AIRayCastQueue . h <nl> struct SRequesterDebugInfo <nl> , szCustomString ( szCustomString ) <nl> , entityId ( entityId ) <nl> { } <nl> - const char * szRequesterString ; <nl> - const char * szCustomString ; <nl> - const EntityId entityId ; <nl> + <nl> + const char * szRequesterString ; <nl> + const char * szCustomString ; <nl> + EntityId entityId ; <nl> } ; <nl> <nl> struct SRequestDebugInfo <nl> struct SRequestDebugInfo <nl> Completed , <nl> } ; <nl> <nl> - SRequestDebugInfo ( const SRequesterDebugInfo & requesterInfo ) <nl> + SRequestDebugInfo ( const SRequesterDebugInfo & requesterInfo , const RayCastRequest : : Priority priorityClass ) <nl> : requesterString ( requesterInfo . szRequesterString ) <nl> , customString ( requesterInfo . szCustomString ) <nl> , entityId ( requesterInfo . entityId ) <nl> + , priorityClass ( priorityClass ) <nl> , state ( EState : : Queued ) <nl> , queuedTime ( gEnv - > pTimer - > GetAsyncTime ( ) ) <nl> + , queuedFrame ( gEnv - > nMainFrameID ) <nl> { } <nl> <nl> - string requesterString ; <nl> - string customString ; <nl> - EntityId entityId ; <nl> - EState state ; <nl> - CTimeValue queuedTime ; <nl> - CTimeValue completedTime ; <nl> + string requesterString ; <nl> + string customString ; <nl> + EntityId entityId ; <nl> + RayCastRequest : : Priority priorityClass ; <nl> + EState state ; <nl> + CTimeValue queuedTime ; <nl> + CTimeValue completedTime ; <nl> + uint32 queuedFrame ; <nl> + uint32 completedFrame ; <nl> } ; <nl> <nl> struct SContentionStats <nl> struct SContentionExtended : public DefaultContention <nl> stats . peakQueueSize = baseStats . peakQueueSize ; <nl> <nl> stats . pendingRequests . reserve ( m_pendingRequestsMap . size ( ) ) ; <nl> - for ( const auto & keyValue : m_pendingRequestsMap ) <nl> + for ( auto & keyValue : m_pendingRequestsMap ) <nl> { <nl> stats . pendingRequests . push_back ( keyValue . second ) ; <nl> } <nl> struct SContentionExtended : public DefaultContention <nl> { <nl> } <nl> <nl> - void Queued ( const SRequesterDebugInfo & requesterInfo , const uint32 queuedId ) <nl> + void Queued ( const SRequesterDebugInfo & requesterInfo , const uint32 queuedId , const RayCastRequest : : Priority priorityClass ) <nl> { <nl> if ( m_isEnabled ) <nl> { <nl> - m_pendingRequestsMap . emplace ( queuedId , SRequestDebugInfo ( requesterInfo ) ) ; <nl> + m_pendingRequestsMap . emplace ( queuedId , SRequestDebugInfo ( requesterInfo , priorityClass ) ) ; <nl> } <nl> } <nl> <nl> struct SContentionExtended : public DefaultContention <nl> { <nl> SRequestDebugInfo & completedRequest = it - > second ; <nl> completedRequest . completedTime = gEnv - > pTimer - > GetAsyncTime ( ) ; <nl> + completedRequest . completedFrame = gEnv - > nMainFrameID ; <nl> completedRequest . state = SRequestDebugInfo : : EState : : Completed ; <nl> m_completedRequests . push_back ( completedRequest ) ; <nl> <nl> template < int RayCasterID > class CQueue < RayCasterID , true > <nl> const typename BaseType : : SubmitCallback & submitCallback , const SRequesterDebugInfo & requester = SRequesterDebugInfo ( ) ) <nl> { <nl> const uint32 queuedId = BaseType : : Queue ( priority , resultCallback , submitCallback ) ; <nl> - BaseType : : ContentionPolicy : : Queued ( requester , queuedId ) ; <nl> + BaseType : : ContentionPolicy : : Queued ( requester , queuedId , priority ) ; <nl> return queuedId ; <nl> } <nl> <nl> template < int RayCasterID > class CQueue < RayCasterID , true > <nl> const typename BaseType : : ResultCallback & resultCallback , const typename BaseType : : SubmitCallback & submitCallback = 0 , const SRequesterDebugInfo & requester = SRequesterDebugInfo ( ) ) <nl> { <nl> const uint32 queuedId = BaseType : : Queue ( priority , request , resultCallback , submitCallback ) ; <nl> - BaseType : : ContentionPolicy : : Queued ( requester , queuedId ) ; <nl> + BaseType : : ContentionPolicy : : Queued ( requester , queuedId , priority ) ; <nl> return queuedId ; <nl> } <nl> } ; <nl> mmm a / Code / Sandbox / Plugins / PerforcePlugin / CMakeLists . txt <nl> ppp b / Code / Sandbox / Plugins / PerforcePlugin / CMakeLists . txt <nl> add_sources ( " NoUberFile " <nl> " PerforceApiOutputParser . h " <nl> " PerforceConflictsResolver . cpp " <nl> " PerforceConflictsResolver . h " <nl> - " PerforceFilePathUtil . cpp " <nl> - " PerforceFilePathUtil . h " <nl> - " PerforceFileStatFilter . h " <nl> + " PerforceFilePathUtil . cpp " <nl> + " PerforceFilePathUtil . h " <nl> + " PerforceFileStatFilter . h " <nl> " PerforceVCSAdapter . cpp " <nl> " PerforceVCSAdapter . h " <nl> " Md5Generator . cpp " <nl> add_sources ( " NoUberFile " <nl> end_sources ( ) <nl> # END - FILE - LIST <nl> <nl> - set ( P4API_DIR " $ { SDK_DIR } / p4api / 2016 . 2 " ) <nl> - if ( NOT EXISTS $ { P4API_DIR } ) <nl> - message ( WARNING " Perforce api library could not be found at $ { P4API_DIR } " ) <nl> - return ( ) <nl> + set ( SUPPORTED_PLATFORM YES ) <nl> + <nl> + if ( WIN64 OR WIN32 ) <nl> + set ( P4API_PLATFORM_FOLDER windows ) <nl> + else ( ) <nl> + set ( SUPPORTED_PLATFORM NO ) <nl> endif ( ) <nl> <nl> - CryEditorPlugin ( PerforcePlugin PCH " StdAfx . cpp " SOLUTION_FOLDER " Sandbox / Plugins " DISABLE_MFC ) <nl> - force_static_crt ( ) <nl> - target_compile_definitions ( $ { THIS_PROJECT } PRIVATE - DBOOST_ALL_NO_LIB ) <nl> - target_include_directories ( $ { THIS_PROJECT } PRIVATE " $ { P4API_DIR } / include " ) <nl> + if ( SUPPORTED_PLATFORM ) <nl> + set ( P4API_DIR " $ { SDK_DIR } / p4api " ) <nl> + <nl> + if ( NOT EXISTS $ { P4API_DIR } ) <nl> + message ( WARNING " Perforce api library could not be found at $ { P4API_DIR } " ) <nl> + return ( ) <nl> + endif ( ) <nl> <nl> - target_include_directories ( $ { THIS_PROJECT } PRIVATE " $ { SDK_DIR } / md5 " ) <nl> + CryEditorPlugin ( PerforcePlugin PCH " StdAfx . cpp " SOLUTION_FOLDER " Sandbox / Plugins " DISABLE_MFC ) <nl> + force_static_crt ( ) <nl> + target_compile_definitions ( $ { THIS_PROJECT } PRIVATE - DBOOST_ALL_NO_LIB ) <nl> + <nl> + set ( P4API_CONFIG_FOLDER $ < $ < NOT : $ < CONFIG : Debug > > : Release > $ < $ < CONFIG : Debug > : Debug > ) <nl> + target_include_directories ( $ { THIS_PROJECT } PRIVATE " $ { P4API_DIR } / $ { P4API_PLATFORM_FOLDER } / include " ) <nl> + target_include_directories ( $ { THIS_PROJECT } PRIVATE " $ { SDK_DIR } / md5 " ) <nl> <nl> - set_libpath_flag ( ) <nl> - set_property ( TARGET $ { THIS_PROJECT } APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " $ { LIBPATH_FLAG } \ " $ { P4API_DIR } / lib \ " " ) <nl> - set_property ( TARGET $ { THIS_PROJECT } APPEND_STRING PROPERTY LINK_FLAGS_PROFILE " $ { LIBPATH_FLAG } \ " $ { P4API_DIR } / lib \ " " ) <nl> - set_property ( TARGET $ { THIS_PROJECT } APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " $ { LIBPATH_FLAG } \ " $ { P4API_DIR } / lib \ " " ) <nl> - target_link_libraries ( $ { THIS_PROJECT } PRIVATE libclient librpc libsupp libp4sslstub md5 ) <nl> + set_libpath_flag ( ) <nl> + set_property ( TARGET $ { THIS_PROJECT } APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " $ { LIBPATH_FLAG } $ { P4API_DIR } / $ { P4API_PLATFORM_FOLDER } / Debug / lib / " ) <nl> + set_property ( TARGET $ { THIS_PROJECT } APPEND_STRING PROPERTY LINK_FLAGS_PROFILE " $ { LIBPATH_FLAG } $ { P4API_DIR } / $ { P4API_PLATFORM_FOLDER } / Release / lib / " ) <nl> + set_property ( TARGET $ { THIS_PROJECT } APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " $ { LIBPATH_FLAG } $ { P4API_DIR } / $ { P4API_PLATFORM_FOLDER } / Release / lib / " ) <nl> + target_link_libraries ( $ { THIS_PROJECT } PRIVATE libclient librpc libsupp libp4sslstub md5 ) <nl> + else ( ) <nl> + message ( WARNING " Unsupported platform for PerforcePlugin " ) <nl> + endif ( ) <nl>
! I integrate from / / ce / main . . .
CRYTEK/CRYENGINE
4c5899659afe5dc10de51e557d559918096fdd3d
2018-08-14T08:18:27Z
mmm a / cocos2dx / CCDirector . cpp <nl> ppp b / cocos2dx / CCDirector . cpp <nl> CCDirector * CCDirector : : init ( void ) <nl> m_fContentScaleFactor = 1 ; <nl> m_obScreenSize = m_obSurfaceSize = CGSizeZero ; <nl> <nl> + m_pLastUpdate = new struct cc_timeval ( ) ; <nl> + <nl> / / create autorelease pool <nl> NSPoolManager : : getInstance ( ) - > push ( ) ; <nl> <nl> CCDirector : : ~ CCDirector ( void ) <nl> NSPoolManager : : getInstance ( ) - > pop ( ) ; <nl> <nl> pobSharedDirector = NULL ; <nl> + <nl> + / / delete m_pLastUpdate <nl> + delete m_pLastUpdate ; <nl> + m_pLastUpdate = NULL ; <nl> } <nl> <nl> void CCDirector : : setGLDefaultValues ( void ) <nl>
issue : initialize m_pLastUpdate
cocos2d/cocos2d-x
5404fd879bea37854a1dbaac2cf2bf5580128ecc
2010-08-04T08:50:51Z
mmm a / lib / Sema / LookupVisibleDecls . cpp <nl> ppp b / lib / Sema / LookupVisibleDecls . cpp <nl> static void lookupDeclsFromProtocolsBeingConformedTo ( <nl> } <nl> <nl> DeclVisibilityKind ReasonForThisProtocol ; <nl> - if ( Reason = = DeclVisibilityKind : : MemberOfCurrentNominal ) <nl> + if ( Conformance - > getKind ( ) = = ProtocolConformanceKind : : Inherited ) <nl> + ReasonForThisProtocol = getReasonForSuper ( Reason ) ; <nl> + else if ( Reason = = DeclVisibilityKind : : MemberOfCurrentNominal ) <nl> ReasonForThisProtocol = <nl> DeclVisibilityKind : : MemberOfProtocolImplementedByCurrentNominal ; <nl> else <nl> static void lookupVisibleMemberDeclsImpl ( <nl> } <nl> } <nl> <nl> - llvm : : SmallPtrSet < ClassDecl * , 8 > Ancestors ; <nl> - do { <nl> - NominalTypeDecl * CurNominal = BaseTy - > getAnyNominal ( ) ; <nl> - if ( ! CurNominal ) <nl> - break ; <nl> - <nl> - synthesizeMemberDeclsForLookup ( CurNominal , CurrDC ) ; <nl> + const auto synthesizeAndLookupTypeMembers = [ & ] ( NominalTypeDecl * NTD ) { <nl> + synthesizeMemberDeclsForLookup ( NTD , CurrDC ) ; <nl> <nl> / / Look in for members of a nominal type . <nl> lookupTypeMembers ( BaseTy , BaseTy , Consumer , CurrDC , LS , Reason ) ; <nl> + } ; <nl> + <nl> + llvm : : SmallPtrSet < ClassDecl * , 8 > Ancestors ; <nl> + { <nl> + const auto NTD = BaseTy - > getAnyNominal ( ) ; <nl> + if ( NTD = = nullptr ) <nl> + return ; <nl> + <nl> + synthesizeAndLookupTypeMembers ( NTD ) ; <nl> + / / Look into protocols only on the current nominal to avoid repeatedly <nl> + / / visiting inherited conformances . <nl> lookupDeclsFromProtocolsBeingConformedTo ( BaseTy , Consumer , LS , CurrDC , <nl> Reason , Visited ) ; <nl> - / / If we have a class type , look into its superclass . <nl> - auto * CurClass = dyn_cast < ClassDecl > ( CurNominal ) ; <nl> + <nl> + const auto CD = dyn_cast < ClassDecl > ( NTD ) ; <nl> <nl> / / FIXME : We check ` getSuperclass ( ) ` here because we ' ll be using the <nl> / / superclass Type below , and in ill - formed code ` hasSuperclass ( ) ` could <nl> / / be true while ` getSuperclass ( ) ` returns null , because the latter <nl> / / looks for a declaration . <nl> - if ( CurClass & & CurClass - > getSuperclass ( ) ) { <nl> - / / FIXME : This path is no substitute for an actual circularity check . <nl> - / / The real fix is to check that the superclass doesn ' t introduce a <nl> - / / circular reference before it ' s written into the AST . <nl> - if ( Ancestors . count ( CurClass ) ) { <nl> - break ; <nl> - } <nl> + if ( ! CD | | ! CD - > getSuperclass ( ) ) <nl> + return ; <nl> <nl> - BaseTy = CurClass - > getSuperclass ( ) ; <nl> - Reason = getReasonForSuper ( Reason ) ; <nl> - <nl> - bool InheritsSuperclassInitializers = <nl> - CurClass - > inheritsSuperclassInitializers ( ) ; <nl> - if ( LS . isOnSuperclass ( ) & & ! InheritsSuperclassInitializers ) <nl> - LS = LS . withoutInheritsSuperclassInitializers ( ) ; <nl> - else if ( ! LS . isOnSuperclass ( ) ) { <nl> - LS = LS . withOnSuperclass ( ) ; <nl> - if ( InheritsSuperclassInitializers ) <nl> - LS = LS . withInheritsSuperclassInitializers ( ) ; <nl> - } <nl> - } else { <nl> + / / We have a superclass ; switch state and look into the inheritance chain . <nl> + Ancestors . insert ( CD ) ; <nl> + <nl> + Reason = getReasonForSuper ( Reason ) ; <nl> + BaseTy = CD - > getSuperclass ( ) ; <nl> + <nl> + LS = LS . withOnSuperclass ( ) ; <nl> + if ( CD - > inheritsSuperclassInitializers ( ) ) <nl> + LS = LS . withInheritsSuperclassInitializers ( ) ; <nl> + } <nl> + <nl> + / / Look into the inheritance chain . <nl> + do { <nl> + const auto CurClass = BaseTy - > getClassOrBoundGenericClass ( ) ; <nl> + <nl> + / / FIXME : This path is no substitute for an actual circularity check . <nl> + / / The real fix is to check that the superclass doesn ' t introduce a <nl> + / / circular reference before it ' s written into the AST . <nl> + if ( ! Ancestors . insert ( CurClass ) . second ) <nl> break ; <nl> - } <nl> - Ancestors . insert ( CurClass ) ; <nl> - } while ( 1 ) ; <nl> + <nl> + synthesizeAndLookupTypeMembers ( CurClass ) ; <nl> + <nl> + BaseTy = CurClass - > getSuperclass ( ) ; <nl> + if ( ! CurClass - > inheritsSuperclassInitializers ( ) ) <nl> + LS = LS . withoutInheritsSuperclassInitializers ( ) ; <nl> + } while ( BaseTy ) ; <nl> } <nl> <nl> swift : : DynamicLookupInfo : : DynamicLookupInfo ( <nl>
Merge pull request from AnthonyLatsis / member - lookup - protocols
apple/swift
021cbbb66801b3387051b006efc03ade7971e195
2020-03-20T20:17:24Z
mmm a / arangod / Aql / CalculationExecutor . h <nl> ppp b / arangod / Aql / CalculationExecutor . h <nl> class CalculationExecutor { <nl> * / <nl> inline std : : pair < ExecutionState , Stats > produceRows ( OutputAqlItemRow & output ) ; <nl> <nl> - inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> - TRI_ASSERT ( false ) ; <nl> - THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> - TRI_ERROR_INTERNAL , <nl> - " Logic_error , prefetching number fo rows not supported " ) ; <nl> + inline std : : tuple < ExecutionState , Stats , SharedAqlItemBlockPtr > fetchBlockForPassthrough ( size_t atMost ) { <nl> + auto rv = _fetcher . fetchBlockForPassthrough ( atMost ) ; <nl> + return { rv . first , { } , std : : move ( rv . second ) } ; <nl> } <nl> <nl> private : <nl> mmm a / arangod / Aql / EnumerateCollectionExecutor . h <nl> ppp b / arangod / Aql / EnumerateCollectionExecutor . h <nl> class EnumerateCollectionExecutor { <nl> void setProducingFunction ( DocumentProducingFunction const & documentProducer ) { <nl> _documentProducer = documentProducer ; <nl> } ; <nl> - <nl> - inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> - TRI_ASSERT ( false ) ; <nl> - THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> - TRI_ERROR_INTERNAL , <nl> - " Logic_error , prefetching number fo rows not supported " ) ; <nl> - } <nl> <nl> void initializeCursor ( ) ; <nl> <nl> mmm a / arangod / Aql / EnumerateListExecutor . h <nl> ppp b / arangod / Aql / EnumerateListExecutor . h <nl> class EnumerateListExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRows ( OutputAqlItemRow & output ) ; <nl> <nl> - inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const { <nl> - TRI_ASSERT ( false ) ; <nl> - THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> - TRI_ERROR_INTERNAL , <nl> - " Logic_error , prefetching number fo rows not supported " ) ; <nl> - } <nl> - <nl> private : <nl> AqlValue getAqlValue ( AqlValue const & inVarReg , size_t const & pos , bool & mustDestroy ) ; <nl> void initialize ( ) ; <nl> mmm a / arangod / Aql / ExecutionBlock . h <nl> ppp b / arangod / Aql / ExecutionBlock . h <nl> class ExecutionBlock { <nl> / / / @ brief batch size value <nl> static constexpr inline size_t DefaultBatchSize ( ) { return 1000 ; } <nl> <nl> + / / / @ brief Number to use when we skip all . Should really be inf , but don ' t <nl> + / / / use something near std : : numeric_limits < size_t > : : max ( ) to avoid overflows <nl> + / / / in calculations . <nl> + / / / This is used as an argument for skipSome ( ) , e . g . when counting everything . <nl> + / / / Setting this to any other value > 0 does not ( and must not ) affect the <nl> + / / / results . It ' s only to reduce the number of necessary skipSome calls . <nl> + static constexpr inline size_t SkipAllSize ( ) { return 1000000000 ; } <nl> + <nl> / / / @ brief Methods for execution <nl> / / / Lifecycle is : <nl> / / / CONSTRUCTOR <nl> mmm a / arangod / Aql / ExecutionBlockImpl . cpp <nl> ppp b / arangod / Aql / ExecutionBlockImpl . cpp <nl> using namespace arangodb : : aql ; <nl> <nl> CREATE_HAS_MEMBER_CHECK ( initializeCursor , hasInitializeCursor ) ; <nl> CREATE_HAS_MEMBER_CHECK ( skipRows , hasSkipRows ) ; <nl> + CREATE_HAS_MEMBER_CHECK ( fetchBlockForPassthrough , hasFetchBlockForPassthrough ) ; <nl> + CREATE_HAS_MEMBER_CHECK ( expectedNumberOfRows , hasExpectedNumberOfRows ) ; <nl> <nl> template < class Executor > <nl> ExecutionBlockImpl < Executor > : : ExecutionBlockImpl ( ExecutionEngine * engine , <nl> std : : unique_ptr < OutputAqlItemRow > ExecutionBlockImpl < Executor > : : createOutputRow ( <nl> namespace arangodb { <nl> namespace aql { <nl> <nl> - enum class SkipVariants { FETCHER , EXECUTOR , DEFAULT } ; <nl> + enum class SkipVariants { FETCHER , EXECUTOR , GET_SOME } ; <nl> <nl> / / Specifying the namespace here is important to MSVC . <nl> template < enum arangodb : : aql : : SkipVariants > <nl> struct ExecuteSkipVariant < SkipVariants : : FETCHER > { <nl> static std : : tuple < ExecutionState , typename Executor : : Stats , size_t > executeSkip ( <nl> Executor & executor , typename Executor : : Fetcher & fetcher , size_t toSkip ) { <nl> auto res = fetcher . skipRows ( toSkip ) ; <nl> - return std : : make_tuple ( res . first , typename Executor : : Stats { } , res . second ) ; / / tupple , cannot use initializer list due to build failure <nl> + return std : : make_tuple ( res . first , typename Executor : : Stats { } , res . second ) ; / / tuple , cannot use initializer list due to build failure <nl> } <nl> } ; <nl> <nl> struct ExecuteSkipVariant < SkipVariants : : EXECUTOR > { <nl> } ; <nl> <nl> template < > <nl> - struct ExecuteSkipVariant < SkipVariants : : DEFAULT > { <nl> + struct ExecuteSkipVariant < SkipVariants : : GET_SOME > { <nl> template < class Executor > <nl> static std : : tuple < ExecutionState , typename Executor : : Stats , size_t > executeSkip ( <nl> Executor & executor , typename Executor : : Fetcher & fetcher , size_t toSkip ) { <nl> / / this function should never be executed <nl> TRI_ASSERT ( false ) ; <nl> / / Make MSVC happy : <nl> - return std : : make_tuple ( ExecutionState : : DONE , typename Executor : : Stats { } , 0 ) ; / / tupple , cannot use initializer list due to build failure <nl> + return std : : make_tuple ( ExecutionState : : DONE , typename Executor : : Stats { } , 0 ) ; / / tuple , cannot use initializer list due to build failure <nl> } <nl> } ; <nl> <nl> static SkipVariants constexpr skipType ( ) { <nl> std : : is_same < Executor , IResearchViewExecutor < true > > : : value | | <nl> std : : is_same < Executor , IResearchViewMergeExecutor < false > > : : value | | <nl> std : : is_same < Executor , IResearchViewMergeExecutor < true > > : : value | | <nl> - std : : is_same < Executor , EnumerateCollectionExecutor > : : value ) , <nl> + std : : is_same < Executor , EnumerateCollectionExecutor > : : value | | <nl> + std : : is_same < Executor , LimitExecutor > : : value ) , <nl> " Unexpected executor for SkipVariants : : EXECUTOR " ) ; <nl> <nl> + / / The LimitExecutor will not work correctly with SkipVariants : : FETCHER ! <nl> + static_assert ( ! std : : is_same < Executor , LimitExecutor > : : value | | useFetcher , <nl> + " LimitExecutor needs to implement skipRows ( ) to work correctly " ) ; <nl> + <nl> if ( useExecutor ) { <nl> return SkipVariants : : EXECUTOR ; <nl> } else if ( useFetcher ) { <nl> return SkipVariants : : FETCHER ; <nl> } else { <nl> - return SkipVariants : : DEFAULT ; <nl> + return SkipVariants : : GET_SOME ; <nl> } <nl> } <nl> <nl> std : : pair < ExecutionState , size_t > ExecutionBlockImpl < Executor > : : skipSome ( size_t <nl> <nl> constexpr SkipVariants customSkipType = skipType < Executor > ( ) ; <nl> <nl> - if ( customSkipType = = SkipVariants : : DEFAULT ) { <nl> + if ( customSkipType = = SkipVariants : : GET_SOME ) { <nl> atMost = std : : min ( atMost , DefaultBatchSize ( ) ) ; <nl> auto res = getSomeWithoutTrace ( atMost ) ; <nl> <nl> std : : pair < ExecutionState , Result > ExecutionBlockImpl < SubqueryExecutor < false > > : : s <nl> } / / namespace aql <nl> } / / namespace arangodb <nl> <nl> - template < class Executor > <nl> - std : : pair < ExecutionState , SharedAqlItemBlockPtr > ExecutionBlockImpl < Executor > : : requestWrappedBlock ( <nl> - size_t nrItems , RegisterCount nrRegs ) { <nl> - SharedAqlItemBlockPtr block ; <nl> - if / * constexpr * / ( Executor : : Properties : : allowsBlockPassthrough ) { <nl> - / / If blocks can be passed through , we do not create new blocks . <nl> - / / Instead , we take the input blocks from the fetcher and reuse them . <nl> + namespace arangodb { <nl> + namespace aql { <nl> + <nl> + / / The constant " PASSTHROUGH " is somehow reserved with MSVC . <nl> + enum class RequestWrappedBlockVariant { DEFAULT , PASS_THROUGH , INPUTRESTRICTED } ; <nl> + <nl> + / / Specifying the namespace here is important to MSVC . <nl> + template < enum arangodb : : aql : : RequestWrappedBlockVariant > <nl> + struct RequestWrappedBlock { } ; <nl> + <nl> + template < > <nl> + struct RequestWrappedBlock < RequestWrappedBlockVariant : : DEFAULT > { <nl> + / * * <nl> + * @ brief Default requestWrappedBlock ( ) implementation . Just get a new block <nl> + * from the AqlItemBlockManager . <nl> + * / <nl> + template < class Executor > <nl> + static std : : pair < ExecutionState , SharedAqlItemBlockPtr > run ( <nl> + # ifdef ARANGODB_ENABLE_MAINTAINER_MODE <nl> + typename Executor : : Infos const & , <nl> + # endif <nl> + Executor & executor , ExecutionEngine & engine , size_t nrItems , RegisterCount nrRegs ) { <nl> + return { ExecutionState : : HASMORE , <nl> + engine . itemBlockManager ( ) . requestBlock ( nrItems , nrRegs ) } ; <nl> + } <nl> + } ; <nl> + <nl> + template < > <nl> + struct RequestWrappedBlock < RequestWrappedBlockVariant : : PASS_THROUGH > { <nl> + / * * <nl> + * @ brief If blocks can be passed through , we do not create new blocks . <nl> + * Instead , we take the input blocks and reuse them . <nl> + * / <nl> + template < class Executor > <nl> + static std : : pair < ExecutionState , SharedAqlItemBlockPtr > run ( <nl> + # ifdef ARANGODB_ENABLE_MAINTAINER_MODE <nl> + typename Executor : : Infos const & infos , <nl> + # endif <nl> + Executor & executor , ExecutionEngine & engine , size_t nrItems , RegisterCount nrRegs ) { <nl> + static_assert ( <nl> + Executor : : Properties : : allowsBlockPassthrough , <nl> + " This function can only be used with executors supporting ` allowsBlockPassthrough ` " ) ; <nl> + static_assert ( hasFetchBlockForPassthrough < Executor > : : value , <nl> + " An Executor with allowsBlockPassthrough must implement " <nl> + " fetchBlockForPassthrough " ) ; <nl> + <nl> + SharedAqlItemBlockPtr block ; <nl> <nl> ExecutionState state ; <nl> - std : : tie ( state , block ) = _rowFetcher . fetchBlockForPassthrough ( nrItems ) ; <nl> + typename Executor : : Stats executorStats ; <nl> + std : : tie ( state , executorStats , block ) = executor . fetchBlockForPassthrough ( nrItems ) ; <nl> + engine . _stats + = executorStats ; <nl> <nl> if ( state = = ExecutionState : : WAITING ) { <nl> TRI_ASSERT ( block = = nullptr ) ; <nl> std : : pair < ExecutionState , SharedAqlItemBlockPtr > ExecutionBlockImpl < Executor > : : r <nl> TRI_ASSERT ( block - > getNrRegs ( ) = = nrRegs ) ; <nl> # ifdef ARANGODB_ENABLE_MAINTAINER_MODE <nl> / / Check that all output registers are empty . <nl> - for ( auto const & reg : * infos ( ) . getOutputRegisters ( ) ) { <nl> + for ( auto const & reg : * infos . getOutputRegisters ( ) ) { <nl> for ( size_t row = 0 ; row < block - > size ( ) ; row + + ) { <nl> AqlValue const & val = block - > getValueReference ( row , reg ) ; <nl> TRI_ASSERT ( val . isEmpty ( ) ) ; <nl> } <nl> } <nl> # endif <nl> - } else if / * constexpr * / ( Executor : : Properties : : inputSizeRestrictsOutputSize ) { <nl> - / / The SortExecutor should refetch a block to save memory in case if only few elements to sort <nl> + <nl> + return { ExecutionState : : HASMORE , block } ; <nl> + } <nl> + } ; <nl> + <nl> + template < > <nl> + struct RequestWrappedBlock < RequestWrappedBlockVariant : : INPUTRESTRICTED > { <nl> + / * * <nl> + * @ brief If the executor can set an upper bound on the output size knowing <nl> + * the input size , usually because size ( input ) > = size ( output ) , let it <nl> + * prefetch an input block to give us this upper bound . <nl> + * Only then we allocate a new block with at most this upper bound . <nl> + * / <nl> + template < class Executor > <nl> + static std : : pair < ExecutionState , SharedAqlItemBlockPtr > run ( <nl> + # ifdef ARANGODB_ENABLE_MAINTAINER_MODE <nl> + typename Executor : : Infos const & , <nl> + # endif <nl> + Executor & executor , ExecutionEngine & engine , size_t nrItems , RegisterCount nrRegs ) { <nl> + static_assert ( <nl> + Executor : : Properties : : inputSizeRestrictsOutputSize , <nl> + " This function can only be used with executors supporting ` inputSizeRestrictsOutputSize ` " ) ; <nl> + static_assert ( hasExpectedNumberOfRows < Executor > : : value , <nl> + " An Executor with inputSizeRestrictsOutputSize must " <nl> + " implement expectedNumberOfRows " ) ; <nl> + <nl> + SharedAqlItemBlockPtr block ; <nl> + <nl> ExecutionState state ; <nl> size_t expectedRows = 0 ; <nl> / / Note : this might trigger a prefetch on the rowFetcher ! <nl> - / / TODO For the LimitExecutor , this call happens too early . See the more <nl> - / / elaborate comment on <nl> - / / LimitExecutor : : Properties : : inputSizeRestrictsOutputSize . <nl> - std : : tie ( state , expectedRows ) = _executor . expectedNumberOfRows ( nrItems ) ; <nl> + std : : tie ( state , expectedRows ) = executor . expectedNumberOfRows ( nrItems ) ; <nl> if ( state = = ExecutionState : : WAITING ) { <nl> return { state , nullptr } ; <nl> } <nl> std : : pair < ExecutionState , SharedAqlItemBlockPtr > ExecutionBlockImpl < Executor > : : r <nl> TRI_ASSERT ( state = = ExecutionState : : DONE ) ; <nl> return { state , nullptr } ; <nl> } <nl> - block = requestBlock ( nrItems , nrRegs ) ; <nl> - } else { <nl> - block = requestBlock ( nrItems , nrRegs ) ; <nl> + block = engine . itemBlockManager ( ) . requestBlock ( nrItems , nrRegs ) ; <nl> + <nl> + return { ExecutionState : : HASMORE , block } ; <nl> } <nl> + } ; <nl> + <nl> + } / / namespace aql <nl> + } / / namespace arangodb <nl> <nl> - return { ExecutionState : : HASMORE , std : : move ( block ) } ; <nl> + template < class Executor > <nl> + std : : pair < ExecutionState , SharedAqlItemBlockPtr > ExecutionBlockImpl < Executor > : : requestWrappedBlock ( <nl> + size_t nrItems , RegisterCount nrRegs ) { <nl> + static_assert ( ! Executor : : Properties : : allowsBlockPassthrough | | <nl> + ! Executor : : Properties : : inputSizeRestrictsOutputSize , <nl> + " At most one of Properties : : allowsBlockPassthrough or " <nl> + " Properties : : inputSizeRestrictsOutputSize should be true for " <nl> + " each Executor " ) ; <nl> + static_assert ( <nl> + Executor : : Properties : : allowsBlockPassthrough = = <nl> + hasFetchBlockForPassthrough < Executor > : : value , <nl> + " Executors should implement the method fetchBlockForPassthrough ( ) iff " <nl> + " Properties : : allowsBlockPassthrough is true " ) ; <nl> + static_assert ( <nl> + Executor : : Properties : : inputSizeRestrictsOutputSize = = <nl> + hasExpectedNumberOfRows < Executor > : : value , <nl> + " Executors should implement the method expectedNumberOfRows ( ) iff " <nl> + " Properties : : inputSizeRestrictsOutputSize is true " ) ; <nl> + <nl> + constexpr RequestWrappedBlockVariant variant = <nl> + Executor : : Properties : : allowsBlockPassthrough <nl> + ? RequestWrappedBlockVariant : : PASS_THROUGH <nl> + : Executor : : Properties : : inputSizeRestrictsOutputSize <nl> + ? RequestWrappedBlockVariant : : INPUTRESTRICTED <nl> + : RequestWrappedBlockVariant : : DEFAULT ; <nl> + <nl> + return RequestWrappedBlock < variant > : : run ( <nl> + # ifdef ARANGODB_ENABLE_MAINTAINER_MODE <nl> + infos ( ) , <nl> + # endif <nl> + executor ( ) , * _engine , nrItems , nrRegs ) ; <nl> } <nl> <nl> / / / @ brief request an AqlItemBlock from the memory manager <nl> mmm a / arangod / Aql / IResearchViewExecutor . h <nl> ppp b / arangod / Aql / IResearchViewExecutor . h <nl> class IResearchViewExecutorBase { <nl> using Infos = IResearchViewExecutorInfos ; <nl> using Stats = IResearchViewStats ; <nl> <nl> - inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const { <nl> - TRI_ASSERT ( false ) ; <nl> - THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> - TRI_ERROR_INTERNAL , <nl> - " Logic_error , prefetching number fo rows not supported " ) ; <nl> - } <nl> - <nl> / * * <nl> * @ brief produce the next Row of Aql Values . <nl> * <nl> mmm a / arangod / Aql / IdExecutor . h <nl> ppp b / arangod / Aql / IdExecutor . h <nl> class ExecutionBlockImpl < IdExecutor < void > > : public ExecutionBlock { <nl> _currentDependency ( 0 ) , <nl> _outputRegister ( outputRegister ) , <nl> _doCount ( doCount ) { <nl> - <nl> / / already insert ourselves into the statistics results <nl> if ( _profile > = PROFILE_LEVEL_BLOCKS ) { <nl> _engine - > _stats . nodes . emplace ( node - > id ( ) , ExecutionStats : : Node ( ) ) ; <nl> class IdExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRows ( OutputAqlItemRow & output ) ; <nl> <nl> - inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const { <nl> - / / This is passthrough ! <nl> - TRI_ASSERT ( false ) ; <nl> - THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> - TRI_ERROR_INTERNAL , <nl> - " Logic_error , prefetching number fo rows not supported " ) ; <nl> + inline std : : tuple < ExecutionState , Stats , SharedAqlItemBlockPtr > fetchBlockForPassthrough ( size_t atMost ) { <nl> + auto rv = _fetcher . fetchBlockForPassthrough ( atMost ) ; <nl> + return { rv . first , { } , std : : move ( rv . second ) } ; <nl> } <nl> <nl> private : <nl> mmm a / arangod / Aql / IndexExecutor . h <nl> ppp b / arangod / Aql / IndexExecutor . h <nl> class IndexExecutor { <nl> std : : tuple < ExecutionState , Stats , size_t > skipRows ( size_t toSkip ) ; <nl> <nl> public : <nl> - inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const { <nl> - TRI_ASSERT ( false ) ; <nl> - THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> - TRI_ERROR_INTERNAL , <nl> - " Logic_error , prefetching number fo rows not supported " ) ; <nl> - } <nl> - <nl> void initializeCursor ( ) ; <nl> <nl> private : <nl> mmm a / arangod / Aql / KShortestPathsExecutor . h <nl> ppp b / arangod / Aql / KShortestPathsExecutor . h <nl> class KShortestPathsExecutor { <nl> * @ return ExecutionState , and if successful exactly one new Row of AqlItems . <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRows ( OutputAqlItemRow & output ) ; <nl> - inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> - TRI_ASSERT ( false ) ; <nl> - THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> - TRI_ERROR_INTERNAL , <nl> - " Logic_error , prefetching number fo rows not supported " ) ; <nl> - } <nl> <nl> private : <nl> / * * <nl> mmm a / arangod / Aql / LimitExecutor . cpp <nl> ppp b / arangod / Aql / LimitExecutor . cpp <nl> LimitExecutorInfos : : LimitExecutorInfos ( RegisterId nrInputRegisters , RegisterId n <nl> _fullCount ( fullCount ) { } <nl> <nl> LimitExecutor : : LimitExecutor ( Fetcher & fetcher , Infos & infos ) <nl> - : _infos ( infos ) , _fetcher ( fetcher ) { } ; <nl> + : _infos ( infos ) , <nl> + _fetcher ( fetcher ) , <nl> + _lastRowToOutput ( CreateInvalidInputRowHint { } ) , <nl> + _stateOfLastRowToOutput ( ExecutionState : : HASMORE ) { } <nl> LimitExecutor : : ~ LimitExecutor ( ) = default ; <nl> <nl> + std : : pair < ExecutionState , LimitStats > LimitExecutor : : skipOffset ( ) { <nl> + ExecutionState state ; <nl> + size_t skipped ; <nl> + std : : tie ( state , skipped ) = _fetcher . skipRows ( maxRowsLeftToSkip ( ) ) ; <nl> + <nl> + / / WAITING = > skipped = = 0 <nl> + TRI_ASSERT ( state ! = ExecutionState : : WAITING | | skipped = = 0 ) ; <nl> + <nl> + _counter + = skipped ; <nl> + <nl> + LimitStats stats { } ; <nl> + if ( infos ( ) . isFullCountEnabled ( ) ) { <nl> + stats . incrFullCountBy ( skipped ) ; <nl> + } <nl> + <nl> + return { state , stats } ; <nl> + } <nl> + <nl> + std : : pair < ExecutionState , LimitStats > LimitExecutor : : skipRestForFullCount ( ) { <nl> + ExecutionState state ; <nl> + size_t skipped ; <nl> + LimitStats stats { } ; <nl> + / / skip ALL the rows <nl> + std : : tie ( state , skipped ) = _fetcher . skipRows ( ExecutionBlock : : SkipAllSize ( ) ) ; <nl> + <nl> + if ( state = = ExecutionState : : WAITING ) { <nl> + TRI_ASSERT ( skipped = = 0 ) ; <nl> + return { state , stats } ; <nl> + } <nl> + <nl> + / / We must not update _counter here . It is only used to count until offset + limit <nl> + / / is reached . <nl> + <nl> + if ( infos ( ) . isFullCountEnabled ( ) ) { <nl> + stats . incrFullCountBy ( skipped ) ; <nl> + } <nl> + <nl> + return { state , stats } ; <nl> + } <nl> + <nl> std : : pair < ExecutionState , LimitStats > LimitExecutor : : produceRows ( OutputAqlItemRow & output ) { <nl> TRI_IF_FAILURE ( " LimitExecutor : : produceRows " ) { <nl> THROW_ARANGO_EXCEPTION ( TRI_ERROR_DEBUG ) ; <nl> } <nl> - LimitStats stats { } ; <nl> InputAqlItemRow input { CreateInvalidInputRowHint { } } ; <nl> <nl> ExecutionState state ; <nl> - LimitState limitState ; <nl> + LimitStats stats { } ; <nl> <nl> while ( LimitState : : SKIPPING = = currentState ( ) ) { <nl> - size_t skipped ; <nl> - std : : tie ( state , skipped ) = _fetcher . skipRows ( maxRowsLeftToSkip ( ) ) ; <nl> - <nl> - if ( state = = ExecutionState : : WAITING ) { <nl> - return { state , stats } ; <nl> - } <nl> - <nl> - _counter + = skipped ; <nl> - <nl> - if ( infos ( ) . isFullCountEnabled ( ) ) { <nl> - stats . incrFullCountBy ( skipped ) ; <nl> - } <nl> - <nl> - / / Abort if upstream is done <nl> - if ( state = = ExecutionState : : DONE ) { <nl> + LimitStats tmpStats ; <nl> + std : : tie ( state , tmpStats ) = skipOffset ( ) ; <nl> + stats + = tmpStats ; <nl> + if ( state = = ExecutionState : : WAITING | | state = = ExecutionState : : DONE ) { <nl> return { state , stats } ; <nl> } <nl> } <nl> <nl> - while ( LimitState : : LIMIT_REACHED ! = ( limitState = currentState ( ) ) & & LimitState : : COUNTING ! = limitState ) { <nl> + while ( LimitState : : RETURNING = = currentState ( ) ) { <nl> std : : tie ( state , input ) = _fetcher . fetchRow ( maxRowsLeftToFetch ( ) ) ; <nl> <nl> if ( state = = ExecutionState : : WAITING ) { <nl> return { state , stats } ; <nl> } <nl> <nl> - if ( ! input ) { <nl> - TRI_ASSERT ( state = = ExecutionState : : DONE ) ; <nl> - return { state , stats } ; <nl> - } <nl> + / / This executor is pass - through . Thus we will never get asked to write an <nl> + / / output row for which there is no input , as in - and output rows have a <nl> + / / 1 : 1 correspondence . <nl> TRI_ASSERT ( input . isInitialized ( ) ) ; <nl> <nl> / / We ' ve got one input row <nl> std : : pair < ExecutionState , LimitStats > LimitExecutor : : produceRows ( OutputAqlItemRo <nl> } <nl> <nl> / / Return one row <nl> - if ( limitState = = LimitState : : RETURNING ) { <nl> - output . copyRow ( input ) ; <nl> - return { state , stats } ; <nl> - } <nl> - if ( limitState = = LimitState : : RETURNING_LAST_ROW ) { <nl> - output . copyRow ( input ) ; <nl> - return { ExecutionState : : DONE , stats } ; <nl> - } <nl> - <nl> - / / Abort if upstream is done <nl> - if ( state = = ExecutionState : : DONE ) { <nl> - return { state , stats } ; <nl> - } <nl> - <nl> - TRI_ASSERT ( false ) ; <nl> + output . copyRow ( input ) ; <nl> + return { state , stats } ; <nl> } <nl> <nl> - while ( LimitState : : LIMIT_REACHED ! = currentState ( ) ) { <nl> - size_t skipped ; <nl> - / / TODO : skip ALL the rows <nl> - std : : tie ( state , skipped ) = _fetcher . skipRows ( ExecutionBlock : : DefaultBatchSize ( ) ) ; <nl> - <nl> - if ( state = = ExecutionState : : WAITING ) { <nl> - return { state , stats } ; <nl> + / / This case is special for two reasons . <nl> + / / First , after this we want to return DONE , regardless of the upstream ' s <nl> + / / state . <nl> + / / Second , when fullCount is enabled , we need to get the fullCount before <nl> + / / returning the last row , as the count is returned with the stats ( and we <nl> + / / would not be asked again by ExecutionBlockImpl in any case ) . <nl> + if ( LimitState : : RETURNING_LAST_ROW = = currentState ( ) ) { <nl> + if ( _lastRowToOutput . isInitialized ( ) ) { <nl> + / / Use previously saved row iff there is one . We can get here only if <nl> + / / fullCount is enabled . If it is , we can get here multiple times ( until <nl> + / / we consumed the whole upstream , which might return WAITING repeatedly ) . <nl> + TRI_ASSERT ( infos ( ) . isFullCountEnabled ( ) ) ; <nl> + state = _stateOfLastRowToOutput ; <nl> + TRI_ASSERT ( state ! = ExecutionState : : WAITING ) ; <nl> + input = std : : move ( _lastRowToOutput ) ; <nl> + TRI_ASSERT ( ! _lastRowToOutput . isInitialized ( ) ) ; / / rely on the move <nl> + } else { <nl> + std : : tie ( state , input ) = _fetcher . fetchRow ( maxRowsLeftToFetch ( ) ) ; <nl> + <nl> + if ( state = = ExecutionState : : WAITING ) { <nl> + return { state , stats } ; <nl> + } <nl> } <nl> <nl> - _counter + = skipped ; <nl> + / / This executor is pass - through . Thus we will never get asked to write an <nl> + / / output row for which there is no input , as in - and output rows have a <nl> + / / 1 : 1 correspondence . <nl> + TRI_ASSERT ( input . isInitialized ( ) ) ; <nl> <nl> if ( infos ( ) . isFullCountEnabled ( ) ) { <nl> - stats . incrFullCountBy ( skipped ) ; <nl> + / / Save the state now . The _stateOfLastRowToOutput will not be used unless <nl> + / / _lastRowToOutput gets set . <nl> + _stateOfLastRowToOutput = state ; <nl> + LimitStats tmpStats ; <nl> + std : : tie ( state , tmpStats ) = skipRestForFullCount ( ) ; <nl> + stats + = tmpStats ; <nl> + if ( state = = ExecutionState : : WAITING ) { <nl> + / / Save the row <nl> + _lastRowToOutput = std : : move ( input ) ; <nl> + return { state , stats } ; <nl> + } <nl> } <nl> <nl> - / / Abort if upstream is done <nl> - if ( state = = ExecutionState : : DONE ) { <nl> - return { state , stats } ; <nl> + / / It ' s important to increase the counter for the last row only * after * <nl> + / / skipRestForFullCount ( ) is done , because we need currentState ( ) to stay <nl> + / / at RETURNING_LAST_ROW until we ' ve actually returned the last row . <nl> + _counter + + ; <nl> + if ( infos ( ) . isFullCountEnabled ( ) ) { <nl> + stats . incrFullCount ( ) ; <nl> } <nl> + <nl> + output . copyRow ( input ) ; <nl> + return { ExecutionState : : DONE , stats } ; <nl> } <nl> <nl> + / / We should never be COUNTING , this must already be done in the <nl> + / / RETURNING_LAST_ROW - handler . <nl> + TRI_ASSERT ( LimitState : : LIMIT_REACHED = = currentState ( ) ) ; <nl> / / When fullCount is enabled , the loop may only abort when upstream is done . <nl> TRI_ASSERT ( ! infos ( ) . isFullCountEnabled ( ) ) ; <nl> <nl> return { ExecutionState : : DONE , stats } ; <nl> } <nl> <nl> - std : : pair < ExecutionState , size_t > LimitExecutor : : expectedNumberOfRows ( size_t atMost ) const { <nl> + std : : tuple < ExecutionState , LimitStats , SharedAqlItemBlockPtr > LimitExecutor : : fetchBlockForPassthrough ( size_t atMost ) { <nl> switch ( currentState ( ) ) { <nl> case LimitState : : LIMIT_REACHED : <nl> / / We are done with our rows ! <nl> - return { ExecutionState : : DONE , 0 } ; <nl> - case LimitState : : COUNTING : <nl> - / / We are actually done with our rows , <nl> - / / BUt we need to make sure that we get asked more <nl> - return { ExecutionState : : DONE , 1 } ; <nl> - case LimitState : : SKIPPING : { <nl> - / / This is the best guess we can make without calling <nl> - / / preFetchNumberOfRows ( ) , which , however , would prevent skipping . <nl> - / / The problem is not here , but in ExecutionBlockImpl which calls this to <nl> - / / allocate a block before we had a chance to skip here . <nl> - / / There is a corresponding todo note on <nl> - / / LimitExecutor : : Properties : : inputSizeRestrictsOutputSize . <nl> - <nl> - TRI_ASSERT ( _counter < infos ( ) . getOffset ( ) ) ; <nl> - <nl> - / / Note on fullCount we might get more lines from upstream then required . <nl> - size_t leftOverIncludingSkip = infos ( ) . getLimitPlusOffset ( ) - _counter ; <nl> - size_t leftOver = infos ( ) . getLimit ( ) ; <nl> - if ( _infos . isFullCountEnabled ( ) ) { <nl> - / / Add one for the fullcount . <nl> - if ( leftOverIncludingSkip < atMost ) { <nl> - leftOverIncludingSkip + + ; <nl> - } <nl> - if ( leftOver < atMost ) { <nl> - leftOver + + ; <nl> + return { ExecutionState : : DONE , LimitStats { } , nullptr } ; <nl> + case LimitState : : COUNTING : { <nl> + LimitStats stats { } ; <nl> + while ( LimitState : : LIMIT_REACHED ! = currentState ( ) ) { <nl> + ExecutionState state ; <nl> + LimitStats tmpStats { } ; <nl> + std : : tie ( state , tmpStats ) = skipRestForFullCount ( ) ; <nl> + stats + = tmpStats ; <nl> + <nl> + if ( state = = ExecutionState : : WAITING | | state = = ExecutionState : : DONE ) { <nl> + return { state , stats , nullptr } ; <nl> } <nl> } <nl> - <nl> - ExecutionState const state = <nl> - leftOverIncludingSkip > 0 ? ExecutionState : : HASMORE : ExecutionState : : DONE ; <nl> - <nl> - if ( state ! = ExecutionState : : DONE ) { <nl> - / / unless we ' re DONE , never return 0 . <nl> - leftOver = ( std : : max ) ( std : : size_t { 1 } , leftOver ) ; <nl> + return { ExecutionState : : DONE , stats , nullptr } ; <nl> + } <nl> + case LimitState : : SKIPPING : { <nl> + LimitStats stats { } ; <nl> + while ( LimitState : : SKIPPING = = currentState ( ) ) { <nl> + ExecutionState state ; <nl> + LimitStats tmpStats { } ; <nl> + std : : tie ( state , tmpStats ) = skipOffset ( ) ; <nl> + stats + = tmpStats ; <nl> + if ( state = = ExecutionState : : WAITING | | state = = ExecutionState : : DONE ) { <nl> + return { state , stats , nullptr } ; <nl> + } <nl> } <nl> <nl> - return { state , leftOver } ; <nl> + / / We should have reached the next state now <nl> + TRI_ASSERT ( currentState ( ) ! = LimitState : : SKIPPING ) ; <nl> + / / Now jump to the correct case <nl> + auto rv = fetchBlockForPassthrough ( atMost ) ; <nl> + / / Add the stats we collected to the return value <nl> + std : : get < LimitStats > ( rv ) + = stats ; <nl> + return rv ; <nl> } <nl> case LimitState : : RETURNING_LAST_ROW : <nl> - case LimitState : : RETURNING : { <nl> - auto res = _fetcher . preFetchNumberOfRows ( maxRowsLeftToFetch ( ) ) ; <nl> - if ( res . first = = ExecutionState : : WAITING ) { <nl> - return res ; <nl> - } <nl> - / / Note on fullCount we might get more lines from upstream then required . <nl> - size_t leftOver = ( std : : min ) ( infos ( ) . getLimitPlusOffset ( ) - _counter , res . second ) ; <nl> - if ( _infos . isFullCountEnabled ( ) & & leftOver < atMost ) { <nl> - / / Add one for the fullcount . <nl> - leftOver + + ; <nl> - } <nl> - if ( leftOver > 0 ) { <nl> - return { ExecutionState : : HASMORE , leftOver } ; <nl> - } <nl> - return { ExecutionState : : DONE , 0 } ; <nl> - } <nl> + case LimitState : : RETURNING : <nl> + auto rv = _fetcher . fetchBlockForPassthrough ( std : : min ( atMost , maxRowsLeftToFetch ( ) ) ) ; <nl> + return { rv . first , LimitStats { } , std : : move ( rv . second ) } ; <nl> + } <nl> + } <nl> + <nl> + std : : tuple < ExecutionState , LimitExecutor : : Stats , size_t > LimitExecutor : : skipRows ( size_t const toSkipRequested ) { <nl> + / / fullCount can only be enabled on the last top - level LIMIT block . Thus <nl> + / / skip cannot be called on it ! If this requirement is changed for some <nl> + / / reason , the current implementation will not work . <nl> + TRI_ASSERT ( ! infos ( ) . isFullCountEnabled ( ) ) ; <nl> + <nl> + / / If we ' re still skipping ourselves up to offset , this needs to be done first . <nl> + size_t const toSkipOffset = <nl> + currentState ( ) = = LimitState : : SKIPPING ? maxRowsLeftToSkip ( ) : 0 ; <nl> + <nl> + / / We have to skip <nl> + / / our offset ( toSkipOffset or maxRowsLeftToSkip ( ) ) , <nl> + / / plus what we were requested to skip ( toSkipRequested ) , <nl> + / / but not more than our total limit ( maxRowsLeftToFetch ( ) ) . <nl> + size_t const toSkipTotal = <nl> + std : : min ( toSkipRequested + toSkipOffset , maxRowsLeftToFetch ( ) ) ; <nl> + <nl> + ExecutionState state ; <nl> + size_t skipped ; <nl> + std : : tie ( state , skipped ) = _fetcher . skipRows ( toSkipTotal ) ; <nl> + <nl> + / / WAITING = > skipped = = 0 <nl> + TRI_ASSERT ( state ! = ExecutionState : : WAITING | | skipped = = 0 ) ; <nl> + <nl> + _counter + = skipped ; <nl> + <nl> + / / Do NOT report the rows we skipped up to the offset , they don ' t count . <nl> + size_t const reportSkipped = toSkipOffset > = skipped ? 0 : skipped - toSkipOffset ; <nl> + <nl> + if ( currentState ( ) = = LimitState : : LIMIT_REACHED ) { <nl> + state = ExecutionState : : DONE ; <nl> } <nl> - TRI_ASSERT ( false ) ; <nl> - / / This should not be reached , ( the switch case is covering all enum values ) <nl> - / / Nevertheless if it is reached this will fall back to the non . optimal , but <nl> - / / working variant <nl> - return { ExecutionState : : DONE , atMost } ; <nl> + <nl> + return std : : make_tuple ( state , LimitStats { } , reportSkipped ) ; <nl> } <nl> mmm a / arangod / Aql / LimitExecutor . h <nl> ppp b / arangod / Aql / LimitExecutor . h <nl> <nl> # include " Aql / OutputAqlItemRow . h " <nl> # include " Aql / types . h " <nl> <nl> + # include < iosfwd > <nl> # include < memory > <nl> <nl> namespace arangodb { <nl> class LimitExecutor { <nl> public : <nl> struct Properties { <nl> static const bool preservesOrder = true ; <nl> - / / TODO Maybe we can and want to allow passthrough . For this it would be <nl> - / / necessary to allow the LimitExecutor to skip before ExecutionBlockImpl <nl> - / / prefetches a block . This is related to the comment on <nl> - / / inputSizeRestrictsOutputSize . <nl> - static const bool allowsBlockPassthrough = false ; <nl> - / / TODO : <nl> - / / The implementation of this is currently suboptimal for the LimitExecutor . <nl> - / / ExecutionBlockImpl allocates a block before calling produceRows ( ) ; <nl> - / / that means before LimitExecutor had a chance to skip ; <nl> - / / that means we cannot yet call expectedNumberOfRows ( ) on the Fetcher , <nl> - / / because it would call getSome on the parent when we actually want to <nl> - / / skip . <nl> - / / One possible solution is to call skipSome during expectedNumberOfRows ( ) , <nl> - / / which is more than a little ugly . Perhaps we can find a better way . <nl> - / / Note that there are corresponding comments in <nl> - / / ExecutionBlockImpl : : requestWrappedBlock ( ) and <nl> - / / LimitExecutor : : expectedNumberOfRows ( ) . <nl> - static const bool inputSizeRestrictsOutputSize = true ; <nl> + static const bool allowsBlockPassthrough = true ; <nl> + static const bool inputSizeRestrictsOutputSize = false ; <nl> } ; <nl> using Fetcher = SingleRowFetcher < Properties : : allowsBlockPassthrough > ; <nl> using Infos = LimitExecutorInfos ; <nl> class LimitExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRows ( OutputAqlItemRow & output ) ; <nl> <nl> - std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t atMost ) const ; <nl> - <nl> + / * * <nl> + * @ brief Custom skipRows ( ) implementation . This is obligatory to increase <nl> + * _counter ! <nl> + * <nl> + * Semantically , we first skip until our local offset . We may not report the <nl> + * number of rows skipped this way . Second , we skip up to the number of rows <nl> + * requested ; but at most up to our limit . <nl> + * / <nl> + std : : tuple < ExecutionState , Stats , size_t > skipRows ( size_t toSkipRequested ) ; <nl> + <nl> + std : : tuple < ExecutionState , LimitStats , SharedAqlItemBlockPtr > fetchBlockForPassthrough ( size_t atMost ) ; <nl> + <nl> private : <nl> Infos const & infos ( ) const noexcept { return _infos ; } ; <nl> <nl> size_t maxRowsLeftToFetch ( ) const noexcept { <nl> + / / counter should never exceed this count ! <nl> + TRI_ASSERT ( infos ( ) . getLimitPlusOffset ( ) > = _counter ) ; <nl> return infos ( ) . getLimitPlusOffset ( ) - _counter ; <nl> } <nl> <nl> size_t maxRowsLeftToSkip ( ) const noexcept { <nl> + / / should not be called after skipping the offset ! <nl> + TRI_ASSERT ( infos ( ) . getOffset ( ) > = _counter ) ; <nl> return infos ( ) . getOffset ( ) - _counter ; <nl> } <nl> <nl> class LimitExecutor { <nl> SKIPPING , <nl> / / state is RETURNING until the limit is reached <nl> RETURNING , <nl> - / / state is RETURNING_LAST_ROW only if fullCount is disabled , and we ' ve seen <nl> - / / the second to last row until the limit is reached <nl> + / / state is RETURNING_LAST_ROW if we ' ve seen the second to last row before <nl> + / / the limit is reached <nl> RETURNING_LAST_ROW , <nl> / / state is COUNTING when the limit is reached and fullcount is enabled <nl> COUNTING , <nl> class LimitExecutor { <nl> if ( _counter < infos ( ) . getOffset ( ) ) { <nl> return LimitState : : SKIPPING ; <nl> } <nl> - if ( ! infos ( ) . isFullCountEnabled ( ) & & _counter + 1 = = infos ( ) . getLimitPlusOffset ( ) ) { <nl> + if ( _counter + 1 = = infos ( ) . getLimitPlusOffset ( ) ) { <nl> return LimitState : : RETURNING_LAST_ROW ; <nl> } <nl> if ( _counter < infos ( ) . getLimitPlusOffset ( ) ) { <nl> class LimitExecutor { <nl> return LimitState : : LIMIT_REACHED ; <nl> } <nl> <nl> + std : : pair < ExecutionState , Stats > skipOffset ( ) ; <nl> + std : : pair < ExecutionState , Stats > skipRestForFullCount ( ) ; <nl> + <nl> private : <nl> Infos const & _infos ; <nl> Fetcher & _fetcher ; <nl> + InputAqlItemRow _lastRowToOutput ; <nl> + ExecutionState _stateOfLastRowToOutput ; <nl> / / Number of input lines seen <nl> size_t _counter = 0 ; <nl> } ; <nl> mmm a / arangod / Aql / LimitStats . h <nl> ppp b / arangod / Aql / LimitStats . h <nl> class LimitStats { <nl> public : <nl> LimitStats ( ) noexcept : _fullCount ( 0 ) { } <nl> <nl> + LimitStats ( LimitStats const & ) = default ; <nl> + LimitStats & operator = ( LimitStats const & ) = default ; <nl> + <nl> + / / It is relied upon that other . _fullcount is zero after the move ! <nl> + LimitStats ( LimitStats & & other ) noexcept : _fullCount ( other . _fullCount ) { <nl> + other . _fullCount = 0 ; <nl> + } <nl> + LimitStats & operator = ( LimitStats & & other ) noexcept { <nl> + _fullCount = other . _fullCount ; <nl> + other . _fullCount = 0 ; <nl> + return * this ; <nl> + } ; <nl> + <nl> void incrFullCount ( ) noexcept { _fullCount + + ; } <nl> void incrFullCountBy ( size_t amount ) noexcept { _fullCount + = amount ; } <nl> <nl> inline ExecutionStats & operator + = ( ExecutionStats & executionStats , <nl> return executionStats ; <nl> } <nl> <nl> + inline LimitStats & operator + = ( LimitStats & limitStats , LimitStats const & other ) noexcept { <nl> + limitStats . incrFullCountBy ( other . getFullCount ( ) ) ; <nl> + return limitStats ; <nl> + } <nl> + <nl> } <nl> } <nl> <nl> mmm a / arangod / Aql / ModificationExecutor . h <nl> ppp b / arangod / Aql / ModificationExecutor . h <nl> class ModificationExecutor : public ModificationExecutorBase < FetcherType > { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRows ( OutputAqlItemRow & output ) ; <nl> <nl> - / * * <nl> - * This executor immedieately returns every actually consumed row <nl> - * All other rows belong to the fetcher . <nl> - * / <nl> - inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> - TRI_ASSERT ( false ) ; <nl> - THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> - TRI_ERROR_INTERNAL , <nl> - " Logic_error , prefetching number fo rows not supported " ) ; <nl> - } <nl> - <nl> private : <nl> Modifier _modifier ; <nl> } ; <nl> mmm a / arangod / Aql / ShortestPathExecutor . h <nl> ppp b / arangod / Aql / ShortestPathExecutor . h <nl> class ShortestPathExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRows ( OutputAqlItemRow & output ) ; <nl> <nl> - inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> - TRI_ASSERT ( false ) ; <nl> - THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> - TRI_ERROR_INTERNAL , <nl> - " Logic_error , prefetching number fo rows not supported " ) ; <nl> - } <nl> - <nl> private : <nl> / * * <nl> * @ brief Fetch input row ( s ) and compute path <nl> mmm a / arangod / Aql / SingleRemoteModificationExecutor . h <nl> ppp b / arangod / Aql / SingleRemoteModificationExecutor . h <nl> struct SingleRemoteModificationExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRows ( OutputAqlItemRow & output ) ; <nl> <nl> - inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> - TRI_ASSERT ( false ) ; <nl> - THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> - TRI_ERROR_INTERNAL , <nl> - " Logic_error , prefetching number fo rows not supported " ) ; <nl> - } <nl> - <nl> protected : <nl> bool doSingleRemoteModificationOperation ( InputAqlItemRow & , OutputAqlItemRow & , Stats & ) ; <nl> <nl> mmm a / arangod / Aql / SingleRowFetcher . h <nl> ppp b / arangod / Aql / SingleRowFetcher . h <nl> class SingleRowFetcher { <nl> TEST_VIRTUAL std : : pair < ExecutionState , size_t > skipRows ( size_t atMost ) ; <nl> <nl> / / TODO enable_if < passBlocksThrough > <nl> - std : : pair < ExecutionState , SharedAqlItemBlockPtr > fetchBlockForPassthrough ( size_t atMost ) ; <nl> + TEST_VIRTUAL std : : pair < ExecutionState , SharedAqlItemBlockPtr > fetchBlockForPassthrough ( size_t atMost ) ; <nl> <nl> std : : pair < ExecutionState , size_t > preFetchNumberOfRows ( size_t atMost ) { <nl> if ( _upstreamState ! = ExecutionState : : DONE & & ! indexIsValid ( ) ) { <nl> mmm a / arangod / Aql / SubqueryExecutor . h <nl> ppp b / arangod / Aql / SubqueryExecutor . h <nl> class SubqueryExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRows ( OutputAqlItemRow & output ) ; <nl> <nl> - inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> - / / Passthrough does not need to implement this ! <nl> - TRI_ASSERT ( false ) ; <nl> - THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> - TRI_ERROR_INTERNAL , <nl> - " Logic_error , prefetching number fo rows not supported " ) ; <nl> + inline std : : tuple < ExecutionState , Stats , SharedAqlItemBlockPtr > fetchBlockForPassthrough ( size_t atMost ) { <nl> + auto rv = _fetcher . fetchBlockForPassthrough ( atMost ) ; <nl> + return { rv . first , { } , std : : move ( rv . second ) } ; <nl> } <nl> <nl> private : <nl> mmm a / arangod / Aql / TraversalExecutor . h <nl> ppp b / arangod / Aql / TraversalExecutor . h <nl> class TraversalExecutor { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRows ( OutputAqlItemRow & output ) ; <nl> <nl> - inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> - TRI_ASSERT ( false ) ; <nl> - THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> - TRI_ERROR_INTERNAL , <nl> - " Logic_error , prefetching number fo rows not supported " ) ; <nl> - } <nl> - <nl> private : <nl> / * * <nl> * @ brief compute the return state <nl> new file mode 100644 <nl> index 00000000000 . . ba34f7cc343 <nl> mmm / dev / null <nl> ppp b / tests / Aql / AqlHelper . cpp <nl> <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / DISCLAIMER <nl> + / / / <nl> + / / / Copyright 2019 ArangoDB GmbH , Cologne , Germany <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> + / / / Copyright holder is ArangoDB GmbH , Cologne , Germany <nl> + / / / <nl> + / / / @ author Tobias Gödderz <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + # include " AqlHelper . h " <nl> + <nl> + # include " Aql / ExecutionStats . h " <nl> + <nl> + using namespace arangodb ; <nl> + using namespace arangodb : : aql ; <nl> + <nl> + std : : ostream & arangodb : : aql : : operator < < ( std : : ostream & stream , ExecutionStats const & stats ) { <nl> + VPackBuilder builder { } ; <nl> + stats . toVelocyPack ( builder , true ) ; <nl> + return stream < < builder . toJson ( ) ; <nl> + } <nl> + <nl> + std : : ostream & arangodb : : aql : : operator < < ( std : : ostream & stream , AqlItemBlock const & block ) { <nl> + stream < < " [ " ; <nl> + for ( size_t row = 0 ; row < block . size ( ) ; row + + ) { <nl> + if ( row > 0 ) { <nl> + stream < < " , " ; <nl> + } <nl> + stream < < " " ; <nl> + VPackBuilder builder { } ; <nl> + builder . openArray ( ) ; <nl> + for ( RegisterId reg = 0 ; reg < block . getNrRegs ( ) ; reg + + ) { <nl> + if ( reg > 0 ) { <nl> + stream < < " , " ; <nl> + } <nl> + / / will not work for docvecs or ranges <nl> + builder . add ( block . getValueReference ( row , reg ) . slice ( ) ) ; <nl> + } <nl> + builder . close ( ) ; <nl> + stream < < builder . toJson ( ) ; <nl> + } <nl> + stream < < " ] " ; <nl> + return stream ; <nl> + } <nl> + <nl> + bool arangodb : : aql : : operator = = ( arangodb : : aql : : ExecutionStats const & left , <nl> + arangodb : : aql : : ExecutionStats const & right ) { <nl> + TRI_ASSERT ( left . nodes . empty ( ) ) ; <nl> + TRI_ASSERT ( right . nodes . empty ( ) ) ; <nl> + TRI_ASSERT ( left . executionTime = = 0 . 0 ) ; <nl> + TRI_ASSERT ( right . executionTime = = 0 . 0 ) ; <nl> + TRI_ASSERT ( left . peakMemoryUsage = = 0 ) ; <nl> + TRI_ASSERT ( right . peakMemoryUsage = = 0 ) ; <nl> + / / clang - format off <nl> + return left . writesExecuted = = right . writesExecuted <nl> + & & left . writesIgnored = = right . writesIgnored <nl> + & & left . scannedFull = = right . scannedFull <nl> + & & left . scannedIndex = = right . scannedIndex <nl> + & & left . filtered = = right . filtered <nl> + & & left . requests = = right . requests <nl> + & & left . fullCount = = right . fullCount <nl> + & & left . count = = right . count ; <nl> + / / clang - format on <nl> + } <nl> + bool arangodb : : aql : : operator = = ( arangodb : : aql : : AqlItemBlock const & left , <nl> + arangodb : : aql : : AqlItemBlock const & right ) { <nl> + if ( left . size ( ) ! = right . size ( ) ) { <nl> + return false ; <nl> + } <nl> + if ( left . getNrRegs ( ) ! = right . getNrRegs ( ) ) { <nl> + return false ; <nl> + } <nl> + size_t const rows = left . size ( ) ; <nl> + RegisterCount const regs = left . getNrRegs ( ) ; <nl> + for ( size_t row = 0 ; row < rows ; row + + ) { <nl> + for ( RegisterId reg = 0 ; reg < regs ; reg + + ) { <nl> + AqlValue const & l = left . getValueReference ( row , reg ) ; <nl> + AqlValue const & r = right . getValueReference ( row , reg ) ; <nl> + / / Doesn ' t work for docvecs or ranges <nl> + if ( l . slice ( ) ! = r . slice ( ) ) { <nl> + return false ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + return true ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 8d82e392887 <nl> mmm / dev / null <nl> ppp b / tests / Aql / AqlHelper . h <nl> <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / DISCLAIMER <nl> + / / / <nl> + / / / Copyright 2019 ArangoDB GmbH , Cologne , Germany <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> + / / / Copyright holder is ArangoDB GmbH , Cologne , Germany <nl> + / / / <nl> + / / / @ author Tobias Gödderz <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + # ifndef TESTS_AQL_AQLHELPER_H <nl> + # define TESTS_AQL_AQLHELPER_H <nl> + <nl> + # include " Aql / AqlItemBlock . h " <nl> + # include " Aql / ExecutionState . h " <nl> + # include " Aql / ExecutionStats . h " <nl> + <nl> + namespace arangodb { <nl> + namespace aql { <nl> + <nl> + std : : ostream & operator < < ( std : : ostream & , arangodb : : aql : : ExecutionStats const & ) ; <nl> + std : : ostream & operator < < ( std : : ostream & , arangodb : : aql : : AqlItemBlock const & ) ; <nl> + <nl> + bool operator = = ( arangodb : : aql : : ExecutionStats const & , arangodb : : aql : : ExecutionStats const & ) ; <nl> + bool operator = = ( arangodb : : aql : : AqlItemBlock const & , arangodb : : aql : : AqlItemBlock const & ) ; <nl> + <nl> + } <nl> + } <nl> + <nl> + # endif / / TESTS_AQL_AQLHELPER_H <nl> mmm a / tests / Aql / AqlItemBlockHelper . h <nl> ppp b / tests / Aql / AqlItemBlockHelper . h <nl> <nl> # include " Aql / ResourceUsage . h " <nl> # include " Aql / SharedAqlItemBlockPtr . h " <nl> <nl> + # include " AqlHelper . h " <nl> # include " VelocyPackHelper . h " <nl> <nl> / * * * * * * * * <nl> : : arangodb : : aql : : SharedAqlItemBlockPtr buildBlock ( : : arangodb : : aql : : AqlItemBlockM <nl> } / / namespace tests <nl> } / / namespace arangodb <nl> <nl> - namespace std { <nl> - std : : ostream & operator < < ( std : : ostream & , : : arangodb : : aql : : AqlItemBlock const & ) ; <nl> - } <nl> - <nl> namespace arangodb { <nl> namespace tests { <nl> namespace aql { <nl> class EntryToAqlValueVisitor : public boost : : static_visitor < AqlValue > { <nl> template < RegisterId columns > <nl> SharedAqlItemBlockPtr buildBlock ( AqlItemBlockManager & manager , <nl> MatrixBuilder < columns > & & matrix ) { <nl> + if ( matrix . size ( ) = = 0 ) { <nl> + return nullptr ; <nl> + } <nl> SharedAqlItemBlockPtr block { new AqlItemBlock ( manager , matrix . size ( ) , columns ) } ; <nl> <nl> for ( size_t row = 0 ; row < matrix . size ( ) ; row + + ) { <nl> mmm a / tests / Aql / CalculationExecutorTest . cpp <nl> ppp b / tests / Aql / CalculationExecutorTest . cpp <nl> class CalculationExecutorTest : public : : testing : : Test { <nl> TEST_F ( CalculationExecutorTest , there_are_no_rows_upstream_the_producer_does_not_wait ) { <nl> SharedAqlItemBlockPtr block { new AqlItemBlock ( itemBlockManager , 1000 , 2 ) } ; <nl> VPackBuilder input ; <nl> - SingleRowFetcherHelper < true > fetcher ( input . steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , input . steal ( ) , false ) ; <nl> CalculationExecutor < CalculationType : : Condition > testee ( fetcher , infos ) ; <nl> / / Use this instead of std : : ignore , so the tests will be noticed and <nl> / / updated when someone changes the stats type in the return value of <nl> TEST_F ( CalculationExecutorTest , there_are_no_rows_upstream_the_producer_does_not <nl> TEST_F ( CalculationExecutorTest , there_are_no_rows_upstream_the_producer_waits ) { <nl> SharedAqlItemBlockPtr block { new AqlItemBlock ( itemBlockManager , 1000 , 2 ) } ; <nl> VPackBuilder input ; <nl> - SingleRowFetcherHelper < true > fetcher ( input . steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , input . steal ( ) , true ) ; <nl> CalculationExecutor < CalculationType : : Condition > testee ( fetcher , infos ) ; <nl> / / Use this instead of std : : ignore , so the tests will be noticed and <nl> / / updated when someone changes the stats type in the return value of <nl> TEST_F ( CalculationExecutorTest , there_are_no_rows_upstream_the_producer_waits ) { <nl> TEST_F ( CalculationExecutorTest , there_are_rows_in_the_upstream_the_producer_does_not_wait ) { <nl> SharedAqlItemBlockPtr block { new AqlItemBlock ( itemBlockManager , 1000 , 2 ) } ; <nl> auto input = VPackParser : : fromJson ( " [ [ 0 ] , [ 1 ] , [ 2 ] ] " ) ; <nl> - SingleRowFetcherHelper < true > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> CalculationExecutor < CalculationType : : Condition > testee ( fetcher , infos ) ; <nl> NoStats stats { } ; <nl> <nl> TEST_F ( CalculationExecutorTest , there_are_rows_in_the_upstream_the_producer_does <nl> TEST_F ( CalculationExecutorTest , there_are_rows_in_the_upstream_the_producer_waits ) { <nl> SharedAqlItemBlockPtr block { new AqlItemBlock ( itemBlockManager , 1000 , 2 ) } ; <nl> auto input = VPackParser : : fromJson ( " [ [ 0 ] , [ 1 ] , [ 2 ] ] " ) ; <nl> - SingleRowFetcherHelper < true > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> CalculationExecutor < CalculationType : : Condition > testee ( fetcher , infos ) ; <nl> NoStats stats { } ; <nl> <nl> mmm a / tests / Aql / CountCollectExecutorTest . cpp <nl> ppp b / tests / Aql / CountCollectExecutorTest . cpp <nl> class CountCollectExecutorTest : public : : testing : : Test { <nl> TEST_F ( CountCollectExecutorTest , there_are_no_rows_upstream_the_producer_doesnt_wait ) { <nl> CountCollectExecutorInfos infos ( 1 / * outputRegId * / , 1 / * nrIn * / , nrOutputReg , { } , { } ) ; <nl> VPackBuilder input ; <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , false ) ; <nl> CountCollectExecutor testee ( fetcher , infos ) ; <nl> NoStats stats { } ; <nl> <nl> TEST_F ( CountCollectExecutorTest , there_are_no_rows_upstream_the_producer_doesnt_ <nl> TEST_F ( CountCollectExecutorTest , there_are_now_rows_upstream_the_producer_waits ) { <nl> CountCollectExecutorInfos infos ( 1 / * outputRegId * / , 1 / * nrIn * / , nrOutputReg , { } , { } ) ; <nl> VPackBuilder input ; <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , true ) ; <nl> CountCollectExecutor testee ( fetcher , infos ) ; <nl> NoStats stats { } ; <nl> <nl> TEST_F ( CountCollectExecutorTest , there_are_now_rows_upstream_the_producer_waits ) <nl> TEST_F ( CountCollectExecutorTest , there_are_rows_in_the_upstream_the_producer_doesnt_wait ) { <nl> CountCollectExecutorInfos infos ( 1 / * outputRegId * / , 1 / * nrIn * / , nrOutputReg , { } , { } ) ; <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> CountCollectExecutor testee ( fetcher , infos ) ; <nl> NoStats stats { } ; <nl> <nl> TEST_F ( CountCollectExecutorTest , there_are_rows_in_the_upstream_the_producer_doe <nl> TEST_F ( CountCollectExecutorTest , there_are_rows_in_the_upstream_the_producer_waits ) { <nl> CountCollectExecutorInfos infos ( 1 / * outputRegId * / , 1 / * nrIn * / , nrOutputReg , { } , { } ) ; <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> CountCollectExecutor testee ( fetcher , infos ) ; <nl> NoStats stats { } ; <nl> OutputAqlItemRow result { std : : move ( block ) , outputRegisters , <nl> mmm a / tests / Aql / DistinctCollectExecutorTest . cpp <nl> ppp b / tests / Aql / DistinctCollectExecutorTest . cpp <nl> TEST_F ( DistinctCollectExecutorTest , if_no_rows_in_upstream_the_producer_doesnt_w <nl> std : : move ( groupRegisters ) , trx ) ; <nl> block . reset ( new AqlItemBlock ( itemBlockManager , 1000 , 2 ) ) ; <nl> <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , false ) ; <nl> DistinctCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( DistinctCollectExecutorTest , if_no_rows_in_upstream_the_producer_waits ) { <nl> std : : move ( groupRegisters ) , trx ) ; <nl> block . reset ( new AqlItemBlock ( itemBlockManager , 1000 , 2 ) ) ; <nl> <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , true ) ; <nl> DistinctCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( DistinctCollectExecutorTest , <nl> block . reset ( new AqlItemBlock ( itemBlockManager , 1000 , nrOutputRegister ) ) ; <nl> <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> DistinctCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( DistinctCollectExecutorTest , <nl> block . reset ( new AqlItemBlock ( itemBlockManager , 1000 , nrOutputRegister ) ) ; <nl> <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> DistinctCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( DistinctCollectExecutorTest , <nl> block . reset ( new AqlItemBlock ( itemBlockManager , 1000 , nrOutputRegister ) ) ; <nl> <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] , [ 1 ] , [ 2 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> DistinctCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( DistinctCollectExecutorTest , <nl> block . reset ( new AqlItemBlock ( itemBlockManager , 1000 , nrOutputRegister ) ) ; <nl> <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] , [ 1 ] , [ 2 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> DistinctCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> mmm a / tests / Aql / EnumerateCollectionExecutorTest . cpp <nl> ppp b / tests / Aql / EnumerateCollectionExecutorTest . cpp <nl> class EnumerateCollectionExecutorTestNoRowsUpstream : public : : testing : : Test { <nl> } ; <nl> <nl> TEST_F ( EnumerateCollectionExecutorTestNoRowsUpstream , the_producer_does_not_wait ) { <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , false ) ; <nl> EnumerateCollectionExecutor testee ( fetcher , infos ) ; <nl> / / Use this instead of std : : ignore , so the tests will be noticed and <nl> / / updated when someone changes the stats type in the return value of <nl> TEST_F ( EnumerateCollectionExecutorTestNoRowsUpstream , the_producer_does_not_wait <nl> } <nl> <nl> TEST_F ( EnumerateCollectionExecutorTestNoRowsUpstream , the_producer_waits ) { <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , true ) ; <nl> EnumerateCollectionExecutor testee ( fetcher , infos ) ; <nl> / / Use this instead of std : : ignore , so the tests will be noticed and <nl> / / updated when someone changes the stats type in the return value of <nl> mmm a / tests / Aql / EnumerateListExecutorTest . cpp <nl> ppp b / tests / Aql / EnumerateListExecutorTest . cpp <nl> TEST_F ( EnumerateListExecutorTest , there_are_no_rows_upstream_the_producer_does_n <nl> SharedAqlItemBlockPtr block { new AqlItemBlock ( itemBlockManager , 1000 , 2 ) } ; <nl> VPackBuilder input ; <nl> <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , false ) ; <nl> EnumerateListExecutor testee ( fetcher , infos ) ; <nl> / / Use this instead of std : : ignore , so the tests will be noticed and <nl> / / updated when someone changes the stats type in the return value of <nl> TEST_F ( EnumerateListExecutorTest , there_are_no_rows_upstream_the_producer_waits ) <nl> SharedAqlItemBlockPtr block { new AqlItemBlock ( itemBlockManager , 1000 , 2 ) } ; <nl> VPackBuilder input ; <nl> <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , true ) ; <nl> EnumerateListExecutor testee ( fetcher , infos ) ; <nl> / / Use this instead of std : : ignore , so the tests will be noticed and <nl> / / updated when someone changes the stats type in the return value of <nl> TEST_F ( EnumerateListExecutorTest , there_is_one_row_in_the_upstream_the_producer_ <nl> SharedAqlItemBlockPtr block { new AqlItemBlock ( itemBlockManager , 1000 , 5 ) } ; <nl> auto input = VPackParser : : fromJson ( " [ [ 1 , 2 , 3 , [ true , true , true ] ] ] " ) ; <nl> <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> EnumerateListExecutor testee ( fetcher , infos ) ; <nl> / / Use this instead of std : : ignore , so the tests will be noticed and <nl> / / updated when someone changes the stats type in the return value of <nl> TEST_F ( EnumerateListExecutorTest , there_is_one_empty_array_row_in_the_upstream_t <nl> SharedAqlItemBlockPtr block { new AqlItemBlock ( itemBlockManager , 1000 , 5 ) } ; <nl> auto input = VPackParser : : fromJson ( " [ [ 1 , 2 , 3 , [ ] ] ] " ) ; <nl> <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> EnumerateListExecutor testee ( fetcher , infos ) ; <nl> / / Use this instead of std : : ignore , so the tests will be noticed and <nl> / / updated when someone changes the stats type in the return value of <nl> TEST_F ( EnumerateListExecutorTest , there_are_rows_in_the_upstream_the_producer_wa <nl> auto input = VPackParser : : fromJson ( <nl> " [ [ 1 , 2 , 3 , [ true , true , true ] ] , [ 1 , 2 , 3 , [ true , true , true ] ] ] " ) ; <nl> <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> EnumerateListExecutor testee ( fetcher , infos ) ; <nl> / / Use this instead of std : : ignore , so the tests will be noticed and <nl> / / updated when someone changes the stats type in the return value of <nl> similarity index 58 % <nl> rename from tests / Aql / AqlItemBlockHelper . cpp <nl> rename to tests / Aql / ExecutorTestHelper . cpp <nl> mmm a / tests / Aql / AqlItemBlockHelper . cpp <nl> ppp b / tests / Aql / ExecutorTestHelper . cpp <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / / DISCLAIMER <nl> / / / <nl> - / / / Copyright 2018 ArangoDB GmbH , Cologne , Germany <nl> + / / / Copyright 2019 ArangoDB GmbH , Cologne , Germany <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> <nl> / / / @ author Tobias Gödderz <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> - # include " AqlItemBlockHelper . h " <nl> + # include " ExecutorTestHelper . h " <nl> <nl> - std : : ostream & std : : operator < < ( <nl> - std : : ostream & out , : : arangodb : : aql : : AqlItemBlock const & block ) { <nl> - for ( size_t i = 0 ; i < block . size ( ) ; i + + ) { <nl> - for ( arangodb : : aql : : RegisterCount j = 0 ; j < block . getNrRegs ( ) ; j + + ) { <nl> - out < < block . getValue ( i , j ) . slice ( ) . toJson ( ) ; <nl> - if ( j + 1 ! = block . getNrRegs ( ) ) out < < " , " ; <nl> + std : : ostream & arangodb : : tests : : aql : : operator < < ( std : : ostream & stream , <nl> + arangodb : : tests : : aql : : ExecutorCall call ) { <nl> + return stream < < [ call ] ( ) { <nl> + switch ( call ) { <nl> + case ExecutorCall : : SKIP_ROWS : <nl> + return " SKIP_ROWS " ; <nl> + case ExecutorCall : : PRODUCE_ROWS : <nl> + return " PRODUCE_ROWS " ; <nl> + case ExecutorCall : : FETCH_FOR_PASSTHROUGH : <nl> + return " FETCH_FOR_PASSTHROUGH " ; <nl> + case ExecutorCall : : EXPECTED_NR_ROWS : <nl> + return " EXPECTED_NR_ROWS " ; <nl> } <nl> - if ( i + 1 ! = block . size ( ) ) out < < std : : endl ; <nl> - } <nl> - <nl> - out < < std : : endl ; <nl> - <nl> - return out ; <nl> + } ( ) ; <nl> } <nl> new file mode 100644 <nl> index 00000000000 . . 3e6a05ec141 <nl> mmm / dev / null <nl> ppp b / tests / Aql / ExecutorTestHelper . h <nl> <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / DISCLAIMER <nl> + / / / <nl> + / / / Copyright 2019 ArangoDB GmbH , Cologne , Germany <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> + / / / Copyright holder is ArangoDB GmbH , Cologne , Germany <nl> + / / / <nl> + / / / @ author Tobias Gödderz <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + # ifndef TESTS_AQL_EXECUTORTESTHELPER_H <nl> + # define TESTS_AQL_EXECUTORTESTHELPER_H <nl> + <nl> + # include " gtest / gtest . h " <nl> + <nl> + # include " Aql / ExecutionBlock . h " <nl> + # include " Aql / ExecutionState . h " <nl> + # include " Aql / ExecutionStats . h " <nl> + # include " Aql / OutputAqlItemRow . h " <nl> + # include " Aql / SharedAqlItemBlockPtr . h " <nl> + <nl> + # include < tuple > <nl> + <nl> + namespace arangodb { <nl> + namespace tests { <nl> + namespace aql { <nl> + <nl> + enum class ExecutorCall { <nl> + SKIP_ROWS , <nl> + PRODUCE_ROWS , <nl> + FETCH_FOR_PASSTHROUGH , <nl> + EXPECTED_NR_ROWS , <nl> + } ; <nl> + <nl> + std : : ostream & operator < < ( std : : ostream & stream , ExecutorCall call ) ; <nl> + <nl> + using ExecutorStepResult = std : : tuple < ExecutorCall , arangodb : : aql : : ExecutionState , size_t > ; <nl> + <nl> + / / TODO Add skipRows by passing 3 additional integers i , j , k , saying we should <nl> + / / - skip i rows <nl> + / / - produce j rows <nl> + / / - skip k rows <nl> + / / TODO Make the calls to skipRows , fetchBlockForPassthrough and ( later ) expectedNumberOfRows <nl> + / / somehow optional . e . g . call a templated function or so . <nl> + / / TODO Add calls to expectedNumberOfRows <nl> + <nl> + template < class Executor > <nl> + std : : tuple < arangodb : : aql : : SharedAqlItemBlockPtr , std : : vector < ExecutorStepResult > , arangodb : : aql : : ExecutionStats > <nl> + runExecutor ( arangodb : : aql : : AqlItemBlockManager & manager , Executor & executor , <nl> + arangodb : : aql : : OutputAqlItemRow & outputRow , size_t const numSkip , <nl> + size_t const numProduce , bool const skipRest ) { <nl> + using namespace arangodb : : aql ; <nl> + ExecutionState state = ExecutionState : : HASMORE ; <nl> + std : : vector < ExecutorStepResult > results { } ; <nl> + ExecutionStats stats { } ; <nl> + <nl> + uint64_t rowsLeft = 0 ; <nl> + size_t skippedTotal = 0 ; <nl> + size_t producedTotal = 0 ; <nl> + <nl> + enum class RunState { <nl> + SKIP_OFFSET , <nl> + FETCH_FOR_PASSTHROUGH , <nl> + PRODUCE , <nl> + SKIP_REST , <nl> + BREAK <nl> + } ; <nl> + <nl> + while ( state ! = ExecutionState : : DONE ) { <nl> + RunState const runState = [ & ] ( ) { <nl> + if ( skippedTotal < numSkip ) { <nl> + return RunState : : SKIP_OFFSET ; <nl> + } <nl> + if ( rowsLeft = = 0 & & ( producedTotal < numProduce | | numProduce = = 0 ) ) { <nl> + return RunState : : FETCH_FOR_PASSTHROUGH ; <nl> + } <nl> + if ( producedTotal < numProduce | | ! skipRest ) { <nl> + return RunState : : PRODUCE ; <nl> + } <nl> + if ( skipRest ) { <nl> + return RunState : : SKIP_REST ; <nl> + } <nl> + return RunState : : BREAK ; <nl> + } ( ) ; <nl> + <nl> + switch ( runState ) { <nl> + / / Skip first <nl> + / / TODO don ' t do this for executors which don ' t have skipRows <nl> + case RunState : : SKIP_OFFSET : { <nl> + size_t skipped ; <nl> + typename Executor : : Stats executorStats { } ; <nl> + std : : tie ( state , executorStats , skipped ) = executor . skipRows ( numSkip ) ; <nl> + results . emplace_back ( std : : make_tuple ( ExecutorCall : : SKIP_ROWS , state , skipped ) ) ; <nl> + stats + = executorStats ; <nl> + skippedTotal + = skipped ; <nl> + } break ; <nl> + / / Get a new block for pass - through if we still need to produce rows and <nl> + / / the current ( imagined , via rowsLeft ) block is " empty " . <nl> + / / TODO : Don ' t do this at all for non - passThrough blocks <nl> + case RunState : : FETCH_FOR_PASSTHROUGH : { <nl> + ExecutionState fetchBlockState ; <nl> + typename Executor : : Stats executorStats { } ; <nl> + SharedAqlItemBlockPtr block { } ; <nl> + std : : tie ( fetchBlockState , executorStats , block ) = <nl> + executor . fetchBlockForPassthrough ( 1000 ) ; <nl> + size_t const blockSize = block ! = nullptr ? block - > size ( ) : 0 ; <nl> + results . emplace_back ( std : : make_tuple ( ExecutorCall : : FETCH_FOR_PASSTHROUGH , <nl> + fetchBlockState , blockSize ) ) ; <nl> + stats + = executorStats ; <nl> + rowsLeft = blockSize ; <nl> + if ( fetchBlockState ! = ExecutionState : : WAITING & & <nl> + fetchBlockState ! = ExecutionState : : DONE ) { <nl> + EXPECT_GT ( rowsLeft , 0 ) ; <nl> + } <nl> + if ( fetchBlockState ! = ExecutionState : : WAITING & & block = = nullptr ) { <nl> + EXPECT_EQ ( ExecutionState : : DONE , fetchBlockState ) ; <nl> + / / Abort <nl> + state = ExecutionState : : DONE ; <nl> + } <nl> + } break ; <nl> + / / Produce rows <nl> + case RunState : : PRODUCE : { <nl> + EXPECT_GT ( rowsLeft , 0 ) ; <nl> + typename Executor : : Stats executorStats { } ; <nl> + size_t const rowsBefore = outputRow . numRowsWritten ( ) ; <nl> + std : : tie ( state , executorStats ) = executor . produceRows ( outputRow ) ; <nl> + size_t const rowsAfter = outputRow . numRowsWritten ( ) ; <nl> + size_t const rowsProduced = rowsAfter - rowsBefore ; <nl> + results . emplace_back ( std : : make_tuple ( ExecutorCall : : PRODUCE_ROWS , state , rowsProduced ) ) ; <nl> + stats + = executorStats ; <nl> + EXPECT_LE ( rowsProduced , rowsLeft ) ; <nl> + rowsLeft - = rowsProduced ; <nl> + producedTotal + = rowsProduced ; <nl> + <nl> + if ( outputRow . produced ( ) ) { <nl> + outputRow . advanceRow ( ) ; <nl> + } <nl> + } break ; <nl> + / / TODO don ' t do this for executors which don ' t have skipRows <nl> + case RunState : : SKIP_REST : { <nl> + size_t skipped ; <nl> + typename Executor : : Stats executorStats { } ; <nl> + std : : tie ( state , executorStats , skipped ) = <nl> + executor . skipRows ( ExecutionBlock : : SkipAllSize ( ) ) ; <nl> + results . emplace_back ( std : : make_tuple ( ExecutorCall : : SKIP_ROWS , state , skipped ) ) ; <nl> + stats + = executorStats ; <nl> + } break ; <nl> + / / We ' re done <nl> + case RunState : : BREAK : { <nl> + state = ExecutionState : : DONE ; <nl> + } break ; <nl> + } <nl> + } <nl> + <nl> + return { outputRow . stealBlock ( ) , results , stats } ; <nl> + } <nl> + <nl> + } / / namespace aql <nl> + } / / namespace tests <nl> + } / / namespace arangodb <nl> + <nl> + # endif / / TESTS_AQL_EXECUTORTESTHELPER_H <nl> mmm a / tests / Aql / FilterExecutorTest . cpp <nl> ppp b / tests / Aql / FilterExecutorTest . cpp <nl> class FilterExecutorTest : public : : testing : : Test { <nl> <nl> TEST_F ( FilterExecutorTest , there_are_no_rows_upstream_the_producer_does_not_wait ) { <nl> VPackBuilder input ; <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , false ) ; <nl> FilterExecutor testee ( fetcher , infos ) ; <nl> FilterStats stats { } ; <nl> <nl> TEST_F ( FilterExecutorTest , there_are_no_rows_upstream_the_producer_does_not_wait <nl> <nl> TEST_F ( FilterExecutorTest , there_are_no_rows_upstream_the_producer_waits ) { <nl> VPackBuilder input ; <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , true ) ; <nl> FilterExecutor testee ( fetcher , infos ) ; <nl> FilterStats stats { } ; <nl> <nl> TEST_F ( FilterExecutorTest , there_are_no_rows_upstream_the_producer_waits ) { <nl> TEST_F ( FilterExecutorTest , there_are_rows_in_the_upstream_the_producer_does_not_wait ) { <nl> auto input = VPackParser : : fromJson ( <nl> " [ [ true ] , [ false ] , [ true ] , [ false ] , [ false ] , [ true ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> FilterExecutor testee ( fetcher , infos ) ; <nl> FilterStats stats { } ; <nl> <nl> TEST_F ( FilterExecutorTest , there_are_rows_in_the_upstream_the_producer_does_not_ <nl> TEST_F ( FilterExecutorTest , there_are_rows_in_the_upstream_the_producer_waits ) { <nl> auto input = VPackParser : : fromJson ( <nl> " [ [ true ] , [ false ] , [ true ] , [ false ] , [ false ] , [ true ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> FilterExecutor testee ( fetcher , infos ) ; <nl> FilterStats stats { } ; <nl> <nl> TEST_F ( FilterExecutorTest , <nl> there_are_rows_in_the_upstream_and_the_last_one_has_to_be_filtered_the_producer_does_not_wait ) { <nl> auto input = VPackParser : : fromJson ( <nl> " [ [ true ] , [ false ] , [ true ] , [ false ] , [ false ] , [ true ] , [ false ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> FilterExecutor testee ( fetcher , infos ) ; <nl> FilterStats stats { } ; <nl> <nl> TEST_F ( FilterExecutorTest , <nl> there_are_rows_in_the_upstream_and_the_last_one_has_to_be_filtered_the_producer_waits ) { <nl> auto input = VPackParser : : fromJson ( <nl> " [ [ true ] , [ false ] , [ true ] , [ false ] , [ false ] , [ true ] , [ false ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> FilterExecutor testee ( fetcher , infos ) ; <nl> FilterStats stats { } ; <nl> <nl> mmm a / tests / Aql / HashedCollectExecutorTest . cpp <nl> ppp b / tests / Aql / HashedCollectExecutorTest . cpp <nl> class HashedCollectExecutorTestNoRows : public : : testing : : Test { <nl> } ; <nl> <nl> TEST_F ( HashedCollectExecutorTestNoRows , the_producer_doesnt_wait ) { <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , false ) ; <nl> HashedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( HashedCollectExecutorTestNoRows , the_producer_doesnt_wait ) { <nl> } <nl> <nl> TEST_F ( HashedCollectExecutorTestNoRows , the_producer_waits ) { <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , true ) ; <nl> HashedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> class HashedCollectExecutorTestRowsNoCount : public : : testing : : Test { <nl> <nl> TEST_F ( HashedCollectExecutorTestRowsNoCount , the_producer_doesnt_wait_1 ) { <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> HashedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( HashedCollectExecutorTestRowsNoCount , the_producer_doesnt_wait_1 ) { <nl> <nl> TEST_F ( HashedCollectExecutorTestRowsNoCount , the_producer_doesnt_wait_2 ) { <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> HashedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( HashedCollectExecutorTestRowsNoCount , the_producer_doesnt_wait_2 ) { <nl> <nl> TEST_F ( HashedCollectExecutorTestRowsNoCount , the_producer_doesnt_wait_3 ) { <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] , [ 1 ] , [ 2 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> HashedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( HashedCollectExecutorTestRowsNoCount , the_producer_doesnt_wait_3 ) { <nl> <nl> TEST_F ( HashedCollectExecutorTestRowsNoCount , the_producer_doesnt_wait_4 ) { <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 1 ] , [ 2 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> HashedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( HashedCollectExecutorTestRowsNoCount , the_producer_doesnt_wait_4 ) { <nl> <nl> TEST_F ( HashedCollectExecutorTestRowsNoCount , the_producer_waits ) { <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> HashedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST ( HashedCollectExecutorTestRowsCount , the_producer_doesnt_wait ) { <nl> NoStats stats { } ; <nl> <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> HashedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST ( HashedCollectExecutorTestRowsCountNumbers , the_producer_doesnt_wait ) { <nl> NoStats stats { } ; <nl> <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> HashedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST ( HashedCollectExecutorTestRowsCountStrings , the_producer_doesnt_wait ) { <nl> NoStats stats { } ; <nl> <nl> auto input = VPackParser : : fromJson ( " [ [ \ " a \ " ] , [ \ " aa \ " ] , [ \ " aaa \ " ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> HashedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> mmm a / tests / Aql / LimitExecutorTest . cpp <nl> ppp b / tests / Aql / LimitExecutorTest . cpp <nl> <nl> / / / @ author Heiko Kernbach <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> - # include " RowFetcherHelper . h " <nl> # include " gtest / gtest . h " <nl> <nl> + # include " AqlHelper . h " <nl> + # include " AqlItemBlockHelper . h " <nl> + # include " ExecutorTestHelper . h " <nl> + # include " RowFetcherHelper . h " <nl> + # include " VelocyPackHelper . h " <nl> + <nl> # include " Aql / AqlItemBlock . h " <nl> # include " Aql / ExecutorInfos . h " <nl> # include " Aql / InputAqlItemRow . h " <nl> class LimitExecutorTest : public : : testing : : Test { <nl> std : : initializer_list < RegisterId > { 0 } ) ) { } <nl> } ; <nl> <nl> - TEST_F ( LimitExecutorTest , no_rows_upstream_the_producer_doesnt_wait ) { <nl> + TEST_F ( LimitExecutorTest , row_upstream_the_producer_doesnt_wait ) { <nl> + auto input = VPackParser : : fromJson ( " [ [ 1 ] ] " ) ; <nl> LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , 0 , 1 , true ) ; <nl> - VPackBuilder input ; <nl> <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> LimitExecutor testee ( fetcher , infos ) ; <nl> LimitStats stats { } ; <nl> <nl> OutputAqlItemRow result { std : : move ( block ) , outputRegisters , registersToKeep , <nl> infos . registersToClear ( ) } ; <nl> std : : tie ( state , stats ) = testee . produceRows ( result ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : DONE ) ; <nl> - ASSERT_TRUE ( ! result . produced ( ) ) ; <nl> - ASSERT_TRUE ( stats . getFullCount ( ) = = 0 ) ; <nl> + ASSERT_EQ ( state , ExecutionState : : DONE ) ; <nl> + ASSERT_TRUE ( result . produced ( ) ) ; <nl> + ASSERT_EQ ( 1 , stats . getFullCount ( ) ) ; <nl> } <nl> <nl> - TEST_F ( LimitExecutorTest , now_rows_upstream_the_producer_waits ) { <nl> + TEST_F ( LimitExecutorTest , row_upstream_the_producer_waits ) { <nl> + auto input = VPackParser : : fromJson ( " [ [ 1 ] ] " ) ; <nl> LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , 0 , 1 , true ) ; <nl> - VPackBuilder input ; <nl> <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> LimitExecutor testee ( fetcher , infos ) ; <nl> LimitStats stats { } ; <nl> <nl> OutputAqlItemRow result { std : : move ( block ) , outputRegisters , registersToKeep , <nl> infos . registersToClear ( ) } ; <nl> std : : tie ( state , stats ) = testee . produceRows ( result ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : WAITING ) ; <nl> + ASSERT_EQ ( ExecutionState : : WAITING , state ) ; <nl> ASSERT_TRUE ( ! result . produced ( ) ) ; <nl> - ASSERT_TRUE ( stats . getFullCount ( ) = = 0 ) ; <nl> + ASSERT_EQ ( 0 , stats . getFullCount ( ) ) ; <nl> <nl> std : : tie ( state , stats ) = testee . produceRows ( result ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : DONE ) ; <nl> - ASSERT_TRUE ( ! result . produced ( ) ) ; <nl> - ASSERT_TRUE ( stats . getFullCount ( ) = = 0 ) ; <nl> + ASSERT_EQ ( ExecutionState : : DONE , state ) ; <nl> + ASSERT_TRUE ( result . produced ( ) ) ; <nl> + ASSERT_EQ ( 1 , stats . getFullCount ( ) ) ; <nl> } <nl> <nl> TEST_F ( LimitExecutorTest , rows_upstream_the_producer_doesnt_wait_limit_1_offset_0_fullcount_false ) { <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] , [ 4 ] ] " ) ; <nl> LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , 0 , 1 , false ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> LimitExecutor testee ( fetcher , infos ) ; <nl> LimitStats stats { } ; <nl> <nl> TEST_F ( LimitExecutorTest , rows_upstream_the_producer_doesnt_wait_limit_1_offset_ <nl> row . advanceRow ( ) ; <nl> <nl> std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : DONE ) ; <nl> + ASSERT_EQ ( ExecutionState : : DONE , state ) ; <nl> ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> } <nl> <nl> TEST_F ( LimitExecutorTest , rows_upstream_the_producer_doesnt_wait_limit_1_offset_0_fullcount_true ) { <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] , [ 4 ] ] " ) ; <nl> LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , 0 , 1 , true ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> LimitExecutor testee ( fetcher , infos ) ; <nl> LimitStats stats { } ; <nl> <nl> TEST_F ( LimitExecutorTest , rows_upstream_the_producer_doesnt_wait_limit_1_offset_ <nl> infos . registersToClear ( ) } ; <nl> <nl> std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : HASMORE ) ; <nl> + ASSERT_EQ ( ExecutionState : : DONE , state ) ; <nl> ASSERT_TRUE ( row . produced ( ) ) ; <nl> + ASSERT_EQ ( 4 , stats . getFullCount ( ) ) ; <nl> <nl> - row . advanceRow ( ) ; <nl> + auto block = row . stealBlock ( ) ; <nl> + AqlValue value = block - > getValue ( 0 , 0 ) ; <nl> + ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> + ASSERT_EQ ( 1 , value . toInt64 ( ) ) ; <nl> + } <nl> + <nl> + TEST_F ( LimitExecutorTest , rows_upstream_the_producer_doesnt_wait_limit_1_offset_1_fullcount_true ) { <nl> + auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] , [ 4 ] ] " ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , 1 , 1 , true ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> + LimitExecutor testee ( fetcher , infos ) ; <nl> + LimitStats stats { } ; <nl> + <nl> + OutputAqlItemRow row { std : : move ( block ) , outputRegisters , registersToKeep , <nl> + infos . registersToClear ( ) } ; <nl> <nl> std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> - ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : DONE ) ; <nl> - ASSERT_TRUE ( stats . getFullCount ( ) = = 3 ) ; <nl> + ASSERT_EQ ( ExecutionState : : DONE , state ) ; <nl> + ASSERT_TRUE ( row . produced ( ) ) ; <nl> + ASSERT_EQ ( 4 , stats . getFullCount ( ) ) ; <nl> <nl> auto block = row . stealBlock ( ) ; <nl> AqlValue value = block - > getValue ( 0 , 0 ) ; <nl> ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> - ASSERT_TRUE ( value . toInt64 ( ) = = 1 ) ; <nl> + ASSERT_EQ ( 2 , value . toInt64 ( ) ) ; <nl> } <nl> <nl> - TEST_F ( LimitExecutorTest , rows_upstream_the_producer_doesnt_wait_limit_1_offset_1_fullcount_true ) { <nl> + TEST_F ( LimitExecutorTest , rows_upstream_the_producer_waits_limit_1_offset_0_fullcount_false ) { <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] , [ 4 ] ] " ) ; <nl> - LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , 1 , 1 , true ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , 0 , 1 , false ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> LimitExecutor testee ( fetcher , infos ) ; <nl> LimitStats stats { } ; <nl> <nl> TEST_F ( LimitExecutorTest , rows_upstream_the_producer_doesnt_wait_limit_1_offset_ <nl> infos . registersToClear ( ) } ; <nl> <nl> std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : HASMORE ) ; <nl> + ASSERT_EQ ( ExecutionState : : WAITING , state ) ; <nl> + ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : DONE , state ) ; <nl> ASSERT_TRUE ( row . produced ( ) ) ; <nl> <nl> row . advanceRow ( ) ; <nl> <nl> std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : DONE , state ) ; <nl> ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : DONE ) ; <nl> - ASSERT_TRUE ( stats . getFullCount ( ) = = 2 ) ; <nl> <nl> auto block = row . stealBlock ( ) ; <nl> AqlValue value = block - > getValue ( 0 , 0 ) ; <nl> ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> - ASSERT_TRUE ( value . toInt64 ( ) = = 2 ) ; <nl> + ASSERT_EQ ( 1 , value . toInt64 ( ) ) ; <nl> } <nl> <nl> - TEST_F ( LimitExecutorTest , rows_upstream_the_producer_waits_limit_1_offset_0_fullcount_false ) { <nl> + TEST_F ( LimitExecutorTest , rows_upstream_the_producer_waits_limit_1_offset_0_fullcount_true ) { <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] , [ 4 ] ] " ) ; <nl> - LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , 0 , 1 , false ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , 0 , 1 , true ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> LimitExecutor testee ( fetcher , infos ) ; <nl> LimitStats stats { } ; <nl> + size_t fullCount = 0 ; <nl> <nl> OutputAqlItemRow row { std : : move ( block ) , outputRegisters , registersToKeep , <nl> infos . registersToClear ( ) } ; <nl> <nl> std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : WAITING ) ; <nl> + ASSERT_EQ ( ExecutionState : : WAITING , state ) ; <nl> + ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> + EXPECT_EQ ( 0 , stats . getFullCount ( ) ) ; <nl> + fullCount + = stats . getFullCount ( ) ; <nl> + <nl> + / / In the following , the EXPECTs against stats . getFullCount ( ) after each <nl> + / / produceRows ( ) call are not strictly required , but implementation dependent . <nl> + / / The implementation of LimitExecutor would be allowed to return rows it has <nl> + / / already seen at these points . <nl> + / / It is sufficient that the sum of the stats equals 4 , which is asserted at <nl> + / / the end . So the intermediate EXPECTs are against the actual implementation <nl> + / / and thus just there in order to find the location of an error faster . <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : WAITING , state ) ; <nl> ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> + EXPECT_EQ ( 0 , stats . getFullCount ( ) ) ; / / not strictly required , see comment above <nl> + fullCount + = stats . getFullCount ( ) ; <nl> <nl> std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : DONE ) ; <nl> + ASSERT_EQ ( ExecutionState : : WAITING , state ) ; <nl> + ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> + EXPECT_EQ ( 0 , stats . getFullCount ( ) ) ; / / not strictly required , see comment above <nl> + fullCount + = stats . getFullCount ( ) ; <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : WAITING , state ) ; <nl> + ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> + EXPECT_EQ ( 0 , stats . getFullCount ( ) ) ; / / not strictly required , see comment above <nl> + fullCount + = stats . getFullCount ( ) ; <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : DONE , state ) ; <nl> ASSERT_TRUE ( row . produced ( ) ) ; <nl> + EXPECT_EQ ( 4 , stats . getFullCount ( ) ) ; / / not strictly required , see comment above <nl> + fullCount + = stats . getFullCount ( ) ; <nl> + <nl> + ASSERT_EQ ( 4 , fullCount ) ; <nl> <nl> + auto block = row . stealBlock ( ) ; <nl> + AqlValue value = block - > getValue ( 0 , 0 ) ; <nl> + ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> + ASSERT_EQ ( 1 , value . toInt64 ( ) ) ; <nl> + } <nl> + <nl> + TEST_F ( LimitExecutorTest , rows_upstream_the_producer_doesnt_wait_limit_6_offset_1_fullcount_false ) { <nl> + size_t constexpr offset = 1 ; <nl> + size_t constexpr limit = 6 ; <nl> + bool constexpr fullcount = false ; <nl> + bool constexpr waiting = false ; <nl> + auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] , [ 4 ] ] " ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , offset , limit , fullcount ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , input - > steal ( ) , waiting ) ; <nl> + LimitExecutor testee ( fetcher , infos ) ; <nl> + LimitStats stats { } ; <nl> + <nl> + OutputAqlItemRow row { std : : move ( block ) , outputRegisters , registersToKeep , <nl> + infos . registersToClear ( ) } ; <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : HASMORE , state ) ; <nl> + ASSERT_TRUE ( row . produced ( ) ) ; <nl> row . advanceRow ( ) ; <nl> <nl> std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : DONE ) ; <nl> - ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> + ASSERT_EQ ( ExecutionState : : HASMORE , state ) ; <nl> + ASSERT_TRUE ( row . produced ( ) ) ; <nl> + row . advanceRow ( ) ; <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : DONE , state ) ; <nl> + ASSERT_TRUE ( row . produced ( ) ) ; <nl> <nl> auto block = row . stealBlock ( ) ; <nl> + EXPECT_EQ ( 3 , block - > size ( ) ) ; <nl> AqlValue value = block - > getValue ( 0 , 0 ) ; <nl> ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> - ASSERT_TRUE ( value . toInt64 ( ) = = 1 ) ; <nl> + EXPECT_EQ ( 2 , value . toInt64 ( ) ) ; <nl> + value = block - > getValue ( 1 , 0 ) ; <nl> + ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> + EXPECT_EQ ( 3 , value . toInt64 ( ) ) ; <nl> + value = block - > getValue ( 2 , 0 ) ; <nl> + ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> + EXPECT_EQ ( 4 , value . toInt64 ( ) ) ; <nl> } <nl> <nl> - TEST_F ( LimitExecutorTest , rows_upstream_the_producer_waits_limit_1_offset_0_fullcount_true ) { <nl> + TEST_F ( LimitExecutorTest , rows_upstream_the_producer_doesnt_wait_limit_6_offset_1_fullcount_true ) { <nl> + size_t constexpr offset = 1 ; <nl> + size_t constexpr limit = 6 ; <nl> + bool constexpr fullcount = true ; <nl> + bool constexpr waiting = false ; <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] , [ 4 ] ] " ) ; <nl> - LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , 0 , 1 , true ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , offset , limit , fullcount ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , input - > steal ( ) , waiting ) ; <nl> + LimitExecutor testee ( fetcher , infos ) ; <nl> + LimitStats stats { } ; <nl> + size_t fullCount = 0 ; <nl> + <nl> + OutputAqlItemRow row { std : : move ( block ) , outputRegisters , registersToKeep , <nl> + infos . registersToClear ( ) } ; <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : HASMORE , state ) ; <nl> + ASSERT_TRUE ( row . produced ( ) ) ; <nl> + row . advanceRow ( ) ; <nl> + EXPECT_EQ ( 2 , stats . getFullCount ( ) ) ; <nl> + fullCount + = stats . getFullCount ( ) ; <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : HASMORE , state ) ; <nl> + ASSERT_TRUE ( row . produced ( ) ) ; <nl> + row . advanceRow ( ) ; <nl> + EXPECT_EQ ( 1 , stats . getFullCount ( ) ) ; <nl> + fullCount + = stats . getFullCount ( ) ; <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : DONE , state ) ; <nl> + ASSERT_TRUE ( row . produced ( ) ) ; <nl> + EXPECT_EQ ( 1 , stats . getFullCount ( ) ) ; <nl> + fullCount + = stats . getFullCount ( ) ; <nl> + <nl> + ASSERT_EQ ( 4 , fullCount ) ; <nl> + <nl> + auto block = row . stealBlock ( ) ; <nl> + EXPECT_EQ ( 3 , block - > size ( ) ) ; <nl> + AqlValue value = block - > getValue ( 0 , 0 ) ; <nl> + ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> + EXPECT_EQ ( 2 , value . toInt64 ( ) ) ; <nl> + value = block - > getValue ( 1 , 0 ) ; <nl> + ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> + EXPECT_EQ ( 3 , value . toInt64 ( ) ) ; <nl> + value = block - > getValue ( 2 , 0 ) ; <nl> + ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> + EXPECT_EQ ( 4 , value . toInt64 ( ) ) ; <nl> + } <nl> + TEST_F ( LimitExecutorTest , rows_upstream_the_producer_waits_limit_6_offset_1_fullcount_false ) { <nl> + size_t constexpr offset = 1 ; <nl> + size_t constexpr limit = 6 ; <nl> + bool constexpr fullcount = false ; <nl> + bool constexpr waiting = true ; <nl> + auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] , [ 4 ] ] " ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , offset , limit , fullcount ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , input - > steal ( ) , waiting ) ; <nl> LimitExecutor testee ( fetcher , infos ) ; <nl> LimitStats stats { } ; <nl> <nl> TEST_F ( LimitExecutorTest , rows_upstream_the_producer_waits_limit_1_offset_0_full <nl> infos . registersToClear ( ) } ; <nl> <nl> std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : WAITING ) ; <nl> + ASSERT_EQ ( ExecutionState : : WAITING , state ) ; <nl> + ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : WAITING , state ) ; <nl> ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> <nl> std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : HASMORE ) ; <nl> + ASSERT_EQ ( ExecutionState : : HASMORE , state ) ; <nl> ASSERT_TRUE ( row . produced ( ) ) ; <nl> + row . advanceRow ( ) ; <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : WAITING , state ) ; <nl> + ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : HASMORE , state ) ; <nl> + ASSERT_TRUE ( row . produced ( ) ) ; <nl> row . advanceRow ( ) ; <nl> <nl> std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : WAITING ) ; <nl> + ASSERT_EQ ( ExecutionState : : WAITING , state ) ; <nl> + ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : DONE , state ) ; <nl> + ASSERT_TRUE ( row . produced ( ) ) ; <nl> + <nl> + auto block = row . stealBlock ( ) ; <nl> + EXPECT_EQ ( 3 , block - > size ( ) ) ; <nl> + AqlValue value = block - > getValue ( 0 , 0 ) ; <nl> + ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> + EXPECT_EQ ( 2 , value . toInt64 ( ) ) ; <nl> + value = block - > getValue ( 1 , 0 ) ; <nl> + ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> + EXPECT_EQ ( 3 , value . toInt64 ( ) ) ; <nl> + value = block - > getValue ( 2 , 0 ) ; <nl> + ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> + EXPECT_EQ ( 4 , value . toInt64 ( ) ) ; <nl> + } <nl> + <nl> + TEST_F ( LimitExecutorTest , rows_upstream_the_producer_waits_limit_6_offset_1_fullcount_true ) { <nl> + size_t constexpr offset = 1 ; <nl> + size_t constexpr limit = 6 ; <nl> + bool constexpr fullcount = true ; <nl> + bool constexpr waiting = true ; <nl> + auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] , [ 4 ] ] " ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , offset , limit , fullcount ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , input - > steal ( ) , waiting ) ; <nl> + LimitExecutor testee ( fetcher , infos ) ; <nl> + LimitStats stats { } ; <nl> + size_t fullCount = 0 ; <nl> + <nl> + OutputAqlItemRow row { std : : move ( block ) , outputRegisters , registersToKeep , <nl> + infos . registersToClear ( ) } ; <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : WAITING , state ) ; <nl> ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> + EXPECT_EQ ( 0 , stats . getFullCount ( ) ) ; <nl> + fullCount + = stats . getFullCount ( ) ; <nl> <nl> std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : WAITING ) ; <nl> + ASSERT_EQ ( ExecutionState : : WAITING , state ) ; <nl> ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> + EXPECT_EQ ( 1 , stats . getFullCount ( ) ) ; <nl> + fullCount + = stats . getFullCount ( ) ; <nl> <nl> std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : WAITING ) ; <nl> + ASSERT_EQ ( ExecutionState : : HASMORE , state ) ; <nl> + ASSERT_TRUE ( row . produced ( ) ) ; <nl> + row . advanceRow ( ) ; <nl> + EXPECT_EQ ( 1 , stats . getFullCount ( ) ) ; <nl> + fullCount + = stats . getFullCount ( ) ; <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : WAITING , state ) ; <nl> ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> + EXPECT_EQ ( 0 , stats . getFullCount ( ) ) ; <nl> + fullCount + = stats . getFullCount ( ) ; <nl> <nl> std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> - ASSERT_TRUE ( state = = ExecutionState : : DONE ) ; <nl> - ASSERT_TRUE ( stats . getFullCount ( ) = = 1 ) ; <nl> + ASSERT_EQ ( ExecutionState : : HASMORE , state ) ; <nl> + ASSERT_TRUE ( row . produced ( ) ) ; <nl> + row . advanceRow ( ) ; <nl> + EXPECT_EQ ( 1 , stats . getFullCount ( ) ) ; <nl> + fullCount + = stats . getFullCount ( ) ; <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : WAITING , state ) ; <nl> ASSERT_TRUE ( ! row . produced ( ) ) ; <nl> + EXPECT_EQ ( 0 , stats . getFullCount ( ) ) ; <nl> + fullCount + = stats . getFullCount ( ) ; <nl> + <nl> + std : : tie ( state , stats ) = testee . produceRows ( row ) ; <nl> + ASSERT_EQ ( ExecutionState : : DONE , state ) ; <nl> + ASSERT_TRUE ( row . produced ( ) ) ; <nl> + EXPECT_EQ ( 1 , stats . getFullCount ( ) ) ; <nl> + fullCount + = stats . getFullCount ( ) ; <nl> + <nl> + ASSERT_EQ ( 4 , fullCount ) ; <nl> <nl> auto block = row . stealBlock ( ) ; <nl> + EXPECT_EQ ( 3 , block - > size ( ) ) ; <nl> AqlValue value = block - > getValue ( 0 , 0 ) ; <nl> ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> - ASSERT_TRUE ( value . toInt64 ( ) = = 1 ) ; <nl> + EXPECT_EQ ( 2 , value . toInt64 ( ) ) ; <nl> + value = block - > getValue ( 1 , 0 ) ; <nl> + ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> + EXPECT_EQ ( 3 , value . toInt64 ( ) ) ; <nl> + value = block - > getValue ( 2 , 0 ) ; <nl> + ASSERT_TRUE ( value . isNumber ( ) ) ; <nl> + EXPECT_EQ ( 4 , value . toInt64 ( ) ) ; <nl> + } <nl> + <nl> + class LimitExecutorTestBase { <nl> + protected : <nl> + ResourceMonitor monitor ; <nl> + AqlItemBlockManager itemBlockManager ; <nl> + std : : shared_ptr < const std : : unordered_set < RegisterId > > outputRegisters ; <nl> + std : : shared_ptr < const std : : unordered_set < RegisterId > > registersToKeep ; <nl> + <nl> + LimitExecutorTestBase ( ) <nl> + : monitor ( ) , <nl> + itemBlockManager ( & monitor ) , <nl> + outputRegisters ( std : : make_shared < const std : : unordered_set < RegisterId > > ( <nl> + std : : initializer_list < RegisterId > { } ) ) , <nl> + registersToKeep ( std : : make_shared < const std : : unordered_set < RegisterId > > ( <nl> + std : : initializer_list < RegisterId > { 0 } ) ) { } <nl> + } ; <nl> + <nl> + / / skip and fullCount cannot go together : Only the last limit block may get <nl> + / / fullCount , so there is no block after that could skip . <nl> + / / For these cases , use this class . <nl> + class LimitExecutorWaitingTest : public LimitExecutorTestBase , <nl> + public : : testing : : TestWithParam < bool > { <nl> + protected : <nl> + bool waiting { } ; <nl> + <nl> + LimitExecutorWaitingTest ( ) : LimitExecutorTestBase ( ) { } <nl> + <nl> + virtual void SetUp ( ) { waiting = GetParam ( ) ; } <nl> + } ; <nl> + <nl> + / / Fields : <nl> + / / [ 0 ] bool waiting <nl> + / / [ 1 ] bool fullCount <nl> + using ExtendedLimitTestParameters = std : : tuple < bool , bool > ; <nl> + <nl> + class LimitExecutorWaitingFullCountTest <nl> + : public LimitExecutorTestBase , <nl> + public : : testing : : TestWithParam < ExtendedLimitTestParameters > { <nl> + protected : <nl> + bool waiting { } ; <nl> + bool fullCount { } ; <nl> + <nl> + LimitExecutorWaitingFullCountTest ( ) : LimitExecutorTestBase ( ) { } <nl> + <nl> + virtual void SetUp ( ) { <nl> + ExtendedLimitTestParameters const & params = GetParam ( ) ; <nl> + std : : tie ( waiting , fullCount ) = params ; <nl> + } <nl> + } ; <nl> + <nl> + void removeWaiting ( std : : vector < ExecutorStepResult > & results ) { <nl> + std : : vector < ExecutorStepResult > tmp ; <nl> + for ( auto const result : results ) { <nl> + if ( std : : get < ExecutionState > ( result ) ! = ExecutionState : : WAITING ) { <nl> + tmp . emplace_back ( result ) ; <nl> + } <nl> + } <nl> + results . swap ( tmp ) ; <nl> + } <nl> + <nl> + TEST_P ( LimitExecutorWaitingFullCountTest , rows_9_blocksize_3_limit_10 ) { <nl> + / / Input spec : <nl> + size_t constexpr blocksize = 3 ; <nl> + size_t constexpr offset = 0 ; <nl> + size_t constexpr limit = 10 ; <nl> + SharedAqlItemBlockPtr const input = <nl> + buildBlock < 1 > ( itemBlockManager , { { 0 } , { 1 } , { 2 } , { 3 } , { 4 } , { 5 } , { 6 } , { 7 } , { 8 } } ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , blocksize , waiting , input ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , offset , limit , fullCount ) ; <nl> + <nl> + / / Output spec : <nl> + SharedAqlItemBlockPtr const expectedOutput = <nl> + buildBlock < 1 > ( itemBlockManager , { { 0 } , { 1 } , { 2 } , { 3 } , { 4 } , { 5 } , { 6 } , { 7 } , { 8 } } ) ; <nl> + size_t const expectedOutputSize = <nl> + expectedOutput = = nullptr ? 0 : expectedOutput - > size ( ) ; <nl> + std : : vector < ExecutorStepResult > expectedStates { <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : HASMORE , 3 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : HASMORE , 3 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : DONE , 3 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : DONE , 1 } , <nl> + } ; <nl> + if ( ! waiting ) { <nl> + removeWaiting ( expectedStates ) ; <nl> + } <nl> + ExecutionStats expectedStats { } ; <nl> + if ( fullCount ) { <nl> + expectedStats . fullCount = 9 ; <nl> + } else { <nl> + expectedStats . fullCount = 0 ; <nl> + } <nl> + <nl> + / / Run : <nl> + LimitExecutor testee ( fetcher , infos ) ; <nl> + / / Allocate at least one output row more than expected ! <nl> + SharedAqlItemBlockPtr block = itemBlockManager . requestBlock ( expectedOutputSize + 1 , 1 ) ; <nl> + OutputAqlItemRow outputRow { block , outputRegisters , registersToKeep , <nl> + infos . registersToClear ( ) } ; <nl> + <nl> + auto result = <nl> + runExecutor ( itemBlockManager , testee , outputRow , 0 , expectedOutputSize , false ) ; <nl> + auto & actualOutput = std : : get < SharedAqlItemBlockPtr > ( result ) ; <nl> + auto & actualStats = std : : get < ExecutionStats > ( result ) ; <nl> + auto & actualStates = std : : get < std : : vector < ExecutorStepResult > > ( result ) ; <nl> + <nl> + EXPECT_EQ ( expectedStats , actualStats ) ; <nl> + EXPECT_EQ ( expectedStates , actualStates ) ; <nl> + if ( expectedOutput = = nullptr ) { <nl> + ASSERT_TRUE ( actualOutput = = nullptr ) ; <nl> + } else { <nl> + ASSERT_FALSE ( actualOutput = = nullptr ) ; <nl> + EXPECT_EQ ( * expectedOutput , * actualOutput ) ; <nl> + } <nl> + } <nl> + <nl> + TEST_P ( LimitExecutorWaitingFullCountTest , rows_9_blocksize_3_limit_4 ) { <nl> + / / Input spec : <nl> + size_t constexpr blocksize = 3 ; <nl> + size_t constexpr offset = 0 ; <nl> + size_t constexpr limit = 4 ; <nl> + SharedAqlItemBlockPtr const input = <nl> + buildBlock < 1 > ( itemBlockManager , { { 0 } , { 1 } , { 2 } , { 3 } , { 4 } , { 5 } , { 6 } , { 7 } , { 8 } } ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , blocksize , waiting , input ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , offset , limit , fullCount ) ; <nl> + <nl> + / / Output spec : <nl> + SharedAqlItemBlockPtr const expectedOutput = <nl> + buildBlock < 1 > ( itemBlockManager , { { 0 } , { 1 } , { 2 } , { 3 } } ) ; <nl> + size_t const expectedOutputSize = <nl> + expectedOutput = = nullptr ? 0 : expectedOutput - > size ( ) ; <nl> + std : : vector < ExecutorStepResult > expectedStates { <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : HASMORE , 3 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : HASMORE , 3 } , <nl> + } ; <nl> + if ( fullCount ) { <nl> + expectedStates . emplace_back ( ExecutorCall : : PRODUCE_ROWS , ExecutionState : : WAITING , 0 ) ; <nl> + } <nl> + expectedStates . emplace_back ( ExecutorCall : : PRODUCE_ROWS , ExecutionState : : DONE , 1 ) ; <nl> + if ( ! waiting ) { <nl> + removeWaiting ( expectedStates ) ; <nl> + } <nl> + ExecutionStats expectedStats { } ; <nl> + if ( fullCount ) { <nl> + expectedStats . fullCount = 9 ; <nl> + } else { <nl> + expectedStats . fullCount = 0 ; <nl> + } <nl> + <nl> + / / Run : <nl> + LimitExecutor testee ( fetcher , infos ) ; <nl> + / / Allocate at least one output row more than expected ! <nl> + SharedAqlItemBlockPtr block = itemBlockManager . requestBlock ( expectedOutputSize + 1 , 1 ) ; <nl> + OutputAqlItemRow outputRow { block , outputRegisters , registersToKeep , <nl> + infos . registersToClear ( ) } ; <nl> + <nl> + auto result = <nl> + runExecutor ( itemBlockManager , testee , outputRow , 0 , expectedOutputSize , false ) ; <nl> + auto & actualOutput = std : : get < SharedAqlItemBlockPtr > ( result ) ; <nl> + auto & actualStats = std : : get < ExecutionStats > ( result ) ; <nl> + auto & actualStates = std : : get < std : : vector < ExecutorStepResult > > ( result ) ; <nl> + <nl> + EXPECT_EQ ( expectedStats , actualStats ) ; <nl> + EXPECT_EQ ( expectedStates , actualStates ) ; <nl> + if ( expectedOutput = = nullptr ) { <nl> + ASSERT_TRUE ( actualOutput = = nullptr ) ; <nl> + } else { <nl> + ASSERT_FALSE ( actualOutput = = nullptr ) ; <nl> + EXPECT_EQ ( * expectedOutput , * actualOutput ) ; <nl> + } <nl> } <nl> <nl> + TEST_P ( LimitExecutorWaitingFullCountTest , rows_9_blocksize_3_limit_0 ) { <nl> + / / Input spec : <nl> + size_t constexpr blocksize = 3 ; <nl> + size_t constexpr offset = 0 ; <nl> + size_t constexpr limit = 0 ; <nl> + SharedAqlItemBlockPtr const input = <nl> + buildBlock < 1 > ( itemBlockManager , { { 0 } , { 1 } , { 2 } , { 3 } , { 4 } , { 5 } , { 6 } , { 7 } , { 8 } } ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , blocksize , waiting , input ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , offset , limit , fullCount ) ; <nl> + <nl> + / / Output spec : <nl> + SharedAqlItemBlockPtr const expectedOutput = <nl> + buildBlock < 1 > ( itemBlockManager , { } ) ; <nl> + size_t const expectedOutputSize = <nl> + expectedOutput = = nullptr ? 0 : expectedOutput - > size ( ) ; <nl> + std : : vector < ExecutorStepResult > expectedStates { } ; <nl> + if ( fullCount ) { <nl> + expectedStates . emplace_back ( ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : WAITING , 0 ) ; <nl> + expectedStates . emplace_back ( ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : WAITING , 0 ) ; <nl> + expectedStates . emplace_back ( ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : WAITING , 0 ) ; <nl> + } <nl> + expectedStates . emplace_back ( ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : DONE , 0 ) ; <nl> + if ( ! waiting ) { <nl> + removeWaiting ( expectedStates ) ; <nl> + } <nl> + ExecutionStats expectedStats { } ; <nl> + if ( fullCount ) { <nl> + expectedStats . fullCount = 9 ; <nl> + } else { <nl> + expectedStats . fullCount = 0 ; <nl> + } <nl> + <nl> + / / Run : <nl> + LimitExecutor testee ( fetcher , infos ) ; <nl> + / / Allocate at least one output row more than expected ! <nl> + SharedAqlItemBlockPtr block = itemBlockManager . requestBlock ( expectedOutputSize + 1 , 1 ) ; <nl> + OutputAqlItemRow outputRow { block , outputRegisters , registersToKeep , <nl> + infos . registersToClear ( ) } ; <nl> + <nl> + auto result = <nl> + runExecutor ( itemBlockManager , testee , outputRow , 0 , expectedOutputSize , false ) ; <nl> + auto & actualOutput = std : : get < SharedAqlItemBlockPtr > ( result ) ; <nl> + auto & actualStats = std : : get < ExecutionStats > ( result ) ; <nl> + auto & actualStates = std : : get < std : : vector < ExecutorStepResult > > ( result ) ; <nl> + <nl> + EXPECT_EQ ( expectedStats , actualStats ) ; <nl> + EXPECT_EQ ( expectedStates , actualStates ) ; <nl> + if ( expectedOutput = = nullptr ) { <nl> + ASSERT_TRUE ( actualOutput = = nullptr ) ; <nl> + } else { <nl> + ASSERT_FALSE ( actualOutput = = nullptr ) ; <nl> + EXPECT_EQ ( * expectedOutput , * actualOutput ) ; <nl> + } <nl> + } <nl> + <nl> + TEST_P ( LimitExecutorWaitingFullCountTest , rows_9_blocksize_3_offset_4_limit_4 ) { <nl> + / / Input spec : <nl> + size_t constexpr blocksize = 3 ; <nl> + size_t constexpr offset = 4 ; <nl> + size_t constexpr limit = 4 ; <nl> + SharedAqlItemBlockPtr const input = <nl> + buildBlock < 1 > ( itemBlockManager , { { 0 } , { 1 } , { 2 } , { 3 } , { 4 } , { 5 } , { 6 } , { 7 } , { 8 } } ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , blocksize , waiting , input ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , offset , limit , fullCount ) ; <nl> + <nl> + / / Output spec : <nl> + SharedAqlItemBlockPtr const expectedOutput = <nl> + buildBlock < 1 > ( itemBlockManager , { { 4 } , { 5 } , { 6 } , { 7 } } ) ; <nl> + size_t const expectedOutputSize = <nl> + expectedOutput = = nullptr ? 0 : expectedOutput - > size ( ) ; <nl> + std : : vector < ExecutorStepResult > expectedStates { <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : HASMORE , 2 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : HASMORE , 3 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : DONE , 1 } , <nl> + } ; <nl> + if ( ! waiting ) { <nl> + removeWaiting ( expectedStates ) ; <nl> + } <nl> + ExecutionStats expectedStats { } ; <nl> + if ( fullCount ) { <nl> + expectedStats . fullCount = 9 ; <nl> + } else { <nl> + expectedStats . fullCount = 0 ; <nl> + } <nl> + <nl> + / / Run : <nl> + LimitExecutor testee ( fetcher , infos ) ; <nl> + / / Allocate at least one output row more than expected ! <nl> + SharedAqlItemBlockPtr block = itemBlockManager . requestBlock ( expectedOutputSize + 1 , 1 ) ; <nl> + OutputAqlItemRow outputRow { block , outputRegisters , registersToKeep , <nl> + infos . registersToClear ( ) } ; <nl> + <nl> + auto result = <nl> + runExecutor ( itemBlockManager , testee , outputRow , 0 , expectedOutputSize , false ) ; <nl> + auto & actualOutput = std : : get < SharedAqlItemBlockPtr > ( result ) ; <nl> + auto & actualStats = std : : get < ExecutionStats > ( result ) ; <nl> + auto & actualStates = std : : get < std : : vector < ExecutorStepResult > > ( result ) ; <nl> + <nl> + EXPECT_EQ ( expectedStats , actualStats ) ; <nl> + EXPECT_EQ ( expectedStates , actualStates ) ; <nl> + if ( expectedOutput = = nullptr ) { <nl> + ASSERT_TRUE ( actualOutput = = nullptr ) ; <nl> + } else { <nl> + ASSERT_FALSE ( actualOutput = = nullptr ) ; <nl> + EXPECT_EQ ( * expectedOutput , * actualOutput ) ; <nl> + } <nl> + } <nl> + <nl> + TEST_P ( LimitExecutorWaitingFullCountTest , rows_9_blocksize_3_offset_10_limit_1 ) { <nl> + / / Input spec : <nl> + size_t constexpr blocksize = 3 ; <nl> + size_t constexpr offset = 10 ; <nl> + size_t constexpr limit = 1 ; <nl> + SharedAqlItemBlockPtr const input = <nl> + buildBlock < 1 > ( itemBlockManager , { { 0 } , { 1 } , { 2 } , { 3 } , { 4 } , { 5 } , { 6 } , { 7 } , { 8 } } ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , blocksize , waiting , input ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , offset , limit , fullCount ) ; <nl> + <nl> + / / Output spec : <nl> + SharedAqlItemBlockPtr const expectedOutput = <nl> + buildBlock < 1 > ( itemBlockManager , { } ) ; <nl> + size_t const expectedOutputSize = <nl> + expectedOutput = = nullptr ? 0 : expectedOutput - > size ( ) ; <nl> + std : : vector < ExecutorStepResult > expectedStates { <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : DONE , 0 } , <nl> + } ; <nl> + if ( ! waiting ) { <nl> + removeWaiting ( expectedStates ) ; <nl> + } <nl> + ExecutionStats expectedStats { } ; <nl> + if ( fullCount ) { <nl> + expectedStats . fullCount = 9 ; <nl> + } else { <nl> + expectedStats . fullCount = 0 ; <nl> + } <nl> + <nl> + / / Run : <nl> + LimitExecutor testee ( fetcher , infos ) ; <nl> + / / Allocate at least one output row more than expected ! <nl> + SharedAqlItemBlockPtr block = itemBlockManager . requestBlock ( expectedOutputSize + 1 , 1 ) ; <nl> + OutputAqlItemRow outputRow { block , outputRegisters , registersToKeep , <nl> + infos . registersToClear ( ) } ; <nl> + <nl> + auto result = <nl> + runExecutor ( itemBlockManager , testee , outputRow , 0 , expectedOutputSize , false ) ; <nl> + auto & actualOutput = std : : get < SharedAqlItemBlockPtr > ( result ) ; <nl> + auto & actualStats = std : : get < ExecutionStats > ( result ) ; <nl> + auto & actualStates = std : : get < std : : vector < ExecutorStepResult > > ( result ) ; <nl> + <nl> + EXPECT_EQ ( expectedStats , actualStats ) ; <nl> + EXPECT_EQ ( expectedStates , actualStates ) ; <nl> + if ( expectedOutput = = nullptr ) { <nl> + ASSERT_TRUE ( actualOutput = = nullptr ) ; <nl> + } else { <nl> + ASSERT_FALSE ( actualOutput = = nullptr ) ; <nl> + EXPECT_EQ ( * expectedOutput , * actualOutput ) ; <nl> + } <nl> + } <nl> + <nl> + INSTANTIATE_TEST_CASE_P ( LimitExecutorVariations , LimitExecutorWaitingFullCountTest , <nl> + testing : : Combine ( testing : : Bool ( ) , testing : : Bool ( ) ) ) ; <nl> + <nl> + TEST_P ( LimitExecutorWaitingTest , rows_9_blocksize_3_skip_4_offset_1_limit_7 ) { <nl> + / / Input spec : <nl> + size_t constexpr blocksize = 3 ; <nl> + size_t constexpr offset = 1 ; <nl> + size_t constexpr limit = 7 ; <nl> + size_t constexpr skip = 4 ; <nl> + size_t constexpr readRows = 2 ; <nl> + bool constexpr skipAfter = true ; <nl> + SharedAqlItemBlockPtr const input = <nl> + buildBlock < 1 > ( itemBlockManager , { { 0 } , { 1 } , { 2 } , { 3 } , { 4 } , { 5 } , { 6 } , { 7 } , { 8 } } ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , blocksize , waiting , input ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , offset , limit , false ) ; <nl> + <nl> + / / Output spec : <nl> + SharedAqlItemBlockPtr const expectedOutput = <nl> + buildBlock < 1 > ( itemBlockManager , { { 5 } , { 6 } } ) ; <nl> + size_t const expectedOutputSize = <nl> + expectedOutput = = nullptr ? 0 : expectedOutput - > size ( ) ; <nl> + std : : vector < ExecutorStepResult > expectedStates { <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : HASMORE , 4 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : HASMORE , 3 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : DONE , 1 } , <nl> + } ; <nl> + if ( ! waiting ) { <nl> + removeWaiting ( expectedStates ) ; <nl> + } <nl> + ExecutionStats expectedStats { } ; <nl> + expectedStats . fullCount = 0 ; <nl> + <nl> + / / Run : <nl> + LimitExecutor testee ( fetcher , infos ) ; <nl> + / / Allocate at least one output row more than expected ! <nl> + SharedAqlItemBlockPtr block = itemBlockManager . requestBlock ( expectedOutputSize + 1 , 1 ) ; <nl> + OutputAqlItemRow outputRow { block , outputRegisters , registersToKeep , <nl> + infos . registersToClear ( ) } ; <nl> + <nl> + auto result = runExecutor ( itemBlockManager , testee , outputRow , skip , readRows , skipAfter ) ; <nl> + auto & actualOutput = std : : get < SharedAqlItemBlockPtr > ( result ) ; <nl> + auto & actualStats = std : : get < ExecutionStats > ( result ) ; <nl> + auto & actualStates = std : : get < std : : vector < ExecutorStepResult > > ( result ) ; <nl> + <nl> + EXPECT_EQ ( expectedStats , actualStats ) ; <nl> + EXPECT_EQ ( expectedStates , actualStates ) ; <nl> + if ( expectedOutput = = nullptr ) { <nl> + ASSERT_TRUE ( actualOutput = = nullptr ) ; <nl> + } else { <nl> + ASSERT_FALSE ( actualOutput = = nullptr ) ; <nl> + EXPECT_EQ ( * expectedOutput , * actualOutput ) ; <nl> + } <nl> + } <nl> + <nl> + TEST_P ( LimitExecutorWaitingTest , rows_9_blocksize_3_skip_4_offset_1_limit_3 ) { <nl> + / / Input spec : <nl> + size_t constexpr blocksize = 3 ; <nl> + size_t constexpr offset = 1 ; <nl> + size_t constexpr limit = 3 ; <nl> + size_t constexpr skip = 4 ; <nl> + size_t constexpr readRows = 1 ; <nl> + bool constexpr skipAfter = true ; <nl> + SharedAqlItemBlockPtr const input = <nl> + buildBlock < 1 > ( itemBlockManager , { { 0 } , { 1 } , { 2 } , { 3 } , { 4 } , { 5 } , { 6 } , { 7 } , { 8 } } ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , blocksize , waiting , input ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , offset , limit , false ) ; <nl> + <nl> + / / Output spec : <nl> + SharedAqlItemBlockPtr const expectedOutput = <nl> + buildBlock < 1 > ( itemBlockManager , { } ) ; <nl> + size_t const expectedOutputSize = <nl> + expectedOutput = = nullptr ? 0 : expectedOutput - > size ( ) ; <nl> + std : : vector < ExecutorStepResult > expectedStates { <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : DONE , 3 } , <nl> + } ; <nl> + if ( ! waiting ) { <nl> + removeWaiting ( expectedStates ) ; <nl> + } <nl> + ExecutionStats expectedStats { } ; <nl> + expectedStats . fullCount = 0 ; <nl> + <nl> + / / Run : <nl> + LimitExecutor testee ( fetcher , infos ) ; <nl> + / / Allocate at least one output row more than expected ! <nl> + SharedAqlItemBlockPtr block = itemBlockManager . requestBlock ( expectedOutputSize + 1 , 1 ) ; <nl> + OutputAqlItemRow outputRow { block , outputRegisters , registersToKeep , <nl> + infos . registersToClear ( ) } ; <nl> + <nl> + auto result = runExecutor ( itemBlockManager , testee , outputRow , skip , readRows , skipAfter ) ; <nl> + auto & actualOutput = std : : get < SharedAqlItemBlockPtr > ( result ) ; <nl> + auto & actualStats = std : : get < ExecutionStats > ( result ) ; <nl> + auto & actualStates = std : : get < std : : vector < ExecutorStepResult > > ( result ) ; <nl> + <nl> + EXPECT_EQ ( expectedStats , actualStats ) ; <nl> + EXPECT_EQ ( expectedStates , actualStates ) ; <nl> + if ( expectedOutput = = nullptr ) { <nl> + ASSERT_TRUE ( actualOutput = = nullptr ) ; <nl> + } else { <nl> + ASSERT_FALSE ( actualOutput = = nullptr ) ; <nl> + EXPECT_EQ ( * expectedOutput , * actualOutput ) ; <nl> + } <nl> + } <nl> + <nl> + TEST_P ( LimitExecutorWaitingTest , rows_9_blocksize_3_skip_2_read_1_offset_2_limit_4 ) { <nl> + / / Input spec : <nl> + size_t constexpr blocksize = 3 ; <nl> + size_t constexpr offset = 2 ; <nl> + size_t constexpr limit = 4 ; <nl> + size_t constexpr skip = 2 ; <nl> + size_t constexpr readRows = 1 ; <nl> + bool constexpr skipAfter = true ; <nl> + SharedAqlItemBlockPtr const input = <nl> + buildBlock < 1 > ( itemBlockManager , { { 0 } , { 1 } , { 2 } , { 3 } , { 4 } , { 5 } , { 6 } , { 7 } , { 8 } } ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , blocksize , waiting , input ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , offset , limit , false ) ; <nl> + <nl> + / / Output spec : <nl> + SharedAqlItemBlockPtr const expectedOutput = <nl> + buildBlock < 1 > ( itemBlockManager , { { 4 } } ) ; <nl> + size_t const expectedOutputSize = <nl> + expectedOutput = = nullptr ? 0 : expectedOutput - > size ( ) ; <nl> + std : : vector < ExecutorStepResult > expectedStates { <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : HASMORE , 2 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : HASMORE , 2 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : DONE , 1 } , <nl> + } ; <nl> + if ( ! waiting ) { <nl> + removeWaiting ( expectedStates ) ; <nl> + } <nl> + ExecutionStats expectedStats { } ; <nl> + expectedStats . fullCount = 0 ; <nl> + <nl> + / / Run : <nl> + LimitExecutor testee ( fetcher , infos ) ; <nl> + / / Allocate at least one output row more than expected ! <nl> + SharedAqlItemBlockPtr block = itemBlockManager . requestBlock ( expectedOutputSize + 1 , 1 ) ; <nl> + OutputAqlItemRow outputRow { block , outputRegisters , registersToKeep , <nl> + infos . registersToClear ( ) } ; <nl> + <nl> + auto result = runExecutor ( itemBlockManager , testee , outputRow , skip , readRows , skipAfter ) ; <nl> + auto & actualOutput = std : : get < SharedAqlItemBlockPtr > ( result ) ; <nl> + auto & actualStats = std : : get < ExecutionStats > ( result ) ; <nl> + auto & actualStates = std : : get < std : : vector < ExecutorStepResult > > ( result ) ; <nl> + <nl> + EXPECT_EQ ( expectedStats , actualStats ) ; <nl> + EXPECT_EQ ( expectedStates , actualStates ) ; <nl> + if ( expectedOutput = = nullptr ) { <nl> + ASSERT_TRUE ( actualOutput = = nullptr ) ; <nl> + } else { <nl> + ASSERT_FALSE ( actualOutput = = nullptr ) ; <nl> + EXPECT_EQ ( * expectedOutput , * actualOutput ) ; <nl> + } <nl> + } <nl> + <nl> + TEST_P ( LimitExecutorWaitingTest , rows_9_blocksize_3_skip_10_limit_12 ) { <nl> + / / Input spec : <nl> + size_t constexpr blocksize = 3 ; <nl> + size_t constexpr offset = 0 ; <nl> + size_t constexpr limit = 12 ; <nl> + size_t constexpr skip = 10 ; <nl> + size_t constexpr readRows = 1 ; <nl> + bool constexpr skipAfter = true ; <nl> + SharedAqlItemBlockPtr const input = <nl> + buildBlock < 1 > ( itemBlockManager , { { 0 } , { 1 } , { 2 } , { 3 } , { 4 } , { 5 } , { 6 } , { 7 } , { 8 } } ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , blocksize , waiting , input ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , offset , limit , false ) ; <nl> + <nl> + / / Output spec : <nl> + SharedAqlItemBlockPtr const expectedOutput = <nl> + buildBlock < 1 > ( itemBlockManager , { } ) ; <nl> + size_t const expectedOutputSize = <nl> + expectedOutput = = nullptr ? 0 : expectedOutput - > size ( ) ; <nl> + std : : vector < ExecutorStepResult > expectedStates { <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : DONE , 9 } , <nl> + } ; <nl> + if ( ! waiting ) { <nl> + removeWaiting ( expectedStates ) ; <nl> + } <nl> + ExecutionStats expectedStats { } ; <nl> + expectedStats . fullCount = 0 ; <nl> + <nl> + / / Run : <nl> + LimitExecutor testee ( fetcher , infos ) ; <nl> + / / Allocate at least one output row more than expected ! <nl> + SharedAqlItemBlockPtr block = itemBlockManager . requestBlock ( expectedOutputSize + 1 , 1 ) ; <nl> + OutputAqlItemRow outputRow { block , outputRegisters , registersToKeep , <nl> + infos . registersToClear ( ) } ; <nl> + <nl> + auto result = runExecutor ( itemBlockManager , testee , outputRow , skip , readRows , skipAfter ) ; <nl> + auto & actualOutput = std : : get < SharedAqlItemBlockPtr > ( result ) ; <nl> + auto & actualStats = std : : get < ExecutionStats > ( result ) ; <nl> + auto & actualStates = std : : get < std : : vector < ExecutorStepResult > > ( result ) ; <nl> + <nl> + EXPECT_EQ ( expectedStats , actualStats ) ; <nl> + EXPECT_EQ ( expectedStates , actualStates ) ; <nl> + if ( expectedOutput = = nullptr ) { <nl> + ASSERT_TRUE ( actualOutput = = nullptr ) ; <nl> + } else { <nl> + ASSERT_FALSE ( actualOutput = = nullptr ) ; <nl> + EXPECT_EQ ( * expectedOutput , * actualOutput ) ; <nl> + } <nl> + } <nl> + <nl> + TEST_P ( LimitExecutorWaitingTest , rows_9_blocksize_3_skip_1_read_1_limit_12 ) { <nl> + / / Input spec : <nl> + size_t constexpr blocksize = 3 ; <nl> + size_t constexpr offset = 0 ; <nl> + size_t constexpr limit = 12 ; <nl> + size_t constexpr skip = 1 ; <nl> + size_t constexpr readRows = 1 ; <nl> + bool constexpr skipAfter = true ; <nl> + SharedAqlItemBlockPtr const input = <nl> + buildBlock < 1 > ( itemBlockManager , { { 0 } , { 1 } , { 2 } , { 3 } , { 4 } , { 5 } , { 6 } , { 7 } , { 8 } } ) ; <nl> + SingleRowFetcherHelper < true > fetcher ( itemBlockManager , blocksize , waiting , input ) ; <nl> + LimitExecutorInfos infos ( 1 , 1 , { } , { 0 } , offset , limit , false ) ; <nl> + <nl> + / / Output spec : <nl> + SharedAqlItemBlockPtr const expectedOutput = <nl> + buildBlock < 1 > ( itemBlockManager , { { 1 } } ) ; <nl> + size_t const expectedOutputSize = <nl> + expectedOutput = = nullptr ? 0 : expectedOutput - > size ( ) ; <nl> + std : : vector < ExecutorStepResult > expectedStates { <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : FETCH_FOR_PASSTHROUGH , ExecutionState : : HASMORE , 2 } , <nl> + { ExecutorCall : : PRODUCE_ROWS , ExecutionState : : HASMORE , 1 } , <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : WAITING , 0 } , <nl> + { ExecutorCall : : SKIP_ROWS , ExecutionState : : DONE , 7 } , <nl> + } ; <nl> + if ( ! waiting ) { <nl> + removeWaiting ( expectedStates ) ; <nl> + } <nl> + ExecutionStats expectedStats { } ; <nl> + expectedStats . fullCount = 0 ; <nl> + <nl> + / / Run : <nl> + LimitExecutor testee ( fetcher , infos ) ; <nl> + / / Allocate at least one output row more than expected ! <nl> + SharedAqlItemBlockPtr block = itemBlockManager . requestBlock ( expectedOutputSize + 1 , 1 ) ; <nl> + OutputAqlItemRow outputRow { block , outputRegisters , registersToKeep , <nl> + infos . registersToClear ( ) } ; <nl> + <nl> + auto result = runExecutor ( itemBlockManager , testee , outputRow , skip , readRows , skipAfter ) ; <nl> + auto & actualOutput = std : : get < SharedAqlItemBlockPtr > ( result ) ; <nl> + auto & actualStats = std : : get < ExecutionStats > ( result ) ; <nl> + auto & actualStates = std : : get < std : : vector < ExecutorStepResult > > ( result ) ; <nl> + <nl> + EXPECT_EQ ( expectedStats , actualStats ) ; <nl> + EXPECT_EQ ( expectedStates , actualStates ) ; <nl> + if ( expectedOutput = = nullptr ) { <nl> + ASSERT_TRUE ( actualOutput = = nullptr ) ; <nl> + } else { <nl> + ASSERT_FALSE ( actualOutput = = nullptr ) ; <nl> + EXPECT_EQ ( * expectedOutput , * actualOutput ) ; <nl> + } <nl> + } <nl> + <nl> + INSTANTIATE_TEST_CASE_P ( LimitExecutorVariations , LimitExecutorWaitingTest , testing : : Bool ( ) ) ; <nl> + <nl> } / / namespace aql <nl> } / / namespace tests <nl> } / / namespace arangodb <nl> mmm a / tests / Aql / NoResultsExecutorTest . cpp <nl> ppp b / tests / Aql / NoResultsExecutorTest . cpp <nl> class NoResultsExecutorTest : public : : testing : : Test { <nl> <nl> TEST_F ( NoResultsExecutorTest , no_rows_upstream_the_producer_doesnt_wait ) { <nl> VPackBuilder input ; <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , false ) ; <nl> NoResultsExecutor testee ( fetcher , infos ) ; <nl> NoStats stats { } ; <nl> <nl> TEST_F ( NoResultsExecutorTest , no_rows_upstream_the_producer_doesnt_wait ) { <nl> <nl> TEST_F ( NoResultsExecutorTest , no_rows_upstream_the_producer_waits ) { <nl> VPackBuilder input ; <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , true ) ; <nl> NoResultsExecutor testee ( fetcher , infos ) ; <nl> NoStats stats { } ; <nl> <nl> TEST_F ( NoResultsExecutorTest , no_rows_upstream_the_producer_waits ) { <nl> <nl> TEST_F ( NoResultsExecutorTest , rows_upstream_the_producer_doesnt_wait ) { <nl> auto input = VPackParser : : fromJson ( " [ [ true ] , [ false ] , [ true ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> NoResultsExecutor testee ( fetcher , infos ) ; <nl> NoStats stats { } ; <nl> <nl> TEST_F ( NoResultsExecutorTest , rows_upstream_the_producer_doesnt_wait ) { <nl> <nl> TEST_F ( NoResultsExecutorTest , rows_upstream_the_producer_waits ) { <nl> auto input = VPackParser : : fromJson ( " [ [ true ] , [ false ] , [ true ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> NoResultsExecutor testee ( fetcher , infos ) ; <nl> NoStats stats { } ; <nl> <nl> mmm a / tests / Aql / ReturnExecutorTest . cpp <nl> ppp b / tests / Aql / ReturnExecutorTest . cpp <nl> TEST_F ( ReturnExecutorTest , NoRowsUpstreamProducerDoesNotWait ) { <nl> ReturnExecutorInfos infos ( inputRegister , 1 / * nr in * / , 1 / * nr out * / , true / * do count * / ) ; <nl> auto & outputRegisters = infos . getOutputRegisters ( ) ; <nl> VPackBuilder input ; <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , false ) ; <nl> ReturnExecutor testee ( fetcher , infos ) ; <nl> CountStats stats { } ; <nl> <nl> TEST_F ( ReturnExecutorTest , NoRowsUpstreamProducerWaits ) { <nl> ReturnExecutorInfos infos ( inputRegister , 1 / * nr in * / , 1 / * nr out * / , true / * do count * / ) ; <nl> auto & outputRegisters = infos . getOutputRegisters ( ) ; <nl> VPackBuilder input ; <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , true ) ; <nl> ReturnExecutor testee ( fetcher , infos ) ; <nl> CountStats stats { } ; <nl> <nl> TEST_F ( ReturnExecutorTest , RowsUpstreamProducerDoesNotWait ) { <nl> ReturnExecutorInfos infos ( inputRegister , 1 / * nr in * / , 1 / * nr out * / , true / * do count * / ) ; <nl> auto & outputRegisters = infos . getOutputRegisters ( ) ; <nl> auto input = VPackParser : : fromJson ( " [ [ true ] , [ false ] , [ true ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > buffer ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > buffer ( ) , false ) ; <nl> ReturnExecutor testee ( fetcher , infos ) ; <nl> CountStats stats { } ; <nl> <nl> TEST_F ( ReturnExecutorTest , RowsUpstreamProducerWaits ) { <nl> ReturnExecutorInfos infos ( inputRegister , 1 / * nr in * / , 1 / * nr out * / , true / * do count * / ) ; <nl> auto & outputRegisters = infos . getOutputRegisters ( ) ; <nl> auto input = VPackParser : : fromJson ( " [ [ true ] , [ false ] , [ true ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> ReturnExecutor testee ( fetcher , infos ) ; <nl> CountStats stats { } ; <nl> <nl> mmm a / tests / Aql / RowFetcherHelper . cpp <nl> ppp b / tests / Aql / RowFetcherHelper . cpp <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> # include " RowFetcherHelper . h " <nl> + # include " VelocyPackHelper . h " <nl> <nl> # include " Aql / AllRowsFetcher . h " <nl> # include " Aql / AqlItemBlock . h " <nl> using namespace arangodb : : tests : : aql ; <nl> using namespace arangodb : : aql ; <nl> <nl> namespace { <nl> - void VPackToAqlItemBlock ( VPackSlice data , uint64_t nrRegs , AqlItemBlock & block ) { <nl> - / / coordinates in the matrix rowNr , entryNr <nl> - size_t rowIndex = 0 ; <nl> - RegisterId entry = 0 ; <nl> - for ( auto const & row : VPackArrayIterator ( data ) ) { <nl> - / / Walk through the rows <nl> - TRI_ASSERT ( row . isArray ( ) ) ; <nl> - TRI_ASSERT ( row . length ( ) = = nrRegs ) ; <nl> - for ( auto const & oneEntry : VPackArrayIterator ( row ) ) { <nl> - / / Walk through on row values <nl> - block . setValue ( rowIndex , entry , AqlValue { oneEntry } ) ; <nl> - entry + + ; <nl> - } <nl> - rowIndex + + ; <nl> - entry = 0 ; <nl> - } <nl> - } <nl> } / / namespace <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> void VPackToAqlItemBlock ( VPackSlice data , uint64_t nrRegs , AqlItemBlock & block ) <nl> <nl> template < bool passBlocksThrough > <nl> SingleRowFetcherHelper < passBlocksThrough > : : SingleRowFetcherHelper ( <nl> - std : : shared_ptr < VPackBuffer < uint8_t > > vPackBuffer , bool returnsWaiting ) <nl> + AqlItemBlockManager & manager , <nl> + std : : shared_ptr < VPackBuffer < uint8_t > > const & vPackBuffer , bool returnsWaiting ) <nl> + : SingleRowFetcherHelper ( manager , 1 , returnsWaiting , <nl> + vPackBufferToAqlItemBlock ( manager , vPackBuffer ) ) { } <nl> + <nl> + template < bool passBlocksThrough > <nl> + SingleRowFetcherHelper < passBlocksThrough > : : SingleRowFetcherHelper ( : : arangodb : : aql : : AqlItemBlockManager & manager , <nl> + size_t const blockSize , bool const returnsWaiting , <nl> + : : arangodb : : aql : : SharedAqlItemBlockPtr input ) <nl> : SingleRowFetcher < passBlocksThrough > ( ) , <nl> - _vPackBuffer ( std : : move ( vPackBuffer ) ) , <nl> _returnsWaiting ( returnsWaiting ) , <nl> - _nrItems ( 0 ) , <nl> - _nrCalled ( 0 ) , <nl> - _didWait ( false ) , <nl> - _resourceMonitor ( ) , <nl> - _itemBlockManager ( & _resourceMonitor ) , <nl> - _itemBlock ( nullptr ) , <nl> + _nrItems ( input = = nullptr ? 0 : input - > size ( ) ) , <nl> + _blockSize ( blockSize ) , <nl> + _itemBlockManager ( manager ) , <nl> + _itemBlock ( std : : move ( input ) ) , <nl> _lastReturnedRow { CreateInvalidInputRowHint { } } { <nl> - if ( _vPackBuffer ! = nullptr ) { <nl> - _data = VPackSlice ( _vPackBuffer - > data ( ) ) ; <nl> - } else { <nl> - _data = VPackSlice : : nullSlice ( ) ; <nl> - } <nl> - if ( _data . isArray ( ) ) { <nl> - _nrItems = _data . length ( ) ; <nl> - if ( _nrItems > 0 ) { <nl> - VPackSlice oneRow = _data . at ( 0 ) ; <nl> - TRI_ASSERT ( oneRow . isArray ( ) ) ; <nl> - arangodb : : aql : : RegisterCount nrRegs = static_cast < arangodb : : aql : : RegisterCount > ( oneRow . length ( ) ) ; <nl> - / / Add all registers as valid input registers : <nl> - auto inputRegisters = std : : make_shared < std : : unordered_set < RegisterId > > ( ) ; <nl> - for ( RegisterId i = 0 ; i < nrRegs ; i + + ) { <nl> - inputRegisters - > emplace ( i ) ; <nl> - } <nl> - _itemBlock = <nl> - SharedAqlItemBlockPtr { new AqlItemBlock ( _itemBlockManager , _nrItems , nrRegs ) } ; <nl> - / / std : : make_unique < AqlItemBlock > ( & _resourceMonitor , _nrItems , nrRegs ) ; <nl> - VPackToAqlItemBlock ( _data , nrRegs , * _itemBlock ) ; <nl> - } <nl> - } <nl> - } ; <nl> + TRI_ASSERT ( _blockSize > 0 ) ; <nl> + } <nl> <nl> template < bool passBlocksThrough > <nl> SingleRowFetcherHelper < passBlocksThrough > : : ~ SingleRowFetcherHelper ( ) = default ; <nl> template < bool passBlocksThrough > <nl> std : : pair < ExecutionState , InputAqlItemRow > SingleRowFetcherHelper < passBlocksThrough > : : fetchRow ( size_t ) { <nl> / / If this assertion fails , the Executor has fetched more rows after DONE . <nl> TRI_ASSERT ( _nrCalled < = _nrItems ) ; <nl> - if ( _returnsWaiting ) { <nl> - if ( ! _didWait ) { <nl> - _didWait = true ; <nl> - / / if once DONE is returned , always return DONE <nl> - if ( _returnedDone ) { <nl> - return { ExecutionState : : DONE , InputAqlItemRow { CreateInvalidInputRowHint { } } } ; <nl> - } <nl> - return { ExecutionState : : WAITING , InputAqlItemRow { CreateInvalidInputRowHint { } } } ; <nl> + if ( wait ( ) ) { <nl> + / / if once DONE is returned , always return DONE <nl> + if ( _returnedDone ) { <nl> + return { ExecutionState : : DONE , InputAqlItemRow { CreateInvalidInputRowHint { } } } ; <nl> } <nl> - _didWait = false ; <nl> + return { ExecutionState : : WAITING , InputAqlItemRow { CreateInvalidInputRowHint { } } } ; <nl> } <nl> _nrCalled + + ; <nl> if ( _nrCalled > _nrItems ) { <nl> _returnedDone = true ; <nl> return { ExecutionState : : DONE , InputAqlItemRow { CreateInvalidInputRowHint { } } } ; <nl> } <nl> - TRI_ASSERT ( _itemBlock ! = nullptr ) ; <nl> - _lastReturnedRow = InputAqlItemRow { _itemBlock , _nrCalled - 1 } ; <nl> + _lastReturnedRow = InputAqlItemRow { getItemBlock ( ) , _curRowIndex } ; <nl> + nextRow ( ) ; <nl> ExecutionState state ; <nl> if ( _nrCalled < _nrItems ) { <nl> state = ExecutionState : : HASMORE ; <nl> std : : pair < ExecutionState , InputAqlItemRow > SingleRowFetcherHelper < passBlocksThro <nl> <nl> template < bool passBlocksThrough > <nl> std : : pair < ExecutionState , size_t > SingleRowFetcherHelper < passBlocksThrough > : : skipRows ( size_t const atMost ) { <nl> - size_t skipped = 0 ; <nl> ExecutionState state = ExecutionState : : HASMORE ; <nl> <nl> - while ( atMost > skipped ) { <nl> - std : : tie ( state , std : : ignore ) = fetchRow ( ) ; <nl> + while ( atMost > _skipped ) { <nl> + InputAqlItemRow row { CreateInvalidInputRowHint { } } ; <nl> + std : : tie ( state , row ) = fetchRow ( ) ; <nl> if ( state = = ExecutionState : : WAITING ) { <nl> - return { state , skipped } ; <nl> + return { state , 0 } ; <nl> + } <nl> + if ( row . isInitialized ( ) ) { <nl> + + + _skipped ; <nl> } <nl> - + + skipped ; <nl> if ( state = = ExecutionState : : DONE ) { <nl> + size_t skipped = _skipped ; <nl> + _skipped = 0 ; <nl> return { state , skipped } ; <nl> } <nl> } <nl> <nl> + size_t skipped = _skipped ; <nl> + _skipped = 0 ; <nl> return { state , skipped } ; <nl> - } ; <nl> + } <nl> + <nl> + template < bool passBlocksThrough > <nl> + std : : pair < arangodb : : aql : : ExecutionState , arangodb : : aql : : SharedAqlItemBlockPtr > <nl> + SingleRowFetcherHelper < passBlocksThrough > : : fetchBlockForPassthrough ( size_t const atMost ) { <nl> + if ( wait ( ) ) { <nl> + return { ExecutionState : : WAITING , nullptr } ; <nl> + } <nl> + <nl> + size_t const remainingRows = _blockSize - _curIndexInBlock ; <nl> + size_t const from = _curRowIndex ; <nl> + size_t const to = _curRowIndex + remainingRows ; <nl> + <nl> + bool const isLastBlock = _curRowIndex + _blockSize > = _nrItems ; <nl> + bool const askingForMore = _curRowIndex + atMost > _nrItems ; <nl> + <nl> + bool const done = isLastBlock & & askingForMore ; <nl> + <nl> + ExecutionState const state = done ? ExecutionState : : DONE : ExecutionState : : HASMORE ; <nl> + <nl> + return { state , _itemBlock - > slice ( from , to ) } ; <nl> + } <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> / / - SECTION ALLROWSFETCHER - <nl> mmm a / tests / Aql / RowFetcherHelper . h <nl> ppp b / tests / Aql / RowFetcherHelper . h <nl> <nl> # include " Aql / ConstFetcher . h " <nl> # include " Aql / ExecutionBlock . h " <nl> # include " Aql / ExecutionState . h " <nl> + # include " Aql / InputAqlItemRow . h " <nl> # include " Aql / ResourceUsage . h " <nl> # include " Aql / SingleRowFetcher . h " <nl> + # include " Aql / VelocyPackHelper . h " <nl> <nl> # include < Basics / Common . h > <nl> # include < velocypack / Buffer . h > <nl> namespace aql { <nl> * / <nl> template < bool passBlocksThrough > <nl> class SingleRowFetcherHelper <nl> - : public : : arangodb : : aql : : SingleRowFetcher < passBlocksThrough > { <nl> + : public arangodb : : aql : : SingleRowFetcher < passBlocksThrough > { <nl> public : <nl> - SingleRowFetcherHelper ( std : : shared_ptr < arangodb : : velocypack : : Buffer < uint8_t > > vPackBuffer , <nl> + SingleRowFetcherHelper ( arangodb : : aql : : AqlItemBlockManager & manager , <nl> + size_t blockSize , bool returnsWaiting , <nl> + arangodb : : aql : : SharedAqlItemBlockPtr input ) ; <nl> + <nl> + / / backwards compatible constructor <nl> + SingleRowFetcherHelper ( arangodb : : aql : : AqlItemBlockManager & manager , <nl> + std : : shared_ptr < arangodb : : velocypack : : Buffer < uint8_t > > const & vPackBuffer , <nl> bool returnsWaiting ) ; <nl> + <nl> virtual ~ SingleRowFetcherHelper ( ) ; <nl> <nl> / / NOLINTNEXTLINE google - default - arguments <nl> - std : : pair < : : arangodb : : aql : : ExecutionState , : : arangodb : : aql : : InputAqlItemRow > fetchRow ( <nl> - size_t atMost = : : arangodb : : aql : : ExecutionBlock : : DefaultBatchSize ( ) ) override ; <nl> + std : : pair < arangodb : : aql : : ExecutionState , arangodb : : aql : : InputAqlItemRow > fetchRow ( <nl> + size_t atMost = arangodb : : aql : : ExecutionBlock : : DefaultBatchSize ( ) ) override ; <nl> <nl> uint64_t nrCalled ( ) { return _nrCalled ; } <nl> <nl> std : : pair < arangodb : : aql : : ExecutionState , size_t > skipRows ( size_t atMost ) override ; <nl> <nl> - : : arangodb : : aql : : SharedAqlItemBlockPtr getItemBlock ( ) { return _itemBlock ; } <nl> + std : : pair < arangodb : : aql : : ExecutionState , arangodb : : aql : : SharedAqlItemBlockPtr > fetchBlockForPassthrough ( <nl> + size_t atMost ) override ; <nl> <nl> bool isDone ( ) const { return _returnedDone ; } <nl> <nl> + arangodb : : aql : : AqlItemBlockManager & itemBlockManager ( ) { return _itemBlockManager ; } <nl> + <nl> + private : <nl> + arangodb : : aql : : SharedAqlItemBlockPtr & getItemBlock ( ) { return _itemBlock ; } <nl> + arangodb : : aql : : SharedAqlItemBlockPtr const & getItemBlock ( ) const { return _itemBlock ; } <nl> + <nl> + void nextRow ( ) { <nl> + _curRowIndex + + ; <nl> + _curIndexInBlock = ( _curIndexInBlock + 1 ) % _blockSize ; <nl> + } <nl> + <nl> + bool wait ( ) { <nl> + / / Wait on the first row of every block , if applicable <nl> + if ( _returnsWaiting & & _curIndexInBlock = = 0 ) { <nl> + / / If the insert succeeds , we have not yet waited at this index . <nl> + bool const waitNow = _didWaitAt . insert ( _curRowIndex ) . second ; <nl> + <nl> + return waitNow ; <nl> + } <nl> + <nl> + return false ; <nl> + } <nl> + <nl> private : <nl> - std : : shared_ptr < arangodb : : velocypack : : Buffer < uint8_t > > _vPackBuffer ; <nl> - arangodb : : velocypack : : Slice _data ; <nl> bool _returnedDone = false ; <nl> - bool _returnsWaiting ; <nl> + bool const _returnsWaiting ; <nl> uint64_t _nrItems ; <nl> - uint64_t _nrCalled ; <nl> - bool _didWait ; <nl> - arangodb : : aql : : ResourceMonitor _resourceMonitor ; <nl> - arangodb : : aql : : AqlItemBlockManager _itemBlockManager ; <nl> + uint64_t _nrCalled { } ; <nl> + size_t _skipped { } ; <nl> + size_t _curIndexInBlock { } ; <nl> + size_t _curRowIndex { } ; <nl> + size_t _blockSize ; <nl> + std : : unordered_set < size_t > _didWaitAt ; <nl> + arangodb : : aql : : AqlItemBlockManager & _itemBlockManager ; <nl> arangodb : : aql : : SharedAqlItemBlockPtr _itemBlock ; <nl> - arangodb : : aql : : InputAqlItemRow _lastReturnedRow ; <nl> + arangodb : : aql : : InputAqlItemRow _lastReturnedRow { arangodb : : aql : : CreateInvalidInputRowHint { } } ; <nl> } ; <nl> <nl> / * * <nl> * @ brief Mock for AllRowsFetcher <nl> * / <nl> - class AllRowsFetcherHelper : public : : arangodb : : aql : : AllRowsFetcher { <nl> + class AllRowsFetcherHelper : public arangodb : : aql : : AllRowsFetcher { <nl> public : <nl> AllRowsFetcherHelper ( std : : shared_ptr < arangodb : : velocypack : : Buffer < uint8_t > > vPackBuffer , <nl> bool returnsWaiting ) ; <nl> ~ AllRowsFetcherHelper ( ) ; <nl> <nl> - std : : pair < : : arangodb : : aql : : ExecutionState , : : arangodb : : aql : : AqlItemMatrix const * > fetchAllRows ( ) override ; <nl> + std : : pair < arangodb : : aql : : ExecutionState , arangodb : : aql : : AqlItemMatrix const * > fetchAllRows ( ) override ; <nl> <nl> private : <nl> std : : shared_ptr < arangodb : : velocypack : : Buffer < uint8_t > > _vPackBuffer ; <nl> class ConstFetcherHelper : public arangodb : : aql : : ConstFetcher { <nl> std : : shared_ptr < arangodb : : velocypack : : Buffer < uint8_t > > vPackBuffer ) ; <nl> virtual ~ ConstFetcherHelper ( ) ; <nl> <nl> - std : : pair < : : arangodb : : aql : : ExecutionState , : : arangodb : : aql : : InputAqlItemRow > fetchRow ( ) override ; <nl> + std : : pair < arangodb : : aql : : ExecutionState , arangodb : : aql : : InputAqlItemRow > fetchRow ( ) override ; <nl> <nl> private : <nl> std : : shared_ptr < arangodb : : velocypack : : Buffer < uint8_t > > _vPackBuffer ; <nl> mmm a / tests / Aql / ShortestPathExecutorTest . cpp <nl> ppp b / tests / Aql / ShortestPathExecutorTest . cpp <nl> class ShortestPathExecutorTest : public : : testing : : Test { <nl> ExecutionState state = ExecutionState : : HASMORE ; <nl> auto & finder = dynamic_cast < FakePathFinder & > ( infos . finder ( ) ) ; <nl> <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> infos . registersToKeep ( ) , infos . registersToClear ( ) ) ; <nl> ShortestPathExecutor testee ( fetcher , infos ) ; <nl> class ShortestPathExecutorTest : public : : testing : : Test { <nl> ExecutionState state = ExecutionState : : HASMORE ; <nl> auto & finder = dynamic_cast < FakePathFinder & > ( infos . finder ( ) ) ; <nl> <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> infos . registersToKeep ( ) , infos . registersToClear ( ) ) ; <nl> ShortestPathExecutor testee ( fetcher , infos ) ; <nl> mmm a / tests / Aql / SortedCollectExecutorTest . cpp <nl> ppp b / tests / Aql / SortedCollectExecutorTest . cpp <nl> class SortedCollectExecutorTestNoRowsUpstream : public : : testing : : Test { <nl> } ; <nl> <nl> TEST_F ( SortedCollectExecutorTestNoRowsUpstream , producer_doesnt_wait ) { <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , false ) ; <nl> SortedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( SortedCollectExecutorTestNoRowsUpstream , producer_doesnt_wait ) { <nl> } <nl> <nl> TEST_F ( SortedCollectExecutorTestNoRowsUpstream , producer_waits ) { <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , true ) ; <nl> SortedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> class SortedCollectExecutorTestRowsUpstream : public : : testing : : Test { <nl> <nl> TEST_F ( SortedCollectExecutorTestRowsUpstream , producer_doesnt_wait ) { <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> SortedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( SortedCollectExecutorTestRowsUpstream , producer_doesnt_wait ) { <nl> <nl> TEST_F ( SortedCollectExecutorTestRowsUpstream , producer_doesnt_wait_2 ) { <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> SortedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( SortedCollectExecutorTestRowsUpstream , producer_doesnt_wait_2 ) { <nl> TEST_F ( SortedCollectExecutorTestRowsUpstream , producer_doesnt_wait_3 ) { <nl> / / Input order needs to be guaranteed <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 1 ] , [ 2 ] , [ 2 ] , [ 3 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> SortedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( SortedCollectExecutorTestRowsUpstream , producer_doesnt_wait_3 ) { <nl> <nl> TEST_F ( SortedCollectExecutorTestRowsUpstream , producer_doesnt_wait_4 ) { <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 1 ] , [ 2 ] , [ 2 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> SortedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( SortedCollectExecutorTestRowsUpstream , producer_doesnt_wait_4 ) { <nl> <nl> TEST_F ( SortedCollectExecutorTestRowsUpstream , producer_waits ) { <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> SortedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST ( SortedCollectExecutorTestRowsUpstreamCount , test ) { <nl> NoStats stats { } ; <nl> <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> SortedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST ( SortedCollectExecutorTestRowsUpstreamCountNumbers , test ) { <nl> NoStats stats { } ; <nl> <nl> auto input = VPackParser : : fromJson ( " [ [ 1 ] , [ 2 ] , [ 3 ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> SortedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST ( SortedCollectExecutorTestRowsUpstreamCountStrings , test ) { <nl> NoStats stats { } ; <nl> <nl> auto input = VPackParser : : fromJson ( " [ [ \ " a \ " ] , [ \ " aa \ " ] , [ \ " aaa \ " ] ] " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> SortedCollectExecutor testee ( fetcher , infos ) ; <nl> <nl> OutputAqlItemRow result ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> mmm a / tests / Aql / TestEmptyExecutorHelper . h <nl> ppp b / tests / Aql / TestEmptyExecutorHelper . h <nl> class TestEmptyExecutorHelper { <nl> * @ return ExecutionState , and if successful exactly one new Row of AqlItems . <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRows ( OutputAqlItemRow & output ) ; <nl> - <nl> - inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> - TRI_ASSERT ( false ) ; <nl> - THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> - TRI_ERROR_INTERNAL , <nl> - " Logic_error , prefetching number of rows not supported " ) ; <nl> - } <nl> } ; <nl> <nl> } / / namespace aql <nl> mmm a / tests / Aql / TestExecutorHelper . h <nl> ppp b / tests / Aql / TestExecutorHelper . h <nl> class TestExecutorHelperInfos : public ExecutorInfos { <nl> RegisterId _inputRegister ; <nl> } ; <nl> <nl> - / * * <nl> - * @ brief Implementation of Filter Node <nl> - * / <nl> class TestExecutorHelper { <nl> public : <nl> struct Properties { <nl> class TestExecutorHelper { <nl> * / <nl> std : : pair < ExecutionState , Stats > produceRows ( OutputAqlItemRow & output ) ; <nl> <nl> - inline std : : pair < ExecutionState , size_t > expectedNumberOfRows ( size_t ) const { <nl> - TRI_ASSERT ( false ) ; <nl> - THROW_ARANGO_EXCEPTION_MESSAGE ( <nl> - TRI_ERROR_INTERNAL , <nl> - " Logic_error , prefetching number fo rows not supported " ) ; <nl> - } <nl> - <nl> public : <nl> Infos & _infos ; <nl> <nl> mmm a / tests / Aql / TraversalExecutorTest . cpp <nl> ppp b / tests / Aql / TraversalExecutorTest . cpp <nl> class TraversalExecutorTestInputStartVertex : public : : testing : : Test { <nl> <nl> TEST_F ( TraversalExecutorTestInputStartVertex , there_are_no_rows_upstream_producer_doesnt_wait ) { <nl> VPackBuilder input ; <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , false ) ; <nl> TraversalExecutor testee ( fetcher , infos ) ; <nl> TraversalStats stats { } ; <nl> <nl> TEST_F ( TraversalExecutorTestInputStartVertex , there_are_no_rows_upstream_produce <nl> <nl> TEST_F ( TraversalExecutorTestInputStartVertex , there_are_no_rows_upstream_producer_waits ) { <nl> VPackBuilder input ; <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , true ) ; <nl> TraversalExecutor testee ( fetcher , infos ) ; <nl> TraversalStats stats { } ; <nl> <nl> TEST_F ( TraversalExecutorTestInputStartVertex , there_are_rows_upstream_producer_d <nl> myGraph . addVertex ( " 2 " ) ; <nl> myGraph . addVertex ( " 3 " ) ; <nl> auto input = VPackParser : : fromJson ( R " ( [ [ " v / 1 " ] , [ " v / 2 " ] , [ " v / 3 " ] ] ) " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> TraversalExecutor testee ( fetcher , infos ) ; <nl> TraversalStats stats { } ; <nl> <nl> TEST_F ( TraversalExecutorTestInputStartVertex , <nl> myGraph . addVertex ( " 2 " ) ; <nl> myGraph . addVertex ( " 3 " ) ; <nl> auto input = VPackParser : : fromJson ( R " ( [ [ " v / 1 " ] , [ " v / 2 " ] , [ " v / 3 " ] ] ) " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> TraversalExecutor testee ( fetcher , infos ) ; <nl> TraversalStats stats { } ; <nl> <nl> TEST_F ( TraversalExecutorTestInputStartVertex , <nl> myGraph . addVertex ( " 2 " ) ; <nl> myGraph . addVertex ( " 3 " ) ; <nl> auto input = VPackParser : : fromJson ( R " ( [ [ " v / 1 " ] , [ " v / 2 " ] , [ " v / 3 " ] ] ) " ) ; <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> TraversalExecutor testee ( fetcher , infos ) ; <nl> TraversalStats stats { } ; <nl> <nl> class TraversalExecutorTestConstantStartVertex : public : : testing : : Test { <nl> <nl> TEST_F ( TraversalExecutorTestConstantStartVertex , no_rows_upstream_producer_doesnt_wait ) { <nl> VPackBuilder input ; <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , false ) ; <nl> TraversalExecutor testee ( fetcher , infos ) ; <nl> TraversalStats stats { } ; <nl> <nl> TEST_F ( TraversalExecutorTestConstantStartVertex , no_rows_upstream_producer_doesn <nl> <nl> TEST_F ( TraversalExecutorTestConstantStartVertex , no_rows_upstream_producer_waits ) { <nl> VPackBuilder input ; <nl> - SingleRowFetcherHelper < false > fetcher ( input . steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input . steal ( ) , true ) ; <nl> TraversalExecutor testee ( fetcher , infos ) ; <nl> TraversalStats stats { } ; <nl> <nl> TEST_F ( TraversalExecutorTestConstantStartVertex , rows_upstream_producer_doesnt_w <nl> myGraph . addVertex ( " 3 " ) ; <nl> auto input = VPackParser : : fromJson ( R " ( [ [ " v / 1 " ] , [ " v / 2 " ] , [ " v / 3 " ] ] ) " ) ; <nl> <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , false ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , false ) ; <nl> TraversalExecutor testee ( fetcher , infos ) ; <nl> TraversalStats stats { } ; <nl> <nl> TEST_F ( TraversalExecutorTestConstantStartVertex , rows_upstream_producer_waits_no <nl> myGraph . addVertex ( " 3 " ) ; <nl> auto input = VPackParser : : fromJson ( R " ( [ [ " v / 1 " ] , [ " v / 2 " ] , [ " v / 3 " ] ] ) " ) ; <nl> <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> TraversalExecutor testee ( fetcher , infos ) ; <nl> TraversalStats stats { } ; <nl> OutputAqlItemRow row ( std : : move ( block ) , infos . getOutputRegisters ( ) , <nl> TEST_F ( TraversalExecutorTestConstantStartVertex , rows_upstream_producer_waits_ed <nl> myGraph . addVertex ( " 3 " ) ; <nl> auto input = VPackParser : : fromJson ( R " ( [ [ " v / 1 " ] , [ " v / 2 " ] , [ " v / 3 " ] ] ) " ) ; <nl> <nl> - SingleRowFetcherHelper < false > fetcher ( input - > steal ( ) , true ) ; <nl> + SingleRowFetcherHelper < false > fetcher ( itemBlockManager , input - > steal ( ) , true ) ; <nl> TraversalExecutor testee ( fetcher , infos ) ; <nl> TraversalStats stats { } ; <nl> myGraph . addEdge ( " 1 " , " 2 " , " 1 - > 2 " ) ; <nl> mmm a / tests / Aql / VelocyPackHelper . cpp <nl> ppp b / tests / Aql / VelocyPackHelper . cpp <nl> <nl> <nl> # include " VelocyPackHelper . h " <nl> <nl> + # include < velocypack / velocypack - aliases . h > <nl> + <nl> using namespace arangodb ; <nl> - using namespace arangodb : : tests : : aql ; <nl> + using namespace arangodb : : aql ; <nl> + using namespace arangodb : : tests ; <nl> <nl> - VPackBufferPtr arangodb : : tests : : aql : : vpackFromJsonString ( char const * c ) { <nl> - velocypack : : Options options ; <nl> + VPackBufferPtr arangodb : : tests : : vpackFromJsonString ( char const * c ) { <nl> + VPackOptions options ; <nl> options . checkAttributeUniqueness = true ; <nl> - velocypack : : Parser parser ( & options ) ; <nl> + VPackParser parser ( & options ) ; <nl> parser . parse ( c ) ; <nl> <nl> - std : : shared_ptr < velocypack : : Builder > builder = parser . steal ( ) ; <nl> + std : : shared_ptr < VPackBuilder > builder = parser . steal ( ) ; <nl> <nl> return builder - > steal ( ) ; <nl> } <nl> <nl> - VPackBufferPtr arangodb : : tests : : aql : : operator " " _vpack ( const char * json , size_t ) { <nl> + VPackBufferPtr arangodb : : tests : : operator " " _vpack ( const char * json , size_t ) { <nl> return vpackFromJsonString ( json ) ; <nl> } <nl> + <nl> + void arangodb : : tests : : VPackToAqlItemBlock ( VPackSlice data , RegisterCount nrRegs , <nl> + AqlItemBlock & block ) { <nl> + / / coordinates in the matrix rowNr , entryNr <nl> + size_t rowIndex = 0 ; <nl> + RegisterId entry = 0 ; <nl> + for ( auto const & row : VPackArrayIterator ( data ) ) { <nl> + / / Walk through the rows <nl> + TRI_ASSERT ( row . isArray ( ) ) ; <nl> + TRI_ASSERT ( row . length ( ) = = nrRegs ) ; <nl> + for ( auto const & oneEntry : VPackArrayIterator ( row ) ) { <nl> + / / Walk through on row values <nl> + block . setValue ( rowIndex , entry , AqlValue { oneEntry } ) ; <nl> + entry + + ; <nl> + } <nl> + rowIndex + + ; <nl> + entry = 0 ; <nl> + } <nl> + } <nl> + <nl> + arangodb : : aql : : SharedAqlItemBlockPtr arangodb : : tests : : vPackBufferToAqlItemBlock ( <nl> + arangodb : : aql : : AqlItemBlockManager & manager , VPackBufferPtr const & buffer ) { <nl> + if ( VPackSlice ( buffer - > data ( ) ) . isNone ( ) ) { <nl> + return nullptr ; <nl> + } <nl> + return multiVPackBufferToAqlItemBlocks ( manager , buffer ) [ 0 ] ; <nl> + } <nl> + <nl> + std : : vector < SharedAqlItemBlockPtr > arangodb : : tests : : vPackToAqlItemBlocks ( <nl> + AqlItemBlockManager & manager , VPackBufferPtr const & buffer ) { <nl> + VPackSlice outer ( buffer - > data ( ) ) ; <nl> + if ( outer . isNone ( ) ) { <nl> + return { } ; <nl> + } <nl> + TRI_ASSERT ( outer . isArray ( ) ) ; <nl> + if ( outer . length ( ) = = 0 ) { <nl> + return { } ; <nl> + } <nl> + size_t const nrRegs = [ & ] ( ) { <nl> + VPackSlice firstRow ( outer [ 0 ] ) ; <nl> + TRI_ASSERT ( firstRow . isArray ( ) ) ; <nl> + return firstRow . length ( ) ; <nl> + } ( ) ; <nl> + <nl> + auto wrap = [ ] ( VPackSlice slice ) - > VPackBufferPtr { <nl> + VPackBuilder builder ; <nl> + builder . openArray ( ) ; <nl> + builder . add ( slice ) ; <nl> + builder . close ( ) ; <nl> + return builder . steal ( ) ; <nl> + } ; <nl> + <nl> + std : : vector < SharedAqlItemBlockPtr > blocks ; <nl> + <nl> + for ( VPackSlice inner : VPackArrayIterator ( outer ) ) { <nl> + SharedAqlItemBlockPtr block = manager . requestBlock ( 1 , nrRegs ) ; <nl> + VPackToAqlItemBlock ( VPackSlice ( wrap ( inner ) - > data ( ) ) , nrRegs , * block ) ; <nl> + blocks . emplace_back ( block ) ; <nl> + } <nl> + <nl> + return blocks ; <nl> + } <nl> mmm a / tests / Aql / VelocyPackHelper . h <nl> ppp b / tests / Aql / VelocyPackHelper . h <nl> <nl> # ifndef ARANGOD_AQL_TESTS_VELOCYPACK_HELPER_H <nl> # define ARANGOD_AQL_TESTS_VELOCYPACK_HELPER_H <nl> <nl> + # include " Aql / AqlItemBlock . h " <nl> + # include " Aql / AqlItemBlockManager . h " <nl> + # include " Aql / AqlValue . h " <nl> + # include " Aql / SharedAqlItemBlockPtr . h " <nl> + <nl> # include < velocypack / Buffer . h > <nl> # include < velocypack / Builder . h > <nl> + # include < velocypack / Iterator . h > <nl> # include < velocypack / Options . h > <nl> # include < velocypack / Parser . h > <nl> # include < memory > <nl> <nl> namespace arangodb { <nl> namespace tests { <nl> - namespace aql { <nl> <nl> using VPackBufferPtr = std : : shared_ptr < velocypack : : Buffer < uint8_t > > ; <nl> <nl> VPackBufferPtr vpackFromJsonString ( char const * c ) ; <nl> <nl> VPackBufferPtr operator " " _vpack ( const char * json , size_t ) ; <nl> <nl> - } / / namespace aql <nl> + void VPackToAqlItemBlock ( velocypack : : Slice data , arangodb : : aql : : RegisterCount nrRegs , <nl> + arangodb : : aql : : AqlItemBlock & block ) ; <nl> + <nl> + / / Convert a single VPackBuffer into an AqlItemBlock <nl> + arangodb : : aql : : SharedAqlItemBlockPtr vPackBufferToAqlItemBlock ( <nl> + arangodb : : aql : : AqlItemBlockManager & manager , VPackBufferPtr const & buffer ) ; <nl> + <nl> + / * * <nl> + * @ brief Convert a list of VPackBufferPtr to a vector of AqlItemBlocks . <nl> + * Does no error handling but for maintainer mode assertions : It ' s meant for <nl> + * tests with static input . <nl> + * / <nl> + template < typename . . . Ts > <nl> + std : : vector < arangodb : : aql : : SharedAqlItemBlockPtr > multiVPackBufferToAqlItemBlocks ( <nl> + arangodb : : aql : : AqlItemBlockManager & manager , Ts . . . vPackBuffers ) { <nl> + std : : vector < VPackBufferPtr > buffers ( { std : : forward < Ts > ( vPackBuffers ) . . . } ) ; <nl> + arangodb : : aql : : RegisterCount const nrRegs = [ & ] ( ) - > arangodb : : aql : : RegisterCount { <nl> + if ( buffers . empty ( ) ) { <nl> + return 0 ; <nl> + } <nl> + for ( size_t i = 0 ; i < buffers . size ( ) ; i + + ) { <nl> + velocypack : : Slice block ( buffers [ 0 ] - > data ( ) ) ; <nl> + TRI_ASSERT ( block . isArray ( ) ) ; <nl> + if ( block . length ( ) > 0 ) { <nl> + velocypack : : Slice firstRow ( block [ 0 ] ) ; <nl> + TRI_ASSERT ( firstRow . isArray ( ) ) ; <nl> + return static_cast < arangodb : : aql : : RegisterCount > ( firstRow . length ( ) ) ; <nl> + } <nl> + } <nl> + / / no rows in any block <nl> + return 0 ; <nl> + } ( ) ; <nl> + <nl> + std : : vector < arangodb : : aql : : SharedAqlItemBlockPtr > blocks { } ; <nl> + <nl> + for ( auto const & buffer : buffers ) { <nl> + velocypack : : Slice slice ( buffer - > data ( ) ) ; <nl> + TRI_ASSERT ( slice . isArray ( ) ) ; <nl> + size_t const nrItems = slice . length ( ) ; <nl> + arangodb : : aql : : SharedAqlItemBlockPtr block = nullptr ; <nl> + if ( nrItems > 0 ) { <nl> + block = manager . requestBlock ( nrItems , nrRegs ) ; <nl> + VPackToAqlItemBlock ( slice , nrRegs , * block ) ; <nl> + } <nl> + blocks . emplace_back ( block ) ; <nl> + } <nl> + <nl> + return blocks ; <nl> + } <nl> + <nl> + / / Expects buffer to be an array of arrays . For every inner array , an <nl> + / / AqlItemBlock with a single row matching the inner array is returned . <nl> + std : : vector < arangodb : : aql : : SharedAqlItemBlockPtr > vPackToAqlItemBlocks ( <nl> + arangodb : : aql : : AqlItemBlockManager & manager , VPackBufferPtr const & buffer ) ; <nl> + <nl> } / / namespace tests <nl> } / / namespace arangodb <nl> <nl> mmm a / tests / CMakeLists . txt <nl> ppp b / tests / CMakeLists . txt <nl> set ( ARANGODB_TESTS_SOURCES <nl> Agency / RemoveFollowerTest . cpp <nl> Agency / StoreTest . cpp <nl> Agency / SupervisionTest . cpp <nl> - Aql / AllRowsFetcherTest . cpp <nl> - Aql / AqlItemBlockHelper . cpp <nl> + Aql / AqlHelper . cpp <nl> Aql / AqlItemRowTest . cpp <nl> + Aql / AllRowsFetcherTest . cpp <nl> Aql / CalculationExecutorTest . cpp <nl> Aql / CountCollectExecutorTest . cpp <nl> Aql / DateFunctionsTest . cpp <nl> set ( ARANGODB_TESTS_SOURCES <nl> Aql / EnumerateListExecutorTest . cpp <nl> Aql / ExecutionBlockImplTest . cpp <nl> Aql / ExecutionBlockImplTestInstances . cpp <nl> + Aql / ExecutorTestHelper . cpp <nl> Aql / FilterExecutorTest . cpp <nl> Aql / HashedCollectExecutorTest . cpp <nl> Aql / IdExecutorTest . cpp <nl> mmm a / tests / js / server / aql / aql - queries - optimizer - sort - limit . js <nl> ppp b / tests / js / server / aql / aql - queries - optimizer - sort - limit . js <nl> function ahuacatlQueryOptimizerLimitTestSuite ( ) { <nl> var query = " FOR c IN " + cn + " SORT c . value LIMIT " + test . offset + " , " + test . limit + " LIMIT " + test . offset2 + " , " + test . limit2 + " RETURN c " ; <nl> <nl> var actual = getQueryResults ( query ) ; <nl> - assertEqual ( test . expectedLength , actual . length ) ; <nl> + assertEqual ( test . expectedLength , actual . length , ` Test # $ { i } , query was : $ { query } ` ) ; <nl> <nl> var sorts = getSorts ( query ) ; <nl> assertEqual ( sorts . length , 1 ) ; <nl>
Feature / limit executor passthrough ( )
arangodb/arangodb
c854d048644c3f77008dd42831fe102327f38bc7
2019-06-18T15:33:58Z
mmm a / src / lookup . cc <nl> ppp b / src / lookup . cc <nl> void LookupIterator : : WriteDataValue ( Handle < Object > value ) { <nl> } <nl> <nl> <nl> - bool LookupIterator : : IsSpecialNumericIndex ( ) const { <nl> - if ( GetStoreTarget ( ) - > IsJSTypedArray ( ) & & name ( ) - > IsString ( ) ) { <nl> - Handle < String > name_string = Handle < String > : : cast ( name ( ) ) ; <nl> - if ( name_string - > length ( ) > 0 ) { <nl> - double d = <nl> - StringToDouble ( isolate ( ) - > unicode_cache ( ) , * name_string , NO_FLAGS ) ; <nl> - if ( ! std : : isnan ( d ) ) { <nl> - Factory * factory = isolate ( ) - > factory ( ) ; <nl> - Handle < Object > num = factory - > NewNumber ( d ) ; <nl> - Handle < String > roundtrip_string = factory - > NumberToString ( num ) ; <nl> - if ( String : : Equals ( name_string , roundtrip_string ) ) return true ; <nl> - } <nl> - } <nl> - } <nl> - return false ; <nl> - } <nl> - <nl> - <nl> void LookupIterator : : InternalizeName ( ) { <nl> if ( name_ - > IsUniqueName ( ) ) return ; <nl> name_ = factory ( ) - > InternalizeString ( Handle < String > : : cast ( name_ ) ) ; <nl> mmm a / src / lookup . h <nl> ppp b / src / lookup . h <nl> class LookupIterator FINAL BASE_EMBEDDED { <nl> Handle < Object > GetDataValue ( ) const ; <nl> void WriteDataValue ( Handle < Object > value ) ; <nl> <nl> - / / Checks whether the receiver is an indexed exotic object <nl> - / / and name is a special numeric index . <nl> - bool IsSpecialNumericIndex ( ) const ; <nl> - <nl> void InternalizeName ( ) ; <nl> <nl> private : <nl> mmm a / src / objects . cc <nl> ppp b / src / objects . cc <nl> MaybeHandle < Object > Object : : AddDataProperty ( LookupIterator * it , <nl> / / instead . If the prototype is Null , the proxy is detached . <nl> if ( receiver - > IsJSGlobalProxy ( ) ) return value ; <nl> <nl> - / / If the receiver is Indexed Exotic object ( currently only typed arrays ) , <nl> - / / disallow adding properties with numeric names . <nl> - if ( it - > IsSpecialNumericIndex ( ) ) return value ; <nl> - <nl> / / Possibly migrate to the most up - to - date map that will be able to store <nl> / / | value | under it - > name ( ) with | attributes | . <nl> it - > PrepareTransitionToDataProperty ( value , attributes , store_mode ) ; <nl> mmm a / test / mjsunit / harmony / typedarrays . js <nl> ppp b / test / mjsunit / harmony / typedarrays . js <nl> function TestTypedArraySet ( ) { <nl> <nl> TestTypedArraySet ( ) ; <nl> <nl> - function TestTypedArraysWithIllegalIndices ( ) { <nl> - var a = new Int32Array ( 100 ) ; <nl> - <nl> - a [ - 10 ] = 10 ; <nl> - assertEquals ( undefined , a [ - 10 ] ) ; <nl> - a [ " - 10 " ] = 10 ; <nl> - assertEquals ( undefined , a [ " - 10 " ] ) ; <nl> - <nl> - var s = " - 10 " ; <nl> - a [ s ] = 10 ; <nl> - assertEquals ( 10 , a [ s ] ) ; <nl> - var s1 = " - 10 " ; <nl> - a [ s ] = 10 ; <nl> - assertEquals ( 10 , a [ s ] ) ; <nl> - <nl> - a [ " - 1e2 " ] = 10 ; <nl> - assertEquals ( 10 , a [ " - 1e2 " ] ) ; <nl> - assertEquals ( undefined , a [ - 1e2 ] ) ; <nl> - <nl> - a [ - Infinity ] = 50 ; <nl> - assertEquals ( undefined , a [ - Infinity ] ) ; <nl> - a [ 1 . 5 ] = 10 ; <nl> - assertEquals ( undefined , a [ 1 . 5 ] ) ; <nl> - var nan = Math . sqrt ( - 1 ) ; <nl> - a [ nan ] = 5 ; <nl> - assertEquals ( 5 , a [ nan ] ) ; <nl> - <nl> - var x = 0 ; <nl> - var y = - 0 ; <nl> - assertEquals ( Infinity , 1 / x ) ; <nl> - assertEquals ( - Infinity , 1 / y ) ; <nl> - a [ x ] = 5 ; <nl> - a [ y ] = 27 ; <nl> - assertEquals ( 27 , a [ x ] ) ; <nl> - assertEquals ( 27 , a [ y ] ) ; <nl> - } <nl> - <nl> - TestTypedArraysWithIllegalIndices ( ) ; <nl> - <nl> - function TestTypedArraysWithIllegalIndicesStrict ( ) { <nl> - ' use strict ' ; <nl> - var a = new Int32Array ( 100 ) ; <nl> - <nl> - a [ - 10 ] = 10 ; <nl> - assertEquals ( undefined , a [ - 10 ] ) ; <nl> - a [ " - 10 " ] = 10 ; <nl> - assertEquals ( undefined , a [ " - 10 " ] ) ; <nl> - <nl> - var s = " - 10 " ; <nl> - a [ s ] = 10 ; <nl> - assertEquals ( 10 , a [ s ] ) ; <nl> - var s1 = " - 10 " ; <nl> - a [ s ] = 10 ; <nl> - assertEquals ( 10 , a [ s ] ) ; <nl> - <nl> - a [ " - 1e2 " ] = 10 ; <nl> - assertEquals ( 10 , a [ " - 1e2 " ] ) ; <nl> - assertEquals ( undefined , a [ - 1e2 ] ) ; <nl> - <nl> - a [ - Infinity ] = 50 ; <nl> - assertEquals ( undefined , a [ - Infinity ] ) ; <nl> - a [ 1 . 5 ] = 10 ; <nl> - assertEquals ( undefined , a [ 1 . 5 ] ) ; <nl> - var nan = Math . sqrt ( - 1 ) ; <nl> - a [ nan ] = 5 ; <nl> - assertEquals ( 5 , a [ nan ] ) ; <nl> - <nl> - var x = 0 ; <nl> - var y = - 0 ; <nl> - assertEquals ( Infinity , 1 / x ) ; <nl> - assertEquals ( - Infinity , 1 / y ) ; <nl> - a [ x ] = 5 ; <nl> - a [ y ] = 27 ; <nl> - assertEquals ( 27 , a [ x ] ) ; <nl> - assertEquals ( 27 , a [ y ] ) ; <nl> - } <nl> - <nl> - TestTypedArraysWithIllegalIndicesStrict ( ) ; <nl> - <nl> / / DataView <nl> function TestDataViewConstructor ( ) { <nl> var ab = new ArrayBuffer ( 256 ) ; <nl>
Revert " Correct semantics for numerically indexed stores to typed arrays . "
v8/v8
8854589c79229b51c056ac60cd62850013018676
2014-10-17T13:01:54Z
mmm a / src / qt / paymentserver . cpp <nl> ppp b / src / qt / paymentserver . cpp <nl> static QList < QString > savedPaymentRequests ; <nl> <nl> static void ReportInvalidCertificate ( const QSslCertificate & cert ) <nl> { <nl> - qWarning ( ) < < " ReportInvalidCertificate : Payment server found an invalid certificate : " < < cert . subjectInfo ( QSslCertificate : : CommonName ) ; <nl> + qDebug ( ) < < " ReportInvalidCertificate : Payment server found an invalid certificate : " < < cert . subjectInfo ( QSslCertificate : : CommonName ) ; <nl> } <nl> <nl> / / <nl>
qt : Demote ReportInvalidCertificate message to qDebug
bitcoin/bitcoin
488a61643908e8e872326a79e1143d1f377d412b
2014-08-04T14:41:42Z
mmm a / doc / tutorials / introduction / android_binary_package / android_binary_package . rst <nl> ppp b / doc / tutorials / introduction / android_binary_package / android_binary_package . rst <nl> You need the following tools to be installed : <nl> <nl> * * Android SDK Tools , revision12 * or newer <nl> <nl> - Older revisions should also work but they are not recommended . <nl> + Older revisions should also work but they are not recommended . <nl> <nl> * * SDK Platform Android 2 . 2 , API 8 , revision 2 * ( also known as * android - 8 * ) <nl> <nl>
Fixed list formatting
opencv/opencv
27f060c70745cc7e957ace09a159ac88ee63f2b0
2011-07-20T07:54:08Z
new file mode 100644 <nl> index 0000000000000 . . 27d6783e3a4bd <nl> mmm / dev / null <nl> ppp b / tensorflow / core / api_def / python_api / api_def_StringLower . pbtxt <nl> <nl> + op { <nl> + graph_op_name : " StringLower " <nl> + endpoint { <nl> + name : " strings . lower " <nl> + } <nl> + } <nl>
Expose strings . lower api endpoint based on StringLower op
tensorflow/tensorflow
a19e8352ae62e61d7909d972fbc9211c8b749bdd
2019-04-03T20:48:38Z
mmm a / xbmc / cores / AudioEngine / Engines / CoreAudio / CoreAudioStream . cpp <nl> ppp b / xbmc / cores / AudioEngine / Engines / CoreAudio / CoreAudioStream . cpp <nl> <nl> <nl> # include " CoreAudioAEHAL . h " <nl> # include " utils / log . h " <nl> + # include " utils / StdString . h " <nl> <nl> / / AudioHardwareGetProperty and friends are deprecated , <nl> / / turn off the warning spew . <nl> bool CCoreAudioStream : : Open ( AudioStreamID streamId ) <nl> { <nl> m_StreamId = streamId ; <nl> CLog : : Log ( LOGDEBUG , " CCoreAudioStream : : Open : Opened stream 0x % 04x . " , ( uint ) m_StreamId ) ; <nl> + <nl> + / / watch for physical property changes . <nl> + AudioObjectPropertyAddress propertyAOPA ; <nl> + propertyAOPA . mScope = kAudioObjectPropertyScopeGlobal ; <nl> + propertyAOPA . mElement = kAudioObjectPropertyElementMaster ; <nl> + propertyAOPA . mSelector = kAudioStreamPropertyPhysicalFormat ; <nl> + if ( AudioObjectAddPropertyListener ( m_StreamId , & propertyAOPA , HardwareStreamListener , this ) ! = noErr ) <nl> + CLog : : Log ( LOGERROR , " CCoreAudioStream : : Open : couldn ' t set up a physical property listener . " , m_StreamId ) ; <nl> + <nl> + / / watch for virtual property changes . <nl> + propertyAOPA . mScope = kAudioObjectPropertyScopeGlobal ; <nl> + propertyAOPA . mElement = kAudioObjectPropertyElementMaster ; <nl> + propertyAOPA . mSelector = kAudioStreamPropertyVirtualFormat ; <nl> + if ( AudioObjectAddPropertyListener ( m_StreamId , & propertyAOPA , HardwareStreamListener , this ) ! = noErr ) <nl> + CLog : : Log ( LOGERROR , " CCoreAudioStream : : Open : couldn ' t set up a virtual property listener . " , m_StreamId ) ; <nl> + <nl> return true ; <nl> } <nl> <nl> void CCoreAudioStream : : Close ( ) <nl> <nl> std : : string formatString ; <nl> <nl> + / / remove the physical / virtual property listeners before we make changes <nl> + / / that will trigger callbacks that we do not care about . <nl> + AudioObjectPropertyAddress propertyAOPA ; <nl> + propertyAOPA . mScope = kAudioObjectPropertyScopeGlobal ; <nl> + propertyAOPA . mElement = kAudioObjectPropertyElementMaster ; <nl> + propertyAOPA . mSelector = kAudioStreamPropertyPhysicalFormat ; <nl> + if ( AudioObjectRemovePropertyListener ( m_StreamId , & propertyAOPA , HardwareStreamListener , this ) ! = noErr ) <nl> + CLog : : Log ( LOGDEBUG , " CCoreAudioStream : : Close : Couldn ' t remove property listener . " ) ; <nl> + <nl> + propertyAOPA . mScope = kAudioObjectPropertyScopeGlobal ; <nl> + propertyAOPA . mElement = kAudioObjectPropertyElementMaster ; <nl> + propertyAOPA . mSelector = kAudioStreamPropertyVirtualFormat ; <nl> + if ( AudioObjectRemovePropertyListener ( m_StreamId , & propertyAOPA , HardwareStreamListener , this ) ! = noErr ) <nl> + CLog : : Log ( LOGDEBUG , " CCoreAudioStream : : Close : Couldn ' t remove property listener . " ) ; <nl> + <nl> / / Revert any format changes we made <nl> if ( m_OriginalVirtualFormat . mFormatID & & m_StreamId ) <nl> { <nl> bool CCoreAudioStream : : SetVirtualFormat ( AudioStreamBasicDescription * pDesc ) <nl> return false ; <nl> } <nl> } <nl> + m_virtual_format_event . Reset ( ) ; <nl> OSStatus ret = AudioStreamSetProperty ( m_StreamId , <nl> NULL , 0 , kAudioStreamPropertyVirtualFormat , sizeof ( AudioStreamBasicDescription ) , pDesc ) ; <nl> if ( ret ) <nl> bool CCoreAudioStream : : SetVirtualFormat ( AudioStreamBasicDescription * pDesc ) <nl> ( uint ) m_StreamId , StreamDescriptionToString ( checkVirtualFormat , formatString ) ) ; <nl> break ; <nl> } <nl> - Sleep ( 100 ) ; <nl> + m_virtual_format_event . WaitMSec ( 100 ) ; <nl> } <nl> return true ; <nl> } <nl> bool CCoreAudioStream : : SetPhysicalFormat ( AudioStreamBasicDescription * pDesc ) <nl> return false ; <nl> } <nl> } <nl> + m_physical_format_event . Reset ( ) ; <nl> OSStatus ret = AudioStreamSetProperty ( m_StreamId , <nl> NULL , 0 , kAudioStreamPropertyPhysicalFormat , sizeof ( AudioStreamBasicDescription ) , pDesc ) ; <nl> if ( ret ) <nl> bool CCoreAudioStream : : SetPhysicalFormat ( AudioStreamBasicDescription * pDesc ) <nl> return false ; <nl> } <nl> if ( checkPhysicalFormat . mSampleRate = = pDesc - > mSampleRate & & <nl> - checkPhysicalFormat . mFormatID = = pDesc - > mFormatID & & <nl> + checkPhysicalFormat . mFormatID = = pDesc - > mFormatID & & <nl> checkPhysicalFormat . mFramesPerPacket = = pDesc - > mFramesPerPacket ) <nl> { <nl> / / The right format is now active . <nl> bool CCoreAudioStream : : SetPhysicalFormat ( AudioStreamBasicDescription * pDesc ) <nl> ( uint ) m_StreamId , StreamDescriptionToString ( checkPhysicalFormat , formatString ) ) ; <nl> break ; <nl> } <nl> - Sleep ( 100 ) ; <nl> + m_physical_format_event . WaitMSec ( 100 ) ; <nl> } <nl> + <nl> return true ; <nl> } <nl> <nl> bool CCoreAudioStream : : GetAvailablePhysicalFormats ( StreamFormatList * pList ) <nl> delete [ ] pFormatList ; <nl> return ( ret = = noErr ) ; <nl> } <nl> + <nl> + OSStatus CCoreAudioStream : : HardwareStreamListener ( AudioObjectID inObjectID , <nl> + UInt32 inNumberAddresses , const AudioObjectPropertyAddress inAddresses [ ] , void * inClientData ) <nl> + { <nl> + CCoreAudioStream * ca_stream = ( CCoreAudioStream * ) inClientData ; <nl> + <nl> + for ( UInt32 i = 0 ; i < inNumberAddresses ; i + + ) <nl> + { <nl> + if ( inAddresses [ i ] . mSelector = = kAudioStreamPropertyPhysicalFormat ) <nl> + { <nl> + AudioStreamBasicDescription actualFormat ; <nl> + UInt32 propertySize = sizeof ( AudioStreamBasicDescription ) ; <nl> + / / hardware physical format has changed . <nl> + if ( AudioObjectGetPropertyData ( ca_stream - > m_StreamId , & inAddresses [ i ] , 0 , NULL , & propertySize , & actualFormat ) = = noErr ) <nl> + { <nl> + CStdString formatString ; <nl> + CLog : : Log ( LOGINFO , " CCoreAudioStream : : HardwareStreamListener : " <nl> + " Hardware physical format changed to % s " , StreamDescriptionToString ( actualFormat , formatString ) ) ; <nl> + ca_stream - > m_physical_format_event . Set ( ) ; <nl> + } <nl> + } <nl> + else if ( inAddresses [ i ] . mSelector = = kAudioStreamPropertyVirtualFormat ) <nl> + { <nl> + / / hardware virtual format has changed . <nl> + AudioStreamBasicDescription actualFormat ; <nl> + UInt32 propertySize = sizeof ( AudioStreamBasicDescription ) ; <nl> + if ( AudioObjectGetPropertyData ( ca_stream - > m_StreamId , & inAddresses [ i ] , 0 , NULL , & propertySize , & actualFormat ) = = noErr ) <nl> + { <nl> + CStdString formatString ; <nl> + CLog : : Log ( LOGINFO , " CCoreAudioStream : : HardwareStreamListener : " <nl> + " Hardware virtual format changed to % s " , StreamDescriptionToString ( actualFormat , formatString ) ) ; <nl> + ca_stream - > m_virtual_format_event . Set ( ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + return noErr ; <nl> + } <nl> mmm a / xbmc / cores / AudioEngine / Engines / CoreAudio / CoreAudioStream . h <nl> ppp b / xbmc / cores / AudioEngine / Engines / CoreAudio / CoreAudioStream . h <nl> <nl> <nl> # if defined ( TARGET_DARWIN_OSX ) <nl> <nl> + # include " threads / Thread . h " <nl> # include < CoreAudio / CoreAudio . h > <nl> <nl> # include < list > <nl> class CCoreAudioStream <nl> bool GetAvailablePhysicalFormats ( StreamFormatList * pList ) ; <nl> <nl> protected : <nl> + static OSStatus HardwareStreamListener ( AudioObjectID inObjectID , <nl> + UInt32 inNumberAddresses , const AudioObjectPropertyAddress inAddresses [ ] , void * inClientData ) ; <nl> + <nl> + CEvent m_virtual_format_event ; <nl> + CEvent m_physical_format_event ; <nl> + <nl> + <nl> AudioStreamID m_StreamId ; <nl> AudioStreamBasicDescription m_OriginalVirtualFormat ; <nl> AudioStreamBasicDescription m_OriginalPhysicalFormat ; <nl>
[ osx ] changed , add a property listener for virtual and physical format changes and hook a cevent to them rather than blind sleeps
xbmc/xbmc
6105a33b28af5bfd3eaeeeda1f227a3682f0db80
2012-05-19T05:10:36Z
mmm a / cocos / audio / AudioEngine . cpp <nl> ppp b / cocos / audio / AudioEngine . cpp <nl> <nl> using namespace cocos2d ; <nl> using namespace cocos2d : : experimental ; <nl> <nl> - const int AudioEngine : : INVAILD_AUDIO_ID = - 1 ; <nl> + const int AudioEngine : : INVALID_AUDIO_ID = - 1 ; <nl> const float AudioEngine : : TIME_UNKNOWN = - 1 . 0f ; <nl> <nl> / / audio file path , audio IDs <nl> bool AudioEngine : : lazyInit ( ) <nl> <nl> int AudioEngine : : play2d ( const std : : string & filePath , bool loop , float volume , const AudioProfile * profile ) <nl> { <nl> - int ret = AudioEngine : : INVAILD_AUDIO_ID ; <nl> + int ret = AudioEngine : : INVALID_AUDIO_ID ; <nl> <nl> do { <nl> if ( ! lazyInit ( ) ) { <nl> int AudioEngine : : play2d ( const std : : string & filePath , bool loop , float volume , co <nl> } <nl> <nl> ret = _audioEngineImpl - > play2d ( filePath , loop , volume ) ; <nl> - if ( ret ! = INVAILD_AUDIO_ID ) <nl> + if ( ret ! = INVALID_AUDIO_ID ) <nl> { <nl> _audioPathIDMap [ filePath ] . push_back ( ret ) ; <nl> auto it = _audioPathIDMap . find ( filePath ) ; <nl> mmm a / cocos / audio / android / AudioEngine - inl . cpp <nl> ppp b / cocos / audio / android / AudioEngine - inl . cpp <nl> bool AudioEngineImpl : : init ( ) <nl> <nl> int AudioEngineImpl : : play2d ( const std : : string & filePath , bool loop , float volume ) <nl> { <nl> - auto audioId = AudioEngine : : INVAILD_AUDIO_ID ; <nl> + auto audioId = AudioEngine : : INVALID_AUDIO_ID ; <nl> <nl> do <nl> { <nl> mmm a / cocos / audio / apple / AudioEngine - inl . mm <nl> ppp b / cocos / audio / apple / AudioEngine - inl . mm <nl> void threadFunc ( int index ) <nl> int AudioEngineImpl : : play2d ( const std : : string & filePath , bool loop , float volume ) <nl> { <nl> if ( s_ALDevice = = nullptr ) { <nl> - return AudioEngine : : INVAILD_AUDIO_ID ; <nl> + return AudioEngine : : INVALID_AUDIO_ID ; <nl> } <nl> <nl> bool sourceFlag = false ; <nl> void threadFunc ( int index ) <nl> } <nl> } <nl> if ( ! sourceFlag ) { <nl> - return AudioEngine : : INVAILD_AUDIO_ID ; <nl> + return AudioEngine : : INVALID_AUDIO_ID ; <nl> } <nl> <nl> AudioCache * audioCache = nullptr ; <nl> mmm a / cocos / audio / include / AudioEngine . h <nl> ppp b / cocos / audio / include / AudioEngine . h <nl> class EXPORT_DLL AudioEngine <nl> PAUSED <nl> } ; <nl> <nl> - static const int INVAILD_AUDIO_ID ; <nl> + static const int INVALID_AUDIO_ID ; <nl> <nl> static const float TIME_UNKNOWN ; <nl> <nl> mmm a / cocos / audio / win32 / AudioEngine - win32 . cpp <nl> ppp b / cocos / audio / win32 / AudioEngine - win32 . cpp <nl> int AudioEngineImpl : : play2d ( const std : : string & filePath , bool loop , float volume <nl> } <nl> } <nl> if ( ! availableSourceExist ) { <nl> - return AudioEngine : : INVAILD_AUDIO_ID ; <nl> + return AudioEngine : : INVALID_AUDIO_ID ; <nl> } <nl> <nl> AudioCache * audioCache = nullptr ; <nl> int AudioEngineImpl : : play2d ( const std : : string & filePath , bool loop , float volume <nl> <nl> if ( eraseCache ) { <nl> _audioCaches . erase ( filePath ) ; <nl> - return AudioEngine : : INVAILD_AUDIO_ID ; <nl> + return AudioEngine : : INVALID_AUDIO_ID ; <nl> } <nl> <nl> audioCache - > _fileFullPath = FileUtils : : getInstance ( ) - > fullPathForFilename ( filePath ) ; <nl> mmm a / tests / cpp - tests / Classes / NewAudioEngineTest / NewAudioEngineTest . cpp <nl> ppp b / tests / cpp - tests / Classes / NewAudioEngineTest / NewAudioEngineTest . cpp <nl> std : : string AudioEngineTestDemo : : title ( ) const <nl> bool AudioControlTest : : init ( ) <nl> { <nl> auto ret = AudioEngineTestDemo : : init ( ) ; <nl> - _audioID = AudioEngine : : INVAILD_AUDIO_ID ; <nl> + _audioID = AudioEngine : : INVALID_AUDIO_ID ; <nl> _loopEnabled = false ; <nl> _volume = 1 . 0f ; <nl> _duration = AudioEngine : : TIME_UNKNOWN ; <nl> bool AudioControlTest : : init ( ) <nl> auto & layerSize = this - > getContentSize ( ) ; <nl> <nl> auto playItem = TextButton : : create ( " play " , [ & ] ( TextButton * button ) { <nl> - if ( _audioID = = AudioEngine : : INVAILD_AUDIO_ID ) { <nl> + if ( _audioID = = AudioEngine : : INVALID_AUDIO_ID ) { <nl> _audioID = AudioEngine : : play2d ( " background . mp3 " , _loopEnabled , _volume ) ; <nl> <nl> - if ( _audioID ! = AudioEngine : : INVAILD_AUDIO_ID ) { <nl> + if ( _audioID ! = AudioEngine : : INVALID_AUDIO_ID ) { <nl> button - > setEnabled ( false ) ; <nl> AudioEngine : : setFinishCallback ( _audioID , [ & ] ( int id , const std : : string & filePath ) { <nl> - _audioID = AudioEngine : : INVAILD_AUDIO_ID ; <nl> + _audioID = AudioEngine : : INVALID_AUDIO_ID ; <nl> ( ( TextButton * ) _playItem ) - > setEnabled ( true ) ; <nl> <nl> _timeRatio = 0 . 0f ; <nl> bool AudioControlTest : : init ( ) <nl> addChild ( playItem ) ; <nl> <nl> auto stopItem = TextButton : : create ( " stop " , [ & ] ( TextButton * button ) { <nl> - if ( _audioID ! = AudioEngine : : INVAILD_AUDIO_ID ) { <nl> + if ( _audioID ! = AudioEngine : : INVALID_AUDIO_ID ) { <nl> AudioEngine : : stop ( _audioID ) ; <nl> <nl> - _audioID = AudioEngine : : INVAILD_AUDIO_ID ; <nl> + _audioID = AudioEngine : : INVALID_AUDIO_ID ; <nl> ( ( TextButton * ) _playItem ) - > setEnabled ( true ) ; <nl> } <nl> } ) ; <nl> bool AudioControlTest : : init ( ) <nl> addChild ( stopItem ) ; <nl> <nl> auto pauseItem = TextButton : : create ( " pause " , [ & ] ( TextButton * button ) { <nl> - if ( _audioID ! = AudioEngine : : INVAILD_AUDIO_ID ) { <nl> + if ( _audioID ! = AudioEngine : : INVALID_AUDIO_ID ) { <nl> AudioEngine : : pause ( _audioID ) ; <nl> } <nl> } ) ; <nl> bool AudioControlTest : : init ( ) <nl> addChild ( pauseItem ) ; <nl> <nl> auto resumeItem = TextButton : : create ( " resume " , [ & ] ( TextButton * button ) { <nl> - if ( _audioID ! = AudioEngine : : INVAILD_AUDIO_ID ) { <nl> + if ( _audioID ! = AudioEngine : : INVALID_AUDIO_ID ) { <nl> AudioEngine : : resume ( _audioID ) ; <nl> } <nl> } ) ; <nl> bool AudioControlTest : : init ( ) <nl> auto loopItem = TextButton : : create ( " enable - loop " , [ & ] ( TextButton * button ) { <nl> _loopEnabled = ! _loopEnabled ; <nl> <nl> - if ( _audioID ! = AudioEngine : : INVAILD_AUDIO_ID ) { <nl> + if ( _audioID ! = AudioEngine : : INVALID_AUDIO_ID ) { <nl> AudioEngine : : setLoop ( _audioID , _loopEnabled ) ; <nl> } <nl> if ( _loopEnabled ) { <nl> bool AudioControlTest : : init ( ) <nl> auto uncacheItem = TextButton : : create ( " uncache " , [ & ] ( TextButton * button ) { <nl> AudioEngine : : uncache ( " background . mp3 " ) ; <nl> <nl> - _audioID = AudioEngine : : INVAILD_AUDIO_ID ; <nl> + _audioID = AudioEngine : : INVALID_AUDIO_ID ; <nl> ( ( TextButton * ) _playItem ) - > setEnabled ( true ) ; <nl> } ) ; <nl> uncacheItem - > setPosition ( layerSize . width * 0 . 7f , layerSize . height * 0 . 5f ) ; <nl> bool AudioControlTest : : init ( ) <nl> volumeSlider - > setPercent ( 100 ) ; <nl> volumeSlider - > setCallBack ( [ & ] ( SliderEx * sender , float ratio , SliderEx : : TouchEvent event ) { <nl> _volume = ratio ; <nl> - if ( _audioID ! = AudioEngine : : INVAILD_AUDIO_ID ) { <nl> + if ( _audioID ! = AudioEngine : : INVALID_AUDIO_ID ) { <nl> AudioEngine : : setVolume ( _audioID , _volume ) ; <nl> } <nl> } ) ; <nl> bool AudioControlTest : : init ( ) <nl> _updateTimeSlider = false ; <nl> break ; <nl> case SliderEx : : TouchEvent : : UP : <nl> - if ( _audioID ! = AudioEngine : : INVAILD_AUDIO_ID & & _duration ! = AudioEngine : : TIME_UNKNOWN ) { <nl> + if ( _audioID ! = AudioEngine : : INVALID_AUDIO_ID & & _duration ! = AudioEngine : : TIME_UNKNOWN ) { <nl> AudioEngine : : setCurrentTime ( _audioID , _duration * ratio ) ; <nl> } <nl> case SliderEx : : TouchEvent : : CANCEL : <nl> bool AudioControlTest : : init ( ) <nl> <nl> void AudioControlTest : : update ( float dt ) <nl> { <nl> - if ( _audioID ! = AudioEngine : : INVAILD_AUDIO_ID ) { <nl> + if ( _audioID ! = AudioEngine : : INVALID_AUDIO_ID ) { <nl> if ( _duration = = AudioEngine : : TIME_UNKNOWN ) { <nl> _duration = AudioEngine : : getDuration ( _audioID ) ; <nl> } <nl> bool PlaySimultaneouslyTest : : init ( ) <nl> auto startTime = utils : : gettime ( ) ; <nl> for ( int index = 0 ; index < TEST_COUNT ; + + index ) { <nl> audioId = AudioEngine : : play2d ( _files [ index ] ) ; <nl> - if ( audioId ! = AudioEngine : : INVAILD_AUDIO_ID ) { <nl> + if ( audioId ! = AudioEngine : : INVALID_AUDIO_ID ) { <nl> _playingcount + = 1 ; <nl> <nl> AudioEngine : : setFinishCallback ( audioId , [ & ] ( int id , const std : : string & filePath ) { <nl> bool AudioProfileTest : : init ( ) <nl> auto playItem = TextButton : : create ( text , [ & ] ( TextButton * button ) { <nl> int index = button - > getTag ( ) ; <nl> auto id = AudioEngine : : play2d ( _files [ index ] , false , 1 . 0f , & _audioProfile ) ; <nl> - if ( id ! = AudioEngine : : INVAILD_AUDIO_ID ) { <nl> + if ( id ! = AudioEngine : : INVALID_AUDIO_ID ) { <nl> _time = _minDelay ; <nl> _audioCount + = 1 ; <nl> char show [ 30 ] ; <nl>
Merge pull request from raydelto / v3
cocos2d/cocos2d-x
26a650255809706dd14012e33369e770f4873ba1
2015-01-04T05:36:16Z
mmm a / src / compiler / x64 / code - generator - x64 . cc <nl> ppp b / src / compiler / x64 / code - generator - x64 . cc <nl> void CodeGenerator : : AssembleArchInstruction ( Instruction * instr ) { <nl> break ; <nl> case kX64Movsxbl : <nl> __ movsxbl ( i . OutputRegister ( ) , i . MemoryOperand ( ) ) ; <nl> + __ AssertZeroExtended ( i . OutputRegister ( ) ) ; <nl> break ; <nl> case kX64Movzxbl : <nl> __ movzxbl ( i . OutputRegister ( ) , i . MemoryOperand ( ) ) ; <nl> void CodeGenerator : : AssembleArchInstruction ( Instruction * instr ) { <nl> break ; <nl> } <nl> case kX64Movsxwl : <nl> - __ movsxwl ( i . OutputRegister ( ) , i . MemoryOperand ( ) ) ; <nl> + if ( instr - > addressing_mode ( ) ! = kMode_None ) { <nl> + __ movsxwl ( i . OutputRegister ( ) , i . MemoryOperand ( ) ) ; <nl> + } else if ( instr - > InputAt ( 0 ) - > IsRegister ( ) ) { <nl> + __ movsxwl ( i . OutputRegister ( ) , i . InputRegister ( 0 ) ) ; <nl> + } else { <nl> + __ movsxwl ( i . OutputRegister ( ) , i . InputOperand ( 0 ) ) ; <nl> + } <nl> + __ AssertZeroExtended ( i . OutputRegister ( ) ) ; <nl> break ; <nl> case kX64Movzxwl : <nl> __ movzxwl ( i . OutputRegister ( ) , i . MemoryOperand ( ) ) ; <nl> + __ AssertZeroExtended ( i . OutputRegister ( ) ) ; <nl> break ; <nl> case kX64Movw : { <nl> int index = 0 ; <nl> void CodeGenerator : : AssembleArchInstruction ( Instruction * instr ) { <nl> } else { <nl> __ movl ( i . OutputRegister ( ) , i . MemoryOperand ( ) ) ; <nl> } <nl> + __ AssertZeroExtended ( i . OutputRegister ( ) ) ; <nl> } else { <nl> int index = 0 ; <nl> Operand operand = i . MemoryOperand ( & index ) ; <nl> void CodeGenerator : : AssembleArchInstruction ( Instruction * instr ) { <nl> break ; <nl> case kX64Lea32 : <nl> __ leal ( i . OutputRegister ( ) , i . MemoryOperand ( ) ) ; <nl> + __ AssertZeroExtended ( i . OutputRegister ( ) ) ; <nl> break ; <nl> case kX64Lea : <nl> __ leaq ( i . OutputRegister ( ) , i . MemoryOperand ( ) ) ; <nl> mmm a / src / compiler / x64 / instruction - selector - x64 . cc <nl> ppp b / src / compiler / x64 / instruction - selector - x64 . cc <nl> void InstructionSelector : : VisitWord64Shr ( Node * node ) { <nl> <nl> <nl> void InstructionSelector : : VisitWord32Sar ( Node * node ) { <nl> + X64OperandGenerator g ( this ) ; <nl> + Int32BinopMatcher m ( node ) ; <nl> + if ( CanCover ( m . node ( ) , m . left ( ) . node ( ) ) & & m . left ( ) . IsWord32Shl ( ) ) { <nl> + Int32BinopMatcher mleft ( m . left ( ) . node ( ) ) ; <nl> + if ( mleft . right ( ) . Is ( 16 ) & & m . right ( ) . Is ( 16 ) ) { <nl> + Emit ( kX64Movsxwl , g . DefineAsRegister ( node ) , g . Use ( mleft . left ( ) . node ( ) ) ) ; <nl> + return ; <nl> + } <nl> + } <nl> VisitWord32Shift ( this , node , kX64Sar32 ) ; <nl> } <nl> <nl> void InstructionSelector : : VisitWord64Ror ( Node * node ) { <nl> VisitWord64Shift ( this , node , kX64Ror ) ; <nl> } <nl> <nl> + <nl> namespace { <nl> <nl> AddressingMode GenerateMemoryOperandInputs ( X64OperandGenerator * g , Node * scaled , <nl> InstructionSelector : : SupportedMachineOperatorFlags ( ) { <nl> } <nl> return MachineOperatorBuilder : : kNoFlags ; <nl> } <nl> + <nl> } / / namespace compiler <nl> } / / namespace internal <nl> } / / namespace v8 <nl> mmm a / src / x64 / assembler - x64 . cc <nl> ppp b / src / x64 / assembler - x64 . cc <nl> void Assembler : : movsxbq ( Register dst , const Operand & src ) { <nl> } <nl> <nl> <nl> + void Assembler : : movsxwl ( Register dst , Register src ) { <nl> + EnsureSpace ensure_space ( this ) ; <nl> + emit_optional_rex_32 ( dst , src ) ; <nl> + emit ( 0x0F ) ; <nl> + emit ( 0xBF ) ; <nl> + emit_modrm ( dst , src ) ; <nl> + } <nl> + <nl> + <nl> void Assembler : : movsxwl ( Register dst , const Operand & src ) { <nl> EnsureSpace ensure_space ( this ) ; <nl> emit_optional_rex_32 ( dst , src ) ; <nl> mmm a / src / x64 / assembler - x64 . h <nl> ppp b / src / x64 / assembler - x64 . h <nl> class Assembler : public AssemblerBase { <nl> <nl> void movsxbl ( Register dst , const Operand & src ) ; <nl> void movsxbq ( Register dst , const Operand & src ) ; <nl> + void movsxwl ( Register dst , Register src ) ; <nl> void movsxwl ( Register dst , const Operand & src ) ; <nl> void movsxwq ( Register dst , const Operand & src ) ; <nl> void movsxlq ( Register dst , Register src ) ; <nl>
[ x64 ] Recognize MOVSXWL .
v8/v8
3c79e2e920ccf49dc5841a0b4ce3323f11d24ec0
2014-11-18T07:51:52Z
mmm a / Marlin / src / pins / stm32 / pins_BIGTREE_SKR_E3_DIP . h <nl> ppp b / Marlin / src / pins / stm32 / pins_BIGTREE_SKR_E3_DIP . h <nl> <nl> # define BTN_ENC PB6 <nl> <nl> # if ENABLED ( CR10_STOCKDISPLAY ) <nl> + <nl> # define LCD_PINS_RS PB8 <nl> <nl> # define BTN_EN1 PA9 <nl> <nl> # define LCD_PINS_ENABLE PB7 <nl> # define LCD_PINS_D4 PB9 <nl> <nl> + # elif ENABLED ( MKS_MINI_12864 ) <nl> + <nl> + / * * Creality Ender - 2 display pinout <nl> + * _____ <nl> + * 5V | · · | GND <nl> + * ( MOSI ) PB7 | · · | PB8 ( LCD_RS ) <nl> + * ( LCD_A0 ) PB9 | · · | PA10 ( BTN_EN2 ) <nl> + * RESET | · · | PA9 ( BTN_EN1 ) <nl> + * ( BTN_ENC ) PB6 | · · | PA15 ( SCK ) <nl> + * mmm - - <nl> + * EXP1 <nl> + * / <nl> + <nl> + # define BTN_EN1 PA9 <nl> + # define BTN_EN2 PA10 <nl> + # define DOGLCD_CS PB8 <nl> + # define DOGLCD_A0 PB9 <nl> + # define DOGLCD_SCK PA15 <nl> + # define DOGLCD_MOSI PB7 <nl> + # define FORCE_SOFT_SPI <nl> + # define LCD_BACKLIGHT_PIN - 1 <nl> + <nl> # else <nl> - # error " Only CR10_STOCKDISPLAY is currently supported on the BIGTREE_SKR_E3_DIP . " <nl> + # error " Only CR10_STOCKDISPLAY and MKS_MINI_12864 are currently supported on the BIGTREE_SKR_E3_DIP . " <nl> # endif <nl> <nl> # endif / / HAS_SPI_LCD <nl> mmm a / Marlin / src / pins / stm32 / pins_BIGTREE_SKR_MINI_E3 . h <nl> ppp b / Marlin / src / pins / stm32 / pins_BIGTREE_SKR_MINI_E3 . h <nl> <nl> # define LCD_PINS_ENABLE PB7 <nl> # define LCD_PINS_D4 PB9 <nl> <nl> + # elif ENABLED ( MKS_MINI_12864 ) <nl> + <nl> + / * * Creality Ender - 2 display pinout <nl> + * _____ <nl> + * 5V | · · | GND <nl> + * ( MOSI ) PB7 | · · | PB8 ( LCD_RS ) <nl> + * ( LCD_A0 ) PB9 | · · | PA10 ( BTN_EN2 ) <nl> + * RESET | · · | PA9 ( BTN_EN1 ) <nl> + * ( BTN_ENC ) PB6 | · · | PA15 ( SCK ) <nl> + * mmm - - <nl> + * EXP1 <nl> + * / <nl> + <nl> + # define BTN_EN1 PA9 <nl> + # define BTN_EN2 PA10 <nl> + # define DOGLCD_CS PB8 <nl> + # define DOGLCD_A0 PB9 <nl> + # define DOGLCD_SCK PA15 <nl> + # define DOGLCD_MOSI PB7 <nl> + # define FORCE_SOFT_SPI <nl> + # define LCD_BACKLIGHT_PIN - 1 <nl> + <nl> # else <nl> - # error " Only CR10_STOCKDISPLAY is currently supported on the BIGTREE_SKR_MINI_E3 . " <nl> + # error " Only CR10_STOCKDISPLAY and MKS_MINI_12864 are currently supported on the BIGTREE_SKR_MINI_E3 . " <nl> # endif <nl> <nl> # endif / / HAS_SPI_LCD <nl>
Ender - 2 LCD on BTT SKR E3 ( )
MarlinFirmware/Marlin
814d908a8aba9d5cff06e344f7f7dcaaf7b4377d
2019-11-20T05:21:27Z
deleted file mode 100644 <nl> index 250e9fdb8be . . 00000000000 <nl> mmm a / src / test / tainting / build_tests . sh <nl> ppp / dev / null <nl> <nl> - # ! / bin / sh <nl> - # <nl> - # This script runs tainting tests on all the taint < i > . php and stores the <nl> - # ouptut in taint < i > . php . exp . Please do not run it if you are not sure the <nl> - # tainting features work , as it resets the expected outputs of the test cases . <nl> - # <nl> - # The script is not executable so that it is not run by accident . To run it do : <nl> - # sh built_tests . sh <nl> - # <nl> - read - n 1 - p ' This test will recreate the . exp ( for expected ) files . Are you sure you want to proceed ? [ y / n ] ' answer <nl> - echo ' ' <nl> - if [ $ answer = ' y ' ] <nl> - then <nl> - test_files = ` ls $ HPHP_HOME / src / test / tainting / * . php ` <nl> - for i in $ test_files <nl> - do <nl> - echo " mmm Building $ i . exp mmm " <nl> - $ HPHP_HOME / src / hphpi / hphpi - f $ i | pretty > $ i . exp <nl> - done <nl> - fi <nl> deleted file mode 100644 <nl> index 5591bf69202 . . 00000000000 <nl> mmm a / src / test / tainting / core / array . php <nl> ppp / dev / null <nl> <nl> - < ? php <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - require_once ( ' . . / setup . inc ' ) ; <nl> - <nl> - / * * <nl> - * Sanity checks for tainting array entries . <nl> - * / <nl> - <nl> - $ arrg1 = array ( $ good1 ) ; <nl> - $ arrb1 = array ( $ bad1 ) ; <nl> - echo " Testing array ( ) on strings : \ n " ; <nl> - assert_not_tainted ( $ arrg1 [ 0 ] ) ; <nl> - assert_tainted ( $ arrb1 [ 0 ] ) ; <nl> - <nl> - $ arr = array ( <nl> - ' good1 ' = > $ good1 , <nl> - ' bad1 ' = > $ bad1 , <nl> - 42 = > array ( <nl> - ' good2 ' = > $ good2 , <nl> - ' bad2 ' = > $ bad2 , <nl> - ) , <nl> - ) ; <nl> - echo " \ n " ; <nl> - echo " Testing array containing mixed taints : \ n " ; <nl> - assert_not_tainted ( $ arr ) ; <nl> - assert_tainted ( print_r ( $ arr , true ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing taint independence among array entries : \ n " ; <nl> - assert_not_tainted ( $ arr [ ' good1 ' ] ) ; <nl> - assert_tainted ( $ arr [ ' bad1 ' ] ) ; <nl> - assert_not_tainted ( $ arr [ 42 ] ) ; <nl> - assert_tainted ( print_r ( $ arr [ 42 ] , true ) ) ; <nl> - assert_not_tainted ( $ arr [ 42 ] [ ' good2 ' ] ) ; <nl> - assert_tainted ( $ arr [ 42 ] [ ' bad2 ' ] ) ; <nl> deleted file mode 100644 <nl> index 6a4d9aa50c1 . . 00000000000 <nl> mmm a / src / test / tainting / core / call_user_func . php <nl> ppp / dev / null <nl> <nl> - < ? php <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - require_once ( ' . . / setup . inc ' ) ; <nl> - <nl> - / * * <nl> - * Taint tests for call_user_func * ( ) family of functions . <nl> - * / <nl> - <nl> - / / Checks that call_user_func * family correctly propagate taint ( i . e . , that <nl> - / / taints are passed to parameters even without a TaintObserver declared in <nl> - / / the scope of call_user_func * ) <nl> - function callback_check_propagation ( $ a , $ a_taint , $ b , $ b_taint ) { <nl> - $ a_taint ? assert_tainted ( $ a ) : assert_not_tainted ( $ a ) ; <nl> - $ b_taint ? assert_tainted ( $ b ) : assert_not_tainted ( $ b ) ; <nl> - } <nl> - <nl> - / / Helper function for callback_check_independence to make a new string without <nl> - / / scoping a new TaintObserver <nl> - / / TODO figure out away to avoid re - scoping a TaintObserver ( currently this is <nl> - / / a placeholder ) <nl> - function make_string ( $ a ) { <nl> - return $ a . ' quux ' ; <nl> - } <nl> - <nl> - / / Checks that call_user_func * family does not create a TaintObserver which <nl> - / / would transmit taint between independent strings <nl> - function callback_check_independence ( $ a ) { <nl> - / / taint $ a <nl> - fb_set_taint ( $ a , TAINT_HTML ) ; <nl> - <nl> - / / access $ a without scoping new TaintObserver <nl> - if ( $ a = = = ' foobarbaz ' ) { <nl> - / / create new string $ b without scoping new TaintObserver <nl> - $ b = make_string ( ' ' ) ; <nl> - assert_not_tainted ( $ b ) ; <nl> - } <nl> - } <nl> - <nl> - $ arr_good = array ( $ good1 , false , $ good2 , false ) ; <nl> - $ arr_mixed = array ( $ good1 , false , $ bad1 , true ) ; <nl> - $ arr_bad = array ( $ bad1 , true , $ bad2 , true ) ; <nl> - <nl> - echo " Testing call_user_func taint propagation : \ n " ; <nl> - call_user_func ( ' callback_check_propagation ' , $ good1 , false , $ good2 , false ) ; <nl> - call_user_func ( ' callback_check_propagation ' , $ good1 , false , $ bad1 , true ) ; <nl> - call_user_func ( ' callback_check_propagation ' , $ bad1 , true , $ bad2 , true ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing call_user_func_array taint propagation : \ n " ; <nl> - call_user_func_array ( ' callback_check_propagation ' , $ arr_good ) ; <nl> - call_user_func_array ( ' callback_check_propagation ' , $ arr_mixed ) ; <nl> - call_user_func_array ( ' callback_check_propagation ' , $ arr_bad ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing taint independence : \ n " ; <nl> - call_user_func ( ' callback_check_independence ' , ' foobarbaz ' ) ; <nl> - call_user_func_array ( ' callback_check_independence ' , array ( ' foobarbaz ' ) ) ; <nl> deleted file mode 100644 <nl> index 78c61cd2968 . . 00000000000 <nl> mmm a / src / test / tainting / core / concatenations . php <nl> ppp / dev / null <nl> <nl> - < ? php <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - require_once ( ' . . / setup . inc ' ) ; <nl> - <nl> - / * * <nl> - * Check that various forms of concatenations output the right general taint <nl> - * information . Concatenation tests for staticity can be found in . / static / <nl> - * / <nl> - <nl> - $ a = $ good1 . $ good2 ; <nl> - assert_not_tainted ( $ a ) ; <nl> - <nl> - $ a = $ good1 . $ bad1 ; <nl> - assert_tainted ( $ a ) ; <nl> - <nl> - $ a = $ good1 ; <nl> - $ a . = $ good2 ; <nl> - assert_not_tainted ( $ a ) ; <nl> - <nl> - $ a = $ good1 ; <nl> - $ a . = $ bad1 ; <nl> - assert_tainted ( $ a ) ; <nl> - <nl> - $ a = " $ good1 $ good2 " ; <nl> - assert_not_tainted ( $ a ) ; <nl> - <nl> - $ a = " $ good1 $ bad1 " ; <nl> - assert_tainted ( $ a ) ; <nl> deleted file mode 100644 <nl> index 3d70cccd1d4 . . 00000000000 <nl> mmm a / src / test / tainting / core / output . php <nl> ppp / dev / null <nl> <nl> - < ? php <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - require_once ( ' . . / setup . inc ' ) ; <nl> - <nl> - / * * <nl> - * Taint tests for functions defined in output . idl . php <nl> - * / <nl> - <nl> - echo " Testing ob_start : \ n " ; <nl> - ob_start ( ) ; <nl> - ob_start ( ) ; <nl> - echo $ good1 ; <nl> - $ a = ob_get_clean ( ) ; <nl> - echo $ a ; <nl> - $ b = ob_get_clean ( ) ; <nl> - assert_html_safe ( $ a ) ; <nl> - assert_html_safe ( $ b ) ; <nl> - <nl> - ob_start ( ) ; <nl> - ob_start ( ) ; <nl> - echo $ bad1 ; <nl> - $ a = ob_get_clean ( ) ; <nl> - echo $ a ; <nl> - $ b = ob_get_clean ( ) ; <nl> - assert_html_unsafe ( $ a ) ; <nl> - assert_html_unsafe ( $ b ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing ob_clean : \ n " ; <nl> - ob_start ( ) ; <nl> - echo $ good1 ; <nl> - ob_clean ( ) ; <nl> - echo $ good2 ; <nl> - assert_html_safe ( ob_get_clean ( ) ) ; <nl> - <nl> - ob_start ( ) ; <nl> - echo $ bad1 ; <nl> - ob_clean ( ) ; <nl> - echo $ good1 ; <nl> - assert_html_safe ( ob_get_clean ( ) ) ; <nl> - <nl> - ob_start ( ) ; <nl> - echo $ good1 ; <nl> - ob_clean ( ) ; <nl> - echo $ bad1 ; <nl> - assert_html_unsafe ( ob_get_clean ( ) ) ; <nl> - <nl> - ob_start ( ) ; <nl> - echo $ bad1 ; <nl> - ob_clean ( ) ; <nl> - echo $ bad2 ; <nl> - assert_html_unsafe ( ob_get_clean ( ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing ob_flush : \ n " ; <nl> - ob_start ( ) ; <nl> - ob_start ( ) ; <nl> - echo $ good1 ; <nl> - ob_flush ( ) ; <nl> - ob_end_clean ( ) ; <nl> - $ a = ob_get_clean ( ) ; <nl> - assert_html_safe ( $ a ) ; <nl> - <nl> - ob_start ( ) ; <nl> - ob_start ( ) ; <nl> - echo $ bad1 ; <nl> - ob_flush ( ) ; <nl> - ob_end_clean ( ) ; <nl> - $ a = ob_get_clean ( ) ; <nl> - assert_html_unsafe ( $ a ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing ob_end_clean : \ n " ; <nl> - ob_start ( ) ; <nl> - ob_start ( ) ; <nl> - echo $ good1 ; <nl> - ob_end_clean ( ) ; <nl> - echo $ good2 ; <nl> - assert_html_safe ( ob_get_clean ( ) ) ; <nl> - <nl> - ob_start ( ) ; <nl> - ob_start ( ) ; <nl> - echo $ bad1 ; <nl> - ob_end_clean ( ) ; <nl> - echo $ good1 ; <nl> - assert_html_safe ( ob_get_clean ( ) ) ; <nl> - <nl> - ob_start ( ) ; <nl> - ob_start ( ) ; <nl> - echo $ good1 ; <nl> - ob_end_clean ( ) ; <nl> - echo $ bad1 ; <nl> - assert_html_unsafe ( ob_get_clean ( ) ) ; <nl> - <nl> - ob_start ( ) ; <nl> - ob_start ( ) ; <nl> - echo $ bad1 ; <nl> - ob_end_clean ( ) ; <nl> - echo $ bad2 ; <nl> - assert_html_unsafe ( ob_get_clean ( ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing ob_end_flush : \ n " ; <nl> - ob_start ( ) ; <nl> - ob_start ( ) ; <nl> - echo $ good1 ; <nl> - ob_end_flush ( ) ; <nl> - assert_html_safe ( ob_get_clean ( ) ) ; <nl> - <nl> - ob_start ( ) ; <nl> - ob_start ( ) ; <nl> - echo $ bad1 ; <nl> - ob_end_flush ( ) ; <nl> - assert_html_unsafe ( ob_get_clean ( ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing ob_get_clean : \ n " ; <nl> - ob_start ( ) ; <nl> - echo $ good1 ; <nl> - assert_html_safe ( ob_get_clean ( ) ) ; <nl> - <nl> - ob_start ( ) ; <nl> - echo $ bad1 ; <nl> - assert_html_unsafe ( ob_get_clean ( ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing ob_get_contents : \ n " ; <nl> - ob_start ( ) ; <nl> - echo $ good1 ; <nl> - $ a = ob_get_contents ( ) ; <nl> - ob_end_clean ( ) ; <nl> - assert_html_safe ( $ a ) ; <nl> - <nl> - ob_start ( ) ; <nl> - echo $ bad1 ; <nl> - $ a = ob_get_contents ( ) ; <nl> - ob_end_clean ( ) ; <nl> - assert_html_unsafe ( $ a ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing ob_get_flush : \ n " ; <nl> - ob_start ( ) ; <nl> - ob_start ( ) ; <nl> - echo $ good1 ; <nl> - $ a = ob_get_flush ( ) ; <nl> - ob_end_clean ( ) ; <nl> - $ b = ob_get_clean ( ) ; <nl> - assert_html_safe ( $ a ) ; <nl> - assert_html_safe ( $ b ) ; <nl> - <nl> - ob_start ( ) ; <nl> - ob_start ( ) ; <nl> - echo $ bad1 ; <nl> - $ a = ob_get_flush ( ) ; <nl> - ob_end_clean ( ) ; <nl> - $ b = ob_get_clean ( ) ; <nl> - assert_html_unsafe ( $ a ) ; <nl> - assert_html_unsafe ( $ b ) ; <nl> - <nl> - <nl> deleted file mode 100644 <nl> index 41d3badf0e3 . . 00000000000 <nl> mmm a / src / test / tainting / core / references . php <nl> ppp / dev / null <nl> <nl> - < ? php <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - require_once ( ' . . / setup . inc ' ) ; <nl> - <nl> - / * * <nl> - * Check that the reference operator doesn ' t cause us to lose any taint <nl> - * information . <nl> - * / <nl> - <nl> - $ a = $ good1 ; <nl> - $ b = & $ a ; <nl> - <nl> - $ a . = $ good2 ; <nl> - assert_not_tainted ( $ b ) ; <nl> - <nl> - $ a . = $ bad1 ; <nl> - assert_tainted ( $ b ) ; <nl> deleted file mode 100644 <nl> index 3c0510b825b . . 00000000000 <nl> mmm a / src / test / tainting / core / strings . php <nl> ppp / dev / null <nl> <nl> - < ? php <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - require_once ( ' . . / setup . inc ' ) ; <nl> - <nl> - / * * <nl> - * Taint tests for functions defined in string . idl . php <nl> - * <nl> - * Please make sure to test both cases , where a tainted result is expected <nl> - * as well as where an untainted result is expected . <nl> - * / <nl> - <nl> - $ common_suite_funcs = array ( <nl> - " stripcslashes " , <nl> - " addslashes " , <nl> - " stripslashes " , <nl> - " bin2hex " , <nl> - / / " hex2bin " , <nl> - " nl2br " , <nl> - " quotemeta " , <nl> - " str_shuffle " , <nl> - " strrev " , <nl> - " strtolower " , <nl> - " strtoupper " , <nl> - " ucfirst " , <nl> - " ucwords " , <nl> - " strip_tags " , <nl> - " trim " , <nl> - " ltrim " , <nl> - " chop " , <nl> - " html_entity_decode " , <nl> - " htmlentities " , <nl> - " htmlspecialchars_decode " , <nl> - " htmlspecialchars " , <nl> - " quoted_printable_encode " , <nl> - " quoted_printable_decode " , <nl> - " convert_uudecode " , <nl> - " convert_uuencode " , <nl> - " str_rot13 " , <nl> - " crypt " , <nl> - " md5 " , <nl> - " sha1 " <nl> - ) ; <nl> - <nl> - function test_common_suite ( $ func ) { <nl> - global $ good1 , $ bad1 ; <nl> - echo " \ n " ; <nl> - echo " Testing $ func : \ n " ; <nl> - assert_html_safe ( $ func ( $ good1 ) ) ; <nl> - assert_html_unsafe ( $ func ( $ bad1 ) ) ; <nl> - assert_not_static ( $ func ( $ good1 ) ) ; <nl> - assert_not_static ( $ func ( $ bad1 ) ) ; <nl> - } <nl> - <nl> - <nl> - <nl> - echo " Testing addcslashes : \ n " ; <nl> - assert_html_safe ( addcslashes ( $ good1 , $ good2 ) ) ; <nl> - assert_html_unsafe ( addcslashes ( $ bad1 , $ bad1 ) ) ; <nl> - assert_html_unsafe ( addcslashes ( $ good1 , $ bad1 ) ) ; <nl> - assert_not_static ( addcslashes ( $ good1 , $ good2 ) ) ; <nl> - assert_not_static ( addcslashes ( $ bad1 , $ bad2 ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing rtrim : \ n " ; <nl> - assert_html_safe ( rtrim ( $ good1 ) ) ; <nl> - assert_html_unsafe ( rtrim ( $ bad1 ) ) ; <nl> - assert_static ( rtrim ( $ good1 ) ) ; <nl> - assert_not_static ( rtrim ( $ good1 , 5 ) ) ; <nl> - assert_not_static ( rtrim ( $ bad1 ) ) ; <nl> - <nl> - foreach ( $ common_suite_funcs as $ func ) { <nl> - test_common_suite ( $ func ) ; <nl> - } <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing explode : \ n " ; <nl> - $ arr = explode ( " \ n " , $ good1 ) ; <nl> - assert_html_safe ( $ arr [ 0 ] ) ; <nl> - assert_html_safe ( $ arr [ 1 ] ) ; <nl> - assert_not_static ( $ arr [ 0 ] ) ; <nl> - assert_not_static ( $ arr [ 1 ] ) ; <nl> - $ arr = explode ( " \ n " , $ bad1 ) ; <nl> - assert_html_unsafe ( $ arr [ 0 ] ) ; <nl> - assert_html_unsafe ( $ arr [ 1 ] ) ; <nl> - assert_not_static ( $ arr [ 0 ] ) ; <nl> - assert_not_static ( $ arr [ 1 ] ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing implode : \ n " ; <nl> - $ arr = array ( ) ; <nl> - $ arr [ ] = $ good1 ; <nl> - $ arr [ ] = $ good2 ; <nl> - assert_html_safe ( implode ( " \ t " , $ arr ) ) ; <nl> - assert_static ( implode ( " \ t " , $ arr ) ) ; <nl> - assert_not_static ( implode ( $ bad2 , $ arr ) ) ; <nl> - $ arr [ ] = $ bad1 ; <nl> - assert_html_unsafe ( implode ( " \ t " , $ arr ) ) ; <nl> - assert_not_static ( implode ( " \ t " , $ arr ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing join : \ n " ; <nl> - $ arr = array ( ) ; <nl> - $ arr [ ] = $ good1 ; <nl> - $ arr [ ] = $ good2 ; <nl> - assert_html_safe ( join ( " \ t " , $ arr ) ) ; <nl> - assert_not_static ( join ( " \ t " , $ arr ) ) ; <nl> - $ arr [ ] = $ bad1 ; <nl> - assert_html_unsafe ( join ( " \ t " , $ arr ) ) ; <nl> - assert_not_static ( join ( " \ t " , $ arr ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing str_split : \ n " ; <nl> - $ arr = str_split ( $ good1 , 2 ) ; <nl> - assert_html_safe ( $ arr [ 0 ] ) ; <nl> - assert_html_safe ( $ arr [ 1 ] ) ; <nl> - assert_not_static ( $ arr [ 0 ] ) ; <nl> - assert_not_static ( $ arr [ 1 ] ) ; <nl> - $ arr = str_split ( $ bad1 , 2 ) ; <nl> - assert_html_unsafe ( $ arr [ 0 ] ) ; <nl> - assert_html_unsafe ( $ arr [ 1 ] ) ; <nl> - assert_not_static ( $ arr [ 0 ] ) ; <nl> - assert_not_static ( $ arr [ 1 ] ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing chunk_split : \ n " ; <nl> - assert_html_safe ( chunk_split ( $ good1 , 3 , $ good2 ) ) ; <nl> - assert_html_unsafe ( chunk_split ( $ bad1 , 3 , $ good1 ) ) ; <nl> - assert_html_unsafe ( chunk_split ( $ good1 , 3 , $ bad1 ) ) ; <nl> - assert_not_static ( chunk_split ( $ good1 , 3 , $ good2 ) ) ; <nl> - assert_not_static ( chunk_split ( $ bad1 , 3 , $ good1 ) ) ; <nl> - assert_not_static ( chunk_split ( $ good1 , 3 , $ bad1 ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing strtok : \ n " ; <nl> - assert_html_safe ( strtok ( $ good1 , " \ n " ) ) ; <nl> - assert_html_safe ( strtok ( " : \ n " ) ) ; <nl> - assert_not_static ( strtok ( $ good1 , " \ n " ) ) ; <nl> - assert_not_static ( strtok ( " : \ n " ) ) ; <nl> - <nl> - assert_html_unsafe ( strtok ( $ bad1 , " \ n " ) ) ; <nl> - assert_html_unsafe ( strtok ( " : \ n " ) ) ; <nl> - assert_not_static ( strtok ( $ bad1 , " \ n " ) ) ; <nl> - assert_not_static ( strtok ( " : \ n " ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing str_replace : \ n " ; <nl> - assert_html_safe ( str_replace ( $ good3 , $ good2 , $ good1 ) ) ; <nl> - $ arr = array ( $ good1 , $ good2 ) ; <nl> - $ a = str_replace ( $ good3 , $ good2 , $ arr ) ; <nl> - assert_html_safe ( $ a [ 0 ] ) ; <nl> - assert_html_safe ( $ a [ 1 ] ) ; <nl> - <nl> - assert_html_unsafe ( str_replace ( $ good3 , $ bad1 , $ good1 ) ) ; <nl> - $ arr = array ( $ bad1 , $ bad2 ) ; <nl> - $ a = str_replace ( $ good3 , $ good2 , $ arr ) ; <nl> - assert_html_unsafe ( $ a [ 0 ] ) ; <nl> - assert_html_unsafe ( $ a [ 1 ] ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing str_ireplace : \ n " ; <nl> - assert_html_safe ( str_ireplace ( $ good3 , $ good2 , $ good1 ) ) ; <nl> - assert_not_static ( str_ireplace ( $ good3 , $ good2 , $ good1 ) ) ; <nl> - $ arr = array ( $ good1 , $ good2 ) ; <nl> - $ a = str_ireplace ( $ good3 , $ good2 , $ arr ) ; <nl> - assert_html_safe ( $ a [ 0 ] ) ; <nl> - assert_html_safe ( $ a [ 1 ] ) ; <nl> - assert_not_static ( $ a [ 0 ] ) ; <nl> - / / Note : if no replacement occurs , static strings in array remain static . <nl> - assert_static ( $ a [ 1 ] ) ; <nl> - <nl> - assert_html_unsafe ( str_ireplace ( $ good3 , $ bad1 , $ good1 ) ) ; <nl> - assert_not_static ( str_ireplace ( $ good3 , $ bad1 , $ good1 ) ) ; <nl> - $ arr = array ( $ bad1 , $ bad2 ) ; <nl> - $ a = str_ireplace ( $ good3 , $ good2 , $ arr ) ; <nl> - assert_html_unsafe ( $ a [ 0 ] ) ; <nl> - assert_html_unsafe ( $ a [ 1 ] ) ; <nl> - assert_not_static ( $ a [ 0 ] ) ; <nl> - assert_not_static ( $ a [ 1 ] ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing substr_replace : \ n " ; <nl> - assert_html_safe ( substr_replace ( $ good1 , $ good2 , 0 , 3 ) ) ; <nl> - assert_html_safe ( substr_replace ( $ good1 , $ good2 , 0 ) ) ; <nl> - assert_html_unsafe ( substr_replace ( $ bad1 , $ good1 , 0 , 3 ) ) ; <nl> - assert_html_unsafe ( substr_replace ( $ bad1 , $ good1 , 0 ) ) ; <nl> - assert_html_unsafe ( substr_replace ( $ good1 , $ bad1 , 0 , 3 ) ) ; <nl> - assert_html_unsafe ( substr_replace ( $ good1 , $ bad1 , 0 ) ) ; <nl> - assert_html_unsafe ( substr_replace ( $ bad1 , $ bad2 , 0 , 3 ) ) ; <nl> - assert_html_unsafe ( substr_replace ( $ bad1 , $ bad2 , 0 ) ) ; <nl> - <nl> - assert_not_static ( substr_replace ( $ good1 , $ good2 , 0 , 3 ) ) ; <nl> - assert_not_static ( substr_replace ( $ good1 , $ good2 , 0 ) ) ; <nl> - assert_not_static ( substr_replace ( $ bad1 , $ good1 , 0 , 3 ) ) ; <nl> - assert_not_static ( substr_replace ( $ bad1 , $ good1 , 0 ) ) ; <nl> - assert_not_static ( substr_replace ( $ good1 , $ bad1 , 0 , 3 ) ) ; <nl> - assert_not_static ( substr_replace ( $ good1 , $ bad1 , 0 ) ) ; <nl> - assert_not_static ( substr_replace ( $ bad1 , $ bad2 , 0 , 3 ) ) ; <nl> - assert_not_static ( substr_replace ( $ bad1 , $ bad2 , 0 ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing substr : \ n " ; <nl> - assert_html_safe ( substr ( $ good1 , 5 , 5 ) ) ; <nl> - assert_html_unsafe ( substr ( $ bad1 , 5 , 5 ) ) ; <nl> - assert_not_static ( substr ( $ good1 , 5 , 5 ) ) ; <nl> - assert_not_static ( substr ( $ bad1 , 5 , 5 ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing str_pad : \ n " ; <nl> - assert_html_safe ( str_pad ( $ good1 , 5 , $ good2 ) ) ; <nl> - assert_html_unsafe ( str_pad ( $ bad1 , 5 , $ good1 ) ) ; <nl> - assert_html_unsafe ( str_pad ( $ good1 , 5 , $ bad1 ) ) ; <nl> - assert_html_unsafe ( str_pad ( $ bad1 , 5 , $ bad2 ) ) ; <nl> - assert_not_static ( str_pad ( $ good1 , 5 , $ good2 ) ) ; <nl> - assert_not_static ( str_pad ( $ bad1 , 5 , $ good1 ) ) ; <nl> - assert_not_static ( str_pad ( $ good1 , 5 , $ bad1 ) ) ; <nl> - assert_not_static ( str_pad ( $ bad1 , 5 , $ bad2 ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing str_repeat : \ n " ; <nl> - assert_html_safe ( str_repeat ( $ good1 , 5 ) ) ; <nl> - assert_html_unsafe ( str_repeat ( $ bad1 , 13 ) ) ; <nl> - assert_static ( str_repeat ( $ good1 , 5 ) ) ; <nl> - assert_not_static ( str_repeat ( $ bad1 , 13 ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing wordwrap : \ n " ; <nl> - assert_html_safe ( wordwrap ( $ good1 , 5 , $ good2 , true ) ) ; <nl> - assert_html_unsafe ( wordwrap ( $ bad1 , 5 , $ good1 , true ) ) ; <nl> - assert_html_unsafe ( wordwrap ( $ good1 , 5 , $ bad1 , true ) ) ; <nl> - assert_html_unsafe ( wordwrap ( $ bad1 , 5 , $ bad2 , true ) ) ; <nl> - assert_not_static ( wordwrap ( $ good1 , 5 , $ good2 , true ) ) ; <nl> - assert_not_static ( wordwrap ( $ bad1 , 5 , $ good1 , true ) ) ; <nl> - assert_not_static ( wordwrap ( $ good1 , 5 , $ bad1 , true ) ) ; <nl> - assert_not_static ( wordwrap ( $ bad1 , 5 , $ bad2 , true ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing crc32 : \ n " ; <nl> - assert_html_safe ( crc32 ( $ good1 ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing print_r : \ n " ; <nl> - $ arr = array ( $ good1 , $ good2 ) ; <nl> - $ x = print_r ( $ arr , true ) ; <nl> - assert_html_safe ( $ x ) ; <nl> - assert_not_static ( $ x ) ; <nl> - $ arr = array ( $ good1 , $ bad1 ) ; <nl> - $ x = print_r ( $ arr , true ) ; <nl> - assert_html_unsafe ( $ x ) ; <nl> - assert_not_static ( $ x ) ; <nl> deleted file mode 100644 <nl> index bbd0a26b8e4 . . 00000000000 <nl> mmm a / src / test / tainting / core / variable . php <nl> ppp / dev / null <nl> <nl> - < ? php <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - require_once ( ' . . / setup . inc ' ) ; <nl> - <nl> - / * * <nl> - * Taint tests for functions defined in variable . idl . php <nl> - * <nl> - * - Please keep these tests in the same order as the function declarations in <nl> - * the idl files . <nl> - * - Please make sure to test both cases , where a tainted result is expected <nl> - * as well as where an untainted result is expected . <nl> - * / <nl> - <nl> - echo " Testing strval : \ n " ; <nl> - assert_html_safe ( strval ( $ good1 ) ) ; <nl> - assert_html_unsafe ( strval ( $ bad1 ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing var_export : \ n " ; <nl> - $ a = var_export ( $ good1 , true ) ; <nl> - assert_html_safe ( $ a ) ; <nl> - <nl> - ob_start ( ) ; <nl> - var_export ( $ good1 ) ; <nl> - $ a = ob_get_clean ( ) ; <nl> - assert_html_safe ( $ a ) ; <nl> - <nl> - $ a = var_export ( $ bad1 , true ) ; <nl> - assert_html_unsafe ( $ a ) ; <nl> - <nl> - ob_start ( ) ; <nl> - var_export ( $ bad1 ) ; <nl> - $ a = ob_get_clean ( ) ; <nl> - assert_html_unsafe ( $ a ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing var_dump : \ n " ; <nl> - ob_start ( ) ; <nl> - var_dump ( $ good1 ) ; <nl> - $ a = ob_get_clean ( ) ; <nl> - assert_html_safe ( $ a ) ; <nl> - <nl> - ob_start ( ) ; <nl> - var_dump ( $ bad1 ) ; <nl> - $ a = ob_get_clean ( ) ; <nl> - assert_html_unsafe ( $ a ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing debug_zval_dump : \ n " ; <nl> - ob_start ( ) ; <nl> - debug_zval_dump ( $ good1 ) ; <nl> - $ a = ob_get_clean ( ) ; <nl> - assert_html_safe ( $ a ) ; <nl> - <nl> - ob_start ( ) ; <nl> - debug_zval_dump ( $ bad1 ) ; <nl> - $ a = ob_get_clean ( ) ; <nl> - assert_html_unsafe ( $ a ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing serialize : \ n " ; <nl> - assert_html_safe ( serialize ( $ good1 ) ) ; <nl> - assert_html_unsafe ( serialize ( $ bad1 ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing unserialize : \ n " ; <nl> - assert_html_safe ( unserialize ( $ serialized_good ) ) ; <nl> - assert_html_unsafe ( unserialize ( $ serialized_bad ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing get_defined_vars : \ n " ; <nl> - $ arr = get_defined_vars ( ) ; <nl> - assert_html_safe ( $ arr [ ' good1 ' ] ) ; <nl> - assert_html_unsafe ( $ arr [ ' bad1 ' ] ) ; <nl> - <nl> - / / Note : import_request_variables is not supported in hphp <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing extract : \ n " ; <nl> - $ arr = array ( <nl> - ' good1 ' = > $ good1 , <nl> - ' bad1 ' = > $ bad1 , <nl> - ) ; <nl> - extract ( $ arr , EXTR_PREFIX_ALL , ' extract ' ) ; <nl> - assert_html_safe ( $ extract_good1 ) ; <nl> - assert_html_unsafe ( $ extract_bad1 ) ; <nl> deleted file mode 100644 <nl> index 5915389cefa . . 00000000000 <nl> mmm a / src / test / tainting / print_r_06 . php <nl> ppp / dev / null <nl> <nl> - < ? php <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - require_once ( ' setup . inc ' ) ; <nl> - <nl> - $ a = " bad \ n " ; <nl> - fb_set_taint ( $ a , TAINT_ALL_MASK ) ; <nl> - <nl> - print_r ( $ a ) ; <nl> - <nl> - $ b = array ( $ a ) ; <nl> - <nl> - print_r ( $ b ) ; <nl> - <nl> deleted file mode 100644 <nl> index fda89e859be . . 00000000000 <nl> mmm a / src / test / tainting / print_r_06 . php . exp <nl> ppp / dev / null <nl> <nl> - <nl> - HipHop Warning : Echoing a tainted string : <nl> - the originally tainted string was : ' bad <nl> - ' <nl> - it was tainted at : <nl> - # 0 fb_set_taint ( ) , called at [ / data / users / amenghra / hphp / hphp / src / test / tainting / print_r_06 . php : 20 ] <nl> - # 1 include ( ) , called at [ hphpi . php : 5 ] <nl> - it was successively modified at : <nl> - # 0 print_r ( ) , called at [ / data / users / amenghra / hphp / hphp / src / test / tainting / print_r_06 . php : 22 ] <nl> - # 1 include ( ) , called at [ hphpi . php : 5 ] <nl> - mmm <nl> - # 0 print_r ( ) , called at [ / data / users / amenghra / hphp / hphp / src / test / tainting / print_r_06 . php : 22 ] <nl> - # 1 include ( ) , called at [ hphpi . php : 5 ] <nl> - mmm <nl> - it was echoed at : <nl> - # 0 print_r ( ) , called at [ / data / users / amenghra / hphp / hphp / src / test / tainting / print_r_06 . php : 22 ] <nl> - # 1 include ( ) , called at [ hphpi . php : 5 ] <nl> - the echoed string is : ' bad <nl> - ' <nl> - <nl> - [ end of the echoed string ] <nl> - <nl> - <nl> - bad <nl> - <nl> - HipHop Warning : Echoing a tainted string : <nl> - the originally tainted string was : ' bad <nl> - ' <nl> - it was tainted at : <nl> - # 0 fb_set_taint ( ) , called at [ / data / users / amenghra / hphp / hphp / src / test / tainting / print_r_06 . php : 20 ] <nl> - # 1 include ( ) , called at [ hphpi . php : 5 ] <nl> - it was successively modified at : <nl> - # 0 print_r ( ) , called at [ / data / users / amenghra / hphp / hphp / src / test / tainting / print_r_06 . php : 26 ] <nl> - # 1 include ( ) , called at [ hphpi . php : 5 ] <nl> - mmm <nl> - # 0 print_r ( ) , called at [ / data / users / amenghra / hphp / hphp / src / test / tainting / print_r_06 . php : 26 ] <nl> - # 1 include ( ) , called at [ hphpi . php : 5 ] <nl> - mmm <nl> - it was echoed at : <nl> - # 0 print_r ( ) , called at [ / data / users / amenghra / hphp / hphp / src / test / tainting / print_r_06 . php : 26 ] <nl> - # 1 include ( ) , called at [ hphpi . php : 5 ] <nl> - the echoed string is : ' Array <nl> - ( <nl> - [ 0 ] = > bad <nl> - <nl> - ) <nl> - ' <nl> - <nl> - [ end of the echoed string ] <nl> - <nl> - <nl> - Array <nl> - <nl> - ( <nl> - <nl> - [ 0 ] = > bad <nl> - <nl> - <nl> - <nl> - ) <nl> deleted file mode 100755 <nl> index 1b8f4b5b899 . . 00000000000 <nl> mmm a / src / test / tainting / run_tests . sh <nl> ppp / dev / null <nl> <nl> - # ! / bin / sh <nl> - # <nl> - test_files = ` ls $ HPHP_HOME / src / test / tainting / * . php ` <nl> - for i in $ test_files <nl> - do <nl> - echo " Testing file $ i : " <nl> - $ HPHP_HOME / src / hphpi / hphpi - f $ i | pretty | diff $ i . exp - <nl> - done <nl> - echo ' If you have seen some diffs , then something is wrong ' <nl> deleted file mode 100644 <nl> index 4a0176b2c63 . . 00000000000 <nl> mmm a / src / test / tainting / setup . inc <nl> ppp / dev / null <nl> <nl> - < ? php <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - <nl> - $ good1 = " heLlO \ nwoRld \ ntoto \ ntiti \ ntata " ; <nl> - $ good2 = " world " ; <nl> - $ good3 = " toto " ; <nl> - $ serialized_good = ' s : 5 : " hello " ; ' ; <nl> - <nl> - $ bad1 = " eViL \ nsTring \ nare \ tfun \ narent \ tthey ? " ; <nl> - $ bad2 = " some \ nthing \ ntoto \ nbad ! " ; <nl> - $ serialized_bad = ' s : 11 : " evil string " ; ' ; <nl> - <nl> - fb_set_taint ( $ bad1 , TAINT_ALL ) ; <nl> - fb_set_taint ( $ bad2 , TAINT_ALL ) ; <nl> - fb_set_taint ( $ serialized_bad , TAINT_ALL ) ; <nl> - <nl> - function assert_positive ( $ v , $ taint ) { <nl> - if ( ob_get_level ( ) ) { <nl> - die ( " Error : may not call assert_negative ( ) inside ob_start ( ) \ n " ) ; <nl> - } <nl> - <nl> - if ( ! fb_get_taint ( $ v , $ taint ) ) { <nl> - echo chr ( 27 ) . " [ 0 ; 32m " ; <nl> - echo " OK \ n " ; <nl> - echo chr ( 27 ) . " [ 0m " ; <nl> - } else { <nl> - echo chr ( 27 ) . " [ 0 ; 31m " ; <nl> - echo " FAIL \ n " ; <nl> - echo chr ( 27 ) . " [ 0m " ; <nl> - } <nl> - } <nl> - <nl> - function assert_negative ( $ v , $ taint ) { <nl> - if ( ob_get_level ( ) ) { <nl> - die ( " Error : may not call assert_positive ( ) inside ob_start ( ) \ n " ) ; <nl> - } <nl> - <nl> - if ( fb_get_taint ( $ v , $ taint ) ) { <nl> - echo chr ( 27 ) . " [ 0 ; 32m " ; <nl> - echo " OK \ n " ; <nl> - echo chr ( 27 ) . " [ 0m " ; <nl> - } else { <nl> - echo chr ( 27 ) . " [ 0 ; 31m " ; <nl> - echo " FAIL \ n " ; <nl> - echo chr ( 27 ) . " [ 0m " ; <nl> - } <nl> - } <nl> - <nl> - function assert_not_tainted ( $ v ) { <nl> - return assert_positive ( $ v , TAINT_ALL ) ; <nl> - } <nl> - function assert_html_safe ( $ v ) { <nl> - return assert_positive ( $ v , TAINT_HTML ) ; <nl> - } <nl> - function assert_sql_safe ( $ v ) { <nl> - return assert_positive ( $ v , TAINT_SQL ) ; <nl> - } <nl> - function assert_static ( $ v ) { <nl> - return assert_positive ( $ v , TAINT_MUTATED ) ; <nl> - } <nl> - <nl> - function assert_tainted ( $ v ) { <nl> - return assert_negative ( $ v , TAINT_ALL ) ; <nl> - } <nl> - function assert_html_unsafe ( $ v ) { <nl> - return assert_negative ( $ v , TAINT_HTML ) ; <nl> - } <nl> - function assert_sql_unsafe ( $ v ) { <nl> - return assert_negative ( $ v , TAINT_SQL ) ; <nl> - } <nl> - function assert_not_static ( $ v ) { <nl> - return assert_negative ( $ v , TAINT_MUTATED ) ; <nl> - } <nl> deleted file mode 100644 <nl> index 1d1165de4bd . . 00000000000 <nl> mmm a / src / test / tainting / static / static_concat . php <nl> ppp / dev / null <nl> <nl> - < ? php <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - require_once ( ' . . / setup . inc ' ) ; <nl> - <nl> - / * * <nl> - * Check that basic concatenations deal with static - ness correctly . <nl> - * / <nl> - <nl> - echo " Testing literals : \ n " ; <nl> - if ( fb_get_taint ( " heLlO \ nwoRld \ ntoto \ ntiti \ ntata " , TAINT_MUTATED ) ) { <nl> - echo chr ( 27 ) . " [ 0 ; 31m " ; <nl> - echo " FAIL \ n " ; <nl> - echo chr ( 27 ) . " [ 0m " ; <nl> - } else { <nl> - echo chr ( 27 ) . " [ 0 ; 32m " ; <nl> - echo " OK \ n " ; <nl> - echo chr ( 27 ) . " [ 0m " ; <nl> - } <nl> - if ( fb_get_taint ( " heLlO \ nwoRld \ ntoto \ ntiti \ ntata " . " world " , TAINT_MUTATED ) ) { <nl> - echo chr ( 27 ) . " [ 0 ; 31m " ; <nl> - echo " FAIL \ n " ; <nl> - echo chr ( 27 ) . " [ 0m " ; <nl> - } else { <nl> - echo chr ( 27 ) . " [ 0 ; 32m " ; <nl> - echo " OK \ n " ; <nl> - echo chr ( 27 ) . " [ 0m " ; <nl> - } <nl> - if ( fb_get_taint ( " heLlO \ nwoRld \ ntoto \ ntiti \ ntata " . " world " . " toto " , <nl> - TAINT_MUTATED ) ) { <nl> - echo chr ( 27 ) . " [ 0 ; 31m " ; <nl> - echo " FAIL \ n " ; <nl> - echo chr ( 27 ) . " [ 0m " ; <nl> - } else { <nl> - echo chr ( 27 ) . " [ 0 ; 32m " ; <nl> - echo " OK \ n " ; <nl> - echo chr ( 27 ) . " [ 0m " ; <nl> - } <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing passed literals : \ n " ; <nl> - assert_static ( " heLlO \ nwoRld \ ntoto \ ntiti \ ntata " ) ; <nl> - assert_static ( " heLlO \ nwoRld \ ntoto \ ntiti \ ntata " . " world " ) ; <nl> - assert_static ( " heLlO \ nwoRld \ ntoto \ ntiti \ ntata " . " world " . " toto " ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing assigned literals : \ n " ; <nl> - assert_static ( $ good1 ) ; <nl> - assert_static ( $ good1 . $ good2 ) ; <nl> - assert_not_static ( $ bad1 ) ; <nl> - assert_not_static ( $ bad1 . $ good2 ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing in - quote concat : \ n " ; <nl> - assert_static ( " $ good1 " ) ; <nl> - assert_static ( " $ good1 $ good2 " ) ; <nl> - assert_not_static ( " $ bad1 " ) ; <nl> - assert_not_static ( " $ bad1 $ good2 " ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing assignment : \ n " ; <nl> - $ a = $ good1 ; <nl> - assert_static ( $ a ) ; <nl> - $ a . = $ good2 ; <nl> - assert_static ( $ a ) ; <nl> - $ a . = $ good2 . $ good3 ; <nl> - assert_static ( $ a ) ; <nl> - $ a = $ bad1 ; <nl> - assert_not_static ( $ a ) ; <nl> - $ a . = $ good2 ; <nl> - assert_not_static ( $ a ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing global constants : \ n " ; <nl> - define ( ' CONSTANT ' , ' constant ' ) ; <nl> - assert_static ( CONSTANT ) ; <nl> - assert_static ( $ good1 . CONSTANT ) ; <nl> - assert_not_static ( $ bad1 . CONSTANT ) ; <nl> - <nl> - function wrap_concat ( $ a , $ b ) { <nl> - return $ a . $ b ; <nl> - } <nl> - function wrap_concat_with_local ( $ b ) { <nl> - $ a = " local " ; <nl> - return $ a . $ b ; <nl> - } <nl> - function wrap_concat_with_bad_local ( $ b ) { <nl> - global $ bad2 ; <nl> - $ a = $ bad2 ; <nl> - return $ a . $ b ; <nl> - } <nl> - echo " \ n " ; <nl> - echo " Testing function - wrapped concat : \ n " ; <nl> - assert_static ( wrap_concat ( " heLlO \ nwoRld \ ntoto \ ntiti \ ntata " , " world " ) ) ; <nl> - assert_static ( wrap_concat ( $ good1 , $ good2 ) ) ; <nl> - assert_static ( wrap_concat_with_local ( $ good1 ) ) ; <nl> - assert_not_static ( wrap_concat_with_bad_local ( $ good1 ) ) ; <nl> - assert_not_static ( wrap_concat ( $ good1 , $ bad2 ) ) ; <nl> - assert_not_static ( wrap_concat_with_local ( $ bad1 ) ) ; <nl> - <nl> - class StaticConcat { <nl> - const SC_CONST = " constant " ; <nl> - public $ sc_prop ; <nl> - <nl> - function __construct ( ) { <nl> - $ this - > sc_prop = " property " ; <nl> - } <nl> - <nl> - public function concatWithConstant ( $ str ) { <nl> - return $ str . self : : SC_CONST ; <nl> - } <nl> - <nl> - public function concatWithProperty ( $ str ) { <nl> - return $ str . $ this - > sc_prop ; <nl> - } <nl> - } <nl> - echo " \ n " ; <nl> - echo " Testing class - wrapped concat : \ n " ; <nl> - assert_static ( $ good1 . StaticConcat : : SC_CONST ) ; <nl> - $ sc = new StaticConcat ( ) ; <nl> - assert_static ( $ sc - > concatWithConstant ( $ good1 ) ) ; <nl> - assert_static ( $ good1 . $ sc - > sc_prop ) ; <nl> - assert_static ( $ sc - > concatWithProperty ( $ good1 ) ) ; <nl> - <nl> - echo " \ n " ; <nl> - echo " Testing concat with other types : \ n " ; <nl> - assert_static ( $ good1 . NULL ) ; <nl> - assert_static ( $ good1 . true ) ; <nl> - assert_static ( $ good1 . false ) ; <nl> - assert_not_static ( $ good1 . 42 ) ; <nl> - assert_not_static ( $ good1 . 3 . 1415926535897 ) ; <nl> deleted file mode 100644 <nl> index 21aa3af1cfb . . 00000000000 <nl> mmm a / src / test / tainting / static / static_typecast . php <nl> ppp / dev / null <nl> <nl> - < ? php <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - require_once ( ' . . / setup . inc ' ) ; <nl> - <nl> - / * * <nl> - * Check that fb_is_static_string works correctly on various static values <nl> - * cast to strings . Currently : <nl> - * - all numeric values ( ints , doubles ) are by default non - static ( see <nl> - * constructors in runtime / base / type_string . cpp ) <nl> - * - bools and NULL are static ( N . B . : this is done because when implicitly <nl> - * typecast in HPHP , bools and NULL are converted to global string <nl> - * constants , and tainting these constants could have undesired side - <nl> - * effects ) <nl> - * - HPHP casts all arrays to the string " Array " ; this is considered <nl> - * static <nl> - * - values in an array are static or non - static ( or , in general , tainted <nl> - * or not tainted ) independent of other values <nl> - * - whether an object is cast to a static string depends on whether its <nl> - * __toString ( ) method returns a static string <nl> - * / <nl> - <nl> - echo " Testing string literal : " ; <nl> - if ( fb_get_taint ( " str " , TAINT_MUTATED ) ) { <nl> - echo chr ( 27 ) . " [ 0 ; 31m " ; <nl> - echo " FAIL \ n " ; <nl> - echo chr ( 27 ) . " [ 0m " ; <nl> - } else { <nl> - echo chr ( 27 ) . " [ 0 ; 32m " ; <nl> - echo " OK \ n " ; <nl> - echo chr ( 27 ) . " [ 0m " ; <nl> - } <nl> - <nl> - $ str = " str " ; <nl> - echo " Testing static string variable : " ; <nl> - assert_static ( $ str ) ; <nl> - <nl> - echo " Testing NULL : " ; <nl> - assert_static ( NULL ) ; <nl> - <nl> - echo " Testing true : " ; <nl> - assert_static ( true ) ; <nl> - echo " Testing false : " ; <nl> - assert_static ( false ) ; <nl> - <nl> - echo " Testing int : " ; <nl> - assert_not_static ( 42 ) ; <nl> - <nl> - echo " Testing double : " ; <nl> - assert_not_static ( 3 . 1415926535897 ) ; <nl> - <nl> - $ array = array ( <nl> - ' str ' = > 42 , <nl> - 42 = > ' str ' , <nl> - 1 = > true , <nl> - ) ; <nl> - echo " Testing array . . . \ n " ; <nl> - echo " int value : " ; <nl> - assert_not_static ( $ array [ ' str ' ] ) ; <nl> - echo " string value : " ; <nl> - assert_static ( $ array [ 42 ] ) ; <nl> - echo " bool value : " ; <nl> - assert_static ( $ array [ 1 ] ) ; <nl> - echo " typecast as string : " ; <nl> - assert_static ( $ array ) ; <nl> - <nl> - class ObjToStringLiteral { <nl> - function __toString ( ) { return " obj " ; } <nl> - } <nl> - class ObjToStringNonliteral { <nl> - function __toString ( ) { <nl> - global $ bad1 ; <nl> - return " obj " . $ bad1 ; <nl> - } <nl> - } <nl> - echo " Testing object . . . \ n " ; <nl> - $ obj1 = new ObjToStringLiteral ( ) ; <nl> - echo " cast as literal : " ; <nl> - assert_static ( $ obj1 ) ; <nl> - $ obj2 = new ObjToStringNonliteral ( ) ; <nl> - echo " cast as nonliteral : " ; <nl> - assert_not_static ( $ obj2 ) ; <nl> mmm a / src / test / test_code_run . cpp <nl> ppp b / src / test / test_code_run . cpp <nl> bool TestCodeRun : : RunTests ( const std : : string & which ) { <nl> / / HipHop features <nl> RUN_TEST ( TestYield ) ; <nl> RUN_TEST ( TestHint ) ; <nl> + # ifdef TAINTED <nl> + RUN_TEST ( TestTaint ) ; <nl> + # endif <nl> <nl> RUN_TEST ( TestAdHoc ) ; <nl> return ret ; <nl> bool TestCodeRun : : TestHint ( ) { <nl> return true ; <nl> } <nl> <nl> + # ifdef TAINTED <nl> + bool TestCodeRun : : TestTaint ( ) { <nl> + WithOpt w ( Option : : EnableHipHopSyntax ) ; <nl> + <nl> + / / NB : We reconstruct our starting strings in a loop since hphpc implements <nl> + / / copy - on - write ( at least with literals ) , so tainting any string assigned <nl> + / / to our literal would taint them all ( including the literal itself ) . In <nl> + / / practice , since we only taint new StringData objects , this quirk is <nl> + / / harmless ( and is secure , since it would only generate false positives ) . <nl> + <nl> + / / Literals and assignments <nl> + MVCRO ( " < ? php \ n " <nl> + " var_dump ( fb_get_taint ( ' foostr ' , TAINT_ALL ) ) ; \ n " <nl> + " $ a = ' foostr ' ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ b = $ a ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " , <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " ) ; <nl> + <nl> + / / Clean concatenations <nl> + MVCRO ( " < ? php \ n " <nl> + " $ tmp = ' foo ' ; \ n " <nl> + " $ a = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ a . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = ' str ' ; \ n " <nl> + " $ b = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ b . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " $ c = ' foo ' . ' str ' ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = ' foo ' . $ b ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = $ a . ' str ' ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = $ a . $ b ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = ' ' ; \ n " <nl> + " $ c . = ' foostr ' ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = ' ' ; \ n " <nl> + " $ c . = $ a ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " , <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " ) ; <nl> + <nl> + / / Taint propagation in concatenations <nl> + MVCRO ( " < ? php \ n " <nl> + " $ tmp = \ " heLlO \ \ nwoRld \ \ ntoto \ \ ntiti \ \ ntata \ " ; \ n " <nl> + " $ good1 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ good1 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = ' world ' ; \ n " <nl> + " $ good2 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ good2 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = \ " eViL \ \ nsTring \ \ nare \ \ tfun \ \ narent \ \ tthey ? \ " ; \ n " <nl> + " $ bad1 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ bad1 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = ' blurf ' ; \ n " <nl> + " $ bad2 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ bad2 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " fb_set_taint ( $ bad1 , TAINT_ALL ) ; \ n " <nl> + " fb_set_taint ( $ bad2 , TAINT_ALL ) ; \ n " <nl> + " $ a = $ good1 . $ good2 ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = $ good1 . $ bad1 ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = $ bad1 . $ good1 ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = $ bad1 . $ bad2 ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = $ good1 ; \ n " <nl> + " $ a . = $ good2 ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = $ good1 ; \ n " <nl> + " $ a . = $ bad1 ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = $ bad1 ; \ n " <nl> + " $ a . = $ good1 ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = $ bad1 ; \ n " <nl> + " $ a . = $ bad2 ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = \ " $ good1 $ good2 \ " ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = \ " $ good1 $ bad1 \ " ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = \ " $ bad1 $ good1 \ " ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = \ " $ bad1 $ bad2 \ " ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " , <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " ) ; <nl> + <nl> + / / Long concatenations <nl> + MVCRO ( " < ? php \ n " <nl> + " $ tmp = ' foostr ' ; \ n " <nl> + " $ a = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ a . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = ' badstr ' ; \ n " <nl> + " $ b = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ b . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " fb_set_taint ( $ b , TAINT_ALL ) ; \ n " <nl> + " $ c = $ a . $ b ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = $ b . $ a . $ a ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = $ a . $ b . $ a ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = $ a . $ a . $ b ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = $ a . $ a . $ a . $ b ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = $ a . $ a . $ a . $ a . $ b ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = $ a . $ a . $ a . $ a . $ a . $ b ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = $ a . $ a . $ a . $ a . $ a . $ a . $ b ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = $ a . $ a . $ a . $ a . $ a . $ a . $ a . $ b ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = $ a . $ a . $ b . $ a . $ a . $ a . $ a . $ a ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = \ " $ a $ b \ " ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = \ " $ b $ a $ a \ " ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = \ " $ a $ b $ a \ " ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = \ " $ a $ a $ b \ " ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = \ " $ a $ a $ a $ b \ " ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = \ " $ a $ a $ a $ a $ b \ " ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = \ " $ a $ a $ a $ a $ a $ b \ " ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = \ " $ a $ a $ a $ a $ a $ a $ b \ " ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = \ " $ a $ a $ a $ a $ a $ a $ a $ b \ " ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ c = \ " $ a $ a $ b $ a $ a $ a $ a $ a \ " ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " , <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " ) ; <nl> + <nl> + / / Complex concatenations ( adapted from TestString ) <nl> + MVCRO ( " < ? php \ n " <nl> + " $ a = array ( ' x ' = > ' foo ' ) ; \ n " <nl> + " $ tmp = ' qqq ' ; \ n " <nl> + " $ b = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ b . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " class c { } \ n " <nl> + " $ c = new c ; \ n " <nl> + " $ c - > p = ' zzz ' ; \ n " <nl> + " var_dump ( fb_get_taint ( \ " AAA $ { a [ ' x ' ] } $ a [ x ] $ b $ c - > p \ " , TAINT_ALL ) ) ; \ n " <nl> + " fb_set_taint ( $ b , TAINT_ALL ) ; \ n " <nl> + " var_dump ( fb_get_taint ( \ " AAA $ { a [ ' x ' ] } $ a [ x ] $ b $ c - > p \ " , TAINT_ALL ) ) ; \ n " <nl> + " class X { \ n " <nl> + " static function g ( ) { } \ n " <nl> + " } ; \ n " <nl> + " $ tmp = ' efg ' ; \ n " <nl> + " $ a = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ a . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " $ b = rand ( ) % 42 ; \ n " <nl> + " var_dump ( fb_get_taint ( ' abc ' . X : : g ( ) . $ b . $ a , TAINT_ALL ) ) ; \ n " <nl> + " fb_set_taint ( $ a , TAINT_ALL ) ; \ n " <nl> + " var_dump ( fb_get_taint ( ' abc ' . X : : g ( ) . 42 . $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( ' abc ' . X : : g ( ) . $ b . $ a , TAINT_ALL ) ) ; \ n " <nl> + " function f ( ) { \ n " <nl> + " $ tmp = ' x ' ; \ n " <nl> + " $ a = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ a . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " fb_set_taint ( $ a , TAINT_ALL ) ; \ n " <nl> + " return $ a ; \ n " <nl> + " } \ n " <nl> + " function g ( ) { } \ n " <nl> + " function test1 ( $ a ) { \ n " <nl> + " $ buf = ' ' ; \ n " <nl> + " foreach ( $ a as $ s ) { \ n " <nl> + " $ buf . = f ( ) . g ( ) . ' h ' . f ( ) . ' h ' . g ( ) ; \ n " <nl> + " } \ n " <nl> + " foreach ( $ a as $ s ) { \ n " <nl> + " $ buf . = ( $ s . ' h ' . $ s ) ; \ n " <nl> + " } \ n " <nl> + " return $ buf ; \ n " <nl> + " } \ n " <nl> + " var_dump ( fb_get_taint ( test1 ( array ( 1 ) ) , TAINT_ALL ) ) ; \ n " <nl> + " function test2 ( ) { \ n " <nl> + " return f ( ) . g ( ) . f ( ) . g ( ) ; \ n " <nl> + " } \ n " <nl> + " var_dump ( fb_get_taint ( test2 ( ) , TAINT_ALL ) ) ; \ n " <nl> + " function test3 ( ) { \ n " <nl> + " return f ( ) . g ( ) . f ( ) . g ( ) . f ( ) . g ( ) . f ( ) . g ( ) . f ( ) ; \ n " <nl> + " } \ n " <nl> + " var_dump ( fb_get_taint ( test3 ( ) , TAINT_ALL ) ) ; \ n " <nl> + " function test4 ( ) { \ n " <nl> + " $ s = f ( ) ; \ n " <nl> + " $ s . = \ n " <nl> + " ( ' foo ' . \ n " <nl> + " ' bar ' . \ n " <nl> + " f ( ) . \ n " <nl> + " ' foo ' . \ n " <nl> + " ' baz ' . \ n " <nl> + " f ( ) . \ n " <nl> + " ' fuz ' . \ n " <nl> + " ' boo ' . \ n " <nl> + " f ( ) . \ n " <nl> + " ' fiz ' . \ n " <nl> + " ' faz ' ) ; \ n " <nl> + " $ s . = f ( ) ; \ n " <nl> + " return $ s ; \ n " <nl> + " } \ n " <nl> + " var_dump ( fb_get_taint ( test4 ( ) , TAINT_ALL ) ) ; \ n " <nl> + " function test6 ( ) { \ n " <nl> + " return g ( ) . f ( ) . g ( ) ; \ n " <nl> + " } \ n " <nl> + " var_dump ( fb_get_taint ( test6 ( ) , TAINT_ALL ) ) ; \ n " , <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " ) ; <nl> + <nl> + / / Taint independence <nl> + MVCRO ( " < ? php \ n " <nl> + " $ tmp = ' foostr ' ; \ n " <nl> + " $ a = ' ' ; \ n " <nl> + " $ b = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ a . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ b . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ c = $ b ; \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " var_dump ( fb_get_taint ( ' foostr ' , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " fb_set_taint ( $ a , TAINT_ALL ) ; \ n " <nl> + " var_dump ( fb_get_taint ( ' foostr ' , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " fb_set_taint ( $ b , TAINT_ALL ) ; \ n " <nl> + " var_dump ( fb_get_taint ( ' foostr ' , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " fb_unset_taint ( $ c , TAINT_ALL ) ; \ n " <nl> + " var_dump ( fb_get_taint ( ' foostr ' , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " $ b . = $ a ; \ n " <nl> + " var_dump ( fb_get_taint ( ' foostr ' , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " if ( $ a = = = $ c ) { \ n " <nl> + " $ b = ' foostr ' ; \ n " <nl> + " } \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + " $ b = & $ c ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + " $ c . = $ a ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " , <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " ) ; <nl> + <nl> + / / Functions and classes <nl> + MVCRO ( " < ? php \ n " <nl> + " $ tmp = ' foostr ' ; \ n " <nl> + " $ a = ' ' ; \ n " <nl> + " $ b = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ a . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ b . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " fb_set_taint ( $ b , TAINT_ALL ) ; \ n " <nl> + " function foo ( $ a , $ b ) { \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + " $ a . = $ b ; \ n " <nl> + " return $ a ; \ n " <nl> + " } \ n " <nl> + " foo ( $ a , $ b ) ; " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + " class Foo { \ n " <nl> + " const FOO = ' foostr ' ; \ n " <nl> + " public $ m_a , $ m_b ; \ n " <nl> + " function __construct ( $ a , $ b ) { \ n " <nl> + " $ this - > m_a = $ a ; \ n " <nl> + " $ this - > m_b = $ b ; \ n " <nl> + " } \ n " <nl> + " function test ( ) { \ n " <nl> + " var_dump ( fb_get_taint ( $ this - > m_a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ this - > m_b , TAINT_ALL ) ) ; \ n " <nl> + " } \ n " <nl> + " } \ n " <nl> + " $ foo = new Foo ( $ a , $ b ) ; \ n " <nl> + " $ foo - > test ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( Foo : : FOO , TAINT_ALL ) ) ; \ n " , <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " ) ; <nl> + <nl> + / / Arrays <nl> + MVCRO ( " < ? php \ n " <nl> + " $ tmp = \ " heLlO \ \ nwoRld \ \ ntoto \ \ ntiti \ \ ntata \ " ; \ n " <nl> + " $ good1 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ good1 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = ' world ' ; \ n " <nl> + " $ good2 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ good2 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = ' toto ' ; \ n " <nl> + " $ good3 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ good3 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = \ " eViL \ \ nsTring \ \ nare \ \ tfun \ \ narent \ \ tthey ? \ " ; \ n " <nl> + " $ bad1 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ bad1 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = \ " some \ \ nthing \ \ ntoto \ \ nbad ! \ " ; \ n " <nl> + " $ bad2 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ bad2 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " fb_set_taint ( $ bad1 , TAINT_ALL ) ; \ n " <nl> + " fb_set_taint ( $ bad2 , TAINT_ALL ) ; \ n " <nl> + " $ arrg = array ( $ good1 ) ; \ n " <nl> + " $ arrb = array ( $ bad1 ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arrg [ 0 ] , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arrb [ 0 ] , TAINT_ALL ) ) ; \ n " <nl> + " $ arr = array ( \ n " <nl> + " $ good1 = > $ good2 , \ n " <nl> + " $ bad1 = > $ bad2 , \ n " <nl> + " $ bad2 = > array ( \ n " <nl> + " $ good2 = > $ bad2 , \ n " <nl> + " $ bad2 = > $ good3 , \ n " <nl> + " ) , \ n " <nl> + " ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( print_r ( $ arr , true ) , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ $ good1 ] , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ $ bad1 ] , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ $ bad2 ] , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( print_r ( $ arr [ 42 ] , true ) , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ $ bad2 ] [ $ good2 ] , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ $ bad2 ] [ $ bad2 ] , TAINT_ALL ) ) ; \ n " <nl> + " $ keys = array_keys ( $ arr ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ keys [ 0 ] , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ keys [ 1 ] , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ keys [ 2 ] , TAINT_ALL ) ) ; \ n " , <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " ) ; <nl> + <nl> + / / Typecasts <nl> + MVCRO ( " < ? php \ n " <nl> + " var_dump ( fb_get_taint ( NULL , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( true , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( false , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( rand ( ) , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( ( rand ( ) / rand ( ) ) , TAINT_ALL ) ) ; \ n " <nl> + " $ a = NULL ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( ( string ) $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = true ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( ( string ) $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = false ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( ( string ) $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = rand ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( ( string ) $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = rand ( ) / rand ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( ( string ) $ a , TAINT_ALL ) ) ; \ n " <nl> + " $ a = rand ( ) ; \ n " <nl> + " $ arr = array ( \ n " <nl> + " ' foostr ' = > rand ( ) , \ n " <nl> + " $ a = > ' barbaz ' , \ n " <nl> + " ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ ' foostr ' ] , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ $ a ] , TAINT_ALL ) ) ; \ n " <nl> + " class CleanObj { \ n " <nl> + " function __toString ( ) { return ' obj ' ; } \ n " <nl> + " } \ n " <nl> + " class TaintedObj { \ n " <nl> + " function __toString ( ) { \ n " <nl> + " $ bad1 = \ " eViL \ \ nsTring \ \ nare \ \ tfun \ \ narent \ \ tthey ? \ " ; \ n " <nl> + " fb_set_taint ( $ bad1 , TAINT_MUTATED ) ; \ n " <nl> + " return ' obj ' . $ bad1 ; \ n " <nl> + " } \ n " <nl> + " } \ n " <nl> + " $ obj1 = new CleanObj ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ obj1 , TAINT_MUTATED ) ) ; \ n " <nl> + " $ obj2 = new TaintedObj ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ obj2 , TAINT_MUTATED ) ) ; \ n " , <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " ) ; <nl> + <nl> + / / Tokens <nl> + MVCRO ( " < ? php \ n " <nl> + " $ tmp = ' foostr ' ; \ n " <nl> + " $ badtok = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ badtok . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " $ $ badtok = ' bleeblooblah ' ; \ n " <nl> + " $ vars = array_keys ( get_defined_vars ( ) , ' bleeblooblah ' ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ vars [ 0 ] , TAINT_ALL ) ) ; \ n " <nl> + " fb_set_taint ( $ badtok , TAINT_ALL ) ; \ n " <nl> + " $ $ badtok = ' bleeblooblah ' ; \ n " <nl> + " $ vars = array_keys ( get_defined_vars ( ) , ' bleeblooblah ' ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ vars [ 0 ] , TAINT_ALL ) ) ; \ n " <nl> + " function foostr ( ) { \ n " <nl> + " var_dump ( fb_get_taint ( __FUNCTION__ , TAINT_ALL ) ) ; \ n " <nl> + " } \ n " <nl> + " foostr ( ) ; \ n " <nl> + " class foostr { \ n " <nl> + " public function __construct ( ) { } \ n " <nl> + " public function foostr ( ) { \ n " <nl> + " var_dump ( fb_get_taint ( __CLASS__ , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( __METHOD__ , TAINT_ALL ) ) ; \ n " <nl> + " } \ n " <nl> + " public static function staticFoostr ( ) { \ n " <nl> + " var_dump ( fb_get_taint ( __CLASS__ , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( __METHOD__ , TAINT_ALL ) ) ; \ n " <nl> + " } \ n " <nl> + " } \ n " <nl> + " $ a = new foostr ( ) ; \ n " <nl> + " $ a - > foostr ( ) ; \ n " <nl> + " foostr : : staticFoostr ( ) ; \ n " , <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " ) ; <nl> + <nl> + / / Closures <nl> + MVCRO ( " < ? php \ n " <nl> + " $ tmp = ' foostr ' ; \ n " <nl> + " $ a = ' ' ; \ n " <nl> + " $ b = ' ' ; \ n " <nl> + " $ c = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ a . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ b . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ c . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " fb_set_taint ( $ b , TAINT_ALL ) ; \ n " <nl> + " $ closure = \ n " <nl> + " function ( $ a ) use ( $ c ) { \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " } ; \ n " <nl> + " $ closure ( $ a ) ; \ n " <nl> + " $ closure ( $ b ) ; \ n " <nl> + " $ closure ( $ c ) ; \ n " <nl> + " fb_set_taint ( $ c , TAINT_ALL ) ; \ n " <nl> + " $ closure = \ n " <nl> + " function ( $ a ) use ( $ c ) { \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " } ; \ n " <nl> + " $ closure ( $ a ) ; \ n " <nl> + " $ closure ( $ b ) ; \ n " <nl> + " $ closure ( $ c ) ; \ n " <nl> + " function make_closure ( $ c ) { \ n " <nl> + " $ closure = \ n " <nl> + " function ( $ a ) use ( $ c ) { \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ c , TAINT_ALL ) ) ; \ n " <nl> + " } ; \ n " <nl> + " return $ closure ; \ n " <nl> + " } \ n " <nl> + " $ closure = make_closure ( $ c ) ; \ n " <nl> + " $ closure ( $ a ) ; \ n " <nl> + " $ closure ( $ b ) ; \ n " <nl> + " $ closure ( $ c ) ; \ n " , <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " ) ; <nl> + <nl> + / / Generators <nl> + MVCRO ( " < ? php \ n " <nl> + " function foo ( $ b ) { \ n " <nl> + " $ tmp = ' foostr ' ; \ n " <nl> + " $ a = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ a . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " fb_set_taint ( $ a , TAINT_ALL ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + " yield fb_get_taint ( $ a , TAINT_ALL ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + " yield fb_get_taint ( $ a , TAINT_ALL ) ; \ n " <nl> + " } \ n " <nl> + " $ tmp = ' foostr ' ; \ n " <nl> + " $ b = ' ' ; \ n " <nl> + " $ c = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ b . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ c . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " fb_set_taint ( $ c , TAINT_ALL ) ; \ n " <nl> + " foreach ( foo ( $ b ) as $ a ) { var_dump ( $ a ) ; } \ n " <nl> + " foreach ( foo ( $ c ) as $ a ) { var_dump ( $ a ) ; } \ n " , <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " ) ; <nl> + <nl> + / / call_user_func * ( ) <nl> + MVCRO ( " < ? php \ n " <nl> + " $ tmp = \ " heLlO \ \ nwoRld \ \ ntoto \ \ ntiti \ \ ntata \ " ; \ n " <nl> + " $ good1 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ good1 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = ' world ' ; \ n " <nl> + " $ good2 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ good2 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = \ " eViL \ \ nsTring \ \ nare \ \ tfun \ \ narent \ \ tthey ? \ " ; \ n " <nl> + " $ bad1 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ bad1 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = \ " some \ \ nthing \ \ ntoto \ \ nbad ! \ " ; \ n " <nl> + " $ bad2 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ bad2 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " fb_set_taint ( $ bad1 , TAINT_ALL ) ; \ n " <nl> + " fb_set_taint ( $ bad2 , TAINT_ALL ) ; \ n " <nl> + / / Ensure that falling into the callback doesn ' t drop taint . <nl> + " function callback_check_propagation ( $ a , $ b ) { \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + " } \ n " <nl> + / / Ensure that the call_user_func * ( ) family is not scoping in any <nl> + / / TaintObservers . To do this check , we do an access on the variable <nl> + / / we ' ve passed in , we create a String object without scoping in new <nl> + / / TaintObservers by making a new variable , then we check that said <nl> + / / variable ' s name is not tainted . <nl> + " function callback_check_independence ( $ a ) { \ n " <nl> + " if ( $ a = = = ' foobarbaz ' ) { \ n " <nl> + " $ var = ' something ' ; \ n " <nl> + " } \ n " <nl> + " var_dump ( fb_get_taint ( $ var , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( \ n " <nl> + " array_keys ( get_defined_vars ( ) , ' something ' ) , \ n " <nl> + " TAINT_ALL \ n " <nl> + " ) ) ; \ n " <nl> + " } \ n " <nl> + " $ arr_good = array ( $ good1 , $ good2 ) ; \ n " <nl> + " $ arr_mixed = array ( $ good1 , $ bad1 ) ; \ n " <nl> + " $ arr_bad = array ( $ bad1 , $ bad2 ) ; \ n " <nl> + " call_user_func ( ' callback_check_propagation ' , $ good1 , $ good2 ) ; \ n " <nl> + " call_user_func ( ' callback_check_propagation ' , $ good1 , $ bad1 ) ; \ n " <nl> + " call_user_func ( ' callback_check_propagation ' , $ bad1 , $ bad2 ) ; \ n " <nl> + " call_user_func_array ( ' callback_check_propagation ' , $ arr_good ) ; \ n " <nl> + " call_user_func_array ( ' callback_check_propagation ' , $ arr_mixed ) ; \ n " <nl> + " call_user_func_array ( ' callback_check_propagation ' , $ arr_bad ) ; \ n " <nl> + " $ a = ' foobarbaz ' ; \ n " <nl> + " fb_set_taint ( $ a , TAINT_ALL ) ; \ n " <nl> + " call_user_func ( ' callback_check_independence ' , $ a ) ; \ n " <nl> + " call_user_func_array ( ' callback_check_independence ' , array ( $ a ) ) ; \ n " , <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " ) ; <nl> + <nl> + / / Output buffers <nl> + MVCRO ( " < ? php \ n " <nl> + " $ tmp = \ " heLlO \ \ nwoRld \ \ ntoto \ \ ntiti \ \ ntata \ " ; \ n " <nl> + " $ good1 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ good1 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = ' world ' ; \ n " <nl> + " $ good2 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ good2 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = \ " eViL \ \ nsTring \ \ nare \ \ tfun \ \ narent \ \ tthey ? \ " ; \ n " <nl> + " $ bad1 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ bad1 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = \ " some \ \ nthing \ \ ntoto \ \ nbad ! \ " ; \ n " <nl> + " $ bad2 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ bad2 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " fb_set_taint ( $ bad1 , TAINT_ALL ) ; \ n " <nl> + " fb_set_taint ( $ bad2 , TAINT_ALL ) ; \ n " <nl> + / / ob_start <nl> + " ob_start ( ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ good1 ; \ n " <nl> + " $ a = ob_get_clean ( ) ; \ n " <nl> + " echo $ a ; \ n " <nl> + " $ b = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ bad1 ; \ n " <nl> + " $ a = ob_get_clean ( ) ; \ n " <nl> + " echo $ a ; \ n " <nl> + " $ b = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + / / ob_clean <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ good1 ; \ n " <nl> + " ob_clean ( ) ; \ n " <nl> + " echo $ good2 ; \ n " <nl> + " var_dump ( fb_get_taint ( ob_get_clean ( ) , TAINT_ALL ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ bad1 ; \ n " <nl> + " ob_clean ( ) ; \ n " <nl> + " echo $ good1 ; \ n " <nl> + " var_dump ( fb_get_taint ( ob_get_clean ( ) , TAINT_ALL ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ good1 ; \ n " <nl> + " ob_clean ( ) ; \ n " <nl> + " echo $ bad1 ; \ n " <nl> + " var_dump ( fb_get_taint ( ob_get_clean ( ) , TAINT_ALL ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ bad1 ; \ n " <nl> + " ob_clean ( ) ; \ n " <nl> + " echo $ bad2 ; \ n " <nl> + " var_dump ( fb_get_taint ( ob_get_clean ( ) , TAINT_ALL ) ) ; \ n " <nl> + / / ob_flush <nl> + " ob_start ( ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ good1 ; \ n " <nl> + " ob_flush ( ) ; \ n " <nl> + " ob_end_clean ( ) ; \ n " <nl> + " $ a = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ bad1 ; \ n " <nl> + " ob_flush ( ) ; \ n " <nl> + " ob_end_clean ( ) ; \ n " <nl> + " $ a = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + / / ob_end_clean <nl> + " ob_start ( ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ good1 ; \ n " <nl> + " ob_end_clean ( ) ; \ n " <nl> + " echo $ good2 ; \ n " <nl> + " var_dump ( fb_get_taint ( ob_get_clean ( ) , TAINT_ALL ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ bad1 ; \ n " <nl> + " ob_end_clean ( ) ; \ n " <nl> + " echo $ good1 ; \ n " <nl> + " var_dump ( fb_get_taint ( ob_get_clean ( ) , TAINT_ALL ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ good1 ; \ n " <nl> + " ob_end_clean ( ) ; \ n " <nl> + " echo $ bad1 ; \ n " <nl> + " var_dump ( fb_get_taint ( ob_get_clean ( ) , TAINT_ALL ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ bad1 ; \ n " <nl> + " ob_end_clean ( ) ; \ n " <nl> + " echo $ bad2 ; \ n " <nl> + " var_dump ( fb_get_taint ( ob_get_clean ( ) , TAINT_ALL ) ) ; \ n " <nl> + / / ob_end_flush <nl> + " ob_start ( ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ good1 ; \ n " <nl> + " ob_end_flush ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( ob_get_clean ( ) , TAINT_ALL ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ bad1 ; \ n " <nl> + " ob_end_flush ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( ob_get_clean ( ) , TAINT_ALL ) ) ; \ n " <nl> + / / ob_get_clean <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ good1 ; \ n " <nl> + " var_dump ( fb_get_taint ( ob_get_clean ( ) , TAINT_ALL ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ bad1 ; \ n " <nl> + " var_dump ( fb_get_taint ( ob_get_clean ( ) , TAINT_ALL ) ) ; \ n " <nl> + / / ob_get_contents <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ good1 ; \ n " <nl> + " $ a = ob_get_contents ( ) ; \ n " <nl> + " ob_end_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ bad1 ; \ n " <nl> + " $ a = ob_get_contents ( ) ; \ n " <nl> + " ob_end_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + / / ob_get_flush <nl> + " ob_start ( ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ good1 ; \ n " <nl> + " $ a = ob_get_flush ( ) ; \ n " <nl> + " ob_end_clean ( ) ; \ n " <nl> + " $ b = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ bad1 ; \ n " <nl> + " $ a = ob_get_flush ( ) ; \ n " <nl> + " ob_end_clean ( ) ; \ n " <nl> + " $ b = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ b , TAINT_ALL ) ) ; \ n " <nl> + / / ob concatenation semantics <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ good1 ; \ n " <nl> + " echo $ good2 ; \ n " <nl> + " $ a = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ good1 ; \ n " <nl> + " echo $ bad1 ; \ n " <nl> + " $ a = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ bad1 ; \ n " <nl> + " echo $ good1 ; \ n " <nl> + " $ a = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " echo $ bad1 ; \ n " <nl> + " echo $ bad2 ; \ n " <nl> + " $ a = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_ALL ) ) ; \ n " , <nl> + / / ob_start <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / ob_clean <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / ob_flush <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / ob_end_clean <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / ob_end_flush <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / ob_get_clean <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / ob_get_contents <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / ob_get_flush <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / ob concatenations semantics <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " ) ; <nl> + <nl> + / / Variable extension functions <nl> + MVCRO ( " < ? php \ n " <nl> + " $ tmp = \ " heLlO \ \ nwoRld \ \ ntoto \ \ ntiti \ \ ntata \ " ; \ n " <nl> + " $ good1 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ good1 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = ' s : 5 : \ " hello \ " ; ' ; \ n " <nl> + " $ serialized_good = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ serialized_good . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = \ " eViL \ \ nsTring \ \ nare \ \ tfun \ \ narent \ \ tthey ? \ " ; \ n " <nl> + " $ bad1 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ bad1 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = ' s : 11 : \ " evil string \ " ; ' ; \ n " <nl> + " $ serialized_bad = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ serialized_bad . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " fb_set_taint ( $ bad1 , TAINT_ALL ) ; \ n " <nl> + " fb_set_taint ( $ serialized_bad , TAINT_ALL ) ; \ n " <nl> + " var_dump ( fb_get_taint ( strval ( $ good1 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( strval ( $ bad1 ) , TAINT_HTML ) ) ; \ n " <nl> + " $ a = var_export ( $ good1 , true ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_HTML ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " var_export ( $ good1 ) ; \ n " <nl> + " $ a = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_HTML ) ) ; \ n " <nl> + " $ a = var_export ( $ bad1 , true ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_HTML ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " var_export ( $ bad1 ) ; \ n " <nl> + " $ a = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_HTML ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " var_dump ( $ good1 ) ; \ n " <nl> + " $ a = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_HTML ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " var_dump ( $ bad1 ) ; \ n " <nl> + " $ a = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_HTML ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " debug_zval_dump ( $ good1 ) ; \ n " <nl> + " $ a = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_HTML ) ) ; \ n " <nl> + " ob_start ( ) ; \ n " <nl> + " debug_zval_dump ( $ bad1 ) ; \ n " <nl> + " $ a = ob_get_clean ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( serialize ( $ good1 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( serialize ( $ bad1 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( unserialize ( $ serialized_good ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( unserialize ( $ serialized_bad ) , TAINT_HTML ) ) ; \ n " <nl> + " $ arr = get_defined_vars ( ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ ' good1 ' ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ ' bad1 ' ] , TAINT_HTML ) ) ; \ n " <nl> + " $ arr = array ( \ n " <nl> + " ' good1 ' = > $ good1 , \ n " <nl> + " ' bad1 ' = > $ bad1 , \ n " <nl> + " ) ; \ n " <nl> + " extract ( $ arr , EXTR_PREFIX_ALL , ' extract ' ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ extract_good1 , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ extract_bad1 , TAINT_HTML ) ) ; \ n " , <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " ) ; <nl> + <nl> + / / String extension functions <nl> + MVCRO ( " < ? php \ n " <nl> + " $ tmp = \ " heLlO \ \ nwoRld \ \ ntoto \ \ ntiti \ \ ntata \ " ; \ n " <nl> + " $ good1 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ good1 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = ' world ' ; \ n " <nl> + " $ good2 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ good2 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = ' toto ' ; \ n " <nl> + " $ good3 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ good3 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = \ " eViL \ \ nsTring \ \ nare \ \ tfun \ \ narent \ \ tthey ? \ " ; \ n " <nl> + " $ bad1 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ bad1 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " $ tmp = \ " some \ \ nthing \ \ ntoto \ \ nbad ! \ " ; \ n " <nl> + " $ bad2 = ' ' ; \ n " <nl> + " for ( $ i = 0 ; $ i < strlen ( $ tmp ) ; $ i + + ) { \ n " <nl> + " $ bad2 . = $ tmp [ $ i ] ; \ n " <nl> + " } \ n " <nl> + " unset ( $ tmp ) ; \ n " <nl> + " fb_set_taint ( $ bad1 , TAINT_ALL ) ; \ n " <nl> + " fb_set_taint ( $ bad2 , TAINT_ALL ) ; \ n " <nl> + " $ common_suite_funcs = array ( \ n " <nl> + " ' stripcslashes ' , \ n " <nl> + " ' addslashes ' , \ n " <nl> + " ' stripslashes ' , \ n " <nl> + " ' bin2hex ' , \ n " <nl> + " / / ' hex2bin ' , \ n " <nl> + " ' nl2br ' , \ n " <nl> + " ' quotemeta ' , \ n " <nl> + " ' str_shuffle ' , \ n " <nl> + " ' strrev ' , \ n " <nl> + " ' strtolower ' , \ n " <nl> + " ' strtoupper ' , \ n " <nl> + " ' ucfirst ' , \ n " <nl> + " ' ucwords ' , \ n " <nl> + " ' strip_tags ' , \ n " <nl> + " ' trim ' , \ n " <nl> + " ' ltrim ' , \ n " <nl> + " ' chop ' , \ n " <nl> + " ' html_entity_decode ' , \ n " <nl> + " ' htmlentities ' , \ n " <nl> + " ' htmlspecialchars_decode ' , \ n " <nl> + " ' htmlspecialchars ' , \ n " <nl> + " ' quoted_printable_encode ' , \ n " <nl> + " ' quoted_printable_decode ' , \ n " <nl> + " ' convert_uudecode ' , \ n " <nl> + " ' convert_uuencode ' , \ n " <nl> + " ' str_rot13 ' , \ n " <nl> + " ' crypt ' , \ n " <nl> + " ' sha1 ' \ n " <nl> + " ) ; \ n " <nl> + " function test_common_suite ( $ func ) { \ n " <nl> + " global $ good1 , $ bad1 ; \ n " <nl> + " var_dump ( fb_get_taint ( $ func ( $ good1 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ func ( $ bad1 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ func ( $ good1 ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ func ( $ bad1 ) , TAINT_MUTATED ) ) ; \ n " <nl> + " } \ n " <nl> + " foreach ( $ common_suite_funcs as $ func ) { \ n " <nl> + " test_common_suite ( $ func ) ; \ n " <nl> + " } \ n " <nl> + " var_dump ( fb_get_taint ( addcslashes ( $ good1 , $ good2 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( addcslashes ( $ bad1 , $ bad1 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( addcslashes ( $ good1 , $ bad1 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( addcslashes ( $ good1 , $ good2 ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( addcslashes ( $ bad1 , $ bad2 ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( rtrim ( $ good1 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( rtrim ( $ bad1 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( rtrim ( $ good1 ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( rtrim ( $ bad1 ) , TAINT_MUTATED ) ) ; \ n " <nl> + " $ arr = explode ( \ " \ \ n \ " , $ good1 ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 0 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 1 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 0 ] , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 1 ] , TAINT_MUTATED ) ) ; \ n " <nl> + " $ arr = explode ( \ " \ \ n \ " , $ bad1 ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 0 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 1 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 0 ] , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 1 ] , TAINT_MUTATED ) ) ; \ n " <nl> + " $ arr = array ( ) ; \ n " <nl> + " $ arr [ ] = $ good1 ; \ n " <nl> + " $ arr [ ] = $ good2 ; \ n " <nl> + " var_dump ( fb_get_taint ( implode ( \ " \ \ t \ " , $ arr ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( implode ( \ " \ \ t \ " , $ arr ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( implode ( $ bad2 , $ arr ) , TAINT_MUTATED ) ) ; \ n " <nl> + " $ arr [ ] = $ bad1 ; \ n " <nl> + " var_dump ( fb_get_taint ( implode ( \ " \ \ t \ " , $ arr ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( implode ( \ " \ \ t \ " , $ arr ) , TAINT_MUTATED ) ) ; \ n " <nl> + " $ arr = array ( ) ; \ n " <nl> + " $ arr [ ] = $ good1 ; \ n " <nl> + " $ arr [ ] = $ good2 ; \ n " <nl> + " var_dump ( fb_get_taint ( join ( \ " \ \ t \ " , $ arr ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( join ( \ " \ \ t \ " , $ arr ) , TAINT_MUTATED ) ) ; \ n " <nl> + " $ arr [ ] = $ bad1 ; \ n " <nl> + " var_dump ( fb_get_taint ( join ( \ " \ \ t \ " , $ arr ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( join ( \ " \ \ t \ " , $ arr ) , TAINT_MUTATED ) ) ; \ n " <nl> + " $ arr = str_split ( $ good1 , 2 ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 0 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 1 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 0 ] , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 1 ] , TAINT_MUTATED ) ) ; \ n " <nl> + " $ arr = str_split ( $ bad1 , 2 ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 0 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 1 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 0 ] , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ arr [ 1 ] , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( chunk_split ( $ good1 , 3 , $ good2 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( chunk_split ( $ bad1 , 3 , $ good1 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( chunk_split ( $ good1 , 3 , $ bad1 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( chunk_split ( $ good1 , 3 , $ good2 ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( chunk_split ( $ bad1 , 3 , $ good1 ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( chunk_split ( $ good1 , 3 , $ bad1 ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( strtok ( $ good1 , \ " \ \ n \ " ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( strtok ( \ " : \ \ n \ " ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( strtok ( $ good1 , \ " \ \ n \ " ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( strtok ( \ " : \ \ n \ " ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( strtok ( $ bad1 , \ " \ \ n \ " ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( strtok ( \ " : \ \ n \ " ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( strtok ( $ bad1 , \ " \ \ n \ " ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( strtok ( \ " : \ \ n \ " ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_replace ( $ good3 , $ good2 , $ good1 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " $ arr = array ( $ good1 , $ good2 ) ; \ n " <nl> + " $ a = str_replace ( $ good3 , $ good2 , $ arr ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a [ 0 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a [ 1 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_replace ( $ good3 , $ bad1 , $ good1 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " $ arr = array ( $ bad1 , $ bad2 ) ; \ n " <nl> + " $ a = str_replace ( $ good3 , $ good2 , $ arr ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a [ 0 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a [ 1 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_ireplace ( $ good3 , $ good2 , $ good1 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_ireplace ( $ good3 , $ good2 , $ good1 ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " $ arr = array ( $ good1 , $ good2 ) ; \ n " <nl> + " $ a = str_ireplace ( $ good3 , $ good2 , $ arr ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a [ 0 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a [ 1 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a [ 0 ] , TAINT_MUTATED ) ) ; \ n " <nl> + " / / Note : if no replacement occurs , static strings remain static . \ n " <nl> + " var_dump ( fb_get_taint ( $ a [ 1 ] , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_ireplace ( $ good3 , $ bad1 , $ good1 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_ireplace ( $ good3 , $ bad1 , $ good1 ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " $ arr = array ( $ bad1 , $ bad2 ) ; \ n " <nl> + " $ a = str_ireplace ( $ good3 , $ good2 , $ arr ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a [ 0 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a [ 1 ] , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a [ 0 ] , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ a [ 1 ] , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ good1 , $ good2 , 0 , 3 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ good1 , $ good2 , 0 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ bad1 , $ good1 , 0 , 3 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ bad1 , $ good1 , 0 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ good1 , $ bad1 , 0 , 3 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ good1 , $ bad1 , 0 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ bad1 , $ bad2 , 0 , 3 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ bad1 , $ bad2 , 0 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ good1 , $ good2 , 0 , 3 ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ good1 , $ good2 , 0 ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ bad1 , $ good1 , 0 , 3 ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ bad1 , $ good1 , 0 ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ good1 , $ bad1 , 0 , 3 ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ good1 , $ bad1 , 0 ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ bad1 , $ bad2 , 0 , 3 ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr_replace ( $ bad1 , $ bad2 , 0 ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr ( $ good1 , 5 , 5 ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr ( $ bad1 , 5 , 5 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr ( $ good1 , 5 , 5 ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( substr ( $ bad1 , 5 , 5 ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_pad ( $ good1 , 5 , $ good2 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_pad ( $ bad1 , 5 , $ good1 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_pad ( $ good1 , 5 , $ bad1 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_pad ( $ bad1 , 5 , $ bad2 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_pad ( $ good1 , 5 , $ good2 ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_pad ( $ bad1 , 5 , $ good1 ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_pad ( $ good1 , 5 , $ bad1 ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_pad ( $ bad1 , 5 , $ bad2 ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_repeat ( $ good1 , 5 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_repeat ( $ bad1 , 13 ) , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_repeat ( $ good1 , 5 ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( str_repeat ( $ bad1 , 13 ) , TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( wordwrap ( $ good1 , 5 , $ good2 , true ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( wordwrap ( $ bad1 , 5 , $ good1 , true ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( wordwrap ( $ good1 , 5 , $ bad1 , true ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( wordwrap ( $ bad1 , 5 , $ bad2 , true ) , \ n " <nl> + " TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( wordwrap ( $ good1 , 5 , $ good2 , true ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( wordwrap ( $ bad1 , 5 , $ good1 , true ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( wordwrap ( $ good1 , 5 , $ bad1 , true ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( wordwrap ( $ bad1 , 5 , $ bad2 , true ) , \ n " <nl> + " TAINT_MUTATED ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( crc32 ( $ good1 ) , TAINT_HTML ) ) ; \ n " <nl> + " $ arr = array ( $ good1 , $ good2 ) ; \ n " <nl> + " $ x = print_r ( $ arr , true ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ x , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ x , TAINT_MUTATED ) ) ; \ n " <nl> + " $ arr = array ( $ good1 , $ bad1 ) ; \ n " <nl> + " $ x = print_r ( $ arr , true ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ x , TAINT_HTML ) ) ; \ n " <nl> + " var_dump ( fb_get_taint ( $ x , TAINT_MUTATED ) ) ; \ n " , <nl> + / / common suite <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / addcslashes <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / rtrim <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / explode <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / implode <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / join <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / str_split <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / chunk_split <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / strtok <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / str_replace <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / str_ireplace <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / substr_replace <nl> + " bool ( false ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / substr <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / str_pad <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / str_repeat <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / wordwrap <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + / / crc32 <nl> + " bool ( false ) \ n " <nl> + / / print_r <nl> + " bool ( false ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + " bool ( true ) \ n " <nl> + ) ; <nl> + <nl> + return true ; <nl> + } <nl> + # endif <nl> + <nl> bool TestCodeRun : : TestParser ( ) { <nl> MVCRO ( " < ? php function foo ( ) { return array ( 1 , 2 , 3 ) ; } var_dump ( foo ( ) [ 2 ] ) ; " , <nl> " int ( 3 ) \ n " ) ; <nl> mmm a / src / test / test_code_run . h <nl> ppp b / src / test / test_code_run . h <nl> class TestCodeRun : public TestBase { <nl> / / HipHop specific <nl> bool TestYield ( ) ; <nl> bool TestHint ( ) ; <nl> + # ifdef TAINTED <nl> + bool TestTaint ( ) ; <nl> + # endif <nl> <nl> / / debugging purpose <nl> bool TestAdHoc ( ) ; <nl>
[ HPHP Tainting ] Migrating taint tests to HPHP framework
facebook/hhvm
c3532a52d9e71eb351255d850ddc605db379fa02
2011-08-19T19:53:54Z
mmm a / hphp / hack / src / full_fidelity / full_fidelity_declaration_parser . ml <nl> ppp b / hphp / hack / src / full_fidelity / full_fidelity_declaration_parser . ml <nl> module WithExpressionAndStatementParser <nl> ( parser , node ) <nl> <nl> ( * Declarations * ) <nl> - <nl> let rec parse_require_multiple_directive parser = <nl> ( * TODO * ) <nl> let ( parser , token ) = next_token parser in <nl> module WithExpressionAndStatementParser <nl> let ( parser , token ) = next_token parser in <nl> ( parser , make_error [ make_token token ] ) <nl> <nl> - and parse_interface_declaration parser = <nl> - ( * TODO * ) <nl> - let ( parser , token ) = next_token parser in <nl> - ( parser , make_error [ make_token token ] ) <nl> - <nl> and parse_namespace_declaration parser = <nl> ( * TODO * ) <nl> let ( parser , token ) = next_token parser in <nl> module WithExpressionAndStatementParser <nl> let ( parser , token ) = next_token parser in <nl> ( parser , make_error [ make_token token ] ) <nl> <nl> - and parse_trait_declaration parser = <nl> - ( * TODO * ) <nl> - let ( parser , token ) = next_token parser in <nl> - ( parser , make_error [ make_token token ] ) <nl> + and parse_classish_declaration parser = <nl> + let ( parser , attribute_spec ) = <nl> + parse_attribute_specification_opt parser in <nl> + let ( parser , abstract , final ) = <nl> + parse_classish_modifier_opt parser in <nl> + let ( parser , token ) = <nl> + parse_classish_token parser in <nl> + let ( parser , name ) = <nl> + expect_token parser Name SyntaxError . error1004 in <nl> + let ( parser , generic_type_parameter_list ) = <nl> + parse_generic_type_parameter_list_opt parser in <nl> + let ( parser , classish_extends , classish_extends_list ) = <nl> + parse_classish_extends_opt parser in <nl> + let ( parser , classish_implements , classish_implements_list ) = <nl> + parse_classish_implements_opt parser in <nl> + let ( parser , body ) = parse_classish_body parser in <nl> + let syntax = make_classish <nl> + attribute_spec abstract final token name generic_type_parameter_list <nl> + classish_extends classish_extends_list classish_implements <nl> + classish_implements_list <nl> + body <nl> + in <nl> + ( parser , syntax ) <nl> <nl> - and parse_class_declaration parser = <nl> - ( * TODO * ) <nl> - let ( parser , token ) = next_token parser in <nl> - ( parser , make_error [ make_token token ] ) <nl> + and parse_classish_modifier_opt parser = <nl> + let ( parser , abstract ) = optional_token parser Abstract in <nl> + let ( parser , final ) = optional_token parser Final in <nl> + ( parser , abstract , final ) <nl> + <nl> + and parse_classish_token parser = <nl> + let ( parser1 , token ) = next_token parser in <nl> + match ( Token . kind token ) with <nl> + | Class <nl> + | Trait <nl> + | Interface - > ( parser1 , make_token token ) <nl> + | _ - > ( with_error parser SyntaxError . error1035 , ( make_missing ( ) ) ) <nl> + <nl> + and parse_classish_extends_opt parser = <nl> + let ( parser1 , extends_token ) = next_token parser in <nl> + if ( Token . kind extends_token ) < > Extends then <nl> + ( parser , make_missing ( ) , Syntax . make_missing ( ) ) <nl> + else <nl> + let ( parser , extends_list ) = parse_qualified_name_list parser1 in <nl> + ( parser , make_token extends_token , extends_list ) <nl> + <nl> + and parse_classish_implements_opt parser = <nl> + let ( parser1 , implements_token ) = next_token parser in <nl> + if ( Token . kind implements_token ) < > Implements then <nl> + ( parser , make_missing ( ) , Syntax . make_missing ( ) ) <nl> + else <nl> + let ( parser , implements_list ) = parse_qualified_name_list parser1 in <nl> + ( parser , make_token implements_token , implements_list ) <nl> + <nl> + and parse_qualified_name_list parser = <nl> + let rec aux parser acc = <nl> + let token = peek_token parser in <nl> + match ( Token . kind token ) with <nl> + | Comma - > <nl> + let ( parser1 , token ) = next_token parser in <nl> + aux parser1 ( ( make_token token ) : : acc ) <nl> + | Name <nl> + | QualifiedName - > <nl> + let ( parser , classish_reference ) = parse_type_specifier parser in <nl> + aux parser ( classish_reference : : acc ) <nl> + | _ - > ( parser , acc ) <nl> + in <nl> + let ( parser , qualified_name_list ) = aux parser [ ] in <nl> + let qualified_name_list = List . rev qualified_name_list in <nl> + ( parser , make_list qualified_name_list ) <nl> + <nl> + and parse_classish_body parser = <nl> + let ( parser , left_brace_token ) = <nl> + expect_token parser LeftBrace SyntaxError . error1034 in <nl> + let ( parser , classish_element_list ) = <nl> + parse_classish_element_list_opt parser in <nl> + let ( parser , right_brace_token ) = <nl> + expect_token parser RightBrace SyntaxError . error1006 in <nl> + let syntax = make_classish_body <nl> + left_brace_token classish_element_list right_brace_token in <nl> + ( parser , syntax ) <nl> + <nl> + and parse_classish_element_list_opt parser = <nl> + let rec aux parser acc = <nl> + let token = peek_token parser in <nl> + match ( Token . kind token ) with <nl> + | RightBrace <nl> + | EndOfFile - > ( parser , acc ) <nl> + | _ - > <nl> + ( * TODO * ) <nl> + let ( parser , token ) = next_token parser in <nl> + let parser = with_error parser SyntaxError . error1033 in <nl> + aux parser ( make_error [ make_token token ] : : acc ) <nl> + in <nl> + let ( parser , classish_elements ) = aux parser [ ] in <nl> + let classish_elements = List . rev classish_elements in <nl> + ( parser , make_list classish_elements ) <nl> <nl> ( * SPEC : <nl> attribute_specification : = < < attribute_list > > <nl> module WithExpressionAndStatementParser <nl> parameter_list right_paren_token colon_token return_type body in <nl> ( parser , syntax ) <nl> <nl> - let parse_class_function_interface_or_trait_declaration parser = <nl> + let parse_classish_or_function_declaration parser = <nl> let parser , attribute_specification = <nl> parse_attribute_specification_opt parser in <nl> let parser1 , token = next_token parser in <nl> module WithExpressionAndStatementParser <nl> | Require_once - > parse_require_once_directive parser <nl> | Type - > parse_type_alias_declaration parser <nl> | Newtype - > parse_newtype_alias_declaration parser <nl> - | Enum - > parse_enum_declaration parser <nl> - | Interface - > parse_interface_declaration parser <nl> | Namespace - > parse_namespace_declaration parser <nl> | Use - > parse_namespace_use_declaration parser <nl> - | Trait - > parse_trait_declaration parser <nl> + | Trait <nl> + | Interface <nl> | Abstract <nl> | Final <nl> - | Class - > parse_class_declaration parser <nl> + | Class - > parse_classish_declaration parser <nl> + | Enum - > parse_enum_declaration parser <nl> | Async <nl> | Function - > parse_function_declaration parser ( make_missing ( ) ) <nl> | LessThanLessThan - > <nl> - parse_class_function_interface_or_trait_declaration parser <nl> + parse_classish_or_function_declaration parser <nl> | _ - > <nl> ( * ERROR RECOVERY : Skip the token , try again . * ) <nl> ( * TODO : Better policy would be to skip ahead to <nl> mmm a / hphp / hack / src / full_fidelity / full_fidelity_pretty_printer . ml <nl> ppp b / hphp / hack / src / full_fidelity / full_fidelity_pretty_printer . ml <nl> let rec get_doc node = <nl> ( x | > header_language | > get_doc | > add_break ) <nl> | Script x - > group_doc ( get_doc ( script_header x ) <nl> ^ | get_doc ( script_declarations x ) ) <nl> + | ClassishDeclaration x - > <nl> + let attr = add_break ( get_doc ( classish_attr x ) ) in <nl> + <nl> + let preface = group_doc ( <nl> + get_doc ( classish_abstract x ) ^ | <nl> + get_doc ( classish_final x ) ^ | <nl> + get_doc ( classish_token x ) <nl> + ) in <nl> + <nl> + let name_and_generics = <nl> + let name = get_doc ( classish_name x ) in <nl> + let type_params = get_doc ( classish_type_params x ) in <nl> + group_doc ( indent_doc name type_params indt ) <nl> + in <nl> + <nl> + let extends = <nl> + let extends_token = get_doc ( classish_extends x ) in <nl> + let extends_list = get_doc ( classish_extends_list x ) in <nl> + group_doc ( indent_doc extends_token extends_list indt ) <nl> + in <nl> + <nl> + let implements = <nl> + let implements_token = get_doc ( classish_implements x ) in <nl> + let implements_list = get_doc ( classish_implements_list x ) in <nl> + group_doc ( indent_doc implements_token implements_list indt ) <nl> + in <nl> + <nl> + let body = get_doc ( classish_body x ) in <nl> + <nl> + ( * TODO : Make this better * ) <nl> + attr ^ ^ ^ <nl> + group_doc ( <nl> + group_doc ( <nl> + preface ^ | <nl> + name_and_generics <nl> + ) ^ | <nl> + group_doc ( <nl> + extends ^ | <nl> + implements <nl> + ) ^ | <nl> + body <nl> + ) <nl> + | ClassishBody x - > <nl> + let left = get_doc ( classish_body_left_brace x ) in <nl> + let right = get_doc ( classish_body_right_brace x ) in <nl> + let body = get_doc ( classish_body_elements x ) in <nl> + indent_block_no_space left body right indt <nl> | FunctionDeclaration x - > <nl> let preface = group_doc ( get_doc ( function_attr x ) <nl> ^ | get_doc ( function_async x ) <nl> mmm a / hphp / hack / src / full_fidelity / full_fidelity_syntax . ml <nl> ppp b / hphp / hack / src / full_fidelity / full_fidelity_syntax . ml <nl> module WithToken ( Token : TokenType ) = struct <nl> function_type : t ; <nl> function_body : t <nl> } <nl> + and classish_declaration = { <nl> + classish_attr : t ; <nl> + classish_abstract : t ; <nl> + classish_final : t ; <nl> + classish_token : t ; <nl> + classish_name : t ; <nl> + classish_type_params : t ; <nl> + classish_extends : t ; <nl> + classish_extends_list : t ; <nl> + classish_implements : t ; <nl> + classish_implements_list : t ; <nl> + classish_body : t ; <nl> + } <nl> + and classish_body = { <nl> + classish_body_left_brace : t ; <nl> + classish_body_elements : t ; <nl> + classish_body_right_brace : t ; <nl> + } <nl> and parameter_declaration = { <nl> param_attr : t ; <nl> param_type : t ; <nl> module WithToken ( Token : TokenType ) = struct <nl> | Script of script <nl> <nl> | FunctionDeclaration of function_declaration <nl> + | ClassishDeclaration of classish_declaration <nl> + | ClassishBody of classish_body <nl> | ParameterDeclaration of parameter_declaration <nl> | DefaultArgumentSpecifier of default_argument_specifier <nl> | AttributeSpecification of attribute_specification <nl> module WithToken ( Token : TokenType ) = struct <nl> | ScriptHeader _ - > SyntaxKind . ScriptHeader <nl> | Script _ - > SyntaxKind . Script <nl> | FunctionDeclaration _ - > SyntaxKind . FunctionDeclaration <nl> + | ClassishDeclaration _ - > SyntaxKind . ClassishDeclaration <nl> + | ClassishBody _ - > SyntaxKind . ClassishBody <nl> | ParameterDeclaration _ - > SyntaxKind . ParameterDeclaration <nl> | DefaultArgumentSpecifier _ - > SyntaxKind . DefaultArgumentSpecifier <nl> | AttributeSpecification _ - > SyntaxKind . AttributeSpecification <nl> module WithToken ( Token : TokenType ) = struct <nl> let is_header node = kind node = SyntaxKind . ScriptHeader <nl> let is_script node = kind node = SyntaxKind . Script <nl> let is_function node = kind node = SyntaxKind . FunctionDeclaration <nl> + let is_classish node = kind node = SyntaxKind . ClassishDeclaration <nl> + let is_classish_body node = kind node = SyntaxKind . ClassishBody <nl> let is_parameter node = kind node = SyntaxKind . ParameterDeclaration <nl> let is_default_arg_specifier node = <nl> kind node = SyntaxKind . DefaultArgumentSpecifier <nl> module WithToken ( Token : TokenType ) = struct <nl> [ function_attr ; function_async ; function_token ; function_name ; <nl> function_type_params ; function_left_paren ; function_params ; <nl> function_right_paren ; function_colon ; function_type ; function_body ] <nl> + | ClassishDeclaration <nl> + { classish_attr ; classish_abstract ; classish_final ; classish_token ; <nl> + classish_name ; classish_type_params ; classish_extends ; <nl> + classish_extends_list ; classish_implements ; classish_implements_list ; <nl> + classish_body } - > <nl> + [ classish_attr ; classish_abstract ; classish_final ; classish_token ; <nl> + classish_name ; classish_type_params ; classish_extends ; <nl> + classish_extends_list ; classish_implements ; classish_implements_list ; <nl> + classish_body ] <nl> + | ClassishBody <nl> + { classish_body_left_brace ; classish_body_elements ; <nl> + classish_body_right_brace } - > <nl> + [ classish_body_left_brace ; classish_body_elements ; <nl> + classish_body_right_brace ] <nl> | ParameterDeclaration <nl> { param_attr ; param_type ; param_name ; param_default } - > <nl> [ param_attr ; param_type ; param_name ; param_default ] <nl> module WithToken ( Token : TokenType ) = struct <nl> " function_type_params " ; " function_left_paren " ; " function_params " ; <nl> " function_right_paren " ; " function_colon " ; " function_type " ; <nl> " function_body " ] <nl> + | ClassishDeclaration <nl> + { classish_attr ; classish_abstract ; classish_final ; classish_token ; <nl> + classish_name ; classish_type_params ; classish_extends ; <nl> + classish_extends_list ; classish_implements ; classish_implements_list ; <nl> + classish_body } - > <nl> + [ " classish_attr " ; " classish_abstract " ; " classish_final " ; <nl> + " classish_token " ; " classish_name " ; " classish_type_params " ; <nl> + " classish_extends " ; " classish_extends_list " ; " classish_implements " ; <nl> + " classish_implements_list " ; " classish_body " ] <nl> + | ClassishBody <nl> + { classish_body_left_brace ; classish_body_elements ; <nl> + classish_body_right_brace } - > <nl> + [ " classish_body_left_brace " ; " classish_body_elements " ; <nl> + " classish_body_right_brace " ] <nl> | ParameterDeclaration <nl> { param_attr ; param_type ; param_name ; param_default } - > <nl> [ " param_attr " ; " param_type " ; " param_name " ; " param_default " ] <nl> module WithToken ( Token : TokenType ) = struct <nl> let function_colon x = x . function_colon <nl> let function_type x = x . function_type <nl> let function_body x = x . function_body <nl> + let classish_attr x = x . classish_attr <nl> + let classish_abstract x = x . classish_abstract <nl> + let classish_final x = x . classish_final <nl> + let classish_token x = x . classish_token <nl> + let classish_name x = x . classish_name <nl> + let classish_type_params x = x . classish_type_params <nl> + let classish_extends x = x . classish_extends <nl> + let classish_extends_list x = x . classish_extends_list <nl> + let classish_implements x = x . classish_implements <nl> + let classish_implements_list x = x . classish_implements_list <nl> + let classish_body x = x . classish_body <nl> + let classish_body_left_brace x = x . classish_body_left_brace <nl> + let classish_body_elements x = x . classish_body_elements <nl> + let classish_body_right_brace x = x . classish_body_right_brace <nl> let param_attr x = x . param_attr <nl> let param_type x = x . param_type <nl> let param_name x = x . param_name <nl> module WithToken ( Token : TokenType ) = struct <nl> function_token ; function_name ; function_type_params ; <nl> function_left_paren ; function_params ; function_right_paren ; <nl> function_colon ; function_type ; function_body } <nl> + | ( SyntaxKind . ClassishDeclaration , <nl> + [ classish_attr ; classish_abstract ; classish_final ; classish_token ; <nl> + classish_name ; classish_type_params ; classish_extends ; <nl> + classish_extends_list ; classish_implements ; classish_implements_list ; <nl> + classish_body ] ) - > <nl> + ClassishDeclaration { <nl> + classish_attr ; classish_abstract ; classish_final ; classish_token ; <nl> + classish_name ; classish_type_params ; classish_extends ; <nl> + classish_extends_list ; classish_implements ; classish_implements_list ; <nl> + classish_body } <nl> + | ( SyntaxKind . ClassishBody , <nl> + [ classish_body_left_brace ; classish_body_elements ; <nl> + classish_body_right_brace ] ) - > <nl> + ClassishBody { <nl> + classish_body_left_brace ; classish_body_elements ; <nl> + classish_body_right_brace } <nl> | ( SyntaxKind . ParameterDeclaration , [ param_attr ; param_type ; param_name ; <nl> param_default ] ) - > <nl> ParameterDeclaration { param_attr ; param_type ; param_name ; <nl> module WithToken ( Token : TokenType ) = struct <nl> function_type_params ; function_left_paren ; function_params ; <nl> function_right_paren ; function_colon ; function_type ; function_body ] <nl> <nl> + let make_classish classish_attr classish_abstract classish_final <nl> + classish_token classish_name classish_type_params classish_extends <nl> + classish_extends_list classish_implements classish_implements_list <nl> + classish_body = <nl> + from_children SyntaxKind . ClassishDeclaration [ <nl> + classish_attr ; classish_abstract ; classish_final ; classish_token ; <nl> + classish_name ; classish_type_params ; classish_extends ; <nl> + classish_extends_list ; classish_implements ; classish_implements_list ; <nl> + classish_body ] <nl> + <nl> + let make_classish_body classish_body_left_brace classish_body_elements <nl> + classish_body_right_brace = <nl> + from_children SyntaxKind . ClassishBody [ <nl> + classish_body_left_brace ; classish_body_elements ; <nl> + classish_body_right_brace ] <nl> + <nl> let make_parameter_declaration <nl> param_attr param_type param_name param_default = <nl> from_children SyntaxKind . ParameterDeclaration <nl> mmm a / hphp / hack / src / full_fidelity / full_fidelity_syntax_error . ml <nl> ppp b / hphp / hack / src / full_fidelity / full_fidelity_syntax_error . ml <nl> let error1029 = " A closing double angle bracket is expected here . " <nl> let error1030 = " An attribute is expected here . " <nl> let error1031 = " A comma or a closing square bracket is expected here . " <nl> let error1032 = " A closing square bracket is expected here . " <nl> + ( * TODO : Break this up according to classish type * ) <nl> + let error1033 = " A class member , method , type , trait usage , trait require , " ^ <nl> + " xhp attribute , xhp use , or xhp category is expected here . " <nl> + let error1034 = " A left brace is expected here . " <nl> + let error1035 = " ' Class ' keyword is expected here . " <nl> <nl> let error2001 = " A type annotation is required in strict mode . " <nl> mmm a / hphp / hack / src / full_fidelity / full_fidelity_syntax_kind . ml <nl> ppp b / hphp / hack / src / full_fidelity / full_fidelity_syntax_kind . ml <nl> type t = <nl> | ScriptHeader <nl> | Script <nl> | FunctionDeclaration <nl> + | ClassishDeclaration <nl> + | ClassishBody <nl> | ParameterDeclaration <nl> | DefaultArgumentSpecifier <nl> | AttributeSpecification <nl> let to_string kind = <nl> | ScriptHeader - > " header " <nl> | Script - > " script " <nl> | FunctionDeclaration - > " function_declaration " <nl> + | ClassishDeclaration - > " classish_declaration " <nl> + | ClassishBody - > " classish_body " <nl> | ParameterDeclaration - > " parameter_declaration " <nl> | AttributeSpecification - > " attribute_specification " <nl> | Attribute - > " attribute " <nl> new file mode 100644 <nl> index 00000000000 . . 2e1b28d64a6 <nl> mmm / dev / null <nl> ppp b / hphp / hack / test / full_fidelity / cases / test_empty_class . exp <nl> <nl> + ( script ( header ( ( < ) ) ( ( ? ) ) ( ( name ) ( end_of_line ) ) ) ( list ( <nl> + classish_declaration <nl> + ( missing ) <nl> + ( missing ) <nl> + ( missing ) <nl> + ( ( interface ) ( whitespace ) ) <nl> + ( ( name ) ( whitespace ) ) <nl> + ( missing ) <nl> + ( missing ) <nl> + ( missing ) <nl> + ( missing ) <nl> + ( missing ) <nl> + ( classish_body ( ( { ) ) <nl> + ( missing ) <nl> + ( ( } ) ( end_of_line ) ) ) ) <nl> + ( classish_declaration <nl> + ( missing ) <nl> + ( missing ) <nl> + ( missing ) <nl> + ( ( end_of_line ) ( trait ) ( whitespace ) ) <nl> + ( ( name ) ( whitespace ) ) <nl> + ( missing ) <nl> + ( missing ) <nl> + ( missing ) <nl> + ( missing ) <nl> + ( missing ) <nl> + ( classish_body ( ( { ) ) <nl> + ( missing ) <nl> + ( ( } ) ( end_of_line ) ) ) ) <nl> + ( classish_declaration <nl> + ( missing ) <nl> + ( ( end_of_line ) ( abstract ) ( whitespace ) ) <nl> + ( ( final ) ( whitespace ) ) <nl> + ( ( class ) ( whitespace ) ) <nl> + ( ( name ) ( whitespace ) ) <nl> + ( missing ) <nl> + ( missing ) <nl> + ( missing ) <nl> + ( missing ) <nl> + ( missing ) <nl> + ( classish_body ( ( { ) ) <nl> + ( missing ) <nl> + ( ( } ) ) <nl> + ) ) ) ) <nl> new file mode 100644 <nl> index 00000000000 . . 42eefa9e4bb <nl> mmm / dev / null <nl> ppp b / hphp / hack / test / full_fidelity / cases / test_empty_class . php <nl> <nl> + < ? hh <nl> + interface A { } <nl> + <nl> + trait B { } <nl> + <nl> + abstract final class C { } <nl> mmm a / hphp / hack / test / full_fidelity / full_fidelity_unit_test . ml <nl> ppp b / hphp / hack / test / full_fidelity / full_fidelity_unit_test . ml <nl> let test_data = [ <nl> make_test_case_from_files " test_errors_not_strict " test_errors ; <nl> make_test_case_from_files " test_errors_strict " test_errors ; <nl> make_test_case_from_files " test_no_errors_strict " test_errors ; <nl> + make_test_case_from_files <nl> + ~ preprocess_exp : remove_whitespace " test_empty_class " test_minimal ; <nl> ] <nl> <nl> let driver test ( ) = <nl>
RFC : Add support for parsing classes
facebook/hhvm
68e6e3653be0fdf93b1e092f0edd72bde991cb9e
2016-07-01T22:43:58Z
mmm a / vnpy / app / algo_trading / genus . py <nl> ppp b / vnpy / app / algo_trading / genus . py <nl> <nl> from datetime import datetime , timedelta <nl> from typing import Any <nl> from dataclasses import dataclass <nl> + import pytz <nl> <nl> import quickfix as fix <nl> <nl> <nl> from . base import EVENT_ALGO_PARAMETERS , EVENT_ALGO_SETTING , EVENT_ALGO_LOG <nl> <nl> <nl> + CHINA_TZ = pytz . timezone ( " Asia / Shanghai " ) <nl> + <nl> EXCHANGE_VT2GNS = { <nl> Exchange . SSE : " SS " , <nl> Exchange . SZSE : " SZ " , <nl> def on_parent_order ( self , message : fix . Message ) : <nl> } <nl> print ( d ) <nl> <nl> + # Add algo active status <nl> + if status in { Status . SUBMITTING , Status . NOTTRADED , Status . ALLTRADED } : <nl> + variables [ " active " ] = True <nl> + else : <nl> + variables [ " active " ] = False <nl> + <nl> self . client . put_variables_event ( parent_orderid , variables ) <nl> <nl> def send_parent_order ( self , setting : dict ) : <nl> def send_parent_order ( self , setting : dict ) : <nl> price = setting [ " price " ] <nl> order_type = setting [ " order_type " ] <nl> direction = setting [ " direction " ] <nl> - algo_type = setting [ " algo_type " ] <nl> + algo_type = setting [ " template_name " ] <nl> <nl> message = new_message ( fix . MsgType_NewOrderSingle ) <nl> <nl> def send_parent_order ( self , setting : dict ) : <nl> side = DIRECTION_VT2GNS [ direction ] <nl> genus_type = ORDERTYPE_VT2GNS [ order_type ] <nl> <nl> - utc_now = datetime . utcnow ( ) <nl> - hours = timedelta ( hours = 1 ) <nl> - mins = timedelta ( minutes = 1 ) <nl> - <nl> - utc_start = ( utc_now - mins ) . strftime ( " % Y % m % d - % H : % M : % S " ) <nl> - utc_end = ( utc_now + hours ) . strftime ( " % Y % m % d - % H : % M : % S " ) <nl> - <nl> self . parent_orderid + = 1 <nl> parent_orderid = str ( self . parent_orderid ) <nl> message . setField ( fix . ClOrdID ( parent_orderid ) ) <nl> def send_parent_order ( self , setting : dict ) : <nl> if order_type = = OrderType . LIMIT : <nl> message . setField ( fix . Price ( price ) ) <nl> <nl> + # utc_now = datetime . utcnow ( ) <nl> + # hours = timedelta ( hours = 1 ) <nl> + # mins = timedelta ( minutes = 1 ) <nl> + # utc_start = ( utc_now - mins ) . strftime ( " % Y % m % d - % H : % M : % S " ) <nl> + # utc_end = ( utc_now + hours ) . strftime ( " % Y % m % d - % H : % M : % S " ) <nl> + <nl> + start_time = setting { " start_time " } <nl> + end_time = setting { " end_time " } <nl> + utc_start = convert_to_utc ( start_time ) <nl> + utc_end = convert_to_utc ( end_time ) <nl> + <nl> parameters = f " StartTime ; { utc_start } ^ EndTime ; { utc_end } " <nl> + <nl> message . setField ( 847 , algo_type ) <nl> message . setField ( 848 , parameters ) <nl> <nl> def get_field_value ( field_map : fix . FieldMap , field : Any ) - > Any : <nl> return field . getValue ( ) <nl> <nl> <nl> + def convert_to_utc ( time_str : str ) - > str : <nl> + " " " " " " <nl> + date_str = datetime . now ( ) . strftime ( " % Y - % m - % d " ) <nl> + dt_str = f " { date_str } { time_str } " <nl> + dt = datetime . strptime ( dt_str , " % Y - % m - % d % H : % M : % S " ) <nl> + local_dt = CHINA_TZ . localize ( dt ) <nl> + utc_dt = local_dt . astimezone ( pytz . utc ) <nl> + return utc_dt . strftime ( " % Y % m % d - % H : % M : % S " ) <nl> + <nl> + <nl> if __name__ = = " __main__ " : <nl> from time import sleep <nl> <nl>
[ Mod ] support timestr convert from beijing to utc
vnpy/vnpy
104e95f663f3f65ba3a6c1ad137c40e333a3bb0f
2020-08-09T14:25:47Z
mmm a / README . mdown <nl> ppp b / README . mdown <nl> <nl> - cocos2d - x <nl> - = = = = = = = = = = = = = = = = = = <nl> + cocos2d - x <nl> + = = = = = = = = = <nl> <nl> - [ cocos2d - x ] [ 1 ] is a multi - platform 2D game framework in C + + , branched on [ cocos2d - iphone ] [ 2 ] and licensed under MIT . <nl> - The master branch on github uses OpenGL ES 1 . 1 rendering , while gles20 branch uses OpenGL ES 2 . 0 rendering . Currently we focus on gles20 developmenet . <nl> + [ cocos2d - x ] [ 1 ] is a multi - platform 2D game framework in C + + , branched on <nl> + [ cocos2d - iphone ] [ 2 ] and licensed under MIT . The master branch on github uses <nl> + OpenGL ES 2 . 0 rendering , while the old gles11 branch uses OpenGL ES 1 . 1 <nl> + rendering . Currently we focus on gles20 developmenet . <nl> + <nl> + Supported Platforms <nl> + mmmmmmmmmmmmmmmmmm - <nl> <nl> - Supported Platforms <nl> mmmmmmmmmmmmmmmmmm - <nl> * iOS : stable , well tested on iOS 5 . x ~ 6 . x SDK . <nl> - * Android : stable , well tested on 2 . 0 ~ 4 . x , ndk r5 ~ r8 . If you use gles20 branch or cocos2d - x v2 . 0 above , only android 2 . 3 and higher are supported <nl> - * Windows Phone 8 and Win8 Metro : stable , it ' s in another repo http : / / github . com / cocos2d - x / cocos2dx - win8 . <nl> - * Bada : cocos2d - x v1 . x supports Bada SDK 1 . 0 & 2 . 0 . Bada support was deprecated since cocos2d - x v2 . 0 . <nl> + * Android : stable , well tested on 2 . 0 ~ 4 . x , ndk r5 ~ r8 . If you use gles20 <nl> + branch or cocos2d - x v2 . 0 above , only android 2 . 3 and higher are supported <nl> + * Windows Phone 8 and Win8 Metro : stable , it ' s in another repo <nl> + http : / / github . com / cocos2d - x / cocos2dx - win8 . <nl> + * Bada : cocos2d - x v1 . x supports Bada SDK 1 . 0 & 2 . 0 . Bada support was <nl> + deprecated since cocos2d - x v2 . 0 . <nl> * BlackBerry : stable , contribued by staffs in RIM , supports Playbook & BB10 . <nl> * Marmalade : stable since cocos2d - x v0 . 11 . 0 , contributed by Marmalade ' s staff . <nl> * Native Client ( NaCl ) : contributed by the Native Client authors . <nl> - * Windows : stable , well tested on WinXP / Vista / Win7 . Please upgrde the drive of your video card if you meet problems on OpenGL functions <nl> + * Windows : stable , well tested on WinXP / Vista / Win7 . Please upgrde the drive <nl> + of your video card if you meet problems on OpenGL functions <nl> * Linux : support but not very stable . <nl> <nl> - You can visit our continuous integration system http : / / ci . cocos2d - x . org to check the stability on edge version . <nl> + You can visit our continuous integration system http : / / ci . cocos2d - x . org to <nl> + check the stability on edge version . <nl> <nl> Supported Programming Languages <nl> mmmmmmmmmmmmmmmmmm - <nl> - * C + + is the major programming language of cocos2d - x . Tons of top - chart cocos2d - x games were written in C + + . <nl> - * Lua binding is also widely used . Glu mobile , Zynga , UCWEB , 4399 , Renren Games are using lua on cocos2d - x . <nl> - * Javascript binding is our recommendation since 2012 H2 . Cocos2d community are cooperating on the same Javasciprt API on cocos2d - iphone / - x / - html5 . <nl> - <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + * C + + is the major programming language of cocos2d - x . Tons of top - chart <nl> + cocos2d - x games were written in C + + . <nl> + * Lua binding is also widely used . Glu mobile , Zynga , UCWEB , 4399 , Renren <nl> + Games are using lua on cocos2d - x . <nl> + * Javascript binding is our recommendation since 2012 H2 . Cocos2d community <nl> + are cooperating on the same Javasciprt API on cocos2d - iphone / - x / - html5 . <nl> <nl> Documentations <nl> mmmmmmmmmmmmmmmmmm - <nl> + mmmmmmmmmmmm - - <nl> + <nl> * Wiki : [ wiki . cocos2d - x . org ] [ 3 ] <nl> - * [ Online API References ] [ 4 ] <nl> - <nl> + * [ Online API References ] [ 4 ] <nl> + <nl> Contact us <nl> mmmmmmmmmmmmmmmmmm - <nl> + mmmmmmmmm - <nl> + <nl> * Forum : [ http : / / forum . cocos2d - x . org ] [ 5 ] <nl> * Twitter : [ http : / / www . twitter . com / cocos2dx ] [ 6 ] <nl> * Weibo : [ http : / / t . sina . com . cn / cocos2dx ] [ 7 ] <nl> - <nl> + <nl> [ 1 ] : http : / / www . cocos2d - x . org " cocos2d - x " <nl> [ 2 ] : http : / / www . cocos2d - iphone . org " cocos2d for iPhone " <nl> [ 3 ] : http : / / wiki . cocos2d - x . org " wiki . cocos2d - x . org " <nl>
Merge pull request from sbc100 / fix_readme
cocos2d/cocos2d-x
51a2c3acf5a73bcc1318b2bf1291e0f8f82fa541
2013-03-10T00:56:37Z
mmm a / dbms / src / Interpreters / tests / hash_map . cpp <nl> ppp b / dbms / src / Interpreters / tests / hash_map . cpp <nl> int main ( int argc , char * * argv ) <nl> { <nl> Stopwatch watch ; <nl> <nl> - google : : dense_hash_map < Key , Value , DB : : DefaultHash < Key > > map ; <nl> - google : : dense_hash_map < Key , Value , DB : : DefaultHash < Key > > : : iterator it ; <nl> + google : : dense_hash_map < Key , Value , DefaultHash < Key > > map ; <nl> + google : : dense_hash_map < Key , Value , DefaultHash < Key > > : : iterator it ; <nl> map . set_empty_key ( - 1ULL ) ; <nl> for ( size_t i = 0 ; i < n ; + + i ) <nl> { <nl> int main ( int argc , char * * argv ) <nl> { <nl> Stopwatch watch ; <nl> <nl> - google : : sparse_hash_map < Key , Value , DB : : DefaultHash < Key > > map ; <nl> - google : : sparse_hash_map < Key , Value , DB : : DefaultHash < Key > > : : iterator it ; <nl> + google : : sparse_hash_map < Key , Value , DefaultHash < Key > > map ; <nl> + google : : sparse_hash_map < Key , Value , DefaultHash < Key > > : : iterator it ; <nl> for ( size_t i = 0 ; i < n ; + + i ) <nl> { <nl> map . insert ( std : : make_pair ( data [ i ] , std : : move ( value ) ) ) ; <nl> mmm a / dbms / src / Interpreters / tests / hash_map2 . cpp <nl> ppp b / dbms / src / Interpreters / tests / hash_map2 . cpp <nl> int main ( int argc , char * * argv ) <nl> { <nl> Stopwatch watch ; <nl> <nl> - std : : unordered_map < Key , Value , DB : : DefaultHash < Key > > map ; <nl> + std : : unordered_map < Key , Value , DefaultHash < Key > > map ; <nl> for ( size_t i = 0 ; i < n ; + + i ) <nl> + + map [ data [ i ] ] ; <nl> <nl> int main ( int argc , char * * argv ) <nl> { <nl> Stopwatch watch ; <nl> <nl> - google : : dense_hash_map < Key , Value , DB : : DefaultHash < Key > > map ; <nl> + google : : dense_hash_map < Key , Value , DefaultHash < Key > > map ; <nl> map . set_empty_key ( - 1ULL ) ; <nl> for ( size_t i = 0 ; i < n ; + + i ) <nl> + + map [ data [ i ] ] ; <nl> int main ( int argc , char * * argv ) <nl> { <nl> Stopwatch watch ; <nl> <nl> - google : : sparse_hash_map < Key , Value , DB : : DefaultHash < Key > > map ; <nl> + google : : sparse_hash_map < Key , Value , DefaultHash < Key > > map ; <nl> for ( size_t i = 0 ; i < n ; + + i ) <nl> + + map [ data [ i ] ] ; <nl> <nl> mmm a / dbms / src / Interpreters / tests / hash_map3 . cpp <nl> ppp b / dbms / src / Interpreters / tests / hash_map3 . cpp <nl> <nl> # include < string . h > <nl> <nl> # include < malloc . h > <nl> - # include < math . h > <nl> <nl> # include < utility > <nl> <nl> - # include < boost / noncopyable . hpp > <nl> - <nl> - # include < Yandex / likely . h > <nl> - <nl> - # include < stats / IntHash . h > <nl> - <nl> # include < DB / Core / Types . h > <nl> # include < DB / Core / Exception . h > <nl> # include < DB / Core / ErrorCodes . h > <nl> <nl> <nl> # include < DB / Core / StringRef . h > <nl> <nl> - # ifdef DBMS_HASH_MAP_DEBUG_RESIZES <nl> - # include < iostream > <nl> - # include < iomanip > <nl> - # include < statdaemons / Stopwatch . h > <nl> - # endif <nl> - <nl> - <nl> - namespace DB <nl> - { <nl> - <nl> - <nl> - / * * Очень простая хэш - таблица . Предназначена для быстрой агрегации . Есть только необходимый минимум возможностей . <nl> - * Требования : <nl> - * - Key и Mapped - position independent типы ( для перемещения значений которых достаточно сделать memcpy ) . <nl> - * <nl> - * Желательно , чтобы Key был числом , или маленьким агрегатом ( типа UInt128 ) . <nl> - * <nl> - * Сценарий работы : <nl> - * - вставлять в хэш - таблицу значения ; <nl> - * - проитерироваться по имеющимся в ней значениям . <nl> - * <nl> - * Open addressing . <nl> - * Linear probing ( подходит , если хэш функция хорошая ! ) . <nl> - * Значение с нулевым ключём хранится отдельно . <nl> - * Удаления элементов нет . <nl> - * / <nl> - <nl> - <nl> - / * * Хэш функции , которые лучше чем тривиальная функция std : : hash . <nl> - * ( при агрегации по идентификатору посетителя , прирост производительности более чем в 5 раз ) <nl> - * / <nl> - template < typename T > struct default_hash ; <nl> - <nl> - template < typename T > <nl> - inline size_t default_hash_64 ( T key ) <nl> - { <nl> - union <nl> - { <nl> - T in ; <nl> - UInt64 out ; <nl> - } u ; <nl> - u . out = 0 ; <nl> - u . in = key ; <nl> - return intHash32 < 0 > ( u . out ) ; <nl> - } <nl> - <nl> - # define DEFAULT_HASH_64 ( T ) \ <nl> - template < > struct default_hash < T > \ <nl> - { \ <nl> - size_t operator ( ) ( T key ) const \ <nl> - { \ <nl> - return default_hash_64 < T > ( key ) ; \ <nl> - } \ <nl> - } ; <nl> - <nl> - DEFAULT_HASH_64 ( UInt8 ) <nl> - DEFAULT_HASH_64 ( UInt16 ) <nl> - DEFAULT_HASH_64 ( UInt32 ) <nl> - DEFAULT_HASH_64 ( UInt64 ) <nl> - DEFAULT_HASH_64 ( Int8 ) <nl> - DEFAULT_HASH_64 ( Int16 ) <nl> - DEFAULT_HASH_64 ( Int32 ) <nl> - DEFAULT_HASH_64 ( Int64 ) <nl> - DEFAULT_HASH_64 ( Float32 ) <nl> - DEFAULT_HASH_64 ( Float64 ) <nl> - <nl> - # undef DEFAULT_HASH_64 <nl> - <nl> - <nl> - / * * Способ проверить , что ключ нулевой , <nl> - * а также способ установить значение ключа в ноль . <nl> - * При этом , нулевой ключ всё - равно должен быть представлен только нулевыми байтами <nl> - * ( кроме , возможно , мусора из - за выравнивания ) . <nl> - * / <nl> - template < typename T > struct default_zero_traits <nl> - { <nl> - static inline bool check ( T x ) { return 0 = = x ; } <nl> - static inline void set ( T & x ) { x = 0 ; } <nl> - } ; <nl> - <nl> - <nl> - / * * Описание , как хэш - таблица будет расти . <nl> - * / <nl> - struct default_growth_traits <nl> - { <nl> - / * * Изначально выделить кусок памяти для 64K элементов . <nl> - * Уменьшите значение для лучшей кэш - локальности в случае маленького количества уникальных ключей . <nl> - * / <nl> - static const int INITIAL_SIZE_DEGREE = 16 ; <nl> - <nl> - / * * Степень роста хэш таблицы , пока не превышен порог размера . ( В 4 раза . ) <nl> - * / <nl> - static const int FAST_GROWTH_DEGREE = 2 ; <nl> - <nl> - / * * Порог размера , после которого степень роста уменьшается ( до роста в 2 раза ) - 8 миллионов элементов . <nl> - * После этого порога , максимально возможный оверхед по памяти будет всего лишь в 4 , а не в 8 раз . <nl> - * / <nl> - static const int GROWTH_CHANGE_THRESHOLD = 23 ; <nl> - } ; <nl> + # include < DB / Common / HashTable / HashMap . h > <nl> <nl> <nl> template <nl> < <nl> typename Key , <nl> typename Mapped , <nl> - typename Hash , <nl> - typename ZeroTraits , <nl> - typename GrowthTraits , <nl> - typename Allocator <nl> + typename Hash = DefaultHash < Key > , <nl> + typename Grower = HashTableGrower , <nl> + typename Allocator = HashTableAllocator <nl> > <nl> - class HashMap : private Allocator , private Hash / / / empty base optimization <nl> + class HashMapWithDump : public HashMap < Key , Mapped , Hash , Grower , Allocator > <nl> { <nl> - private : <nl> - friend class const_iterator ; <nl> - friend class iterator ; <nl> - <nl> - typedef std : : pair < Key , Mapped > Value ; / / / Без const Key для простоты . <nl> - typedef size_t HashValue ; <nl> - typedef HashMap < Key , Mapped , Hash , ZeroTraits , GrowthTraits , Allocator > Self ; <nl> - <nl> - size_t m_size ; / / / Количество элементов <nl> - Value * buf ; / / / Кусок памяти для всех элементов кроме элемента с ключём 0 . <nl> - UInt8 size_degree ; / / / Размер таблицы в виде степени двух <nl> - bool has_zero ; / / / Хэш - таблица содержит элемент со значением ключа = 0 . <nl> - <nl> - char zero_value_storage [ sizeof ( Value ) ] ; / / / Кусок памяти для элемента с ключём 0 . <nl> - <nl> - # ifdef DBMS_HASH_MAP_COUNT_COLLISIONS <nl> - mutable size_t collisions ; <nl> - # endif <nl> - <nl> - inline size_t hash ( const Key & x ) const { return Hash : : operator ( ) ( x ) ; } <nl> - inline size_t buf_size ( ) const { return 1 < < size_degree ; } <nl> - inline size_t buf_size_bytes ( ) const { return buf_size ( ) * sizeof ( Value ) ; } <nl> - inline size_t max_fill ( ) const { return 1 < < ( size_degree - 1 ) ; } <nl> - inline size_t mask ( ) const { return buf_size ( ) - 1 ; } <nl> - inline size_t place ( HashValue x ) const { return x & mask ( ) ; } <nl> - <nl> - inline Value * zero_value ( ) { return reinterpret_cast < Value * > ( zero_value_storage ) ; } <nl> - <nl> - <nl> - / / / Увеличить размер буфера в 2 ^ N раз <nl> - void resize ( ) <nl> - { <nl> - # ifdef DBMS_HASH_MAP_DEBUG_RESIZES <nl> - Stopwatch watch ; <nl> - # endif <nl> - <nl> - size_t old_size = buf_size ( ) ; <nl> - size_t old_size_bytes = buf_size_bytes ( ) ; <nl> - <nl> - size_degree + = size_degree > = GrowthTraits : : GROWTH_CHANGE_THRESHOLD <nl> - ? 1 <nl> - : GrowthTraits : : FAST_GROWTH_DEGREE ; <nl> - <nl> - / / / Расширим пространство . <nl> - buf = reinterpret_cast < Value * > ( Allocator : : realloc ( buf , old_size_bytes , buf_size_bytes ( ) ) ) ; <nl> - <nl> - / * * Теперь некоторые элементы может потребоваться переместить на новое место . <nl> - * Элемент может остаться на месте , или переместиться в новое место " справа " , <nl> - * или переместиться левее по цепочке разрешения коллизий , из - за того , что элементы левее него были перемещены в новое место " справа " . <nl> - * / <nl> - for ( size_t i = 0 ; i < old_size ; + + i ) <nl> - if ( ! ZeroTraits : : check ( buf [ i ] . first ) ) <nl> - reinsert ( buf [ i ] ) ; <nl> - <nl> - # ifdef DBMS_HASH_MAP_DEBUG_RESIZES <nl> - watch . stop ( ) ; <nl> - std : : cerr < < std : : fixed < < std : : setprecision ( 3 ) <nl> - < < " Resize from " < < old_size < < " to " < < buf_size ( ) < < " took " < < watch . elapsedSeconds ( ) < < " sec . " <nl> - < < std : : endl ; <nl> - # endif <nl> - } <nl> - <nl> - <nl> - / * * Вставить в новый буфер значение , которое было в старом буфере . <nl> - * Используется при увеличении размера буфера . <nl> - * / <nl> - void reinsert ( Value & x ) <nl> - { <nl> - size_t place_value = place ( hash ( x . first ) ) ; <nl> - <nl> - / / / Если элемент на своём месте . <nl> - if ( & x = = & buf [ place_value ] ) <nl> - return ; <nl> - <nl> - / / / Вычисление нового места , с учётом цепочки разрешения коллизий . <nl> - while ( ! ZeroTraits : : check ( buf [ place_value ] . first ) & & x ! = buf [ place_value ] ) <nl> - { <nl> - + + place_value ; <nl> - place_value & = mask ( ) ; <nl> - # ifdef DBMS_HASH_MAP_COUNT_COLLISIONS <nl> - + + collisions ; <nl> - # endif <nl> - } <nl> - <nl> - / / / Если элемент остался на своём месте в старой цепочке разрешения коллизий . <nl> - if ( x = = buf [ place_value ] ) <nl> - return ; <nl> - <nl> - / / / Копирование на новое место и зануление старого . <nl> - memcpy ( & buf [ place_value ] , & x , sizeof ( x ) ) ; <nl> - ZeroTraits : : set ( x . first ) ; <nl> - <nl> - / / / Потом на старое место могут переместиться элементы , которые раньше были в коллизии с этим . <nl> - } <nl> - <nl> - <nl> public : <nl> - typedef Key key_type ; <nl> - typedef Mapped mapped_type ; <nl> - typedef Value value_type ; <nl> - <nl> - <nl> - HashMap ( ) : <nl> - m_size ( 0 ) , <nl> - size_degree ( GrowthTraits : : INITIAL_SIZE_DEGREE ) , <nl> - has_zero ( false ) <nl> - { <nl> - ZeroTraits : : set ( zero_value ( ) - > first ) ; <nl> - buf = reinterpret_cast < Value * > ( Allocator : : alloc ( buf_size_bytes ( ) ) ) ; <nl> - <nl> - # ifdef DBMS_HASH_MAP_COUNT_COLLISIONS <nl> - collisions = 0 ; <nl> - # endif <nl> - } <nl> - <nl> - ~ HashMap ( ) <nl> - { <nl> - if ( ! __has_trivial_destructor ( Key ) | | ! __has_trivial_destructor ( Mapped ) ) <nl> - for ( iterator it = begin ( ) ; it ! = end ( ) ; + + it ) <nl> - it - > ~ Value ( ) ; <nl> - <nl> - Allocator : : free ( buf , buf_size_bytes ( ) ) ; <nl> - } <nl> - <nl> - <nl> - class iterator <nl> - { <nl> - Self * container ; <nl> - Value * ptr ; <nl> - <nl> - friend class HashMap ; <nl> - <nl> - iterator ( Self * container_ , Value * ptr_ ) : container ( container_ ) , ptr ( ptr_ ) { } <nl> - <nl> - public : <nl> - iterator ( ) { } <nl> - <nl> - bool operator = = ( const iterator & rhs ) const { return ptr = = rhs . ptr ; } <nl> - bool operator ! = ( const iterator & rhs ) const { return ptr ! = rhs . ptr ; } <nl> - <nl> - iterator & operator + + ( ) <nl> - { <nl> - if ( unlikely ( ZeroTraits : : check ( ptr - > first ) ) ) <nl> - ptr = container - > buf ; <nl> - else <nl> - + + ptr ; <nl> - <nl> - while ( ptr < container - > buf + container - > buf_size ( ) & & ZeroTraits : : check ( ptr - > first ) ) <nl> - + + ptr ; <nl> - <nl> - return * this ; <nl> - } <nl> - <nl> - Value & operator * ( ) const { return * ptr ; } <nl> - Value * operator - > ( ) const { return ptr ; } <nl> - } ; <nl> - <nl> - <nl> - class const_iterator <nl> - { <nl> - const Self * container ; <nl> - const Value * ptr ; <nl> - <nl> - friend class HashMap ; <nl> - <nl> - const_iterator ( const Self * container_ , const Value * ptr_ ) : container ( container_ ) , ptr ( ptr_ ) { } <nl> - <nl> - public : <nl> - const_iterator ( ) { } <nl> - const_iterator ( const iterator & rhs ) : container ( rhs . container ) , ptr ( rhs . ptr ) { } <nl> - <nl> - bool operator = = ( const const_iterator & rhs ) const { return ptr = = rhs . ptr ; } <nl> - bool operator ! = ( const const_iterator & rhs ) const { return ptr ! = rhs . ptr ; } <nl> - <nl> - const_iterator & operator + + ( ) <nl> - { <nl> - if ( unlikely ( ZeroTraits : : check ( ptr - > first ) ) ) <nl> - ptr = container - > buf ; <nl> - else <nl> - + + ptr ; <nl> - <nl> - while ( ptr < container - > buf + container - > buf_size ( ) & & ZeroTraits : : check ( ptr - > first ) ) <nl> - + + ptr ; <nl> - <nl> - return * this ; <nl> - } <nl> - <nl> - const Value & operator * ( ) const { return * ptr ; } <nl> - const Value * operator - > ( ) const { return ptr ; } <nl> - } ; <nl> - <nl> - <nl> - const_iterator begin ( ) const <nl> - { <nl> - if ( has_zero ) <nl> - return const_iterator ( this , zero_value ( ) ) ; <nl> - <nl> - const Value * ptr = buf ; <nl> - while ( ptr < buf + buf_size ( ) & & ZeroTraits : : check ( ptr - > first ) ) <nl> - + + ptr ; <nl> - <nl> - return const_iterator ( this , ptr ) ; <nl> - } <nl> - <nl> - iterator begin ( ) <nl> - { <nl> - if ( has_zero ) <nl> - return iterator ( this , zero_value ( ) ) ; <nl> - <nl> - Value * ptr = buf ; <nl> - while ( ptr < buf + buf_size ( ) & & ZeroTraits : : check ( ptr - > first ) ) <nl> - + + ptr ; <nl> - <nl> - return iterator ( this , ptr ) ; <nl> - } <nl> - <nl> - const_iterator end ( ) const { return const_iterator ( this , buf + buf_size ( ) ) ; } <nl> - iterator end ( ) { return iterator ( this , buf + buf_size ( ) ) ; } <nl> - <nl> - <nl> - Mapped & operator [ ] ( Key x ) <nl> - { <nl> - if ( ZeroTraits : : check ( x ) ) <nl> - { <nl> - if ( ! has_zero ) <nl> - { <nl> - + + m_size ; <nl> - has_zero = true ; <nl> - } <nl> - return zero_value ( ) - > second ; <nl> - } <nl> - <nl> - size_t place_value = place ( hash ( x ) ) ; <nl> - while ( ! ZeroTraits : : check ( buf [ place_value ] . first ) & & buf [ place_value ] . first ! = x ) <nl> - { <nl> - + + place_value ; <nl> - place_value & = mask ( ) ; <nl> - # ifdef DBMS_HASH_MAP_COUNT_COLLISIONS <nl> - + + collisions ; <nl> - # endif <nl> - } <nl> - <nl> - if ( ! ZeroTraits : : check ( buf [ place_value ] . first ) ) <nl> - return buf [ place_value ] . second ; <nl> - <nl> - new ( & buf [ place_value ] . first ) Key ( x ) ; <nl> - new ( & buf [ place_value ] . second ) Mapped ( ) ; <nl> - + + m_size ; <nl> - <nl> - / / std : : cerr < < " m_size : " < < m_size < < " , " < < " max_fill ( ) : " < < max_fill ( ) < < std : : endl ; <nl> - / / std : : cerr < < " m_size : " < < m_size < < std : : endl ; <nl> - / / std : : cerr < < " max_fill : " < < max_fill ( ) < < std : : endl ; <nl> - / / std : : cerr < < " m_size > ( 1 < < ( size_degree - 1 ) ) : " < < ( m_size > ( 1 < < ( size_degree - 1 ) ) ) < < std : : endl ; <nl> - / / std : : cerr < < " ! ! buf : " < < buf < < std : : endl ; <nl> - <nl> - if ( unlikely ( m_size > max_fill ( ) ) ) <nl> - { <nl> - / / std : : cerr < < " resize " < < std : : endl ; <nl> - resize ( ) ; <nl> - return ( * this ) [ x ] ; <nl> - } <nl> - <nl> - / / std : : cerr < < " size_degree : " < < ( int ) size_degree < < std : : endl ; <nl> - / / std : : cerr < < " ! ! buf : " < < buf < < std : : endl ; <nl> - <nl> - return buf [ place_value ] . second ; <nl> - } <nl> - <nl> - # ifdef DBMS_HASH_MAP_COUNT_COLLISIONS <nl> - size_t getCollisions ( ) const <nl> - { <nl> - return collisions ; <nl> - } <nl> - # endif <nl> - <nl> void dump ( ) const <nl> { <nl> - / / std : : cerr < < " buf : " < < buf < < std : : endl ; <nl> - for ( size_t i = 0 ; i < buf_size ( ) ; + + i ) <nl> + for ( size_t i = 0 ; i < this - > grower . bufSize ( ) ; + + i ) <nl> { <nl> - if ( ZeroTraits : : check ( buf [ i ] . first ) ) <nl> + if ( this - > buf [ i ] . isZero ( * this ) ) <nl> std : : cerr < < " [ ] " ; <nl> else <nl> - std : : cerr < < ' [ ' < < buf [ i ] . first . data < < " , " < < buf [ i ] . second < < ' ] ' ; <nl> + std : : cerr < < ' [ ' < < this - > buf [ i ] . getValue ( ) . first . data < < " , " < < this - > buf [ i ] . getValue ( ) . second < < ' ] ' ; <nl> } <nl> std : : cerr < < std : : endl ; <nl> } <nl> - <nl> - size_t size ( ) const <nl> - { <nl> - return m_size ; <nl> - } <nl> - } ; <nl> - <nl> - <nl> - class HashTableAllocator <nl> - { <nl> - public : <nl> - / / / Выделить кусок памяти и заполнить его нулями . <nl> - void * alloc ( size_t size ) <nl> - { <nl> - void * buf = : : calloc ( size , 1 ) ; <nl> - if ( nullptr = = buf ) <nl> - throwFromErrno ( " HashTableAllocator : Cannot calloc . " , ErrorCodes : : CANNOT_ALLOCATE_MEMORY ) ; <nl> - <nl> - return buf ; <nl> - } <nl> - <nl> - / / / Освободить память . <nl> - void free ( void * buf , size_t size ) <nl> - { <nl> - : : free ( buf ) ; <nl> - } <nl> - <nl> - / * * Увеличить размер куска памяти . <nl> - * Содержимое старого куска памяти переезжает в начало нового . <nl> - * Оставшаяся часть заполняется нулями . <nl> - * Положение куска памяти может измениться . <nl> - * / <nl> - void * realloc ( void * buf , size_t old_size , size_t new_size ) <nl> - { <nl> - buf = : : realloc ( buf , new_size ) ; <nl> - if ( nullptr = = buf ) <nl> - throwFromErrno ( " HashTableAllocator : Cannot realloc . " , ErrorCodes : : CANNOT_ALLOCATE_MEMORY ) ; <nl> - <nl> - memset ( reinterpret_cast < char * > ( buf ) + old_size , 0 , new_size - old_size ) ; <nl> - return buf ; <nl> - } <nl> - } ; <nl> - <nl> - <nl> - template < size_t N > <nl> - class HashTableAllocatorWithStackMemory : private HashTableAllocator <nl> - { <nl> - private : <nl> - char stack_memory [ N ] { } ; <nl> - <nl> - public : <nl> - void * alloc ( size_t size ) <nl> - { <nl> - / / std : : cerr < < " alloc ( ) : size : " < < size < < std : : endl ; <nl> - if ( size < = N ) <nl> - return & stack_memory [ 0 ] ; <nl> - <nl> - return HashTableAllocator : : alloc ( size ) ; <nl> - } <nl> - <nl> - void free ( void * buf , size_t size ) <nl> - { <nl> - if ( size > N ) <nl> - HashTableAllocator : : free ( buf , size ) ; <nl> - } <nl> - <nl> - void * realloc ( void * buf , size_t old_size , size_t new_size ) <nl> - { <nl> - / / std : : cerr < < " old_size : " < < old_size < < " , new_size : " < < new_size < < std : : endl ; <nl> - <nl> - if ( new_size < = N ) <nl> - return buf ; <nl> - <nl> - if ( old_size > N ) <nl> - return HashTableAllocator : : realloc ( buf , old_size , new_size ) ; <nl> - <nl> - buf = : : malloc ( new_size ) ; <nl> - if ( nullptr = = buf ) <nl> - throwFromErrno ( " HashTableAllocator : Cannot malloc . " , ErrorCodes : : CANNOT_ALLOCATE_MEMORY ) ; <nl> - <nl> - memcpy ( buf , stack_memory , old_size ) ; <nl> - memset ( reinterpret_cast < char * > ( buf ) + old_size , 0 , new_size - old_size ) ; <nl> - <nl> - return buf ; <nl> - } <nl> } ; <nl> <nl> <nl> - } <nl> - <nl> - <nl> struct TrivialHash <nl> { <nl> size_t operator ( ) ( UInt64 x ) const { return x ; } <nl> size_t operator ( ) ( StringRef x ) const { return DB : : parse < UInt64 > ( x . data ) ; } <nl> } ; <nl> <nl> - struct GrowthTraits : public DB : : default_growth_traits <nl> + struct Grower : public HashTableGrower <nl> { <nl> - static const int INITIAL_SIZE_DEGREE = 2 ; <nl> - static const int FAST_GROWTH_DEGREE = 1 ; <nl> + static const size_t initial_size_degree = 2 ; <nl> + Grower ( ) { size_degree = initial_size_degree ; } <nl> + void increaseSize ( ) { + + size_degree ; } <nl> } ; <nl> <nl> - <nl> int main ( int argc , char * * argv ) <nl> { <nl> - typedef DB : : HashMap < <nl> + typedef HashMapWithDump < <nl> StringRef , <nl> UInt64 , <nl> TrivialHash , <nl> - ZeroTraits , <nl> - GrowthTraits , <nl> - DB : : HashTableAllocatorWithStackMemory < 4 * 24 > > Map ; <nl> + Grower , <nl> + HashTableAllocatorWithStackMemory < 4 * 24 > > Map ; <nl> <nl> Map map ; <nl> <nl>
dbms : unified hash tables : development [ # METR - 2944 ] .
ClickHouse/ClickHouse
bbbc5c2b694f102020581c5d3f75332dd70031bb
2014-04-28T03:25:05Z
mmm a / modules / gapi / src / backends / onnx / gonnxbackend . cpp <nl> ppp b / modules / gapi / src / backends / onnx / gonnxbackend . cpp <nl> inline void preprocess ( const cv : : Mat & src , <nl> / / No layout or dimension transformations done here ! <nl> / / TODO : This needs to be aligned across all NN backends . <nl> GAPI_Assert ( toCV ( ti . type ) = = CV_32F & & " Only 32F model input is supported for 32F data " ) ; <nl> - GAPI_Assert ( toORT ( src . size ) = = ti . dims & & " 32F tensor dimensions should match with NN input " ) ; <nl> - GAPI_Assert ( ! ti . is_dynamic & & " Dynamic inputs are not supported for this case " ) ; <nl> + const auto tensor_dims = toORT ( src . size ) ; <nl> + if ( tensor_dims . size ( ) = = ti . dims . size ( ) ) { <nl> + for ( size_t i = 0 ; i < ti . dims . size ( ) ; + + i ) { <nl> + GAPI_Assert ( ( ti . dims [ i ] = = - 1 | | ti . dims [ i ] = = tensor_dims [ i ] ) & & <nl> + " 32F tensor dimensions should match with all non - dynamic NN input dimensions " ) ; <nl> + } <nl> + } else { <nl> + GAPI_Assert ( false & & " 32F tensor size should match with NN input " ) ; <nl> + } <nl> + <nl> dst = src ; <nl> } else { <nl> / / 8U input : full preprocessing path <nl> mmm a / modules / gapi / test / infer / gapi_infer_onnx_test . cpp <nl> ppp b / modules / gapi / test / infer / gapi_infer_onnx_test . cpp <nl> <nl> # include < onnxruntime_cxx_api . h > <nl> # include < ade / util / iota_range . hpp > <nl> <nl> + # include < opencv2 / gapi / own / convert . hpp > <nl> # include < opencv2 / gapi / infer / onnx . hpp > <nl> <nl> namespace { <nl> - <nl> struct ONNXInitPath { <nl> ONNXInitPath ( ) { <nl> const char * env_path = getenv ( " OPENCV_GAPI_ONNX_MODEL_PATH " ) ; <nl> - if ( env_path ) <nl> + if ( env_path ) { <nl> cvtest : : addDataSearchPath ( env_path ) ; <nl> + } <nl> } <nl> } ; <nl> static ONNXInitPath g_init_path ; <nl> <nl> - cv : : Mat initMatrixRandU ( int type , cv : : Size sz_in ) <nl> - { <nl> - cv : : Mat in_mat1 = cv : : Mat ( sz_in , type ) ; <nl> + cv : : Mat initMatrixRandU ( const int type , const cv : : Size & sz_in ) { <nl> + const cv : : Mat in_mat1 = cv : : Mat ( sz_in , type ) ; <nl> <nl> - if ( CV_MAT_DEPTH ( type ) < CV_32F ) <nl> - { <nl> + if ( CV_MAT_DEPTH ( type ) < CV_32F ) { <nl> cv : : randu ( in_mat1 , cv : : Scalar : : all ( 0 ) , cv : : Scalar : : all ( 255 ) ) ; <nl> - } <nl> - else <nl> - { <nl> + } else { <nl> const int fscale = 256 ; / / avoid bits near ULP , generate stable test input <nl> cv : : Mat in_mat32s ( in_mat1 . size ( ) , CV_MAKE_TYPE ( CV_32S , CV_MAT_CN ( type ) ) ) ; <nl> cv : : randu ( in_mat32s , cv : : Scalar : : all ( 0 ) , cv : : Scalar : : all ( 255 * fscale ) ) ; <nl> cv : : Mat initMatrixRandU ( int type , cv : : Size sz_in ) <nl> } <nl> return in_mat1 ; <nl> } <nl> - } <nl> + } / / anonymous namespace <nl> namespace opencv_test <nl> { <nl> namespace { <nl> / / FIXME : taken from the DNN module <nl> - void normAssert ( cv : : InputArray ref , cv : : InputArray test , <nl> + void normAssert ( const cv : : InputArray & ref , const cv : : InputArray & test , <nl> const char * comment / * = " " * / , <nl> - double l1 = 0 . 00001 , double lInf = 0 . 0001 ) <nl> - { <nl> - double normL1 = cvtest : : norm ( ref , test , cv : : NORM_L1 ) / ref . getMat ( ) . total ( ) ; <nl> + const double l1 = 0 . 00001 , const double lInf = 0 . 0001 ) { <nl> + const double normL1 = cvtest : : norm ( ref , test , cv : : NORM_L1 ) / ref . getMat ( ) . total ( ) ; <nl> EXPECT_LE ( normL1 , l1 ) < < comment ; <nl> <nl> - double normInf = cvtest : : norm ( ref , test , cv : : NORM_INF ) ; <nl> + const double normInf = cvtest : : norm ( ref , test , cv : : NORM_INF ) ; <nl> EXPECT_LE ( normInf , lInf ) < < comment ; <nl> } <nl> <nl> - std : : string findModel ( const std : : string & model_name ) <nl> - { <nl> - return findDataFile ( " vision / classification / squeezenet / model / " + model_name + " . onnx " , false ) ; <nl> + inline std : : string findModel ( const std : : string & model_name ) { <nl> + return findDataFile ( " vision / " + model_name + " . onnx " , false ) ; <nl> } <nl> <nl> - inline void preprocess ( const cv : : Mat & src , <nl> - cv : : Mat & dst , <nl> - const cv : : Scalar & mean , <nl> - const cv : : Scalar & std ) { <nl> - int new_h = 224 ; <nl> - int new_w = 224 ; <nl> - cv : : Mat tmp , nmat , cvt ; <nl> - cv : : resize ( src , dst , cv : : Size ( new_w , new_h ) ) ; <nl> - dst . convertTo ( cvt , CV_32F , 1 . f / 255 ) ; <nl> - nmat = cvt - mean ; <nl> - tmp = nmat / std ; <nl> - dst . create ( cv : : Size ( new_w , new_h * src . channels ( ) ) , CV_32F ) ; <nl> + inline void toCHW ( const cv : : Mat & src , cv : : Mat & dst ) { <nl> + dst . create ( cv : : Size ( src . cols , src . rows * src . channels ( ) ) , CV_32F ) ; <nl> std : : vector < cv : : Mat > planes ; <nl> for ( int i = 0 ; i < src . channels ( ) ; + + i ) { <nl> - planes . push_back ( dst . rowRange ( i * new_h , ( i + 1 ) * new_h ) ) ; <nl> + planes . push_back ( dst . rowRange ( i * src . rows , ( i + 1 ) * src . rows ) ) ; <nl> } <nl> - cv : : split ( tmp , planes ) ; <nl> + cv : : split ( src , planes ) ; <nl> } <nl> <nl> - void InferONNX ( const std : : string & model_path , <nl> - const cv : : Mat & in , <nl> - cv : : Mat & out , <nl> - const cv : : Scalar & mean , <nl> - const cv : : Scalar & std ) <nl> - { <nl> - / / FIXME : It must be a FIXTURE test ! <nl> - Ort : : Env env ( ORT_LOGGING_LEVEL_WARNING , " test " ) ; <nl> - Ort : : SessionOptions session_options ; <nl> - Ort : : Session session ( env , model_path . data ( ) , session_options ) ; <nl> - auto input_node_dims = / / 0 - one input <nl> - session . GetInputTypeInfo ( 0 ) . GetTensorTypeAndShapeInfo ( ) . GetShape ( ) ; <nl> - auto output_node_dims = / / 0 - one output <nl> - session . GetOutputTypeInfo ( 0 ) . GetTensorTypeAndShapeInfo ( ) . GetShape ( ) ; <nl> - Ort : : AllocatorWithDefaultOptions allocator ; <nl> - char * in_node_name_p = session . GetInputName ( 0 , allocator ) ; <nl> - char * out_node_name_p = session . GetOutputName ( 0 , allocator ) ; <nl> - std : : string in_node_name ( in_node_name_p ) ; <nl> - std : : string out_node_name ( out_node_name_p ) ; <nl> - allocator . Free ( in_node_name_p ) ; <nl> - allocator . Free ( out_node_name_p ) ; <nl> - <nl> - auto memory_info = Ort : : MemoryInfo : : CreateCpu ( OrtArenaAllocator , OrtMemTypeDefault ) ; <nl> - cv : : Mat dst ; <nl> - preprocess ( in , dst , mean , std ) ; <nl> - <nl> - out . create ( std : : vector < int > ( output_node_dims . begin ( ) , <nl> - output_node_dims . end ( ) ) , CV_32F ) ; / / empty output Mat <nl> - auto in_tensor = Ort : : Value : : CreateTensor < float > ( memory_info , <nl> - dst . ptr < float > ( ) , <nl> - dst . total ( ) , <nl> - input_node_dims . data ( ) , <nl> - input_node_dims . size ( ) ) ; <nl> - auto out_tensor = Ort : : Value : : CreateTensor < float > ( memory_info , <nl> - out . ptr < float > ( ) , <nl> - out . total ( ) , <nl> - output_node_dims . data ( ) , <nl> - output_node_dims . size ( ) ) ; <nl> - std : : vector < const char * > in_names = { in_node_name . data ( ) } ; <nl> - std : : vector < const char * > out_names = { out_node_name . data ( ) } ; <nl> - session . Run ( Ort : : RunOptions { nullptr } , <nl> - in_names . data ( ) , <nl> - & in_tensor , <nl> - session . GetInputCount ( ) , <nl> - out_names . data ( ) , <nl> - & out_tensor , <nl> - session . GetOutputCount ( ) ) ; <nl> + inline int toCV ( const ONNXTensorElementDataType prec ) { <nl> + switch ( prec ) { <nl> + case ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8 : return CV_8U ; <nl> + case ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT : return CV_32F ; <nl> + default : GAPI_Assert ( false & & " Unsupported data type " ) ; <nl> + } <nl> + return - 1 ; <nl> } <nl> <nl> - } / / anonymous namespace <nl> + inline std : : vector < int64_t > toORT ( const cv : : MatSize & sz ) { <nl> + return cv : : to_own < int64_t > ( sz ) ; <nl> + } <nl> <nl> - TEST ( ONNX , Infer ) <nl> - { <nl> - cv : : Mat in_mat1 , out_gapi , out_onnx ; <nl> - std : : string model_path = findModel ( " squeezenet1 . 0 - 9 " ) ; <nl> - / / NOTE : All tests chek " random " image <nl> - / / Ideally it should be a real image <nl> - in_mat1 = initMatrixRandU ( CV_8UC3 , cv : : Size { 640 , 480 } ) ; <nl> + inline std : : vector < const char * > getCharNames ( const std : : vector < std : : string > & names ) { <nl> + std : : vector < const char * > out_vec ; <nl> + for ( const auto & el : names ) { <nl> + out_vec . push_back ( el . data ( ) ) ; <nl> + } <nl> + return out_vec ; <nl> + } <nl> <nl> - cv : : Scalar mean = { 0 . 485 , 0 . 456 , 0 . 406 } ; <nl> - cv : : Scalar std = { 0 . 229 , 0 . 224 , 0 . 225 } ; <nl> + inline void copyToOut ( const cv : : Mat & in , cv : : Mat & out ) { <nl> + GAPI_Assert ( in . depth ( ) = = CV_32F ) ; <nl> + GAPI_Assert ( in . size = = out . size ) ; <nl> + const float * const inptr = in . ptr < float > ( ) ; <nl> + float * const optr = out . ptr < float > ( ) ; <nl> + const int size = in . total ( ) ; <nl> + for ( int i = 0 ; i < size ; + + i ) { <nl> + optr [ i ] = inptr [ i ] ; <nl> + } <nl> + } <nl> <nl> - / / ONNX_API code <nl> - InferONNX ( model_path , in_mat1 , out_onnx , mean , std ) ; <nl> + void remapYolo ( const std : : unordered_map < std : : string , cv : : Mat > & onnx , <nl> + std : : unordered_map < std : : string , cv : : Mat > & gapi ) { <nl> + GAPI_Assert ( onnx . size ( ) = = 1u ) ; <nl> + GAPI_Assert ( gapi . size ( ) = = 1u ) ; <nl> + / / Result from Run method <nl> + const cv : : Mat & in = onnx . begin ( ) - > second ; <nl> + / / Configured output <nl> + cv : : Mat & out = gapi . begin ( ) - > second ; <nl> + / / Simple copy <nl> + copyToOut ( in , out ) ; <nl> + } <nl> + <nl> + void remapSsdPorts ( const std : : unordered_map < std : : string , cv : : Mat > & onnx , <nl> + std : : unordered_map < std : : string , cv : : Mat > & gapi ) { <nl> + / / Result from Run method <nl> + const cv : : Mat & in_num = onnx . at ( " num_detections : 0 " ) ; <nl> + const cv : : Mat & in_boxes = onnx . at ( " detection_boxes : 0 " ) ; <nl> + const cv : : Mat & in_scores = onnx . at ( " detection_scores : 0 " ) ; <nl> + const cv : : Mat & in_classes = onnx . at ( " detection_classes : 0 " ) ; <nl> + / / Configured outputs <nl> + cv : : Mat & out_boxes = gapi . at ( " out1 " ) ; <nl> + cv : : Mat & out_classes = gapi . at ( " out2 " ) ; <nl> + cv : : Mat & out_scores = gapi . at ( " out3 " ) ; <nl> + cv : : Mat & out_num = gapi . at ( " out4 " ) ; <nl> + / / Simple copy for outputs <nl> + copyToOut ( in_num , out_num ) ; <nl> + copyToOut ( in_boxes , out_boxes ) ; <nl> + copyToOut ( in_scores , out_scores ) ; <nl> + copyToOut ( in_classes , out_classes ) ; <nl> + } <nl> + <nl> + class ONNXtest : public : : testing : : Test { <nl> + public : <nl> + std : : string model_path ; <nl> + size_t num_in , num_out ; <nl> + std : : vector < cv : : Mat > out_gapi ; <nl> + std : : vector < cv : : Mat > out_onnx ; <nl> + cv : : Mat in_mat1 ; <nl> <nl> + ONNXtest ( ) { <nl> + env = Ort : : Env ( ORT_LOGGING_LEVEL_WARNING , " test " ) ; <nl> + memory_info = Ort : : MemoryInfo : : CreateCpu ( OrtArenaAllocator , OrtMemTypeDefault ) ; <nl> + out_gapi . resize ( 1 ) ; <nl> + out_onnx . resize ( 1 ) ; <nl> + / / FIXME : All tests chek " random " image <nl> + / / Ideally it should be a real image <nl> + in_mat1 = initMatrixRandU ( CV_8UC3 , cv : : Size { 640 , 480 } ) ; <nl> + } <nl> + <nl> + template < typename T > <nl> + void infer ( const std : : vector < cv : : Mat > & ins , <nl> + std : : vector < cv : : Mat > & outs ) { <nl> + / / Prepare session <nl> + session = Ort : : Session ( env , model_path . data ( ) , session_options ) ; <nl> + num_in = session . GetInputCount ( ) ; <nl> + num_out = session . GetOutputCount ( ) ; <nl> + GAPI_Assert ( num_in = = ins . size ( ) ) ; <nl> + in_node_names . clear ( ) ; <nl> + out_node_names . clear ( ) ; <nl> + / / Inputs Run params <nl> + std : : vector < Ort : : Value > in_tensors ; <nl> + for ( size_t i = 0 ; i < num_in ; + + i ) { <nl> + char * in_node_name_p = session . GetInputName ( i , allocator ) ; <nl> + in_node_names . push_back ( std : : string ( in_node_name_p ) ) ; <nl> + allocator . Free ( in_node_name_p ) ; <nl> + in_node_dims = toORT ( ins [ i ] . size ) ; <nl> + in_tensors . emplace_back ( Ort : : Value : : CreateTensor < T > ( memory_info , <nl> + const_cast < T * > ( ins [ i ] . ptr < T > ( ) ) , <nl> + ins [ i ] . total ( ) , <nl> + in_node_dims . data ( ) , <nl> + in_node_dims . size ( ) ) ) ; <nl> + } <nl> + / / Outputs Run params <nl> + for ( size_t i = 0 ; i < num_out ; + + i ) { <nl> + char * out_node_name_p = session . GetOutputName ( i , allocator ) ; <nl> + out_node_names . push_back ( std : : string ( out_node_name_p ) ) ; <nl> + allocator . Free ( out_node_name_p ) ; <nl> + } <nl> + / / Input / output order by names <nl> + const auto in_run_names = getCharNames ( in_node_names ) ; <nl> + const auto out_run_names = getCharNames ( out_node_names ) ; <nl> + / / Run <nl> + auto result = session . Run ( Ort : : RunOptions { nullptr } , <nl> + in_run_names . data ( ) , <nl> + & in_tensors . front ( ) , <nl> + num_in , <nl> + out_run_names . data ( ) , <nl> + num_out ) ; <nl> + / / Copy outputs <nl> + GAPI_Assert ( result . size ( ) = = num_out ) ; <nl> + outs . resize ( num_out ) ; <nl> + for ( size_t i = 0 ; i < num_out ; + + i ) { <nl> + const auto info = result [ i ] . GetTensorTypeAndShapeInfo ( ) ; <nl> + const auto shape = info . GetShape ( ) ; <nl> + const auto type = info . GetElementType ( ) ; <nl> + cv : : Mat mt ( std : : vector < int > ( shape . begin ( ) , shape . end ( ) ) , toCV ( type ) , <nl> + reinterpret_cast < void * > ( result [ i ] . GetTensorMutableData < uint8_t * > ( ) ) ) ; <nl> + mt . copyTo ( outs [ i ] ) ; <nl> + } <nl> + } <nl> + / / One input / output overload <nl> + template < typename T > <nl> + void infer ( const cv : : Mat & in , cv : : Mat & out ) { <nl> + std : : vector < cv : : Mat > result ; <nl> + infer < T > ( { in } , result ) ; <nl> + GAPI_Assert ( result . size ( ) = = 1u ) ; <nl> + out = result . front ( ) ; <nl> + } <nl> + <nl> + void validate ( ) { <nl> + GAPI_Assert ( ! out_gapi . empty ( ) & & ! out_onnx . empty ( ) ) ; <nl> + ASSERT_EQ ( out_gapi . size ( ) , out_onnx . size ( ) ) ; <nl> + const auto size = out_gapi . size ( ) ; <nl> + for ( size_t i = 0 ; i < size ; + + i ) { <nl> + normAssert ( out_onnx [ i ] , out_gapi [ i ] , " Test outputs " ) ; <nl> + } <nl> + } <nl> + <nl> + void useModel ( const std : : string & model_name ) { <nl> + model_path = findModel ( model_name ) ; <nl> + } <nl> + private : <nl> + Ort : : Env env { nullptr } ; <nl> + Ort : : MemoryInfo memory_info { nullptr } ; <nl> + Ort : : AllocatorWithDefaultOptions allocator ; <nl> + Ort : : SessionOptions session_options ; <nl> + Ort : : Session session { nullptr } ; <nl> + <nl> + std : : vector < int64_t > in_node_dims ; <nl> + std : : vector < std : : string > in_node_names ; <nl> + std : : vector < std : : string > out_node_names ; <nl> + } ; <nl> + <nl> + class ONNXClassificationTest : public ONNXtest { <nl> + public : <nl> + const cv : : Scalar mean = { 0 . 485 , 0 . 456 , 0 . 406 } ; <nl> + const cv : : Scalar std = { 0 . 229 , 0 . 224 , 0 . 225 } ; <nl> + <nl> + void preprocess ( const cv : : Mat & src , cv : : Mat & dst ) { <nl> + const int new_h = 224 ; <nl> + const int new_w = 224 ; <nl> + cv : : Mat tmp , cvt , rsz ; <nl> + cv : : resize ( src , rsz , cv : : Size ( new_w , new_h ) ) ; <nl> + rsz . convertTo ( cvt , CV_32F , 1 . f / 255 ) ; <nl> + tmp = ( cvt - mean ) / std ; <nl> + toCHW ( tmp , dst ) ; <nl> + dst = dst . reshape ( 1 , { 1 , 3 , new_h , new_w } ) ; <nl> + } <nl> + } ; <nl> + <nl> + class ONNXGRayScaleTest : public ONNXtest { <nl> + public : <nl> + void preprocess ( const cv : : Mat & src , cv : : Mat & dst ) { <nl> + const int new_h = 64 ; <nl> + const int new_w = 64 ; <nl> + cv : : Mat cvc , rsz , cvt ; <nl> + cv : : cvtColor ( src , cvc , cv : : COLOR_BGR2GRAY ) ; <nl> + cv : : resize ( cvc , rsz , cv : : Size ( new_w , new_h ) ) ; <nl> + rsz . convertTo ( cvt , CV_32F ) ; <nl> + toCHW ( cvt , dst ) ; <nl> + dst = dst . reshape ( 1 , { 1 , 1 , new_h , new_w } ) ; <nl> + } <nl> + } ; <nl> + } / / anonymous namespace <nl> + <nl> + TEST_F ( ONNXClassificationTest , Infer ) <nl> + { <nl> + useModel ( " classification / squeezenet / model / squeezenet1 . 0 - 9 " ) ; <nl> + / / ONNX_API code <nl> + cv : : Mat processed_mat ; <nl> + preprocess ( in_mat1 , processed_mat ) ; <nl> + infer < float > ( processed_mat , out_onnx . front ( ) ) ; <nl> / / G_API code <nl> G_API_NET ( SqueezNet , < cv : : GMat ( cv : : GMat ) > , " squeeznet " ) ; <nl> cv : : GMat in ; <nl> TEST ( ONNX , Infer ) <nl> cv : : GComputation comp ( cv : : GIn ( in ) , cv : : GOut ( out ) ) ; <nl> / / NOTE : We have to normalize U8 tensor <nl> / / so cfgMeanStd ( ) is here <nl> - auto net = cv : : gapi : : onnx : : Params < SqueezNet > { model_path } . cfgMeanStd ( { mean } , { std } ) ; <nl> + auto net = cv : : gapi : : onnx : : Params < SqueezNet > { model_path } . cfgMeanStd ( { mean } , { std } ) ; <nl> comp . apply ( cv : : gin ( in_mat1 ) , <nl> - cv : : gout ( out_gapi ) , <nl> + cv : : gout ( out_gapi . front ( ) ) , <nl> cv : : compile_args ( cv : : gapi : : networks ( net ) ) ) ; <nl> - <nl> / / Validate <nl> - ASSERT_EQ ( 1000u , out_onnx . total ( ) ) ; <nl> - ASSERT_EQ ( 1000u , out_gapi . total ( ) ) ; <nl> - normAssert ( out_onnx , out_gapi , " Test classification output " ) ; <nl> + validate ( ) ; <nl> } <nl> <nl> - TEST ( ONNX , InferROI ) <nl> + TEST_F ( ONNXtest , InferTensor ) <nl> { <nl> - cv : : Mat in_mat1 , out_gapi , out_onnx ; <nl> - std : : string model_path = findModel ( " squeezenet1 . 0 - 9 " ) ; <nl> - in_mat1 = initMatrixRandU ( CV_8UC3 , cv : : Size { 640 , 480 } ) ; <nl> - <nl> - cv : : Scalar mean = { 0 . 485 , 0 . 456 , 0 . 406 } ; / / squeeznet mean <nl> - cv : : Scalar std = { 0 . 229 , 0 . 224 , 0 . 225 } ; / / squeeznet std <nl> - <nl> - cv : : Rect ROI ( cv : : Point { 0 , 0 } , cv : : Size { 250 , 250 } ) ; <nl> + useModel ( " classification / squeezenet / model / squeezenet1 . 0 - 9 " ) ; <nl> + / / Create tensor <nl> + / / FIXME : Test cheks " random " image <nl> + / / Ideally it should be a real image <nl> + const cv : : Mat rand_mat = initMatrixRandU ( CV_32FC3 , cv : : Size { 224 , 224 } ) ; <nl> + const std : : vector < int > dims = { 1 , rand_mat . channels ( ) , rand_mat . rows , rand_mat . cols } ; <nl> + const cv : : Mat tensor ( dims , CV_32F , rand_mat . data ) ; <nl> / / ONNX_API code <nl> - InferONNX ( model_path , in_mat1 ( ROI ) , out_onnx , mean , std ) ; <nl> + infer < float > ( tensor , out_onnx . front ( ) ) ; <nl> + / / G_API code <nl> + G_API_NET ( SqueezNet , < cv : : GMat ( cv : : GMat ) > , " squeeznet " ) ; <nl> + cv : : GMat in ; <nl> + cv : : GMat out = cv : : gapi : : infer < SqueezNet > ( in ) ; <nl> + cv : : GComputation comp ( cv : : GIn ( in ) , cv : : GOut ( out ) ) ; <nl> + auto net = cv : : gapi : : onnx : : Params < SqueezNet > { model_path } ; <nl> + comp . apply ( cv : : gin ( tensor ) , <nl> + cv : : gout ( out_gapi . front ( ) ) , <nl> + cv : : compile_args ( cv : : gapi : : networks ( net ) ) ) ; <nl> + / / Validate <nl> + validate ( ) ; <nl> + } <nl> <nl> + TEST_F ( ONNXClassificationTest , InferROI ) <nl> + { <nl> + useModel ( " classification / squeezenet / model / squeezenet1 . 0 - 9 " ) ; <nl> + const cv : : Rect ROI ( cv : : Point { 0 , 0 } , cv : : Size { 250 , 250 } ) ; <nl> + / / ONNX_API code <nl> + cv : : Mat roi_mat ; <nl> + preprocess ( in_mat1 ( ROI ) , roi_mat ) ; <nl> + infer < float > ( roi_mat , out_onnx . front ( ) ) ; <nl> / / G_API code <nl> G_API_NET ( SqueezNet , < cv : : GMat ( cv : : GMat ) > , " squeeznet " ) ; <nl> cv : : GMat in ; <nl> cv : : GOpaque < cv : : Rect > rect ; <nl> cv : : GMat out = cv : : gapi : : infer < SqueezNet > ( rect , in ) ; <nl> cv : : GComputation comp ( cv : : GIn ( in , rect ) , cv : : GOut ( out ) ) ; <nl> - auto net = cv : : gapi : : onnx : : Params < SqueezNet > { model_path } . cfgMeanStd ( { mean } , { std } ) ; <nl> + / / NOTE : We have to normalize U8 tensor <nl> + / / so cfgMeanStd ( ) is here <nl> + auto net = cv : : gapi : : onnx : : Params < SqueezNet > { model_path } . cfgMeanStd ( { mean } , { std } ) ; <nl> comp . apply ( cv : : gin ( in_mat1 , ROI ) , <nl> - cv : : gout ( out_gapi ) , <nl> + cv : : gout ( out_gapi . front ( ) ) , <nl> cv : : compile_args ( cv : : gapi : : networks ( net ) ) ) ; <nl> - <nl> / / Validate <nl> - ASSERT_EQ ( 1000u , out_onnx . total ( ) ) ; <nl> - ASSERT_EQ ( 1000u , out_gapi . total ( ) ) ; <nl> - normAssert ( out_onnx , out_gapi , " Test classification output " ) ; <nl> + validate ( ) ; <nl> } <nl> <nl> - TEST ( ONNX , InferROIList ) <nl> + TEST_F ( ONNXClassificationTest , InferROIList ) <nl> { <nl> - cv : : Mat in_mat1 ; <nl> - std : : string model_path = findModel ( " squeezenet1 . 0 - 9 " ) ; <nl> - in_mat1 = initMatrixRandU ( CV_8UC3 , cv : : Size { 640 , 480 } ) ; <nl> - <nl> - cv : : Scalar mean = { 0 . 485 , 0 . 456 , 0 . 406 } ; / / squeeznet mean <nl> - cv : : Scalar std = { 0 . 229 , 0 . 224 , 0 . 225 } ; / / squeeznet std <nl> - <nl> - std : : vector < cv : : Rect > rois = { <nl> + useModel ( " classification / squeezenet / model / squeezenet1 . 0 - 9 " ) ; <nl> + const std : : vector < cv : : Rect > rois = { <nl> cv : : Rect ( cv : : Point { 0 , 0 } , cv : : Size { 80 , 120 } ) , <nl> cv : : Rect ( cv : : Point { 50 , 100 } , cv : : Size { 250 , 360 } ) , <nl> } ; <nl> - std : : vector < cv : : Mat > out_gapi ; <nl> - std : : vector < cv : : Mat > out_onnx ( rois . size ( ) ) ; <nl> / / ONNX_API code <nl> + out_onnx . resize ( rois . size ( ) ) ; <nl> for ( size_t i = 0 ; i < rois . size ( ) ; + + i ) { <nl> - InferONNX ( model_path , in_mat1 ( rois [ i ] ) , out_onnx [ i ] , mean , std ) ; <nl> + cv : : Mat roi_mat ; <nl> + preprocess ( in_mat1 ( rois [ i ] ) , roi_mat ) ; <nl> + infer < float > ( roi_mat , out_onnx [ i ] ) ; <nl> } <nl> - <nl> / / G_API code <nl> G_API_NET ( SqueezNet , < cv : : GMat ( cv : : GMat ) > , " squeeznet " ) ; <nl> cv : : GMat in ; <nl> cv : : GArray < cv : : Rect > rr ; <nl> cv : : GArray < cv : : GMat > out = cv : : gapi : : infer < SqueezNet > ( rr , in ) ; <nl> cv : : GComputation comp ( cv : : GIn ( in , rr ) , cv : : GOut ( out ) ) ; <nl> - auto net = cv : : gapi : : onnx : : Params < SqueezNet > { model_path } . cfgMeanStd ( { mean } , { std } ) ; <nl> + / / NOTE : We have to normalize U8 tensor <nl> + / / so cfgMeanStd ( ) is here <nl> + auto net = cv : : gapi : : onnx : : Params < SqueezNet > { model_path } . cfgMeanStd ( { mean } , { std } ) ; <nl> comp . apply ( cv : : gin ( in_mat1 , rois ) , <nl> cv : : gout ( out_gapi ) , <nl> cv : : compile_args ( cv : : gapi : : networks ( net ) ) ) ; <nl> - <nl> / / Validate <nl> - for ( size_t i = 0 ; i < rois . size ( ) ; + + i ) { <nl> - ASSERT_EQ ( 1000u , out_onnx [ i ] . total ( ) ) ; <nl> - ASSERT_EQ ( 1000u , out_gapi [ i ] . total ( ) ) ; <nl> - normAssert ( out_onnx [ i ] , out_gapi [ i ] , " Test classification output " ) ; <nl> - } <nl> + validate ( ) ; <nl> } <nl> <nl> - TEST ( ONNX , Infer2ROIList ) <nl> + TEST_F ( ONNXClassificationTest , Infer2ROIList ) <nl> { <nl> - cv : : Mat in_mat1 ; <nl> - std : : string model_path = findModel ( " squeezenet1 . 0 - 9 " ) ; <nl> - in_mat1 = initMatrixRandU ( CV_8UC3 , cv : : Size { 640 , 480 } ) ; <nl> - <nl> - cv : : Scalar mean = { 0 . 485 , 0 . 456 , 0 . 406 } ; / / squeeznet mean <nl> - cv : : Scalar std = { 0 . 229 , 0 . 224 , 0 . 225 } ; / / squeeznet std <nl> - <nl> - std : : vector < cv : : Rect > rois = { <nl> + useModel ( " classification / squeezenet / model / squeezenet1 . 0 - 9 " ) ; <nl> + const std : : vector < cv : : Rect > rois = { <nl> cv : : Rect ( cv : : Point { 0 , 0 } , cv : : Size { 80 , 120 } ) , <nl> cv : : Rect ( cv : : Point { 50 , 100 } , cv : : Size { 250 , 360 } ) , <nl> } ; <nl> - std : : vector < cv : : Mat > out_gapi ; <nl> - std : : vector < cv : : Mat > out_onnx ( rois . size ( ) ) ; <nl> / / ONNX_API code <nl> + out_onnx . resize ( rois . size ( ) ) ; <nl> for ( size_t i = 0 ; i < rois . size ( ) ; + + i ) { <nl> - InferONNX ( model_path , in_mat1 ( rois [ i ] ) , out_onnx [ i ] , mean , std ) ; <nl> + cv : : Mat roi_mat ; <nl> + preprocess ( in_mat1 ( rois [ i ] ) , roi_mat ) ; <nl> + infer < float > ( roi_mat , out_onnx [ i ] ) ; <nl> } <nl> - <nl> / / G_API code <nl> G_API_NET ( SqueezNet , < cv : : GMat ( cv : : GMat ) > , " squeeznet " ) ; <nl> cv : : GMat in ; <nl> cv : : GArray < cv : : Rect > rr ; <nl> - cv : : GArray < cv : : GMat > out = cv : : gapi : : infer2 < SqueezNet > ( in , rr ) ; <nl> + cv : : GArray < cv : : GMat > out = cv : : gapi : : infer2 < SqueezNet > ( in , rr ) ; <nl> cv : : GComputation comp ( cv : : GIn ( in , rr ) , cv : : GOut ( out ) ) ; <nl> - auto net = cv : : gapi : : onnx : : Params < SqueezNet > { model_path } . cfgMeanStd ( { mean } , { std } ) ; <nl> + / / NOTE : We have to normalize U8 tensor <nl> + / / so cfgMeanStd ( ) is here <nl> + auto net = cv : : gapi : : onnx : : Params < SqueezNet > { model_path } . cfgMeanStd ( { mean } , { std } ) ; <nl> comp . apply ( cv : : gin ( in_mat1 , rois ) , <nl> cv : : gout ( out_gapi ) , <nl> cv : : compile_args ( cv : : gapi : : networks ( net ) ) ) ; <nl> + / / Validate <nl> + validate ( ) ; <nl> + } <nl> + <nl> + TEST_F ( ONNXtest , InferDynamicInputTensor ) <nl> + { <nl> + useModel ( " object_detection_segmentation / tiny - yolov2 / model / tinyyolov2 - 8 " ) ; <nl> + / / Create tensor <nl> + / / FIXME : Test cheks " random " image <nl> + / / Ideally it should be a real image <nl> + const cv : : Mat rand_mat = initMatrixRandU ( CV_32FC3 , cv : : Size { 416 , 416 } ) ; <nl> + const std : : vector < int > dims = { 1 , rand_mat . channels ( ) , rand_mat . rows , rand_mat . cols } ; <nl> + cv : : Mat tensor ( dims , CV_32F , rand_mat . data ) ; <nl> + const cv : : Mat in_tensor = tensor / 255 . f ; <nl> + / / ONNX_API code <nl> + infer < float > ( in_tensor , out_onnx . front ( ) ) ; <nl> + / / G_API code <nl> + G_API_NET ( YoloNet , < cv : : GMat ( cv : : GMat ) > , " YoloNet " ) ; <nl> + cv : : GMat in ; <nl> + cv : : GMat out = cv : : gapi : : infer < YoloNet > ( in ) ; <nl> + cv : : GComputation comp ( cv : : GIn ( in ) , cv : : GOut ( out ) ) ; <nl> + auto net = cv : : gapi : : onnx : : Params < YoloNet > { model_path } <nl> + . cfgPostProc ( { cv : : GMatDesc { CV_32F , { 1 , 125 , 13 , 13 } } } , remapYolo ) <nl> + . cfgOutputLayers ( { " out " } ) ; <nl> + comp . apply ( cv : : gin ( in_tensor ) , <nl> + cv : : gout ( out_gapi . front ( ) ) , <nl> + cv : : compile_args ( cv : : gapi : : networks ( net ) ) ) ; <nl> + / / Validate <nl> + validate ( ) ; <nl> + } <nl> <nl> + TEST_F ( ONNXGRayScaleTest , InferImage ) <nl> + { <nl> + useModel ( " body_analysis / emotion_ferplus / model / emotion - ferplus - 8 " ) ; <nl> + / / ONNX_API code <nl> + cv : : Mat prep_mat ; <nl> + preprocess ( in_mat1 , prep_mat ) ; <nl> + infer < float > ( prep_mat , out_onnx . front ( ) ) ; <nl> + / / G_API code <nl> + G_API_NET ( EmotionNet , < cv : : GMat ( cv : : GMat ) > , " emotion - ferplus " ) ; <nl> + cv : : GMat in ; <nl> + cv : : GMat out = cv : : gapi : : infer < EmotionNet > ( in ) ; <nl> + cv : : GComputation comp ( cv : : GIn ( in ) , cv : : GOut ( out ) ) ; <nl> + auto net = cv : : gapi : : onnx : : Params < EmotionNet > { model_path } <nl> + . cfgNormalize ( { false } ) ; / / model accepts 0 . . 255 range in FP32 ; <nl> + comp . apply ( cv : : gin ( in_mat1 ) , <nl> + cv : : gout ( out_gapi . front ( ) ) , <nl> + cv : : compile_args ( cv : : gapi : : networks ( net ) ) ) ; <nl> / / Validate <nl> - for ( size_t i = 0 ; i < rois . size ( ) ; + + i ) { <nl> - ASSERT_EQ ( 1000u , out_onnx [ i ] . total ( ) ) ; <nl> - ASSERT_EQ ( 1000u , out_gapi [ i ] . total ( ) ) ; <nl> - normAssert ( out_onnx [ i ] , out_gapi [ i ] , " Test classification output " ) ; <nl> - } <nl> + validate ( ) ; <nl> } <nl> <nl> + TEST_F ( ONNXtest , InferMultOutput ) <nl> + { <nl> + useModel ( " object_detection_segmentation / ssd - mobilenetv1 / model / ssd_mobilenet_v1_10 " ) ; <nl> + / / ONNX_API code <nl> + const auto prep_mat = in_mat1 . reshape ( 1 , { 1 , in_mat1 . rows , in_mat1 . cols , in_mat1 . channels ( ) } ) ; <nl> + infer < uint8_t > ( { prep_mat } , out_onnx ) ; <nl> + / / G_API code <nl> + using SSDOut = std : : tuple < cv : : GMat , cv : : GMat , cv : : GMat , cv : : GMat > ; <nl> + G_API_NET ( MobileNet , < SSDOut ( cv : : GMat ) > , " ssd_mobilenet " ) ; <nl> + cv : : GMat in ; <nl> + cv : : GMat out1 , out2 , out3 , out4 ; <nl> + std : : tie ( out1 , out2 , out3 , out4 ) = cv : : gapi : : infer < MobileNet > ( in ) ; <nl> + cv : : GComputation comp ( cv : : GIn ( in ) , cv : : GOut ( out1 , out2 , out3 , out4 ) ) ; <nl> + auto net = cv : : gapi : : onnx : : Params < MobileNet > { model_path } <nl> + . cfgOutputLayers ( { " out1 " , " out2 " , " out3 " , " out4 " } ) <nl> + . cfgPostProc ( { cv : : GMatDesc { CV_32F , { 1 , 100 , 4 } } , <nl> + cv : : GMatDesc { CV_32F , { 1 , 100 } } , <nl> + cv : : GMatDesc { CV_32F , { 1 , 100 } } , <nl> + cv : : GMatDesc { CV_32F , { 1 , 1 } } } , remapSsdPorts ) ; <nl> + out_gapi . resize ( num_out ) ; <nl> + comp . apply ( cv : : gin ( in_mat1 ) , <nl> + cv : : gout ( out_gapi [ 0 ] , out_gapi [ 1 ] , out_gapi [ 2 ] , out_gapi [ 3 ] ) , <nl> + cv : : compile_args ( cv : : gapi : : networks ( net ) ) ) ; <nl> + / / Validate <nl> + validate ( ) ; <nl> + } <nl> } / / namespace opencv_test <nl> <nl> # endif / / HAVE_ONNX <nl>
Merge pull request from mpashchenkov : mp / onnx - dynamic - input - tensor
opencv/opencv
06477743abd51f6e2eba774fcb8204a007e87435
2020-11-16T19:24:55Z
mmm a / libraries / ESP8266WiFi / src / ESP8266WiFi . cpp <nl> ppp b / libraries / ESP8266WiFi / src / ESP8266WiFi . cpp <nl> IPAddress ESP8266WiFiClass : : gatewayIP ( ) <nl> return IPAddress ( ip . gw . addr ) ; <nl> } <nl> <nl> + IPAddress ESP8266WiFiClass : : dnsIP ( ) <nl> + { <nl> + ip_addr_t dns_ip = dns_getserver ( 0 ) ; <nl> + return IPAddress ( dns_ip . addr ) ; <nl> + } <nl> + <nl> String ESP8266WiFiClass : : SSID ( ) const <nl> { <nl> static struct station_config conf ; <nl> mmm a / libraries / ESP8266WiFi / src / ESP8266WiFi . h <nl> ppp b / libraries / ESP8266WiFi / src / ESP8266WiFi . h <nl> class ESP8266WiFiClass <nl> * / <nl> IPAddress gatewayIP ( ) ; <nl> <nl> + / * <nl> + * Get the DNS ip address . <nl> + * <nl> + * return : DNS ip address value <nl> + * / <nl> + IPAddress dnsIP ( ) ; <nl> + <nl> / * <nl> * Return the current SSID associated with the network <nl> * <nl>
add dnsIP ( ) to ESP8266WiFi class
esp8266/Arduino
7f318d72cfe117d822fe16aae6e3e9a520f12a75
2015-10-18T18:18:14Z
mmm a / src / api . cc <nl> ppp b / src / api . cc <nl> bool v8 : : String : : CanMakeExternal ( ) { <nl> i : : Handle < i : : String > obj = Utils : : OpenHandle ( this ) ; <nl> i : : Isolate * isolate = obj - > GetIsolate ( ) ; <nl> if ( IsDeadCheck ( isolate , " v8 : : String : : CanMakeExternal ( ) " ) ) return false ; <nl> - if ( isolate - > string_tracker ( ) - > IsFreshUnusedString ( obj ) ) { <nl> - return false ; <nl> - } <nl> + if ( isolate - > string_tracker ( ) - > IsFreshUnusedString ( obj ) ) return false ; <nl> int size = obj - > Size ( ) ; / / Byte size of the original string . <nl> - if ( size < i : : ExternalString : : kSize ) <nl> - return false ; <nl> + if ( size < i : : ExternalString : : kShortSize ) return false ; <nl> i : : StringShape shape ( * obj ) ; <nl> return ! shape . IsExternal ( ) ; <nl> } <nl> mmm a / src / heap - inl . h <nl> ppp b / src / heap - inl . h <nl> void Heap : : FinalizeExternalString ( String * string ) { <nl> ExternalString : : kResourceOffset - <nl> kHeapObjectTag ) ; <nl> <nl> - / / Clear pointer cache . <nl> - ExternalString : : cast ( string ) - > clear_data_cache ( ) ; <nl> - <nl> / / Dispose of the C + + object if it has not already been disposed . <nl> if ( * resource_addr ! = NULL ) { <nl> ( * resource_addr ) - > Dispose ( ) ; <nl> + * resource_addr = NULL ; <nl> } <nl> - <nl> - / / Clear the resource pointer in the string . <nl> - * resource_addr = NULL ; <nl> } <nl> <nl> <nl> mmm a / src / heap . cc <nl> ppp b / src / heap . cc <nl> Map * Heap : : SymbolMapForString ( String * string ) { <nl> if ( map = = external_string_with_ascii_data_map ( ) ) { <nl> return external_symbol_with_ascii_data_map ( ) ; <nl> } <nl> + if ( map = = short_external_string_map ( ) ) { <nl> + return short_external_symbol_map ( ) ; <nl> + } <nl> + if ( map = = short_external_ascii_string_map ( ) ) { <nl> + return short_external_ascii_symbol_map ( ) ; <nl> + } <nl> + if ( map = = short_external_string_with_ascii_data_map ( ) ) { <nl> + return short_external_symbol_with_ascii_data_map ( ) ; <nl> + } <nl> <nl> / / No match found . <nl> return NULL ; <nl> mmm a / src / heap . h <nl> ppp b / src / heap . h <nl> inline Heap * _inline_get_heap_ ( ) ; <nl> V ( Map , external_string_map , ExternalStringMap ) \ <nl> V ( Map , external_string_with_ascii_data_map , ExternalStringWithAsciiDataMap ) \ <nl> V ( Map , external_ascii_string_map , ExternalAsciiStringMap ) \ <nl> + V ( Map , short_external_symbol_map , ShortExternalSymbolMap ) \ <nl> + V ( Map , \ <nl> + short_external_symbol_with_ascii_data_map , \ <nl> + ShortExternalSymbolWithAsciiDataMap ) \ <nl> + V ( Map , short_external_ascii_symbol_map , ShortExternalAsciiSymbolMap ) \ <nl> + V ( Map , short_external_string_map , ShortExternalStringMap ) \ <nl> + V ( Map , \ <nl> + short_external_string_with_ascii_data_map , \ <nl> + ShortExternalStringWithAsciiDataMap ) \ <nl> + V ( Map , short_external_ascii_string_map , ShortExternalAsciiStringMap ) \ <nl> V ( Map , undetectable_string_map , UndetectableStringMap ) \ <nl> V ( Map , undetectable_ascii_string_map , UndetectableAsciiStringMap ) \ <nl> V ( Map , external_pixel_array_map , ExternalPixelArrayMap ) \ <nl> mmm a / src / ia32 / codegen - ia32 . cc <nl> ppp b / src / ia32 / codegen - ia32 . cc <nl> void StringCharLoadGenerator : : Generate ( MacroAssembler * masm , <nl> __ Assert ( zero , " external string expected , but not found " ) ; <nl> } <nl> __ mov ( result , FieldOperand ( string , ExternalString : : kResourceDataOffset ) ) ; <nl> - / / Assert that the external string has not been finalized yet . <nl> - __ test ( result , result ) ; <nl> - __ j ( zero , call_runtime ) ; <nl> Register scratch = string ; <nl> __ mov ( scratch , FieldOperand ( string , HeapObject : : kMapOffset ) ) ; <nl> - __ cmp ( scratch , Immediate ( factory - > external_ascii_string_map ( ) ) ) ; <nl> - __ j ( equal , & ascii_external , Label : : kNear ) ; <nl> - __ cmp ( scratch , Immediate ( factory - > external_ascii_symbol_map ( ) ) ) ; <nl> - __ j ( equal , & ascii_external , Label : : kNear ) ; <nl> + __ movzx_b ( scratch , FieldOperand ( scratch , Map : : kInstanceTypeOffset ) ) ; <nl> + / / Rule out short external strings . <nl> + STATIC_CHECK ( kShortExternalStringTag ! = 0 ) ; <nl> + __ test_b ( scratch , kShortExternalStringMask ) ; <nl> + __ j ( not_zero , call_runtime ) ; <nl> + / / Check encoding . <nl> + STATIC_ASSERT ( kTwoByteStringTag = = 0 ) ; <nl> + __ test_b ( scratch , kStringEncodingMask ) ; <nl> + __ j ( not_equal , & ascii_external , Label : : kNear ) ; <nl> / / Two - byte string . <nl> __ movzx_w ( result , Operand ( result , index , times_2 , 0 ) ) ; <nl> __ jmp ( & done ) ; <nl> mmm a / src / objects - inl . h <nl> ppp b / src / objects - inl . h <nl> void ConsString : : set_second ( String * value , WriteBarrierMode mode ) { <nl> } <nl> <nl> <nl> - void ExternalString : : clear_data_cache ( ) { <nl> - WRITE_INTPTR_FIELD ( this , kResourceDataOffset , 0 ) ; <nl> + bool ExternalString : : is_short ( ) { <nl> + InstanceType type = map ( ) - > instance_type ( ) ; <nl> + return ( type & kShortExternalStringMask ) = = kShortExternalStringTag ; <nl> } <nl> <nl> <nl> const ExternalAsciiString : : Resource * ExternalAsciiString : : resource ( ) { <nl> } <nl> <nl> <nl> + void ExternalAsciiString : : update_data_cache ( ) { <nl> + if ( is_short ( ) ) return ; <nl> + const char * * data_field = <nl> + reinterpret_cast < const char * * > ( FIELD_ADDR ( this , kResourceDataOffset ) ) ; <nl> + * data_field = resource ( ) - > data ( ) ; <nl> + } <nl> + <nl> + <nl> void ExternalAsciiString : : set_resource ( <nl> const ExternalAsciiString : : Resource * resource ) { <nl> * reinterpret_cast < const Resource * * > ( <nl> FIELD_ADDR ( this , kResourceOffset ) ) = resource ; <nl> - clear_data_cache ( ) ; <nl> + if ( resource ! = NULL ) update_data_cache ( ) ; <nl> } <nl> <nl> <nl> const char * ExternalAsciiString : : GetChars ( ) { <nl> - const char * * data_field = <nl> - reinterpret_cast < const char * * > ( FIELD_ADDR ( this , kResourceDataOffset ) ) ; <nl> - if ( * data_field = = NULL ) * data_field = resource ( ) - > data ( ) ; <nl> - return * data_field ; <nl> + return resource ( ) - > data ( ) ; <nl> } <nl> <nl> <nl> const ExternalTwoByteString : : Resource * ExternalTwoByteString : : resource ( ) { <nl> } <nl> <nl> <nl> + void ExternalTwoByteString : : update_data_cache ( ) { <nl> + if ( is_short ( ) ) return ; <nl> + const uint16_t * * data_field = <nl> + reinterpret_cast < const uint16_t * * > ( FIELD_ADDR ( this , kResourceDataOffset ) ) ; <nl> + * data_field = resource ( ) - > data ( ) ; <nl> + } <nl> + <nl> + <nl> void ExternalTwoByteString : : set_resource ( <nl> const ExternalTwoByteString : : Resource * resource ) { <nl> * reinterpret_cast < const Resource * * > ( <nl> FIELD_ADDR ( this , kResourceOffset ) ) = resource ; <nl> - clear_data_cache ( ) ; <nl> + if ( resource ! = NULL ) update_data_cache ( ) ; <nl> } <nl> <nl> <nl> const uint16_t * ExternalTwoByteString : : GetChars ( ) { <nl> - const uint16_t * * data_field = <nl> - reinterpret_cast < const uint16_t * * > ( FIELD_ADDR ( this , kResourceDataOffset ) ) ; <nl> - if ( * data_field = = NULL ) * data_field = resource ( ) - > data ( ) ; <nl> - return * data_field ; <nl> + return resource ( ) - > data ( ) ; <nl> } <nl> <nl> <nl> mmm a / src / objects - printer . cc <nl> ppp b / src / objects - printer . cc <nl> static const char * TypeToString ( InstanceType type ) { <nl> case EXTERNAL_ASCII_SYMBOL_TYPE : <nl> case EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE : <nl> case EXTERNAL_SYMBOL_TYPE : return " EXTERNAL_SYMBOL " ; <nl> + case SHORT_EXTERNAL_ASCII_SYMBOL_TYPE : <nl> + case SHORT_EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE : <nl> + case SHORT_EXTERNAL_SYMBOL_TYPE : return " SHORT_EXTERNAL_SYMBOL " ; <nl> case ASCII_STRING_TYPE : return " ASCII_STRING " ; <nl> case STRING_TYPE : return " TWO_BYTE_STRING " ; <nl> case CONS_STRING_TYPE : <nl> static const char * TypeToString ( InstanceType type ) { <nl> case EXTERNAL_ASCII_STRING_TYPE : <nl> case EXTERNAL_STRING_WITH_ASCII_DATA_TYPE : <nl> case EXTERNAL_STRING_TYPE : return " EXTERNAL_STRING " ; <nl> + case SHORT_EXTERNAL_ASCII_STRING_TYPE : <nl> + case SHORT_EXTERNAL_STRING_WITH_ASCII_DATA_TYPE : <nl> + case SHORT_EXTERNAL_STRING_TYPE : return " SHORT_EXTERNAL_STRING " ; <nl> case FIXED_ARRAY_TYPE : return " FIXED_ARRAY " ; <nl> case BYTE_ARRAY_TYPE : return " BYTE_ARRAY " ; <nl> case FREE_SPACE_TYPE : return " FREE_SPACE " ; <nl> mmm a / src / objects - visiting . cc <nl> ppp b / src / objects - visiting . cc <nl> StaticVisitorBase : : VisitorId StaticVisitorBase : : GetVisitorId ( <nl> case kExternalStringTag : <nl> return GetVisitorIdForSize ( kVisitDataObject , <nl> kVisitDataObjectGeneric , <nl> - ExternalString : : kSize ) ; <nl> + instance_size ) ; <nl> } <nl> UNREACHABLE ( ) ; <nl> } <nl> mmm a / src / objects . cc <nl> ppp b / src / objects . cc <nl> bool String : : MakeExternal ( v8 : : String : : ExternalStringResource * resource ) { <nl> # endif / / DEBUG <nl> Heap * heap = GetHeap ( ) ; <nl> int size = this - > Size ( ) ; / / Byte size of the original string . <nl> - if ( size < ExternalString : : kSize ) { <nl> + if ( size < ExternalString : : kShortSize ) { <nl> return false ; <nl> } <nl> - ASSERT ( size > = ExternalString : : kSize ) ; <nl> bool is_ascii = this - > IsAsciiRepresentation ( ) ; <nl> bool is_symbol = this - > IsSymbol ( ) ; <nl> - int length = this - > length ( ) ; <nl> - int hash_field = this - > hash_field ( ) ; <nl> <nl> / / Morph the object to an external string by adjusting the map and <nl> / / reinitializing the fields . <nl> - this - > set_map ( is_ascii ? <nl> - heap - > external_string_with_ascii_data_map ( ) : <nl> - heap - > external_string_map ( ) ) ; <nl> + if ( size > = ExternalString : : kSize ) { <nl> + this - > set_map ( <nl> + is_symbol <nl> + ? ( is_ascii ? heap - > external_symbol_with_ascii_data_map ( ) <nl> + : heap - > external_symbol_map ( ) ) <nl> + : ( is_ascii ? heap - > external_string_with_ascii_data_map ( ) <nl> + : heap - > external_string_map ( ) ) ) ; <nl> + } else { <nl> + this - > set_map ( <nl> + is_symbol <nl> + ? ( is_ascii ? heap - > short_external_symbol_with_ascii_data_map ( ) <nl> + : heap - > short_external_symbol_map ( ) ) <nl> + : ( is_ascii ? heap - > short_external_string_with_ascii_data_map ( ) <nl> + : heap - > short_external_string_map ( ) ) ) ; <nl> + } <nl> ExternalTwoByteString * self = ExternalTwoByteString : : cast ( this ) ; <nl> - self - > set_length ( length ) ; <nl> - self - > set_hash_field ( hash_field ) ; <nl> self - > set_resource ( resource ) ; <nl> - / / Additionally make the object into an external symbol if the original string <nl> - / / was a symbol to start with . <nl> - if ( is_symbol ) { <nl> - self - > Hash ( ) ; / / Force regeneration of the hash value . <nl> - / / Now morph this external string into a external symbol . <nl> - this - > set_map ( is_ascii ? <nl> - heap - > external_symbol_with_ascii_data_map ( ) : <nl> - heap - > external_symbol_map ( ) ) ; <nl> - } <nl> + if ( is_symbol ) self - > Hash ( ) ; / / Force regeneration of the hash value . <nl> <nl> / / Fill the remainder of the string with dead wood . <nl> int new_size = this - > Size ( ) ; / / Byte size of the external String object . <nl> bool String : : MakeExternal ( v8 : : String : : ExternalAsciiStringResource * resource ) { <nl> # endif / / DEBUG <nl> Heap * heap = GetHeap ( ) ; <nl> int size = this - > Size ( ) ; / / Byte size of the original string . <nl> - if ( size < ExternalString : : kSize ) { <nl> + if ( size < ExternalString : : kShortSize ) { <nl> return false ; <nl> } <nl> - ASSERT ( size > = ExternalString : : kSize ) ; <nl> bool is_symbol = this - > IsSymbol ( ) ; <nl> - int length = this - > length ( ) ; <nl> - int hash_field = this - > hash_field ( ) ; <nl> <nl> / / Morph the object to an external string by adjusting the map and <nl> - / / reinitializing the fields . <nl> - this - > set_map ( heap - > external_ascii_string_map ( ) ) ; <nl> + / / reinitializing the fields . Use short version if space is limited . <nl> + if ( size > = ExternalString : : kSize ) { <nl> + this - > set_map ( is_symbol ? heap - > external_ascii_symbol_map ( ) <nl> + : heap - > external_ascii_string_map ( ) ) ; <nl> + } else { <nl> + this - > set_map ( is_symbol ? heap - > short_external_ascii_symbol_map ( ) <nl> + : heap - > short_external_ascii_string_map ( ) ) ; <nl> + } <nl> ExternalAsciiString * self = ExternalAsciiString : : cast ( this ) ; <nl> - self - > set_length ( length ) ; <nl> - self - > set_hash_field ( hash_field ) ; <nl> self - > set_resource ( resource ) ; <nl> - / / Additionally make the object into an external symbol if the original string <nl> - / / was a symbol to start with . <nl> - if ( is_symbol ) { <nl> - self - > Hash ( ) ; / / Force regeneration of the hash value . <nl> - / / Now morph this external string into a external symbol . <nl> - this - > set_map ( heap - > external_ascii_symbol_map ( ) ) ; <nl> - } <nl> + if ( is_symbol ) self - > Hash ( ) ; / / Force regeneration of the hash value . <nl> <nl> / / Fill the remainder of the string with dead wood . <nl> int new_size = this - > Size ( ) ; / / Byte size of the external String object . <nl> bool String : : MakeExternal ( v8 : : String : : ExternalAsciiStringResource * resource ) { <nl> if ( Marking : : IsBlack ( Marking : : MarkBitFrom ( this ) ) ) { <nl> MemoryChunk : : IncrementLiveBytes ( this - > address ( ) , new_size - size ) ; <nl> } <nl> - <nl> return true ; <nl> } <nl> <nl> mmm a / src / objects . h <nl> ppp b / src / objects . h <nl> static const int kVariableSizeSentinel = 0 ; <nl> V ( EXTERNAL_SYMBOL_TYPE ) \ <nl> V ( EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE ) \ <nl> V ( EXTERNAL_ASCII_SYMBOL_TYPE ) \ <nl> + V ( SHORT_EXTERNAL_SYMBOL_TYPE ) \ <nl> + V ( SHORT_EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE ) \ <nl> + V ( SHORT_EXTERNAL_ASCII_SYMBOL_TYPE ) \ <nl> V ( STRING_TYPE ) \ <nl> V ( ASCII_STRING_TYPE ) \ <nl> V ( CONS_STRING_TYPE ) \ <nl> static const int kVariableSizeSentinel = 0 ; <nl> V ( EXTERNAL_STRING_TYPE ) \ <nl> V ( EXTERNAL_STRING_WITH_ASCII_DATA_TYPE ) \ <nl> V ( EXTERNAL_ASCII_STRING_TYPE ) \ <nl> + V ( SHORT_EXTERNAL_STRING_TYPE ) \ <nl> + V ( SHORT_EXTERNAL_STRING_WITH_ASCII_DATA_TYPE ) \ <nl> + V ( SHORT_EXTERNAL_ASCII_STRING_TYPE ) \ <nl> V ( PRIVATE_EXTERNAL_ASCII_STRING_TYPE ) \ <nl> \ <nl> V ( MAP_TYPE ) \ <nl> static const int kVariableSizeSentinel = 0 ; <nl> ExternalAsciiString : : kSize , \ <nl> external_ascii_symbol , \ <nl> ExternalAsciiSymbol ) \ <nl> + V ( SHORT_EXTERNAL_SYMBOL_TYPE , \ <nl> + ExternalTwoByteString : : kShortSize , \ <nl> + short_external_symbol , \ <nl> + ShortExternalSymbol ) \ <nl> + V ( SHORT_EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE , \ <nl> + ExternalTwoByteString : : kShortSize , \ <nl> + short_external_symbol_with_ascii_data , \ <nl> + ShortExternalSymbolWithAsciiData ) \ <nl> + V ( SHORT_EXTERNAL_ASCII_SYMBOL_TYPE , \ <nl> + ExternalAsciiString : : kShortSize , \ <nl> + short_external_ascii_symbol , \ <nl> + ShortExternalAsciiSymbol ) \ <nl> V ( STRING_TYPE , \ <nl> kVariableSizeSentinel , \ <nl> string , \ <nl> static const int kVariableSizeSentinel = 0 ; <nl> V ( EXTERNAL_ASCII_STRING_TYPE , \ <nl> ExternalAsciiString : : kSize , \ <nl> external_ascii_string , \ <nl> - ExternalAsciiString ) <nl> + ExternalAsciiString ) \ <nl> + V ( SHORT_EXTERNAL_STRING_TYPE , \ <nl> + ExternalTwoByteString : : kShortSize , \ <nl> + short_external_string , \ <nl> + ShortExternalString ) \ <nl> + V ( SHORT_EXTERNAL_STRING_WITH_ASCII_DATA_TYPE , \ <nl> + ExternalTwoByteString : : kShortSize , \ <nl> + short_external_string_with_ascii_data , \ <nl> + ShortExternalStringWithAsciiData ) \ <nl> + V ( SHORT_EXTERNAL_ASCII_STRING_TYPE , \ <nl> + ExternalAsciiString : : kShortSize , \ <nl> + short_external_ascii_string , \ <nl> + ShortExternalAsciiString ) <nl> <nl> / / A struct is a simple object a set of object - valued fields . Including an <nl> / / object type in this causes the compiler to generate most of the boilerplate <nl> STATIC_ASSERT ( IS_POWER_OF_TWO ( kSlicedNotConsMask ) & & kSlicedNotConsMask ! = 0 ) ; <nl> const uint32_t kAsciiDataHintMask = 0x08 ; <nl> const uint32_t kAsciiDataHintTag = 0x08 ; <nl> <nl> + / / If bit 7 is clear and string representation indicates an external string , <nl> + / / then bit 4 indicates whether the data pointer is cached . <nl> + const uint32_t kShortExternalStringMask = 0x10 ; <nl> + const uint32_t kShortExternalStringTag = 0x10 ; <nl> + <nl> <nl> / / A ConsString with an empty string as the right side is a candidate <nl> / / for being shortcut by the garbage collector unless it is a <nl> enum InstanceType { <nl> ASCII_SYMBOL_TYPE = kAsciiStringTag | kSymbolTag | kSeqStringTag , <nl> CONS_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kConsStringTag , <nl> CONS_ASCII_SYMBOL_TYPE = kAsciiStringTag | kSymbolTag | kConsStringTag , <nl> + SHORT_EXTERNAL_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | <nl> + kExternalStringTag | kShortExternalStringTag , <nl> + SHORT_EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE = <nl> + kTwoByteStringTag | kSymbolTag | kExternalStringTag | <nl> + kAsciiDataHintTag | kShortExternalStringTag , <nl> + SHORT_EXTERNAL_ASCII_SYMBOL_TYPE = kAsciiStringTag | kExternalStringTag | <nl> + kSymbolTag | kShortExternalStringTag , <nl> EXTERNAL_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kExternalStringTag , <nl> EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE = <nl> kTwoByteStringTag | kSymbolTag | kExternalStringTag | kAsciiDataHintTag , <nl> enum InstanceType { <nl> CONS_ASCII_STRING_TYPE = kAsciiStringTag | kConsStringTag , <nl> SLICED_STRING_TYPE = kTwoByteStringTag | kSlicedStringTag , <nl> SLICED_ASCII_STRING_TYPE = kAsciiStringTag | kSlicedStringTag , <nl> + SHORT_EXTERNAL_STRING_TYPE = <nl> + kTwoByteStringTag | kExternalStringTag | kShortExternalStringTag , <nl> + SHORT_EXTERNAL_STRING_WITH_ASCII_DATA_TYPE = <nl> + kTwoByteStringTag | kExternalStringTag | <nl> + kAsciiDataHintTag | kShortExternalStringTag , <nl> + SHORT_EXTERNAL_ASCII_STRING_TYPE = <nl> + kAsciiStringTag | kExternalStringTag | kShortExternalStringTag , <nl> EXTERNAL_STRING_TYPE = kTwoByteStringTag | kExternalStringTag , <nl> EXTERNAL_STRING_WITH_ASCII_DATA_TYPE = <nl> kTwoByteStringTag | kExternalStringTag | kAsciiDataHintTag , <nl> class ExternalString : public String { <nl> <nl> / / Layout description . <nl> static const int kResourceOffset = POINTER_SIZE_ALIGN ( String : : kSize ) ; <nl> + static const int kShortSize = kResourceOffset + kPointerSize ; <nl> static const int kResourceDataOffset = kResourceOffset + kPointerSize ; <nl> static const int kSize = kResourceDataOffset + kPointerSize ; <nl> <nl> - / / Clear the cached pointer to the character array provided by the resource . <nl> - / / This cache is updated the first time the character array is accessed . <nl> - inline void clear_data_cache ( ) ; <nl> + / / Return whether external string is short ( data pointer is not cached ) . <nl> + inline bool is_short ( ) ; <nl> <nl> STATIC_CHECK ( kResourceOffset = = Internals : : kStringResourceOffset ) ; <nl> <nl> class ExternalAsciiString : public ExternalString { <nl> inline const Resource * resource ( ) ; <nl> inline void set_resource ( const Resource * buffer ) ; <nl> <nl> + / / Update the pointer cache to the external character array . <nl> + / / The cached pointer is always valid , as the external character array does = <nl> + / / not move during lifetime . Deserialization is the only exception , after <nl> + / / which the pointer cache has to be refreshed . <nl> + inline void update_data_cache ( ) ; <nl> + <nl> inline const char * GetChars ( ) ; <nl> <nl> / / Dispatched behavior . <nl> class ExternalTwoByteString : public ExternalString { <nl> inline const Resource * resource ( ) ; <nl> inline void set_resource ( const Resource * buffer ) ; <nl> <nl> + / / Update the pointer cache to the external character array . <nl> + / / The cached pointer is always valid , as the external character array does = <nl> + / / not move during lifetime . Deserialization is the only exception , after <nl> + / / which the pointer cache has to be refreshed . <nl> + inline void update_data_cache ( ) ; <nl> + <nl> inline const uint16_t * GetChars ( ) ; <nl> <nl> / / Dispatched behavior . <nl> mmm a / src / serialize . cc <nl> ppp b / src / serialize . cc <nl> void Deserializer : : Deserialize ( ) { <nl> <nl> isolate_ - > heap ( ) - > set_global_contexts_list ( <nl> isolate_ - > heap ( ) - > undefined_value ( ) ) ; <nl> + <nl> + / / Update data pointers to the external strings containing natives sources . <nl> + for ( int i = 0 ; i < Natives : : GetBuiltinsCount ( ) ; i + + ) { <nl> + Object * source = isolate_ - > heap ( ) - > natives_source_cache ( ) - > get ( i ) ; <nl> + if ( ! source - > IsUndefined ( ) ) { <nl> + ExternalAsciiString : : cast ( source ) - > update_data_cache ( ) ; <nl> + } <nl> + } <nl> } <nl> <nl> <nl> void Serializer : : ObjectSerializer : : VisitExternalAsciiString ( <nl> sink_ - > Put ( kNativesStringResource , " NativesStringResource " ) ; <nl> sink_ - > PutSection ( i , " NativesStringResourceEnd " ) ; <nl> bytes_processed_so_far_ + = sizeof ( resource ) ; <nl> - string - > clear_data_cache ( ) ; <nl> return ; <nl> } <nl> } <nl> mmm a / test / cctest / test - api . cc <nl> ppp b / test / cctest / test - api . cc <nl> TEST ( MakingExternalStringConditions ) { <nl> HEAP - > CollectGarbage ( i : : NEW_SPACE ) ; <nl> HEAP - > CollectGarbage ( i : : NEW_SPACE ) ; <nl> <nl> - uint16_t * two_byte_string = AsciiToTwoByteString ( " abcdefghi " ) ; <nl> + uint16_t * two_byte_string = AsciiToTwoByteString ( " s1 " ) ; <nl> Local < String > small_string = String : : New ( two_byte_string ) ; <nl> i : : DeleteArray ( two_byte_string ) ; <nl> <nl> TEST ( MakingExternalStringConditions ) { <nl> / / Old space strings should be accepted . <nl> CHECK ( small_string - > CanMakeExternal ( ) ) ; <nl> <nl> - two_byte_string = AsciiToTwoByteString ( " abcdefghi " ) ; <nl> + two_byte_string = AsciiToTwoByteString ( " small string 2 " ) ; <nl> small_string = String : : New ( two_byte_string ) ; <nl> i : : DeleteArray ( two_byte_string ) ; <nl> <nl> TEST ( MakingExternalAsciiStringConditions ) { <nl> HEAP - > CollectGarbage ( i : : NEW_SPACE ) ; <nl> HEAP - > CollectGarbage ( i : : NEW_SPACE ) ; <nl> <nl> - Local < String > small_string = String : : New ( " abcdefghi " ) ; <nl> + Local < String > small_string = String : : New ( " s1 " ) ; <nl> / / We should refuse to externalize newly created small string . <nl> CHECK ( ! small_string - > CanMakeExternal ( ) ) ; <nl> / / Trigger GCs so that the newly allocated string moves to old gen . <nl> TEST ( MakingExternalAsciiStringConditions ) { <nl> / / Old space strings should be accepted . <nl> CHECK ( small_string - > CanMakeExternal ( ) ) ; <nl> <nl> - small_string = String : : New ( " abcdefghi " ) ; <nl> + small_string = String : : New ( " small string 2 " ) ; <nl> / / We should refuse externalizing newly created small string . <nl> CHECK ( ! small_string - > CanMakeExternal ( ) ) ; <nl> for ( int i = 0 ; i < 100 ; i + + ) { <nl> mmm a / test / mjsunit / string - externalize . js <nl> ppp b / test / mjsunit / string - externalize . js <nl> function test ( ) { <nl> assertTrue ( isAsciiString ( str ) ) ; <nl> <nl> var twoByteExternalWithAsciiData = <nl> - " AAAAAAAA " + ( function ( ) { return " A " ; } ) ( ) ; <nl> + " AA " + ( function ( ) { return " A " ; } ) ( ) ; <nl> externalizeString ( twoByteExternalWithAsciiData , true / * force two - byte * / ) ; <nl> assertFalse ( isAsciiString ( twoByteExternalWithAsciiData ) ) ; <nl> <nl>
Introduce short external strings without pointer cache .
v8/v8
21edc7c30bcd13f1293bbcd3e8980ffe1086de90
2011-11-23T09:58:58Z
mmm a / mars / comm / xlogger / xlogger . h <nl> ppp b / mars / comm / xlogger / xlogger . h <nl> __inline void __xlogger_c_write ( const XLoggerInfo * _info , const char * _log , . . . <nl> # define xinfo2_if ( exp , . . . ) __xlogger_cpp_impl_if ( kLevelInfo , exp , __VA_ARGS__ ) <nl> # define xwarn2_if ( exp , . . . ) __xlogger_cpp_impl_if ( kLevelWarn , exp , __VA_ARGS__ ) <nl> # define xerror2_if ( exp , . . . ) __xlogger_cpp_impl_if ( kLevelError , exp , __VA_ARGS__ ) <nl> - # define xfatal2_if ( exp , . . . ) __xlogger_cpp_impl_ifkLevelFatal , exp , __VA_ARGS__ ) <nl> + # define xfatal2_if ( exp , . . . ) __xlogger_cpp_impl_if ( kLevelFatal , exp , __VA_ARGS__ ) <nl> # define xlog2_if ( level , . . . ) __xlogger_cpp_impl_if ( level , __VA_ARGS__ ) <nl> <nl> # define xgroup2_define ( group ) XLogger group ( kLevelAll , XLOGGER_TAG , __XFILE__ , __XFUNCTION__ , __LINE__ , XLOGGER_HOOK ) <nl> mmm a / mars / log / export_include / xlogger / xlogger . h <nl> ppp b / mars / log / export_include / xlogger / xlogger . h <nl> __inline void __xlogger_c_write ( const XLoggerInfo * _info , const char * _log , . . . <nl> # define xinfo2_if ( exp , . . . ) __xlogger_cpp_impl_if ( kLevelInfo , exp , __VA_ARGS__ ) <nl> # define xwarn2_if ( exp , . . . ) __xlogger_cpp_impl_if ( kLevelWarn , exp , __VA_ARGS__ ) <nl> # define xerror2_if ( exp , . . . ) __xlogger_cpp_impl_if ( kLevelError , exp , __VA_ARGS__ ) <nl> - # define xfatal2_if ( exp , . . . ) __xlogger_cpp_impl_ifkLevelFatal , exp , __VA_ARGS__ ) <nl> + # define xfatal2_if ( exp , . . . ) __xlogger_cpp_impl_if ( kLevelFatal , exp , __VA_ARGS__ ) <nl> # define xlog2_if ( level , . . . ) __xlogger_cpp_impl_if ( level , __VA_ARGS__ ) <nl> <nl> # define xgroup2_define ( group ) XLogger group ( kLevelAll , XLOGGER_TAG , __XFILE__ , __XFUNCTION__ , __LINE__ , XLOGGER_HOOK ) <nl>
[ xlog ] fix missing ‘ ( ’
Tencent/mars
ad6d3ac46ef83741fa8a178f58e57d7d64805cf2
2018-11-29T02:25:05Z
mmm a / java / rocksjni / rocksjni . cc <nl> ppp b / java / rocksjni / rocksjni . cc <nl> jobjectArray Java_org_rocksdb_RocksDB_listColumnFamilies ( <nl> <nl> void rocksdb_put_helper ( <nl> JNIEnv * env , rocksdb : : DB * db , const rocksdb : : WriteOptions & write_options , <nl> - rocksdb : : ColumnFamilyHandle * cf_handle , jbyteArray jkey , jint jkey_len , <nl> - jbyteArray jentry_value , jint jentry_value_len ) { <nl> + rocksdb : : ColumnFamilyHandle * cf_handle , jbyteArray jkey , jint jkey_off , <nl> + jint jkey_len , jbyteArray jvalue , jint jvalue_off , jint jvalue_len ) { <nl> + <nl> + jbyte * key = new jbyte [ jkey_len ] ; <nl> + env - > GetByteArrayRegion ( jkey , jkey_off , jkey_len , key ) ; <nl> + <nl> + jbyte * value = new jbyte [ jvalue_len ] ; <nl> + env - > GetByteArrayRegion ( jvalue , jvalue_off , jvalue_len , value ) ; <nl> <nl> - jbyte * key = env - > GetByteArrayElements ( jkey , 0 ) ; <nl> - jbyte * value = env - > GetByteArrayElements ( jentry_value , 0 ) ; <nl> rocksdb : : Slice key_slice ( reinterpret_cast < char * > ( key ) , jkey_len ) ; <nl> rocksdb : : Slice value_slice ( reinterpret_cast < char * > ( value ) , <nl> - jentry_value_len ) ; <nl> + jvalue_len ) ; <nl> <nl> rocksdb : : Status s ; <nl> if ( cf_handle ! = nullptr ) { <nl> void rocksdb_put_helper ( <nl> s = db - > Put ( write_options , key_slice , value_slice ) ; <nl> } <nl> <nl> - / / trigger java unref on key and value . <nl> - / / by passing JNI_ABORT , it will simply release the reference without <nl> - / / copying the result back to the java byte array . <nl> - env - > ReleaseByteArrayElements ( jkey , key , JNI_ABORT ) ; <nl> - env - > ReleaseByteArrayElements ( jentry_value , value , JNI_ABORT ) ; <nl> + / / cleanup <nl> + delete [ ] value ; <nl> + delete [ ] key ; <nl> <nl> if ( s . ok ( ) ) { <nl> return ; <nl> void rocksdb_put_helper ( <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : put <nl> - * Signature : ( J [ BI [ BI ) V <nl> + * Signature : ( J [ BII [ BII ) V <nl> * / <nl> - void Java_org_rocksdb_RocksDB_put__J_3BI_3BI ( <nl> + void Java_org_rocksdb_RocksDB_put__J_3BII_3BII ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , <nl> - jbyteArray jkey , jint jkey_len , <nl> - jbyteArray jentry_value , jint jentry_value_len ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , <nl> + jbyteArray jvalue , jint jvalue_off , jint jvalue_len ) { <nl> auto db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> static const rocksdb : : WriteOptions default_write_options = <nl> rocksdb : : WriteOptions ( ) ; <nl> <nl> rocksdb_put_helper ( env , db , default_write_options , nullptr , <nl> - jkey , jkey_len , <nl> - jentry_value , jentry_value_len ) ; <nl> + jkey , jkey_off , jkey_len , <nl> + jvalue , jvalue_off , jvalue_len ) ; <nl> } <nl> + <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : put <nl> - * Signature : ( J [ BI [ BIJ ) V <nl> + * Signature : ( J [ BII [ BIIJ ) V <nl> * / <nl> - void Java_org_rocksdb_RocksDB_put__J_3BI_3BIJ ( <nl> + void Java_org_rocksdb_RocksDB_put__J_3BII_3BIIJ ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , <nl> - jbyteArray jkey , jint jkey_len , <nl> - jbyteArray jentry_value , jint jentry_value_len , jlong jcf_handle ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , <nl> + jbyteArray jvalue , jint jvalue_off , jint jvalue_len , jlong jcf_handle ) { <nl> auto db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> static const rocksdb : : WriteOptions default_write_options = <nl> rocksdb : : WriteOptions ( ) ; <nl> auto cf_handle = reinterpret_cast < rocksdb : : ColumnFamilyHandle * > ( jcf_handle ) ; <nl> if ( cf_handle ! = nullptr ) { <nl> rocksdb_put_helper ( env , db , default_write_options , cf_handle , <nl> - jkey , jkey_len , jentry_value , jentry_value_len ) ; <nl> + jkey , jkey_off , jkey_len , jvalue , jvalue_off , jvalue_len ) ; <nl> } else { <nl> rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , <nl> rocksdb : : Status : : InvalidArgument ( " Invalid ColumnFamilyHandle . " ) ) ; <nl> void Java_org_rocksdb_RocksDB_put__J_3BI_3BIJ ( <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : put <nl> - * Signature : ( JJ [ BI [ BI ) V <nl> + * Signature : ( JJ [ BII [ BII ) V <nl> * / <nl> - void Java_org_rocksdb_RocksDB_put__JJ_3BI_3BI ( <nl> + void Java_org_rocksdb_RocksDB_put__JJ_3BII_3BII ( <nl> JNIEnv * env , jobject jdb , <nl> jlong jdb_handle , jlong jwrite_options_handle , <nl> - jbyteArray jkey , jint jkey_len , <nl> - jbyteArray jentry_value , jint jentry_value_len ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , <nl> + jbyteArray jvalue , jint jvalue_off , jint jvalue_len ) { <nl> auto db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> auto write_options = reinterpret_cast < rocksdb : : WriteOptions * > ( <nl> jwrite_options_handle ) ; <nl> <nl> rocksdb_put_helper ( env , db , * write_options , nullptr , <nl> - jkey , jkey_len , <nl> - jentry_value , jentry_value_len ) ; <nl> + jkey , jkey_off , jkey_len , <nl> + jvalue , jvalue_off , jvalue_len ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : put <nl> - * Signature : ( JJ [ BI [ BIJ ) V <nl> + * Signature : ( JJ [ BII [ BIIJ ) V <nl> * / <nl> - void Java_org_rocksdb_RocksDB_put__JJ_3BI_3BIJ ( <nl> + void Java_org_rocksdb_RocksDB_put__JJ_3BII_3BIIJ ( <nl> JNIEnv * env , jobject jdb , <nl> jlong jdb_handle , jlong jwrite_options_handle , <nl> - jbyteArray jkey , jint jkey_len , <nl> - jbyteArray jentry_value , jint jentry_value_len , jlong jcf_handle ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , <nl> + jbyteArray jvalue , jint jvalue_off , jint jvalue_len , jlong jcf_handle ) { <nl> auto db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> auto write_options = reinterpret_cast < rocksdb : : WriteOptions * > ( <nl> jwrite_options_handle ) ; <nl> auto cf_handle = reinterpret_cast < rocksdb : : ColumnFamilyHandle * > ( jcf_handle ) ; <nl> if ( cf_handle ! = nullptr ) { <nl> rocksdb_put_helper ( env , db , * write_options , cf_handle , <nl> - jkey , jkey_len , jentry_value , jentry_value_len ) ; <nl> + jkey , jkey_off , jkey_len , jvalue , jvalue_off , jvalue_len ) ; <nl> } else { <nl> rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , <nl> rocksdb : : Status : : InvalidArgument ( " Invalid ColumnFamilyHandle . " ) ) ; <nl> void Java_org_rocksdb_RocksDB_write1 ( <nl> / / rocksdb : : DB : : KeyMayExist <nl> jboolean key_may_exist_helper ( JNIEnv * env , rocksdb : : DB * db , <nl> const rocksdb : : ReadOptions & read_opt , <nl> - rocksdb : : ColumnFamilyHandle * cf_handle , jbyteArray jkey , jint jkey_len , <nl> - jobject jstring_buffer ) { <nl> + rocksdb : : ColumnFamilyHandle * cf_handle , jbyteArray jkey , jint jkey_off , <nl> + jint jkey_len , jobject jstring_buffer ) { <nl> std : : string value ; <nl> bool value_found = false ; <nl> - jboolean isCopy ; <nl> - jbyte * key = env - > GetByteArrayElements ( jkey , & isCopy ) ; <nl> + jbyte * key = new jbyte [ jkey_len ] ; <nl> + env - > GetByteArrayRegion ( jkey , jkey_off , jkey_len , key ) ; <nl> rocksdb : : Slice key_slice ( reinterpret_cast < char * > ( key ) , jkey_len ) ; <nl> bool keyMayExist ; <nl> if ( cf_handle ! = nullptr ) { <nl> jboolean key_may_exist_helper ( JNIEnv * env , rocksdb : : DB * db , <nl> & value , & value_found ) ; <nl> } <nl> <nl> + / / cleanup <nl> + delete [ ] key ; <nl> + <nl> + / / extract the value <nl> if ( value_found & & ! value . empty ( ) ) { <nl> jclass clazz = env - > GetObjectClass ( jstring_buffer ) ; <nl> jmethodID mid = env - > GetMethodID ( clazz , " append " , <nl> jboolean key_may_exist_helper ( JNIEnv * env , rocksdb : : DB * db , <nl> jstring new_value_str = env - > NewStringUTF ( value . c_str ( ) ) ; <nl> env - > CallObjectMethod ( jstring_buffer , mid , new_value_str ) ; <nl> } <nl> - env - > ReleaseByteArrayElements ( jkey , key , JNI_ABORT ) ; <nl> return static_cast < jboolean > ( keyMayExist ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : keyMayExist <nl> - * Signature : ( J [ BILjava / lang / StringBuffer ; ) Z <nl> + * Signature : ( J [ BIILjava / lang / StringBuffer ; ) Z <nl> * / <nl> - jboolean Java_org_rocksdb_RocksDB_keyMayExist__J_3BILjava_lang_StringBuffer_2 ( <nl> - JNIEnv * env , jobject jdb , jlong jdb_handle , jbyteArray jkey , jint jkey_len , <nl> - jobject jstring_buffer ) { <nl> + jboolean Java_org_rocksdb_RocksDB_keyMayExist__J_3BIILjava_lang_StringBuffer_2 ( <nl> + JNIEnv * env , jobject jdb , jlong jdb_handle , jbyteArray jkey , jint jkey_off , <nl> + jint jkey_len , jobject jstring_buffer ) { <nl> auto * db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> return key_may_exist_helper ( env , db , rocksdb : : ReadOptions ( ) , <nl> - nullptr , jkey , jkey_len , jstring_buffer ) ; <nl> + nullptr , jkey , jkey_off , jkey_len , jstring_buffer ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : keyMayExist <nl> - * Signature : ( J [ BIJLjava / lang / StringBuffer ; ) Z <nl> + * Signature : ( J [ BIIJLjava / lang / StringBuffer ; ) Z <nl> * / <nl> - jboolean Java_org_rocksdb_RocksDB_keyMayExist__J_3BIJLjava_lang_StringBuffer_2 ( <nl> - JNIEnv * env , jobject jdb , jlong jdb_handle , jbyteArray jkey , jint jkey_len , <nl> - jlong jcf_handle , jobject jstring_buffer ) { <nl> + jboolean Java_org_rocksdb_RocksDB_keyMayExist__J_3BIIJLjava_lang_StringBuffer_2 ( <nl> + JNIEnv * env , jobject jdb , jlong jdb_handle , jbyteArray jkey , jint jkey_off , <nl> + jint jkey_len , jlong jcf_handle , jobject jstring_buffer ) { <nl> auto * db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> auto * cf_handle = reinterpret_cast < rocksdb : : ColumnFamilyHandle * > ( <nl> jcf_handle ) ; <nl> if ( cf_handle ! = nullptr ) { <nl> return key_may_exist_helper ( env , db , rocksdb : : ReadOptions ( ) , <nl> - cf_handle , jkey , jkey_len , jstring_buffer ) ; <nl> + cf_handle , jkey , jkey_off , jkey_len , jstring_buffer ) ; <nl> } else { <nl> rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , <nl> rocksdb : : Status : : InvalidArgument ( " Invalid ColumnFamilyHandle . " ) ) ; <nl> jboolean Java_org_rocksdb_RocksDB_keyMayExist__J_3BIJLjava_lang_StringBuffer_2 ( <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : keyMayExist <nl> - * Signature : ( JJ [ BILjava / lang / StringBuffer ; ) Z <nl> + * Signature : ( JJ [ BIILjava / lang / StringBuffer ; ) Z <nl> * / <nl> - jboolean Java_org_rocksdb_RocksDB_keyMayExist__JJ_3BILjava_lang_StringBuffer_2 ( <nl> + jboolean Java_org_rocksdb_RocksDB_keyMayExist__JJ_3BIILjava_lang_StringBuffer_2 ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , jlong jread_options_handle , <nl> - jbyteArray jkey , jint jkey_len , jobject jstring_buffer ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , jobject jstring_buffer ) { <nl> auto * db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> auto & read_options = * reinterpret_cast < rocksdb : : ReadOptions * > ( <nl> jread_options_handle ) ; <nl> return key_may_exist_helper ( env , db , read_options , <nl> - nullptr , jkey , jkey_len , jstring_buffer ) ; <nl> + nullptr , jkey , jkey_off , jkey_len , jstring_buffer ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : keyMayExist <nl> - * Signature : ( JJ [ BIJLjava / lang / StringBuffer ; ) Z <nl> + * Signature : ( JJ [ BIIJLjava / lang / StringBuffer ; ) Z <nl> * / <nl> - jboolean Java_org_rocksdb_RocksDB_keyMayExist__JJ_3BIJLjava_lang_StringBuffer_2 ( <nl> + jboolean Java_org_rocksdb_RocksDB_keyMayExist__JJ_3BIIJLjava_lang_StringBuffer_2 ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , jlong jread_options_handle , <nl> - jbyteArray jkey , jint jkey_len , jlong jcf_handle , jobject jstring_buffer ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , jlong jcf_handle , <nl> + jobject jstring_buffer ) { <nl> auto * db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> auto & read_options = * reinterpret_cast < rocksdb : : ReadOptions * > ( <nl> jread_options_handle ) ; <nl> jboolean Java_org_rocksdb_RocksDB_keyMayExist__JJ_3BIJLjava_lang_StringBuffer_2 ( <nl> jcf_handle ) ; <nl> if ( cf_handle ! = nullptr ) { <nl> return key_may_exist_helper ( env , db , read_options , cf_handle , <nl> - jkey , jkey_len , jstring_buffer ) ; <nl> + jkey , jkey_off , jkey_len , jstring_buffer ) ; <nl> } else { <nl> rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , <nl> rocksdb : : Status : : InvalidArgument ( " Invalid ColumnFamilyHandle . " ) ) ; <nl> jboolean Java_org_rocksdb_RocksDB_keyMayExist__JJ_3BIJLjava_lang_StringBuffer_2 ( <nl> jbyteArray rocksdb_get_helper ( <nl> JNIEnv * env , rocksdb : : DB * db , const rocksdb : : ReadOptions & read_opt , <nl> rocksdb : : ColumnFamilyHandle * column_family_handle , jbyteArray jkey , <nl> - jint jkey_len ) { <nl> - jboolean isCopy ; <nl> - jbyte * key = env - > GetByteArrayElements ( jkey , & isCopy ) ; <nl> + jint jkey_off , jint jkey_len ) { <nl> + <nl> + jbyte * key = new jbyte [ jkey_len ] ; <nl> + env - > GetByteArrayRegion ( jkey , jkey_off , jkey_len , key ) ; <nl> rocksdb : : Slice key_slice ( <nl> reinterpret_cast < char * > ( key ) , jkey_len ) ; <nl> <nl> jbyteArray rocksdb_get_helper ( <nl> s = db - > Get ( read_opt , key_slice , & value ) ; <nl> } <nl> <nl> - / / trigger java unref on key . <nl> - / / by passing JNI_ABORT , it will simply release the reference without <nl> - / / copying the result back to the java byte array . <nl> - env - > ReleaseByteArrayElements ( jkey , key , JNI_ABORT ) ; <nl> + / / cleanup <nl> + delete [ ] key ; <nl> <nl> if ( s . IsNotFound ( ) ) { <nl> return nullptr ; <nl> jbyteArray rocksdb_get_helper ( <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : get <nl> - * Signature : ( J [ BI ) [ B <nl> + * Signature : ( J [ BII ) [ B <nl> * / <nl> - jbyteArray Java_org_rocksdb_RocksDB_get__J_3BI ( <nl> + jbyteArray Java_org_rocksdb_RocksDB_get__J_3BII ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , <nl> - jbyteArray jkey , jint jkey_len ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len ) { <nl> return rocksdb_get_helper ( env , <nl> reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) , <nl> rocksdb : : ReadOptions ( ) , nullptr , <nl> - jkey , jkey_len ) ; <nl> + jkey , jkey_off , jkey_len ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : get <nl> - * Signature : ( J [ BIJ ) [ B <nl> + * Signature : ( J [ BIIJ ) [ B <nl> * / <nl> - jbyteArray Java_org_rocksdb_RocksDB_get__J_3BIJ ( <nl> + jbyteArray Java_org_rocksdb_RocksDB_get__J_3BIIJ ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , <nl> - jbyteArray jkey , jint jkey_len , jlong jcf_handle ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , jlong jcf_handle ) { <nl> auto db_handle = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> auto cf_handle = reinterpret_cast < rocksdb : : ColumnFamilyHandle * > ( jcf_handle ) ; <nl> if ( cf_handle ! = nullptr ) { <nl> return rocksdb_get_helper ( env , db_handle , rocksdb : : ReadOptions ( ) , <nl> - cf_handle , jkey , jkey_len ) ; <nl> + cf_handle , jkey , jkey_off , jkey_len ) ; <nl> } else { <nl> rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , <nl> rocksdb : : Status : : InvalidArgument ( " Invalid ColumnFamilyHandle . " ) ) ; <nl> jbyteArray Java_org_rocksdb_RocksDB_get__J_3BIJ ( <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : get <nl> - * Signature : ( JJ [ BI ) [ B <nl> + * Signature : ( JJ [ BII ) [ B <nl> * / <nl> - jbyteArray Java_org_rocksdb_RocksDB_get__JJ_3BI ( <nl> + jbyteArray Java_org_rocksdb_RocksDB_get__JJ_3BII ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , jlong jropt_handle , <nl> - jbyteArray jkey , jint jkey_len ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len ) { <nl> return rocksdb_get_helper ( env , <nl> reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) , <nl> * reinterpret_cast < rocksdb : : ReadOptions * > ( jropt_handle ) , nullptr , <nl> - jkey , jkey_len ) ; <nl> + jkey , jkey_off , jkey_len ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : get <nl> - * Signature : ( JJ [ BIJ ) [ B <nl> + * Signature : ( JJ [ BIIJ ) [ B <nl> * / <nl> - jbyteArray Java_org_rocksdb_RocksDB_get__JJ_3BIJ ( <nl> + jbyteArray Java_org_rocksdb_RocksDB_get__JJ_3BIIJ ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , jlong jropt_handle , <nl> - jbyteArray jkey , jint jkey_len , jlong jcf_handle ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , jlong jcf_handle ) { <nl> auto db_handle = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> auto & ro_opt = * reinterpret_cast < rocksdb : : ReadOptions * > ( jropt_handle ) ; <nl> auto cf_handle = reinterpret_cast < rocksdb : : ColumnFamilyHandle * > ( jcf_handle ) ; <nl> if ( cf_handle ! = nullptr ) { <nl> return rocksdb_get_helper ( env , db_handle , ro_opt , cf_handle , <nl> - jkey , jkey_len ) ; <nl> + jkey , jkey_off , jkey_len ) ; <nl> } else { <nl> rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , <nl> rocksdb : : Status : : InvalidArgument ( " Invalid ColumnFamilyHandle . " ) ) ; <nl> jbyteArray Java_org_rocksdb_RocksDB_get__JJ_3BIJ ( <nl> jint rocksdb_get_helper ( <nl> JNIEnv * env , rocksdb : : DB * db , const rocksdb : : ReadOptions & read_options , <nl> rocksdb : : ColumnFamilyHandle * column_family_handle , jbyteArray jkey , <nl> - jint jkey_len , jbyteArray jentry_value , jint jentry_value_len ) { <nl> + jint jkey_off , jint jkey_len , jbyteArray jvalue , jint jvalue_off , <nl> + jint jvalue_len ) { <nl> static const int kNotFound = - 1 ; <nl> static const int kStatusError = - 2 ; <nl> <nl> - jbyte * key = env - > GetByteArrayElements ( jkey , 0 ) ; <nl> + jbyte * key = new jbyte [ jkey_len ] ; <nl> + env - > GetByteArrayRegion ( jkey , jkey_off , jkey_len , key ) ; <nl> rocksdb : : Slice key_slice ( <nl> reinterpret_cast < char * > ( key ) , jkey_len ) ; <nl> <nl> jint rocksdb_get_helper ( <nl> s = db - > Get ( read_options , key_slice , & cvalue ) ; <nl> } <nl> <nl> - / / trigger java unref on key . <nl> - / / by passing JNI_ABORT , it will simply release the reference without <nl> - / / copying the result back to the java byte array . <nl> - env - > ReleaseByteArrayElements ( jkey , key , JNI_ABORT ) ; <nl> + / / cleanup <nl> + delete [ ] key ; <nl> <nl> if ( s . IsNotFound ( ) ) { <nl> return kNotFound ; <nl> jint rocksdb_get_helper ( <nl> } <nl> <nl> jint cvalue_len = static_cast < jint > ( cvalue . size ( ) ) ; <nl> - jint length = std : : min ( jentry_value_len , cvalue_len ) ; <nl> + jint length = std : : min ( jvalue_len , cvalue_len ) ; <nl> <nl> env - > SetByteArrayRegion ( <nl> - jentry_value , 0 , length , <nl> + jvalue , jvalue_off , length , <nl> reinterpret_cast < const jbyte * > ( cvalue . c_str ( ) ) ) ; <nl> return cvalue_len ; <nl> } <nl> jint rocksdb_get_helper ( <nl> / / cf multi get <nl> jobjectArray multi_get_helper ( JNIEnv * env , jobject jdb , rocksdb : : DB * db , <nl> const rocksdb : : ReadOptions & rOpt , jobjectArray jkeys , <nl> + jintArray jkey_offs , jintArray jkey_lens , <nl> jlongArray jcolumn_family_handles ) { <nl> std : : vector < rocksdb : : ColumnFamilyHandle * > cf_handles ; <nl> if ( jcolumn_family_handles ! = nullptr ) { <nl> jobjectArray multi_get_helper ( JNIEnv * env , jobject jdb , rocksdb : : DB * db , <nl> } <nl> <nl> std : : vector < rocksdb : : Slice > keys ; <nl> - std : : vector < std : : tuple < jbyteArray , jbyte * , jobject > > keys_to_free ; <nl> + std : : vector < std : : pair < jbyte * , jobject > > keys_to_free ; <nl> jsize len_keys = env - > GetArrayLength ( jkeys ) ; <nl> - if ( env - > EnsureLocalCapacity ( len_keys ) ! = 0 ) { <nl> + if ( env - > EnsureLocalCapacity ( len_keys ) ! = 0 ) { <nl> / / out of memory <nl> return NULL ; <nl> } <nl> + <nl> + jint * jkey_off = env - > GetIntArrayElements ( jkey_offs , NULL ) ; <nl> + jint * jkey_len = env - > GetIntArrayElements ( jkey_lens , NULL ) ; <nl> + <nl> for ( int i = 0 ; i < len_keys ; i + + ) { <nl> - jobject jk = env - > GetObjectArrayElement ( jkeys , i ) ; <nl> - jbyteArray jk_ba = reinterpret_cast < jbyteArray > ( jk ) ; <nl> - jsize len_key = env - > GetArrayLength ( jk_ba ) ; <nl> - jbyte * jk_val = env - > GetByteArrayElements ( jk_ba , NULL ) ; <nl> + jobject jkey = env - > GetObjectArrayElement ( jkeys , i ) ; <nl> + <nl> + jbyteArray jkey_ba = reinterpret_cast < jbyteArray > ( jkey ) ; <nl> <nl> - rocksdb : : Slice key_slice ( reinterpret_cast < char * > ( jk_val ) , len_key ) ; <nl> + jint len_key = jkey_len [ i ] ; <nl> + jbyte * key = new jbyte [ len_key ] ; <nl> + env - > GetByteArrayRegion ( jkey_ba , jkey_off [ i ] , len_key , key ) ; <nl> + <nl> + rocksdb : : Slice key_slice ( reinterpret_cast < char * > ( key ) , len_key ) ; <nl> keys . push_back ( key_slice ) ; <nl> <nl> - keys_to_free . push_back ( std : : make_tuple ( jk_ba , jk_val , jk ) ) ; <nl> + keys_to_free . push_back ( std : : pair < jbyte * , jobject > ( key , jkey ) ) ; <nl> } <nl> <nl> + / / cleanup jkey_off and jken_len <nl> + env - > ReleaseIntArrayElements ( jkey_lens , jkey_len , JNI_ABORT ) ; <nl> + env - > ReleaseIntArrayElements ( jkey_offs , jkey_off , JNI_ABORT ) ; <nl> + <nl> std : : vector < std : : string > values ; <nl> std : : vector < rocksdb : : Status > s ; <nl> if ( cf_handles . size ( ) = = 0 ) { <nl> jobjectArray multi_get_helper ( JNIEnv * env , jobject jdb , rocksdb : : DB * db , <nl> } <nl> <nl> / / free up allocated byte arrays <nl> - for ( std : : vector < std : : tuple < jbyteArray , jbyte * , jobject > > : : size_type i = 0 ; <nl> - i < keys_to_free . size ( ) ; i + + ) { <nl> - jobject jk ; <nl> - jbyteArray jk_ba ; <nl> - jbyte * jk_val ; <nl> - std : : tie ( jk_ba , jk_val , jk ) = keys_to_free [ i ] ; <nl> - env - > ReleaseByteArrayElements ( jk_ba , jk_val , JNI_ABORT ) ; <nl> - env - > DeleteLocalRef ( jk ) ; <nl> + for ( auto it = keys_to_free . begin ( ) ; it ! = keys_to_free . end ( ) ; + + it ) { <nl> + delete [ ] it - > first ; <nl> + env - > DeleteLocalRef ( it - > second ) ; <nl> } <nl> + keys_to_free . clear ( ) ; <nl> <nl> / / prepare the results <nl> jclass jcls_ba = env - > FindClass ( " [ B " ) ; <nl> jobjectArray multi_get_helper ( JNIEnv * env , jobject jdb , rocksdb : : DB * db , <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : multiGet <nl> - * Signature : ( J [ [ B ) [ [ B <nl> + * Signature : ( J [ [ B [ I [ I ) [ [ B <nl> * / <nl> - jobjectArray Java_org_rocksdb_RocksDB_multiGet__J_3_3B ( <nl> - JNIEnv * env , jobject jdb , jlong jdb_handle , jobjectArray jkeys ) { <nl> + jobjectArray Java_org_rocksdb_RocksDB_multiGet__J_3_3B_3I_3I ( <nl> + JNIEnv * env , jobject jdb , jlong jdb_handle , jobjectArray jkeys , <nl> + jintArray jkey_offs , jintArray jkey_lens ) { <nl> return multi_get_helper ( env , jdb , reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) , <nl> - rocksdb : : ReadOptions ( ) , jkeys , nullptr ) ; <nl> + rocksdb : : ReadOptions ( ) , jkeys , jkey_offs , jkey_lens , nullptr ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : multiGet <nl> - * Signature : ( J [ [ B [ J ) [ [ B <nl> + * Signature : ( J [ [ B [ I [ I [ J ) [ [ B <nl> * / <nl> - jobjectArray Java_org_rocksdb_RocksDB_multiGet__J_3_3B_3J ( <nl> + jobjectArray Java_org_rocksdb_RocksDB_multiGet__J_3_3B_3I_3I_3J ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , jobjectArray jkeys , <nl> + jintArray jkey_offs , jintArray jkey_lens , <nl> jlongArray jcolumn_family_handles ) { <nl> return multi_get_helper ( env , jdb , reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) , <nl> - rocksdb : : ReadOptions ( ) , jkeys , jcolumn_family_handles ) ; <nl> + rocksdb : : ReadOptions ( ) , jkeys , jkey_offs , jkey_lens , <nl> + jcolumn_family_handles ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : multiGet <nl> - * Signature : ( JJ [ [ B ) [ [ B <nl> + * Signature : ( JJ [ [ B [ I [ I ) [ [ B <nl> * / <nl> - jobjectArray Java_org_rocksdb_RocksDB_multiGet__JJ_3_3B ( <nl> + jobjectArray Java_org_rocksdb_RocksDB_multiGet__JJ_3_3B_3I_3I ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , jlong jropt_handle , <nl> - jobjectArray jkeys ) { <nl> + jobjectArray jkeys , jintArray jkey_offs , jintArray jkey_lens ) { <nl> return multi_get_helper ( env , jdb , reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) , <nl> - * reinterpret_cast < rocksdb : : ReadOptions * > ( jropt_handle ) , jkeys , nullptr ) ; <nl> + * reinterpret_cast < rocksdb : : ReadOptions * > ( jropt_handle ) , jkeys , jkey_offs , <nl> + jkey_lens , nullptr ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : multiGet <nl> - * Signature : ( JJ [ [ B [ J ) [ [ B <nl> + * Signature : ( JJ [ [ B [ I [ I [ J ) [ [ B <nl> * / <nl> - jobjectArray Java_org_rocksdb_RocksDB_multiGet__JJ_3_3B_3J ( <nl> + jobjectArray Java_org_rocksdb_RocksDB_multiGet__JJ_3_3B_3I_3I_3J ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , jlong jropt_handle , <nl> - jobjectArray jkeys , jlongArray jcolumn_family_handles ) { <nl> + jobjectArray jkeys , jintArray jkey_offs , jintArray jkey_lens , <nl> + jlongArray jcolumn_family_handles ) { <nl> return multi_get_helper ( env , jdb , reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) , <nl> - * reinterpret_cast < rocksdb : : ReadOptions * > ( jropt_handle ) , jkeys , <nl> - jcolumn_family_handles ) ; <nl> + * reinterpret_cast < rocksdb : : ReadOptions * > ( jropt_handle ) , jkeys , jkey_offs , <nl> + jkey_lens , jcolumn_family_handles ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : get <nl> - * Signature : ( J [ BI [ BI ) I <nl> + * Signature : ( J [ BII [ BII ) I <nl> * / <nl> - jint Java_org_rocksdb_RocksDB_get__J_3BI_3BI ( <nl> + jint Java_org_rocksdb_RocksDB_get__J_3BII_3BII ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , <nl> - jbyteArray jkey , jint jkey_len , <nl> - jbyteArray jentry_value , jint jentry_value_len ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , <nl> + jbyteArray jvalue , jint jvalue_off , jint jvalue_len ) { <nl> return rocksdb_get_helper ( env , <nl> reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) , <nl> rocksdb : : ReadOptions ( ) , nullptr , <nl> - jkey , jkey_len , jentry_value , jentry_value_len ) ; <nl> + jkey , jkey_off , jkey_len , jvalue , jvalue_off , jvalue_len ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : get <nl> - * Signature : ( J [ BI [ BIJ ) I <nl> + * Signature : ( J [ BII [ BIIJ ) I <nl> * / <nl> - jint Java_org_rocksdb_RocksDB_get__J_3BI_3BIJ ( <nl> + jint Java_org_rocksdb_RocksDB_get__J_3BII_3BIIJ ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , <nl> - jbyteArray jkey , jint jkey_len , <nl> - jbyteArray jentry_value , jint jentry_value_len , jlong jcf_handle ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , <nl> + jbyteArray jvalue , jint jvalue_off , jint jvalue_len , jlong jcf_handle ) { <nl> auto db_handle = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> auto cf_handle = reinterpret_cast < rocksdb : : ColumnFamilyHandle * > ( jcf_handle ) ; <nl> if ( cf_handle ! = nullptr ) { <nl> return rocksdb_get_helper ( env , db_handle , rocksdb : : ReadOptions ( ) , cf_handle , <nl> - jkey , jkey_len , jentry_value , jentry_value_len ) ; <nl> + jkey , jkey_off , jkey_len , jvalue , jvalue_off , jvalue_len ) ; <nl> } else { <nl> rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , <nl> rocksdb : : Status : : InvalidArgument ( " Invalid ColumnFamilyHandle . " ) ) ; <nl> jint Java_org_rocksdb_RocksDB_get__J_3BI_3BIJ ( <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : get <nl> - * Signature : ( JJ [ BI [ BI ) I <nl> + * Signature : ( JJ [ BII [ BII ) I <nl> * / <nl> - jint Java_org_rocksdb_RocksDB_get__JJ_3BI_3BI ( <nl> + jint Java_org_rocksdb_RocksDB_get__JJ_3BII_3BII ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , jlong jropt_handle , <nl> - jbyteArray jkey , jint jkey_len , <nl> - jbyteArray jentry_value , jint jentry_value_len ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , <nl> + jbyteArray jvalue , jint jvalue_off , jint jvalue_len ) { <nl> return rocksdb_get_helper ( env , <nl> reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) , <nl> * reinterpret_cast < rocksdb : : ReadOptions * > ( jropt_handle ) , <nl> - nullptr , jkey , jkey_len , jentry_value , jentry_value_len ) ; <nl> + nullptr , jkey , jkey_off , jkey_len , jvalue , jvalue_off , jvalue_len ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : get <nl> - * Signature : ( JJ [ BI [ BIJ ) I <nl> + * Signature : ( JJ [ BII [ BIIJ ) I <nl> * / <nl> - jint Java_org_rocksdb_RocksDB_get__JJ_3BI_3BIJ ( <nl> + jint Java_org_rocksdb_RocksDB_get__JJ_3BII_3BIIJ ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , jlong jropt_handle , <nl> - jbyteArray jkey , jint jkey_len , <nl> - jbyteArray jentry_value , jint jentry_value_len , jlong jcf_handle ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , <nl> + jbyteArray jvalue , jint jvalue_off , jint jvalue_len , jlong jcf_handle ) { <nl> auto db_handle = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> auto & ro_opt = * reinterpret_cast < rocksdb : : ReadOptions * > ( jropt_handle ) ; <nl> auto cf_handle = reinterpret_cast < rocksdb : : ColumnFamilyHandle * > ( jcf_handle ) ; <nl> if ( cf_handle ! = nullptr ) { <nl> return rocksdb_get_helper ( env , db_handle , ro_opt , cf_handle , jkey , <nl> - jkey_len , jentry_value , jentry_value_len ) ; <nl> + jkey_off , jkey_len , jvalue , jvalue_off , jvalue_len ) ; <nl> } else { <nl> rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , <nl> rocksdb : : Status : : InvalidArgument ( " Invalid ColumnFamilyHandle . " ) ) ; <nl> jint Java_org_rocksdb_RocksDB_get__JJ_3BI_3BIJ ( <nl> / / rocksdb : : DB : : Delete ( ) <nl> void rocksdb_delete_helper ( <nl> JNIEnv * env , rocksdb : : DB * db , const rocksdb : : WriteOptions & write_options , <nl> - rocksdb : : ColumnFamilyHandle * cf_handle , jbyteArray jkey , jint jkey_len ) { <nl> - jbyte * key = env - > GetByteArrayElements ( jkey , 0 ) ; <nl> + rocksdb : : ColumnFamilyHandle * cf_handle , jbyteArray jkey , jint jkey_off , <nl> + jint jkey_len ) { <nl> + jbyte * key = new jbyte [ jkey_len ] ; <nl> + env - > GetByteArrayRegion ( jkey , jkey_off , jkey_len , key ) ; <nl> rocksdb : : Slice key_slice ( reinterpret_cast < char * > ( key ) , jkey_len ) ; <nl> <nl> rocksdb : : Status s ; <nl> void rocksdb_delete_helper ( <nl> / / backwards compatibility <nl> s = db - > Delete ( write_options , key_slice ) ; <nl> } <nl> - / / trigger java unref on key and value . <nl> - / / by passing JNI_ABORT , it will simply release the reference without <nl> - / / copying the result back to the java byte array . <nl> - env - > ReleaseByteArrayElements ( jkey , key , JNI_ABORT ) ; <nl> + <nl> + / / cleanup <nl> + delete [ ] key ; <nl> <nl> if ( ! s . ok ( ) ) { <nl> rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , s ) ; <nl> void rocksdb_delete_helper ( <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : delete <nl> - * Signature : ( J [ BI ) V <nl> + * Signature : ( J [ BII ) V <nl> * / <nl> - void Java_org_rocksdb_RocksDB_delete__J_3BI ( <nl> + void Java_org_rocksdb_RocksDB_delete__J_3BII ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , <nl> - jbyteArray jkey , jint jkey_len ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len ) { <nl> auto db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> static const rocksdb : : WriteOptions default_write_options = <nl> rocksdb : : WriteOptions ( ) ; <nl> rocksdb_delete_helper ( env , db , default_write_options , nullptr , <nl> - jkey , jkey_len ) ; <nl> + jkey , jkey_off , jkey_len ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : delete <nl> - * Signature : ( J [ BIJ ) V <nl> + * Signature : ( J [ BIIJ ) V <nl> * / <nl> - void Java_org_rocksdb_RocksDB_delete__J_3BIJ ( <nl> + void Java_org_rocksdb_RocksDB_delete__J_3BIIJ ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , <nl> - jbyteArray jkey , jint jkey_len , jlong jcf_handle ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , jlong jcf_handle ) { <nl> auto db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> static const rocksdb : : WriteOptions default_write_options = <nl> rocksdb : : WriteOptions ( ) ; <nl> auto cf_handle = reinterpret_cast < rocksdb : : ColumnFamilyHandle * > ( jcf_handle ) ; <nl> if ( cf_handle ! = nullptr ) { <nl> rocksdb_delete_helper ( env , db , default_write_options , cf_handle , <nl> - jkey , jkey_len ) ; <nl> + jkey , jkey_off , jkey_len ) ; <nl> } else { <nl> rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , <nl> rocksdb : : Status : : InvalidArgument ( " Invalid ColumnFamilyHandle . " ) ) ; <nl> void Java_org_rocksdb_RocksDB_delete__J_3BIJ ( <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : delete <nl> - * Signature : ( JJ [ BIJ ) V <nl> + * Signature : ( JJ [ BII ) V <nl> * / <nl> - void Java_org_rocksdb_RocksDB_delete__JJ_3BI ( <nl> + void Java_org_rocksdb_RocksDB_delete__JJ_3BII ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , <nl> - jlong jwrite_options , jbyteArray jkey , jint jkey_len ) { <nl> + jlong jwrite_options , jbyteArray jkey , jint jkey_off , jint jkey_len ) { <nl> auto db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> auto write_options = reinterpret_cast < rocksdb : : WriteOptions * > ( jwrite_options ) ; <nl> - rocksdb_delete_helper ( env , db , * write_options , nullptr , jkey , jkey_len ) ; <nl> + rocksdb_delete_helper ( env , db , * write_options , nullptr , jkey , jkey_off , <nl> + jkey_len ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : delete <nl> - * Signature : ( JJ [ BIJ ) V <nl> + * Signature : ( JJ [ BIIJ ) V <nl> * / <nl> - void Java_org_rocksdb_RocksDB_delete__JJ_3BIJ ( <nl> + void Java_org_rocksdb_RocksDB_delete__JJ_3BIIJ ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , <nl> - jlong jwrite_options , jbyteArray jkey , jint jkey_len , <nl> + jlong jwrite_options , jbyteArray jkey , jint jkey_off , jint jkey_len , <nl> jlong jcf_handle ) { <nl> auto db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> auto write_options = reinterpret_cast < rocksdb : : WriteOptions * > ( jwrite_options ) ; <nl> auto cf_handle = reinterpret_cast < rocksdb : : ColumnFamilyHandle * > ( jcf_handle ) ; <nl> if ( cf_handle ! = nullptr ) { <nl> - rocksdb_delete_helper ( env , db , * write_options , cf_handle , jkey , jkey_len ) ; <nl> + rocksdb_delete_helper ( env , db , * write_options , cf_handle , jkey , jkey_off , <nl> + jkey_len ) ; <nl> } else { <nl> rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , <nl> rocksdb : : Status : : InvalidArgument ( " Invalid ColumnFamilyHandle . " ) ) ; <nl> void Java_org_rocksdb_RocksDB_singleDelete__JJ_3BIJ ( <nl> <nl> void rocksdb_merge_helper ( <nl> JNIEnv * env , rocksdb : : DB * db , const rocksdb : : WriteOptions & write_options , <nl> - rocksdb : : ColumnFamilyHandle * cf_handle , jbyteArray jkey , jint jkey_len , <nl> - jbyteArray jentry_value , jint jentry_value_len ) { <nl> - <nl> - jbyte * key = env - > GetByteArrayElements ( jkey , 0 ) ; <nl> - jbyte * value = env - > GetByteArrayElements ( jentry_value , 0 ) ; <nl> + rocksdb : : ColumnFamilyHandle * cf_handle , jbyteArray jkey , jint jkey_off , <nl> + jint jkey_len , jbyteArray jvalue , jint jvalue_off , jint jvalue_len ) { <nl> + jbyte * key = new jbyte [ jkey_len ] ; <nl> + env - > GetByteArrayRegion ( jkey , jkey_off , jkey_len , key ) ; <nl> + jbyte * value = new jbyte [ jkey_len ] ; <nl> + env - > GetByteArrayRegion ( jvalue , jvalue_off , jvalue_len , value ) ; <nl> rocksdb : : Slice key_slice ( reinterpret_cast < char * > ( key ) , jkey_len ) ; <nl> rocksdb : : Slice value_slice ( reinterpret_cast < char * > ( value ) , <nl> - jentry_value_len ) ; <nl> + jvalue_len ) ; <nl> <nl> rocksdb : : Status s ; <nl> if ( cf_handle ! = nullptr ) { <nl> void rocksdb_merge_helper ( <nl> s = db - > Merge ( write_options , key_slice , value_slice ) ; <nl> } <nl> <nl> - / / trigger java unref on key and value . <nl> - / / by passing JNI_ABORT , it will simply release the reference without <nl> - / / copying the result back to the java byte array . <nl> - env - > ReleaseByteArrayElements ( jkey , key , JNI_ABORT ) ; <nl> - env - > ReleaseByteArrayElements ( jentry_value , value , JNI_ABORT ) ; <nl> + / / cleanup <nl> + delete [ ] value ; <nl> + delete [ ] key ; <nl> <nl> if ( s . ok ( ) ) { <nl> return ; <nl> void rocksdb_merge_helper ( <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : merge <nl> - * Signature : ( J [ BI [ BI ) V <nl> + * Signature : ( J [ BII [ BII ) V <nl> * / <nl> - void Java_org_rocksdb_RocksDB_merge__J_3BI_3BI ( <nl> + void Java_org_rocksdb_RocksDB_merge__J_3BII_3BII ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , <nl> - jbyteArray jkey , jint jkey_len , <nl> - jbyteArray jentry_value , jint jentry_value_len ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , <nl> + jbyteArray jvalue , jint jvalue_off , jint jvalue_len ) { <nl> auto db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> static const rocksdb : : WriteOptions default_write_options = <nl> rocksdb : : WriteOptions ( ) ; <nl> <nl> rocksdb_merge_helper ( env , db , default_write_options , <nl> - nullptr , jkey , jkey_len , jentry_value , jentry_value_len ) ; <nl> + nullptr , jkey , jkey_off , jkey_len , jvalue , jvalue_off , jvalue_len ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : merge <nl> - * Signature : ( J [ BI [ BIJ ) V <nl> + * Signature : ( J [ BII [ BIIJ ) V <nl> * / <nl> - void Java_org_rocksdb_RocksDB_merge__J_3BI_3BIJ ( <nl> + void Java_org_rocksdb_RocksDB_merge__J_3BII_3BIIJ ( <nl> JNIEnv * env , jobject jdb , jlong jdb_handle , <nl> - jbyteArray jkey , jint jkey_len , <nl> - jbyteArray jentry_value , jint jentry_value_len , jlong jcf_handle ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , <nl> + jbyteArray jvalue , jint jvalue_off , jint jvalue_len , jlong jcf_handle ) { <nl> auto db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> static const rocksdb : : WriteOptions default_write_options = <nl> rocksdb : : WriteOptions ( ) ; <nl> auto cf_handle = reinterpret_cast < rocksdb : : ColumnFamilyHandle * > ( jcf_handle ) ; <nl> if ( cf_handle ! = nullptr ) { <nl> rocksdb_merge_helper ( env , db , default_write_options , <nl> - cf_handle , jkey , jkey_len , jentry_value , jentry_value_len ) ; <nl> + cf_handle , jkey , jkey_off , jkey_len , jvalue , jvalue_off , jvalue_len ) ; <nl> } else { <nl> rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , <nl> rocksdb : : Status : : InvalidArgument ( " Invalid ColumnFamilyHandle . " ) ) ; <nl> void Java_org_rocksdb_RocksDB_merge__J_3BI_3BIJ ( <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : merge <nl> - * Signature : ( JJ [ BI [ BI ) V <nl> + * Signature : ( JJ [ BII [ BII ) V <nl> * / <nl> - void Java_org_rocksdb_RocksDB_merge__JJ_3BI_3BI ( <nl> + void Java_org_rocksdb_RocksDB_merge__JJ_3BII_3BII ( <nl> JNIEnv * env , jobject jdb , <nl> jlong jdb_handle , jlong jwrite_options_handle , <nl> - jbyteArray jkey , jint jkey_len , <nl> - jbyteArray jentry_value , jint jentry_value_len ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , <nl> + jbyteArray jvalue , jint jvalue_off , jint jvalue_len ) { <nl> auto db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> auto write_options = reinterpret_cast < rocksdb : : WriteOptions * > ( <nl> jwrite_options_handle ) ; <nl> <nl> rocksdb_merge_helper ( env , db , * write_options , <nl> - nullptr , jkey , jkey_len , jentry_value , jentry_value_len ) ; <nl> + nullptr , jkey , jkey_off , jkey_len , jvalue , jvalue_off , jvalue_len ) ; <nl> } <nl> <nl> / * <nl> * Class : org_rocksdb_RocksDB <nl> * Method : merge <nl> - * Signature : ( JJ [ BI [ BIJ ) V <nl> + * Signature : ( JJ [ BII [ BIIJ ) V <nl> * / <nl> - void Java_org_rocksdb_RocksDB_merge__JJ_3BI_3BIJ ( <nl> + void Java_org_rocksdb_RocksDB_merge__JJ_3BII_3BIIJ ( <nl> JNIEnv * env , jobject jdb , <nl> jlong jdb_handle , jlong jwrite_options_handle , <nl> - jbyteArray jkey , jint jkey_len , <nl> - jbyteArray jentry_value , jint jentry_value_len , jlong jcf_handle ) { <nl> + jbyteArray jkey , jint jkey_off , jint jkey_len , <nl> + jbyteArray jvalue , jint jvalue_off , jint jvalue_len , jlong jcf_handle ) { <nl> auto db = reinterpret_cast < rocksdb : : DB * > ( jdb_handle ) ; <nl> auto write_options = reinterpret_cast < rocksdb : : WriteOptions * > ( <nl> jwrite_options_handle ) ; <nl> auto cf_handle = reinterpret_cast < rocksdb : : ColumnFamilyHandle * > ( jcf_handle ) ; <nl> if ( cf_handle ! = nullptr ) { <nl> rocksdb_merge_helper ( env , db , * write_options , <nl> - cf_handle , jkey , jkey_len , jentry_value , jentry_value_len ) ; <nl> + cf_handle , jkey , jkey_off , jkey_len , jvalue , jvalue_off , jvalue_len ) ; <nl> } else { <nl> rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , <nl> rocksdb : : Status : : InvalidArgument ( " Invalid ColumnFamilyHandle . " ) ) ; <nl> void Java_org_rocksdb_RocksDB_setOptions ( JNIEnv * env , jobject jdb , <nl> std : : unordered_map < std : : string , std : : string > options_map ; <nl> const jsize len = env - > GetArrayLength ( jkeys ) ; <nl> assert ( len = = env - > GetArrayLength ( jvalues ) ) ; <nl> - for ( int i = 0 ; i < len ; i + + ) { <nl> + for ( int i = 0 ; i < len ; i + + ) { <nl> jobject jobj_key = env - > GetObjectArrayElement ( jkeys , i ) ; <nl> jobject jobj_value = env - > GetObjectArrayElement ( jvalues , i ) ; <nl> jstring jkey = reinterpret_cast < jstring > ( jobj_key ) ; <nl> mmm a / java / src / main / java / org / rocksdb / RocksDB . java <nl> ppp b / java / src / main / java / org / rocksdb / RocksDB . java <nl> private void storeOptionsInstance ( DBOptionsInterface options ) { <nl> * / <nl> public void put ( final byte [ ] key , final byte [ ] value ) <nl> throws RocksDBException { <nl> - put ( nativeHandle_ , key , key . length , value , value . length ) ; <nl> + put ( nativeHandle_ , key , 0 , key . length , value , 0 , value . length ) ; <nl> } <nl> <nl> / * * <nl> public void put ( final byte [ ] key , final byte [ ] value ) <nl> * / <nl> public void put ( final ColumnFamilyHandle columnFamilyHandle , <nl> final byte [ ] key , final byte [ ] value ) throws RocksDBException { <nl> - put ( nativeHandle_ , key , key . length , value , value . length , <nl> + put ( nativeHandle_ , key , 0 , key . length , value , 0 , value . length , <nl> columnFamilyHandle . nativeHandle_ ) ; <nl> } <nl> <nl> public void put ( final ColumnFamilyHandle columnFamilyHandle , <nl> public void put ( final WriteOptions writeOpts , final byte [ ] key , <nl> final byte [ ] value ) throws RocksDBException { <nl> put ( nativeHandle_ , writeOpts . nativeHandle_ , <nl> - key , key . length , value , value . length ) ; <nl> + key , 0 , key . length , value , 0 , value . length ) ; <nl> } <nl> <nl> / * * <nl> public void put ( final WriteOptions writeOpts , final byte [ ] key , <nl> public void put ( final ColumnFamilyHandle columnFamilyHandle , <nl> final WriteOptions writeOpts , final byte [ ] key , <nl> final byte [ ] value ) throws RocksDBException { <nl> - put ( nativeHandle_ , writeOpts . nativeHandle_ , key , key . length , value , <nl> - value . length , columnFamilyHandle . nativeHandle_ ) ; <nl> + put ( nativeHandle_ , writeOpts . nativeHandle_ , key , 0 , key . length , value , <nl> + 0 , value . length , columnFamilyHandle . nativeHandle_ ) ; <nl> } <nl> <nl> / * * <nl> public void put ( final ColumnFamilyHandle columnFamilyHandle , <nl> * found in block - cache . <nl> * @ return boolean value indicating if key does not exist or might exist . <nl> * / <nl> - public boolean keyMayExist ( final byte [ ] key , final StringBuffer value ) { <nl> - return keyMayExist ( nativeHandle_ , key , key . length , value ) ; <nl> + public boolean keyMayExist ( final byte [ ] key , final StringBuffer value ) { <nl> + return keyMayExist ( nativeHandle_ , key , 0 , key . length , value ) ; <nl> } <nl> <nl> / * * <nl> public boolean keyMayExist ( final byte [ ] key , final StringBuffer value ) { <nl> * @ return boolean value indicating if key does not exist or might exist . <nl> * / <nl> public boolean keyMayExist ( final ColumnFamilyHandle columnFamilyHandle , <nl> - final byte [ ] key , final StringBuffer value ) { <nl> - return keyMayExist ( nativeHandle_ , key , key . length , <nl> + final byte [ ] key , final StringBuffer value ) { <nl> + return keyMayExist ( nativeHandle_ , key , 0 , key . length , <nl> columnFamilyHandle . nativeHandle_ , value ) ; <nl> } <nl> <nl> public boolean keyMayExist ( final ColumnFamilyHandle columnFamilyHandle , <nl> * @ return boolean value indicating if key does not exist or might exist . <nl> * / <nl> public boolean keyMayExist ( final ReadOptions readOptions , <nl> - final byte [ ] key , final StringBuffer value ) { <nl> + final byte [ ] key , final StringBuffer value ) { <nl> return keyMayExist ( nativeHandle_ , readOptions . nativeHandle_ , <nl> - key , key . length , value ) ; <nl> + key , 0 , key . length , value ) ; <nl> } <nl> <nl> / * * <nl> public boolean keyMayExist ( final ReadOptions readOptions , <nl> * / <nl> public boolean keyMayExist ( final ReadOptions readOptions , <nl> final ColumnFamilyHandle columnFamilyHandle , final byte [ ] key , <nl> - final StringBuffer value ) { <nl> + final StringBuffer value ) { <nl> return keyMayExist ( nativeHandle_ , readOptions . nativeHandle_ , <nl> - key , key . length , columnFamilyHandle . nativeHandle_ , <nl> + key , 0 , key . length , columnFamilyHandle . nativeHandle_ , <nl> value ) ; <nl> } <nl> <nl> public void write ( final WriteOptions writeOpts , <nl> * / <nl> public void merge ( final byte [ ] key , final byte [ ] value ) <nl> throws RocksDBException { <nl> - merge ( nativeHandle_ , key , key . length , value , value . length ) ; <nl> + merge ( nativeHandle_ , key , 0 , key . length , value , 0 , value . length ) ; <nl> } <nl> <nl> / * * <nl> public void merge ( final byte [ ] key , final byte [ ] value ) <nl> * / <nl> public void merge ( final ColumnFamilyHandle columnFamilyHandle , <nl> final byte [ ] key , final byte [ ] value ) throws RocksDBException { <nl> - merge ( nativeHandle_ , key , key . length , value , value . length , <nl> + merge ( nativeHandle_ , key , 0 , key . length , value , 0 , value . length , <nl> columnFamilyHandle . nativeHandle_ ) ; <nl> } <nl> <nl> public void merge ( final ColumnFamilyHandle columnFamilyHandle , <nl> public void merge ( final WriteOptions writeOpts , final byte [ ] key , <nl> final byte [ ] value ) throws RocksDBException { <nl> merge ( nativeHandle_ , writeOpts . nativeHandle_ , <nl> - key , key . length , value , value . length ) ; <nl> + key , 0 , key . length , value , 0 , value . length ) ; <nl> } <nl> <nl> / * * <nl> public void merge ( final ColumnFamilyHandle columnFamilyHandle , <nl> final WriteOptions writeOpts , final byte [ ] key , <nl> final byte [ ] value ) throws RocksDBException { <nl> merge ( nativeHandle_ , writeOpts . nativeHandle_ , <nl> - key , key . length , value , value . length , <nl> + key , 0 , key . length , value , 0 , value . length , <nl> columnFamilyHandle . nativeHandle_ ) ; <nl> } <nl> <nl> public void merge ( final ColumnFamilyHandle columnFamilyHandle , <nl> * native library . <nl> * / <nl> public int get ( final byte [ ] key , final byte [ ] value ) throws RocksDBException { <nl> - return get ( nativeHandle_ , key , key . length , value , value . length ) ; <nl> + return get ( nativeHandle_ , key , 0 , key . length , value , 0 , value . length ) ; <nl> } <nl> <nl> / * * <nl> public int get ( final byte [ ] key , final byte [ ] value ) throws RocksDBException { <nl> * / <nl> public int get ( final ColumnFamilyHandle columnFamilyHandle , final byte [ ] key , <nl> final byte [ ] value ) throws RocksDBException , IllegalArgumentException { <nl> - return get ( nativeHandle_ , key , key . length , value , value . length , <nl> + return get ( nativeHandle_ , key , 0 , key . length , value , 0 , value . length , <nl> columnFamilyHandle . nativeHandle_ ) ; <nl> } <nl> <nl> public int get ( final ColumnFamilyHandle columnFamilyHandle , final byte [ ] key , <nl> public int get ( final ReadOptions opt , final byte [ ] key , <nl> final byte [ ] value ) throws RocksDBException { <nl> return get ( nativeHandle_ , opt . nativeHandle_ , <nl> - key , key . length , value , value . length ) ; <nl> + key , 0 , key . length , value , 0 , value . length ) ; <nl> } <nl> / * * <nl> * Get the value associated with the specified key within column family . <nl> public int get ( final ReadOptions opt , final byte [ ] key , <nl> public int get ( final ColumnFamilyHandle columnFamilyHandle , <nl> final ReadOptions opt , final byte [ ] key , final byte [ ] value ) <nl> throws RocksDBException { <nl> - return get ( nativeHandle_ , opt . nativeHandle_ , key , key . length , value , <nl> - value . length , columnFamilyHandle . nativeHandle_ ) ; <nl> + return get ( nativeHandle_ , opt . nativeHandle_ , key , 0 , key . length , value , <nl> + 0 , value . length , columnFamilyHandle . nativeHandle_ ) ; <nl> } <nl> <nl> / * * <nl> public int get ( final ColumnFamilyHandle columnFamilyHandle , <nl> * native library . <nl> * / <nl> public byte [ ] get ( final byte [ ] key ) throws RocksDBException { <nl> - return get ( nativeHandle_ , key , key . length ) ; <nl> + return get ( nativeHandle_ , key , 0 , key . length ) ; <nl> } <nl> <nl> / * * <nl> public int get ( final ColumnFamilyHandle columnFamilyHandle , <nl> * / <nl> public byte [ ] get ( final ColumnFamilyHandle columnFamilyHandle , <nl> final byte [ ] key ) throws RocksDBException { <nl> - return get ( nativeHandle_ , key , key . length , <nl> + return get ( nativeHandle_ , key , 0 , key . length , <nl> columnFamilyHandle . nativeHandle_ ) ; <nl> } <nl> <nl> public int get ( final ColumnFamilyHandle columnFamilyHandle , <nl> * / <nl> public byte [ ] get ( final ReadOptions opt , final byte [ ] key ) <nl> throws RocksDBException { <nl> - return get ( nativeHandle_ , opt . nativeHandle_ , key , key . length ) ; <nl> + return get ( nativeHandle_ , opt . nativeHandle_ , key , 0 , key . length ) ; <nl> } <nl> <nl> / * * <nl> public int get ( final ColumnFamilyHandle columnFamilyHandle , <nl> * / <nl> public byte [ ] get ( final ColumnFamilyHandle columnFamilyHandle , <nl> final ReadOptions opt , final byte [ ] key ) throws RocksDBException { <nl> - return get ( nativeHandle_ , opt . nativeHandle_ , key , key . length , <nl> + return get ( nativeHandle_ , opt . nativeHandle_ , key , 0 , key . length , <nl> columnFamilyHandle . nativeHandle_ ) ; <nl> } <nl> <nl> public int get ( final ColumnFamilyHandle columnFamilyHandle , <nl> throws RocksDBException { <nl> assert ( keys . size ( ) ! = 0 ) ; <nl> <nl> - final byte [ ] [ ] values = multiGet ( nativeHandle_ , <nl> - keys . toArray ( new byte [ keys . size ( ) ] [ ] ) ) ; <nl> + final byte [ ] [ ] keysArray = keys . toArray ( new byte [ keys . size ( ) ] [ ] ) ; <nl> + final int keyOffsets [ ] = new int [ keysArray . length ] ; <nl> + final int keyLengths [ ] = new int [ keysArray . length ] ; <nl> + for ( int i = 0 ; i < keyLengths . length ; i + + ) { <nl> + keyLengths [ i ] = keysArray [ i ] . length ; <nl> + } <nl> + <nl> + final byte [ ] [ ] values = multiGet ( nativeHandle_ , keysArray , keyOffsets , <nl> + keyLengths ) ; <nl> <nl> - Map < byte [ ] , byte [ ] > keyValueMap = new HashMap < > ( ) ; <nl> + final Map < byte [ ] , byte [ ] > keyValueMap = new HashMap < > ( ) ; <nl> for ( int i = 0 ; i < values . length ; i + + ) { <nl> if ( values [ i ] = = null ) { <nl> continue ; <nl> public int get ( final ColumnFamilyHandle columnFamilyHandle , <nl> for ( int i = 0 ; i < columnFamilyHandleList . size ( ) ; i + + ) { <nl> cfHandles [ i ] = columnFamilyHandleList . get ( i ) . nativeHandle_ ; <nl> } <nl> - final byte [ ] [ ] values = multiGet ( nativeHandle_ , <nl> - keys . toArray ( new byte [ keys . size ( ) ] [ ] ) , cfHandles ) ; <nl> <nl> - Map < byte [ ] , byte [ ] > keyValueMap = new HashMap < > ( ) ; <nl> + final byte [ ] [ ] keysArray = keys . toArray ( new byte [ keys . size ( ) ] [ ] ) ; <nl> + final int keyOffsets [ ] = new int [ keysArray . length ] ; <nl> + final int keyLengths [ ] = new int [ keysArray . length ] ; <nl> + for ( int i = 0 ; i < keyLengths . length ; i + + ) { <nl> + keyLengths [ i ] = keysArray [ i ] . length ; <nl> + } <nl> + <nl> + final byte [ ] [ ] values = multiGet ( nativeHandle_ , keysArray , keyOffsets , <nl> + keyLengths , cfHandles ) ; <nl> + <nl> + final Map < byte [ ] , byte [ ] > keyValueMap = new HashMap < > ( ) ; <nl> for ( int i = 0 ; i < values . length ; i + + ) { <nl> if ( values [ i ] = = null ) { <nl> continue ; <nl> public int get ( final ColumnFamilyHandle columnFamilyHandle , <nl> final List < byte [ ] > keys ) throws RocksDBException { <nl> assert ( keys . size ( ) ! = 0 ) ; <nl> <nl> + final byte [ ] [ ] keysArray = keys . toArray ( new byte [ keys . size ( ) ] [ ] ) ; <nl> + final int keyOffsets [ ] = new int [ keysArray . length ] ; <nl> + final int keyLengths [ ] = new int [ keysArray . length ] ; <nl> + for ( int i = 0 ; i < keyLengths . length ; i + + ) { <nl> + keyLengths [ i ] = keysArray [ i ] . length ; <nl> + } <nl> + <nl> final byte [ ] [ ] values = multiGet ( nativeHandle_ , opt . nativeHandle_ , <nl> - keys . toArray ( new byte [ keys . size ( ) ] [ ] ) ) ; <nl> + keysArray , keyOffsets , keyLengths ) ; <nl> <nl> - Map < byte [ ] , byte [ ] > keyValueMap = new HashMap < > ( ) ; <nl> + final Map < byte [ ] , byte [ ] > keyValueMap = new HashMap < > ( ) ; <nl> for ( int i = 0 ; i < values . length ; i + + ) { <nl> if ( values [ i ] = = null ) { <nl> continue ; <nl> public int get ( final ColumnFamilyHandle columnFamilyHandle , <nl> for ( int i = 0 ; i < columnFamilyHandleList . size ( ) ; i + + ) { <nl> cfHandles [ i ] = columnFamilyHandleList . get ( i ) . nativeHandle_ ; <nl> } <nl> + <nl> + final byte [ ] [ ] keysArray = keys . toArray ( new byte [ keys . size ( ) ] [ ] ) ; <nl> + final int keyOffsets [ ] = new int [ keysArray . length ] ; <nl> + final int keyLengths [ ] = new int [ keysArray . length ] ; <nl> + for ( int i = 0 ; i < keyLengths . length ; i + + ) { <nl> + keyLengths [ i ] = keysArray [ i ] . length ; <nl> + } <nl> + <nl> final byte [ ] [ ] values = multiGet ( nativeHandle_ , opt . nativeHandle_ , <nl> - keys . toArray ( new byte [ keys . size ( ) ] [ ] ) , cfHandles ) ; <nl> + keysArray , keyOffsets , keyLengths , cfHandles ) ; <nl> <nl> - Map < byte [ ] , byte [ ] > keyValueMap = new HashMap < > ( ) ; <nl> + final Map < byte [ ] , byte [ ] > keyValueMap = new HashMap < > ( ) ; <nl> for ( int i = 0 ; i < values . length ; i + + ) { <nl> if ( values [ i ] = = null ) { <nl> continue ; <nl> public void remove ( final byte [ ] key ) throws RocksDBException { <nl> * native library . <nl> * / <nl> public void delete ( final byte [ ] key ) throws RocksDBException { <nl> - delete ( nativeHandle_ , key , key . length ) ; <nl> + delete ( nativeHandle_ , key , 0 , key . length ) ; <nl> } <nl> <nl> / * * <nl> public void remove ( final ColumnFamilyHandle columnFamilyHandle , <nl> * / <nl> public void delete ( final ColumnFamilyHandle columnFamilyHandle , <nl> final byte [ ] key ) throws RocksDBException { <nl> - delete ( nativeHandle_ , key , key . length , columnFamilyHandle . nativeHandle_ ) ; <nl> + delete ( nativeHandle_ , key , 0 , key . length , columnFamilyHandle . nativeHandle_ ) ; <nl> } <nl> <nl> / * * <nl> public void remove ( final WriteOptions writeOpt , final byte [ ] key ) <nl> * / <nl> public void delete ( final WriteOptions writeOpt , final byte [ ] key ) <nl> throws RocksDBException { <nl> - delete ( nativeHandle_ , writeOpt . nativeHandle_ , key , key . length ) ; <nl> + delete ( nativeHandle_ , writeOpt . nativeHandle_ , key , 0 , key . length ) ; <nl> } <nl> <nl> / * * <nl> public void remove ( final ColumnFamilyHandle columnFamilyHandle , <nl> public void delete ( final ColumnFamilyHandle columnFamilyHandle , <nl> final WriteOptions writeOpt , final byte [ ] key ) <nl> throws RocksDBException { <nl> - delete ( nativeHandle_ , writeOpt . nativeHandle_ , key , key . length , <nl> + delete ( nativeHandle_ , writeOpt . nativeHandle_ , key , 0 , key . length , <nl> columnFamilyHandle . nativeHandle_ ) ; <nl> } <nl> <nl> protected native static long openROnly ( final long optionsHandle , <nl> final long [ ] columnFamilyOptions <nl> ) throws RocksDBException ; <nl> <nl> - protected native static byte [ ] [ ] listColumnFamilies ( <nl> - long optionsHandle , String path ) throws RocksDBException ; <nl> - protected native void put ( <nl> - long handle , byte [ ] key , int keyLen , <nl> - byte [ ] value , int valueLen ) throws RocksDBException ; <nl> - protected native void put ( <nl> - long handle , byte [ ] key , int keyLen , <nl> - byte [ ] value , int valueLen , long cfHandle ) throws RocksDBException ; <nl> - protected native void put ( <nl> - long handle , long writeOptHandle , <nl> - byte [ ] key , int keyLen , <nl> - byte [ ] value , int valueLen ) throws RocksDBException ; <nl> - protected native void put ( <nl> - long handle , long writeOptHandle , <nl> - byte [ ] key , int keyLen , <nl> - byte [ ] value , int valueLen , long cfHandle ) throws RocksDBException ; <nl> + protected native static byte [ ] [ ] listColumnFamilies ( long optionsHandle , <nl> + String path ) throws RocksDBException ; <nl> + protected native void put ( long handle , byte [ ] key , int keyOffset , <nl> + int keyLength , byte [ ] value , int valueOffset , int valueLength ) <nl> + throws RocksDBException ; <nl> + protected native void put ( long handle , byte [ ] key , int keyOffset , <nl> + int keyLength , byte [ ] value , int valueOffset , int valueLength , <nl> + long cfHandle ) throws RocksDBException ; <nl> + protected native void put ( long handle , long writeOptHandle , byte [ ] key , <nl> + int keyOffset , int keyLength , byte [ ] value , int valueOffset , <nl> + int valueLength ) throws RocksDBException ; <nl> + protected native void put ( long handle , long writeOptHandle , byte [ ] key , <nl> + int keyOffset , int keyLength , byte [ ] value , int valueOffset , <nl> + int valueLength , long cfHandle ) throws RocksDBException ; <nl> protected native void write0 ( final long handle , long writeOptHandle , <nl> long wbHandle ) throws RocksDBException ; <nl> protected native void write1 ( final long handle , long writeOptHandle , <nl> long wbwiHandle ) throws RocksDBException ; <nl> protected native boolean keyMayExist ( final long handle , final byte [ ] key , <nl> - final int keyLen , final StringBuffer stringBuffer ) ; <nl> + final int keyOffset , final int keyLength , <nl> + final StringBuffer stringBuffer ) ; <nl> protected native boolean keyMayExist ( final long handle , final byte [ ] key , <nl> - final int keyLen , final long cfHandle , final StringBuffer stringBuffer ) ; <nl> - protected native boolean keyMayExist ( final long handle , <nl> - final long optionsHandle , final byte [ ] key , final int keyLen , <nl> + final int keyOffset , final int keyLength , final long cfHandle , <nl> final StringBuffer stringBuffer ) ; <nl> protected native boolean keyMayExist ( final long handle , <nl> - final long optionsHandle , final byte [ ] key , final int keyLen , <nl> - final long cfHandle , final StringBuffer stringBuffer ) ; <nl> - protected native void merge ( <nl> - long handle , byte [ ] key , int keyLen , <nl> - byte [ ] value , int valueLen ) throws RocksDBException ; <nl> - protected native void merge ( <nl> - long handle , byte [ ] key , int keyLen , <nl> - byte [ ] value , int valueLen , long cfHandle ) throws RocksDBException ; <nl> - protected native void merge ( <nl> - long handle , long writeOptHandle , <nl> - byte [ ] key , int keyLen , <nl> - byte [ ] value , int valueLen ) throws RocksDBException ; <nl> - protected native void merge ( <nl> - long handle , long writeOptHandle , <nl> - byte [ ] key , int keyLen , <nl> - byte [ ] value , int valueLen , long cfHandle ) throws RocksDBException ; <nl> - protected native int get ( <nl> - long handle , byte [ ] key , int keyLen , <nl> - byte [ ] value , int valueLen ) throws RocksDBException ; <nl> - protected native int get ( <nl> - long handle , byte [ ] key , int keyLen , <nl> - byte [ ] value , int valueLen , long cfHandle ) throws RocksDBException ; <nl> - protected native int get ( <nl> - long handle , long readOptHandle , byte [ ] key , int keyLen , <nl> - byte [ ] value , int valueLen ) throws RocksDBException ; <nl> - protected native int get ( <nl> - long handle , long readOptHandle , byte [ ] key , int keyLen , <nl> - byte [ ] value , int valueLen , long cfHandle ) throws RocksDBException ; <nl> - protected native byte [ ] [ ] multiGet ( final long dbHandle , final byte [ ] [ ] keys ) ; <nl> + final long optionsHandle , final byte [ ] key , final int keyOffset , <nl> + final int keyLength , final StringBuffer stringBuffer ) ; <nl> + protected native boolean keyMayExist ( final long handle , <nl> + final long optionsHandle , final byte [ ] key , final int keyOffset , <nl> + final int keyLength , final long cfHandle , <nl> + final StringBuffer stringBuffer ) ; <nl> + protected native void merge ( long handle , byte [ ] key , int keyOffset , <nl> + int keyLength , byte [ ] value , int valueOffset , int valueLength ) <nl> + throws RocksDBException ; <nl> + protected native void merge ( long handle , byte [ ] key , int keyOffset , <nl> + int keyLength , byte [ ] value , int valueOffset , int valueLength , <nl> + long cfHandle ) throws RocksDBException ; <nl> + protected native void merge ( long handle , long writeOptHandle , byte [ ] key , <nl> + int keyOffset , int keyLength , byte [ ] value , int valueOffset , <nl> + int valueLength ) throws RocksDBException ; <nl> + protected native void merge ( long handle , long writeOptHandle , byte [ ] key , <nl> + int keyOffset , int keyLength , byte [ ] value , int valueOffset , <nl> + int valueLength , long cfHandle ) throws RocksDBException ; <nl> + protected native int get ( long handle , byte [ ] key , int keyOffset , <nl> + int keyLength , byte [ ] value , int valueOffset , int valueLength ) <nl> + throws RocksDBException ; <nl> + protected native int get ( long handle , byte [ ] key , int keyOffset , <nl> + int keyLength , byte [ ] value , int valueOffset , int valueLength , <nl> + long cfHandle ) throws RocksDBException ; <nl> + protected native int get ( long handle , long readOptHandle , byte [ ] key , <nl> + int keyOffset , int keyLength , byte [ ] value , int valueOffset , <nl> + int valueLength ) throws RocksDBException ; <nl> + protected native int get ( long handle , long readOptHandle , byte [ ] key , <nl> + int keyOffset , int keyLength , byte [ ] value , int valueOffset , <nl> + int valueLength , long cfHandle ) throws RocksDBException ; <nl> protected native byte [ ] [ ] multiGet ( final long dbHandle , final byte [ ] [ ] keys , <nl> + final int [ ] keyOffsets , final int [ ] keyLengths ) ; <nl> + protected native byte [ ] [ ] multiGet ( final long dbHandle , final byte [ ] [ ] keys , <nl> + final int [ ] keyOffsets , final int [ ] keyLengths , <nl> final long [ ] columnFamilyHandles ) ; <nl> protected native byte [ ] [ ] multiGet ( final long dbHandle , final long rOptHandle , <nl> - final byte [ ] [ ] keys ) ; <nl> + final byte [ ] [ ] keys , final int [ ] keyOffsets , final int [ ] keyLengths ) ; <nl> protected native byte [ ] [ ] multiGet ( final long dbHandle , final long rOptHandle , <nl> - final byte [ ] [ ] keys , final long [ ] columnFamilyHandles ) ; <nl> - protected native byte [ ] get ( <nl> - long handle , byte [ ] key , int keyLen ) throws RocksDBException ; <nl> - protected native byte [ ] get ( <nl> - long handle , byte [ ] key , int keyLen , long cfHandle ) <nl> - throws RocksDBException ; <nl> - protected native byte [ ] get ( <nl> - long handle , long readOptHandle , <nl> - byte [ ] key , int keyLen ) throws RocksDBException ; <nl> - protected native byte [ ] get ( <nl> - long handle , long readOptHandle , <nl> - byte [ ] key , int keyLen , long cfHandle ) throws RocksDBException ; <nl> - protected native void delete ( <nl> - long handle , byte [ ] key , int keyLen ) throws RocksDBException ; <nl> - protected native void delete ( <nl> - long handle , byte [ ] key , int keyLen , long cfHandle ) <nl> - throws RocksDBException ; <nl> - protected native void delete ( <nl> - long handle , long writeOptHandle , <nl> - byte [ ] key , int keyLen ) throws RocksDBException ; <nl> - protected native void delete ( <nl> - long handle , long writeOptHandle , <nl> - byte [ ] key , int keyLen , long cfHandle ) throws RocksDBException ; <nl> + final byte [ ] [ ] keys , final int [ ] keyOffsets , final int [ ] keyLengths , <nl> + final long [ ] columnFamilyHandles ) ; <nl> + protected native byte [ ] get ( long handle , byte [ ] key , int keyOffset , <nl> + int keyLength ) throws RocksDBException ; <nl> + protected native byte [ ] get ( long handle , byte [ ] key , int keyOffset , <nl> + int keyLength , long cfHandle ) throws RocksDBException ; <nl> + protected native byte [ ] get ( long handle , long readOptHandle , <nl> + byte [ ] key , int keyOffset , int keyLength ) throws RocksDBException ; <nl> + protected native byte [ ] get ( long handle , long readOptHandle , byte [ ] key , <nl> + int keyOffset , int keyLength , long cfHandle ) throws RocksDBException ; <nl> + protected native void delete ( long handle , byte [ ] key , int keyOffset , <nl> + int keyLength ) throws RocksDBException ; <nl> + protected native void delete ( long handle , byte [ ] key , int keyOffset , <nl> + int keyLength , long cfHandle ) throws RocksDBException ; <nl> + protected native void delete ( long handle , long writeOptHandle , byte [ ] key , <nl> + int keyOffset , int keyLength ) throws RocksDBException ; <nl> + protected native void delete ( long handle , long writeOptHandle , byte [ ] key , <nl> + int keyOffset , int keyLength , long cfHandle ) throws RocksDBException ; <nl> protected native void singleDelete ( <nl> long handle , byte [ ] key , int keyLen ) throws RocksDBException ; <nl> protected native void singleDelete ( <nl> protected native String getProperty0 ( long nativeHandle , <nl> String property , int propertyLength ) throws RocksDBException ; <nl> protected native String getProperty0 ( long nativeHandle , long cfHandle , <nl> String property , int propertyLength ) throws RocksDBException ; <nl> - protected native long getLongProperty ( long nativeHandle , <nl> - String property , int propertyLength ) throws RocksDBException ; <nl> + protected native long getLongProperty ( long nativeHandle , String property , <nl> + int propertyLength ) throws RocksDBException ; <nl> protected native long getLongProperty ( long nativeHandle , long cfHandle , <nl> String property , int propertyLength ) throws RocksDBException ; <nl> protected native long iterator ( long handle ) ; <nl> protected native long iteratorCF ( long handle , long cfHandle , <nl> final long [ ] columnFamilyHandles , final long readOptHandle ) <nl> throws RocksDBException ; <nl> protected native long getSnapshot ( long nativeHandle ) ; <nl> - protected native void releaseSnapshot ( <nl> - long nativeHandle , long snapshotHandle ) ; <nl> + protected native void releaseSnapshot ( long nativeHandle , long snapshotHandle ) ; <nl> @ Override protected final native void disposeInternal ( final long handle ) ; <nl> private native long getDefaultColumnFamily ( long handle ) ; <nl> private native long createColumnFamily ( final long handle , <nl> private native void dropColumnFamily ( long handle , long cfHandle ) <nl> throws RocksDBException ; <nl> private native void flush ( long handle , long flushOptHandle ) <nl> throws RocksDBException ; <nl> - private native void flush ( long handle , long flushOptHandle , <nl> - long cfHandle ) throws RocksDBException ; <nl> + private native void flush ( long handle , long flushOptHandle , long cfHandle ) <nl> + throws RocksDBException ; <nl> private native void compactRange0 ( long handle , boolean reduce_level , <nl> int target_level , int target_path_id ) throws RocksDBException ; <nl> private native void compactRange0 ( long handle , byte [ ] begin , int beginLen , <nl> private native void compactRange ( long handle , byte [ ] begin , int beginLen , <nl> private native void continueBackgroundWork ( long handle ) throws RocksDBException ; <nl> private native long getLatestSequenceNumber ( long handle ) ; <nl> private native void disableFileDeletions ( long handle ) throws RocksDBException ; <nl> - private native void enableFileDeletions ( long handle , <nl> - boolean force ) throws RocksDBException ; <nl> + private native void enableFileDeletions ( long handle , boolean force ) <nl> + throws RocksDBException ; <nl> private native long getUpdatesSince ( long handle , long sequenceNumber ) <nl> throws RocksDBException ; <nl> private native void setOptions ( long handle , long cfHandle , String [ ] keys , <nl>
Allow an offset as well as a length to be specified for byte [ ] operations in RocksJava JNI ( )
facebook/rocksdb
22d88e24db012639eeafcaa7fa26ab01eb56f952
2016-09-12T18:51:08Z
mmm a / CHANGELOG <nl> ppp b / CHANGELOG <nl> cocos2d - x - 3 . 3 - rc0 Oct . 21 2014 <nl> [ NEW ] Spine : update to 2 . 0 . 18 <nl> [ NEW ] TileMap : added staggered tile map support <nl> [ NEW ] Utils : added getCascadeBoundingBox ( ) <nl> - [ NEW ] UI : ` WebView ` support on windows <nl> [ NEW ] WP8 : enabled screen orientation change handling <nl> <nl> [ FIX ] Accelerometer : using Accelerometer will freeze app and then crash on WP8 <nl>
[ ci skip ] Update CHANGELOG
cocos2d/cocos2d-x
a52d75f15dfedd272342f9892293f6090257ced5
2014-10-16T13:08:16Z
mmm a / code / online_challenges / src / project_euler / problem_012 / problem_012 . cpp <nl> ppp b / code / online_challenges / src / project_euler / problem_012 / problem_012 . cpp <nl> <nl> - # include < iostream > <nl> - # include < cmath > <nl> + # include < iostream > <nl> + # include < cmath > <nl> <nl> int main ( ) <nl> { <nl> int divisorCount = 0 ; <nl> + <nl> int triangleNumberIndex = 0 , triangleNumber = 0 ; <nl> <nl> while ( divisorCount < 500 ) <nl>
update_3
OpenGenus/cosmos
1f9af21da93ec2672b805cb360304ed82049707d
2018-02-25T16:49:29Z
mmm a / tensorflow / python / autograph / converters / return_statements . py <nl> ppp b / tensorflow / python / autograph / converters / return_statements . py <nl> def __init__ ( self , ctx , default_to_null_return ) : <nl> def visit_Return ( self , node ) : <nl> self . state [ _Return ] . used = True <nl> <nl> - retval = node . value if node . value else parser . parse_expresison ( ' None ' ) <nl> + retval = node . value if node . value else parser . parse_expression ( ' None ' ) <nl> <nl> template = " " " <nl> do_return_var_name = True <nl> mmm a / tensorflow / python / autograph / converters / return_statements_test . py <nl> ppp b / tensorflow / python / autograph / converters / return_statements_test . py <nl> def test_fn ( n ) : <nl> self . assertTransformedEquivalent ( test_fn , 2 ) <nl> self . assertTransformedEquivalent ( test_fn , 4 ) <nl> <nl> + def test_null_return ( self ) : <nl> + <nl> + def test_fn ( n ) : <nl> + if n > 4 : <nl> + return <nl> + return <nl> + <nl> + self . assertTransformedEquivalent ( test_fn , 4 ) <nl> + self . assertTransformedEquivalent ( test_fn , 5 ) <nl> + <nl> <nl> if __name__ = = ' __main__ ' : <nl> test . main ( ) <nl>
Fix mispelled function name .
tensorflow/tensorflow
603e11f5e7b8e16977df27b98db187247e33e572
2019-01-29T19:08:44Z
mmm a / RestServer / AvocadoServer . cpp <nl> ppp b / RestServer / AvocadoServer . cpp <nl> using namespace triagens : : rest ; <nl> using namespace triagens : : admin ; <nl> using namespace triagens : : avocado ; <nl> <nl> - # include " js / bootstrap / js - modules . h " <nl> - # include " js / bootstrap / js - print . h " <nl> - # include " js / server / js - aql . h " <nl> - # include " js / server / js - json . h " <nl> - # include " js / server / js - modules . h " <nl> - # include " js / server / js - shell . h " <nl> + # include " js / common / bootstrap / js - modules . h " <nl> + # include " js / common / bootstrap / js - print . h " <nl> + # include " js / server / server . h " <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> / / - - SECTION - - private variables <nl> mmm a / V8 / v8 - line - editor . cpp <nl> ppp b / V8 / v8 - line - editor . cpp <nl> static char * * AttemptedCompletion ( char const * text , int start , int end ) { <nl> <nl> if ( result [ 0 ] [ n - 1 ] = = ' ) ' ) { <nl> result [ 0 ] [ n - 1 ] = ' \ 0 ' ; <nl> + <nl> + # if RL_READLINE_VERSION < 0x0500 <nl> rl_completion_suppress_append = 1 ; <nl> + # endif <nl> } <nl> } <nl> <nl>
readline
arangodb/arangodb
e610f0de32e1a6b8d560bcbafb9a5b0f60b1a2ca
2012-03-13T14:52:06Z
mmm a / CMakeLists . txt <nl> ppp b / CMakeLists . txt <nl> endif ( ) <nl> # Make this extra - checks for correct library dependencies . <nl> if ( OS_LINUX AND NOT SANITIZE ) <nl> set ( CMAKE_EXE_LINKER_FLAGS " $ { CMAKE_EXE_LINKER_FLAGS } - Wl , - - no - undefined " ) <nl> - set ( CMAKE_SHARED_LINKER_FLAGS " $ { CMAKE_EXE_LINKER_FLAGS } - Wl , - - no - undefined " ) <nl> + set ( CMAKE_SHARED_LINKER_FLAGS " $ { CMAKE_SHARED_LINKER_FLAGS } - Wl , - - no - undefined " ) <nl> endif ( ) <nl> <nl> include ( cmake / dbms_glob_sources . cmake ) <nl>
Fix typo - do not overwrite targets using a wrong var
ClickHouse/ClickHouse
bca280d571b8403bfddc843c2469dde710abd9e2
2020-04-27T17:51:32Z
mmm a / Marlin / Configuration_adv . h <nl> ppp b / Marlin / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> - <nl> - / / Allow babystepping tool z offsets , allowing compensation for tools at different heights . <nl> - / / Ignored in Independent X Carriage Duplicate mode , where tool 0 Z probe offset will be used . <nl> - / / # define BABYSTEP_HOTEND_Z_OFFSET <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / default / Configuration_adv . h <nl> ppp b / Marlin / src / config / default / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / AlephObjects / TAZ4 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / AlephObjects / TAZ4 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Anet / A2 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Anet / A2 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Anet / A2plus / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Anet / A2plus / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Anet / A6 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Anet / A6 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Anet / A8 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Anet / A8 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Azteeg / X5GT / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Azteeg / X5GT / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / BIBO / TouchX / cyclops / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / BIBO / TouchX / cyclops / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / BIBO / TouchX / default / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / BIBO / TouchX / default / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / BQ / Hephestos / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / BQ / Hephestos / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / BQ / Hephestos_2 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / BQ / Hephestos_2 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 2 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1500 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / BQ / WITBOX / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / BQ / WITBOX / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Cartesio / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Cartesio / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Creality / CR - 10 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Creality / CR - 10 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 10 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Creality / CR - 10S / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Creality / CR - 10S / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 5 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Creality / CR - 10mini / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Creality / CR - 10mini / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Creality / CR - 8 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Creality / CR - 8 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 5 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Creality / Ender - 2 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Creality / Ender - 2 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Creality / Ender - 3 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Creality / Ender - 3 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Creality / Ender - 4 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Creality / Ender - 4 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 5 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Einstart - S / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Einstart - S / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Felix / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Felix / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / FolgerTech / i3 - 2020 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / FolgerTech / i3 - 2020 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 2 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Formbot / T - Rex_2 + / Configuration . h <nl> ppp b / Marlin / src / config / examples / Formbot / T - Rex_2 + / Configuration . h <nl> <nl> # define TEMP_SENSOR_4 0 <nl> # define TEMP_SENSOR_5 0 <nl> <nl> - # if ( ENABLED ( ROXYs_TRex ) ) <nl> + # ifdef ROXYs_TRex <nl> # define TEMP_SENSOR_BED 11 <nl> # else <nl> # define TEMP_SENSOR_BED 0 <nl> <nl> <nl> / / If you are using a pre - configured hotend then you can use one of the value sets by uncommenting it <nl> <nl> - # if ( ENABLED ( ROXYs_TRex ) ) <nl> + # ifdef ROXYs_TRex <nl> / / Roxy ' s T - Rex 2 + <nl> # define DEFAULT_Kp 15 . 17 <nl> # define DEFAULT_Ki 0 . 88 <nl> <nl> <nl> / / # define PID_BED_DEBUG / / Sends debug data to the serial port . <nl> <nl> - # if ( ENABLED ( ROXYs_TRex ) ) <nl> + # ifdef ROXYs_TRex <nl> / / T - Rex 2 + <nl> # define DEFAULT_bedKp 289 . 73 <nl> # define DEFAULT_bedKi 51 . 26 <nl> <nl> # define Z_MIN_POS 0 <nl> # define X_MAX_POS 450 <nl> # define Y_MAX_POS Y_BED_SIZE <nl> - # if ( ENABLED ( tallVersion ) ) <nl> + # if ENABLED ( tallVersion ) <nl> # define Z_MAX_POS 700 <nl> # else <nl> # define Z_MAX_POS 500 <nl> mmm a / Marlin / src / config / examples / Formbot / T - Rex_2 + / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Formbot / T - Rex_2 + / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 40 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Formbot / T_Rex_3 / Configuration . h <nl> ppp b / Marlin / src / config / examples / Formbot / T_Rex_3 / Configuration . h <nl> <nl> # define TEMP_SENSOR_4 0 <nl> # define TEMP_SENSOR_5 0 <nl> <nl> - # if ( ENABLED ( ROXYs_TRex ) ) <nl> + # ifdef ROXYs_TRex <nl> # define TEMP_SENSOR_BED 11 <nl> # endif <nl> <nl> - # if ( ENABLED ( TREX3 ) ) <nl> + # if ENABLED ( TREX3 ) <nl> # define TEMP_SENSOR_BED 11 <nl> # endif <nl> <nl> <nl> <nl> / / If you are using a pre - configured hotend then you can use one of the value sets by uncommenting it <nl> <nl> - # if ( ENABLED ( ROXYs_TRex ) ) <nl> + # ifdef ROXYs_TRex <nl> / / Roxy ' s T - Rex 2 + <nl> # define DEFAULT_Kp 15 . 17 <nl> # define DEFAULT_Ki 0 . 88 <nl> <nl> <nl> / / # define PID_BED_DEBUG / / Sends debug data to the serial port . <nl> <nl> - # if ( ENABLED ( ROXYs_TRex ) ) <nl> + # ifdef ROXYs_TRex <nl> / / T - Rex 2 + <nl> # define DEFAULT_bedKp 289 . 73 <nl> # define DEFAULT_bedKi 51 . 26 <nl> <nl> # define Z_MIN_POS 0 <nl> # define X_MAX_POS 450 <nl> # define Y_MAX_POS Y_BED_SIZE <nl> - # if ( ENABLED ( tallVersion ) ) <nl> + # if ENABLED ( tallVersion ) <nl> # define Z_MAX_POS 700 <nl> # else <nl> # define Z_MAX_POS 500 <nl> mmm a / Marlin / src / config / examples / Formbot / T_Rex_3 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Formbot / T_Rex_3 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 40 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> diff - - git a / Marlin / src / config / examples / Geeetech / Prusa i3 Pro C / Configuration_adv . h b / Marlin / src / config / examples / Geeetech / Prusa i3 Pro C / Configuration_adv . h <nl> mmm a / Marlin / src / config / examples / Geeetech / Prusa i3 Pro C / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Geeetech / Prusa i3 Pro C / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> diff - - git a / Marlin / src / config / examples / Geeetech / Prusa i3 Pro W / Configuration_adv . h b / Marlin / src / config / examples / Geeetech / Prusa i3 Pro W / Configuration_adv . h <nl> mmm a / Marlin / src / config / examples / Geeetech / Prusa i3 Pro W / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Geeetech / Prusa i3 Pro W / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Infitary / i3 - M508 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Infitary / i3 - M508 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / JGAurora / A5 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / JGAurora / A5 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 5 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / MakerParts / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / MakerParts / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Malyan / M150 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Malyan / M150 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Malyan / M200 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Malyan / M200 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Micromake / C1 / enhanced / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Micromake / C1 / enhanced / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Mks / Sbase / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Mks / Sbase / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / RigidBot / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / RigidBot / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / SCARA / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / SCARA / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Sanguinololu / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Sanguinololu / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / TheBorg / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / TheBorg / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / TinyBoy2 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / TinyBoy2 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Tronxy / X3A / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Tronxy / X3A / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / UltiMachine / Archim2 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / UltiMachine / Archim2 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Velleman / K8200 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Velleman / K8200 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / Velleman / K8400 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Velleman / K8400 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> diff - - git a / Marlin / src / config / examples / Wanhao / Duplicator 6 / Configuration_adv . h b / Marlin / src / config / examples / Wanhao / Duplicator 6 / Configuration_adv . h <nl> mmm a / Marlin / src / config / examples / Wanhao / Duplicator 6 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / Wanhao / Duplicator 6 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / delta / Anycubic / Kossel / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / delta / Anycubic / Kossel / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / delta / FLSUN / auto_calibrate / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / delta / FLSUN / auto_calibrate / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / delta / FLSUN / kossel / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / delta / FLSUN / kossel / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / delta / FLSUN / kossel_mini / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / delta / FLSUN / kossel_mini / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / delta / generic / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / delta / generic / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / delta / kossel_mini / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / delta / kossel_mini / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / delta / kossel_pro / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / delta / kossel_pro / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / delta / kossel_xl / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / delta / kossel_xl / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / gCreate / gMax1 . 5 + / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / gCreate / gMax1 . 5 + / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 3 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / makibox / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / makibox / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / tvrrug / Round2 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / tvrrug / Round2 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / config / examples / wt150 / Configuration_adv . h <nl> ppp b / Marlin / src / config / examples / wt150 / Configuration_adv . h <nl> <nl> / / # define BABYSTEP_XY / / Also enable X / Y Babystepping . Not supported on DELTA ! <nl> # define BABYSTEP_INVERT_Z false / / Change if Z babysteps should go the other way <nl> # define BABYSTEP_MULTIPLICATOR 1 / / Babysteps are very small . Increase for faster motion . <nl> - / / # define BABYSTEP_ZPROBE_OFFSET / / Enable to combine M851 and Babystepping <nl> + / / # define BABYSTEP_ZPROBE_OFFSET / / Combine M851 Z and Babystepping <nl> / / # define DOUBLECLICK_FOR_Z_BABYSTEPPING / / Double - click on the Status Screen for Z Babystepping . <nl> # define DOUBLECLICK_MAX_INTERVAL 1250 / / Maximum interval between clicks , in milliseconds . <nl> / / Note : Extra time may be added to mitigate controller latency . <nl> / / # define BABYSTEP_ZPROBE_GFX_OVERLAY / / Enable graphical overlay on Z - offset editor <nl> + # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + / / # define BABYSTEP_HOTEND_Z_OFFSET / / For multiple hotends , babystep relative Z offsets <nl> + # endif <nl> # endif <nl> <nl> / / @ section extruder <nl> mmm a / Marlin / src / gcode / motion / M290 . cpp <nl> ppp b / Marlin / src / gcode / motion / M290 . cpp <nl> <nl> # include " . . / . . / core / serial . h " <nl> # endif <nl> <nl> - <nl> # if ENABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> + <nl> FORCE_INLINE void mod_zprobe_zoffset ( const float & offs ) { <nl> - # if ENABLED ( BABYSTEP_HOTEND_Z_OFFSET ) <nl> - if ( active_extruder = = 0 ) <nl> - { <nl> - zprobe_zoffset + = offs ; <nl> - SERIAL_ECHO_START ( ) ; <nl> - SERIAL_ECHOLNPAIR ( MSG_PROBE_Z_OFFSET " : " , zprobe_zoffset ) ; <nl> - } else { <nl> - hotend_offset [ Z_AXIS ] [ active_extruder ] - = offs ; <nl> - SERIAL_ECHO_START ( ) ; <nl> - SERIAL_ECHOLNPAIR ( MSG_IDEX_Z_OFFSET " : " , hotend_offset [ Z_AXIS ] [ active_extruder ] ) ; <nl> - } <nl> - # else <nl> + if ( true <nl> + # if ENABLED ( BABYSTEP_HOTEND_Z_OFFSET ) <nl> + & & active_extruder = = 0 <nl> + # endif <nl> + ) { <nl> zprobe_zoffset + = offs ; <nl> SERIAL_ECHO_START ( ) ; <nl> SERIAL_ECHOLNPAIR ( MSG_PROBE_Z_OFFSET " : " , zprobe_zoffset ) ; <nl> + } <nl> + # if ENABLED ( BABYSTEP_HOTEND_Z_OFFSET ) <nl> + else { <nl> + hotend_offset [ Z_AXIS ] [ active_extruder ] - = offs ; <nl> + SERIAL_ECHO_START ( ) ; <nl> + SERIAL_ECHOLNPAIR ( MSG_IDEX_Z_OFFSET " : " , hotend_offset [ Z_AXIS ] [ active_extruder ] ) ; <nl> + } <nl> # endif <nl> - <nl> } <nl> + <nl> # endif <nl> <nl> / * * <nl> mmm a / Marlin / src / inc / SanityCheck . h <nl> ppp b / Marlin / src / inc / SanityCheck . h <nl> <nl> # define BOARD_MKS_13 - 47 <nl> # define BOARD_TRIGORILLA - 343 <nl> # define BOARD_RURAMPS4D - 1550 <nl> + # define BOARD_FORMBOT_TREX2 - 81 <nl> # if MB ( MKS_13 ) <nl> # error " BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13 . Please update your configuration . " <nl> - # elif MB ( BOARD_TRIGORILLA ) <nl> + # elif MB ( TRIGORILLA ) <nl> # error " BOARD_TRIGORILLA has been renamed BOARD_TRIGORILLA_13 . Please update your configuration . " <nl> - # elif MB ( BOARD_RURAMPS4D ) <nl> + # elif MB ( RURAMPS4D ) <nl> # error " BOARD_RURAMPS4D has been renamed BOARD_RURAMPS4D_11 . Please update your configuration . " <nl> + # elif MB ( FORMBOT_TREX2 ) <nl> + # error " FORMBOT_TREX2 has been renamed BOARD_FORMBOT_TREX2PLUS . Please update your configuration . " <nl> # endif <nl> <nl> / * * <nl> static_assert ( X_MAX_LENGTH > = X_BED_SIZE & & Y_MAX_LENGTH > = Y_BED_SIZE , <nl> # error " BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD . " <nl> # elif ENABLED ( BABYSTEP_ZPROBE_GFX_OVERLAY ) & & DISABLED ( BABYSTEP_ZPROBE_OFFSET ) <nl> # error " BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET . " <nl> + # elif ENABLED ( BABYSTEP_HOTEND_Z_OFFSET ) & & ! HAS_HOTEND_OFFSET <nl> + # error " BABYSTEP_HOTEND_Z_OFFSET requires 2 or more HOTENDS . " <nl> # endif <nl> # endif <nl> <nl> mmm a / Marlin / src / lcd / ultralcd . cpp <nl> ppp b / Marlin / src / lcd / ultralcd . cpp <nl> void lcd_quick_feedback ( const bool clear_buttons ) { <nl> void lcd_babystep_zoffset ( ) { <nl> if ( use_click ( ) ) { return lcd_goto_previous_menu_no_defer ( ) ; } <nl> defer_return_to_status = true ; <nl> + # if ENABLED ( BABYSTEP_HOTEND_Z_OFFSET ) <nl> + const bool do_probe = ( active_extruder = = 0 ) ; <nl> + # else <nl> + constexpr bool do_probe = true ; <nl> + # endif <nl> ENCODER_DIRECTION_NORMAL ( ) ; <nl> if ( encoderPosition ) { <nl> const int16_t babystep_increment = ( int32_t ) encoderPosition * ( BABYSTEP_MULTIPLICATOR ) ; <nl> encoderPosition = 0 ; <nl> <nl> - const float new_zoffset = zprobe_zoffset + planner . steps_to_mm [ Z_AXIS ] * babystep_increment ; <nl> - if ( WITHIN ( new_zoffset , Z_PROBE_OFFSET_RANGE_MIN , Z_PROBE_OFFSET_RANGE_MAX ) ) { <nl> + const float diff = planner . steps_to_mm [ Z_AXIS ] * babystep_increment , <nl> + new_probe_offset = zprobe_zoffset + diff , <nl> + new_offs = <nl> + # if ENABLED ( BABYSTEP_HOTEND_Z_OFFSET ) <nl> + do_probe ? new_probe_offset : hotend_offset [ Z_AXIS ] [ active_extruder ] - diff <nl> + # else <nl> + new_probe_offset <nl> + # endif <nl> + ; <nl> + if ( WITHIN ( new_offs , Z_PROBE_OFFSET_RANGE_MIN , Z_PROBE_OFFSET_RANGE_MAX ) ) { <nl> <nl> + thermalManager . babystep_axis ( Z_AXIS , babystep_increment ) ; <nl> <nl> + if ( do_probe ) zprobe_zoffset = new_offs ; <nl> # if ENABLED ( BABYSTEP_HOTEND_Z_OFFSET ) <nl> - if ( active_extruder = = 0 ) <nl> - { <nl> - thermalManager . babystep_axis ( Z_AXIS , babystep_increment ) ; <nl> - zprobe_zoffset = new_zoffset ; <nl> - } else { <nl> - thermalManager . babystep_axis ( Z_AXIS , babystep_increment ) ; <nl> - hotend_offset [ Z_AXIS ] [ active_extruder ] - = ( planner . steps_to_mm [ Z_AXIS ] * babystep_increment ) ; <nl> - } <nl> - # else <nl> - zprobe_zoffset = new_zoffset ; <nl> + else hotend_offset [ Z_AXIS ] [ active_extruder ] = new_offs ; <nl> # endif <nl> + <nl> lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT ; <nl> } <nl> } <nl> if ( lcdDrawUpdate ) { <nl> # if ENABLED ( BABYSTEP_HOTEND_Z_OFFSET ) <nl> - if ( active_extruder = = 0 ) { <nl> + if ( do_probe ) <nl> lcd_implementation_drawedit ( PSTR ( MSG_ZPROBE_ZOFFSET ) , ftostr43sign ( zprobe_zoffset ) ) ; <nl> - } else { <nl> + else <nl> lcd_implementation_drawedit ( PSTR ( MSG_IDEX_Z_OFFSET ) , ftostr43sign ( hotend_offset [ Z_AXIS ] [ active_extruder ] ) ) ; <nl> - } <nl> # endif <nl> # if ENABLED ( BABYSTEP_ZPROBE_GFX_OVERLAY ) <nl> - if ( active_extruder = = 0 ) { <nl> - _lcd_zoffset_overlay_gfx ( zprobe_zoffset ) ; <nl> - } <nl> + if ( do_probe ) _lcd_zoffset_overlay_gfx ( zprobe_zoffset ) ; <nl> # endif <nl> } <nl> } <nl> mmm a / Marlin / src / module / configuration_store . cpp <nl> ppp b / Marlin / src / module / configuration_store . cpp <nl> void MarlinSettings : : postprocess ( ) { <nl> for ( uint8_t q = mesh_num_x * mesh_num_y ; q - - ; ) EEPROM_WRITE ( dummy ) ; <nl> # endif / / MESH_BED_LEVELING <nl> <nl> + _FIELD_TEST ( zprobe_zoffset ) ; <nl> + <nl> # if ! HAS_BED_PROBE <nl> const float zprobe_zoffset = 0 ; <nl> # endif <nl> - <nl> - _FIELD_TEST ( zprobe_zoffset ) ; <nl> - EEPROM_WRITE ( zprobe_zoffset ) ; <nl> + EEPROM_WRITE ( zprobe_zoffset ) ; <nl> <nl> / / <nl> / / Planar Bed Leveling matrix <nl> void MarlinSettings : : postprocess ( ) { <nl> for ( uint16_t q = mesh_num_x * mesh_num_y ; q - - ; ) EEPROM_READ ( dummy ) ; <nl> # endif / / MESH_BED_LEVELING <nl> <nl> + _FIELD_TEST ( zprobe_zoffset ) ; <nl> + <nl> # if ! HAS_BED_PROBE <nl> float zprobe_zoffset ; <nl> # endif <nl> - <nl> - _FIELD_TEST ( zprobe_zoffset ) ; <nl> - EEPROM_READ ( zprobe_zoffset ) ; <nl> + EEPROM_READ ( zprobe_zoffset ) ; <nl> <nl> / / <nl> / / Planar Bed Leveling matrix <nl> mmm a / Marlin / src / pins / pins_FORMBOT_TREX2PLUS . h <nl> ppp b / Marlin / src / pins / pins_FORMBOT_TREX2PLUS . h <nl> <nl> # define HEATER_BED_PIN 58 <nl> <nl> # define FAN_PIN 9 <nl> - # if ( DISABLED ( FILAMENT_RUNOUT_SENSOR ) ) <nl> - / / Though defined as a fan pin , it is utilized as a dedicated laser pin by Formbot . May <nl> - / / swapped plug and play with a fil ; ament runout sensor . <nl> - # define FAN1_PIN 4 <nl> - # endif <nl> - <nl> # if ENABLED ( FILAMENT_RUNOUT_SENSOR ) <nl> - # define FIL_RUNOUT_PIN 4 <nl> + # define FIL_RUNOUT_PIN 4 <nl> / / # define FIL_RUNOUT2_PIN - 1 <nl> + # else <nl> + / / Though defined as a fan pin , it is utilized as a dedicated laser pin by Formbot . <nl> + # define FAN1_PIN 4 <nl> # endif <nl> <nl> / / <nl> mmm a / buildroot / share / tests / megaatmega2560_tests <nl> ppp b / buildroot / share / tests / megaatmega2560_tests <nl> exec_test $ 1 $ 2 " Probeless build of AUTO_BED_LEVELING_UBL , with lots of extruder <nl> opt_enable Z_PROBE_SLED SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE <nl> opt_set LCD_LANGUAGE jp - kana <nl> opt_disable SEGMENT_LEVELED_MOVES <nl> - opt_enable_adv BABYSTEP_ZPROBE_OFFSET DOUBLECLICK_FOR_Z_BABYSTEPPING <nl> + opt_enable_adv BABYSTEP_ZPROBE_OFFSET DOUBLECLICK_FOR_Z_BABYSTEPPING BABYSTEP_HOTEND_Z_OFFSET <nl> exec_test $ 1 $ 2 " Add a Sled Z Probe , use UBL Cartesian moves , use Japanese language " <nl> # <nl> # Test a Servo Probe <nl>
Followup for BABYSTEP_HOTEND_Z_OFFSET ( )
MarlinFirmware/Marlin
cee34f72901788fabc358a31580c9894c6424a20
2018-09-25T01:46:56Z
mmm a / tools / editor / asset_library_editor_plugin . cpp <nl> ppp b / tools / editor / asset_library_editor_plugin . cpp <nl> void EditorAssetLibraryItemDownload : : _http_download_completed ( int p_status , int <nl> <nl> <nl> String error_text ; <nl> + print_line ( " COMPLETED : " + itos ( p_status ) + " code : " + itos ( p_code ) + " data size : " + itos ( p_data . size ( ) ) ) ; <nl> <nl> switch ( p_status ) { <nl> <nl> void EditorAssetLibraryItemDownload : : _http_download_completed ( int p_status , int <nl> print_line ( " max : " + itos ( download - > get_body_size ( ) ) + " bytes : " + itos ( download - > get_downloaded_bytes ( ) ) ) ; <nl> install - > set_disabled ( false ) ; <nl> <nl> - status - > set_text ( " Success ! " ) ; <nl> + progress - > set_val ( download - > get_downloaded_bytes ( ) ) ; <nl> + <nl> + status - > set_text ( " Success ! ( " + String : : humanize_size ( download - > get_downloaded_bytes ( ) ) + " ) " ) ; <nl> set_process ( false ) ; <nl> } <nl> <nl> void EditorAssetLibraryItemDownload : : _notification ( int p_what ) { <nl> progress - > set_val ( download - > get_downloaded_bytes ( ) ) ; <nl> <nl> int cstatus = download - > get_http_client_status ( ) ; <nl> + <nl> + if ( cstatus = = HTTPClient : : STATUS_BODY ) <nl> + status - > set_text ( " Fetching : " + String : : humanize_size ( download - > get_downloaded_bytes ( ) ) ) ; <nl> + <nl> if ( cstatus ! = prev_status ) { <nl> switch ( cstatus ) { <nl> <nl> void EditorAssetLibraryItemDownload : : _notification ( int p_what ) { <nl> case HTTPClient : : STATUS_REQUESTING : { <nl> status - > set_text ( " Requesting . . " ) ; <nl> } break ; <nl> - case HTTPClient : : STATUS_BODY : { <nl> - status - > set_text ( " Downloading . . " ) ; <nl> - } break ; <nl> default : { } <nl> } <nl> prev_status = cstatus ; <nl>
shows progress ( bytes ) on download even if getting chunked content
godotengine/godot
85f365bbffc0735a82d29ddce4e7991814ae1a5b
2016-07-24T17:37:52Z
mmm a / tensorflow / contrib / gdr / gdr_memory_manager . h <nl> ppp b / tensorflow / contrib / gdr / gdr_memory_manager . h <nl> limitations under the License . <nl> # ifndef GDR_MEMORY_MANAGER_H_ <nl> # define GDR_MEMORY_MANAGER_H_ <nl> <nl> + # include " google / protobuf / any . pb . h " <nl> # include " tensorflow / core / lib / core / status . h " <nl> <nl> - namespace google { <nl> - namespace protobuf { <nl> - class Any ; <nl> - } <nl> - } <nl> - <nl> namespace tensorflow { <nl> <nl> class Device ; <nl>
fix gdr compiling error ( )
tensorflow/tensorflow
6fc52fb724892e34197a29cb7c4d974fd81cb55b
2017-08-25T18:19:20Z
mmm a / core / error_list . h <nl> ppp b / core / error_list . h <nl> enum Error { <nl> ERR_FILE_EOF , <nl> ERR_CANT_OPEN , / / / < Can ' t open a resource / socket / file <nl> ERR_CANT_CREATE , / / ( 20 ) <nl> - ERROR_QUERY_FAILED , <nl> + ERR_QUERY_FAILED , <nl> ERR_ALREADY_IN_USE , <nl> ERR_LOCKED , / / / < resource is locked <nl> ERR_TIMEOUT , <nl> mmm a / core / global_constants . cpp <nl> ppp b / core / global_constants . cpp <nl> static _GlobalConstant _global_constants [ ] = { <nl> BIND_GLOBAL_CONSTANT ( ERR_CANT_OPEN ) , / / / < Can ' t open a resource / socket / file <nl> BIND_GLOBAL_CONSTANT ( ERR_CANT_CREATE ) , <nl> BIND_GLOBAL_CONSTANT ( ERR_PARSE_ERROR ) , <nl> - BIND_GLOBAL_CONSTANT ( ERROR_QUERY_FAILED ) , <nl> + BIND_GLOBAL_CONSTANT ( ERR_QUERY_FAILED ) , <nl> BIND_GLOBAL_CONSTANT ( ERR_ALREADY_IN_USE ) , <nl> BIND_GLOBAL_CONSTANT ( ERR_LOCKED ) , / / / < resource is locked <nl> BIND_GLOBAL_CONSTANT ( ERR_TIMEOUT ) , <nl>
Merge pull request from volzhs / match - err
godotengine/godot
63673de247f5ec7c18cdae774523c76347f02053
2017-02-02T12:33:45Z
mmm a / dbms / src / Storages / MergeTree / MergeTreeDataMergerMutator . cpp <nl> ppp b / dbms / src / Storages / MergeTree / MergeTreeDataMergerMutator . cpp <nl> NameSet MergeTreeDataMergerMutator : : collectFilesToRemove ( <nl> remove_files . emplace ( " skp_idx_ " + command . column_name + mrk_extension ) ; <nl> } <nl> / / / We don ' t remove column files for compact parts because they stored in single file <nl> - else if ( command . type = = MutationCommand : : Type : : DROP_COLUMN & & isCompactPart ( source_part ) ) <nl> + else if ( command . type = = MutationCommand : : Type : : DROP_COLUMN & & ! isCompactPart ( source_part ) ) <nl> { <nl> IDataType : : StreamCallback callback = [ & ] ( const IDataType : : SubstreamPath & substream_path ) <nl> { <nl>
Misused if
ClickHouse/ClickHouse
f54ade41f2a45cdef02e729025e5c7a8767d1135
2020-02-25T13:48:23Z
mmm a / Code / CryEngine / RenderDll / XRenderD3D9 / GraphicsPipeline / VolumetricFog . cpp <nl> ppp b / Code / CryEngine / RenderDll / XRenderD3D9 / GraphicsPipeline / VolumetricFog . cpp <nl> void CVolumetricFogStage : : ExecuteTemporalReprojection ( const SScopedComputeComman <nl> static CCryNameTSCRC techName ( " ReprojectVolumetricFog " ) ; <nl> pass . SetTechnique ( pShader , techName , rtMask ) ; <nl> <nl> - if ( ! m_seperateDensity ) <nl> - { <nl> - pass . SetOutputUAV ( 0 , GetInscatterTex ( ) ) ; <nl> - pass . SetTexture ( 0 , m_pInscatteringVolume ) ; <nl> - pass . SetTexture ( 1 , GetPrevInscatterTex ( ) ) ; <nl> - pass . SetTexture ( 2 , m_pMaxDepth ) ; <nl> - } <nl> - else <nl> + pass . SetOutputUAV ( 0 , GetInscatterTex ( ) ) ; <nl> + pass . SetTexture ( 0 , m_pInscatteringVolume ) ; <nl> + pass . SetTexture ( 1 , GetPrevInscatterTex ( ) ) ; <nl> + pass . SetTexture ( 4 , m_pMaxDepth ) ; <nl> + <nl> + if ( m_seperateDensity ) <nl> { <nl> - pass . SetOutputUAV ( 0 , GetInscatterTex ( ) ) ; <nl> pass . SetOutputUAV ( 1 , GetDensityTex ( ) ) ; <nl> - pass . SetTexture ( 0 , m_pInscatteringVolume ) ; <nl> - pass . SetTexture ( 1 , GetPrevInscatterTex ( ) ) ; <nl> pass . SetTexture ( 2 , m_pVolFogBufDensity ) ; <nl> pass . SetTexture ( 3 , GetPrevDensityTex ( ) ) ; <nl> - pass . SetTexture ( 4 , m_pMaxDepth ) ; <nl> } <nl> <nl> pass . SetSampler ( 0 , EDefaultSamplerStates : : TrilinearClamp ) ; <nl>
! XB ( Renderer ) Volumetric Fog setup hotfix
CRYTEK/CRYENGINE
56d094b10817d32ae250b529c8c041784de477d5
2018-08-22T16:12:52Z
mmm a / addons / xbmc . python / addon . xml <nl> ppp b / addons / xbmc . python / addon . xml <nl> <nl> < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> < addon id = " xbmc . python " version = " 3 . 0 . 0 " provider - name = " Team Kodi " > <nl> - < backwards - compatibility abi = " 2 . 1 . 0 " / > <nl> + < backwards - compatibility abi = " 3 . 0 . 0 " / > <nl> < requires > <nl> < import addon = " xbmc . core " version = " 0 . 1 . 0 " / > <nl> < / requires > <nl>
[ python ] set abi to 3 . 0 . 0
xbmc/xbmc
57f29252ce8420b66b317169fafe290baa88279b
2020-01-14T01:48:19Z
mmm a / hphp / runtime / base / memory - manager . h <nl> ppp b / hphp / runtime / base / memory - manager . h <nl> struct MemoryManager { <nl> <nl> / * <nl> * Get most recent stats data , as one would with getStats ( ) , but without <nl> - * altering the underlying data stored in the MemoryManager . <nl> - * Used for obtaining debug info . <nl> + * altering the underlying data stored in the MemoryManager , triggering <nl> + * OOM , or triggering the memory threshold callback . Used for obtaining <nl> + * allocation counters passively . <nl> * / <nl> MemoryUsageStats getStatsCopy ( ) ; <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 int64_t HHVM_FUNCTION ( memory_get_usage , bool real_usage / * = false * / ) { <nl> return std : : max < int64_t > ( ret , 0 ) ; <nl> } <nl> <nl> + static int64_t HHVM_FUNCTION ( hphp_memory_heap_usage ) { <nl> + / / This corresponds to PHP memory_get_usage ( false ) , only counting <nl> + / / allocations via MemoryManager . <nl> + return MM ( ) . getStatsCopy ( ) . mmUsage ; <nl> + } <nl> + <nl> + static int64_t HHVM_FUNCTION ( hphp_memory_heap_capacity ) { <nl> + / / this happens to match HHVM memory_get_usage ( false ) , but without the <nl> + / / possibility of triggering OOM . capacity is updated eagerly , not by <nl> + / / refreshStats . It also matches PHP memory_get_usage ( true ) . <nl> + return MM ( ) . getStatsCopy ( ) . capacity ; <nl> + } <nl> + <nl> static bool HHVM_FUNCTION ( hphp_memory_start_interval ) { <nl> return MM ( ) . startStatsInterval ( ) ; <nl> } <nl> void StandardExtension : : initOptions ( ) { <nl> HHVM_FE ( ini_set ) ; <nl> HHVM_FE ( memory_get_peak_usage ) ; <nl> HHVM_FE ( memory_get_usage ) ; <nl> + / / HHVM - specific stateless accessors for memory stats <nl> + HHVM_FE ( hphp_memory_heap_usage ) ; <nl> + HHVM_FE ( hphp_memory_heap_capacity ) ; <nl> / / This is HH - specific as well but code depends on the old name . <nl> HHVM_FE ( memory_get_allocation ) ; <nl> HHVM_FE ( hphp_memory_get_interval_peak_usage ) ; <nl> mmm a / hphp / runtime / ext / std / ext_std_options . php <nl> ppp b / hphp / runtime / ext / std / ext_std_options . php <nl> function memory_get_usage ( bool $ real_usage = false ) : int ; <nl> < < __Native , __HipHopSpecific > > <nl> function memory_get_allocation ( ) : int ; <nl> <nl> + / * Returns the request - heap memory currently in use by the script . <nl> + * Does not trigger OOM . <nl> + * / <nl> + < < __Native , __HipHopSpecific > > <nl> + function hphp_memory_heap_usage ( ) : int ; <nl> + <nl> + / * Returns the current total capacity of the request - heap , including <nl> + * blocks freed by the script but not returned to the process heap , <nl> + * external fragmentation , and heap management overhead . <nl> + * Does not trigger OOM . <nl> + * / <nl> + < < __Native , __HipHopSpecific > > <nl> + function hphp_memory_heap_capacity ( ) : int ; <nl> + <nl> / * Returns the peak of memory , in bytes , that ' s been allocated to your PHP <nl> * script since calling memory_start_usage_interval . <nl> * / <nl>
Add hhvm - specific memory stats query functions
facebook/hhvm
9b8e781d432c0a88491fbf0f1a6a56271f1c5009
2017-06-06T00:08:58Z
mmm a / cocos / CMakeLists . txt <nl> ppp b / cocos / CMakeLists . txt <nl> if ( MINGW ) <nl> elseif ( WINDOWS ) <nl> set ( PLATFORM_SPECIFIC_LIBS libjpeg libpng libwebp libtiff libcurl_imp libwebsockets freetype250 glew32 opengl32 libiconv libzlib ) <nl> elseif ( LINUX ) <nl> - set ( PLATFORM_SPECIFIC_LIBS jpeg webp tiff freetype curl websockets ssl crypto fontconfig png pthread GLEW GL X11 rt z $ { FMOD_LIB } ) <nl> + set ( PLATFORM_SPECIFIC_LIBS jpeg webp tiff freetype curl websockets ssl crypto <nl> + fontconfig png pthread glfw GLEW GL X11 rt z $ { FMOD_LIB } ) <nl> elseif ( MACOSX OR APPLE ) <nl> INCLUDE_DIRECTORIES ( / System / Library / Frameworks ) <nl> <nl>
fix linux linker error
cocos2d/cocos2d-x
caf9107a7216fd07f246643a955fe9298372c006
2014-11-19T07:18:15Z
mmm a / src / snapshot / serializer - common . h <nl> ppp b / src / snapshot / serializer - common . h <nl> class Checksum { <nl> # ifdef MEMORY_SANITIZER <nl> / / Computing the checksum includes padding bytes for objects like strings . <nl> / / Mark every object as initialized in the code serializer . <nl> - MSAN_MEMORY_IS_INITIALIZED ( payload . start ( ) , payload . length ( ) ) ; <nl> + MSAN_MEMORY_IS_INITIALIZED ( payload . begin ( ) , payload . length ( ) ) ; <nl> # endif / / MEMORY_SANITIZER <nl> / / Fletcher ' s checksum . Modified to reduce 64 - bit sums to 32 - bit . <nl> uintptr_t a = 1 ; <nl> class Checksum { <nl> / / access payload through an uintptr_t pointer later on ; and some <nl> / / architectures , e . g . arm , may generate instructions that expect correct <nl> / / alignment . However , we do not control alignment for external snapshots . <nl> - / / DCHECK ( IsAligned ( reinterpret_cast < intptr_t > ( payload . start ( ) ) , <nl> + / / DCHECK ( IsAligned ( reinterpret_cast < intptr_t > ( payload . begin ( ) ) , <nl> / / kIntptrSize ) ) ; <nl> DCHECK ( IsAligned ( payload . length ( ) , kIntptrSize ) ) ; <nl> const uintptr_t * cur = reinterpret_cast < const uintptr_t * > ( payload . begin ( ) ) ; <nl>
Fix msan build
v8/v8
99254554c1f14202a5c870117c6979d0b469df6e
2019-04-29T13:02:06Z
mmm a / src / interfaces / wallet . cpp <nl> ppp b / src / interfaces / wallet . cpp <nl> class WalletImpl : public Wallet <nl> std : : string error ; <nl> return m_wallet - > GetNewDestination ( type , label , dest , error ) ; <nl> } <nl> - bool getPubKey ( const CKeyID & address , CPubKey & pub_key ) override { return m_wallet - > GetLegacyScriptPubKeyMan ( ) - > GetPubKey ( address , pub_key ) ; } <nl> - bool getPrivKey ( const CKeyID & address , CKey & key ) override { return m_wallet - > GetLegacyScriptPubKeyMan ( ) - > GetKey ( address , key ) ; } <nl> + bool getPubKey ( const CScript & script , const CKeyID & address , CPubKey & pub_key ) override <nl> + { <nl> + const SigningProvider * provider = m_wallet - > GetSigningProvider ( script ) ; <nl> + if ( provider ) { <nl> + return provider - > GetPubKey ( address , pub_key ) ; <nl> + } <nl> + return false ; <nl> + } <nl> + bool getPrivKey ( const CScript & script , const CKeyID & address , CKey & key ) override <nl> + { <nl> + const SigningProvider * provider = m_wallet - > GetSigningProvider ( script ) ; <nl> + if ( provider ) { <nl> + return provider - > GetKey ( address , key ) ; <nl> + } <nl> + return false ; <nl> + } <nl> bool isSpendable ( const CTxDestination & dest ) override { return m_wallet - > IsMine ( dest ) & ISMINE_SPENDABLE ; } <nl> bool haveWatchOnly ( ) override <nl> { <nl> mmm a / src / interfaces / wallet . h <nl> ppp b / src / interfaces / wallet . h <nl> class Wallet <nl> virtual bool getNewDestination ( const OutputType type , const std : : string label , CTxDestination & dest ) = 0 ; <nl> <nl> / / ! Get public key . <nl> - virtual bool getPubKey ( const CKeyID & address , CPubKey & pub_key ) = 0 ; <nl> + virtual bool getPubKey ( const CScript & script , const CKeyID & address , CPubKey & pub_key ) = 0 ; <nl> <nl> / / ! Get private key . <nl> - virtual bool getPrivKey ( const CKeyID & address , CKey & key ) = 0 ; <nl> + virtual bool getPrivKey ( const CScript & script , const CKeyID & address , CKey & key ) = 0 ; <nl> <nl> / / ! Return whether wallet has private key . <nl> virtual bool isSpendable ( const CTxDestination & dest ) = 0 ; <nl> mmm a / src / qt / coincontroldialog . cpp <nl> ppp b / src / qt / coincontroldialog . cpp <nl> void CoinControlDialog : : updateLabels ( WalletModel * model , QDialog * dialog ) <nl> { <nl> CPubKey pubkey ; <nl> PKHash * pkhash = boost : : get < PKHash > ( & address ) ; <nl> - if ( pkhash & & model - > wallet ( ) . getPubKey ( CKeyID ( * pkhash ) , pubkey ) ) <nl> + if ( pkhash & & model - > wallet ( ) . getPubKey ( out . txout . scriptPubKey , CKeyID ( * pkhash ) , pubkey ) ) <nl> { <nl> nBytesInputs + = ( pubkey . IsCompressed ( ) ? 148 : 180 ) ; <nl> } <nl> mmm a / src / qt / signverifymessagedialog . cpp <nl> ppp b / src / qt / signverifymessagedialog . cpp <nl> void SignVerifyMessageDialog : : on_signMessageButton_SM_clicked ( ) <nl> } <nl> <nl> CKey key ; <nl> - if ( ! model - > wallet ( ) . getPrivKey ( CKeyID ( * pkhash ) , key ) ) <nl> + if ( ! model - > wallet ( ) . getPrivKey ( GetScriptForDestination ( destination ) , CKeyID ( * pkhash ) , key ) ) <nl> { <nl> ui - > statusLabel_SM - > setStyleSheet ( " QLabel { color : red ; } " ) ; <nl> ui - > statusLabel_SM - > setText ( tr ( " Private key for the entered address is not available . " ) ) ; <nl> mmm a / src / wallet / psbtwallet . cpp <nl> ppp b / src / wallet / psbtwallet . cpp <nl> TransactionError FillPSBT ( const CWallet * pwallet , PartiallySignedTransaction & ps <nl> return TransactionError : : SIGHASH_MISMATCH ; <nl> } <nl> <nl> - complete & = SignPSBTInput ( HidingSigningProvider ( pwallet - > GetSigningProvider ( ) , ! sign , ! bip32derivs ) , psbtx , i , sighash_type ) ; <nl> + / / Get the scriptPubKey to know which SigningProvider to use <nl> + CScript script ; <nl> + if ( ! input . witness_utxo . IsNull ( ) ) { <nl> + script = input . witness_utxo . scriptPubKey ; <nl> + } else if ( input . non_witness_utxo ) { <nl> + script = input . non_witness_utxo - > vout [ txin . prevout . n ] . scriptPubKey ; <nl> + } else { <nl> + / / There ' s no UTXO so we can just skip this now <nl> + complete = false ; <nl> + continue ; <nl> + } <nl> + SignatureData sigdata ; <nl> + input . FillSignatureData ( sigdata ) ; <nl> + const SigningProvider * provider = pwallet - > GetSigningProvider ( script , sigdata ) ; <nl> + if ( ! provider ) { <nl> + complete = false ; <nl> + continue ; <nl> + } <nl> + <nl> + complete & = SignPSBTInput ( HidingSigningProvider ( provider , ! sign , ! bip32derivs ) , psbtx , i , sighash_type ) ; <nl> } <nl> <nl> / / Fill in the bip32 keypaths and redeemscripts for the outputs so that hardware wallets can identify change <nl> for ( unsigned int i = 0 ; i < psbtx . tx - > vout . size ( ) ; + + i ) { <nl> - UpdatePSBTOutput ( HidingSigningProvider ( pwallet - > GetSigningProvider ( ) , true , ! bip32derivs ) , psbtx , i ) ; <nl> + const CTxOut & out = psbtx . tx - > vout . at ( i ) ; <nl> + const SigningProvider * provider = pwallet - > GetSigningProvider ( out . scriptPubKey ) ; <nl> + if ( provider ) { <nl> + UpdatePSBTOutput ( HidingSigningProvider ( provider , true , ! bip32derivs ) , psbtx , i ) ; <nl> + } <nl> } <nl> <nl> return TransactionError : : OK ; <nl> mmm a / src / wallet / rpcwallet . cpp <nl> ppp b / src / wallet / rpcwallet . cpp <nl> static UniValue signmessage ( const JSONRPCRequest & request ) <nl> throw JSONRPCError ( RPC_TYPE_ERROR , " Address does not refer to key " ) ; <nl> } <nl> <nl> - const SigningProvider * provider = pwallet - > GetSigningProvider ( ) ; <nl> + CScript script_pub_key = GetScriptForDestination ( * pkhash ) ; <nl> + const SigningProvider * provider = pwallet - > GetSigningProvider ( script_pub_key ) ; <nl> + if ( ! provider ) { <nl> + throw JSONRPCError ( RPC_WALLET_ERROR , " Private key not available " ) ; <nl> + } <nl> <nl> CKey key ; <nl> CKeyID keyID ( * pkhash ) ; <nl> static UniValue listunspent ( const JSONRPCRequest & request ) <nl> entry . pushKV ( " label " , i - > second . name ) ; <nl> } <nl> <nl> - const SigningProvider * provider = pwallet - > GetSigningProvider ( ) ; <nl> - if ( scriptPubKey . IsPayToScriptHash ( ) ) { <nl> - const CScriptID & hash = CScriptID ( boost : : get < ScriptHash > ( address ) ) ; <nl> - CScript redeemScript ; <nl> - if ( provider - > GetCScript ( hash , redeemScript ) ) { <nl> - entry . pushKV ( " redeemScript " , HexStr ( redeemScript . begin ( ) , redeemScript . end ( ) ) ) ; <nl> - / / Now check if the redeemScript is actually a P2WSH script <nl> - CTxDestination witness_destination ; <nl> - if ( redeemScript . IsPayToWitnessScriptHash ( ) ) { <nl> - bool extracted = ExtractDestination ( redeemScript , witness_destination ) ; <nl> - CHECK_NONFATAL ( extracted ) ; <nl> - / / Also return the witness script <nl> - const WitnessV0ScriptHash & whash = boost : : get < WitnessV0ScriptHash > ( witness_destination ) ; <nl> - CScriptID id ; <nl> - CRIPEMD160 ( ) . Write ( whash . begin ( ) , whash . size ( ) ) . Finalize ( id . begin ( ) ) ; <nl> - CScript witnessScript ; <nl> - if ( provider - > GetCScript ( id , witnessScript ) ) { <nl> - entry . pushKV ( " witnessScript " , HexStr ( witnessScript . begin ( ) , witnessScript . end ( ) ) ) ; <nl> + const SigningProvider * provider = pwallet - > GetSigningProvider ( scriptPubKey ) ; <nl> + if ( provider ) { <nl> + if ( scriptPubKey . IsPayToScriptHash ( ) ) { <nl> + const CScriptID & hash = CScriptID ( boost : : get < ScriptHash > ( address ) ) ; <nl> + CScript redeemScript ; <nl> + if ( provider - > GetCScript ( hash , redeemScript ) ) { <nl> + entry . pushKV ( " redeemScript " , HexStr ( redeemScript . begin ( ) , redeemScript . end ( ) ) ) ; <nl> + / / Now check if the redeemScript is actually a P2WSH script <nl> + CTxDestination witness_destination ; <nl> + if ( redeemScript . IsPayToWitnessScriptHash ( ) ) { <nl> + bool extracted = ExtractDestination ( redeemScript , witness_destination ) ; <nl> + CHECK_NONFATAL ( extracted ) ; <nl> + / / Also return the witness script <nl> + const WitnessV0ScriptHash & whash = boost : : get < WitnessV0ScriptHash > ( witness_destination ) ; <nl> + CScriptID id ; <nl> + CRIPEMD160 ( ) . Write ( whash . begin ( ) , whash . size ( ) ) . Finalize ( id . begin ( ) ) ; <nl> + CScript witnessScript ; <nl> + if ( provider - > GetCScript ( id , witnessScript ) ) { <nl> + entry . pushKV ( " witnessScript " , HexStr ( witnessScript . begin ( ) , witnessScript . end ( ) ) ) ; <nl> + } <nl> } <nl> } <nl> - } <nl> - } else if ( scriptPubKey . IsPayToWitnessScriptHash ( ) ) { <nl> - const WitnessV0ScriptHash & whash = boost : : get < WitnessV0ScriptHash > ( address ) ; <nl> - CScriptID id ; <nl> - CRIPEMD160 ( ) . Write ( whash . begin ( ) , whash . size ( ) ) . Finalize ( id . begin ( ) ) ; <nl> - CScript witnessScript ; <nl> - if ( provider - > GetCScript ( id , witnessScript ) ) { <nl> - entry . pushKV ( " witnessScript " , HexStr ( witnessScript . begin ( ) , witnessScript . end ( ) ) ) ; <nl> + } else if ( scriptPubKey . IsPayToWitnessScriptHash ( ) ) { <nl> + const WitnessV0ScriptHash & whash = boost : : get < WitnessV0ScriptHash > ( address ) ; <nl> + CScriptID id ; <nl> + CRIPEMD160 ( ) . Write ( whash . begin ( ) , whash . size ( ) ) . Finalize ( id . begin ( ) ) ; <nl> + CScript witnessScript ; <nl> + if ( provider - > GetCScript ( id , witnessScript ) ) { <nl> + entry . pushKV ( " witnessScript " , HexStr ( witnessScript . begin ( ) , witnessScript . end ( ) ) ) ; <nl> + } <nl> } <nl> } <nl> } <nl> static UniValue listunspent ( const JSONRPCRequest & request ) <nl> entry . pushKV ( " spendable " , out . fSpendable ) ; <nl> entry . pushKV ( " solvable " , out . fSolvable ) ; <nl> if ( out . fSolvable ) { <nl> - auto descriptor = InferDescriptor ( scriptPubKey , * pwallet - > GetLegacyScriptPubKeyMan ( ) ) ; <nl> - entry . pushKV ( " desc " , descriptor - > ToString ( ) ) ; <nl> + const SigningProvider * provider = pwallet - > GetSigningProvider ( scriptPubKey ) ; <nl> + if ( provider ) { <nl> + auto descriptor = InferDescriptor ( scriptPubKey , * provider ) ; <nl> + entry . pushKV ( " desc " , descriptor - > ToString ( ) ) ; <nl> + } <nl> } <nl> if ( avoid_reuse ) entry . pushKV ( " reused " , reused ) ; <nl> entry . pushKV ( " safe " , out . fSafe ) ; <nl> UniValue signrawtransactionwithwallet ( const JSONRPCRequest & request ) <nl> / / Parse the prevtxs array <nl> ParsePrevouts ( request . params [ 1 ] , nullptr , coins ) ; <nl> <nl> + std : : set < const SigningProvider * > providers ; <nl> + for ( const std : : pair < COutPoint , Coin > coin_pair : coins ) { <nl> + const SigningProvider * provider = pwallet - > GetSigningProvider ( coin_pair . second . out . scriptPubKey ) ; <nl> + if ( provider ) { <nl> + providers . insert ( std : : move ( provider ) ) ; <nl> + } <nl> + } <nl> + if ( providers . size ( ) = = 0 ) { <nl> + / / When there are no available providers , use DUMMY_SIGNING_PROVIDER so we can check if the tx is complete <nl> + providers . insert ( & DUMMY_SIGNING_PROVIDER ) ; <nl> + } <nl> + <nl> UniValue result ( UniValue : : VOBJ ) ; <nl> - SignTransaction ( mtx , & * pwallet - > GetLegacyScriptPubKeyMan ( ) , coins , request . params [ 2 ] , result ) ; <nl> - return result ; <nl> + for ( const SigningProvider * provider : providers ) { <nl> + SignTransaction ( mtx , provider , coins , request . params [ 2 ] , result ) ; <nl> + } <nl> + return result ; <nl> } <nl> <nl> static UniValue bumpfee ( const JSONRPCRequest & request ) <nl> static UniValue DescribeWalletAddress ( CWallet * pwallet , const CTxDestination & de <nl> { <nl> UniValue ret ( UniValue : : VOBJ ) ; <nl> UniValue detail = DescribeAddress ( dest ) ; <nl> + CScript script = GetScriptForDestination ( dest ) ; <nl> const SigningProvider * provider = nullptr ; <nl> if ( pwallet ) { <nl> - provider = pwallet - > GetSigningProvider ( ) ; <nl> + provider = pwallet - > GetSigningProvider ( script ) ; <nl> } <nl> ret . pushKVs ( detail ) ; <nl> ret . pushKVs ( boost : : apply_visitor ( DescribeWalletAddressVisitor ( provider ) , dest ) ) ; <nl> UniValue getaddressinfo ( const JSONRPCRequest & request ) <nl> <nl> CScript scriptPubKey = GetScriptForDestination ( dest ) ; <nl> ret . pushKV ( " scriptPubKey " , HexStr ( scriptPubKey . begin ( ) , scriptPubKey . end ( ) ) ) ; <nl> - const SigningProvider * provider = pwallet - > GetSigningProvider ( ) ; <nl> + const SigningProvider * provider = pwallet - > GetSigningProvider ( scriptPubKey ) ; <nl> <nl> isminetype mine = pwallet - > IsMine ( dest ) ; <nl> ret . pushKV ( " ismine " , bool ( mine & ISMINE_SPENDABLE ) ) ; <nl> - bool solvable = IsSolvable ( * provider , scriptPubKey ) ; <nl> + bool solvable = provider & & IsSolvable ( * provider , scriptPubKey ) ; <nl> ret . pushKV ( " solvable " , solvable ) ; <nl> if ( solvable ) { <nl> ret . pushKV ( " desc " , InferDescriptor ( scriptPubKey , * provider ) - > ToString ( ) ) ; <nl> UniValue getaddressinfo ( const JSONRPCRequest & request ) <nl> } <nl> ret . pushKV ( " ischange " , pwallet - > IsChange ( scriptPubKey ) ) ; <nl> <nl> - ScriptPubKeyMan * spk_man = pwallet - > GetScriptPubKeyMan ( ) ; <nl> + ScriptPubKeyMan * spk_man = pwallet - > GetScriptPubKeyMan ( scriptPubKey ) ; <nl> if ( spk_man ) { <nl> CKeyID key_id = GetKeyForDestination ( * provider , dest ) ; <nl> const CKeyMetadata * meta = nullptr ; <nl> mmm a / src / wallet / wallet . cpp <nl> ppp b / src / wallet / wallet . cpp <nl> bool CWallet : : DummySignInput ( CTxIn & tx_in , const CTxOut & txout , bool use_max_sig <nl> const CScript & scriptPubKey = txout . scriptPubKey ; <nl> SignatureData sigdata ; <nl> <nl> - const SigningProvider * provider = GetSigningProvider ( ) ; <nl> + const SigningProvider * provider = GetSigningProvider ( scriptPubKey ) ; <nl> + if ( ! provider ) { <nl> + / / We don ' t know about this scriptpbuKey ; <nl> + return false ; <nl> + } <nl> <nl> if ( ! ProduceSignature ( * provider , use_max_sig ? DUMMY_MAXIMUM_SIGNATURE_CREATOR : DUMMY_SIGNATURE_CREATOR , scriptPubKey , sigdata ) ) { <nl> return false ; <nl> void CWallet : : AvailableCoins ( interfaces : : Chain : : Lock & locked_chain , std : : vector < <nl> continue ; <nl> } <nl> <nl> - const SigningProvider * provider = GetSigningProvider ( ) ; <nl> + const SigningProvider * provider = GetSigningProvider ( wtx . tx - > vout [ i ] . scriptPubKey ) ; <nl> <nl> bool solvable = provider ? IsSolvable ( * provider , wtx . tx - > vout [ i ] . scriptPubKey ) : false ; <nl> bool spendable = ( ( mine & ISMINE_SPENDABLE ) ! = ISMINE_NO ) | | ( ( ( mine & ISMINE_WATCH_ONLY ) ! = ISMINE_NO ) & & ( coinControl & & coinControl - > fAllowWatchOnly & & solvable ) ) ; <nl> bool CWallet : : SignTransaction ( CMutableTransaction & tx ) <nl> const CAmount & amount = mi - > second . tx - > vout [ input . prevout . n ] . nValue ; <nl> SignatureData sigdata ; <nl> <nl> - const SigningProvider * provider = GetSigningProvider ( ) ; <nl> + const SigningProvider * provider = GetSigningProvider ( scriptPubKey ) ; <nl> if ( ! provider ) { <nl> + / / We don ' t know about this scriptpbuKey ; <nl> return false ; <nl> } <nl> <nl> bool CWallet : : CreateTransaction ( interfaces : : Chain : : Lock & locked_chain , const std <nl> const CScript & scriptPubKey = coin . txout . scriptPubKey ; <nl> SignatureData sigdata ; <nl> <nl> - const SigningProvider * provider = GetSigningProvider ( ) ; <nl> + const SigningProvider * provider = GetSigningProvider ( scriptPubKey ) ; <nl> if ( ! provider | | ! ProduceSignature ( * provider , MutableTransactionSignatureCreator ( & txNew , nIn , coin . txout . nValue , SIGHASH_ALL ) , scriptPubKey , sigdata ) ) <nl> { <nl> strFailReason = _ ( " Signing transaction failed " ) . translated ; <nl> bool CWallet : : Lock ( ) <nl> return true ; <nl> } <nl> <nl> - ScriptPubKeyMan * CWallet : : GetScriptPubKeyMan ( ) const <nl> + ScriptPubKeyMan * CWallet : : GetScriptPubKeyMan ( const CScript & script ) const <nl> + { <nl> + return m_spk_man . get ( ) ; <nl> + } <nl> + <nl> + const SigningProvider * CWallet : : GetSigningProvider ( const CScript & script ) const <nl> { <nl> return m_spk_man . get ( ) ; <nl> } <nl> <nl> - const SigningProvider * CWallet : : GetSigningProvider ( ) const <nl> + const SigningProvider * CWallet : : GetSigningProvider ( const CScript & script , SignatureData & sigdata ) const <nl> { <nl> return m_spk_man . get ( ) ; <nl> } <nl> mmm a / src / wallet / wallet . h <nl> ppp b / src / wallet / wallet . h <nl> class CWallet final : public WalletStorage , private interfaces : : Chain : : Notificat <nl> LogPrintf ( ( " % s " + fmt ) . c_str ( ) , GetDisplayName ( ) , parameters . . . ) ; <nl> } ; <nl> <nl> - ScriptPubKeyMan * GetScriptPubKeyMan ( ) const ; <nl> - const SigningProvider * GetSigningProvider ( ) const ; <nl> + / / ! Get the ScriptPubKeyMan for a script <nl> + ScriptPubKeyMan * GetScriptPubKeyMan ( const CScript & script ) const ; <nl> + <nl> + / / ! Get the SigningProvider for a script <nl> + const SigningProvider * GetSigningProvider ( const CScript & script ) const ; <nl> + const SigningProvider * GetSigningProvider ( const CScript & script , SignatureData & sigdata ) const ; <nl> + <nl> LegacyScriptPubKeyMan * GetLegacyScriptPubKeyMan ( ) const ; <nl> <nl> / / Temporary LegacyScriptPubKeyMan accessors and aliases . <nl>
Refactor : Require scriptPubKey to get wallet SigningProvider
bitcoin/bitcoin
d0dab897afaac0a18aa47d3ce673a4a43a69178a
2019-11-18T20:42:01Z
mmm a / xbmc / addons / AddonInstaller . cpp <nl> ppp b / xbmc / addons / AddonInstaller . cpp <nl> void CAddonInstaller : : InstallFromXBMCRepo ( const set < CStdString > & addonIDs ) <nl> } <nl> <nl> bool CAddonInstaller : : CheckDependencies ( const AddonPtr & addon ) <nl> + { <nl> + std : : vector < std : : string > preDeps ; <nl> + preDeps . push_back ( addon - > ID ( ) ) ; <nl> + return CheckDependencies ( addon , preDeps ) ; <nl> + } <nl> + <nl> + bool CAddonInstaller : : CheckDependencies ( const AddonPtr & addon , <nl> + std : : vector < std : : string > & preDeps ) <nl> { <nl> if ( ! addon . get ( ) ) <nl> return true ; / / a NULL addon has no dependencies <nl> bool CAddonInstaller : : CheckDependencies ( const AddonPtr & addon ) <nl> return false ; <nl> } <nl> } <nl> - / / prevent infinite loops <nl> - if ( dep & & dep - > ID ( ) = = addon - > ID ( ) ) <nl> - { <nl> - CLog : : Log ( LOGERROR , " Addon % s depends on itself , ignoring " , addon - > ID ( ) . c_str ( ) ) ; <nl> - return false ; <nl> - } <nl> / / at this point we have our dep , or the dep is optional ( and we don ' t have it ) so check that it ' s OK as well <nl> / / TODO : should we assume that installed deps are OK ? <nl> - if ( dep & & ! CheckDependencies ( dep ) ) <nl> + if ( dep & & <nl> + std : : find ( preDeps . begin ( ) , preDeps . end ( ) , dep - > ID ( ) ) = = preDeps . end ( ) & & <nl> + ! CheckDependencies ( dep , preDeps ) ) <nl> + { <nl> return false ; <nl> + } <nl> + preDeps . push_back ( dep - > ID ( ) ) ; <nl> } <nl> return true ; <nl> } <nl> mmm a / xbmc / addons / AddonInstaller . h <nl> ppp b / xbmc / addons / AddonInstaller . h <nl> class CAddonInstaller : public IJobCallback <nl> * / <nl> bool DoInstall ( const ADDON : : AddonPtr & addon , const CStdString & hash = " " , bool update = false , const CStdString & referer = " " , bool background = true ) ; <nl> <nl> + / * ! \ brief Check whether dependencies of an addon exist or are installable . <nl> + Iterates through the addon ' s dependencies , checking they ' re installed or installable . <nl> + Each dependency must also satisfies CheckDependencies in turn . <nl> + \ param addon the addon to check <nl> + \ param preDeps previous dependencies encountered during recursion . aids in avoiding infinite recursion <nl> + \ return true if dependencies are available , false otherwise . <nl> + * / <nl> + bool CheckDependencies ( const ADDON : : AddonPtr & addon , <nl> + std : : vector < std : : string > & preDeps ) ; <nl> + <nl> void PrunePackageCache ( ) ; <nl> int64_t EnumeratePackageFolder ( std : : map < CStdString , CFileItemList * > & result ) ; <nl> <nl>
fixed : prevent infinite loop in add - on dependency checks
xbmc/xbmc
e1374217a66d1324f3482f6567448f0bc7ef2946
2013-03-21T13:40:52Z
mmm a / DEPS <nl> ppp b / DEPS <nl> vars = { <nl> <nl> deps = { <nl> ' v8 / build ' : <nl> - Var ( ' chromium_url ' ) + ' / chromium / src / build . git ' + ' @ ' + ' 5fc01865de145f529476144fa799710a00ff83b7 ' , <nl> + Var ( ' chromium_url ' ) + ' / chromium / src / build . git ' + ' @ ' + ' 8e3406c27511f9787a6353ee72c01d7d90b0b6eb ' , <nl> ' v8 / tools / gyp ' : <nl> Var ( ' chromium_url ' ) + ' / external / gyp . git ' + ' @ ' + ' d61a9397e668fa9843c4aa7da9e79460fe590bfb ' , <nl> ' v8 / third_party / depot_tools ' : <nl> - Var ( ' chromium_url ' ) + ' / chromium / tools / depot_tools . git ' + ' @ ' + ' b3853afe341f2c478f07edba8ac4e60ea833c3b1 ' , <nl> + Var ( ' chromium_url ' ) + ' / chromium / tools / depot_tools . git ' + ' @ ' + ' ae1f03388f7a09583b726e571bf78674a1691821 ' , <nl> ' v8 / third_party / icu ' : <nl> Var ( ' chromium_url ' ) + ' / chromium / deps / icu . git ' + ' @ ' + ' 172d33141cd16df9d027cfd49bfe940b1dc66f1a ' , <nl> ' v8 / third_party / instrumented_libraries ' : <nl> deps = { <nl> ' condition ' : ' checkout_android ' , <nl> } , <nl> ' v8 / third_party / catapult ' : { <nl> - ' url ' : Var ( ' chromium_url ' ) + ' / catapult . git ' + ' @ ' + ' d96c633790000d036c5bbcf943d2c4f1f06d9820 ' , <nl> + ' url ' : Var ( ' chromium_url ' ) + ' / catapult . git ' + ' @ ' + ' e2d6bbca629c30094f633f21e5f3967ecbeb10da ' , <nl> ' condition ' : ' checkout_android ' , <nl> } , <nl> ' v8 / third_party / colorama / src ' : { <nl>
Update V8 DEPS .
v8/v8
038859609a8da867c6042efd34d5de5d4636f278
2018-06-29T03:52:25Z
mmm a / src / bootstrapper . cc <nl> ppp b / src / bootstrapper . cc <nl> V8_NOINLINE Handle < SharedFunctionInfo > SimpleCreateBuiltinSharedFunctionInfo ( <nl> Handle < SharedFunctionInfo > shared = <nl> isolate - > factory ( ) - > NewSharedFunctionInfoForBuiltin ( name , builtin_id , <nl> kNormalFunction ) ; <nl> - shared - > SetConstructStub ( * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> shared - > set_internal_formal_parameter_count ( len ) ; <nl> shared - > set_length ( len ) ; <nl> return shared ; <nl> void Genesis : : CreateObjectFunction ( Handle < JSFunction > empty_function ) { <nl> inobject_properties , factory - > null_value ( ) , Builtins : : kObjectConstructor ) ; <nl> object_fun - > shared ( ) - > set_length ( 1 ) ; <nl> object_fun - > shared ( ) - > DontAdaptArguments ( ) ; <nl> - object_fun - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate_ , JSBuiltinsConstructStub ) ) ; <nl> native_context ( ) - > set_object_function ( * object_fun ) ; <nl> <nl> { <nl> static void InstallError ( Isolate * isolate , Handle < JSObject > global , <nl> global , name , JS_ERROR_TYPE , JSObject : : kHeaderSize , 0 , <nl> factory - > the_hole_value ( ) , Builtins : : kErrorConstructor , DONT_ENUM ) ; <nl> error_fun - > shared ( ) - > DontAdaptArguments ( ) ; <nl> - error_fun - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> error_fun - > shared ( ) - > set_length ( 1 ) ; <nl> <nl> if ( context_index = = Context : : ERROR_FUNCTION_INDEX ) { <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> / / Function instances are sloppy by default . <nl> function_fun - > set_prototype_or_initial_map ( * isolate - > sloppy_function_map ( ) ) ; <nl> function_fun - > shared ( ) - > DontAdaptArguments ( ) ; <nl> - function_fun - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> function_fun - > shared ( ) - > set_length ( 1 ) ; <nl> InstallWithIntrinsicDefaultProto ( isolate , function_fun , <nl> Context : : FUNCTION_FUNCTION_INDEX ) ; <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> <nl> / / Cache the array maps , needed by ArrayConstructorStub <nl> CacheInitialJSArrayMaps ( native_context ( ) , initial_map ) ; <nl> - array_function - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> <nl> / / Set up % ArrayPrototype % . <nl> / / The % ArrayPrototype % has TERMINAL_FAST_ELEMENTS_KIND in order to ensure <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> isolate - > initial_object_prototype ( ) , Builtins : : kNumberConstructor ) ; <nl> number_fun - > shared ( ) - > set_builtin_function_id ( kNumberConstructor ) ; <nl> number_fun - > shared ( ) - > DontAdaptArguments ( ) ; <nl> - number_fun - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> number_fun - > shared ( ) - > set_length ( 1 ) ; <nl> InstallWithIntrinsicDefaultProto ( isolate , number_fun , <nl> Context : : NUMBER_FUNCTION_INDEX ) ; <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> global , " Boolean " , JS_VALUE_TYPE , JSValue : : kSize , 0 , <nl> isolate - > initial_object_prototype ( ) , Builtins : : kBooleanConstructor ) ; <nl> boolean_fun - > shared ( ) - > DontAdaptArguments ( ) ; <nl> - boolean_fun - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> boolean_fun - > shared ( ) - > set_length ( 1 ) ; <nl> InstallWithIntrinsicDefaultProto ( isolate , boolean_fun , <nl> Context : : BOOLEAN_FUNCTION_INDEX ) ; <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> global , " String " , JS_VALUE_TYPE , JSValue : : kSize , 0 , <nl> isolate - > initial_object_prototype ( ) , Builtins : : kStringConstructor ) ; <nl> string_fun - > shared ( ) - > set_builtin_function_id ( kStringConstructor ) ; <nl> - string_fun - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> string_fun - > shared ( ) - > DontAdaptArguments ( ) ; <nl> string_fun - > shared ( ) - > set_length ( 1 ) ; <nl> InstallWithIntrinsicDefaultProto ( isolate , string_fun , <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> global , " Symbol " , JS_VALUE_TYPE , JSValue : : kSize , 0 , <nl> factory - > the_hole_value ( ) , Builtins : : kSymbolConstructor ) ; <nl> symbol_fun - > shared ( ) - > set_builtin_function_id ( kSymbolConstructor ) ; <nl> - symbol_fun - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> symbol_fun - > shared ( ) - > set_length ( 0 ) ; <nl> symbol_fun - > shared ( ) - > DontAdaptArguments ( ) ; <nl> native_context ( ) - > set_symbol_function ( * symbol_fun ) ; <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> factory - > the_hole_value ( ) , Builtins : : kDateConstructor ) ; <nl> InstallWithIntrinsicDefaultProto ( isolate , date_fun , <nl> Context : : DATE_FUNCTION_INDEX ) ; <nl> - date_fun - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> date_fun - > shared ( ) - > set_length ( 7 ) ; <nl> date_fun - > shared ( ) - > DontAdaptArguments ( ) ; <nl> <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> Context : : PROMISE_FUNCTION_INDEX ) ; <nl> <nl> Handle < SharedFunctionInfo > shared ( promise_fun - > shared ( ) , isolate ) ; <nl> - shared - > SetConstructStub ( * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> shared - > set_internal_formal_parameter_count ( 1 ) ; <nl> shared - > set_length ( 1 ) ; <nl> <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> Context : : REGEXP_FUNCTION_INDEX ) ; <nl> <nl> Handle < SharedFunctionInfo > shared ( regexp_fun - > shared ( ) , isolate ) ; <nl> - shared - > SetConstructStub ( * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> shared - > set_internal_formal_parameter_count ( 2 ) ; <nl> shared - > set_length ( 2 ) ; <nl> <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> Builtins : : kDataViewConstructor ) ; <nl> InstallWithIntrinsicDefaultProto ( isolate , data_view_fun , <nl> Context : : DATA_VIEW_FUN_INDEX ) ; <nl> - data_view_fun - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> data_view_fun - > shared ( ) - > set_length ( 3 ) ; <nl> data_view_fun - > shared ( ) - > DontAdaptArguments ( ) ; <nl> <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> Context : : JS_MAP_FUN_INDEX ) ; <nl> <nl> Handle < SharedFunctionInfo > shared ( js_map_fun - > shared ( ) , isolate ) ; <nl> - shared - > SetConstructStub ( * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> shared - > DontAdaptArguments ( ) ; <nl> shared - > set_length ( 0 ) ; <nl> <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> Context : : JS_SET_FUN_INDEX ) ; <nl> <nl> Handle < SharedFunctionInfo > shared ( js_set_fun - > shared ( ) , isolate ) ; <nl> - shared - > SetConstructStub ( * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> shared - > DontAdaptArguments ( ) ; <nl> shared - > set_length ( 0 ) ; <nl> <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> Context : : JS_WEAK_MAP_FUN_INDEX ) ; <nl> <nl> Handle < SharedFunctionInfo > shared ( cons - > shared ( ) , isolate ) ; <nl> - shared - > SetConstructStub ( * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> shared - > DontAdaptArguments ( ) ; <nl> shared - > set_length ( 0 ) ; <nl> <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> Context : : JS_WEAK_SET_FUN_INDEX ) ; <nl> <nl> Handle < SharedFunctionInfo > shared ( cons - > shared ( ) , isolate ) ; <nl> - shared - > SetConstructStub ( * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> shared - > DontAdaptArguments ( ) ; <nl> shared - > set_length ( 0 ) ; <nl> <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> JSFunction : : SetInitialMap ( proxy_function , isolate - > proxy_map ( ) , <nl> factory - > null_value ( ) ) ; <nl> <nl> - proxy_function - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> proxy_function - > shared ( ) - > set_internal_formal_parameter_count ( 2 ) ; <nl> proxy_function - > shared ( ) - > set_length ( 2 ) ; <nl> <nl> Handle < JSFunction > Genesis : : InstallTypedArray ( const char * name , <nl> <nl> result - > shared ( ) - > DontAdaptArguments ( ) ; <nl> result - > shared ( ) - > set_length ( 3 ) ; <nl> - result - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate_ , JSBuiltinsConstructStub ) ) ; <nl> <nl> CHECK ( JSObject : : SetPrototype ( result , typed_array_function , false , kDontThrow ) <nl> . FromJust ( ) ) ; <nl> void Bootstrapper : : ExportFromRuntime ( Isolate * isolate , <nl> generator_function_function - > set_prototype_or_initial_map ( <nl> native_context - > generator_function_map ( ) ) ; <nl> generator_function_function - > shared ( ) - > DontAdaptArguments ( ) ; <nl> - generator_function_function - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> generator_function_function - > shared ( ) - > set_length ( 1 ) ; <nl> InstallWithIntrinsicDefaultProto ( <nl> isolate , generator_function_function , <nl> void Bootstrapper : : ExportFromRuntime ( Isolate * isolate , <nl> async_generator_function_function - > set_prototype_or_initial_map ( <nl> native_context - > async_generator_function_map ( ) ) ; <nl> async_generator_function_function - > shared ( ) - > DontAdaptArguments ( ) ; <nl> - async_generator_function_function - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> async_generator_function_function - > shared ( ) - > set_length ( 1 ) ; <nl> InstallWithIntrinsicDefaultProto ( <nl> isolate , async_generator_function_function , <nl> void Bootstrapper : : ExportFromRuntime ( Isolate * isolate , <nl> async_function_constructor - > set_prototype_or_initial_map ( <nl> native_context - > async_function_map ( ) ) ; <nl> async_function_constructor - > shared ( ) - > DontAdaptArguments ( ) ; <nl> - async_function_constructor - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate , JSBuiltinsConstructStub ) ) ; <nl> async_function_constructor - > shared ( ) - > set_length ( 1 ) ; <nl> native_context - > set_async_function_constructor ( * async_function_constructor ) ; <nl> JSObject : : ForceSetPrototype ( async_function_constructor , <nl> void Genesis : : InitializeGlobal_harmony_bigint ( ) { <nl> factory - > the_hole_value ( ) , Builtins : : kBigIntConstructor ) ; <nl> bigint_fun - > shared ( ) - > set_builtin_function_id ( kBigIntConstructor ) ; <nl> bigint_fun - > shared ( ) - > DontAdaptArguments ( ) ; <nl> - bigint_fun - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate ( ) , JSBuiltinsConstructStub ) ) ; <nl> bigint_fun - > shared ( ) - > set_length ( 1 ) ; <nl> InstallWithIntrinsicDefaultProto ( isolate ( ) , bigint_fun , <nl> Context : : BIGINT_FUNCTION_INDEX ) ; <nl> Handle < JSFunction > Genesis : : CreateArrayBuffer ( <nl> CreateFunction ( isolate ( ) , name , JS_ARRAY_BUFFER_TYPE , <nl> JSArrayBuffer : : kSizeWithEmbedderFields , 0 , prototype , <nl> Builtins : : kArrayBufferConstructor ) ; <nl> - array_buffer_fun - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate ( ) , JSBuiltinsConstructStub ) ) ; <nl> array_buffer_fun - > shared ( ) - > DontAdaptArguments ( ) ; <nl> array_buffer_fun - > shared ( ) - > set_length ( 1 ) ; <nl> <nl> Handle < JSFunction > Genesis : : InstallInternalArray ( Handle < JSObject > target , <nl> InstallFunction ( target , name , JS_ARRAY_TYPE , JSArray : : kSize , 0 , prototype , <nl> Builtins : : kInternalArrayConstructor ) ; <nl> <nl> - array_function - > shared ( ) - > SetConstructStub ( <nl> - * BUILTIN_CODE ( isolate_ , JSBuiltinsConstructStub ) ) ; <nl> array_function - > shared ( ) - > DontAdaptArguments ( ) ; <nl> <nl> Handle < Map > original_map ( array_function - > initial_map ( ) ) ; <nl> mmm a / src / builtins / arm / builtins - arm . cc <nl> ppp b / src / builtins / arm / builtins - arm . cc <nl> void Builtins : : Generate_JSConstructStubGenericUnrestrictedReturn ( <nl> MacroAssembler * masm ) { <nl> Generate_JSConstructStubGeneric ( masm , false ) ; <nl> } <nl> - void Builtins : : Generate_JSConstructStubApi ( MacroAssembler * masm ) { <nl> - Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> - } <nl> void Builtins : : Generate_JSBuiltinsConstructStub ( MacroAssembler * masm ) { <nl> Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> } <nl> void Builtins : : Generate_ConstructFunction ( MacroAssembler * masm ) { <nl> / / r2 to contain either an AllocationSite or undefined . <nl> __ LoadRoot ( r2 , Heap : : kUndefinedValueRootIndex ) ; <nl> <nl> - / / Tail call to the function - specific construct stub ( still in the caller <nl> - / / context at this point ) . <nl> + Label call_generic_stub ; <nl> + <nl> + / / Jump to JSBuiltinsConstructStub or JSConstructStubGeneric . <nl> __ ldr ( r4 , FieldMemOperand ( r1 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> - __ ldr ( r4 , FieldMemOperand ( r4 , SharedFunctionInfo : : kConstructStubOffset ) ) ; <nl> - __ add ( pc , r4 , Operand ( Code : : kHeaderSize - kHeapObjectTag ) ) ; <nl> + __ ldr ( r4 , FieldMemOperand ( r4 , SharedFunctionInfo : : kFlagsOffset ) ) ; <nl> + __ tst ( r4 , Operand ( SharedFunctionInfo : : ConstructAsBuiltinBit : : kMask ) ) ; <nl> + __ b ( eq , & call_generic_stub ) ; <nl> + <nl> + __ Jump ( BUILTIN_CODE ( masm - > isolate ( ) , JSBuiltinsConstructStub ) , <nl> + RelocInfo : : CODE_TARGET ) ; <nl> + <nl> + __ bind ( & call_generic_stub ) ; <nl> + __ Jump ( masm - > isolate ( ) - > builtins ( ) - > JSConstructStubGeneric ( ) , <nl> + RelocInfo : : CODE_TARGET ) ; <nl> } <nl> <nl> / / static <nl> mmm a / src / builtins / arm64 / builtins - arm64 . cc <nl> ppp b / src / builtins / arm64 / builtins - arm64 . cc <nl> void Builtins : : Generate_JSConstructStubGenericUnrestrictedReturn ( <nl> MacroAssembler * masm ) { <nl> Generate_JSConstructStubGeneric ( masm , false ) ; <nl> } <nl> - void Builtins : : Generate_JSConstructStubApi ( MacroAssembler * masm ) { <nl> - Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> - } <nl> void Builtins : : Generate_JSBuiltinsConstructStub ( MacroAssembler * masm ) { <nl> Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> } <nl> void Builtins : : Generate_ConstructFunction ( MacroAssembler * masm ) { <nl> / / x2 to contain either an AllocationSite or undefined . <nl> __ LoadRoot ( x2 , Heap : : kUndefinedValueRootIndex ) ; <nl> <nl> - / / Tail call to the function - specific construct stub ( still in the caller <nl> - / / context at this point ) . <nl> + Label call_generic_stub ; <nl> + <nl> + / / Jump to JSBuiltinsConstructStub or JSConstructStubGeneric . <nl> __ Ldr ( x4 , FieldMemOperand ( x1 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> - __ Ldr ( x4 , FieldMemOperand ( x4 , SharedFunctionInfo : : kConstructStubOffset ) ) ; <nl> - __ Add ( x4 , x4 , Code : : kHeaderSize - kHeapObjectTag ) ; <nl> - __ Br ( x4 ) ; <nl> + __ Ldr ( w4 , FieldMemOperand ( x4 , SharedFunctionInfo : : kFlagsOffset ) ) ; <nl> + __ TestAndBranchIfAllClear ( <nl> + w4 , SharedFunctionInfo : : ConstructAsBuiltinBit : : kMask , & call_generic_stub ) ; <nl> + <nl> + __ Jump ( BUILTIN_CODE ( masm - > isolate ( ) , JSBuiltinsConstructStub ) , <nl> + RelocInfo : : CODE_TARGET ) ; <nl> + <nl> + __ bind ( & call_generic_stub ) ; <nl> + __ Jump ( masm - > isolate ( ) - > builtins ( ) - > JSConstructStubGeneric ( ) , <nl> + RelocInfo : : CODE_TARGET ) ; <nl> } <nl> <nl> / / static <nl> mmm a / src / builtins / builtins - definitions . h <nl> ppp b / src / builtins / builtins - definitions . h <nl> namespace internal { <nl> TFC ( ConstructWithArrayLike , ConstructWithArrayLike , 1 ) \ <nl> ASM ( ConstructForwardVarargs ) \ <nl> ASM ( ConstructFunctionForwardVarargs ) \ <nl> - ASM ( JSConstructStubApi ) \ <nl> ASM ( JSConstructStubGenericRestrictedReturn ) \ <nl> ASM ( JSConstructStubGenericUnrestrictedReturn ) \ <nl> ASM ( JSBuiltinsConstructStub ) \ <nl> mmm a / src / builtins / ia32 / builtins - ia32 . cc <nl> ppp b / src / builtins / ia32 / builtins - ia32 . cc <nl> void Builtins : : Generate_JSConstructStubGenericUnrestrictedReturn ( <nl> MacroAssembler * masm ) { <nl> return Generate_JSConstructStubGeneric ( masm , false ) ; <nl> } <nl> - void Builtins : : Generate_JSConstructStubApi ( MacroAssembler * masm ) { <nl> - Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> - } <nl> void Builtins : : Generate_JSBuiltinsConstructStub ( MacroAssembler * masm ) { <nl> Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> } <nl> void Builtins : : Generate_ConstructFunction ( MacroAssembler * masm ) { <nl> / / ebx to contain either an AllocationSite or undefined . <nl> __ LoadRoot ( ebx , Heap : : kUndefinedValueRootIndex ) ; <nl> <nl> - / / Tail call to the function - specific construct stub ( still in the caller <nl> - / / context at this point ) . <nl> + Label call_generic_stub ; <nl> + <nl> + / / Jump to JSBuiltinsConstructStub or JSConstructStubGeneric . <nl> __ mov ( ecx , FieldOperand ( edi , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> - __ mov ( ecx , FieldOperand ( ecx , SharedFunctionInfo : : kConstructStubOffset ) ) ; <nl> - __ lea ( ecx , FieldOperand ( ecx , Code : : kHeaderSize ) ) ; <nl> - __ jmp ( ecx ) ; <nl> + __ test ( FieldOperand ( ecx , SharedFunctionInfo : : kFlagsOffset ) , <nl> + Immediate ( SharedFunctionInfo : : ConstructAsBuiltinBit : : kMask ) ) ; <nl> + __ j ( zero , & call_generic_stub , Label : : kNear ) ; <nl> + <nl> + __ Jump ( BUILTIN_CODE ( masm - > isolate ( ) , JSBuiltinsConstructStub ) , <nl> + RelocInfo : : CODE_TARGET ) ; <nl> + <nl> + __ bind ( & call_generic_stub ) ; <nl> + __ Jump ( masm - > isolate ( ) - > builtins ( ) - > JSConstructStubGeneric ( ) , <nl> + RelocInfo : : CODE_TARGET ) ; <nl> } <nl> <nl> / / static <nl> mmm a / src / builtins / mips / builtins - mips . cc <nl> ppp b / src / builtins / mips / builtins - mips . cc <nl> void Builtins : : Generate_JSConstructStubGenericUnrestrictedReturn ( <nl> MacroAssembler * masm ) { <nl> Generate_JSConstructStubGeneric ( masm , false ) ; <nl> } <nl> - void Builtins : : Generate_JSConstructStubApi ( MacroAssembler * masm ) { <nl> - Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> - } <nl> void Builtins : : Generate_JSBuiltinsConstructStub ( MacroAssembler * masm ) { <nl> Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> } <nl> void Builtins : : Generate_ConstructFunction ( MacroAssembler * masm ) { <nl> / / a2 to contain either an AllocationSite or undefined . <nl> __ LoadRoot ( a2 , Heap : : kUndefinedValueRootIndex ) ; <nl> <nl> - / / Tail call to the function - specific construct stub ( still in the caller <nl> - / / context at this point ) . <nl> + Label call_generic_stub ; <nl> + <nl> + / / Jump to JSBuiltinsConstructStub or JSConstructStubGeneric . <nl> __ lw ( t0 , FieldMemOperand ( a1 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> - __ lw ( t0 , FieldMemOperand ( t0 , SharedFunctionInfo : : kConstructStubOffset ) ) ; <nl> - __ Jump ( at , t0 , Code : : kHeaderSize - kHeapObjectTag ) ; <nl> + __ lw ( t0 , FieldMemOperand ( t0 , SharedFunctionInfo : : kFlagsOffset ) ) ; <nl> + __ And ( t0 , t0 , Operand ( SharedFunctionInfo : : ConstructAsBuiltinBit : : kMask ) ) ; <nl> + __ Branch ( & call_generic_stub , eq , t0 , Operand ( zero_reg ) ) ; <nl> + <nl> + __ Jump ( BUILTIN_CODE ( masm - > isolate ( ) , JSBuiltinsConstructStub ) , <nl> + RelocInfo : : CODE_TARGET ) ; <nl> + <nl> + __ bind ( & call_generic_stub ) ; <nl> + __ Jump ( masm - > isolate ( ) - > builtins ( ) - > JSConstructStubGeneric ( ) , <nl> + RelocInfo : : CODE_TARGET ) ; <nl> } <nl> <nl> / / static <nl> mmm a / src / builtins / mips64 / builtins - mips64 . cc <nl> ppp b / src / builtins / mips64 / builtins - mips64 . cc <nl> void Builtins : : Generate_JSConstructStubGenericUnrestrictedReturn ( <nl> MacroAssembler * masm ) { <nl> Generate_JSConstructStubGeneric ( masm , false ) ; <nl> } <nl> - void Builtins : : Generate_JSConstructStubApi ( MacroAssembler * masm ) { <nl> - Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> - } <nl> void Builtins : : Generate_JSBuiltinsConstructStub ( MacroAssembler * masm ) { <nl> Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> } <nl> void Builtins : : Generate_ConstructFunction ( MacroAssembler * masm ) { <nl> / / a2 to contain either an AllocationSite or undefined . <nl> __ LoadRoot ( a2 , Heap : : kUndefinedValueRootIndex ) ; <nl> <nl> - / / Tail call to the function - specific construct stub ( still in the caller <nl> - / / context at this point ) . <nl> + Label call_generic_stub ; <nl> + <nl> + / / Jump to JSBuiltinsConstructStub or JSConstructStubGeneric . <nl> __ Ld ( a4 , FieldMemOperand ( a1 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> - __ Ld ( a4 , FieldMemOperand ( a4 , SharedFunctionInfo : : kConstructStubOffset ) ) ; <nl> - __ Daddu ( at , a4 , Operand ( Code : : kHeaderSize - kHeapObjectTag ) ) ; <nl> - __ Jump ( at ) ; <nl> + __ lwu ( a4 , FieldMemOperand ( a4 , SharedFunctionInfo : : kFlagsOffset ) ) ; <nl> + __ And ( a4 , a4 , Operand ( SharedFunctionInfo : : ConstructAsBuiltinBit : : kMask ) ) ; <nl> + __ Branch ( & call_generic_stub , eq , a4 , Operand ( zero_reg ) ) ; <nl> + <nl> + __ Jump ( BUILTIN_CODE ( masm - > isolate ( ) , JSBuiltinsConstructStub ) , <nl> + RelocInfo : : CODE_TARGET ) ; <nl> + <nl> + __ bind ( & call_generic_stub ) ; <nl> + __ Jump ( masm - > isolate ( ) - > builtins ( ) - > JSConstructStubGeneric ( ) , <nl> + RelocInfo : : CODE_TARGET ) ; <nl> } <nl> <nl> / / static <nl> mmm a / src / builtins / ppc / builtins - ppc . cc <nl> ppp b / src / builtins / ppc / builtins - ppc . cc <nl> void Builtins : : Generate_JSConstructStubGenericUnrestrictedReturn ( <nl> MacroAssembler * masm ) { <nl> Generate_JSConstructStubGeneric ( masm , false ) ; <nl> } <nl> - void Builtins : : Generate_JSConstructStubApi ( MacroAssembler * masm ) { <nl> - Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> - } <nl> void Builtins : : Generate_JSBuiltinsConstructStub ( MacroAssembler * masm ) { <nl> Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> } <nl> mmm a / src / builtins / s390 / builtins - s390 . cc <nl> ppp b / src / builtins / s390 / builtins - s390 . cc <nl> void Builtins : : Generate_JSConstructStubGenericUnrestrictedReturn ( <nl> MacroAssembler * masm ) { <nl> Generate_JSConstructStubGeneric ( masm , false ) ; <nl> } <nl> - void Builtins : : Generate_JSConstructStubApi ( MacroAssembler * masm ) { <nl> - Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> - } <nl> void Builtins : : Generate_JSBuiltinsConstructStub ( MacroAssembler * masm ) { <nl> Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> } <nl> mmm a / src / builtins / x64 / builtins - x64 . cc <nl> ppp b / src / builtins / x64 / builtins - x64 . cc <nl> void Builtins : : Generate_JSConstructStubGenericUnrestrictedReturn ( <nl> MacroAssembler * masm ) { <nl> return Generate_JSConstructStubGeneric ( masm , false ) ; <nl> } <nl> - void Builtins : : Generate_JSConstructStubApi ( MacroAssembler * masm ) { <nl> - Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> - } <nl> void Builtins : : Generate_JSBuiltinsConstructStub ( MacroAssembler * masm ) { <nl> Generate_JSBuiltinsConstructStubHelper ( masm ) ; <nl> } <nl> void Builtins : : Generate_ConstructFunction ( MacroAssembler * masm ) { <nl> / / rbx to contain either an AllocationSite or undefined . <nl> __ LoadRoot ( rbx , Heap : : kUndefinedValueRootIndex ) ; <nl> <nl> - / / Tail call to the function - specific construct stub ( still in the caller <nl> - / / context at this point ) . <nl> + Label call_generic_stub ; <nl> + <nl> + / / Jump to JSBuiltinsConstructStub or JSConstructStubGeneric . <nl> __ movp ( rcx , FieldOperand ( rdi , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> - __ movp ( rcx , FieldOperand ( rcx , SharedFunctionInfo : : kConstructStubOffset ) ) ; <nl> - __ leap ( rcx , FieldOperand ( rcx , Code : : kHeaderSize ) ) ; <nl> - __ jmp ( rcx ) ; <nl> + __ testl ( FieldOperand ( rcx , SharedFunctionInfo : : kFlagsOffset ) , <nl> + Immediate ( SharedFunctionInfo : : ConstructAsBuiltinBit : : kMask ) ) ; <nl> + __ j ( zero , & call_generic_stub , Label : : kNear ) ; <nl> + <nl> + __ Jump ( BUILTIN_CODE ( masm - > isolate ( ) , JSBuiltinsConstructStub ) , <nl> + RelocInfo : : CODE_TARGET ) ; <nl> + <nl> + __ bind ( & call_generic_stub ) ; <nl> + __ Jump ( masm - > isolate ( ) - > builtins ( ) - > JSConstructStubGeneric ( ) , <nl> + RelocInfo : : CODE_TARGET ) ; <nl> } <nl> <nl> / / static <nl> mmm a / src / compiler / js - inlining . cc <nl> ppp b / src / compiler / js - inlining . cc <nl> namespace { <nl> / / TODO ( mstarzinger , verwaest ) : Move this predicate onto SharedFunctionInfo ? <nl> bool NeedsImplicitReceiver ( Handle < SharedFunctionInfo > shared_info ) { <nl> DisallowHeapAllocation no_gc ; <nl> - Isolate * const isolate = shared_info - > GetIsolate ( ) ; <nl> - Code * const construct_stub = shared_info - > construct_stub ( ) ; <nl> - if ( construct_stub = = * isolate - > builtins ( ) - > JSConstructStubGeneric ( ) ) { <nl> + if ( ! shared_info - > construct_as_builtin ( ) ) { <nl> return ! IsDerivedConstructor ( shared_info - > kind ( ) ) ; <nl> } else { <nl> return false ; <nl> mmm a / src / compiler / js - typed - lowering . cc <nl> ppp b / src / compiler / js - typed - lowering . cc <nl> Reduction JSTypedLowering : : ReduceJSConstruct ( Node * node ) { <nl> Node * target = NodeProperties : : GetValueInput ( node , 0 ) ; <nl> Type * target_type = NodeProperties : : GetType ( target ) ; <nl> Node * new_target = NodeProperties : : GetValueInput ( node , arity + 1 ) ; <nl> - Node * effect = NodeProperties : : GetEffectInput ( node ) ; <nl> - Node * control = NodeProperties : : GetControlInput ( node ) ; <nl> <nl> / / Check if { target } is a known JSFunction . <nl> if ( target_type - > IsHeapConstant ( ) & & <nl> Reduction JSTypedLowering : : ReduceJSConstruct ( Node * node ) { <nl> Handle < JSFunction > function = <nl> Handle < JSFunction > : : cast ( target_type - > AsHeapConstant ( ) - > Value ( ) ) ; <nl> Handle < SharedFunctionInfo > shared ( function - > shared ( ) , isolate ( ) ) ; <nl> - const int builtin_index = shared - > construct_stub ( ) - > builtin_index ( ) ; <nl> - const bool is_builtin = ( builtin_index ! = - 1 ) ; <nl> <nl> / / Only optimize [ [ Construct ] ] here if { function } is a Constructor . <nl> if ( ! function - > IsConstructor ( ) ) return NoChange ( ) ; <nl> <nl> CallDescriptor : : Flags flags = CallDescriptor : : kNeedsFrameState ; <nl> <nl> - if ( is_builtin & & Builtins : : HasCppImplementation ( builtin_index ) & & <nl> - ! NeedsArgumentAdaptorFrame ( shared , arity ) ) { <nl> - / / Patch { node } to a direct CEntryStub call . <nl> + / / Patch { node } to an indirect call via the { function } s construct stub . <nl> + bool use_builtin_construct_stub = shared - > construct_as_builtin ( ) ; <nl> <nl> - / / Load the context from the { target } . <nl> - Node * context = effect = graph ( ) - > NewNode ( <nl> - simplified ( ) - > LoadField ( AccessBuilder : : ForJSFunctionContext ( ) ) , <nl> - target , effect , control ) ; <nl> - NodeProperties : : ReplaceContextInput ( node , context ) ; <nl> + Handle < Code > code = <nl> + use_builtin_construct_stub <nl> + ? BUILTIN_CODE ( isolate ( ) , JSBuiltinsConstructStub ) <nl> + : BUILTIN_CODE ( isolate ( ) , JSConstructStubGenericUnrestrictedReturn ) ; <nl> <nl> - / / Update the effect dependency for the { node } . <nl> - NodeProperties : : ReplaceEffectInput ( node , effect ) ; <nl> + node - > RemoveInput ( arity + 1 ) ; <nl> + node - > InsertInput ( graph ( ) - > zone ( ) , 0 , jsgraph ( ) - > HeapConstant ( code ) ) ; <nl> + node - > InsertInput ( graph ( ) - > zone ( ) , 2 , new_target ) ; <nl> + node - > InsertInput ( graph ( ) - > zone ( ) , 3 , jsgraph ( ) - > Constant ( arity ) ) ; <nl> + node - > InsertInput ( graph ( ) - > zone ( ) , 4 , jsgraph ( ) - > UndefinedConstant ( ) ) ; <nl> + node - > InsertInput ( graph ( ) - > zone ( ) , 5 , jsgraph ( ) - > UndefinedConstant ( ) ) ; <nl> + NodeProperties : : ChangeOp ( <nl> + node , common ( ) - > Call ( Linkage : : GetStubCallDescriptor ( <nl> + isolate ( ) , graph ( ) - > zone ( ) , <nl> + ConstructStubDescriptor ( isolate ( ) ) , 1 + arity , flags ) ) ) ; <nl> <nl> - ReduceBuiltin ( isolate ( ) , jsgraph ( ) , node , builtin_index , arity , flags ) ; <nl> - } else { <nl> - / / Patch { node } to an indirect call via the { function } s construct stub . <nl> - Callable callable ( handle ( shared - > construct_stub ( ) , isolate ( ) ) , <nl> - ConstructStubDescriptor ( isolate ( ) ) ) ; <nl> - node - > RemoveInput ( arity + 1 ) ; <nl> - node - > InsertInput ( graph ( ) - > zone ( ) , 0 , <nl> - jsgraph ( ) - > HeapConstant ( callable . code ( ) ) ) ; <nl> - node - > InsertInput ( graph ( ) - > zone ( ) , 2 , new_target ) ; <nl> - node - > InsertInput ( graph ( ) - > zone ( ) , 3 , jsgraph ( ) - > Constant ( arity ) ) ; <nl> - node - > InsertInput ( graph ( ) - > zone ( ) , 4 , jsgraph ( ) - > UndefinedConstant ( ) ) ; <nl> - node - > InsertInput ( graph ( ) - > zone ( ) , 5 , jsgraph ( ) - > UndefinedConstant ( ) ) ; <nl> - NodeProperties : : ChangeOp ( <nl> - node , common ( ) - > Call ( Linkage : : GetStubCallDescriptor ( <nl> - isolate ( ) , graph ( ) - > zone ( ) , callable . descriptor ( ) , <nl> - 1 + arity , flags ) ) ) ; <nl> - } <nl> return Changed ( node ) ; <nl> } <nl> <nl> mmm a / src / factory . cc <nl> ppp b / src / factory . cc <nl> Handle < SharedFunctionInfo > Factory : : NewSharedFunctionInfo ( <nl> share - > set_builtin_id ( Builtins : : kIllegal ) ; <nl> } <nl> share - > set_outer_scope_info ( * the_hole_value ( ) ) ; <nl> - share - > SetConstructStub ( * isolate ( ) - > builtins ( ) - > JSConstructStubGeneric ( ) ) ; <nl> share - > set_script ( * undefined_value ( ) , SKIP_WRITE_BARRIER ) ; <nl> share - > set_debug_info ( Smi : : kZero , SKIP_WRITE_BARRIER ) ; <nl> share - > set_function_identifier ( * undefined_value ( ) , SKIP_WRITE_BARRIER ) ; <nl> Handle < SharedFunctionInfo > Factory : : NewSharedFunctionInfo ( <nl> share - > set_function_token_position ( 0 ) ; <nl> / / All flags default to false or 0 . <nl> share - > set_flags ( 0 ) ; <nl> + share - > CalculateConstructAsBuiltin ( ) ; <nl> share - > set_kind ( kind ) ; <nl> <nl> share - > clear_padding ( ) ; <nl> mmm a / src / objects - debug . cc <nl> ppp b / src / objects - debug . cc <nl> void SharedFunctionInfo : : SharedFunctionInfoVerify ( ) { <nl> CHECK_EQ ( raw_start_position ( ) , info - > StartPosition ( ) ) ; <nl> CHECK_EQ ( raw_end_position ( ) , info - > EndPosition ( ) ) ; <nl> } <nl> + <nl> + if ( IsApiFunction ( ) ) { <nl> + CHECK ( construct_as_builtin ( ) ) ; <nl> + } else if ( ! HasBuiltinId ( ) ) { <nl> + CHECK ( ! construct_as_builtin ( ) ) ; <nl> + } else { <nl> + int id = builtin_id ( ) ; <nl> + if ( id ! = Builtins : : kCompileLazy & & id ! = Builtins : : kEmptyFunction ) { <nl> + CHECK ( construct_as_builtin ( ) ) ; <nl> + } else { <nl> + CHECK ( ! construct_as_builtin ( ) ) ; <nl> + } <nl> + } <nl> } <nl> <nl> <nl> mmm a / src / objects . cc <nl> ppp b / src / objects . cc <nl> Handle < SharedFunctionInfo > FunctionTemplateInfo : : GetOrCreateSharedFunctionInfo ( <nl> } else { <nl> name_string = isolate - > factory ( ) - > empty_string ( ) ; <nl> } <nl> - bool is_constructor ; <nl> FunctionKind function_kind ; <nl> if ( info - > remove_prototype ( ) ) { <nl> - is_constructor = false ; <nl> function_kind = kConciseMethod ; <nl> } else { <nl> - is_constructor = true ; <nl> function_kind = kNormalFunction ; <nl> } <nl> Handle < SharedFunctionInfo > result = <nl> isolate - > factory ( ) - > NewSharedFunctionInfoForApiFunction ( name_string , info , <nl> function_kind ) ; <nl> - if ( is_constructor ) { <nl> - result - > SetConstructStub ( * BUILTIN_CODE ( isolate , JSConstructStubApi ) ) ; <nl> - } <nl> <nl> result - > set_length ( info - > length ( ) ) ; <nl> result - > DontAdaptArguments ( ) ; <nl> void SharedFunctionInfo : : InitFromFunctionLiteral ( <nl> / / shared_info - > set_kind ( lit - > kind ( ) ) ; <nl> / / FunctionKind must have already been set . <nl> DCHECK ( lit - > kind ( ) = = shared_info - > kind ( ) ) ; <nl> - DCHECK_EQ ( * shared_info - > GetIsolate ( ) - > builtins ( ) - > JSConstructStubGeneric ( ) , <nl> - shared_info - > construct_stub ( ) ) ; <nl> shared_info - > set_needs_home_object ( lit - > scope ( ) - > NeedsHomeObject ( ) ) ; <nl> shared_info - > set_function_literal_id ( lit - > function_literal_id ( ) ) ; <nl> DCHECK_IMPLIES ( lit - > requires_instance_fields_initializer ( ) , <nl> void SharedFunctionInfo : : SetExpectedNofPropertiesFromEstimate ( <nl> set_expected_nof_properties ( estimate ) ; <nl> } <nl> <nl> - void SharedFunctionInfo : : SetConstructStub ( Code * code ) { <nl> - if ( code - > kind ( ) = = Code : : BUILTIN ) code - > set_is_construct_stub ( true ) ; <nl> - # ifdef DEBUG <nl> - if ( code - > is_builtin ( ) ) { <nl> - / / See https : / / crbug . com / v8 / 6787 . Lazy deserialization currently cannot <nl> - / / handle lazy construct stubs that differ from the code object . <nl> - int builtin_id = code - > builtin_index ( ) ; <nl> - DCHECK_NE ( Builtins : : kDeserializeLazy , builtin_id ) ; <nl> - DCHECK ( builtin_id = = Builtins : : kJSBuiltinsConstructStub | | <nl> - ! Builtins : : IsLazy ( builtin_id ) ) ; <nl> - / / Builtins should use JSBuiltinsConstructStub . <nl> - DCHECK_NE ( this - > GetCode ( ) , code ) ; <nl> - } <nl> - # endif <nl> - set_construct_stub ( code ) ; <nl> - } <nl> - <nl> void Map : : StartInobjectSlackTracking ( ) { <nl> DCHECK ( ! IsInobjectSlackTrackingInProgress ( ) ) ; <nl> if ( UnusedPropertyFields ( ) = = 0 ) return ; <nl> mmm a / src / objects / shared - function - info - inl . h <nl> ppp b / src / objects / shared - function - info - inl . h <nl> DEFINE_DEOPT_ELEMENT_ACCESSORS ( SharedFunctionInfo , Object ) <nl> <nl> ACCESSORS ( SharedFunctionInfo , name_or_scope_info , Object , <nl> kNameOrScopeInfoOffset ) <nl> - ACCESSORS ( SharedFunctionInfo , construct_stub , Code , kConstructStubOffset ) <nl> ACCESSORS ( SharedFunctionInfo , feedback_metadata , FeedbackMetadata , <nl> kFeedbackMetadataOffset ) <nl> ACCESSORS ( SharedFunctionInfo , function_data , Object , kFunctionDataOffset ) <nl> void SharedFunctionInfo : : set_needs_home_object ( bool value ) { <nl> UpdateFunctionMapIndex ( ) ; <nl> } <nl> <nl> + bool SharedFunctionInfo : : construct_as_builtin ( ) const { <nl> + return ConstructAsBuiltinBit : : decode ( flags ( ) ) ; <nl> + } <nl> + <nl> + void SharedFunctionInfo : : CalculateConstructAsBuiltin ( ) { <nl> + bool uses_builtins_construct_stub = false ; <nl> + if ( HasBuiltinId ( ) ) { <nl> + int id = builtin_id ( ) ; <nl> + if ( id ! = Builtins : : kCompileLazy & & id ! = Builtins : : kEmptyFunction ) { <nl> + uses_builtins_construct_stub = true ; <nl> + } <nl> + } else if ( IsApiFunction ( ) ) { <nl> + uses_builtins_construct_stub = true ; <nl> + } <nl> + <nl> + int f = flags ( ) ; <nl> + f = ConstructAsBuiltinBit : : update ( f , uses_builtins_construct_stub ) ; <nl> + set_flags ( f ) ; <nl> + } <nl> + <nl> int SharedFunctionInfo : : function_map_index ( ) const { <nl> / / Note : Must be kept in sync with the FastNewClosure builtin . <nl> int index = <nl> mmm a / src / objects / shared - function - info . h <nl> ppp b / src / objects / shared - function - info . h <nl> class SharedFunctionInfo : public HeapObject { <nl> / / value if it isn ' t yet known . <nl> DECL_ACCESSORS ( outer_scope_info , HeapObject ) <nl> <nl> - / / [ construct stub ] : Code stub for constructing instances of this function . <nl> - DECL_ACCESSORS ( construct_stub , Code ) <nl> - <nl> - / / Sets the given code as the construct stub , and marks builtin code objects <nl> - / / as a construct stub . <nl> - void SetConstructStub ( Code * code ) ; <nl> - <nl> / / Returns if this function has been compiled to native code yet . <nl> inline bool is_compiled ( ) const ; <nl> <nl> class SharedFunctionInfo : public HeapObject { <nl> / / Sets the expected number of properties based on estimate from parser . <nl> void SetExpectedNofPropertiesFromEstimate ( FunctionLiteral * literal ) ; <nl> <nl> + inline bool construct_as_builtin ( ) const ; <nl> + <nl> + / / Determines and sets the ConstructAsBuiltinBit in | flags | , based on the <nl> + / / | function_data | . Must be called when creating the SFI after other fields <nl> + / / are initialized . The ConstructAsBuiltinBit determines whether <nl> + / / JSBuiltinsConstructStub or JSConstructStubGeneric should be called to <nl> + / / construct this function . <nl> + inline void CalculateConstructAsBuiltin ( ) ; <nl> + <nl> / / Dispatched behavior . <nl> DECL_PRINTER ( SharedFunctionInfo ) <nl> DECL_VERIFIER ( SharedFunctionInfo ) <nl> class SharedFunctionInfo : public HeapObject { <nl> V ( kFunctionDataOffset , kPointerSize ) \ <nl> V ( kNameOrScopeInfoOffset , kPointerSize ) \ <nl> V ( kOuterScopeInfoOffset , kPointerSize ) \ <nl> - V ( kConstructStubOffset , kPointerSize ) \ <nl> V ( kScriptOffset , kPointerSize ) \ <nl> V ( kDebugInfoOffset , kPointerSize ) \ <nl> V ( kFunctionIdentifierOffset , kPointerSize ) \ <nl> class SharedFunctionInfo : public HeapObject { <nl> V ( IsAsmWasmBrokenBit , bool , 1 , _ ) \ <nl> V ( FunctionMapIndexBits , int , 5 , _ ) \ <nl> V ( DisabledOptimizationReasonBits , BailoutReason , 4 , _ ) \ <nl> - V ( RequiresInstanceFieldsInitializer , bool , 1 , _ ) <nl> + V ( RequiresInstanceFieldsInitializer , bool , 1 , _ ) \ <nl> + V ( ConstructAsBuiltinBit , bool , 1 , _ ) <nl> <nl> DEFINE_BIT_FIELDS ( FLAGS_BIT_FIELDS ) <nl> # undef FLAGS_BIT_FIELDS <nl> mmm a / src / profiler / heap - snapshot - generator . cc <nl> ppp b / src / profiler / heap - snapshot - generator . cc <nl> void V8HeapExplorer : : ExtractSharedFunctionInfoReferences ( <nl> SetInternalReference ( obj , entry , <nl> " script " , shared - > script ( ) , <nl> SharedFunctionInfo : : kScriptOffset ) ; <nl> - const char * construct_stub_name = name ? <nl> - names_ - > GetFormatted ( " ( construct stub code for % s ) " , name ) : <nl> - " ( construct stub code ) " ; <nl> - TagObject ( shared - > construct_stub ( ) , construct_stub_name ) ; <nl> - SetInternalReference ( obj , entry , <nl> - " construct_stub " , shared - > construct_stub ( ) , <nl> - SharedFunctionInfo : : kConstructStubOffset ) ; <nl> SetInternalReference ( obj , entry , <nl> " function_data " , shared - > function_data ( ) , <nl> SharedFunctionInfo : : kFunctionDataOffset ) ; <nl> mmm a / test / cctest / heap / test - alloc . cc <nl> ppp b / test / cctest / heap / test - alloc . cc <nl> TEST ( StressJS ) { <nl> v8 : : HandleScope scope ( CcTest : : isolate ( ) ) ; <nl> v8 : : Local < v8 : : Context > env = v8 : : Context : : New ( CcTest : : isolate ( ) ) ; <nl> env - > Enter ( ) ; <nl> - Handle < JSFunction > function = <nl> - factory - > NewFunctionForTest ( factory - > function_string ( ) ) ; <nl> - / / Force the creation of an initial map and set the code to <nl> - / / something empty . <nl> + <nl> + NewFunctionArgs args = NewFunctionArgs : : ForBuiltin ( <nl> + factory - > function_string ( ) , isolate - > sloppy_function_map ( ) , <nl> + Builtins : : kEmptyFunction ) ; <nl> + Handle < JSFunction > function = factory - > NewFunction ( args ) ; <nl> + CHECK ( ! function - > shared ( ) - > construct_as_builtin ( ) ) ; <nl> + <nl> + / / Force the creation of an initial map . <nl> factory - > NewJSObject ( function ) ; <nl> - function - > set_code ( <nl> - CcTest : : i_isolate ( ) - > builtins ( ) - > builtin ( Builtins : : kEmptyFunction ) ) ; <nl> + <nl> / / Patch the map to have an accessor for " get " . <nl> Handle < Map > map ( function - > initial_map ( ) ) ; <nl> Handle < DescriptorArray > instance_descriptors ( map - > instance_descriptors ( ) ) ; <nl>
[ runtime ] Remove the construct_stub field of the SFI
v8/v8
63ecddc814fd8e9918cd5f7705bdd28316b53cd5
2018-04-04T10:12:29Z
mmm a / vs2010 / libtesseract . vcxproj <nl> ppp b / vs2010 / libtesseract . vcxproj <nl> <nl> < / ProjectReference > <nl> < Lib > <nl> < AdditionalLibraryDirectories > . . \ vs2008 \ lib < / AdditionalLibraryDirectories > <nl> - < AdditionalDependencies > ws2_32 . lib ; liblept - static - mtdll - debug . lib ; libpng - static - mtdll . lib ; libjpeg - static - mtdll . lib ; libtiff - static - mtdll . lib ; giflib - static - mtdll . lib ; % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> + < AdditionalDependencies > ws2_32 . lib ; libpng - static - mtdll . lib ; libjpeg - static - mtdll . lib ; libtiff - static - mtdll . lib ; giflib - static - mtdll . lib ; % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> < / Lib > <nl> < / ItemDefinitionGroup > <nl> < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > <nl> <nl> < / ProjectReference > <nl> < Lib > <nl> < AdditionalLibraryDirectories > . . \ vs2008 \ lib < / AdditionalLibraryDirectories > <nl> - < AdditionalDependencies > ws2_32 . lib ; liblept - static - mtdll . lib ; giflib - static - mtdll . lib ; libjpeg - static - mtdll . lib ; libpng - static - mtdll . lib ; libtiff - static - mtdll . lib ; zlib - static - mtdll . lib ; % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> + < AdditionalDependencies > ws2_32 . lib ; giflib - static - mtdll . lib ; libjpeg - static - mtdll . lib ; libpng - static - mtdll . lib ; libtiff - static - mtdll . lib ; zlib - static - mtdll . lib ; % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> < / Lib > <nl> < / ItemDefinitionGroup > <nl> < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . targets " / > <nl>
VS2010 build fix
tesseract-ocr/tesseract
22fc3e80bef50a5e67ebe8cdd62329c51a6a2fff
2011-09-05T10:05:36Z
mmm a / arangod / RocksDBEngine / RocksDBIndex . cpp <nl> ppp b / arangod / RocksDBEngine / RocksDBIndex . cpp <nl> RocksDBIndex : : ~ RocksDBIndex ( ) { <nl> <nl> void RocksDBIndex : : toVelocyPackFigures ( VPackBuilder & builder ) const { <nl> TRI_ASSERT ( builder . isOpenObject ( ) ) ; <nl> + Index : : toVelocyPackFigures ( builder ) ; <nl> + builder . add ( " cacheInUse " , VPackValue ( useCache ( ) ) ) ; <nl> if ( useCache ( ) ) { <nl> builder . add ( " cacheSize " , VPackValue ( _cache - > size ( ) ) ) ; <nl> - builder . add ( " liftimeHitRate " , VPackValue ( _cache - > hitRates ( ) . first ) ) ; <nl> - builder . add ( " windowHitRate " , VPackValue ( _cache - > hitRates ( ) . second ) ) ; <nl> + double rate = _cache - > hitRates ( ) . first ; <nl> + rate = std : : isnan ( rate ) ? 0 . 0 : rate ; <nl> + builder . add ( " cacheLiftimeHitRate " , VPackValue ( rate ) ) ; <nl> + rate = _cache - > hitRates ( ) . second ; <nl> + rate = std : : isnan ( rate ) ? 0 . 0 : rate ; <nl> + builder . add ( " cacheWindowHitRate " , VPackValue ( rate ) ) ; <nl> } else { <nl> builder . add ( " cacheSize " , VPackValue ( 0 ) ) ; <nl> } <nl> mmm a / arangod / RocksDBEngine / RocksDBPrimaryIndex . cpp <nl> ppp b / arangod / RocksDBEngine / RocksDBPrimaryIndex . cpp <nl> void RocksDBPrimaryIndex : : toVelocyPack ( VPackBuilder & builder , bool withFigures , <nl> builder . close ( ) ; <nl> } <nl> <nl> - / / / @ brief return a VelocyPack representation of the index figures <nl> - void RocksDBPrimaryIndex : : toVelocyPackFigures ( VPackBuilder & builder ) const { <nl> - Index : : toVelocyPackFigures ( builder ) ; <nl> - / / TODO : implement <nl> - } <nl> - <nl> RocksDBToken RocksDBPrimaryIndex : : lookupKey ( transaction : : Methods * trx , <nl> arangodb : : StringRef keyRef ) const { <nl> auto key = RocksDBKey : : PrimaryIndexValue ( _objectId , keyRef ) ; <nl> mmm a / arangod / RocksDBEngine / RocksDBPrimaryIndex . h <nl> ppp b / arangod / RocksDBEngine / RocksDBPrimaryIndex . h <nl> class RocksDBPrimaryIndex final : public RocksDBIndex { <nl> size_t memory ( ) const override ; <nl> <nl> void toVelocyPack ( VPackBuilder & , bool , bool ) const override ; <nl> - void toVelocyPackFigures ( VPackBuilder & ) const override ; <nl> <nl> RocksDBToken lookupKey ( transaction : : Methods * trx , <nl> arangodb : : StringRef key ) const ; <nl> mmm a / js / common / tests / shell / shell - index - figures - spec . js <nl> ppp b / js / common / tests / shell / shell - index - figures - spec . js <nl> var db = internal . db ; <nl> var expect = require ( ' chai ' ) . expect ; <nl> var should = require ( ' chai ' ) . should ( ) ; <nl> <nl> + function debugOut ( item ) { <nl> + print ( " # # # # # # # # # # # # # " ) ; <nl> + print ( item ) ; <nl> + print ( " # # # # # # # # # # # # # " ) ; <nl> + } <nl> + var isRocksDB = db . _engine ( ) . name = = = " rocksdb " ; <nl> + var isMMFiles = db . _engine ( ) . name = = = " mmfiles " ; <nl> + <nl> + function verifyMemory ( index ) { <nl> + expect ( index . figures ) . to . be . ok ; <nl> + expect ( index . figures . memory ) . to . be . a ( ' number ' ) ; <nl> + if ( isMMFiles ) { <nl> + expect ( index . figures . memory ) . to . be . a . above ( 0 ) ; <nl> + } <nl> + } <nl> + <nl> + function verifyCache ( index ) { <nl> + expect ( index . figures . cacheInUse ) . to . be . true ; <nl> + expect ( index . figures ) . to . be . ok ; <nl> + expect ( index . figures . cacheSize ) . to . be . a ( ' number ' ) ; <nl> + expect ( index . figures . cacheLiftimeHitRate ) . to . be . a ( ' number ' ) ; <nl> + expect ( index . figures . cacheWindowHitRate ) . to . be . a ( ' number ' ) ; <nl> + } <nl> + <nl> + <nl> describe ( ' Index figures ' , function ( ) { <nl> beforeEach ( function ( ) { <nl> try { <nl> describe ( ' Index figures ' , function ( ) { <nl> } ) ; <nl> <nl> / / edge index / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - describe ( ' edge index ' , function ( ) { <nl> + describe ( ' primar / edge index ' , function ( ) { <nl> var col ; <nl> before ( ' create collection ' , function ( ) { <nl> col = db . _createEdgeCollection ( " UnitTestEdgar " ) ; <nl> describe ( ' Index figures ' , function ( ) { <nl> col . insert ( { " _from " : " source / 1 " , " _to " : " sink / " + i } ) ; <nl> } <nl> } ) ; <nl> - <nl> it ( ' verify index types ' , function ( ) { <nl> var indexes = col . getIndexes ( true ) ; <nl> expect ( indexes . length ) . to . be . equal ( 2 ) ; <nl> expect ( indexes [ 0 ] . type ) . to . be . equal ( " primary " ) ; <nl> expect ( indexes [ 1 ] . type ) . to . be . equal ( " edge " ) ; <nl> } ) ; <nl> - <nl> - it . skip ( ' verify index - memory ' , function ( ) { <nl> + it ( ' verify index - memory ' , function ( ) { <nl> var indexes = col . getIndexes ( true ) ; <nl> indexes . forEach ( ( i ) = > { <nl> - expect ( i . figure ) . to . be . defined ; <nl> - expect ( i . figure , " index of type " + i . type + " does not have memory property " ) <nl> - . should . have . property ( ' memory ' ) . above ( 0 ) ; <nl> + verifyMemory ( i ) ; <nl> } ) ; <nl> } ) ; <nl> - <nl> it ( ' verify figures - cache ' , function ( ) { <nl> - if ( db . _engine ( ) . name ! = = " rocksdb " ) { <nl> + if ( ! isRocksDB ) { <nl> this . skip ( ) ; <nl> } <nl> + var indexes = col . getIndexes ( true ) ; <nl> + indexes . forEach ( ( i ) = > { <nl> + verifyCache ( i ) ; <nl> + } ) ; <nl> } ) ; <nl> - <nl> after ( function ( ) { <nl> db . _drop ( col ) ; <nl> } ) ; <nl> describe ( ' Index figures ' , function ( ) { <nl> <nl> / / hash index / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> describe ( ' hash index ' , function ( ) { <nl> + var col ; <nl> + before ( ' create collection ' , function ( ) { <nl> + col = db . _createDocumentCollection ( " UnitTestDoggy " ) ; <nl> + col . ensureIndex ( { type : " hash " , fields : [ " name " ] } ) ; <nl> + for ( var i = 0 ; i < 100 ; i + + ) { <nl> + col . insert ( { " name " : " Harry " + i } ) ; <nl> + } <nl> + } ) ; <nl> + it ( ' verify index types ' , function ( ) { <nl> + var indexes = col . getIndexes ( true ) ; <nl> + expect ( indexes . length ) . to . be . equal ( 2 ) ; <nl> + expect ( indexes [ 0 ] . type ) . to . be . equal ( " primary " ) ; <nl> + expect ( indexes [ 1 ] . type ) . to . be . equal ( " hash " ) ; <nl> + } ) ; <nl> + it ( ' verify index - memory ' , function ( ) { <nl> + var indexes = col . getIndexes ( true ) ; <nl> + indexes . forEach ( ( i ) = > { <nl> + verifyMemory ( i ) ; <nl> + } ) ; <nl> + } ) ; <nl> + / / FIXME not implemented <nl> + it . skip ( ' verify figures - cache ' , function ( ) { <nl> + if ( ! isRocksDB ) { <nl> + this . skip ( ) ; <nl> + } <nl> + var indexes = col . getIndexes ( true ) ; <nl> + indexes . forEach ( ( i ) = > { <nl> + verifyCache ( i ) ; <nl> + } ) ; <nl> + } ) ; <nl> + after ( function ( ) { <nl> + db . _drop ( col ) ; <nl> + } ) ; <nl> } ) ; / / end hash index <nl> <nl> + / / skiplist index / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + describe ( ' skiplist index ' , function ( ) { <nl> + var col ; <nl> + before ( ' create collection ' , function ( ) { <nl> + col = db . _createDocumentCollection ( " UnitTestDoggy " ) ; <nl> + col . ensureIndex ( { type : " skiplist " , fields : [ " name " ] } ) ; <nl> + for ( var i = 0 ; i < 100 ; i + + ) { <nl> + col . insert ( { " name " : " Harry " + i } ) ; <nl> + } <nl> + } ) ; <nl> + it ( ' verify index types ' , function ( ) { <nl> + var indexes = col . getIndexes ( true ) ; <nl> + expect ( indexes . length ) . to . be . equal ( 2 ) ; <nl> + expect ( indexes [ 0 ] . type ) . to . be . equal ( " primary " ) ; <nl> + expect ( indexes [ 1 ] . type ) . to . be . equal ( " skiplist " ) ; <nl> + } ) ; <nl> + it ( ' verify index - memory ' , function ( ) { <nl> + var indexes = col . getIndexes ( true ) ; <nl> + indexes . forEach ( ( i ) = > { <nl> + verifyMemory ( i ) ; <nl> + } ) ; <nl> + } ) ; <nl> + / / FIXME not implemented <nl> + it . skip ( ' verify figures - cache ' , function ( ) { <nl> + if ( ! isRocksDB ) { <nl> + this . skip ( ) ; <nl> + } <nl> + var indexes = col . getIndexes ( true ) ; <nl> + indexes . forEach ( ( i ) = > { <nl> + verifyCache ( i ) ; <nl> + } ) ; <nl> + } ) ; <nl> + after ( function ( ) { <nl> + db . _drop ( col ) ; <nl> + } ) ; <nl> + } ) ; / / end skiplist index <nl> + <nl> + / / fulltest index / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + describe ( ' fulltext index ' , function ( ) { <nl> + var col ; <nl> + before ( ' create collection ' , function ( ) { <nl> + col = db . _createDocumentCollection ( " UnitTestDoggy " ) ; <nl> + col . ensureIndex ( { type : " fulltext " , fields : [ " name " ] , minLength : 3 } ) ; <nl> + for ( var i = 0 ; i < 100 ; i + + ) { <nl> + col . insert ( { " name " : " Harry " + i } ) ; <nl> + } <nl> + } ) ; <nl> + it ( ' verify index types ' , function ( ) { <nl> + var indexes = col . getIndexes ( true ) ; <nl> + expect ( indexes . length ) . to . be . equal ( 2 ) ; <nl> + expect ( indexes [ 0 ] . type ) . to . be . equal ( " primary " ) ; <nl> + expect ( indexes [ 1 ] . type ) . to . be . equal ( " fulltext " ) ; <nl> + } ) ; <nl> + it ( ' verify index - memory ' , function ( ) { <nl> + var indexes = col . getIndexes ( true ) ; <nl> + indexes . forEach ( ( i ) = > { <nl> + verifyMemory ( i ) ; <nl> + } ) ; <nl> + } ) ; <nl> + / / FIXME not implemented <nl> + it . skip ( ' verify figures - cache ' , function ( ) { <nl> + if ( ! isRocksDB ) { <nl> + this . skip ( ) ; <nl> + } <nl> + var indexes = col . getIndexes ( true ) ; <nl> + indexes . forEach ( ( i ) = > { <nl> + verifyCache ( i ) ; <nl> + } ) ; <nl> + } ) ; <nl> + after ( function ( ) { <nl> + db . _drop ( col ) ; <nl> + } ) ; <nl> + } ) ; / / end fulltext index <nl> + <nl> + / / geo index / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + describe ( ' geo index ' , function ( ) { <nl> + var col ; <nl> + before ( ' create collection ' , function ( ) { <nl> + col = db . _createDocumentCollection ( " UnitTestGeoSpass " ) ; <nl> + col . ensureIndex ( { type : " geo " , fields : [ " loc " ] } ) ; <nl> + for ( var i = 0 ; i < 10 ; i + + ) { <nl> + for ( var j = 0 ; j < 10 ; j + + ) { <nl> + col . insert ( { " name " : " place " + i + " / " + j , <nl> + loc : [ i , j ] <nl> + } ) ; <nl> + } <nl> + } <nl> + } ) ; <nl> + it ( ' verify index types ' , function ( ) { <nl> + var indexes = col . getIndexes ( true ) ; <nl> + expect ( indexes . length ) . to . be . equal ( 2 ) ; <nl> + expect ( indexes [ 0 ] . type ) . to . be . equal ( " primary " ) ; <nl> + expect ( indexes [ 1 ] . type ) . to . be . equal ( " geo1 " ) ; <nl> + } ) ; <nl> + it ( ' verify index - memory ' , function ( ) { <nl> + var indexes = col . getIndexes ( true ) ; <nl> + indexes . forEach ( ( i ) = > { <nl> + verifyMemory ( i ) ; <nl> + } ) ; <nl> + } ) ; <nl> + / / FIXME not implemented <nl> + it . skip ( ' verify figures - cache ' , function ( ) { <nl> + if ( ! isRocksDB ) { <nl> + this . skip ( ) ; <nl> + } <nl> + var indexes = col . getIndexes ( true ) ; <nl> + indexes . forEach ( ( i ) = > { <nl> + verifyCache ( i ) ; <nl> + } ) ; <nl> + } ) ; <nl> + after ( function ( ) { <nl> + db . _drop ( col ) ; <nl> + } ) ; <nl> + } ) ; / / end fulltext index <nl> } ) ; / / end Index figures <nl>
fix figures and add tests
arangodb/arangodb
415cbfea601779ebba7e6815477158726a8fd1cc
2017-05-17T10:22:43Z
mmm a / Makefile . am <nl> ppp b / Makefile . am <nl> BISON_FILES = <nl> <nl> BISONXX_FILES = <nl> <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # @ brief protocol buffers files <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - PROTOBUF_FILES = <nl> - <nl> # # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> # # - - SECTION - - PATHS <nl> # # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> AM_CPPFLAGS = \ <nl> @ OPENSSL_CPPFLAGS @ \ <nl> @ READLINE_CPPFLAGS @ \ <nl> @ ICU_CPPFLAGS @ \ <nl> - @ PROTOBUF_CPPFLAGS @ \ <nl> @ V8_CPPFLAGS @ <nl> <nl> <nl> AM_LDFLAGS = \ <nl> @ MATH_LDFLAGS @ \ <nl> @ OPENSSL_LDFLAGS @ \ <nl> @ READLINE_LDFLAGS @ \ <nl> - @ PROTOBUF_LDFLAGS @ \ <nl> @ ICU_LDFLAGS @ \ <nl> @ V8_LDFLAGS @ <nl> <nl> LIBS = \ <nl> @ MATH_LIBS @ \ <nl> @ OPENSSL_LIBS @ \ <nl> @ ICU_LIBS @ \ <nl> - @ PROTOBUF_LIBS @ \ <nl> @ READLINE_LIBS @ <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> if ENABLE_BISON <nl> include lib / Makefile . bison <nl> endif <nl> <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # @ brief generate all protocol buffers <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - include lib / Makefile . protobuf <nl> - <nl> # # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> # # - - SECTION - - EXTERNAL LIBRARIES <nl> # # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> if ENABLE_ALL_IN_ONE_LIBEV <nl> include 3rdParty / Makefile . all - in - one - libev <nl> endif <nl> <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # @ brief protcol buffers <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - if ENABLE_ALL_IN_ONE_PROTOBUF <nl> - include 3rdParty / Makefile . all - in - one - protobuf <nl> - endif <nl> - <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # # # @ brief V8 <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> mmm a / Makefile . in <nl> ppp b / Makefile . in <nl> <nl> <nl> # - * - mode : Makefile ; - * - <nl> <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # @ brief built sources <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - # - * - mode : Makefile ; - * - <nl> - <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # # # @ brief libev <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> <nl> # - * - mode : Makefile ; - * - <nl> <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # @ brief Protobuf <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - # - * - mode : Makefile ; - * - <nl> - <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # # # @ brief V8 <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> DIST_COMMON = README $ ( am__configure_deps ) $ ( dist_man_MANS ) \ <nl> $ ( srcdir ) / 3rdParty / Makefile . all - in - one - icu \ <nl> $ ( srcdir ) / 3rdParty / Makefile . all - in - one - libev \ <nl> $ ( srcdir ) / 3rdParty / Makefile . all - in - one - mruby \ <nl> - $ ( srcdir ) / 3rdParty / Makefile . all - in - one - protobuf \ <nl> $ ( srcdir ) / 3rdParty / Makefile . all - in - one - v8 \ <nl> $ ( srcdir ) / 3rdParty / Makefile . all - in - one - zeromq \ <nl> $ ( srcdir ) / Documentation / Makefile . doxygen $ ( srcdir ) / Makefile . am \ <nl> DIST_COMMON = README $ ( am__configure_deps ) $ ( dist_man_MANS ) \ <nl> $ ( srcdir ) / arangosh / Makefile . files $ ( srcdir ) / etc / Makefile . files \ <nl> $ ( srcdir ) / js / Makefile . javascript $ ( srcdir ) / lib / Makefile . bison \ <nl> $ ( srcdir ) / lib / Makefile . files $ ( srcdir ) / lib / Makefile . flex \ <nl> - $ ( srcdir ) / lib / Makefile . protobuf $ ( srcdir ) / mr / Makefile . mruby \ <nl> - $ ( srcdir ) / utils / Makefile . files \ <nl> + $ ( srcdir ) / mr / Makefile . mruby $ ( srcdir ) / utils / Makefile . files \ <nl> $ ( top_srcdir ) / Documentation / arango . template . in \ <nl> $ ( top_srcdir ) / config / config . h . in $ ( top_srcdir ) / configure \ <nl> $ ( top_srcdir ) / lib / BasicsC / local - configuration . h . in \ <nl> DIST_COMMON = README $ ( am__configure_deps ) $ ( dist_man_MANS ) \ <nl> # # # @ brief additional files to remove <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> @ ENABLE_ALL_IN_ONE_LIBEV_TRUE @ am__append_25 = . libev - build - @ TRI_BITS @ <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ am__append_26 = @ PROTOBUF_LIBS @ <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # @ brief additional files to remove <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ am__append_27 = . protobuf - build - @ TRI_BITS @ <nl> - @ ENABLE_ALL_IN_ONE_V8_TRUE @ am__append_28 = @ V8_LIBS @ <nl> + @ ENABLE_ALL_IN_ONE_V8_TRUE @ am__append_26 = @ V8_LIBS @ <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # # # @ brief additional files to remove <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - @ ENABLE_ALL_IN_ONE_V8_TRUE @ am__append_29 = . v8 - build - @ TRI_BITS @ <nl> - @ ENABLE_MRUBY_TRUE @ am__append_30 = @ MRUBY_LIBS @ <nl> + @ ENABLE_ALL_IN_ONE_V8_TRUE @ am__append_27 = . v8 - build - @ TRI_BITS @ <nl> + @ ENABLE_MRUBY_TRUE @ am__append_28 = @ MRUBY_LIBS @ <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # # # @ brief additional files to remove <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - @ ENABLE_MRUBY_TRUE @ am__append_31 = . mruby - build - @ TRI_BITS @ <nl> - @ ENABLE_ZEROMQ_TRUE @ am__append_32 = @ ZEROMQ_LIBS @ <nl> + @ ENABLE_MRUBY_TRUE @ am__append_29 = . mruby - build - @ TRI_BITS @ <nl> + @ ENABLE_ZEROMQ_TRUE @ am__append_30 = @ ZEROMQ_LIBS @ <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # # # @ brief additional files to remove <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - @ ENABLE_ZEROMQ_TRUE @ am__append_33 = . zeromq - build - @ TRI_BITS @ . czmq - build - @ TRI_BITS @ <nl> - @ ENABLE_ALL_IN_ONE_ICU_TRUE @ am__append_34 = @ ICU_LIBS @ <nl> + @ ENABLE_ZEROMQ_TRUE @ am__append_31 = . zeromq - build - @ TRI_BITS @ . czmq - build - @ TRI_BITS @ <nl> + @ ENABLE_ALL_IN_ONE_ICU_TRUE @ am__append_32 = @ ICU_LIBS @ <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # # # @ brief additional files to remove <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - @ ENABLE_ALL_IN_ONE_ICU_TRUE @ am__append_35 = . icu - build - @ TRI_BITS @ <nl> + @ ENABLE_ALL_IN_ONE_ICU_TRUE @ am__append_33 = . icu - build - @ TRI_BITS @ <nl> subdir = . <nl> ACLOCAL_M4 = $ ( top_srcdir ) / aclocal . m4 <nl> am__aclocal_m4_deps = $ ( top_srcdir ) / m4 / acx_pthread . m4 \ <nl> am__aclocal_m4_deps = $ ( top_srcdir ) / m4 / acx_pthread . m4 \ <nl> $ ( top_srcdir ) / m4 / all - in - one . libev \ <nl> $ ( top_srcdir ) / m4 / external . libev \ <nl> $ ( top_srcdir ) / m4 / all - in - one . mruby \ <nl> - $ ( top_srcdir ) / m4 / all - in - one . protobuf \ <nl> - $ ( top_srcdir ) / m4 / external . protobuf \ <nl> $ ( top_srcdir ) / m4 / all - in - one . v8 $ ( top_srcdir ) / m4 / external . v8 \ <nl> $ ( top_srcdir ) / m4 / all - in - one . zeromq \ <nl> $ ( top_srcdir ) / m4 / all - in - one . icu $ ( top_srcdir ) / m4 / external . icu \ <nl> am__lib_libarango_a_SOURCES_DIST = lib / Basics / ConditionLocker . cpp \ <nl> lib / Logger / Logger . cpp lib / Logger / LoggerData . cpp \ <nl> lib / Logger / LoggerInfo . cpp lib / Logger / LoggerStream . cpp \ <nl> lib / Logger / LoggerTiming . cpp \ <nl> - lib / ProgramOptions / program - options . c \ <nl> - lib / ProtocolBuffers / HttpRequestProtobuf . cpp \ <nl> - lib / ProtocolBuffers / arangodb . pb . cpp lib / Rest / AnyServer . cpp \ <nl> + lib / ProgramOptions / program - options . c lib / Rest / AnyServer . cpp \ <nl> lib / Rest / EndpointList . cpp lib / Rest / Endpoint . cpp \ <nl> lib / Rest / Handler . cpp lib / Rest / HttpRequest . cpp \ <nl> lib / Rest / HttpRequestPlain . cpp lib / Rest / HttpResponse . cpp \ <nl> am_lib_libarango_a_OBJECTS = lib / Basics / ConditionLocker . $ ( OBJEXT ) \ <nl> lib / Logger / LoggerStream . $ ( OBJEXT ) \ <nl> lib / Logger / LoggerTiming . $ ( OBJEXT ) \ <nl> lib / ProgramOptions / program - options . $ ( OBJEXT ) \ <nl> - lib / ProtocolBuffers / HttpRequestProtobuf . $ ( OBJEXT ) \ <nl> - lib / ProtocolBuffers / arangodb . pb . $ ( OBJEXT ) \ <nl> lib / Rest / AnyServer . $ ( OBJEXT ) lib / Rest / EndpointList . $ ( OBJEXT ) \ <nl> lib / Rest / Endpoint . $ ( OBJEXT ) lib / Rest / Handler . $ ( OBJEXT ) \ <nl> lib / Rest / HttpRequest . $ ( OBJEXT ) \ <nl> am_lib_libarango_client_a_OBJECTS = \ <nl> lib / SimpleHttpClient / ClientConnection . $ ( OBJEXT ) \ <nl> lib / SimpleHttpClient / SslClientConnection . $ ( OBJEXT ) \ <nl> lib / SimpleHttpClient / SimpleClient . $ ( OBJEXT ) \ <nl> - lib / SimpleHttpClient / SimpleBinaryClient . $ ( OBJEXT ) \ <nl> lib / SimpleHttpClient / SimpleHttpClient . $ ( OBJEXT ) \ <nl> lib / SimpleHttpClient / SimpleHttpResult . $ ( OBJEXT ) <nl> lib_libarango_client_a_OBJECTS = $ ( am_lib_libarango_client_a_OBJECTS ) <nl> LIBOBJS = @ LIBOBJS @ <nl> # # # @ brief libraries <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> LIBS = @ BOOST_LIBS @ @ LIBEV_LIBS @ @ MATH_LIBS @ @ OPENSSL_LIBS @ @ ICU_LIBS @ \ <nl> - @ PROTOBUF_LIBS @ @ READLINE_LIBS @ $ ( am__append_6 ) <nl> + @ READLINE_LIBS @ $ ( am__append_6 ) <nl> LN_S = @ LN_S @ <nl> LTLIBOBJS = @ LTLIBOBJS @ <nl> MAKEINFO = @ MAKEINFO @ <nl> PACKAGE_TARNAME = @ PACKAGE_TARNAME @ <nl> PACKAGE_URL = @ PACKAGE_URL @ <nl> PACKAGE_VERSION = @ PACKAGE_VERSION @ <nl> PATH_SEPARATOR = @ PATH_SEPARATOR @ <nl> - PROTOBUF_CPPFLAGS = @ PROTOBUF_CPPFLAGS @ <nl> - PROTOBUF_LDFLAGS = @ PROTOBUF_LDFLAGS @ <nl> - PROTOBUF_LIBS = @ PROTOBUF_LIBS @ <nl> - PROTOBUF_PROTOC = @ PROTOBUF_PROTOC @ <nl> PTHREAD_CC = @ PTHREAD_CC @ <nl> PTHREAD_CFLAGS = @ PTHREAD_CFLAGS @ <nl> PTHREAD_LIBS = @ PTHREAD_LIBS @ <nl> BUILT_SOURCES = build . h $ ( JAVASCRIPT_HEADER ) $ ( JAVASCRIPT_BROWSER ) \ <nl> $ ( am__append_16 ) Doxygen / . setup - directories \ <nl> @ builddir @ / . setup - js - directories $ ( am__append_17 ) \ <nl> $ ( am__append_19 ) $ ( am__append_20 ) $ ( am__append_22 ) \ <nl> - $ ( PROTOBUF_FILES ) $ ( am__append_24 ) $ ( am__append_26 ) \ <nl> - $ ( am__append_28 ) $ ( am__append_30 ) $ ( am__append_32 ) \ <nl> - $ ( am__append_34 ) <nl> + $ ( am__append_24 ) $ ( am__append_26 ) $ ( am__append_28 ) \ <nl> + $ ( am__append_30 ) $ ( am__append_32 ) <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # # # @ brief man pages to install <nl> CLEANUP = . setup - js - directories . setup - mr - directories $ ( am__append_14 ) \ <nl> Doxygen / . setup - directories $ ( JAVASCRIPT_HEADER ) \ <nl> . setup - js - directories $ ( am__append_18 ) $ ( am__append_21 ) \ <nl> $ ( am__append_23 ) $ ( am__append_25 ) $ ( am__append_27 ) \ <nl> - $ ( am__append_29 ) $ ( am__append_31 ) $ ( am__append_33 ) \ <nl> - $ ( am__append_35 ) <nl> + $ ( am__append_29 ) $ ( am__append_31 ) $ ( am__append_33 ) <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # # # @ brief flex files <nl> BISON_FILES = arangod / Ahuacatl / ahuacatl - grammar . c <nl> # # # @ brief bison + + files <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> BISONXX_FILES = <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # @ brief protocol buffers files <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # @ brief protocol buffers <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - PROTOBUF_FILES = lib / ProtocolBuffers / arangodb . pb . cpp <nl> @ ENABLE_RELATIVE_FALSE @ TRI_DATABASEDIR = $ { localstatedir } / lib / $ { PACKAGE_TARNAME } <nl> @ ENABLE_RELATIVE_TRUE @ TRI_DATABASEDIR = <nl> @ ENABLE_RELATIVE_FALSE @ TRI_LOGDIR = $ { localstatedir } / log / $ { PACKAGE_TARNAME } <nl> ACLOCAL_AMFLAGS = - I m4 <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> AM_CPPFLAGS = - I @ top_srcdir @ / lib - I @ top_builddir @ / lib @ BOOST_CPPFLAGS @ \ <nl> @ LIBEV_CPPFLAGS @ @ MATH_CPPFLAGS @ @ OPENSSL_CPPFLAGS @ \ <nl> - @ READLINE_CPPFLAGS @ @ ICU_CPPFLAGS @ @ PROTOBUF_CPPFLAGS @ \ <nl> - @ V8_CPPFLAGS @ $ ( am__append_1 ) $ ( am__append_2 ) $ ( am__append_3 ) \ <nl> + @ READLINE_CPPFLAGS @ @ ICU_CPPFLAGS @ @ V8_CPPFLAGS @ \ <nl> + $ ( am__append_1 ) $ ( am__append_2 ) $ ( am__append_3 ) \ <nl> $ ( am__append_5 ) <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # # # @ brief linker flags <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> AM_LDFLAGS = @ BOOST_LDFLAGS @ @ LIBEV_LDFLAGS @ @ MATH_LDFLAGS @ \ <nl> - @ OPENSSL_LDFLAGS @ @ READLINE_LDFLAGS @ @ PROTOBUF_LDFLAGS @ \ <nl> - @ ICU_LDFLAGS @ @ V8_LDFLAGS @ $ ( am__append_4 ) <nl> + @ OPENSSL_LDFLAGS @ @ READLINE_LDFLAGS @ @ ICU_LDFLAGS @ \ <nl> + @ V8_LDFLAGS @ $ ( am__append_4 ) <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # # # @ brief auxiliary libraries <nl> lib_libarango_a_SOURCES = lib / Basics / ConditionLocker . cpp \ <nl> lib / Logger / Logger . cpp lib / Logger / LoggerData . cpp \ <nl> lib / Logger / LoggerInfo . cpp lib / Logger / LoggerStream . cpp \ <nl> lib / Logger / LoggerTiming . cpp \ <nl> - lib / ProgramOptions / program - options . c \ <nl> - lib / ProtocolBuffers / HttpRequestProtobuf . cpp \ <nl> - lib / ProtocolBuffers / arangodb . pb . cpp lib / Rest / AnyServer . cpp \ <nl> + lib / ProgramOptions / program - options . c lib / Rest / AnyServer . cpp \ <nl> lib / Rest / EndpointList . cpp lib / Rest / Endpoint . cpp \ <nl> lib / Rest / Handler . cpp lib / Rest / HttpRequest . cpp \ <nl> lib / Rest / HttpRequestPlain . cpp lib / Rest / HttpResponse . cpp \ <nl> lib_libarango_client_a_SOURCES = \ <nl> lib / SimpleHttpClient / ClientConnection . cpp \ <nl> lib / SimpleHttpClient / SslClientConnection . cpp \ <nl> lib / SimpleHttpClient / SimpleClient . cpp \ <nl> - lib / SimpleHttpClient / SimpleBinaryClient . cpp \ <nl> lib / SimpleHttpClient / SimpleHttpClient . cpp \ <nl> lib / SimpleHttpClient / SimpleHttpResult . cpp <nl> <nl> UNITTESTS_SERVER_BITARRAY = $ ( addprefix - - javascript . unit - tests , $ ( BITARRAY_COMM <nl> # # # @ brief tags file <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> GTAGS_FILES = $ ( sort $ ( abspath $ ( SOURCES ) $ ( HEADERS ) ) ) <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ PROTOBUFDIR = @ abs_top_srcdir @ / 3rdParty / protobuf - 2 . 4 . 1 / BUILD <nl> @ ENABLE_ZEROMQ_TRUE @ ZMQDIR = @ abs_top_srcdir @ / 3rdParty / zeromq - 2 . 2 . 0 / BUILD <nl> @ ENABLE_ALL_IN_ONE_ICU_TRUE @ ICUDIR = @ abs_top_srcdir @ / 3rdParty / icu / BUILD <nl> all : $ ( BUILT_SOURCES ) <nl> all : $ ( BUILT_SOURCES ) <nl> . SUFFIXES : . c . cpp . o . obj <nl> am - - refresh : <nl> @ : <nl> - $ ( srcdir ) / Makefile . in : $ ( srcdir ) / Makefile . am $ ( srcdir ) / Makefile . files $ ( srcdir ) / lib / Makefile . files $ ( srcdir ) / arangod / Makefile . files $ ( srcdir ) / arangosh / Makefile . files $ ( srcdir ) / etc / Makefile . files $ ( srcdir ) / utils / Makefile . files $ ( srcdir ) / arangoirb / Makefile . files $ ( srcdir ) / UnitTests / Makefile . files $ ( srcdir ) / Documentation / Makefile . doxygen $ ( srcdir ) / js / Makefile . javascript $ ( srcdir ) / mr / Makefile . mruby $ ( srcdir ) / lib / Makefile . flex $ ( srcdir ) / lib / Makefile . bison $ ( srcdir ) / lib / Makefile . protobuf $ ( srcdir ) / 3rdParty / Makefile . all - in - one - libev $ ( srcdir ) / 3rdParty / Makefile . all - in - one - protobuf $ ( srcdir ) / 3rdParty / Makefile . all - in - one - v8 $ ( srcdir ) / 3rdParty / Makefile . all - in - one - mruby $ ( srcdir ) / 3rdParty / Makefile . all - in - one - zeromq $ ( srcdir ) / 3rdParty / Makefile . all - in - one - icu $ ( am__configure_deps ) <nl> + $ ( srcdir ) / Makefile . in : $ ( srcdir ) / Makefile . am $ ( srcdir ) / Makefile . files $ ( srcdir ) / lib / Makefile . files $ ( srcdir ) / arangod / Makefile . files $ ( srcdir ) / arangosh / Makefile . files $ ( srcdir ) / etc / Makefile . files $ ( srcdir ) / utils / Makefile . files $ ( srcdir ) / arangoirb / Makefile . files $ ( srcdir ) / UnitTests / Makefile . files $ ( srcdir ) / Documentation / Makefile . doxygen $ ( srcdir ) / js / Makefile . javascript $ ( srcdir ) / mr / Makefile . mruby $ ( srcdir ) / lib / Makefile . flex $ ( srcdir ) / lib / Makefile . bison $ ( srcdir ) / 3rdParty / Makefile . all - in - one - libev $ ( srcdir ) / 3rdParty / Makefile . all - in - one - v8 $ ( srcdir ) / 3rdParty / Makefile . all - in - one - mruby $ ( srcdir ) / 3rdParty / Makefile . all - in - one - zeromq $ ( srcdir ) / 3rdParty / Makefile . all - in - one - icu $ ( am__configure_deps ) <nl> @ for dep in $ ? ; do \ <nl> case ' $ ( am__configure_deps ) ' in \ <nl> * $ $ dep * ) \ <nl> lib / ProgramOptions / $ ( DEPDIR ) / $ ( am__dirstamp ) : <nl> lib / ProgramOptions / program - options . $ ( OBJEXT ) : \ <nl> lib / ProgramOptions / $ ( am__dirstamp ) \ <nl> lib / ProgramOptions / $ ( DEPDIR ) / $ ( am__dirstamp ) <nl> - lib / ProtocolBuffers / $ ( am__dirstamp ) : <nl> - @ $ ( MKDIR_P ) lib / ProtocolBuffers <nl> - @ : > lib / ProtocolBuffers / $ ( am__dirstamp ) <nl> - lib / ProtocolBuffers / $ ( DEPDIR ) / $ ( am__dirstamp ) : <nl> - @ $ ( MKDIR_P ) lib / ProtocolBuffers / $ ( DEPDIR ) <nl> - @ : > lib / ProtocolBuffers / $ ( DEPDIR ) / $ ( am__dirstamp ) <nl> - lib / ProtocolBuffers / HttpRequestProtobuf . $ ( OBJEXT ) : \ <nl> - lib / ProtocolBuffers / $ ( am__dirstamp ) \ <nl> - lib / ProtocolBuffers / $ ( DEPDIR ) / $ ( am__dirstamp ) <nl> - lib / ProtocolBuffers / arangodb . pb . $ ( OBJEXT ) : \ <nl> - lib / ProtocolBuffers / $ ( am__dirstamp ) \ <nl> - lib / ProtocolBuffers / $ ( DEPDIR ) / $ ( am__dirstamp ) <nl> lib / Rest / $ ( am__dirstamp ) : <nl> @ $ ( MKDIR_P ) lib / Rest <nl> @ : > lib / Rest / $ ( am__dirstamp ) <nl> lib / SimpleHttpClient / SslClientConnection . $ ( OBJEXT ) : \ <nl> lib / SimpleHttpClient / SimpleClient . $ ( OBJEXT ) : \ <nl> lib / SimpleHttpClient / $ ( am__dirstamp ) \ <nl> lib / SimpleHttpClient / $ ( DEPDIR ) / $ ( am__dirstamp ) <nl> - lib / SimpleHttpClient / SimpleBinaryClient . $ ( OBJEXT ) : \ <nl> - lib / SimpleHttpClient / $ ( am__dirstamp ) \ <nl> - lib / SimpleHttpClient / $ ( DEPDIR ) / $ ( am__dirstamp ) <nl> lib / SimpleHttpClient / SimpleHttpClient . $ ( OBJEXT ) : \ <nl> lib / SimpleHttpClient / $ ( am__dirstamp ) \ <nl> lib / SimpleHttpClient / $ ( DEPDIR ) / $ ( am__dirstamp ) <nl> mostlyclean - compile : <nl> - rm - f lib / MRuby / MRLoader . $ ( OBJEXT ) <nl> - rm - f lib / MRuby / mr - utils . $ ( OBJEXT ) <nl> - rm - f lib / ProgramOptions / program - options . $ ( OBJEXT ) <nl> - - rm - f lib / ProtocolBuffers / HttpRequestProtobuf . $ ( OBJEXT ) <nl> - - rm - f lib / ProtocolBuffers / arangodb . pb . $ ( OBJEXT ) <nl> - rm - f lib / Rest / AnyServer . $ ( OBJEXT ) <nl> - rm - f lib / Rest / Endpoint . $ ( OBJEXT ) <nl> - rm - f lib / Rest / EndpointList . $ ( OBJEXT ) <nl> mostlyclean - compile : <nl> - rm - f lib / ShapedJson / shaped - json . $ ( OBJEXT ) <nl> - rm - f lib / SimpleHttpClient / ClientConnection . $ ( OBJEXT ) <nl> - rm - f lib / SimpleHttpClient / GeneralClientConnection . $ ( OBJEXT ) <nl> - - rm - f lib / SimpleHttpClient / SimpleBinaryClient . $ ( OBJEXT ) <nl> - rm - f lib / SimpleHttpClient / SimpleClient . $ ( OBJEXT ) <nl> - rm - f lib / SimpleHttpClient / SimpleHttpClient . $ ( OBJEXT ) <nl> - rm - f lib / SimpleHttpClient / SimpleHttpResult . $ ( OBJEXT ) <nl> distclean - compile : <nl> @ AMDEP_TRUE @ @ am__include @ @ am__quote @ lib / MRuby / $ ( DEPDIR ) / MRLoader . Po @ am__quote @ <nl> @ AMDEP_TRUE @ @ am__include @ @ am__quote @ lib / MRuby / $ ( DEPDIR ) / mr - utils . Po @ am__quote @ <nl> @ AMDEP_TRUE @ @ am__include @ @ am__quote @ lib / ProgramOptions / $ ( DEPDIR ) / program - options . Po @ am__quote @ <nl> - @ AMDEP_TRUE @ @ am__include @ @ am__quote @ lib / ProtocolBuffers / $ ( DEPDIR ) / HttpRequestProtobuf . Po @ am__quote @ <nl> - @ AMDEP_TRUE @ @ am__include @ @ am__quote @ lib / ProtocolBuffers / $ ( DEPDIR ) / arangodb . pb . Po @ am__quote @ <nl> @ AMDEP_TRUE @ @ am__include @ @ am__quote @ lib / Rest / $ ( DEPDIR ) / AnyServer . Po @ am__quote @ <nl> @ AMDEP_TRUE @ @ am__include @ @ am__quote @ lib / Rest / $ ( DEPDIR ) / Endpoint . Po @ am__quote @ <nl> @ AMDEP_TRUE @ @ am__include @ @ am__quote @ lib / Rest / $ ( DEPDIR ) / EndpointList . Po @ am__quote @ <nl> distclean - compile : <nl> @ AMDEP_TRUE @ @ am__include @ @ am__quote @ lib / ShapedJson / $ ( DEPDIR ) / shaped - json . Po @ am__quote @ <nl> @ AMDEP_TRUE @ @ am__include @ @ am__quote @ lib / SimpleHttpClient / $ ( DEPDIR ) / ClientConnection . Po @ am__quote @ <nl> @ AMDEP_TRUE @ @ am__include @ @ am__quote @ lib / SimpleHttpClient / $ ( DEPDIR ) / GeneralClientConnection . Po @ am__quote @ <nl> - @ AMDEP_TRUE @ @ am__include @ @ am__quote @ lib / SimpleHttpClient / $ ( DEPDIR ) / SimpleBinaryClient . Po @ am__quote @ <nl> @ AMDEP_TRUE @ @ am__include @ @ am__quote @ lib / SimpleHttpClient / $ ( DEPDIR ) / SimpleClient . Po @ am__quote @ <nl> @ AMDEP_TRUE @ @ am__include @ @ am__quote @ lib / SimpleHttpClient / $ ( DEPDIR ) / SimpleHttpClient . Po @ am__quote @ <nl> @ AMDEP_TRUE @ @ am__include @ @ am__quote @ lib / SimpleHttpClient / $ ( DEPDIR ) / SimpleHttpResult . Po @ am__quote @ <nl> distclean - generic : <nl> - rm - f lib / MRuby / $ ( am__dirstamp ) <nl> - rm - f lib / ProgramOptions / $ ( DEPDIR ) / $ ( am__dirstamp ) <nl> - rm - f lib / ProgramOptions / $ ( am__dirstamp ) <nl> - - rm - f lib / ProtocolBuffers / $ ( DEPDIR ) / $ ( am__dirstamp ) <nl> - - rm - f lib / ProtocolBuffers / $ ( am__dirstamp ) <nl> - rm - f lib / Rest / $ ( DEPDIR ) / $ ( am__dirstamp ) <nl> - rm - f lib / Rest / $ ( am__dirstamp ) <nl> - rm - f lib / ResultGenerator / $ ( DEPDIR ) / $ ( am__dirstamp ) <nl> clean - am : clean - binPROGRAMS clean - generic clean - local \ <nl> <nl> distclean : distclean - am <nl> - rm - f $ ( am__CONFIG_DISTCLEAN_FILES ) <nl> - - rm - rf UnitTests / $ ( DEPDIR ) UnitTests / Cambridge / $ ( DEPDIR ) UnitTests / Jutland / $ ( DEPDIR ) UnitTests / Philadelphia / $ ( DEPDIR ) arangod / Actions / $ ( DEPDIR ) arangod / Ahuacatl / $ ( DEPDIR ) arangod / BitIndexes / $ ( DEPDIR ) arangod / GeoIndex / $ ( DEPDIR ) arangod / HashIndex / $ ( DEPDIR ) arangod / IndexIterators / $ ( DEPDIR ) arangod / IndexOperators / $ ( DEPDIR ) arangod / MRServer / $ ( DEPDIR ) arangod / PriorityQueue / $ ( DEPDIR ) arangod / RestHandler / $ ( DEPDIR ) arangod / RestServer / $ ( DEPDIR ) arangod / SkipLists / $ ( DEPDIR ) arangod / V8Server / $ ( DEPDIR ) arangod / VocBase / $ ( DEPDIR ) arangoirb / MRClient / $ ( DEPDIR ) arangosh / ArangoShell / $ ( DEPDIR ) arangosh / V8Client / $ ( DEPDIR ) lib / Admin / $ ( DEPDIR ) lib / ApplicationServer / $ ( DEPDIR ) lib / Basics / $ ( DEPDIR ) lib / BasicsC / $ ( DEPDIR ) lib / Dispatcher / $ ( DEPDIR ) lib / HttpServer / $ ( DEPDIR ) lib / JsonParser / $ ( DEPDIR ) lib / Logger / $ ( DEPDIR ) lib / MRuby / $ ( DEPDIR ) lib / ProgramOptions / $ ( DEPDIR ) lib / ProtocolBuffers / $ ( DEPDIR ) lib / Rest / $ ( DEPDIR ) lib / ResultGenerator / $ ( DEPDIR ) lib / Scheduler / $ ( DEPDIR ) lib / ShapedJson / $ ( DEPDIR ) lib / SimpleHttpClient / $ ( DEPDIR ) lib / Statistics / $ ( DEPDIR ) lib / Utilities / $ ( DEPDIR ) lib / V8 / $ ( DEPDIR ) lib / Variant / $ ( DEPDIR ) lib / ZeroMQ / $ ( DEPDIR ) <nl> + - rm - rf UnitTests / $ ( DEPDIR ) UnitTests / Cambridge / $ ( DEPDIR ) UnitTests / Jutland / $ ( DEPDIR ) UnitTests / Philadelphia / $ ( DEPDIR ) arangod / Actions / $ ( DEPDIR ) arangod / Ahuacatl / $ ( DEPDIR ) arangod / BitIndexes / $ ( DEPDIR ) arangod / GeoIndex / $ ( DEPDIR ) arangod / HashIndex / $ ( DEPDIR ) arangod / IndexIterators / $ ( DEPDIR ) arangod / IndexOperators / $ ( DEPDIR ) arangod / MRServer / $ ( DEPDIR ) arangod / PriorityQueue / $ ( DEPDIR ) arangod / RestHandler / $ ( DEPDIR ) arangod / RestServer / $ ( DEPDIR ) arangod / SkipLists / $ ( DEPDIR ) arangod / V8Server / $ ( DEPDIR ) arangod / VocBase / $ ( DEPDIR ) arangoirb / MRClient / $ ( DEPDIR ) arangosh / ArangoShell / $ ( DEPDIR ) arangosh / V8Client / $ ( DEPDIR ) lib / Admin / $ ( DEPDIR ) lib / ApplicationServer / $ ( DEPDIR ) lib / Basics / $ ( DEPDIR ) lib / BasicsC / $ ( DEPDIR ) lib / Dispatcher / $ ( DEPDIR ) lib / HttpServer / $ ( DEPDIR ) lib / JsonParser / $ ( DEPDIR ) lib / Logger / $ ( DEPDIR ) lib / MRuby / $ ( DEPDIR ) lib / ProgramOptions / $ ( DEPDIR ) lib / Rest / $ ( DEPDIR ) lib / ResultGenerator / $ ( DEPDIR ) lib / Scheduler / $ ( DEPDIR ) lib / ShapedJson / $ ( DEPDIR ) lib / SimpleHttpClient / $ ( DEPDIR ) lib / Statistics / $ ( DEPDIR ) lib / Utilities / $ ( DEPDIR ) lib / V8 / $ ( DEPDIR ) lib / Variant / $ ( DEPDIR ) lib / ZeroMQ / $ ( DEPDIR ) <nl> - rm - f Makefile <nl> distclean - am : clean - am distclean - compile distclean - generic \ <nl> distclean - hdr distclean - tags <nl> installcheck - am : <nl> maintainer - clean : maintainer - clean - am <nl> - rm - f $ ( am__CONFIG_DISTCLEAN_FILES ) <nl> - rm - rf $ ( top_srcdir ) / autom4te . cache <nl> - - rm - rf UnitTests / $ ( DEPDIR ) UnitTests / Cambridge / $ ( DEPDIR ) UnitTests / Jutland / $ ( DEPDIR ) UnitTests / Philadelphia / $ ( DEPDIR ) arangod / Actions / $ ( DEPDIR ) arangod / Ahuacatl / $ ( DEPDIR ) arangod / BitIndexes / $ ( DEPDIR ) arangod / GeoIndex / $ ( DEPDIR ) arangod / HashIndex / $ ( DEPDIR ) arangod / IndexIterators / $ ( DEPDIR ) arangod / IndexOperators / $ ( DEPDIR ) arangod / MRServer / $ ( DEPDIR ) arangod / PriorityQueue / $ ( DEPDIR ) arangod / RestHandler / $ ( DEPDIR ) arangod / RestServer / $ ( DEPDIR ) arangod / SkipLists / $ ( DEPDIR ) arangod / V8Server / $ ( DEPDIR ) arangod / VocBase / $ ( DEPDIR ) arangoirb / MRClient / $ ( DEPDIR ) arangosh / ArangoShell / $ ( DEPDIR ) arangosh / V8Client / $ ( DEPDIR ) lib / Admin / $ ( DEPDIR ) lib / ApplicationServer / $ ( DEPDIR ) lib / Basics / $ ( DEPDIR ) lib / BasicsC / $ ( DEPDIR ) lib / Dispatcher / $ ( DEPDIR ) lib / HttpServer / $ ( DEPDIR ) lib / JsonParser / $ ( DEPDIR ) lib / Logger / $ ( DEPDIR ) lib / MRuby / $ ( DEPDIR ) lib / ProgramOptions / $ ( DEPDIR ) lib / ProtocolBuffers / $ ( DEPDIR ) lib / Rest / $ ( DEPDIR ) lib / ResultGenerator / $ ( DEPDIR ) lib / Scheduler / $ ( DEPDIR ) lib / ShapedJson / $ ( DEPDIR ) lib / SimpleHttpClient / $ ( DEPDIR ) lib / Statistics / $ ( DEPDIR ) lib / Utilities / $ ( DEPDIR ) lib / V8 / $ ( DEPDIR ) lib / Variant / $ ( DEPDIR ) lib / ZeroMQ / $ ( DEPDIR ) <nl> + - rm - rf UnitTests / $ ( DEPDIR ) UnitTests / Cambridge / $ ( DEPDIR ) UnitTests / Jutland / $ ( DEPDIR ) UnitTests / Philadelphia / $ ( DEPDIR ) arangod / Actions / $ ( DEPDIR ) arangod / Ahuacatl / $ ( DEPDIR ) arangod / BitIndexes / $ ( DEPDIR ) arangod / GeoIndex / $ ( DEPDIR ) arangod / HashIndex / $ ( DEPDIR ) arangod / IndexIterators / $ ( DEPDIR ) arangod / IndexOperators / $ ( DEPDIR ) arangod / MRServer / $ ( DEPDIR ) arangod / PriorityQueue / $ ( DEPDIR ) arangod / RestHandler / $ ( DEPDIR ) arangod / RestServer / $ ( DEPDIR ) arangod / SkipLists / $ ( DEPDIR ) arangod / V8Server / $ ( DEPDIR ) arangod / VocBase / $ ( DEPDIR ) arangoirb / MRClient / $ ( DEPDIR ) arangosh / ArangoShell / $ ( DEPDIR ) arangosh / V8Client / $ ( DEPDIR ) lib / Admin / $ ( DEPDIR ) lib / ApplicationServer / $ ( DEPDIR ) lib / Basics / $ ( DEPDIR ) lib / BasicsC / $ ( DEPDIR ) lib / Dispatcher / $ ( DEPDIR ) lib / HttpServer / $ ( DEPDIR ) lib / JsonParser / $ ( DEPDIR ) lib / Logger / $ ( DEPDIR ) lib / MRuby / $ ( DEPDIR ) lib / ProgramOptions / $ ( DEPDIR ) lib / Rest / $ ( DEPDIR ) lib / ResultGenerator / $ ( DEPDIR ) lib / Scheduler / $ ( DEPDIR ) lib / ShapedJson / $ ( DEPDIR ) lib / SimpleHttpClient / $ ( DEPDIR ) lib / Statistics / $ ( DEPDIR ) lib / Utilities / $ ( DEPDIR ) lib / V8 / $ ( DEPDIR ) lib / Variant / $ ( DEPDIR ) lib / ZeroMQ / $ ( DEPDIR ) <nl> - rm - f Makefile <nl> maintainer - clean - am : distclean - am maintainer - clean - generic <nl> <nl> js / server / js - % . h : @ srcdir @ / js / server / % . js . setup - js - directories <nl> @ ENABLE_BISON_TRUE @ % . cpp : % . yy <nl> @ ENABLE_BISON_TRUE @ @ top_srcdir @ / config / bison - c + + . sh $ ( BISON ) $ @ $ < <nl> <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # @ brief protocol buffers <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - % . pb . cpp : % . proto @ PROTOBUF_PROTOC @ <nl> - @ PROTOBUF_PROTOC @ - - cpp_out . $ < <nl> - mv $ ( addsuffix . cc , $ ( basename $ @ ) ) $ @ <nl> - <nl> @ ENABLE_ALL_IN_ONE_LIBEV_TRUE @ @ LIBEV_LIBS @ : @ srcdir @ / . libev - build - @ TRI_BITS @ <nl> <nl> @ ENABLE_ALL_IN_ONE_LIBEV_TRUE @ @ srcdir @ / . libev - build - @ TRI_BITS @ : <nl> js / server / js - % . h : @ srcdir @ / js / server / % . js . setup - js - directories <nl> @ ENABLE_ALL_IN_ONE_LIBEV_TRUE @ @ echo " mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - " <nl> @ ENABLE_ALL_IN_ONE_LIBEV_TRUE @ @ echo <nl> <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ @ PROTOBUF_LIBS @ : @ srcdir @ / . protobuf - build - @ TRI_BITS @ <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ @ PROTOBUF_PROTOC @ : @ srcdir @ / . protobuf - build - @ TRI_BITS @ <nl> - <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ @ srcdir @ / . protobuf - build - @ TRI_BITS @ : <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ @ echo <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ @ echo " mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - " <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ @ echo " BUILDING Protocol Buffers " <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ @ echo " mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - " <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ @ echo <nl> - <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ cd @ top_srcdir @ / 3rdParty / protobuf - 2 . 4 . 1 \ <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ & & . / configure \ <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ - - disable - dependency - tracking \ <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ - - disable - shared \ <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ - - prefix = $ ( PROTOBUFDIR ) \ <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ - - libdir = $ ( PROTOBUFDIR ) / lib @ TRI_BITS @ <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ cd @ top_srcdir @ / 3rdParty / protobuf - 2 . 4 . 1 & & $ ( MAKE ) install <nl> - <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ touch @ srcdir @ / . protobuf - build - @ TRI_BITS @ <nl> - <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ @ echo <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ @ echo " mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - " <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ @ echo " BUILD Protocol Buffers FINISHED " <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ @ echo " mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - " <nl> - @ ENABLE_ALL_IN_ONE_PROTOBUF_TRUE @ @ echo <nl> - <nl> @ ENABLE_ALL_IN_ONE_V8_TRUE @ @ V8_LIBS @ : @ srcdir @ / . v8 - build - @ TRI_BITS @ <nl> <nl> @ ENABLE_ALL_IN_ONE_V8_TRUE @ @ srcdir @ / . v8 - build - @ TRI_BITS @ : <nl> js / server / js - % . h : @ srcdir @ / js / server / % . js . setup - js - directories <nl> # # # @ brief generate all bison files <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # @ brief generate all protocol buffers <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # # # @ brief libev <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # @ brief protcol buffers <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # # # @ brief V8 <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> mmm a / UnitTests / Jutland / EndpointTest . cpp <nl> ppp b / UnitTests / Jutland / EndpointTest . cpp <nl> BOOST_AUTO_TEST_CASE ( EndpointSpecification ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / localhost " , Specification , " tcp : / / localhost " ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " SSL : / / 127 . 0 . 0 . 5 " , Specification , " SSL : / / 127 . 0 . 0 . 5 " ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " httP @ ssl : / / localhost : 4635 " , Specification , " httP @ ssl : / / localhost : 4635 " ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " BinArY @ tCp : / / 42 . 26 . 92 . 94 : 424 " , Specification , " BinArY @ tCp : / / 42 . 26 . 92 . 94 : 424 " ) ; <nl> CHECK_ENDPOINT_FEATURE ( server , " unix : / / / path / to / socket " , Specification , " unix : / / / path / to / socket " ) ; <nl> - CHECK_ENDPOINT_FEATURE ( server , " biNaRY @ UNIx : / / / a / b / c / d / e / f . s " , Specification , " biNaRY @ UNIx : / / / a / b / c / d / e / f . s " ) ; <nl> + CHECK_ENDPOINT_FEATURE ( server , " htTp @ UNIx : / / / a / b / c / d / e / f . s " , Specification , " htTp @ UNIx : / / / a / b / c / d / e / f . s " ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> BOOST_AUTO_TEST_CASE ( EndpointDomains ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ 127 . 0 . 0 . 1 ] : 8529 " , Domain , AF_INET6 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ : : ] : 8529 " , Domain , AF_INET6 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 8529 " , Domain , AF_INET6 ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 8529 " , Domain , AF_INET6 ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 8529 " , Domain , AF_INET6 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / 127 . 0 . 0 . 1 " , Domain , AF_INET ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / 192 . 168 . 173 . 13 " , Domain , AF_INET ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / localhost " , Domain , AF_INET ) ; <nl> BOOST_AUTO_TEST_CASE ( EndpointDomains ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / [ 127 . 0 . 0 . 1 ] : 8529 " , Domain , AF_INET6 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / [ : : ] : 8529 " , Domain , AF_INET6 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 8529 " , Domain , AF_INET6 ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ ssl : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 8529 " , Domain , AF_INET6 ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ ssl : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 8529 " , Domain , AF_INET6 ) ; <nl> <nl> CHECK_ENDPOINT_FEATURE ( client , " unix : / / / tmp / socket " , Domain , AF_UNIX ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " unix : / / / tmp / socket / arango . sock " , Domain , AF_UNIX ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ unix : / / / tmp / socket / arango . sock " , Domain , AF_UNIX ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ unix : / / / tmp / socket / arango . sock " , Domain , AF_UNIX ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> BOOST_AUTO_TEST_CASE ( EndpointDomainTypes ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " TCP : / / 127 . 0 . 0 . 1 " , DomainType , Endpoint : : ENDPOINT_IPV4 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " Tcp : / / 127 . 0 . 0 . 1 " , DomainType , Endpoint : : ENDPOINT_IPV4 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tCP : / / 127 . 0 . 0 . 1 " , DomainType , Endpoint : : ENDPOINT_IPV4 ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ tcp : / / 127 . 0 . 0 . 1 " , DomainType , Endpoint : : ENDPOINT_IPV4 ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ tcp : / / 127 . 0 . 0 . 1 " , DomainType , Endpoint : : ENDPOINT_IPV4 ) ; <nl> <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / 127 . 0 . 0 . 1 " , DomainType , Endpoint : : ENDPOINT_IPV4 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / localhost " , DomainType , Endpoint : : ENDPOINT_IPV4 ) ; <nl> BOOST_AUTO_TEST_CASE ( EndpointDomainTypes ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " SSL : / / 127 . 0 . 0 . 1 " , DomainType , Endpoint : : ENDPOINT_IPV4 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " Ssl : / / 127 . 0 . 0 . 1 " , DomainType , Endpoint : : ENDPOINT_IPV4 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " sSL : / / 127 . 0 . 0 . 1 " , DomainType , Endpoint : : ENDPOINT_IPV4 ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ ssl : / / 127 . 0 . 0 . 1 " , DomainType , Endpoint : : ENDPOINT_IPV4 ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ ssl : / / 127 . 0 . 0 . 1 " , DomainType , Endpoint : : ENDPOINT_IPV4 ) ; <nl> <nl> CHECK_ENDPOINT_FEATURE ( client , " unix : / / / tmp / socket " , DomainType , Endpoint : : ENDPOINT_UNIX ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " unix : / / / tmp / socket / arango . sock " , DomainType , Endpoint : : ENDPOINT_UNIX ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " UNIX : / / / tmp / socket " , DomainType , Endpoint : : ENDPOINT_UNIX ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " Unix : / / / tmp / socket " , DomainType , Endpoint : : ENDPOINT_UNIX ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " uNIX : / / / tmp / socket " , DomainType , Endpoint : : ENDPOINT_UNIX ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ unix : / / / tmp / socket " , DomainType , Endpoint : : ENDPOINT_UNIX ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ unix : / / / tmp / socket " , DomainType , Endpoint : : ENDPOINT_UNIX ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> BOOST_AUTO_TEST_CASE ( EndpointProtocols ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " HTTP @ tcp : / / 127 . 0 . 0 . 1 " , Protocol , Endpoint : : PROTOCOL_HTTP ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " HTTP @ ssl : / / 127 . 0 . 0 . 1 " , Protocol , Endpoint : : PROTOCOL_HTTP ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " HTTP @ unix : / / / tmp / socket " , Protocol , Endpoint : : PROTOCOL_HTTP ) ; <nl> - <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ tcp : / / 127 . 0 . 0 . 1 " , Protocol , Endpoint : : PROTOCOL_BINARY ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ ssl : / / 127 . 0 . 0 . 1 " , Protocol , Endpoint : : PROTOCOL_BINARY ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ unix : / / / tmp / socket " , Protocol , Endpoint : : PROTOCOL_BINARY ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " Binary @ tcp : / / 127 . 0 . 0 . 1 " , Protocol , Endpoint : : PROTOCOL_BINARY ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " Binary @ ssl : / / 127 . 0 . 0 . 1 " , Protocol , Endpoint : : PROTOCOL_BINARY ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " Binary @ unix : / / / tmp / socket " , Protocol , Endpoint : : PROTOCOL_BINARY ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " BINARY @ tcp : / / 127 . 0 . 0 . 1 " , Protocol , Endpoint : : PROTOCOL_BINARY ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " BINARY @ ssl : / / 127 . 0 . 0 . 1 " , Protocol , Endpoint : : PROTOCOL_BINARY ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " BINARY @ unix : / / / tmp / socket " , Protocol , Endpoint : : PROTOCOL_BINARY ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> BOOST_AUTO_TEST_CASE ( EndpointPorts ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / localhost : 443 " , Port , 443 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / localhost : 65535 " , Port , 65535 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / www . arangodb . org : 8529 " , Port , 8529 ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ tcp : / / www . arangodb . org : 8529 " , Port , 8529 ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ tcp : / / www . arangodb . org : 8529 " , Port , 8529 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ 127 . 0 . 0 . 1 ] " , Port , EndpointIp : : _defaultPort ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ : : ] " , Port , EndpointIp : : _defaultPort ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ 127 . 0 . 0 . 1 ] : 8529 " , Port , 8529 ) ; <nl> BOOST_AUTO_TEST_CASE ( EndpointPorts ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ : : ] : 443 " , Port , 443 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ : : ] : 65535 " , Port , 65535 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 666 " , Port , 666 ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 666 " , Port , 666 ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 666 " , Port , 666 ) ; <nl> <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / 127 . 0 . 0 . 1 " , Port , EndpointIp : : _defaultPort ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / localhost " , Port , EndpointIp : : _defaultPort ) ; <nl> BOOST_AUTO_TEST_CASE ( EndpointPorts ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / localhost : 443 " , Port , 443 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / localhost : 65535 " , Port , 65535 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / www . arangodb . org : 8529 " , Port , 8529 ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ ssl : / / www . arangodb . org : 8529 " , Port , 8529 ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ ssl : / / www . arangodb . org : 8529 " , Port , 8529 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / [ 127 . 0 . 0 . 1 ] " , Port , EndpointIp : : _defaultPort ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / [ : : ] " , Port , EndpointIp : : _defaultPort ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / [ 127 . 0 . 0 . 1 ] : 8529 " , Port , 8529 ) ; <nl> BOOST_AUTO_TEST_CASE ( EndpointPorts ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / [ : : ] : 443 " , Port , 443 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / [ : : ] : 65535 " , Port , 65535 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 666 " , Port , 666 ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ ssl : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 666 " , Port , 666 ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ ssl : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 666 " , Port , 666 ) ; <nl> <nl> CHECK_ENDPOINT_FEATURE ( client , " unix : / / / tmp / socket " , Port , 0 ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " unix : / / / tmp / socket / arango . sock " , Port , 0 ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ unix : / / / tmp / socket / arango . sock " , Port , 0 ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ unix : / / / tmp / socket / arango . sock " , Port , 0 ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> BOOST_AUTO_TEST_CASE ( EndpointEncryption ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ 127 . 0 . 0 . 1 ] : 8529 " , Encryption , Endpoint : : ENCRYPTION_NONE ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ : : ] : 8529 " , Encryption , Endpoint : : ENCRYPTION_NONE ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 666 " , Encryption , Endpoint : : ENCRYPTION_NONE ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 666 " , Encryption , Endpoint : : ENCRYPTION_NONE ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 666 " , Encryption , Endpoint : : ENCRYPTION_NONE ) ; <nl> <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / 127 . 0 . 0 . 1 " , Encryption , Endpoint : : ENCRYPTION_SSL ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / localhost " , Encryption , Endpoint : : ENCRYPTION_SSL ) ; <nl> BOOST_AUTO_TEST_CASE ( EndpointEncryption ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " SSL : / / [ : : ] : 8529 " , Encryption , Endpoint : : ENCRYPTION_SSL ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " Ssl : / / [ : : ] : 8529 " , Encryption , Endpoint : : ENCRYPTION_SSL ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " sSL : / / [ : : ] : 8529 " , Encryption , Endpoint : : ENCRYPTION_SSL ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ ssl : / / [ : : ] : 8529 " , Encryption , Endpoint : : ENCRYPTION_SSL ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ ssl : / / [ : : ] : 8529 " , Encryption , Endpoint : : ENCRYPTION_SSL ) ; <nl> <nl> CHECK_ENDPOINT_FEATURE ( client , " unix : / / / tmp / socket " , Encryption , Endpoint : : ENCRYPTION_NONE ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " unix : / / / tmp / socket / arango . sock " , Encryption , Endpoint : : ENCRYPTION_NONE ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " UNIX : / / / tmp / socket / arango . sock " , Encryption , Endpoint : : ENCRYPTION_NONE ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " Unix : / / / tmp / socket / arango . sock " , Encryption , Endpoint : : ENCRYPTION_NONE ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " uNIX : / / / tmp / socket / arango . sock " , Encryption , Endpoint : : ENCRYPTION_NONE ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ unix : / / / tmp / socket / arango . sock " , Encryption , Endpoint : : ENCRYPTION_NONE ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ unix : / / / tmp / socket / arango . sock " , Encryption , Endpoint : : ENCRYPTION_NONE ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> BOOST_AUTO_TEST_CASE ( EndpointHost ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ : : ] : 8529 " , Host , " [ : : ] " ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] " , Host , " [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] " ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 8529 " , Host , " [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] " ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ tcp : / / [ : : ] : 8529 " , Host , " [ : : ] " ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ tcp : / / [ : : ] : 8529 " , Host , " [ : : ] " ) ; <nl> <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / 127 . 0 . 0 . 1 " , Host , " 127 . 0 . 0 . 1 " ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / localhost " , Host , " localhost " ) ; <nl> BOOST_AUTO_TEST_CASE ( EndpointHost ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / [ : : ] : 8529 " , Host , " [ : : ] " ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] " , Host , " [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] " ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 8529 " , Host , " [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] " ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ ssl : / / [ : : ] : 8529 " , Host , " [ : : ] " ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ ssl : / / [ : : ] : 8529 " , Host , " [ : : ] " ) ; <nl> <nl> CHECK_ENDPOINT_FEATURE ( client , " unix : / / / tmp / socket " , Host , " localhost " ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " unix : / / / tmp / socket / arango . sock " , Host , " localhost " ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ unix : / / / tmp / socket / arango . sock " , Host , " localhost " ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ unix : / / / tmp / socket / arango . sock " , Host , " localhost " ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> BOOST_AUTO_TEST_CASE ( EndpointHostString ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] " , HostString , " [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 8529 " ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 8529 " , HostString , " [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 8529 " ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 777 " , HostString , " [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 777 " ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 777 " , HostString , " [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 777 " ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ tcp : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 777 " , HostString , " [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 777 " ) ; <nl> <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / 127 . 0 . 0 . 1 " , HostString , " 127 . 0 . 0 . 1 : 8529 " ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / localhost " , HostString , " localhost : 8529 " ) ; <nl> BOOST_AUTO_TEST_CASE ( EndpointHostString ) { <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] " , HostString , " [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 8529 " ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 8529 " , HostString , " [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 8529 " ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " ssl : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 994 " , HostString , " [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 994 " ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ ssl : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 994 " , HostString , " [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 994 " ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ ssl : / / [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 994 " , HostString , " [ 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 ] : 994 " ) ; <nl> <nl> CHECK_ENDPOINT_FEATURE ( client , " unix : / / / tmp / socket " , HostString , " localhost " ) ; <nl> CHECK_ENDPOINT_FEATURE ( client , " unix : / / / tmp / socket / arango . sock " , HostString , " localhost " ) ; <nl> - CHECK_ENDPOINT_FEATURE ( client , " binary @ unix : / / / tmp / socket / arango . sock " , HostString , " localhost " ) ; <nl> + CHECK_ENDPOINT_FEATURE ( client , " http @ unix : / / / tmp / socket / arango . sock " , HostString , " localhost " ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> BOOST_AUTO_TEST_CASE ( EndpointServerUnix ) { <nl> / / / @ brief test client endpoint <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> - BOOST_AUTO_TEST_CASE ( EndpointClientSslIpV6WithPortBinary ) { <nl> + BOOST_AUTO_TEST_CASE ( EndpointClientSslIpV6WithPortHttp ) { <nl> Endpoint * e ; <nl> <nl> - e = Endpoint : : clientFactory ( " binary @ SSL : / / [ 0001 : 0002 : 0003 : 0004 : 0005 : 0006 : 0007 : 0008 ] : 43425 " ) ; <nl> - BOOST_CHECK_EQUAL ( " binary @ SSL : / / [ 0001 : 0002 : 0003 : 0004 : 0005 : 0006 : 0007 : 0008 ] : 43425 " , e - > getSpecification ( ) ) ; <nl> + e = Endpoint : : clientFactory ( " http @ SSL : / / [ 0001 : 0002 : 0003 : 0004 : 0005 : 0006 : 0007 : 0008 ] : 43425 " ) ; <nl> + BOOST_CHECK_EQUAL ( " http @ SSL : / / [ 0001 : 0002 : 0003 : 0004 : 0005 : 0006 : 0007 : 0008 ] : 43425 " , e - > getSpecification ( ) ) ; <nl> BOOST_CHECK_EQUAL ( Endpoint : : ENDPOINT_CLIENT , e - > getType ( ) ) ; <nl> BOOST_CHECK_EQUAL ( Endpoint : : ENDPOINT_IPV6 , e - > getDomainType ( ) ) ; <nl> - BOOST_CHECK_EQUAL ( Endpoint : : PROTOCOL_BINARY , e - > getProtocol ( ) ) ; <nl> + BOOST_CHECK_EQUAL ( Endpoint : : PROTOCOL_HTTP , e - > getProtocol ( ) ) ; <nl> BOOST_CHECK_EQUAL ( Endpoint : : ENCRYPTION_SSL , e - > getEncryption ( ) ) ; <nl> BOOST_CHECK_EQUAL ( AF_INET6 , e - > getDomain ( ) ) ; <nl> BOOST_CHECK_EQUAL ( " [ 0001 : 0002 : 0003 : 0004 : 0005 : 0006 : 0007 : 0008 ] " , e - > getHost ( ) ) ; <nl> mmm a / arangod / RestHandler / RestBatchHandler . cpp <nl> ppp b / arangod / RestHandler / RestBatchHandler . cpp <nl> Handler : : status_e RestBatchHandler : : execute ( ) { <nl> } <nl> <nl> / / set up request object for the part <nl> - LOGGER_DEBUG < < " part header is " < < string ( headerStart , headerLength ) ; <nl> + LOGGER_TRACE < < " part header is " < < string ( headerStart , headerLength ) ; <nl> HttpRequestPlain * request = new HttpRequestPlain ( headerStart , headerLength ) ; <nl> if ( bodyLength > 0 ) { <nl> - LOGGER_INFO < < " part body is " < < string ( bodyStart , bodyLength ) ; <nl> + LOGGER_TRACE < < " part body is " < < string ( bodyStart , bodyLength ) ; <nl> request - > setBody ( bodyStart , bodyLength ) ; <nl> } <nl> <nl> bool RestBatchHandler : : getBoundary ( string * result ) { <nl> return false ; <nl> } <nl> <nl> - LOGGER_INFO < < " boundary of multipart - message is " < < boundary ; <nl> + LOGGER_TRACE < < " boundary of multipart - message is " < < boundary ; <nl> <nl> * result = boundary ; <nl> return true ; <nl> mmm a / arangod / RestHandler / RestBatchHandler . h <nl> ppp b / arangod / RestHandler / RestBatchHandler . h <nl> <nl> <nl> # include " RestHandler / RestVocbaseBaseHandler . h " <nl> # include " HttpServer / HttpServer . h " <nl> - # include " RestHandler / BatchJob . h " <nl> - # include " ProtocolBuffers / arangodb . pb . h " <nl> <nl> using namespace triagens : : basics ; <nl> using namespace triagens : : rest ; <nl> mmm a / arangosh / V8Client / BenchmarkThread . h <nl> ppp b / arangosh / V8Client / BenchmarkThread . h <nl> <nl> # include " V8Client / SharedCounter . h " <nl> # include " SimpleHttpClient / SimpleClient . h " <nl> # include " SimpleHttpClient / SimpleHttpClient . h " <nl> - # include " SimpleHttpClient / SimpleBinaryClient . h " <nl> # include " SimpleHttpClient / GeneralClientConnection . h " <nl> - # include " BinaryServer / BinaryMessage . h " <nl> - # include " ProtocolBuffers / arangodb . pb . h " <nl> <nl> using namespace std ; <nl> using namespace triagens : : basics ; <nl> namespace triagens { <nl> BenchmarkRequest ( const char * url , <nl> map < string , string > params , <nl> char * ( * genFunc ) ( ) , <nl> - void ( * jsonFunc ) ( PB_ArangoBlobRequest * ) , <nl> SimpleHttpClient : : http_method type ) : <nl> url ( url ) , <nl> params ( params ) , <nl> genFunc ( genFunc ) , <nl> - jsonFunc ( jsonFunc ) , <nl> type ( type ) , <nl> ptr ( 0 ) { <nl> } ; <nl> namespace triagens { <nl> ptr = ( void * ) genFunc ( ) ; <nl> } <nl> <nl> - void createString ( PB_ArangoBlobRequest * blob ) { <nl> - createString ( ) ; <nl> - blob - > set_content ( getString ( ) , getStringLength ( ) ) ; <nl> - } <nl> - <nl> - void createJson ( PB_ArangoBlobRequest * blob ) { <nl> - if ( jsonFunc = = NULL ) { <nl> - cerr < < " invalid call to createJson " < < endl ; <nl> - exit ( EXIT_FAILURE ) ; <nl> - } <nl> - jsonFunc ( blob ) ; <nl> - } <nl> - <nl> char * getString ( ) { <nl> return ( char * ) ptr ; <nl> } <nl> namespace triagens { <nl> string url ; <nl> map < string , string > params ; <nl> char * ( * genFunc ) ( ) ; <nl> - void ( * jsonFunc ) ( PB_ArangoBlobRequest * ) ; <nl> SimpleHttpClient : : http_method type ; <nl> void * ptr ; <nl> } ; <nl> namespace triagens { <nl> ConditionVariable * condition , <nl> const unsigned long batchSize , <nl> SharedCounter < unsigned long > * operationsCounter , <nl> - bool useJson , <nl> Endpoint * endpoint , <nl> const string & username , <nl> const string & password ) <nl> namespace triagens { <nl> _startCondition ( condition ) , <nl> _batchSize ( batchSize ) , <nl> _operationsCounter ( operationsCounter ) , <nl> - _useJson ( useJson ) , <nl> _endpoint ( endpoint ) , <nl> _username ( username ) , <nl> _password ( password ) , <nl> namespace triagens { <nl> exit ( EXIT_FAILURE ) ; <nl> } <nl> <nl> - bool isBinary = _endpoint - > isBinary ( ) ; <nl> - <nl> - if ( isBinary ) { <nl> - _client = new SimpleBinaryClient ( _connection , 10 . 0 , true ) ; <nl> - } <nl> - else { <nl> - _client = new SimpleHttpClient ( _connection , 10 . 0 , true ) ; <nl> - _client - > setUserNamePassword ( " / " , _username , _password ) ; <nl> - map < string , string > headerFields ; <nl> - SimpleHttpResult * result = _client - > request ( SimpleHttpClient : : GET , " / _api / version " , 0 , 0 , headerFields ) ; <nl> + _client = new SimpleHttpClient ( _connection , 10 . 0 , true ) ; <nl> + _client - > setUserNamePassword ( " / " , _username , _password ) ; <nl> + map < string , string > headerFields ; <nl> + SimpleHttpResult * result = _client - > request ( SimpleHttpClient : : GET , " / _api / version " , 0 , 0 , headerFields ) ; <nl> <nl> - if ( ! result | | ! result - > isComplete ( ) ) { <nl> - if ( result ) { <nl> - delete result ; <nl> - } <nl> - cerr < < " could not connect to server " < < endl ; <nl> - exit ( EXIT_FAILURE ) ; <nl> + if ( ! result | | ! result - > isComplete ( ) ) { <nl> + if ( result ) { <nl> + delete result ; <nl> } <nl> - <nl> - delete result ; <nl> + cerr < < " could not connect to server " < < endl ; <nl> + exit ( EXIT_FAILURE ) ; <nl> } <nl> + <nl> + delete result ; <nl> <nl> { <nl> ConditionLocker guard ( _startCondition ) ; <nl> namespace triagens { <nl> break ; <nl> } <nl> <nl> - if ( _batchSize = = 1 & & ! isBinary ) { <nl> + if ( _batchSize = = 1 ) { <nl> executeRequest ( ) ; <nl> } <nl> else { <nl> namespace triagens { <nl> } <nl> } <nl> <nl> - <nl> - PB_ArangoRequestType getRequestType ( const SimpleHttpClient : : http_method type ) const { <nl> - if ( type = = SimpleHttpClient : : GET ) { <nl> - return PB_REQUEST_TYPE_GET ; <nl> - } <nl> - if ( type = = SimpleHttpClient : : POST ) { <nl> - return PB_REQUEST_TYPE_POST ; <nl> - } <nl> - if ( type = = SimpleHttpClient : : PUT ) { <nl> - return PB_REQUEST_TYPE_PUT ; <nl> - } <nl> - if ( type = = SimpleHttpClient : : DELETE ) { <nl> - return PB_REQUEST_TYPE_DELETE ; <nl> - } <nl> - cerr < < " invalid request type " < < endl ; <nl> - exit ( EXIT_FAILURE ) ; <nl> - } <nl> - <nl> - <nl> void executeRequest ( const unsigned long numOperations ) { <nl> + / * <nl> PB_ArangoMessage messages ; <nl> PB_ArangoBatchMessage * batch ; <nl> PB_ArangoBlobRequest * blob ; <nl> namespace triagens { <nl> } <nl> } <nl> delete result ; <nl> + * / <nl> } <nl> <nl> <nl> namespace triagens { <nl> <nl> SharedCounter < unsigned long > * _operationsCounter ; <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief use binary json ? <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - bool _useJson ; <nl> - <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / / @ brief endpoint to use <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> mmm a / arangosh / V8Client / arangob . cpp <nl> ppp b / arangosh / V8Client / arangob . cpp <nl> static int Operations = 1000 ; <nl> <nl> static int BatchSize = 1 ; <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief use binary json ? <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - static bool UseJson = false ; <nl> - <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / / @ } <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> static void ParseProgramOptions ( int argc , char * argv [ ] ) { <nl> ( " concurrency " , & Concurrency , " number of parallel connections " ) <nl> ( " requests " , & Operations , " total number of operations " ) <nl> ( " batch - size " , & BatchSize , " number of operations in one batch " ) <nl> - ( " binary - json " , & UseJson , " use binary json " ) <nl> ; <nl> <nl> BaseClient . setupGeneral ( description ) ; <nl> char * SEmpty ( ) { <nl> return TRI_DuplicateStringZ ( TRI_UNKNOWN_MEM_ZONE , " " ) ; <nl> } <nl> <nl> - void JEmpty ( PB_ArangoBlobRequest * blob ) { <nl> - } <nl> - <nl> BenchmarkRequest VersionFunc ( ) { <nl> map < string , string > params ; <nl> - BenchmarkRequest r ( " / _api / version " , params , & SEmpty , & JEmpty , SimpleHttpClient : : GET ) ; <nl> + BenchmarkRequest r ( " / _api / version " , params , & SEmpty , SimpleHttpClient : : GET ) ; <nl> <nl> return r ; <nl> } <nl> char * SFunc1 ( ) { <nl> return TRI_DuplicateStringZ ( TRI_UNKNOWN_MEM_ZONE , " { \ " some value \ " : 1 } " ) ; <nl> } <nl> <nl> - void JFunc1 ( PB_ArangoBlobRequest * blob ) { <nl> - PB_ArangoJsonContent * json = blob - > mutable_json ( ) ; <nl> - json - > set_type ( PB_REQUEST_TYPE_ARRAY ) ; <nl> - <nl> - json - > mutable_value ( ) - > add_objects ( ) ; / / key <nl> - json - > mutable_value ( ) - > add_objects ( ) ; / / value <nl> - <nl> - PB_ArangoJsonContent * k = json - > mutable_value ( ) - > mutable_objects ( 0 ) ; <nl> - PB_ArangoJsonContent * v = json - > mutable_value ( ) - > mutable_objects ( 1 ) ; <nl> - <nl> - k - > set_type ( PB_REQUEST_TYPE_STRING ) ; <nl> - k - > mutable_value ( ) - > set_stringvalue ( " some value " ) ; <nl> - v - > set_type ( PB_REQUEST_TYPE_NUMBER ) ; <nl> - v - > mutable_value ( ) - > set_numbervalue ( 1 . 0 ) ; <nl> - } <nl> - <nl> BenchmarkRequest InsertFunc1 ( ) { <nl> map < string , string > params ; <nl> params [ " createCollection " ] = " true " ; <nl> params [ " collection " ] = " BenchmarkInsert " ; <nl> <nl> - BenchmarkRequest r ( " / _api / document " , params , & SFunc1 , & JFunc1 , SimpleHttpClient : : POST ) ; <nl> + BenchmarkRequest r ( " / _api / document " , params , & SFunc1 , SimpleHttpClient : : POST ) ; <nl> <nl> return r ; <nl> } <nl> char * SFunc2 ( ) { <nl> return TRI_DuplicateStringZ ( TRI_UNKNOWN_MEM_ZONE , s . c_str ( ) ) ; <nl> } <nl> <nl> - void JFunc2 ( PB_ArangoBlobRequest * blob ) { <nl> - PB_ArangoJsonContent * json = blob - > mutable_json ( ) ; <nl> - json - > set_type ( PB_REQUEST_TYPE_ARRAY ) ; <nl> - <nl> - for ( size_t i = 0 ; i < 1 ; + + i ) { <nl> - json - > mutable_value ( ) - > add_objects ( ) ; / / key <nl> - json - > mutable_value ( ) - > add_objects ( ) ; / / value <nl> - <nl> - PB_ArangoJsonContent * k = json - > mutable_value ( ) - > mutable_objects ( i * 2 ) ; <nl> - PB_ArangoJsonContent * v = json - > mutable_value ( ) - > mutable_objects ( ( i * 2 ) + 1 ) ; <nl> - <nl> - k - > set_type ( PB_REQUEST_TYPE_STRING ) ; <nl> - ostringstream ks ; <nl> - ks < < " some value " < < i ; <nl> - k - > mutable_value ( ) - > set_stringvalue ( ks . str ( ) ) ; <nl> - v - > set_type ( PB_REQUEST_TYPE_NUMBER ) ; <nl> - v - > mutable_value ( ) - > set_numbervalue ( ( double ) i ) ; <nl> - } <nl> - } <nl> - <nl> BenchmarkRequest InsertFunc2 ( ) { <nl> map < string , string > params ; <nl> params [ " createCollection " ] = " true " ; <nl> params [ " collection " ] = " BenchmarkInsert " ; <nl> <nl> - BenchmarkRequest r ( " / _api / document " , params , & SFunc2 , & JFunc2 , SimpleHttpClient : : POST ) ; <nl> + BenchmarkRequest r ( " / _api / document " , params , & SFunc2 , SimpleHttpClient : : POST ) ; <nl> <nl> return r ; <nl> } <nl> int main ( int argc , char * argv [ ] ) { <nl> & startCondition , <nl> ( unsigned long ) BatchSize , <nl> & operationsCounter , <nl> - UseJson , <nl> endpoint , <nl> BaseClient . username ( ) , <nl> BaseClient . password ( ) ) ; <nl> mmm a / configure . ac <nl> ppp b / configure . ac <nl> AC_ARG_ENABLE ( all - in - one - libev , <nl> <nl> AM_CONDITIONAL ( ENABLE_ALL_IN_ONE_LIBEV , test " x $ tr_ALL_IN_ONE_LIBEV " = xyes ) <nl> <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - dnl PROTOBUF <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - AC_ARG_ENABLE ( all - in - one - protobuf , <nl> - AS_HELP_STRING ( [ - - enable - all - in - one - protobuf ] , [ use supplied PROTOBUF from 3rdParty directory ] ) , <nl> - [ tr_ALL_IN_ONE_PROTOBUF = " $ { enableval : - yes } " ] , <nl> - [ tr_ALL_IN_ONE_PROTOBUF = yes ] <nl> - ) <nl> - <nl> - AM_CONDITIONAL ( ENABLE_ALL_IN_ONE_PROTOBUF , test " x $ tr_ALL_IN_ONE_PROTOBUF " = xyes ) <nl> - <nl> dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> dnl V8 <nl> dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> m4_include ( [ m4 / all - in - one . mruby ] ) <nl> <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - dnl PROTOBUF <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - if test " x $ tr_ALL_IN_ONE_PROTOBUF " = xyes ; then <nl> - m4_include ( [ m4 / all - in - one . protobuf ] ) <nl> - else <nl> - m4_include ( [ m4 / external . protobuf ] ) <nl> - fi <nl> - <nl> dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> dnl V8 <nl> dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> deleted file mode 100644 <nl> index 07734f57136 . . 00000000000 <nl> mmm a / lib / BinaryServer / BinaryCommTask . h <nl> ppp / dev / null <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief task for binary communication <nl> - / / / <nl> - / / / @ file <nl> - / / / <nl> - / / / DISCLAIMER <nl> - / / / <nl> - / / / Copyright 2004 - 2012 triAGENS GmbH , Cologne , Germany <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> - / / / Copyright holder is triAGENS GmbH , Cologne , Germany <nl> - / / / <nl> - / / / @ author Jan Steemann <nl> - / / / @ author Copyright 2012 , triAGENS GmbH , Cologne , Germany <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - # ifndef TRIAGENS_HTTP_SERVER_BINARY_COMM_TASK_H <nl> - # define TRIAGENS_HTTP_SERVER_BINARY_COMM_TASK_H 1 <nl> - <nl> - # include " GeneralServer / GeneralCommTask . h " <nl> - <nl> - # include " BasicsC / hashes . h " <nl> - <nl> - # include " Basics / StringUtils . h " <nl> - # include " Basics / StringBuffer . h " <nl> - <nl> - # include " Scheduler / ListenTask . h " <nl> - # include " HttpServer / HttpHandler . h " <nl> - # include " HttpServer / HttpHandlerFactory . h " <nl> - # include " Rest / HttpRequest . h " <nl> - # include " Rest / HttpRequestPlain . h " <nl> - # include " Rest / HttpResponse . h " <nl> - # include " Scheduler / Scheduler . h " <nl> - # include " BinaryServer / BinaryMessage . h " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - forward declarations <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - namespace triagens { <nl> - namespace rest { <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - class BinaryCommTask <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief task for binary communication <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - template < typename S > <nl> - class BinaryCommTask : public GeneralCommTask < S , HttpHandlerFactory > , <nl> - public RequestStatisticsAgent { <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - constructors and destructors <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - public : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief constructors <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - BinaryCommTask ( S * server , <nl> - socket_t fd , <nl> - ConnectionInfo const & info , <nl> - double keepAliveTimeout ) <nl> - : Task ( " BinaryCommTask " ) , <nl> - GeneralCommTask < S , HttpHandlerFactory > ( server , fd , info , keepAliveTimeout ) { <nl> - ConnectionStatisticsAgentSetHttp ( this ) ; <nl> - ConnectionStatisticsAgent : : release ( ) ; <nl> - <nl> - ConnectionStatisticsAgent : : acquire ( ) ; <nl> - ConnectionStatisticsAgentSetStart ( this ) ; <nl> - ConnectionStatisticsAgentSetHttp ( this ) ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief destructors <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - virtual ~ BinaryCommTask ( ) { <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - GeneralCommTask methods <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - protected : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - bool processRead ( ) { <nl> - if ( this - > _requestPending | | this - > _readBuffer - > c_str ( ) = = 0 ) { <nl> - return true ; <nl> - } <nl> - <nl> - bool handleRequest = false ; <nl> - <nl> - if ( ! this - > _readRequestBody ) { <nl> - # ifdef TRI_ENABLE_FIGURES <nl> - <nl> - if ( this - > _readPosition = = 0 & & this - > _readBuffer - > c_str ( ) ! = this - > _readBuffer - > end ( ) ) { <nl> - RequestStatisticsAgent : : acquire ( ) ; <nl> - RequestStatisticsAgentSetReadStart ( this ) ; <nl> - } <nl> - <nl> - # endif <nl> - <nl> - const char * ptr = this - > _readBuffer - > c_str ( ) + this - > _readPosition ; <nl> - const char * end = this - > _readBuffer - > end ( ) ; <nl> - <nl> - if ( end - ptr > = ( ptrdiff_t ) BinaryMessage : : getHeaderLength ( ) ) { <nl> - this - > _readPosition = BinaryMessage : : getHeaderLength ( ) ; <nl> - <nl> - LOGGER_TRACE < < " BINARY READ FOR " < < static_cast < Task * > ( this ) ; <nl> - <nl> - / / create a fake HTTP request <nl> - triagens : : basics : : StringBuffer fakeRequest ( TRI_UNKNOWN_MEM_ZONE ) ; <nl> - fakeRequest . appendText ( " POST / _api / batch HTTP / 1 . 1 \ r \ nContent - Type : " ) ; <nl> - fakeRequest . appendText ( BinaryMessage : : getContentType ( ) ) ; <nl> - fakeRequest . appendText ( " \ r \ nContent - Length : " ) ; <nl> - fakeRequest . appendInteger ( this - > _bodyLength ) ; <nl> - fakeRequest . appendText ( " \ r \ nConnection : Close \ r \ n \ r \ n " ) ; <nl> - <nl> - this - > _request = new HttpRequestPlain ( fakeRequest . begin ( ) , fakeRequest . length ( ) ) ; <nl> - <nl> - if ( this - > _request = = 0 ) { <nl> - LOGGER_ERROR < < " cannot generate request " ; <nl> - return false ; <nl> - } <nl> - <nl> - / / update the connection information , i . e . client and server addresses and ports <nl> - this - > _request - > setConnectionInfo ( this - > _connectionInfo ) ; <nl> - <nl> - LOGGER_TRACE < < " server port = " < < this - > _connectionInfo . serverPort < < " , client port = " < < this - > _connectionInfo . clientPort ; <nl> - <nl> - / / set body start to current position <nl> - this - > _bodyPosition = this - > _readPosition ; <nl> - <nl> - this - > _bodyLength = ( size_t ) BinaryMessage : : decodeLength ( ( const uint8_t * ) ( this - > _readBuffer - > c_str ( ) + 4 ) ) ; <nl> - this - > _readRequestBody = true ; <nl> - } <nl> - else { <nl> - if ( this - > _readBuffer - > c_str ( ) < end ) { <nl> - this - > _readPosition = end - this - > _readBuffer - > c_str ( ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - / / readRequestBody might have changed , so cannot use else <nl> - if ( this - > _readRequestBody ) { <nl> - if ( this - > _readBuffer - > length ( ) - this - > _bodyPosition < this - > _bodyLength ) { <nl> - return true ; <nl> - } <nl> - <nl> - / / read " bodyLength " from read buffer and add this body to " httpRequest " <nl> - this - > _request - > setBody ( this - > _readBuffer - > c_str ( ) + this - > _bodyPosition , this - > _bodyLength ) ; <nl> - <nl> - / / std : : cout < < " body length : " < < this - > _bodyLength < < " , hash : " < < TRI_FnvHashPointer ( this - > _readBuffer - > c_str ( ) + this - > _bodyPosition , this - > _bodyLength ) < < " \ n " ; <nl> - <nl> - / / remove body from read buffer and reset read position <nl> - this - > _readRequestBody = false ; <nl> - handleRequest = true ; <nl> - } <nl> - <nl> - / / we have to delete request in here or pass it to a handler , which will delete it <nl> - if ( handleRequest ) { <nl> - RequestStatisticsAgentSetReadEnd ( this ) ; <nl> - RequestStatisticsAgentAddReceivedBytes ( this , this - > _bodyPosition + this - > _bodyLength ) ; <nl> - <nl> - this - > _readBuffer - > erase_front ( this - > _bodyPosition + this - > _bodyLength ) ; <nl> - <nl> - this - > _requestPending = true ; <nl> - <nl> - if ( this - > _keepAliveTimeout < = 0 . 0 ) { <nl> - this - > _closeRequested = true ; <nl> - } <nl> - else { <nl> - this - > _closeRequested = false ; <nl> - } <nl> - <nl> - this - > _readPosition = 0 ; <nl> - this - > _bodyPosition = 0 ; <nl> - this - > _bodyLength = 0 ; <nl> - <nl> - HttpHandler * handler = this - > _server - > getHandlerFactory ( ) - > createHandler ( this - > _request ) ; <nl> - if ( handler = = 0 ) { <nl> - LOGGER_TRACE < < " no handler is known , giving up " ; <nl> - delete this - > _request ; <nl> - this - > _request = 0 ; <nl> - <nl> - HttpResponse response ( HttpResponse : : NOT_FOUND ) ; <nl> - this - > handleResponse ( & response ) ; <nl> - } <nl> - else { <nl> - this - > RequestStatisticsAgent : : transfer ( handler ) ; <nl> - <nl> - this - > _request = 0 ; <nl> - bool ok = this - > _server - > handleRequest ( this , handler ) ; <nl> - <nl> - if ( ! ok ) { <nl> - HttpResponse response ( HttpResponse : : SERVER_ERROR ) ; <nl> - this - > handleResponse ( & response ) ; <nl> - } <nl> - } <nl> - <nl> - return processRead ( ) ; <nl> - } <nl> - <nl> - return true ; <nl> - } <nl> - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - void addResponse ( HttpResponse * response ) { <nl> - triagens : : basics : : StringBuffer * buffer ; <nl> - <nl> - if ( this - > _closeRequested ) { <nl> - response - > setHeader ( " connection " , strlen ( " connection " ) , " Close " ) ; <nl> - } <nl> - else { <nl> - / / keep - alive is the default <nl> - response - > setHeader ( " connection " , strlen ( " connection " ) , " Keep - Alive " ) ; <nl> - } <nl> - <nl> - / / save header <nl> - buffer = new triagens : : basics : : StringBuffer ( TRI_UNKNOWN_MEM_ZONE ) ; <nl> - buffer - > appendText ( " \ 0 \ 0 \ 0 \ 0 \ 0 \ 0 \ 0 \ 0 " , 8 ) ; <nl> - uint8_t * outPointer = ( uint8_t * ) buffer - > c_str ( ) ; <nl> - <nl> - BinaryMessage : : writeHeader ( ( uint32_t ) response - > body ( ) . length ( ) , outPointer ) ; <nl> - <nl> - buffer - > appendText ( response - > body ( ) ) ; <nl> - <nl> - / / LOGGER_TRACE < < " binary body length : " < < response - > body ( ) . length ( ) < < " , hash : " < < TRI_FnvHashPointer ( response - > body ( ) . c_str ( ) , response - > body ( ) . length ( ) ) ; <nl> - <nl> - this - > _writeBuffers . push_back ( buffer ) ; <nl> - <nl> - # ifdef TRI_ENABLE_FIGURES <nl> - <nl> - this - > _writeBuffersStats . push_back ( RequestStatisticsAgent : : transfer ( ) ) ; <nl> - <nl> - # endif <nl> - <nl> - / / clear body <nl> - response - > body ( ) . clear ( ) ; <nl> - <nl> - / / start output <nl> - this - > fillWriteBuffer ( ) ; <nl> - } <nl> - } ; <nl> - } <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - # endif <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - END - OF - FILE <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / Local Variables : <nl> - / / mode : outline - minor <nl> - / / outline - regexp : " ^ \ \ ( / / / @ brief \ \ | / / / { @ inheritDoc } \ \ | / / / @ addtogroup \ \ | / / / @ page \ \ | / / - - SECTION - - \ \ | / / / @ \ \ } \ \ ) " <nl> - / / End : <nl> deleted file mode 100644 <nl> index 656dd96a776 . . 00000000000 <nl> mmm a / lib / BinaryServer / BinaryMessage . h <nl> ppp / dev / null <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief binary protocol data container <nl> - / / / <nl> - / / / @ file <nl> - / / / <nl> - / / / DISCLAIMER <nl> - / / / <nl> - / / / Copyright 2004 - 2012 triAGENS GmbH , Cologne , Germany <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> - / / / Copyright holder is triAGENS GmbH , Cologne , Germany <nl> - / / / <nl> - / / / @ author Jan Steemann <nl> - / / / @ author Copyright 2012 , triAGENS GmbH , Cologne , Germany <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - # ifndef TRIAGENS_BINARY_SERVER_BINARY_MESSAGE_H <nl> - # define TRIAGENS_BINARY_SERVER_BINARY_MESSAGE_H 1 <nl> - <nl> - # include " Basics / StringUtils . h " <nl> - # include " Basics / StringBuffer . h " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - forward declarations <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - namespace triagens { <nl> - namespace rest { <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - class BinaryMessage <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief message used for binary communication <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - class BinaryMessage { <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - constructors and destructors <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - private : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief constructors <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - BinaryMessage ( ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief destructors <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - ~ BinaryMessage ( ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - public static methods <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - public : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief return the protocol signature <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - static const char * getSignature ( ) { <nl> - return " \ xaa \ xdb \ x00 \ x00 " ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief return the encoded length as a size_t <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - static uint32_t decodeLength ( const uint8_t * data ) { <nl> - uint32_t length = ( ( uint32_t ) data [ 0 ] < < 24 ) | <nl> - ( ( uint32_t ) data [ 1 ] < < 16 ) | <nl> - ( ( uint32_t ) data [ 2 ] < < 8 ) | <nl> - ( uint32_t ) data [ 3 ] ; <nl> - <nl> - return length ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief encode the size_t length in a char [ 4 ] <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - static void writeHeader ( const uint32_t length , uint8_t * out ) { <nl> - static const char * signature = getSignature ( ) ; <nl> - <nl> - for ( size_t i = 0 ; i < 4 ; + + i ) { <nl> - * ( out + + ) = ( uint8_t ) signature [ i ] ; <nl> - } <nl> - <nl> - * ( out + + ) = ( ( uint32_t ) length > > 24 ) ; <nl> - * ( out + + ) = ( ( uint32_t ) length > > 16 ) & 0xff ; <nl> - * ( out + + ) = ( ( uint32_t ) length > > 8 ) & 0xff ; <nl> - * ( out + + ) = ( ( uint32_t ) length ) & 0xff ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief return the required content - type string <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - static string const & getContentType ( ) { <nl> - static string const contentType = " application / x - arangodb - batch " ; <nl> - <nl> - return contentType ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief return the minimum binary message length <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - static const size_t getHeaderLength ( ) { <nl> - return 8 ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief return the maximum binary message length <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - static const size_t getMaxLength ( ) { <nl> - return 128 * 1024 * 1024 ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - } ; <nl> - } <nl> - } <nl> - <nl> - # endif <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - END - OF - FILE <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / Local Variables : <nl> - / / mode : outline - minor <nl> - / / outline - regexp : " ^ \ \ ( / / / @ brief \ \ | / / / { @ inheritDoc } \ \ | / / / @ addtogroup \ \ | / / / @ page \ \ | / / - - SECTION - - \ \ | / / / @ \ \ } \ \ ) " <nl> - / / End : <nl> - <nl> deleted file mode 100644 <nl> index dd7ecc72abf . . 00000000000 <nl> mmm a / lib / BinaryServer / BinaryServer . h <nl> ppp / dev / null <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief binary server <nl> - / / / <nl> - / / / @ file <nl> - / / / <nl> - / / / DISCLAIMER <nl> - / / / <nl> - / / / Copyright 2004 - 2012 triAGENS GmbH , Cologne , Germany <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> - / / / Copyright holder is triAGENS GmbH , Cologne , Germany <nl> - / / / <nl> - / / / @ author Dr . Frank Celler <nl> - / / / @ author Achim Brandt <nl> - / / / @ author Copyright 2009 - 2012 , triAGENS GmbH , Cologne , Germany <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - # ifndef TRIAGENS_HTTP_SERVER_BINARY_SERVER_H <nl> - # define TRIAGENS_HTTP_SERVER_BINARY_SERVER_H 1 <nl> - <nl> - # include " GeneralServer / GeneralServerDispatcher . h " <nl> - <nl> - # include " BinaryServer / GeneralBinaryServer . h " <nl> - # include " BinaryServer / BinaryCommTask . h " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - forward declarations <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - namespace triagens { <nl> - namespace rest { <nl> - class HttpHandlerFactory ; <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - class BinaryServer <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief binary server implementation <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - class BinaryServer : public GeneralBinaryServer < BinaryServer , HttpHandlerFactory , BinaryCommTask < BinaryServer > > { <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - constructors and destructors <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - public : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief constructs a new binary server <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - BinaryServer ( Scheduler * scheduler , <nl> - Dispatcher * dispatcher , <nl> - double keepAliveTimeout , <nl> - HttpHandlerFactory * handlerFactory ) <nl> - : GeneralServer < BinaryServer , HttpHandlerFactory , BinaryCommTask < BinaryServer > > ( scheduler , keepAliveTimeout ) , <nl> - GeneralServerDispatcher < BinaryServer , HttpHandlerFactory , BinaryCommTask < BinaryServer > > ( scheduler , dispatcher , keepAliveTimeout ) , <nl> - GeneralBinaryServer < BinaryServer , HttpHandlerFactory , BinaryCommTask < BinaryServer > > ( scheduler , dispatcher , keepAliveTimeout , handlerFactory ) { <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - constructors and destructors <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - public : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief return encryption to be used <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - virtual Endpoint : : Encryption getEncryption ( ) const { <nl> - return Endpoint : : ENCRYPTION_NONE ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - } ; <nl> - } <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - # endif <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - END - OF - FILE <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / Local Variables : <nl> - / / mode : outline - minor <nl> - / / outline - regexp : " ^ \ \ ( / / / @ brief \ \ | / / / { @ inheritDoc } \ \ | / / / @ addtogroup \ \ | / / - - SECTION - - \ \ | / / / @ \ \ } \ \ ) " <nl> - / / End : <nl> deleted file mode 100644 <nl> index d88c5498a3e . . 00000000000 <nl> mmm a / lib / BinaryServer / BinarySslServer . h <nl> ppp / dev / null <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief binary ssl server <nl> - / / / <nl> - / / / @ file <nl> - / / / <nl> - / / / DISCLAIMER <nl> - / / / <nl> - / / / Copyright 2004 - 2012 triAGENS GmbH , Cologne , Germany <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> - / / / Copyright holder is triAGENS GmbH , Cologne , Germany <nl> - / / / <nl> - / / / @ author Dr . Frank Celler <nl> - / / / @ author Copyright 2010 - 2012 , triAGENS GmbH , Cologne , Germany <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - # ifndef TRIAGENS_HTTP_SERVER_BINARY_SSL_SERVER_H <nl> - # define TRIAGENS_HTTP_SERVER_BINARY_SSL_SERVER_H 1 <nl> - <nl> - # include " GeneralServer / GeneralSslServer . h " <nl> - # include " HttpServer / GeneralBinaryServer . h " <nl> - <nl> - # include < openssl / ssl . h > <nl> - <nl> - # include " Basics / ssl - helper . h " <nl> - # include " Logger / Logger . h " <nl> - <nl> - # include " HttpServer / BinaryCommTask . h " <nl> - # include " HttpServer / HttpHandler . h " <nl> - # include " HttpServer / SslAsyncCommTask . h " <nl> - # include " Scheduler / Scheduler . h " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - class BinarySslServer <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - namespace triagens { <nl> - namespace rest { <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief http server <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - class BinarySslServer : public GeneralSslServer < BinarySslServer , HttpHandlerFactory , BinaryCommTask < BinarySslServer > > , <nl> - public GeneralBinaryServer < BinarySslServer , HttpHandlerFactory , BinaryCommTask < BinarySslServer > > { <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - constructors and destructors <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - public : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief constructs a new http server <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - BinarySslServer ( Scheduler * scheduler , <nl> - Dispatcher * dispatcher , <nl> - HttpHandlerFactory * handlerFactory , <nl> - SSL_CTX * ctx ) <nl> - : GeneralServer < BinarySslServer , HttpHandlerFactory , BinaryCommTask < BinarySslServer > > ( scheduler ) , <nl> - GeneralServerDispatcher < BinarySslServer , HttpHandlerFactory , BinaryCommTask < BinarySslServer > > ( scheduler , dispatcher ) , <nl> - GeneralSslServer < BinarySslServer , HttpHandlerFactory , BinaryCommTask < BinarySslServer > > ( scheduler , dispatcher , handlerFactory , ctx ) , <nl> - GeneralBinaryServer < BinarySslServer , HttpHandlerFactory , BinaryCommTask < BinarySslServer > > ( scheduler , dispatcher , handlerFactory ) { <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief destructor <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - ~ BinarySslServer ( ) { <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - public methods <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - public : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - void handleConnected ( socket_t socket , ConnectionInfo & info ) { <nl> - GeneralSslServer : : handleConnected ( socket , info ) ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - } ; <nl> - } <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - # endif <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - END - OF - FILE <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / Local Variables : <nl> - / / mode : outline - minor <nl> - / / outline - regexp : " ^ \ \ ( / / / @ brief \ \ | / / / { @ inheritDoc } \ \ | / / / @ addtogroup \ \ | / / - - SECTION - - \ \ | / / / @ \ \ } \ \ ) " <nl> - / / End : <nl> deleted file mode 100644 <nl> index 9a9ce25829b . . 00000000000 <nl> mmm a / lib / BinaryServer / GeneralBinaryServer . h <nl> ppp / dev / null <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief general binary server <nl> - / / / <nl> - / / / @ file <nl> - / / / <nl> - / / / DISCLAIMER <nl> - / / / <nl> - / / / Copyright 2004 - 2012 triAGENS GmbH , Cologne , Germany <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> - / / / Copyright holder is triAGENS GmbH , Cologne , Germany <nl> - / / / <nl> - / / / @ author Jan Steemann <nl> - / / / @ author Copyright 2012 , triAGENS GmbH , Cologne , Germany <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - # ifndef TRIAGENS_HTTP_SERVER_GENERAL_BINARY_SERVER_H <nl> - # define TRIAGENS_HTTP_SERVER_GENERAL_BINARY_SERVER_H 1 <nl> - <nl> - # include " GeneralServer / GeneralServerDispatcher . h " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - forward declarations <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - namespace triagens { <nl> - namespace rest { <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - class GeneralBinaryServer <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief binary server implementation <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - template < typename S , typename HF , typename CT > <nl> - class GeneralBinaryServer : virtual public GeneralServerDispatcher < S , HF , CT > { <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - constructors and destructors <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - public : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief constructs a new general binary server <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - GeneralBinaryServer ( Scheduler * scheduler , <nl> - Dispatcher * dispatcher , <nl> - double keepAliveTimeout , <nl> - HF * handlerFactory ) <nl> - : GeneralServer < S , HF , CT > ( scheduler , keepAliveTimeout ) , <nl> - GeneralServerDispatcher < S , HF , CT > ( scheduler , dispatcher , keepAliveTimeout ) , <nl> - _handlerFactory ( handlerFactory ) { <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - public methods <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - public : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief return the protocol to be used <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - Endpoint : : Protocol getProtocol ( ) const { <nl> - return Endpoint : : PROTOCOL_BINARY ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief return the handler factory <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - HF * getHandlerFactory ( ) const { <nl> - return _handlerFactory ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - protected variables <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup HttpServer <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - HF * _handlerFactory ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - } ; <nl> - } <nl> - } <nl> - <nl> - # endif <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - END - OF - FILE <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / Local Variables : <nl> - / / mode : outline - minor <nl> - / / outline - regexp : " ^ \ \ ( / / / @ brief \ \ | / / / { @ inheritDoc } \ \ | / / / @ addtogroup \ \ | / / - - SECTION - - \ \ | / / / @ \ \ } \ \ ) " <nl> - / / End : <nl> mmm a / lib / HttpServer / ApplicationEndpointServer . cpp <nl> ppp b / lib / HttpServer / ApplicationEndpointServer . cpp <nl> <nl> # include " HttpServer / HttpHandlerFactory . h " <nl> # include " HttpServer / HttpServer . h " <nl> # include " HttpServer / HttpsServer . h " <nl> - # include " BinaryServer / BinaryServer . h " <nl> # include " Logger / Logger . h " <nl> # include " Rest / OperationMode . h " <nl> # include " Scheduler / ApplicationScheduler . h " <nl> bool ApplicationEndpointServer : : buildServers ( ) { <nl> _servers . push_back ( server ) ; <nl> } <nl> <nl> - if ( _endpointList . count ( Endpoint : : PROTOCOL_BINARY , Endpoint : : ENCRYPTION_NONE ) > 0 ) { <nl> - / / binary endpoints <nl> - server = new BinaryServer ( _applicationScheduler - > scheduler ( ) , <nl> - _applicationDispatcher - > dispatcher ( ) , <nl> - _keepAliveTimeout , <nl> - _handlerFactory ) ; <nl> - <nl> - server - > setEndpointList ( & _endpointList ) ; <nl> - _servers . push_back ( server ) ; <nl> - } <nl> - <nl> - <nl> / / ssl endpoints <nl> if ( _endpointList . count ( Endpoint : : PROTOCOL_HTTP , Endpoint : : ENCRYPTION_SSL ) > 0 ) { <nl> / / check the ssl context <nl> mmm a / lib / HttpServer / HttpHandler . cpp <nl> ppp b / lib / HttpServer / HttpHandler . cpp <nl> <nl> # include " Logger / Logger . h " <nl> # include " HttpServer / HttpServer . h " <nl> # include " HttpServer / HttpsServer . h " <nl> - # include " BinaryServer / BinaryServer . h " <nl> # include " Rest / HttpRequest . h " <nl> # include " Rest / HttpResponse . h " <nl> # include " GeneralServer / GeneralServerJob . h " <nl> Job * HttpHandler : : createJob ( AsyncJobServer * server ) { <nl> return new GeneralServerJob < HttpsServer , HttpHandlerFactory : : GeneralHandler > ( httpsServer , this ) ; <nl> } <nl> <nl> - BinaryServer * binaryServer = dynamic_cast < BinaryServer * > ( server ) ; <nl> - if ( binaryServer ! = 0 ) { <nl> - return new GeneralServerJob < BinaryServer , HttpHandlerFactory : : GeneralHandler > ( binaryServer , this ) ; <nl> - } <nl> / / stj : end of hack <nl> <nl> LOGGER_WARNING < < " cannot convert AsyncJobServer into a HttpServer " ; <nl> mmm a / lib / Makefile . files <nl> ppp b / lib / Makefile . files <nl> lib_libarango_a_SOURCES = \ <nl> lib / Logger / LoggerStream . cpp \ <nl> lib / Logger / LoggerTiming . cpp \ <nl> lib / ProgramOptions / program - options . c \ <nl> - lib / ProtocolBuffers / HttpRequestProtobuf . cpp \ <nl> - lib / ProtocolBuffers / arangodb . pb . cpp \ <nl> lib / Rest / AnyServer . cpp \ <nl> lib / Rest / EndpointList . cpp \ <nl> lib / Rest / Endpoint . cpp \ <nl> lib_libarango_client_a_SOURCES = \ <nl> lib / SimpleHttpClient / ClientConnection . cpp \ <nl> lib / SimpleHttpClient / SslClientConnection . cpp \ <nl> lib / SimpleHttpClient / SimpleClient . cpp \ <nl> - lib / SimpleHttpClient / SimpleBinaryClient . cpp \ <nl> lib / SimpleHttpClient / SimpleHttpClient . cpp \ <nl> lib / SimpleHttpClient / SimpleHttpResult . cpp <nl> <nl> FLEX_FILES + = \ <nl> FLEXXX_FILES + = \ <nl> lib / V8 / v8 - json . cpp <nl> <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # @ brief protocol buffers <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - PROTOBUF_FILES + = \ <nl> - lib / ProtocolBuffers / arangodb . pb . cpp <nl> - <nl> # # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> # # - - SECTION - - END - OF - FILE <nl> # # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> deleted file mode 100644 <nl> index f9a61748616 . . 00000000000 <nl> mmm a / lib / Makefile . protobuf <nl> ppp / dev / null <nl> <nl> - # - * - mode : Makefile ; - * - <nl> - <nl> - # # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - # # - - SECTION - - PROTOCOL BUFFERS <nl> - # # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # @ brief built sources <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - BUILT_SOURCES + = $ ( PROTOBUF_FILES ) <nl> - <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # # # @ brief protocol buffers <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - <nl> - % . pb . cpp : % . proto @ PROTOBUF_PROTOC @ <nl> - @ PROTOBUF_PROTOC @ - - cpp_out . $ < <nl> - mv $ ( addsuffix . cc , $ ( basename $ @ ) ) $ @ <nl> - <nl> - # # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - # # - - SECTION - - END - OF - FILE <nl> - # # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - # # Local Variables : <nl> - # # mode : outline - minor <nl> - # # outline - regexp : " ^ \ \ ( # # # @ brief \ \ | # # - - SECTION - - \ \ | # - \ \ * - \ \ ) " <nl> - # # End : <nl> deleted file mode 100644 <nl> index 34b0b630909 . . 00000000000 <nl> mmm a / lib / ProtocolBuffers / HttpRequestProtobuf . cpp <nl> ppp / dev / null <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief protobuf http request <nl> - / / / <nl> - / / / @ file <nl> - / / / <nl> - / / / DISCLAIMER <nl> - / / / <nl> - / / / Copyright 2004 - 2012 triAGENS GmbH , Cologne , Germany <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> - / / / Copyright holder is triAGENS GmbH , Cologne , Germany <nl> - / / / <nl> - / / / @ author Dr . Frank Celler <nl> - / / / @ author Achim Brandt <nl> - / / / @ author Copyright 2008 - 2012 , triAGENS GmbH , Cologne , Germany <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - # include " HttpRequestProtobuf . h " <nl> - <nl> - # include " BasicsC / strings . h " <nl> - # include " Basics / StringUtils . h " <nl> - # include " ProtocolBuffers / JsonConverterProtobuf . h " <nl> - <nl> - using namespace triagens : : basics ; <nl> - using namespace triagens : : rest ; <nl> - using namespace std ; <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - local constants <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - static char const * EMPTY_STR = " " ; <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - class HttpRequestProtobuf <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - constructors and destructors <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup Rest <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief http request constructor <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - HttpRequestProtobuf : : HttpRequestProtobuf ( PB_ArangoBatchMessage const & message ) <nl> - : HttpRequest ( ) , <nl> - _valid ( false ) , <nl> - _request ( 0 ) { <nl> - if ( message . type ( ) = = PB_BLOB_REQUEST ) { <nl> - _valid = true ; <nl> - _request = & message . blobrequest ( ) ; <nl> - <nl> - switch ( _request - > requesttype ( ) ) { <nl> - case PB_REQUEST_TYPE_DELETE : <nl> - _type = HTTP_REQUEST_DELETE ; <nl> - break ; <nl> - <nl> - case PB_REQUEST_TYPE_GET : <nl> - _type = HTTP_REQUEST_GET ; <nl> - break ; <nl> - <nl> - case PB_REQUEST_TYPE_HEAD : <nl> - _type = HTTP_REQUEST_HEAD ; <nl> - break ; <nl> - <nl> - case PB_REQUEST_TYPE_POST : <nl> - _type = HTTP_REQUEST_POST ; <nl> - break ; <nl> - <nl> - case PB_REQUEST_TYPE_PUT : <nl> - _type = HTTP_REQUEST_PUT ; <nl> - break ; <nl> - <nl> - case PB_REQUEST_TYPE_PATCH : <nl> - _type = HTTP_REQUEST_PATCH ; <nl> - break ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief destructor <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - HttpRequestProtobuf : : ~ HttpRequestProtobuf ( ) { <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - HttpRequest methods <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup Rest <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - TRI_json_t * HttpRequestProtobuf : : toJson ( char * * errmsg ) { <nl> - TRI_json_t * json = 0 ; <nl> - <nl> - if ( _request - > contenttype ( ) = = PB_JSON_CONTENT ) { <nl> - json = JsonConverterProtobuf : : ParseObject ( TRI_UNKNOWN_MEM_ZONE , _request - > json ( ) ) ; <nl> - } <nl> - else if ( _request - > contenttype ( ) = = PB_NO_CONTENT ) { <nl> - json = TRI_Json2String ( TRI_UNKNOWN_MEM_ZONE , body ( ) , errmsg ) ; <nl> - } <nl> - <nl> - return json ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - char const * HttpRequestProtobuf : : requestPath ( ) const { <nl> - return _request - > url ( ) . c_str ( ) ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - void HttpRequestProtobuf : : write ( TRI_string_buffer_t * buffer ) const { <nl> - switch ( _type ) { <nl> - case HTTP_REQUEST_GET : <nl> - TRI_AppendString2StringBuffer ( buffer , " GET " , 4 ) ; <nl> - break ; <nl> - <nl> - case HTTP_REQUEST_POST : <nl> - TRI_AppendString2StringBuffer ( buffer , " POST " , 5 ) ; <nl> - break ; <nl> - <nl> - case HTTP_REQUEST_PUT : <nl> - TRI_AppendString2StringBuffer ( buffer , " PUT " , 4 ) ; <nl> - break ; <nl> - <nl> - case HTTP_REQUEST_DELETE : <nl> - TRI_AppendString2StringBuffer ( buffer , " DELETE " , 7 ) ; <nl> - break ; <nl> - <nl> - case HTTP_REQUEST_HEAD : <nl> - TRI_AppendString2StringBuffer ( buffer , " HEAD " , 5 ) ; <nl> - break ; <nl> - <nl> - case HTTP_REQUEST_PATCH : <nl> - TRI_AppendString2StringBuffer ( buffer , " PATCH " , 6 ) ; <nl> - break ; <nl> - <nl> - default : <nl> - TRI_AppendString2StringBuffer ( buffer , " UNKNOWN " , 8 ) ; <nl> - break ; <nl> - } <nl> - <nl> - / / do NOT url - encode the path , we need to distingush between <nl> - / / " / document / a / b " and " / document / a % 2fb " <nl> - <nl> - TRI_AppendStringStringBuffer ( buffer , _request - > url ( ) . c_str ( ) ) ; <nl> - <nl> - / / generate the request parameters <nl> - bool first = true ; <nl> - <nl> - for ( : : google : : protobuf : : RepeatedPtrField < PB_ArangoKeyValue > : : const_iterator i = _request - > values ( ) . begin ( ) ; <nl> - i ! = _request - > values ( ) . end ( ) ; <nl> - + + i ) { <nl> - PB_ArangoKeyValue const & kv = * i ; <nl> - <nl> - if ( first ) { <nl> - TRI_AppendCharStringBuffer ( buffer , ' ? ' ) ; <nl> - first = false ; <nl> - } <nl> - else { <nl> - TRI_AppendCharStringBuffer ( buffer , ' & ' ) ; <nl> - } <nl> - <nl> - TRI_AppendUrlEncodedStringStringBuffer ( buffer , kv . key ( ) . c_str ( ) ) ; <nl> - TRI_AppendCharStringBuffer ( buffer , ' = ' ) ; <nl> - TRI_AppendUrlEncodedStringStringBuffer ( buffer , kv . value ( ) . c_str ( ) ) ; <nl> - } <nl> - <nl> - TRI_AppendString2StringBuffer ( buffer , " HTTP / 1 . 1 \ r \ n " , 11 ) ; <nl> - <nl> - / / generate the header fields <nl> - for ( : : google : : protobuf : : RepeatedPtrField < PB_ArangoKeyValue > : : const_iterator i = _request - > headers ( ) . begin ( ) ; <nl> - i ! = _request - > headers ( ) . end ( ) ; <nl> - + + i ) { <nl> - PB_ArangoKeyValue const & kv = * i ; <nl> - <nl> - TRI_AppendStringStringBuffer ( buffer , kv . key ( ) . c_str ( ) ) ; <nl> - TRI_AppendString2StringBuffer ( buffer , " : " , 2 ) ; <nl> - TRI_AppendStringStringBuffer ( buffer , kv . value ( ) . c_str ( ) ) ; <nl> - TRI_AppendString2StringBuffer ( buffer , " \ r \ n " , 2 ) ; <nl> - } <nl> - <nl> - TRI_AppendString2StringBuffer ( buffer , " content - length : " , 16 ) ; <nl> - TRI_AppendUInt64StringBuffer ( buffer , _request - > content ( ) . size ( ) ) ; <nl> - TRI_AppendString2StringBuffer ( buffer , " \ r \ n \ r \ n " , 4 ) ; <nl> - TRI_AppendString2StringBuffer ( buffer , _request - > content ( ) . c_str ( ) , _request - > content ( ) . size ( ) ) ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - size_t HttpRequestProtobuf : : contentLength ( ) const { <nl> - return _request - > content ( ) . size ( ) ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - char const * HttpRequestProtobuf : : header ( char const * key ) const { <nl> - map < string , string > result ; <nl> - <nl> - : : google : : protobuf : : RepeatedPtrField < PB_ArangoKeyValue > : : const_iterator i = _request - > headers ( ) . begin ( ) ; <nl> - <nl> - for ( ; i ! = _request - > headers ( ) . end ( ) ; + + i ) { <nl> - PB_ArangoKeyValue const & kv = * i ; <nl> - <nl> - if ( TRI_EqualString ( key , kv . key ( ) . c_str ( ) ) ) { <nl> - return kv . value ( ) . c_str ( ) ; <nl> - } <nl> - } <nl> - <nl> - return EMPTY_STR ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - char const * HttpRequestProtobuf : : header ( char const * key , bool & found ) const { <nl> - map < string , string > result ; <nl> - <nl> - : : google : : protobuf : : RepeatedPtrField < PB_ArangoKeyValue > : : const_iterator i = _request - > headers ( ) . begin ( ) ; <nl> - <nl> - for ( ; i ! = _request - > headers ( ) . end ( ) ; + + i ) { <nl> - PB_ArangoKeyValue const & kv = * i ; <nl> - <nl> - if ( TRI_EqualString ( key , kv . key ( ) . c_str ( ) ) ) { <nl> - found = true ; <nl> - return kv . value ( ) . c_str ( ) ; <nl> - } <nl> - } <nl> - <nl> - found = false ; <nl> - return EMPTY_STR ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - map < string , string > HttpRequestProtobuf : : headers ( ) const { <nl> - map < string , string > result ; <nl> - <nl> - : : google : : protobuf : : RepeatedPtrField < PB_ArangoKeyValue > : : const_iterator i = _request - > headers ( ) . begin ( ) ; <nl> - <nl> - for ( ; i ! = _request - > headers ( ) . end ( ) ; + + i ) { <nl> - PB_ArangoKeyValue const & kv = * i ; <nl> - <nl> - result [ kv . key ( ) ] = kv . value ( ) ; <nl> - } <nl> - <nl> - result [ " content - length " ] = StringUtils : : itoa ( _request - > content ( ) . size ( ) ) ; <nl> - <nl> - return result ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - char const * HttpRequestProtobuf : : value ( char const * key ) const { <nl> - map < string , string > result ; <nl> - <nl> - : : google : : protobuf : : RepeatedPtrField < PB_ArangoKeyValue > : : const_iterator i = _request - > values ( ) . begin ( ) ; <nl> - <nl> - for ( ; i ! = _request - > values ( ) . end ( ) ; + + i ) { <nl> - PB_ArangoKeyValue const & kv = * i ; <nl> - <nl> - if ( TRI_EqualString ( key , kv . key ( ) . c_str ( ) ) ) { <nl> - return kv . value ( ) . c_str ( ) ; <nl> - } <nl> - } <nl> - <nl> - return EMPTY_STR ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - char const * HttpRequestProtobuf : : value ( char const * key , bool & found ) const { <nl> - map < string , string > result ; <nl> - <nl> - : : google : : protobuf : : RepeatedPtrField < PB_ArangoKeyValue > : : const_iterator i = _request - > values ( ) . begin ( ) ; <nl> - <nl> - for ( ; i ! = _request - > values ( ) . end ( ) ; + + i ) { <nl> - PB_ArangoKeyValue const & kv = * i ; <nl> - <nl> - if ( TRI_EqualString ( key , kv . key ( ) . c_str ( ) ) ) { <nl> - found = true ; <nl> - return kv . value ( ) . c_str ( ) ; <nl> - } <nl> - } <nl> - <nl> - found = false ; <nl> - return EMPTY_STR ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - map < string , string > HttpRequestProtobuf : : values ( ) const { <nl> - map < string , string > result ; <nl> - <nl> - : : google : : protobuf : : RepeatedPtrField < PB_ArangoKeyValue > : : const_iterator i = _request - > values ( ) . begin ( ) ; <nl> - <nl> - for ( ; i ! = _request - > values ( ) . end ( ) ; + + i ) { <nl> - PB_ArangoKeyValue const & kv = * i ; <nl> - <nl> - result [ kv . key ( ) ] = kv . value ( ) ; <nl> - } <nl> - <nl> - return result ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - char const * HttpRequestProtobuf : : body ( ) const { <nl> - return _request - > content ( ) . c_str ( ) ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - size_t HttpRequestProtobuf : : bodySize ( ) const { <nl> - return _request - > content ( ) . size ( ) ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - int HttpRequestProtobuf : : setBody ( char const * newBody , size_t length ) { <nl> - return TRI_ERROR_NOT_IMPLEMENTED ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - int HttpRequestProtobuf : : setBodyReference ( char * newBody , size_t length ) { <nl> - return TRI_ERROR_NOT_IMPLEMENTED ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - public methods <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup Rest <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief true if message is valid <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - bool HttpRequestProtobuf : : isValid ( ) const { <nl> - return _valid ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - END - OF - FILE <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / Local Variables : <nl> - / / mode : outline - minor <nl> - / / outline - regexp : " ^ \ \ ( / / / @ brief \ \ | / / / { @ inheritDoc } \ \ | / / / @ addtogroup \ \ | / / / @ page \ \ | / / - - SECTION - - \ \ | / / / @ \ \ } \ \ ) " <nl> - / / End : <nl> deleted file mode 100644 <nl> index 0cf51cee2c3 . . 00000000000 <nl> mmm a / lib / ProtocolBuffers / HttpRequestProtobuf . h <nl> ppp / dev / null <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief protobuf http request <nl> - / / / <nl> - / / / @ file <nl> - / / / <nl> - / / / DISCLAIMER <nl> - / / / <nl> - / / / Copyright 2004 - 2012 triAGENS GmbH , Cologne , Germany <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> - / / / Copyright holder is triAGENS GmbH , Cologne , Germany <nl> - / / / <nl> - / / / @ author Dr . Frank Celler <nl> - / / / @ author Achim Brandt <nl> - / / / @ author Copyright 2004 - 2012 , triAGENS GmbH , Cologne , Germany <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - # ifndef TRIAGENS_REST_HTTP_REQUEST_PROTOBUF_H <nl> - # define TRIAGENS_REST_HTTP_REQUEST_PROTOBUF_H 1 <nl> - <nl> - # include " Rest / HttpRequest . h " <nl> - # include " ProtocolBuffers / arangodb . pb . h " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - class HttpRequestPlain <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup Rest <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - namespace triagens { <nl> - namespace rest { <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief http request <nl> - / / / <nl> - / / / The http server reads the request string from the client and converts it <nl> - / / / into an instance of this class . An http request object provides methods to <nl> - / / / inspect the header and parameter fields . <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - class HttpRequestProtobuf : public HttpRequest { <nl> - private : <nl> - HttpRequestProtobuf ( HttpRequestProtobuf const & ) ; <nl> - HttpRequestProtobuf & operator = ( HttpRequestProtobuf const & ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - constructors and destructors <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup Rest <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - public : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief http request constructor <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - HttpRequestProtobuf ( PB_ArangoBatchMessage const & ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief destructor <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - ~ HttpRequestProtobuf ( ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - HttpRequest methods <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup Rest <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - public : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - virtual TRI_json_t * toJson ( char * * ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - char const * requestPath ( ) const ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - void write ( TRI_string_buffer_t * ) const ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - size_t contentLength ( ) const ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - char const * header ( char const * field ) const ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - char const * header ( char const * field , bool & found ) const ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - map < string , string > headers ( ) const ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - char const * value ( char const * key ) const ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - char const * value ( char const * key , bool & found ) const ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - map < string , string > values ( ) const ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - char const * body ( ) const ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - size_t bodySize ( ) const ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - int setBody ( char const * newBody , size_t length ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / { @ inheritDoc } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - int setBodyReference ( char * newBody , size_t length ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - public methods <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup Rest <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - public : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief true if message is valid <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - bool isValid ( ) const ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - private variables <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup Rest <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - private : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief valid flag <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - bool _valid ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief arango message <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - PB_ArangoBlobRequest const * _request ; <nl> - } ; <nl> - } <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - # endif <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - END - OF - FILE <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / Local Variables : <nl> - / / mode : outline - minor <nl> - / / outline - regexp : " ^ \ \ ( / / / @ brief \ \ | / / / { @ inheritDoc } \ \ | / / / @ addtogroup \ \ | / / / @ page \ \ | / / - - SECTION - - \ \ | / / / @ \ \ } \ \ ) " <nl> - / / End : <nl> deleted file mode 100644 <nl> index 98ab3b8b36f . . 00000000000 <nl> mmm a / lib / ProtocolBuffers / JsonConverterProtobuf . h <nl> ppp / dev / null <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief protobuf to json converter helper functions <nl> - / / / <nl> - / / / @ file <nl> - / / / <nl> - / / / DISCLAIMER <nl> - / / / <nl> - / / / Copyright 2004 - 2012 triAGENS GmbH , Cologne , Germany <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> - / / / Copyright holder is triAGENS GmbH , Cologne , Germany <nl> - / / / <nl> - / / / @ author Jan Steemann <nl> - / / / @ author Copyright 2012 , triAGENS GmbH , Cologne , Germany <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - # ifndef TRIAGENS_PROTOCOL_BUFFERS_JSON_CONVERTER_PROTOBUF_H <nl> - # define TRIAGENS_PROTOCOL_BUFFERS_JSON_CONVERTER_PROTOBUF_H 1 <nl> - <nl> - # include " BasicsC / json . h " <nl> - <nl> - # include " Logger / Logger . h " <nl> - # include " ProtocolBuffers / arangodb . pb . h " <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - class JsonConverterProtobuf <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup Rest <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - namespace triagens { <nl> - namespace rest { <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief json to protobuf and vice versa conversion functions <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - class JsonConverterProtobuf { <nl> - private : <nl> - JsonConverterProtobuf ( JsonConverterProtobuf const & ) ; <nl> - JsonConverterProtobuf & operator = ( JsonConverterProtobuf const & ) ; <nl> - JsonConverterProtobuf ( ) ; <nl> - ~ JsonConverterProtobuf ( ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - public static methods <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ addtogroup Rest <nl> - / / / @ { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - public : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief convert a protobuf json list object into a TRI_json_t * <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - static TRI_json_t * ParseList ( TRI_memory_zone_t * zone , <nl> - const PB_ArangoJsonValue & object ) { <nl> - TRI_json_t * result = TRI_CreateListJson ( zone ) ; <nl> - <nl> - for ( int i = 0 ; i < object . objects_size ( ) ; + + i ) { <nl> - const PB_ArangoJsonContent & atom = object . objects ( i ) ; <nl> - <nl> - TRI_json_t * json = ParseObject ( zone , atom ) ; <nl> - TRI_PushBack3ListJson ( zone , result , json ) ; <nl> - } <nl> - <nl> - return result ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief convert a protobuf json array object into a TRI_json_t * <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - static TRI_json_t * ParseArray ( TRI_memory_zone_t * zone , <nl> - const PB_ArangoJsonValue & object ) { <nl> - TRI_json_t * result = TRI_CreateArrayJson ( zone ) ; <nl> - <nl> - for ( int i = 0 ; i < object . objects_size ( ) ; ) { <nl> - const PB_ArangoJsonContent & key = object . objects ( i ) ; <nl> - const PB_ArangoJsonContent & value = object . objects ( i + 1 ) ; <nl> - i + = 2 ; <nl> - <nl> - if ( key . type ( ) ! = PB_REQUEST_TYPE_STRING ) { <nl> - LOGGER_WARNING < < " invalid json contained in protobuf message " ; <nl> - return 0 ; <nl> - } <nl> - <nl> - TRI_json_t * json = ParseObject ( zone , value ) ; <nl> - TRI_InsertArrayJson ( zone , result , key . value ( ) . stringvalue ( ) . c_str ( ) , json ) ; <nl> - } <nl> - <nl> - return result ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief convert a protobuf json object into a TRI_json_t * <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - static TRI_json_t * ParseObject ( TRI_memory_zone_t * zone , <nl> - const PB_ArangoJsonContent & object ) { <nl> - TRI_json_t * result ; <nl> - <nl> - switch ( object . type ( ) ) { <nl> - case PB_REQUEST_TYPE_NULL : { <nl> - result = TRI_CreateNullJson ( zone ) ; <nl> - break ; <nl> - } <nl> - <nl> - case PB_REQUEST_TYPE_BOOLEAN : { <nl> - result = TRI_CreateBooleanJson ( zone , object . value ( ) . booleanvalue ( ) ) ; <nl> - break ; <nl> - } <nl> - <nl> - case PB_REQUEST_TYPE_NUMBER : { <nl> - result = TRI_CreateNumberJson ( zone , object . value ( ) . numbervalue ( ) ) ; <nl> - break ; <nl> - } <nl> - <nl> - case PB_REQUEST_TYPE_STRING : { <nl> - result = TRI_CreateString2CopyJson ( zone , ( char * ) object . value ( ) . stringvalue ( ) . c_str ( ) , object . value ( ) . stringvalue ( ) . size ( ) ) ; <nl> - break ; <nl> - } <nl> - <nl> - case PB_REQUEST_TYPE_ARRAY : { <nl> - result = ParseArray ( zone , object . value ( ) ) ; <nl> - break ; <nl> - } <nl> - <nl> - case PB_REQUEST_TYPE_LIST : { <nl> - result = ParseList ( zone , object . value ( ) ) ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - return result ; <nl> - } <nl> - <nl> - } ; <nl> - } <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ } <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - # endif <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - END - OF - FILE <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / Local Variables : <nl> - / / mode : outline - minor <nl> - / / outline - regexp : " ^ \ \ ( / / / @ brief \ \ | / / / { @ inheritDoc } \ \ | / / / @ addtogroup \ \ | / / / @ page \ \ | / / - - SECTION - - \ \ | / / / @ \ \ } \ \ ) " <nl> - / / End : <nl> deleted file mode 100644 <nl> index 0de4d3124cb . . 00000000000 <nl> mmm a / lib / ProtocolBuffers / arangodb . pb . cpp <nl> ppp / dev / null <nl> <nl> - / / Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> - <nl> - # define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION <nl> - # include " lib / ProtocolBuffers / arangodb . pb . h " <nl> - <nl> - # include < algorithm > <nl> - <nl> - # include < google / protobuf / stubs / once . h > <nl> - # include < google / protobuf / io / coded_stream . h > <nl> - # include < google / protobuf / wire_format_lite_inl . h > <nl> - # include < google / protobuf / descriptor . h > <nl> - # include < google / protobuf / reflection_ops . h > <nl> - # include < google / protobuf / wire_format . h > <nl> - / / @ @ protoc_insertion_point ( includes ) <nl> - <nl> - namespace { <nl> - <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoKeyValue_descriptor_ = NULL ; <nl> - const : : google : : protobuf : : internal : : GeneratedMessageReflection * <nl> - PB_ArangoKeyValue_reflection_ = NULL ; <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoMessage_descriptor_ = NULL ; <nl> - const : : google : : protobuf : : internal : : GeneratedMessageReflection * <nl> - PB_ArangoMessage_reflection_ = NULL ; <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoBatchMessage_descriptor_ = NULL ; <nl> - const : : google : : protobuf : : internal : : GeneratedMessageReflection * <nl> - PB_ArangoBatchMessage_reflection_ = NULL ; <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoJsonValue_descriptor_ = NULL ; <nl> - const : : google : : protobuf : : internal : : GeneratedMessageReflection * <nl> - PB_ArangoJsonValue_reflection_ = NULL ; <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoJsonContent_descriptor_ = NULL ; <nl> - const : : google : : protobuf : : internal : : GeneratedMessageReflection * <nl> - PB_ArangoJsonContent_reflection_ = NULL ; <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoBlobRequest_descriptor_ = NULL ; <nl> - const : : google : : protobuf : : internal : : GeneratedMessageReflection * <nl> - PB_ArangoBlobRequest_reflection_ = NULL ; <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoBlobResponse_descriptor_ = NULL ; <nl> - const : : google : : protobuf : : internal : : GeneratedMessageReflection * <nl> - PB_ArangoBlobResponse_reflection_ = NULL ; <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoErrorResponse_descriptor_ = NULL ; <nl> - const : : google : : protobuf : : internal : : GeneratedMessageReflection * <nl> - PB_ArangoErrorResponse_reflection_ = NULL ; <nl> - const : : google : : protobuf : : EnumDescriptor * PB_ArangoMessageType_descriptor_ = NULL ; <nl> - const : : google : : protobuf : : EnumDescriptor * PB_ArangoMessageContentType_descriptor_ = NULL ; <nl> - const : : google : : protobuf : : EnumDescriptor * PB_ArangoRequestType_descriptor_ = NULL ; <nl> - const : : google : : protobuf : : EnumDescriptor * PB_ArangoJsonType_descriptor_ = NULL ; <nl> - <nl> - } / / namespace <nl> - <nl> - <nl> - void protobuf_AssignDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) { <nl> - protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - const : : google : : protobuf : : FileDescriptor * file = <nl> - : : google : : protobuf : : DescriptorPool : : generated_pool ( ) - > FindFileByName ( <nl> - " lib / ProtocolBuffers / arangodb . proto " ) ; <nl> - GOOGLE_CHECK ( file ! = NULL ) ; <nl> - PB_ArangoKeyValue_descriptor_ = file - > message_type ( 0 ) ; <nl> - static const int PB_ArangoKeyValue_offsets_ [ 2 ] = { <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoKeyValue , key_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoKeyValue , value_ ) , <nl> - } ; <nl> - PB_ArangoKeyValue_reflection_ = <nl> - new : : google : : protobuf : : internal : : GeneratedMessageReflection ( <nl> - PB_ArangoKeyValue_descriptor_ , <nl> - PB_ArangoKeyValue : : default_instance_ , <nl> - PB_ArangoKeyValue_offsets_ , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoKeyValue , _has_bits_ [ 0 ] ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoKeyValue , _unknown_fields_ ) , <nl> - - 1 , <nl> - : : google : : protobuf : : DescriptorPool : : generated_pool ( ) , <nl> - : : google : : protobuf : : MessageFactory : : generated_factory ( ) , <nl> - sizeof ( PB_ArangoKeyValue ) ) ; <nl> - PB_ArangoMessage_descriptor_ = file - > message_type ( 1 ) ; <nl> - static const int PB_ArangoMessage_offsets_ [ 1 ] = { <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoMessage , messages_ ) , <nl> - } ; <nl> - PB_ArangoMessage_reflection_ = <nl> - new : : google : : protobuf : : internal : : GeneratedMessageReflection ( <nl> - PB_ArangoMessage_descriptor_ , <nl> - PB_ArangoMessage : : default_instance_ , <nl> - PB_ArangoMessage_offsets_ , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoMessage , _has_bits_ [ 0 ] ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoMessage , _unknown_fields_ ) , <nl> - - 1 , <nl> - : : google : : protobuf : : DescriptorPool : : generated_pool ( ) , <nl> - : : google : : protobuf : : MessageFactory : : generated_factory ( ) , <nl> - sizeof ( PB_ArangoMessage ) ) ; <nl> - PB_ArangoBatchMessage_descriptor_ = file - > message_type ( 2 ) ; <nl> - static const int PB_ArangoBatchMessage_offsets_ [ 4 ] = { <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBatchMessage , type_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBatchMessage , blobrequest_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBatchMessage , blobresponse_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBatchMessage , errorresponse_ ) , <nl> - } ; <nl> - PB_ArangoBatchMessage_reflection_ = <nl> - new : : google : : protobuf : : internal : : GeneratedMessageReflection ( <nl> - PB_ArangoBatchMessage_descriptor_ , <nl> - PB_ArangoBatchMessage : : default_instance_ , <nl> - PB_ArangoBatchMessage_offsets_ , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBatchMessage , _has_bits_ [ 0 ] ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBatchMessage , _unknown_fields_ ) , <nl> - - 1 , <nl> - : : google : : protobuf : : DescriptorPool : : generated_pool ( ) , <nl> - : : google : : protobuf : : MessageFactory : : generated_factory ( ) , <nl> - sizeof ( PB_ArangoBatchMessage ) ) ; <nl> - PB_ArangoJsonValue_descriptor_ = file - > message_type ( 3 ) ; <nl> - static const int PB_ArangoJsonValue_offsets_ [ 4 ] = { <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoJsonValue , booleanvalue_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoJsonValue , numbervalue_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoJsonValue , stringvalue_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoJsonValue , objects_ ) , <nl> - } ; <nl> - PB_ArangoJsonValue_reflection_ = <nl> - new : : google : : protobuf : : internal : : GeneratedMessageReflection ( <nl> - PB_ArangoJsonValue_descriptor_ , <nl> - PB_ArangoJsonValue : : default_instance_ , <nl> - PB_ArangoJsonValue_offsets_ , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoJsonValue , _has_bits_ [ 0 ] ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoJsonValue , _unknown_fields_ ) , <nl> - - 1 , <nl> - : : google : : protobuf : : DescriptorPool : : generated_pool ( ) , <nl> - : : google : : protobuf : : MessageFactory : : generated_factory ( ) , <nl> - sizeof ( PB_ArangoJsonValue ) ) ; <nl> - PB_ArangoJsonContent_descriptor_ = file - > message_type ( 4 ) ; <nl> - static const int PB_ArangoJsonContent_offsets_ [ 2 ] = { <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoJsonContent , type_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoJsonContent , value_ ) , <nl> - } ; <nl> - PB_ArangoJsonContent_reflection_ = <nl> - new : : google : : protobuf : : internal : : GeneratedMessageReflection ( <nl> - PB_ArangoJsonContent_descriptor_ , <nl> - PB_ArangoJsonContent : : default_instance_ , <nl> - PB_ArangoJsonContent_offsets_ , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoJsonContent , _has_bits_ [ 0 ] ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoJsonContent , _unknown_fields_ ) , <nl> - - 1 , <nl> - : : google : : protobuf : : DescriptorPool : : generated_pool ( ) , <nl> - : : google : : protobuf : : MessageFactory : : generated_factory ( ) , <nl> - sizeof ( PB_ArangoJsonContent ) ) ; <nl> - PB_ArangoBlobRequest_descriptor_ = file - > message_type ( 5 ) ; <nl> - static const int PB_ArangoBlobRequest_offsets_ [ 7 ] = { <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobRequest , requesttype_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobRequest , url_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobRequest , values_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobRequest , headers_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobRequest , contenttype_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobRequest , content_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobRequest , json_ ) , <nl> - } ; <nl> - PB_ArangoBlobRequest_reflection_ = <nl> - new : : google : : protobuf : : internal : : GeneratedMessageReflection ( <nl> - PB_ArangoBlobRequest_descriptor_ , <nl> - PB_ArangoBlobRequest : : default_instance_ , <nl> - PB_ArangoBlobRequest_offsets_ , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobRequest , _has_bits_ [ 0 ] ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobRequest , _unknown_fields_ ) , <nl> - - 1 , <nl> - : : google : : protobuf : : DescriptorPool : : generated_pool ( ) , <nl> - : : google : : protobuf : : MessageFactory : : generated_factory ( ) , <nl> - sizeof ( PB_ArangoBlobRequest ) ) ; <nl> - PB_ArangoBlobResponse_descriptor_ = file - > message_type ( 6 ) ; <nl> - static const int PB_ArangoBlobResponse_offsets_ [ 5 ] = { <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobResponse , status_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobResponse , headers_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobResponse , contenttype_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobResponse , contentlength_ ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobResponse , content_ ) , <nl> - } ; <nl> - PB_ArangoBlobResponse_reflection_ = <nl> - new : : google : : protobuf : : internal : : GeneratedMessageReflection ( <nl> - PB_ArangoBlobResponse_descriptor_ , <nl> - PB_ArangoBlobResponse : : default_instance_ , <nl> - PB_ArangoBlobResponse_offsets_ , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobResponse , _has_bits_ [ 0 ] ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoBlobResponse , _unknown_fields_ ) , <nl> - - 1 , <nl> - : : google : : protobuf : : DescriptorPool : : generated_pool ( ) , <nl> - : : google : : protobuf : : MessageFactory : : generated_factory ( ) , <nl> - sizeof ( PB_ArangoBlobResponse ) ) ; <nl> - PB_ArangoErrorResponse_descriptor_ = file - > message_type ( 7 ) ; <nl> - static const int PB_ArangoErrorResponse_offsets_ [ 1 ] = { <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoErrorResponse , message_ ) , <nl> - } ; <nl> - PB_ArangoErrorResponse_reflection_ = <nl> - new : : google : : protobuf : : internal : : GeneratedMessageReflection ( <nl> - PB_ArangoErrorResponse_descriptor_ , <nl> - PB_ArangoErrorResponse : : default_instance_ , <nl> - PB_ArangoErrorResponse_offsets_ , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoErrorResponse , _has_bits_ [ 0 ] ) , <nl> - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET ( PB_ArangoErrorResponse , _unknown_fields_ ) , <nl> - - 1 , <nl> - : : google : : protobuf : : DescriptorPool : : generated_pool ( ) , <nl> - : : google : : protobuf : : MessageFactory : : generated_factory ( ) , <nl> - sizeof ( PB_ArangoErrorResponse ) ) ; <nl> - PB_ArangoMessageType_descriptor_ = file - > enum_type ( 0 ) ; <nl> - PB_ArangoMessageContentType_descriptor_ = file - > enum_type ( 1 ) ; <nl> - PB_ArangoRequestType_descriptor_ = file - > enum_type ( 2 ) ; <nl> - PB_ArangoJsonType_descriptor_ = file - > enum_type ( 3 ) ; <nl> - } <nl> - <nl> - namespace { <nl> - <nl> - GOOGLE_PROTOBUF_DECLARE_ONCE ( protobuf_AssignDescriptors_once_ ) ; <nl> - inline void protobuf_AssignDescriptorsOnce ( ) { <nl> - : : google : : protobuf : : GoogleOnceInit ( & protobuf_AssignDescriptors_once_ , <nl> - & protobuf_AssignDesc_lib_2fProtocolBuffers_2farangodb_2eproto ) ; <nl> - } <nl> - <nl> - void protobuf_RegisterTypes ( const : : std : : string & ) { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - : : google : : protobuf : : MessageFactory : : InternalRegisterGeneratedMessage ( <nl> - PB_ArangoKeyValue_descriptor_ , & PB_ArangoKeyValue : : default_instance ( ) ) ; <nl> - : : google : : protobuf : : MessageFactory : : InternalRegisterGeneratedMessage ( <nl> - PB_ArangoMessage_descriptor_ , & PB_ArangoMessage : : default_instance ( ) ) ; <nl> - : : google : : protobuf : : MessageFactory : : InternalRegisterGeneratedMessage ( <nl> - PB_ArangoBatchMessage_descriptor_ , & PB_ArangoBatchMessage : : default_instance ( ) ) ; <nl> - : : google : : protobuf : : MessageFactory : : InternalRegisterGeneratedMessage ( <nl> - PB_ArangoJsonValue_descriptor_ , & PB_ArangoJsonValue : : default_instance ( ) ) ; <nl> - : : google : : protobuf : : MessageFactory : : InternalRegisterGeneratedMessage ( <nl> - PB_ArangoJsonContent_descriptor_ , & PB_ArangoJsonContent : : default_instance ( ) ) ; <nl> - : : google : : protobuf : : MessageFactory : : InternalRegisterGeneratedMessage ( <nl> - PB_ArangoBlobRequest_descriptor_ , & PB_ArangoBlobRequest : : default_instance ( ) ) ; <nl> - : : google : : protobuf : : MessageFactory : : InternalRegisterGeneratedMessage ( <nl> - PB_ArangoBlobResponse_descriptor_ , & PB_ArangoBlobResponse : : default_instance ( ) ) ; <nl> - : : google : : protobuf : : MessageFactory : : InternalRegisterGeneratedMessage ( <nl> - PB_ArangoErrorResponse_descriptor_ , & PB_ArangoErrorResponse : : default_instance ( ) ) ; <nl> - } <nl> - <nl> - } / / namespace <nl> - <nl> - void protobuf_ShutdownFile_lib_2fProtocolBuffers_2farangodb_2eproto ( ) { <nl> - delete PB_ArangoKeyValue : : default_instance_ ; <nl> - delete PB_ArangoKeyValue_reflection_ ; <nl> - delete PB_ArangoMessage : : default_instance_ ; <nl> - delete PB_ArangoMessage_reflection_ ; <nl> - delete PB_ArangoBatchMessage : : default_instance_ ; <nl> - delete PB_ArangoBatchMessage_reflection_ ; <nl> - delete PB_ArangoJsonValue : : default_instance_ ; <nl> - delete PB_ArangoJsonValue_reflection_ ; <nl> - delete PB_ArangoJsonContent : : default_instance_ ; <nl> - delete PB_ArangoJsonContent_reflection_ ; <nl> - delete PB_ArangoBlobRequest : : default_instance_ ; <nl> - delete PB_ArangoBlobRequest_reflection_ ; <nl> - delete PB_ArangoBlobResponse : : default_instance_ ; <nl> - delete PB_ArangoBlobResponse_reflection_ ; <nl> - delete PB_ArangoErrorResponse : : default_instance_ ; <nl> - delete PB_ArangoErrorResponse_reflection_ ; <nl> - } <nl> - <nl> - void protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) { <nl> - static bool already_here = false ; <nl> - if ( already_here ) return ; <nl> - already_here = true ; <nl> - GOOGLE_PROTOBUF_VERIFY_VERSION ; <nl> - <nl> - : : google : : protobuf : : DescriptorPool : : InternalAddGeneratedFile ( <nl> - " \ n \ " lib / ProtocolBuffers / arangodb . proto \ " / \ n \ 021 " <nl> - " PB_ArangoKeyValue \ 022 \ 013 \ n \ 003key \ 030 \ 001 \ 002 ( \ t \ 022 \ r \ n \ 005value \ 030 " <nl> - " \ 002 \ 002 ( \ t \ " < \ n \ 020PB_ArangoMessage \ 022 ( \ n \ 010messages \ 030 \ 001 " <nl> - " \ 003 ( \ 0132 \ 026 . PB_ArangoBatchMessage \ " \ 306 \ 001 \ n \ 025PB_Arang " <nl> - " oBatchMessage \ 022 # \ n \ 004type \ 030 \ 001 \ 002 ( \ 0162 \ 025 . PB_ArangoM " <nl> - " essageType \ 022 * \ n \ 013blobRequest \ 030 \ 002 \ 001 ( \ 0132 \ 025 . PB_Ara " <nl> - " ngoBlobRequest \ 022 , \ n \ 014blobResponse \ 030 \ 003 \ 001 ( \ 0132 \ 026 . P " <nl> - " B_ArangoBlobResponse \ 022 . \ n \ rerrorResponse \ 030 \ 004 " <nl> - " \ 001 ( \ 0132 \ 027 . PB_ArangoErrorResponse \ " | \ n \ 022PB_Arang " <nl> - " oJsonValue \ 022 \ 024 \ n \ 014booleanValue \ 030 \ 001 \ 001 ( \ 010 \ 022 \ 023 \ n \ 013numb " <nl> - " erValue \ 030 \ 002 \ 001 ( \ 001 \ 022 \ 023 \ n \ 013stringValue \ 030 \ 003 \ 001 ( \ t \ 022 & \ n \ 007ob " <nl> - " jects \ 030 \ 004 \ 003 ( \ 0132 \ 025 . PB_ArangoJsonContent \ " \ \ \ n \ 024PB " <nl> - " _ArangoJsonContent \ 022 \ n \ 004type \ 030 \ 001 \ 002 ( \ 0162 \ 022 . PB_Ar " <nl> - " angoJsonType \ 022 \ " \ n \ 005value \ 030 \ 002 \ 001 ( \ 0132 \ 023 . PB_ArangoJ " <nl> - " sonValue \ " \ 201 \ 002 \ n \ 024PB_ArangoBlobRequest \ 022 * \ n \ 013req " <nl> - " uestType \ 030 \ 001 \ 002 ( \ 0162 \ 025 . PB_ArangoRequestType \ 022 \ 013 \ n " <nl> - " \ 003url \ 030 \ 002 \ 002 ( \ t \ 022 \ " \ n \ 006values \ 030 \ 003 \ 003 ( \ 0132 \ 022 . PB_ArangoKe " <nl> - " yValue \ 022 # \ n \ 007headers \ 030 \ 004 \ 003 ( \ 0132 \ 022 . PB_ArangoKeyVa " <nl> - " lue \ 0221 \ n \ 013contentType \ 030 \ 005 \ 002 ( \ 0162 \ 034 . PB_ArangoMess " <nl> - " ageContentType \ 022 \ 017 \ n \ 007content \ 030 \ 007 \ 001 ( \ t \ 022 # \ n \ 004json \ 030 " <nl> - " \ 010 \ 001 ( \ 0132 \ 025 . PB_ArangoJsonContent \ " \ 247 \ 001 \ n \ 025PB_Aran " <nl> - " goBlobResponse \ 022 \ 016 \ n \ 006status \ 030 \ 001 \ 002 ( \ 005 \ 022 # \ n \ 007header " <nl> - " s \ 030 \ 002 \ 003 ( \ 0132 \ 022 . PB_ArangoKeyValue \ 0221 \ n \ 013contentTy " <nl> - " pe \ 030 \ 003 \ 002 ( \ 0162 \ 034 . PB_ArangoMessageContentType \ 022 \ 025 " <nl> - " \ n \ rcontentLength \ 030 \ 006 \ 002 ( \ 005 \ 022 \ 017 \ n \ 007content \ 030 \ 004 \ 001 ( \ t \ " ) " <nl> - " \ n \ 026PB_ArangoErrorResponse \ 022 \ 017 \ n \ 007message \ 030 \ 001 \ 002 ( " <nl> - " \ t * X \ n \ 024PB_ArangoMessageType \ 022 \ 023 \ n \ 017PB_BLOB_REQ " <nl> - " UEST \ 020 \ 000 \ 022 \ 024 \ n \ 020PB_BLOB_RESPONSE \ 020 \ 001 \ 022 \ 025 \ n \ 021PB_ERROR " <nl> - " _RESPONSE \ 020 \ 002 * Z \ n \ 033PB_ArangoMessageContentTy " <nl> - " pe \ 022 \ 021 \ n \ rPB_NO_CONTENT \ 020 \ 000 \ 022 \ 023 \ n \ 017PB_TEXT_CONTENT " <nl> - " \ 020 \ 001 \ 022 \ 023 \ n \ 017PB_JSON_CONTENT \ 020 \ 002 * \ 263 \ 001 \ n \ 024PB_ArangoReq " <nl> - " uestType \ 022 \ 032 \ n \ 026PB_REQUEST_TYPE_DELETE \ 020 \ 000 \ 022 \ 027 \ n \ 023 " <nl> - " PB_REQUEST_TYPE_GET \ 020 \ 001 \ 022 \ 030 \ n \ 024PB_REQUEST_TYPE " <nl> - " _HEAD \ 020 \ 002 \ 022 \ 030 \ n \ 024PB_REQUEST_TYPE_POST \ 020 \ 003 \ 022 \ 027 \ n \ 023PB_ " <nl> - " REQUEST_TYPE_PUT \ 020 \ 004 \ 022 \ 031 \ n \ 025PB_REQUEST_TYPE_PA " <nl> - " TCH \ 020 \ 005 * \ 267 \ 001 \ n \ 021PB_ArangoJsonType \ 022 \ 030 \ n \ 024PB_REQUES " <nl> - " T_TYPE_NULL \ 020 \ 000 \ 022 \ 033 \ n \ 027PB_REQUEST_TYPE_BOOLEAN " <nl> - " \ 020 \ 001 \ 022 \ 032 \ n \ 026PB_REQUEST_TYPE_NUMBER \ 020 \ 002 \ 022 \ 032 \ n \ 026PB_REQ " <nl> - " UEST_TYPE_STRING \ 020 \ 003 \ 022 \ 031 \ n \ 025PB_REQUEST_TYPE_AR " <nl> - " RAY \ 020 \ 004 \ 022 \ 030 \ n \ 024PB_REQUEST_TYPE_LIST \ 020 \ 005 " , 1591 ) ; <nl> - : : google : : protobuf : : MessageFactory : : InternalRegisterGeneratedFile ( <nl> - " lib / ProtocolBuffers / arangodb . proto " , & protobuf_RegisterTypes ) ; <nl> - PB_ArangoKeyValue : : default_instance_ = new PB_ArangoKeyValue ( ) ; <nl> - PB_ArangoMessage : : default_instance_ = new PB_ArangoMessage ( ) ; <nl> - PB_ArangoBatchMessage : : default_instance_ = new PB_ArangoBatchMessage ( ) ; <nl> - PB_ArangoJsonValue : : default_instance_ = new PB_ArangoJsonValue ( ) ; <nl> - PB_ArangoJsonContent : : default_instance_ = new PB_ArangoJsonContent ( ) ; <nl> - PB_ArangoBlobRequest : : default_instance_ = new PB_ArangoBlobRequest ( ) ; <nl> - PB_ArangoBlobResponse : : default_instance_ = new PB_ArangoBlobResponse ( ) ; <nl> - PB_ArangoErrorResponse : : default_instance_ = new PB_ArangoErrorResponse ( ) ; <nl> - PB_ArangoKeyValue : : default_instance_ - > InitAsDefaultInstance ( ) ; <nl> - PB_ArangoMessage : : default_instance_ - > InitAsDefaultInstance ( ) ; <nl> - PB_ArangoBatchMessage : : default_instance_ - > InitAsDefaultInstance ( ) ; <nl> - PB_ArangoJsonValue : : default_instance_ - > InitAsDefaultInstance ( ) ; <nl> - PB_ArangoJsonContent : : default_instance_ - > InitAsDefaultInstance ( ) ; <nl> - PB_ArangoBlobRequest : : default_instance_ - > InitAsDefaultInstance ( ) ; <nl> - PB_ArangoBlobResponse : : default_instance_ - > InitAsDefaultInstance ( ) ; <nl> - PB_ArangoErrorResponse : : default_instance_ - > InitAsDefaultInstance ( ) ; <nl> - : : google : : protobuf : : internal : : OnShutdown ( & protobuf_ShutdownFile_lib_2fProtocolBuffers_2farangodb_2eproto ) ; <nl> - } <nl> - <nl> - / / Force AddDescriptors ( ) to be called at static initialization time . <nl> - struct StaticDescriptorInitializer_lib_2fProtocolBuffers_2farangodb_2eproto { <nl> - StaticDescriptorInitializer_lib_2fProtocolBuffers_2farangodb_2eproto ( ) { <nl> - protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - } <nl> - } static_descriptor_initializer_lib_2fProtocolBuffers_2farangodb_2eproto_ ; <nl> - <nl> - const : : google : : protobuf : : EnumDescriptor * PB_ArangoMessageType_descriptor ( ) { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - return PB_ArangoMessageType_descriptor_ ; <nl> - } <nl> - bool PB_ArangoMessageType_IsValid ( int value ) { <nl> - switch ( value ) { <nl> - case 0 : <nl> - case 1 : <nl> - case 2 : <nl> - return true ; <nl> - default : <nl> - return false ; <nl> - } <nl> - } <nl> - <nl> - const : : google : : protobuf : : EnumDescriptor * PB_ArangoMessageContentType_descriptor ( ) { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - return PB_ArangoMessageContentType_descriptor_ ; <nl> - } <nl> - bool PB_ArangoMessageContentType_IsValid ( int value ) { <nl> - switch ( value ) { <nl> - case 0 : <nl> - case 1 : <nl> - case 2 : <nl> - return true ; <nl> - default : <nl> - return false ; <nl> - } <nl> - } <nl> - <nl> - const : : google : : protobuf : : EnumDescriptor * PB_ArangoRequestType_descriptor ( ) { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - return PB_ArangoRequestType_descriptor_ ; <nl> - } <nl> - bool PB_ArangoRequestType_IsValid ( int value ) { <nl> - switch ( value ) { <nl> - case 0 : <nl> - case 1 : <nl> - case 2 : <nl> - case 3 : <nl> - case 4 : <nl> - case 5 : <nl> - return true ; <nl> - default : <nl> - return false ; <nl> - } <nl> - } <nl> - <nl> - const : : google : : protobuf : : EnumDescriptor * PB_ArangoJsonType_descriptor ( ) { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - return PB_ArangoJsonType_descriptor_ ; <nl> - } <nl> - bool PB_ArangoJsonType_IsValid ( int value ) { <nl> - switch ( value ) { <nl> - case 0 : <nl> - case 1 : <nl> - case 2 : <nl> - case 3 : <nl> - case 4 : <nl> - case 5 : <nl> - return true ; <nl> - default : <nl> - return false ; <nl> - } <nl> - } <nl> - <nl> - <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - <nl> - # ifndef _MSC_VER <nl> - const int PB_ArangoKeyValue : : kKeyFieldNumber ; <nl> - const int PB_ArangoKeyValue : : kValueFieldNumber ; <nl> - # endif / / ! _MSC_VER <nl> - <nl> - PB_ArangoKeyValue : : PB_ArangoKeyValue ( ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoKeyValue : : InitAsDefaultInstance ( ) { <nl> - } <nl> - <nl> - PB_ArangoKeyValue : : PB_ArangoKeyValue ( const PB_ArangoKeyValue & from ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoKeyValue : : SharedCtor ( ) { <nl> - _cached_size_ = 0 ; <nl> - key_ = const_cast < : : std : : string * > ( & : : google : : protobuf : : internal : : kEmptyString ) ; <nl> - value_ = const_cast < : : std : : string * > ( & : : google : : protobuf : : internal : : kEmptyString ) ; <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - } <nl> - <nl> - PB_ArangoKeyValue : : ~ PB_ArangoKeyValue ( ) { <nl> - SharedDtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoKeyValue : : SharedDtor ( ) { <nl> - if ( key_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - delete key_ ; <nl> - } <nl> - if ( value_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - delete value_ ; <nl> - } <nl> - if ( this ! = default_instance_ ) { <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoKeyValue : : SetCachedSize ( int size ) const { <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - } <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoKeyValue : : descriptor ( ) { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - return PB_ArangoKeyValue_descriptor_ ; <nl> - } <nl> - <nl> - const PB_ArangoKeyValue & PB_ArangoKeyValue : : default_instance ( ) { <nl> - if ( default_instance_ = = NULL ) protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; return * default_instance_ ; <nl> - } <nl> - <nl> - PB_ArangoKeyValue * PB_ArangoKeyValue : : default_instance_ = NULL ; <nl> - <nl> - PB_ArangoKeyValue * PB_ArangoKeyValue : : New ( ) const { <nl> - return new PB_ArangoKeyValue ; <nl> - } <nl> - <nl> - void PB_ArangoKeyValue : : Clear ( ) { <nl> - if ( _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - if ( has_key ( ) ) { <nl> - if ( key_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - key_ - > clear ( ) ; <nl> - } <nl> - } <nl> - if ( has_value ( ) ) { <nl> - if ( value_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - value_ - > clear ( ) ; <nl> - } <nl> - } <nl> - } <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - mutable_unknown_fields ( ) - > Clear ( ) ; <nl> - } <nl> - <nl> - bool PB_ArangoKeyValue : : MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) { <nl> - # define DO_ ( EXPRESSION ) if ( ! ( EXPRESSION ) ) return false <nl> - : : google : : protobuf : : uint32 tag ; <nl> - while ( ( tag = input - > ReadTag ( ) ) ! = 0 ) { <nl> - switch ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagFieldNumber ( tag ) ) { <nl> - / / required string key = 1 ; <nl> - case 1 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadString ( <nl> - input , this - > mutable_key ( ) ) ) ; <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > key ( ) . data ( ) , this - > key ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : PARSE ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 18 ) ) goto parse_value ; <nl> - break ; <nl> - } <nl> - <nl> - / / required string value = 2 ; <nl> - case 2 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - parse_value : <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadString ( <nl> - input , this - > mutable_value ( ) ) ) ; <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > value ( ) . data ( ) , this - > value ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : PARSE ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectAtEnd ( ) ) return true ; <nl> - break ; <nl> - } <nl> - <nl> - default : { <nl> - handle_uninterpreted : <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_END_GROUP ) { <nl> - return true ; <nl> - } <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormat : : SkipField ( <nl> - input , tag , mutable_unknown_fields ( ) ) ) ; <nl> - break ; <nl> - } <nl> - } <nl> - } <nl> - return true ; <nl> - # undef DO_ <nl> - } <nl> - <nl> - void PB_ArangoKeyValue : : SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const { <nl> - / / required string key = 1 ; <nl> - if ( has_key ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > key ( ) . data ( ) , this - > key ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : SERIALIZE ) ; <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteString ( <nl> - 1 , this - > key ( ) , output ) ; <nl> - } <nl> - <nl> - / / required string value = 2 ; <nl> - if ( has_value ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > value ( ) . data ( ) , this - > value ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : SERIALIZE ) ; <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteString ( <nl> - 2 , this - > value ( ) , output ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFields ( <nl> - unknown_fields ( ) , output ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : uint8 * PB_ArangoKeyValue : : SerializeWithCachedSizesToArray ( <nl> - : : google : : protobuf : : uint8 * target ) const { <nl> - / / required string key = 1 ; <nl> - if ( has_key ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > key ( ) . data ( ) , this - > key ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : SERIALIZE ) ; <nl> - target = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteStringToArray ( <nl> - 1 , this - > key ( ) , target ) ; <nl> - } <nl> - <nl> - / / required string value = 2 ; <nl> - if ( has_value ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > value ( ) . data ( ) , this - > value ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : SERIALIZE ) ; <nl> - target = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteStringToArray ( <nl> - 2 , this - > value ( ) , target ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFieldsToArray ( <nl> - unknown_fields ( ) , target ) ; <nl> - } <nl> - return target ; <nl> - } <nl> - <nl> - int PB_ArangoKeyValue : : ByteSize ( ) const { <nl> - int total_size = 0 ; <nl> - <nl> - if ( _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - / / required string key = 1 ; <nl> - if ( has_key ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : StringSize ( <nl> - this - > key ( ) ) ; <nl> - } <nl> - <nl> - / / required string value = 2 ; <nl> - if ( has_value ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : StringSize ( <nl> - this - > value ( ) ) ; <nl> - } <nl> - <nl> - } <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - total_size + = <nl> - : : google : : protobuf : : internal : : WireFormat : : ComputeUnknownFieldsSize ( <nl> - unknown_fields ( ) ) ; <nl> - } <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = total_size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - return total_size ; <nl> - } <nl> - <nl> - void PB_ArangoKeyValue : : MergeFrom ( const : : google : : protobuf : : Message & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - const PB_ArangoKeyValue * source = <nl> - : : google : : protobuf : : internal : : dynamic_cast_if_available < const PB_ArangoKeyValue * > ( <nl> - & from ) ; <nl> - if ( source = = NULL ) { <nl> - : : google : : protobuf : : internal : : ReflectionOps : : Merge ( from , this ) ; <nl> - } else { <nl> - MergeFrom ( * source ) ; <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoKeyValue : : MergeFrom ( const PB_ArangoKeyValue & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - if ( from . _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - if ( from . has_key ( ) ) { <nl> - set_key ( from . key ( ) ) ; <nl> - } <nl> - if ( from . has_value ( ) ) { <nl> - set_value ( from . value ( ) ) ; <nl> - } <nl> - } <nl> - mutable_unknown_fields ( ) - > MergeFrom ( from . unknown_fields ( ) ) ; <nl> - } <nl> - <nl> - void PB_ArangoKeyValue : : CopyFrom ( const : : google : : protobuf : : Message & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoKeyValue : : CopyFrom ( const PB_ArangoKeyValue & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - bool PB_ArangoKeyValue : : IsInitialized ( ) const { <nl> - if ( ( _has_bits_ [ 0 ] & 0x00000003 ) ! = 0x00000003 ) return false ; <nl> - <nl> - return true ; <nl> - } <nl> - <nl> - void PB_ArangoKeyValue : : Swap ( PB_ArangoKeyValue * other ) { <nl> - if ( other ! = this ) { <nl> - std : : swap ( key_ , other - > key_ ) ; <nl> - std : : swap ( value_ , other - > value_ ) ; <nl> - std : : swap ( _has_bits_ [ 0 ] , other - > _has_bits_ [ 0 ] ) ; <nl> - _unknown_fields_ . Swap ( & other - > _unknown_fields_ ) ; <nl> - std : : swap ( _cached_size_ , other - > _cached_size_ ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : Metadata PB_ArangoKeyValue : : GetMetadata ( ) const { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - : : google : : protobuf : : Metadata metadata ; <nl> - metadata . descriptor = PB_ArangoKeyValue_descriptor_ ; <nl> - metadata . reflection = PB_ArangoKeyValue_reflection_ ; <nl> - return metadata ; <nl> - } <nl> - <nl> - <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - <nl> - # ifndef _MSC_VER <nl> - const int PB_ArangoMessage : : kMessagesFieldNumber ; <nl> - # endif / / ! _MSC_VER <nl> - <nl> - PB_ArangoMessage : : PB_ArangoMessage ( ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoMessage : : InitAsDefaultInstance ( ) { <nl> - } <nl> - <nl> - PB_ArangoMessage : : PB_ArangoMessage ( const PB_ArangoMessage & from ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoMessage : : SharedCtor ( ) { <nl> - _cached_size_ = 0 ; <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - } <nl> - <nl> - PB_ArangoMessage : : ~ PB_ArangoMessage ( ) { <nl> - SharedDtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoMessage : : SharedDtor ( ) { <nl> - if ( this ! = default_instance_ ) { <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoMessage : : SetCachedSize ( int size ) const { <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - } <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoMessage : : descriptor ( ) { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - return PB_ArangoMessage_descriptor_ ; <nl> - } <nl> - <nl> - const PB_ArangoMessage & PB_ArangoMessage : : default_instance ( ) { <nl> - if ( default_instance_ = = NULL ) protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; return * default_instance_ ; <nl> - } <nl> - <nl> - PB_ArangoMessage * PB_ArangoMessage : : default_instance_ = NULL ; <nl> - <nl> - PB_ArangoMessage * PB_ArangoMessage : : New ( ) const { <nl> - return new PB_ArangoMessage ; <nl> - } <nl> - <nl> - void PB_ArangoMessage : : Clear ( ) { <nl> - messages_ . Clear ( ) ; <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - mutable_unknown_fields ( ) - > Clear ( ) ; <nl> - } <nl> - <nl> - bool PB_ArangoMessage : : MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) { <nl> - # define DO_ ( EXPRESSION ) if ( ! ( EXPRESSION ) ) return false <nl> - : : google : : protobuf : : uint32 tag ; <nl> - while ( ( tag = input - > ReadTag ( ) ) ! = 0 ) { <nl> - switch ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagFieldNumber ( tag ) ) { <nl> - / / repeated . PB_ArangoBatchMessage messages = 1 ; <nl> - case 1 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - parse_messages : <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadMessageNoVirtual ( <nl> - input , add_messages ( ) ) ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 10 ) ) goto parse_messages ; <nl> - if ( input - > ExpectAtEnd ( ) ) return true ; <nl> - break ; <nl> - } <nl> - <nl> - default : { <nl> - handle_uninterpreted : <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_END_GROUP ) { <nl> - return true ; <nl> - } <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormat : : SkipField ( <nl> - input , tag , mutable_unknown_fields ( ) ) ) ; <nl> - break ; <nl> - } <nl> - } <nl> - } <nl> - return true ; <nl> - # undef DO_ <nl> - } <nl> - <nl> - void PB_ArangoMessage : : SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const { <nl> - / / repeated . PB_ArangoBatchMessage messages = 1 ; <nl> - for ( int i = 0 ; i < this - > messages_size ( ) ; i + + ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteMessageMaybeToArray ( <nl> - 1 , this - > messages ( i ) , output ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFields ( <nl> - unknown_fields ( ) , output ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : uint8 * PB_ArangoMessage : : SerializeWithCachedSizesToArray ( <nl> - : : google : : protobuf : : uint8 * target ) const { <nl> - / / repeated . PB_ArangoBatchMessage messages = 1 ; <nl> - for ( int i = 0 ; i < this - > messages_size ( ) ; i + + ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : <nl> - WriteMessageNoVirtualToArray ( <nl> - 1 , this - > messages ( i ) , target ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFieldsToArray ( <nl> - unknown_fields ( ) , target ) ; <nl> - } <nl> - return target ; <nl> - } <nl> - <nl> - int PB_ArangoMessage : : ByteSize ( ) const { <nl> - int total_size = 0 ; <nl> - <nl> - / / repeated . PB_ArangoBatchMessage messages = 1 ; <nl> - total_size + = 1 * this - > messages_size ( ) ; <nl> - for ( int i = 0 ; i < this - > messages_size ( ) ; i + + ) { <nl> - total_size + = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : MessageSizeNoVirtual ( <nl> - this - > messages ( i ) ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - total_size + = <nl> - : : google : : protobuf : : internal : : WireFormat : : ComputeUnknownFieldsSize ( <nl> - unknown_fields ( ) ) ; <nl> - } <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = total_size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - return total_size ; <nl> - } <nl> - <nl> - void PB_ArangoMessage : : MergeFrom ( const : : google : : protobuf : : Message & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - const PB_ArangoMessage * source = <nl> - : : google : : protobuf : : internal : : dynamic_cast_if_available < const PB_ArangoMessage * > ( <nl> - & from ) ; <nl> - if ( source = = NULL ) { <nl> - : : google : : protobuf : : internal : : ReflectionOps : : Merge ( from , this ) ; <nl> - } else { <nl> - MergeFrom ( * source ) ; <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoMessage : : MergeFrom ( const PB_ArangoMessage & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - messages_ . MergeFrom ( from . messages_ ) ; <nl> - mutable_unknown_fields ( ) - > MergeFrom ( from . unknown_fields ( ) ) ; <nl> - } <nl> - <nl> - void PB_ArangoMessage : : CopyFrom ( const : : google : : protobuf : : Message & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoMessage : : CopyFrom ( const PB_ArangoMessage & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - bool PB_ArangoMessage : : IsInitialized ( ) const { <nl> - <nl> - for ( int i = 0 ; i < messages_size ( ) ; i + + ) { <nl> - if ( ! this - > messages ( i ) . IsInitialized ( ) ) return false ; <nl> - } <nl> - return true ; <nl> - } <nl> - <nl> - void PB_ArangoMessage : : Swap ( PB_ArangoMessage * other ) { <nl> - if ( other ! = this ) { <nl> - messages_ . Swap ( & other - > messages_ ) ; <nl> - std : : swap ( _has_bits_ [ 0 ] , other - > _has_bits_ [ 0 ] ) ; <nl> - _unknown_fields_ . Swap ( & other - > _unknown_fields_ ) ; <nl> - std : : swap ( _cached_size_ , other - > _cached_size_ ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : Metadata PB_ArangoMessage : : GetMetadata ( ) const { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - : : google : : protobuf : : Metadata metadata ; <nl> - metadata . descriptor = PB_ArangoMessage_descriptor_ ; <nl> - metadata . reflection = PB_ArangoMessage_reflection_ ; <nl> - return metadata ; <nl> - } <nl> - <nl> - <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - <nl> - # ifndef _MSC_VER <nl> - const int PB_ArangoBatchMessage : : kTypeFieldNumber ; <nl> - const int PB_ArangoBatchMessage : : kBlobRequestFieldNumber ; <nl> - const int PB_ArangoBatchMessage : : kBlobResponseFieldNumber ; <nl> - const int PB_ArangoBatchMessage : : kErrorResponseFieldNumber ; <nl> - # endif / / ! _MSC_VER <nl> - <nl> - PB_ArangoBatchMessage : : PB_ArangoBatchMessage ( ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoBatchMessage : : InitAsDefaultInstance ( ) { <nl> - blobrequest_ = const_cast < : : PB_ArangoBlobRequest * > ( & : : PB_ArangoBlobRequest : : default_instance ( ) ) ; <nl> - blobresponse_ = const_cast < : : PB_ArangoBlobResponse * > ( & : : PB_ArangoBlobResponse : : default_instance ( ) ) ; <nl> - errorresponse_ = const_cast < : : PB_ArangoErrorResponse * > ( & : : PB_ArangoErrorResponse : : default_instance ( ) ) ; <nl> - } <nl> - <nl> - PB_ArangoBatchMessage : : PB_ArangoBatchMessage ( const PB_ArangoBatchMessage & from ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoBatchMessage : : SharedCtor ( ) { <nl> - _cached_size_ = 0 ; <nl> - type_ = 0 ; <nl> - blobrequest_ = NULL ; <nl> - blobresponse_ = NULL ; <nl> - errorresponse_ = NULL ; <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - } <nl> - <nl> - PB_ArangoBatchMessage : : ~ PB_ArangoBatchMessage ( ) { <nl> - SharedDtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoBatchMessage : : SharedDtor ( ) { <nl> - if ( this ! = default_instance_ ) { <nl> - delete blobrequest_ ; <nl> - delete blobresponse_ ; <nl> - delete errorresponse_ ; <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoBatchMessage : : SetCachedSize ( int size ) const { <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - } <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoBatchMessage : : descriptor ( ) { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - return PB_ArangoBatchMessage_descriptor_ ; <nl> - } <nl> - <nl> - const PB_ArangoBatchMessage & PB_ArangoBatchMessage : : default_instance ( ) { <nl> - if ( default_instance_ = = NULL ) protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; return * default_instance_ ; <nl> - } <nl> - <nl> - PB_ArangoBatchMessage * PB_ArangoBatchMessage : : default_instance_ = NULL ; <nl> - <nl> - PB_ArangoBatchMessage * PB_ArangoBatchMessage : : New ( ) const { <nl> - return new PB_ArangoBatchMessage ; <nl> - } <nl> - <nl> - void PB_ArangoBatchMessage : : Clear ( ) { <nl> - if ( _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - type_ = 0 ; <nl> - if ( has_blobrequest ( ) ) { <nl> - if ( blobrequest_ ! = NULL ) blobrequest_ - > : : PB_ArangoBlobRequest : : Clear ( ) ; <nl> - } <nl> - if ( has_blobresponse ( ) ) { <nl> - if ( blobresponse_ ! = NULL ) blobresponse_ - > : : PB_ArangoBlobResponse : : Clear ( ) ; <nl> - } <nl> - if ( has_errorresponse ( ) ) { <nl> - if ( errorresponse_ ! = NULL ) errorresponse_ - > : : PB_ArangoErrorResponse : : Clear ( ) ; <nl> - } <nl> - } <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - mutable_unknown_fields ( ) - > Clear ( ) ; <nl> - } <nl> - <nl> - bool PB_ArangoBatchMessage : : MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) { <nl> - # define DO_ ( EXPRESSION ) if ( ! ( EXPRESSION ) ) return false <nl> - : : google : : protobuf : : uint32 tag ; <nl> - while ( ( tag = input - > ReadTag ( ) ) ! = 0 ) { <nl> - switch ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagFieldNumber ( tag ) ) { <nl> - / / required . PB_ArangoMessageType type = 1 ; <nl> - case 1 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_VARINT ) { <nl> - int value ; <nl> - DO_ ( ( : : google : : protobuf : : internal : : WireFormatLite : : ReadPrimitive < <nl> - int , : : google : : protobuf : : internal : : WireFormatLite : : TYPE_ENUM > ( <nl> - input , & value ) ) ) ; <nl> - if ( PB_ArangoMessageType_IsValid ( value ) ) { <nl> - set_type ( static_cast < PB_ArangoMessageType > ( value ) ) ; <nl> - } else { <nl> - mutable_unknown_fields ( ) - > AddVarint ( 1 , value ) ; <nl> - } <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 18 ) ) goto parse_blobRequest ; <nl> - break ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoBlobRequest blobRequest = 2 ; <nl> - case 2 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - parse_blobRequest : <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadMessageNoVirtual ( <nl> - input , mutable_blobrequest ( ) ) ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 26 ) ) goto parse_blobResponse ; <nl> - break ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoBlobResponse blobResponse = 3 ; <nl> - case 3 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - parse_blobResponse : <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadMessageNoVirtual ( <nl> - input , mutable_blobresponse ( ) ) ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 34 ) ) goto parse_errorResponse ; <nl> - break ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoErrorResponse errorResponse = 4 ; <nl> - case 4 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - parse_errorResponse : <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadMessageNoVirtual ( <nl> - input , mutable_errorresponse ( ) ) ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectAtEnd ( ) ) return true ; <nl> - break ; <nl> - } <nl> - <nl> - default : { <nl> - handle_uninterpreted : <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_END_GROUP ) { <nl> - return true ; <nl> - } <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormat : : SkipField ( <nl> - input , tag , mutable_unknown_fields ( ) ) ) ; <nl> - break ; <nl> - } <nl> - } <nl> - } <nl> - return true ; <nl> - # undef DO_ <nl> - } <nl> - <nl> - void PB_ArangoBatchMessage : : SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const { <nl> - / / required . PB_ArangoMessageType type = 1 ; <nl> - if ( has_type ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteEnum ( <nl> - 1 , this - > type ( ) , output ) ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoBlobRequest blobRequest = 2 ; <nl> - if ( has_blobrequest ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteMessageMaybeToArray ( <nl> - 2 , this - > blobrequest ( ) , output ) ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoBlobResponse blobResponse = 3 ; <nl> - if ( has_blobresponse ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteMessageMaybeToArray ( <nl> - 3 , this - > blobresponse ( ) , output ) ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoErrorResponse errorResponse = 4 ; <nl> - if ( has_errorresponse ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteMessageMaybeToArray ( <nl> - 4 , this - > errorresponse ( ) , output ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFields ( <nl> - unknown_fields ( ) , output ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : uint8 * PB_ArangoBatchMessage : : SerializeWithCachedSizesToArray ( <nl> - : : google : : protobuf : : uint8 * target ) const { <nl> - / / required . PB_ArangoMessageType type = 1 ; <nl> - if ( has_type ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : WriteEnumToArray ( <nl> - 1 , this - > type ( ) , target ) ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoBlobRequest blobRequest = 2 ; <nl> - if ( has_blobrequest ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : <nl> - WriteMessageNoVirtualToArray ( <nl> - 2 , this - > blobrequest ( ) , target ) ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoBlobResponse blobResponse = 3 ; <nl> - if ( has_blobresponse ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : <nl> - WriteMessageNoVirtualToArray ( <nl> - 3 , this - > blobresponse ( ) , target ) ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoErrorResponse errorResponse = 4 ; <nl> - if ( has_errorresponse ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : <nl> - WriteMessageNoVirtualToArray ( <nl> - 4 , this - > errorresponse ( ) , target ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFieldsToArray ( <nl> - unknown_fields ( ) , target ) ; <nl> - } <nl> - return target ; <nl> - } <nl> - <nl> - int PB_ArangoBatchMessage : : ByteSize ( ) const { <nl> - int total_size = 0 ; <nl> - <nl> - if ( _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - / / required . PB_ArangoMessageType type = 1 ; <nl> - if ( has_type ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : EnumSize ( this - > type ( ) ) ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoBlobRequest blobRequest = 2 ; <nl> - if ( has_blobrequest ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : MessageSizeNoVirtual ( <nl> - this - > blobrequest ( ) ) ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoBlobResponse blobResponse = 3 ; <nl> - if ( has_blobresponse ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : MessageSizeNoVirtual ( <nl> - this - > blobresponse ( ) ) ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoErrorResponse errorResponse = 4 ; <nl> - if ( has_errorresponse ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : MessageSizeNoVirtual ( <nl> - this - > errorresponse ( ) ) ; <nl> - } <nl> - <nl> - } <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - total_size + = <nl> - : : google : : protobuf : : internal : : WireFormat : : ComputeUnknownFieldsSize ( <nl> - unknown_fields ( ) ) ; <nl> - } <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = total_size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - return total_size ; <nl> - } <nl> - <nl> - void PB_ArangoBatchMessage : : MergeFrom ( const : : google : : protobuf : : Message & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - const PB_ArangoBatchMessage * source = <nl> - : : google : : protobuf : : internal : : dynamic_cast_if_available < const PB_ArangoBatchMessage * > ( <nl> - & from ) ; <nl> - if ( source = = NULL ) { <nl> - : : google : : protobuf : : internal : : ReflectionOps : : Merge ( from , this ) ; <nl> - } else { <nl> - MergeFrom ( * source ) ; <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoBatchMessage : : MergeFrom ( const PB_ArangoBatchMessage & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - if ( from . _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - if ( from . has_type ( ) ) { <nl> - set_type ( from . type ( ) ) ; <nl> - } <nl> - if ( from . has_blobrequest ( ) ) { <nl> - mutable_blobrequest ( ) - > : : PB_ArangoBlobRequest : : MergeFrom ( from . blobrequest ( ) ) ; <nl> - } <nl> - if ( from . has_blobresponse ( ) ) { <nl> - mutable_blobresponse ( ) - > : : PB_ArangoBlobResponse : : MergeFrom ( from . blobresponse ( ) ) ; <nl> - } <nl> - if ( from . has_errorresponse ( ) ) { <nl> - mutable_errorresponse ( ) - > : : PB_ArangoErrorResponse : : MergeFrom ( from . errorresponse ( ) ) ; <nl> - } <nl> - } <nl> - mutable_unknown_fields ( ) - > MergeFrom ( from . unknown_fields ( ) ) ; <nl> - } <nl> - <nl> - void PB_ArangoBatchMessage : : CopyFrom ( const : : google : : protobuf : : Message & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoBatchMessage : : CopyFrom ( const PB_ArangoBatchMessage & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - bool PB_ArangoBatchMessage : : IsInitialized ( ) const { <nl> - if ( ( _has_bits_ [ 0 ] & 0x00000001 ) ! = 0x00000001 ) return false ; <nl> - <nl> - if ( has_blobrequest ( ) ) { <nl> - if ( ! this - > blobrequest ( ) . IsInitialized ( ) ) return false ; <nl> - } <nl> - if ( has_blobresponse ( ) ) { <nl> - if ( ! this - > blobresponse ( ) . IsInitialized ( ) ) return false ; <nl> - } <nl> - if ( has_errorresponse ( ) ) { <nl> - if ( ! this - > errorresponse ( ) . IsInitialized ( ) ) return false ; <nl> - } <nl> - return true ; <nl> - } <nl> - <nl> - void PB_ArangoBatchMessage : : Swap ( PB_ArangoBatchMessage * other ) { <nl> - if ( other ! = this ) { <nl> - std : : swap ( type_ , other - > type_ ) ; <nl> - std : : swap ( blobrequest_ , other - > blobrequest_ ) ; <nl> - std : : swap ( blobresponse_ , other - > blobresponse_ ) ; <nl> - std : : swap ( errorresponse_ , other - > errorresponse_ ) ; <nl> - std : : swap ( _has_bits_ [ 0 ] , other - > _has_bits_ [ 0 ] ) ; <nl> - _unknown_fields_ . Swap ( & other - > _unknown_fields_ ) ; <nl> - std : : swap ( _cached_size_ , other - > _cached_size_ ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : Metadata PB_ArangoBatchMessage : : GetMetadata ( ) const { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - : : google : : protobuf : : Metadata metadata ; <nl> - metadata . descriptor = PB_ArangoBatchMessage_descriptor_ ; <nl> - metadata . reflection = PB_ArangoBatchMessage_reflection_ ; <nl> - return metadata ; <nl> - } <nl> - <nl> - <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - <nl> - # ifndef _MSC_VER <nl> - const int PB_ArangoJsonValue : : kBooleanValueFieldNumber ; <nl> - const int PB_ArangoJsonValue : : kNumberValueFieldNumber ; <nl> - const int PB_ArangoJsonValue : : kStringValueFieldNumber ; <nl> - const int PB_ArangoJsonValue : : kObjectsFieldNumber ; <nl> - # endif / / ! _MSC_VER <nl> - <nl> - PB_ArangoJsonValue : : PB_ArangoJsonValue ( ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoJsonValue : : InitAsDefaultInstance ( ) { <nl> - } <nl> - <nl> - PB_ArangoJsonValue : : PB_ArangoJsonValue ( const PB_ArangoJsonValue & from ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoJsonValue : : SharedCtor ( ) { <nl> - _cached_size_ = 0 ; <nl> - booleanvalue_ = false ; <nl> - numbervalue_ = 0 ; <nl> - stringvalue_ = const_cast < : : std : : string * > ( & : : google : : protobuf : : internal : : kEmptyString ) ; <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - } <nl> - <nl> - PB_ArangoJsonValue : : ~ PB_ArangoJsonValue ( ) { <nl> - SharedDtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoJsonValue : : SharedDtor ( ) { <nl> - if ( stringvalue_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - delete stringvalue_ ; <nl> - } <nl> - if ( this ! = default_instance_ ) { <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoJsonValue : : SetCachedSize ( int size ) const { <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - } <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoJsonValue : : descriptor ( ) { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - return PB_ArangoJsonValue_descriptor_ ; <nl> - } <nl> - <nl> - const PB_ArangoJsonValue & PB_ArangoJsonValue : : default_instance ( ) { <nl> - if ( default_instance_ = = NULL ) protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; return * default_instance_ ; <nl> - } <nl> - <nl> - PB_ArangoJsonValue * PB_ArangoJsonValue : : default_instance_ = NULL ; <nl> - <nl> - PB_ArangoJsonValue * PB_ArangoJsonValue : : New ( ) const { <nl> - return new PB_ArangoJsonValue ; <nl> - } <nl> - <nl> - void PB_ArangoJsonValue : : Clear ( ) { <nl> - if ( _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - booleanvalue_ = false ; <nl> - numbervalue_ = 0 ; <nl> - if ( has_stringvalue ( ) ) { <nl> - if ( stringvalue_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - stringvalue_ - > clear ( ) ; <nl> - } <nl> - } <nl> - } <nl> - objects_ . Clear ( ) ; <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - mutable_unknown_fields ( ) - > Clear ( ) ; <nl> - } <nl> - <nl> - bool PB_ArangoJsonValue : : MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) { <nl> - # define DO_ ( EXPRESSION ) if ( ! ( EXPRESSION ) ) return false <nl> - : : google : : protobuf : : uint32 tag ; <nl> - while ( ( tag = input - > ReadTag ( ) ) ! = 0 ) { <nl> - switch ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagFieldNumber ( tag ) ) { <nl> - / / optional bool booleanValue = 1 ; <nl> - case 1 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_VARINT ) { <nl> - DO_ ( ( : : google : : protobuf : : internal : : WireFormatLite : : ReadPrimitive < <nl> - bool , : : google : : protobuf : : internal : : WireFormatLite : : TYPE_BOOL > ( <nl> - input , & booleanvalue_ ) ) ) ; <nl> - set_has_booleanvalue ( ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 17 ) ) goto parse_numberValue ; <nl> - break ; <nl> - } <nl> - <nl> - / / optional double numberValue = 2 ; <nl> - case 2 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_FIXED64 ) { <nl> - parse_numberValue : <nl> - DO_ ( ( : : google : : protobuf : : internal : : WireFormatLite : : ReadPrimitive < <nl> - double , : : google : : protobuf : : internal : : WireFormatLite : : TYPE_DOUBLE > ( <nl> - input , & numbervalue_ ) ) ) ; <nl> - set_has_numbervalue ( ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 26 ) ) goto parse_stringValue ; <nl> - break ; <nl> - } <nl> - <nl> - / / optional string stringValue = 3 ; <nl> - case 3 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - parse_stringValue : <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadString ( <nl> - input , this - > mutable_stringvalue ( ) ) ) ; <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > stringvalue ( ) . data ( ) , this - > stringvalue ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : PARSE ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 34 ) ) goto parse_objects ; <nl> - break ; <nl> - } <nl> - <nl> - / / repeated . PB_ArangoJsonContent objects = 4 ; <nl> - case 4 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - parse_objects : <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadMessageNoVirtual ( <nl> - input , add_objects ( ) ) ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 34 ) ) goto parse_objects ; <nl> - if ( input - > ExpectAtEnd ( ) ) return true ; <nl> - break ; <nl> - } <nl> - <nl> - default : { <nl> - handle_uninterpreted : <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_END_GROUP ) { <nl> - return true ; <nl> - } <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormat : : SkipField ( <nl> - input , tag , mutable_unknown_fields ( ) ) ) ; <nl> - break ; <nl> - } <nl> - } <nl> - } <nl> - return true ; <nl> - # undef DO_ <nl> - } <nl> - <nl> - void PB_ArangoJsonValue : : SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const { <nl> - / / optional bool booleanValue = 1 ; <nl> - if ( has_booleanvalue ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteBool ( 1 , this - > booleanvalue ( ) , output ) ; <nl> - } <nl> - <nl> - / / optional double numberValue = 2 ; <nl> - if ( has_numbervalue ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteDouble ( 2 , this - > numbervalue ( ) , output ) ; <nl> - } <nl> - <nl> - / / optional string stringValue = 3 ; <nl> - if ( has_stringvalue ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > stringvalue ( ) . data ( ) , this - > stringvalue ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : SERIALIZE ) ; <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteString ( <nl> - 3 , this - > stringvalue ( ) , output ) ; <nl> - } <nl> - <nl> - / / repeated . PB_ArangoJsonContent objects = 4 ; <nl> - for ( int i = 0 ; i < this - > objects_size ( ) ; i + + ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteMessageMaybeToArray ( <nl> - 4 , this - > objects ( i ) , output ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFields ( <nl> - unknown_fields ( ) , output ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : uint8 * PB_ArangoJsonValue : : SerializeWithCachedSizesToArray ( <nl> - : : google : : protobuf : : uint8 * target ) const { <nl> - / / optional bool booleanValue = 1 ; <nl> - if ( has_booleanvalue ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : WriteBoolToArray ( 1 , this - > booleanvalue ( ) , target ) ; <nl> - } <nl> - <nl> - / / optional double numberValue = 2 ; <nl> - if ( has_numbervalue ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : WriteDoubleToArray ( 2 , this - > numbervalue ( ) , target ) ; <nl> - } <nl> - <nl> - / / optional string stringValue = 3 ; <nl> - if ( has_stringvalue ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > stringvalue ( ) . data ( ) , this - > stringvalue ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : SERIALIZE ) ; <nl> - target = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteStringToArray ( <nl> - 3 , this - > stringvalue ( ) , target ) ; <nl> - } <nl> - <nl> - / / repeated . PB_ArangoJsonContent objects = 4 ; <nl> - for ( int i = 0 ; i < this - > objects_size ( ) ; i + + ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : <nl> - WriteMessageNoVirtualToArray ( <nl> - 4 , this - > objects ( i ) , target ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFieldsToArray ( <nl> - unknown_fields ( ) , target ) ; <nl> - } <nl> - return target ; <nl> - } <nl> - <nl> - int PB_ArangoJsonValue : : ByteSize ( ) const { <nl> - int total_size = 0 ; <nl> - <nl> - if ( _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - / / optional bool booleanValue = 1 ; <nl> - if ( has_booleanvalue ( ) ) { <nl> - total_size + = 1 + 1 ; <nl> - } <nl> - <nl> - / / optional double numberValue = 2 ; <nl> - if ( has_numbervalue ( ) ) { <nl> - total_size + = 1 + 8 ; <nl> - } <nl> - <nl> - / / optional string stringValue = 3 ; <nl> - if ( has_stringvalue ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : StringSize ( <nl> - this - > stringvalue ( ) ) ; <nl> - } <nl> - <nl> - } <nl> - / / repeated . PB_ArangoJsonContent objects = 4 ; <nl> - total_size + = 1 * this - > objects_size ( ) ; <nl> - for ( int i = 0 ; i < this - > objects_size ( ) ; i + + ) { <nl> - total_size + = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : MessageSizeNoVirtual ( <nl> - this - > objects ( i ) ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - total_size + = <nl> - : : google : : protobuf : : internal : : WireFormat : : ComputeUnknownFieldsSize ( <nl> - unknown_fields ( ) ) ; <nl> - } <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = total_size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - return total_size ; <nl> - } <nl> - <nl> - void PB_ArangoJsonValue : : MergeFrom ( const : : google : : protobuf : : Message & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - const PB_ArangoJsonValue * source = <nl> - : : google : : protobuf : : internal : : dynamic_cast_if_available < const PB_ArangoJsonValue * > ( <nl> - & from ) ; <nl> - if ( source = = NULL ) { <nl> - : : google : : protobuf : : internal : : ReflectionOps : : Merge ( from , this ) ; <nl> - } else { <nl> - MergeFrom ( * source ) ; <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoJsonValue : : MergeFrom ( const PB_ArangoJsonValue & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - objects_ . MergeFrom ( from . objects_ ) ; <nl> - if ( from . _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - if ( from . has_booleanvalue ( ) ) { <nl> - set_booleanvalue ( from . booleanvalue ( ) ) ; <nl> - } <nl> - if ( from . has_numbervalue ( ) ) { <nl> - set_numbervalue ( from . numbervalue ( ) ) ; <nl> - } <nl> - if ( from . has_stringvalue ( ) ) { <nl> - set_stringvalue ( from . stringvalue ( ) ) ; <nl> - } <nl> - } <nl> - mutable_unknown_fields ( ) - > MergeFrom ( from . unknown_fields ( ) ) ; <nl> - } <nl> - <nl> - void PB_ArangoJsonValue : : CopyFrom ( const : : google : : protobuf : : Message & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoJsonValue : : CopyFrom ( const PB_ArangoJsonValue & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - bool PB_ArangoJsonValue : : IsInitialized ( ) const { <nl> - <nl> - for ( int i = 0 ; i < objects_size ( ) ; i + + ) { <nl> - if ( ! this - > objects ( i ) . IsInitialized ( ) ) return false ; <nl> - } <nl> - return true ; <nl> - } <nl> - <nl> - void PB_ArangoJsonValue : : Swap ( PB_ArangoJsonValue * other ) { <nl> - if ( other ! = this ) { <nl> - std : : swap ( booleanvalue_ , other - > booleanvalue_ ) ; <nl> - std : : swap ( numbervalue_ , other - > numbervalue_ ) ; <nl> - std : : swap ( stringvalue_ , other - > stringvalue_ ) ; <nl> - objects_ . Swap ( & other - > objects_ ) ; <nl> - std : : swap ( _has_bits_ [ 0 ] , other - > _has_bits_ [ 0 ] ) ; <nl> - _unknown_fields_ . Swap ( & other - > _unknown_fields_ ) ; <nl> - std : : swap ( _cached_size_ , other - > _cached_size_ ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : Metadata PB_ArangoJsonValue : : GetMetadata ( ) const { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - : : google : : protobuf : : Metadata metadata ; <nl> - metadata . descriptor = PB_ArangoJsonValue_descriptor_ ; <nl> - metadata . reflection = PB_ArangoJsonValue_reflection_ ; <nl> - return metadata ; <nl> - } <nl> - <nl> - <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - <nl> - # ifndef _MSC_VER <nl> - const int PB_ArangoJsonContent : : kTypeFieldNumber ; <nl> - const int PB_ArangoJsonContent : : kValueFieldNumber ; <nl> - # endif / / ! _MSC_VER <nl> - <nl> - PB_ArangoJsonContent : : PB_ArangoJsonContent ( ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoJsonContent : : InitAsDefaultInstance ( ) { <nl> - value_ = const_cast < : : PB_ArangoJsonValue * > ( & : : PB_ArangoJsonValue : : default_instance ( ) ) ; <nl> - } <nl> - <nl> - PB_ArangoJsonContent : : PB_ArangoJsonContent ( const PB_ArangoJsonContent & from ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoJsonContent : : SharedCtor ( ) { <nl> - _cached_size_ = 0 ; <nl> - type_ = 0 ; <nl> - value_ = NULL ; <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - } <nl> - <nl> - PB_ArangoJsonContent : : ~ PB_ArangoJsonContent ( ) { <nl> - SharedDtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoJsonContent : : SharedDtor ( ) { <nl> - if ( this ! = default_instance_ ) { <nl> - delete value_ ; <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoJsonContent : : SetCachedSize ( int size ) const { <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - } <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoJsonContent : : descriptor ( ) { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - return PB_ArangoJsonContent_descriptor_ ; <nl> - } <nl> - <nl> - const PB_ArangoJsonContent & PB_ArangoJsonContent : : default_instance ( ) { <nl> - if ( default_instance_ = = NULL ) protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; return * default_instance_ ; <nl> - } <nl> - <nl> - PB_ArangoJsonContent * PB_ArangoJsonContent : : default_instance_ = NULL ; <nl> - <nl> - PB_ArangoJsonContent * PB_ArangoJsonContent : : New ( ) const { <nl> - return new PB_ArangoJsonContent ; <nl> - } <nl> - <nl> - void PB_ArangoJsonContent : : Clear ( ) { <nl> - if ( _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - type_ = 0 ; <nl> - if ( has_value ( ) ) { <nl> - if ( value_ ! = NULL ) value_ - > : : PB_ArangoJsonValue : : Clear ( ) ; <nl> - } <nl> - } <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - mutable_unknown_fields ( ) - > Clear ( ) ; <nl> - } <nl> - <nl> - bool PB_ArangoJsonContent : : MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) { <nl> - # define DO_ ( EXPRESSION ) if ( ! ( EXPRESSION ) ) return false <nl> - : : google : : protobuf : : uint32 tag ; <nl> - while ( ( tag = input - > ReadTag ( ) ) ! = 0 ) { <nl> - switch ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagFieldNumber ( tag ) ) { <nl> - / / required . PB_ArangoJsonType type = 1 ; <nl> - case 1 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_VARINT ) { <nl> - int value ; <nl> - DO_ ( ( : : google : : protobuf : : internal : : WireFormatLite : : ReadPrimitive < <nl> - int , : : google : : protobuf : : internal : : WireFormatLite : : TYPE_ENUM > ( <nl> - input , & value ) ) ) ; <nl> - if ( PB_ArangoJsonType_IsValid ( value ) ) { <nl> - set_type ( static_cast < PB_ArangoJsonType > ( value ) ) ; <nl> - } else { <nl> - mutable_unknown_fields ( ) - > AddVarint ( 1 , value ) ; <nl> - } <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 18 ) ) goto parse_value ; <nl> - break ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoJsonValue value = 2 ; <nl> - case 2 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - parse_value : <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadMessageNoVirtual ( <nl> - input , mutable_value ( ) ) ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectAtEnd ( ) ) return true ; <nl> - break ; <nl> - } <nl> - <nl> - default : { <nl> - handle_uninterpreted : <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_END_GROUP ) { <nl> - return true ; <nl> - } <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormat : : SkipField ( <nl> - input , tag , mutable_unknown_fields ( ) ) ) ; <nl> - break ; <nl> - } <nl> - } <nl> - } <nl> - return true ; <nl> - # undef DO_ <nl> - } <nl> - <nl> - void PB_ArangoJsonContent : : SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const { <nl> - / / required . PB_ArangoJsonType type = 1 ; <nl> - if ( has_type ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteEnum ( <nl> - 1 , this - > type ( ) , output ) ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoJsonValue value = 2 ; <nl> - if ( has_value ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteMessageMaybeToArray ( <nl> - 2 , this - > value ( ) , output ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFields ( <nl> - unknown_fields ( ) , output ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : uint8 * PB_ArangoJsonContent : : SerializeWithCachedSizesToArray ( <nl> - : : google : : protobuf : : uint8 * target ) const { <nl> - / / required . PB_ArangoJsonType type = 1 ; <nl> - if ( has_type ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : WriteEnumToArray ( <nl> - 1 , this - > type ( ) , target ) ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoJsonValue value = 2 ; <nl> - if ( has_value ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : <nl> - WriteMessageNoVirtualToArray ( <nl> - 2 , this - > value ( ) , target ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFieldsToArray ( <nl> - unknown_fields ( ) , target ) ; <nl> - } <nl> - return target ; <nl> - } <nl> - <nl> - int PB_ArangoJsonContent : : ByteSize ( ) const { <nl> - int total_size = 0 ; <nl> - <nl> - if ( _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - / / required . PB_ArangoJsonType type = 1 ; <nl> - if ( has_type ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : EnumSize ( this - > type ( ) ) ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoJsonValue value = 2 ; <nl> - if ( has_value ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : MessageSizeNoVirtual ( <nl> - this - > value ( ) ) ; <nl> - } <nl> - <nl> - } <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - total_size + = <nl> - : : google : : protobuf : : internal : : WireFormat : : ComputeUnknownFieldsSize ( <nl> - unknown_fields ( ) ) ; <nl> - } <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = total_size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - return total_size ; <nl> - } <nl> - <nl> - void PB_ArangoJsonContent : : MergeFrom ( const : : google : : protobuf : : Message & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - const PB_ArangoJsonContent * source = <nl> - : : google : : protobuf : : internal : : dynamic_cast_if_available < const PB_ArangoJsonContent * > ( <nl> - & from ) ; <nl> - if ( source = = NULL ) { <nl> - : : google : : protobuf : : internal : : ReflectionOps : : Merge ( from , this ) ; <nl> - } else { <nl> - MergeFrom ( * source ) ; <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoJsonContent : : MergeFrom ( const PB_ArangoJsonContent & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - if ( from . _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - if ( from . has_type ( ) ) { <nl> - set_type ( from . type ( ) ) ; <nl> - } <nl> - if ( from . has_value ( ) ) { <nl> - mutable_value ( ) - > : : PB_ArangoJsonValue : : MergeFrom ( from . value ( ) ) ; <nl> - } <nl> - } <nl> - mutable_unknown_fields ( ) - > MergeFrom ( from . unknown_fields ( ) ) ; <nl> - } <nl> - <nl> - void PB_ArangoJsonContent : : CopyFrom ( const : : google : : protobuf : : Message & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoJsonContent : : CopyFrom ( const PB_ArangoJsonContent & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - bool PB_ArangoJsonContent : : IsInitialized ( ) const { <nl> - if ( ( _has_bits_ [ 0 ] & 0x00000001 ) ! = 0x00000001 ) return false ; <nl> - <nl> - if ( has_value ( ) ) { <nl> - if ( ! this - > value ( ) . IsInitialized ( ) ) return false ; <nl> - } <nl> - return true ; <nl> - } <nl> - <nl> - void PB_ArangoJsonContent : : Swap ( PB_ArangoJsonContent * other ) { <nl> - if ( other ! = this ) { <nl> - std : : swap ( type_ , other - > type_ ) ; <nl> - std : : swap ( value_ , other - > value_ ) ; <nl> - std : : swap ( _has_bits_ [ 0 ] , other - > _has_bits_ [ 0 ] ) ; <nl> - _unknown_fields_ . Swap ( & other - > _unknown_fields_ ) ; <nl> - std : : swap ( _cached_size_ , other - > _cached_size_ ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : Metadata PB_ArangoJsonContent : : GetMetadata ( ) const { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - : : google : : protobuf : : Metadata metadata ; <nl> - metadata . descriptor = PB_ArangoJsonContent_descriptor_ ; <nl> - metadata . reflection = PB_ArangoJsonContent_reflection_ ; <nl> - return metadata ; <nl> - } <nl> - <nl> - <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - <nl> - # ifndef _MSC_VER <nl> - const int PB_ArangoBlobRequest : : kRequestTypeFieldNumber ; <nl> - const int PB_ArangoBlobRequest : : kUrlFieldNumber ; <nl> - const int PB_ArangoBlobRequest : : kValuesFieldNumber ; <nl> - const int PB_ArangoBlobRequest : : kHeadersFieldNumber ; <nl> - const int PB_ArangoBlobRequest : : kContentTypeFieldNumber ; <nl> - const int PB_ArangoBlobRequest : : kContentFieldNumber ; <nl> - const int PB_ArangoBlobRequest : : kJsonFieldNumber ; <nl> - # endif / / ! _MSC_VER <nl> - <nl> - PB_ArangoBlobRequest : : PB_ArangoBlobRequest ( ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoBlobRequest : : InitAsDefaultInstance ( ) { <nl> - json_ = const_cast < : : PB_ArangoJsonContent * > ( & : : PB_ArangoJsonContent : : default_instance ( ) ) ; <nl> - } <nl> - <nl> - PB_ArangoBlobRequest : : PB_ArangoBlobRequest ( const PB_ArangoBlobRequest & from ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoBlobRequest : : SharedCtor ( ) { <nl> - _cached_size_ = 0 ; <nl> - requesttype_ = 0 ; <nl> - url_ = const_cast < : : std : : string * > ( & : : google : : protobuf : : internal : : kEmptyString ) ; <nl> - contenttype_ = 0 ; <nl> - content_ = const_cast < : : std : : string * > ( & : : google : : protobuf : : internal : : kEmptyString ) ; <nl> - json_ = NULL ; <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - } <nl> - <nl> - PB_ArangoBlobRequest : : ~ PB_ArangoBlobRequest ( ) { <nl> - SharedDtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoBlobRequest : : SharedDtor ( ) { <nl> - if ( url_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - delete url_ ; <nl> - } <nl> - if ( content_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - delete content_ ; <nl> - } <nl> - if ( this ! = default_instance_ ) { <nl> - delete json_ ; <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoBlobRequest : : SetCachedSize ( int size ) const { <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - } <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoBlobRequest : : descriptor ( ) { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - return PB_ArangoBlobRequest_descriptor_ ; <nl> - } <nl> - <nl> - const PB_ArangoBlobRequest & PB_ArangoBlobRequest : : default_instance ( ) { <nl> - if ( default_instance_ = = NULL ) protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; return * default_instance_ ; <nl> - } <nl> - <nl> - PB_ArangoBlobRequest * PB_ArangoBlobRequest : : default_instance_ = NULL ; <nl> - <nl> - PB_ArangoBlobRequest * PB_ArangoBlobRequest : : New ( ) const { <nl> - return new PB_ArangoBlobRequest ; <nl> - } <nl> - <nl> - void PB_ArangoBlobRequest : : Clear ( ) { <nl> - if ( _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - requesttype_ = 0 ; <nl> - if ( has_url ( ) ) { <nl> - if ( url_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - url_ - > clear ( ) ; <nl> - } <nl> - } <nl> - contenttype_ = 0 ; <nl> - if ( has_content ( ) ) { <nl> - if ( content_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - content_ - > clear ( ) ; <nl> - } <nl> - } <nl> - if ( has_json ( ) ) { <nl> - if ( json_ ! = NULL ) json_ - > : : PB_ArangoJsonContent : : Clear ( ) ; <nl> - } <nl> - } <nl> - values_ . Clear ( ) ; <nl> - headers_ . Clear ( ) ; <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - mutable_unknown_fields ( ) - > Clear ( ) ; <nl> - } <nl> - <nl> - bool PB_ArangoBlobRequest : : MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) { <nl> - # define DO_ ( EXPRESSION ) if ( ! ( EXPRESSION ) ) return false <nl> - : : google : : protobuf : : uint32 tag ; <nl> - while ( ( tag = input - > ReadTag ( ) ) ! = 0 ) { <nl> - switch ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagFieldNumber ( tag ) ) { <nl> - / / required . PB_ArangoRequestType requestType = 1 ; <nl> - case 1 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_VARINT ) { <nl> - int value ; <nl> - DO_ ( ( : : google : : protobuf : : internal : : WireFormatLite : : ReadPrimitive < <nl> - int , : : google : : protobuf : : internal : : WireFormatLite : : TYPE_ENUM > ( <nl> - input , & value ) ) ) ; <nl> - if ( PB_ArangoRequestType_IsValid ( value ) ) { <nl> - set_requesttype ( static_cast < PB_ArangoRequestType > ( value ) ) ; <nl> - } else { <nl> - mutable_unknown_fields ( ) - > AddVarint ( 1 , value ) ; <nl> - } <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 18 ) ) goto parse_url ; <nl> - break ; <nl> - } <nl> - <nl> - / / required string url = 2 ; <nl> - case 2 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - parse_url : <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadString ( <nl> - input , this - > mutable_url ( ) ) ) ; <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > url ( ) . data ( ) , this - > url ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : PARSE ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 26 ) ) goto parse_values ; <nl> - break ; <nl> - } <nl> - <nl> - / / repeated . PB_ArangoKeyValue values = 3 ; <nl> - case 3 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - parse_values : <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadMessageNoVirtual ( <nl> - input , add_values ( ) ) ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 26 ) ) goto parse_values ; <nl> - if ( input - > ExpectTag ( 34 ) ) goto parse_headers ; <nl> - break ; <nl> - } <nl> - <nl> - / / repeated . PB_ArangoKeyValue headers = 4 ; <nl> - case 4 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - parse_headers : <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadMessageNoVirtual ( <nl> - input , add_headers ( ) ) ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 34 ) ) goto parse_headers ; <nl> - if ( input - > ExpectTag ( 40 ) ) goto parse_contentType ; <nl> - break ; <nl> - } <nl> - <nl> - / / required . PB_ArangoMessageContentType contentType = 5 ; <nl> - case 5 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_VARINT ) { <nl> - parse_contentType : <nl> - int value ; <nl> - DO_ ( ( : : google : : protobuf : : internal : : WireFormatLite : : ReadPrimitive < <nl> - int , : : google : : protobuf : : internal : : WireFormatLite : : TYPE_ENUM > ( <nl> - input , & value ) ) ) ; <nl> - if ( PB_ArangoMessageContentType_IsValid ( value ) ) { <nl> - set_contenttype ( static_cast < PB_ArangoMessageContentType > ( value ) ) ; <nl> - } else { <nl> - mutable_unknown_fields ( ) - > AddVarint ( 5 , value ) ; <nl> - } <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 58 ) ) goto parse_content ; <nl> - break ; <nl> - } <nl> - <nl> - / / optional string content = 7 ; <nl> - case 7 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - parse_content : <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadString ( <nl> - input , this - > mutable_content ( ) ) ) ; <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > content ( ) . data ( ) , this - > content ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : PARSE ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 66 ) ) goto parse_json ; <nl> - break ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoJsonContent json = 8 ; <nl> - case 8 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - parse_json : <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadMessageNoVirtual ( <nl> - input , mutable_json ( ) ) ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectAtEnd ( ) ) return true ; <nl> - break ; <nl> - } <nl> - <nl> - default : { <nl> - handle_uninterpreted : <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_END_GROUP ) { <nl> - return true ; <nl> - } <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormat : : SkipField ( <nl> - input , tag , mutable_unknown_fields ( ) ) ) ; <nl> - break ; <nl> - } <nl> - } <nl> - } <nl> - return true ; <nl> - # undef DO_ <nl> - } <nl> - <nl> - void PB_ArangoBlobRequest : : SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const { <nl> - / / required . PB_ArangoRequestType requestType = 1 ; <nl> - if ( has_requesttype ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteEnum ( <nl> - 1 , this - > requesttype ( ) , output ) ; <nl> - } <nl> - <nl> - / / required string url = 2 ; <nl> - if ( has_url ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > url ( ) . data ( ) , this - > url ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : SERIALIZE ) ; <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteString ( <nl> - 2 , this - > url ( ) , output ) ; <nl> - } <nl> - <nl> - / / repeated . PB_ArangoKeyValue values = 3 ; <nl> - for ( int i = 0 ; i < this - > values_size ( ) ; i + + ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteMessageMaybeToArray ( <nl> - 3 , this - > values ( i ) , output ) ; <nl> - } <nl> - <nl> - / / repeated . PB_ArangoKeyValue headers = 4 ; <nl> - for ( int i = 0 ; i < this - > headers_size ( ) ; i + + ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteMessageMaybeToArray ( <nl> - 4 , this - > headers ( i ) , output ) ; <nl> - } <nl> - <nl> - / / required . PB_ArangoMessageContentType contentType = 5 ; <nl> - if ( has_contenttype ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteEnum ( <nl> - 5 , this - > contenttype ( ) , output ) ; <nl> - } <nl> - <nl> - / / optional string content = 7 ; <nl> - if ( has_content ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > content ( ) . data ( ) , this - > content ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : SERIALIZE ) ; <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteString ( <nl> - 7 , this - > content ( ) , output ) ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoJsonContent json = 8 ; <nl> - if ( has_json ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteMessageMaybeToArray ( <nl> - 8 , this - > json ( ) , output ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFields ( <nl> - unknown_fields ( ) , output ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : uint8 * PB_ArangoBlobRequest : : SerializeWithCachedSizesToArray ( <nl> - : : google : : protobuf : : uint8 * target ) const { <nl> - / / required . PB_ArangoRequestType requestType = 1 ; <nl> - if ( has_requesttype ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : WriteEnumToArray ( <nl> - 1 , this - > requesttype ( ) , target ) ; <nl> - } <nl> - <nl> - / / required string url = 2 ; <nl> - if ( has_url ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > url ( ) . data ( ) , this - > url ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : SERIALIZE ) ; <nl> - target = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteStringToArray ( <nl> - 2 , this - > url ( ) , target ) ; <nl> - } <nl> - <nl> - / / repeated . PB_ArangoKeyValue values = 3 ; <nl> - for ( int i = 0 ; i < this - > values_size ( ) ; i + + ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : <nl> - WriteMessageNoVirtualToArray ( <nl> - 3 , this - > values ( i ) , target ) ; <nl> - } <nl> - <nl> - / / repeated . PB_ArangoKeyValue headers = 4 ; <nl> - for ( int i = 0 ; i < this - > headers_size ( ) ; i + + ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : <nl> - WriteMessageNoVirtualToArray ( <nl> - 4 , this - > headers ( i ) , target ) ; <nl> - } <nl> - <nl> - / / required . PB_ArangoMessageContentType contentType = 5 ; <nl> - if ( has_contenttype ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : WriteEnumToArray ( <nl> - 5 , this - > contenttype ( ) , target ) ; <nl> - } <nl> - <nl> - / / optional string content = 7 ; <nl> - if ( has_content ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > content ( ) . data ( ) , this - > content ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : SERIALIZE ) ; <nl> - target = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteStringToArray ( <nl> - 7 , this - > content ( ) , target ) ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoJsonContent json = 8 ; <nl> - if ( has_json ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : <nl> - WriteMessageNoVirtualToArray ( <nl> - 8 , this - > json ( ) , target ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFieldsToArray ( <nl> - unknown_fields ( ) , target ) ; <nl> - } <nl> - return target ; <nl> - } <nl> - <nl> - int PB_ArangoBlobRequest : : ByteSize ( ) const { <nl> - int total_size = 0 ; <nl> - <nl> - if ( _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - / / required . PB_ArangoRequestType requestType = 1 ; <nl> - if ( has_requesttype ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : EnumSize ( this - > requesttype ( ) ) ; <nl> - } <nl> - <nl> - / / required string url = 2 ; <nl> - if ( has_url ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : StringSize ( <nl> - this - > url ( ) ) ; <nl> - } <nl> - <nl> - / / required . PB_ArangoMessageContentType contentType = 5 ; <nl> - if ( has_contenttype ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : EnumSize ( this - > contenttype ( ) ) ; <nl> - } <nl> - <nl> - / / optional string content = 7 ; <nl> - if ( has_content ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : StringSize ( <nl> - this - > content ( ) ) ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoJsonContent json = 8 ; <nl> - if ( has_json ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : MessageSizeNoVirtual ( <nl> - this - > json ( ) ) ; <nl> - } <nl> - <nl> - } <nl> - / / repeated . PB_ArangoKeyValue values = 3 ; <nl> - total_size + = 1 * this - > values_size ( ) ; <nl> - for ( int i = 0 ; i < this - > values_size ( ) ; i + + ) { <nl> - total_size + = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : MessageSizeNoVirtual ( <nl> - this - > values ( i ) ) ; <nl> - } <nl> - <nl> - / / repeated . PB_ArangoKeyValue headers = 4 ; <nl> - total_size + = 1 * this - > headers_size ( ) ; <nl> - for ( int i = 0 ; i < this - > headers_size ( ) ; i + + ) { <nl> - total_size + = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : MessageSizeNoVirtual ( <nl> - this - > headers ( i ) ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - total_size + = <nl> - : : google : : protobuf : : internal : : WireFormat : : ComputeUnknownFieldsSize ( <nl> - unknown_fields ( ) ) ; <nl> - } <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = total_size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - return total_size ; <nl> - } <nl> - <nl> - void PB_ArangoBlobRequest : : MergeFrom ( const : : google : : protobuf : : Message & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - const PB_ArangoBlobRequest * source = <nl> - : : google : : protobuf : : internal : : dynamic_cast_if_available < const PB_ArangoBlobRequest * > ( <nl> - & from ) ; <nl> - if ( source = = NULL ) { <nl> - : : google : : protobuf : : internal : : ReflectionOps : : Merge ( from , this ) ; <nl> - } else { <nl> - MergeFrom ( * source ) ; <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoBlobRequest : : MergeFrom ( const PB_ArangoBlobRequest & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - values_ . MergeFrom ( from . values_ ) ; <nl> - headers_ . MergeFrom ( from . headers_ ) ; <nl> - if ( from . _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - if ( from . has_requesttype ( ) ) { <nl> - set_requesttype ( from . requesttype ( ) ) ; <nl> - } <nl> - if ( from . has_url ( ) ) { <nl> - set_url ( from . url ( ) ) ; <nl> - } <nl> - if ( from . has_contenttype ( ) ) { <nl> - set_contenttype ( from . contenttype ( ) ) ; <nl> - } <nl> - if ( from . has_content ( ) ) { <nl> - set_content ( from . content ( ) ) ; <nl> - } <nl> - if ( from . has_json ( ) ) { <nl> - mutable_json ( ) - > : : PB_ArangoJsonContent : : MergeFrom ( from . json ( ) ) ; <nl> - } <nl> - } <nl> - mutable_unknown_fields ( ) - > MergeFrom ( from . unknown_fields ( ) ) ; <nl> - } <nl> - <nl> - void PB_ArangoBlobRequest : : CopyFrom ( const : : google : : protobuf : : Message & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoBlobRequest : : CopyFrom ( const PB_ArangoBlobRequest & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - bool PB_ArangoBlobRequest : : IsInitialized ( ) const { <nl> - if ( ( _has_bits_ [ 0 ] & 0x00000013 ) ! = 0x00000013 ) return false ; <nl> - <nl> - for ( int i = 0 ; i < values_size ( ) ; i + + ) { <nl> - if ( ! this - > values ( i ) . IsInitialized ( ) ) return false ; <nl> - } <nl> - for ( int i = 0 ; i < headers_size ( ) ; i + + ) { <nl> - if ( ! this - > headers ( i ) . IsInitialized ( ) ) return false ; <nl> - } <nl> - if ( has_json ( ) ) { <nl> - if ( ! this - > json ( ) . IsInitialized ( ) ) return false ; <nl> - } <nl> - return true ; <nl> - } <nl> - <nl> - void PB_ArangoBlobRequest : : Swap ( PB_ArangoBlobRequest * other ) { <nl> - if ( other ! = this ) { <nl> - std : : swap ( requesttype_ , other - > requesttype_ ) ; <nl> - std : : swap ( url_ , other - > url_ ) ; <nl> - values_ . Swap ( & other - > values_ ) ; <nl> - headers_ . Swap ( & other - > headers_ ) ; <nl> - std : : swap ( contenttype_ , other - > contenttype_ ) ; <nl> - std : : swap ( content_ , other - > content_ ) ; <nl> - std : : swap ( json_ , other - > json_ ) ; <nl> - std : : swap ( _has_bits_ [ 0 ] , other - > _has_bits_ [ 0 ] ) ; <nl> - _unknown_fields_ . Swap ( & other - > _unknown_fields_ ) ; <nl> - std : : swap ( _cached_size_ , other - > _cached_size_ ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : Metadata PB_ArangoBlobRequest : : GetMetadata ( ) const { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - : : google : : protobuf : : Metadata metadata ; <nl> - metadata . descriptor = PB_ArangoBlobRequest_descriptor_ ; <nl> - metadata . reflection = PB_ArangoBlobRequest_reflection_ ; <nl> - return metadata ; <nl> - } <nl> - <nl> - <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - <nl> - # ifndef _MSC_VER <nl> - const int PB_ArangoBlobResponse : : kStatusFieldNumber ; <nl> - const int PB_ArangoBlobResponse : : kHeadersFieldNumber ; <nl> - const int PB_ArangoBlobResponse : : kContentTypeFieldNumber ; <nl> - const int PB_ArangoBlobResponse : : kContentLengthFieldNumber ; <nl> - const int PB_ArangoBlobResponse : : kContentFieldNumber ; <nl> - # endif / / ! _MSC_VER <nl> - <nl> - PB_ArangoBlobResponse : : PB_ArangoBlobResponse ( ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoBlobResponse : : InitAsDefaultInstance ( ) { <nl> - } <nl> - <nl> - PB_ArangoBlobResponse : : PB_ArangoBlobResponse ( const PB_ArangoBlobResponse & from ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoBlobResponse : : SharedCtor ( ) { <nl> - _cached_size_ = 0 ; <nl> - status_ = 0 ; <nl> - contenttype_ = 0 ; <nl> - contentlength_ = 0 ; <nl> - content_ = const_cast < : : std : : string * > ( & : : google : : protobuf : : internal : : kEmptyString ) ; <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - } <nl> - <nl> - PB_ArangoBlobResponse : : ~ PB_ArangoBlobResponse ( ) { <nl> - SharedDtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoBlobResponse : : SharedDtor ( ) { <nl> - if ( content_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - delete content_ ; <nl> - } <nl> - if ( this ! = default_instance_ ) { <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoBlobResponse : : SetCachedSize ( int size ) const { <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - } <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoBlobResponse : : descriptor ( ) { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - return PB_ArangoBlobResponse_descriptor_ ; <nl> - } <nl> - <nl> - const PB_ArangoBlobResponse & PB_ArangoBlobResponse : : default_instance ( ) { <nl> - if ( default_instance_ = = NULL ) protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; return * default_instance_ ; <nl> - } <nl> - <nl> - PB_ArangoBlobResponse * PB_ArangoBlobResponse : : default_instance_ = NULL ; <nl> - <nl> - PB_ArangoBlobResponse * PB_ArangoBlobResponse : : New ( ) const { <nl> - return new PB_ArangoBlobResponse ; <nl> - } <nl> - <nl> - void PB_ArangoBlobResponse : : Clear ( ) { <nl> - if ( _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - status_ = 0 ; <nl> - contenttype_ = 0 ; <nl> - contentlength_ = 0 ; <nl> - if ( has_content ( ) ) { <nl> - if ( content_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - content_ - > clear ( ) ; <nl> - } <nl> - } <nl> - } <nl> - headers_ . Clear ( ) ; <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - mutable_unknown_fields ( ) - > Clear ( ) ; <nl> - } <nl> - <nl> - bool PB_ArangoBlobResponse : : MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) { <nl> - # define DO_ ( EXPRESSION ) if ( ! ( EXPRESSION ) ) return false <nl> - : : google : : protobuf : : uint32 tag ; <nl> - while ( ( tag = input - > ReadTag ( ) ) ! = 0 ) { <nl> - switch ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagFieldNumber ( tag ) ) { <nl> - / / required int32 status = 1 ; <nl> - case 1 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_VARINT ) { <nl> - DO_ ( ( : : google : : protobuf : : internal : : WireFormatLite : : ReadPrimitive < <nl> - : : google : : protobuf : : int32 , : : google : : protobuf : : internal : : WireFormatLite : : TYPE_INT32 > ( <nl> - input , & status_ ) ) ) ; <nl> - set_has_status ( ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 18 ) ) goto parse_headers ; <nl> - break ; <nl> - } <nl> - <nl> - / / repeated . PB_ArangoKeyValue headers = 2 ; <nl> - case 2 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - parse_headers : <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadMessageNoVirtual ( <nl> - input , add_headers ( ) ) ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 18 ) ) goto parse_headers ; <nl> - if ( input - > ExpectTag ( 24 ) ) goto parse_contentType ; <nl> - break ; <nl> - } <nl> - <nl> - / / required . PB_ArangoMessageContentType contentType = 3 ; <nl> - case 3 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_VARINT ) { <nl> - parse_contentType : <nl> - int value ; <nl> - DO_ ( ( : : google : : protobuf : : internal : : WireFormatLite : : ReadPrimitive < <nl> - int , : : google : : protobuf : : internal : : WireFormatLite : : TYPE_ENUM > ( <nl> - input , & value ) ) ) ; <nl> - if ( PB_ArangoMessageContentType_IsValid ( value ) ) { <nl> - set_contenttype ( static_cast < PB_ArangoMessageContentType > ( value ) ) ; <nl> - } else { <nl> - mutable_unknown_fields ( ) - > AddVarint ( 3 , value ) ; <nl> - } <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 34 ) ) goto parse_content ; <nl> - break ; <nl> - } <nl> - <nl> - / / optional string content = 4 ; <nl> - case 4 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - parse_content : <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadString ( <nl> - input , this - > mutable_content ( ) ) ) ; <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > content ( ) . data ( ) , this - > content ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : PARSE ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectTag ( 48 ) ) goto parse_contentLength ; <nl> - break ; <nl> - } <nl> - <nl> - / / required int32 contentLength = 6 ; <nl> - case 6 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_VARINT ) { <nl> - parse_contentLength : <nl> - DO_ ( ( : : google : : protobuf : : internal : : WireFormatLite : : ReadPrimitive < <nl> - : : google : : protobuf : : int32 , : : google : : protobuf : : internal : : WireFormatLite : : TYPE_INT32 > ( <nl> - input , & contentlength_ ) ) ) ; <nl> - set_has_contentlength ( ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectAtEnd ( ) ) return true ; <nl> - break ; <nl> - } <nl> - <nl> - default : { <nl> - handle_uninterpreted : <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_END_GROUP ) { <nl> - return true ; <nl> - } <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormat : : SkipField ( <nl> - input , tag , mutable_unknown_fields ( ) ) ) ; <nl> - break ; <nl> - } <nl> - } <nl> - } <nl> - return true ; <nl> - # undef DO_ <nl> - } <nl> - <nl> - void PB_ArangoBlobResponse : : SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const { <nl> - / / required int32 status = 1 ; <nl> - if ( has_status ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteInt32 ( 1 , this - > status ( ) , output ) ; <nl> - } <nl> - <nl> - / / repeated . PB_ArangoKeyValue headers = 2 ; <nl> - for ( int i = 0 ; i < this - > headers_size ( ) ; i + + ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteMessageMaybeToArray ( <nl> - 2 , this - > headers ( i ) , output ) ; <nl> - } <nl> - <nl> - / / required . PB_ArangoMessageContentType contentType = 3 ; <nl> - if ( has_contenttype ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteEnum ( <nl> - 3 , this - > contenttype ( ) , output ) ; <nl> - } <nl> - <nl> - / / optional string content = 4 ; <nl> - if ( has_content ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > content ( ) . data ( ) , this - > content ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : SERIALIZE ) ; <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteString ( <nl> - 4 , this - > content ( ) , output ) ; <nl> - } <nl> - <nl> - / / required int32 contentLength = 6 ; <nl> - if ( has_contentlength ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteInt32 ( 6 , this - > contentlength ( ) , output ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFields ( <nl> - unknown_fields ( ) , output ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : uint8 * PB_ArangoBlobResponse : : SerializeWithCachedSizesToArray ( <nl> - : : google : : protobuf : : uint8 * target ) const { <nl> - / / required int32 status = 1 ; <nl> - if ( has_status ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : WriteInt32ToArray ( 1 , this - > status ( ) , target ) ; <nl> - } <nl> - <nl> - / / repeated . PB_ArangoKeyValue headers = 2 ; <nl> - for ( int i = 0 ; i < this - > headers_size ( ) ; i + + ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : <nl> - WriteMessageNoVirtualToArray ( <nl> - 2 , this - > headers ( i ) , target ) ; <nl> - } <nl> - <nl> - / / required . PB_ArangoMessageContentType contentType = 3 ; <nl> - if ( has_contenttype ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : WriteEnumToArray ( <nl> - 3 , this - > contenttype ( ) , target ) ; <nl> - } <nl> - <nl> - / / optional string content = 4 ; <nl> - if ( has_content ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > content ( ) . data ( ) , this - > content ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : SERIALIZE ) ; <nl> - target = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteStringToArray ( <nl> - 4 , this - > content ( ) , target ) ; <nl> - } <nl> - <nl> - / / required int32 contentLength = 6 ; <nl> - if ( has_contentlength ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormatLite : : WriteInt32ToArray ( 6 , this - > contentlength ( ) , target ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFieldsToArray ( <nl> - unknown_fields ( ) , target ) ; <nl> - } <nl> - return target ; <nl> - } <nl> - <nl> - int PB_ArangoBlobResponse : : ByteSize ( ) const { <nl> - int total_size = 0 ; <nl> - <nl> - if ( _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - / / required int32 status = 1 ; <nl> - if ( has_status ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : Int32Size ( <nl> - this - > status ( ) ) ; <nl> - } <nl> - <nl> - / / required . PB_ArangoMessageContentType contentType = 3 ; <nl> - if ( has_contenttype ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : EnumSize ( this - > contenttype ( ) ) ; <nl> - } <nl> - <nl> - / / required int32 contentLength = 6 ; <nl> - if ( has_contentlength ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : Int32Size ( <nl> - this - > contentlength ( ) ) ; <nl> - } <nl> - <nl> - / / optional string content = 4 ; <nl> - if ( has_content ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : StringSize ( <nl> - this - > content ( ) ) ; <nl> - } <nl> - <nl> - } <nl> - / / repeated . PB_ArangoKeyValue headers = 2 ; <nl> - total_size + = 1 * this - > headers_size ( ) ; <nl> - for ( int i = 0 ; i < this - > headers_size ( ) ; i + + ) { <nl> - total_size + = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : MessageSizeNoVirtual ( <nl> - this - > headers ( i ) ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - total_size + = <nl> - : : google : : protobuf : : internal : : WireFormat : : ComputeUnknownFieldsSize ( <nl> - unknown_fields ( ) ) ; <nl> - } <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = total_size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - return total_size ; <nl> - } <nl> - <nl> - void PB_ArangoBlobResponse : : MergeFrom ( const : : google : : protobuf : : Message & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - const PB_ArangoBlobResponse * source = <nl> - : : google : : protobuf : : internal : : dynamic_cast_if_available < const PB_ArangoBlobResponse * > ( <nl> - & from ) ; <nl> - if ( source = = NULL ) { <nl> - : : google : : protobuf : : internal : : ReflectionOps : : Merge ( from , this ) ; <nl> - } else { <nl> - MergeFrom ( * source ) ; <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoBlobResponse : : MergeFrom ( const PB_ArangoBlobResponse & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - headers_ . MergeFrom ( from . headers_ ) ; <nl> - if ( from . _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - if ( from . has_status ( ) ) { <nl> - set_status ( from . status ( ) ) ; <nl> - } <nl> - if ( from . has_contenttype ( ) ) { <nl> - set_contenttype ( from . contenttype ( ) ) ; <nl> - } <nl> - if ( from . has_contentlength ( ) ) { <nl> - set_contentlength ( from . contentlength ( ) ) ; <nl> - } <nl> - if ( from . has_content ( ) ) { <nl> - set_content ( from . content ( ) ) ; <nl> - } <nl> - } <nl> - mutable_unknown_fields ( ) - > MergeFrom ( from . unknown_fields ( ) ) ; <nl> - } <nl> - <nl> - void PB_ArangoBlobResponse : : CopyFrom ( const : : google : : protobuf : : Message & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoBlobResponse : : CopyFrom ( const PB_ArangoBlobResponse & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - bool PB_ArangoBlobResponse : : IsInitialized ( ) const { <nl> - if ( ( _has_bits_ [ 0 ] & 0x0000000d ) ! = 0x0000000d ) return false ; <nl> - <nl> - for ( int i = 0 ; i < headers_size ( ) ; i + + ) { <nl> - if ( ! this - > headers ( i ) . IsInitialized ( ) ) return false ; <nl> - } <nl> - return true ; <nl> - } <nl> - <nl> - void PB_ArangoBlobResponse : : Swap ( PB_ArangoBlobResponse * other ) { <nl> - if ( other ! = this ) { <nl> - std : : swap ( status_ , other - > status_ ) ; <nl> - headers_ . Swap ( & other - > headers_ ) ; <nl> - std : : swap ( contenttype_ , other - > contenttype_ ) ; <nl> - std : : swap ( contentlength_ , other - > contentlength_ ) ; <nl> - std : : swap ( content_ , other - > content_ ) ; <nl> - std : : swap ( _has_bits_ [ 0 ] , other - > _has_bits_ [ 0 ] ) ; <nl> - _unknown_fields_ . Swap ( & other - > _unknown_fields_ ) ; <nl> - std : : swap ( _cached_size_ , other - > _cached_size_ ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : Metadata PB_ArangoBlobResponse : : GetMetadata ( ) const { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - : : google : : protobuf : : Metadata metadata ; <nl> - metadata . descriptor = PB_ArangoBlobResponse_descriptor_ ; <nl> - metadata . reflection = PB_ArangoBlobResponse_reflection_ ; <nl> - return metadata ; <nl> - } <nl> - <nl> - <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - <nl> - # ifndef _MSC_VER <nl> - const int PB_ArangoErrorResponse : : kMessageFieldNumber ; <nl> - # endif / / ! _MSC_VER <nl> - <nl> - PB_ArangoErrorResponse : : PB_ArangoErrorResponse ( ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoErrorResponse : : InitAsDefaultInstance ( ) { <nl> - } <nl> - <nl> - PB_ArangoErrorResponse : : PB_ArangoErrorResponse ( const PB_ArangoErrorResponse & from ) <nl> - : : : google : : protobuf : : Message ( ) { <nl> - SharedCtor ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoErrorResponse : : SharedCtor ( ) { <nl> - _cached_size_ = 0 ; <nl> - message_ = const_cast < : : std : : string * > ( & : : google : : protobuf : : internal : : kEmptyString ) ; <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - } <nl> - <nl> - PB_ArangoErrorResponse : : ~ PB_ArangoErrorResponse ( ) { <nl> - SharedDtor ( ) ; <nl> - } <nl> - <nl> - void PB_ArangoErrorResponse : : SharedDtor ( ) { <nl> - if ( message_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - delete message_ ; <nl> - } <nl> - if ( this ! = default_instance_ ) { <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoErrorResponse : : SetCachedSize ( int size ) const { <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - } <nl> - const : : google : : protobuf : : Descriptor * PB_ArangoErrorResponse : : descriptor ( ) { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - return PB_ArangoErrorResponse_descriptor_ ; <nl> - } <nl> - <nl> - const PB_ArangoErrorResponse & PB_ArangoErrorResponse : : default_instance ( ) { <nl> - if ( default_instance_ = = NULL ) protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; return * default_instance_ ; <nl> - } <nl> - <nl> - PB_ArangoErrorResponse * PB_ArangoErrorResponse : : default_instance_ = NULL ; <nl> - <nl> - PB_ArangoErrorResponse * PB_ArangoErrorResponse : : New ( ) const { <nl> - return new PB_ArangoErrorResponse ; <nl> - } <nl> - <nl> - void PB_ArangoErrorResponse : : Clear ( ) { <nl> - if ( _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - if ( has_message ( ) ) { <nl> - if ( message_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - message_ - > clear ( ) ; <nl> - } <nl> - } <nl> - } <nl> - : : memset ( _has_bits_ , 0 , sizeof ( _has_bits_ ) ) ; <nl> - mutable_unknown_fields ( ) - > Clear ( ) ; <nl> - } <nl> - <nl> - bool PB_ArangoErrorResponse : : MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) { <nl> - # define DO_ ( EXPRESSION ) if ( ! ( EXPRESSION ) ) return false <nl> - : : google : : protobuf : : uint32 tag ; <nl> - while ( ( tag = input - > ReadTag ( ) ) ! = 0 ) { <nl> - switch ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagFieldNumber ( tag ) ) { <nl> - / / required string message = 1 ; <nl> - case 1 : { <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_LENGTH_DELIMITED ) { <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormatLite : : ReadString ( <nl> - input , this - > mutable_message ( ) ) ) ; <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > message ( ) . data ( ) , this - > message ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : PARSE ) ; <nl> - } else { <nl> - goto handle_uninterpreted ; <nl> - } <nl> - if ( input - > ExpectAtEnd ( ) ) return true ; <nl> - break ; <nl> - } <nl> - <nl> - default : { <nl> - handle_uninterpreted : <nl> - if ( : : google : : protobuf : : internal : : WireFormatLite : : GetTagWireType ( tag ) = = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WIRETYPE_END_GROUP ) { <nl> - return true ; <nl> - } <nl> - DO_ ( : : google : : protobuf : : internal : : WireFormat : : SkipField ( <nl> - input , tag , mutable_unknown_fields ( ) ) ) ; <nl> - break ; <nl> - } <nl> - } <nl> - } <nl> - return true ; <nl> - # undef DO_ <nl> - } <nl> - <nl> - void PB_ArangoErrorResponse : : SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const { <nl> - / / required string message = 1 ; <nl> - if ( has_message ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > message ( ) . data ( ) , this - > message ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : SERIALIZE ) ; <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteString ( <nl> - 1 , this - > message ( ) , output ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFields ( <nl> - unknown_fields ( ) , output ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : uint8 * PB_ArangoErrorResponse : : SerializeWithCachedSizesToArray ( <nl> - : : google : : protobuf : : uint8 * target ) const { <nl> - / / required string message = 1 ; <nl> - if ( has_message ( ) ) { <nl> - : : google : : protobuf : : internal : : WireFormat : : VerifyUTF8String ( <nl> - this - > message ( ) . data ( ) , this - > message ( ) . length ( ) , <nl> - : : google : : protobuf : : internal : : WireFormat : : SERIALIZE ) ; <nl> - target = <nl> - : : google : : protobuf : : internal : : WireFormatLite : : WriteStringToArray ( <nl> - 1 , this - > message ( ) , target ) ; <nl> - } <nl> - <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - target = : : google : : protobuf : : internal : : WireFormat : : SerializeUnknownFieldsToArray ( <nl> - unknown_fields ( ) , target ) ; <nl> - } <nl> - return target ; <nl> - } <nl> - <nl> - int PB_ArangoErrorResponse : : ByteSize ( ) const { <nl> - int total_size = 0 ; <nl> - <nl> - if ( _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - / / required string message = 1 ; <nl> - if ( has_message ( ) ) { <nl> - total_size + = 1 + <nl> - : : google : : protobuf : : internal : : WireFormatLite : : StringSize ( <nl> - this - > message ( ) ) ; <nl> - } <nl> - <nl> - } <nl> - if ( ! unknown_fields ( ) . empty ( ) ) { <nl> - total_size + = <nl> - : : google : : protobuf : : internal : : WireFormat : : ComputeUnknownFieldsSize ( <nl> - unknown_fields ( ) ) ; <nl> - } <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN ( ) ; <nl> - _cached_size_ = total_size ; <nl> - GOOGLE_SAFE_CONCURRENT_WRITES_END ( ) ; <nl> - return total_size ; <nl> - } <nl> - <nl> - void PB_ArangoErrorResponse : : MergeFrom ( const : : google : : protobuf : : Message & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - const PB_ArangoErrorResponse * source = <nl> - : : google : : protobuf : : internal : : dynamic_cast_if_available < const PB_ArangoErrorResponse * > ( <nl> - & from ) ; <nl> - if ( source = = NULL ) { <nl> - : : google : : protobuf : : internal : : ReflectionOps : : Merge ( from , this ) ; <nl> - } else { <nl> - MergeFrom ( * source ) ; <nl> - } <nl> - } <nl> - <nl> - void PB_ArangoErrorResponse : : MergeFrom ( const PB_ArangoErrorResponse & from ) { <nl> - GOOGLE_CHECK_NE ( & from , this ) ; <nl> - if ( from . _has_bits_ [ 0 / 32 ] & ( 0xffu < < ( 0 % 32 ) ) ) { <nl> - if ( from . has_message ( ) ) { <nl> - set_message ( from . message ( ) ) ; <nl> - } <nl> - } <nl> - mutable_unknown_fields ( ) - > MergeFrom ( from . unknown_fields ( ) ) ; <nl> - } <nl> - <nl> - void PB_ArangoErrorResponse : : CopyFrom ( const : : google : : protobuf : : Message & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - void PB_ArangoErrorResponse : : CopyFrom ( const PB_ArangoErrorResponse & from ) { <nl> - if ( & from = = this ) return ; <nl> - Clear ( ) ; <nl> - MergeFrom ( from ) ; <nl> - } <nl> - <nl> - bool PB_ArangoErrorResponse : : IsInitialized ( ) const { <nl> - if ( ( _has_bits_ [ 0 ] & 0x00000001 ) ! = 0x00000001 ) return false ; <nl> - <nl> - return true ; <nl> - } <nl> - <nl> - void PB_ArangoErrorResponse : : Swap ( PB_ArangoErrorResponse * other ) { <nl> - if ( other ! = this ) { <nl> - std : : swap ( message_ , other - > message_ ) ; <nl> - std : : swap ( _has_bits_ [ 0 ] , other - > _has_bits_ [ 0 ] ) ; <nl> - _unknown_fields_ . Swap ( & other - > _unknown_fields_ ) ; <nl> - std : : swap ( _cached_size_ , other - > _cached_size_ ) ; <nl> - } <nl> - } <nl> - <nl> - : : google : : protobuf : : Metadata PB_ArangoErrorResponse : : GetMetadata ( ) const { <nl> - protobuf_AssignDescriptorsOnce ( ) ; <nl> - : : google : : protobuf : : Metadata metadata ; <nl> - metadata . descriptor = PB_ArangoErrorResponse_descriptor_ ; <nl> - metadata . reflection = PB_ArangoErrorResponse_reflection_ ; <nl> - return metadata ; <nl> - } <nl> - <nl> - <nl> - / / @ @ protoc_insertion_point ( namespace_scope ) <nl> - <nl> - / / @ @ protoc_insertion_point ( global_scope ) <nl> deleted file mode 100644 <nl> index f13fa527b35 . . 00000000000 <nl> mmm a / lib / ProtocolBuffers / arangodb . pb . h <nl> ppp / dev / null <nl> <nl> - / / Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> - / / source : lib / ProtocolBuffers / arangodb . proto <nl> - <nl> - # ifndef PROTOBUF_lib_2fProtocolBuffers_2farangodb_2eproto__INCLUDED <nl> - # define PROTOBUF_lib_2fProtocolBuffers_2farangodb_2eproto__INCLUDED <nl> - <nl> - # include < string > <nl> - <nl> - # include < google / protobuf / stubs / common . h > <nl> - <nl> - # if GOOGLE_PROTOBUF_VERSION < 2004000 <nl> - # error This file was generated by a newer version of protoc which is <nl> - # error incompatible with your Protocol Buffer headers . Please update <nl> - # error your headers . <nl> - # endif <nl> - # if 2004001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION <nl> - # error This file was generated by an older version of protoc which is <nl> - # error incompatible with your Protocol Buffer headers . Please <nl> - # error regenerate this file with a newer version of protoc . <nl> - # endif <nl> - <nl> - # include < google / protobuf / generated_message_util . h > <nl> - # include < google / protobuf / repeated_field . h > <nl> - # include < google / protobuf / extension_set . h > <nl> - # include < google / protobuf / generated_message_reflection . h > <nl> - / / @ @ protoc_insertion_point ( includes ) <nl> - <nl> - / / Internal implementation detail - - do not call these . <nl> - void protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - void protobuf_AssignDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - void protobuf_ShutdownFile_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - <nl> - class PB_ArangoKeyValue ; <nl> - class PB_ArangoMessage ; <nl> - class PB_ArangoBatchMessage ; <nl> - class PB_ArangoJsonValue ; <nl> - class PB_ArangoJsonContent ; <nl> - class PB_ArangoBlobRequest ; <nl> - class PB_ArangoBlobResponse ; <nl> - class PB_ArangoErrorResponse ; <nl> - <nl> - enum PB_ArangoMessageType { <nl> - PB_BLOB_REQUEST = 0 , <nl> - PB_BLOB_RESPONSE = 1 , <nl> - PB_ERROR_RESPONSE = 2 <nl> - } ; <nl> - bool PB_ArangoMessageType_IsValid ( int value ) ; <nl> - const PB_ArangoMessageType PB_ArangoMessageType_MIN = PB_BLOB_REQUEST ; <nl> - const PB_ArangoMessageType PB_ArangoMessageType_MAX = PB_ERROR_RESPONSE ; <nl> - const int PB_ArangoMessageType_ARRAYSIZE = PB_ArangoMessageType_MAX + 1 ; <nl> - <nl> - const : : google : : protobuf : : EnumDescriptor * PB_ArangoMessageType_descriptor ( ) ; <nl> - inline const : : std : : string & PB_ArangoMessageType_Name ( PB_ArangoMessageType value ) { <nl> - return : : google : : protobuf : : internal : : NameOfEnum ( <nl> - PB_ArangoMessageType_descriptor ( ) , value ) ; <nl> - } <nl> - inline bool PB_ArangoMessageType_Parse ( <nl> - const : : std : : string & name , PB_ArangoMessageType * value ) { <nl> - return : : google : : protobuf : : internal : : ParseNamedEnum < PB_ArangoMessageType > ( <nl> - PB_ArangoMessageType_descriptor ( ) , name , value ) ; <nl> - } <nl> - enum PB_ArangoMessageContentType { <nl> - PB_NO_CONTENT = 0 , <nl> - PB_TEXT_CONTENT = 1 , <nl> - PB_JSON_CONTENT = 2 <nl> - } ; <nl> - bool PB_ArangoMessageContentType_IsValid ( int value ) ; <nl> - const PB_ArangoMessageContentType PB_ArangoMessageContentType_MIN = PB_NO_CONTENT ; <nl> - const PB_ArangoMessageContentType PB_ArangoMessageContentType_MAX = PB_JSON_CONTENT ; <nl> - const int PB_ArangoMessageContentType_ARRAYSIZE = PB_ArangoMessageContentType_MAX + 1 ; <nl> - <nl> - const : : google : : protobuf : : EnumDescriptor * PB_ArangoMessageContentType_descriptor ( ) ; <nl> - inline const : : std : : string & PB_ArangoMessageContentType_Name ( PB_ArangoMessageContentType value ) { <nl> - return : : google : : protobuf : : internal : : NameOfEnum ( <nl> - PB_ArangoMessageContentType_descriptor ( ) , value ) ; <nl> - } <nl> - inline bool PB_ArangoMessageContentType_Parse ( <nl> - const : : std : : string & name , PB_ArangoMessageContentType * value ) { <nl> - return : : google : : protobuf : : internal : : ParseNamedEnum < PB_ArangoMessageContentType > ( <nl> - PB_ArangoMessageContentType_descriptor ( ) , name , value ) ; <nl> - } <nl> - enum PB_ArangoRequestType { <nl> - PB_REQUEST_TYPE_DELETE = 0 , <nl> - PB_REQUEST_TYPE_GET = 1 , <nl> - PB_REQUEST_TYPE_HEAD = 2 , <nl> - PB_REQUEST_TYPE_POST = 3 , <nl> - PB_REQUEST_TYPE_PUT = 4 , <nl> - PB_REQUEST_TYPE_PATCH = 5 <nl> - } ; <nl> - bool PB_ArangoRequestType_IsValid ( int value ) ; <nl> - const PB_ArangoRequestType PB_ArangoRequestType_MIN = PB_REQUEST_TYPE_DELETE ; <nl> - const PB_ArangoRequestType PB_ArangoRequestType_MAX = PB_REQUEST_TYPE_PATCH ; <nl> - const int PB_ArangoRequestType_ARRAYSIZE = PB_ArangoRequestType_MAX + 1 ; <nl> - <nl> - const : : google : : protobuf : : EnumDescriptor * PB_ArangoRequestType_descriptor ( ) ; <nl> - inline const : : std : : string & PB_ArangoRequestType_Name ( PB_ArangoRequestType value ) { <nl> - return : : google : : protobuf : : internal : : NameOfEnum ( <nl> - PB_ArangoRequestType_descriptor ( ) , value ) ; <nl> - } <nl> - inline bool PB_ArangoRequestType_Parse ( <nl> - const : : std : : string & name , PB_ArangoRequestType * value ) { <nl> - return : : google : : protobuf : : internal : : ParseNamedEnum < PB_ArangoRequestType > ( <nl> - PB_ArangoRequestType_descriptor ( ) , name , value ) ; <nl> - } <nl> - enum PB_ArangoJsonType { <nl> - PB_REQUEST_TYPE_NULL = 0 , <nl> - PB_REQUEST_TYPE_BOOLEAN = 1 , <nl> - PB_REQUEST_TYPE_NUMBER = 2 , <nl> - PB_REQUEST_TYPE_STRING = 3 , <nl> - PB_REQUEST_TYPE_ARRAY = 4 , <nl> - PB_REQUEST_TYPE_LIST = 5 <nl> - } ; <nl> - bool PB_ArangoJsonType_IsValid ( int value ) ; <nl> - const PB_ArangoJsonType PB_ArangoJsonType_MIN = PB_REQUEST_TYPE_NULL ; <nl> - const PB_ArangoJsonType PB_ArangoJsonType_MAX = PB_REQUEST_TYPE_LIST ; <nl> - const int PB_ArangoJsonType_ARRAYSIZE = PB_ArangoJsonType_MAX + 1 ; <nl> - <nl> - const : : google : : protobuf : : EnumDescriptor * PB_ArangoJsonType_descriptor ( ) ; <nl> - inline const : : std : : string & PB_ArangoJsonType_Name ( PB_ArangoJsonType value ) { <nl> - return : : google : : protobuf : : internal : : NameOfEnum ( <nl> - PB_ArangoJsonType_descriptor ( ) , value ) ; <nl> - } <nl> - inline bool PB_ArangoJsonType_Parse ( <nl> - const : : std : : string & name , PB_ArangoJsonType * value ) { <nl> - return : : google : : protobuf : : internal : : ParseNamedEnum < PB_ArangoJsonType > ( <nl> - PB_ArangoJsonType_descriptor ( ) , name , value ) ; <nl> - } <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - <nl> - class PB_ArangoKeyValue : public : : google : : protobuf : : Message { <nl> - public : <nl> - PB_ArangoKeyValue ( ) ; <nl> - virtual ~ PB_ArangoKeyValue ( ) ; <nl> - <nl> - PB_ArangoKeyValue ( const PB_ArangoKeyValue & from ) ; <nl> - <nl> - inline PB_ArangoKeyValue & operator = ( const PB_ArangoKeyValue & from ) { <nl> - CopyFrom ( from ) ; <nl> - return * this ; <nl> - } <nl> - <nl> - inline const : : google : : protobuf : : UnknownFieldSet & unknown_fields ( ) const { <nl> - return _unknown_fields_ ; <nl> - } <nl> - <nl> - inline : : google : : protobuf : : UnknownFieldSet * mutable_unknown_fields ( ) { <nl> - return & _unknown_fields_ ; <nl> - } <nl> - <nl> - static const : : google : : protobuf : : Descriptor * descriptor ( ) ; <nl> - static const PB_ArangoKeyValue & default_instance ( ) ; <nl> - <nl> - void Swap ( PB_ArangoKeyValue * other ) ; <nl> - <nl> - / / implements Message mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - PB_ArangoKeyValue * New ( ) const ; <nl> - void CopyFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void MergeFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void CopyFrom ( const PB_ArangoKeyValue & from ) ; <nl> - void MergeFrom ( const PB_ArangoKeyValue & from ) ; <nl> - void Clear ( ) ; <nl> - bool IsInitialized ( ) const ; <nl> - <nl> - int ByteSize ( ) const ; <nl> - bool MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) ; <nl> - void SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const ; <nl> - : : google : : protobuf : : uint8 * SerializeWithCachedSizesToArray ( : : google : : protobuf : : uint8 * output ) const ; <nl> - int GetCachedSize ( ) const { return _cached_size_ ; } <nl> - private : <nl> - void SharedCtor ( ) ; <nl> - void SharedDtor ( ) ; <nl> - void SetCachedSize ( int size ) const ; <nl> - public : <nl> - <nl> - : : google : : protobuf : : Metadata GetMetadata ( ) const ; <nl> - <nl> - / / nested types mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / accessors mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / required string key = 1 ; <nl> - inline bool has_key ( ) const ; <nl> - inline void clear_key ( ) ; <nl> - static const int kKeyFieldNumber = 1 ; <nl> - inline const : : std : : string & key ( ) const ; <nl> - inline void set_key ( const : : std : : string & value ) ; <nl> - inline void set_key ( const char * value ) ; <nl> - inline void set_key ( const char * value , size_t size ) ; <nl> - inline : : std : : string * mutable_key ( ) ; <nl> - inline : : std : : string * release_key ( ) ; <nl> - <nl> - / / required string value = 2 ; <nl> - inline bool has_value ( ) const ; <nl> - inline void clear_value ( ) ; <nl> - static const int kValueFieldNumber = 2 ; <nl> - inline const : : std : : string & value ( ) const ; <nl> - inline void set_value ( const : : std : : string & value ) ; <nl> - inline void set_value ( const char * value ) ; <nl> - inline void set_value ( const char * value , size_t size ) ; <nl> - inline : : std : : string * mutable_value ( ) ; <nl> - inline : : std : : string * release_value ( ) ; <nl> - <nl> - / / @ @ protoc_insertion_point ( class_scope : PB_ArangoKeyValue ) <nl> - private : <nl> - inline void set_has_key ( ) ; <nl> - inline void clear_has_key ( ) ; <nl> - inline void set_has_value ( ) ; <nl> - inline void clear_has_value ( ) ; <nl> - <nl> - : : google : : protobuf : : UnknownFieldSet _unknown_fields_ ; <nl> - <nl> - : : std : : string * key_ ; <nl> - : : std : : string * value_ ; <nl> - <nl> - mutable int _cached_size_ ; <nl> - : : google : : protobuf : : uint32 _has_bits_ [ ( 2 + 31 ) / 32 ] ; <nl> - <nl> - friend void protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_AssignDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_ShutdownFile_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - <nl> - void InitAsDefaultInstance ( ) ; <nl> - static PB_ArangoKeyValue * default_instance_ ; <nl> - } ; <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - class PB_ArangoMessage : public : : google : : protobuf : : Message { <nl> - public : <nl> - PB_ArangoMessage ( ) ; <nl> - virtual ~ PB_ArangoMessage ( ) ; <nl> - <nl> - PB_ArangoMessage ( const PB_ArangoMessage & from ) ; <nl> - <nl> - inline PB_ArangoMessage & operator = ( const PB_ArangoMessage & from ) { <nl> - CopyFrom ( from ) ; <nl> - return * this ; <nl> - } <nl> - <nl> - inline const : : google : : protobuf : : UnknownFieldSet & unknown_fields ( ) const { <nl> - return _unknown_fields_ ; <nl> - } <nl> - <nl> - inline : : google : : protobuf : : UnknownFieldSet * mutable_unknown_fields ( ) { <nl> - return & _unknown_fields_ ; <nl> - } <nl> - <nl> - static const : : google : : protobuf : : Descriptor * descriptor ( ) ; <nl> - static const PB_ArangoMessage & default_instance ( ) ; <nl> - <nl> - void Swap ( PB_ArangoMessage * other ) ; <nl> - <nl> - / / implements Message mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - PB_ArangoMessage * New ( ) const ; <nl> - void CopyFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void MergeFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void CopyFrom ( const PB_ArangoMessage & from ) ; <nl> - void MergeFrom ( const PB_ArangoMessage & from ) ; <nl> - void Clear ( ) ; <nl> - bool IsInitialized ( ) const ; <nl> - <nl> - int ByteSize ( ) const ; <nl> - bool MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) ; <nl> - void SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const ; <nl> - : : google : : protobuf : : uint8 * SerializeWithCachedSizesToArray ( : : google : : protobuf : : uint8 * output ) const ; <nl> - int GetCachedSize ( ) const { return _cached_size_ ; } <nl> - private : <nl> - void SharedCtor ( ) ; <nl> - void SharedDtor ( ) ; <nl> - void SetCachedSize ( int size ) const ; <nl> - public : <nl> - <nl> - : : google : : protobuf : : Metadata GetMetadata ( ) const ; <nl> - <nl> - / / nested types mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / accessors mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / repeated . PB_ArangoBatchMessage messages = 1 ; <nl> - inline int messages_size ( ) const ; <nl> - inline void clear_messages ( ) ; <nl> - static const int kMessagesFieldNumber = 1 ; <nl> - inline const : : PB_ArangoBatchMessage & messages ( int index ) const ; <nl> - inline : : PB_ArangoBatchMessage * mutable_messages ( int index ) ; <nl> - inline : : PB_ArangoBatchMessage * add_messages ( ) ; <nl> - inline const : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoBatchMessage > & <nl> - messages ( ) const ; <nl> - inline : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoBatchMessage > * <nl> - mutable_messages ( ) ; <nl> - <nl> - / / @ @ protoc_insertion_point ( class_scope : PB_ArangoMessage ) <nl> - private : <nl> - <nl> - : : google : : protobuf : : UnknownFieldSet _unknown_fields_ ; <nl> - <nl> - : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoBatchMessage > messages_ ; <nl> - <nl> - mutable int _cached_size_ ; <nl> - : : google : : protobuf : : uint32 _has_bits_ [ ( 1 + 31 ) / 32 ] ; <nl> - <nl> - friend void protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_AssignDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_ShutdownFile_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - <nl> - void InitAsDefaultInstance ( ) ; <nl> - static PB_ArangoMessage * default_instance_ ; <nl> - } ; <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - class PB_ArangoBatchMessage : public : : google : : protobuf : : Message { <nl> - public : <nl> - PB_ArangoBatchMessage ( ) ; <nl> - virtual ~ PB_ArangoBatchMessage ( ) ; <nl> - <nl> - PB_ArangoBatchMessage ( const PB_ArangoBatchMessage & from ) ; <nl> - <nl> - inline PB_ArangoBatchMessage & operator = ( const PB_ArangoBatchMessage & from ) { <nl> - CopyFrom ( from ) ; <nl> - return * this ; <nl> - } <nl> - <nl> - inline const : : google : : protobuf : : UnknownFieldSet & unknown_fields ( ) const { <nl> - return _unknown_fields_ ; <nl> - } <nl> - <nl> - inline : : google : : protobuf : : UnknownFieldSet * mutable_unknown_fields ( ) { <nl> - return & _unknown_fields_ ; <nl> - } <nl> - <nl> - static const : : google : : protobuf : : Descriptor * descriptor ( ) ; <nl> - static const PB_ArangoBatchMessage & default_instance ( ) ; <nl> - <nl> - void Swap ( PB_ArangoBatchMessage * other ) ; <nl> - <nl> - / / implements Message mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - PB_ArangoBatchMessage * New ( ) const ; <nl> - void CopyFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void MergeFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void CopyFrom ( const PB_ArangoBatchMessage & from ) ; <nl> - void MergeFrom ( const PB_ArangoBatchMessage & from ) ; <nl> - void Clear ( ) ; <nl> - bool IsInitialized ( ) const ; <nl> - <nl> - int ByteSize ( ) const ; <nl> - bool MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) ; <nl> - void SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const ; <nl> - : : google : : protobuf : : uint8 * SerializeWithCachedSizesToArray ( : : google : : protobuf : : uint8 * output ) const ; <nl> - int GetCachedSize ( ) const { return _cached_size_ ; } <nl> - private : <nl> - void SharedCtor ( ) ; <nl> - void SharedDtor ( ) ; <nl> - void SetCachedSize ( int size ) const ; <nl> - public : <nl> - <nl> - : : google : : protobuf : : Metadata GetMetadata ( ) const ; <nl> - <nl> - / / nested types mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / accessors mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / required . PB_ArangoMessageType type = 1 ; <nl> - inline bool has_type ( ) const ; <nl> - inline void clear_type ( ) ; <nl> - static const int kTypeFieldNumber = 1 ; <nl> - inline PB_ArangoMessageType type ( ) const ; <nl> - inline void set_type ( PB_ArangoMessageType value ) ; <nl> - <nl> - / / optional . PB_ArangoBlobRequest blobRequest = 2 ; <nl> - inline bool has_blobrequest ( ) const ; <nl> - inline void clear_blobrequest ( ) ; <nl> - static const int kBlobRequestFieldNumber = 2 ; <nl> - inline const : : PB_ArangoBlobRequest & blobrequest ( ) const ; <nl> - inline : : PB_ArangoBlobRequest * mutable_blobrequest ( ) ; <nl> - inline : : PB_ArangoBlobRequest * release_blobrequest ( ) ; <nl> - <nl> - / / optional . PB_ArangoBlobResponse blobResponse = 3 ; <nl> - inline bool has_blobresponse ( ) const ; <nl> - inline void clear_blobresponse ( ) ; <nl> - static const int kBlobResponseFieldNumber = 3 ; <nl> - inline const : : PB_ArangoBlobResponse & blobresponse ( ) const ; <nl> - inline : : PB_ArangoBlobResponse * mutable_blobresponse ( ) ; <nl> - inline : : PB_ArangoBlobResponse * release_blobresponse ( ) ; <nl> - <nl> - / / optional . PB_ArangoErrorResponse errorResponse = 4 ; <nl> - inline bool has_errorresponse ( ) const ; <nl> - inline void clear_errorresponse ( ) ; <nl> - static const int kErrorResponseFieldNumber = 4 ; <nl> - inline const : : PB_ArangoErrorResponse & errorresponse ( ) const ; <nl> - inline : : PB_ArangoErrorResponse * mutable_errorresponse ( ) ; <nl> - inline : : PB_ArangoErrorResponse * release_errorresponse ( ) ; <nl> - <nl> - / / @ @ protoc_insertion_point ( class_scope : PB_ArangoBatchMessage ) <nl> - private : <nl> - inline void set_has_type ( ) ; <nl> - inline void clear_has_type ( ) ; <nl> - inline void set_has_blobrequest ( ) ; <nl> - inline void clear_has_blobrequest ( ) ; <nl> - inline void set_has_blobresponse ( ) ; <nl> - inline void clear_has_blobresponse ( ) ; <nl> - inline void set_has_errorresponse ( ) ; <nl> - inline void clear_has_errorresponse ( ) ; <nl> - <nl> - : : google : : protobuf : : UnknownFieldSet _unknown_fields_ ; <nl> - <nl> - : : PB_ArangoBlobRequest * blobrequest_ ; <nl> - : : PB_ArangoBlobResponse * blobresponse_ ; <nl> - : : PB_ArangoErrorResponse * errorresponse_ ; <nl> - int type_ ; <nl> - <nl> - mutable int _cached_size_ ; <nl> - : : google : : protobuf : : uint32 _has_bits_ [ ( 4 + 31 ) / 32 ] ; <nl> - <nl> - friend void protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_AssignDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_ShutdownFile_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - <nl> - void InitAsDefaultInstance ( ) ; <nl> - static PB_ArangoBatchMessage * default_instance_ ; <nl> - } ; <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - class PB_ArangoJsonValue : public : : google : : protobuf : : Message { <nl> - public : <nl> - PB_ArangoJsonValue ( ) ; <nl> - virtual ~ PB_ArangoJsonValue ( ) ; <nl> - <nl> - PB_ArangoJsonValue ( const PB_ArangoJsonValue & from ) ; <nl> - <nl> - inline PB_ArangoJsonValue & operator = ( const PB_ArangoJsonValue & from ) { <nl> - CopyFrom ( from ) ; <nl> - return * this ; <nl> - } <nl> - <nl> - inline const : : google : : protobuf : : UnknownFieldSet & unknown_fields ( ) const { <nl> - return _unknown_fields_ ; <nl> - } <nl> - <nl> - inline : : google : : protobuf : : UnknownFieldSet * mutable_unknown_fields ( ) { <nl> - return & _unknown_fields_ ; <nl> - } <nl> - <nl> - static const : : google : : protobuf : : Descriptor * descriptor ( ) ; <nl> - static const PB_ArangoJsonValue & default_instance ( ) ; <nl> - <nl> - void Swap ( PB_ArangoJsonValue * other ) ; <nl> - <nl> - / / implements Message mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - PB_ArangoJsonValue * New ( ) const ; <nl> - void CopyFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void MergeFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void CopyFrom ( const PB_ArangoJsonValue & from ) ; <nl> - void MergeFrom ( const PB_ArangoJsonValue & from ) ; <nl> - void Clear ( ) ; <nl> - bool IsInitialized ( ) const ; <nl> - <nl> - int ByteSize ( ) const ; <nl> - bool MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) ; <nl> - void SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const ; <nl> - : : google : : protobuf : : uint8 * SerializeWithCachedSizesToArray ( : : google : : protobuf : : uint8 * output ) const ; <nl> - int GetCachedSize ( ) const { return _cached_size_ ; } <nl> - private : <nl> - void SharedCtor ( ) ; <nl> - void SharedDtor ( ) ; <nl> - void SetCachedSize ( int size ) const ; <nl> - public : <nl> - <nl> - : : google : : protobuf : : Metadata GetMetadata ( ) const ; <nl> - <nl> - / / nested types mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / accessors mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / optional bool booleanValue = 1 ; <nl> - inline bool has_booleanvalue ( ) const ; <nl> - inline void clear_booleanvalue ( ) ; <nl> - static const int kBooleanValueFieldNumber = 1 ; <nl> - inline bool booleanvalue ( ) const ; <nl> - inline void set_booleanvalue ( bool value ) ; <nl> - <nl> - / / optional double numberValue = 2 ; <nl> - inline bool has_numbervalue ( ) const ; <nl> - inline void clear_numbervalue ( ) ; <nl> - static const int kNumberValueFieldNumber = 2 ; <nl> - inline double numbervalue ( ) const ; <nl> - inline void set_numbervalue ( double value ) ; <nl> - <nl> - / / optional string stringValue = 3 ; <nl> - inline bool has_stringvalue ( ) const ; <nl> - inline void clear_stringvalue ( ) ; <nl> - static const int kStringValueFieldNumber = 3 ; <nl> - inline const : : std : : string & stringvalue ( ) const ; <nl> - inline void set_stringvalue ( const : : std : : string & value ) ; <nl> - inline void set_stringvalue ( const char * value ) ; <nl> - inline void set_stringvalue ( const char * value , size_t size ) ; <nl> - inline : : std : : string * mutable_stringvalue ( ) ; <nl> - inline : : std : : string * release_stringvalue ( ) ; <nl> - <nl> - / / repeated . PB_ArangoJsonContent objects = 4 ; <nl> - inline int objects_size ( ) const ; <nl> - inline void clear_objects ( ) ; <nl> - static const int kObjectsFieldNumber = 4 ; <nl> - inline const : : PB_ArangoJsonContent & objects ( int index ) const ; <nl> - inline : : PB_ArangoJsonContent * mutable_objects ( int index ) ; <nl> - inline : : PB_ArangoJsonContent * add_objects ( ) ; <nl> - inline const : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoJsonContent > & <nl> - objects ( ) const ; <nl> - inline : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoJsonContent > * <nl> - mutable_objects ( ) ; <nl> - <nl> - / / @ @ protoc_insertion_point ( class_scope : PB_ArangoJsonValue ) <nl> - private : <nl> - inline void set_has_booleanvalue ( ) ; <nl> - inline void clear_has_booleanvalue ( ) ; <nl> - inline void set_has_numbervalue ( ) ; <nl> - inline void clear_has_numbervalue ( ) ; <nl> - inline void set_has_stringvalue ( ) ; <nl> - inline void clear_has_stringvalue ( ) ; <nl> - <nl> - : : google : : protobuf : : UnknownFieldSet _unknown_fields_ ; <nl> - <nl> - double numbervalue_ ; <nl> - : : std : : string * stringvalue_ ; <nl> - : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoJsonContent > objects_ ; <nl> - bool booleanvalue_ ; <nl> - <nl> - mutable int _cached_size_ ; <nl> - : : google : : protobuf : : uint32 _has_bits_ [ ( 4 + 31 ) / 32 ] ; <nl> - <nl> - friend void protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_AssignDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_ShutdownFile_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - <nl> - void InitAsDefaultInstance ( ) ; <nl> - static PB_ArangoJsonValue * default_instance_ ; <nl> - } ; <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - class PB_ArangoJsonContent : public : : google : : protobuf : : Message { <nl> - public : <nl> - PB_ArangoJsonContent ( ) ; <nl> - virtual ~ PB_ArangoJsonContent ( ) ; <nl> - <nl> - PB_ArangoJsonContent ( const PB_ArangoJsonContent & from ) ; <nl> - <nl> - inline PB_ArangoJsonContent & operator = ( const PB_ArangoJsonContent & from ) { <nl> - CopyFrom ( from ) ; <nl> - return * this ; <nl> - } <nl> - <nl> - inline const : : google : : protobuf : : UnknownFieldSet & unknown_fields ( ) const { <nl> - return _unknown_fields_ ; <nl> - } <nl> - <nl> - inline : : google : : protobuf : : UnknownFieldSet * mutable_unknown_fields ( ) { <nl> - return & _unknown_fields_ ; <nl> - } <nl> - <nl> - static const : : google : : protobuf : : Descriptor * descriptor ( ) ; <nl> - static const PB_ArangoJsonContent & default_instance ( ) ; <nl> - <nl> - void Swap ( PB_ArangoJsonContent * other ) ; <nl> - <nl> - / / implements Message mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - PB_ArangoJsonContent * New ( ) const ; <nl> - void CopyFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void MergeFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void CopyFrom ( const PB_ArangoJsonContent & from ) ; <nl> - void MergeFrom ( const PB_ArangoJsonContent & from ) ; <nl> - void Clear ( ) ; <nl> - bool IsInitialized ( ) const ; <nl> - <nl> - int ByteSize ( ) const ; <nl> - bool MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) ; <nl> - void SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const ; <nl> - : : google : : protobuf : : uint8 * SerializeWithCachedSizesToArray ( : : google : : protobuf : : uint8 * output ) const ; <nl> - int GetCachedSize ( ) const { return _cached_size_ ; } <nl> - private : <nl> - void SharedCtor ( ) ; <nl> - void SharedDtor ( ) ; <nl> - void SetCachedSize ( int size ) const ; <nl> - public : <nl> - <nl> - : : google : : protobuf : : Metadata GetMetadata ( ) const ; <nl> - <nl> - / / nested types mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / accessors mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / required . PB_ArangoJsonType type = 1 ; <nl> - inline bool has_type ( ) const ; <nl> - inline void clear_type ( ) ; <nl> - static const int kTypeFieldNumber = 1 ; <nl> - inline PB_ArangoJsonType type ( ) const ; <nl> - inline void set_type ( PB_ArangoJsonType value ) ; <nl> - <nl> - / / optional . PB_ArangoJsonValue value = 2 ; <nl> - inline bool has_value ( ) const ; <nl> - inline void clear_value ( ) ; <nl> - static const int kValueFieldNumber = 2 ; <nl> - inline const : : PB_ArangoJsonValue & value ( ) const ; <nl> - inline : : PB_ArangoJsonValue * mutable_value ( ) ; <nl> - inline : : PB_ArangoJsonValue * release_value ( ) ; <nl> - <nl> - / / @ @ protoc_insertion_point ( class_scope : PB_ArangoJsonContent ) <nl> - private : <nl> - inline void set_has_type ( ) ; <nl> - inline void clear_has_type ( ) ; <nl> - inline void set_has_value ( ) ; <nl> - inline void clear_has_value ( ) ; <nl> - <nl> - : : google : : protobuf : : UnknownFieldSet _unknown_fields_ ; <nl> - <nl> - : : PB_ArangoJsonValue * value_ ; <nl> - int type_ ; <nl> - <nl> - mutable int _cached_size_ ; <nl> - : : google : : protobuf : : uint32 _has_bits_ [ ( 2 + 31 ) / 32 ] ; <nl> - <nl> - friend void protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_AssignDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_ShutdownFile_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - <nl> - void InitAsDefaultInstance ( ) ; <nl> - static PB_ArangoJsonContent * default_instance_ ; <nl> - } ; <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - class PB_ArangoBlobRequest : public : : google : : protobuf : : Message { <nl> - public : <nl> - PB_ArangoBlobRequest ( ) ; <nl> - virtual ~ PB_ArangoBlobRequest ( ) ; <nl> - <nl> - PB_ArangoBlobRequest ( const PB_ArangoBlobRequest & from ) ; <nl> - <nl> - inline PB_ArangoBlobRequest & operator = ( const PB_ArangoBlobRequest & from ) { <nl> - CopyFrom ( from ) ; <nl> - return * this ; <nl> - } <nl> - <nl> - inline const : : google : : protobuf : : UnknownFieldSet & unknown_fields ( ) const { <nl> - return _unknown_fields_ ; <nl> - } <nl> - <nl> - inline : : google : : protobuf : : UnknownFieldSet * mutable_unknown_fields ( ) { <nl> - return & _unknown_fields_ ; <nl> - } <nl> - <nl> - static const : : google : : protobuf : : Descriptor * descriptor ( ) ; <nl> - static const PB_ArangoBlobRequest & default_instance ( ) ; <nl> - <nl> - void Swap ( PB_ArangoBlobRequest * other ) ; <nl> - <nl> - / / implements Message mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - PB_ArangoBlobRequest * New ( ) const ; <nl> - void CopyFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void MergeFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void CopyFrom ( const PB_ArangoBlobRequest & from ) ; <nl> - void MergeFrom ( const PB_ArangoBlobRequest & from ) ; <nl> - void Clear ( ) ; <nl> - bool IsInitialized ( ) const ; <nl> - <nl> - int ByteSize ( ) const ; <nl> - bool MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) ; <nl> - void SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const ; <nl> - : : google : : protobuf : : uint8 * SerializeWithCachedSizesToArray ( : : google : : protobuf : : uint8 * output ) const ; <nl> - int GetCachedSize ( ) const { return _cached_size_ ; } <nl> - private : <nl> - void SharedCtor ( ) ; <nl> - void SharedDtor ( ) ; <nl> - void SetCachedSize ( int size ) const ; <nl> - public : <nl> - <nl> - : : google : : protobuf : : Metadata GetMetadata ( ) const ; <nl> - <nl> - / / nested types mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / accessors mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / required . PB_ArangoRequestType requestType = 1 ; <nl> - inline bool has_requesttype ( ) const ; <nl> - inline void clear_requesttype ( ) ; <nl> - static const int kRequestTypeFieldNumber = 1 ; <nl> - inline PB_ArangoRequestType requesttype ( ) const ; <nl> - inline void set_requesttype ( PB_ArangoRequestType value ) ; <nl> - <nl> - / / required string url = 2 ; <nl> - inline bool has_url ( ) const ; <nl> - inline void clear_url ( ) ; <nl> - static const int kUrlFieldNumber = 2 ; <nl> - inline const : : std : : string & url ( ) const ; <nl> - inline void set_url ( const : : std : : string & value ) ; <nl> - inline void set_url ( const char * value ) ; <nl> - inline void set_url ( const char * value , size_t size ) ; <nl> - inline : : std : : string * mutable_url ( ) ; <nl> - inline : : std : : string * release_url ( ) ; <nl> - <nl> - / / repeated . PB_ArangoKeyValue values = 3 ; <nl> - inline int values_size ( ) const ; <nl> - inline void clear_values ( ) ; <nl> - static const int kValuesFieldNumber = 3 ; <nl> - inline const : : PB_ArangoKeyValue & values ( int index ) const ; <nl> - inline : : PB_ArangoKeyValue * mutable_values ( int index ) ; <nl> - inline : : PB_ArangoKeyValue * add_values ( ) ; <nl> - inline const : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoKeyValue > & <nl> - values ( ) const ; <nl> - inline : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoKeyValue > * <nl> - mutable_values ( ) ; <nl> - <nl> - / / repeated . PB_ArangoKeyValue headers = 4 ; <nl> - inline int headers_size ( ) const ; <nl> - inline void clear_headers ( ) ; <nl> - static const int kHeadersFieldNumber = 4 ; <nl> - inline const : : PB_ArangoKeyValue & headers ( int index ) const ; <nl> - inline : : PB_ArangoKeyValue * mutable_headers ( int index ) ; <nl> - inline : : PB_ArangoKeyValue * add_headers ( ) ; <nl> - inline const : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoKeyValue > & <nl> - headers ( ) const ; <nl> - inline : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoKeyValue > * <nl> - mutable_headers ( ) ; <nl> - <nl> - / / required . PB_ArangoMessageContentType contentType = 5 ; <nl> - inline bool has_contenttype ( ) const ; <nl> - inline void clear_contenttype ( ) ; <nl> - static const int kContentTypeFieldNumber = 5 ; <nl> - inline PB_ArangoMessageContentType contenttype ( ) const ; <nl> - inline void set_contenttype ( PB_ArangoMessageContentType value ) ; <nl> - <nl> - / / optional string content = 7 ; <nl> - inline bool has_content ( ) const ; <nl> - inline void clear_content ( ) ; <nl> - static const int kContentFieldNumber = 7 ; <nl> - inline const : : std : : string & content ( ) const ; <nl> - inline void set_content ( const : : std : : string & value ) ; <nl> - inline void set_content ( const char * value ) ; <nl> - inline void set_content ( const char * value , size_t size ) ; <nl> - inline : : std : : string * mutable_content ( ) ; <nl> - inline : : std : : string * release_content ( ) ; <nl> - <nl> - / / optional . PB_ArangoJsonContent json = 8 ; <nl> - inline bool has_json ( ) const ; <nl> - inline void clear_json ( ) ; <nl> - static const int kJsonFieldNumber = 8 ; <nl> - inline const : : PB_ArangoJsonContent & json ( ) const ; <nl> - inline : : PB_ArangoJsonContent * mutable_json ( ) ; <nl> - inline : : PB_ArangoJsonContent * release_json ( ) ; <nl> - <nl> - / / @ @ protoc_insertion_point ( class_scope : PB_ArangoBlobRequest ) <nl> - private : <nl> - inline void set_has_requesttype ( ) ; <nl> - inline void clear_has_requesttype ( ) ; <nl> - inline void set_has_url ( ) ; <nl> - inline void clear_has_url ( ) ; <nl> - inline void set_has_contenttype ( ) ; <nl> - inline void clear_has_contenttype ( ) ; <nl> - inline void set_has_content ( ) ; <nl> - inline void clear_has_content ( ) ; <nl> - inline void set_has_json ( ) ; <nl> - inline void clear_has_json ( ) ; <nl> - <nl> - : : google : : protobuf : : UnknownFieldSet _unknown_fields_ ; <nl> - <nl> - : : std : : string * url_ ; <nl> - : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoKeyValue > values_ ; <nl> - int requesttype_ ; <nl> - int contenttype_ ; <nl> - : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoKeyValue > headers_ ; <nl> - : : std : : string * content_ ; <nl> - : : PB_ArangoJsonContent * json_ ; <nl> - <nl> - mutable int _cached_size_ ; <nl> - : : google : : protobuf : : uint32 _has_bits_ [ ( 7 + 31 ) / 32 ] ; <nl> - <nl> - friend void protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_AssignDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_ShutdownFile_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - <nl> - void InitAsDefaultInstance ( ) ; <nl> - static PB_ArangoBlobRequest * default_instance_ ; <nl> - } ; <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - class PB_ArangoBlobResponse : public : : google : : protobuf : : Message { <nl> - public : <nl> - PB_ArangoBlobResponse ( ) ; <nl> - virtual ~ PB_ArangoBlobResponse ( ) ; <nl> - <nl> - PB_ArangoBlobResponse ( const PB_ArangoBlobResponse & from ) ; <nl> - <nl> - inline PB_ArangoBlobResponse & operator = ( const PB_ArangoBlobResponse & from ) { <nl> - CopyFrom ( from ) ; <nl> - return * this ; <nl> - } <nl> - <nl> - inline const : : google : : protobuf : : UnknownFieldSet & unknown_fields ( ) const { <nl> - return _unknown_fields_ ; <nl> - } <nl> - <nl> - inline : : google : : protobuf : : UnknownFieldSet * mutable_unknown_fields ( ) { <nl> - return & _unknown_fields_ ; <nl> - } <nl> - <nl> - static const : : google : : protobuf : : Descriptor * descriptor ( ) ; <nl> - static const PB_ArangoBlobResponse & default_instance ( ) ; <nl> - <nl> - void Swap ( PB_ArangoBlobResponse * other ) ; <nl> - <nl> - / / implements Message mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - PB_ArangoBlobResponse * New ( ) const ; <nl> - void CopyFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void MergeFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void CopyFrom ( const PB_ArangoBlobResponse & from ) ; <nl> - void MergeFrom ( const PB_ArangoBlobResponse & from ) ; <nl> - void Clear ( ) ; <nl> - bool IsInitialized ( ) const ; <nl> - <nl> - int ByteSize ( ) const ; <nl> - bool MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) ; <nl> - void SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const ; <nl> - : : google : : protobuf : : uint8 * SerializeWithCachedSizesToArray ( : : google : : protobuf : : uint8 * output ) const ; <nl> - int GetCachedSize ( ) const { return _cached_size_ ; } <nl> - private : <nl> - void SharedCtor ( ) ; <nl> - void SharedDtor ( ) ; <nl> - void SetCachedSize ( int size ) const ; <nl> - public : <nl> - <nl> - : : google : : protobuf : : Metadata GetMetadata ( ) const ; <nl> - <nl> - / / nested types mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / accessors mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / required int32 status = 1 ; <nl> - inline bool has_status ( ) const ; <nl> - inline void clear_status ( ) ; <nl> - static const int kStatusFieldNumber = 1 ; <nl> - inline : : google : : protobuf : : int32 status ( ) const ; <nl> - inline void set_status ( : : google : : protobuf : : int32 value ) ; <nl> - <nl> - / / repeated . PB_ArangoKeyValue headers = 2 ; <nl> - inline int headers_size ( ) const ; <nl> - inline void clear_headers ( ) ; <nl> - static const int kHeadersFieldNumber = 2 ; <nl> - inline const : : PB_ArangoKeyValue & headers ( int index ) const ; <nl> - inline : : PB_ArangoKeyValue * mutable_headers ( int index ) ; <nl> - inline : : PB_ArangoKeyValue * add_headers ( ) ; <nl> - inline const : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoKeyValue > & <nl> - headers ( ) const ; <nl> - inline : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoKeyValue > * <nl> - mutable_headers ( ) ; <nl> - <nl> - / / required . PB_ArangoMessageContentType contentType = 3 ; <nl> - inline bool has_contenttype ( ) const ; <nl> - inline void clear_contenttype ( ) ; <nl> - static const int kContentTypeFieldNumber = 3 ; <nl> - inline PB_ArangoMessageContentType contenttype ( ) const ; <nl> - inline void set_contenttype ( PB_ArangoMessageContentType value ) ; <nl> - <nl> - / / required int32 contentLength = 6 ; <nl> - inline bool has_contentlength ( ) const ; <nl> - inline void clear_contentlength ( ) ; <nl> - static const int kContentLengthFieldNumber = 6 ; <nl> - inline : : google : : protobuf : : int32 contentlength ( ) const ; <nl> - inline void set_contentlength ( : : google : : protobuf : : int32 value ) ; <nl> - <nl> - / / optional string content = 4 ; <nl> - inline bool has_content ( ) const ; <nl> - inline void clear_content ( ) ; <nl> - static const int kContentFieldNumber = 4 ; <nl> - inline const : : std : : string & content ( ) const ; <nl> - inline void set_content ( const : : std : : string & value ) ; <nl> - inline void set_content ( const char * value ) ; <nl> - inline void set_content ( const char * value , size_t size ) ; <nl> - inline : : std : : string * mutable_content ( ) ; <nl> - inline : : std : : string * release_content ( ) ; <nl> - <nl> - / / @ @ protoc_insertion_point ( class_scope : PB_ArangoBlobResponse ) <nl> - private : <nl> - inline void set_has_status ( ) ; <nl> - inline void clear_has_status ( ) ; <nl> - inline void set_has_contenttype ( ) ; <nl> - inline void clear_has_contenttype ( ) ; <nl> - inline void set_has_contentlength ( ) ; <nl> - inline void clear_has_contentlength ( ) ; <nl> - inline void set_has_content ( ) ; <nl> - inline void clear_has_content ( ) ; <nl> - <nl> - : : google : : protobuf : : UnknownFieldSet _unknown_fields_ ; <nl> - <nl> - : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoKeyValue > headers_ ; <nl> - : : google : : protobuf : : int32 status_ ; <nl> - int contenttype_ ; <nl> - : : std : : string * content_ ; <nl> - : : google : : protobuf : : int32 contentlength_ ; <nl> - <nl> - mutable int _cached_size_ ; <nl> - : : google : : protobuf : : uint32 _has_bits_ [ ( 5 + 31 ) / 32 ] ; <nl> - <nl> - friend void protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_AssignDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_ShutdownFile_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - <nl> - void InitAsDefaultInstance ( ) ; <nl> - static PB_ArangoBlobResponse * default_instance_ ; <nl> - } ; <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - class PB_ArangoErrorResponse : public : : google : : protobuf : : Message { <nl> - public : <nl> - PB_ArangoErrorResponse ( ) ; <nl> - virtual ~ PB_ArangoErrorResponse ( ) ; <nl> - <nl> - PB_ArangoErrorResponse ( const PB_ArangoErrorResponse & from ) ; <nl> - <nl> - inline PB_ArangoErrorResponse & operator = ( const PB_ArangoErrorResponse & from ) { <nl> - CopyFrom ( from ) ; <nl> - return * this ; <nl> - } <nl> - <nl> - inline const : : google : : protobuf : : UnknownFieldSet & unknown_fields ( ) const { <nl> - return _unknown_fields_ ; <nl> - } <nl> - <nl> - inline : : google : : protobuf : : UnknownFieldSet * mutable_unknown_fields ( ) { <nl> - return & _unknown_fields_ ; <nl> - } <nl> - <nl> - static const : : google : : protobuf : : Descriptor * descriptor ( ) ; <nl> - static const PB_ArangoErrorResponse & default_instance ( ) ; <nl> - <nl> - void Swap ( PB_ArangoErrorResponse * other ) ; <nl> - <nl> - / / implements Message mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - PB_ArangoErrorResponse * New ( ) const ; <nl> - void CopyFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void MergeFrom ( const : : google : : protobuf : : Message & from ) ; <nl> - void CopyFrom ( const PB_ArangoErrorResponse & from ) ; <nl> - void MergeFrom ( const PB_ArangoErrorResponse & from ) ; <nl> - void Clear ( ) ; <nl> - bool IsInitialized ( ) const ; <nl> - <nl> - int ByteSize ( ) const ; <nl> - bool MergePartialFromCodedStream ( <nl> - : : google : : protobuf : : io : : CodedInputStream * input ) ; <nl> - void SerializeWithCachedSizes ( <nl> - : : google : : protobuf : : io : : CodedOutputStream * output ) const ; <nl> - : : google : : protobuf : : uint8 * SerializeWithCachedSizesToArray ( : : google : : protobuf : : uint8 * output ) const ; <nl> - int GetCachedSize ( ) const { return _cached_size_ ; } <nl> - private : <nl> - void SharedCtor ( ) ; <nl> - void SharedDtor ( ) ; <nl> - void SetCachedSize ( int size ) const ; <nl> - public : <nl> - <nl> - : : google : : protobuf : : Metadata GetMetadata ( ) const ; <nl> - <nl> - / / nested types mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / accessors mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / required string message = 1 ; <nl> - inline bool has_message ( ) const ; <nl> - inline void clear_message ( ) ; <nl> - static const int kMessageFieldNumber = 1 ; <nl> - inline const : : std : : string & message ( ) const ; <nl> - inline void set_message ( const : : std : : string & value ) ; <nl> - inline void set_message ( const char * value ) ; <nl> - inline void set_message ( const char * value , size_t size ) ; <nl> - inline : : std : : string * mutable_message ( ) ; <nl> - inline : : std : : string * release_message ( ) ; <nl> - <nl> - / / @ @ protoc_insertion_point ( class_scope : PB_ArangoErrorResponse ) <nl> - private : <nl> - inline void set_has_message ( ) ; <nl> - inline void clear_has_message ( ) ; <nl> - <nl> - : : google : : protobuf : : UnknownFieldSet _unknown_fields_ ; <nl> - <nl> - : : std : : string * message_ ; <nl> - <nl> - mutable int _cached_size_ ; <nl> - : : google : : protobuf : : uint32 _has_bits_ [ ( 1 + 31 ) / 32 ] ; <nl> - <nl> - friend void protobuf_AddDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_AssignDesc_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - friend void protobuf_ShutdownFile_lib_2fProtocolBuffers_2farangodb_2eproto ( ) ; <nl> - <nl> - void InitAsDefaultInstance ( ) ; <nl> - static PB_ArangoErrorResponse * default_instance_ ; <nl> - } ; <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - <nl> - <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - <nl> - / / PB_ArangoKeyValue <nl> - <nl> - / / required string key = 1 ; <nl> - inline bool PB_ArangoKeyValue : : has_key ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000001u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoKeyValue : : set_has_key ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000001u ; <nl> - } <nl> - inline void PB_ArangoKeyValue : : clear_has_key ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000001u ; <nl> - } <nl> - inline void PB_ArangoKeyValue : : clear_key ( ) { <nl> - if ( key_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - key_ - > clear ( ) ; <nl> - } <nl> - clear_has_key ( ) ; <nl> - } <nl> - inline const : : std : : string & PB_ArangoKeyValue : : key ( ) const { <nl> - return * key_ ; <nl> - } <nl> - inline void PB_ArangoKeyValue : : set_key ( const : : std : : string & value ) { <nl> - set_has_key ( ) ; <nl> - if ( key_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - key_ = new : : std : : string ; <nl> - } <nl> - key_ - > assign ( value ) ; <nl> - } <nl> - inline void PB_ArangoKeyValue : : set_key ( const char * value ) { <nl> - set_has_key ( ) ; <nl> - if ( key_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - key_ = new : : std : : string ; <nl> - } <nl> - key_ - > assign ( value ) ; <nl> - } <nl> - inline void PB_ArangoKeyValue : : set_key ( const char * value , size_t size ) { <nl> - set_has_key ( ) ; <nl> - if ( key_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - key_ = new : : std : : string ; <nl> - } <nl> - key_ - > assign ( reinterpret_cast < const char * > ( value ) , size ) ; <nl> - } <nl> - inline : : std : : string * PB_ArangoKeyValue : : mutable_key ( ) { <nl> - set_has_key ( ) ; <nl> - if ( key_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - key_ = new : : std : : string ; <nl> - } <nl> - return key_ ; <nl> - } <nl> - inline : : std : : string * PB_ArangoKeyValue : : release_key ( ) { <nl> - clear_has_key ( ) ; <nl> - if ( key_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - return NULL ; <nl> - } else { <nl> - : : std : : string * temp = key_ ; <nl> - key_ = const_cast < : : std : : string * > ( & : : google : : protobuf : : internal : : kEmptyString ) ; <nl> - return temp ; <nl> - } <nl> - } <nl> - <nl> - / / required string value = 2 ; <nl> - inline bool PB_ArangoKeyValue : : has_value ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000002u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoKeyValue : : set_has_value ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000002u ; <nl> - } <nl> - inline void PB_ArangoKeyValue : : clear_has_value ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000002u ; <nl> - } <nl> - inline void PB_ArangoKeyValue : : clear_value ( ) { <nl> - if ( value_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - value_ - > clear ( ) ; <nl> - } <nl> - clear_has_value ( ) ; <nl> - } <nl> - inline const : : std : : string & PB_ArangoKeyValue : : value ( ) const { <nl> - return * value_ ; <nl> - } <nl> - inline void PB_ArangoKeyValue : : set_value ( const : : std : : string & value ) { <nl> - set_has_value ( ) ; <nl> - if ( value_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - value_ = new : : std : : string ; <nl> - } <nl> - value_ - > assign ( value ) ; <nl> - } <nl> - inline void PB_ArangoKeyValue : : set_value ( const char * value ) { <nl> - set_has_value ( ) ; <nl> - if ( value_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - value_ = new : : std : : string ; <nl> - } <nl> - value_ - > assign ( value ) ; <nl> - } <nl> - inline void PB_ArangoKeyValue : : set_value ( const char * value , size_t size ) { <nl> - set_has_value ( ) ; <nl> - if ( value_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - value_ = new : : std : : string ; <nl> - } <nl> - value_ - > assign ( reinterpret_cast < const char * > ( value ) , size ) ; <nl> - } <nl> - inline : : std : : string * PB_ArangoKeyValue : : mutable_value ( ) { <nl> - set_has_value ( ) ; <nl> - if ( value_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - value_ = new : : std : : string ; <nl> - } <nl> - return value_ ; <nl> - } <nl> - inline : : std : : string * PB_ArangoKeyValue : : release_value ( ) { <nl> - clear_has_value ( ) ; <nl> - if ( value_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - return NULL ; <nl> - } else { <nl> - : : std : : string * temp = value_ ; <nl> - value_ = const_cast < : : std : : string * > ( & : : google : : protobuf : : internal : : kEmptyString ) ; <nl> - return temp ; <nl> - } <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / PB_ArangoMessage <nl> - <nl> - / / repeated . PB_ArangoBatchMessage messages = 1 ; <nl> - inline int PB_ArangoMessage : : messages_size ( ) const { <nl> - return messages_ . size ( ) ; <nl> - } <nl> - inline void PB_ArangoMessage : : clear_messages ( ) { <nl> - messages_ . Clear ( ) ; <nl> - } <nl> - inline const : : PB_ArangoBatchMessage & PB_ArangoMessage : : messages ( int index ) const { <nl> - return messages_ . Get ( index ) ; <nl> - } <nl> - inline : : PB_ArangoBatchMessage * PB_ArangoMessage : : mutable_messages ( int index ) { <nl> - return messages_ . Mutable ( index ) ; <nl> - } <nl> - inline : : PB_ArangoBatchMessage * PB_ArangoMessage : : add_messages ( ) { <nl> - return messages_ . Add ( ) ; <nl> - } <nl> - inline const : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoBatchMessage > & <nl> - PB_ArangoMessage : : messages ( ) const { <nl> - return messages_ ; <nl> - } <nl> - inline : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoBatchMessage > * <nl> - PB_ArangoMessage : : mutable_messages ( ) { <nl> - return & messages_ ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / PB_ArangoBatchMessage <nl> - <nl> - / / required . PB_ArangoMessageType type = 1 ; <nl> - inline bool PB_ArangoBatchMessage : : has_type ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000001u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoBatchMessage : : set_has_type ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000001u ; <nl> - } <nl> - inline void PB_ArangoBatchMessage : : clear_has_type ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000001u ; <nl> - } <nl> - inline void PB_ArangoBatchMessage : : clear_type ( ) { <nl> - type_ = 0 ; <nl> - clear_has_type ( ) ; <nl> - } <nl> - inline PB_ArangoMessageType PB_ArangoBatchMessage : : type ( ) const { <nl> - return static_cast < PB_ArangoMessageType > ( type_ ) ; <nl> - } <nl> - inline void PB_ArangoBatchMessage : : set_type ( PB_ArangoMessageType value ) { <nl> - GOOGLE_DCHECK ( PB_ArangoMessageType_IsValid ( value ) ) ; <nl> - set_has_type ( ) ; <nl> - type_ = value ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoBlobRequest blobRequest = 2 ; <nl> - inline bool PB_ArangoBatchMessage : : has_blobrequest ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000002u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoBatchMessage : : set_has_blobrequest ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000002u ; <nl> - } <nl> - inline void PB_ArangoBatchMessage : : clear_has_blobrequest ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000002u ; <nl> - } <nl> - inline void PB_ArangoBatchMessage : : clear_blobrequest ( ) { <nl> - if ( blobrequest_ ! = NULL ) blobrequest_ - > : : PB_ArangoBlobRequest : : Clear ( ) ; <nl> - clear_has_blobrequest ( ) ; <nl> - } <nl> - inline const : : PB_ArangoBlobRequest & PB_ArangoBatchMessage : : blobrequest ( ) const { <nl> - return blobrequest_ ! = NULL ? * blobrequest_ : * default_instance_ - > blobrequest_ ; <nl> - } <nl> - inline : : PB_ArangoBlobRequest * PB_ArangoBatchMessage : : mutable_blobrequest ( ) { <nl> - set_has_blobrequest ( ) ; <nl> - if ( blobrequest_ = = NULL ) blobrequest_ = new : : PB_ArangoBlobRequest ; <nl> - return blobrequest_ ; <nl> - } <nl> - inline : : PB_ArangoBlobRequest * PB_ArangoBatchMessage : : release_blobrequest ( ) { <nl> - clear_has_blobrequest ( ) ; <nl> - : : PB_ArangoBlobRequest * temp = blobrequest_ ; <nl> - blobrequest_ = NULL ; <nl> - return temp ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoBlobResponse blobResponse = 3 ; <nl> - inline bool PB_ArangoBatchMessage : : has_blobresponse ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000004u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoBatchMessage : : set_has_blobresponse ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000004u ; <nl> - } <nl> - inline void PB_ArangoBatchMessage : : clear_has_blobresponse ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000004u ; <nl> - } <nl> - inline void PB_ArangoBatchMessage : : clear_blobresponse ( ) { <nl> - if ( blobresponse_ ! = NULL ) blobresponse_ - > : : PB_ArangoBlobResponse : : Clear ( ) ; <nl> - clear_has_blobresponse ( ) ; <nl> - } <nl> - inline const : : PB_ArangoBlobResponse & PB_ArangoBatchMessage : : blobresponse ( ) const { <nl> - return blobresponse_ ! = NULL ? * blobresponse_ : * default_instance_ - > blobresponse_ ; <nl> - } <nl> - inline : : PB_ArangoBlobResponse * PB_ArangoBatchMessage : : mutable_blobresponse ( ) { <nl> - set_has_blobresponse ( ) ; <nl> - if ( blobresponse_ = = NULL ) blobresponse_ = new : : PB_ArangoBlobResponse ; <nl> - return blobresponse_ ; <nl> - } <nl> - inline : : PB_ArangoBlobResponse * PB_ArangoBatchMessage : : release_blobresponse ( ) { <nl> - clear_has_blobresponse ( ) ; <nl> - : : PB_ArangoBlobResponse * temp = blobresponse_ ; <nl> - blobresponse_ = NULL ; <nl> - return temp ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoErrorResponse errorResponse = 4 ; <nl> - inline bool PB_ArangoBatchMessage : : has_errorresponse ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000008u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoBatchMessage : : set_has_errorresponse ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000008u ; <nl> - } <nl> - inline void PB_ArangoBatchMessage : : clear_has_errorresponse ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000008u ; <nl> - } <nl> - inline void PB_ArangoBatchMessage : : clear_errorresponse ( ) { <nl> - if ( errorresponse_ ! = NULL ) errorresponse_ - > : : PB_ArangoErrorResponse : : Clear ( ) ; <nl> - clear_has_errorresponse ( ) ; <nl> - } <nl> - inline const : : PB_ArangoErrorResponse & PB_ArangoBatchMessage : : errorresponse ( ) const { <nl> - return errorresponse_ ! = NULL ? * errorresponse_ : * default_instance_ - > errorresponse_ ; <nl> - } <nl> - inline : : PB_ArangoErrorResponse * PB_ArangoBatchMessage : : mutable_errorresponse ( ) { <nl> - set_has_errorresponse ( ) ; <nl> - if ( errorresponse_ = = NULL ) errorresponse_ = new : : PB_ArangoErrorResponse ; <nl> - return errorresponse_ ; <nl> - } <nl> - inline : : PB_ArangoErrorResponse * PB_ArangoBatchMessage : : release_errorresponse ( ) { <nl> - clear_has_errorresponse ( ) ; <nl> - : : PB_ArangoErrorResponse * temp = errorresponse_ ; <nl> - errorresponse_ = NULL ; <nl> - return temp ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / PB_ArangoJsonValue <nl> - <nl> - / / optional bool booleanValue = 1 ; <nl> - inline bool PB_ArangoJsonValue : : has_booleanvalue ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000001u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoJsonValue : : set_has_booleanvalue ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000001u ; <nl> - } <nl> - inline void PB_ArangoJsonValue : : clear_has_booleanvalue ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000001u ; <nl> - } <nl> - inline void PB_ArangoJsonValue : : clear_booleanvalue ( ) { <nl> - booleanvalue_ = false ; <nl> - clear_has_booleanvalue ( ) ; <nl> - } <nl> - inline bool PB_ArangoJsonValue : : booleanvalue ( ) const { <nl> - return booleanvalue_ ; <nl> - } <nl> - inline void PB_ArangoJsonValue : : set_booleanvalue ( bool value ) { <nl> - set_has_booleanvalue ( ) ; <nl> - booleanvalue_ = value ; <nl> - } <nl> - <nl> - / / optional double numberValue = 2 ; <nl> - inline bool PB_ArangoJsonValue : : has_numbervalue ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000002u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoJsonValue : : set_has_numbervalue ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000002u ; <nl> - } <nl> - inline void PB_ArangoJsonValue : : clear_has_numbervalue ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000002u ; <nl> - } <nl> - inline void PB_ArangoJsonValue : : clear_numbervalue ( ) { <nl> - numbervalue_ = 0 ; <nl> - clear_has_numbervalue ( ) ; <nl> - } <nl> - inline double PB_ArangoJsonValue : : numbervalue ( ) const { <nl> - return numbervalue_ ; <nl> - } <nl> - inline void PB_ArangoJsonValue : : set_numbervalue ( double value ) { <nl> - set_has_numbervalue ( ) ; <nl> - numbervalue_ = value ; <nl> - } <nl> - <nl> - / / optional string stringValue = 3 ; <nl> - inline bool PB_ArangoJsonValue : : has_stringvalue ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000004u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoJsonValue : : set_has_stringvalue ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000004u ; <nl> - } <nl> - inline void PB_ArangoJsonValue : : clear_has_stringvalue ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000004u ; <nl> - } <nl> - inline void PB_ArangoJsonValue : : clear_stringvalue ( ) { <nl> - if ( stringvalue_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - stringvalue_ - > clear ( ) ; <nl> - } <nl> - clear_has_stringvalue ( ) ; <nl> - } <nl> - inline const : : std : : string & PB_ArangoJsonValue : : stringvalue ( ) const { <nl> - return * stringvalue_ ; <nl> - } <nl> - inline void PB_ArangoJsonValue : : set_stringvalue ( const : : std : : string & value ) { <nl> - set_has_stringvalue ( ) ; <nl> - if ( stringvalue_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - stringvalue_ = new : : std : : string ; <nl> - } <nl> - stringvalue_ - > assign ( value ) ; <nl> - } <nl> - inline void PB_ArangoJsonValue : : set_stringvalue ( const char * value ) { <nl> - set_has_stringvalue ( ) ; <nl> - if ( stringvalue_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - stringvalue_ = new : : std : : string ; <nl> - } <nl> - stringvalue_ - > assign ( value ) ; <nl> - } <nl> - inline void PB_ArangoJsonValue : : set_stringvalue ( const char * value , size_t size ) { <nl> - set_has_stringvalue ( ) ; <nl> - if ( stringvalue_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - stringvalue_ = new : : std : : string ; <nl> - } <nl> - stringvalue_ - > assign ( reinterpret_cast < const char * > ( value ) , size ) ; <nl> - } <nl> - inline : : std : : string * PB_ArangoJsonValue : : mutable_stringvalue ( ) { <nl> - set_has_stringvalue ( ) ; <nl> - if ( stringvalue_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - stringvalue_ = new : : std : : string ; <nl> - } <nl> - return stringvalue_ ; <nl> - } <nl> - inline : : std : : string * PB_ArangoJsonValue : : release_stringvalue ( ) { <nl> - clear_has_stringvalue ( ) ; <nl> - if ( stringvalue_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - return NULL ; <nl> - } else { <nl> - : : std : : string * temp = stringvalue_ ; <nl> - stringvalue_ = const_cast < : : std : : string * > ( & : : google : : protobuf : : internal : : kEmptyString ) ; <nl> - return temp ; <nl> - } <nl> - } <nl> - <nl> - / / repeated . PB_ArangoJsonContent objects = 4 ; <nl> - inline int PB_ArangoJsonValue : : objects_size ( ) const { <nl> - return objects_ . size ( ) ; <nl> - } <nl> - inline void PB_ArangoJsonValue : : clear_objects ( ) { <nl> - objects_ . Clear ( ) ; <nl> - } <nl> - inline const : : PB_ArangoJsonContent & PB_ArangoJsonValue : : objects ( int index ) const { <nl> - return objects_ . Get ( index ) ; <nl> - } <nl> - inline : : PB_ArangoJsonContent * PB_ArangoJsonValue : : mutable_objects ( int index ) { <nl> - return objects_ . Mutable ( index ) ; <nl> - } <nl> - inline : : PB_ArangoJsonContent * PB_ArangoJsonValue : : add_objects ( ) { <nl> - return objects_ . Add ( ) ; <nl> - } <nl> - inline const : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoJsonContent > & <nl> - PB_ArangoJsonValue : : objects ( ) const { <nl> - return objects_ ; <nl> - } <nl> - inline : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoJsonContent > * <nl> - PB_ArangoJsonValue : : mutable_objects ( ) { <nl> - return & objects_ ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / PB_ArangoJsonContent <nl> - <nl> - / / required . PB_ArangoJsonType type = 1 ; <nl> - inline bool PB_ArangoJsonContent : : has_type ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000001u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoJsonContent : : set_has_type ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000001u ; <nl> - } <nl> - inline void PB_ArangoJsonContent : : clear_has_type ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000001u ; <nl> - } <nl> - inline void PB_ArangoJsonContent : : clear_type ( ) { <nl> - type_ = 0 ; <nl> - clear_has_type ( ) ; <nl> - } <nl> - inline PB_ArangoJsonType PB_ArangoJsonContent : : type ( ) const { <nl> - return static_cast < PB_ArangoJsonType > ( type_ ) ; <nl> - } <nl> - inline void PB_ArangoJsonContent : : set_type ( PB_ArangoJsonType value ) { <nl> - GOOGLE_DCHECK ( PB_ArangoJsonType_IsValid ( value ) ) ; <nl> - set_has_type ( ) ; <nl> - type_ = value ; <nl> - } <nl> - <nl> - / / optional . PB_ArangoJsonValue value = 2 ; <nl> - inline bool PB_ArangoJsonContent : : has_value ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000002u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoJsonContent : : set_has_value ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000002u ; <nl> - } <nl> - inline void PB_ArangoJsonContent : : clear_has_value ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000002u ; <nl> - } <nl> - inline void PB_ArangoJsonContent : : clear_value ( ) { <nl> - if ( value_ ! = NULL ) value_ - > : : PB_ArangoJsonValue : : Clear ( ) ; <nl> - clear_has_value ( ) ; <nl> - } <nl> - inline const : : PB_ArangoJsonValue & PB_ArangoJsonContent : : value ( ) const { <nl> - return value_ ! = NULL ? * value_ : * default_instance_ - > value_ ; <nl> - } <nl> - inline : : PB_ArangoJsonValue * PB_ArangoJsonContent : : mutable_value ( ) { <nl> - set_has_value ( ) ; <nl> - if ( value_ = = NULL ) value_ = new : : PB_ArangoJsonValue ; <nl> - return value_ ; <nl> - } <nl> - inline : : PB_ArangoJsonValue * PB_ArangoJsonContent : : release_value ( ) { <nl> - clear_has_value ( ) ; <nl> - : : PB_ArangoJsonValue * temp = value_ ; <nl> - value_ = NULL ; <nl> - return temp ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / PB_ArangoBlobRequest <nl> - <nl> - / / required . PB_ArangoRequestType requestType = 1 ; <nl> - inline bool PB_ArangoBlobRequest : : has_requesttype ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000001u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : set_has_requesttype ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000001u ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : clear_has_requesttype ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000001u ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : clear_requesttype ( ) { <nl> - requesttype_ = 0 ; <nl> - clear_has_requesttype ( ) ; <nl> - } <nl> - inline PB_ArangoRequestType PB_ArangoBlobRequest : : requesttype ( ) const { <nl> - return static_cast < PB_ArangoRequestType > ( requesttype_ ) ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : set_requesttype ( PB_ArangoRequestType value ) { <nl> - GOOGLE_DCHECK ( PB_ArangoRequestType_IsValid ( value ) ) ; <nl> - set_has_requesttype ( ) ; <nl> - requesttype_ = value ; <nl> - } <nl> - <nl> - / / required string url = 2 ; <nl> - inline bool PB_ArangoBlobRequest : : has_url ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000002u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : set_has_url ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000002u ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : clear_has_url ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000002u ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : clear_url ( ) { <nl> - if ( url_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - url_ - > clear ( ) ; <nl> - } <nl> - clear_has_url ( ) ; <nl> - } <nl> - inline const : : std : : string & PB_ArangoBlobRequest : : url ( ) const { <nl> - return * url_ ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : set_url ( const : : std : : string & value ) { <nl> - set_has_url ( ) ; <nl> - if ( url_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - url_ = new : : std : : string ; <nl> - } <nl> - url_ - > assign ( value ) ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : set_url ( const char * value ) { <nl> - set_has_url ( ) ; <nl> - if ( url_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - url_ = new : : std : : string ; <nl> - } <nl> - url_ - > assign ( value ) ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : set_url ( const char * value , size_t size ) { <nl> - set_has_url ( ) ; <nl> - if ( url_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - url_ = new : : std : : string ; <nl> - } <nl> - url_ - > assign ( reinterpret_cast < const char * > ( value ) , size ) ; <nl> - } <nl> - inline : : std : : string * PB_ArangoBlobRequest : : mutable_url ( ) { <nl> - set_has_url ( ) ; <nl> - if ( url_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - url_ = new : : std : : string ; <nl> - } <nl> - return url_ ; <nl> - } <nl> - inline : : std : : string * PB_ArangoBlobRequest : : release_url ( ) { <nl> - clear_has_url ( ) ; <nl> - if ( url_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - return NULL ; <nl> - } else { <nl> - : : std : : string * temp = url_ ; <nl> - url_ = const_cast < : : std : : string * > ( & : : google : : protobuf : : internal : : kEmptyString ) ; <nl> - return temp ; <nl> - } <nl> - } <nl> - <nl> - / / repeated . PB_ArangoKeyValue values = 3 ; <nl> - inline int PB_ArangoBlobRequest : : values_size ( ) const { <nl> - return values_ . size ( ) ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : clear_values ( ) { <nl> - values_ . Clear ( ) ; <nl> - } <nl> - inline const : : PB_ArangoKeyValue & PB_ArangoBlobRequest : : values ( int index ) const { <nl> - return values_ . Get ( index ) ; <nl> - } <nl> - inline : : PB_ArangoKeyValue * PB_ArangoBlobRequest : : mutable_values ( int index ) { <nl> - return values_ . Mutable ( index ) ; <nl> - } <nl> - inline : : PB_ArangoKeyValue * PB_ArangoBlobRequest : : add_values ( ) { <nl> - return values_ . Add ( ) ; <nl> - } <nl> - inline const : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoKeyValue > & <nl> - PB_ArangoBlobRequest : : values ( ) const { <nl> - return values_ ; <nl> - } <nl> - inline : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoKeyValue > * <nl> - PB_ArangoBlobRequest : : mutable_values ( ) { <nl> - return & values_ ; <nl> - } <nl> - <nl> - / / repeated . PB_ArangoKeyValue headers = 4 ; <nl> - inline int PB_ArangoBlobRequest : : headers_size ( ) const { <nl> - return headers_ . size ( ) ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : clear_headers ( ) { <nl> - headers_ . Clear ( ) ; <nl> - } <nl> - inline const : : PB_ArangoKeyValue & PB_ArangoBlobRequest : : headers ( int index ) const { <nl> - return headers_ . Get ( index ) ; <nl> - } <nl> - inline : : PB_ArangoKeyValue * PB_ArangoBlobRequest : : mutable_headers ( int index ) { <nl> - return headers_ . Mutable ( index ) ; <nl> - } <nl> - inline : : PB_ArangoKeyValue * PB_ArangoBlobRequest : : add_headers ( ) { <nl> - return headers_ . Add ( ) ; <nl> - } <nl> - inline const : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoKeyValue > & <nl> - PB_ArangoBlobRequest : : headers ( ) const { <nl> - return headers_ ; <nl> - } <nl> - inline : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoKeyValue > * <nl> - PB_ArangoBlobRequest : : mutable_headers ( ) { <nl> - return & headers_ ; <nl> - } <nl> - <nl> - / / required . PB_ArangoMessageContentType contentType = 5 ; <nl> - inline bool PB_ArangoBlobRequest : : has_contenttype ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000010u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : set_has_contenttype ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000010u ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : clear_has_contenttype ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000010u ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : clear_contenttype ( ) { <nl> - contenttype_ = 0 ; <nl> - clear_has_contenttype ( ) ; <nl> - } <nl> - inline PB_ArangoMessageContentType PB_ArangoBlobRequest : : contenttype ( ) const { <nl> - return static_cast < PB_ArangoMessageContentType > ( contenttype_ ) ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : set_contenttype ( PB_ArangoMessageContentType value ) { <nl> - GOOGLE_DCHECK ( PB_ArangoMessageContentType_IsValid ( value ) ) ; <nl> - set_has_contenttype ( ) ; <nl> - contenttype_ = value ; <nl> - } <nl> - <nl> - / / optional string content = 7 ; <nl> - inline bool PB_ArangoBlobRequest : : has_content ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000020u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : set_has_content ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000020u ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : clear_has_content ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000020u ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : clear_content ( ) { <nl> - if ( content_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - content_ - > clear ( ) ; <nl> - } <nl> - clear_has_content ( ) ; <nl> - } <nl> - inline const : : std : : string & PB_ArangoBlobRequest : : content ( ) const { <nl> - return * content_ ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : set_content ( const : : std : : string & value ) { <nl> - set_has_content ( ) ; <nl> - if ( content_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - content_ = new : : std : : string ; <nl> - } <nl> - content_ - > assign ( value ) ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : set_content ( const char * value ) { <nl> - set_has_content ( ) ; <nl> - if ( content_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - content_ = new : : std : : string ; <nl> - } <nl> - content_ - > assign ( value ) ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : set_content ( const char * value , size_t size ) { <nl> - set_has_content ( ) ; <nl> - if ( content_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - content_ = new : : std : : string ; <nl> - } <nl> - content_ - > assign ( reinterpret_cast < const char * > ( value ) , size ) ; <nl> - } <nl> - inline : : std : : string * PB_ArangoBlobRequest : : mutable_content ( ) { <nl> - set_has_content ( ) ; <nl> - if ( content_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - content_ = new : : std : : string ; <nl> - } <nl> - return content_ ; <nl> - } <nl> - inline : : std : : string * PB_ArangoBlobRequest : : release_content ( ) { <nl> - clear_has_content ( ) ; <nl> - if ( content_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - return NULL ; <nl> - } else { <nl> - : : std : : string * temp = content_ ; <nl> - content_ = const_cast < : : std : : string * > ( & : : google : : protobuf : : internal : : kEmptyString ) ; <nl> - return temp ; <nl> - } <nl> - } <nl> - <nl> - / / optional . PB_ArangoJsonContent json = 8 ; <nl> - inline bool PB_ArangoBlobRequest : : has_json ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000040u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : set_has_json ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000040u ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : clear_has_json ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000040u ; <nl> - } <nl> - inline void PB_ArangoBlobRequest : : clear_json ( ) { <nl> - if ( json_ ! = NULL ) json_ - > : : PB_ArangoJsonContent : : Clear ( ) ; <nl> - clear_has_json ( ) ; <nl> - } <nl> - inline const : : PB_ArangoJsonContent & PB_ArangoBlobRequest : : json ( ) const { <nl> - return json_ ! = NULL ? * json_ : * default_instance_ - > json_ ; <nl> - } <nl> - inline : : PB_ArangoJsonContent * PB_ArangoBlobRequest : : mutable_json ( ) { <nl> - set_has_json ( ) ; <nl> - if ( json_ = = NULL ) json_ = new : : PB_ArangoJsonContent ; <nl> - return json_ ; <nl> - } <nl> - inline : : PB_ArangoJsonContent * PB_ArangoBlobRequest : : release_json ( ) { <nl> - clear_has_json ( ) ; <nl> - : : PB_ArangoJsonContent * temp = json_ ; <nl> - json_ = NULL ; <nl> - return temp ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / PB_ArangoBlobResponse <nl> - <nl> - / / required int32 status = 1 ; <nl> - inline bool PB_ArangoBlobResponse : : has_status ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000001u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : set_has_status ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000001u ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : clear_has_status ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000001u ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : clear_status ( ) { <nl> - status_ = 0 ; <nl> - clear_has_status ( ) ; <nl> - } <nl> - inline : : google : : protobuf : : int32 PB_ArangoBlobResponse : : status ( ) const { <nl> - return status_ ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : set_status ( : : google : : protobuf : : int32 value ) { <nl> - set_has_status ( ) ; <nl> - status_ = value ; <nl> - } <nl> - <nl> - / / repeated . PB_ArangoKeyValue headers = 2 ; <nl> - inline int PB_ArangoBlobResponse : : headers_size ( ) const { <nl> - return headers_ . size ( ) ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : clear_headers ( ) { <nl> - headers_ . Clear ( ) ; <nl> - } <nl> - inline const : : PB_ArangoKeyValue & PB_ArangoBlobResponse : : headers ( int index ) const { <nl> - return headers_ . Get ( index ) ; <nl> - } <nl> - inline : : PB_ArangoKeyValue * PB_ArangoBlobResponse : : mutable_headers ( int index ) { <nl> - return headers_ . Mutable ( index ) ; <nl> - } <nl> - inline : : PB_ArangoKeyValue * PB_ArangoBlobResponse : : add_headers ( ) { <nl> - return headers_ . Add ( ) ; <nl> - } <nl> - inline const : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoKeyValue > & <nl> - PB_ArangoBlobResponse : : headers ( ) const { <nl> - return headers_ ; <nl> - } <nl> - inline : : google : : protobuf : : RepeatedPtrField < : : PB_ArangoKeyValue > * <nl> - PB_ArangoBlobResponse : : mutable_headers ( ) { <nl> - return & headers_ ; <nl> - } <nl> - <nl> - / / required . PB_ArangoMessageContentType contentType = 3 ; <nl> - inline bool PB_ArangoBlobResponse : : has_contenttype ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000004u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : set_has_contenttype ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000004u ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : clear_has_contenttype ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000004u ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : clear_contenttype ( ) { <nl> - contenttype_ = 0 ; <nl> - clear_has_contenttype ( ) ; <nl> - } <nl> - inline PB_ArangoMessageContentType PB_ArangoBlobResponse : : contenttype ( ) const { <nl> - return static_cast < PB_ArangoMessageContentType > ( contenttype_ ) ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : set_contenttype ( PB_ArangoMessageContentType value ) { <nl> - GOOGLE_DCHECK ( PB_ArangoMessageContentType_IsValid ( value ) ) ; <nl> - set_has_contenttype ( ) ; <nl> - contenttype_ = value ; <nl> - } <nl> - <nl> - / / required int32 contentLength = 6 ; <nl> - inline bool PB_ArangoBlobResponse : : has_contentlength ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000008u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : set_has_contentlength ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000008u ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : clear_has_contentlength ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000008u ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : clear_contentlength ( ) { <nl> - contentlength_ = 0 ; <nl> - clear_has_contentlength ( ) ; <nl> - } <nl> - inline : : google : : protobuf : : int32 PB_ArangoBlobResponse : : contentlength ( ) const { <nl> - return contentlength_ ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : set_contentlength ( : : google : : protobuf : : int32 value ) { <nl> - set_has_contentlength ( ) ; <nl> - contentlength_ = value ; <nl> - } <nl> - <nl> - / / optional string content = 4 ; <nl> - inline bool PB_ArangoBlobResponse : : has_content ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000010u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : set_has_content ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000010u ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : clear_has_content ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000010u ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : clear_content ( ) { <nl> - if ( content_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - content_ - > clear ( ) ; <nl> - } <nl> - clear_has_content ( ) ; <nl> - } <nl> - inline const : : std : : string & PB_ArangoBlobResponse : : content ( ) const { <nl> - return * content_ ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : set_content ( const : : std : : string & value ) { <nl> - set_has_content ( ) ; <nl> - if ( content_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - content_ = new : : std : : string ; <nl> - } <nl> - content_ - > assign ( value ) ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : set_content ( const char * value ) { <nl> - set_has_content ( ) ; <nl> - if ( content_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - content_ = new : : std : : string ; <nl> - } <nl> - content_ - > assign ( value ) ; <nl> - } <nl> - inline void PB_ArangoBlobResponse : : set_content ( const char * value , size_t size ) { <nl> - set_has_content ( ) ; <nl> - if ( content_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - content_ = new : : std : : string ; <nl> - } <nl> - content_ - > assign ( reinterpret_cast < const char * > ( value ) , size ) ; <nl> - } <nl> - inline : : std : : string * PB_ArangoBlobResponse : : mutable_content ( ) { <nl> - set_has_content ( ) ; <nl> - if ( content_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - content_ = new : : std : : string ; <nl> - } <nl> - return content_ ; <nl> - } <nl> - inline : : std : : string * PB_ArangoBlobResponse : : release_content ( ) { <nl> - clear_has_content ( ) ; <nl> - if ( content_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - return NULL ; <nl> - } else { <nl> - : : std : : string * temp = content_ ; <nl> - content_ = const_cast < : : std : : string * > ( & : : google : : protobuf : : internal : : kEmptyString ) ; <nl> - return temp ; <nl> - } <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - / / PB_ArangoErrorResponse <nl> - <nl> - / / required string message = 1 ; <nl> - inline bool PB_ArangoErrorResponse : : has_message ( ) const { <nl> - return ( _has_bits_ [ 0 ] & 0x00000001u ) ! = 0 ; <nl> - } <nl> - inline void PB_ArangoErrorResponse : : set_has_message ( ) { <nl> - _has_bits_ [ 0 ] | = 0x00000001u ; <nl> - } <nl> - inline void PB_ArangoErrorResponse : : clear_has_message ( ) { <nl> - _has_bits_ [ 0 ] & = ~ 0x00000001u ; <nl> - } <nl> - inline void PB_ArangoErrorResponse : : clear_message ( ) { <nl> - if ( message_ ! = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - message_ - > clear ( ) ; <nl> - } <nl> - clear_has_message ( ) ; <nl> - } <nl> - inline const : : std : : string & PB_ArangoErrorResponse : : message ( ) const { <nl> - return * message_ ; <nl> - } <nl> - inline void PB_ArangoErrorResponse : : set_message ( const : : std : : string & value ) { <nl> - set_has_message ( ) ; <nl> - if ( message_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - message_ = new : : std : : string ; <nl> - } <nl> - message_ - > assign ( value ) ; <nl> - } <nl> - inline void PB_ArangoErrorResponse : : set_message ( const char * value ) { <nl> - set_has_message ( ) ; <nl> - if ( message_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - message_ = new : : std : : string ; <nl> - } <nl> - message_ - > assign ( value ) ; <nl> - } <nl> - inline void PB_ArangoErrorResponse : : set_message ( const char * value , size_t size ) { <nl> - set_has_message ( ) ; <nl> - if ( message_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - message_ = new : : std : : string ; <nl> - } <nl> - message_ - > assign ( reinterpret_cast < const char * > ( value ) , size ) ; <nl> - } <nl> - inline : : std : : string * PB_ArangoErrorResponse : : mutable_message ( ) { <nl> - set_has_message ( ) ; <nl> - if ( message_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - message_ = new : : std : : string ; <nl> - } <nl> - return message_ ; <nl> - } <nl> - inline : : std : : string * PB_ArangoErrorResponse : : release_message ( ) { <nl> - clear_has_message ( ) ; <nl> - if ( message_ = = & : : google : : protobuf : : internal : : kEmptyString ) { <nl> - return NULL ; <nl> - } else { <nl> - : : std : : string * temp = message_ ; <nl> - message_ = const_cast < : : std : : string * > ( & : : google : : protobuf : : internal : : kEmptyString ) ; <nl> - return temp ; <nl> - } <nl> - } <nl> - <nl> - <nl> - / / @ @ protoc_insertion_point ( namespace_scope ) <nl> - <nl> - # ifndef SWIG <nl> - namespace google { <nl> - namespace protobuf { <nl> - <nl> - template < > <nl> - inline const EnumDescriptor * GetEnumDescriptor < PB_ArangoMessageType > ( ) { <nl> - return PB_ArangoMessageType_descriptor ( ) ; <nl> - } <nl> - template < > <nl> - inline const EnumDescriptor * GetEnumDescriptor < PB_ArangoMessageContentType > ( ) { <nl> - return PB_ArangoMessageContentType_descriptor ( ) ; <nl> - } <nl> - template < > <nl> - inline const EnumDescriptor * GetEnumDescriptor < PB_ArangoRequestType > ( ) { <nl> - return PB_ArangoRequestType_descriptor ( ) ; <nl> - } <nl> - template < > <nl> - inline const EnumDescriptor * GetEnumDescriptor < PB_ArangoJsonType > ( ) { <nl> - return PB_ArangoJsonType_descriptor ( ) ; <nl> - } <nl> - <nl> - } / / namespace google <nl> - } / / namespace protobuf <nl> - # endif / / SWIG <nl> - <nl> - / / @ @ protoc_insertion_point ( global_scope ) <nl> - <nl> - # endif / / PROTOBUF_lib_2fProtocolBuffers_2farangodb_2eproto__INCLUDED <nl> deleted file mode 100644 <nl> index c876a7195cc . . 00000000000 <nl> mmm a / lib / ProtocolBuffers / arangodb . proto <nl> ppp / dev / null <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief message definition for protocol buffers <nl> - / / / <nl> - / / / @ file <nl> - / / / <nl> - / / / DISCLAIMER <nl> - / / / <nl> - / / / Copyright 2012 triagens GmbH , Cologne , Germany <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> - / / / Copyright holder is triAGENS GmbH , Cologne , Germany <nl> - / / / <nl> - / / / @ author Dr . Frank Celler <nl> - / / / @ author Copyright 2012 , triAGENS GmbH , Cologne , Germany <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - enumerations <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - enum PB_ArangoMessageType { <nl> - PB_BLOB_REQUEST = 0 ; <nl> - PB_BLOB_RESPONSE = 1 ; <nl> - PB_ERROR_RESPONSE = 2 ; <nl> - } <nl> - <nl> - enum PB_ArangoMessageContentType { <nl> - PB_NO_CONTENT = 0 ; <nl> - PB_TEXT_CONTENT = 1 ; <nl> - PB_JSON_CONTENT = 2 ; <nl> - } <nl> - <nl> - enum PB_ArangoRequestType { <nl> - PB_REQUEST_TYPE_DELETE = 0 ; <nl> - PB_REQUEST_TYPE_GET = 1 ; <nl> - PB_REQUEST_TYPE_HEAD = 2 ; <nl> - PB_REQUEST_TYPE_POST = 3 ; <nl> - PB_REQUEST_TYPE_PUT = 4 ; <nl> - PB_REQUEST_TYPE_PATCH = 5 ; <nl> - } <nl> - <nl> - enum PB_ArangoJsonType { <nl> - PB_REQUEST_TYPE_NULL = 0 ; <nl> - PB_REQUEST_TYPE_BOOLEAN = 1 ; <nl> - PB_REQUEST_TYPE_NUMBER = 2 ; <nl> - PB_REQUEST_TYPE_STRING = 3 ; <nl> - PB_REQUEST_TYPE_ARRAY = 4 ; <nl> - PB_REQUEST_TYPE_LIST = 5 ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - general <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - message PB_ArangoKeyValue { <nl> - required string key = 1 ; <nl> - required string value = 2 ; <nl> - } <nl> - <nl> - message PB_ArangoMessage { <nl> - repeated PB_ArangoBatchMessage messages = 1 ; <nl> - } <nl> - <nl> - message PB_ArangoBatchMessage { <nl> - required PB_ArangoMessageType type = 1 ; <nl> - optional PB_ArangoBlobRequest blobRequest = 2 ; <nl> - optional PB_ArangoBlobResponse blobResponse = 3 ; <nl> - optional PB_ArangoErrorResponse errorResponse = 4 ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - json value <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - message PB_ArangoJsonValue { <nl> - optional bool booleanValue = 1 ; <nl> - optional double numberValue = 2 ; <nl> - optional string stringValue = 3 ; <nl> - repeated PB_ArangoJsonContent objects = 4 ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - json content <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - message PB_ArangoJsonContent { <nl> - required PB_ArangoJsonType type = 1 ; <nl> - optional PB_ArangoJsonValue value = 2 ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - blob request <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - message PB_ArangoBlobRequest { <nl> - required PB_ArangoRequestType requestType = 1 ; <nl> - required string url = 2 ; <nl> - repeated PB_ArangoKeyValue values = 3 ; / / case of key is significant <nl> - repeated PB_ArangoKeyValue headers = 4 ; / / key must be lowercase <nl> - required PB_ArangoMessageContentType contentType = 5 ; <nl> - optional string content = 7 ; <nl> - optional PB_ArangoJsonContent json = 8 ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - blob response <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - message PB_ArangoBlobResponse { <nl> - required int32 status = 1 ; <nl> - repeated PB_ArangoKeyValue headers = 2 ; / / key must be lowercase <nl> - required PB_ArangoMessageContentType contentType = 3 ; <nl> - required int32 contentLength = 6 ; <nl> - optional string content = 4 ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - error response <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - message PB_ArangoErrorResponse { <nl> - required string message = 1 ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - END - OF - FILE <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / Local Variables : <nl> - / / mode : outline - minor <nl> - / / outline - regexp : " ^ \ \ ( / / / @ brief \ \ | / / / { @ inheritDoc } \ \ | / / / @ addtogroup \ \ | / / - - SECTION - - \ \ | / / / @ \ \ } \ \ ) " <nl> - / / End : <nl> mmm a / lib / Rest / Endpoint . cpp <nl> ppp b / lib / Rest / Endpoint . cpp <nl> Endpoint * Endpoint : : factory ( const Endpoint : : Type type , <nl> size_t found = copy . find ( ' @ ' ) ; <nl> if ( found ! = string : : npos ) { <nl> string protoString = StringUtils : : tolower ( copy . substr ( 0 , found ) ) ; <nl> - if ( protoString = = " binary " ) { <nl> - protocol = PROTOCOL_BINARY ; <nl> - copy = copy . substr ( strlen ( " binary @ " ) ) ; <nl> - } <nl> - else if ( protoString = = " http " ) { <nl> + if ( protoString = = " http " ) { <nl> copy = copy . substr ( strlen ( " http @ " ) ) ; <nl> } <nl> else { <nl> mmm a / lib / Rest / Endpoint . h <nl> ppp b / lib / Rest / Endpoint . h <nl> namespace triagens { <nl> <nl> enum Protocol { <nl> PROTOCOL_UNKNOWN , <nl> - PROTOCOL_BINARY , <nl> PROTOCOL_HTTP <nl> } ; <nl> <nl> namespace triagens { <nl> return _protocol ; <nl> } <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief return whether the protocol is binary <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - bool isBinary ( ) const { <nl> - return _protocol = = PROTOCOL_BINARY ; <nl> - } <nl> - <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / / @ brief get the encryption used <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> mmm a / lib / Rest / EndpointList . h <nl> ppp b / lib / Rest / EndpointList . h <nl> namespace triagens { <nl> <nl> static const string getProtocolName ( const Endpoint : : Protocol protocol ) { <nl> switch ( protocol ) { <nl> - case Endpoint : : PROTOCOL_BINARY : <nl> - return " binary " ; <nl> case Endpoint : : PROTOCOL_HTTP : <nl> return " http " ; <nl> default : <nl> mmm a / lib / Rest / HttpResponse . cpp <nl> ppp b / lib / Rest / HttpResponse . cpp <nl> <nl> # include " BasicsC / strings . h " <nl> # include " Basics / StringUtils . h " <nl> # include " Logger / Logger . h " <nl> - # include " ProtocolBuffers / arangodb . pb . h " <nl> <nl> using namespace triagens : : basics ; <nl> using namespace triagens : : rest ; <nl> void HttpResponse : : writeHeader ( StringBuffer * output ) { <nl> / / end of header , body to follow <nl> } <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief writes the message to a protocol buffer <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - void HttpResponse : : write ( PB_ArangoBatchMessage * message ) { <nl> - message - > set_type ( PB_BLOB_RESPONSE ) ; <nl> - PB_ArangoBlobResponse * blob = message - > mutable_blobresponse ( ) ; <nl> - <nl> - blob - > set_status ( ( int32_t ) _code ) ; <nl> - <nl> - / / copy the headers <nl> - basics : : Dictionary < char const * > : : KeyValue const * begin ; <nl> - basics : : Dictionary < char const * > : : KeyValue const * end ; <nl> - <nl> - string contentType = " text / plain " ; <nl> - <nl> - for ( _headers . range ( begin , end ) ; begin < end ; + + begin ) { <nl> - char const * key = begin - > _key ; <nl> - <nl> - if ( key = = 0 ) { <nl> - continue ; <nl> - } <nl> - <nl> - / / ignore content - length <nl> - if ( strcmp ( key , " content - length " ) = = 0 ) { <nl> - continue ; <nl> - } <nl> - <nl> - if ( strcmp ( key , " transfer - encoding " ) = = 0 ) { <nl> - continue ; <nl> - } <nl> - <nl> - if ( strcmp ( key , " connection " ) = = 0 ) { <nl> - continue ; <nl> - } <nl> - <nl> - if ( strcmp ( key , " server " ) = = 0 ) { <nl> - continue ; <nl> - } <nl> - <nl> - char const * value = begin - > _value ; <nl> - <nl> - if ( strcmp ( key , " content - type " ) = = 0 ) { <nl> - contentType = value ; <nl> - continue ; <nl> - } <nl> - <nl> - PB_ArangoKeyValue * kv = blob - > add_headers ( ) ; <nl> - <nl> - kv - > set_key ( key ) ; <nl> - kv - > set_value ( value ) ; <nl> - } <nl> - <nl> - / / set the content type <nl> - if ( StringUtils : : isPrefix ( contentType , " application / json " ) ) { <nl> - blob - > set_contenttype ( PB_JSON_CONTENT ) ; <nl> - } <nl> - else { <nl> - blob - > set_contenttype ( PB_TEXT_CONTENT ) ; <nl> - } <nl> - <nl> - / / check the body <nl> - if ( _isHeadResponse ) { <nl> - blob - > set_contentlength ( _bodySize ) ; <nl> - } <nl> - else { <nl> - blob - > set_contentlength ( _body . length ( ) ) ; <nl> - <nl> - string content ( _body . c_str ( ) , _body . length ( ) ) ; <nl> - blob - > set_content ( content ) ; <nl> - } <nl> - } <nl> - <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / / @ brief returns the size of the body <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> deleted file mode 100644 <nl> index 203d7cf5466 . . 00000000000 <nl> mmm a / lib / SimpleHttpClient / SimpleBinaryClient . cpp <nl> ppp / dev / null <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief simple binary client <nl> - / / / <nl> - / / / @ file <nl> - / / / <nl> - / / / DISCLAIMER <nl> - / / / <nl> - / / / Copyright 2010 - 2011 triagens GmbH , Cologne , Germany <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> - / / / Copyright holder is triAGENS GmbH , Cologne , Germany <nl> - / / / <nl> - / / / @ author Jan Steemann <nl> - / / / @ author Copyright 2012 , triagens GmbH , Cologne , Germany <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - # include " SimpleBinaryClient . h " <nl> - <nl> - # include < stdio . h > <nl> - # include < string > <nl> - # include < errno . h > <nl> - <nl> - # include " BasicsC / hashes . h " <nl> - <nl> - # include " Basics / StringUtils . h " <nl> - # include " Logger / Logger . h " <nl> - <nl> - # include " GeneralClientConnection . h " <nl> - # include " SimpleHttpClient / SimpleHttpResult . h " <nl> - # include " BinaryServer / BinaryMessage . h " <nl> - <nl> - using namespace triagens : : basics ; <nl> - using namespace triagens : : rest ; <nl> - using namespace std ; <nl> - <nl> - namespace triagens { <nl> - namespace httpclient { <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / constructors and destructors <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - SimpleBinaryClient : : SimpleBinaryClient ( GeneralClientConnection * connection , double requestTimeout , bool warn ) : <nl> - SimpleClient ( connection , requestTimeout , warn ) , _result ( 0 ) { <nl> - } <nl> - <nl> - SimpleBinaryClient : : ~ SimpleBinaryClient ( ) { <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / public methods <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - SimpleHttpResult * SimpleBinaryClient : : request ( int method , <nl> - const string & location , <nl> - const char * body , <nl> - size_t bodyLength , <nl> - const map < string , string > & headerFields ) { <nl> - <nl> - assert ( _result = = 0 ) ; <nl> - <nl> - _result = new SimpleHttpResult ; <nl> - _errorMessage = " " ; <nl> - <nl> - / / set body to all connections <nl> - setRequest ( method , location , body , bodyLength , headerFields ) ; <nl> - <nl> - double endTime = now ( ) + _requestTimeout ; <nl> - double remainingTime = _requestTimeout ; <nl> - <nl> - while ( isWorking ( ) & & remainingTime > 0 . 0 ) { <nl> - switch ( _state ) { <nl> - case ( IN_CONNECT ) : { <nl> - handleConnect ( ) ; <nl> - break ; <nl> - } <nl> - <nl> - case ( IN_WRITE ) : { <nl> - size_t bytesWritten = 0 ; <nl> - <nl> - if ( ! _connection - > handleWrite ( remainingTime , ( void * ) ( _writeBuffer . c_str ( ) + _written ) , _writeBuffer . length ( ) - _written , & bytesWritten ) ) { <nl> - setErrorMessage ( " : : send ( ) failed " , errno ) ; <nl> - close ( ) ; <nl> - } <nl> - else { <nl> - _written + = bytesWritten ; <nl> - if ( _written = = _writeBuffer . length ( ) ) { <nl> - _state = IN_READ_HEADER ; <nl> - } <nl> - } <nl> - break ; <nl> - } <nl> - <nl> - case ( IN_READ_HEADER ) : <nl> - case ( IN_READ_BODY ) : { <nl> - if ( _connection - > handleRead ( remainingTime , _readBuffer ) ) { <nl> - switch ( _state ) { <nl> - case ( IN_READ_HEADER ) : { <nl> - const size_t headerLength = BinaryMessage : : getHeaderLength ( ) ; <nl> - if ( _readBuffer . length ( ) > = headerLength ) { <nl> - const size_t foundLength = BinaryMessage : : decodeLength ( ( uint8_t * ) ( _readBuffer . c_str ( ) + 4 ) ) ; <nl> - _result - > setContentLength ( foundLength ) ; <nl> - <nl> - if ( foundLength + headerLength = = _readBuffer . length ( ) ) { <nl> - _result - > getBody ( ) . write ( _readBuffer . c_str ( ) + headerLength , foundLength ) ; <nl> - _readBuffer . erase_front ( _readBuffer . length ( ) ) ; <nl> - _result - > setResultType ( SimpleHttpResult : : COMPLETE ) ; <nl> - _state = FINISHED ; <nl> - } <nl> - else { <nl> - _readBuffer . erase_front ( headerLength ) ; <nl> - _state = IN_READ_BODY ; <nl> - readBody ( ) ; <nl> - } <nl> - } <nl> - else { <nl> - setErrorMessage ( " return message truncated " , errno ) ; <nl> - close ( ) ; <nl> - } <nl> - break ; <nl> - } <nl> - <nl> - case ( IN_READ_BODY ) : <nl> - readBody ( ) ; <nl> - break ; <nl> - <nl> - default : <nl> - break ; <nl> - } <nl> - } <nl> - else { <nl> - setErrorMessage ( " gesockopt ( ) failed " , errno ) ; <nl> - close ( ) ; <nl> - } <nl> - break ; <nl> - } <nl> - <nl> - default : <nl> - break ; <nl> - } <nl> - <nl> - remainingTime = endTime - now ( ) ; <nl> - } <nl> - <nl> - if ( isWorking ( ) & & _errorMessage = = " " ) { <nl> - setErrorMessage ( " Request timeout reached " ) ; <nl> - } <nl> - <nl> - / / set result type in getResult ( ) <nl> - SimpleHttpResult * result = getResult ( ) ; <nl> - <nl> - _result = 0 ; <nl> - <nl> - return result ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / private methods <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - void SimpleBinaryClient : : reset ( ) { <nl> - SimpleClient : : reset ( ) ; <nl> - if ( _result ) { <nl> - _result - > clear ( ) ; <nl> - } <nl> - } <nl> - <nl> - bool SimpleBinaryClient : : readBody ( ) { <nl> - if ( _readBuffer . length ( ) > = _result - > getContentLength ( ) ) { <nl> - _result - > getBody ( ) . write ( _readBuffer . c_str ( ) , _readBuffer . length ( ) ) ; <nl> - _readBuffer . erase_front ( _readBuffer . length ( ) ) ; <nl> - _result - > setResultType ( SimpleHttpResult : : COMPLETE ) ; <nl> - _state = FINISHED ; <nl> - } <nl> - <nl> - return true ; <nl> - } <nl> - <nl> - SimpleHttpResult * SimpleBinaryClient : : getResult ( ) { <nl> - switch ( _state ) { <nl> - case ( IN_CONNECT ) : <nl> - _result - > setResultType ( SimpleHttpResult : : COULD_NOT_CONNECT ) ; <nl> - break ; <nl> - <nl> - case ( IN_WRITE ) : <nl> - _result - > setResultType ( SimpleHttpResult : : WRITE_ERROR ) ; <nl> - break ; <nl> - <nl> - case ( IN_READ_HEADER ) : <nl> - case ( IN_READ_BODY ) : <nl> - case ( IN_READ_CHUNKED_HEADER ) : <nl> - case ( IN_READ_CHUNKED_BODY ) : <nl> - _result - > setResultType ( SimpleHttpResult : : READ_ERROR ) ; <nl> - break ; <nl> - <nl> - case ( FINISHED ) : <nl> - _result - > setResultType ( SimpleHttpResult : : COMPLETE ) ; <nl> - break ; <nl> - <nl> - default : <nl> - _result - > setResultType ( SimpleHttpResult : : COULD_NOT_CONNECT ) ; <nl> - } <nl> - <nl> - return _result ; <nl> - } <nl> - <nl> - void SimpleBinaryClient : : setRequest ( int method , <nl> - const string & location , <nl> - const char * body , <nl> - size_t bodyLength , <nl> - const map < string , string > & headerFields ) { <nl> - <nl> - if ( _state = = DEAD ) { <nl> - _connection - > resetNumConnectRetries ( ) ; <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / fill the write buffer / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - _writeBuffer . clear ( ) ; <nl> - <nl> - / / write some dummy output ( will be overwritten later ) <nl> - _writeBuffer . appendText ( " 00000000 " ) ; <nl> - <nl> - uint8_t * outPtr = ( uint8_t * ) _writeBuffer . c_str ( ) ; <nl> - BinaryMessage : : writeHeader ( bodyLength , outPtr ) ; <nl> - <nl> - _writeBuffer . appendText ( body , bodyLength ) ; <nl> - <nl> - / / std : : cout < < " buffer length : " < < _writeBuffer . length ( ) < < " , hash : " < < TRI_FnvHashPointer ( _writeBuffer . c_str ( ) , _writeBuffer . length ( ) ) < < " \ n " ; <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - if ( _state ! = FINISHED ) { <nl> - / / close connection to reset all read and write buffers <nl> - close ( ) ; <nl> - } <nl> - <nl> - if ( _connection - > isConnected ( ) ) { <nl> - / / we are connected , start with writing <nl> - _state = IN_WRITE ; <nl> - _written = 0 ; <nl> - } <nl> - else { <nl> - / / connect to server <nl> - _state = IN_CONNECT ; <nl> - } <nl> - } <nl> - <nl> - } <nl> - <nl> - } <nl> deleted file mode 100644 <nl> index e3fef7ae7de . . 00000000000 <nl> mmm a / lib / SimpleHttpClient / SimpleBinaryClient . h <nl> ppp / dev / null <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief simple binary client <nl> - / / / <nl> - / / / @ file <nl> - / / / <nl> - / / / DISCLAIMER <nl> - / / / <nl> - / / / Copyright 2010 - 2011 triagens GmbH , Cologne , Germany <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> - / / / Copyright holder is triAGENS GmbH , Cologne , Germany <nl> - / / / <nl> - / / / @ author Jan Steemann <nl> - / / / @ author Copyright 2012 , triagens GmbH , Cologne , Germany <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - # ifndef TRIAGENS_SIMPLE_HTTP_CLIENT_SIMPLE_BINARY_CLIENT_H <nl> - # define TRIAGENS_SIMPLE_HTTP_CLIENT_SIMPLE_BINARY_CLIENT_H 1 <nl> - <nl> - # include < Basics / Common . h > <nl> - <nl> - # include " Basics / StringBuffer . h " <nl> - # include " Logger / Logger . h " <nl> - # include " SimpleHttpClient / SimpleClient . h " <nl> - # include " ProtocolBuffers / arangodb . pb . h " <nl> - <nl> - namespace triagens { <nl> - namespace httpclient { <nl> - <nl> - class SimpleHttpResult ; <nl> - class GeneralClientConnection ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief simple binary client <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - class SimpleBinaryClient : public SimpleClient { <nl> - <nl> - private : <nl> - SimpleBinaryClient ( SimpleBinaryClient const & ) ; <nl> - SimpleBinaryClient & operator = ( SimpleBinaryClient const & ) ; <nl> - <nl> - public : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief constructs a new binary client <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - SimpleBinaryClient ( GeneralClientConnection * , <nl> - double , <nl> - bool ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief destructs a binary client <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - virtual ~ SimpleBinaryClient ( ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief make a http request <nl> - / / / the caller has to delete the result object <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - virtual SimpleHttpResult * request ( int method , <nl> - const string & location , <nl> - const char * body , <nl> - size_t bodyLength , <nl> - const map < string , string > & headerFields ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief set user name and password <nl> - / / / not needed for binary client <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - virtual void setUserNamePassword ( const string & prefix , <nl> - const string & username , <nl> - const string & password ) { <nl> - } <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief reset state <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - virtual void reset ( ) ; <nl> - <nl> - private : <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief read remainder of body until done <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - bool readBody ( ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief get the result <nl> - / / / the caller has to delete the result object <nl> - / / / <nl> - / / / @ return SimpleHttpResult the request result <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - SimpleHttpResult * getResult ( ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief set the request <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - void setRequest ( int method , <nl> - const string & location , <nl> - const char * body , <nl> - size_t bodyLength , <nl> - const map < string , string > & headerFields ) ; <nl> - <nl> - private : <nl> - <nl> - SimpleHttpResult * _result ; <nl> - <nl> - } ; <nl> - } <nl> - } <nl> - <nl> - # endif <nl> deleted file mode 100644 <nl> index e6eb90f25ee . . 00000000000 <nl> mmm a / m4 / all - in - one . protobuf <nl> ppp / dev / null <nl> <nl> - dnl - * - mode : Autoconf ; - * - <nl> - <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - dnl - - SECTION - - PROTOBUF <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - PROTOBUF_CPPFLAGS = " - I $ { srcdir } / 3rdParty / protobuf - 2 . 4 . 1 / src " <nl> - PROTOBUF_LDFLAGS = " " <nl> - PROTOBUF_LIBS = " $ { srcdir } / 3rdParty / protobuf - 2 . 4 . 1 / src / . libs / libprotobuf . a " <nl> - PROTOBUF_PROTOC = " $ { srcdir } / 3rdParty / protobuf - 2 . 4 . 1 / BUILD / bin / protoc " <nl> - <nl> - TRI_PROTOBUF_VERSION = " 2 . 4 . 1 " <nl> - <nl> - PROTOBUF_CPPFLAGS = " $ { PROTOBUF_CPPFLAGS } - DTRI_PROTOBUF_VERSION = ' \ " $ { TRI_PROTOBUF_VERSION } \ " ' " <nl> - <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - dnl add substitutions <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - AC_SUBST ( PROTOBUF_CPPFLAGS ) <nl> - AC_SUBST ( PROTOBUF_LDFLAGS ) <nl> - AC_SUBST ( PROTOBUF_LIBS ) <nl> - <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - dnl informational output <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - LIB_INFO = " $ LIB_INFO | PROTOBUF : 3rdParty " <nl> - LIB_INFO = " $ LIB_INFO | PROTOBUF VERSION : $ { TRI_PROTOBUF_VERSION } " <nl> - LIB_INFO = " $ LIB_INFO | PROTOBUF COMPILER : $ { PROTOBUF_PROTOC } " <nl> - <nl> - LIB_INFO = " $ LIB_INFO | PROTOBUF_CPPFLAGS : $ { PROTOBUF_CPPFLAGS } " <nl> - LIB_INFO = " $ LIB_INFO | PROTOBUF_LDFLAGS : $ { PROTOBUF_LDFLAGS } " <nl> - LIB_INFO = " $ LIB_INFO | PROTOBUF_LIBS : $ { PROTOBUF_LIBS } " <nl> - <nl> - LIB_INFO = " $ LIB_INFO | . " <nl> - <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - dnl - - SECTION - - END - OF - FILE <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - dnl Local Variables : <nl> - dnl mode : outline - minor <nl> - dnl outline - regexp : " ^ \ \ ( dnl - - SECTION - - \ \ ) " <nl> - dnl End : <nl> deleted file mode 100644 <nl> index 591dbb1b60a . . 00000000000 <nl> mmm a / m4 / external . protobuf <nl> ppp / dev / null <nl> <nl> - dnl - * - mode : Autoconf ; - * - <nl> - <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - dnl - - SECTION - - PROTOBUF <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - AC_ARG_WITH ( protobuf , <nl> - AS_HELP_STRING ( [ - - with - protobuf = DIR ] , [ where the protobuf library and includes are located ] ) , <nl> - [ PROTOBUF_CPPFLAGS = " - I $ withval / include " <nl> - PROTOBUF_LDFLAGS = " - L $ withval / lib " <nl> - PROTOBUF = " $ withval " ] <nl> - ) <nl> - <nl> - AC_ARG_WITH ( protobuf - lib , <nl> - AS_HELP_STRING ( [ - - with - protobuf - lib = DIR ] , [ where the protobuf library is located ] ) , <nl> - [ PROTOBUF_LDFLAGS = " - L $ withval " ] <nl> - ) <nl> - <nl> - TR_STATIC_ENABLE ( [ protobuf ] ) <nl> - <nl> - AC_MSG_NOTICE ( [ mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - ] ) <nl> - AC_MSG_NOTICE ( [ CHECKING FOR PROTOBUF ] ) <nl> - AC_MSG_NOTICE ( [ mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - ] ) <nl> - <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - dnl save flags <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - SAVE_CPPFLAGS = " $ CPPFLAGS " <nl> - CPPFLAGS = " $ CPPFLAGS $ PROTOBUF_CPPFLAGS " <nl> - <nl> - SAVE_LDFLAGS = " $ LDFLAGS " <nl> - LDFLAGS = " $ LDFLAGS $ PROTOBUF_LDFLAGS " <nl> - <nl> - SAVE_LIBS = " $ LIBS " <nl> - <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - dnl check for header and library <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - AC_LANG ( C + + ) <nl> - <nl> - AC_CHECK_HEADERS ( google / protobuf / stubs / common . h , [ tr_PROTOBUF = " yes " ] , [ tr_PROTOBUF = " no " ] ) <nl> - <nl> - PROTOBUF_LIBS = " " <nl> - <nl> - if test " x $ tr_PROTOBUF " = xyes ; then <nl> - TR_FIND_CXX_LIBRARY ( [ protobuf ] , [ protobuf ] , [ PROTOBUF_LIBS ] , [ # include < google / protobuf / stubs / common . h > ] , [ google : : protobuf : : ShutdownProtobufLibrary ( ) ] ) <nl> - tr_PROTOBUF = $ tr_library_found <nl> - fi <nl> - <nl> - if test " x $ tr_PROTOBUF " = xyes ; then <nl> - TR_STATIC_LIBRARY ( [ protobuf ] , [ PROTOBUF_LIBS ] ) <nl> - else <nl> - AC_MSG_ERROR ( [ Please install Google ' s protocol buffers from http : / / code . google . com / p / protobuf / ] ) <nl> - fi <nl> - <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - dnl check for protoc <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - AC_PATH_PROG ( [ PROTOBUF_PROTOC ] , [ protoc ] , [ ] , [ $ PATH ] ) <nl> - <nl> - if test " x $ PROTOBUF_PROTOC " = x ; then <nl> - AC_MSG_ERROR ( [ Please install Google ' s protocol buffers from http : / / code . google . com / p / protobuf / ] ) <nl> - fi <nl> - <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - dnl grep protobuf version number <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - cat confdefs . h - < < _ACEOF > conftest . $ ac_ext <nl> - / * end confdefs . h . * / <nl> - # include < google / protobuf / stubs / common . h > <nl> - <nl> - main ( ) { <nl> - long sdnhg36ed = GOOGLE_PROTOBUF_VERSION ; <nl> - } <nl> - <nl> - _ACEOF <nl> - AC_MSG_CHECKING ( [ PROTOBUF version ] ) <nl> - eval " $ ac_cpp conftest . $ ac_ext " | fgrep " long sdnhg36ed " | awk ' { m1 = int ( $ 4 / 1000000 ) ; m2 = int ( $ 4 / 1000 ) % 1000 ; m3 = ( $ 4 % 1000 ) ; print m1 " . " m2 " . " m3 } ' > conftest . output <nl> - TRI_PROTOBUF_VERSION = ` cat conftest . output ` <nl> - AC_MSG_RESULT ( [ $ TRI_PROTOBUF_VERSION ] ) <nl> - rm - f conftest * <nl> - <nl> - PROTOBUF_CPPFLAGS = " $ { PROTOBUF_CPPFLAGS } - DTRI_PROTOBUF_VERSION = ' \ " $ { TRI_PROTOBUF_VERSION } \ " ' " <nl> - <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - dnl restore flags <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - LIBS = " $ SAVE_LIBS " <nl> - LDFLAGS = " $ SAVE_LDFLAGS " <nl> - CPPFLAGS = " $ SAVE_CPPFLAGS " <nl> - <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - dnl add substitutions <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - AC_SUBST ( PROTOBUF_PROTOC ) <nl> - AC_SUBST ( PROTOBUF_CPPFLAGS ) <nl> - AC_SUBST ( PROTOBUF_LDFLAGS ) <nl> - AC_SUBST ( PROTOBUF_LIBS ) <nl> - <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - dnl informational output <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - LIB_INFO = " $ LIB_INFO | PROTOBUF : system version " <nl> - LIB_INFO = " $ LIB_INFO | PROTOBUF VERSION : $ { TRI_PROTOBUF_VERSION } " <nl> - LIB_INFO = " $ LIB_INFO | PROTOBUF COMPILER : $ { PROTOBUF_PROTOC } " <nl> - <nl> - LIB_INFO = " $ LIB_INFO | PROTOBUF_CPPFLAGS : $ { PROTOBUF_CPPFLAGS } " <nl> - LIB_INFO = " $ LIB_INFO | PROTOBUF_LDFLAGS : $ { PROTOBUF_LDFLAGS } " <nl> - LIB_INFO = " $ LIB_INFO | PROTOBUF_LIBS : $ { PROTOBUF_LIBS } " <nl> - <nl> - LIB_INFO = " $ LIB_INFO | . " <nl> - <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - dnl - - SECTION - - END - OF - FILE <nl> - dnl mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - dnl Local Variables : <nl> - dnl mode : outline - minor <nl> - dnl outline - regexp : " ^ \ \ ( dnl - - SECTION - - \ \ ) " <nl> - dnl End : <nl>
removed protocol buffers
arangodb/arangodb
f08a788f7cadfa0b9316e1b058599c15034a1923
2012-09-24T11:44:30Z
mmm a / test / mjsunit / mjsunit . status <nl> ppp b / test / mjsunit / mjsunit . status <nl> <nl> ' tzoffset - transition - new - york - noi18n ' : [ SKIP ] , <nl> ' tzoffset - seoul ' : [ SKIP ] , <nl> ' tzoffset - seoul - noi18n ' : [ SKIP ] , <nl> - <nl> - # Flaky OOM test BUG ( v8 : 9192 ) <nl> - ' regress / regress - 678917 ' : [ PASS , FAIL ] , <nl> } ] , # ' system = = windows ' <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl>
[ mjsunit ] Re - enabled regress - 678917 test on windows
v8/v8
eb540d533dde6a9376c1f38d2f556570d26f3108
2019-10-31T16:04:50Z
mmm a / html / admin / js / modules / statement - basics . js <nl> ppp b / html / admin / js / modules / statement - basics . js <nl> ArangoStatement . prototype . bind = function ( key , value ) { <nl> this . _bindVars = key ; <nl> } <nl> else if ( typeof ( key ) = = = " string " ) { <nl> - if ( this . _bindVars [ key ] ! = = undefined ) { <nl> - throw " redeclaration of bind parameter " ; <nl> - } <nl> - <nl> this . _bindVars [ key ] = value ; <nl> } <nl> else if ( typeof ( key ) = = = " number " ) { <nl> ArangoStatement . prototype . bind = function ( key , value ) { <nl> throw " invalid bind parameter declaration " ; <nl> } <nl> <nl> - if ( this . _bindVars [ strKey ] ! = = undefined ) { <nl> - throw " redeclaration of bind parameter " ; <nl> - } <nl> - <nl> this . _bindVars [ strKey ] = value ; <nl> } <nl> else { <nl>
adding derived js
arangodb/arangodb
d5cd3ee5d1955262e1d209f07469b6409b8f6842
2013-01-13T23:58:48Z
mmm a / tensorflow / compiler / mlir / xla / tests / legalize - tf - control - flow . mlir <nl> ppp b / tensorflow / compiler / mlir / xla / tests / legalize - tf - control - flow . mlir <nl> attributes { tf . _input_shapes = [ " tfshape $ " , " tfshape $ " ] } { <nl> } <nl> <nl> <nl> + / / CHECK - LABEL : @ ifRegion <nl> + / / CHECK - SAME : ( [ [ ARG0 : % . + ] ] : tensor < f32 > , [ [ ARG1 : % . + ] ] : tensor < f32 > ) <nl> + func @ ifRegion ( % arg0 : tensor < f32 > , % arg1 : tensor < f32 > ) - > ( tensor < f32 > ) { <nl> + / / CHECK : [ [ VAL0 : % . + ] ] = " mhlo . compare " ( [ [ ARG0 ] ] , [ [ ARG1 ] ] ) { comparison_direction = " GT " } <nl> + % 0 = " mhlo . compare " ( % arg0 , % arg1 ) { comparison_direction = " GT " } : ( tensor < f32 > , tensor < f32 > ) - > tensor < i1 > <nl> + / / CHECK : [ [ VAL1 : % . + ] ] = " mhlo . tuple " ( [ [ ARG0 ] ] ) <nl> + / / CHECK : [ [ VAL2 : % . + ] ] = " mhlo . tuple " ( [ [ ARG1 ] ] ) <nl> + / / CHECK : [ [ VAL3 : % . + ] ] = " mhlo . if " ( [ [ VAL0 ] ] , [ [ VAL1 ] ] , [ [ VAL2 ] ] ) ( { <nl> + % 1 = " tf . IfRegion " ( % 0 ) ( { <nl> + / / CHECK : ^ { { [ a - z0 - 9 ] + } } ( [ [ TRUE_ARG : % . + ] ] : tuple < tensor < f32 > > ) : <nl> + / / CHECK : [ [ VAL5 : % . + ] ] = " mhlo . get_tuple_element " ( [ [ TRUE_ARG ] ] ) { index = 0 : i32 } <nl> + / / CHECK : [ [ VAL6 : % . + ] ] = " mhlo . log " ( [ [ VAL5 ] ] ) <nl> + % 2 = " mhlo . log " ( % arg0 ) : ( tensor < f32 > ) - > tensor < f32 > <nl> + / / CHECK : [ [ VAL7 : % . + ] ] = " mhlo . tuple " ( [ [ VAL6 ] ] ) <nl> + / / CHECK : " mhlo . return " ( [ [ VAL7 ] ] ) <nl> + " tf . Yield " ( % 2 ) : ( tensor < f32 > ) - > ( ) <nl> + } , { <nl> + / / CHECK : ^ { { [ a - z0 - 9 ] + } } ( [ [ FALSE_ARG : % . + ] ] : tuple < tensor < f32 > > ) : <nl> + / / CHECK : [ [ VAL5 : % . + ] ] = " mhlo . get_tuple_element " ( [ [ FALSE_ARG ] ] ) { index = 0 : i32 } <nl> + / / CHECK : [ [ VAL6 : % . + ] ] = " mhlo . exponential " ( [ [ VAL5 ] ] ) <nl> + % 2 = " mhlo . exponential " ( % arg1 ) : ( tensor < f32 > ) - > tensor < f32 > <nl> + / / CHECK : [ [ VAL7 : % . + ] ] = " mhlo . tuple " ( [ [ VAL6 ] ] ) <nl> + / / CHECK : " mhlo . return " ( [ [ VAL7 ] ] ) <nl> + " tf . Yield " ( % 2 ) : ( tensor < f32 > ) - > ( ) <nl> + / / CHECK : } ) : ( tensor < i1 > , tuple < tensor < f32 > > , tuple < tensor < f32 > > ) - > tuple < tensor < f32 > > <nl> + } ) { is_stateless = true } : ( tensor < i1 > ) - > tensor < f32 > <nl> + / / CHECK : [ [ VAL4 : % . + ] ] = " mhlo . get_tuple_element " ( [ [ VAL3 ] ] ) { index = 0 : i32 } <nl> + / / CHECK : return [ [ VAL4 ] ] <nl> + return % 1 : tensor < f32 > <nl> + } <nl> + <nl> + <nl> / / CHECK - LABEL : func @ case <nl> / / CHECK - SAME : % [ [ BRANCH_INDEX : . * ] ] : tensor < i32 > , % [ [ ARG0 : . * ] ] : tensor < f32 > , % [ [ ARG1 : . * ] ] : tensor < f32 > ) - > ( tensor < f32 > , tensor < f32 > ) <nl> func @ case ( % index : tensor < i32 > , % arg0 : tensor < f32 > , % arg1 : tensor < f32 > ) - > ( tensor < f32 > , tensor < f32 > ) { <nl> mmm a / tensorflow / compiler / mlir / xla / transforms / legalize_tf_control_flow . cc <nl> ppp b / tensorflow / compiler / mlir / xla / transforms / legalize_tf_control_flow . cc <nl> void LowerIf ( TF : : IfOp op ) { <nl> SmallVector < Value , 3 > inputs ( op . input ( ) ) ; <nl> auto tuple_input = builder . create < mhlo : : TupleOp > ( loc , inputs ) ; <nl> <nl> - / / Create the new if op with tuple inputs . <nl> + / / Create the new ` mhlo . if ` op with tuple inputs . <nl> auto result_type = builder . getTupleType ( op . getResultTypes ( ) ) ; <nl> auto if_op = builder . create < mhlo : : IfOp > ( loc , result_type , op . cond ( ) , <nl> tuple_input , tuple_input ) ; <nl> void LowerIf ( TF : : IfOp op ) { <nl> ImportXlaRegion ( op . then_function ( ) , & if_op . true_branch ( ) , loc ) ; <nl> ImportXlaRegion ( op . else_function ( ) , & if_op . false_branch ( ) , loc ) ; <nl> <nl> - / / De - tuple the results of the xla hlo if result . <nl> + / / De - tuple the results of the ` mhlo . if ` . <nl> Detuple ( if_op . getResult ( ) , op . getResults ( ) , & builder ) ; <nl> op . erase ( ) ; <nl> } <nl> void LowerCase ( TF : : CaseOp op ) { <nl> / / Create replica of input tuple for each branch <nl> SmallVector < Value , 4 > n_tuple_inputs ( op . num_branches ( ) , tuple_input ) ; <nl> <nl> - / / Create the new case op with tuple inputs . <nl> + / / Create the new ` mhlo . case ` op with tuple inputs . <nl> auto case_op = <nl> builder . create < mhlo : : CaseOp > ( loc , op . getResultTypes ( ) , op . branch_index ( ) , <nl> n_tuple_inputs , op . branches ( ) . size ( ) ) ; <nl> void LowerWhile ( TF : : WhileOp op ) { <nl> builder . setInsertionPoint ( op ) ; <nl> Value tuple_input = builder . create < mhlo : : TupleOp > ( loc , inputs ) ; <nl> <nl> - / / Create the new while op with tuple inputs . <nl> + / / Create the new ` mhlo . while ` op with tuple inputs . <nl> auto while_op = builder . create < mhlo : : WhileOp > ( <nl> loc , builder . getTupleType ( op . getResultTypes ( ) ) , tuple_input ) ; <nl> <nl> void LowerWhile ( TF : : WhileOp op ) { <nl> ImportXlaRegion ( op . cond_function ( ) , & while_op . cond ( ) , loc , <nl> / * tuple_return = * / false ) ; <nl> <nl> - / / De - tuple the results of the xla hlo while . <nl> + / / De - tuple the results of the ` mhlo . while ` . <nl> Detuple ( while_op . getResult ( ) , op . getResults ( ) , & builder ) ; <nl> op . erase ( ) ; <nl> } <nl> void ReplaceBlockArgs ( Block * block , Type tuple_type , OpBuilder * builder ) { <nl> block - > eraseArgument ( i ) ; <nl> } <nl> <nl> - / / Finds and replaces implicitly captured value uses with tuple block argument . <nl> + / / Replaces implicitly captured value uses with tuple block argument . <nl> / / get_tuple_element ' s are created to extract specific values . Values from <nl> / / get_tuple_element ' s are returned in the order of ` implicit_inputs ` . <nl> llvm : : SmallVector < Value , 4 > ReplaceImplicitInputs ( <nl> llvm : : SmallVector < Value , 4 > ReplaceImplicitInputs ( <nl> return implicit_input_elements ; <nl> } <nl> <nl> + / / Finds and replaces implicitly captured value uses with tuple block argument . <nl> + / / A tuple of implicitly captured values is also created and returned , for use <nl> + / / as an operand to the associated mhlo control flow op . <nl> + Value TupleImplicitInputs ( Region & region , Location loc , OpBuilder * builder ) { <nl> + llvm : : SetVector < Value > implicit_inputs ; <nl> + getUsedValuesDefinedAbove ( region , region , implicit_inputs ) ; <nl> + llvm : : ArrayRef < Value > implicit_inputs_ref = implicit_inputs . getArrayRef ( ) ; <nl> + Value tuple_input = builder - > create < mhlo : : TupleOp > ( loc , implicit_inputs_ref ) ; <nl> + Block & block = region . front ( ) ; <nl> + / / ` tf . CaseRegion ` / ` tf . IfRegion ` are expected to have no block arguments and <nl> + / / instead all inputs used by their branch regions are implicitly captured <nl> + / / from above . <nl> + assert ( block . getNumArguments ( ) = = 0 ) ; <nl> + block . addArgument ( tuple_input . getType ( ) ) ; <nl> + builder - > setInsertionPointToStart ( & block ) ; <nl> + ReplaceImplicitInputs ( & block , / * offset = * / 0 , implicit_inputs_ref , builder ) ; <nl> + return tuple_input ; <nl> + } <nl> + <nl> / / Replaces block terminator ( tf . Yield ) with ` mhlo . return ` . Additional results <nl> / / can be returned if ` extra_results ` is not empty . If ` tuple_return ` is <nl> / / set , a tuple of the return values will be set as the terminator operand . <nl> void ReplaceTerminator ( Block * block , ArrayRef < Value > extra_results , <nl> terminator - > erase ( ) ; <nl> } <nl> <nl> + void LowerIfRegion ( TF : : IfRegionOp op ) { <nl> + Location loc = op . getLoc ( ) ; <nl> + OpBuilder builder ( op ) ; <nl> + <nl> + / / Tuple implicit inputs per region and update terminators to return tuples . <nl> + builder . setInsertionPoint ( op ) ; <nl> + Value then_input = TupleImplicitInputs ( op . then_branch ( ) , loc , & builder ) ; <nl> + ReplaceTerminator ( & op . then_branch ( ) . front ( ) , / * extra_results = * / { } , & builder ) ; <nl> + <nl> + builder . setInsertionPoint ( op ) ; <nl> + Value else_input = TupleImplicitInputs ( op . else_branch ( ) , loc , & builder ) ; <nl> + ReplaceTerminator ( & op . else_branch ( ) . front ( ) , / * extra_results = * / { } , & builder ) ; <nl> + <nl> + / / Create the new ` mhlo . if ` op with tuple inputs and take ownership of regions <nl> + / / from ` tf . IfRegion ` op . <nl> + builder . setInsertionPoint ( op ) ; <nl> + auto result_type = builder . getTupleType ( op . getResultTypes ( ) ) ; <nl> + auto if_op = builder . create < mhlo : : IfOp > ( loc , result_type , op . cond ( ) , <nl> + then_input , else_input ) ; <nl> + if_op . true_branch ( ) . takeBody ( op . then_branch ( ) ) ; <nl> + if_op . false_branch ( ) . takeBody ( op . else_branch ( ) ) ; <nl> + <nl> + / / De - tuple the results of the ` mhlo . if ` . <nl> + Detuple ( if_op . getResult ( ) , op . getResults ( ) , & builder ) ; <nl> + op . erase ( ) ; <nl> + } <nl> + <nl> void LowerWhileRegion ( TF : : WhileRegionOp op ) { <nl> Location loc = op . getLoc ( ) ; <nl> OpBuilder builder ( op ) ; <nl> void LowerWhileRegion ( TF : : WhileRegionOp op ) { <nl> builder . setInsertionPoint ( op ) ; <nl> Value tuple_input = builder . create < mhlo : : TupleOp > ( loc , inputs ) ; <nl> <nl> - / / Create the new while op with tuple inputs . Implicit inputs are also <nl> + / / Create the new ` mhlo . while ` op with tuple inputs . Implicit inputs are also <nl> / / returned . <nl> auto while_result_types = llvm : : to_vector < 4 > ( op . getResultTypes ( ) ) ; <nl> while_result_types . reserve ( while_result_types . size ( ) + <nl> void LowerWhileRegion ( TF : : WhileRegionOp op ) { <nl> auto while_op = builder . create < mhlo : : WhileOp > ( <nl> loc , builder . getTupleType ( while_result_types ) , tuple_input ) ; <nl> <nl> - / / Rewrite cond and associated block arguments and terminator . <nl> + / / Rewrite cond and associated block arguments and terminator . Ownership of <nl> + / / cond region is transfered over from ` tf . WhileRegion ` to ` mhlo . while ` . <nl> Region & cond = while_op . cond ( ) ; <nl> cond . takeBody ( op . cond ( ) ) ; <nl> Block & cond_block = cond . front ( ) ; <nl> void LowerWhileRegion ( TF : : WhileRegionOp op ) { <nl> ReplaceTerminator ( & cond_block , / * extra_results = * / { } , & builder , <nl> / * tuple_return = * / false ) ; <nl> <nl> - / / Rewrite body and associated block arguments and terminator . <nl> + / / Rewrite body and associated block arguments and terminator . Ownership of <nl> + / / body region is transfered over from ` tf . WhileRegion ` to ` mhlo . while ` . <nl> Region & body = while_op . body ( ) ; <nl> body . takeBody ( op . body ( ) ) ; <nl> Block & body_block = body . front ( ) ; <nl> void LowerWhileRegion ( TF : : WhileRegionOp op ) { <nl> & body_block , inputs_size , implicit_inputs . getArrayRef ( ) , & builder ) ; <nl> ReplaceTerminator ( & body_block , implicit_input_elements , & builder ) ; <nl> <nl> - / / De - tuple the results of the xla hlo while . <nl> + / / De - tuple the results of the ` mhlo . while ` . <nl> builder . setInsertionPoint ( op ) ; <nl> Detuple ( while_op . getResult ( ) , op . getResults ( ) , & builder ) ; <nl> op . erase ( ) ; <nl> void LegalizeTFControlFlow : : runOnOperation ( ) { <nl> LowerIf ( if_op ) ; <nl> return ; <nl> } <nl> + if ( auto if_region_op = dyn_cast < TF : : IfRegionOp > ( op ) ) { <nl> + LowerIfRegion ( if_region_op ) ; <nl> + return ; <nl> + } <nl> if ( auto case_op = dyn_cast < TF : : CaseOp > ( op ) ) { <nl> LowerCase ( case_op ) ; <nl> return ; <nl>
Add support for tf . IfRegion in LegalizeTFControlFlow pass .
tensorflow/tensorflow
42483c9b4ce71aaedfe095980f8cbd213d06e467
2020-09-22T18:16:49Z
mmm a / cocos / ui / UILoadingBar . cpp <nl> ppp b / cocos / ui / UILoadingBar . cpp <nl> void LoadingBar : : setPercent ( float percent ) <nl> } <nl> } <nl> <nl> - float LoadingBar : : getPercent ( ) <nl> + float LoadingBar : : getPercent ( ) const <nl> { <nl> return _percent ; <nl> } <nl> mmm a / cocos / ui / UILoadingBar . h <nl> ppp b / cocos / ui / UILoadingBar . h <nl> class LoadingBar : public Widget <nl> * <nl> * @ return percent percent value from 1 to 100 . <nl> * / <nl> - float getPercent ( ) ; <nl> + float getPercent ( ) const ; <nl> <nl> / * * <nl> * Sets if loadingbar is using scale9 renderer . <nl>
closed , add const to getPercent method
cocos2d/cocos2d-x
7049fd253d5a05a4803c760d09f2254fb2227b0e
2014-05-13T04:06:28Z
new file mode 100644 <nl> index 0000000000 . . 6c4191d551 <nl> mmm / dev / null <nl> ppp b / . gitmodules <nl> <nl> + [ submodule " third_party / uncrustify " ] <nl> + path = third_party / uncrustify <nl> + url = https : / / github . com / uncrustify / uncrustify . git <nl> + branch = uncrustify - 0 . 66 . 1 <nl> mmm a / build_cpp . sh <nl> ppp b / build_cpp . sh <nl> <nl> + cwd = $ ( pwd ) <nl> + <nl> make - f generate_dependencies . make <nl> make - f testing . make <nl> + <nl> + cd scripts <nl> + . / cpp_coding_style_checker . sh | | exit 1 <nl> + cd $ cwd <nl> mmm a / generate_dependencies . make <nl> ppp b / generate_dependencies . make <nl> G + + FLAGS = - Wall - std = c + + 11 <nl> <nl> <nl> # warning : the ' ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ' cannot be used in file - name <nl> + COSMOS_ROOT_PATH : = $ ( shell dirname $ ( realpath $ ( lastword $ ( MAKEFILE_LIST ) ) ) ) <nl> RECOVER - NAME = $ ( subst ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ , \ , $ ( strip $ 1 ) ) <nl> RECOVER - NAME2 = $ ( subst ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ , \ \ \ , $ ( strip $ 1 ) ) <nl> CONVERT - CPP - TO - DEPENDENCY - NAME = $ ( subst . cpp , . d , $ ( 1 ) ) <nl> CONVERT - DEPENDENCY - TO - CPP - NAME = $ ( subst . d , . cpp , $ ( 1 ) ) <nl> - FIND - CPP - TESTS = $ ( shell find - name ' test_ * . cpp ' | sed ' s : : ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ : g ' ) <nl> + FIND - CPP - TESTS = $ ( shell find " $ ( COSMOS_ROOT_PATH ) / code / " - name " test_ * . cpp " | sed ' s : : ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ : g ' ) <nl> FIND - CPP - SOURCES = $ ( filter - out $ ( cpp_tests ) , $ ( cpp_all_files ) ) <nl> - FIND - CPP - TEST - DEPENDENCIES = $ ( shell find - name ' test_ * . d ' | sed ' s : : ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ : g ' ) <nl> + FIND - CPP - TEST - DEPENDENCIES = $ ( shell find " $ ( COSMOS_ROOT_PATH ) / code / " - name " test_ * . d " | sed ' s : : ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ : g ' ) <nl> FIND - CPP - SOURCE - DEPENDENCIES = $ ( filter - out $ ( cpp_test_dependencies ) , $ ( cpp_all_dependencies ) ) <nl> <nl> <nl> - cpp_all_files = $ ( shell find - name ' * . cpp ' | sed ' s : : ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ : g ' ) <nl> + cpp_all_files = $ ( shell find " $ ( COSMOS_ROOT_PATH ) / code / " - name " * . cpp " | sed ' s : : ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ : g ' ) <nl> cpp_tests = $ ( call FIND - CPP - TESTS ) <nl> cpp_sources = $ ( call FIND - CPP - SOURCES ) <nl> <nl> generate_dependency : <nl> \ r # # # # # # # # # # # # # # # # # # # # # # # # # # # # " <nl> <nl> <nl> - cpp_all_dependencies = $ ( shell find - name ' * . d ' | sed ' s : : ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ : g ' ) <nl> + cpp_all_dependencies = $ ( shell find " $ ( COSMOS_ROOT_PATH ) / code / " - name " * . d " | sed ' s : : ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ : g ' ) <nl> cpp_test_dependencies = $ ( call FIND - CPP - TEST - DEPENDENCIES ) <nl> cpp_source_dependencies = $ ( call FIND - CPP - SOURCE - DEPENDENCIES ) <nl> <nl> new file mode 100755 <nl> index 0000000000 . . cae584bc5b <nl> mmm / dev / null <nl> ppp b / scripts / cpp_coding_style_checker . sh <nl> <nl> + cwd = $ ( pwd ) <nl> + cosmos_root_path = " $ ( cd " $ ( dirname " $ { BASH_SOURCE [ 0 ] } " ) " ; pwd - P ) / . . " <nl> + <nl> + error_times = 0 <nl> + <nl> + uncrustify_root_path = " $ cosmos_root_path / third_party / uncrustify " <nl> + uncrustify = " $ uncrustify_root_path / build / uncrustify " <nl> + uncrustify_config_path = " $ uncrustify_root_path / . . / uncrustify . cfg " <nl> + <nl> + echo <nl> + echo " # # # # # # # # # # # # # # # # # # # # # # # # # # # " <nl> + echo " # Building uncrustify . . . # " <nl> + echo " # # # # # # # # # # # # # # # # # # # # # # # # # # # " <nl> + rm - rf $ uncrustify_root_path / build <nl> + mkdir $ uncrustify_root_path / build <nl> + cd $ uncrustify_root_path / build <nl> + cmake . . <nl> + cmake - - build . <nl> + <nl> + cd " $ cosmos_root_path / code " <nl> + <nl> + echo <nl> + echo " # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # " <nl> + echo " # Creating files for diff . . . # " <nl> + echo " # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # " <nl> + for cpp_file in ` find - name ' * . cpp ' ` <nl> + do <nl> + # remove the output file if existed to prevent ` uncrustify ` is not override it <nl> + if [ - f " $ cpp_file . uncrustify " ] ; then <nl> + rm - f $ cpp_file . uncrustify <nl> + fi ; <nl> + <nl> + $ uncrustify - c $ uncrustify_config_path $ cpp_file <nl> + done <nl> + <nl> + echo <nl> + echo " # # # # # # # # # # # # # # # # # # " <nl> + echo " # Diff files . . . # " <nl> + echo " # # # # # # # # # # # # # # # # # # " <nl> + for cpp_file in ` find - name ' * . cpp ' ` <nl> + do <nl> + d = $ ( diff $ cpp_file $ cpp_file . uncrustify ) <nl> + <nl> + if [ " $ d " ! = " " ] ; then <nl> + echo " # The \ ` $ cpp_file \ ` is not passed " <nl> + # echo <nl> + # echo " diff $ cpp_file $ cpp_file . uncrustify " <nl> + # echo <nl> + # echo " $ d " <nl> + # echo <nl> + error_times = $ ( ( $ error_times + 1 ) ) <nl> + fi ; <nl> + done <nl> + <nl> + cd " $ cwd " <nl> + <nl> + if [ $ error_times ! = 0 ] ; then <nl> + echo " $ error_times error ( s ) generated . " <nl> + exit 1 <nl> + else <nl> + echo " Done . \ ` checking coding style in c + + script \ ` exited with 0 . " <nl> + fi ; <nl> mmm a / testing . make <nl> ppp b / testing . make <nl> all : $ ( files_o ) ; <nl> # include dependent targets <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> <nl> - dependencies = $ ( shell find - name ' * . d ' | sed ' s : : \ \ : g ' ) <nl> + COSMOS_ROOT_PATH : = $ ( shell dirname $ ( realpath $ ( lastword $ ( MAKEFILE_LIST ) ) ) ) <nl> + dependencies = $ ( shell find " $ ( COSMOS_ROOT_PATH ) / code / " - name " * . d " | sed ' s : : \ \ : g ' ) <nl> include $ ( dependencies ) <nl> new file mode 160000 <nl> index 0000000000 . . a9e70a5d49 <nl> mmm / dev / null <nl> ppp b / third_party / uncrustify <nl> @ @ - 0 , 0 + 1 @ @ <nl> + Subproject commit a9e70a5d493df315cb8635d3acbad085c863c7d3 <nl> new file mode 100644 <nl> index 0000000000 . . cc7956ba12 <nl> mmm / dev / null <nl> ppp b / third_party / uncrustify . cfg <nl> <nl> + # Uncrustify - 0 . 66 . 1 <nl> + <nl> + # <nl> + # General options <nl> + # <nl> + <nl> + # The type of line endings . Default = Auto . <nl> + newlines = auto # auto / lf / crlf / cr <nl> + <nl> + # The original size of tabs in the input . Default = 8 . <nl> + input_tab_size = 8 # unsigned number <nl> + <nl> + # The size of tabs in the output ( only used if align_with_tabs = true ) . Default = 8 . <nl> + output_tab_size = 8 # unsigned number <nl> + <nl> + # The ASCII value of the string escape char , usually 92 ( \ ) or 94 ( ^ ) . ( Pawn ) . <nl> + string_escape_char = 92 # unsigned number <nl> + <nl> + # Alternate string escape char for Pawn . Only works right before the quote char . <nl> + string_escape_char2 = 0 # unsigned number <nl> + <nl> + # Replace tab characters found in string literals with the escape sequence \ t instead . <nl> + string_replace_tab_chars = false # false / true <nl> + <nl> + # Allow interpreting ' > = ' and ' > > = ' as part of a template in ' void f ( list < list < B > > = val ) ; ' . <nl> + # If True , ' assert ( x < 0 & & y > = 3 ) ' will be broken . Default = False <nl> + # Improvements to template detection may make this option obsolete . <nl> + tok_split_gte = false # false / true <nl> + <nl> + # Override the default ' * INDENT - OFF * ' in comments for disabling processing of part of the file . <nl> + disable_processing_cmt = " " # string <nl> + <nl> + # Override the default ' * INDENT - ON * ' in comments for enabling processing of part of the file . <nl> + enable_processing_cmt = " " # string <nl> + <nl> + # Enable parsing of digraphs . Default = False . <nl> + enable_digraphs = false # false / true <nl> + <nl> + # Control what to do with the UTF - 8 BOM ( recommend ' remove ' ) . <nl> + utf8_bom = ignore # ignore / add / remove / force <nl> + <nl> + # If the file contains bytes with values between 128 and 255 , but is not UTF - 8 , then output as UTF - 8 . <nl> + utf8_byte = false # false / true <nl> + <nl> + # Force the output encoding to UTF - 8 . <nl> + utf8_force = false # false / true <nl> + <nl> + # <nl> + # Spacing options <nl> + # <nl> + <nl> + # Add or remove space around arithmetic operator ' + ' , ' - ' , ' / ' , ' * ' , etc <nl> + # also ' > > > ' ' < < ' ' > > ' ' % ' ' | ' . <nl> + sp_arith = force # ignore / add / remove / force <nl> + <nl> + # Add or remove space around arithmetic operator ' + ' and ' - ' . Overrides sp_arith <nl> + sp_arith_additive = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space around assignment operator ' = ' , ' + = ' , etc . <nl> + sp_assign = force # ignore / add / remove / force <nl> + <nl> + # Add or remove space around ' = ' in C + + 11 lambda capture specifications . Overrides sp_assign . <nl> + sp_cpp_lambda_assign = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the capture specification in C + + 11 lambda . <nl> + sp_cpp_lambda_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space around assignment operator ' = ' in a prototype . <nl> + sp_assign_default = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before assignment operator ' = ' , ' + = ' , etc . Overrides sp_assign . <nl> + sp_before_assign = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after assignment operator ' = ' , ' + = ' , etc . Overrides sp_assign . <nl> + sp_after_assign = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space in ' NS_ENUM ( ' . <nl> + sp_enum_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space around assignment ' = ' in enum . <nl> + sp_enum_assign = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before assignment ' = ' in enum . Overrides sp_enum_assign . <nl> + sp_enum_before_assign = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after assignment ' = ' in enum . Overrides sp_enum_assign . <nl> + sp_enum_after_assign = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space around assignment ' : ' in enum . <nl> + sp_enum_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space around preprocessor ' # # ' concatenation operator . Default = Add . <nl> + sp_pp_concat = add # ignore / add / remove / force <nl> + <nl> + # Add or remove space after preprocessor ' # ' stringify operator . Also affects the ' # @ ' charizing operator . <nl> + sp_pp_stringify = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before preprocessor ' # ' stringify operator as in ' # define x ( y ) L # y ' . <nl> + sp_before_pp_stringify = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space around boolean operators ' & & ' and ' | | ' . <nl> + sp_bool = force # ignore / add / remove / force <nl> + <nl> + # Add or remove space around compare operator ' < ' , ' > ' , ' = = ' , etc . <nl> + sp_compare = force # ignore / add / remove / force <nl> + <nl> + # Add or remove space inside ' ( ' and ' ) ' . <nl> + sp_inside_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between nested parens : ' ( ( ' vs ' ) ) ' . <nl> + sp_paren_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between back - to - back parens : ' ) ( ' vs ' ) ( ' . <nl> + sp_cparen_oparen = ignore # ignore / add / remove / force <nl> + <nl> + # Whether to balance spaces inside nested parens . <nl> + sp_balance_nested_parens = false # false / true <nl> + <nl> + # Add or remove space between ' ) ' and ' { ' . <nl> + sp_paren_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before pointer star ' * ' . <nl> + sp_before_ptr_star = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before pointer star ' * ' that isn ' t followed by a variable name <nl> + # If set to ' ignore ' , sp_before_ptr_star is used instead . <nl> + sp_before_unnamed_ptr_star = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between pointer stars ' * ' . <nl> + sp_between_ptr_star = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after pointer star ' * ' , if followed by a word . <nl> + sp_after_ptr_star = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after pointer star ' * ' , if followed by a qualifier . <nl> + sp_after_ptr_star_qualifier = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after a pointer star ' * ' , if followed by a func proto / def . <nl> + sp_after_ptr_star_func = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after a pointer star ' * ' , if followed by an open paren ( function types ) . <nl> + sp_ptr_star_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before a pointer star ' * ' , if followed by a func proto / def . <nl> + sp_before_ptr_star_func = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before a reference sign ' & ' . <nl> + sp_before_byref = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before a reference sign ' & ' that isn ' t followed by a variable name . <nl> + # If set to ' ignore ' , sp_before_byref is used instead . <nl> + sp_before_unnamed_byref = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after reference sign ' & ' , if followed by a word . <nl> + sp_after_byref = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after a reference sign ' & ' , if followed by a func proto / def . <nl> + sp_after_byref_func = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before a reference sign ' & ' , if followed by a func proto / def . <nl> + sp_before_byref_func = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between type and word . Default = Force . <nl> + sp_after_type = force # ignore / add / remove / force <nl> + <nl> + # Add or remove space before the paren in the D constructs ' template Foo ( ' and ' class Foo ( ' . <nl> + sp_before_template_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space in ' template < ' vs ' template < ' . <nl> + # If set to ignore , sp_before_angle is used . <nl> + sp_template_angle = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before ' < > ' . <nl> + sp_before_angle = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space inside ' < ' and ' > ' . <nl> + sp_inside_angle = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' < > ' and ' : ' . <nl> + sp_angle_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after ' < > ' . <nl> + sp_after_angle = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' < > ' and ' ( ' as found in ' new List < byte > ( foo ) ; ' . <nl> + sp_angle_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' < > ' and ' ( ) ' as found in ' new List < byte > ( ) ; ' . <nl> + sp_angle_paren_empty = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' < > ' and a word as in ' List < byte > m ; ' or ' template < typename T > static . . . ' . <nl> + sp_angle_word = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' > ' and ' > ' in ' > > ' ( template stuff C + + / C # only ) . Default = Add . <nl> + sp_angle_shift = add # ignore / add / remove / force <nl> + <nl> + # Permit removal of the space between ' > > ' in ' foo < bar < int > > ' ( C + + 11 only ) . Default = False . <nl> + # sp_angle_shift cannot remove the space without this option . <nl> + sp_permit_cpp11_shift = false # false / true <nl> + <nl> + # Add or remove space before ' ( ' of ' if ' , ' for ' , ' switch ' , ' while ' , etc . <nl> + sp_before_sparen = force # ignore / add / remove / force <nl> + <nl> + # Add or remove space inside if - condition ' ( ' and ' ) ' . <nl> + sp_inside_sparen = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space before if - condition ' ) ' . Overrides sp_inside_sparen . <nl> + sp_inside_sparen_close = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space after if - condition ' ( ' . Overrides sp_inside_sparen . <nl> + sp_inside_sparen_open = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after ' ) ' of ' if ' , ' for ' , ' switch ' , and ' while ' , etc . <nl> + sp_after_sparen = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' ) ' and ' { ' of ' if ' , ' for ' , ' switch ' , and ' while ' , etc . <nl> + sp_sparen_brace = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' invariant ' and ' ( ' in the D language . <nl> + sp_invariant_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the ' ) ' in ' invariant ( C ) c ' in the D language . <nl> + sp_after_invariant_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before empty statement ' ; ' on ' if ' , ' for ' and ' while ' . <nl> + sp_special_semi = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before ' ; ' . Default = Remove . <nl> + sp_before_semi = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space before ' ; ' in non - empty ' for ' statements . <nl> + sp_before_semi_for = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before a semicolon of an empty part of a for statement . <nl> + sp_before_semi_for_empty = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after ' ; ' , except when followed by a comment . Default = Add . <nl> + sp_after_semi = add # ignore / add / remove / force <nl> + <nl> + # Add or remove space after ' ; ' in non - empty ' for ' statements . Default = Force . <nl> + sp_after_semi_for = force # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the final semicolon of an empty part of a for statement : for ( ; ; < here > ) . <nl> + sp_after_semi_for_empty = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before ' [ ' ( except ' [ ] ' ) . <nl> + sp_before_square = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before ' [ ] ' . <nl> + sp_before_squares = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space inside a non - empty ' [ ' and ' ] ' . <nl> + sp_inside_square = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after ' , ' , ' a , b ' vs ' a , b ' . <nl> + sp_after_comma = force # ignore / add / remove / force <nl> + <nl> + # Add or remove space before ' , ' . Default = Remove . <nl> + sp_before_comma = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' , ' and ' ] ' in multidimensional array type ' int [ , , ] ' . Only for C # . <nl> + sp_after_mdatype_commas = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' [ ' and ' , ' in multidimensional array type ' int [ , , ] ' . Only for C # . <nl> + sp_before_mdatype_commas = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' , ' in multidimensional array type ' int [ , , ] ' . Only for C # . <nl> + sp_between_mdatype_commas = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between an open paren and comma : ' ( , ' vs ' ( , ' . Default = Force . <nl> + sp_paren_comma = force # ignore / add / remove / force <nl> + <nl> + # Add or remove space before the variadic ' . . . ' when preceded by a non - punctuator . <nl> + sp_before_ellipsis = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after class ' : ' . <nl> + sp_after_class_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before class ' : ' . <nl> + sp_before_class_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after class constructor ' : ' . <nl> + sp_after_constr_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before class constructor ' : ' . <nl> + sp_before_constr_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before case ' : ' . Default = Remove . <nl> + sp_before_case_colon = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' operator ' and operator sign . <nl> + sp_after_operator = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between the operator symbol and the open paren , as in ' operator + + ( ' . <nl> + sp_after_operator_sym = ignore # ignore / add / remove / force <nl> + <nl> + # Overrides sp_after_operator_sym when the operator has no arguments , as in ' operator * ( ) ' . <nl> + sp_after_operator_sym_empty = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after C / D cast , i . e . ' cast ( int ) a ' vs ' cast ( int ) a ' or ' ( int ) a ' vs ' ( int ) a ' . <nl> + sp_after_cast = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove spaces inside cast parens . <nl> + sp_inside_paren_cast = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between the type and open paren in a C + + cast , i . e . ' int ( exp ) ' vs ' int ( exp ) ' . <nl> + sp_cpp_cast_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' sizeof ' and ' ( ' . <nl> + sp_sizeof_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the tag keyword ( Pawn ) . <nl> + sp_after_tag = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space inside enum ' { ' and ' } ' . <nl> + sp_inside_braces_enum = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space inside struct / union ' { ' and ' } ' . <nl> + sp_inside_braces_struct = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after open brace in an unnamed temporary direct - list - initialization . <nl> + sp_after_type_brace_init_lst_open = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before close brace in an unnamed temporary direct - list - initialization . <nl> + sp_before_type_brace_init_lst_close = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space inside an unnamed temporary direct - list - initialization . <nl> + sp_inside_type_brace_init_lst = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space inside ' { ' and ' } ' . <nl> + sp_inside_braces = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space inside ' { } ' . <nl> + sp_inside_braces_empty = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space between return type and function name <nl> + # A minimum of 1 is forced except for pointer return types . <nl> + sp_type_func = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between type and open brace of an unnamed temporary direct - list - initialization . <nl> + sp_type_brace_init_lst = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between function name and ' ( ' on function declaration . <nl> + sp_func_proto_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between function name and ' ( ) ' on function declaration without parameters . <nl> + sp_func_proto_paren_empty = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between function name and ' ( ' on function definition . <nl> + sp_func_def_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between function name and ' ( ) ' on function definition without parameters . <nl> + sp_func_def_paren_empty = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space inside empty function ' ( ) ' . <nl> + sp_inside_fparens = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space inside function ' ( ' and ' ) ' . <nl> + sp_inside_fparen = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space inside the first parens in the function type : ' void ( * x ) ( . . . ) ' . <nl> + sp_inside_tparen = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove between the parens in the function type : ' void ( * x ) ( . . . ) ' . <nl> + sp_after_tparen_close = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' ] ' and ' ( ' when part of a function call . <nl> + sp_square_fparen = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' ) ' and ' { ' of function . <nl> + sp_fparen_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Java : Add or remove space between ' ) ' and ' { { ' of double brace initializer . <nl> + sp_fparen_dbrace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between function name and ' ( ' on function calls . <nl> + sp_func_call_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between function name and ' ( ) ' on function calls without parameters . <nl> + # If set to ' ignore ' ( the default ) , sp_func_call_paren is used . <nl> + sp_func_call_paren_empty = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between the user function name and ' ( ' on function calls <nl> + # You need to set a keyword to be a user function , like this : ' set func_call_user _ ' in the config file . <nl> + sp_func_call_user_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between a constructor / destructor and the open paren . <nl> + sp_func_class_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between a constructor without parameters or destructor and ' ( ) ' . <nl> + sp_func_class_paren_empty = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' return ' and ' ( ' . <nl> + sp_return_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' __attribute__ ' and ' ( ' . <nl> + sp_attribute_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' defined ' and ' ( ' in ' # if defined ( FOO ) ' . <nl> + sp_defined_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' throw ' and ' ( ' in ' throw ( something ) ' . <nl> + sp_throw_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' throw ' and anything other than ' ( ' as in ' @ throw [ . . . ] ; ' . <nl> + sp_after_throw = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' catch ' and ' ( ' in ' catch ( something ) { } ' <nl> + # If set to ignore , sp_before_sparen is used . <nl> + sp_catch_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' version ' and ' ( ' in ' version ( something ) { } ' ( D language ) <nl> + # If set to ignore , sp_before_sparen is used . <nl> + sp_version_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' scope ' and ' ( ' in ' scope ( something ) { } ' ( D language ) <nl> + # If set to ignore , sp_before_sparen is used . <nl> + sp_scope_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' super ' and ' ( ' in ' super ( something ) ' . Default = Remove . <nl> + sp_super_paren = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' this ' and ' ( ' in ' this ( something ) ' . Default = Remove . <nl> + sp_this_paren = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space between macro and value . <nl> + sp_macro = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between macro function ' ) ' and value . <nl> + sp_macro_func = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' else ' and ' { ' if on the same line . <nl> + sp_else_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' } ' and ' else ' if on the same line . <nl> + sp_brace_else = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' } ' and the name of a typedef on the same line . <nl> + sp_brace_typedef = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' catch ' and ' { ' if on the same line . <nl> + sp_catch_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' } ' and ' catch ' if on the same line . <nl> + sp_brace_catch = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' finally ' and ' { ' if on the same line . <nl> + sp_finally_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' } ' and ' finally ' if on the same line . <nl> + sp_brace_finally = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' try ' and ' { ' if on the same line . <nl> + sp_try_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between get / set and ' { ' if on the same line . <nl> + sp_getset_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between a variable and ' { ' for C + + uniform initialization . Default = Add . <nl> + sp_word_brace = add # ignore / add / remove / force <nl> + <nl> + # Add or remove space between a variable and ' { ' for a namespace . Default = Add . <nl> + sp_word_brace_ns = add # ignore / add / remove / force <nl> + <nl> + # Add or remove space before the ' : : ' operator . <nl> + sp_before_dc = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the ' : : ' operator . <nl> + sp_after_dc = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove around the D named array initializer ' : ' operator . <nl> + sp_d_array_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the ' ! ' ( not ) operator . Default = Remove . <nl> + sp_not = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the ' ~ ' ( invert ) operator . Default = Remove . <nl> + sp_inv = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the ' & ' ( address - of ) operator . Default = Remove <nl> + # This does not affect the spacing after a ' & ' that is part of a type . <nl> + sp_addr = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space around the ' . ' or ' - > ' operators . Default = Remove . <nl> + sp_member = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the ' * ' ( dereference ) operator . Default = Remove <nl> + # This does not affect the spacing after a ' * ' that is part of a type . <nl> + sp_deref = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space after ' + ' or ' - ' , as in ' x = - 5 ' or ' y = + 7 ' . Default = Remove . <nl> + sp_sign = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space before or after ' + + ' and ' - - ' , as in ' ( - - x ) ' or ' y + + ; ' . Default = Remove . <nl> + sp_incdec = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove space before a backslash - newline at the end of a line . Default = Add . <nl> + sp_before_nl_cont = add # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the scope ' + ' or ' - ' , as in ' - ( void ) foo ; ' or ' + ( int ) bar ; ' . <nl> + sp_after_oc_scope = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the colon in message specs <nl> + # ' - ( int ) f : ( int ) x ; ' vs ' - ( int ) f : ( int ) x ; ' . <nl> + sp_after_oc_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before the colon in message specs <nl> + # ' - ( int ) f : ( int ) x ; ' vs ' - ( int ) f : ( int ) x ; ' . <nl> + sp_before_oc_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the colon in immutable dictionary expression <nl> + # ' NSDictionary * test = @ { @ " foo " : @ " bar " } ; ' . <nl> + sp_after_oc_dict_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before the colon in immutable dictionary expression <nl> + # ' NSDictionary * test = @ { @ " foo " : @ " bar " } ; ' . <nl> + sp_before_oc_dict_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the colon in message specs <nl> + # ' [ object setValue : 1 ] ; ' vs ' [ object setValue : 1 ] ; ' . <nl> + sp_after_send_oc_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before the colon in message specs <nl> + # ' [ object setValue : 1 ] ; ' vs ' [ object setValue : 1 ] ; ' . <nl> + sp_before_send_oc_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the ( type ) in message specs <nl> + # ' - ( int ) f : ( int ) x ; ' vs ' - ( int ) f : ( int ) x ; ' . <nl> + sp_after_oc_type = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the first ( type ) in message specs <nl> + # ' - ( int ) f : ( int ) x ; ' vs ' - ( int ) f : ( int ) x ; ' . <nl> + sp_after_oc_return_type = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' @ selector ' and ' ( ' <nl> + # ' @ selector ( msgName ) ' vs ' @ selector ( msgName ) ' <nl> + # Also applies to @ protocol ( ) constructs . <nl> + sp_after_oc_at_sel = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between ' @ selector ( x ) ' and the following word <nl> + # ' @ selector ( foo ) a : ' vs ' @ selector ( foo ) a : ' . <nl> + sp_after_oc_at_sel_parens = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space inside ' @ selector ' parens <nl> + # ' @ selector ( foo ) ' vs ' @ selector ( foo ) ' <nl> + # Also applies to @ protocol ( ) constructs . <nl> + sp_inside_oc_at_sel_parens = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before a block pointer caret <nl> + # ' ^ int ( int arg ) { . . . } ' vs . ' ^ int ( int arg ) { . . . } ' . <nl> + sp_before_oc_block_caret = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after a block pointer caret <nl> + # ' ^ int ( int arg ) { . . . } ' vs . ' ^ int ( int arg ) { . . . } ' . <nl> + sp_after_oc_block_caret = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space between the receiver and selector in a message . <nl> + # ' [ receiver selector . . . ] ' . <nl> + sp_after_oc_msg_receiver = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after @ property . <nl> + sp_after_oc_property = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space around the ' : ' in ' b ? t : f ' . <nl> + sp_cond_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before the ' : ' in ' b ? t : f ' . Overrides sp_cond_colon . <nl> + sp_cond_colon_before = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the ' : ' in ' b ? t : f ' . Overrides sp_cond_colon . <nl> + sp_cond_colon_after = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space around the ' ? ' in ' b ? t : f ' . <nl> + sp_cond_question = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space before the ' ? ' in ' b ? t : f ' . Overrides sp_cond_question . <nl> + sp_cond_question_before = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove space after the ' ? ' in ' b ? t : f ' . Overrides sp_cond_question . <nl> + sp_cond_question_after = ignore # ignore / add / remove / force <nl> + <nl> + # In the abbreviated ternary form ( a ? : b ) , add / remove space between ? and : . ' . Overrides all other sp_cond_ * options . <nl> + sp_cond_ternary_short = ignore # ignore / add / remove / force <nl> + <nl> + # Fix the spacing between ' case ' and the label . Only ' ignore ' and ' force ' make sense here . <nl> + sp_case_label = ignore # ignore / add / remove / force <nl> + <nl> + # Control the space around the D ' . . ' operator . <nl> + sp_range = ignore # ignore / add / remove / force <nl> + <nl> + # Control the spacing after ' : ' in ' for ( TYPE VAR : EXPR ) ' . Only JAVA . <nl> + sp_after_for_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Control the spacing before ' : ' in ' for ( TYPE VAR : EXPR ) ' . Only JAVA . <nl> + sp_before_for_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Control the spacing in ' extern ( C ) ' ( D ) . <nl> + sp_extern_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Control the space after the opening of a C + + comment ' / / A ' vs ' / / A ' . <nl> + sp_cmt_cpp_start = ignore # ignore / add / remove / force <nl> + <nl> + # True : If space is added with sp_cmt_cpp_start , do it after doxygen sequences like ' / / / ' , ' / / / < ' , ' / / ! ' and ' / / ! < ' . <nl> + sp_cmt_cpp_doxygen = false # false / true <nl> + <nl> + # True : If space is added with sp_cmt_cpp_start , do it after Qt translator or meta - data comments like ' / / : ' , ' / / = ' , and ' / / ~ ' . <nl> + sp_cmt_cpp_qttr = false # false / true <nl> + <nl> + # Controls the spaces between # else or # endif and a trailing comment . <nl> + sp_endif_cmt = ignore # ignore / add / remove / force <nl> + <nl> + # Controls the spaces after ' new ' , ' delete ' and ' delete [ ] ' . <nl> + sp_after_new = force # ignore / add / remove / force <nl> + <nl> + # Controls the spaces between new and ' ( ' in ' new ( ) ' . <nl> + sp_between_new_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Controls the spaces between ' ) ' and ' type ' in ' new ( foo ) BAR ' . <nl> + sp_after_newop_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Controls the spaces inside paren of the new operator : ' new ( foo ) BAR ' . <nl> + sp_inside_newop_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Controls the space after open paren of the new operator : ' new ( foo ) BAR ' . <nl> + # Overrides sp_inside_newop_paren . <nl> + sp_inside_newop_paren_open = ignore # ignore / add / remove / force <nl> + <nl> + # Controls the space before close paren of the new operator : ' new ( foo ) BAR ' . <nl> + # Overrides sp_inside_newop_paren . <nl> + sp_inside_newop_paren_close = ignore # ignore / add / remove / force <nl> + <nl> + # Controls the spaces before a trailing or embedded comment . <nl> + sp_before_tr_emb_cmt = ignore # ignore / add / remove / force <nl> + <nl> + # Number of spaces before a trailing or embedded comment . <nl> + sp_num_before_tr_emb_cmt = 0 # unsigned number <nl> + <nl> + # Control space between a Java annotation and the open paren . <nl> + sp_annotation_paren = ignore # ignore / add / remove / force <nl> + <nl> + # If True , vbrace tokens are dropped to the previous token and skipped . <nl> + sp_skip_vbrace_tokens = false # false / true <nl> + <nl> + # If True , a < TAB > is inserted after # define . <nl> + force_tab_after_define = false # false / true <nl> + <nl> + # <nl> + # Indenting <nl> + # <nl> + <nl> + # The number of columns to indent per level . <nl> + # Usually 2 , 3 , 4 , or 8 . Default = 8 . <nl> + indent_columns = 8 # unsigned number <nl> + <nl> + # The continuation indent . If non - zero , this overrides the indent of ' ( ' and ' = ' continuation indents . <nl> + # For FreeBSD , this is set to 4 . Negative value is absolute and not increased for each ' ( ' level . <nl> + indent_continue = 0 # number <nl> + <nl> + # The continuation indent for func_ * _param if they are true . <nl> + # If non - zero , this overrides the indent . <nl> + indent_param = 0 # unsigned number <nl> + <nl> + # How to use tabs when indenting code <nl> + # 0 = spaces only <nl> + # 1 = indent with tabs to brace level , align with spaces ( default ) <nl> + # 2 = indent and align with tabs , using spaces when not on a tabstop <nl> + indent_with_tabs = 1 # unsigned number <nl> + <nl> + # Comments that are not a brace level are indented with tabs on a tabstop . <nl> + # Requires indent_with_tabs = 2 . If false , will use spaces . <nl> + indent_cmt_with_tabs = false # false / true <nl> + <nl> + # Whether to indent strings broken by ' \ ' so that they line up . <nl> + indent_align_string = false # false / true <nl> + <nl> + # The number of spaces to indent multi - line XML strings . <nl> + # Requires indent_align_string = True . <nl> + indent_xml_string = 0 # unsigned number <nl> + <nl> + # Spaces to indent ' { ' from level . <nl> + indent_brace = 0 # unsigned number <nl> + <nl> + # Whether braces are indented to the body level . <nl> + indent_braces = false # false / true <nl> + <nl> + # Disabled indenting function braces if indent_braces is True . <nl> + indent_braces_no_func = false # false / true <nl> + <nl> + # Disabled indenting class braces if indent_braces is True . <nl> + indent_braces_no_class = false # false / true <nl> + <nl> + # Disabled indenting struct braces if indent_braces is True . <nl> + indent_braces_no_struct = false # false / true <nl> + <nl> + # Indent based on the size of the brace parent , i . e . ' if ' = > 3 spaces , ' for ' = > 4 spaces , etc . <nl> + indent_brace_parent = false # false / true <nl> + <nl> + # Indent based on the paren open instead of the brace open in ' ( { \ n ' , default is to indent by brace . <nl> + indent_paren_open_brace = false # false / true <nl> + <nl> + # indent a C # delegate by another level , default is to not indent by another level . <nl> + indent_cs_delegate_brace = false # false / true <nl> + <nl> + # Whether the ' namespace ' body is indented . <nl> + indent_namespace = false # false / true <nl> + <nl> + # Only indent one namespace and no sub - namespaces . <nl> + # Requires indent_namespace = True . <nl> + indent_namespace_single_indent = false # false / true <nl> + <nl> + # The number of spaces to indent a namespace block . <nl> + indent_namespace_level = 0 # unsigned number <nl> + <nl> + # If the body of the namespace is longer than this number , it won ' t be indented . <nl> + # Requires indent_namespace = True . Default = 0 ( no limit ) <nl> + indent_namespace_limit = 0 # unsigned number <nl> + <nl> + # Whether the ' extern " C " ' body is indented . <nl> + indent_extern = false # false / true <nl> + <nl> + # Whether the ' class ' body is indented . <nl> + indent_class = false # false / true <nl> + <nl> + # Whether to indent the stuff after a leading base class colon . <nl> + indent_class_colon = false # false / true <nl> + <nl> + # Indent based on a class colon instead of the stuff after the colon . <nl> + # Requires indent_class_colon = True . Default = False . <nl> + indent_class_on_colon = false # false / true <nl> + <nl> + # Whether to indent the stuff after a leading class initializer colon . <nl> + indent_constr_colon = false # false / true <nl> + <nl> + # Virtual indent from the ' : ' for member initializers . Default = 2 . <nl> + indent_ctor_init_leading = 2 # unsigned number <nl> + <nl> + # Additional indent for constructor initializer list . <nl> + # Negative values decrease indent down to the first column . Default = 0 . <nl> + indent_ctor_init = 0 # number <nl> + <nl> + # False = treat ' else \ nif ' as ' else if ' for indenting purposes <nl> + # True = indent the ' if ' one level . <nl> + indent_else_if = false # false / true <nl> + <nl> + # Amount to indent variable declarations after a open brace . neg = relative , pos = absolute . <nl> + indent_var_def_blk = 0 # number <nl> + <nl> + # Indent continued variable declarations instead of aligning . <nl> + indent_var_def_cont = false # false / true <nl> + <nl> + # Indent continued shift expressions ( ' < < ' and ' > > ' ) instead of aligning . <nl> + # Turn align_left_shift off when enabling this . <nl> + indent_shift = false # false / true <nl> + <nl> + # True : force indentation of function definition to start in column 1 <nl> + # False : use the default behavior . <nl> + indent_func_def_force_col1 = false # false / true <nl> + <nl> + # True : indent continued function call parameters one indent level <nl> + # False : align parameters under the open paren . <nl> + indent_func_call_param = false # false / true <nl> + <nl> + # Same as indent_func_call_param , but for function defs . <nl> + indent_func_def_param = false # false / true <nl> + <nl> + # Same as indent_func_call_param , but for function protos . <nl> + indent_func_proto_param = false # false / true <nl> + <nl> + # Same as indent_func_call_param , but for class declarations . <nl> + indent_func_class_param = false # false / true <nl> + <nl> + # Same as indent_func_call_param , but for class variable constructors . <nl> + indent_func_ctor_var_param = false # false / true <nl> + <nl> + # Same as indent_func_call_param , but for templates . <nl> + indent_template_param = false # false / true <nl> + <nl> + # Double the indent for indent_func_xxx_param options . <nl> + # Use both values of the options indent_columns and indent_param . <nl> + indent_func_param_double = false # false / true <nl> + <nl> + # Indentation column for standalone ' const ' function decl / proto qualifier . <nl> + indent_func_const = 0 # unsigned number <nl> + <nl> + # Indentation column for standalone ' throw ' function decl / proto qualifier . <nl> + indent_func_throw = 0 # unsigned number <nl> + <nl> + # The number of spaces to indent a continued ' - > ' or ' . ' <nl> + # Usually set to 0 , 1 , or indent_columns . <nl> + indent_member = 0 # unsigned number <nl> + <nl> + # Spaces to indent single line ( ' / / ' ) comments on lines before code . <nl> + indent_sing_line_comments = 0 # unsigned number <nl> + <nl> + # If set , will indent trailing single line ( ' / / ' ) comments relative <nl> + # to the code instead of trying to keep the same absolute column . <nl> + indent_relative_single_line_comments = false # false / true <nl> + <nl> + # Spaces to indent ' case ' from ' switch ' <nl> + # Usually 0 or indent_columns . <nl> + indent_switch_case = 0 # unsigned number <nl> + <nl> + # Whether to indent preproccesor statements inside of switch statements . <nl> + indent_switch_pp = true # false / true <nl> + <nl> + # Spaces to shift the ' case ' line , without affecting any other lines <nl> + # Usually 0 . <nl> + indent_case_shift = 0 # unsigned number <nl> + <nl> + # Spaces to indent ' { ' from ' case ' . <nl> + # By default , the brace will appear under the ' c ' in case . <nl> + # Usually set to 0 or indent_columns . <nl> + # negative value are OK . <nl> + indent_case_brace = 0 # number <nl> + <nl> + # Whether to indent comments found in first column . <nl> + indent_col1_comment = false # false / true <nl> + <nl> + # How to indent goto labels <nl> + # > 0 : absolute column where 1 is the leftmost column <nl> + # < = 0 : subtract from brace indent <nl> + # Default = 1 <nl> + indent_label = 1 # number <nl> + <nl> + # Same as indent_label , but for access specifiers that are followed by a colon . Default = 1 <nl> + indent_access_spec = 1 # number <nl> + <nl> + # Indent the code after an access specifier by one level . <nl> + # If set , this option forces ' indent_access_spec = 0 ' . <nl> + indent_access_spec_body = false # false / true <nl> + <nl> + # If an open paren is followed by a newline , indent the next line so that it lines up after the open paren ( not recommended ) . <nl> + indent_paren_nl = false # false / true <nl> + <nl> + # Controls the indent of a close paren after a newline . <nl> + # 0 : Indent to body level <nl> + # 1 : Align under the open paren <nl> + # 2 : Indent to the brace level <nl> + indent_paren_close = 0 # unsigned number <nl> + <nl> + # Controls the indent of the open paren of a function definition , if on it ' s own line . If True , indents the open paren <nl> + indent_paren_after_func_def = false # false / true <nl> + <nl> + # Controls the indent of the open paren of a function declaration , if on it ' s own line . If True , indents the open paren <nl> + indent_paren_after_func_decl = false # false / true <nl> + <nl> + # Controls the indent of the open paren of a function call , if on it ' s own line . If True , indents the open paren <nl> + indent_paren_after_func_call = false # false / true <nl> + <nl> + # Controls the indent of a comma when inside a paren . If True , aligns under the open paren . <nl> + indent_comma_paren = false # false / true <nl> + <nl> + # Controls the indent of a BOOL operator when inside a paren . If True , aligns under the open paren . <nl> + indent_bool_paren = false # false / true <nl> + <nl> + # If ' indent_bool_paren ' is True , controls the indent of the first expression . If True , aligns the first expression to the following ones . <nl> + indent_first_bool_expr = false # false / true <nl> + <nl> + # If an open square is followed by a newline , indent the next line so that it lines up after the open square ( not recommended ) . <nl> + indent_square_nl = false # false / true <nl> + <nl> + # Don ' t change the relative indent of ESQL / C ' EXEC SQL ' bodies . <nl> + indent_preserve_sql = false # false / true <nl> + <nl> + # Align continued statements at the ' = ' . Default = True <nl> + # If False or the ' = ' is followed by a newline , the next line is indent one tab . <nl> + indent_align_assign = true # false / true <nl> + <nl> + # Indent OC blocks at brace level instead of usual rules . <nl> + indent_oc_block = false # false / true <nl> + <nl> + # Indent OC blocks in a message relative to the parameter name . <nl> + # 0 = use indent_oc_block rules , 1 + = spaces to indent <nl> + indent_oc_block_msg = 0 # unsigned number <nl> + <nl> + # Minimum indent for subsequent parameters <nl> + indent_oc_msg_colon = 0 # unsigned number <nl> + <nl> + # If True , prioritize aligning with initial colon ( and stripping spaces from lines , if necessary ) . <nl> + # Default = True . <nl> + indent_oc_msg_prioritize_first_colon = true # false / true <nl> + <nl> + # If indent_oc_block_msg and this option are on , blocks will be indented the way that Xcode does by default ( from keyword if the parameter is on its own line ; otherwise , from the previous indentation level ) . <nl> + indent_oc_block_msg_xcode_style = false # false / true <nl> + <nl> + # If indent_oc_block_msg and this option are on , blocks will be indented from where the brace is relative to a msg keyword . <nl> + indent_oc_block_msg_from_keyword = false # false / true <nl> + <nl> + # If indent_oc_block_msg and this option are on , blocks will be indented from where the brace is relative to a msg colon . <nl> + indent_oc_block_msg_from_colon = false # false / true <nl> + <nl> + # If indent_oc_block_msg and this option are on , blocks will be indented from where the block caret is . <nl> + indent_oc_block_msg_from_caret = false # false / true <nl> + <nl> + # If indent_oc_block_msg and this option are on , blocks will be indented from where the brace is . <nl> + indent_oc_block_msg_from_brace = false # false / true <nl> + <nl> + # When identing after virtual brace open and newline add further spaces to reach this min . indent . <nl> + indent_min_vbrace_open = 0 # unsigned number <nl> + <nl> + # True : When identing after virtual brace open and newline add further spaces after regular indent to reach next tabstop . <nl> + indent_vbrace_open_on_tabstop = false # false / true <nl> + <nl> + # If True , a brace followed by another token ( not a newline ) will indent all contained lines to match the token . Default = True . <nl> + indent_token_after_brace = true # false / true <nl> + <nl> + # If True , cpp lambda body will be indentedDefault = False . <nl> + indent_cpp_lambda_body = false # false / true <nl> + <nl> + # indent ( or not ) an using block if no braces are used . Only for C # . Default = True . <nl> + indent_using_block = true # false / true <nl> + <nl> + # indent the continuation of ternary operator . <nl> + # 0 : ( Default ) off <nl> + # 1 : When the ` if_false ` is a continuation , indent it under ` if_false ` <nl> + # 2 : When the ` : ` is a continuation , indent it under ` ? ` <nl> + indent_ternary_operator = 0 # unsigned number <nl> + <nl> + # If true , ignore indent and align for asm blocks as they have their own indentation . <nl> + indent_ignore_asm_block = false # false / true <nl> + <nl> + # <nl> + # Newline adding and removing options <nl> + # <nl> + <nl> + # Whether to collapse empty blocks between ' { ' and ' } ' . <nl> + nl_collapse_empty_body = false # false / true <nl> + <nl> + # Don ' t split one - line braced assignments - ' foo_t f = { 1 , 2 } ; ' . <nl> + nl_assign_leave_one_liners = false # false / true <nl> + <nl> + # Don ' t split one - line braced statements inside a class xx { } body . <nl> + nl_class_leave_one_liners = false # false / true <nl> + <nl> + # Don ' t split one - line enums : ' enum foo { BAR = 15 } ; ' <nl> + nl_enum_leave_one_liners = false # false / true <nl> + <nl> + # Don ' t split one - line get or set functions . <nl> + nl_getset_leave_one_liners = false # false / true <nl> + <nl> + # Don ' t split one - line function definitions - ' int foo ( ) { return 0 ; } ' . <nl> + nl_func_leave_one_liners = false # false / true <nl> + <nl> + # Don ' t split one - line C + + 11 lambdas - ' [ ] ( ) { return 0 ; } ' . <nl> + nl_cpp_lambda_leave_one_liners = false # false / true <nl> + <nl> + # Don ' t split one - line if / else statements - ' if ( a ) b + + ; ' . <nl> + nl_if_leave_one_liners = false # false / true <nl> + <nl> + # Don ' t split one - line while statements - ' while ( a ) b + + ; ' . <nl> + nl_while_leave_one_liners = false # false / true <nl> + <nl> + # Don ' t split one - line OC messages . <nl> + nl_oc_msg_leave_one_liner = false # false / true <nl> + <nl> + # Add or remove newline between Objective - C block signature and ' { ' . <nl> + nl_oc_block_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newlines at the start of the file . <nl> + nl_start_of_file = ignore # ignore / add / remove / force <nl> + <nl> + # The number of newlines at the start of the file ( only used if nl_start_of_file is ' add ' or ' force ' . <nl> + nl_start_of_file_min = 0 # unsigned number <nl> + <nl> + # Add or remove newline at the end of the file . <nl> + nl_end_of_file = force # ignore / add / remove / force <nl> + <nl> + # The number of newlines at the end of the file ( only used if nl_end_of_file is ' add ' or ' force ' ) . <nl> + nl_end_of_file_min = 1 # unsigned number <nl> + <nl> + # Add or remove newline between ' = ' and ' { ' . <nl> + nl_assign_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' = ' and ' [ ' ( D only ) . <nl> + nl_assign_square = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline after ' = [ ' ( D only ) . Will also affect the newline before the ' ] ' . <nl> + nl_after_square_assign = ignore # ignore / add / remove / force <nl> + <nl> + # The number of blank lines after a block of variable definitions at the top of a function body <nl> + # 0 = No change ( default ) . <nl> + nl_func_var_def_blk = 0 # unsigned number <nl> + <nl> + # The number of newlines before a block of typedefs <nl> + # 0 = No change ( default ) <nl> + # is overridden by the option ' nl_after_access_spec ' . <nl> + nl_typedef_blk_start = 0 # unsigned number <nl> + <nl> + # The number of newlines after a block of typedefs <nl> + # 0 = No change ( default ) . <nl> + nl_typedef_blk_end = 0 # unsigned number <nl> + <nl> + # The maximum consecutive newlines within a block of typedefs <nl> + # 0 = No change ( default ) . <nl> + nl_typedef_blk_in = 0 # unsigned number <nl> + <nl> + # The number of newlines before a block of variable definitions not at the top of a function body <nl> + # 0 = No change ( default ) <nl> + # is overridden by the option ' nl_after_access_spec ' . <nl> + nl_var_def_blk_start = 0 # unsigned number <nl> + <nl> + # The number of newlines after a block of variable definitions not at the top of a function body <nl> + # 0 = No change ( default ) . <nl> + nl_var_def_blk_end = 0 # unsigned number <nl> + <nl> + # The maximum consecutive newlines within a block of variable definitions <nl> + # 0 = No change ( default ) . <nl> + nl_var_def_blk_in = 0 # unsigned number <nl> + <nl> + # Add or remove newline between a function call ' s ' ) ' and ' { ' , as in : <nl> + # list_for_each ( item , & list ) { } . <nl> + nl_fcall_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' enum ' and ' { ' . <nl> + nl_enum_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' enum ' and ' class ' . <nl> + nl_enum_class = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' enum class ' and the identifier . <nl> + nl_enum_class_identifier = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' enum class ' type and ' : ' . <nl> + nl_enum_identifier_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' enum class identifier : ' and ' type ' and / or ' type ' . <nl> + nl_enum_colon_type = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' struct and ' { ' . <nl> + nl_struct_brace = force # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' union ' and ' { ' . <nl> + nl_union_brace = force # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' if ' and ' { ' . <nl> + nl_if_brace = force # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' } ' and ' else ' . <nl> + nl_brace_else = force # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' else if ' and ' { ' <nl> + # If set to ignore , nl_if_brace is used instead . <nl> + nl_elseif_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' else ' and ' { ' . <nl> + nl_else_brace = force # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' else ' and ' if ' . <nl> + nl_else_if = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove newline before ' if ' / ' else if ' closing parenthesis . <nl> + nl_before_if_closing_paren = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' } ' and ' finally ' . <nl> + nl_brace_finally = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' finally ' and ' { ' . <nl> + nl_finally_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' try ' and ' { ' . <nl> + nl_try_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between get / set and ' { ' . <nl> + nl_getset_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' for ' and ' { ' . <nl> + nl_for_brace = force # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' catch ' and ' { ' . <nl> + nl_catch_brace = force # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' } ' and ' catch ' . <nl> + nl_brace_catch = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' } ' and ' ] ' . <nl> + nl_brace_square = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' } ' and ' ) ' in a function invocation . <nl> + nl_brace_fparen = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' while ' and ' { ' . <nl> + nl_while_brace = force # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' scope ( x ) ' and ' { ' ( D ) . <nl> + nl_scope_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' unittest ' and ' { ' ( D ) . <nl> + nl_unittest_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' version ( x ) ' and ' { ' ( D ) . <nl> + nl_version_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' using ' and ' { ' . <nl> + nl_using_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between two open or close braces . <nl> + # Due to general newline / brace handling , REMOVE may not work . <nl> + nl_brace_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' do ' and ' { ' . <nl> + nl_do_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' } ' and ' while ' of ' do ' statement . <nl> + nl_brace_while = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' switch ' and ' { ' . <nl> + nl_switch_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' synchronized ' and ' { ' . <nl> + nl_synchronized_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add a newline between ' ) ' and ' { ' if the ' ) ' is on a different line than the if / for / etc . <nl> + # Overrides nl_for_brace , nl_if_brace , nl_switch_brace , nl_while_switch and nl_catch_brace . <nl> + nl_multi_line_cond = false # false / true <nl> + <nl> + # Force a newline in a define after the macro name for multi - line defines . <nl> + nl_multi_line_define = false # false / true <nl> + <nl> + # Whether to put a newline before ' case ' statement , not after the first ' case ' . <nl> + nl_before_case = false # false / true <nl> + <nl> + # Add or remove newline between ' ) ' and ' throw ' . <nl> + nl_before_throw = ignore # ignore / add / remove / force <nl> + <nl> + # Whether to put a newline after ' case ' statement . <nl> + nl_after_case = false # false / true <nl> + <nl> + # Add or remove a newline between a case ' : ' and ' { ' . Overrides nl_after_case . <nl> + nl_case_colon_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Newline between namespace and { . <nl> + nl_namespace_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' template < > ' and whatever follows . <nl> + nl_template_class = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' class ' and ' { ' . <nl> + nl_class_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline before / after each ' , ' in the base class list , <nl> + # ( tied to pos_class_comma ) . <nl> + nl_class_init_args = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline after each ' , ' in the constructor member initialization . <nl> + # Related to nl_constr_colon , pos_constr_colon and pos_constr_comma . <nl> + nl_constr_init_args = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline before first element , after comma , and after last element in enum . <nl> + nl_enum_own_lines = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between return type and function name in a function definition . <nl> + nl_func_type_name = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between return type and function name inside a class { } <nl> + # Uses nl_func_type_name or nl_func_proto_type_name if set to ignore . <nl> + nl_func_type_name_class = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between class specification and ' : : ' in ' void A : : f ( ) { } ' <nl> + # Only appears in separate member implementation ( does not appear with in - line implmementation ) . <nl> + nl_func_class_scope = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between function scope and name <nl> + # Controls the newline after ' : : ' in ' void A : : f ( ) { } ' . <nl> + nl_func_scope_name = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between return type and function name in a prototype . <nl> + nl_func_proto_type_name = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between a function name and the opening ' ( ' in the declaration . <nl> + nl_func_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Overrides nl_func_paren for functions with no parameters . <nl> + nl_func_paren_empty = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between a function name and the opening ' ( ' in the definition . <nl> + nl_func_def_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Overrides nl_func_def_paren for functions with no parameters . <nl> + nl_func_def_paren_empty = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between a function name and the opening ' ( ' in the call <nl> + nl_func_call_paren = ignore # ignore / add / remove / force <nl> + <nl> + # Overrides nl_func_call_paren for functions with no parameters . <nl> + nl_func_call_paren_empty = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline after ' ( ' in a function declaration . <nl> + nl_func_decl_start = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline after ' ( ' in a function definition . <nl> + nl_func_def_start = ignore # ignore / add / remove / force <nl> + <nl> + # Overrides nl_func_decl_start when there is only one parameter . <nl> + nl_func_decl_start_single = ignore # ignore / add / remove / force <nl> + <nl> + # Overrides nl_func_def_start when there is only one parameter . <nl> + nl_func_def_start_single = ignore # ignore / add / remove / force <nl> + <nl> + # Whether to add newline after ' ( ' in a function declaration if ' ( ' and ' ) ' are in different lines . <nl> + nl_func_decl_start_multi_line = false # false / true <nl> + <nl> + # Whether to add newline after ' ( ' in a function definition if ' ( ' and ' ) ' are in different lines . <nl> + nl_func_def_start_multi_line = false # false / true <nl> + <nl> + # Add or remove newline after each ' , ' in a function declaration . <nl> + nl_func_decl_args = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline after each ' , ' in a function definition . <nl> + nl_func_def_args = ignore # ignore / add / remove / force <nl> + <nl> + # Whether to add newline after each ' , ' in a function declaration if ' ( ' and ' ) ' are in different lines . <nl> + nl_func_decl_args_multi_line = false # false / true <nl> + <nl> + # Whether to add newline after each ' , ' in a function definition if ' ( ' and ' ) ' are in different lines . <nl> + nl_func_def_args_multi_line = false # false / true <nl> + <nl> + # Add or remove newline before the ' ) ' in a function declaration . <nl> + nl_func_decl_end = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline before the ' ) ' in a function definition . <nl> + nl_func_def_end = ignore # ignore / add / remove / force <nl> + <nl> + # Overrides nl_func_decl_end when there is only one parameter . <nl> + nl_func_decl_end_single = ignore # ignore / add / remove / force <nl> + <nl> + # Overrides nl_func_def_end when there is only one parameter . <nl> + nl_func_def_end_single = ignore # ignore / add / remove / force <nl> + <nl> + # Whether to add newline before ' ) ' in a function declaration if ' ( ' and ' ) ' are in different lines . <nl> + nl_func_decl_end_multi_line = false # false / true <nl> + <nl> + # Whether to add newline before ' ) ' in a function definition if ' ( ' and ' ) ' are in different lines . <nl> + nl_func_def_end_multi_line = false # false / true <nl> + <nl> + # Add or remove newline between ' ( ) ' in a function declaration . <nl> + nl_func_decl_empty = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' ( ) ' in a function definition . <nl> + nl_func_def_empty = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between ' ( ) ' in a function call . <nl> + nl_func_call_empty = ignore # ignore / add / remove / force <nl> + <nl> + # Whether to add newline after ' ( ' in a function call if ' ( ' and ' ) ' are in different lines . <nl> + nl_func_call_start_multi_line = false # false / true <nl> + <nl> + # Whether to add newline after each ' , ' in a function call if ' ( ' and ' ) ' are in different lines . <nl> + nl_func_call_args_multi_line = false # false / true <nl> + <nl> + # Whether to add newline before ' ) ' in a function call if ' ( ' and ' ) ' are in different lines . <nl> + nl_func_call_end_multi_line = false # false / true <nl> + <nl> + # Whether to put each OC message parameter on a separate line <nl> + # See nl_oc_msg_leave_one_liner . <nl> + nl_oc_msg_args = false # false / true <nl> + <nl> + # Add or remove newline between function signature and ' { ' . <nl> + nl_fdef_brace = force # ignore / add / remove / force <nl> + <nl> + # Add or remove newline between C + + 11 lambda signature and ' { ' . <nl> + nl_cpp_ldef_brace = force # ignore / add / remove / force <nl> + <nl> + # Add or remove a newline between the return keyword and return expression . <nl> + nl_return_expr = ignore # ignore / add / remove / force <nl> + <nl> + # Whether to put a newline after semicolons , except in ' for ' statements . <nl> + nl_after_semicolon = false # false / true <nl> + <nl> + # Java : Control the newline between the ' ) ' and ' { { ' of the double brace initializer . <nl> + nl_paren_dbrace_open = ignore # ignore / add / remove / force <nl> + <nl> + # Whether to put a newline after the type in an unnamed temporary direct - list - initialization . <nl> + nl_type_brace_init_lst = ignore # ignore / add / remove / force <nl> + <nl> + # Whether to put a newline after open brace in an unnamed temporary direct - list - initialization . <nl> + nl_type_brace_init_lst_open = ignore # ignore / add / remove / force <nl> + <nl> + # Whether to put a newline before close brace in an unnamed temporary direct - list - initialization . <nl> + nl_type_brace_init_lst_close = ignore # ignore / add / remove / force <nl> + <nl> + # Whether to put a newline after brace open . <nl> + # This also adds a newline before the matching brace close . <nl> + nl_after_brace_open = false # false / true <nl> + <nl> + # If nl_after_brace_open and nl_after_brace_open_cmt are True , a newline is <nl> + # placed between the open brace and a trailing single - line comment . <nl> + nl_after_brace_open_cmt = false # false / true <nl> + <nl> + # Whether to put a newline after a virtual brace open with a non - empty body . <nl> + # These occur in un - braced if / while / do / for statement bodies . <nl> + nl_after_vbrace_open = false # false / true <nl> + <nl> + # Whether to put a newline after a virtual brace open with an empty body . <nl> + # These occur in un - braced if / while / do / for statement bodies . <nl> + nl_after_vbrace_open_empty = false # false / true <nl> + <nl> + # Whether to put a newline after a brace close . <nl> + # Does not apply if followed by a necessary ' ; ' . <nl> + nl_after_brace_close = false # false / true <nl> + <nl> + # Whether to put a newline after a virtual brace close . <nl> + # Would add a newline before return in : ' if ( foo ) a + + ; return ; ' . <nl> + nl_after_vbrace_close = false # false / true <nl> + <nl> + # Control the newline between the close brace and ' b ' in : ' struct { int a ; } b ; ' <nl> + # Affects enums , unions and structures . If set to ignore , uses nl_after_brace_close . <nl> + nl_brace_struct_var = ignore # ignore / add / remove / force <nl> + <nl> + # Whether to alter newlines in ' # define ' macros . <nl> + nl_define_macro = false # false / true <nl> + <nl> + # Whether to remove blanks after ' # ifxx ' and ' # elxx ' , or before ' # elxx ' and ' # endif ' . Does not affect top - level # ifdefs . <nl> + nl_squeeze_ifdef = false # false / true <nl> + <nl> + # Makes the nl_squeeze_ifdef option affect the top - level # ifdefs as well . <nl> + nl_squeeze_ifdef_top_level = false # false / true <nl> + <nl> + # Add or remove blank line before ' if ' . <nl> + nl_before_if = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove blank line after ' if ' statement . <nl> + # Add / Force work only if the next token is not a closing brace . <nl> + nl_after_if = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove blank line before ' for ' . <nl> + nl_before_for = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove blank line after ' for ' statement . <nl> + nl_after_for = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove blank line before ' while ' . <nl> + nl_before_while = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove blank line after ' while ' statement . <nl> + nl_after_while = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove blank line before ' switch ' . <nl> + nl_before_switch = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove blank line after ' switch ' statement . <nl> + nl_after_switch = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove blank line before ' synchronized ' . <nl> + nl_before_synchronized = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove blank line after ' synchronized ' statement . <nl> + nl_after_synchronized = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove blank line before ' do ' . <nl> + nl_before_do = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove blank line after ' do / while ' statement . <nl> + nl_after_do = ignore # ignore / add / remove / force <nl> + <nl> + # Whether to double - space commented - entries in struct / union / enum . <nl> + nl_ds_struct_enum_cmt = false # false / true <nl> + <nl> + # force nl before } of a struct / union / enum <nl> + # ( lower priority than ' eat_blanks_before_close_brace ' ) . <nl> + nl_ds_struct_enum_close_brace = false # false / true <nl> + <nl> + # Add or remove blank line before ' func_class_def ' . <nl> + nl_before_func_class_def = 0 # unsigned number <nl> + <nl> + # Add or remove blank line before ' func_class_proto ' . <nl> + nl_before_func_class_proto = 0 # unsigned number <nl> + <nl> + # Add or remove a newline before / after a class colon , <nl> + # ( tied to pos_class_colon ) . <nl> + nl_class_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove a newline around a class constructor colon . <nl> + # Related to nl_constr_init_args , pos_constr_colon and pos_constr_comma . <nl> + nl_constr_colon = ignore # ignore / add / remove / force <nl> + <nl> + # Change simple unbraced if statements into a one - liner <nl> + # ' if ( b ) \ n i + + ; ' = > ' if ( b ) i + + ; ' . <nl> + nl_create_if_one_liner = false # false / true <nl> + <nl> + # Change simple unbraced for statements into a one - liner <nl> + # ' for ( i = 0 ; i < 5 ; i + + ) \ n foo ( i ) ; ' = > ' for ( i = 0 ; i < 5 ; i + + ) foo ( i ) ; ' . <nl> + nl_create_for_one_liner = false # false / true <nl> + <nl> + # Change simple unbraced while statements into a one - liner <nl> + # ' while ( i < 5 ) \ n foo ( i + + ) ; ' = > ' while ( i < 5 ) foo ( i + + ) ; ' . <nl> + nl_create_while_one_liner = false # false / true <nl> + <nl> + # Change a one - liner if statement into simple unbraced if <nl> + # ' if ( b ) i + + ; ' = > ' if ( b ) \ n i + + ; ' . <nl> + nl_split_if_one_liner = false # false / true <nl> + <nl> + # Change a one - liner for statement into simple unbraced for <nl> + # ' for ( i = 0 ; < 5 ; i + + ) foo ( i ) ; ' = > ' for ( i = 0 ; < 5 ; i + + ) \ n foo ( i ) ; ' . <nl> + nl_split_for_one_liner = false # false / true <nl> + <nl> + # Change a one - liner while statement into simple unbraced while <nl> + # ' while ( i < 5 ) foo ( i + + ) ; ' = > ' while ( i < 5 ) \ n foo ( i + + ) ; ' . <nl> + nl_split_while_one_liner = false # false / true <nl> + <nl> + # <nl> + # Blank line options <nl> + # <nl> + <nl> + # The maximum consecutive newlines ( 3 = 2 blank lines ) . <nl> + nl_max = 0 # unsigned number <nl> + <nl> + # The maximum consecutive newlines in function . <nl> + nl_max_blank_in_func = 0 # unsigned number <nl> + <nl> + # The number of newlines after a function prototype , if followed by another function prototype . <nl> + nl_after_func_proto = 0 # unsigned number <nl> + <nl> + # The number of newlines after a function prototype , if not followed by another function prototype . <nl> + nl_after_func_proto_group = 0 # unsigned number <nl> + <nl> + # The number of newlines after a function class prototype , if followed by another function class prototype . <nl> + nl_after_func_class_proto = 0 # unsigned number <nl> + <nl> + # The number of newlines after a function class prototype , if not followed by another function class prototype . <nl> + nl_after_func_class_proto_group = 0 # unsigned number <nl> + <nl> + # The number of newlines before a multi - line function def body . <nl> + nl_before_func_body_def = 0 # unsigned number <nl> + <nl> + # The number of newlines before a multi - line function prototype body . <nl> + nl_before_func_body_proto = 0 # unsigned number <nl> + <nl> + # The number of newlines after ' } ' of a multi - line function body . <nl> + nl_after_func_body = 0 # unsigned number <nl> + <nl> + # The number of newlines after ' } ' of a multi - line function body in a class declaration . <nl> + nl_after_func_body_class = 0 # unsigned number <nl> + <nl> + # The number of newlines after ' } ' of a single line function body . <nl> + nl_after_func_body_one_liner = 0 # unsigned number <nl> + <nl> + # The minimum number of newlines before a multi - line comment . <nl> + # Doesn ' t apply if after a brace open or another multi - line comment . <nl> + nl_before_block_comment = 0 # unsigned number <nl> + <nl> + # The minimum number of newlines before a single - line C comment . <nl> + # Doesn ' t apply if after a brace open or other single - line C comments . <nl> + nl_before_c_comment = 0 # unsigned number <nl> + <nl> + # The minimum number of newlines before a CPP comment . <nl> + # Doesn ' t apply if after a brace open or other CPP comments . <nl> + nl_before_cpp_comment = 0 # unsigned number <nl> + <nl> + # Whether to force a newline after a multi - line comment . <nl> + nl_after_multiline_comment = false # false / true <nl> + <nl> + # Whether to force a newline after a label ' s colon . <nl> + nl_after_label_colon = false # false / true <nl> + <nl> + # The number of newlines after ' } ' or ' ; ' of a struct / enum / union definition . <nl> + nl_after_struct = 0 # unsigned number <nl> + <nl> + # The number of newlines before a class definition . <nl> + nl_before_class = 0 # unsigned number <nl> + <nl> + # The number of newlines after ' } ' or ' ; ' of a class definition . <nl> + nl_after_class = 0 # unsigned number <nl> + <nl> + # The number of newlines before a ' private : ' , ' public : ' , ' protected : ' , ' signals : ' , or ' slots : ' label . <nl> + # Will not change the newline count if after a brace open . <nl> + # 0 = No change . <nl> + nl_before_access_spec = 0 # unsigned number <nl> + <nl> + # The number of newlines after a ' private : ' , ' public : ' , ' protected : ' , ' signals : ' or ' slots : ' label . <nl> + # 0 = No change . <nl> + # Overrides ' nl_typedef_blk_start ' and ' nl_var_def_blk_start ' . <nl> + nl_after_access_spec = 0 # unsigned number <nl> + <nl> + # The number of newlines between a function def and the function comment . <nl> + # 0 = No change . <nl> + nl_comment_func_def = 0 # unsigned number <nl> + <nl> + # The number of newlines after a try - catch - finally block that isn ' t followed by a brace close . <nl> + # 0 = No change . <nl> + nl_after_try_catch_finally = 0 # unsigned number <nl> + <nl> + # The number of newlines before and after a property , indexer or event decl . <nl> + # 0 = No change . <nl> + nl_around_cs_property = 0 # unsigned number <nl> + <nl> + # The number of newlines between the get / set / add / remove handlers in C # . <nl> + # 0 = No change . <nl> + nl_between_get_set = 0 # unsigned number <nl> + <nl> + # Add or remove newline between C # property and the ' { ' . <nl> + nl_property_brace = ignore # ignore / add / remove / force <nl> + <nl> + # Whether to remove blank lines after ' { ' . <nl> + eat_blanks_after_open_brace = false # false / true <nl> + <nl> + # Whether to remove blank lines before ' } ' . <nl> + eat_blanks_before_close_brace = false # false / true <nl> + <nl> + # How aggressively to remove extra newlines not in preproc . <nl> + # 0 : No change <nl> + # 1 : Remove most newlines not handled by other config <nl> + # 2 : Remove all newlines and reformat completely by config <nl> + nl_remove_extra_newlines = 0 # unsigned number <nl> + <nl> + # Whether to put a blank line before ' return ' statements , unless after an open brace . <nl> + nl_before_return = false # false / true <nl> + <nl> + # Whether to put a blank line after ' return ' statements , unless followed by a close brace . <nl> + nl_after_return = false # false / true <nl> + <nl> + # Whether to put a newline after a Java annotation statement . <nl> + # Only affects annotations that are after a newline . <nl> + nl_after_annotation = ignore # ignore / add / remove / force <nl> + <nl> + # Controls the newline between two annotations . <nl> + nl_between_annotation = ignore # ignore / add / remove / force <nl> + <nl> + # <nl> + # Positioning options <nl> + # <nl> + <nl> + # The position of arithmetic operators in wrapped expressions . <nl> + pos_arith = ignore # ignore / join / lead / lead_break / lead_force / trail / trail_break / trail_force <nl> + <nl> + # The position of assignment in wrapped expressions . <nl> + # Do not affect ' = ' followed by ' { ' . <nl> + pos_assign = ignore # ignore / join / lead / lead_break / lead_force / trail / trail_break / trail_force <nl> + <nl> + # The position of boolean operators in wrapped expressions . <nl> + pos_bool = ignore # ignore / join / lead / lead_break / lead_force / trail / trail_break / trail_force <nl> + <nl> + # The position of comparison operators in wrapped expressions . <nl> + pos_compare = ignore # ignore / join / lead / lead_break / lead_force / trail / trail_break / trail_force <nl> + <nl> + # The position of conditional ( b ? t : f ) operators in wrapped expressions . <nl> + pos_conditional = ignore # ignore / join / lead / lead_break / lead_force / trail / trail_break / trail_force <nl> + <nl> + # The position of the comma in wrapped expressions . <nl> + pos_comma = ignore # ignore / join / lead / lead_break / lead_force / trail / trail_break / trail_force <nl> + <nl> + # The position of the comma in enum entries . <nl> + pos_enum_comma = ignore # ignore / join / lead / lead_break / lead_force / trail / trail_break / trail_force <nl> + <nl> + # The position of the comma in the base class list if there are more than one line , <nl> + # ( tied to nl_class_init_args ) . <nl> + pos_class_comma = ignore # ignore / join / lead / lead_break / lead_force / trail / trail_break / trail_force <nl> + <nl> + # The position of the comma in the constructor initialization list . <nl> + # Related to nl_constr_colon , nl_constr_init_args and pos_constr_colon . <nl> + pos_constr_comma = ignore # ignore / join / lead / lead_break / lead_force / trail / trail_break / trail_force <nl> + <nl> + # The position of trailing / leading class colon , between class and base class list <nl> + # ( tied to nl_class_colon ) . <nl> + pos_class_colon = ignore # ignore / join / lead / lead_break / lead_force / trail / trail_break / trail_force <nl> + <nl> + # The position of colons between constructor and member initialization , <nl> + # ( tied to nl_constr_colon ) . <nl> + # Related to nl_constr_colon , nl_constr_init_args and pos_constr_comma . <nl> + pos_constr_colon = ignore # ignore / join / lead / lead_break / lead_force / trail / trail_break / trail_force <nl> + <nl> + # <nl> + # Line Splitting options <nl> + # <nl> + <nl> + # Try to limit code width to N number of columns <nl> + code_width = 0 # unsigned number <nl> + <nl> + # Whether to fully split long ' for ' statements at semi - colons . <nl> + ls_for_split_full = false # false / true <nl> + <nl> + # Whether to fully split long function protos / calls at commas . <nl> + ls_func_split_full = false # false / true <nl> + <nl> + # Whether to split lines as close to code_width as possible and ignore some groupings . <nl> + ls_code_width = false # false / true <nl> + <nl> + # <nl> + # Code alignment ( not left column spaces / tabs ) <nl> + # <nl> + <nl> + # Whether to keep non - indenting tabs . <nl> + align_keep_tabs = false # false / true <nl> + <nl> + # Whether to use tabs for aligning . <nl> + align_with_tabs = false # false / true <nl> + <nl> + # Whether to bump out to the next tab when aligning . <nl> + align_on_tabstop = false # false / true <nl> + <nl> + # Whether to right - align numbers . <nl> + align_number_right = false # false / true <nl> + <nl> + # Whether to keep whitespace not required for alignment . <nl> + align_keep_extra_space = false # false / true <nl> + <nl> + # Align variable definitions in prototypes and functions . <nl> + align_func_params = false # false / true <nl> + <nl> + # The span for aligning parameter definitions in function on parameter name ( 0 = don ' t align ) . <nl> + align_func_params_span = 0 # unsigned number <nl> + <nl> + # The threshold for aligning function parameter definitions ( 0 = no limit ) . <nl> + align_func_params_thresh = 0 # unsigned number <nl> + <nl> + # The gap for aligning function parameter definitions . <nl> + align_func_params_gap = 0 # unsigned number <nl> + <nl> + # Align parameters in single - line functions that have the same name . <nl> + # The function names must already be aligned with each other . <nl> + align_same_func_call_params = false # false / true <nl> + <nl> + # The span for aligning variable definitions ( 0 = don ' t align ) <nl> + align_var_def_span = 0 # unsigned number <nl> + <nl> + # How to align the star in variable definitions . <nl> + # 0 = Part of the type ' void * foo ; ' <nl> + # 1 = Part of the variable ' void * foo ; ' <nl> + # 2 = Dangling ' void * foo ; ' <nl> + align_var_def_star_style = 0 # unsigned number <nl> + <nl> + # How to align the ' & ' in variable definitions . <nl> + # 0 = Part of the type <nl> + # 1 = Part of the variable <nl> + # 2 = Dangling <nl> + align_var_def_amp_style = 0 # unsigned number <nl> + <nl> + # The threshold for aligning variable definitions ( 0 = no limit ) <nl> + align_var_def_thresh = 0 # unsigned number <nl> + <nl> + # The gap for aligning variable definitions . <nl> + align_var_def_gap = 0 # unsigned number <nl> + <nl> + # Whether to align the colon in struct bit fields . <nl> + align_var_def_colon = false # false / true <nl> + <nl> + # align variable defs gap for bit colons . <nl> + align_var_def_colon_gap = 0 # unsigned number <nl> + <nl> + # Whether to align any attribute after the variable name . <nl> + align_var_def_attribute = false # false / true <nl> + <nl> + # Whether to align inline struct / enum / union variable definitions . <nl> + align_var_def_inline = false # false / true <nl> + <nl> + # The span for aligning on ' = ' in assignments ( 0 = don ' t align ) <nl> + align_assign_span = 0 # unsigned number <nl> + <nl> + # The threshold for aligning on ' = ' in assignments ( 0 = no limit ) <nl> + align_assign_thresh = 0 # unsigned number <nl> + <nl> + # The span for aligning on ' = ' in enums ( 0 = don ' t align ) <nl> + align_enum_equ_span = 0 # unsigned number <nl> + <nl> + # The threshold for aligning on ' = ' in enums ( 0 = no limit ) <nl> + align_enum_equ_thresh = 0 # unsigned number <nl> + <nl> + # The span for aligning class ( 0 = don ' t align ) <nl> + align_var_class_span = 0 # unsigned number <nl> + <nl> + # The threshold for aligning class member definitions ( 0 = no limit ) . <nl> + align_var_class_thresh = 0 # unsigned number <nl> + <nl> + # The gap for aligning class member definitions . <nl> + align_var_class_gap = 0 # unsigned number <nl> + <nl> + # The span for aligning struct / union ( 0 = don ' t align ) <nl> + align_var_struct_span = 0 # unsigned number <nl> + <nl> + # The threshold for aligning struct / union member definitions ( 0 = no limit ) <nl> + align_var_struct_thresh = 0 # unsigned number <nl> + <nl> + # The gap for aligning struct / union member definitions . <nl> + align_var_struct_gap = 0 # unsigned number <nl> + <nl> + # The span for aligning struct initializer values ( 0 = don ' t align ) <nl> + align_struct_init_span = 0 # unsigned number <nl> + <nl> + # The minimum space between the type and the synonym of a typedef . <nl> + align_typedef_gap = 0 # unsigned number <nl> + <nl> + # The span for aligning single - line typedefs ( 0 = don ' t align ) . <nl> + align_typedef_span = 0 # unsigned number <nl> + <nl> + # How to align typedef ' d functions with other typedefs <nl> + # 0 : Don ' t mix them at all <nl> + # 1 : align the open paren with the types <nl> + # 2 : align the function type name with the other type names <nl> + align_typedef_func = 0 # unsigned number <nl> + <nl> + # Controls the positioning of the ' * ' in typedefs . Just try it . <nl> + # 0 : Align on typedef type , ignore ' * ' <nl> + # 1 : The ' * ' is part of type name : typedef int * pint ; <nl> + # 2 : The ' * ' is part of the type , but dangling : typedef int * pint ; <nl> + align_typedef_star_style = 0 # unsigned number <nl> + <nl> + # Controls the positioning of the ' & ' in typedefs . Just try it . <nl> + # 0 : Align on typedef type , ignore ' & ' <nl> + # 1 : The ' & ' is part of type name : typedef int & pint ; <nl> + # 2 : The ' & ' is part of the type , but dangling : typedef int & pint ; <nl> + align_typedef_amp_style = 0 # unsigned number <nl> + <nl> + # The span for aligning comments that end lines ( 0 = don ' t align ) <nl> + align_right_cmt_span = 0 # unsigned number <nl> + <nl> + # If aligning comments , mix with comments after ' } ' and # endif with less than 3 spaces before the comment . <nl> + align_right_cmt_mix = false # false / true <nl> + <nl> + # If a trailing comment is more than this number of columns away from the text it follows , <nl> + # it will qualify for being aligned . This has to be > 0 to do anything . <nl> + align_right_cmt_gap = 0 # unsigned number <nl> + <nl> + # Align trailing comment at or beyond column N ; ' pulls in ' comments as a bonus side effect ( 0 = ignore ) <nl> + align_right_cmt_at_col = 0 # unsigned number <nl> + <nl> + # The span for aligning function prototypes ( 0 = don ' t align ) . <nl> + align_func_proto_span = 0 # unsigned number <nl> + <nl> + # Minimum gap between the return type and the function name . <nl> + align_func_proto_gap = 0 # unsigned number <nl> + <nl> + # Align function protos on the ' operator ' keyword instead of what follows . <nl> + align_on_operator = false # false / true <nl> + <nl> + # Whether to mix aligning prototype and variable declarations . <nl> + # If True , align_var_def_XXX options are used instead of align_func_proto_XXX options . <nl> + align_mix_var_proto = false # false / true <nl> + <nl> + # Align single - line functions with function prototypes , uses align_func_proto_span . <nl> + align_single_line_func = false # false / true <nl> + <nl> + # Aligning the open brace of single - line functions . <nl> + # Requires align_single_line_func = True , uses align_func_proto_span . <nl> + align_single_line_brace = false # false / true <nl> + <nl> + # Gap for align_single_line_brace . <nl> + align_single_line_brace_gap = 0 # unsigned number <nl> + <nl> + # The span for aligning ObjC msg spec ( 0 = don ' t align ) <nl> + align_oc_msg_spec_span = 0 # unsigned number <nl> + <nl> + # Whether to align macros wrapped with a backslash and a newline . <nl> + # This will not work right if the macro contains a multi - line comment . <nl> + align_nl_cont = false # false / true <nl> + <nl> + # # Align macro functions and variables together . <nl> + align_pp_define_together = false # false / true <nl> + <nl> + # The minimum space between label and value of a preprocessor define . <nl> + align_pp_define_gap = 0 # unsigned number <nl> + <nl> + # The span for aligning on ' # define ' bodies ( 0 = don ' t align , other = number of lines including comments between blocks ) <nl> + align_pp_define_span = 0 # unsigned number <nl> + <nl> + # Align lines that start with ' < < ' with previous ' < < ' . Default = True . <nl> + align_left_shift = true # false / true <nl> + <nl> + # Align text after asm volatile ( ) colons . <nl> + align_asm_colon = false # false / true <nl> + <nl> + # Span for aligning parameters in an Obj - C message call on the ' : ' ( 0 = don ' t align ) <nl> + align_oc_msg_colon_span = 0 # unsigned number <nl> + <nl> + # If True , always align with the first parameter , even if it is too short . <nl> + align_oc_msg_colon_first = false # false / true <nl> + <nl> + # Aligning parameters in an Obj - C ' + ' or ' - ' declaration on the ' : ' . <nl> + align_oc_decl_colon = false # false / true <nl> + <nl> + # <nl> + # Comment modifications <nl> + # <nl> + <nl> + # Try to wrap comments at cmt_width columns <nl> + cmt_width = 0 # unsigned number <nl> + <nl> + # Set the comment reflow mode ( Default = 0 ) <nl> + # 0 : no reflowing ( apart from the line wrapping due to cmt_width ) <nl> + # 1 : no touching at all <nl> + # 2 : full reflow <nl> + cmt_reflow_mode = 0 # unsigned number <nl> + <nl> + # Whether to convert all tabs to spaces in comments . Default is to leave tabs inside comments alone , unless used for indenting . <nl> + cmt_convert_tab_to_spaces = false # false / true <nl> + <nl> + # If False , disable all multi - line comment changes , including cmt_width . keyword substitution and leading chars . <nl> + # Default = True . <nl> + cmt_indent_multi = true # false / true <nl> + <nl> + # Whether to group c - comments that look like they are in a block . <nl> + cmt_c_group = false # false / true <nl> + <nl> + # Whether to put an empty ' / * ' on the first line of the combined c - comment . <nl> + cmt_c_nl_start = false # false / true <nl> + <nl> + # Whether to put a newline before the closing ' * / ' of the combined c - comment . <nl> + cmt_c_nl_end = false # false / true <nl> + <nl> + # Whether to group cpp - comments that look like they are in a block . <nl> + cmt_cpp_group = false # false / true <nl> + <nl> + # Whether to put an empty ' / * ' on the first line of the combined cpp - comment . <nl> + cmt_cpp_nl_start = false # false / true <nl> + <nl> + # Whether to put a newline before the closing ' * / ' of the combined cpp - comment . <nl> + cmt_cpp_nl_end = false # false / true <nl> + <nl> + # Whether to change cpp - comments into c - comments . <nl> + cmt_cpp_to_c = false # false / true <nl> + <nl> + # Whether to put a star on subsequent comment lines . <nl> + cmt_star_cont = false # false / true <nl> + <nl> + # The number of spaces to insert at the start of subsequent comment lines . <nl> + cmt_sp_before_star_cont = 0 # unsigned number <nl> + <nl> + # The number of spaces to insert after the star on subsequent comment lines . <nl> + cmt_sp_after_star_cont = 0 # number <nl> + <nl> + # For multi - line comments with a ' * ' lead , remove leading spaces if the first and last lines of <nl> + # the comment are the same length . Default = True . <nl> + cmt_multi_check_last = true # false / true <nl> + <nl> + # For multi - line comments with a ' * ' lead , remove leading spaces if the first and last lines of <nl> + # the comment are the same length AND if the length is bigger as the first_len minimum . Default = 4 <nl> + cmt_multi_first_len_minimum = 4 # unsigned number <nl> + <nl> + # The filename that contains text to insert at the head of a file if the file doesn ' t start with a C / C + + comment . <nl> + # Will substitute $ ( filename ) with the current file ' s name . <nl> + cmt_insert_file_header = " " # string <nl> + <nl> + # The filename that contains text to insert at the end of a file if the file doesn ' t end with a C / C + + comment . <nl> + # Will substitute $ ( filename ) with the current file ' s name . <nl> + cmt_insert_file_footer = " " # string <nl> + <nl> + # The filename that contains text to insert before a function implementation if the function isn ' t preceded with a C / C + + comment . <nl> + # Will substitute $ ( function ) with the function name and $ ( javaparam ) with the javadoc @ param and @ return stuff . <nl> + # Will also substitute $ ( fclass ) with the class name : void CFoo : : Bar ( ) { . . . } . <nl> + cmt_insert_func_header = " " # string <nl> + <nl> + # The filename that contains text to insert before a class if the class isn ' t preceded with a C / C + + comment . <nl> + # Will substitute $ ( class ) with the class name . <nl> + cmt_insert_class_header = " " # string <nl> + <nl> + # The filename that contains text to insert before a Obj - C message specification if the method isn ' t preceded with a C / C + + comment . <nl> + # Will substitute $ ( message ) with the function name and $ ( javaparam ) with the javadoc @ param and @ return stuff . <nl> + cmt_insert_oc_msg_header = " " # string <nl> + <nl> + # If a preprocessor is encountered when stepping backwards from a function name , then <nl> + # this option decides whether the comment should be inserted . <nl> + # Affects cmt_insert_oc_msg_header , cmt_insert_func_header and cmt_insert_class_header . <nl> + cmt_insert_before_preproc = false # false / true <nl> + <nl> + # If a function is declared inline to a class definition , then <nl> + # this option decides whether the comment should be inserted . <nl> + # Affects cmt_insert_func_header . <nl> + cmt_insert_before_inlines = true # false / true <nl> + <nl> + # If the function is a constructor / destructor , then <nl> + # this option decides whether the comment should be inserted . <nl> + # Affects cmt_insert_func_header . <nl> + cmt_insert_before_ctor_dtor = false # false / true <nl> + <nl> + # <nl> + # Code modifying options ( non - whitespace ) <nl> + # <nl> + <nl> + # Add or remove braces on single - line ' do ' statement . <nl> + mod_full_brace_do = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove braces on single - line ' for ' statement . <nl> + mod_full_brace_for = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove braces on single - line function definitions . ( Pawn ) . <nl> + mod_full_brace_function = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove braces on single - line ' if ' statement . Will not remove the braces if they contain an ' else ' . <nl> + mod_full_brace_if = remove # ignore / add / remove / force <nl> + <nl> + # Make all if / elseif / else statements in a chain be braced or not . Overrides mod_full_brace_if . <nl> + # If any must be braced , they are all braced . If all can be unbraced , then the braces are removed . <nl> + mod_full_brace_if_chain = false # false / true <nl> + <nl> + # Make all if / elseif / else statements with at least one ' else ' or ' else if ' fully braced . <nl> + # If mod_full_brace_if_chain is used together with this option , all if - else chains will get braces , <nl> + # and simple ' if ' statements will lose them ( if possible ) . <nl> + mod_full_brace_if_chain_only = false # false / true <nl> + <nl> + # Don ' t remove braces around statements that span N newlines <nl> + mod_full_brace_nl = 0 # unsigned number <nl> + <nl> + # Blocks removal of braces if the parenthesis of if / for / while / . . span multiple lines . <nl> + mod_full_brace_nl_block_rem_mlcond = false # false / true <nl> + <nl> + # Add or remove braces on single - line ' while ' statement . <nl> + mod_full_brace_while = remove # ignore / add / remove / force <nl> + <nl> + # Add or remove braces on single - line ' using ( ) ' statement . <nl> + mod_full_brace_using = ignore # ignore / add / remove / force <nl> + <nl> + # Add or remove unnecessary paren on ' return ' statement . <nl> + mod_paren_on_return = remove # ignore / add / remove / force <nl> + <nl> + # Whether to change optional semicolons to real semicolons . <nl> + mod_pawn_semicolon = false # false / true <nl> + <nl> + # Add parens on ' while ' and ' if ' statement around bools . <nl> + mod_full_paren_if_bool = false # false / true <nl> + <nl> + # Whether to remove superfluous semicolons . <nl> + mod_remove_extra_semicolon = false # false / true <nl> + <nl> + # If a function body exceeds the specified number of newlines and doesn ' t have a comment after <nl> + # the close brace , a comment will be added . <nl> + mod_add_long_function_closebrace_comment = 0 # unsigned number <nl> + <nl> + # If a namespace body exceeds the specified number of newlines and doesn ' t have a comment after <nl> + # the close brace , a comment will be added . <nl> + mod_add_long_namespace_closebrace_comment = 0 # unsigned number <nl> + <nl> + # If a class body exceeds the specified number of newlines and doesn ' t have a comment after <nl> + # the close brace , a comment will be added . <nl> + mod_add_long_class_closebrace_comment = 0 # unsigned number <nl> + <nl> + # If a switch body exceeds the specified number of newlines and doesn ' t have a comment after <nl> + # the close brace , a comment will be added . <nl> + mod_add_long_switch_closebrace_comment = 0 # unsigned number <nl> + <nl> + # If an # ifdef body exceeds the specified number of newlines and doesn ' t have a comment after <nl> + # the # endif , a comment will be added . <nl> + mod_add_long_ifdef_endif_comment = 0 # unsigned number <nl> + <nl> + # If an # ifdef or # else body exceeds the specified number of newlines and doesn ' t have a comment after <nl> + # the # else , a comment will be added . <nl> + mod_add_long_ifdef_else_comment = 0 # unsigned number <nl> + <nl> + # If True , will sort consecutive single - line ' import ' statements [ Java , D ] . <nl> + mod_sort_import = false # false / true <nl> + <nl> + # If True , will sort consecutive single - line ' using ' statements [ C # ] . <nl> + mod_sort_using = false # false / true <nl> + <nl> + # If True , will sort consecutive single - line ' # include ' statements [ C / C + + ] and ' # import ' statements [ Obj - C ] <nl> + # This is generally a bad idea , as it may break your code . <nl> + mod_sort_include = false # false / true <nl> + <nl> + # If True , it will move a ' break ' that appears after a fully braced ' case ' before the close brace . <nl> + mod_move_case_break = false # false / true <nl> + <nl> + # Will add or remove the braces around a fully braced case statement . <nl> + # Will only remove the braces if there are no variable declarations in the block . <nl> + mod_case_brace = ignore # ignore / add / remove / force <nl> + <nl> + # If True , it will remove a void ' return ; ' that appears as the last statement in a function . <nl> + mod_remove_empty_return = false # false / true <nl> + <nl> + # If True , it will organize the properties ( Obj - C ) . <nl> + mod_sort_oc_properties = false # false / true <nl> + <nl> + # Determines weight of class property modifier ( Obj - C ) . <nl> + mod_sort_oc_property_class_weight = 0 # number <nl> + <nl> + # Determines weight of atomic , nonatomic ( Obj - C ) . <nl> + mod_sort_oc_property_thread_safe_weight = 0 # number <nl> + <nl> + # Determines weight of readwrite ( Obj - C ) . <nl> + mod_sort_oc_property_readwrite_weight = 0 # number <nl> + <nl> + # Determines weight of reference type ( retain , copy , assign , weak , strong ) ( Obj - C ) . <nl> + mod_sort_oc_property_reference_weight = 0 # number <nl> + <nl> + # Determines weight of getter type ( getter = ) ( Obj - C ) . <nl> + mod_sort_oc_property_getter_weight = 0 # number <nl> + <nl> + # Determines weight of setter type ( setter = ) ( Obj - C ) . <nl> + mod_sort_oc_property_setter_weight = 0 # number <nl> + <nl> + # Determines weight of nullability type ( nullable , nonnull , null_unspecified , null_resettable ) ( Obj - C ) . <nl> + mod_sort_oc_property_nullability_weight = 0 # number <nl> + <nl> + # <nl> + # Preprocessor options <nl> + # <nl> + <nl> + # Control indent of preprocessors inside # if blocks at brace level 0 ( file - level ) . <nl> + pp_indent = ignore # ignore / add / remove / force <nl> + <nl> + # Whether to indent # if / # else / # endif at the brace level ( True ) or from column 1 ( False ) . <nl> + pp_indent_at_level = false # false / true <nl> + <nl> + # Specifies the number of columns to indent preprocessors per level at brace level 0 ( file - level ) . <nl> + # If pp_indent_at_level = False , specifies the number of columns to indent preprocessors per level at brace level > 0 ( function - level ) . <nl> + # Default = 1 . <nl> + pp_indent_count = 1 # unsigned number <nl> + <nl> + # Add or remove space after # based on pp_level of # if blocks . <nl> + pp_space = ignore # ignore / add / remove / force <nl> + <nl> + # Sets the number of spaces added with pp_space . <nl> + pp_space_count = 0 # unsigned number <nl> + <nl> + # The indent for # region and # endregion in C # and ' # pragma region ' in C / C + + . <nl> + pp_indent_region = 0 # number <nl> + <nl> + # Whether to indent the code between # region and # endregion . <nl> + pp_region_indent_code = false # false / true <nl> + <nl> + # If pp_indent_at_level = True , sets the indent for # if , # else and # endif when not at file - level . <nl> + # 0 : indent preprocessors using output_tab_size . <nl> + # > 0 : column at which all preprocessors will be indented . <nl> + pp_indent_if = 0 # number <nl> + <nl> + # Control whether to indent the code between # if , # else and # endif . <nl> + pp_if_indent_code = false # false / true <nl> + <nl> + # Whether to indent ' # define ' at the brace level ( True ) or from column 1 ( false ) . <nl> + pp_define_at_level = false # false / true <nl> + <nl> + # Whether to ignore the ' # define ' body while formatting . <nl> + pp_ignore_define_body = false # false / true <nl> + <nl> + # Whether to indent case statements between # if , # else , and # endif . <nl> + # Only applies to the indent of the preprocesser that the case statements directly inside of . <nl> + pp_indent_case = true # false / true <nl> + <nl> + # Whether to indent whole function definitions between # if , # else , and # endif . <nl> + # Only applies to the indent of the preprocesser that the function definition is directly inside of . <nl> + pp_indent_func_def = true # false / true <nl> + <nl> + # Whether to indent extern C blocks between # if , # else , and # endif . <nl> + # Only applies to the indent of the preprocesser that the extern block is directly inside of . <nl> + pp_indent_extern = true # false / true <nl> + <nl> + # Whether to indent braces directly inside # if , # else , and # endif . <nl> + # Only applies to the indent of the preprocesser that the braces are directly inside of . <nl> + pp_indent_brace = true # false / true <nl> + <nl> + # <nl> + # Sort includes options <nl> + # <nl> + <nl> + # The regex for include category with priority 0 . <nl> + include_category_0 = " " # string <nl> + <nl> + # The regex for include category with priority 1 . <nl> + include_category_1 = " " # string <nl> + <nl> + # The regex for include category with priority 2 . <nl> + include_category_2 = " " # string <nl> + <nl> + # <nl> + # Use or Do not Use options <nl> + # <nl> + <nl> + # True : indent_func_call_param will be used ( default ) <nl> + # False : indent_func_call_param will NOT be used . <nl> + use_indent_func_call_param = true # false / true <nl> + <nl> + # The value of the indentation for a continuation line is calculate differently if the line is : <nl> + # a declaration : your case with QString fileName . . . <nl> + # an assignment : your case with pSettings = new QSettings ( . . . <nl> + # At the second case the option value might be used twice : <nl> + # at the assignment <nl> + # at the function call ( if present ) <nl> + # To prevent the double use of the option value , use this option with the value ' True ' . <nl> + # True : indent_continue will be used only once <nl> + # False : indent_continue will be used every time ( default ) . <nl> + use_indent_continue_only_once = false # false / true <nl> + <nl> + # SIGNAL / SLOT Qt macros have special formatting options . See options_for_QT . cpp for details . <nl> + # Default = True . <nl> + use_options_overriding_for_qt_macros = true # false / true <nl> + <nl> + # <nl> + # Warn levels - 1 : error , 2 : warning ( default ) , 3 : note <nl> + # <nl> + <nl> + # Warning is given if doing tab - to - \ t replacement and we have found one in a C # verbatim string literal . <nl> + warn_level_tabs_found_in_verbatim_string_literals = 2 # unsigned number <nl> + <nl> + # Meaning of the settings : <nl> + # Ignore - do not do any changes <nl> + # Add - makes sure there is 1 or more space / brace / newline / etc <nl> + # Force - makes sure there is exactly 1 space / brace / newline / etc , <nl> + # behaves like Add in some contexts <nl> + # Remove - removes space / brace / newline / etc <nl> + # <nl> + # <nl> + # - Token ( s ) can be treated as specific type ( s ) with the ' set ' option : <nl> + # ` set tokenType tokenString [ tokenString . . . ] ` <nl> + # <nl> + # Example : <nl> + # ` set BOOL __AND__ __OR__ ` <nl> + # <nl> + # tokenTypes are defined in src / token_enum . h , use them without the <nl> + # ' CT_ ' prefix : ' CT_BOOL ' - > ' BOOL ' <nl> + # <nl> + # <nl> + # - Token ( s ) can be treated as type ( s ) with the ' type ' option . <nl> + # ` type tokenString [ tokenString . . . ] ` <nl> + # <nl> + # Example : <nl> + # ` type int c_uint_8 Rectangle ` <nl> + # <nl> + # This can also be achieved with ` set TYPE int c_uint_8 Rectangle ` <nl> + # <nl> + # <nl> + # To embed whitespace in tokenStrings use the ' \ ' escape character , or quote <nl> + # the tokenStrings . These quotes are supported : " ' ` <nl> + # <nl> + # <nl> + # - Support for the auto detection of languages through the file ending can be <nl> + # added using the ' file_ext ' command . <nl> + # ` file_ext langType langString [ langString . . ] ` <nl> + # <nl> + # Example : <nl> + # ` file_ext CPP . ch . cxx . cpp . in ` <nl> + # <nl> + # langTypes are defined in uncrusify_types . h in the lang_flag_e enum , use <nl> + # them without the ' LANG_ ' prefix : ' LANG_CPP ' - > ' CPP ' <nl> + # <nl> + # <nl> + # - Custom macro - based indentation can be set up using ' macro - open ' , <nl> + # ' macro - else ' and ' macro - close ' . <nl> + # ` ( macro - open | macro - else | macro - close ) tokenString ` <nl> + # <nl> + # Example : <nl> + # ` macro - open BEGIN_TEMPLATE_MESSAGE_MAP ` <nl> + # ` macro - open BEGIN_MESSAGE_MAP ` <nl> + # ` macro - close END_MESSAGE_MAP ` <nl> + # <nl> + # # option ( s ) with ' not default ' value : 0 <nl> + # <nl>
Merge pull request from iattempt / check - coding - style - in - cpp
OpenGenus/cosmos
ceb2a8a3456f16b3efe8fcce44f3b37641436661
2018-01-29T20:04:33Z
mmm a / src / compiler / backend / instruction - selector . cc <nl> ppp b / src / compiler / backend / instruction - selector . cc <nl> void InstructionSelector : : VisitNode ( Node * node ) { <nl> return MarkAsFloat64 ( node ) , VisitF64x2ExtractLane ( node ) ; <nl> case IrOpcode : : kF64x2ReplaceLane : <nl> return MarkAsSimd128 ( node ) , VisitF64x2ReplaceLane ( node ) ; <nl> + case IrOpcode : : kF64x2Eq : <nl> + return MarkAsSimd128 ( node ) , VisitF64x2Eq ( node ) ; <nl> + case IrOpcode : : kF64x2Ne : <nl> + return MarkAsSimd128 ( node ) , VisitF64x2Ne ( node ) ; <nl> case IrOpcode : : kF32x4Splat : <nl> return MarkAsSimd128 ( node ) , VisitF32x4Splat ( node ) ; <nl> case IrOpcode : : kF32x4ExtractLane : <nl> void InstructionSelector : : VisitWord64AtomicCompareExchange ( Node * node ) { <nl> void InstructionSelector : : VisitF64x2Splat ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> void InstructionSelector : : VisitF64x2ExtractLane ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> void InstructionSelector : : VisitF64x2ReplaceLane ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> + void InstructionSelector : : VisitF64x2Eq ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> + void InstructionSelector : : VisitF64x2Ne ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> void InstructionSelector : : VisitI64x2Splat ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> void InstructionSelector : : VisitI64x2ExtractLane ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> void InstructionSelector : : VisitI64x2ReplaceLane ( Node * node ) { UNIMPLEMENTED ( ) ; } <nl> mmm a / src / compiler / backend / x64 / code - generator - x64 . cc <nl> ppp b / src / compiler / backend / x64 / code - generator - x64 . cc <nl> CodeGenerator : : CodeGenResult CodeGenerator : : AssembleArchInstruction ( <nl> __ movq ( i . OutputDoubleRegister ( ) , kScratchRegister ) ; <nl> break ; <nl> } <nl> + case kX64F64x2Eq : { <nl> + DCHECK_EQ ( i . OutputSimd128Register ( ) , i . InputSimd128Register ( 0 ) ) ; <nl> + __ cmpeqpd ( i . OutputSimd128Register ( ) , i . InputSimd128Register ( 1 ) ) ; <nl> + break ; <nl> + } <nl> + case kX64F64x2Ne : { <nl> + DCHECK_EQ ( i . OutputSimd128Register ( ) , i . InputSimd128Register ( 0 ) ) ; <nl> + __ cmpneqpd ( i . OutputSimd128Register ( ) , i . InputSimd128Register ( 1 ) ) ; <nl> + break ; <nl> + } <nl> / / TODO ( gdeepti ) : Get rid of redundant moves for F32x4Splat / Extract below <nl> case kX64F32x4Splat : { <nl> XMMRegister dst = i . OutputSimd128Register ( ) ; <nl> mmm a / src / compiler / backend / x64 / instruction - codes - x64 . h <nl> ppp b / src / compiler / backend / x64 / instruction - codes - x64 . h <nl> namespace compiler { <nl> V ( X64F64x2Splat ) \ <nl> V ( X64F64x2ExtractLane ) \ <nl> V ( X64F64x2ReplaceLane ) \ <nl> + V ( X64F64x2Eq ) \ <nl> + V ( X64F64x2Ne ) \ <nl> V ( X64F32x4Splat ) \ <nl> V ( X64F32x4ExtractLane ) \ <nl> V ( X64F32x4ReplaceLane ) \ <nl> mmm a / src / compiler / backend / x64 / instruction - scheduler - x64 . cc <nl> ppp b / src / compiler / backend / x64 / instruction - scheduler - x64 . cc <nl> int InstructionScheduler : : GetTargetInstructionFlags ( <nl> case kX64F64x2Splat : <nl> case kX64F64x2ExtractLane : <nl> case kX64F64x2ReplaceLane : <nl> + case kX64F64x2Eq : <nl> + case kX64F64x2Ne : <nl> case kX64F32x4Splat : <nl> case kX64F32x4ExtractLane : <nl> case kX64F32x4ReplaceLane : <nl> mmm a / src / compiler / backend / x64 / instruction - selector - x64 . cc <nl> ppp b / src / compiler / backend / x64 / instruction - selector - x64 . cc <nl> VISIT_ATOMIC_BINOP ( Xor ) <nl> V ( I8x16 ) <nl> <nl> # define SIMD_BINOP_LIST ( V ) \ <nl> + V ( F64x2Eq ) \ <nl> + V ( F64x2Ne ) \ <nl> V ( F32x4Add ) \ <nl> V ( F32x4AddHoriz ) \ <nl> V ( F32x4Sub ) \ <nl> mmm a / src / compiler / machine - operator . cc <nl> ppp b / src / compiler / machine - operator . cc <nl> MachineType AtomicOpType ( Operator const * op ) { <nl> V ( Word32PairShr , Operator : : kNoProperties , 3 , 0 , 2 ) \ <nl> V ( Word32PairSar , Operator : : kNoProperties , 3 , 0 , 2 ) \ <nl> V ( F64x2Splat , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> + V ( F64x2Eq , Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> + V ( F64x2Ne , Operator : : kCommutative , 2 , 0 , 1 ) \ <nl> V ( F32x4Splat , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> V ( F32x4SConvertI32x4 , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> V ( F32x4UConvertI32x4 , Operator : : kNoProperties , 1 , 0 , 1 ) \ <nl> mmm a / src / compiler / machine - operator . h <nl> ppp b / src / compiler / machine - operator . h <nl> class V8_EXPORT_PRIVATE MachineOperatorBuilder final <nl> const Operator * F64x2Splat ( ) ; <nl> const Operator * F64x2ExtractLane ( int32_t ) ; <nl> const Operator * F64x2ReplaceLane ( int32_t ) ; <nl> + const Operator * F64x2Eq ( ) ; <nl> + const Operator * F64x2Ne ( ) ; <nl> + <nl> const Operator * F32x4Splat ( ) ; <nl> const Operator * F32x4ExtractLane ( int32_t ) ; <nl> const Operator * F32x4ReplaceLane ( int32_t ) ; <nl> mmm a / src / compiler / opcodes . h <nl> ppp b / src / compiler / opcodes . h <nl> <nl> V ( F64x2Splat ) \ <nl> V ( F64x2ExtractLane ) \ <nl> V ( F64x2ReplaceLane ) \ <nl> + V ( F64x2Eq ) \ <nl> + V ( F64x2Ne ) \ <nl> V ( F32x4Splat ) \ <nl> V ( F32x4ExtractLane ) \ <nl> V ( F32x4ReplaceLane ) \ <nl> mmm a / src / compiler / wasm - compiler . cc <nl> ppp b / src / compiler / wasm - compiler . cc <nl> Node * WasmGraphBuilder : : SimdOp ( wasm : : WasmOpcode opcode , Node * const * inputs ) { <nl> switch ( opcode ) { <nl> case wasm : : kExprF64x2Splat : <nl> return graph ( ) - > NewNode ( mcgraph ( ) - > machine ( ) - > F64x2Splat ( ) , inputs [ 0 ] ) ; <nl> + case wasm : : kExprF64x2Eq : <nl> + return graph ( ) - > NewNode ( mcgraph ( ) - > machine ( ) - > F64x2Eq ( ) , inputs [ 0 ] , <nl> + inputs [ 1 ] ) ; <nl> + case wasm : : kExprF64x2Ne : <nl> + return graph ( ) - > NewNode ( mcgraph ( ) - > machine ( ) - > F64x2Ne ( ) , inputs [ 0 ] , <nl> + inputs [ 1 ] ) ; <nl> case wasm : : kExprF32x4Splat : <nl> return graph ( ) - > NewNode ( mcgraph ( ) - > machine ( ) - > F32x4Splat ( ) , inputs [ 0 ] ) ; <nl> case wasm : : kExprF32x4SConvertI32x4 : <nl> mmm a / src / wasm / wasm - interpreter . cc <nl> ppp b / src / wasm / wasm - interpreter . cc <nl> class ThreadImpl { <nl> Push ( WasmValue ( Simd128 ( res ) ) ) ; \ <nl> return true ; \ <nl> } <nl> + CMPOP_CASE ( F64x2Eq , f64x2 , float2 , int2 , 2 , a = = b ) <nl> + CMPOP_CASE ( F64x2Ne , f64x2 , float2 , int2 , 2 , a ! = b ) <nl> CMPOP_CASE ( F32x4Eq , f32x4 , float4 , int4 , 4 , a = = b ) <nl> CMPOP_CASE ( F32x4Ne , f32x4 , float4 , int4 , 4 , a ! = b ) <nl> CMPOP_CASE ( F32x4Gt , f32x4 , float4 , int4 , 4 , a > b ) <nl> mmm a / src / wasm / wasm - opcodes . cc <nl> ppp b / src / wasm / wasm - opcodes . cc <nl> const char * WasmOpcodes : : OpcodeName ( WasmOpcode opcode ) { <nl> / / Standard opcodes <nl> CASE_INT_OP ( Eqz , " eqz " ) <nl> CASE_ALL_OP ( Eq , " eq " ) <nl> - CASE_I64x2_OP ( Eq , " eq " ) <nl> CASE_ALL_OP ( Ne , " ne " ) <nl> - CASE_I64x2_OP ( Ne , " ne " ) <nl> CASE_ALL_OP ( Add , " add " ) <nl> CASE_ALL_OP ( Sub , " sub " ) <nl> CASE_ALL_OP ( Mul , " mul " ) <nl> const char * WasmOpcodes : : OpcodeName ( WasmOpcode opcode ) { <nl> CASE_SIMD_OP ( Neg , " neg " ) <nl> CASE_I64x2_OP ( Neg , " neg " ) <nl> CASE_SIMD_OP ( Eq , " eq " ) <nl> + CASE_F64x2_OP ( Eq , " eq " ) <nl> + CASE_I64x2_OP ( Eq , " eq " ) <nl> CASE_SIMD_OP ( Ne , " ne " ) <nl> + CASE_F64x2_OP ( Ne , " ne " ) <nl> + CASE_I64x2_OP ( Ne , " ne " ) <nl> CASE_SIMD_OP ( Add , " add " ) <nl> CASE_I64x2_OP ( Add , " add " ) <nl> CASE_SIMD_OP ( Sub , " sub " ) <nl> mmm a / src / wasm / wasm - opcodes . h <nl> ppp b / src / wasm / wasm - opcodes . h <nl> bool IsJSCompatibleSignature ( const FunctionSig * sig , bool hasBigIntFeature ) ; <nl> V ( F32x4Gt , 0xfd43 , s_ss ) \ <nl> V ( F32x4Le , 0xfd44 , s_ss ) \ <nl> V ( F32x4Ge , 0xfd45 , s_ss ) \ <nl> + V ( F64x2Eq , 0xfd46 , s_ss ) \ <nl> + V ( F64x2Ne , 0xfd47 , s_ss ) \ <nl> V ( S128Not , 0xfd4c , s_s ) \ <nl> V ( S128And , 0xfd4d , s_ss ) \ <nl> V ( S128Or , 0xfd4e , s_ss ) \ <nl> mmm a / test / cctest / wasm / test - run - wasm - simd . cc <nl> ppp b / test / cctest / wasm / test - run - wasm - simd . cc <nl> namespace test_run_wasm_simd { <nl> <nl> namespace { <nl> <nl> + using DoubleCompareOp = int64_t ( * ) ( double , double ) ; <nl> using FloatUnOp = float ( * ) ( float ) ; <nl> using FloatBinOp = float ( * ) ( float , float ) ; <nl> using FloatCompareOp = int ( * ) ( float , float ) ; <nl> T Sqrt ( T a ) { <nl> return std : : sqrt ( a ) ; <nl> } <nl> <nl> + # if V8_TARGET_ARCH_X64 <nl> + / / only used for F64x2 tests below <nl> + int64_t Equal ( double a , double b ) { return a = = b ? - 1 : 0 ; } <nl> + <nl> + int64_t NotEqual ( double a , double b ) { return a ! = b ? - 1 : 0 ; } <nl> + # endif / / V8_TARGET_ARCH_X64 <nl> + <nl> } / / namespace <nl> <nl> # define WASM_SIMD_CHECK_LANE ( TYPE , value , LANE_TYPE , lane_value , lane_index ) \ <nl> WASM_SIMD_TEST_NO_LOWERING ( F64x2ReplaceLane ) { <nl> } <nl> } <nl> <nl> + void RunF64x2CompareOpTest ( ExecutionTier execution_tier , LowerSimd lower_simd , <nl> + WasmOpcode opcode , DoubleCompareOp expected_op ) { <nl> + WasmRunner < int32_t , double , double > r ( execution_tier , lower_simd ) ; <nl> + / / Set up global to hold mask output . <nl> + int64_t * g = r . builder ( ) . AddGlobal < int64_t > ( kWasmS128 ) ; <nl> + / / Build fn to splat test values , perform compare op , and write the result . <nl> + byte value1 = 0 , value2 = 1 ; <nl> + byte temp1 = r . AllocateLocal ( kWasmS128 ) ; <nl> + byte temp2 = r . AllocateLocal ( kWasmS128 ) ; <nl> + BUILD ( r , WASM_SET_LOCAL ( temp1 , WASM_SIMD_F64x2_SPLAT ( WASM_GET_LOCAL ( value1 ) ) ) , <nl> + WASM_SET_LOCAL ( temp2 , WASM_SIMD_F64x2_SPLAT ( WASM_GET_LOCAL ( value2 ) ) ) , <nl> + WASM_SET_GLOBAL ( 0 , WASM_SIMD_BINOP ( opcode , WASM_GET_LOCAL ( temp1 ) , <nl> + WASM_GET_LOCAL ( temp2 ) ) ) , <nl> + WASM_ONE ) ; <nl> + <nl> + FOR_FLOAT64_INPUTS ( x ) { <nl> + if ( ! PlatformCanRepresent ( x ) ) continue ; <nl> + FOR_FLOAT64_INPUTS ( y ) { <nl> + if ( ! PlatformCanRepresent ( y ) ) continue ; <nl> + double diff = x - y ; / / Model comparison as subtraction . <nl> + if ( ! PlatformCanRepresent ( diff ) ) continue ; <nl> + r . Call ( x , y ) ; <nl> + int64_t expected = expected_op ( x , y ) ; <nl> + for ( int i = 0 ; i < 2 ; i + + ) { <nl> + CHECK_EQ ( expected , ReadLittleEndianValue < int64_t > ( & g [ i ] ) ) ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + <nl> + WASM_SIMD_TEST_NO_LOWERING ( F64x2Eq ) { <nl> + RunF64x2CompareOpTest ( execution_tier , lower_simd , kExprF64x2Eq , Equal ) ; <nl> + } <nl> + <nl> + WASM_SIMD_TEST_NO_LOWERING ( F64x2Ne ) { <nl> + RunF64x2CompareOpTest ( execution_tier , lower_simd , kExprF64x2Ne , NotEqual ) ; <nl> + } <nl> + <nl> WASM_SIMD_TEST_NO_LOWERING ( I64x2Splat ) { <nl> WasmRunner < int32_t , int64_t > r ( execution_tier , lower_simd ) ; <nl> / / Set up a global to hold output vector . <nl>
[ wasm simd ] Implement F64x2Eq and F64x2Ne on x64
v8/v8
0860288c5eaf47993a2155a60ee83fb398066499
2019-07-16T03:30:29Z
mmm a / Documentation / Books / Cookbook / Compiling / Windows . md <nl> ppp b / Documentation / Books / Cookbook / Compiling / Windows . md <nl> Compiling ArangoDB under Windows <nl> Problem <nl> mmmmmm - <nl> <nl> - I want to compile ArangoDB 3 . 0 and onwards under Windows . <nl> + I want to compile ArangoDB 3 . 4 and onwards under Windows . <nl> <nl> - * * Note : * * For this recipe you need at least ArangoDB 3 . 0 ; <nl> - For ArangoDB version before 3 . 0 look at the [ old Compiling ArangoDB under Windows ] ( https : / / docs . arangodb . com / 2 . 8 / Cookbook / CompilingUnderWindows . html ) . <nl> + * * Note : * * If you want to compile version 3 . 3 or earlier , then look at the <nl> + [ Compiling ArangoDB under Windows ] ( https : / / docs . arangodb . com / 3 . 3 / Cookbook / Compiling / Windows . html ) <nl> + recipe in the 3 . 3 documentation . <nl> <nl> Solution <nl> mmmmmm - - <nl> <nl> - With ArangoDB 3 . 0 a complete cmake environment was introduced . This also streamlines the dependencies on windows . <nl> + With ArangoDB 3 . 0 a complete cmake environment was introduced . This also streamlines the dependencies on Windows . <nl> We suggest to use [ chocolatey . org ] ( https : / / chocolatey . org / ) to install most of the dependencies . For sure <nl> most projects offer their own setup & install packages , chocolatey offers a simplified way to install them <nl> - with less user interactions . You can even use chocolatey via the brand new <nl> - [ ansibles 2 . 0 winrm facility ] ( http : / / docs . ansible . com / ansible / intro_windows . html ) <nl> - to do unattended installations of some software on windows - the cool thing linux guys always told you about . <nl> + with less user interactions . You can even use chocolatey via <nl> + [ ansibles 2 . 7 winrm facility ] ( https : / / docs . ansible . com / ansible / latest / user_guide / windows . html ) <nl> + to do unattended installations of some software on Windows . <nl> <nl> # # # Ingredients <nl> <nl> - First install the choco package manager by pasting this tiny cmdlet into a command window * ( needs to be run with Administrator privileges ; Right click start menu , * * Command Prompt ( Admin ) * * ) * : <nl> + First install the choco package manager by pasting this tiny cmdlet into a command window <nl> + * ( needs to be run with Administrator privileges ; Right click start menu , * * Command Prompt ( Admin ) * * ) * : <nl> <nl> @ powershell - NoProfile - ExecutionPolicy Bypass - Command " iex ( ( new - object net . webclient ) . DownloadString ( ' https : / / chocolatey . org / install . ps1 ' ) ) " & & SET PATH = % PATH % ; % ALLUSERSPROFILE % \ chocolatey \ bin <nl> <nl> First install the choco package manager by pasting this tiny cmdlet into a comma <nl> Since choco currently fails to alter the environment for <nl> [ Microsoft Visual Studio ] ( https : / / www . visualstudio . com / en - us / products / visual - studio - community - vs . aspx ) , <nl> we suggest to download and install Visual Studio by hand . <nl> - Currently Visual Studio 2015 is the only supported option . <nl> + Currently Visual Studio 2017 is the only supported option . <nl> <nl> - * * You need to make sure that it installs the option " Programming Languages / C + + " , else cmake will fail to dectect it later on . * * <nl> + { % hint ' warning ' % } <nl> + You need to make sure that it installs the * * Desktop development with C + + * * preset , <nl> + else cmake will fail to detect it later on . Furthermore , the * * Windows 8 . 1 SDK and UCRT SDK * * <nl> + optional component is required to be selected during Visual Studio installation , else V8 <nl> + will fail to compile later on . <nl> + { % endhint % } <nl> <nl> After it successfully installed , start it once , so it can finish its setup . <nl> <nl> - # # # # More dependencies <nl> - Now you can invoke the choco package manager for an unattended install of the dependencies * ( needs to be run with Administrator privileges again ) * : <nl> + # # # # More Dependencies <nl> <nl> - choco install - y cmake . portable nsis python2 procdump windbg wget nuget . commandline <nl> + Now you can invoke the choco package manager for an unattended install of the dependencies <nl> + * ( needs to be run with Administrator privileges again ) * : <nl> <nl> - Then we fetch the [ OpenSSL ] ( https : / / openssl . org ) library via the nuget commandline client * ( doesn ' t need Administrator privileges ) * : <nl> + choco install - y cmake . portable nsis python2 procdump windbg wget <nl> <nl> - nuget install openssl <nl> + Then we need to install the [ OpenSSL ] ( https : / / openssl . org ) library from its sources or using precompiled <nl> + [ Third Party OpenSSL Related Binary Distributions ] ( https : / / wiki . openssl . org / index . php / Binaries ) . <nl> <nl> - # # # # Optional <nl> + # # # # Optional Dependencies <nl> <nl> - If you intend to run the unit tests or compile from git , you also need * ( needs to be run with Administrator privileges again ) * : <nl> + If you intend to run the unit tests or compile from git , you also need <nl> + * ( needs to be run with Administrator privileges again ) * : <nl> <nl> choco install - y git winflexbison ruby <nl> <nl> Close and reopen the Administrator command window in order to continue with the <nl> <nl> choco install - y ruby2 . devkit <nl> <nl> - And manually install the requirements via the ` Gemfile ` fetched from the ArangoDB Git repository * ( needs to be run with Administrator privileges ) * : <nl> + And manually install the requirements via the ` Gemfile ` fetched from the ArangoDB Git repository <nl> + * ( needs to be run with Administrator privileges ) * : <nl> <nl> - wget https : / / raw . githubusercontent . com / arangodb / arangodb / devel / tests / HttpInterface / Gemfile <nl> - set PATH = % PATH % ; C : \ tools \ DevKit2 \ bin ; C : \ tools \ DevKit2 \ mingw \ bin <nl> + wget https : / / raw . githubusercontent . com / arangodb / arangodb / devel / tests / rb / HttpInterface / Gemfile <nl> + setx PATH % PATH % ; C : \ tools \ DevKit2 \ bin ; C : \ tools \ DevKit2 \ mingw \ bin <nl> gem install bundler <nl> bundler <nl> <nl> Note that the V8 build scripts and gyp aren ' t compatible with Python 3 . x hence you need python2 ! <nl> <nl> # # # Building ArangoDB <nl> + <nl> Download and extract the release tarball from https : / / www . arangodb . com / download / <nl> <nl> - Or clone the github repository , and checkout the branch or tag you need ( devel , 3 . 0 ) <nl> + Or clone the GitHub repository and checkout the branch or tag you need ( e . g . ` devel ` ) <nl> <nl> git clone https : / / github . com / arangodb / arangodb . git - b devel <nl> cd arangodb <nl> Generate the Visual studio project files , and check back that cmake discovered a <nl> <nl> mkdir Build64 <nl> cd Build64 <nl> - cmake - G " Visual Studio 14 Win64 " . . <nl> + cmake - G " Visual Studio 15 2017 Win64 " . . <nl> <nl> - Note that in some cases cmake struggles to find the proper python interpreter ( i . e . the cygwin one won ' t work ) . You can force overrule it by appending : <nl> + Note that in some cases cmake struggles to find the proper python interpreter <nl> + ( i . e . the cygwin one won ' t work ) . You can force overrule it by appending : <nl> <nl> - - DPYTHON_EXECUTABLE : FILEPATH = C : / tools / python2 / python . exe <nl> + - DPYTHON_EXECUTABLE : FILEPATH = C : / Python27 / python . exe <nl> <nl> You can now load these in the Visual Studio IDE or use cmake to start the build : <nl> <nl> You can now load these in the Visual Studio IDE or use cmake to start the build : <nl> The binaries need the ICU datafile ` icudt54l . dat ` , which is automatically copied into the directory containing the <nl> executable . <nl> <nl> - For development , unit tests and documentation : Cygwin ( Optional ) <nl> - = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + # # # Unit tests ( Optional ) <nl> + <nl> + The unit tests require a [ cygwin ] ( https : / / www . cygwin . com / ) environment . <nl> <nl> - The documentation and unit tests still require a [ cygwin ] ( https : / / www . cygwin . com / ) environment . Here are the hints how to get it properly installed : <nl> + # # # # Cygwin Installation Hints <nl> <nl> You need at least ` make ` from cygwin . Cygwin also offers a ` cmake ` . Do * * not * * install the cygwin cmake . <nl> <nl> Turning ACL off ( noacl ) for all mounts in cygwin fixes permissions troubles that <nl> C : / cygwin64 / ntfs override , binary , auto , noacl 0 0 <nl> none / cygdrive cygdrive binary , posix = 0 , user , noacl 0 0 <nl> <nl> - Enable native symlinks for Cygwin and git <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> + # # # # Enable native symlinks for Cygwin and git <nl> <nl> Cygwin will create proprietary files as placeholders by default instead of <nl> actually symlinking files . The placeholders later tell Cygwin where to resolve <nl> And in Cygwin : <nl> <nl> ln - s source target <nl> <nl> - Making the ICU database publically available <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> + # # # # Making the ICU database publically available <nl> <nl> If you intend to use the machine for development purposes , it may be more practical to copy it to a common place : <nl> <nl> - cp 3rdParty / V8 / V8 - 5 . 0 . 71 . 39 / third_party / icu / source / data / in / icudtl . dat / cygdrive / c / Windows / icudt54l . dat <nl> + cd 3rdParty / V8 / v * / third_party / icu / source / data / in & & cp icudt * . dat / cygdrive / c / Windows / <nl> <nl> And configure your environment ( yes this instruction remembers to the hitchhikers guide to the galaxy . . . ) so that <nl> ` ICU_DATA ` points to ` c : \ \ Windows ` . You do that by opening the explorer , <nl> And variable name : ` ICU_DATA ` to the value : ` c : \ \ Windows ` <nl> <nl> ! [ HowtoSetEnv ] ( . . / assets / CompilingUnderWindows / SetEnvironmentVar . png ) <nl> <nl> - Running Unit tests ( Optional ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + # # # # Running Unit tests <nl> <nl> - You can then run the unit tests in the cygwin shell like that : <nl> + You can then run the integration tests in the cygwin shell like that : <nl> <nl> - build64 / bin / RelWithDebInfo / arangosh . exe \ <nl> + Build64 / bin / RelWithDebInfo / arangosh . exe \ <nl> - c etc / relative / arangosh . conf \ <nl> - - log . level warning \ <nl> - - server . endpoint tcp : / / 127 . 0 . 0 . 1 : 1024 \ <nl> - - javascript . execute UnitTests / unittest . js \ <nl> - - \ <nl> all \ <nl> - - - ruby c : / tools / ruby22 / bin / ruby \ <nl> - - - rspec c : / tools / ruby22 / bin / rspec \ <nl> + - - build Build64 \ <nl> - - buildType RelWithDebInfo \ <nl> - - skipNondeterministic true \ <nl> - - - skipTimeCritical true <nl> + - - skipTimeCritical true \ <nl> - - skipBoost true \ <nl> - - skipGeo true <nl> <nl> - Documentation ( Optional ) <nl> - = = = = = = = = = = = = = = = = = = = = = = = = <nl> - <nl> - NodeJS * ( needs to be run with Administrator privileges again ) * : <nl> - <nl> - choco install - y nodejs <nl> - <nl> - Gitbook : <nl> - <nl> - npm install - g gitbook - cli <nl> - <nl> - Markdown - pp : <nl> - <nl> - git clone https : / / github . com / triAGENS / markdown - pp . git <nl> - cd markdown - pp <nl> - python setup . py install <nl> - <nl> - Ditaa : <nl> - <nl> - Download and install : http : / / ditaa . sourceforge . net / # download <nl> + Additional options ` - - ruby c : / tools / ruby25 / bin / ruby ` and ` - - rspec c : / tools / ruby25 / bin / rspec ` <nl> + should be used only if Ruby is not in the * PATH * . <nl> <nl> * * Authors * * : <nl> [ Frank Celler ] ( https : / / github . com / fceller ) , <nl> - [ Wilfried Goesgens ] ( https : / / github . com / dothebart ) and <nl> - [ Simran Brucherseifer ] ( https : / / github . com / Simran - B ) . <nl> + [ Wilfried Goesgens ] ( https : / / github . com / dothebart ) , <nl> + [ Simran Brucherseifer ] ( https : / / github . com / Simran - B ) and <nl> + [ Vadim Kondratyev ] ( https : / / github . com / KVS85 ) . <nl> <nl> * * Tags * * : # windows <nl>
Doc - updates to the compiling under windows section ( )
arangodb/arangodb
ac37dbed895dc9dde3db267db32b1e1306419d13
2019-01-15T19:00:35Z
mmm a / CMakeLists . txt <nl> ppp b / CMakeLists . txt <nl> <nl> cmake_minimum_required ( VERSION 3 . 4 . 3 ) <nl> <nl> + # TODO : Fix RPATH usage to be CMP0068 compliant <nl> + # Disable Policy CMP0068 for CMake 3 . 9 <nl> + # rdar : / / 37725888 <nl> + if ( POLICY CMP0068 ) <nl> + cmake_policy ( SET CMP0068 OLD ) <nl> + endif ( ) <nl> + <nl> # Add path for custom CMake modules . <nl> list ( APPEND CMAKE_MODULE_PATH <nl> " $ { CMAKE_CURRENT_SOURCE_DIR } / cmake / modules " ) <nl> mmm a / docs / ABI / Mangling . rst <nl> ppp b / docs / ABI / Mangling . rst <nl> Globals <nl> global : : = type ' MP ' / / type metadata pattern <nl> global : : = type ' Ma ' / / type metadata access function <nl> global : : = type ' ML ' / / type metadata lazy cache variable <nl> + global : : = nominal - type ' Mi ' / / generic type instantiation function <nl> + global : : = nominal - type ' MI ' / / generic type instantiation cache <nl> global : : = nominal - type ' Mm ' / / class metaclass <nl> global : : = nominal - type ' Mn ' / / nominal type descriptor <nl> global : : = module ' MXM ' / / module descriptor <nl> mmm a / include / swift / Demangling / DemangleNodes . def <nl> ppp b / include / swift / Demangling / DemangleNodes . def <nl> NODE ( TypeList ) <nl> NODE ( TypeMangling ) <nl> NODE ( TypeMetadata ) <nl> NODE ( TypeMetadataAccessFunction ) <nl> + NODE ( TypeMetadataInstantiationCache ) <nl> + NODE ( TypeMetadataInstantiationFunction ) <nl> NODE ( TypeMetadataLazyCache ) <nl> NODE ( UncurriedFunctionType ) <nl> NODE ( Unmanaged ) <nl> mmm a / include / swift / IRGen / Linking . h <nl> ppp b / include / swift / IRGen / Linking . h <nl> class LinkEntity { <nl> / / This field appears in the ValueWitness kind . <nl> ValueWitnessShift = 8 , ValueWitnessMask = 0xFF00 , <nl> <nl> - / / These fields appear in the TypeMetadata kind . <nl> + / / This field appears in the TypeMetadata kind . <nl> MetadataAddressShift = 8 , MetadataAddressMask = 0x0300 , <nl> - IsPatternShift = 10 , IsPatternMask = 0x0400 , <nl> <nl> / / This field appears in associated type access functions . <nl> AssociatedTypeIndexShift = 8 , AssociatedTypeIndexMask = ~ KindMask , <nl> class LinkEntity { <nl> / / / The pointer is a NominalTypeDecl * . <nl> NominalTypeDescriptor , <nl> <nl> + / / / The metadata pattern for a generic nominal type . <nl> + / / / The pointer is a NominalTypeDecl * . <nl> + TypeMetadataPattern , <nl> + <nl> + / / / The instantiation cache for a generic nominal type . <nl> + / / / The pointer is a NominalTypeDecl * . <nl> + TypeMetadataInstantiationCache , <nl> + <nl> + / / / The instantiation function for a generic nominal type . <nl> + / / / The pointer is a NominalTypeDecl * . <nl> + TypeMetadataInstantiationFunction , <nl> + <nl> / / / The module descriptor for a module . <nl> / / / The pointer is a ModuleDecl * . <nl> ModuleDescriptor , <nl> class LinkEntity { <nl> } <nl> <nl> static LinkEntity forTypeMetadata ( CanType concreteType , <nl> - TypeMetadataAddress addr , <nl> - bool isPattern ) { <nl> + TypeMetadataAddress addr ) { <nl> LinkEntity entity ; <nl> entity . Pointer = concreteType . getPointer ( ) ; <nl> entity . SecondaryPointer = nullptr ; <nl> entity . Data = LINKENTITY_SET_FIELD ( Kind , unsigned ( Kind : : TypeMetadata ) ) <nl> - | LINKENTITY_SET_FIELD ( MetadataAddress , unsigned ( addr ) ) <nl> - | LINKENTITY_SET_FIELD ( IsPattern , unsigned ( isPattern ) ) ; <nl> + | LINKENTITY_SET_FIELD ( MetadataAddress , unsigned ( addr ) ) ; <nl> + return entity ; <nl> + } <nl> + <nl> + static LinkEntity forTypeMetadataPattern ( NominalTypeDecl * decl ) { <nl> + LinkEntity entity ; <nl> + entity . setForDecl ( Kind : : TypeMetadataPattern , decl ) ; <nl> return entity ; <nl> } <nl> <nl> class LinkEntity { <nl> return entity ; <nl> } <nl> <nl> + static LinkEntity forTypeMetadataInstantiationCache ( NominalTypeDecl * decl ) { <nl> + LinkEntity entity ; <nl> + entity . setForDecl ( Kind : : TypeMetadataInstantiationCache , decl ) ; <nl> + return entity ; <nl> + } <nl> + <nl> + static LinkEntity forTypeMetadataInstantiationFunction ( NominalTypeDecl * decl ) { <nl> + LinkEntity entity ; <nl> + entity . setForDecl ( Kind : : TypeMetadataInstantiationFunction , decl ) ; <nl> + return entity ; <nl> + } <nl> + <nl> static LinkEntity forTypeMetadataLazyCacheVariable ( CanType type ) { <nl> LinkEntity entity ; <nl> entity . setForType ( Kind : : TypeMetadataLazyCacheVariable , type ) ; <nl> class LinkEntity { <nl> assert ( getKind ( ) = = Kind : : TypeMetadata ) ; <nl> return ( TypeMetadataAddress ) LINKENTITY_GET_FIELD ( Data , MetadataAddress ) ; <nl> } <nl> - bool isMetadataPattern ( ) const { <nl> - assert ( getKind ( ) = = Kind : : TypeMetadata ) ; <nl> - return LINKENTITY_GET_FIELD ( Data , IsPattern ) ; <nl> - } <nl> bool isForeignTypeMetadataCandidate ( ) const { <nl> return getKind ( ) = = Kind : : ForeignTypeMetadataCandidate ; <nl> } <nl> mmm a / include / swift / Remote / MetadataReader . h <nl> ppp b / include / swift / Remote / MetadataReader . h <nl> class MetadataReader { <nl> / / If this class has a null descriptor , it ' s artificial , <nl> / / and we need to skip it upon request . Otherwise , we ' re done . <nl> if ( descriptorAddress | | ! skipArtificialSubclasses ) <nl> - return static_cast < uintptr_t > ( descriptorAddress ) ; <nl> + return static_cast < StoredPointer > ( descriptorAddress ) ; <nl> <nl> auto superclassMetadataAddress = classMeta - > SuperClass ; <nl> if ( ! superclassMetadataAddress ) <nl> class MetadataReader { <nl> case MetadataKind : : Optional : <nl> case MetadataKind : : Enum : { <nl> auto valueMeta = cast < TargetValueMetadata < Runtime > > ( metadata ) ; <nl> - return reinterpret_cast < uintptr_t > ( valueMeta - > getDescription ( ) ) ; <nl> + return valueMeta - > getDescription ( ) ; <nl> } <nl> <nl> default : <nl> mmm a / include / swift / Runtime / Exclusivity . h <nl> ppp b / include / swift / Runtime / Exclusivity . h <nl> <nl> namespace swift { <nl> <nl> enum class ExclusivityFlags : uintptr_t ; <nl> - struct ValueBuffer ; <nl> + template < typename Runtime > struct TargetValueBuffer ; <nl> + struct InProcess ; <nl> + using ValueBuffer = TargetValueBuffer < InProcess > ; <nl> <nl> / / / Begin dynamically tracking an access . <nl> / / / <nl> mmm a / include / swift / Runtime / Metadata . h <nl> ppp b / include / swift / Runtime / Metadata . h <nl> struct OpaqueValue ; <nl> / / / owns uninitialized value storage for the stored type . <nl> / / / - An initialized buffer is an allocated buffer whose value <nl> / / / storage has been initialized . <nl> - struct ValueBuffer { <nl> - void * PrivateData [ NumWords_ValueBuffer ] ; <nl> + template < typename Runtime > <nl> + struct TargetValueBuffer { <nl> + TargetPointer < Runtime , void > PrivateData [ NumWords_ValueBuffer ] ; <nl> } ; <nl> + using ValueBuffer = TargetValueBuffer < InProcess > ; <nl> <nl> / / / Can a value with the given size and alignment be allocated inline ? <nl> constexpr inline bool canBeInline ( size_t size , size_t alignment ) { <nl> getUnmanagedPointerPointerValueWitnesses ( ) { <nl> / / / Class pointer ) , but this metadata lacks the type metadata header . <nl> / / / This case can be distinguished using the isTypeMetadata ( ) flag <nl> / / / on ClassMetadata . <nl> - struct TypeMetadataHeader { <nl> + template < typename Runtime > <nl> + struct TargetTypeMetadataHeader { <nl> / / / A pointer to the value - witnesses for this type . This is only <nl> / / / present for type metadata . <nl> - const ValueWitnessTable * ValueWitnesses ; <nl> + TargetPointer < Runtime , const ValueWitnessTable > ValueWitnesses ; <nl> } ; <nl> + using TypeMetadataHeader = TargetTypeMetadataHeader < InProcess > ; <nl> <nl> / / / A " full " metadata pointer is simply an adjusted address point on a <nl> / / / metadata object ; it points to the beginning of the metadata ' s <nl> namespace { <nl> } ; <nl> } <nl> <nl> - template < typename Runtime > struct TargetGenericMetadata ; <nl> + template < typename Runtime > struct TargetGenericMetadataInstantiationCache ; <nl> template < typename Runtime > struct TargetClassMetadata ; <nl> template < typename Runtime > struct TargetStructMetadata ; <nl> template < typename Runtime > struct TargetOpaqueMetadata ; <nl> template < typename Runtime > struct TargetValueMetadata ; <nl> template < typename Runtime > struct TargetForeignClassMetadata ; <nl> template < typename Runtime > class TargetTypeContextDescriptor ; <nl> template < typename Runtime > class TargetClassDescriptor ; <nl> + template < typename Runtime > class TargetValueTypeDescriptor ; <nl> template < typename Runtime > class TargetEnumDescriptor ; <nl> template < typename Runtime > class TargetStructDescriptor ; <nl> <nl> struct TargetMetadata { <nl> : Kind ( static_cast < StoredPointer > ( Kind ) ) { } <nl> <nl> / / / The basic header type . <nl> - typedef TypeMetadataHeader HeaderType ; <nl> + typedef TargetTypeMetadataHeader < Runtime > HeaderType ; <nl> <nl> private : <nl> / / / The kind . Only valid for non - class metadata ; getKind ( ) must be used to get <nl> struct TargetMetadata { <nl> / / / The common structure of opaque metadata . Adds nothing . <nl> template < typename Runtime > <nl> struct TargetOpaqueMetadata { <nl> - typedef TypeMetadataHeader HeaderType ; <nl> + typedef TargetTypeMetadataHeader < Runtime > HeaderType ; <nl> <nl> / / We have to represent this as a member so we can list - initialize it . <nl> TargetMetadata < Runtime > base ; <nl> struct TargetForeignClassMetadata <nl> using StoredPointer = typename Runtime : : StoredPointer ; <nl> <nl> / / / An out - of - line description of the type . <nl> - const TargetClassDescriptor < Runtime > * Description ; <nl> + ConstTargetMetadataPointer < Runtime , TargetClassDescriptor > Description ; <nl> <nl> / / / The superclass of the foreign class , if any . <nl> ConstTargetMetadataPointer < Runtime , swift : : TargetForeignClassMetadata > <nl> struct TargetValueMetadata : public TargetMetadata < Runtime > { <nl> : TargetMetadata < Runtime > ( Kind ) , Description ( description ) { } <nl> <nl> / / / An out - of - line description of the type . <nl> - const TargetTypeContextDescriptor < Runtime > * Description ; <nl> + ConstTargetMetadataPointer < Runtime , TargetTypeContextDescriptor > <nl> + Description ; <nl> <nl> static bool classof ( const TargetMetadata < Runtime > * metadata ) { <nl> return metadata - > getKind ( ) = = MetadataKind : : Struct <nl> struct TargetValueMetadata : public TargetMetadata < Runtime > { <nl> | | metadata - > getKind ( ) = = MetadataKind : : Optional ; <nl> } <nl> <nl> - const TargetTypeContextDescriptor < Runtime > * getDescription ( ) const { <nl> + ConstTargetMetadataPointer < Runtime , TargetValueTypeDescriptor > <nl> + getDescription ( ) const { <nl> return Description ; <nl> } <nl> } ; <nl> template < typename Runtime > <nl> struct TargetWitnessTable { <nl> / / / The protocol conformance descriptor from which this witness table <nl> / / / was generated . <nl> - const TargetProtocolConformanceDescriptor < Runtime > * Description ; <nl> + ConstTargetMetadataPointer < Runtime , TargetProtocolConformanceDescriptor > <nl> + Description ; <nl> } ; <nl> <nl> using WitnessTable = TargetWitnessTable < InProcess > ; <nl> <nl> + template < typename Runtime > <nl> + using TargetWitnessTablePointer = <nl> + ConstTargetMetadataPointer < Runtime , TargetWitnessTable > ; <nl> + <nl> + using WitnessTablePointer = TargetWitnessTablePointer < InProcess > ; <nl> + <nl> / / / The possible physical representations of existential types . <nl> enum class ExistentialTypeRepresentation { <nl> / / / The type uses an opaque existential representation . <nl> using ExistentialTypeMetadata <nl> / / / The basic layout of an existential metatype type . <nl> template < typename Runtime > <nl> struct TargetExistentialMetatypeContainer { <nl> - const TargetMetadata < Runtime > * Value ; <nl> + ConstTargetMetadataPointer < Runtime , TargetMetadata > Value ; <nl> <nl> - const TargetWitnessTable < Runtime > * * getWitnessTables ( ) { <nl> - return reinterpret_cast < const TargetWitnessTable < Runtime > * * > ( this + 1 ) ; <nl> + TargetWitnessTablePointer < Runtime > * getWitnessTables ( ) { <nl> + return reinterpret_cast < TargetWitnessTablePointer < Runtime > * > ( this + 1 ) ; <nl> } <nl> - const TargetWitnessTable < Runtime > * const * getWitnessTables ( ) const { <nl> - return reinterpret_cast < const TargetWitnessTable < Runtime > * const * > ( this + 1 ) ; <nl> + TargetWitnessTablePointer < Runtime > const * getWitnessTables ( ) const { <nl> + return reinterpret_cast < TargetWitnessTablePointer < Runtime > const * > ( this + 1 ) ; <nl> } <nl> <nl> void copyTypeInto ( TargetExistentialMetatypeContainer * dest , <nl> struct TargetExistentialMetatypeMetadata <nl> using ExistentialMetatypeMetadata <nl> = TargetExistentialMetatypeMetadata < InProcess > ; <nl> <nl> - / / / \ brief The header in front of a generic metadata template . <nl> - / / / <nl> - / / / This is optimized so that the code generation pattern <nl> - / / / requires the minimal number of independent arguments . <nl> - / / / For example , we want to be able to allocate a generic class <nl> - / / / Dictionary < T , U > like so : <nl> - / / / extern GenericMetadata Dictionary_metadata_header ; <nl> - / / / void * arguments [ ] = { typeid ( T ) , typeid ( U ) } ; <nl> - / / / void * metadata = swift_getGenericMetadata ( & Dictionary_metadata_header , <nl> - / / / & arguments ) ; <nl> - / / / void * object = swift_allocObject ( metadata ) ; <nl> - / / / <nl> - / / / Note that the metadata header is * not * const data ; it includes 8 <nl> - / / / pointers worth of implementation - private data . <nl> - / / / <nl> - / / / Both the metadata header and the arguments buffer are guaranteed <nl> - / / / to be pointer - aligned . <nl> + / / / The instantiation cache for generic metadata . This must be guaranteed <nl> + / / / to zero - initialized before it is first accessed . Its contents are private <nl> + / / / to the runtime . <nl> template < typename Runtime > <nl> - struct TargetGenericMetadata { <nl> - / / / The fill function . Receives a pointer to the instantiated metadata and <nl> - / / / the argument pointer passed to swift_getGenericMetadata . <nl> - TargetMetadata < Runtime > * ( * CreateFunction ) <nl> - ( TargetGenericMetadata < Runtime > * pattern , const void * arguments ) ; <nl> - <nl> - / / / The size of the template in bytes . <nl> - uint32_t TemplateSize ; <nl> - <nl> - / / / The number of generic arguments that we need to unique on , <nl> - / / / in words . The first ' NumArguments * sizeof ( void * ) ' bytes of <nl> - / / / the arguments buffer are the key . There may be additional private - contract <nl> - / / / data used by FillFunction not used for uniquing . <nl> - uint16_t NumKeyArguments ; <nl> - <nl> - / / / The offset of the address point in the template in bytes . <nl> - uint16_t AddressPoint ; <nl> - <nl> + struct TargetGenericMetadataInstantiationCache { <nl> / / / Data that the runtime can use for its own purposes . It is guaranteed <nl> / / / to be zero - filled by the compiler . <nl> TargetPointer < Runtime , void > <nl> PrivateData [ swift : : NumGenericMetadataPrivateDataWords ] ; <nl> - <nl> - / / Here there is a variably - sized field : <nl> - / / char alignas ( void * ) MetadataTemplate [ TemplateSize ] ; <nl> - <nl> - / / / Return the starting address of the metadata template data . <nl> - TargetPointer < Runtime , const void > getMetadataTemplate ( ) const { <nl> - return reinterpret_cast < TargetPointer < Runtime , const void > > ( this + 1 ) ; <nl> - } <nl> - <nl> - / / / Return the nominal type descriptor for the template metadata <nl> - ConstTargetMetadataPointer < Runtime , TargetTypeContextDescriptor > <nl> - getTemplateDescription ( ) const { <nl> - auto bytes = reinterpret_cast < const uint8_t * > ( getMetadataTemplate ( ) ) ; <nl> - auto metadata = reinterpret_cast < <nl> - const TargetMetadata < Runtime > * > ( bytes + AddressPoint ) ; <nl> - return metadata - > getTypeContextDescriptor ( ) ; <nl> - } <nl> } ; <nl> - using GenericMetadata = TargetGenericMetadata < InProcess > ; <nl> + using GenericMetadataInstantiationCache = <nl> + TargetGenericMetadataInstantiationCache < InProcess > ; <nl> <nl> / / / Heap metadata for a box , which may have been generated statically by the <nl> / / / compiler or by the runtime . <nl> struct TargetProtocolConformanceDescriptor final <nl> DirectNominalTypeDescriptor ; <nl> <nl> / / / An indirect reference to a nominal type descriptor . <nl> - RelativeDirectPointer < TargetTypeContextDescriptor < Runtime > * const > <nl> + RelativeDirectPointer < <nl> + ConstTargetMetadataPointer < Runtime , TargetTypeContextDescriptor > > <nl> IndirectNominalTypeDescriptor ; <nl> <nl> / / / An indirect reference to the metadata . <nl> - RelativeDirectPointer < const TargetClassMetadata < Runtime > * > <nl> + RelativeDirectPointer < <nl> + ConstTargetMetadataPointer < Runtime , TargetClassMetadata > > <nl> IndirectObjCClass ; <nl> } ; <nl> <nl> struct TargetAnonymousContextDescriptor final <nl> } <nl> } ; <nl> <nl> - struct TypeGenericContextDescriptorHeader { <nl> + template < typename Runtime > <nl> + struct TargetTypeGenericContextDescriptorHeader { <nl> / / / Indicates the offset of the instantiation arguments for a type ' s generic <nl> / / / contexts in instances of its type metadata . For a value type or class <nl> / / / without resilient superclasses , this the the offset from the address <nl> / / / point of the metadata . For a class with a resilient superclass , this <nl> / / / offset is relative to the end of the superclass metadata . <nl> - unsigned ArgumentOffset ; <nl> + uint32_t ArgumentOffset ; <nl> + <nl> + using InstantiationFunction_t = <nl> + TargetMetadata < Runtime > * ( const TargetTypeContextDescriptor < Runtime > * type , <nl> + const void * arguments ) ; <nl> + <nl> + / / / The function to call to instantiate the template . <nl> + TargetRelativeDirectPointer < Runtime , InstantiationFunction_t > <nl> + InstantiationFunction ; <nl> + <nl> + / / / The metadata instantiation cache . <nl> + TargetRelativeDirectPointer < Runtime , <nl> + TargetGenericMetadataInstantiationCache < Runtime > > <nl> + InstantiationCache ; <nl> + <nl> + GenericMetadataInstantiationCache * getInstantiationCache ( ) const { <nl> + return InstantiationCache . get ( ) ; <nl> + } <nl> + <nl> + / / / The base header . Must always be the final member . <nl> GenericContextDescriptorHeader Base ; <nl> <nl> operator const GenericContextDescriptorHeader & ( ) const { <nl> return Base ; <nl> } <nl> } ; <nl> + using TypeGenericContextDescriptorHeader = <nl> + TargetTypeGenericContextDescriptorHeader < InProcess > ; <nl> <nl> / / / Wrapper class for the pointer to a metadata access function that provides <nl> / / / operator ( ) overloads to call it with the right calling convention . <nl> class TargetTypeContextDescriptor <nl> return MetadataAccessFunction ( AccessFunctionPtr . get ( ) ) ; <nl> } <nl> <nl> - const GenericContextDescriptorHeader & getGenericContextHeader ( ) const ; <nl> + const TargetTypeGenericContextDescriptorHeader < Runtime > & <nl> + getFullGenericContextHeader ( ) const ; <nl> + <nl> + const GenericContextDescriptorHeader & getGenericContextHeader ( ) const { <nl> + return getFullGenericContextHeader ( ) ; <nl> + } <nl> <nl> / / / Return the offset of the start of generic arguments in the nominal <nl> / / / type ' s metadata . The returned value is measured in sizeof ( void * ) . <nl> template < typename Runtime > <nl> class TargetClassDescriptor final <nl> : public TargetTypeContextDescriptor < Runtime > , <nl> public TrailingGenericContextObjects < TargetClassDescriptor < Runtime > , <nl> - TypeGenericContextDescriptorHeader , <nl> - / * additional trailing objects : * / <nl> - TargetVTableDescriptorHeader < Runtime > , <nl> - TargetMethodDescriptor < Runtime > > { <nl> + TargetTypeGenericContextDescriptorHeader < Runtime > , <nl> + / * additional trailing objects : * / <nl> + TargetVTableDescriptorHeader < Runtime > , <nl> + TargetMethodDescriptor < Runtime > > { <nl> private : <nl> using TrailingGenericContextObjects = <nl> TrailingGenericContextObjects < TargetClassDescriptor < Runtime > , <nl> - TypeGenericContextDescriptorHeader , <nl> + TargetTypeGenericContextDescriptorHeader < Runtime > , <nl> TargetVTableDescriptorHeader < Runtime > , <nl> TargetMethodDescriptor < Runtime > > ; <nl> <nl> class TargetClassDescriptor final <nl> <nl> using ClassDescriptor = TargetClassDescriptor < InProcess > ; <nl> <nl> + template < typename Runtime > <nl> + class TargetValueTypeDescriptor <nl> + : public TargetTypeContextDescriptor < Runtime > { <nl> + public : <nl> + static bool classof ( const TargetContextDescriptor < Runtime > * cd ) { <nl> + return cd - > getKind ( ) = = ContextDescriptorKind : : Struct | | <nl> + cd - > getKind ( ) = = ContextDescriptorKind : : Enum ; <nl> + } <nl> + } ; <nl> + using ValueTypeDescriptor = TargetValueTypeDescriptor < InProcess > ; <nl> + <nl> template < typename Runtime > <nl> class TargetStructDescriptor final <nl> - : public TargetTypeContextDescriptor < Runtime > , <nl> + : public TargetValueTypeDescriptor < Runtime > , <nl> public TrailingGenericContextObjects < TargetStructDescriptor < Runtime > , <nl> - TypeGenericContextDescriptorHeader > { <nl> + TargetTypeGenericContextDescriptorHeader < Runtime > > { <nl> private : <nl> using TrailingGenericContextObjects = <nl> TrailingGenericContextObjects < TargetStructDescriptor < Runtime > , <nl> - TypeGenericContextDescriptorHeader > ; <nl> + TargetTypeGenericContextDescriptorHeader < Runtime > > ; <nl> <nl> using TrailingObjects = <nl> typename TrailingGenericContextObjects : : TrailingObjects ; <nl> using StructDescriptor = TargetStructDescriptor < InProcess > ; <nl> <nl> template < typename Runtime > <nl> class TargetEnumDescriptor final <nl> - : public TargetTypeContextDescriptor < Runtime > , <nl> + : public TargetValueTypeDescriptor < Runtime > , <nl> public TrailingGenericContextObjects < TargetEnumDescriptor < Runtime > , <nl> - TypeGenericContextDescriptorHeader > { <nl> + TargetTypeGenericContextDescriptorHeader < Runtime > > { <nl> private : <nl> using TrailingGenericContextObjects = <nl> TrailingGenericContextObjects < TargetEnumDescriptor < Runtime > , <nl> - TypeGenericContextDescriptorHeader > ; <nl> + TargetTypeGenericContextDescriptorHeader < Runtime > > ; <nl> <nl> using TrailingObjects = <nl> typename TrailingGenericContextObjects : : TrailingObjects ; <nl> uint32_t TargetTypeContextDescriptor < Runtime > : : getGenericArgumentOffset ( <nl> } <nl> <nl> template < typename Runtime > <nl> - const GenericContextDescriptorHeader & <nl> - TargetTypeContextDescriptor < Runtime > : : getGenericContextHeader ( ) const { <nl> + const TargetTypeGenericContextDescriptorHeader < Runtime > & <nl> + TargetTypeContextDescriptor < Runtime > : : getFullGenericContextHeader ( ) const { <nl> switch ( this - > getKind ( ) ) { <nl> case ContextDescriptorKind : : Class : <nl> return llvm : : cast < TargetClassDescriptor < Runtime > > ( this ) <nl> - - > getGenericContextHeader ( ) ; <nl> + - > getFullGenericContextHeader ( ) ; <nl> case ContextDescriptorKind : : Enum : <nl> return llvm : : cast < TargetEnumDescriptor < Runtime > > ( this ) <nl> - - > getGenericContextHeader ( ) ; <nl> + - > getFullGenericContextHeader ( ) ; <nl> case ContextDescriptorKind : : Struct : <nl> return llvm : : cast < TargetStructDescriptor < Runtime > > ( this ) <nl> - - > getGenericContextHeader ( ) ; <nl> + - > getFullGenericContextHeader ( ) ; <nl> default : <nl> swift_runtime_unreachable ( " Not a type context descriptor . " ) ; <nl> } <nl> TargetTypeContextDescriptor < Runtime > : : getGenericContextHeader ( ) const { <nl> / / / } <nl> SWIFT_RUNTIME_EXPORT <nl> const Metadata * <nl> - swift_getGenericMetadata ( GenericMetadata * pattern , <nl> + swift_getGenericMetadata ( const TypeContextDescriptor * description , <nl> const void * arguments ) ; <nl> <nl> / / Callback to allocate a generic class metadata object . <nl> SWIFT_RUNTIME_EXPORT <nl> ClassMetadata * <nl> - swift_allocateGenericClassMetadata ( GenericMetadata * pattern , <nl> + swift_allocateGenericClassMetadata ( const ClassDescriptor * description , <nl> + const void * metadataTemplate , <nl> + size_t metadataTemplateSize , <nl> + size_t metadataTemplateAddressPoint , <nl> const void * arguments , <nl> ClassMetadata * superclass , <nl> size_t numImmediateMembers ) ; <nl> swift_allocateGenericClassMetadata ( GenericMetadata * pattern , <nl> / / Callback to allocate a generic struct / enum metadata object . <nl> SWIFT_RUNTIME_EXPORT <nl> ValueMetadata * <nl> - swift_allocateGenericValueMetadata ( GenericMetadata * pattern , <nl> + swift_allocateGenericValueMetadata ( const ValueTypeDescriptor * description , <nl> + const void * metadataTemplate , <nl> + size_t metadataTemplateSize , <nl> const void * arguments ) ; <nl> <nl> / / / Instantiate a resilient or generic protocol witness table . <nl> mmm a / include / swift / Runtime / RuntimeFunctions . def <nl> ppp b / include / swift / Runtime / RuntimeFunctions . def <nl> FUNCTION ( GetForeignTypeMetadata , swift_getForeignTypeMetadata , C_CC , <nl> ARGS ( TypeMetadataPtrTy ) , <nl> ATTRS ( NoUnwind , ReadNone ) ) / / only writes to runtime - private fields <nl> <nl> - / / Metadata * swift_getGenericMetadata ( GenericMetadata * pattern , <nl> + / / Metadata * swift_getGenericMetadata ( TypeContextDescriptor * type , <nl> / / const void * arguments ) ; <nl> FUNCTION ( GetGenericMetadata , swift_getGenericMetadata , C_CC , <nl> RETURNS ( TypeMetadataPtrTy ) , <nl> - ARGS ( TypeMetadataPatternPtrTy , Int8PtrTy ) , <nl> + ARGS ( TypeContextDescriptorPtrTy , Int8PtrTy ) , <nl> ATTRS ( NoUnwind , ReadOnly ) ) <nl> <nl> - / / Metadata * swift_allocateGenericClassMetadata ( GenericMetadata * pattern , <nl> + / / Metadata * swift_allocateGenericClassMetadata ( ClassDescriptor * type , <nl> + / / const void * template , <nl> + / / size_t templateSize , <nl> + / / size_t templateAddressPoint , <nl> / / const void * const * arguments , <nl> / / objc_class * superclass , <nl> / / size_t numImmediateMembers ) ; <nl> FUNCTION ( AllocateGenericClassMetadata , swift_allocateGenericClassMetadata , <nl> C_CC , RETURNS ( TypeMetadataPtrTy ) , <nl> - ARGS ( TypeMetadataPatternPtrTy , Int8PtrPtrTy , ObjCClassPtrTy , SizeTy ) , <nl> + ARGS ( TypeContextDescriptorPtrTy , Int8PtrPtrTy , SizeTy , SizeTy , <nl> + Int8PtrPtrTy , ObjCClassPtrTy , SizeTy ) , <nl> ATTRS ( NoUnwind ) ) <nl> <nl> - / / Metadata * swift_allocateGenericValueMetadata ( GenericMetadata * pattern , <nl> + / / Metadata * swift_allocateGenericValueMetadata ( ValueTypeDescriptor * type , <nl> + / / const void * template , <nl> + / / size_t templateSize , <nl> / / const void * const * arguments ) ; <nl> FUNCTION ( AllocateGenericValueMetadata , swift_allocateGenericValueMetadata , <nl> C_CC , RETURNS ( TypeMetadataPtrTy ) , <nl> - ARGS ( TypeMetadataPatternPtrTy , Int8PtrPtrTy ) , <nl> + ARGS ( TypeContextDescriptorPtrTy , Int8PtrPtrTy , SizeTy , Int8PtrPtrTy ) , <nl> ATTRS ( NoUnwind ) ) <nl> <nl> / / const ProtocolWitnessTable * <nl> mmm a / lib / Demangling / Demangler . cpp <nl> ppp b / lib / Demangling / Demangler . cpp <nl> NodePointer Demangler : : demangleMetatype ( ) { <nl> return createWithPoppedType ( Node : : Kind : : GenericTypeMetadataPattern ) ; <nl> case ' a ' : <nl> return createWithPoppedType ( Node : : Kind : : TypeMetadataAccessFunction ) ; <nl> + case ' I ' : <nl> + return createWithPoppedType ( Node : : Kind : : TypeMetadataInstantiationCache ) ; <nl> + case ' i ' : <nl> + return createWithPoppedType ( Node : : Kind : : TypeMetadataInstantiationFunction ) ; <nl> case ' L ' : <nl> return createWithPoppedType ( Node : : Kind : : TypeMetadataLazyCache ) ; <nl> case ' m ' : <nl> mmm a / lib / Demangling / NodePrinter . cpp <nl> ppp b / lib / Demangling / NodePrinter . cpp <nl> class NodePrinter { <nl> case Node : : Kind : : TypeMangling : <nl> case Node : : Kind : : TypeMetadata : <nl> case Node : : Kind : : TypeMetadataAccessFunction : <nl> + case Node : : Kind : : TypeMetadataInstantiationCache : <nl> + case Node : : Kind : : TypeMetadataInstantiationFunction : <nl> case Node : : Kind : : TypeMetadataLazyCache : <nl> case Node : : Kind : : UncurriedFunctionType : <nl> case Node : : Kind : : Unmanaged : <nl> NodePointer NodePrinter : : print ( NodePointer Node , bool asPrefixContext ) { <nl> Printer < < " type metadata accessor for " ; <nl> print ( Node - > getChild ( 0 ) ) ; <nl> return nullptr ; <nl> + case Node : : Kind : : TypeMetadataInstantiationCache : <nl> + Printer < < " type metadata instantiation cache for " ; <nl> + print ( Node - > getChild ( 0 ) ) ; <nl> + return nullptr ; <nl> + case Node : : Kind : : TypeMetadataInstantiationFunction : <nl> + Printer < < " type metadata instantiation function for " ; <nl> + print ( Node - > getChild ( 0 ) ) ; <nl> + return nullptr ; <nl> case Node : : Kind : : TypeMetadataLazyCache : <nl> Printer < < " lazy cache variable for type metadata for " ; <nl> print ( Node - > getChild ( 0 ) ) ; <nl> mmm a / lib / Demangling / OldRemangler . cpp <nl> ppp b / lib / Demangling / OldRemangler . cpp <nl> void Remangler : : mangleTypeMetadataAccessFunction ( Node * node ) { <nl> mangleSingleChildNode ( node ) ; / / type <nl> } <nl> <nl> + void Remangler : : mangleTypeMetadataInstantiationCache ( Node * node ) { <nl> + Out < < " MI " ; <nl> + mangleSingleChildNode ( node ) ; / / type <nl> + } <nl> + <nl> + void Remangler : : mangleTypeMetadataInstantiationFunction ( Node * node ) { <nl> + Out < < " Mi " ; <nl> + mangleSingleChildNode ( node ) ; / / type <nl> + } <nl> + <nl> void Remangler : : mangleTypeMetadataLazyCache ( Node * node ) { <nl> Out < < " ML " ; <nl> mangleSingleChildNode ( node ) ; / / type <nl> mmm a / lib / Demangling / Remangler . cpp <nl> ppp b / lib / Demangling / Remangler . cpp <nl> void Remangler : : mangleTypeMetadataAccessFunction ( Node * node ) { <nl> Buffer < < " Ma " ; <nl> } <nl> <nl> + void Remangler : : mangleTypeMetadataInstantiationCache ( Node * node ) { <nl> + mangleSingleChildNode ( node ) ; <nl> + Buffer < < " MI " ; <nl> + } <nl> + <nl> + void Remangler : : mangleTypeMetadataInstantiationFunction ( Node * node ) { <nl> + mangleSingleChildNode ( node ) ; <nl> + Buffer < < " Mi " ; <nl> + } <nl> + <nl> void Remangler : : mangleTypeMetadataLazyCache ( Node * node ) { <nl> mangleChildNodes ( node ) ; <nl> Buffer < < " ML " ; <nl> mmm a / lib / IRGen / GenDecl . cpp <nl> ppp b / lib / IRGen / GenDecl . cpp <nl> bool IRGenerator : : tryEnableLazyTypeMetadata ( NominalTypeDecl * Nominal ) { <nl> case FormalLinkage : : Private : <nl> break ; <nl> } <nl> - assert ( eligibleLazyMetadata . count ( Nominal ) = = 0 ) ; <nl> - eligibleLazyMetadata . insert ( Nominal ) ; <nl> + <nl> + auto insertResult = LazyTypeGlobals . try_emplace ( Nominal ) ; <nl> + auto & entry = insertResult . first - > second ; <nl> + assert ( ! entry . IsLazy ) ; <nl> + entry . IsLazy = true ; <nl> + if ( entry . IsMetadataUsed ) <nl> + LazyTypeMetadata . push_back ( Nominal ) ; <nl> + if ( entry . IsDescriptorUsed ) <nl> + LazyTypeContextDescriptors . push_back ( Nominal ) ; <nl> + <nl> return true ; <nl> } <nl> <nl> IRGenModule : : getAddrOfParentContextDescriptor ( DeclContext * from ) { <nl> <nl> case DeclContextKind : : GenericTypeDecl : <nl> if ( auto nomTy = dyn_cast < NominalTypeDecl > ( parent ) ) { <nl> - return { getAddrOfTypeContextDescriptor ( nomTy ) , <nl> + return { getAddrOfTypeContextDescriptor ( nomTy , DontRequireMetadata ) , <nl> ConstantReference : : Direct } ; <nl> } <nl> return { getAddrOfAnonymousContextDescriptor ( from ) , <nl> void IRGenModule : : addObjCClass ( llvm : : Constant * classPtr , bool nonlazy ) { <nl> ObjCNonLazyClasses . push_back ( classPtr ) ; <nl> } <nl> <nl> - void IRGenModule : : addRuntimeResolvableType ( CanType type ) { <nl> + void IRGenModule : : addRuntimeResolvableType ( NominalTypeDecl * nominal ) { <nl> / / Collect the nominal type records we emit into a special section . <nl> - if ( NominalTypeDecl * Nominal = type - > getAnyNominal ( ) ) { <nl> - RuntimeResolvableTypes . push_back ( type ) ; <nl> + RuntimeResolvableTypes . push_back ( nominal ) ; <nl> <nl> - / / As soon as the type metadata is available , all the type ' s conformances <nl> - / / must be available , too . The reason is that a type ( with the help of its <nl> - / / metadata ) can be checked at runtime if it conforms to a protocol . <nl> - addLazyConformances ( Nominal ) ; <nl> - } <nl> + / / As soon as the type metadata is available , all the type ' s conformances <nl> + / / must be available , too . The reason is that a type ( with the help of its <nl> + / / metadata ) can be checked at runtime if it conforms to a protocol . <nl> + addLazyConformances ( nominal ) ; <nl> } <nl> <nl> ConstantReference <nl> void IRGenModule : : finishEmitAfterTopLevel ( ) { <nl> } <nl> } <nl> <nl> - static void emitLazyTypeMetadata ( IRGenModule & IGM , NominalTypeDecl * Nominal ) { <nl> - / / We may have emitted a partial type context descriptor with some empty <nl> - / / fields , and then later discovered we ' re emitting complete metadata . <nl> - / / Remove existing definitions of the type context so that we can regenerate <nl> - / / a complete descriptor . <nl> - auto existingContext = dyn_cast_or_null < llvm : : GlobalVariable > ( <nl> - IGM . getAddrOfTypeContextDescriptor ( Nominal ) - > stripPointerCasts ( ) ) ; <nl> - if ( existingContext & & ! existingContext - > isDeclaration ( ) ) { <nl> - existingContext - > setInitializer ( nullptr ) ; <nl> - } <nl> - <nl> - if ( auto sd = dyn_cast < StructDecl > ( Nominal ) ) { <nl> - return emitStructMetadata ( IGM , sd ) ; <nl> - } else if ( auto ed = dyn_cast < EnumDecl > ( Nominal ) ) { <nl> - emitEnumMetadata ( IGM , ed ) ; <nl> - } else if ( auto pd = dyn_cast < ProtocolDecl > ( Nominal ) ) { <nl> - IGM . emitProtocolDecl ( pd ) ; <nl> - } else { <nl> - llvm_unreachable ( " should not have enqueued a class decl here ! " ) ; <nl> - } <nl> - } <nl> - <nl> void IRGenerator : : emitSwiftProtocols ( ) { <nl> for ( auto & m : * this ) { <nl> m . second - > emitSwiftProtocols ( ) ; <nl> void IRGenerator : : emitTypeMetadataRecords ( ) { <nl> / / / Emit any lazy definitions ( of globals or functions or whatever <nl> / / / else ) that we require . <nl> void IRGenerator : : emitLazyDefinitions ( ) { <nl> - while ( ! LazyMetadata . empty ( ) | | <nl> + while ( ! LazyTypeMetadata . empty ( ) | | <nl> ! LazyTypeContextDescriptors . empty ( ) | | <nl> ! LazyFunctionDefinitions . empty ( ) | | <nl> ! LazyFieldTypes . empty ( ) | | <nl> void IRGenerator : : emitLazyDefinitions ( ) { <nl> } <nl> <nl> / / Emit any lazy type metadata we require . <nl> - while ( ! LazyMetadata . empty ( ) ) { <nl> - NominalTypeDecl * Nominal = LazyMetadata . pop_back_val ( ) ; <nl> - assert ( scheduledLazyMetadata . count ( Nominal ) = = 1 ) ; <nl> - if ( eligibleLazyMetadata . count ( Nominal ) ! = 0 ) { <nl> - CurrentIGMPtr IGM = getGenModule ( Nominal - > getDeclContext ( ) ) ; <nl> - emitLazyTypeMetadata ( * IGM . get ( ) , Nominal ) ; <nl> - } <nl> + while ( ! LazyTypeMetadata . empty ( ) ) { <nl> + NominalTypeDecl * type = LazyTypeMetadata . pop_back_val ( ) ; <nl> + auto & entry = LazyTypeGlobals . find ( type ) - > second ; <nl> + assert ( entry . IsLazy & & entry . IsMetadataUsed & & ! entry . IsMetadataEmitted ) ; <nl> + entry . IsMetadataEmitted = true ; <nl> + CurrentIGMPtr IGM = getGenModule ( type - > getDeclContext ( ) ) ; <nl> + emitLazyTypeMetadata ( * IGM . get ( ) , type ) ; <nl> } <nl> while ( ! LazyTypeContextDescriptors . empty ( ) ) { <nl> - NominalTypeDecl * Nominal = LazyTypeContextDescriptors . pop_back_val ( ) ; <nl> - assert ( scheduledLazyTypeContextDescriptors . count ( Nominal ) = = 1 ) ; <nl> - if ( eligibleLazyMetadata . count ( Nominal ) ! = 0 ) { <nl> - CurrentIGMPtr IGM = getGenModule ( Nominal - > getDeclContext ( ) ) ; <nl> - emitLazyTypeContextDescriptor ( * IGM . get ( ) , Nominal ) ; <nl> - } <nl> + NominalTypeDecl * type = LazyTypeContextDescriptors . pop_back_val ( ) ; <nl> + auto & entry = LazyTypeGlobals . find ( type ) - > second ; <nl> + assert ( entry . IsLazy & & entry . IsDescriptorUsed & & <nl> + ! entry . IsDescriptorEmitted ) ; <nl> + entry . IsDescriptorEmitted = true ; <nl> + CurrentIGMPtr IGM = getGenModule ( type - > getDeclContext ( ) ) ; <nl> + emitLazyTypeContextDescriptor ( * IGM . get ( ) , type , <nl> + RequireMetadata_t ( entry . IsMetadataUsed ) ) ; <nl> } <nl> while ( ! LazyWitnessTables . empty ( ) ) { <nl> SILWitnessTable * wt = LazyWitnessTables . pop_back_val ( ) ; <nl> void IRGenerator : : emitLazyDefinitions ( ) { <nl> } <nl> } <nl> <nl> + void IRGenerator : : noteUseOfTypeGlobals ( NominalTypeDecl * type , <nl> + bool isUseOfMetadata , <nl> + RequireMetadata_t requireMetadata ) { <nl> + / / Try to create a new record of the fact that we used this type . <nl> + auto insertResult = LazyTypeGlobals . try_emplace ( type ) ; <nl> + auto & entry = insertResult . first - > second ; <nl> + <nl> + bool metadataWasUsed = entry . IsMetadataUsed ; <nl> + bool descriptorWasUsed = entry . IsDescriptorUsed ; <nl> + <nl> + bool isNovelUseOfMetadata = false ; <nl> + bool isNovelUseOfDescriptor = false ; <nl> + <nl> + / / Flag that we have a use of the metadata if <nl> + / / - the reference was directly to the metadata <nl> + / / - the reference was to the descriptor , but it requested the emission <nl> + / / of metadata <nl> + if ( ! metadataWasUsed & & ( isUseOfMetadata | | requireMetadata ) ) { <nl> + if ( metadataWasUsed ) return ; <nl> + entry . IsMetadataUsed = true ; <nl> + isNovelUseOfMetadata = true ; <nl> + } <nl> + <nl> + if ( ! descriptorWasUsed & & ! isUseOfMetadata ) { <nl> + if ( descriptorWasUsed ) return ; <nl> + entry . IsDescriptorUsed = true ; <nl> + isNovelUseOfDescriptor = true ; <nl> + } <nl> + <nl> + / / If the type isn ' t known to be lazy , don ' t mess around with the queues . <nl> + if ( ! entry . IsLazy ) <nl> + return ; <nl> + <nl> + / / Enqueue metadata emission if we have a novel use of it . <nl> + if ( isNovelUseOfMetadata ) <nl> + LazyTypeMetadata . push_back ( type ) ; <nl> + <nl> + / / Enqueue descriptor emission if we have a novel use of it or if we <nl> + / / need to re - emit it because we ' re suddenly using metadata for it . <nl> + if ( isNovelUseOfDescriptor | | <nl> + ( isNovelUseOfMetadata & & entry . IsDescriptorEmitted ) ) { <nl> + entry . IsDescriptorEmitted = false ; / / clear this in case it was true <nl> + LazyTypeContextDescriptors . push_back ( type ) ; <nl> + } <nl> + } <nl> + <nl> void IRGenerator : : emitEagerClassInitialization ( ) { <nl> if ( ClassesForEagerInitialization . empty ( ) ) <nl> return ; <nl> SILLinkage LinkEntity : : getLinkage ( ForDefinition_t forDefinition ) const { <nl> return SILLinkage : : Private ; <nl> } <nl> <nl> + case Kind : : TypeMetadataInstantiationCache : <nl> + case Kind : : TypeMetadataInstantiationFunction : <nl> + case Kind : : TypeMetadataPattern : <nl> + return SILLinkage : : Private ; <nl> + <nl> case Kind : : TypeMetadataLazyCacheVariable : { <nl> auto type = getType ( ) ; <nl> <nl> SILLinkage LinkEntity : : getLinkage ( ForDefinition_t forDefinition ) const { <nl> } <nl> <nl> case Kind : : TypeMetadata : <nl> - if ( isMetadataPattern ( ) ) <nl> - return SILLinkage : : Private ; <nl> - <nl> switch ( getMetadataAddress ( ) ) { <nl> case TypeMetadataAddress : : FullMetadata : <nl> / / The full metadata object is private to the containing module . <nl> SILLinkage LinkEntity : : getLinkage ( ForDefinition_t forDefinition ) const { <nl> forDefinition ) ; <nl> } <nl> } <nl> + llvm_unreachable ( " bad kind " ) ; <nl> <nl> / / . . . but we don ' t actually expose individual value witnesses ( right now ) . <nl> case Kind : : ValueWitness : <nl> bool LinkEntity : : isAvailableExternally ( IRGenModule & IGM ) const { <nl> case Kind : : ModuleDescriptor : <nl> case Kind : : ExtensionDescriptor : <nl> case Kind : : AnonymousDescriptor : <nl> + case Kind : : TypeMetadataInstantiationCache : <nl> + case Kind : : TypeMetadataInstantiationFunction : <nl> + case Kind : : TypeMetadataPattern : <nl> return false ; <nl> <nl> case Kind : : ValueWitness : <nl> struct TypeEntityInfo { <nl> } / / end anonymous namespace <nl> <nl> static TypeEntityInfo <nl> - getTypeEntityInfo ( IRGenModule & IGM , CanType conformingType ) { <nl> + getTypeEntityInfo ( IRGenModule & IGM , NominalTypeDecl * nom ) { <nl> TypeMetadataRecordKind typeKind ; <nl> Optional < LinkEntity > entity ; <nl> llvm : : Type * defaultTy , * defaultPtrTy ; <nl> <nl> - auto nom = conformingType - > getAnyNominal ( ) ; <nl> auto clas = dyn_cast < ClassDecl > ( nom ) ; <nl> if ( clas & & ! clas - > isForeign ( ) & & ! hasKnownSwiftMetadata ( IGM , clas ) ) { <nl> / / A reference to an Objective - C class object . <nl> namespace { <nl> / / Relative reference to the type entity info , with the type reference <nl> / / kind mangled in the lower bits . <nl> auto typeEntity = <nl> - getTypeEntityInfo ( IGM , Conformance - > getType ( ) - > getCanonicalType ( ) ) ; <nl> + getTypeEntityInfo ( IGM , Conformance - > getType ( ) - > getAnyNominal ( ) ) ; <nl> auto typeRef = <nl> IGM . getAddrOfLLVMVariableOrGOTEquivalent ( <nl> typeEntity . entity , IGM . getPointerAlignment ( ) , typeEntity . defaultTy ) ; <nl> IRGenModule : : getAddrOfTypeMetadataAccessFunction ( CanType type , <nl> ForDefinition_t forDefinition ) { <nl> assert ( ! type - > hasArchetype ( ) & & ! type - > hasTypeParameter ( ) ) ; <nl> NominalTypeDecl * Nominal = type - > getNominalOrBoundGenericNominal ( ) ; <nl> - IRGen . addLazyTypeMetadata ( Nominal ) ; <nl> + IRGen . noteUseOfTypeMetadata ( Nominal ) ; <nl> <nl> LinkEntity entity = LinkEntity : : forTypeMetadataAccessFunction ( type ) ; <nl> llvm : : Function * & entry = GlobalFuncs [ entity ] ; <nl> IRGenModule : : getAddrOfGenericTypeMetadataAccessFunction ( <nl> assert ( nominal - > isGenericContext ( ) ) ; <nl> assert ( ! genericArgs . empty ( ) | | <nl> nominal - > getGenericSignature ( ) - > areAllParamsConcrete ( ) ) ; <nl> - IRGen . addLazyTypeMetadata ( nominal ) ; <nl> + IRGen . noteUseOfTypeMetadata ( nominal ) ; <nl> <nl> auto type = nominal - > getDeclaredType ( ) - > getCanonicalType ( ) ; <nl> assert ( type - > hasUnboundGenericType ( ) ) ; <nl> llvm : : GlobalValue * IRGenModule : : defineTypeMetadata ( CanType concreteType , <nl> assert ( init ) ; <nl> assert ( ! isIndirect & & " indirect type metadata not used yet " ) ; <nl> <nl> + if ( isPattern ) { <nl> + auto addr = getAddrOfTypeMetadataPattern ( concreteType - > getAnyNominal ( ) , <nl> + isConstant , init , section ) ; <nl> + <nl> + return cast < llvm : : GlobalValue > ( addr ) ; <nl> + } <nl> + <nl> / / / For concrete metadata , we want to use the initializer on the <nl> / / / " full metadata " , and define the " direct " address point as an alias . <nl> - / / / For generic metadata patterns , the address point is always at the <nl> - / / / beginning of the template ( for now . . . ) . <nl> TypeMetadataAddress addrKind ; <nl> llvm : : Type * defaultVarTy ; <nl> unsigned adjustmentIndex ; <nl> Alignment alignment = getPointerAlignment ( ) ; <nl> <nl> - if ( isPattern ) { <nl> - addrKind = TypeMetadataAddress : : AddressPoint ; <nl> - defaultVarTy = TypeMetadataPatternStructTy ; <nl> - adjustmentIndex = MetadataAdjustmentIndex : : None ; <nl> - } else if ( concreteType - > getClassOrBoundGenericClass ( ) ) { <nl> + if ( concreteType - > getClassOrBoundGenericClass ( ) ) { <nl> addrKind = TypeMetadataAddress : : FullMetadata ; <nl> defaultVarTy = FullHeapMetadataStructTy ; <nl> adjustmentIndex = MetadataAdjustmentIndex : : Class ; <nl> llvm : : GlobalValue * IRGenModule : : defineTypeMetadata ( CanType concreteType , <nl> adjustmentIndex = MetadataAdjustmentIndex : : ValueType ; <nl> } <nl> <nl> - auto entity = LinkEntity : : forTypeMetadata ( concreteType , addrKind , isPattern ) ; <nl> + auto entity = LinkEntity : : forTypeMetadata ( concreteType , addrKind ) ; <nl> <nl> auto DbgTy = DebugTypeInfo : : getMetadata ( MetatypeType : : get ( concreteType ) , <nl> defaultVarTy - > getPointerTo ( ) , Size ( 0 ) , <nl> llvm : : GlobalValue * IRGenModule : : defineTypeMetadata ( CanType concreteType , <nl> var - > setConstant ( isConstant ) ; <nl> if ( ! section . empty ( ) ) <nl> var - > setSection ( section ) ; <nl> - <nl> - / / Keep type metadata around for all types . <nl> - addRuntimeResolvableType ( concreteType ) ; <nl> <nl> - / / For metadata patterns , we ' re done . <nl> - if ( isPattern ) <nl> - return var ; <nl> + / / Keep type metadata around for all types . <nl> + if ( auto nominal = concreteType - > getAnyNominal ( ) ) <nl> + addRuntimeResolvableType ( nominal ) ; <nl> <nl> / / For concrete metadata , declare the alias to its address point . <nl> auto directEntity = LinkEntity : : forTypeMetadata ( concreteType , <nl> - TypeMetadataAddress : : AddressPoint , <nl> - / * isPattern * / false ) ; <nl> + TypeMetadataAddress : : AddressPoint ) ; <nl> <nl> llvm : : Constant * addr = var ; <nl> / / Do an adjustment if necessary . <nl> llvm : : GlobalValue * IRGenModule : : defineTypeMetadata ( CanType concreteType , <nl> / / / and it will have the type pointer - to - T , where T is the type <nl> / / / of a direct metadata ; <nl> / / / - if the metadata is a pattern , then the result will not be <nl> - / / / adjusted and it will have TypeMetadataPatternPtrTy ; <nl> + / / / adjusted and it will have FullTypeMetadataPtrTy ; <nl> / / / - otherwise it will be adjusted to the canonical address point <nl> / / / for a type metadata and it will have type TypeMetadataPtrTy . <nl> - llvm : : Constant * IRGenModule : : getAddrOfTypeMetadata ( CanType concreteType , <nl> - bool isPattern ) { <nl> - return getAddrOfTypeMetadata ( concreteType , isPattern , <nl> + llvm : : Constant * IRGenModule : : getAddrOfTypeMetadata ( CanType concreteType ) { <nl> + return getAddrOfTypeMetadata ( concreteType , <nl> SymbolReferenceKind : : Absolute ) . getDirectValue ( ) ; <nl> } <nl> <nl> ConstantReference IRGenModule : : getAddrOfTypeMetadata ( CanType concreteType , <nl> - bool isPattern , <nl> SymbolReferenceKind refKind ) { <nl> - assert ( isPattern | | ! isa < UnboundGenericType > ( concreteType ) ) ; <nl> + assert ( ! isa < UnboundGenericType > ( concreteType ) ) ; <nl> <nl> llvm : : Type * defaultVarTy ; <nl> unsigned adjustmentIndex ; <nl> ConstantReference IRGenModule : : getAddrOfTypeMetadata ( CanType concreteType , <nl> <nl> ClassDecl * ObjCClass = nullptr ; <nl> <nl> - / / Patterns use the pattern type and no adjustment . <nl> - if ( isPattern ) { <nl> - defaultVarTy = TypeMetadataPatternStructTy ; <nl> - adjustmentIndex = 0 ; <nl> - <nl> / / Objective - C classes use the ObjC class object . <nl> - } else if ( isa < ClassType > ( concreteType ) & & <nl> - ! hasKnownSwiftMetadata ( * this , <nl> - cast < ClassType > ( concreteType ) - > getDecl ( ) ) ) { <nl> + if ( isa < ClassType > ( concreteType ) & & <nl> + ! hasKnownSwiftMetadata ( * this , cast < ClassType > ( concreteType ) - > getDecl ( ) ) ) { <nl> defaultVarTy = TypeMetadataStructTy ; <nl> adjustmentIndex = 0 ; <nl> ObjCClass = cast < ClassType > ( concreteType ) - > getDecl ( ) ; <nl> ConstantReference IRGenModule : : getAddrOfTypeMetadata ( CanType concreteType , <nl> <nl> / / If this is a use , and the type metadata is emitted lazily , <nl> / / trigger lazy emission of the metadata . <nl> - if ( NominalTypeDecl * Nominal = concreteType - > getAnyNominal ( ) ) { <nl> - IRGen . addLazyTypeMetadata ( Nominal ) ; <nl> + if ( NominalTypeDecl * nominal = concreteType - > getAnyNominal ( ) ) { <nl> + IRGen . noteUseOfTypeMetadata ( nominal ) ; <nl> } <nl> <nl> LinkEntity entity <nl> = ObjCClass ? LinkEntity : : forObjCClass ( ObjCClass ) <nl> : LinkEntity : : forTypeMetadata ( concreteType , <nl> - TypeMetadataAddress : : AddressPoint , <nl> - isPattern ) ; <nl> + TypeMetadataAddress : : AddressPoint ) ; <nl> <nl> auto DbgTy = <nl> ObjCClass <nl> ConstantReference IRGenModule : : getAddrOfTypeMetadata ( CanType concreteType , <nl> return addr ; <nl> } <nl> <nl> + llvm : : Constant * <nl> + IRGenModule : : getAddrOfTypeMetadataPattern ( NominalTypeDecl * D ) { <nl> + return getAddrOfTypeMetadataPattern ( D , false , ConstantInit ( ) , " " ) ; <nl> + } <nl> + <nl> + llvm : : Constant * <nl> + IRGenModule : : getAddrOfTypeMetadataPattern ( NominalTypeDecl * D , <nl> + bool isConstant , <nl> + ConstantInit init , <nl> + StringRef section ) { <nl> + if ( ! init ) <nl> + IRGen . noteUseOfTypeMetadata ( D ) ; <nl> + <nl> + auto alignment = getPointerAlignment ( ) ; <nl> + LinkEntity entity = LinkEntity : : forTypeMetadataPattern ( D ) ; <nl> + auto addr = getAddrOfLLVMVariable ( entity , alignment , init , <nl> + Int8PtrTy , DebugTypeInfo ( ) ) ; <nl> + <nl> + if ( init ) { <nl> + auto var = cast < llvm : : GlobalVariable > ( addr ) ; <nl> + var - > setConstant ( true ) ; <nl> + if ( ! section . empty ( ) ) <nl> + var - > setSection ( section ) ; <nl> + <nl> + / / Keep type metadata around for all types . <nl> + addRuntimeResolvableType ( D ) ; <nl> + } <nl> + <nl> + return addr ; <nl> + } <nl> + <nl> / / / Returns the address of a class metadata base offset . <nl> llvm : : Constant * <nl> IRGenModule : : getAddrOfClassMetadataBaseOffset ( ClassDecl * D , <nl> IRGenModule : : getAddrOfClassMetadataBaseOffset ( ClassDecl * D , <nl> SizeTy , DebugTypeInfo ( ) ) ; <nl> } <nl> <nl> + / / / Return the address of a generic type ' s metadata instantiation cache . <nl> + llvm : : Constant * <nl> + IRGenModule : : getAddrOfTypeMetadataInstantiationCache ( NominalTypeDecl * D , <nl> + ForDefinition_t forDefinition ) { <nl> + auto entity = LinkEntity : : forTypeMetadataInstantiationCache ( D ) ; <nl> + auto ty = llvm : : ArrayType : : get ( Int8PtrTy , NumGenericMetadataPrivateDataWords ) ; <nl> + return getAddrOfLLVMVariable ( entity , getPointerAlignment ( ) , <nl> + forDefinition , ty , DebugTypeInfo ( ) ) ; <nl> + } <nl> + <nl> + llvm : : Function * <nl> + IRGenModule : : getAddrOfTypeMetadataInstantiationFunction ( NominalTypeDecl * D , <nl> + ForDefinition_t forDefinition ) { <nl> + LinkEntity entity = LinkEntity : : forTypeMetadataInstantiationFunction ( D ) ; <nl> + llvm : : Function * & entry = GlobalFuncs [ entity ] ; <nl> + if ( entry ) { <nl> + if ( forDefinition ) updateLinkageForDefinition ( * this , entry , entity ) ; <nl> + return entry ; <nl> + } <nl> + <nl> + llvm : : Type * argTys [ ] = { TypeContextDescriptorPtrTy , Int8PtrPtrTy } ; <nl> + auto fnType = llvm : : FunctionType : : get ( TypeMetadataPtrTy , <nl> + argTys , / * isVarArg * / false ) ; <nl> + Signature signature ( fnType , llvm : : AttributeList ( ) , DefaultCC ) ; <nl> + LinkInfo link = LinkInfo : : get ( * this , entity , forDefinition ) ; <nl> + entry = createFunction ( * this , link , signature ) ; <nl> + return entry ; <nl> + } <nl> + <nl> / / / Return the address of a nominal type descriptor . <nl> llvm : : Constant * IRGenModule : : getAddrOfTypeContextDescriptor ( NominalTypeDecl * D , <nl> - ConstantInit definition ) { <nl> - IRGen . addLazyTypeContextDescriptor ( D ) ; <nl> + RequireMetadata_t requireMetadata , <nl> + ConstantInit definition ) { <nl> + IRGen . noteUseOfTypeContextDescriptor ( D , requireMetadata ) ; <nl> + <nl> auto entity = LinkEntity : : forNominalTypeDescriptor ( D ) ; <nl> return getAddrOfLLVMVariable ( entity , Alignment ( 4 ) , <nl> definition , <nl> mmm a / lib / IRGen / GenMeta . cpp <nl> ppp b / lib / IRGen / GenMeta . cpp <nl> llvm : : Constant * IRGenModule : : getAddrOfStringForTypeRef ( <nl> / / We currently only allow symbolic references to nominal type contexts . <nl> auto nominal = cast < NominalTypeDecl > ( symbolic . first ) ; <nl> S . addRelativeAddress ( <nl> - getAddrOfTypeContextDescriptor ( const_cast < NominalTypeDecl * > ( nominal ) ) ) ; <nl> + getAddrOfTypeContextDescriptor ( const_cast < NominalTypeDecl * > ( nominal ) , <nl> + DontRequireMetadata ) ) ; <nl> <nl> pos = symbolic . second + 4 ; <nl> } <nl> llvm : : Constant * irgen : : tryEmitConstantHeapMetadataRef ( IRGenModule & IGM , <nl> if ( ! hasKnownSwiftMetadata ( IGM , theDecl ) ) <nl> return IGM . getAddrOfObjCClass ( theDecl , NotForDefinition ) ; <nl> <nl> - return IGM . getAddrOfTypeMetadata ( type , false ) ; <nl> + return IGM . getAddrOfTypeMetadata ( type ) ; <nl> } <nl> <nl> / / / Attempts to return a constant type metadata reference for a <nl> irgen : : tryEmitConstantTypeMetadataRef ( IRGenModule & IGM , CanType type , <nl> if ( ! isTypeMetadataAccessTrivial ( IGM , type ) ) <nl> return ConstantReference ( ) ; <nl> <nl> - return IGM . getAddrOfTypeMetadata ( type , false , refKind ) ; <nl> + return IGM . getAddrOfTypeMetadata ( type , refKind ) ; <nl> } <nl> <nl> / / / Emit a reference to an ObjC class . In general , the only things <nl> static llvm : : Value * emitNominalMetadataRef ( IRGenFunction & IGF , <nl> / / TODO : If Obj - C interop is off , we can relax this to allow referencing <nl> / / class metadata too . <nl> assert ( isa < StructDecl > ( theDecl ) | | isa < EnumDecl > ( theDecl ) ) ; <nl> - return IGF . IGM . getAddrOfTypeMetadata ( theType , false ) ; <nl> + return IGF . IGM . getAddrOfTypeMetadata ( theType ) ; <nl> } <nl> <nl> / / We are applying generic parameters to a generic type . <nl> namespace { <nl> # undef TREAT_AS_OPAQUE <nl> <nl> llvm : : Value * emitDirectMetadataRef ( CanType type ) { <nl> - return IGF . IGM . getAddrOfTypeMetadata ( type , <nl> - / * pattern * / false ) ; <nl> + return IGF . IGM . getAddrOfTypeMetadata ( type ) ; <nl> } <nl> <nl> / / / The given type should use opaque type info . We assume that <nl> llvm : : CallInst * IRGenFunction : : emitGenericTypeMetadataAccessFunctionCall ( <nl> static llvm : : Value * emitGenericMetadataAccessFunction ( IRGenFunction & IGF , <nl> NominalTypeDecl * nominal , <nl> GenericArguments & genericArgs ) { <nl> - CanType declaredType = nominal - > getDeclaredType ( ) - > getCanonicalType ( ) ; <nl> - llvm : : Value * metadata = IGF . IGM . getAddrOfTypeMetadata ( declaredType , true ) ; <nl> + llvm : : Value * descriptor = <nl> + IGF . IGM . getAddrOfTypeContextDescriptor ( nominal , RequireMetadata ) ; <nl> <nl> / / Collect input arguments to the generic metadata accessor , as laid out <nl> / / by the GenericArguments class . <nl> static llvm : : Value * emitGenericMetadataAccessFunction ( IRGenFunction & IGF , <nl> <nl> / / Make the call . <nl> auto result = IGF . Builder . CreateCall ( IGF . IGM . getGetGenericMetadataFn ( ) , <nl> - { metadata , arguments } ) ; <nl> + { descriptor , arguments } ) ; <nl> result - > setDoesNotThrow ( ) ; <nl> result - > addAttribute ( llvm : : AttributeList : : FunctionIndex , <nl> llvm : : Attribute : : ReadOnly ) ; <nl> emitInPlaceTypeMetadataAccessFunctionBody ( IRGenFunction & IGF , <nl> llvm : : Constant * metadata = <nl> IGF . IGM . requiresForeignTypeMetadata ( type ) <nl> ? IGF . IGM . getAddrOfForeignTypeMetadataCandidate ( type ) <nl> - : IGF . IGM . getAddrOfTypeMetadata ( type , false ) ; <nl> + : IGF . IGM . getAddrOfTypeMetadata ( type ) ; <nl> <nl> / / We might not have interesting initialization to do . <nl> assert ( ( cacheVariable = = nullptr ) = = <nl> static llvm : : Value * emitTypeMetadataAccessFunctionBody ( IRGenFunction & IGF , <nl> } <nl> <nl> / / Okay , everything else is built from a Swift metadata object . <nl> - llvm : : Constant * metadata = IGF . IGM . getAddrOfTypeMetadata ( type , false ) ; <nl> + llvm : : Constant * metadata = IGF . IGM . getAddrOfTypeMetadata ( type ) ; <nl> <nl> / / We should not be doing more serious work along this path . <nl> assert ( isTypeMetadataAccessTrivial ( IGF . IGM , type ) ) ; <nl> namespace { <nl> EmitTypeMetadataRefForLayout ( IRGenFunction & IGF ) : IGF ( IGF ) { } <nl> <nl> llvm : : Value * emitDirectMetadataRef ( CanType type ) { <nl> - return IGF . IGM . getAddrOfTypeMetadata ( type , / * pattern * / false ) ; <nl> + return IGF . IGM . getAddrOfTypeMetadata ( type ) ; <nl> } <nl> <nl> / / / For most types , we can just emit the usual metadata . <nl> namespace { <nl> <nl> protected : <nl> NominalTypeDecl * Type ; <nl> - bool Lazy ; <nl> + RequireMetadata_t HasMetadata ; <nl> <nl> using super : : IGM ; <nl> using super : : B ; <nl> namespace { <nl> using super : : addGenericSignature ; <nl> <nl> TypeContextDescriptorBuilderBase ( IRGenModule & IGM , NominalTypeDecl * Type , <nl> - bool isLazy ) <nl> - : super ( IGM ) , Type ( Type ) , Lazy ( isLazy ) <nl> + RequireMetadata_t requireMetadata ) <nl> + : super ( IGM ) , Type ( Type ) , <nl> + HasMetadata ( requireMetadata ) <nl> { } <nl> <nl> void layout ( ) { <nl> namespace { <nl> void addAccessFunction ( ) { <nl> / / Don ' t emit the access function if we ' re only lazily emitting the <nl> / / context descriptor . <nl> - if ( Lazy ) { <nl> + if ( ! HasMetadata ) { <nl> B . addInt32 ( 0 ) ; <nl> return ; <nl> } <nl> namespace { <nl> return Type - > getGenericSignature ( ) ; <nl> } <nl> <nl> + / / / Fill in the fields of a TypeGenericContextDescriptorHeader . <nl> void addGenericParametersHeader ( ) { <nl> + asImpl ( ) . addGenericParamsOffset ( ) ; <nl> + asImpl ( ) . addMetadataInstantiationFunction ( ) ; <nl> + asImpl ( ) . addMetadataInstantiationCache ( ) ; <nl> + <nl> + super : : addGenericParametersHeader ( ) ; <nl> + } <nl> + <nl> + void addGenericParamsOffset ( ) { <nl> / / Include the offset to the generic argument vector inside a metadata <nl> / / record for this type . <nl> B . addInt32 ( asImpl ( ) . getGenericParamsOffset ( ) / IGM . getPointerSize ( ) ) ; <nl> - super : : addGenericParametersHeader ( ) ; <nl> + } <nl> + <nl> + void addMetadataInstantiationFunction ( ) { <nl> + if ( ! HasMetadata ) { <nl> + B . addInt32 ( 0 ) ; <nl> + return ; <nl> + } <nl> + <nl> + auto function = <nl> + IGM . getAddrOfTypeMetadataInstantiationFunction ( Type , NotForDefinition ) ; <nl> + B . addRelativeAddress ( function ) ; <nl> + } <nl> + <nl> + void addMetadataInstantiationCache ( ) { <nl> + if ( ! HasMetadata ) { <nl> + B . addInt32 ( 0 ) ; <nl> + return ; <nl> + } <nl> + <nl> + auto cache = <nl> + IGM . getAddrOfTypeMetadataInstantiationCache ( Type , NotForDefinition ) ; <nl> + B . addRelativeAddress ( cache ) ; <nl> } <nl> <nl> bool isUniqueDescriptor ( ) { <nl> namespace { <nl> <nl> llvm : : Constant * emit ( ) { <nl> asImpl ( ) . layout ( ) ; <nl> - auto addr = IGM . getAddrOfTypeContextDescriptor ( Type , <nl> + auto addr = IGM . getAddrOfTypeContextDescriptor ( Type , HasMetadata , <nl> B . finishAndCreateFuture ( ) ) ; <nl> auto var = cast < llvm : : GlobalVariable > ( addr ) ; <nl> <nl> namespace { <nl> <nl> public : <nl> StructContextDescriptorBuilder ( IRGenModule & IGM , StructDecl * Type , <nl> - bool Lazy ) <nl> - : super ( IGM , Type , Lazy ) <nl> + RequireMetadata_t requireMetadata ) <nl> + : super ( IGM , Type , requireMetadata ) <nl> { <nl> auto & layout = IGM . getMetadataLayout ( getType ( ) ) ; <nl> GenericParamsOffset = layout . getStaticGenericRequirementsOffset ( ) ; <nl> namespace { <nl> Size PayloadSizeOffset ; <nl> <nl> public : <nl> - EnumContextDescriptorBuilder ( IRGenModule & IGM , EnumDecl * Type , bool Lazy ) <nl> - : super ( IGM , Type , Lazy ) <nl> + EnumContextDescriptorBuilder ( IRGenModule & IGM , EnumDecl * Type , <nl> + RequireMetadata_t requireMetadata ) <nl> + : super ( IGM , Type , requireMetadata ) <nl> { <nl> auto & layout = IGM . getMetadataLayout ( getType ( ) ) ; <nl> GenericParamsOffset = layout . getStaticGenericRequirementsOffset ( ) ; <nl> namespace { <nl> unsigned VTableSize ; <nl> <nl> public : <nl> - ClassContextDescriptorBuilder ( IRGenModule & IGM , ClassDecl * Type , bool Lazy ) <nl> - : super ( IGM , Type , Lazy ) <nl> + ClassContextDescriptorBuilder ( IRGenModule & IGM , ClassDecl * Type , <nl> + RequireMetadata_t requireMetadata ) <nl> + : super ( IGM , Type , requireMetadata ) <nl> { <nl> if ( getType ( ) - > isForeign ( ) ) { <nl> VTable = nullptr ; <nl> namespace { <nl> } ; <nl> } / / end anonymous namespace <nl> <nl> - void <nl> - irgen : : emitLazyTypeContextDescriptor ( IRGenModule & IGM , <nl> - NominalTypeDecl * Nominal ) { <nl> - if ( auto Struct = dyn_cast < StructDecl > ( Nominal ) ) { <nl> - StructContextDescriptorBuilder ( IGM , Struct , / * lazy * / true ) <nl> - . emit ( ) ; <nl> - } else if ( auto Enum = dyn_cast < EnumDecl > ( Nominal ) ) { <nl> - EnumContextDescriptorBuilder ( IGM , Enum , / * lazy * / true ) <nl> - . emit ( ) ; <nl> - } else if ( auto Class = dyn_cast < ClassDecl > ( Nominal ) ) { <nl> - ClassContextDescriptorBuilder ( IGM , Class , / * lazy * / true ) <nl> - . emit ( ) ; <nl> + static void eraseExistingTypeContextDescriptor ( IRGenModule & IGM , <nl> + NominalTypeDecl * type ) { <nl> + / / We may have emitted a partial type context descriptor with some empty <nl> + / / fields , and then later discovered we ' re emitting complete metadata . <nl> + / / Remove existing definitions of the type context so that we can regenerate <nl> + / / a complete descriptor . <nl> + auto entity = IGM . getAddrOfTypeContextDescriptor ( type , DontRequireMetadata ) ; <nl> + entity = entity - > stripPointerCasts ( ) ; <nl> + auto existingContext = dyn_cast < llvm : : GlobalVariable > ( entity ) ; <nl> + if ( existingContext & & ! existingContext - > isDeclaration ( ) ) { <nl> + existingContext - > setInitializer ( nullptr ) ; <nl> + } <nl> + } <nl> + <nl> + void irgen : : emitLazyTypeContextDescriptor ( IRGenModule & IGM , <nl> + NominalTypeDecl * type , <nl> + RequireMetadata_t requireMetadata ) { <nl> + eraseExistingTypeContextDescriptor ( IGM , type ) ; <nl> + <nl> + if ( auto sd = dyn_cast < StructDecl > ( type ) ) { <nl> + StructContextDescriptorBuilder ( IGM , sd , requireMetadata ) . emit ( ) ; <nl> + } else if ( auto ed = dyn_cast < EnumDecl > ( type ) ) { <nl> + EnumContextDescriptorBuilder ( IGM , ed , requireMetadata ) . emit ( ) ; <nl> + } else if ( auto cd = dyn_cast < ClassDecl > ( type ) ) { <nl> + ClassContextDescriptorBuilder ( IGM , cd , requireMetadata ) . emit ( ) ; <nl> } else { <nl> llvm_unreachable ( " type does not have a context descriptor " ) ; <nl> } <nl> } <nl> <nl> + void irgen : : emitLazyTypeMetadata ( IRGenModule & IGM , NominalTypeDecl * type ) { <nl> + eraseExistingTypeContextDescriptor ( IGM , type ) ; <nl> + <nl> + if ( auto sd = dyn_cast < StructDecl > ( type ) ) { <nl> + return emitStructMetadata ( IGM , sd ) ; <nl> + } else if ( auto ed = dyn_cast < EnumDecl > ( type ) ) { <nl> + emitEnumMetadata ( IGM , ed ) ; <nl> + } else if ( auto pd = dyn_cast < ProtocolDecl > ( type ) ) { <nl> + IGM . emitProtocolDecl ( pd ) ; <nl> + } else { <nl> + llvm_unreachable ( " should not have enqueued a class decl here ! " ) ; <nl> + } <nl> + <nl> + } <nl> + <nl> llvm : : Constant * <nl> IRGenModule : : getAddrOfSharedContextDescriptor ( LinkEntity entity , <nl> ConstantInit definition , <nl> namespace { <nl> <nl> SmallVector < FillOp , 8 > FillOps ; <nl> <nl> - enum { TemplateHeaderFieldCount = 5 } ; <nl> - enum { NumPrivateDataWords = swift : : NumGenericMetadataPrivateDataWords } ; <nl> - <nl> protected : <nl> - Size TemplateHeaderSize ; <nl> - <nl> / / / The offset of the address point in the type we ' re emitting . <nl> Size AddressPoint = Size : : invalid ( ) ; <nl> + <nl> + / / / The total size of the template ( following any header ) . <nl> + Size TemplateSize = Size : : invalid ( ) ; <nl> <nl> IRGenModule & IGM = super : : IGM ; <nl> using super : : asImpl ; <nl> namespace { <nl> GenericMetadataBuilderBase ( IRGenModule & IGM , T & & . . . args ) <nl> : super ( IGM , std : : forward < T > ( args ) . . . ) { } <nl> <nl> + / / / Emit the instantiation cache variable for the template . <nl> + void emitInstantiationCache ( ) { <nl> + auto cache = cast < llvm : : GlobalVariable > ( <nl> + IGM . getAddrOfTypeMetadataInstantiationCache ( Target , ForDefinition ) ) ; <nl> + auto init = <nl> + llvm : : ConstantAggregateZero : : get ( cache - > getValueType ( ) ) ; <nl> + cache - > setInitializer ( init ) ; <nl> + } <nl> + <nl> / / / Emit the create function for the template . <nl> - llvm : : Function * emitCreateFunction ( ) { <nl> - / / Metadata * ( * CreateFunction ) ( GenericMetadata * , const void * const * ) <nl> - llvm : : Type * argTys [ ] = { IGM . TypeMetadataPatternPtrTy , IGM . Int8PtrPtrTy } ; <nl> - auto ty = llvm : : FunctionType : : get ( IGM . TypeMetadataPtrTy , <nl> - argTys , / * isVarArg * / false ) ; <nl> - llvm : : Function * f = llvm : : Function : : Create ( ty , <nl> - llvm : : GlobalValue : : PrivateLinkage , <nl> - llvm : : Twine ( " create_generic_metadata_ " ) <nl> - + Target - > getName ( ) . str ( ) , <nl> - & IGM . Module ) ; <nl> + void emitCreateFunction ( ) { <nl> + / / Metadata * ( * CreateFunction ) ( TypeContextDescriptor * , const void * const * ) <nl> + llvm : : Function * f = <nl> + IGM . getAddrOfTypeMetadataInstantiationFunction ( Target , ForDefinition ) ; <nl> f - > setAttributes ( IGM . constructInitialAttributes ( ) ) ; <nl> <nl> IRGenFunction IGF ( IGM , f ) ; <nl> namespace { <nl> IGM . DebugInfo - > emitArtificialFunction ( IGF , f ) ; <nl> <nl> Explosion params = IGF . collectParameters ( ) ; <nl> - llvm : : Value * metadataPattern = params . claimNext ( ) ; <nl> + llvm : : Value * descriptor = params . claimNext ( ) ; <nl> llvm : : Value * args = params . claimNext ( ) ; <nl> <nl> / / Bind the generic arguments . <nl> namespace { <nl> <nl> / / Allocate the metadata . <nl> llvm : : Value * metadataValue = <nl> - asImpl ( ) . emitAllocateMetadata ( IGF , metadataPattern , args ) ; <nl> - <nl> + asImpl ( ) . emitAllocateMetadata ( IGF , descriptor , args ) ; <nl> + <nl> / / Execute the fill ops . Cast the parameters to word pointers because the <nl> / / fill indexes are word - indexed . <nl> auto * metadataWords = IGF . Builder . CreateBitCast ( metadataValue , IGM . Int8PtrPtrTy ) ; <nl> namespace { <nl> <nl> / / The metadata is now complete . <nl> IGF . Builder . CreateRet ( metadataValue ) ; <nl> - <nl> - return f ; <nl> } <nl> <nl> public : <nl> namespace { <nl> } <nl> <nl> void layout ( ) { <nl> - TemplateHeaderSize = <nl> - ( ( NumPrivateDataWords + 1 ) * IGM . getPointerSize ( ) ) + Size ( 8 ) ; <nl> - <nl> - auto privateDataInit = getPrivateDataInit ( ) ; <nl> - <nl> - / / Leave room for the header . <nl> - auto createFunctionField = B . addPlaceholderWithSize ( IGM . Int8PtrTy ) ; <nl> - auto sizeField = B . addPlaceholderWithSize ( IGM . Int32Ty ) ; <nl> - auto numArgumentsField = B . addPlaceholderWithSize ( IGM . Int16Ty ) ; <nl> - auto addressPointField = B . addPlaceholderWithSize ( IGM . Int16Ty ) ; <nl> - auto privateDataField = <nl> - B . addPlaceholderWithSize ( privateDataInit - > getType ( ) ) ; <nl> - <nl> asImpl ( ) . addDependentData ( ) ; <nl> <nl> / / Lay out the template data . <nl> super : : layout ( ) ; <nl> - <nl> - / / Fill in the header : <nl> <nl> - / / Metadata * ( * CreateFunction ) ( GenericMetadata * , const void * ) ; <nl> - B . fillPlaceholder ( createFunctionField , emitCreateFunction ( ) ) ; <nl> - <nl> - / / uint32_t TemplateSize ; <nl> - / / We compute this assuming that every entry in the metadata table <nl> - / / is a pointer in size . <nl> - Size size = getNextOffsetFromTemplateHeader ( ) ; <nl> - B . fillPlaceholderWithInt ( sizeField , IGM . Int32Ty , size . getValue ( ) ) ; <nl> - <nl> - / / uint16_t NumArguments ; <nl> - / / TODO : ultimately , this should be the number of actual template <nl> - / / arguments , not the number of witness tables required . <nl> - unsigned numGenericArguments = <nl> - GenericArguments : : getNumGenericArguments ( IGM , Target ) ; <nl> - B . fillPlaceholderWithInt ( numArgumentsField , <nl> - IGM . Int16Ty , numGenericArguments ) ; <nl> - <nl> - / / uint16_t AddressPoint ; <nl> - assert ( ! AddressPoint . isInvalid ( ) & & " address point not noted ! " ) ; <nl> - B . fillPlaceholderWithInt ( addressPointField , <nl> - IGM . Int16Ty , AddressPoint . getValue ( ) ) ; <nl> + TemplateSize = getNextOffsetFromTemplateHeader ( ) ; <nl> <nl> - / / void * PrivateData [ NumPrivateDataWords ] ; <nl> - B . fillPlaceholder ( privateDataField , privateDataInit ) ; <nl> + asImpl ( ) . emitCreateFunction ( ) ; <nl> + asImpl ( ) . emitInstantiationCache ( ) ; <nl> } <nl> <nl> / / / Write down the index of the address point . <nl> namespace { <nl> super : : noteAddressPoint ( ) ; <nl> } <nl> <nl> - / / / Ignore the preallocated header . <nl> + / / / Ignore any preallocated header on the template . <nl> Size getNextOffsetFromTemplateHeader ( ) const { <nl> - / / Note that the header fields are all pointer - sized . <nl> - return B . getNextOffsetFromGlobal ( ) - TemplateHeaderSize ; <nl> + return B . getNextOffsetFromGlobal ( ) ; <nl> } <nl> <nl> template < class . . . T > <nl> namespace { <nl> <nl> / / Can be overridden by subclassers to emit other dependent metadata . <nl> void addDependentData ( ) { } <nl> - <nl> - private : <nl> - static llvm : : Constant * makeArray ( llvm : : Type * eltTy , <nl> - ArrayRef < llvm : : Constant * > elts ) { <nl> - auto arrayTy = llvm : : ArrayType : : get ( eltTy , elts . size ( ) ) ; <nl> - return llvm : : ConstantArray : : get ( arrayTy , elts ) ; <nl> - } <nl> - <nl> - / / / Produce the initializer for the private - data field of the <nl> - / / / template header . <nl> - llvm : : Constant * getPrivateDataInit ( ) { <nl> - auto null = llvm : : ConstantPointerNull : : get ( IGM . Int8PtrTy ) ; <nl> - <nl> - llvm : : Constant * privateData [ NumPrivateDataWords ] ; <nl> - <nl> - for ( auto & element : privateData ) <nl> - element = null ; <nl> - <nl> - return makeArray ( IGM . Int8PtrTy , privateData ) ; <nl> - } <nl> } ; <nl> } / / end anonymous namespace <nl> <nl> namespace { <nl> <nl> void addNominalTypeDescriptor ( ) { <nl> auto descriptor = <nl> - ClassContextDescriptorBuilder ( IGM , Target , / * lazy * / false ) . emit ( ) ; <nl> + ClassContextDescriptorBuilder ( IGM , Target , RequireMetadata ) . emit ( ) ; <nl> B . add ( descriptor ) ; <nl> } <nl> <nl> namespace { <nl> emitFieldOffsetGlobals ( ) ; <nl> <nl> auto type = Target - > getDeclaredType ( ) - > getCanonicalType ( ) ; <nl> - auto metadata = <nl> - IGF . IGM . getAddrOfTypeMetadata ( type , / * pattern * / false ) ; <nl> + auto metadata = IGF . IGM . getAddrOfTypeMetadata ( type ) ; <nl> return emitFinishIdempotentInitialization ( IGF , metadata ) ; <nl> } <nl> <nl> namespace { <nl> } <nl> <nl> llvm : : Value * emitAllocateMetadata ( IRGenFunction & IGF , <nl> - llvm : : Value * metadataPattern , <nl> + llvm : : Value * descriptor , <nl> llvm : : Value * arguments ) { <nl> llvm : : Value * superMetadata ; <nl> if ( Target - > hasSuperclass ( ) ) { <nl> namespace { <nl> superMetadata = llvm : : ConstantPointerNull : : get ( IGM . ObjCClassPtrTy ) ; <nl> } <nl> <nl> + auto templatePointer = IGM . getAddrOfTypeMetadataPattern ( Target ) ; <nl> + auto templateSize = IGM . getSize ( TemplateSize ) ; <nl> + auto templateAddressPoint = IGM . getSize ( AddressPoint ) ; <nl> + <nl> auto numImmediateMembers = <nl> IGM . getSize ( Size ( IGM . getClassMetadataLayout ( Target ) . getNumImmediateMembers ( ) ) ) ; <nl> <nl> return IGF . Builder . CreateCall ( IGM . getAllocateGenericClassMetadataFn ( ) , <nl> - { metadataPattern , arguments , superMetadata , <nl> - numImmediateMembers } ) ; <nl> + { descriptor , templatePointer , templateSize , <nl> + templateAddressPoint , arguments , <nl> + superMetadata , numImmediateMembers } ) ; <nl> } <nl> <nl> void addMetadataFlags ( ) { <nl> namespace { <nl> <nl> std : : tie ( DependentClassRODataPoint , DependentMetaclassRODataPoint ) <nl> = emitClassPrivateDataFields ( IGM , B , Target ) ; <nl> - DependentClassRODataPoint - = TemplateHeaderSize ; <nl> - DependentMetaclassRODataPoint - = TemplateHeaderSize ; <nl> } <nl> <nl> void noteStartOfFieldOffsets ( ClassDecl * whichClass ) { } <nl> namespace { <nl> <nl> void addNominalTypeDescriptor ( ) { <nl> auto * descriptor = <nl> - StructContextDescriptorBuilder ( IGM , Target , / * lazy * / false ) . emit ( ) ; <nl> + StructContextDescriptorBuilder ( IGM , Target , RequireMetadata ) . emit ( ) ; <nl> B . add ( descriptor ) ; <nl> } <nl> <nl> namespace { <nl> : super ( IGM , theStruct , B ) { } <nl> <nl> llvm : : Value * emitAllocateMetadata ( IRGenFunction & IGF , <nl> - llvm : : Value * metadataPattern , <nl> + llvm : : Value * descriptor , <nl> llvm : : Value * arguments ) { <nl> + auto templatePointer = IGM . getAddrOfTypeMetadataPattern ( Target ) ; <nl> + auto templateSize = IGM . getSize ( TemplateSize ) ; <nl> + assert ( AddressPoint = = IGM . getPointerSize ( ) & & <nl> + " address point is not equal to value expected by runtime " ) ; <nl> + <nl> return IGF . Builder . CreateCall ( IGM . getAllocateGenericValueMetadataFn ( ) , <nl> - { metadataPattern , arguments } ) ; <nl> + { descriptor , templatePointer , templateSize , <nl> + arguments } ) ; <nl> } <nl> <nl> void flagUnfilledFieldOffset ( ) { <nl> namespace { <nl> <nl> void addNominalTypeDescriptor ( ) { <nl> auto descriptor = <nl> - EnumContextDescriptorBuilder ( IGM , Target , / * lazy * / false ) . emit ( ) ; <nl> + EnumContextDescriptorBuilder ( IGM , Target , RequireMetadata ) . emit ( ) ; <nl> B . add ( descriptor ) ; <nl> } <nl> <nl> namespace { <nl> : GenericMetadataBuilderBase ( IGM , theEnum , B ) { } <nl> <nl> llvm : : Value * emitAllocateMetadata ( IRGenFunction & IGF , <nl> - llvm : : Value * metadataPattern , <nl> + llvm : : Value * descriptor , <nl> llvm : : Value * arguments ) { <nl> + auto templatePointer = IGM . getAddrOfTypeMetadataPattern ( Target ) ; <nl> + auto templateSize = IGM . getSize ( TemplateSize ) ; <nl> + assert ( AddressPoint = = IGM . getPointerSize ( ) & & <nl> + " address point is not equal to value expected by runtime " ) ; <nl> + <nl> return IGF . Builder . CreateCall ( IGM . getAllocateGenericValueMetadataFn ( ) , <nl> - { metadataPattern , arguments } ) ; <nl> + { descriptor , templatePointer , templateSize , <nl> + arguments } ) ; <nl> } <nl> <nl> void addValueWitnessTable ( ) { <nl> namespace { <nl> <nl> void addNominalTypeDescriptor ( ) { <nl> auto descriptor = <nl> - ClassContextDescriptorBuilder ( this - > IGM , Target , / * lazy * / false ) . emit ( ) ; <nl> + ClassContextDescriptorBuilder ( this - > IGM , Target , RequireMetadata ) . emit ( ) ; <nl> B . add ( descriptor ) ; <nl> } <nl> <nl> IRGenModule : : getAddrOfForeignTypeMetadataCandidate ( CanType type ) { <nl> } <nl> <nl> / / Keep type metadata around for all types . <nl> - addRuntimeResolvableType ( type ) ; <nl> + addRuntimeResolvableType ( type - > getAnyNominal ( ) ) ; <nl> <nl> / / If the enclosing type is also an imported type , force its metadata too . <nl> if ( auto enclosing = type - > getNominalParent ( ) ) { <nl> mmm a / lib / IRGen / GenMeta . h <nl> ppp b / lib / IRGen / GenMeta . h <nl> namespace irgen { <nl> class GenericTypeRequirements ; <nl> class IRGenFunction ; <nl> class IRGenModule ; <nl> + enum RequireMetadata_t : bool ; <nl> class Size ; <nl> class StructLayout ; <nl> enum class SymbolReferenceKind : unsigned char ; <nl> namespace irgen { <nl> / / / Emit a type context descriptor that was demanded by a reference from <nl> / / / other generated definitions . <nl> void emitLazyTypeContextDescriptor ( IRGenModule & IGM , <nl> - NominalTypeDecl * theStruct ) ; <nl> + NominalTypeDecl * type , <nl> + RequireMetadata_t requireMetadata ) ; <nl> + <nl> + / / / Emit type metadata that was demanded by a reference from other <nl> + / / / generated definitions . <nl> + void emitLazyTypeMetadata ( IRGenModule & IGM , NominalTypeDecl * type ) ; <nl> <nl> / / / Emit the metadata associated with the given struct declaration . <nl> void emitStructMetadata ( IRGenModule & IGM , StructDecl * theStruct ) ; <nl> mmm a / lib / IRGen / IRGenMangler . h <nl> ppp b / lib / IRGen / IRGenMangler . h <nl> class IRGenMangler : public Mangle : : ASTMangler { <nl> return mangleTypeSymbol ( type , " Mf " ) ; <nl> } <nl> <nl> - std : : string mangleTypeMetadataFull ( Type type , bool isPattern ) { <nl> - return mangleTypeSymbol ( type , isPattern ? " MP " : " N " ) ; <nl> + std : : string mangleTypeMetadataFull ( Type type ) { <nl> + return mangleTypeSymbol ( type , " N " ) ; <nl> + } <nl> + <nl> + std : : string mangleTypeMetadataPattern ( const NominalTypeDecl * decl ) { <nl> + return mangleNominalTypeSymbol ( decl , " MP " ) ; <nl> } <nl> <nl> std : : string mangleClassMetaClass ( const ClassDecl * Decl ) { <nl> class IRGenMangler : public Mangle : : ASTMangler { <nl> std : : string mangleNominalTypeDescriptor ( const NominalTypeDecl * Decl ) { <nl> return mangleNominalTypeSymbol ( Decl , " Mn " ) ; <nl> } <nl> + <nl> + std : : string mangleTypeMetadataInstantiationCache ( const NominalTypeDecl * Decl ) { <nl> + return mangleNominalTypeSymbol ( Decl , " MI " ) ; <nl> + } <nl> + <nl> + std : : string mangleTypeMetadataInstantiationFunction ( <nl> + const NominalTypeDecl * Decl ) { <nl> + return mangleNominalTypeSymbol ( Decl , " Mi " ) ; <nl> + } <nl> <nl> std : : string mangleModuleDescriptor ( const ModuleDecl * Decl ) { <nl> beginMangling ( ) ; <nl> mmm a / lib / IRGen / IRGenModule . cpp <nl> ppp b / lib / IRGen / IRGenModule . cpp <nl> IRGenModule : : IRGenModule ( IRGenerator & irgen , <nl> } ) ; <nl> FullTypeMetadataPtrTy = FullTypeMetadataStructTy - > getPointerTo ( DefaultAS ) ; <nl> <nl> - / / A metadata pattern is a structure from which generic type <nl> - / / metadata are allocated . We leave this struct type intentionally <nl> - / / opaque , because the compiler basically never needs to access <nl> - / / anything from one . <nl> - TypeMetadataPatternStructTy = <nl> - llvm : : StructType : : create ( getLLVMContext ( ) , " swift . type_pattern " ) ; <nl> - TypeMetadataPatternPtrTy = <nl> - TypeMetadataPatternStructTy - > getPointerTo ( DefaultAS ) ; <nl> - <nl> DeallocatingDtorTy = llvm : : FunctionType : : get ( VoidTy , RefCountedPtrTy , false ) ; <nl> llvm : : Type * dtorPtrTy = DeallocatingDtorTy - > getPointerTo ( ) ; <nl> <nl> mmm a / lib / IRGen / IRGenModule . h <nl> ppp b / lib / IRGen / IRGenModule . h <nl> class FieldTypeInfo { <nl> bool hasFlags ( ) const { return Info . getInt ( ) ! = 0 ; } <nl> } ; <nl> <nl> + enum RequireMetadata_t : bool { <nl> + DontRequireMetadata = false , <nl> + RequireMetadata = true <nl> + } ; <nl> + <nl> / / / The principal singleton which manages all of IR generation . <nl> / / / <nl> / / / The IRGenerator delegates the emission of different top - level entities <nl> class IRGenerator { <nl> / / The current IGM for which IR is generated . <nl> IRGenModule * CurrentIGM = nullptr ; <nl> <nl> - / / / The set of type metadata that is not emitted eagerly . <nl> - llvm : : SmallPtrSet < NominalTypeDecl * , 4 > eligibleLazyMetadata ; <nl> + struct LazyTypeGlobalsInfo { <nl> + / / / Is there a use of the type metadata ? <nl> + bool IsMetadataUsed = false ; <nl> <nl> - / / / The set of type metadata that have been enqueue for lazy emission . <nl> - / / / <nl> - / / / It can also contain some eagerly emitted metadata . Those are ignored in <nl> - / / / lazy emission . <nl> - llvm : : SmallPtrSet < NominalTypeDecl * , 4 > scheduledLazyMetadata ; <nl> + / / / Is there a use of the nominal type descriptor ? <nl> + bool IsDescriptorUsed = false ; <nl> + <nl> + / / / Have we already emitted a definition for the type metadata with <nl> + / / / the current requirements ? <nl> + bool IsMetadataEmitted = false ; <nl> <nl> - / / / The set of type metadata that have been enqueue for lazy emission . <nl> + / / / Have we already emitted a definition for the type descriptor with <nl> + / / / the current requirements ? <nl> + bool IsDescriptorEmitted = false ; <nl> + <nl> + / / / Is the type a lazy type ? <nl> + bool IsLazy = false ; <nl> + } ; <nl> + <nl> + / / / The set of type metadata that have been enqueued for lazy emission . <nl> / / / <nl> / / / It can also contain some eagerly emitted metadata . Those are ignored in <nl> / / / lazy emission . <nl> - llvm : : SmallPtrSet < NominalTypeDecl * , 4 > scheduledLazyTypeContextDescriptors ; <nl> + llvm : : DenseMap < NominalTypeDecl * , LazyTypeGlobalsInfo > LazyTypeGlobals ; <nl> <nl> / / / The queue of lazy type metadata to emit . <nl> - llvm : : SmallVector < NominalTypeDecl * , 4 > LazyMetadata ; <nl> + llvm : : SmallVector < NominalTypeDecl * , 4 > LazyTypeMetadata ; <nl> + <nl> / / / The queue of lazy type context descriptors to emit . <nl> llvm : : SmallVector < NominalTypeDecl * , 4 > LazyTypeContextDescriptors ; <nl> <nl> class IRGenerator { <nl> DefaultIGMForFunction [ f ] = CurrentIGM ; <nl> } <nl> } <nl> - <nl> - void addLazyTypeMetadata ( NominalTypeDecl * Nominal ) { <nl> - / / Add it to the queue if it hasn ' t already been put there . <nl> - if ( scheduledLazyMetadata . insert ( Nominal ) . second ) { <nl> - LazyMetadata . push_back ( Nominal ) ; <nl> - <nl> - / / We don ' t need to emit only the type context descriptor anymore if we <nl> - / / forced the metadata . <nl> - if ( ! scheduledLazyTypeContextDescriptors . insert ( Nominal ) . second ) { <nl> - auto newEnd = std : : remove ( LazyTypeContextDescriptors . begin ( ) , <nl> - LazyTypeContextDescriptors . end ( ) , <nl> - Nominal ) ; <nl> - LazyTypeContextDescriptors . erase ( newEnd , <nl> - LazyTypeContextDescriptors . end ( ) ) ; <nl> - } <nl> - } <nl> + <nl> + void noteUseOfTypeMetadata ( NominalTypeDecl * type ) { <nl> + noteUseOfTypeGlobals ( type , true , RequireMetadata ) ; <nl> } <nl> - <nl> - void addLazyTypeContextDescriptor ( NominalTypeDecl * Nominal ) { <nl> - / / Emitting the metadata will already include the nominal type descriptor . <nl> - if ( scheduledLazyMetadata . count ( Nominal ) ) <nl> - return ; <nl> <nl> - / / Add it to the queue if it hasn ' t already been put there . <nl> - if ( scheduledLazyTypeContextDescriptors . insert ( Nominal ) . second ) { <nl> - LazyTypeContextDescriptors . push_back ( Nominal ) ; <nl> - } <nl> + void noteUseOfTypeContextDescriptor ( NominalTypeDecl * type , <nl> + RequireMetadata_t requireMetadata ) { <nl> + noteUseOfTypeGlobals ( type , false , requireMetadata ) ; <nl> } <nl> <nl> + private : <nl> + void noteUseOfTypeGlobals ( NominalTypeDecl * type , <nl> + bool isUseOfMetadata , <nl> + RequireMetadata_t requireMetadata ) ; <nl> + public : <nl> + <nl> / / / Return true if \ p wt can be emitted lazily . <nl> bool canEmitWitnessTableLazily ( SILWitnessTable * wt ) ; <nl> <nl> class IRGenModule { <nl> llvm : : PointerType * FullHeapMetadataPtrTy ; / / / % swift . full_heapmetadata * <nl> llvm : : StructType * FullBoxMetadataStructTy ; / / / % swift . full_boxmetadata = type { . . . } <nl> llvm : : PointerType * FullBoxMetadataPtrTy ; / / / % swift . full_boxmetadata * <nl> - llvm : : StructType * TypeMetadataPatternStructTy ; / / / % swift . type_pattern = type { . . . } <nl> - llvm : : PointerType * TypeMetadataPatternPtrTy ; / / / % swift . type_pattern * <nl> llvm : : StructType * FullTypeMetadataStructTy ; / / / % swift . full_type = type { . . . } <nl> llvm : : PointerType * FullTypeMetadataPtrTy ; / / / % swift . full_type * <nl> llvm : : StructType * ProtocolDescriptorStructTy ; / / / % swift . protocol = type { . . . } <nl> class IRGenModule { <nl> / / / List of protocol conformances to generate records for . <nl> SmallVector < const NormalProtocolConformance * , 4 > ProtocolConformances ; <nl> / / / List of nominal types to generate type metadata records for . <nl> - SmallVector < CanType , 4 > RuntimeResolvableTypes ; <nl> + SmallVector < NominalTypeDecl * , 4 > RuntimeResolvableTypes ; <nl> / / / List of ExtensionDecls corresponding to the generated <nl> / / / categories . <nl> SmallVector < ExtensionDecl * , 4 > ObjCCategoryDecls ; <nl> private : \ <nl> ConstantInitFuture init , <nl> llvm : : StringRef section = { } ) ; <nl> <nl> - llvm : : Constant * getAddrOfTypeMetadata ( CanType concreteType , bool isPattern ) ; <nl> - ConstantReference getAddrOfTypeMetadata ( CanType concreteType , bool isPattern , <nl> + llvm : : Constant * getAddrOfTypeMetadata ( CanType concreteType ) ; <nl> + ConstantReference getAddrOfTypeMetadata ( CanType concreteType , <nl> SymbolReferenceKind kind ) ; <nl> + llvm : : Constant * getAddrOfTypeMetadataPattern ( NominalTypeDecl * D ) ; <nl> + llvm : : Constant * getAddrOfTypeMetadataPattern ( NominalTypeDecl * D , <nl> + bool isConstant , <nl> + ConstantInit init , <nl> + StringRef section ) ; <nl> + llvm : : Function * getAddrOfTypeMetadataInstantiationFunction ( NominalTypeDecl * D , <nl> + ForDefinition_t forDefinition ) ; <nl> + llvm : : Constant * getAddrOfTypeMetadataInstantiationCache ( NominalTypeDecl * D , <nl> + ForDefinition_t forDefinition ) ; <nl> llvm : : Function * getAddrOfTypeMetadataAccessFunction ( CanType type , <nl> ForDefinition_t forDefinition ) ; <nl> llvm : : Function * getAddrOfGenericTypeMetadataAccessFunction ( <nl> private : \ <nl> llvm : : Constant * getAddrOfClassMetadataBaseOffset ( ClassDecl * D , <nl> ForDefinition_t forDefinition ) ; <nl> llvm : : Constant * getAddrOfTypeContextDescriptor ( NominalTypeDecl * D , <nl> + RequireMetadata_t requireMetadata , <nl> ConstantInit definition = ConstantInit ( ) ) ; <nl> llvm : : Constant * getAddrOfAnonymousContextDescriptor ( DeclContext * DC , <nl> ConstantInit definition = ConstantInit ( ) ) ; <nl> private : \ <nl> SymbolReferenceKind refKind ) ; <nl> <nl> void emitLazyPrivateDefinitions ( ) ; <nl> - void addRuntimeResolvableType ( CanType type ) ; <nl> + void addRuntimeResolvableType ( NominalTypeDecl * nominal ) ; <nl> <nl> / / / Add all conformances of \ p Nominal to LazyWitnessTables . <nl> void addLazyConformances ( NominalTypeDecl * Nominal ) ; <nl> mmm a / lib / IRGen / Linking . cpp <nl> ppp b / lib / IRGen / Linking . cpp <nl> std : : string LinkEntity : : mangleAsString ( ) const { <nl> case Kind : : TypeMetadataLazyCacheVariable : <nl> return mangler . mangleTypeMetadataLazyCacheVariable ( getType ( ) ) ; <nl> <nl> + case Kind : : TypeMetadataInstantiationCache : <nl> + return mangler . mangleTypeMetadataInstantiationCache ( <nl> + cast < NominalTypeDecl > ( getDecl ( ) ) ) ; <nl> + <nl> + case Kind : : TypeMetadataInstantiationFunction : <nl> + return mangler . mangleTypeMetadataInstantiationFunction ( <nl> + cast < NominalTypeDecl > ( getDecl ( ) ) ) ; <nl> + <nl> case Kind : : TypeMetadata : <nl> switch ( getMetadataAddress ( ) ) { <nl> case TypeMetadataAddress : : FullMetadata : <nl> return mangler . mangleTypeFullMetadataFull ( getType ( ) ) ; <nl> case TypeMetadataAddress : : AddressPoint : <nl> - return mangler . mangleTypeMetadataFull ( getType ( ) , isMetadataPattern ( ) ) ; <nl> + return mangler . mangleTypeMetadataFull ( getType ( ) ) ; <nl> } <nl> llvm_unreachable ( " invalid metadata address " ) ; <nl> <nl> + case Kind : : TypeMetadataPattern : <nl> + return mangler . mangleTypeMetadataPattern ( <nl> + cast < NominalTypeDecl > ( getDecl ( ) ) ) ; <nl> + <nl> case Kind : : ForeignTypeMetadataCandidate : <nl> - return mangler . mangleTypeMetadataFull ( getType ( ) , / * isPattern = * / false ) ; <nl> + return mangler . mangleTypeMetadataFull ( getType ( ) ) ; <nl> <nl> case Kind : : SwiftMetaclassStub : <nl> return mangler . mangleClassMetaClass ( cast < ClassDecl > ( getDecl ( ) ) ) ; <nl> mmm a / lib / TBDGen / TBDGen . cpp <nl> ppp b / lib / TBDGen / TBDGen . cpp <nl> void TBDGenVisitor : : visitNominalTypeDecl ( NominalTypeDecl * NTD ) { <nl> / / Generic types do not get metadata directly , only through the function . <nl> if ( ! NTD - > isGenericContext ( ) ) { <nl> addSymbol ( LinkEntity : : forTypeMetadata ( declaredType , <nl> - TypeMetadataAddress : : AddressPoint , <nl> - / * isPattern = * / false ) ) ; <nl> + TypeMetadataAddress : : AddressPoint ) ) ; <nl> } <nl> addSymbol ( LinkEntity : : forTypeMetadataAccessFunction ( declaredType ) ) ; <nl> <nl> mmm a / stdlib / public / runtime / Metadata . cpp <nl> ppp b / stdlib / public / runtime / Metadata . cpp <nl> static int compareIntegers ( T left , T right ) { <nl> return ( left = = right ? 0 : left < right ? - 1 : 1 ) ; <nl> } <nl> <nl> + static const size_t ValueTypeMetadataAddressPoint = sizeof ( TypeMetadataHeader ) ; <nl> + <nl> namespace { <nl> struct GenericCacheEntry ; <nl> <nl> namespace { <nl> <nl> size_t getNumArguments ( ) const { return NumArguments ; } <nl> <nl> - static GenericCacheEntry * getFromMetadata ( GenericMetadata * pattern , <nl> + static GenericCacheEntry * getFromMetadata ( <nl> + const TypeGenericContextDescriptorHeader & generics , <nl> Metadata * metadata ) { <nl> char * bytes = ( char * ) metadata ; <nl> if ( auto classType = dyn_cast < ClassMetadata > ( metadata ) ) { <nl> assert ( classType - > isTypeMetadata ( ) ) ; <nl> bytes - = classType - > getClassAddressPoint ( ) ; <nl> } else { <nl> - bytes - = pattern - > AddressPoint ; <nl> + bytes - = ValueTypeMetadataAddressPoint ; <nl> } <nl> bytes - = sizeof ( GenericCacheEntry ) ; <nl> return reinterpret_cast < GenericCacheEntry * > ( bytes ) ; <nl> using GenericMetadataCache = MetadataCache < GenericCacheEntry > ; <nl> using LazyGenericMetadataCache = Lazy < GenericMetadataCache > ; <nl> <nl> / / / Fetch the metadata cache for a generic metadata structure . <nl> - static GenericMetadataCache & getCache ( GenericMetadata * metadata ) { <nl> + static GenericMetadataCache & getCache ( <nl> + const TypeGenericContextDescriptorHeader & generics ) { <nl> / / Keep this assert even if you change the representation above . <nl> static_assert ( sizeof ( LazyGenericMetadataCache ) < = <nl> - sizeof ( GenericMetadata : : PrivateData ) , <nl> + sizeof ( GenericMetadataInstantiationCache : : PrivateData ) , <nl> " metadata cache is larger than the allowed space " ) ; <nl> <nl> auto lazyCache = <nl> - reinterpret_cast < LazyGenericMetadataCache * > ( metadata - > PrivateData ) ; <nl> + reinterpret_cast < LazyGenericMetadataCache * > ( <nl> + generics . getInstantiationCache ( ) - > PrivateData ) ; <nl> return lazyCache - > get ( ) ; <nl> } <nl> <nl> / / / Fetch the metadata cache for a generic metadata structure , <nl> / / / in a context where it must have already been initialized . <nl> - static GenericMetadataCache & unsafeGetInitializedCache ( GenericMetadata * metadata ) { <nl> + static GenericMetadataCache & unsafeGetInitializedCache ( <nl> + const TypeGenericContextDescriptorHeader & generics ) { <nl> / / Keep this assert even if you change the representation above . <nl> static_assert ( sizeof ( LazyGenericMetadataCache ) < = <nl> - sizeof ( GenericMetadata : : PrivateData ) , <nl> + sizeof ( GenericMetadataInstantiationCache : : PrivateData ) , <nl> " metadata cache is larger than the allowed space " ) ; <nl> <nl> auto lazyCache = <nl> - reinterpret_cast < LazyGenericMetadataCache * > ( metadata - > PrivateData ) ; <nl> + reinterpret_cast < LazyGenericMetadataCache * > ( <nl> + generics . getInstantiationCache ( ) - > PrivateData ) ; <nl> return lazyCache - > unsafeGetAlreadyInitialized ( ) ; <nl> } <nl> <nl> ClassMetadata * <nl> - swift : : swift_allocateGenericClassMetadata ( GenericMetadata * pattern , <nl> + swift : : swift_allocateGenericClassMetadata ( const ClassDescriptor * description , <nl> + const void * metadataTemplate , <nl> + size_t templateSize , <nl> + size_t templateAddressPoint , <nl> const void * arguments , <nl> ClassMetadata * superclass , <nl> size_t numImmediateMembers ) { <nl> void * const * argumentsAsArray = reinterpret_cast < void * const * > ( arguments ) ; <nl> - size_t numGenericArguments = pattern - > NumKeyArguments ; <nl> + auto & generics = description - > getFullGenericContextHeader ( ) ; <nl> + size_t numGenericArguments = generics . Base . NumKeyArguments ; <nl> <nl> size_t metadataSize ; <nl> if ( superclass & & superclass - > isTypeMetadata ( ) ) { <nl> - assert ( superclass - > getClassAddressPoint ( ) < = pattern - > AddressPoint ) ; <nl> + assert ( superclass - > getClassAddressPoint ( ) < = templateAddressPoint ) ; <nl> <nl> metadataSize = ( superclass - > getClassSize ( ) - <nl> superclass - > getClassAddressPoint ( ) + <nl> - pattern - > AddressPoint + <nl> + templateAddressPoint + <nl> numImmediateMembers * sizeof ( void * ) ) ; <nl> - assert ( pattern - > TemplateSize < = metadataSize ) ; <nl> + assert ( templateSize < = metadataSize ) ; <nl> } else { <nl> - metadataSize = ( pattern - > TemplateSize + <nl> + metadataSize = ( templateSize + <nl> numImmediateMembers * sizeof ( void * ) ) ; <nl> } <nl> <nl> - char * bytes = GenericCacheEntry : : allocate ( <nl> - unsafeGetInitializedCache ( pattern ) . getAllocator ( ) , <nl> - argumentsAsArray , <nl> - numGenericArguments , <nl> - metadataSize ) - > getData < char > ( ) ; <nl> + auto & cache = unsafeGetInitializedCache ( generics ) ; <nl> + char * bytes = GenericCacheEntry : : allocate ( cache . getAllocator ( ) , <nl> + argumentsAsArray , <nl> + numGenericArguments , <nl> + metadataSize ) - > getData < char > ( ) ; <nl> <nl> / / Copy in the metadata template . <nl> - memcpy ( bytes , pattern - > getMetadataTemplate ( ) , pattern - > TemplateSize ) ; <nl> + memcpy ( bytes , metadataTemplate , templateSize ) ; <nl> <nl> / / Zero out the rest of the metadata . <nl> - memset ( bytes + pattern - > TemplateSize , 0 , <nl> - metadataSize - pattern - > TemplateSize ) ; <nl> + memset ( bytes + templateSize , 0 , metadataSize - templateSize ) ; <nl> <nl> / / Okay , move to the address point . <nl> ClassMetadata * metadata = <nl> - reinterpret_cast < ClassMetadata * > ( bytes + pattern - > AddressPoint ) ; <nl> + reinterpret_cast < ClassMetadata * > ( bytes + templateAddressPoint ) ; <nl> auto patternBytes = <nl> - reinterpret_cast < const char * > ( pattern - > getMetadataTemplate ( ) ) + <nl> - pattern - > AddressPoint ; <nl> + reinterpret_cast < const char * > ( metadataTemplate ) + <nl> + templateAddressPoint ; <nl> auto patternMetadata = reinterpret_cast < const ClassMetadata * > ( patternBytes ) ; <nl> assert ( metadata - > isTypeMetadata ( ) ) ; <nl> <nl> swift : : swift_allocateGenericClassMetadata ( GenericMetadata * pattern , <nl> <nl> / / The pattern might have private prefix matter prior to the start <nl> / / of metadata . <nl> - assert ( metadata - > getClassAddressPoint ( ) < = pattern - > AddressPoint ) ; <nl> + assert ( metadata - > getClassAddressPoint ( ) < = templateAddressPoint ) ; <nl> metadata - > setClassSize ( metadataSize ) ; <nl> <nl> return metadata ; <nl> } <nl> <nl> ValueMetadata * <nl> - swift : : swift_allocateGenericValueMetadata ( GenericMetadata * pattern , <nl> + swift : : swift_allocateGenericValueMetadata ( const ValueTypeDescriptor * description , <nl> + const void * metadataTemplate , <nl> + size_t templateSize , <nl> const void * arguments ) { <nl> void * const * argumentsAsArray = reinterpret_cast < void * const * > ( arguments ) ; <nl> - size_t numGenericArguments = pattern - > NumKeyArguments ; <nl> + auto & generics = description - > getFullGenericContextHeader ( ) ; <nl> + size_t numGenericArguments = generics . Base . NumKeyArguments ; <nl> <nl> + auto & cache = unsafeGetInitializedCache ( generics ) ; <nl> char * bytes = <nl> - GenericCacheEntry : : allocate ( <nl> - unsafeGetInitializedCache ( pattern ) . getAllocator ( ) , <nl> - argumentsAsArray , numGenericArguments , <nl> - pattern - > TemplateSize ) - > getData < char > ( ) ; <nl> + GenericCacheEntry : : allocate ( cache . getAllocator ( ) , <nl> + argumentsAsArray , numGenericArguments , <nl> + templateSize ) - > getData < char > ( ) ; <nl> <nl> / / Copy in the metadata template . <nl> - memcpy ( bytes , pattern - > getMetadataTemplate ( ) , pattern - > TemplateSize ) ; <nl> + memcpy ( bytes , metadataTemplate , templateSize ) ; <nl> <nl> / / Okay , move to the address point . <nl> - bytes + = pattern - > AddressPoint ; <nl> + bytes + = ValueTypeMetadataAddressPoint ; <nl> auto * metadata = reinterpret_cast < ValueMetadata * > ( bytes ) ; <nl> <nl> - / / Adjust the relative references to the nominal type descriptor and <nl> - / / parent type . <nl> - auto patternBytes = <nl> - reinterpret_cast < const char * > ( pattern - > getMetadataTemplate ( ) ) + <nl> - pattern - > AddressPoint ; <nl> - auto patternMetadata = reinterpret_cast < const ValueMetadata * > ( patternBytes ) ; <nl> - metadata - > Description = patternMetadata - > Description ; <nl> - <nl> return metadata ; <nl> } <nl> <nl> / / / The primary entrypoint . <nl> - const Metadata * swift : : swift_getGenericMetadata ( GenericMetadata * pattern , <nl> - const void * arguments ) { <nl> + const Metadata * <nl> + swift : : swift_getGenericMetadata ( const TypeContextDescriptor * description , <nl> + const void * arguments ) { <nl> auto genericArgs = ( const void * const * ) arguments ; <nl> - size_t numGenericArgs = pattern - > NumKeyArguments ; <nl> + auto & generics = description - > getFullGenericContextHeader ( ) ; <nl> + size_t numGenericArgs = generics . Base . NumKeyArguments ; <nl> <nl> - auto entry = getCache ( pattern ) . findOrAdd ( genericArgs , numGenericArgs , <nl> + auto entry = getCache ( generics ) . findOrAdd ( genericArgs , numGenericArgs , <nl> [ & ] ( ) - > GenericCacheEntry * { <nl> / / Create new metadata to cache . <nl> - auto metadata = pattern - > CreateFunction ( pattern , arguments ) ; <nl> - auto entry = GenericCacheEntry : : getFromMetadata ( pattern , metadata ) ; <nl> + auto metadata = generics . InstantiationFunction ( description , arguments ) ; <nl> + auto entry = GenericCacheEntry : : getFromMetadata ( generics , metadata ) ; <nl> entry - > Value = metadata ; <nl> return entry ; <nl> } ) ; <nl> mmm a / test / IRGen / class_resilience . swift <nl> ppp b / test / IRGen / class_resilience . swift <nl> extension ResilientGenericOutsideParent { <nl> <nl> / / ResilientGenericChild metadata initialization function <nl> <nl> - / / CHECK - LABEL : define private % swift . type * @ create_generic_metadata_ResilientGenericChild ( % swift . type_pattern * , i8 * * ) <nl> + / / CHECK - LABEL : define internal % swift . type * @ " $ S16class_resilience21ResilientGenericChildCMi " ( % swift . type_descriptor * , i8 * * ) <nl> <nl> / / Get the superclass size and address point . . . <nl> <nl> extension ResilientGenericOutsideParent { <nl> / / CHECK - 64 : [ [ OFFSET_ZEXT : % . * ] ] = zext i32 [ [ OFFSET ] ] to i64 <nl> / / CHECK - 64 : store [ [ INT ] ] [ [ OFFSET_ZEXT ] ] , [ [ INT ] ] * @ " $ S16class_resilience21ResilientGenericChildCMo " <nl> <nl> - / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_pattern * % 0 , i8 * * % 1 , % objc_class * [ [ SUPER_TMP ] ] , [ [ INT ] ] 5 ) <nl> + / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_descriptor * % 0 , i8 * * bitcast ( { { . * } } @ " $ S16class_resilience21ResilientGenericChildCMP " to i8 * * ) , [ [ INT ] ] { { [ 0 - 9 ] + } } , [ [ INT ] ] { { [ 0 - 9 ] + } } , i8 * * % 1 , % objc_class * [ [ SUPER_TMP ] ] , [ [ INT ] ] 5 ) <nl> / / CHECK : ret % swift . type * [ [ METADATA ] ] <nl> mmm a / test / IRGen / enum . sil <nl> ppp b / test / IRGen / enum . sil <nl> import Swift <nl> / / CHECK - SAME : i32 0 , <nl> / / - - Case type accessor <nl> / / CHECK - SAME : i32 2 , <nl> + / / - - generic instantiation function <nl> + / / CHECK - SAME : @ " $ S4enum16DynamicSingletonOMi " <nl> / / - - generic parameters , requirements , key , extra <nl> / / CHECK - SAME : i32 1 , i32 0 , i32 1 , i32 0 <nl> / / - - generic param <nl> / / CHECK - SAME : i8 - 128 , <nl> / / CHECK - SAME : } > <nl> <nl> - / / CHECK : @ " $ S4enum16DynamicSingletonOMP " = internal global < { { { . * } } , % swift . type * } > < { <nl> - / / CHECK - SAME : % swift . type * ( % swift . type_pattern * , i8 * * ) * @ create_generic_metadata_DynamicSingleton <nl> + / / CHECK : @ " $ S4enum16DynamicSingletonOMP " = internal constant < { { { . * } } , % swift . type * } > < { <nl> / / CHECK - SAME : [ 18 x i8 * ] * @ " $ S4enum16DynamicSingletonOWV " <nl> / / CHECK - SAME : @ " $ S4enum16DynamicSingletonOMn " <nl> <nl> import Swift <nl> / / CHECK - SAME : i8 * bitcast ( void ( % swift . opaque * , i32 , % swift . type * ) * @ " $ S4enum20DynamicSinglePayloadOwxs " to i8 * ) <nl> / / CHECK - SAME : i8 * bitcast ( i32 ( % swift . opaque * , % swift . type * ) * @ " $ S4enum20DynamicSinglePayloadOwxg " to i8 * ) <nl> <nl> - / / CHECK : @ " $ S4enum20DynamicSinglePayloadOMP " = internal global < { { { . * } } , % swift . type * } > < { <nl> - / / CHECK - SAME : % swift . type * ( % swift . type_pattern * , i8 * * ) * @ create_generic_metadata_DynamicSinglePayload <nl> + / / CHECK : @ " $ S4enum20DynamicSinglePayloadOMP " = internal constant < { { { . * } } , % swift . type * } > < { <nl> / / CHECK - SAME : [ 18 x i8 * ] * @ " $ S4enum20DynamicSinglePayloadOWV " <nl> <nl> / / CHECK : @ " $ S4enum18MultiPayloadNestedOWV " = internal constant [ 18 x i8 * ] [ <nl> entry ( % x : $ * MyOptional ) : <nl> } <nl> <nl> / / - - Fill function for dynamic singleton . <nl> - / / CHECK : define { { ( protected ) ? } } private % swift . type * @ create_generic_metadata_DynamicSingleton ( % swift . type_pattern * , i8 * * ) { { . * } } { <nl> + / / CHECK : define { { ( protected ) ? } } internal % swift . type * @ " $ S4enum16DynamicSingletonOMi " ( % swift . type_descriptor * , i8 * * ) { { . * } } { <nl> / / CHECK : [ [ T0 : % . * ] ] = bitcast i8 * * % 1 to % swift . type * * <nl> / / CHECK : [ [ T : % T ] ] = load % swift . type * , % swift . type * * [ [ T0 ] ] , <nl> - / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericValueMetadata ( % swift . type_pattern * % 0 , i8 * * % 1 ) <nl> + / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericValueMetadata ( % swift . type_descriptor * % 0 , i8 * * bitcast ( { { . * } } @ " $ S4enum16DynamicSingletonOMP " to i8 * * ) , [ [ WORD ] ] { { 16 | 32 } } , i8 * * % 1 ) <nl> / / CHECK : [ [ METADATA_ARRAY : % . * ] ] = bitcast % swift . type * [ [ METADATA ] ] to i8 * * <nl> / / CHECK : [ [ T1 : % . * ] ] = getelementptr inbounds i8 * , i8 * * [ [ METADATA_ARRAY ] ] , [ [ WORD ] ] 2 <nl> / / CHECK : [ [ T0 : % . * ] ] = bitcast % swift . type * [ [ T ] ] to i8 * <nl> entry ( % x : $ * MyOptional ) : <nl> <nl> / / - - Fill function for dynamic single - payload . Call into the runtime to <nl> / / calculate the size . <nl> - / / CHECK - LABEL : define { { ( protected ) ? } } private % swift . type * @ create_generic_metadata_DynamicSinglePayload ( % swift . type_pattern * , i8 * * ) { { . * } } { <nl> + / / CHECK - LABEL : define { { ( protected ) ? } } internal % swift . type * @ " $ S4enum20DynamicSinglePayloadOMi " ( % swift . type_descriptor * , i8 * * ) { { . * } } { <nl> / / CHECK : call void @ swift_initEnumMetadataSinglePayload ( % swift . type * [ [ METADATA ] ] , [ [ WORD ] ] 0 , i8 * * [ [ T_LAYOUT ] ] , i32 3 ) <nl> <nl> / / CHECK - 64 - LABEL : define linkonce_odr hidden void @ " $ S4enum17StructWithWeakVarVwxs " ( % swift . opaque * noalias % dest , i32 % index , % swift . type * % StructWithWeakVar ) <nl> mmm a / test / IRGen / enum_dynamic_multi_payload . sil <nl> ppp b / test / IRGen / enum_dynamic_multi_payload . sil <nl> class C { } <nl> <nl> sil_vtable C { } <nl> <nl> - / / CHECK : @ " $ S26enum_dynamic_multi_payload8EitherOrOMP " = { { . * } } % swift . type * ( % swift . type_pattern * , i8 * * ) * [ [ CREATE_GENERIC_METADATA : @ [ A - Za - z0 - 9_ ] + ] ] <nl> - <nl> / / - - The runtime doesn ' t track spare bits , so fixed instances of the dynamic <nl> / / type can ' t use them . <nl> / / CHECK - 64 - LABEL : define { { ( protected ) ? } } swiftcc { i64 , i8 } @ fixed_instances_dont_use_spare_bits ( i64 , i8 ) <nl> entry ( % a : $ * EitherOr < T , C > , % b : $ * EitherOr < T , C > ) : <nl> return undef : $ ( ) <nl> } <nl> <nl> - / / CHECK : define { { ( protected ) ? } } private % swift . type * [ [ CREATE_GENERIC_METADATA ] ] ( % swift . type_pattern * , i8 * * ) { { . * } } { <nl> + / / CHECK : define { { ( protected ) ? } } internal % swift . type * @ " $ S26enum_dynamic_multi_payload8EitherOrOMi " ( % swift . type_descriptor * , i8 * * ) { { . * } } { <nl> / / CHECK : [ [ BUF : % . * ] ] = alloca [ 2 x i8 * * ] <nl> / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericValueMetadata <nl> <nl> mmm a / test / IRGen / enum_value_semantics . sil <nl> ppp b / test / IRGen / enum_value_semantics . sil <nl> enum GenericFixedLayout < T > { <nl> / / CHECK - SAME : } > <nl> <nl> <nl> - / / CHECK - LABEL : @ " $ S20enum_value_semantics18GenericFixedLayoutOMP " = internal global < { { [ { ] . * \ * [ } ] } } > < { <nl> - / / CHECK : % swift . type * ( % swift . type_pattern * , i8 * * ) * @ create_generic_metadata_GenericFixedLayout <nl> - / / CHECK : i32 32 , i16 1 , i16 8 , <nl> - / / CHECK : [ 16 x i8 * ] zeroinitializer , <nl> + / / CHECK - LABEL : @ " $ S20enum_value_semantics18GenericFixedLayoutOMn " = hidden constant <nl> + / / CHECK - SAME : % swift . type * ( % swift . type_descriptor * , i8 * * ) * @ " $ S20enum_value_semantics18GenericFixedLayoutOMi " <nl> + / / CHECK - SAME : [ 16 x i8 * ] * @ " $ S20enum_value_semantics18GenericFixedLayoutOMI " <nl> + <nl> + / / CHECK - LABEL : @ " $ S20enum_value_semantics18GenericFixedLayoutOMP " = internal constant < { { [ { ] . * \ * [ } ] } } > < { <nl> / / CHECK : i8 * * getelementptr inbounds ( [ 18 x i8 * ] , [ 18 x i8 * ] * @ " $ S20enum_value_semantics18GenericFixedLayoutOWV " , i32 0 , i32 0 ) , <nl> / / CHECK : i64 2 , <nl> / / CHECK : { { . * } } * @ " $ S20enum_value_semantics18GenericFixedLayoutOMn " <nl> mmm a / test / IRGen / generic_classes . sil <nl> ppp b / test / IRGen / generic_classes . sil <nl> import Swift <nl> / / CHECK - SAME : i32 15 , <nl> / / - - generic parameter vector offset <nl> / / CHECK - SAME : i32 10 , <nl> + / / - - template instantiation function <nl> + / / CHECK - SAME : % swift . type * ( % swift . type_descriptor * , i8 * * ) * @ " $ S15generic_classes11RootGenericCMi " <nl> + / / - - template instantiation cache <nl> + / / CHECK - SAME : [ 16 x i8 * ] * @ " $ S15generic_classes11RootGenericCMI " <nl> / / - - generic parameters , requirements , key arguments , extra arguments <nl> / / CHECK - SAME : i32 1 , i32 0 , i32 1 , i32 0 <nl> / / - - vtable offset <nl> import Swift <nl> / / CHECK - SAME : i32 4 <nl> / / CHECK - SAME : } <nl> <nl> - / / CHECK - LABEL : @ " $ S15generic_classes11RootGenericCMP " = internal global <nl> - / / - - template fill function <nl> - / / CHECK - SAME : % swift . type * ( % swift . type_pattern * , i8 * * ) * @ create_generic_metadata_RootGeneric <nl> + / / CHECK - LABEL : @ " $ S15generic_classes11RootGenericCMP " = internal constant <nl> / / - - nominal type descriptor <nl> / / CHECK - SAME : @ " $ S15generic_classes11RootGenericCMn " <nl> / / - - ivar destroyer <nl> import Swift <nl> / / CHECK - SAME : { { . * } } * @ " $ S15generic_classes14RootNonGenericCMn " <nl> / / CHECK - SAME : } > <nl> <nl> - / / CHECK : @ " $ S15generic_classes015GenericInheritsC0CMP " = internal global <nl> - / / - - template fill function <nl> - / / CHECK - SAME : % swift . type * ( % swift . type_pattern * , i8 * * ) * @ create_generic_metadata_GenericInheritsGeneric <nl> + / / CHECK : @ " $ S15generic_classes015GenericInheritsC0CMn " = hidden constant <nl> + / / - - template instantiation function <nl> + / / CHECK - SAME : % swift . type * ( % swift . type_descriptor * , i8 * * ) * @ " $ S15generic_classes015GenericInheritsC0CMi " <nl> + <nl> + / / CHECK : @ " $ S15generic_classes015GenericInheritsC0CMP " = internal constant <nl> / / - - nominal type descriptor <nl> / / CHECK - SAME : @ " $ S15generic_classes015GenericInheritsC0CMn " , <nl> / / - - ivar destroyer <nl> entry ( % c : $ RootGeneric < Int32 > ) : <nl> } <nl> * / <nl> <nl> - / / CHECK : define { { ( protected ) ? } } private % swift . type * @ create_generic_metadata_RootGeneric ( % swift . type_pattern * , i8 * * ) { { . * } } { <nl> - / / CHECK : [ [ METADATA : % . * ] ] = { { ( tail ) ? } } call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_pattern * % 0 , { { . * } } , i64 8 ) <nl> + / / CHECK - LABEL : define { { ( protected ) ? } } internal % swift . type * @ " $ S15generic_classes11RootGenericCMi " ( % swift . type_descriptor * , i8 * * ) { { . * } } { <nl> + / / CHECK : [ [ METADATA : % . * ] ] = { { ( tail ) ? } } call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_descriptor * % 0 , { { . * } } , i64 8 ) <nl> / / - - initialize the dependent field offsets <nl> / / CHECK : call void @ swift_initClassMetadata_UniversalStrategy ( % swift . type * [ [ METADATA ] ] , i64 3 , i8 * * * { { % . * } } , i64 * { { % . * } } ) <nl> / / CHECK : } <nl> <nl> - / / CHECK : define { { ( protected ) ? } } private % swift . type * @ create_generic_metadata_RootGenericFixedLayout ( % swift . type_pattern * , i8 * * ) { { . * } } { <nl> - / / CHECK : [ [ METADATA : % . * ] ] = { { ( tail ) ? } } call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_pattern * % 0 , { { . * } } , i64 5 ) <nl> + / / CHECK - LABEL : define { { ( protected ) ? } } internal % swift . type * @ " $ S15generic_classes22RootGenericFixedLayoutCMi " ( % swift . type_descriptor * , i8 * * ) { { . * } } { <nl> + / / CHECK : [ [ METADATA : % . * ] ] = { { ( tail ) ? } } call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_descriptor * % 0 , { { . * } } , i64 5 ) <nl> / / CHECK : call void @ swift_initClassMetadata_UniversalStrategy ( % swift . type * [ [ METADATA ] ] , i64 3 , i8 * * * { { % . * } } , i64 * { { % . * } } ) <nl> / / CHECK : } <nl> <nl> - / / CHECK : define { { ( protected ) ? } } private % swift . type * @ create_generic_metadata_GenericInheritsGeneric ( % swift . type_pattern * , i8 * * ) { { . * } } { <nl> + / / CHECK - LABEL : define { { ( protected ) ? } } internal % swift . type * @ " $ S15generic_classes015GenericInheritsC0CMi " ( % swift . type_descriptor * , i8 * * ) { { . * } } { <nl> / / Bind the generic parameters . <nl> / / CHECK : [ [ T0 : % . * ] ] = bitcast i8 * * % 1 to % swift . type * * <nl> / / CHECK : % A = load % swift . type * , % swift . type * * [ [ T0 ] ] <nl> entry ( % c : $ RootGeneric < Int32 > ) : <nl> / / Construct the superclass . <nl> / / CHECK : [ [ SUPER : % . * ] ] = call % swift . type * @ " $ S15generic_classes11RootGenericCMa " ( % swift . type * % A ) <nl> / / CHECK : [ [ T0 : % . * ] ] = bitcast % swift . type * [ [ SUPER ] ] to % objc_class * <nl> - / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_pattern * % 0 , i8 * * % 1 , % objc_class * [ [ T0 ] ] , i64 6 ) <nl> + / / CHECK - native : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_descriptor * % 0 , i8 * * { { . * } } , i64 96 , i64 16 , i8 * * % 1 , % objc_class * [ [ T0 ] ] , i64 6 ) <nl> + / / CHECK - objc : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_descriptor * % 0 , i8 * * { { . * } } , i64 280 , i64 200 , i8 * * % 1 , % objc_class * [ [ T0 ] ] , i64 6 ) <nl> / / CHECK : [ [ METADATA_ARRAY : % . * ] ] = bitcast % swift . type * [ [ METADATA ] ] to i8 * * <nl> / / Put the generic arguments in their correct positions . <nl> / / CHECK : [ [ A_ADDR : % . * ] ] = getelementptr inbounds i8 * , i8 * * [ [ METADATA_ARRAY : % . * ] ] , i64 18 <nl> mmm a / test / IRGen / generic_metatypes . swift <nl> ppp b / test / IRGen / generic_metatypes . swift <nl> func makeGenericMetatypes ( ) { <nl> / / CHECK : [ [ BUFFER_ELT : % . * ] ] = getelementptr inbounds { % swift . type * } , { % swift . type * } * [ [ BUFFER ] ] , i32 0 , i32 0 <nl> / / CHECK : store % swift . type * % 0 , % swift . type * * [ [ BUFFER_ELT ] ] <nl> / / CHECK : [ [ BUFFER_PTR : % . * ] ] = bitcast { % swift . type * } * [ [ BUFFER ] ] to i8 * <nl> - / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_getGenericMetadata ( % swift . type_pattern * { { . * } } @ " $ S17generic_metatypes6OneArgVMP " { { . * } } , i8 * [ [ BUFFER_PTR ] ] ) <nl> + / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_getGenericMetadata ( % swift . type_descriptor * { { . * } } @ " $ S17generic_metatypes6OneArgVMn " { { . * } } , i8 * [ [ BUFFER_PTR ] ] ) <nl> / / CHECK : [ [ BUFFER_PTR : % . * ] ] = bitcast { % swift . type * } * [ [ BUFFER ] ] to i8 * <nl> / / CHECK : call void @ llvm . lifetime . end <nl> / / CHECK : ret % swift . type * [ [ METADATA ] ] <nl> func makeGenericMetatypes ( ) { <nl> / / CHECK : [ [ BUFFER_ELT : % . * ] ] = getelementptr inbounds { % swift . type * , % swift . type * } , { % swift . type * , % swift . type * } * [ [ BUFFER ] ] , i32 0 , i32 1 <nl> / / CHECK : store % swift . type * % 1 , % swift . type * * [ [ BUFFER_ELT ] ] <nl> / / CHECK : [ [ BUFFER_PTR : % . * ] ] = bitcast { % swift . type * , % swift . type * } * [ [ BUFFER ] ] to i8 * <nl> - / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_getGenericMetadata ( % swift . type_pattern * { { . * } } @ " $ S17generic_metatypes7TwoArgsVMP " { { . * } } , i8 * [ [ BUFFER_PTR ] ] ) <nl> + / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_getGenericMetadata ( % swift . type_descriptor * { { . * } } @ " $ S17generic_metatypes7TwoArgsVMn " { { . * } } , i8 * [ [ BUFFER_PTR ] ] ) <nl> / / CHECK : [ [ BUFFER_PTR : % . * ] ] = bitcast { % swift . type * , % swift . type * } * [ [ BUFFER ] ] to i8 * <nl> / / CHECK : call void @ llvm . lifetime . end <nl> / / CHECK : ret % swift . type * [ [ METADATA ] ] <nl> func makeGenericMetatypes ( ) { <nl> / / CHECK : [ [ BUFFER_ELT : % . * ] ] = getelementptr inbounds { % swift . type * , % swift . type * , % swift . type * } , { % swift . type * , % swift . type * , % swift . type * } * [ [ BUFFER ] ] , i32 0 , i32 2 <nl> / / CHECK : store % swift . type * % 2 , % swift . type * * [ [ BUFFER_ELT ] ] <nl> / / CHECK : [ [ BUFFER_PTR : % . * ] ] = bitcast { % swift . type * , % swift . type * , % swift . type * } * [ [ BUFFER ] ] to i8 * <nl> - / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_getGenericMetadata ( % swift . type_pattern * { { . * } } @ " $ S17generic_metatypes9ThreeArgsVMP " { { . * } } , i8 * [ [ BUFFER_PTR ] ] ) <nl> + / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_getGenericMetadata ( % swift . type_descriptor * { { . * } } @ " $ S17generic_metatypes9ThreeArgsVMn " { { . * } } , i8 * [ [ BUFFER_PTR ] ] ) <nl> / / CHECK : [ [ BUFFER_PTR : % . * ] ] = bitcast { % swift . type * , % swift . type * , % swift . type * } * [ [ BUFFER ] ] to i8 * <nl> / / CHECK : call void @ llvm . lifetime . end <nl> / / CHECK : ret % swift . type * [ [ METADATA ] ] <nl> func makeGenericMetatypes ( ) { <nl> <nl> / / CHECK : define hidden % swift . type * @ " $ S17generic_metatypes8FiveArgsVMa " ( % swift . type * , % swift . type * , % swift . type * , i8 * * ) [ [ NOUNWIND_OPT : # [ 0 - 9 ] + ] ] <nl> / / CHECK - NOT : alloc <nl> - / / CHECK : call % swift . type * @ swift_getGenericMetadata ( % swift . type_pattern * { { . * } } @ " $ S17generic_metatypes8FiveArgsVMP " { { . * } } , i8 * <nl> + / / CHECK : call % swift . type * @ swift_getGenericMetadata ( % swift . type_descriptor * { { . * } } @ " $ S17generic_metatypes8FiveArgsVMn " { { . * } } , i8 * <nl> / / CHECK - NOT : call void @ llvm . lifetime . end <nl> / / CHECK : ret % swift . type * <nl> <nl> mmm a / test / IRGen / generic_metatypes_arm . swift <nl> ppp b / test / IRGen / generic_metatypes_arm . swift <nl> func makeGenericMetatypes ( ) { <nl> / / CHECK : [ [ BUFFER_ELT : % . * ] ] = getelementptr inbounds { % swift . type * } , { % swift . type * } * [ [ BUFFER ] ] , i32 0 , i32 0 <nl> / / CHECK : store % swift . type * % 0 , % swift . type * * [ [ BUFFER_ELT ] ] <nl> / / CHECK : [ [ BUFFER_PTR : % . * ] ] = bitcast { % swift . type * } * [ [ BUFFER ] ] to i8 * <nl> - / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_getGenericMetadata ( % swift . type_pattern * { { . * } } @ " $ S17generic_metatypes6OneArgVMP " { { . * } } , i8 * [ [ BUFFER_PTR ] ] ) <nl> + / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_getGenericMetadata ( % swift . type_descriptor * { { . * } } @ " $ S17generic_metatypes6OneArgVMn " { { . * } } , i8 * [ [ BUFFER_PTR ] ] ) <nl> / / CHECK : [ [ BUFFER_PTR : % . * ] ] = bitcast { % swift . type * } * [ [ BUFFER ] ] to i8 * <nl> / / CHECK : call void @ llvm . lifetime . end <nl> / / CHECK : ret % swift . type * [ [ METADATA ] ] <nl> func makeGenericMetatypes ( ) { <nl> / / CHECK : [ [ BUFFER_ELT : % . * ] ] = getelementptr inbounds { % swift . type * , % swift . type * } , { % swift . type * , % swift . type * } * [ [ BUFFER ] ] , i32 0 , i32 1 <nl> / / CHECK : store % swift . type * % 1 , % swift . type * * [ [ BUFFER_ELT ] ] <nl> / / CHECK : [ [ BUFFER_PTR : % . * ] ] = bitcast { % swift . type * , % swift . type * } * [ [ BUFFER ] ] to i8 * <nl> - / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_getGenericMetadata ( % swift . type_pattern * { { . * } } @ " $ S17generic_metatypes7TwoArgsVMP " { { . * } } , i8 * [ [ BUFFER_PTR ] ] ) <nl> + / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_getGenericMetadata ( % swift . type_descriptor * { { . * } } @ " $ S17generic_metatypes7TwoArgsVMn " { { . * } } , i8 * [ [ BUFFER_PTR ] ] ) <nl> / / CHECK : [ [ BUFFER_PTR : % . * ] ] = bitcast { % swift . type * , % swift . type * } * [ [ BUFFER ] ] to i8 * <nl> / / CHECK : call void @ llvm . lifetime . end <nl> / / CHECK : ret % swift . type * [ [ METADATA ] ] <nl> func makeGenericMetatypes ( ) { <nl> / / CHECK : [ [ BUFFER_ELT : % . * ] ] = getelementptr inbounds { % swift . type * , % swift . type * , % swift . type * } , { % swift . type * , % swift . type * , % swift . type * } * [ [ BUFFER ] ] , i32 0 , i32 2 <nl> / / CHECK : store % swift . type * % 2 , % swift . type * * [ [ BUFFER_ELT ] ] <nl> / / CHECK : [ [ BUFFER_PTR : % . * ] ] = bitcast { % swift . type * , % swift . type * , % swift . type * } * [ [ BUFFER ] ] to i8 * <nl> - / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_getGenericMetadata ( % swift . type_pattern * { { . * } } @ " $ S17generic_metatypes9ThreeArgsVMP " { { . * } } , i8 * [ [ BUFFER_PTR ] ] ) <nl> + / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_getGenericMetadata ( % swift . type_descriptor * { { . * } } @ " $ S17generic_metatypes9ThreeArgsVMn " { { . * } } , i8 * [ [ BUFFER_PTR ] ] ) <nl> / / CHECK : [ [ BUFFER_PTR : % . * ] ] = bitcast { % swift . type * , % swift . type * , % swift . type * } * [ [ BUFFER ] ] to i8 * <nl> / / CHECK : call void @ llvm . lifetime . end <nl> / / CHECK : ret % swift . type * [ [ METADATA ] ] <nl> func makeGenericMetatypes ( ) { <nl> <nl> / / CHECK - LABEL : define hidden % swift . type * @ " $ S17generic_metatypes8FiveArgsVMa " ( % swift . type * , % swift . type * , % swift . type * , i8 * * ) <nl> / / CHECK - NOT : alloca <nl> - / / CHECK : call % swift . type * @ swift_getGenericMetadata ( % swift . type_pattern * { { . * } } @ " $ S17generic_metatypes8FiveArgsVMP " { { . * } } , i8 * <nl> + / / CHECK : call % swift . type * @ swift_getGenericMetadata ( % swift . type_descriptor * { { . * } } @ " $ S17generic_metatypes8FiveArgsVMn " { { . * } } , i8 * <nl> / / CHECK - NOT : call void @ llvm . lifetime . end <nl> / / CHECK : ret % swift . type * <nl> <nl> mmm a / test / IRGen / generic_structs . sil <nl> ppp b / test / IRGen / generic_structs . sil <nl> import Builtin <nl> / / CHECK - SAME : i32 3 , <nl> / / - - generic parameter vector offset <nl> / / CHECK - SAME : i32 2 , <nl> + / / - - generic instantiation info <nl> + / / CHECK - SAME : % swift . type * ( % swift . type_descriptor * , i8 * * ) * @ " $ S15generic_structs13SingleDynamicVMi " <nl> + / / CHECK - SAME : [ { { [ 0 - 9 ] + } } x i8 * ] * @ " $ S15generic_structs13SingleDynamicVMI " <nl> / / - - generic params , requirements , key args , extra args <nl> / / CHECK - SAME : i32 1 , i32 0 , i32 1 , i32 0 <nl> / / - - generic parameters <nl> / / CHECK - SAME : < i8 0x80 > <nl> / / CHECK - SAME : } > <nl> - / / CHECK : @ " $ S15generic_structs13SingleDynamicVMP " = internal global < { { { . * } } } > < { <nl> - / / - - template header <nl> - / / CHECK - SAME : % swift . type * ( % swift . type_pattern * , i8 * * ) * @ create_generic_metadata_SingleDynamic , <nl> - / / CHECK - SAME : i32 40 , i16 1 , i16 8 , [ { { [ 0 - 9 ] + } } x i8 * ] zeroinitializer , <nl> + / / CHECK : @ " $ S15generic_structs13SingleDynamicVMP " = internal constant < { { { . * } } } > < { <nl> / / - - vwtable pointer <nl> / / CHECK - SAME : @ " $ S15generic_structs13SingleDynamicVWV " <nl> / / - - address point <nl> import Builtin <nl> / / CHECK - SAME : % swift . protocol * @ " $ S15generic_structs4Req2Mp " <nl> / / CHECK - SAME : } > <nl> <nl> - / / CHECK : @ " $ S15generic_structs23DynamicWithRequirementsVMP " = internal global < { { { . * } } } > < { <nl> + / / CHECK : @ " $ S15generic_structs23DynamicWithRequirementsVMP " = internal constant < { { { . * } } } > < { <nl> / / - - field offset vector ; generic parameter vector <nl> / / CHECK : % swift . type * null , % swift . type * null , i8 * * null , i8 * * null , i64 0 , i64 0 } > <nl> <nl> entry ( % 0 : $ * ComplexDynamic < A , B > , % 1 : $ * Byteful , % 2 : $ * A , % 3 : $ * B , % 4 : $ * Ch <nl> / / CHECK - NEXT : [ [ T2 : % . * ] ] = bitcast { { . * } } [ [ T1 ] ] to % swift . opaque * <nl> / / CHECK - NEXT : ret % swift . opaque * [ [ T2 ] ] <nl> <nl> - / / CHECK - LABEL : define { { ( protected ) ? } } private % swift . type * @ create_generic_metadata_SingleDynamic ( % swift . type_pattern * , i8 * * ) <nl> + / / CHECK - LABEL : define { { ( protected ) ? } } internal % swift . type * @ " $ S15generic_structs13SingleDynamicVMi " ( % swift . type_descriptor * , i8 * * ) <nl> / / CHECK : [ [ T0 : % . * ] ] = bitcast i8 * * % 1 to % swift . type * * <nl> / / CHECK : % T = load % swift . type * , % swift . type * * [ [ T0 ] ] , align 8 <nl> - / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericValueMetadata ( % swift . type_pattern * % 0 , i8 * * % 1 ) <nl> + / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericValueMetadata ( % swift . type_descriptor * % 0 , i8 * * bitcast ( { { . * } } @ " $ S15generic_structs13SingleDynamicVMP " to i8 * * ) , i64 40 , i8 * * % 1 ) <nl> / / CHECK : [ [ SELF_ARRAY : % . * ] ] = bitcast % swift . type * [ [ METADATA ] ] to i8 * * <nl> / / Fill type argument . <nl> / / CHECK : [ [ T1 : % . * ] ] = getelementptr inbounds i8 * , i8 * * [ [ SELF_ARRAY ] ] , i64 2 <nl> struct GenericLayoutWithAssocType < T : ParentHasAssociatedType > { <nl> var x : T . Assoc <nl> var y : T . Assoc . Assoc <nl> } <nl> - / / CHECK - LABEL : define private % swift . type * @ create_generic_metadata_GenericLayoutWithAssocType ( <nl> + / / CHECK - LABEL : define internal % swift . type * @ " $ S15generic_structs26GenericLayoutWithAssocTypeVMi " ( <nl> / / CHECK : [ [ T0 : % . * ] ] = bitcast i8 * * % 1 to % swift . type * * <nl> / / CHECK : % T = load % swift . type * , % swift . type * * [ [ T0 ] ] , align 8 <nl> / / CHECK : [ [ T1 : % . * ] ] = getelementptr inbounds % swift . type * , % swift . type * * [ [ T0 ] ] , i32 1 <nl> mmm a / test / IRGen / generic_types . swift <nl> ppp b / test / IRGen / generic_types . swift <nl> <nl> / / CHECK : [ [ C : % T13generic_types1CC ] ] = type <nl> / / CHECK : [ [ D : % T13generic_types1DC ] ] = type <nl> <nl> - / / CHECK - LABEL : @ " $ S13generic_types1ACMP " = internal global <nl> - / / CHECK : % swift . type * ( % swift . type_pattern * , i8 * * ) * @ create_generic_metadata_A , <nl> - / / CHECK - native - SAME : i32 96 , <nl> - / / CHECK - objc - SAME : i32 280 , <nl> - / / CHECK - SAME : i16 1 , <nl> - / / CHECK - native - SAME : i16 16 , <nl> - / / CHECK - objc - SAME : i16 200 , <nl> - / / CHECK - SAME : [ { { [ 0 - 9 ] + } } x i8 * ] zeroinitializer , <nl> + / / CHECK - LABEL : @ " $ S13generic_types1ACMI " = internal global [ 16 x i8 * ] zeroinitializer , align 8 <nl> + <nl> + / / CHECK - LABEL : @ " $ S13generic_types1ACMn " = hidden constant <nl> + / / CHECK - SAME : @ " $ S13generic_types1ACMa " <nl> + / / CHECK - SAME : @ " $ S13generic_types1ACMi " <nl> + / / CHECK - SAME : @ " $ S13generic_types1ACMI " <nl> + <nl> + / / CHECK - LABEL : @ " $ S13generic_types1ACMP " = internal constant <nl> / / CHECK - SAME : void ( [ [ A ] ] * ) * @ " $ S13generic_types1ACfD " , <nl> / / CHECK - SAME : i8 * * @ " $ SBoWV " , <nl> / / CHECK - SAME : i64 0 , <nl> <nl> / / CHECK - SAME : i8 * null <nl> / / CHECK - SAME : } <nl> <nl> - / / CHECK - LABEL : @ " $ S13generic_types1BCMP " = internal global <nl> - / / CHECK - SAME : % swift . type * ( % swift . type_pattern * , i8 * * ) * @ create_generic_metadata_B , <nl> - / / CHECK - native - SAME : i32 96 , <nl> - / / CHECK - objc - SAME : i32 280 , <nl> - / / CHECK - SAME : i16 1 , <nl> - / / CHECK - native - SAME : i16 16 , <nl> - / / CHECK - objc - SAME : i16 200 , <nl> - / / CHECK - SAME : [ { { [ 0 - 9 ] + } } x i8 * ] zeroinitializer , <nl> + / / CHECK - LABEL : @ " $ S13generic_types1BCMI " = internal global [ 16 x i8 * ] zeroinitializer , align 8 <nl> + <nl> + / / CHECK - LABEL : @ " $ S13generic_types1BCMn " = hidden constant <nl> + / / CHECK - SAME : @ " $ S13generic_types1BCMa " <nl> + / / CHECK - SAME : @ " $ S13generic_types1BCMi " <nl> + / / CHECK - SAME : @ " $ S13generic_types1BCMI " <nl> + <nl> + / / CHECK - LABEL : @ " $ S13generic_types1BCMP " = internal constant <nl> / / CHECK - SAME : void ( [ [ B ] ] * ) * @ " $ S13generic_types1BCfD " , <nl> / / CHECK - SAME : i8 * * @ " $ SBoWV " , <nl> / / CHECK - SAME : i64 0 , <nl> <nl> / / CHECK - SAME : i8 * null <nl> / / CHECK - SAME : } <nl> <nl> - / / CHECK - LABEL : @ " $ S13generic_types1CCMP " = internal global <nl> + / / CHECK - LABEL : @ " $ S13generic_types1CCMP " = internal constant <nl> / / CHECK - SAME : void ( [ [ C ] ] * ) * @ " $ S13generic_types1CCfD " , <nl> / / CHECK - SAME : i8 * * @ " $ SBoWV " , <nl> / / CHECK - SAME : i64 0 , <nl> <nl> / / CHECK - SAME : i8 * null <nl> / / CHECK - SAME : } <nl> <nl> - / / CHECK - LABEL : @ " $ S13generic_types1DCMP " = internal global <nl> + / / CHECK - LABEL : @ " $ S13generic_types1DCMP " = internal constant <nl> / / CHECK - SAME : void ( [ [ D ] ] * ) * @ " $ S13generic_types1DCfD " , <nl> / / CHECK - SAME : i8 * * @ " $ SBoWV " , <nl> / / CHECK - SAME : i64 0 , <nl> <nl> / / CHECK - SAME : i8 * null <nl> / / CHECK - SAME : } <nl> <nl> - / / CHECK - LABEL : define { { ( protected ) ? } } private % swift . type * @ create_generic_metadata_A ( % swift . type_pattern * , i8 * * ) { { . * } } { <nl> + / / CHECK - LABEL : define { { ( protected ) ? } } internal % swift . type * @ " $ S13generic_types1ACMi " ( % swift . type_descriptor * , i8 * * ) { { . * } } { <nl> / / CHECK : [ [ T0 : % . * ] ] = bitcast i8 * * % 1 to % swift . type * * <nl> / / CHECK : % T = load % swift . type * , % swift . type * * [ [ T0 ] ] , <nl> - / / CHECK - native : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_pattern * % 0 , i8 * * % 1 , % objc_class * null , i64 7 ) <nl> + / / CHECK - native : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_descriptor * % 0 , i8 * * bitcast ( { { . * } } * @ " $ S13generic_types1ACMP " to i8 * * ) , i64 96 , i64 16 , i8 * * % 1 , % objc_class * null , i64 7 ) <nl> / / CHECK - objc : [ [ T0 : % . * ] ] = load % objc_class * , % objc_class * * @ " OBJC_CLASS_REF_ $ __TtCs12_SwiftObject " <nl> / / CHECK - objc : [ [ SUPER : % . * ] ] = call % objc_class * @ swift_getInitializedObjCClass ( % objc_class * [ [ T0 ] ] ) <nl> - / / CHECK - objc : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_pattern * % 0 , i8 * * % 1 , % objc_class * [ [ SUPER ] ] , i64 7 ) <nl> + / / CHECK - objc : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_descriptor * % 0 , i8 * * bitcast ( { { . * } } * @ " $ S13generic_types1ACMP " to i8 * * ) , i64 280 , i64 200 , i8 * * % 1 , % objc_class * [ [ SUPER ] ] , i64 7 ) <nl> / / CHECK : [ [ SELF_ARRAY : % . * ] ] = bitcast % swift . type * [ [ METADATA ] ] to i8 * * <nl> / / CHECK : [ [ T1 : % . * ] ] = getelementptr inbounds i8 * , i8 * * [ [ SELF_ARRAY ] ] , i64 10 <nl> / / CHECK : [ [ T0 : % . * ] ] = bitcast % swift . type * % T to i8 * <nl> <nl> / / CHECK : ret % swift . type * [ [ METADATA ] ] <nl> / / CHECK : } <nl> <nl> - / / CHECK - LABEL : define { { ( protected ) ? } } private % swift . type * @ create_generic_metadata_B ( % swift . type_pattern * , i8 * * ) { { . * } } { <nl> + / / CHECK - LABEL : define { { ( protected ) ? } } internal % swift . type * @ " $ S13generic_types1BCMi " ( % swift . type_descriptor * , i8 * * ) { { . * } } { <nl> / / CHECK : [ [ T0 : % . * ] ] = bitcast i8 * * % 1 to % swift . type * * <nl> / / CHECK : % T = load % swift . type * , % swift . type * * [ [ T0 ] ] , <nl> - / / CHECK - native : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_pattern * % 0 , i8 * * % 1 , % objc_class * null , i64 6 ) <nl> + / / CHECK - native : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_descriptor * % 0 , i8 * * bitcast ( { { . * } } * @ " $ S13generic_types1BCMP " to i8 * * ) , i64 96 , i64 16 , i8 * * % 1 , % objc_class * null , i64 6 ) <nl> / / CHECK - objc : [ [ T0 : % . * ] ] = load % objc_class * , % objc_class * * @ " OBJC_CLASS_REF_ $ __TtCs12_SwiftObject " <nl> / / CHECK - objc : [ [ SUPER : % . * ] ] = call % objc_class * @ swift_getInitializedObjCClass ( % objc_class * [ [ T0 ] ] ) <nl> - / / CHECK - objc : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_pattern * % 0 , i8 * * % 1 , % objc_class * [ [ SUPER ] ] , i64 6 ) <nl> + / / CHECK - objc : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_descriptor * % 0 , i8 * * bitcast ( { { . * } } * @ " $ S13generic_types1BCMP " to i8 * * ) , i64 280 , i64 200 , i8 * * % 1 , % objc_class * [ [ SUPER ] ] , i64 6 ) <nl> / / CHECK : [ [ SELF_ARRAY : % . * ] ] = bitcast % swift . type * [ [ METADATA ] ] to i8 * * <nl> / / CHECK : [ [ T1 : % . * ] ] = getelementptr inbounds i8 * , i8 * * [ [ SELF_ARRAY ] ] , i64 10 <nl> / / CHECK : [ [ T0 : % . * ] ] = bitcast % swift . type * % T to i8 * <nl> mmm a / test / IRGen / generic_vtable . swift <nl> ppp b / test / IRGen / generic_vtable . swift <nl> public class Concrete : Derived < Int > { <nl> / / / / Type metadata pattern for ' Derived ' has an empty vtable , filled in at <nl> / / / / instantiation time . <nl> <nl> - / / CHECK - LABEL : @ " $ S14generic_vtable7DerivedCMP " = internal global < { { . * } } > < { <nl> + / / CHECK - LABEL : @ " $ S14generic_vtable7DerivedCMP " = internal constant < { { . * } } > < { <nl> / / - - nominal type descriptor <nl> / / CHECK - SAME : @ " $ S14generic_vtable7DerivedCMn " , <nl> / / - - ivar destroyer <nl> public class Concrete : Derived < Int > { <nl> / / / / Metadata initialization function for ' Derived ' copies superclass vtable <nl> / / / / and installs overrides for ' m2 ( ) ' and ' init ( ) ' . <nl> <nl> - / / CHECK - LABEL : define private % swift . type * @ create_generic_metadata_Derived ( % swift . type_pattern * , i8 * * ) <nl> + / / CHECK - LABEL : define internal % swift . type * @ " $ S14generic_vtable7DerivedCMi " ( % swift . type_descriptor * , i8 * * ) <nl> <nl> / / - 2 immediate members : <nl> / / - type metadata for generic parameter T , <nl> / / - and vtable entry for ' m3 ( ) ' <nl> - / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_pattern * % 0 , i8 * * % 1 , { { . * } } , i64 2 ) <nl> + / / CHECK : [ [ METADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata ( % swift . type_descriptor * % 0 , i8 * * bitcast ( { { . * } } @ " $ S14generic_vtable7DerivedCMP " to i8 * * ) , i64 { { [ 0 - 9 ] + } } , i64 { { [ 0 - 9 ] + } } , i8 * * % 1 , { { . * } } , i64 2 ) <nl> <nl> / / CHECK : call void @ swift_initClassMetadata_UniversalStrategy ( % swift . type * [ [ METADATA ] ] , i64 0 , { { . * } } ) <nl> <nl> mmm a / test / IRGen / type_layout . swift <nl> ppp b / test / IRGen / type_layout . swift <nl> struct FourInts { var x , y , z , w : Int32 } <nl> @ _alignment ( 16 ) <nl> struct AlignedFourInts { var x : FourInts } <nl> <nl> - / / CHECK : @ " $ S11type_layout14TypeLayoutTestVMP " = internal global { { . * } } @ create_generic_metadata_TypeLayoutTest <nl> - / / CHECK : define private % swift . type * @ create_generic_metadata_TypeLayoutTest <nl> + / / CHECK : @ " $ S11type_layout14TypeLayoutTestVMn " = hidden constant { { . * } } @ " $ S11type_layout14TypeLayoutTestVMi " <nl> + / / CHECK : define internal % swift . type * @ " $ S11type_layout14TypeLayoutTestVMi " <nl> struct TypeLayoutTest < T > { <nl> / / - - dynamic layout , projected from metadata <nl> / / CHECK : [ [ T0 : % . * ] ] = bitcast % swift . type * % T to i8 * * * <nl> mmm a / test / IRGen / type_layout_objc . swift <nl> ppp b / test / IRGen / type_layout_objc . swift <nl> enum EMult { case X ( Int64 ) , Y ( Int64 ) } <nl> @ _alignment ( 4 ) <nl> struct CommonLayout { var x , y , z , w : Int8 } <nl> <nl> - / / CHECK : @ " $ S16type_layout_objc14TypeLayoutTestVMP " = internal global { { . * } } @ create_generic_metadata_TypeLayoutTest <nl> - / / CHECK : define private % swift . type * @ create_generic_metadata_TypeLayoutTest <nl> + / / CHECK : @ " $ S16type_layout_objc14TypeLayoutTestVMn " = hidden constant { { . * } } @ " $ S16type_layout_objc14TypeLayoutTestVMi " <nl> + / / CHECK : define internal % swift . type * @ " $ S16type_layout_objc14TypeLayoutTestVMi " <nl> struct TypeLayoutTest < T > { <nl> / / - - dynamic layout , projected from metadata <nl> / / CHECK : [ [ T0 : % . * ] ] = bitcast % swift . type * % T to i8 * * * <nl> mmm a / test / IRGen / type_layout_reference_storage . swift <nl> ppp b / test / IRGen / type_layout_reference_storage . swift <nl> class C { } <nl> protocol P : class { } <nl> protocol Q : class { } <nl> <nl> - / / CHECK : @ " $ S29type_layout_reference_storage26ReferenceStorageTypeLayoutVMP " = internal global { { . * } } @ create_generic_metadata_ReferenceStorageTypeLayout <nl> - / / CHECK : define private % swift . type * @ create_generic_metadata_ReferenceStorageTypeLayout <nl> + / / CHECK : @ " $ S29type_layout_reference_storage26ReferenceStorageTypeLayoutVMn " = hidden constant { { . * } } @ " $ S29type_layout_reference_storage26ReferenceStorageTypeLayoutVMi " <nl> + / / CHECK : define internal % swift . type * @ " $ S29type_layout_reference_storage26ReferenceStorageTypeLayoutVMi " <nl> struct ReferenceStorageTypeLayout < T , Native : C , Unknown : AnyObject > { <nl> var z : T <nl> <nl> mmm a / test / IRGen / type_layout_reference_storage_objc . swift <nl> ppp b / test / IRGen / type_layout_reference_storage_objc . swift <nl> class C : NSObject { } <nl> @ objc protocol Q { } <nl> protocol NonObjC : class { } <nl> <nl> - / / CHECK : @ " $ S34type_layout_reference_storage_objc26ReferenceStorageTypeLayoutVMP " = internal global { { . * } } @ create_generic_metadata_ReferenceStorageTypeLayout <nl> - / / CHECK : define private % swift . type * @ create_generic_metadata_ReferenceStorageTypeLayout <nl> + / / CHECK : @ " $ S34type_layout_reference_storage_objc26ReferenceStorageTypeLayoutVMn " = hidden constant { { . * } } @ " $ S34type_layout_reference_storage_objc26ReferenceStorageTypeLayoutVMi " <nl> + / / CHECK : define internal % swift . type * @ " $ S34type_layout_reference_storage_objc26ReferenceStorageTypeLayoutVMi " <nl> struct ReferenceStorageTypeLayout < T , ObjC : C > { <nl> var z : T <nl> <nl> mmm a / test / multifile / require - layout - generic - arg - closure . swift <nl> ppp b / test / multifile / require - layout - generic - arg - closure . swift <nl> <nl> public func requestType2 < T > ( x : T ) { <nl> requestTypeThrough ( closure : { x in print ( x ) } , arg : x ) <nl> } <nl> - / / FILE2 - LABEL : define private % swift . type * @ create_generic_metadata_Sub ( % swift . type_pattern * , i8 * * ) <nl> + / / FILE2 - LABEL : define internal % swift . type * @ " $ S4test3SubCMi " ( % swift . type_descriptor * , i8 * * ) <nl> / / FILE2 : [ [ T_ADDR : % . * ] ] = bitcast i8 * * % 1 to % swift . type * * <nl> / / FILE2 : [ [ T : % . * ] ] = load % swift . type * , % swift . type * * % 2 <nl> / / FILE2 : [ [ CLASSMETADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata <nl> mmm a / test / multifile / require - layout - generic - arg - subscript . swift <nl> ppp b / test / multifile / require - layout - generic - arg - subscript . swift <nl> public class AccessorTest { <nl> } <nl> } <nl> <nl> - / / FILE2 - LABEL : define private % swift . type * @ create_generic_metadata_Sub ( % swift . type_pattern * , i8 * * ) <nl> + / / FILE2 - LABEL : define internal % swift . type * @ " $ S4test3SubCMi " ( % swift . type_descriptor * , i8 * * ) <nl> / / FILE2 : [ [ T_ADDR : % . * ] ] = bitcast i8 * * % 1 to % swift . type * * <nl> / / FILE2 : [ [ T : % . * ] ] = load % swift . type * , % swift . type * * % 2 <nl> / / FILE2 : [ [ CLASSMETADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata <nl> mmm a / test / multifile / require - layout - generic - arg . swift <nl> ppp b / test / multifile / require - layout - generic - arg . swift <nl> public func requestType < T > ( _ c : Sub < T > ) { <nl> print ( T . self ) <nl> } <nl> <nl> - / / FILE2 - LABEL : define private % swift . type * @ create_generic_metadata_Sub ( % swift . type_pattern * , i8 * * ) <nl> + / / FILE2 - LABEL : define internal % swift . type * @ " $ S4test3SubCMi " ( % swift . type_descriptor * , i8 * * ) <nl> / / FILE2 : [ [ T_ADDR : % . * ] ] = bitcast i8 * * % 1 to % swift . type * * <nl> / / FILE2 : [ [ T : % . * ] ] = load % swift . type * , % swift . type * * % 2 <nl> / / FILE2 : [ [ CLASSMETADATA : % . * ] ] = call % swift . type * @ swift_allocateGenericClassMetadata <nl> mmm a / unittests / runtime / Metadata . cpp <nl> ppp b / unittests / runtime / Metadata . cpp <nl> uint32_t Global1 = 0 ; <nl> uint32_t Global2 = 0 ; <nl> uint32_t Global3 = 0 ; <nl> <nl> - / / / The general structure of a generic metadata . <nl> - template < typename Instance , unsigned NumArguments > <nl> - struct GenericMetadataTest { <nl> - GenericMetadata Header ; <nl> - Instance Template ; <nl> - void * Storage [ NumArguments ] ; <nl> - } ; <nl> - <nl> - GenericMetadataTest < StructMetadata , 1 > MetadataTest1 = { <nl> - / / Header <nl> - { <nl> - / / allocation function <nl> - [ ] ( GenericMetadata * pattern , const void * args ) - > Metadata * { <nl> - auto metadata = swift_allocateGenericValueMetadata ( pattern , args ) ; <nl> - auto metadataWords = reinterpret_cast < const void * * > ( metadata ) ; <nl> - auto argsWords = reinterpret_cast < const void * const * > ( args ) ; <nl> - metadataWords [ 2 ] = argsWords [ 0 ] ; <nl> - return metadata ; <nl> - } , <nl> - 3 * sizeof ( void * ) , / / metadata size <nl> - 1 , / / num arguments <nl> - 0 , / / address point <nl> - { } / / private data <nl> - } , <nl> - <nl> - / / Fields <nl> - { <nl> - MetadataKind : : Struct , <nl> - reinterpret_cast < const TypeContextDescriptor * > ( & Global1 ) <nl> - } , <nl> - <nl> - / / Arguments <nl> - { nullptr } <nl> - } ; <nl> - <nl> struct TestObjContainer { <nl> swift_once_t token ; <nl> HeapObject obj ; <nl> TEST ( Concurrent , ConcurrentMap ) { <nl> } <nl> } <nl> <nl> - <nl> - TEST ( MetadataTest , getGenericMetadata ) { <nl> - auto metadataTemplate = ( GenericMetadata * ) & MetadataTest1 ; <nl> - <nl> - void * args [ ] = { & Global2 } ; <nl> - <nl> - auto result1 = RaceTest_ExpectEqual < const Metadata * > ( <nl> - [ & ] ( ) - > const Metadata * { <nl> - auto inst = static_cast < const StructMetadata * > <nl> - ( swift_getGenericMetadata ( metadataTemplate , args ) ) ; <nl> - <nl> - auto fields = reinterpret_cast < void * const * > ( inst ) ; <nl> - <nl> - EXPECT_EQ ( MetadataKind : : Struct , inst - > getKind ( ) ) ; <nl> - EXPECT_EQ ( reinterpret_cast < const TypeContextDescriptor * > ( & Global1 ) , <nl> - inst - > Description ) ; <nl> - <nl> - EXPECT_EQ ( & Global2 , fields [ 2 ] ) ; <nl> - <nl> - return inst ; <nl> - } ) ; <nl> - <nl> - args [ 0 ] = & Global3 ; <nl> - <nl> - RaceTest_ExpectEqual < const Metadata * > ( <nl> - [ & ] ( ) - > const Metadata * { <nl> - auto inst = static_cast < const StructMetadata * > <nl> - ( swift_getGenericMetadata ( metadataTemplate , args ) ) ; <nl> - EXPECT_NE ( inst , result1 ) ; <nl> - <nl> - auto fields = reinterpret_cast < void * const * > ( inst ) ; <nl> - EXPECT_EQ ( MetadataKind : : Struct , inst - > getKind ( ) ) ; <nl> - EXPECT_EQ ( reinterpret_cast < const TypeContextDescriptor * > ( & Global1 ) , <nl> - inst - > Description ) ; <nl> - <nl> - EXPECT_EQ ( & Global3 , fields [ 2 ] ) ; <nl> - <nl> - return inst ; <nl> - } ) ; <nl> - } <nl> - <nl> FullMetadata < ClassMetadata > MetadataTest2 = { <nl> { { nullptr } , { & VALUE_WITNESS_SYM ( Bo ) } } , <nl> { { { MetadataKind : : Class } } , nullptr , / * rodata * / 1 , <nl> TEST ( MetadataTest , getExistentialMetadata ) { <nl> } ) ; <nl> } <nl> <nl> - static SWIFT_CC ( swift ) void destroySuperclass ( SWIFT_CONTEXT HeapObject * toDestroy ) { } <nl> - <nl> - struct { <nl> - void * Prefix [ 4 ] ; <nl> - FullMetadata < ClassMetadata > Metadata ; <nl> - } SuperclassWithPrefix = { <nl> - { & Global1 , & Global3 , & Global2 , & Global3 } , <nl> - { { { & destroySuperclass } , { & VALUE_WITNESS_SYM ( Bo ) } } , <nl> - { { { MetadataKind : : Class } } , nullptr , / * rodata * / 1 , ClassFlags ( ) , 0 , <nl> - 0 , 0 , 0 , sizeof ( SuperclassWithPrefix ) , <nl> - sizeof ( SuperclassWithPrefix . Prefix ) + sizeof ( HeapMetadataHeader ) } } <nl> - } ; <nl> - ClassMetadata * const SuperclassWithPrefix_AddressPoint = <nl> - & SuperclassWithPrefix . Metadata ; <nl> - <nl> - static SWIFT_CC ( swift ) void destroySubclass ( SWIFT_CONTEXT HeapObject * toDestroy ) { } <nl> - <nl> - struct { <nl> - GenericMetadata Header ; <nl> - FullMetadata < ClassMetadata > Pattern ; <nl> - void * Suffix [ 3 ] ; <nl> - } GenericSubclass = { <nl> - { <nl> - / / allocation function <nl> - [ ] ( GenericMetadata * pattern , const void * args ) - > Metadata * { <nl> - auto metadata = <nl> - swift_allocateGenericClassMetadata ( pattern , args , <nl> - SuperclassWithPrefix_AddressPoint , 0 ) ; <nl> - char * bytes = ( char * ) metadata + sizeof ( ClassMetadata ) ; <nl> - auto metadataWords = reinterpret_cast < const void * * > ( bytes ) ; <nl> - auto argsWords = reinterpret_cast < const void * const * > ( args ) ; <nl> - metadataWords [ 2 ] = argsWords [ 0 ] ; <nl> - return metadata ; <nl> - } , <nl> - sizeof ( GenericSubclass . Pattern ) + sizeof ( GenericSubclass . Suffix ) , / / pattern size <nl> - 1 , / / num arguments <nl> - sizeof ( HeapMetadataHeader ) , / / address point <nl> - { } / / private data <nl> - } , <nl> - { { { & destroySubclass } , { & VALUE_WITNESS_SYM ( Bo ) } } , <nl> - { { { MetadataKind : : Class } } , nullptr , / * rodata * / 1 , ClassFlags ( ) , 0 , <nl> - 0 , 0 , 0 , <nl> - sizeof ( GenericSubclass . Pattern ) + sizeof ( GenericSubclass . Suffix ) , <nl> - sizeof ( HeapMetadataHeader ) } } , <nl> - { & Global2 , & Global1 , & Global2 } <nl> - } ; <nl> - <nl> static ProtocolDescriptor OpaqueProto1 = { " OpaqueProto1 " , nullptr , <nl> ProtocolDescriptorFlags ( ) . withSwift ( true ) <nl> . withDispatchStrategy ( ProtocolDispatchStrategy : : Swift ) <nl>
Merge remote - tracking branch ' origin / master ' into master - llvm - swift5 - transition
apple/swift
18fe201cbced9825c281117f5a61033ab667f3b2
2018-02-26T19:18:00Z
mmm a / src / qt / guiutil . cpp <nl> ppp b / src / qt / guiutil . cpp <nl> bool parseBitcoinURI ( QString uri , SendCoinsRecipient * out ) <nl> / / <nl> / / Cannot handle this later , because bitcoin : / / will cause Qt to see the part after / / as host , <nl> / / which will lower - case it ( and thus invalidate the address ) . <nl> - if ( uri . startsWith ( " bitcoin : / / " ) ) <nl> + if ( uri . startsWith ( " bitcoin : / / " , Qt : : CaseInsensitive ) ) <nl> { <nl> uri . replace ( 0 , 10 , " bitcoin : " ) ; <nl> } <nl>
qt : make URI scheme comparison case insensitive
bitcoin/bitcoin
b3e579713f14309a330a44171abd47c2e851a7b0
2013-11-12T15:40:09Z
new file mode 100644 <nl> index 000000000000 . . 89d6b79f4143 <nl> mmm / dev / null <nl> ppp b / test / jit / test_op_normalization . py <nl> <nl> + import os <nl> + import sys <nl> + <nl> + import torch <nl> + from torch . testing import FileCheck <nl> + <nl> + # Make the helper files in test / importable <nl> + pytorch_test_dir = os . path . dirname ( os . path . dirname ( os . path . realpath ( __file__ ) ) ) <nl> + sys . path . append ( pytorch_test_dir ) <nl> + from torch . testing . _internal . jit_utils import JitTestCase , op_alias_mappings <nl> + from torch . testing . _internal . jit_metaprogramming_utils import create_script_fn , create_traced_fn <nl> + from torch . testing . _internal . common_methods_invocations import method_tests , create_input <nl> + <nl> + if __name__ = = ' __main__ ' : <nl> + raise RuntimeError ( " This test file is not meant to be run directly , use : \ n \ n " <nl> + " \ tpython test / test_jit . py TESTNAME \ n \ n " <nl> + " instead . " ) <nl> + <nl> + def get_defaults ( <nl> + name , <nl> + self_size , <nl> + args , <nl> + variant_name = ' ' , <nl> + check_ad = ( ) , <nl> + dim_args_idx = ( ) , <nl> + skipTestIf = ( ) , <nl> + output_process_fn = lambda x : x , <nl> + kwargs = None ) : <nl> + args = tuple ( enumerate ( args ) ) <nl> + kwargs = kwargs if kwargs else { } <nl> + return name , self_size , args , kwargs , output_process_fn <nl> + <nl> + class TestOpNormalization ( JitTestCase ) : <nl> + <nl> + @ torch . no_grad ( ) <nl> + def test_aliases ( self ) : <nl> + # tests that op aliases are correctly being normalized <nl> + # does not check for other properties such as correctness because <nl> + # the common method registry gets tested for those in test_jit . py <nl> + <nl> + op_registry = { } <nl> + for op in method_tests ( ) : <nl> + op_registry [ op [ 0 ] ] = op <nl> + <nl> + for alias , mapping in op_alias_mappings . items ( ) : <nl> + assert alias in op_registry , " Test not found for { } alias " . format ( alias ) <nl> + <nl> + name , self_size , args , kwargs , output_process_fn = get_defaults ( * op_registry [ alias ] ) <nl> + <nl> + def fn ( * inputs , * * kwargs ) : <nl> + attr = getattr ( inputs [ 0 ] , name ) <nl> + output = attr ( * inputs [ 1 : ] , * * kwargs ) <nl> + return output_process_fn ( output ) <nl> + <nl> + self_variable = create_input ( ( self_size , ) ) [ 0 ] [ 0 ] <nl> + args_variable , kwargs_variable = create_input ( args , requires_grad = False , call_kwargs = kwargs ) <nl> + <nl> + traced_fn = create_traced_fn ( self , fn ) <nl> + inputs = ( self_variable , ) + args_variable <nl> + traced_fn ( * inputs , * * kwargs ) <nl> + last_graph = traced_fn . last_graph <nl> + FileCheck ( ) . check ( mapping ) . check_not ( alias ) . run ( last_graph ) <nl> + <nl> + script_fn = create_script_fn ( self , name , ' method ' , output_process_fn ) <nl> + script_fn ( * inputs , * * kwargs ) <nl> + last_graph = script_fn . last_graph <nl> + FileCheck ( ) . check ( mapping ) . check_not ( alias ) . run ( last_graph ) <nl> mmm a / test / test_jit . py <nl> ppp b / test / test_jit . py <nl> <nl> from jit . test_python_ir import TestPythonIr # noqa : F401 <nl> from jit . test_functional_blocks import TestFunctionalBlocks # noqa : F401 <nl> from jit . test_torchbind import TestTorchbind # noqa : F401 <nl> + from jit . test_op_normalization import TestOpNormalization # noqa : F401 <nl> <nl> # Torch <nl> from torch import Tensor <nl> <nl> from torch . testing . _internal . jit_utils import JitTestCase , enable_cpu_fuser , disable_autodiff_subgraph_inlining , \ <nl> _trace , enable_cpu_fuser_if , do_input_map , get_execution_plan , \ <nl> execWrapper , _inline_everything , _tmp_donotuse_dont_inline_everything , \ <nl> - RUN_CUDA , RUN_CUDA_MULTI_GPU <nl> + RUN_CUDA , RUN_CUDA_MULTI_GPU , op_alias_mappings <nl> from torch . testing . _internal . jit_metaprogramming_utils import create_script_fn , nn_functional_tests , get_script_args , \ <nl> get_call , script_template , EXCLUDE_SCRIPT , additional_module_tests , EXCLUDE_SCRIPT_MODULES , \ <nl> - get_nn_module_name_from_kwargs , script_method_template <nl> + get_nn_module_name_from_kwargs , script_method_template , create_traced_fn <nl> <nl> from torch . testing . _internal . common_nn import module_tests , new_module_tests , criterion_tests <nl> from torch . testing . _internal . common_methods_invocations import method_tests as autograd_method_tests <nl> def test_irparser ( self ) : <nl> " " " <nl> FileCheck ( ) . run ( graph_str , parse_ir ( graph_str ) ) <nl> <nl> - def test_norm_aliases ( self ) : <nl> - def absolute ( x ) : <nl> - return torch . absolute ( x ) <nl> - <nl> - self . checkScript ( absolute , ( torch . tensor ( - 2 ) , ) ) <nl> - self . checkScript ( absolute , ( torch . tensor ( 2 ) , ) ) <nl> - <nl> - g = torch . jit . script ( absolute ) <nl> - FileCheck ( ) . check ( " aten : : abs ( " ) . check_not ( " absolute " ) . run ( g . graph ) <nl> - <nl> - self . checkTrace ( absolute , ( torch . rand ( 3 , 4 ) , ) ) <nl> - out = torch . jit . trace ( absolute , ( torch . rand ( 3 , 4 ) , ) ) <nl> - FileCheck ( ) . check ( " aten : : abs ( " ) . check_not ( " absolute " ) . run ( out . graph ) <nl> - <nl> def test_canonicalize_control_outputs ( self ) : <nl> def test_all_outputs ( g ) : <nl> ifs = g . findAllNodes ( " prim : : If " ) <nl> def _forward ( self , x ) : <nl> ' test_nn_max_pool1d_with_indices ' , <nl> } <nl> <nl> - # make a new function where all non - tensor arguments in ' args ' have been partially <nl> - # applied , and all tensor arguments remain . <nl> - # used to trace functions when some arguments are not tensors <nl> - def partial_apply_nontensors ( fn , args , * * kwargs ) : <nl> - source = [ ' t ' if isinstance ( arg , torch . Tensor ) else ' s ' for arg in args ] <nl> - <nl> - def new_fn ( * tensors_ ) : <nl> - tensors = iter ( tensors_ ) <nl> - return fn ( * ( args [ i ] if s = = ' s ' else next ( tensors ) for i , s in enumerate ( source ) ) , * * kwargs ) <nl> - <nl> - return new_fn , [ arg for arg in args if isinstance ( arg , torch . Tensor ) ] <nl> - <nl> - <nl> - # create a trace function from input fn <nl> - def create_traced_fn ( self , fn ) : <nl> - def traced_fn ( * inputs , * * kwargs ) : <nl> - fn_tensors , inputs_tensors = partial_apply_nontensors ( fn , inputs , * * kwargs ) <nl> - # ` check_trace ` is set to False because check_trace is run with @ no_grad <nl> - # Also , ` check_against_reference ` already does all the checks <nl> - # against python function <nl> - traced = torch . jit . trace ( fn_tensors , inputs_tensors , check_trace = False ) <nl> - self . assertExportImport ( traced . graph , inputs_tensors ) <nl> - output = traced ( * inputs_tensors ) <nl> - traced_fn . last_graph = traced . graph_for ( * inputs_tensors ) <nl> - return output <nl> - return traced_fn <nl> - <nl> - <nl> def check_alias_annotation ( method_name , args , kwargs ) : <nl> formals , tensors , actuals = get_script_args ( args ) <nl> call = get_call ( method_name , ' method ' , actuals , kwargs ) <nl> class TestJitGeneratedFunctional ( JitTestCase ) : <nl> ' grid_sample ' , <nl> ] ) <nl> <nl> - <nl> def add_autograd_test ( <nl> name , <nl> self_size , <nl> def fn ( * inputs , * * kwargs ) : <nl> <nl> # alias annotation testing <nl> if is_inplace and test_name not in EXCLUDE_SCRIPT : <nl> - check_alias_annotation ( name , ( self_variable , ) + args_variable , kwargs_variable ) <nl> + check_alias_annotation ( op_alias_mappings . get ( name , name ) , ( self_variable , ) + args_variable , kwargs_variable ) <nl> <nl> check ( name ) <nl> inplace_name = name + ' _ ' <nl> mmm a / torch / testing / _internal / common_methods_invocations . py <nl> ppp b / torch / testing / _internal / common_methods_invocations . py <nl> def ident ( x ) : <nl> # input size / constructing fn , <nl> # args ( tuple represents shape of a tensor arg ) , <nl> # test variant name ( will be used at test name suffix ) , / / optional <nl> - # ( True , nonfusible_nodes , fusible_nodes ) for autodiff , / / optional <nl> + # ( should_check_autodiff [ bool ] , nonfusible_nodes , fusible_nodes ) for autodiff , / / optional <nl> # indices for possible dim arg , / / optional <nl> # fn mapping output to part that should be gradcheck ' ed , / / optional <nl> # kwargs / / optional <nl> def method_tests ( ) : <nl> ( ' cosh ' , ( ) , NO_ARGS , ' scalar ' , ( True , ) ) , <nl> ( ' abs ' , ( S , S , S ) , NO_ARGS , ' ' , ( True , ) ) , <nl> ( ' abs ' , ( ) , NO_ARGS , ' scalar ' , ( True , ) ) , <nl> + ( ' absolute ' , ( S , S , S ) , NO_ARGS , ' ' , ( False , ) ) , <nl> + ( ' absolute_ ' , ( S , S , S ) , NO_ARGS , ' ' , ( False , ) ) , <nl> ( ' clamp ' , ( S , S , S ) , ( 0 , 1 ) , ' ' , ( True , ) ) , <nl> ( ' clamp ' , ( S , S , S ) , ( None , 0 . 5 ) , ' min ' , ( True , ) ) , <nl> ( ' clamp ' , ( S , S , S ) , ( 0 . 5 , None ) , ' max ' , ( True , ) ) , <nl> mmm a / torch / testing / _internal / jit_metaprogramming_utils . py <nl> ppp b / torch / testing / _internal / jit_metaprogramming_utils . py <nl> def script_fn ( * args , * * kwargs ) : <nl> return output <nl> return script_fn <nl> <nl> + # make a new function where all non - tensor arguments in ' args ' have been partially <nl> + # applied , and all tensor arguments remain . <nl> + # used to trace functions when some arguments are not tensors <nl> + def partial_apply_nontensors ( fn , args , * * kwargs ) : <nl> + source = [ ' t ' if isinstance ( arg , torch . Tensor ) else ' s ' for arg in args ] <nl> + <nl> + def new_fn ( * tensors_ ) : <nl> + tensors = iter ( tensors_ ) <nl> + return fn ( * ( args [ i ] if s = = ' s ' else next ( tensors ) for i , s in enumerate ( source ) ) , * * kwargs ) <nl> + <nl> + return new_fn , [ arg for arg in args if isinstance ( arg , torch . Tensor ) ] <nl> + <nl> + # create a trace function from input fn <nl> + def create_traced_fn ( self , fn ) : <nl> + def traced_fn ( * inputs , * * kwargs ) : <nl> + fn_tensors , inputs_tensors = partial_apply_nontensors ( fn , inputs , * * kwargs ) <nl> + # ` check_trace ` is set to False because check_trace is run with @ no_grad <nl> + # Also , ` check_against_reference ` already does all the checks <nl> + # against python function <nl> + traced = torch . jit . trace ( fn_tensors , inputs_tensors , check_trace = False ) <nl> + self . assertExportImport ( traced . graph , inputs_tensors ) <nl> + output = traced ( * inputs_tensors ) <nl> + traced_fn . last_graph = traced . graph_for ( * inputs_tensors ) <nl> + return output <nl> + return traced_fn <nl> <nl> # known to be failing in script <nl> EXCLUDE_SCRIPT = { <nl> def script_fn ( * args , * * kwargs ) : <nl> ' test_to_sparse ' <nl> } <nl> <nl> - # generates a script function and set of example inputs <nl> + # generates a script function and set of example inputs <nl> # from a specified test in the format of nn_functional_tests <nl> def get_nn_functional_compiled_fn_and_inputs ( name , self_size , args , variant_name = ' ' , * extra_args ) : <nl> test_name = ' test_nn_ ' + name <nl> def try_get_nn_module_compiled_mod_and_inputs ( * args , * * kwargs ) : <nl> elif ' target_fn ' in kwargs : <nl> if torch . is_tensor ( input ) : <nl> input = ( input , ) <nl> - input = input + ( kwargs [ ' target_fn ' ] ( ) , ) <nl> + input = input + ( kwargs [ ' target_fn ' ] ( ) , ) <nl> <nl> args_variable , kwargs_variable = create_input ( input ) <nl> f_args_variable = deepcopy ( unpack_variables ( args_variable ) ) <nl> mmm a / torch / testing / _internal / jit_utils . py <nl> ppp b / torch / testing / _internal / jit_utils . py <nl> def get_module_method ( m , module , method ) : <nl> def attrs_with_prefix ( module , prefix ) : <nl> return [ x for x , _ in module . _modules . _c . items ( ) <nl> if x . startswith ( prefix ) ] <nl> + <nl> + op_alias_mappings = { <nl> + " absolute " : " abs " , <nl> + " absolute_ " : " abs_ " , <nl> + } <nl>
[ JIT ] Factor out aliases to separate test ( )
pytorch/pytorch
cd5d7a34b8802cf120451182fd17a662efec644c
2020-05-22T04:47:24Z
mmm a / tools / internal_ci / helper_scripts / prepare_build_interop_rc <nl> ppp b / tools / internal_ci / helper_scripts / prepare_build_interop_rc <nl> git clone - - recursive https : / / github . com / grpc / grpc - go . / . . / grpc - go <nl> git clone - - recursive https : / / github . com / grpc / grpc - java . / . . / grpc - java <nl> git clone - - recursive https : / / github . com / grpc / grpc - node . / . . / grpc - node <nl> git clone - - recursive https : / / github . com / grpc / grpc - dart . / . . / grpc - dart <nl> + git clone - - recursive https : / / github . com / grpc / grpc - dotnet . / . . / grpc - dotnet <nl> <nl> # Download json file . <nl> mkdir ~ / service_account <nl> mmm a / tools / internal_ci / helper_scripts / prepare_build_macos_interop_rc <nl> ppp b / tools / internal_ci / helper_scripts / prepare_build_macos_interop_rc <nl> git clone - - recursive https : / / github . com / grpc / grpc - go . / . . / grpc - go <nl> git clone - - recursive https : / / github . com / grpc / grpc - java . / . . / grpc - java <nl> git clone - - recursive https : / / github . com / grpc / grpc - node . / . . / grpc - node <nl> git clone - - recursive https : / / github . com / grpc / grpc - dart . / . . / grpc - dart <nl> + git clone - - recursive https : / / github . com / grpc / grpc - dotnet . / . . / grpc - dotnet <nl>
update prepare scripts
grpc/grpc
ecee06640e39b4c249a45da88a55da31a28cbe2d
2019-02-14T23:17:05Z
mmm a / folly / experimental / pushmi / concepts . h <nl> ppp b / folly / experimental / pushmi / concepts . h <nl> PUSHMI_CONCEPT_DEF ( <nl> ( concept ReceiveError ) ( R , E ) , / / <nl> requires ( R & r , E & & e ) ( / / <nl> set_error ( r , ( E & & ) e ) ) & & <nl> - Receiver < R > & & SemiMovable < E > ) ; <nl> + Receiver < R > & & SemiMovable < E > <nl> + ) ; <nl> <nl> PUSHMI_CONCEPT_DEF ( <nl> template ( class D , class . . . PropertyN ) / / <nl> mmm a / folly / experimental / pushmi / detail / concept_def . h <nl> ppp b / folly / experimental / pushmi / detail / concept_def . h <nl> PUSHMI_PP_IGNORE_CXX2A_COMPAT_BEGIN <nl> PUSHMI_PP_IIF ( X ) ( PUSHMI_PP_EMPTY , PUSHMI_PP_COMMA ) ( ) <nl> <nl> # define PUSHMI_CONCEPT_ASSERT ( . . . ) \ <nl> - static_assert ( ( bool ) ( __VA_ARGS__ ) , \ <nl> + static_assert ( static_cast < bool > ( __VA_ARGS__ ) , \ <nl> " Concept assertion failed : " # __VA_ARGS__ ) <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> PUSHMI_PP_IGNORE_CXX2A_COMPAT_BEGIN <nl> # define PUSHMI_PP_DECL_DEF_IMPL ( TPARAM , NAME , ARGS , . . . ) \ <nl> inline namespace _eager_ { \ <nl> PUSHMI_PP_CAT ( PUSHMI_PP_DEF_ , TPARAM ) \ <nl> - concept bool NAME = PUSHMI_PP_DEF_IMPL ( __VA_ARGS__ ) ( __VA_ARGS__ ) ; \ <nl> + concept bool NAME = PUSHMI_PP_DEF_IMPL ( __VA_ARGS__ , ) ( __VA_ARGS__ ) ; \ <nl> } \ <nl> namespace lazy = _eager_ ; \ <nl> / * * / <nl> # else <nl> / / No requires expression : <nl> # define PUSHMI_PP_DEF_IMPL_0 ( . . . ) \ <nl> - ( ) - > std : : enable_if_t < bool ( __VA_ARGS__ ) , int > \ <nl> + ( ) - > std : : enable_if_t < static_cast < bool > ( __VA_ARGS__ ) , int > \ <nl> / * * / <nl> / / Requires expression : <nl> # define PUSHMI_PP_DEF_IMPL_1 ( . . . ) \ <nl> PUSHMI_PP_IGNORE_CXX2A_COMPAT_BEGIN <nl> using Concept = PUSHMI_PP_CAT ( NAME , Concept ) ; \ <nl> PUSHMI_PP_IGNORE_CXX2A_COMPAT_BEGIN \ <nl> PUSHMI_PP_CAT ( PUSHMI_PP_DEF_ , TPARAM ) \ <nl> - static auto Requires_ PUSHMI_PP_DEF_IMPL ( __VA_ARGS__ ) ( __VA_ARGS__ ) { \ <nl> + static auto Requires_ PUSHMI_PP_DEF_IMPL ( __VA_ARGS__ , ) ( __VA_ARGS__ ) { \ <nl> return 0 ; \ <nl> } \ <nl> PUSHMI_PP_IGNORE_CXX2A_COMPAT_END \ <nl> PUSHMI_PP_CAT ( PUSHMI_PP_DEF_ , TPARAM ) \ <nl> struct Eval { \ <nl> - template < class C_ = Concept > \ <nl> - static constexpr decltype ( : : folly : : pushmi : : concepts : : detail : : gcc_bugs ( \ <nl> - & C_ : : template Requires_ < PUSHMI_PP_EXPAND ARGS > ) ) \ <nl> - impl ( int ) noexcept { \ <nl> + template < class C_ = Concept , \ <nl> + decltype ( : : folly : : pushmi : : concepts : : detail : : gcc_bugs ( \ <nl> + & C_ : : template Requires_ < PUSHMI_PP_EXPAND ARGS > ) ) = nullptr > \ <nl> + static constexpr bool impl ( int ) noexcept { \ <nl> return true ; \ <nl> } \ <nl> static constexpr bool impl ( long ) noexcept { \ <nl> PUSHMI_PP_IGNORE_CXX2A_COMPAT_BEGIN <nl> template < \ <nl> class PMThis = Concept , \ <nl> bool PMB , \ <nl> - class = std : : enable_if_t < PMB = = ( bool ) PMThis { } > > \ <nl> + class = std : : enable_if_t < PMB = = static_cast < bool > ( PMThis { } ) > > \ <nl> constexpr operator std : : integral_constant < bool , PMB > ( ) const noexcept { \ <nl> return { } ; \ <nl> } \ <nl> PUSHMI_PP_IGNORE_CXX2A_COMPAT_BEGIN <nl> } \ <nl> PUSHMI_PP_CAT ( PUSHMI_PP_DEF_ , TPARAM ) \ <nl> PUSHMI_INLINE_VAR constexpr bool NAME = \ <nl> - ( bool ) PUSHMI_PP_CAT ( NAME , Concept ) : : Eval < PUSHMI_PP_EXPAND ARGS > { } \ <nl> + static_cast < bool > ( \ <nl> + PUSHMI_PP_CAT ( NAME , Concept ) : : Eval < PUSHMI_PP_EXPAND ARGS > { } ) \ <nl> / * * / <nl> # endif <nl> <nl> PUSHMI_PP_IGNORE_CXX2A_COMPAT_BEGIN <nl> # define PUSHMI_TEMPLATE ( . . . ) \ <nl> template < __VA_ARGS__ PUSHMI_TEMPLATE_AUX_ <nl> # define PUSHMI_TEMPLATE_AUX_ ( . . . ) , \ <nl> - int ( * PUSHMI_PP_CAT ( _pushmi_concept_unique_ , __LINE__ ) ) [ \ <nl> - PUSHMI_COUNTER ] = nullptr , \ <nl> - std : : enable_if_t < PUSHMI_PP_CAT ( _pushmi_concept_unique_ , __LINE__ ) | | \ <nl> - bool ( PUSHMI_TEMPLATE_AUX_4 ( PUSHMI_PP_CAT ( \ <nl> - PUSHMI_TEMPLATE_AUX_3_ , __VA_ARGS__ ) ) ) , int > = 0 > \ <nl> + bool PUSHMI_PP_CAT ( _pushmi_false_ , __LINE__ ) = false , \ <nl> + std : : enable_if_t < \ <nl> + static_cast < bool > ( PUSHMI_TEMPLATE_AUX_4 ( PUSHMI_PP_CAT ( \ <nl> + PUSHMI_TEMPLATE_AUX_3_ , __VA_ARGS__ ) ) ) | | \ <nl> + PUSHMI_PP_CAT ( _pushmi_false_ , __LINE__ ) , int > = 0 > \ <nl> / * * / <nl> # define PUSHMI_TEMPLATE_AUX_3_requires <nl> # define PUSHMI_TEMPLATE_AUX_4 ( . . . ) \ <nl> using bool_ = std : : integral_constant < bool , B > ; <nl> <nl> namespace concepts { <nl> namespace detail { <nl> - bool gcc_bugs ( . . . ) ; <nl> + template < class T > <nl> + T gcc_bugs ( T ) ; <nl> <nl> template < class > <nl> inline constexpr bool requires_ ( ) { <nl> struct Or ; <nl> template < class T > <nl> struct Not { <nl> explicit constexpr operator bool ( ) const noexcept { <nl> - return ! ( bool ) T { } ; <nl> + return ! static_cast < bool > ( T { } ) ; <nl> } <nl> PUSHMI_TEMPLATE ( class This = Not , bool B ) <nl> - ( requires B = = ( bool ) This { } ) constexpr <nl> + ( requires B = = static_cast < bool > ( This { } ) ) constexpr <nl> operator std : : integral_constant < bool , B > ( ) const noexcept { <nl> return { } ; <nl> } <nl> struct And { <nl> explicit constexpr operator bool ( ) const noexcept { <nl> return ( bool ) std : : conditional_t < ( bool ) T { } , U , std : : false_type > { } ; <nl> } <nl> - PUSHMI_TEMPLATE ( class This = And , bool B ) <nl> - ( requires B = = ( bool ) This { } ) constexpr <nl> - operator std : : integral_constant < bool , B > ( ) const noexcept { <nl> + PUSHMI_TEMPLATE ( class This = And , bool B ) / / <nl> + ( requires B = = static_cast < bool > ( This { } ) ) / / <nl> + constexpr operator std : : integral_constant < bool , B > ( ) const noexcept { <nl> return { } ; <nl> } <nl> constexpr auto operator ! ( ) const noexcept { <nl> struct Or { <nl> explicit constexpr operator bool ( ) const noexcept { <nl> return ( bool ) std : : conditional_t < ( bool ) T { } , std : : true_type , U > { } ; <nl> } <nl> - PUSHMI_TEMPLATE ( class This = Or , bool B ) <nl> - ( requires B = = ( bool ) This { } ) constexpr <nl> - operator std : : integral_constant < bool , B > ( ) const noexcept { <nl> + PUSHMI_TEMPLATE ( class This = Or , bool B ) / / <nl> + ( requires B = = static_cast < bool > ( This { } ) ) / / <nl> + constexpr operator std : : integral_constant < bool , B > ( ) const noexcept { <nl> return { } ; <nl> } <nl> constexpr auto operator ! ( ) const noexcept { <nl> mmm a / folly / experimental / pushmi / examples / set_done / set_done_2 . cpp <nl> ppp b / folly / experimental / pushmi / examples / set_done / set_done_2 . cpp <nl> auto println = [ ] ( auto v ) { std : : cout < < v < < std : : endl ; } ; <nl> <nl> / / concat not yet implemented <nl> template < class T , class E = std : : exception_ptr > <nl> - auto concat = [ ] ( auto in ) { <nl> - return mi : : make_single_sender ( [ in ] ( auto out ) mutable { <nl> - mi : : submit ( in , mi : : make_receiver ( out , [ ] ( auto out_ , auto v ) { <nl> - mi : : submit ( v , mi : : any_receiver < E , T > ( out_ ) ) ; <nl> - } ) ) ; <nl> - } ) ; <nl> - } ; <nl> + auto concat ( ) { <nl> + return [ ] ( auto in ) { <nl> + return mi : : make_single_sender ( [ in ] ( auto out ) mutable { <nl> + mi : : submit ( in , mi : : make_receiver ( out , [ ] ( auto out_ , auto v ) { <nl> + mi : : submit ( v , mi : : any_receiver < E , T > ( out_ ) ) ; <nl> + } ) ) ; <nl> + } ) ; <nl> + } ; <nl> + } <nl> <nl> int main ( ) { <nl> get_setting ( ) | op : : transform ( [ ] ( int i ) { return std : : to_string ( i ) ; } ) | <nl> int main ( ) { <nl> } <nl> return mi : : any_single_sender < std : : exception_ptr , std : : string > { <nl> op : : just ( std : : to_string ( i ) ) } ; <nl> - } ) | concat < std : : string > | <nl> + } ) | concat < std : : string > ( ) | <nl> op : : submit ( println ) ; <nl> <nl> std : : cout < < " OK " < < std : : endl ; <nl> mmm a / folly / experimental / pushmi / examples / set_error / set_error_2 . cpp <nl> ppp b / folly / experimental / pushmi / examples / set_error / set_error_2 . cpp <nl> using namespace folly : : pushmi : : aliases ; <nl> <nl> / / concat not yet implemented <nl> template < class T , class E = std : : exception_ptr > <nl> - auto concat = [ ] ( auto in ) { <nl> - return mi : : make_single_sender ( [ in ] ( auto out ) mutable { <nl> - mi : : submit ( in , mi : : make_receiver ( out , [ ] ( auto out_ , auto v ) { <nl> - mi : : submit ( v , mi : : any_receiver < E , T > ( out_ ) ) ; <nl> - } ) ) ; <nl> - } ) ; <nl> - } ; <nl> + auto concat ( ) { <nl> + return [ ] ( auto in ) { <nl> + return mi : : make_single_sender ( [ in ] ( auto out ) mutable { <nl> + mi : : submit ( in , mi : : make_receiver ( out , [ ] ( auto out_ , auto v ) { <nl> + mi : : submit ( v , mi : : any_receiver < E , T > ( out_ ) ) ; <nl> + } ) ) ; <nl> + } ) ; <nl> + } ; <nl> + } <nl> <nl> int main ( ) { <nl> auto stop_abort = mi : : on_error ( [ ] ( auto ) noexcept { } ) ; <nl> int main ( ) { <nl> } else { <nl> return r_t { op : : just ( v ) } ; <nl> } <nl> - } ) | concat < int > | <nl> + } ) | concat < int > ( ) | <nl> op : : submit ( ) ; <nl> <nl> / / retry on error <nl> mmm a / folly / experimental / pushmi / executor . h <nl> ppp b / folly / experimental / pushmi / executor . h <nl> struct any_executor_ref { <nl> static_assert ( <nl> SenderTo < Wrapped , any_receiver < E , This > > , <nl> " Expecting to be passed a Sender that can send to a SingleReceiver " <nl> - " that accpets a value of type This and an error of type E " ) ; <nl> + " that accepts a value of type This and an error of type E " ) ; <nl> struct s { <nl> static void submit ( void * pobj , void * s ) { <nl> return : : folly : : pushmi : : submit ( <nl> mmm a / folly / experimental / pushmi / extension_points . h <nl> ppp b / folly / experimental / pushmi / extension_points . h <nl> PUSHMI_INLINE_VAR constexpr __adl : : get_top_fn top { } ; <nl> template < class T > <nl> struct property_set_traits < <nl> T , <nl> - std : : enable_if_t < ( bool ) Invocable < T & > & & not Valid < T & , __properties_t > > > { <nl> + void_t < invoke_result_t < T & > > > { <nl> using properties = property_set < is_receiver < > > ; <nl> } ; <nl> <nl> mmm a / folly / experimental / pushmi / o / tap . h <nl> ppp b / folly / experimental / pushmi / o / tap . h <nl> struct tap_fn { <nl> ( requires Sender < In > & & Receiver < SideEffects > ) <nl> struct out_impl { <nl> SideEffects sideEffects_ ; <nl> + template < class Out > <nl> + using tap_t = <nl> + decltype ( <nl> + detail : : make_tap ( <nl> + std : : declval < const SideEffects & > ( ) , <nl> + std : : declval < Out > ( ) ) ) ; <nl> + template < class Out > <nl> + using receiver_t = invoke_result_t < receiver_from_fn < In > , tap_t < Out > > ; <nl> PUSHMI_TEMPLATE ( class Out ) <nl> ( requires Receiver < Out > & & SenderTo < In , Out > & & SenderTo < <nl> In , <nl> - decltype ( <nl> - : : folly : : pushmi : : detail : : receiver_from_fn < In > ( ) ( detail : : make_tap ( <nl> - std : : declval < SideEffects > ( ) , <nl> - std : : declval < Out > ( ) ) ) ) > ) <nl> + receiver_t < Out > > ) <nl> auto operator ( ) ( Out out ) const { <nl> auto gang { : : folly : : pushmi : : detail : : receiver_from_fn < In > ( ) ( <nl> detail : : make_tap ( sideEffects_ , std : : move ( out ) ) ) } ; <nl> mmm a / folly / experimental / pushmi / piping . h <nl> ppp b / folly / experimental / pushmi / piping . h <nl> namespace folly { <nl> namespace pushmi { <nl> <nl> PUSHMI_TEMPLATE ( class In , class Op ) <nl> - ( requires lazy : : Sender < std : : decay_t < In > > & & lazy : : Invocable < Op & , In > ) / / <nl> + ( requires PUSHMI_EXP ( lazy : : Sender < std : : decay_t < In > > PUSHMI_AND <nl> + lazy : : Invocable < Op & , In > ) ) / / <nl> decltype ( auto ) <nl> operator | ( In & & in , Op op ) { <nl> return op ( ( In & & ) in ) ; <nl> mmm a / folly / experimental / pushmi / properties . h <nl> ppp b / folly / experimental / pushmi / properties . h <nl> <nl> * / <nl> # pragma once <nl> <nl> + # include < folly / Traits . h > <nl> # include < folly / experimental / pushmi / traits . h > <nl> # include < folly / experimental / pushmi / forwards . h > <nl> <nl> struct property_traits { } ; <nl> template < class T > <nl> struct property_traits < <nl> T , <nl> - std : : enable_if_t < Valid < std : : decay_t < T > , __property_category_t > > > { <nl> + void_t < __property_category_t < std : : decay_t < T > > > > { <nl> using property_category = __property_category_t < std : : decay_t < T > > ; <nl> } ; <nl> <nl> using property_category_t = __property_category_t < property_traits < T > > ; <nl> PUSHMI_CONCEPT_DEF ( <nl> template ( class T ) <nl> concept Property , <nl> - Valid < T , property_category_t > <nl> + True < __property_category_t < property_traits < T > > > <nl> ) ; <nl> <nl> / / in cases where Set contains T , allow T to find itself only once <nl> struct property_set_traits { } ; <nl> template < class T > <nl> struct property_set_traits < <nl> T , <nl> - std : : enable_if_t < Valid < std : : decay_t < T > , __properties_t > > > { <nl> + void_t < __properties_t < std : : decay_t < T > > > > { <nl> using properties = __properties_t < std : : decay_t < T > > ; <nl> } ; <nl> <nl> using properties_t = std : : enable_if_t < <nl> PUSHMI_CONCEPT_DEF ( <nl> template ( class T ) <nl> concept Properties , <nl> - Valid < T , properties_t > <nl> + PropertySet < __properties_t < property_set_traits < T > > > <nl> ) ; <nl> <nl> / / find property in the specified set that matches the category of the property <nl> mmm a / folly / experimental / pushmi / receiver . h <nl> ppp b / folly / experimental / pushmi / receiver . h <nl> class any_receiver { <nl> std : : swap ( that . vptr_ , vptr_ ) ; <nl> } <nl> PUSHMI_TEMPLATE ( class Wrapped ) <nl> - ( requires ReceiveValue < wrapped_t < Wrapped > , VN . . . > & & ReceiveError < <nl> - Wrapped , <nl> - E > ) <nl> + ( requires ReceiveValue < wrapped_t < Wrapped > , VN . . . > & & / / <nl> + ReceiveError < wrapped_t < Wrapped > , E > ) <nl> explicit any_receiver ( Wrapped obj ) noexcept ( insitu < Wrapped > ( ) ) <nl> : any_receiver { std : : move ( obj ) , bool_ < insitu < Wrapped > ( ) > { } } { <nl> check < Wrapped > ( ) ; <nl> mmm a / folly / experimental / pushmi / single_sender . h <nl> ppp b / folly / experimental / pushmi / single_sender . h <nl> class any_single_sender { <nl> template < class T , class U = std : : decay_t < T > > <nl> using wrapped_t = <nl> std : : enable_if_t < ! std : : is_same < U , any_single_sender > : : value , U > ; <nl> - <nl> public : <nl> using properties = property_set < is_sender < > , is_single < > > ; <nl> <nl> class any_single_sender { <nl> std : : swap ( that . vptr_ , vptr_ ) ; <nl> } <nl> <nl> - PUSHMI_TEMPLATE ( class Wrapped ) <nl> - ( requires SenderTo < <nl> - wrapped_t < Wrapped > , <nl> - any_receiver < <nl> - E , <nl> - VN . . . > > ) / / <nl> - explicit any_single_sender ( Wrapped obj ) noexcept ( insitu < Wrapped > ( ) ) <nl> + PUSHMI_TEMPLATE ( class Wrapped ) / / <nl> + ( requires SenderTo < wrapped_t < Wrapped > , any_receiver < E , VN . . . > > ) / / <nl> + explicit any_single_sender ( Wrapped obj ) noexcept ( insitu < Wrapped > ( ) ) <nl> : any_single_sender { std : : move ( obj ) , bool_ < insitu < Wrapped > ( ) > { } } { } <nl> ~ any_single_sender ( ) { <nl> vptr_ - > op_ ( data_ , nullptr ) ; <nl> mmm a / folly / experimental / pushmi / traits . h <nl> ppp b / folly / experimental / pushmi / traits . h <nl> <nl> # include < functional > <nl> # include < type_traits > <nl> <nl> + # include < folly / Traits . h > <nl> # include < folly / experimental / pushmi / detail / functional . h > <nl> <nl> # define PUSHMI_NOEXCEPT_AUTO ( . . . ) \ <nl> PUSHMI_INLINE_VAR constexpr int sum_v = detail : : sum_impl < Is . . . > ( ) ; <nl> template < class . . . > <nl> struct typelist ; <nl> <nl> - template < class . . . > <nl> - using void_t = void ; <nl> - <nl> template < class T > <nl> using remove_cvref_t = std : : remove_cv_t < std : : remove_reference_t < T > > ; <nl> <nl> PUSHMI_CONCEPT_DEF ( <nl> true <nl> ) ; <nl> <nl> - PUSHMI_CONCEPT_DEF ( <nl> - template ( class T , template < class . . . > class C ) <nl> - ( concept Valid ) ( T , C ) , <nl> - True < C < T > > <nl> - ) ; <nl> - <nl> PUSHMI_CONCEPT_DEF ( <nl> template ( class T , template < class . . . > class Trait , class . . . Args ) <nl> ( concept Satisfies ) ( T , Trait , Args . . . ) , <nl>
get folly / experimental / pushmi building with gcc - 5 again
facebook/folly
de4ce8995666025131feb40123bcb0f9a1e7ade7
2019-02-08T00:58:46Z
mmm a / src / builtins / mips / builtins - mips . cc <nl> ppp b / src / builtins / mips / builtins - mips . cc <nl> void Generate_JSConstructStubHelper ( MacroAssembler * masm , bool is_api_function , <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> <nl> __ Pop ( a1 ) ; <nl> - __ Push ( a0 , a0 ) ; <nl> + __ Push ( v0 , v0 ) ; <nl> <nl> / / Retrieve smi - tagged arguments count from the stack . <nl> __ lw ( a0 , MemOperand ( fp , ConstructFrameConstants : : kLengthOffset ) ) ; <nl> mmm a / src / builtins / mips64 / builtins - mips64 . cc <nl> ppp b / src / builtins / mips64 / builtins - mips64 . cc <nl> void Generate_JSConstructStubHelper ( MacroAssembler * masm , bool is_api_function , <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> <nl> __ Pop ( a1 ) ; <nl> - __ Push ( a0 , a0 ) ; <nl> + __ Push ( v0 , v0 ) ; <nl> <nl> / / Retrieve smi - tagged arguments count from the stack . <nl> __ Ld ( a0 , MemOperand ( fp , ConstructFrameConstants : : kLengthOffset ) ) ; <nl>
MIPS [ 64 ] : Fix ` [ turbofan ] Correct lazy deopt { JSCreate } operation . `
v8/v8
24782a47c07455e39abb81ba04d72670bbc12f9c
2017-04-20T14:45:44Z
mmm a / src / searchengine / searchengine . cpp <nl> ppp b / src / searchengine / searchengine . cpp <nl> void SearchEngine : : tab_changed ( int t ) <nl> { / / when we switch from a tab that is not empty to another that is empty the download button <nl> / / doesn ' t have to be available <nl> if ( t > - 1 ) { / / - 1 = no more tab <nl> - if ( all_tab . at ( tabWidget - > currentIndex ( ) ) - > getCurrentSearchListModel ( ) - > rowCount ( ) ) { <nl> + currentSearchTab = all_tab . at ( tabWidget - > currentIndex ( ) ) ; <nl> + if ( currentSearchTab - > getCurrentSearchListModel ( ) - > rowCount ( ) ) { <nl> download_button - > setEnabled ( true ) ; <nl> goToDescBtn - > setEnabled ( true ) ; <nl> } <nl> void SearchEngine : : tab_changed ( int t ) <nl> download_button - > setEnabled ( false ) ; <nl> goToDescBtn - > setEnabled ( false ) ; <nl> } <nl> + search_status - > setText ( currentSearchTab - > status ) ; <nl> } <nl> } <nl> <nl> void SearchEngine : : on_search_button_clicked ( ) { <nl> search_button - > setText ( tr ( " Search " ) ) ; <nl> return ; <nl> } <nl> + allTabsSetActiveState ( false ) ; <nl> } <nl> searchProcess - > waitForFinished ( ) ; <nl> / / Reload environment variables ( proxy ) <nl> void SearchEngine : : on_search_button_clicked ( ) { <nl> } <nl> / / Tab Addition <nl> currentSearchTab = new SearchTab ( this ) ; <nl> + activeSearchTab = currentSearchTab ; <nl> connect ( currentSearchTab - > header ( ) , SIGNAL ( sectionResized ( int , int , int ) ) , this , SLOT ( saveResultsColumnsWidth ( ) ) ) ; <nl> all_tab . append ( currentSearchTab ) ; <nl> QString tabName = pattern ; <nl> void SearchEngine : : downloadTorrent ( QString engine_url , QString torrent_url ) { <nl> <nl> void SearchEngine : : searchStarted ( ) { <nl> / / Update SearchEngine widgets <nl> - search_status - > setText ( tr ( " Searching . . . " ) ) ; <nl> + activeSearchTab - > status = tr ( " Searching . . . " ) ; <nl> + search_status - > setText ( activeSearchTab - > status ) ; <nl> search_status - > repaint ( ) ; <nl> search_button - > setText ( tr ( " Stop " ) ) ; <nl> } <nl> void SearchEngine : : readSearchOutput ( ) { <nl> foreach ( const QByteArray & line , lines_list ) { <nl> appendSearchResult ( QString : : fromUtf8 ( line ) ) ; <nl> } <nl> - if ( currentSearchTab ) <nl> - currentSearchTab - > getCurrentLabel ( ) - > setText ( tr ( " Results " ) + QString : : fromUtf8 ( " < i > ( " ) + QString : : number ( nb_search_results ) + QString : : fromUtf8 ( " ) < / i > : " ) ) ; <nl> + if ( activeSearchTab ) <nl> + activeSearchTab - > getCurrentLabel ( ) - > setText ( tr ( " Results " ) + QString : : fromUtf8 ( " < i > ( " ) + QString : : number ( nb_search_results ) + QString : : fromUtf8 ( " ) < / i > : " ) ) ; <nl> } <nl> <nl> void SearchEngine : : downloadFinished ( int exitcode , QProcess : : ExitStatus ) { <nl> void SearchEngine : : updateNova ( ) { <nl> / / Slot called when search is Finished <nl> / / Search can be finished for 3 reasons : <nl> / / Error | Stopped by user | Finished normally <nl> - void SearchEngine : : searchFinished ( int exitcode , QProcess : : ExitStatus ) { <nl> + void SearchEngine : : searchFinished ( int exitcode , QProcess : : ExitStatus ) { <nl> if ( searchTimeout - > isActive ( ) ) { <nl> searchTimeout - > stop ( ) ; <nl> } <nl> void SearchEngine : : searchFinished ( int exitcode , QProcess : : ExitStatus ) { <nl> } <nl> if ( exitcode ) { <nl> # ifdef Q_OS_WIN <nl> - search_status - > setText ( tr ( " Search aborted " ) ) ; <nl> + activeSearchTab - > status = tr ( " Search aborted " ) ; <nl> # else <nl> - search_status - > setText ( tr ( " An error occurred during search . . . " ) ) ; <nl> + activeSearchTab - > status = tr ( " An error occurred during search . . . " ) ; <nl> # endif <nl> - } else { <nl> + } else { <nl> if ( search_stopped ) { <nl> - search_status - > setText ( tr ( " Search aborted " ) ) ; <nl> - } else { <nl> + activeSearchTab - > status = tr ( " Search aborted " ) ; <nl> + } else { <nl> if ( no_search_results ) { <nl> - search_status - > setText ( tr ( " Search returned no results " ) ) ; <nl> - } else { <nl> - search_status - > setText ( tr ( " Search has finished " ) ) ; <nl> + activeSearchTab - > status = tr ( " Search returned no results " ) ; <nl> + } else { <nl> + activeSearchTab - > status = tr ( " Search has finished " ) ; <nl> } <nl> } <nl> } <nl> <nl> - if ( currentSearchTab ) <nl> - currentSearchTab - > getCurrentLabel ( ) - > setText ( tr ( " Results " , " i . e : Search results " ) + QString : : fromUtf8 ( " < i > ( " ) + QString : : number ( nb_search_results ) + QString : : fromUtf8 ( " ) < / i > : " ) ) ; <nl> + if ( activeSearchTab ) <nl> + if ( currentSearchTab = = activeSearchTab ) search_status - > setText ( activeSearchTab - > status ) ; <nl> + activeSearchTab - > getCurrentLabel ( ) - > setText ( tr ( " Results " , " i . e : Search results " ) + QString : : fromUtf8 ( " < i > ( " ) + QString : : number ( nb_search_results ) + QString : : fromUtf8 ( " ) < / i > : " ) ) ; <nl> + activeSearchTab - > isActive = false ; <nl> + activeSearchTab = 0 ; <nl> + <nl> search_button - > setText ( tr ( " Search " ) ) ; <nl> } <nl> <nl> void SearchEngine : : searchFinished ( int exitcode , QProcess : : ExitStatus ) { <nl> / / Line is in the following form : <nl> / / file url | file name | file size | nb seeds | nb leechers | Search engine url <nl> void SearchEngine : : appendSearchResult ( const QString & line ) { <nl> - if ( ! currentSearchTab ) { <nl> + if ( ! activeSearchTab ) { <nl> if ( searchProcess - > state ( ) ! = QProcess : : NotRunning ) { <nl> searchProcess - > terminate ( ) ; <nl> } <nl> void SearchEngine : : appendSearchResult ( const QString & line ) { <nl> if ( nb_fields < NB_PLUGIN_COLUMNS - 1 ) { / / - 1 because desc_link is optional <nl> return ; <nl> } <nl> - Q_ASSERT ( currentSearchTab ) ; <nl> + Q_ASSERT ( activeSearchTab ) ; <nl> / / Add item to search result list <nl> - QStandardItemModel * cur_model = currentSearchTab - > getCurrentSearchListModel ( ) ; <nl> + QStandardItemModel * cur_model = activeSearchTab - > getCurrentSearchListModel ( ) ; <nl> Q_ASSERT ( cur_model ) ; <nl> int row = cur_model - > rowCount ( ) ; <nl> cur_model - > insertRow ( row ) ; <nl> void SearchEngine : : appendSearchResult ( const QString & line ) { <nl> } <nl> <nl> void SearchEngine : : closeTab ( int index ) { <nl> - if ( index = = tabWidget - > indexOf ( currentSearchTab ) ) { <nl> - qDebug ( " Deleted current search Tab " ) ; <nl> + / / Search is run for active tab so if user decided to close it , then stop search <nl> + if ( activeSearchTab & & index = = tabWidget - > indexOf ( activeSearchTab ) ) { <nl> + qDebug ( " Closed active search Tab " ) ; <nl> if ( searchProcess - > state ( ) ! = QProcess : : NotRunning ) { <nl> searchProcess - > terminate ( ) ; <nl> } <nl> void SearchEngine : : closeTab ( int index ) { <nl> searchTimeout - > stop ( ) ; <nl> } <nl> search_stopped = true ; <nl> - currentSearchTab = 0 ; <nl> + if ( currentSearchTab = = activeSearchTab ) currentSearchTab = 0 ; <nl> + activeSearchTab = 0 ; <nl> } <nl> delete all_tab . takeAt ( index ) ; <nl> if ( ! all_tab . size ( ) ) { <nl> void SearchEngine : : on_goToDescBtn_clicked ( ) <nl> } <nl> } <nl> } <nl> + <nl> + inline void SearchEngine : : allTabsSetActiveState ( bool newState ) <nl> + { <nl> + foreach ( SearchTab * tab , all_tab ) { <nl> + tab - > isActive = newState ; <nl> + } <nl> + } <nl> mmm a / src / searchengine / searchengine . h <nl> ppp b / src / searchengine / searchengine . h <nl> private slots : <nl> unsigned long nb_search_results ; <nl> SupportedEngines * supported_engines ; <nl> QTimer * searchTimeout ; <nl> - QPointer < SearchTab > currentSearchTab ; <nl> + QPointer < SearchTab > currentSearchTab ; / / Selected tab <nl> + QPointer < SearchTab > activeSearchTab ; / / Tab with running search <nl> QList < QPointer < SearchTab > > all_tab ; / / To store all tabs <nl> const SearchCategories full_cat_names ; <nl> MainWindow * mp_mainWindow ; <nl> + inline void allTabsSetActiveState ( bool ) ; <nl> } ; <nl> <nl> # endif <nl> mmm a / src / searchengine / searchtab . cpp <nl> ppp b / src / searchengine / searchtab . cpp <nl> SearchTab : : SearchTab ( SearchEngine * parent ) : QWidget ( ) , parent ( parent ) <nl> resultsBrowser - > setSelectionMode ( QAbstractItemView : : ExtendedSelection ) ; <nl> box - > addWidget ( results_lbl ) ; <nl> box - > addWidget ( resultsBrowser ) ; <nl> + / / New tab is created with new search <nl> + isActive = true ; <nl> <nl> setLayout ( box ) ; <nl> / / Set Search results list model <nl> mmm a / src / searchengine / searchtab . h <nl> ppp b / src / searchengine / searchtab . h <nl> protected slots : <nl> QTreeView * getCurrentTreeView ( ) ; <nl> void setRowColor ( int row , QString color ) ; <nl> QHeaderView * header ( ) const ; <nl> + bool isActive ; <nl> + QString status ; <nl> } ; <nl> <nl> # endif <nl>
Search status uses tab ' s status
qbittorrent/qBittorrent
e2aa8056af9905d4f6e8099da022b1f5c4e39cc0
2015-07-14T06:03:27Z
mmm a / tensorflow / python / keras / layers / preprocessing / image_preprocessing . py <nl> ppp b / tensorflow / python / keras / layers / preprocessing / image_preprocessing . py <nl> def __init__ ( self , height , width , seed = None , name = None , * * kwargs ) : <nl> self . input_spec = InputSpec ( ndim = 4 ) <nl> super ( RandomCrop , self ) . __init__ ( name = name , * * kwargs ) <nl> <nl> - def call ( self , inputs , training = None ) : <nl> + def call ( self , inputs , training = True ) : <nl> if training is None : <nl> training = K . learning_phase ( ) <nl> <nl> def __init__ ( self , <nl> self . _rng = make_generator ( self . seed ) <nl> self . input_spec = InputSpec ( ndim = 4 ) <nl> <nl> - def call ( self , inputs , training = None ) : <nl> + def call ( self , inputs , training = True ) : <nl> if training is None : <nl> training = K . learning_phase ( ) <nl> <nl> def __init__ ( self , <nl> self . input_spec = InputSpec ( ndim = 4 ) <nl> super ( RandomTranslation , self ) . __init__ ( name = name , * * kwargs ) <nl> <nl> - def call ( self , inputs , training = None ) : <nl> + def call ( self , inputs , training = True ) : <nl> if training is None : <nl> training = K . learning_phase ( ) <nl> <nl> def __init__ ( self , <nl> self . input_spec = InputSpec ( ndim = 4 ) <nl> super ( RandomRotation , self ) . __init__ ( name = name , * * kwargs ) <nl> <nl> - def call ( self , inputs , training = None ) : <nl> + def call ( self , inputs , training = True ) : <nl> if training is None : <nl> training = K . learning_phase ( ) <nl> <nl> def __init__ ( self , <nl> self . input_spec = InputSpec ( ndim = 4 ) <nl> super ( RandomZoom , self ) . __init__ ( name = name , * * kwargs ) <nl> <nl> - def call ( self , inputs , training = None ) : <nl> + def call ( self , inputs , training = True ) : <nl> if training is None : <nl> training = K . learning_phase ( ) <nl> <nl> def __init__ ( self , factor , seed = None , name = None , * * kwargs ) : <nl> self . input_spec = InputSpec ( ndim = 4 ) <nl> super ( RandomContrast , self ) . __init__ ( name = name , * * kwargs ) <nl> <nl> - def call ( self , inputs , training = None ) : <nl> + def call ( self , inputs , training = True ) : <nl> if training is None : <nl> training = K . learning_phase ( ) <nl> <nl> def __init__ ( self , <nl> self . _rng = make_generator ( self . seed ) <nl> super ( RandomHeight , self ) . __init__ ( name = name , * * kwargs ) <nl> <nl> - def call ( self , inputs , training = None ) : <nl> + def call ( self , inputs , training = True ) : <nl> if training is None : <nl> training = K . learning_phase ( ) <nl> <nl> def __init__ ( self , <nl> self . _rng = make_generator ( self . seed ) <nl> super ( RandomWidth , self ) . __init__ ( name = name , * * kwargs ) <nl> <nl> - def call ( self , inputs , training = None ) : <nl> + def call ( self , inputs , training = True ) : <nl> if training is None : <nl> training = K . learning_phase ( ) <nl> <nl> mmm a / tensorflow / tools / api / golden / v1 / tensorflow . keras . layers . experimental . preprocessing . - random - contrast . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v1 / tensorflow . keras . layers . experimental . preprocessing . - random - contrast . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " call " <nl> - argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' True \ ' ] , " <nl> } <nl> member_method { <nl> name : " compute_mask " <nl> mmm a / tensorflow / tools / api / golden / v1 / tensorflow . keras . layers . experimental . preprocessing . - random - crop . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v1 / tensorflow . keras . layers . experimental . preprocessing . - random - crop . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " call " <nl> - argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' True \ ' ] , " <nl> } <nl> member_method { <nl> name : " compute_mask " <nl> mmm a / tensorflow / tools / api / golden / v1 / tensorflow . keras . layers . experimental . preprocessing . - random - flip . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v1 / tensorflow . keras . layers . experimental . preprocessing . - random - flip . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " call " <nl> - argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' True \ ' ] , " <nl> } <nl> member_method { <nl> name : " compute_mask " <nl> mmm a / tensorflow / tools / api / golden / v1 / tensorflow . keras . layers . experimental . preprocessing . - random - height . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v1 / tensorflow . keras . layers . experimental . preprocessing . - random - height . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " call " <nl> - argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' True \ ' ] , " <nl> } <nl> member_method { <nl> name : " compute_mask " <nl> mmm a / tensorflow / tools / api / golden / v1 / tensorflow . keras . layers . experimental . preprocessing . - random - rotation . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v1 / tensorflow . keras . layers . experimental . preprocessing . - random - rotation . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " call " <nl> - argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' True \ ' ] , " <nl> } <nl> member_method { <nl> name : " compute_mask " <nl> mmm a / tensorflow / tools / api / golden / v1 / tensorflow . keras . layers . experimental . preprocessing . - random - translation . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v1 / tensorflow . keras . layers . experimental . preprocessing . - random - translation . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " call " <nl> - argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' True \ ' ] , " <nl> } <nl> member_method { <nl> name : " compute_mask " <nl> mmm a / tensorflow / tools / api / golden / v1 / tensorflow . keras . layers . experimental . preprocessing . - random - width . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v1 / tensorflow . keras . layers . experimental . preprocessing . - random - width . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " call " <nl> - argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' True \ ' ] , " <nl> } <nl> member_method { <nl> name : " compute_mask " <nl> mmm a / tensorflow / tools / api / golden / v2 / tensorflow . keras . layers . experimental . preprocessing . - random - contrast . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v2 / tensorflow . keras . layers . experimental . preprocessing . - random - contrast . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " call " <nl> - argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' True \ ' ] , " <nl> } <nl> member_method { <nl> name : " compute_mask " <nl> mmm a / tensorflow / tools / api / golden / v2 / tensorflow . keras . layers . experimental . preprocessing . - random - crop . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v2 / tensorflow . keras . layers . experimental . preprocessing . - random - crop . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " call " <nl> - argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' True \ ' ] , " <nl> } <nl> member_method { <nl> name : " compute_mask " <nl> mmm a / tensorflow / tools / api / golden / v2 / tensorflow . keras . layers . experimental . preprocessing . - random - flip . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v2 / tensorflow . keras . layers . experimental . preprocessing . - random - flip . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " call " <nl> - argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' True \ ' ] , " <nl> } <nl> member_method { <nl> name : " compute_mask " <nl> mmm a / tensorflow / tools / api / golden / v2 / tensorflow . keras . layers . experimental . preprocessing . - random - height . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v2 / tensorflow . keras . layers . experimental . preprocessing . - random - height . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " call " <nl> - argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' True \ ' ] , " <nl> } <nl> member_method { <nl> name : " compute_mask " <nl> mmm a / tensorflow / tools / api / golden / v2 / tensorflow . keras . layers . experimental . preprocessing . - random - rotation . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v2 / tensorflow . keras . layers . experimental . preprocessing . - random - rotation . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " call " <nl> - argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' True \ ' ] , " <nl> } <nl> member_method { <nl> name : " compute_mask " <nl> mmm a / tensorflow / tools / api / golden / v2 / tensorflow . keras . layers . experimental . preprocessing . - random - translation . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v2 / tensorflow . keras . layers . experimental . preprocessing . - random - translation . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " call " <nl> - argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' True \ ' ] , " <nl> } <nl> member_method { <nl> name : " compute_mask " <nl> mmm a / tensorflow / tools / api / golden / v2 / tensorflow . keras . layers . experimental . preprocessing . - random - width . pbtxt <nl> ppp b / tensorflow / tools / api / golden / v2 / tensorflow . keras . layers . experimental . preprocessing . - random - width . pbtxt <nl> tf_class { <nl> } <nl> member_method { <nl> name : " call " <nl> - argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' None \ ' ] , " <nl> + argspec : " args = [ \ ' self \ ' , \ ' inputs \ ' , \ ' training \ ' ] , varargs = None , keywords = None , defaults = [ \ ' True \ ' ] , " <nl> } <nl> member_method { <nl> name : " compute_mask " <nl>
For most layers , inference mode is a good default . For data augmentation
tensorflow/tensorflow
b592f87bd87e3f87bfe6bac346b524997b0a6040
2020-04-20T20:49:10Z
mmm a / modules / prediction / evaluator / vehicle / BUILD <nl> ppp b / modules / prediction / evaluator / vehicle / BUILD <nl> cc_library ( <nl> } ) , <nl> ) <nl> <nl> + cc_library ( <nl> + name = " semantic_lstm_evaluator " , <nl> + srcs = [ <nl> + " semantic_lstm_evaluator . cc " , <nl> + ] , <nl> + hdrs = [ <nl> + " semantic_lstm_evaluator . h " , <nl> + ] , <nl> + copts = [ <nl> + " - DMODULE_NAME = \ \ \ " prediction \ \ \ " " , <nl> + ] , <nl> + deps = [ <nl> + " / / modules / prediction / common : prediction_util " , <nl> + " / / modules / prediction / common : semantic_map " , <nl> + " / / modules / prediction / evaluator " , <nl> + ] + select ( { <nl> + " / / tools / platforms : use_gpu " : [ <nl> + " @ pytorch_gpu " , <nl> + ] , <nl> + " / / conditions : default " : [ <nl> + " @ pytorch " , <nl> + ] , <nl> + } ) , <nl> + ) <nl> + <nl> cpplint ( ) <nl> new file mode 100644 <nl> index 00000000000 . . 95c66c985a8 <nl> mmm / dev / null <nl> ppp b / modules / prediction / evaluator / vehicle / semantic_lstm_evaluator . cc <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> + * Copyright 2019 The Apollo 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> + <nl> + # include " modules / prediction / evaluator / vehicle / semantic_lstm_evaluator . h " <nl> + <nl> + # include < omp . h > <nl> + # include < unordered_map > <nl> + # include < utility > <nl> + <nl> + # include " cyber / common / file . h " <nl> + # include " modules / prediction / common / prediction_gflags . h " <nl> + # include " modules / prediction / common / prediction_map . h " <nl> + # include " modules / prediction / common / prediction_system_gflags . h " <nl> + # include " modules / prediction / common / prediction_util . h " <nl> + # include " modules / prediction / common / semantic_map . h " <nl> + <nl> + namespace apollo { <nl> + namespace prediction { <nl> + <nl> + SemanticLSTMEvaluator : : SemanticLSTMEvaluator ( ) : device_ ( torch : : kCPU ) { <nl> + evaluator_type_ = ObstacleConf : : SEMANTIC_LSTM_EVALUATOR ; <nl> + LoadModel ( ) ; <nl> + } <nl> + <nl> + void SemanticLSTMEvaluator : : Clear ( ) { } <nl> + <nl> + bool SemanticLSTMEvaluator : : Evaluate ( Obstacle * obstacle_ptr ) { return true ; } <nl> + <nl> + bool SemanticLSTMEvaluator : : ExtractFeatureValues ( <nl> + Obstacle * obstacle_ptr , std : : vector < double > * feature_values ) { <nl> + return true ; <nl> + } <nl> + <nl> + void SemanticLSTMEvaluator : : LoadModel ( ) { <nl> + if ( FLAGS_use_cuda & & torch : : cuda : : is_available ( ) ) { <nl> + ADEBUG < < " CUDA is available " ; <nl> + device_ = torch : : Device ( torch : : kCUDA ) ; <nl> + } <nl> + torch : : set_num_threads ( 1 ) ; <nl> + / / TODO ( Hongyi ) : change model file name and gflag <nl> + torch_model_ = <nl> + torch : : jit : : load ( FLAGS_torch_vehicle_junction_map_file , device_ ) ; <nl> + } <nl> + <nl> + } / / namespace prediction <nl> + } / / namespace apollo <nl> new file mode 100644 <nl> index 00000000000 . . ecaba19628f <nl> mmm / dev / null <nl> ppp b / modules / prediction / evaluator / vehicle / semantic_lstm_evaluator . h <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> + * Copyright 2019 The Apollo 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> + <nl> + # pragma once <nl> + <nl> + # include < memory > <nl> + # include < string > <nl> + # include < vector > <nl> + <nl> + # include " torch / extension . h " <nl> + # include " torch / script . h " <nl> + <nl> + # include " modules / prediction / evaluator / evaluator . h " <nl> + <nl> + namespace apollo { <nl> + namespace prediction { <nl> + <nl> + class SemanticLSTMEvaluator : public Evaluator { <nl> + public : <nl> + / * * <nl> + * @ brief Constructor <nl> + * / <nl> + SemanticLSTMEvaluator ( ) ; <nl> + <nl> + / * * <nl> + * @ brief Destructor <nl> + * / <nl> + virtual ~ SemanticLSTMEvaluator ( ) = default ; <nl> + <nl> + / * * <nl> + * @ brief Clear obstacle feature map <nl> + * / <nl> + void Clear ( ) ; <nl> + <nl> + / * * <nl> + * @ brief Override Evaluate <nl> + * @ param Obstacle pointer <nl> + * / <nl> + bool Evaluate ( Obstacle * obstacle_ptr ) override ; <nl> + <nl> + / * * <nl> + * @ brief Extract feature vector <nl> + * @ param Obstacle pointer <nl> + * Feature container in a vector for receiving the feature values <nl> + * / <nl> + bool ExtractFeatureValues ( Obstacle * obstacle_ptr , <nl> + std : : vector < double > * feature_values ) ; <nl> + <nl> + / * * <nl> + * @ brief Get the name of evaluator . <nl> + * / <nl> + std : : string GetName ( ) override { return " SEMANTIC_LSTM_EVALUATOR " ; } <nl> + <nl> + private : <nl> + / * * <nl> + * @ brief Load model file <nl> + * / <nl> + void LoadModel ( ) ; <nl> + <nl> + private : <nl> + static const size_t OBSTACLE_FEATURE_SIZE = 20 * 2 ; <nl> + torch : : jit : : script : : Module torch_model_ ; <nl> + torch : : Device device_ ; <nl> + } ; <nl> + <nl> + } / / namespace prediction <nl> + } / / namespace apollo <nl> mmm a / modules / prediction / proto / prediction_conf . proto <nl> ppp b / modules / prediction / proto / prediction_conf . proto <nl> message ObstacleConf { <nl> PEDESTRIAN_INTERACTION_EVALUATOR = 7 ; <nl> JUNCTION_MAP_EVALUATOR = 8 ; <nl> LANE_AGGREGATING_EVALUATOR = 9 ; <nl> + SEMANTIC_LSTM_EVALUATOR = 10 ; <nl> } <nl> <nl> enum PredictorType { <nl>
Prediction : add semantic_lstm_evaluator
ApolloAuto/apollo
b3df1919867754a2c990c2d353ade67a3ce265ef
2019-10-05T00:24:19Z
mmm a / xbmc / utils / Builtins . cpp <nl> ppp b / xbmc / utils / Builtins . cpp <nl> int CBuiltins : : Execute ( const CStdString & execString ) <nl> CGUIWindowAddonBrowser : : SelectAddonID ( type , addonID , false ) ) <nl> { <nl> CAddonMgr : : Get ( ) . SetDefault ( type , addonID ) ; <nl> + if ( type = = ADDON_VIZ ) <nl> + g_windowManager . SendMessage ( GUI_MSG_VISUALISATION_RELOAD , 0 , 0 ) ; <nl> } <nl> } <nl> else if ( execute . Equals ( " toggledpms " ) ) <nl>
fixed : Ensure the vis is reloaded after addon . default . set
xbmc/xbmc
84a4d659748e6c30a68a50fae32ed2b18df64237
2010-06-22T00:03:45Z
mmm a / Code / CryEngine / CryAudioSystem / implementations / CryAudioImplWwise / ATLEntities . cpp <nl> ppp b / Code / CryEngine / CryAudioSystem / implementations / CryAudioImplWwise / ATLEntities . cpp <nl> ERequestStatus CObject : : SetParameter ( IParameter const * const pIParameter , float <nl> ERequestStatus CObject : : SetSwitchState ( ISwitchState const * const pISwitchState ) <nl> { <nl> ERequestStatus result = ERequestStatus : : Failure ; <nl> - <nl> SSwitchState const * const pSwitchState = static_cast < SSwitchState const * const > ( pISwitchState ) ; <nl> <nl> if ( pSwitchState ! = nullptr ) <nl> ERequestStatus CObject : : SetObstructionOcclusion ( float const obstruction , float c <nl> { <nl> ERequestStatus result = ERequestStatus : : Failure ; <nl> <nl> - if ( g_listenerID ! = AK_INVALID_GAME_OBJECT ) <nl> + if ( g_listenerId ! = AK_INVALID_GAME_OBJECT ) <nl> { <nl> AKRESULT const wwiseResult = AK : : SoundEngine : : SetObjectObstructionAndOcclusion ( <nl> m_id , <nl> - g_listenerID , / / only set the obstruction / occlusion for the default listener for now <nl> - static_cast < AkReal32 > ( occlusion ) , / / Currently used on obstruction until the ATL produces a correct obstruction value . <nl> + g_listenerId , / / Set obstruction / occlusion for only the default listener for now . <nl> + static_cast < AkReal32 > ( occlusion ) , / / The occlusion value is currently used on obstruction as well until a correct obstruction value is calculated . <nl> static_cast < AkReal32 > ( occlusion ) ) ; <nl> <nl> if ( IS_WWISE_OK ( wwiseResult ) ) <nl> ERequestStatus CObject : : ExecuteTrigger ( ITrigger const * const pITrigger , IEvent * <nl> <nl> if ( ( pTrigger ! = nullptr ) & & ( pEvent ! = nullptr ) ) <nl> { <nl> - PostEnvironmentAmounts ( ) ; <nl> - AkPlayingID const id = AK : : SoundEngine : : PostEvent ( pTrigger - > m_id , m_id , AK_EndOfEvent , & EndEventCallback , pEvent ) ; <nl> + / / If the user executes a trigger on the global object we want to post events only to that particular object and not globally ! <nl> + AkGameObjectID objectId = s_globalObjectId ; <nl> + <nl> + if ( m_id ! = AK_INVALID_GAME_OBJECT ) <nl> + { <nl> + objectId = m_id ; <nl> + PostEnvironmentAmounts ( ) ; <nl> + } <nl> + <nl> + AkPlayingID const id = AK : : SoundEngine : : PostEvent ( pTrigger - > m_id , objectId , AK_EndOfEvent , & EndEventCallback , pEvent ) ; <nl> <nl> if ( id ! = AK_INVALID_PLAYING_ID ) <nl> { <nl> ERequestStatus CObject : : ExecuteTrigger ( ITrigger const * const pITrigger , IEvent * <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> ERequestStatus CObject : : StopAllTriggers ( ) <nl> { <nl> - AK : : SoundEngine : : StopAll ( m_id ) ; <nl> + / / If the user wants to stop all triggers on the global object we want to stop them only on that particular object and not globally ! <nl> + AkGameObjectID const objectId = ( m_id ! = AK_INVALID_GAME_OBJECT ) ? m_id : s_globalObjectId ; <nl> + AK : : SoundEngine : : StopAll ( objectId ) ; <nl> return ERequestStatus : : Success ; <nl> } <nl> <nl> ERequestStatus CObject : : PostEnvironmentAmounts ( ) <nl> AkAuxSendValue & auxValue = auxValues [ auxIndex ] ; <nl> auxValue . auxBusID = iEnvPair - > first ; <nl> auxValue . fControlValue = amount ; <nl> - auxValue . listenerID = g_listenerID ; <nl> + auxValue . listenerID = g_listenerId ; <nl> <nl> / / If an amount is zero , we still want to send it to the middleware , but we also want to remove it from the map . <nl> if ( amount = = 0 . 0f ) <nl> ERequestStatus CObject : : PostEnvironmentAmounts ( ) <nl> AkAuxSendValue & auxValue = auxValues [ auxIndex ] ; <nl> auxValue . auxBusID = iSortedEnvPair - > first ; <nl> auxValue . fControlValue = iSortedEnvPair - > second ; <nl> - auxValue . listenerID = g_listenerID ; <nl> + auxValue . listenerID = g_listenerId ; <nl> } <nl> <nl> / / remove all Environments with 0 . 0 amounts <nl> mmm a / Code / CryEngine / CryAudioSystem / implementations / CryAudioImplWwise / ATLEntities . h <nl> ppp b / Code / CryEngine / CryAudioSystem / implementations / CryAudioImplWwise / ATLEntities . h <nl> namespace Impl <nl> { <nl> namespace Wwise <nl> { <nl> - / / To be removed once multi - listener support is implemented . <nl> - static AkGameObjectID g_listenerID = AK_INVALID_GAME_OBJECT ; <nl> + static AkGameObjectID g_listenerId = AK_INVALID_GAME_OBJECT ; / / To be removed once multi - listener support is implemented . <nl> + static AkGameObjectID s_globalObjectId = AK_INVALID_GAME_OBJECT ; <nl> <nl> class CObject final : public IObject , public CPoolObject < CObject , stl : : PSyncNone > <nl> { <nl> mmm a / Code / CryEngine / CryAudioSystem / implementations / CryAudioImplWwise / AudioImpl . cpp <nl> ppp b / Code / CryEngine / CryAudioSystem / implementations / CryAudioImplWwise / AudioImpl . cpp <nl> char const * const CImpl : : GetFileLocation ( SFileInfo * const pFileInfo ) <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> IObject * CImpl : : ConstructGlobalObject ( ) <nl> { <nl> + s_globalObjectId = m_gameObjectId + + ; <nl> + <nl> # if defined ( INCLUDE_WWISE_IMPL_PRODUCTION_CODE ) <nl> - AKRESULT const wwiseResult = AK : : SoundEngine : : RegisterGameObj ( m_gameObjectId , " GlobalObject " ) ; <nl> + AKRESULT const wwiseResult = AK : : SoundEngine : : RegisterGameObj ( s_globalObjectId , " GlobalObject " ) ; <nl> <nl> if ( ! IS_WWISE_OK ( wwiseResult ) ) <nl> { <nl> g_implLogger . Log ( ELogType : : Warning , " Wwise ConstructGlobalObject failed with AKRESULT : % d " , wwiseResult ) ; <nl> } <nl> # else <nl> - AK : : SoundEngine : : RegisterGameObj ( m_gameObjectId ) ; <nl> + AK : : SoundEngine : : RegisterGameObj ( s_globalObjectId ) ; <nl> # endif / / INCLUDE_WWISE_IMPL_PRODUCTION_CODE <nl> <nl> - return static_cast < IObject * > ( new CObject ( m_gameObjectId + + ) ) ; <nl> + return static_cast < IObject * > ( new CObject ( AK_INVALID_GAME_OBJECT ) ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> IListener * CImpl : : ConstructListener ( char const * const szName / * = nullptr * / ) <nl> pIListener = static_cast < IListener * > ( new CListener ( m_gameObjectId ) ) ; <nl> # endif / / INCLUDE_WWISE_IMPL_PRODUCTION_CODE <nl> <nl> - g_listenerID = m_gameObjectId + + ; <nl> + g_listenerId = m_gameObjectId + + ; <nl> <nl> return pIListener ; <nl> } <nl>
! B ( Audio ) ( CE - 8978 ) global changes weren ' t applied in Wwise 2017 . 1 . 0
CRYTEK/CRYENGINE
acf8f5e2ddcd4914b4c11ce3d9c04dda102344db
2017-08-14T09:19:47Z
mmm a / src / bench / bench_bitcoin . cpp <nl> ppp b / src / bench / bench_bitcoin . cpp <nl> static void SetupBenchArgs ( ) <nl> { <nl> SetupHelpOptions ( gArgs ) ; <nl> <nl> - gArgs . AddArg ( " - list " , " List benchmarks without executing them . Can be combined with - scaling and - filter " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - evals = < n > " , strprintf ( " Number of measurement evaluations to perform . ( default : % u ) " , DEFAULT_BENCH_EVALUATIONS ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - filter = < regex > " , strprintf ( " Regular expression filter to select benchmark by name ( default : % s ) " , DEFAULT_BENCH_FILTER ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - scaling = < n > " , strprintf ( " Scaling factor for benchmark ' s runtime ( default : % u ) " , DEFAULT_BENCH_SCALING ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - printer = ( console | plot ) " , strprintf ( " Choose printer format . console : print data to console . plot : Print results as HTML graph ( default : % s ) " , DEFAULT_BENCH_PRINTER ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - plot - plotlyurl = < uri > " , strprintf ( " URL to use for plotly . js ( default : % s ) " , DEFAULT_PLOT_PLOTLYURL ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - plot - width = < x > " , strprintf ( " Plot width in pixel ( default : % u ) " , DEFAULT_PLOT_WIDTH ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - plot - height = < x > " , strprintf ( " Plot height in pixel ( default : % u ) " , DEFAULT_PLOT_HEIGHT ) , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - list " , " List benchmarks without executing them . Can be combined with - scaling and - filter " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - evals = < n > " , strprintf ( " Number of measurement evaluations to perform . ( default : % u ) " , DEFAULT_BENCH_EVALUATIONS ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - filter = < regex > " , strprintf ( " Regular expression filter to select benchmark by name ( default : % s ) " , DEFAULT_BENCH_FILTER ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - scaling = < n > " , strprintf ( " Scaling factor for benchmark ' s runtime ( default : % u ) " , DEFAULT_BENCH_SCALING ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - printer = ( console | plot ) " , strprintf ( " Choose printer format . console : print data to console . plot : Print results as HTML graph ( default : % s ) " , DEFAULT_BENCH_PRINTER ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - plot - plotlyurl = < uri > " , strprintf ( " URL to use for plotly . js ( default : % s ) " , DEFAULT_PLOT_PLOTLYURL ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - plot - width = < x > " , strprintf ( " Plot width in pixel ( default : % u ) " , DEFAULT_PLOT_WIDTH ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - plot - height = < x > " , strprintf ( " Plot height in pixel ( default : % u ) " , DEFAULT_PLOT_HEIGHT ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> } <nl> <nl> int main ( int argc , char * * argv ) <nl> mmm a / src / bitcoin - cli . cpp <nl> ppp b / src / bitcoin - cli . cpp <nl> static void SetupCliArgs ( ) <nl> const auto testnetBaseParams = CreateBaseChainParams ( CBaseChainParams : : TESTNET ) ; <nl> const auto regtestBaseParams = CreateBaseChainParams ( CBaseChainParams : : REGTEST ) ; <nl> <nl> - gArgs . AddArg ( " - version " , " Print version and exit " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - conf = < file > " , strprintf ( " Specify configuration file . Relative paths will be prefixed by datadir location . ( default : % s ) " , BITCOIN_CONF_FILENAME ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - datadir = < dir > " , " Specify data directory " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - getinfo " , " Get general information from the remote server . Note that unlike server - side RPC calls , the results of - getinfo is the result of multiple non - atomic requests . Some entries in the result may represent results from different states ( e . g . wallet balance may be as of a different block from the chain state reported ) " , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - version " , " Print version and exit " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - conf = < file > " , strprintf ( " Specify configuration file . Relative paths will be prefixed by datadir location . ( default : % s ) " , BITCOIN_CONF_FILENAME ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - datadir = < dir > " , " Specify data directory " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - getinfo " , " Get general information from the remote server . Note that unlike server - side RPC calls , the results of - getinfo is the result of multiple non - atomic requests . Some entries in the result may represent results from different states ( e . g . wallet balance may be as of a different block from the chain state reported ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> SetupChainParamsBaseOptions ( ) ; <nl> - gArgs . AddArg ( " - named " , strprintf ( " Pass named instead of positional arguments ( default : % s ) " , DEFAULT_NAMED ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - rpcclienttimeout = < n > " , strprintf ( " Timeout in seconds during HTTP requests , or 0 for no timeout . ( default : % d ) " , DEFAULT_HTTP_CLIENT_TIMEOUT ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - rpcconnect = < ip > " , strprintf ( " Send commands to node running on < ip > ( default : % s ) " , DEFAULT_RPCCONNECT ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - rpccookiefile = < loc > " , " Location of the auth cookie . Relative paths will be prefixed by a net - specific datadir location . ( default : data dir ) " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - rpcpassword = < pw > " , " Password for JSON - RPC connections " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - rpcport = < port > " , strprintf ( " Connect to JSON - RPC on < port > ( default : % u , testnet : % u , regtest : % u ) " , defaultBaseParams - > RPCPort ( ) , testnetBaseParams - > RPCPort ( ) , regtestBaseParams - > RPCPort ( ) ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - rpcuser = < user > " , " Username for JSON - RPC connections " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - rpcwait " , " Wait for RPC server to start " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - rpcwallet = < walletname > " , " Send RPC for non - default wallet on RPC server ( needs to exactly match corresponding - wallet option passed to bitcoind ) . This changes the RPC endpoint used , e . g . http : / / 127 . 0 . 0 . 1 : 8332 / wallet / < walletname > " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - stdin " , " Read extra arguments from standard input , one per line until EOF / Ctrl - D ( recommended for sensitive information such as passphrases ) . When combined with - stdinrpcpass , the first line from standard input is used for the RPC password . " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - stdinrpcpass " , " Read RPC password from standard input as a single line . When combined with - stdin , the first line from standard input is used for the RPC password . " , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - named " , strprintf ( " Pass named instead of positional arguments ( default : % s ) " , DEFAULT_NAMED ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - rpcclienttimeout = < n > " , strprintf ( " Timeout in seconds during HTTP requests , or 0 for no timeout . ( default : % d ) " , DEFAULT_HTTP_CLIENT_TIMEOUT ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - rpcconnect = < ip > " , strprintf ( " Send commands to node running on < ip > ( default : % s ) " , DEFAULT_RPCCONNECT ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - rpccookiefile = < loc > " , " Location of the auth cookie . Relative paths will be prefixed by a net - specific datadir location . ( default : data dir ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - rpcpassword = < pw > " , " Password for JSON - RPC connections " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - rpcport = < port > " , strprintf ( " Connect to JSON - RPC on < port > ( default : % u , testnet : % u , regtest : % u ) " , defaultBaseParams - > RPCPort ( ) , testnetBaseParams - > RPCPort ( ) , regtestBaseParams - > RPCPort ( ) ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - rpcuser = < user > " , " Username for JSON - RPC connections " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - rpcwait " , " Wait for RPC server to start " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - rpcwallet = < walletname > " , " Send RPC for non - default wallet on RPC server ( needs to exactly match corresponding - wallet option passed to bitcoind ) . This changes the RPC endpoint used , e . g . http : / / 127 . 0 . 0 . 1 : 8332 / wallet / < walletname > " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - stdin " , " Read extra arguments from standard input , one per line until EOF / Ctrl - D ( recommended for sensitive information such as passphrases ) . When combined with - stdinrpcpass , the first line from standard input is used for the RPC password . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - stdinrpcpass " , " Read RPC password from standard input as a single line . When combined with - stdin , the first line from standard input is used for the RPC password . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> } <nl> <nl> / * * libevent event log callback * / <nl> mmm a / src / bitcoin - tx . cpp <nl> ppp b / src / bitcoin - tx . cpp <nl> static void SetupBitcoinTxArgs ( ) <nl> { <nl> SetupHelpOptions ( gArgs ) ; <nl> <nl> - gArgs . AddArg ( " - create " , " Create new , empty TX . " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - json " , " Select JSON output " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - txid " , " Output only the hex - encoded transaction id of the resultant transaction . " , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - create " , " Create new , empty TX . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - json " , " Select JSON output " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - txid " , " Output only the hex - encoded transaction id of the resultant transaction . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> SetupChainParamsBaseOptions ( ) ; <nl> <nl> - gArgs . AddArg ( " delin = N " , " Delete input N from TX " , false , OptionsCategory : : COMMANDS ) ; <nl> - gArgs . AddArg ( " delout = N " , " Delete output N from TX " , false , OptionsCategory : : COMMANDS ) ; <nl> - gArgs . AddArg ( " in = TXID : VOUT ( : SEQUENCE_NUMBER ) " , " Add input to TX " , false , OptionsCategory : : COMMANDS ) ; <nl> - gArgs . AddArg ( " locktime = N " , " Set TX lock time to N " , false , OptionsCategory : : COMMANDS ) ; <nl> - gArgs . AddArg ( " nversion = N " , " Set TX version to N " , false , OptionsCategory : : COMMANDS ) ; <nl> - gArgs . AddArg ( " outaddr = VALUE : ADDRESS " , " Add address - based output to TX " , false , OptionsCategory : : COMMANDS ) ; <nl> - gArgs . AddArg ( " outdata = [ VALUE : ] DATA " , " Add data - based output to TX " , false , OptionsCategory : : COMMANDS ) ; <nl> + gArgs . AddArg ( " delin = N " , " Delete input N from TX " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : COMMANDS ) ; <nl> + gArgs . AddArg ( " delout = N " , " Delete output N from TX " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : COMMANDS ) ; <nl> + gArgs . AddArg ( " in = TXID : VOUT ( : SEQUENCE_NUMBER ) " , " Add input to TX " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : COMMANDS ) ; <nl> + gArgs . AddArg ( " locktime = N " , " Set TX lock time to N " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : COMMANDS ) ; <nl> + gArgs . AddArg ( " nversion = N " , " Set TX version to N " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : COMMANDS ) ; <nl> + gArgs . AddArg ( " outaddr = VALUE : ADDRESS " , " Add address - based output to TX " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : COMMANDS ) ; <nl> + gArgs . AddArg ( " outdata = [ VALUE : ] DATA " , " Add data - based output to TX " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : COMMANDS ) ; <nl> gArgs . AddArg ( " outmultisig = VALUE : REQUIRED : PUBKEYS : PUBKEY1 : PUBKEY2 : . . . . [ : FLAGS ] " , " Add Pay To n - of - m Multi - sig output to TX . n = REQUIRED , m = PUBKEYS . " <nl> " Optionally add the \ " W \ " flag to produce a pay - to - witness - script - hash output . " <nl> - " Optionally add the \ " S \ " flag to wrap the output in a pay - to - script - hash . " , false , OptionsCategory : : COMMANDS ) ; <nl> + " Optionally add the \ " S \ " flag to wrap the output in a pay - to - script - hash . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : COMMANDS ) ; <nl> gArgs . AddArg ( " outpubkey = VALUE : PUBKEY [ : FLAGS ] " , " Add pay - to - pubkey output to TX . " <nl> " Optionally add the \ " W \ " flag to produce a pay - to - witness - pubkey - hash output . " <nl> - " Optionally add the \ " S \ " flag to wrap the output in a pay - to - script - hash . " , false , OptionsCategory : : COMMANDS ) ; <nl> + " Optionally add the \ " S \ " flag to wrap the output in a pay - to - script - hash . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : COMMANDS ) ; <nl> gArgs . AddArg ( " outscript = VALUE : SCRIPT [ : FLAGS ] " , " Add raw script output to TX . " <nl> " Optionally add the \ " W \ " flag to produce a pay - to - witness - script - hash output . " <nl> - " Optionally add the \ " S \ " flag to wrap the output in a pay - to - script - hash . " , false , OptionsCategory : : COMMANDS ) ; <nl> - gArgs . AddArg ( " replaceable ( = N ) " , " Set RBF opt - in sequence number for input N ( if not provided , opt - in all available inputs ) " , false , OptionsCategory : : COMMANDS ) ; <nl> + " Optionally add the \ " S \ " flag to wrap the output in a pay - to - script - hash . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : COMMANDS ) ; <nl> + gArgs . AddArg ( " replaceable ( = N ) " , " Set RBF opt - in sequence number for input N ( if not provided , opt - in all available inputs ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : COMMANDS ) ; <nl> gArgs . AddArg ( " sign = SIGHASH - FLAGS " , " Add zero or more signatures to transaction . " <nl> " This command requires JSON registers : " <nl> " prevtxs = JSON object , " <nl> " privatekeys = JSON object . " <nl> - " See signrawtransactionwithkey docs for format of sighash flags , JSON objects . " , false , OptionsCategory : : COMMANDS ) ; <nl> + " See signrawtransactionwithkey docs for format of sighash flags , JSON objects . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : COMMANDS ) ; <nl> <nl> - gArgs . AddArg ( " load = NAME : FILENAME " , " Load JSON file FILENAME into register NAME " , false , OptionsCategory : : REGISTER_COMMANDS ) ; <nl> - gArgs . AddArg ( " set = NAME : JSON - STRING " , " Set register NAME to given JSON - STRING " , false , OptionsCategory : : REGISTER_COMMANDS ) ; <nl> + gArgs . AddArg ( " load = NAME : FILENAME " , " Load JSON file FILENAME into register NAME " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : REGISTER_COMMANDS ) ; <nl> + gArgs . AddArg ( " set = NAME : JSON - STRING " , " Set register NAME to given JSON - STRING " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : REGISTER_COMMANDS ) ; <nl> } <nl> <nl> / / <nl> mmm a / src / bitcoin - wallet . cpp <nl> ppp b / src / bitcoin - wallet . cpp <nl> static void SetupWalletToolArgs ( ) <nl> SetupHelpOptions ( gArgs ) ; <nl> SetupChainParamsBaseOptions ( ) ; <nl> <nl> - gArgs . AddArg ( " - datadir = < dir > " , " Specify data directory " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - wallet = < wallet - name > " , " Specify wallet name " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - debug = < category > " , " Output debugging information ( default : 0 ) . " , false , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - printtoconsole " , " Send trace / debug info to console ( default : 1 when no - debug is true , 0 otherwise . " , false , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - datadir = < dir > " , " Specify data directory " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - wallet = < wallet - name > " , " Specify wallet name " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - debug = < category > " , " Output debugging information ( default : 0 ) . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - printtoconsole " , " Send trace / debug info to console ( default : 1 when no - debug is true , 0 otherwise . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : DEBUG_TEST ) ; <nl> <nl> - gArgs . AddArg ( " info " , " Get wallet info " , false , OptionsCategory : : COMMANDS ) ; <nl> - gArgs . AddArg ( " create " , " Create new wallet file " , false , OptionsCategory : : COMMANDS ) ; <nl> + gArgs . AddArg ( " info " , " Get wallet info " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : COMMANDS ) ; <nl> + gArgs . AddArg ( " create " , " Create new wallet file " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : COMMANDS ) ; <nl> } <nl> <nl> static bool WalletAppInit ( int argc , char * argv [ ] ) <nl> mmm a / src / chainparamsbase . cpp <nl> ppp b / src / chainparamsbase . cpp <nl> const std : : string CBaseChainParams : : REGTEST = " regtest " ; <nl> void SetupChainParamsBaseOptions ( ) <nl> { <nl> gArgs . AddArg ( " - regtest " , " Enter regression test mode , which uses a special chain in which blocks can be solved instantly . " <nl> - " This is intended for regression testing tools and app development . " , true , OptionsCategory : : CHAINPARAMS ) ; <nl> - gArgs . AddArg ( " - testnet " , " Use the test chain " , false , OptionsCategory : : CHAINPARAMS ) ; <nl> - gArgs . AddArg ( " - vbparams = deployment : start : end " , " Use given start / end times for specified version bits deployment ( regtest - only ) " , true , OptionsCategory : : CHAINPARAMS ) ; <nl> + " This is intended for regression testing tools and app development . " , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : CHAINPARAMS ) ; <nl> + gArgs . AddArg ( " - testnet " , " Use the test chain " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CHAINPARAMS ) ; <nl> + gArgs . AddArg ( " - vbparams = deployment : start : end " , " Use given start / end times for specified version bits deployment ( regtest - only ) " , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : CHAINPARAMS ) ; <nl> } <nl> <nl> static std : : unique_ptr < CBaseChainParams > globalChainBaseParams ; <nl> mmm a / src / init . cpp <nl> ppp b / src / init . cpp <nl> static void OnRPCStopped ( ) <nl> void SetupServerArgs ( ) <nl> { <nl> SetupHelpOptions ( gArgs ) ; <nl> - gArgs . AddArg ( " - help - debug " , " Print help message with debugging options and exit " , false , OptionsCategory : : DEBUG_TEST ) ; / / server - only for now <nl> + gArgs . AddArg ( " - help - debug " , " Print help message with debugging options and exit " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : DEBUG_TEST ) ; / / server - only for now <nl> <nl> const auto defaultBaseParams = CreateBaseChainParams ( CBaseChainParams : : MAIN ) ; <nl> const auto testnetBaseParams = CreateBaseChainParams ( CBaseChainParams : : TESTNET ) ; <nl> void SetupServerArgs ( ) <nl> / / GUI args . These will be overwritten by SetupUIArgs for the GUI <nl> " - allowselfsignedrootcertificates " , " - choosedatadir " , " - lang = < lang > " , " - min " , " - resetguisettings " , " - rootcertificates = < file > " , " - splash " , " - uiplatform " } ; <nl> <nl> - gArgs . AddArg ( " - version " , " Print version and exit " , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - version " , " Print version and exit " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> # if HAVE_SYSTEM <nl> - gArgs . AddArg ( " - alertnotify = < cmd > " , " Execute command when a relevant alert is received or we see a really long fork ( % s in cmd is replaced by message ) " , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - alertnotify = < cmd > " , " Execute command when a relevant alert is received or we see a really long fork ( % s in cmd is replaced by message ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> # endif <nl> - gArgs . AddArg ( " - assumevalid = < hex > " , strprintf ( " If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification ( 0 to verify all , default : % s , testnet : % s ) " , defaultChainParams - > GetConsensus ( ) . defaultAssumeValid . GetHex ( ) , testnetChainParams - > GetConsensus ( ) . defaultAssumeValid . GetHex ( ) ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - blocksdir = < dir > " , " Specify directory to hold blocks subdirectory for * . dat files ( default : < datadir > ) " , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - assumevalid = < hex > " , strprintf ( " If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification ( 0 to verify all , default : % s , testnet : % s ) " , defaultChainParams - > GetConsensus ( ) . defaultAssumeValid . GetHex ( ) , testnetChainParams - > GetConsensus ( ) . defaultAssumeValid . GetHex ( ) ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - blocksdir = < dir > " , " Specify directory to hold blocks subdirectory for * . dat files ( default : < datadir > ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> # if HAVE_SYSTEM <nl> - gArgs . AddArg ( " - blocknotify = < cmd > " , " Execute command when the best block changes ( % s in cmd is replaced by block hash ) " , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - blocknotify = < cmd > " , " Execute command when the best block changes ( % s in cmd is replaced by block hash ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> # endif <nl> - gArgs . AddArg ( " - blockreconstructionextratxn = < n > " , strprintf ( " Extra transactions to keep in memory for compact block reconstructions ( default : % u ) " , DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - blocksonly " , strprintf ( " Whether to reject transactions from network peers . Transactions from the wallet or RPC are not affected . ( default : % u ) " , DEFAULT_BLOCKSONLY ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - conf = < file > " , strprintf ( " Specify configuration file . Relative paths will be prefixed by datadir location . ( default : % s ) " , BITCOIN_CONF_FILENAME ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - datadir = < dir > " , " Specify data directory " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - dbbatchsize " , strprintf ( " Maximum database write batch size in bytes ( default : % u ) " , nDefaultDbBatchSize ) , true , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - dbcache = < n > " , strprintf ( " Maximum database cache size < n > MiB ( % d to % d , default : % d ) . In addition , unused mempool memory is shared for this cache ( see - maxmempool ) . " , nMinDbCache , nMaxDbCache , nDefaultDbCache ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - debuglogfile = < file > " , strprintf ( " Specify location of debug log file . Relative paths will be prefixed by a net - specific datadir location . ( - nodebuglogfile to disable ; default : % s ) " , DEFAULT_DEBUGLOGFILE ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - feefilter " , strprintf ( " Tell other nodes to filter invs to us by our mempool min fee ( default : % u ) " , DEFAULT_FEEFILTER ) , true , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - includeconf = < file > " , " Specify additional configuration file , relative to the - datadir path ( only useable from configuration file , not command line ) " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - loadblock = < file > " , " Imports blocks from external blk000 ? ? . dat file on startup " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - maxmempool = < n > " , strprintf ( " Keep the transaction memory pool below < n > megabytes ( default : % u ) " , DEFAULT_MAX_MEMPOOL_SIZE ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - maxorphantx = < n > " , strprintf ( " Keep at most < n > unconnectable transactions in memory ( default : % u ) " , DEFAULT_MAX_ORPHAN_TRANSACTIONS ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - mempoolexpiry = < n > " , strprintf ( " Do not keep transactions in the mempool longer than < n > hours ( default : % u ) " , DEFAULT_MEMPOOL_EXPIRY ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - minimumchainwork = < hex > " , strprintf ( " Minimum work assumed to exist on a valid chain in hex ( default : % s , testnet : % s ) " , defaultChainParams - > GetConsensus ( ) . nMinimumChainWork . GetHex ( ) , testnetChainParams - > GetConsensus ( ) . nMinimumChainWork . GetHex ( ) ) , true , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - blockreconstructionextratxn = < n > " , strprintf ( " Extra transactions to keep in memory for compact block reconstructions ( default : % u ) " , DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - blocksonly " , strprintf ( " Whether to reject transactions from network peers . Transactions from the wallet or RPC are not affected . ( default : % u ) " , DEFAULT_BLOCKSONLY ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - conf = < file > " , strprintf ( " Specify configuration file . Relative paths will be prefixed by datadir location . ( default : % s ) " , BITCOIN_CONF_FILENAME ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - datadir = < dir > " , " Specify data directory " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - dbbatchsize " , strprintf ( " Maximum database write batch size in bytes ( default : % u ) " , nDefaultDbBatchSize ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - dbcache = < n > " , strprintf ( " Maximum database cache size < n > MiB ( % d to % d , default : % d ) . In addition , unused mempool memory is shared for this cache ( see - maxmempool ) . " , nMinDbCache , nMaxDbCache , nDefaultDbCache ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - debuglogfile = < file > " , strprintf ( " Specify location of debug log file . Relative paths will be prefixed by a net - specific datadir location . ( - nodebuglogfile to disable ; default : % s ) " , DEFAULT_DEBUGLOGFILE ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - feefilter " , strprintf ( " Tell other nodes to filter invs to us by our mempool min fee ( default : % u ) " , DEFAULT_FEEFILTER ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - includeconf = < file > " , " Specify additional configuration file , relative to the - datadir path ( only useable from configuration file , not command line ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - loadblock = < file > " , " Imports blocks from external blk000 ? ? . dat file on startup " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - maxmempool = < n > " , strprintf ( " Keep the transaction memory pool below < n > megabytes ( default : % u ) " , DEFAULT_MAX_MEMPOOL_SIZE ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - maxorphantx = < n > " , strprintf ( " Keep at most < n > unconnectable transactions in memory ( default : % u ) " , DEFAULT_MAX_ORPHAN_TRANSACTIONS ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - mempoolexpiry = < n > " , strprintf ( " Do not keep transactions in the mempool longer than < n > hours ( default : % u ) " , DEFAULT_MEMPOOL_EXPIRY ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - minimumchainwork = < hex > " , strprintf ( " Minimum work assumed to exist on a valid chain in hex ( default : % s , testnet : % s ) " , defaultChainParams - > GetConsensus ( ) . nMinimumChainWork . GetHex ( ) , testnetChainParams - > GetConsensus ( ) . nMinimumChainWork . GetHex ( ) ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : OPTIONS ) ; <nl> gArgs . AddArg ( " - par = < n > " , strprintf ( " Set the number of script verification threads ( % u to % d , 0 = auto , < 0 = leave that many cores free , default : % d ) " , <nl> - - GetNumCores ( ) , MAX_SCRIPTCHECK_THREADS , DEFAULT_SCRIPTCHECK_THREADS ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - persistmempool " , strprintf ( " Whether to save the mempool on shutdown and load on restart ( default : % u ) " , DEFAULT_PERSIST_MEMPOOL ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - pid = < file > " , strprintf ( " Specify pid file . Relative paths will be prefixed by a net - specific datadir location . ( default : % s ) " , BITCOIN_PID_FILENAME ) , false , OptionsCategory : : OPTIONS ) ; <nl> + - GetNumCores ( ) , MAX_SCRIPTCHECK_THREADS , DEFAULT_SCRIPTCHECK_THREADS ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - persistmempool " , strprintf ( " Whether to save the mempool on shutdown and load on restart ( default : % u ) " , DEFAULT_PERSIST_MEMPOOL ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - pid = < file > " , strprintf ( " Specify pid file . Relative paths will be prefixed by a net - specific datadir location . ( default : % s ) " , BITCOIN_PID_FILENAME ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> gArgs . AddArg ( " - prune = < n > " , strprintf ( " Reduce storage requirements by enabling pruning ( deleting ) of old blocks . This allows the pruneblockchain RPC to be called to delete specific blocks , and enables automatic pruning of old blocks if a target size in MiB is provided . This mode is incompatible with - txindex and - rescan . " <nl> " Warning : Reverting this setting requires re - downloading the entire blockchain . " <nl> - " ( default : 0 = disable pruning blocks , 1 = allow manual pruning via RPC , > = % u = automatically prune block files to stay under the specified target size in MiB ) " , MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024 ) , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - reindex " , " Rebuild chain state and block index from the blk * . dat files on disk " , false , OptionsCategory : : OPTIONS ) ; <nl> - gArgs . AddArg ( " - reindex - chainstate " , " Rebuild chain state from the currently indexed blocks . When in pruning mode or if blocks on disk might be corrupted , use full - reindex instead . " , false , OptionsCategory : : OPTIONS ) ; <nl> + " ( default : 0 = disable pruning blocks , 1 = allow manual pruning via RPC , > = % u = automatically prune block files to stay under the specified target size in MiB ) " , MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024 ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - reindex " , " Rebuild chain state and block index from the blk * . dat files on disk " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - reindex - chainstate " , " Rebuild chain state from the currently indexed blocks . When in pruning mode or if blocks on disk might be corrupted , use full - reindex instead . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> # ifndef WIN32 <nl> - gArgs . AddArg ( " - sysperms " , " Create new files with system default permissions , instead of umask 077 ( only effective with disabled wallet functionality ) " , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - sysperms " , " Create new files with system default permissions , instead of umask 077 ( only effective with disabled wallet functionality ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> # else <nl> hidden_args . emplace_back ( " - sysperms " ) ; <nl> # endif <nl> - gArgs . AddArg ( " - txindex " , strprintf ( " Maintain a full transaction index , used by the getrawtransaction rpc call ( default : % u ) " , DEFAULT_TXINDEX ) , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - txindex " , strprintf ( " Maintain a full transaction index , used by the getrawtransaction rpc call ( default : % u ) " , DEFAULT_TXINDEX ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> gArgs . AddArg ( " - blockfilterindex = < type > " , <nl> strprintf ( " Maintain an index of compact filters by block ( default : % s , values : % s ) . " , DEFAULT_BLOCKFILTERINDEX , ListBlockFilterTypes ( ) ) + <nl> " If < type > is not supplied or if < type > = 1 , indexes for all known types are enabled . " , <nl> - false , OptionsCategory : : OPTIONS ) ; <nl> - <nl> - gArgs . AddArg ( " - addnode = < ip > " , " Add a node to connect to and attempt to keep the connection open ( see the ` addnode ` RPC command help for more info ) . This option can be specified multiple times to add multiple nodes . " , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - banscore = < n > " , strprintf ( " Threshold for disconnecting misbehaving peers ( default : % u ) " , DEFAULT_BANSCORE_THRESHOLD ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - bantime = < n > " , strprintf ( " Number of seconds to keep misbehaving peers from reconnecting ( default : % u ) " , DEFAULT_MISBEHAVING_BANTIME ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - bind = < addr > " , " Bind to given address and always listen on it . Use [ host ] : port notation for IPv6 " , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - connect = < ip > " , " Connect only to the specified node ; - noconnect disables automatic connections ( the rules for this peer are the same as for - addnode ) . This option can be specified multiple times to connect to multiple nodes . " , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - discover " , " Discover own IP addresses ( default : 1 when listening and no - externalip or - proxy ) " , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - dns " , strprintf ( " Allow DNS lookups for - addnode , - seednode and - connect ( default : % u ) " , DEFAULT_NAME_LOOKUP ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - dnsseed " , " Query for peer addresses via DNS lookup , if low on addresses ( default : 1 unless - connect used ) " , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - enablebip61 " , strprintf ( " Send reject messages per BIP61 ( default : % u ) " , DEFAULT_ENABLE_BIP61 ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - externalip = < ip > " , " Specify your own public address " , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - forcednsseed " , strprintf ( " Always query for peer addresses via DNS lookup ( default : % u ) " , DEFAULT_FORCEDNSSEED ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - listen " , " Accept connections from outside ( default : 1 if no - proxy or - connect ) " , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - listenonion " , strprintf ( " Automatically create Tor hidden service ( default : % d ) " , DEFAULT_LISTEN_ONION ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - maxconnections = < n > " , strprintf ( " Maintain at most < n > connections to peers ( default : % u ) " , DEFAULT_MAX_PEER_CONNECTIONS ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - maxreceivebuffer = < n > " , strprintf ( " Maximum per - connection receive buffer , < n > * 1000 bytes ( default : % u ) " , DEFAULT_MAXRECEIVEBUFFER ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - maxsendbuffer = < n > " , strprintf ( " Maximum per - connection send buffer , < n > * 1000 bytes ( default : % u ) " , DEFAULT_MAXSENDBUFFER ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - maxtimeadjustment " , strprintf ( " Maximum allowed median peer time offset adjustment . Local perspective of time may be influenced by peers forward or backward by this amount . ( default : % u seconds ) " , DEFAULT_MAX_TIME_ADJUSTMENT ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - maxuploadtarget = < n > " , strprintf ( " Tries to keep outbound traffic under the given target ( in MiB per 24h ) , 0 = no limit ( default : % d ) " , DEFAULT_MAX_UPLOAD_TARGET ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - onion = < ip : port > " , " Use separate SOCKS5 proxy to reach peers via Tor hidden services , set - noonion to disable ( default : - proxy ) " , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - onlynet = < net > " , " Make outgoing connections only through network < net > ( ipv4 , ipv6 or onion ) . Incoming connections are not affected by this option . This option can be specified multiple times to allow multiple networks . " , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - peerbloomfilters " , strprintf ( " Support filtering of blocks and transaction with bloom filters ( default : % u ) " , DEFAULT_PEERBLOOMFILTERS ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - permitbaremultisig " , strprintf ( " Relay non - P2SH multisig ( default : % u ) " , DEFAULT_PERMIT_BAREMULTISIG ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - port = < port > " , strprintf ( " Listen for connections on < port > ( default : % u , testnet : % u , regtest : % u ) " , defaultChainParams - > GetDefaultPort ( ) , testnetChainParams - > GetDefaultPort ( ) , regtestChainParams - > GetDefaultPort ( ) ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - proxy = < ip : port > " , " Connect through SOCKS5 proxy , set - noproxy to disable ( default : disabled ) " , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - proxyrandomize " , strprintf ( " Randomize credentials for every proxy connection . This enables Tor stream isolation ( default : % u ) " , DEFAULT_PROXYRANDOMIZE ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - seednode = < ip > " , " Connect to a node to retrieve peer addresses , and disconnect . This option can be specified multiple times to connect to multiple nodes . " , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - timeout = < n > " , strprintf ( " Specify connection timeout in milliseconds ( minimum : 1 , default : % d ) " , DEFAULT_CONNECT_TIMEOUT ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - peertimeout = < n > " , strprintf ( " Specify p2p connection timeout in seconds . This option determines the amount of time a peer may be inactive before the connection to it is dropped . ( minimum : 1 , default : % d ) " , DEFAULT_PEER_CONNECT_TIMEOUT ) , true , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - torcontrol = < ip > : < port > " , strprintf ( " Tor control port to use if onion listening enabled ( default : % s ) " , DEFAULT_TOR_CONTROL ) , false , OptionsCategory : : CONNECTION ) ; <nl> - gArgs . AddArg ( " - torpassword = < pass > " , " Tor control port password ( default : empty ) " , false , OptionsCategory : : CONNECTION ) ; <nl> + ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + <nl> + gArgs . AddArg ( " - addnode = < ip > " , " Add a node to connect to and attempt to keep the connection open ( see the ` addnode ` RPC command help for more info ) . This option can be specified multiple times to add multiple nodes . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - banscore = < n > " , strprintf ( " Threshold for disconnecting misbehaving peers ( default : % u ) " , DEFAULT_BANSCORE_THRESHOLD ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - bantime = < n > " , strprintf ( " Number of seconds to keep misbehaving peers from reconnecting ( default : % u ) " , DEFAULT_MISBEHAVING_BANTIME ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - bind = < addr > " , " Bind to given address and always listen on it . Use [ host ] : port notation for IPv6 " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - connect = < ip > " , " Connect only to the specified node ; - noconnect disables automatic connections ( the rules for this peer are the same as for - addnode ) . This option can be specified multiple times to connect to multiple nodes . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - discover " , " Discover own IP addresses ( default : 1 when listening and no - externalip or - proxy ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - dns " , strprintf ( " Allow DNS lookups for - addnode , - seednode and - connect ( default : % u ) " , DEFAULT_NAME_LOOKUP ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - dnsseed " , " Query for peer addresses via DNS lookup , if low on addresses ( default : 1 unless - connect used ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - enablebip61 " , strprintf ( " Send reject messages per BIP61 ( default : % u ) " , DEFAULT_ENABLE_BIP61 ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - externalip = < ip > " , " Specify your own public address " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - forcednsseed " , strprintf ( " Always query for peer addresses via DNS lookup ( default : % u ) " , DEFAULT_FORCEDNSSEED ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - listen " , " Accept connections from outside ( default : 1 if no - proxy or - connect ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - listenonion " , strprintf ( " Automatically create Tor hidden service ( default : % d ) " , DEFAULT_LISTEN_ONION ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - maxconnections = < n > " , strprintf ( " Maintain at most < n > connections to peers ( default : % u ) " , DEFAULT_MAX_PEER_CONNECTIONS ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - maxreceivebuffer = < n > " , strprintf ( " Maximum per - connection receive buffer , < n > * 1000 bytes ( default : % u ) " , DEFAULT_MAXRECEIVEBUFFER ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - maxsendbuffer = < n > " , strprintf ( " Maximum per - connection send buffer , < n > * 1000 bytes ( default : % u ) " , DEFAULT_MAXSENDBUFFER ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - maxtimeadjustment " , strprintf ( " Maximum allowed median peer time offset adjustment . Local perspective of time may be influenced by peers forward or backward by this amount . ( default : % u seconds ) " , DEFAULT_MAX_TIME_ADJUSTMENT ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - maxuploadtarget = < n > " , strprintf ( " Tries to keep outbound traffic under the given target ( in MiB per 24h ) , 0 = no limit ( default : % d ) " , DEFAULT_MAX_UPLOAD_TARGET ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - onion = < ip : port > " , " Use separate SOCKS5 proxy to reach peers via Tor hidden services , set - noonion to disable ( default : - proxy ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - onlynet = < net > " , " Make outgoing connections only through network < net > ( ipv4 , ipv6 or onion ) . Incoming connections are not affected by this option . This option can be specified multiple times to allow multiple networks . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - peerbloomfilters " , strprintf ( " Support filtering of blocks and transaction with bloom filters ( default : % u ) " , DEFAULT_PEERBLOOMFILTERS ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - permitbaremultisig " , strprintf ( " Relay non - P2SH multisig ( default : % u ) " , DEFAULT_PERMIT_BAREMULTISIG ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - port = < port > " , strprintf ( " Listen for connections on < port > ( default : % u , testnet : % u , regtest : % u ) " , defaultChainParams - > GetDefaultPort ( ) , testnetChainParams - > GetDefaultPort ( ) , regtestChainParams - > GetDefaultPort ( ) ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - proxy = < ip : port > " , " Connect through SOCKS5 proxy , set - noproxy to disable ( default : disabled ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - proxyrandomize " , strprintf ( " Randomize credentials for every proxy connection . This enables Tor stream isolation ( default : % u ) " , DEFAULT_PROXYRANDOMIZE ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - seednode = < ip > " , " Connect to a node to retrieve peer addresses , and disconnect . This option can be specified multiple times to connect to multiple nodes . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - timeout = < n > " , strprintf ( " Specify connection timeout in milliseconds ( minimum : 1 , default : % d ) " , DEFAULT_CONNECT_TIMEOUT ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - peertimeout = < n > " , strprintf ( " Specify p2p connection timeout in seconds . This option determines the amount of time a peer may be inactive before the connection to it is dropped . ( minimum : 1 , default : % d ) " , DEFAULT_PEER_CONNECT_TIMEOUT ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - torcontrol = < ip > : < port > " , strprintf ( " Tor control port to use if onion listening enabled ( default : % s ) " , DEFAULT_TOR_CONTROL ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - torpassword = < pass > " , " Tor control port password ( default : empty ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> # ifdef USE_UPNP <nl> # if USE_UPNP <nl> - gArgs . AddArg ( " - upnp " , " Use UPnP to map the listening port ( default : 1 when listening and no - proxy ) " , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - upnp " , " Use UPnP to map the listening port ( default : 1 when listening and no - proxy ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> # else <nl> - gArgs . AddArg ( " - upnp " , strprintf ( " Use UPnP to map the listening port ( default : % u ) " , 0 ) , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - upnp " , strprintf ( " Use UPnP to map the listening port ( default : % u ) " , 0 ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> # endif <nl> # else <nl> hidden_args . emplace_back ( " - upnp " ) ; <nl> # endif <nl> - gArgs . AddArg ( " - whitebind = < addr > " , " Bind to given address and whitelist peers connecting to it . Use [ host ] : port notation for IPv6 " , false , OptionsCategory : : CONNECTION ) ; <nl> + gArgs . AddArg ( " - whitebind = < addr > " , " Bind to given address and whitelist peers connecting to it . Use [ host ] : port notation for IPv6 " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> gArgs . AddArg ( " - whitelist = < IP address or network > " , " Whitelist peers connecting from the given IP address ( e . g . 1 . 2 . 3 . 4 ) or CIDR notated network ( e . g . 1 . 2 . 3 . 0 / 24 ) . Can be specified multiple times . " <nl> - " Whitelisted peers cannot be DoS banned " , false , OptionsCategory : : CONNECTION ) ; <nl> + " Whitelisted peers cannot be DoS banned " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : CONNECTION ) ; <nl> <nl> g_wallet_init_interface . AddWalletOptions ( ) ; <nl> <nl> # if ENABLE_ZMQ <nl> - gArgs . AddArg ( " - zmqpubhashblock = < address > " , " Enable publish hash block in < address > " , false , OptionsCategory : : ZMQ ) ; <nl> - gArgs . AddArg ( " - zmqpubhashtx = < address > " , " Enable publish hash transaction in < address > " , false , OptionsCategory : : ZMQ ) ; <nl> - gArgs . AddArg ( " - zmqpubrawblock = < address > " , " Enable publish raw block in < address > " , false , OptionsCategory : : ZMQ ) ; <nl> - gArgs . AddArg ( " - zmqpubrawtx = < address > " , " Enable publish raw transaction in < address > " , false , OptionsCategory : : ZMQ ) ; <nl> - gArgs . AddArg ( " - zmqpubhashblockhwm = < n > " , strprintf ( " Set publish hash block outbound message high water mark ( default : % d ) " , CZMQAbstractNotifier : : DEFAULT_ZMQ_SNDHWM ) , false , OptionsCategory : : ZMQ ) ; <nl> - gArgs . AddArg ( " - zmqpubhashtxhwm = < n > " , strprintf ( " Set publish hash transaction outbound message high water mark ( default : % d ) " , CZMQAbstractNotifier : : DEFAULT_ZMQ_SNDHWM ) , false , OptionsCategory : : ZMQ ) ; <nl> - gArgs . AddArg ( " - zmqpubrawblockhwm = < n > " , strprintf ( " Set publish raw block outbound message high water mark ( default : % d ) " , CZMQAbstractNotifier : : DEFAULT_ZMQ_SNDHWM ) , false , OptionsCategory : : ZMQ ) ; <nl> - gArgs . AddArg ( " - zmqpubrawtxhwm = < n > " , strprintf ( " Set publish raw transaction outbound message high water mark ( default : % d ) " , CZMQAbstractNotifier : : DEFAULT_ZMQ_SNDHWM ) , false , OptionsCategory : : ZMQ ) ; <nl> + gArgs . AddArg ( " - zmqpubhashblock = < address > " , " Enable publish hash block in < address > " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : ZMQ ) ; <nl> + gArgs . AddArg ( " - zmqpubhashtx = < address > " , " Enable publish hash transaction in < address > " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : ZMQ ) ; <nl> + gArgs . AddArg ( " - zmqpubrawblock = < address > " , " Enable publish raw block in < address > " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : ZMQ ) ; <nl> + gArgs . AddArg ( " - zmqpubrawtx = < address > " , " Enable publish raw transaction in < address > " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : ZMQ ) ; <nl> + gArgs . AddArg ( " - zmqpubhashblockhwm = < n > " , strprintf ( " Set publish hash block outbound message high water mark ( default : % d ) " , CZMQAbstractNotifier : : DEFAULT_ZMQ_SNDHWM ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : ZMQ ) ; <nl> + gArgs . AddArg ( " - zmqpubhashtxhwm = < n > " , strprintf ( " Set publish hash transaction outbound message high water mark ( default : % d ) " , CZMQAbstractNotifier : : DEFAULT_ZMQ_SNDHWM ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : ZMQ ) ; <nl> + gArgs . AddArg ( " - zmqpubrawblockhwm = < n > " , strprintf ( " Set publish raw block outbound message high water mark ( default : % d ) " , CZMQAbstractNotifier : : DEFAULT_ZMQ_SNDHWM ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : ZMQ ) ; <nl> + gArgs . AddArg ( " - zmqpubrawtxhwm = < n > " , strprintf ( " Set publish raw transaction outbound message high water mark ( default : % d ) " , CZMQAbstractNotifier : : DEFAULT_ZMQ_SNDHWM ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : ZMQ ) ; <nl> # else <nl> hidden_args . emplace_back ( " - zmqpubhashblock = < address > " ) ; <nl> hidden_args . emplace_back ( " - zmqpubhashtx = < address > " ) ; <nl> void SetupServerArgs ( ) <nl> hidden_args . emplace_back ( " - zmqpubrawtxhwm = < n > " ) ; <nl> # endif <nl> <nl> - gArgs . AddArg ( " - checkblocks = < n > " , strprintf ( " How many blocks to check at startup ( default : % u , 0 = all ) " , DEFAULT_CHECKBLOCKS ) , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - checkblocks = < n > " , strprintf ( " How many blocks to check at startup ( default : % u , 0 = all ) " , DEFAULT_CHECKBLOCKS ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> gArgs . AddArg ( " - checklevel = < n > " , strprintf ( " How thorough the block verification of - checkblocks is : " <nl> " level 0 reads the blocks from disk , " <nl> " level 1 verifies block validity , " <nl> void SetupServerArgs ( ) <nl> " level 3 checks disconnection of tip blocks , " <nl> " and level 4 tries to reconnect the blocks , " <nl> " each level includes the checks of the previous levels " <nl> - " ( 0 - 4 , default : % u ) " , DEFAULT_CHECKLEVEL ) , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - checkblockindex " , strprintf ( " Do a full consistency check for the block tree , setBlockIndexCandidates , : : ChainActive ( ) and mapBlocksUnlinked occasionally . ( default : % u , regtest : % u ) " , defaultChainParams - > DefaultConsistencyChecks ( ) , regtestChainParams - > DefaultConsistencyChecks ( ) ) , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - checkmempool = < n > " , strprintf ( " Run checks every < n > transactions ( default : % u , regtest : % u ) " , defaultChainParams - > DefaultConsistencyChecks ( ) , regtestChainParams - > DefaultConsistencyChecks ( ) ) , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - checkpoints " , strprintf ( " Disable expensive verification for known chain history ( default : % u ) " , DEFAULT_CHECKPOINTS_ENABLED ) , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - deprecatedrpc = < method > " , " Allows deprecated RPC method ( s ) to be used " , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - dropmessagestest = < n > " , " Randomly drop 1 of every < n > network messages " , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - stopafterblockimport " , strprintf ( " Stop running after importing blocks from disk ( default : % u ) " , DEFAULT_STOPAFTERBLOCKIMPORT ) , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - stopatheight " , strprintf ( " Stop running after reaching the given height in the main chain ( default : % u ) " , DEFAULT_STOPATHEIGHT ) , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - limitancestorcount = < n > " , strprintf ( " Do not accept transactions if number of in - mempool ancestors is < n > or more ( default : % u ) " , DEFAULT_ANCESTOR_LIMIT ) , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - limitancestorsize = < n > " , strprintf ( " Do not accept transactions whose size with all in - mempool ancestors exceeds < n > kilobytes ( default : % u ) " , DEFAULT_ANCESTOR_SIZE_LIMIT ) , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - limitdescendantcount = < n > " , strprintf ( " Do not accept transactions if any ancestor would have < n > or more in - mempool descendants ( default : % u ) " , DEFAULT_DESCENDANT_LIMIT ) , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - limitdescendantsize = < n > " , strprintf ( " Do not accept transactions if any ancestor would have more than < n > kilobytes of in - mempool descendants ( default : % u ) . " , DEFAULT_DESCENDANT_SIZE_LIMIT ) , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - addrmantest " , " Allows to test address relay on localhost " , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + " ( 0 - 4 , default : % u ) " , DEFAULT_CHECKLEVEL ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - checkblockindex " , strprintf ( " Do a full consistency check for the block tree , setBlockIndexCandidates , : : ChainActive ( ) and mapBlocksUnlinked occasionally . ( default : % u , regtest : % u ) " , defaultChainParams - > DefaultConsistencyChecks ( ) , regtestChainParams - > DefaultConsistencyChecks ( ) ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - checkmempool = < n > " , strprintf ( " Run checks every < n > transactions ( default : % u , regtest : % u ) " , defaultChainParams - > DefaultConsistencyChecks ( ) , regtestChainParams - > DefaultConsistencyChecks ( ) ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - checkpoints " , strprintf ( " Disable expensive verification for known chain history ( default : % u ) " , DEFAULT_CHECKPOINTS_ENABLED ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - deprecatedrpc = < method > " , " Allows deprecated RPC method ( s ) to be used " , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - dropmessagestest = < n > " , " Randomly drop 1 of every < n > network messages " , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - stopafterblockimport " , strprintf ( " Stop running after importing blocks from disk ( default : % u ) " , DEFAULT_STOPAFTERBLOCKIMPORT ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - stopatheight " , strprintf ( " Stop running after reaching the given height in the main chain ( default : % u ) " , DEFAULT_STOPATHEIGHT ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - limitancestorcount = < n > " , strprintf ( " Do not accept transactions if number of in - mempool ancestors is < n > or more ( default : % u ) " , DEFAULT_ANCESTOR_LIMIT ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - limitancestorsize = < n > " , strprintf ( " Do not accept transactions whose size with all in - mempool ancestors exceeds < n > kilobytes ( default : % u ) " , DEFAULT_ANCESTOR_SIZE_LIMIT ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - limitdescendantcount = < n > " , strprintf ( " Do not accept transactions if any ancestor would have < n > or more in - mempool descendants ( default : % u ) " , DEFAULT_DESCENDANT_LIMIT ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - limitdescendantsize = < n > " , strprintf ( " Do not accept transactions if any ancestor would have more than < n > kilobytes of in - mempool descendants ( default : % u ) . " , DEFAULT_DESCENDANT_SIZE_LIMIT ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - addrmantest " , " Allows to test address relay on localhost " , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> gArgs . AddArg ( " - debug = < category > " , " Output debugging information ( default : - nodebug , supplying < category > is optional ) . " <nl> - " If < category > is not supplied or if < category > = 1 , output all debugging information . < category > can be : " + ListLogCategories ( ) + " . " , false , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - debugexclude = < category > " , strprintf ( " Exclude debugging information for a category . Can be used in conjunction with - debug = 1 to output debug logs for all categories except one or more specified categories . " ) , false , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - logips " , strprintf ( " Include IP addresses in debug output ( default : % u ) " , DEFAULT_LOGIPS ) , false , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - logtimestamps " , strprintf ( " Prepend debug output with timestamp ( default : % u ) " , DEFAULT_LOGTIMESTAMPS ) , false , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - logthreadnames " , strprintf ( " Prepend debug output with name of the originating thread ( only available on platforms supporting thread_local ) ( default : % u ) " , DEFAULT_LOGTHREADNAMES ) , false , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - logtimemicros " , strprintf ( " Add microsecond precision to debug timestamps ( default : % u ) " , DEFAULT_LOGTIMEMICROS ) , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - mocktime = < n > " , " Replace actual time with < n > seconds since epoch ( default : 0 ) " , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - maxsigcachesize = < n > " , strprintf ( " Limit sum of signature cache and script execution cache sizes to < n > MiB ( default : % u ) " , DEFAULT_MAX_SIG_CACHE_SIZE ) , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - maxtipage = < n > " , strprintf ( " Maximum tip age in seconds to consider node in initial block download ( default : % u ) " , DEFAULT_MAX_TIP_AGE ) , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - printpriority " , strprintf ( " Log transaction fee per kB when mining blocks ( default : % u ) " , DEFAULT_PRINTPRIORITY ) , true , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - printtoconsole " , " Send trace / debug info to console ( default : 1 when no - daemon . To disable logging to file , set - nodebuglogfile ) " , false , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - shrinkdebugfile " , " Shrink debug . log file on client startup ( default : 1 when no - debug ) " , false , OptionsCategory : : DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - uacomment = < cmt > " , " Append comment to the user agent string " , false , OptionsCategory : : DEBUG_TEST ) ; <nl> + " If < category > is not supplied or if < category > = 1 , output all debugging information . < category > can be : " + ListLogCategories ( ) + " . " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - debugexclude = < category > " , strprintf ( " Exclude debugging information for a category . Can be used in conjunction with - debug = 1 to output debug logs for all categories except one or more specified categories . " ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - logips " , strprintf ( " Include IP addresses in debug output ( default : % u ) " , DEFAULT_LOGIPS ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - logtimestamps " , strprintf ( " Prepend debug output with timestamp ( default : % u ) " , DEFAULT_LOGTIMESTAMPS ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - logthreadnames " , strprintf ( " Prepend debug output with name of the originating thread ( only available on platforms supporting thread_local ) ( default : % u ) " , DEFAULT_LOGTHREADNAMES ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - logtimemicros " , strprintf ( " Add microsecond precision to debug timestamps ( default : % u ) " , DEFAULT_LOGTIMEMICROS ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - mocktime = < n > " , " Replace actual time with < n > seconds since epoch ( default : 0 ) " , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - maxsigcachesize = < n > " , strprintf ( " Limit sum of signature cache and script execution cache sizes to < n > MiB ( default : % u ) " , DEFAULT_MAX_SIG_CACHE_SIZE ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - maxtipage = < n > " , strprintf ( " Maximum tip age in seconds to consider node in initial block download ( default : % u ) " , DEFAULT_MAX_TIP_AGE ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - printpriority " , strprintf ( " Log transaction fee per kB when mining blocks ( default : % u ) " , DEFAULT_PRINTPRIORITY ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - printtoconsole " , " Send trace / debug info to console ( default : 1 when no - daemon . To disable logging to file , set - nodebuglogfile ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - shrinkdebugfile " , " Shrink debug . log file on client startup ( default : 1 when no - debug ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - uacomment = < cmt > " , " Append comment to the user agent string " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : DEBUG_TEST ) ; <nl> <nl> SetupChainParamsBaseOptions ( ) ; <nl> <nl> - gArgs . AddArg ( " - acceptnonstdtxn " , strprintf ( " Relay and mine \ " non - standard \ " transactions ( % sdefault : % u ) " , " testnet / regtest only ; " , ! testnetChainParams - > RequireStandard ( ) ) , true , OptionsCategory : : NODE_RELAY ) ; <nl> - gArgs . AddArg ( " - incrementalrelayfee = < amt > " , strprintf ( " Fee rate ( in % s / kB ) used to define cost of relay , used for mempool limiting and BIP 125 replacement . ( default : % s ) " , CURRENCY_UNIT , FormatMoney ( DEFAULT_INCREMENTAL_RELAY_FEE ) ) , true , OptionsCategory : : NODE_RELAY ) ; <nl> - gArgs . AddArg ( " - dustrelayfee = < amt > " , strprintf ( " Fee rate ( in % s / kB ) used to define dust , the value of an output such that it will cost more than its value in fees at this fee rate to spend it . ( default : % s ) " , CURRENCY_UNIT , FormatMoney ( DUST_RELAY_TX_FEE ) ) , true , OptionsCategory : : NODE_RELAY ) ; <nl> - gArgs . AddArg ( " - bytespersigop " , strprintf ( " Equivalent bytes per sigop in transactions for relay and mining ( default : % u ) " , DEFAULT_BYTES_PER_SIGOP ) , false , OptionsCategory : : NODE_RELAY ) ; <nl> - gArgs . AddArg ( " - datacarrier " , strprintf ( " Relay and mine data carrier transactions ( default : % u ) " , DEFAULT_ACCEPT_DATACARRIER ) , false , OptionsCategory : : NODE_RELAY ) ; <nl> - gArgs . AddArg ( " - datacarriersize " , strprintf ( " Maximum size of data in data carrier transactions we relay and mine ( default : % u ) " , MAX_OP_RETURN_RELAY ) , false , OptionsCategory : : NODE_RELAY ) ; <nl> + gArgs . AddArg ( " - acceptnonstdtxn " , strprintf ( " Relay and mine \ " non - standard \ " transactions ( % sdefault : % u ) " , " testnet / regtest only ; " , ! testnetChainParams - > RequireStandard ( ) ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : NODE_RELAY ) ; <nl> + gArgs . AddArg ( " - incrementalrelayfee = < amt > " , strprintf ( " Fee rate ( in % s / kB ) used to define cost of relay , used for mempool limiting and BIP 125 replacement . ( default : % s ) " , CURRENCY_UNIT , FormatMoney ( DEFAULT_INCREMENTAL_RELAY_FEE ) ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : NODE_RELAY ) ; <nl> + gArgs . AddArg ( " - dustrelayfee = < amt > " , strprintf ( " Fee rate ( in % s / kB ) used to define dust , the value of an output such that it will cost more than its value in fees at this fee rate to spend it . ( default : % s ) " , CURRENCY_UNIT , FormatMoney ( DUST_RELAY_TX_FEE ) ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : NODE_RELAY ) ; <nl> + gArgs . AddArg ( " - bytespersigop " , strprintf ( " Equivalent bytes per sigop in transactions for relay and mining ( default : % u ) " , DEFAULT_BYTES_PER_SIGOP ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : NODE_RELAY ) ; <nl> + gArgs . AddArg ( " - datacarrier " , strprintf ( " Relay and mine data carrier transactions ( default : % u ) " , DEFAULT_ACCEPT_DATACARRIER ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : NODE_RELAY ) ; <nl> + gArgs . AddArg ( " - datacarriersize " , strprintf ( " Maximum size of data in data carrier transactions we relay and mine ( default : % u ) " , MAX_OP_RETURN_RELAY ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : NODE_RELAY ) ; <nl> gArgs . AddArg ( " - minrelaytxfee = < amt > " , strprintf ( " Fees ( in % s / kB ) smaller than this are considered zero fee for relaying , mining and transaction creation ( default : % s ) " , <nl> - CURRENCY_UNIT , FormatMoney ( DEFAULT_MIN_RELAY_TX_FEE ) ) , false , OptionsCategory : : NODE_RELAY ) ; <nl> - gArgs . AddArg ( " - whitelistforcerelay " , strprintf ( " Force relay of transactions from whitelisted peers even if the transactions were already in the mempool or violate local relay policy ( default : % d ) " , DEFAULT_WHITELISTFORCERELAY ) , false , OptionsCategory : : NODE_RELAY ) ; <nl> - gArgs . AddArg ( " - whitelistrelay " , strprintf ( " Accept relayed transactions received from whitelisted peers even when not relaying transactions ( default : % d ) " , DEFAULT_WHITELISTRELAY ) , false , OptionsCategory : : NODE_RELAY ) ; <nl> - <nl> - <nl> - gArgs . AddArg ( " - blockmaxweight = < n > " , strprintf ( " Set maximum BIP141 block weight ( default : % d ) " , DEFAULT_BLOCK_MAX_WEIGHT ) , false , OptionsCategory : : BLOCK_CREATION ) ; <nl> - gArgs . AddArg ( " - blockmintxfee = < amt > " , strprintf ( " Set lowest fee rate ( in % s / kB ) for transactions to be included in block creation . ( default : % s ) " , CURRENCY_UNIT , FormatMoney ( DEFAULT_BLOCK_MIN_TX_FEE ) ) , false , OptionsCategory : : BLOCK_CREATION ) ; <nl> - gArgs . AddArg ( " - blockversion = < n > " , " Override block version to test forking scenarios " , true , OptionsCategory : : BLOCK_CREATION ) ; <nl> - <nl> - gArgs . AddArg ( " - rest " , strprintf ( " Accept public REST requests ( default : % u ) " , DEFAULT_REST_ENABLE ) , false , OptionsCategory : : RPC ) ; <nl> - gArgs . AddArg ( " - rpcallowip = < ip > " , " Allow JSON - RPC connections from specified source . Valid for < ip > are a single IP ( e . g . 1 . 2 . 3 . 4 ) , a network / netmask ( e . g . 1 . 2 . 3 . 4 / 255 . 255 . 255 . 0 ) or a network / CIDR ( e . g . 1 . 2 . 3 . 4 / 24 ) . This option can be specified multiple times " , false , OptionsCategory : : RPC ) ; <nl> - gArgs . AddArg ( " - rpcauth = < userpw > " , " Username and HMAC - SHA - 256 hashed password for JSON - RPC connections . The field < userpw > comes in the format : < USERNAME > : < SALT > $ < HASH > . A canonical python script is included in share / rpcauth . The client then connects normally using the rpcuser = < USERNAME > / rpcpassword = < PASSWORD > pair of arguments . This option can be specified multiple times " , false , OptionsCategory : : RPC ) ; <nl> - gArgs . AddArg ( " - rpcbind = < addr > [ : port ] " , " Bind to given address to listen for JSON - RPC connections . Do not expose the RPC server to untrusted networks such as the public internet ! This option is ignored unless - rpcallowip is also passed . Port is optional and overrides - rpcport . Use [ host ] : port notation for IPv6 . This option can be specified multiple times ( default : 127 . 0 . 0 . 1 and : : 1 i . e . , localhost ) " , false , OptionsCategory : : RPC ) ; <nl> - gArgs . AddArg ( " - rpccookiefile = < loc > " , " Location of the auth cookie . Relative paths will be prefixed by a net - specific datadir location . ( default : data dir ) " , false , OptionsCategory : : RPC ) ; <nl> - gArgs . AddArg ( " - rpcpassword = < pw > " , " Password for JSON - RPC connections " , false , OptionsCategory : : RPC ) ; <nl> - gArgs . AddArg ( " - rpcport = < port > " , strprintf ( " Listen for JSON - RPC connections on < port > ( default : % u , testnet : % u , regtest : % u ) " , defaultBaseParams - > RPCPort ( ) , testnetBaseParams - > RPCPort ( ) , regtestBaseParams - > RPCPort ( ) ) , false , OptionsCategory : : RPC ) ; <nl> - gArgs . AddArg ( " - rpcserialversion " , strprintf ( " Sets the serialization of raw transaction or block hex returned in non - verbose mode , non - segwit ( 0 ) or segwit ( 1 ) ( default : % d ) " , DEFAULT_RPC_SERIALIZE_VERSION ) , false , OptionsCategory : : RPC ) ; <nl> - gArgs . AddArg ( " - rpcservertimeout = < n > " , strprintf ( " Timeout during HTTP requests ( default : % d ) " , DEFAULT_HTTP_SERVER_TIMEOUT ) , true , OptionsCategory : : RPC ) ; <nl> - gArgs . AddArg ( " - rpcthreads = < n > " , strprintf ( " Set the number of threads to service RPC calls ( default : % d ) " , DEFAULT_HTTP_THREADS ) , false , OptionsCategory : : RPC ) ; <nl> - gArgs . AddArg ( " - rpcuser = < user > " , " Username for JSON - RPC connections " , false , OptionsCategory : : RPC ) ; <nl> - gArgs . AddArg ( " - rpcworkqueue = < n > " , strprintf ( " Set the depth of the work queue to service RPC calls ( default : % d ) " , DEFAULT_HTTP_WORKQUEUE ) , true , OptionsCategory : : RPC ) ; <nl> - gArgs . AddArg ( " - server " , " Accept command line and JSON - RPC commands " , false , OptionsCategory : : RPC ) ; <nl> + CURRENCY_UNIT , FormatMoney ( DEFAULT_MIN_RELAY_TX_FEE ) ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : NODE_RELAY ) ; <nl> + gArgs . AddArg ( " - whitelistforcerelay " , strprintf ( " Force relay of transactions from whitelisted peers even if the transactions were already in the mempool or violate local relay policy ( default : % d ) " , DEFAULT_WHITELISTFORCERELAY ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : NODE_RELAY ) ; <nl> + gArgs . AddArg ( " - whitelistrelay " , strprintf ( " Accept relayed transactions received from whitelisted peers even when not relaying transactions ( default : % d ) " , DEFAULT_WHITELISTRELAY ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : NODE_RELAY ) ; <nl> + <nl> + <nl> + gArgs . AddArg ( " - blockmaxweight = < n > " , strprintf ( " Set maximum BIP141 block weight ( default : % d ) " , DEFAULT_BLOCK_MAX_WEIGHT ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : BLOCK_CREATION ) ; <nl> + gArgs . AddArg ( " - blockmintxfee = < amt > " , strprintf ( " Set lowest fee rate ( in % s / kB ) for transactions to be included in block creation . ( default : % s ) " , CURRENCY_UNIT , FormatMoney ( DEFAULT_BLOCK_MIN_TX_FEE ) ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : BLOCK_CREATION ) ; <nl> + gArgs . AddArg ( " - blockversion = < n > " , " Override block version to test forking scenarios " , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : BLOCK_CREATION ) ; <nl> + <nl> + gArgs . AddArg ( " - rest " , strprintf ( " Accept public REST requests ( default : % u ) " , DEFAULT_REST_ENABLE ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : RPC ) ; <nl> + gArgs . AddArg ( " - rpcallowip = < ip > " , " Allow JSON - RPC connections from specified source . Valid for < ip > are a single IP ( e . g . 1 . 2 . 3 . 4 ) , a network / netmask ( e . g . 1 . 2 . 3 . 4 / 255 . 255 . 255 . 0 ) or a network / CIDR ( e . g . 1 . 2 . 3 . 4 / 24 ) . This option can be specified multiple times " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : RPC ) ; <nl> + gArgs . AddArg ( " - rpcauth = < userpw > " , " Username and HMAC - SHA - 256 hashed password for JSON - RPC connections . The field < userpw > comes in the format : < USERNAME > : < SALT > $ < HASH > . A canonical python script is included in share / rpcauth . The client then connects normally using the rpcuser = < USERNAME > / rpcpassword = < PASSWORD > pair of arguments . This option can be specified multiple times " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : RPC ) ; <nl> + gArgs . AddArg ( " - rpcbind = < addr > [ : port ] " , " Bind to given address to listen for JSON - RPC connections . Do not expose the RPC server to untrusted networks such as the public internet ! This option is ignored unless - rpcallowip is also passed . Port is optional and overrides - rpcport . Use [ host ] : port notation for IPv6 . This option can be specified multiple times ( default : 127 . 0 . 0 . 1 and : : 1 i . e . , localhost ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : RPC ) ; <nl> + gArgs . AddArg ( " - rpccookiefile = < loc > " , " Location of the auth cookie . Relative paths will be prefixed by a net - specific datadir location . ( default : data dir ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : RPC ) ; <nl> + gArgs . AddArg ( " - rpcpassword = < pw > " , " Password for JSON - RPC connections " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : RPC ) ; <nl> + gArgs . AddArg ( " - rpcport = < port > " , strprintf ( " Listen for JSON - RPC connections on < port > ( default : % u , testnet : % u , regtest : % u ) " , defaultBaseParams - > RPCPort ( ) , testnetBaseParams - > RPCPort ( ) , regtestBaseParams - > RPCPort ( ) ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : RPC ) ; <nl> + gArgs . AddArg ( " - rpcserialversion " , strprintf ( " Sets the serialization of raw transaction or block hex returned in non - verbose mode , non - segwit ( 0 ) or segwit ( 1 ) ( default : % d ) " , DEFAULT_RPC_SERIALIZE_VERSION ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : RPC ) ; <nl> + gArgs . AddArg ( " - rpcservertimeout = < n > " , strprintf ( " Timeout during HTTP requests ( default : % d ) " , DEFAULT_HTTP_SERVER_TIMEOUT ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : RPC ) ; <nl> + gArgs . AddArg ( " - rpcthreads = < n > " , strprintf ( " Set the number of threads to service RPC calls ( default : % d ) " , DEFAULT_HTTP_THREADS ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : RPC ) ; <nl> + gArgs . AddArg ( " - rpcuser = < user > " , " Username for JSON - RPC connections " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : RPC ) ; <nl> + gArgs . AddArg ( " - rpcworkqueue = < n > " , strprintf ( " Set the depth of the work queue to service RPC calls ( default : % d ) " , DEFAULT_HTTP_WORKQUEUE ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : RPC ) ; <nl> + gArgs . AddArg ( " - server " , " Accept command line and JSON - RPC commands " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : RPC ) ; <nl> <nl> # if HAVE_DECL_DAEMON <nl> - gArgs . AddArg ( " - daemon " , " Run in the background as a daemon and accept commands " , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( " - daemon " , " Run in the background as a daemon and accept commands " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> # else <nl> hidden_args . emplace_back ( " - daemon " ) ; <nl> # endif <nl> mmm a / src / qt / bitcoin . cpp <nl> ppp b / src / qt / bitcoin . cpp <nl> WId BitcoinApplication : : getMainWinId ( ) const <nl> static void SetupUIArgs ( ) <nl> { <nl> # if defined ( ENABLE_WALLET ) & & defined ( ENABLE_BIP70 ) <nl> - gArgs . AddArg ( " - allowselfsignedrootcertificates " , strprintf ( " Allow self signed root certificates ( default : % u ) " , DEFAULT_SELFSIGNED_ROOTCERTS ) , true , OptionsCategory : : GUI ) ; <nl> + gArgs . AddArg ( " - allowselfsignedrootcertificates " , strprintf ( " Allow self signed root certificates ( default : % u ) " , DEFAULT_SELFSIGNED_ROOTCERTS ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : GUI ) ; <nl> # endif <nl> - gArgs . AddArg ( " - choosedatadir " , strprintf ( " Choose data directory on startup ( default : % u ) " , DEFAULT_CHOOSE_DATADIR ) , false , OptionsCategory : : GUI ) ; <nl> - gArgs . AddArg ( " - lang = < lang > " , " Set language , for example \ " de_DE \ " ( default : system locale ) " , false , OptionsCategory : : GUI ) ; <nl> - gArgs . AddArg ( " - min " , " Start minimized " , false , OptionsCategory : : GUI ) ; <nl> - gArgs . AddArg ( " - resetguisettings " , " Reset all settings changed in the GUI " , false , OptionsCategory : : GUI ) ; <nl> - gArgs . AddArg ( " - rootcertificates = < file > " , " Set SSL root certificates for payment request ( default : - system - ) " , false , OptionsCategory : : GUI ) ; <nl> - gArgs . AddArg ( " - splash " , strprintf ( " Show splash screen on startup ( default : % u ) " , DEFAULT_SPLASHSCREEN ) , false , OptionsCategory : : GUI ) ; <nl> - gArgs . AddArg ( " - uiplatform " , strprintf ( " Select platform to customize UI for ( one of windows , macosx , other ; default : % s ) " , BitcoinGUI : : DEFAULT_UIPLATFORM ) , true , OptionsCategory : : GUI ) ; <nl> + gArgs . AddArg ( " - choosedatadir " , strprintf ( " Choose data directory on startup ( default : % u ) " , DEFAULT_CHOOSE_DATADIR ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : GUI ) ; <nl> + gArgs . AddArg ( " - lang = < lang > " , " Set language , for example \ " de_DE \ " ( default : system locale ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : GUI ) ; <nl> + gArgs . AddArg ( " - min " , " Start minimized " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : GUI ) ; <nl> + gArgs . AddArg ( " - resetguisettings " , " Reset all settings changed in the GUI " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : GUI ) ; <nl> + gArgs . AddArg ( " - rootcertificates = < file > " , " Set SSL root certificates for payment request ( default : - system - ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : GUI ) ; <nl> + gArgs . AddArg ( " - splash " , strprintf ( " Show splash screen on startup ( default : % u ) " , DEFAULT_SPLASHSCREEN ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : GUI ) ; <nl> + gArgs . AddArg ( " - uiplatform " , strprintf ( " Select platform to customize UI for ( one of windows , macosx , other ; default : % s ) " , BitcoinGUI : : DEFAULT_UIPLATFORM ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : GUI ) ; <nl> } <nl> <nl> int GuiMain ( int argc , char * argv [ ] ) <nl> mmm a / src / test / getarg_tests . cpp <nl> ppp b / src / test / getarg_tests . cpp <nl> static void SetupArgs ( const std : : vector < std : : string > & args ) <nl> { <nl> gArgs . ClearArgs ( ) ; <nl> for ( const std : : string & arg : args ) { <nl> - gArgs . AddArg ( arg , " " , false , OptionsCategory : : OPTIONS ) ; <nl> + gArgs . AddArg ( arg , " " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> } <nl> } <nl> <nl> mmm a / src / test / util_tests . cpp <nl> ppp b / src / test / util_tests . cpp <nl> struct TestArgsManager : public ArgsManager <nl> void SetupArgs ( int argv , const char * args [ ] ) <nl> { <nl> for ( int i = 0 ; i < argv ; + + i ) { <nl> - AddArg ( args [ i ] , " " , false , OptionsCategory : : OPTIONS ) ; <nl> + AddArg ( args [ i ] , " " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> } <nl> } <nl> using ArgsManager : : ReadConfigStream ; <nl> BOOST_FIXTURE_TEST_CASE ( util_ArgsMerge , ArgsMergeTestingSetup ) <nl> <nl> const std : : string & name = net_specific ? " wallet " : " server " ; <nl> const std : : string key = " - " + name ; <nl> - parser . AddArg ( key , name , false , OptionsCategory : : OPTIONS ) ; <nl> + parser . AddArg ( key , name , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> if ( net_specific ) parser . SetNetworkOnlyArg ( key ) ; <nl> <nl> auto args = GetValues ( arg_actions , section , name , " a " ) ; <nl> BOOST_FIXTURE_TEST_CASE ( util_ChainMerge , ChainMergeTestingSetup ) <nl> ForEachMergeSetup ( [ & ] ( const ActionList & arg_actions , const ActionList & conf_actions ) { <nl> TestArgsManager parser ; <nl> LOCK ( parser . cs_args ) ; <nl> - parser . AddArg ( " - regtest " , " regtest " , false , OptionsCategory : : OPTIONS ) ; <nl> - parser . AddArg ( " - testnet " , " testnet " , false , OptionsCategory : : OPTIONS ) ; <nl> + parser . AddArg ( " - regtest " , " regtest " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> + parser . AddArg ( " - testnet " , " testnet " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> <nl> auto arg = [ ] ( Action action ) { return action = = ENABLE_TEST ? " - testnet = 1 " : <nl> action = = DISABLE_TEST ? " - testnet = 0 " : <nl> mmm a / src / util / system . cpp <nl> ppp b / src / util / system . cpp <nl> void ArgsManager : : ForceSetArg ( const std : : string & strArg , const std : : string & strV <nl> m_override_args [ strArg ] = { strValue } ; <nl> } <nl> <nl> - void ArgsManager : : AddArg ( const std : : string & name , const std : : string & help , const bool debug_only , const OptionsCategory & cat ) <nl> + void ArgsManager : : AddArg ( const std : : string & name , const std : : string & help , unsigned int flags , const bool debug_only , const OptionsCategory & cat ) <nl> { <nl> / / Split arg name from its help param <nl> size_t eq_index = name . find ( ' = ' ) ; <nl> void ArgsManager : : AddArg ( const std : : string & name , const std : : string & help , const <nl> void ArgsManager : : AddHiddenArgs ( const std : : vector < std : : string > & names ) <nl> { <nl> for ( const std : : string & name : names ) { <nl> - AddArg ( name , " " , false , OptionsCategory : : HIDDEN ) ; <nl> + AddArg ( name , " " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : HIDDEN ) ; <nl> } <nl> } <nl> <nl> bool HelpRequested ( const ArgsManager & args ) <nl> <nl> void SetupHelpOptions ( ArgsManager & args ) <nl> { <nl> - args . AddArg ( " - ? " , " Print this help message and exit " , false , OptionsCategory : : OPTIONS ) ; <nl> + args . AddArg ( " - ? " , " Print this help message and exit " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : OPTIONS ) ; <nl> args . AddHiddenArgs ( { " - h " , " - help " } ) ; <nl> } <nl> <nl> mmm a / src / util / system . h <nl> ppp b / src / util / system . h <nl> class ArgsManager <nl> / * * <nl> * Add argument <nl> * / <nl> - void AddArg ( const std : : string & name , const std : : string & help , const bool debug_only , const OptionsCategory & cat ) ; <nl> + void AddArg ( const std : : string & name , const std : : string & help , unsigned int flags , const bool debug_only , const OptionsCategory & cat ) ; <nl> <nl> / * * <nl> * Add many hidden arguments <nl> mmm a / src / wallet / init . cpp <nl> ppp b / src / wallet / init . cpp <nl> const WalletInitInterface & g_wallet_init_interface = WalletInit ( ) ; <nl> <nl> void WalletInit : : AddWalletOptions ( ) const <nl> { <nl> - gArgs . AddArg ( " - addresstype " , strprintf ( " What type of addresses to use ( \ " legacy \ " , \ " p2sh - segwit \ " , or \ " bech32 \ " , default : \ " % s \ " ) " , FormatOutputType ( DEFAULT_ADDRESS_TYPE ) ) , false , OptionsCategory : : WALLET ) ; <nl> - gArgs . AddArg ( " - avoidpartialspends " , strprintf ( " Group outputs by address , selecting all or none , instead of selecting on a per - output basis . Privacy is improved as an address is only used once ( unless someone sends to it after spending from it ) , but may result in slightly higher fees as suboptimal coin selection may result due to the added limitation ( default : % u ( always enabled for wallets with \ " avoid_reuse \ " enabled ) ) " , DEFAULT_AVOIDPARTIALSPENDS ) , false , OptionsCategory : : WALLET ) ; <nl> - gArgs . AddArg ( " - changetype " , " What type of change to use ( \ " legacy \ " , \ " p2sh - segwit \ " , or \ " bech32 \ " ) . Default is same as - addresstype , except when - addresstype = p2sh - segwit a native segwit output is used when sending to a native segwit address ) " , false , OptionsCategory : : WALLET ) ; <nl> - gArgs . AddArg ( " - disablewallet " , " Do not load the wallet and disable wallet RPC calls " , false , OptionsCategory : : WALLET ) ; <nl> + gArgs . AddArg ( " - addresstype " , strprintf ( " What type of addresses to use ( \ " legacy \ " , \ " p2sh - segwit \ " , or \ " bech32 \ " , default : \ " % s \ " ) " , FormatOutputType ( DEFAULT_ADDRESS_TYPE ) ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> + gArgs . AddArg ( " - avoidpartialspends " , strprintf ( " Group outputs by address , selecting all or none , instead of selecting on a per - output basis . Privacy is improved as an address is only used once ( unless someone sends to it after spending from it ) , but may result in slightly higher fees as suboptimal coin selection may result due to the added limitation ( default : % u ( always enabled for wallets with \ " avoid_reuse \ " enabled ) ) " , DEFAULT_AVOIDPARTIALSPENDS ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> + gArgs . AddArg ( " - changetype " , " What type of change to use ( \ " legacy \ " , \ " p2sh - segwit \ " , or \ " bech32 \ " ) . Default is same as - addresstype , except when - addresstype = p2sh - segwit a native segwit output is used when sending to a native segwit address ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> + gArgs . AddArg ( " - disablewallet " , " Do not load the wallet and disable wallet RPC calls " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> gArgs . AddArg ( " - discardfee = < amt > " , strprintf ( " The fee rate ( in % s / kB ) that indicates your tolerance for discarding change by adding it to the fee ( default : % s ) . " <nl> " Note : An output is discarded if it is dust at this rate , but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target " , <nl> - CURRENCY_UNIT , FormatMoney ( DEFAULT_DISCARD_FEE ) ) , false , OptionsCategory : : WALLET ) ; <nl> + CURRENCY_UNIT , FormatMoney ( DEFAULT_DISCARD_FEE ) ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> gArgs . AddArg ( " - fallbackfee = < amt > " , strprintf ( " A fee rate ( in % s / kB ) that will be used when fee estimation has insufficient data ( default : % s ) " , <nl> - CURRENCY_UNIT , FormatMoney ( DEFAULT_FALLBACK_FEE ) ) , false , OptionsCategory : : WALLET ) ; <nl> - gArgs . AddArg ( " - keypool = < n > " , strprintf ( " Set key pool size to < n > ( default : % u ) " , DEFAULT_KEYPOOL_SIZE ) , false , OptionsCategory : : WALLET ) ; <nl> + CURRENCY_UNIT , FormatMoney ( DEFAULT_FALLBACK_FEE ) ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> + gArgs . AddArg ( " - keypool = < n > " , strprintf ( " Set key pool size to < n > ( default : % u ) " , DEFAULT_KEYPOOL_SIZE ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> gArgs . AddArg ( " - maxtxfee = < amt > " , strprintf ( " Maximum total fees ( in % s ) to use in a single wallet transaction ; setting this too low may abort large transactions ( default : % s ) " , <nl> - CURRENCY_UNIT , FormatMoney ( DEFAULT_TRANSACTION_MAXFEE ) ) , false , OptionsCategory : : DEBUG_TEST ) ; <nl> + CURRENCY_UNIT , FormatMoney ( DEFAULT_TRANSACTION_MAXFEE ) ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : DEBUG_TEST ) ; <nl> gArgs . AddArg ( " - mintxfee = < amt > " , strprintf ( " Fees ( in % s / kB ) smaller than this are considered zero fee for transaction creation ( default : % s ) " , <nl> - CURRENCY_UNIT , FormatMoney ( DEFAULT_TRANSACTION_MINFEE ) ) , false , OptionsCategory : : WALLET ) ; <nl> + CURRENCY_UNIT , FormatMoney ( DEFAULT_TRANSACTION_MINFEE ) ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> gArgs . AddArg ( " - paytxfee = < amt > " , strprintf ( " Fee ( in % s / kB ) to add to transactions you send ( default : % s ) " , <nl> - CURRENCY_UNIT , FormatMoney ( CFeeRate { DEFAULT_PAY_TX_FEE } . GetFeePerK ( ) ) ) , false , OptionsCategory : : WALLET ) ; <nl> - gArgs . AddArg ( " - rescan " , " Rescan the block chain for missing wallet transactions on startup " , false , OptionsCategory : : WALLET ) ; <nl> - gArgs . AddArg ( " - salvagewallet " , " Attempt to recover private keys from a corrupt wallet on startup " , false , OptionsCategory : : WALLET ) ; <nl> - gArgs . AddArg ( " - spendzeroconfchange " , strprintf ( " Spend unconfirmed change when sending transactions ( default : % u ) " , DEFAULT_SPEND_ZEROCONF_CHANGE ) , false , OptionsCategory : : WALLET ) ; <nl> - gArgs . AddArg ( " - txconfirmtarget = < n > " , strprintf ( " If paytxfee is not set , include enough fee so transactions begin confirmation on average within n blocks ( default : % u ) " , DEFAULT_TX_CONFIRM_TARGET ) , false , OptionsCategory : : WALLET ) ; <nl> - gArgs . AddArg ( " - upgradewallet " , " Upgrade wallet to latest format on startup " , false , OptionsCategory : : WALLET ) ; <nl> - gArgs . AddArg ( " - wallet = < path > " , " Specify wallet database path . Can be specified multiple times to load multiple wallets . Path is interpreted relative to < walletdir > if it is not absolute , and will be created if it does not exist ( as a directory containing a wallet . dat file and log files ) . For backwards compatibility this will also accept names of existing data files in < walletdir > . ) " , false , OptionsCategory : : WALLET ) ; <nl> - gArgs . AddArg ( " - walletbroadcast " , strprintf ( " Make the wallet broadcast transactions ( default : % u ) " , DEFAULT_WALLETBROADCAST ) , false , OptionsCategory : : WALLET ) ; <nl> - gArgs . AddArg ( " - walletdir = < dir > " , " Specify directory to hold wallets ( default : < datadir > / wallets if it exists , otherwise < datadir > ) " , false , OptionsCategory : : WALLET ) ; <nl> + CURRENCY_UNIT , FormatMoney ( CFeeRate { DEFAULT_PAY_TX_FEE } . GetFeePerK ( ) ) ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> + gArgs . AddArg ( " - rescan " , " Rescan the block chain for missing wallet transactions on startup " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> + gArgs . AddArg ( " - salvagewallet " , " Attempt to recover private keys from a corrupt wallet on startup " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> + gArgs . AddArg ( " - spendzeroconfchange " , strprintf ( " Spend unconfirmed change when sending transactions ( default : % u ) " , DEFAULT_SPEND_ZEROCONF_CHANGE ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> + gArgs . AddArg ( " - txconfirmtarget = < n > " , strprintf ( " If paytxfee is not set , include enough fee so transactions begin confirmation on average within n blocks ( default : % u ) " , DEFAULT_TX_CONFIRM_TARGET ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> + gArgs . AddArg ( " - upgradewallet " , " Upgrade wallet to latest format on startup " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> + gArgs . AddArg ( " - wallet = < path > " , " Specify wallet database path . Can be specified multiple times to load multiple wallets . Path is interpreted relative to < walletdir > if it is not absolute , and will be created if it does not exist ( as a directory containing a wallet . dat file and log files ) . For backwards compatibility this will also accept names of existing data files in < walletdir > . ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> + gArgs . AddArg ( " - walletbroadcast " , strprintf ( " Make the wallet broadcast transactions ( default : % u ) " , DEFAULT_WALLETBROADCAST ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> + gArgs . AddArg ( " - walletdir = < dir > " , " Specify directory to hold wallets ( default : < datadir > / wallets if it exists , otherwise < datadir > ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> # if HAVE_SYSTEM <nl> - gArgs . AddArg ( " - walletnotify = < cmd > " , " Execute command when a wallet transaction changes ( % s in cmd is replaced by TxID ) " , false , OptionsCategory : : WALLET ) ; <nl> + gArgs . AddArg ( " - walletnotify = < cmd > " , " Execute command when a wallet transaction changes ( % s in cmd is replaced by TxID ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> # endif <nl> - gArgs . AddArg ( " - walletrbf " , strprintf ( " Send transactions with full - RBF opt - in enabled ( RPC only , default : % u ) " , DEFAULT_WALLET_RBF ) , false , OptionsCategory : : WALLET ) ; <nl> + gArgs . AddArg ( " - walletrbf " , strprintf ( " Send transactions with full - RBF opt - in enabled ( RPC only , default : % u ) " , DEFAULT_WALLET_RBF ) , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> gArgs . AddArg ( " - zapwallettxes = < mode > " , " Delete all wallet transactions and only recover those parts of the blockchain through - rescan on startup " <nl> - " ( 1 = keep tx meta data e . g . payment request information , 2 = drop tx meta data ) " , false , OptionsCategory : : WALLET ) ; <nl> + " ( 1 = keep tx meta data e . g . payment request information , 2 = drop tx meta data ) " , ArgsManager : : ALLOW_ANY , false , OptionsCategory : : WALLET ) ; <nl> <nl> - gArgs . AddArg ( " - dblogsize = < n > " , strprintf ( " Flush wallet database activity from memory to disk log every < n > megabytes ( default : % u ) " , DEFAULT_WALLET_DBLOGSIZE ) , true , OptionsCategory : : WALLET_DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - flushwallet " , strprintf ( " Run a thread to flush wallet periodically ( default : % u ) " , DEFAULT_FLUSHWALLET ) , true , OptionsCategory : : WALLET_DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - privdb " , strprintf ( " Sets the DB_PRIVATE flag in the wallet db environment ( default : % u ) " , DEFAULT_WALLET_PRIVDB ) , true , OptionsCategory : : WALLET_DEBUG_TEST ) ; <nl> - gArgs . AddArg ( " - walletrejectlongchains " , strprintf ( " Wallet will not create transactions that violate mempool chain limits ( default : % u ) " , DEFAULT_WALLET_REJECT_LONG_CHAINS ) , true , OptionsCategory : : WALLET_DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - dblogsize = < n > " , strprintf ( " Flush wallet database activity from memory to disk log every < n > megabytes ( default : % u ) " , DEFAULT_WALLET_DBLOGSIZE ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : WALLET_DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - flushwallet " , strprintf ( " Run a thread to flush wallet periodically ( default : % u ) " , DEFAULT_FLUSHWALLET ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : WALLET_DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - privdb " , strprintf ( " Sets the DB_PRIVATE flag in the wallet db environment ( default : % u ) " , DEFAULT_WALLET_PRIVDB ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : WALLET_DEBUG_TEST ) ; <nl> + gArgs . AddArg ( " - walletrejectlongchains " , strprintf ( " Wallet will not create transactions that violate mempool chain limits ( default : % u ) " , DEFAULT_WALLET_REJECT_LONG_CHAINS ) , ArgsManager : : ALLOW_ANY , true , OptionsCategory : : WALLET_DEBUG_TEST ) ; <nl> } <nl> <nl> bool WalletInit : : ParameterInteraction ( ) const <nl>
scripted - diff : Use Flags enum in AddArg ( )
bitcoin/bitcoin
1b4b9422cad28d1bead24ff5fd472536954cfaf9
2019-07-27T12:05:14Z
mmm a / src / DataStreams / PushingToViewsBlockOutputStream . cpp <nl> ppp b / src / DataStreams / PushingToViewsBlockOutputStream . cpp <nl> namespace DB <nl> <nl> PushingToViewsBlockOutputStream : : PushingToViewsBlockOutputStream ( <nl> const StoragePtr & storage_ , <nl> - const Context & context_ , const ASTPtr & query_ptr_ , bool no_destination ) <nl> - : storage ( storage_ ) , context ( context_ ) , query_ptr ( query_ptr_ ) <nl> + const StorageMetadataPtr & metadata_snapshot_ , <nl> + const Context & context_ , <nl> + const ASTPtr & query_ptr_ , <nl> + bool no_destination ) <nl> + : storage ( storage_ ) <nl> + , metadata_snapshot ( metadata_snapshot_ ) <nl> + , context ( context_ ) <nl> + , query_ptr ( query_ptr_ ) <nl> { <nl> / * * TODO This is a very important line . At any insertion into the table one of streams should own lock . <nl> * Although now any insertion into the table is done via PushingToViewsBlockOutputStream , <nl> PushingToViewsBlockOutputStream : : PushingToViewsBlockOutputStream ( <nl> for ( const auto & database_table : dependencies ) <nl> { <nl> auto dependent_table = DatabaseCatalog : : instance ( ) . getTable ( database_table , context ) ; <nl> + auto dependent_metadata_snapshot = dependent_table - > getInMemoryMetadataPtr ( ) ; <nl> <nl> ASTPtr query ; <nl> BlockOutputStreamPtr out ; <nl> PushingToViewsBlockOutputStream : : PushingToViewsBlockOutputStream ( <nl> out = io . out ; <nl> } <nl> else if ( dynamic_cast < const StorageLiveView * > ( dependent_table . get ( ) ) ) <nl> - out = std : : make_shared < PushingToViewsBlockOutputStream > ( dependent_table , * insert_context , ASTPtr ( ) , true ) ; <nl> + out = std : : make_shared < PushingToViewsBlockOutputStream > ( <nl> + dependent_table , dependent_metadata_snapshot , * insert_context , ASTPtr ( ) , true ) ; <nl> else <nl> - out = std : : make_shared < PushingToViewsBlockOutputStream > ( dependent_table , * insert_context , ASTPtr ( ) ) ; <nl> + out = std : : make_shared < PushingToViewsBlockOutputStream > ( <nl> + dependent_table , dependent_metadata_snapshot , * insert_context , ASTPtr ( ) ) ; <nl> <nl> views . emplace_back ( ViewInfo { std : : move ( query ) , database_table , std : : move ( out ) , nullptr } ) ; <nl> } <nl> Block PushingToViewsBlockOutputStream : : getHeader ( ) const <nl> / / / If we don ' t write directly to the destination <nl> / / / then expect that we ' re inserting with precalculated virtual columns <nl> if ( output ) <nl> - return storage - > getSampleBlock ( ) ; <nl> + return metadata_snapshot - > getSampleBlock ( ) ; <nl> else <nl> - return storage - > getSampleBlockWithVirtuals ( ) ; <nl> + return metadata_snapshot - > getSampleBlockWithVirtuals ( storage - > getVirtuals ( ) ) ; <nl> } <nl> <nl> <nl> mmm a / src / DataStreams / PushingToViewsBlockOutputStream . h <nl> ppp b / src / DataStreams / PushingToViewsBlockOutputStream . h <nl> class ReplicatedMergeTreeBlockOutputStream ; <nl> class PushingToViewsBlockOutputStream : public IBlockOutputStream <nl> { <nl> public : <nl> - PushingToViewsBlockOutputStream ( const StoragePtr & storage_ , <nl> - const Context & context_ , const ASTPtr & query_ptr_ , bool no_destination = false ) ; <nl> + PushingToViewsBlockOutputStream ( <nl> + const StoragePtr & storage_ , <nl> + const StorageMetadataPtr & metadata_snapshot_ , <nl> + const Context & context_ , <nl> + const ASTPtr & query_ptr_ , <nl> + bool no_destination = false ) ; <nl> <nl> Block getHeader ( ) const override ; <nl> void write ( const Block & block ) override ; <nl> class PushingToViewsBlockOutputStream : public IBlockOutputStream <nl> <nl> private : <nl> StoragePtr storage ; <nl> + StorageMetadataPtr metadata_snapshot ; <nl> BlockOutputStreamPtr output ; <nl> ReplicatedMergeTreeBlockOutputStream * replicated_output = nullptr ; <nl> <nl> mmm a / src / Interpreters / InterpreterInsertQuery . cpp <nl> ppp b / src / Interpreters / InterpreterInsertQuery . cpp <nl> Block InterpreterInsertQuery : : getSampleBlock ( <nl> if ( ! query . columns ) <nl> { <nl> if ( no_destination ) <nl> - return table - > getSampleBlockWithVirtuals ( ) ; <nl> + return metadata_snapshot - > getSampleBlockWithVirtuals ( table - > getVirtuals ( ) ) ; <nl> else <nl> return table_sample_non_materialized ; <nl> } <nl> BlockIO InterpreterInsertQuery : : execute ( ) <nl> if ( table - > noPushingToViews ( ) & & ! no_destination ) <nl> out = table - > write ( query_ptr , metadata_snapshot , context ) ; <nl> else <nl> - out = std : : make_shared < PushingToViewsBlockOutputStream > ( table , context , query_ptr , no_destination ) ; <nl> + out = std : : make_shared < PushingToViewsBlockOutputStream > ( table , metadata_snapshot , context , query_ptr , no_destination ) ; <nl> <nl> / / / Note that we wrap transforms one on top of another , so we write them in reverse of data processing order . <nl> <nl> mmm a / src / Storages / IStorage . cpp <nl> ppp b / src / Storages / IStorage . cpp <nl> Block IStorage : : getSampleBlock ( ) const <nl> return res ; <nl> } <nl> <nl> - Block IStorage : : getSampleBlockWithVirtuals ( ) const <nl> - { <nl> - auto res = getSampleBlock ( ) ; <nl> - <nl> - / / / Virtual columns must be appended after ordinary , because user can <nl> - / / / override them . <nl> - for ( const auto & column : getVirtuals ( ) ) <nl> - res . insert ( { column . type - > createColumn ( ) , column . type , column . name } ) ; <nl> - <nl> - return res ; <nl> - } <nl> - <nl> - <nl> Block IStorage : : getSampleBlockForColumns ( const Names & column_names ) const <nl> { <nl> Block res ; <nl> mmm a / src / Storages / IStorage . h <nl> ppp b / src / Storages / IStorage . h <nl> class IStorage : public std : : enable_shared_from_this < IStorage > , public TypePromo <nl> void setInMemoryMetadata ( const StorageInMemoryMetadata & metadata_ ) { metadata = std : : make_shared < StorageInMemoryMetadata > ( metadata_ ) ; } <nl> <nl> Block getSampleBlock ( ) const ; / / / ordinary + materialized . <nl> - Block getSampleBlockWithVirtuals ( ) const ; / / / ordinary + materialized + virtuals . <nl> Block getSampleBlockForColumns ( const Names & column_names ) const ; / / / ordinary + materialized + aliases + virtuals . <nl> <nl> / / / Verify that all the requested names are in the table and are set correctly : <nl> mmm a / src / Storages / StorageInMemoryMetadata . cpp <nl> ppp b / src / Storages / StorageInMemoryMetadata . cpp <nl> Block StorageInMemoryMetadata : : getSampleBlockNonMaterialized ( ) const <nl> <nl> return res ; <nl> } <nl> + <nl> + Block StorageInMemoryMetadata : : getSampleBlockWithVirtuals ( const NamesAndTypesList & virtuals ) const <nl> + { <nl> + auto res = getSampleBlock ( ) ; <nl> + <nl> + / / / Virtual columns must be appended after ordinary , because user can <nl> + / / / override them . <nl> + for ( const auto & column : virtuals ) <nl> + res . insert ( { column . type - > createColumn ( ) , column . type , column . name } ) ; <nl> + <nl> + return res ; <nl> + } <nl> + <nl> + Block StorageInMemoryMetadata : : getSampleBlock ( ) const <nl> + { <nl> + Block res ; <nl> + <nl> + for ( const auto & column : getColumns ( ) . getAllPhysical ( ) ) <nl> + res . insert ( { column . type - > createColumn ( ) , column . type , column . name } ) ; <nl> + <nl> + return res ; <nl> + } <nl> } <nl> mmm a / src / Storages / StorageInMemoryMetadata . h <nl> ppp b / src / Storages / StorageInMemoryMetadata . h <nl> struct StorageInMemoryMetadata <nl> / / / indices , TTL expressions ) if we update @ updated_columns set of columns . <nl> ColumnDependencies getColumnDependencies ( const NameSet & updated_columns ) const ; <nl> <nl> + Block getSampleBlock ( ) const ; / / / ordinary + materialized . <nl> Block getSampleBlockNonMaterialized ( ) const ; / / / ordinary . <nl> + Block getSampleBlockWithVirtuals ( const NamesAndTypesList & virtuals ) const ; / / / ordinary + materialized + virtuals . <nl> } ; <nl> <nl> using StorageMetadataPtr = std : : shared_ptr < StorageInMemoryMetadata > ; <nl>
getSampleBlockWithVirtuals in StorageInMemoryMetadata
ClickHouse/ClickHouse
08b9aa6b2ed0b39e542e0077efea231374a1ba32
2020-06-16T12:58:05Z
mmm a / xbmc / peripherals / devices / PeripheralCecAdapter . cpp <nl> ppp b / xbmc / peripherals / devices / PeripheralCecAdapter . cpp <nl> void CPeripheralCecAdapter : : SetConfigurationFromLibCEC ( const CEC : : libcec_configu <nl> / / set the primary device type <nl> m_configuration . deviceTypes . Clear ( ) ; <nl> m_configuration . deviceTypes . Add ( config . deviceTypes [ 0 ] ) ; <nl> - bChanged | = SetSetting ( " device_type " , ( int ) config . deviceTypes [ 0 ] ) ; <nl> <nl> / / hide the " connected device " and " hdmi port number " settings when the PA was autodetected <nl> bool bPAAutoDetected ( config . bAutodetectAddress = = 1 ) ; <nl>
[ cec ] don ' t update the device type in settings with the value that was returned from libCEC
xbmc/xbmc
809c430e627022f17cd40ce9cc2ad85c53ba4760
2013-01-09T01:21:27Z
mmm a / Marlin / language . h <nl> ppp b / Marlin / language . h <nl> <nl> / / LCD Menu Messages <nl> / / Please note these are limited to 17 characters ! <nl> <nl> - # define WELCOME_MSG MACHINE_NAME " Готов . " <nl> + # define WELCOME_MSG MACHINE_NAME " Готов . " <nl> # define MSG_SD_INSERTED " Карта вставлена " <nl> # define MSG_SD_REMOVED " Карта извлечена " <nl> - # define MSG_MAIN " Меню \ 003 " <nl> + # define MSG_MAIN " Меню \ 003 " <nl> # define MSG_AUTOSTART " Автостарт " <nl> # define MSG_DISABLE_STEPPERS " Выкл . двигатели " <nl> # define MSG_AUTO_HOME " Парковка " <nl> <nl> # define MSG_WATCH " Обзор \ 003 " <nl> # define MSG_PREPARE " Действия \ x7E " <nl> # define MSG_TUNE " Настройки \ x7E " <nl> - # define MSG_RESUME_PRINT " Продолжить печать " <nl> - # define MSG_RESUME_PRINT " Продолжить печать " <nl> + # define MSG_PAUSE_PRINT " Продолжить печать " <nl> + # define MSG_RESUME_PRINT " возобн . печать " <nl> # define MSG_STOP_PRINT " Остановить печать " <nl> # define MSG_CARD_MENU " Меню карты \ x7E " <nl> # define MSG_NO_CARD " Нет карты " <nl>
Bugfixes for language option 6 ( russian )
MarlinFirmware/Marlin
c8cdd1fc6f01505f3a3cd5e584f8d221610232b8
2014-03-19T13:27:38Z
mmm a / examples / node / greeter_client . js <nl> ppp b / examples / node / greeter_client . js <nl> var hello_proto = grpc . load ( PROTO_PATH ) . helloworld ; <nl> <nl> function main ( ) { <nl> var client = new hello_proto . Greeter ( ' localhost : 50051 ' , <nl> - grpc . Credentials . createInsecure ( ) ) ; <nl> + grpc . credentials . createInsecure ( ) ) ; <nl> var user ; <nl> if ( process . argv . length > = 3 ) { <nl> user = process . argv [ 2 ] ; <nl>
fix node example
grpc/grpc
f02c535878c944f070322cc0c2775d933687b432
2015-10-24T20:45:04Z
mmm a / admin / static / coffee / dashboard . coffee <nl> ppp b / admin / static / coffee / dashboard . coffee <nl> module ' DashboardView ' , - > <nl> $ popover . on ' clickoutside ' , ( e ) - > <nl> if e . target isnt event . target # so we don ' t remove the popover when we click on the link <nl> $ ( e . currentTarget ) . remove ( ) <nl> - <nl> + $ ( ' . popover_close ' ) . on ' click ' , ( e ) - > <nl> + $ ( e . target ) . parent ( ) . parent ( ) . remove ( ) <nl> initialize : - > <nl> log_initial ' ( initializing ) dashboard cluster status ' <nl> issues . on ' all ' , @ render <nl> mmm a / admin / static / coffee / namespaces / namespace . html <nl> ppp b / admin / static / coffee / namespaces / namespace . html <nl> < h3 class = " title " > Performance < / h3 > <nl> < ul class = " nav nav - tabs " > <nl> < li class = " active " > < a href = " # namespace - overview " data - toggle = " tab " > Overview < / a > < / li > <nl> < li > < a href = " # namespace - replication " class = " namespace_replication - link " data - toggle = " tab " > Replication < / a > < / li > <nl> - < li > < a href = " # namespace - sharding " class = " namespace_sharding - link " data - toggle = " tab " > Sharding < / a > < / li > <nl> - < li > < a href = " # namespace - pinning " class = " namespace_pinning - link " data - toggle = " tab " > Pinning < / a > < / li > <nl> - < li > < a href = " # namespace - other " class = " namespace_other - link " data - toggle = " tab " > Other < / a > < / li > <nl> + < li > < a href = " # namespace - sharding " class = " namespace_sharding - link " data - toggle = " tab " > Shards < / a > < / li > <nl> + < li > < a href = " # namespace - pinning " class = " namespace_pinning - link " data - toggle = " tab " > Machine assignments < / a > < / li > <nl> + < li > < a href = " # namespace - other " class = " namespace_other - link " data - toggle = " tab " > Other operations < / a > < / li > <nl> < / ul > <nl> <nl> < div id = " user - alert - space " > { { print_safe old_alert_html } } < / div > <nl> mmm a / admin / static / coffee / sidebar . coffee <nl> ppp b / admin / static / coffee / sidebar . coffee <nl> module ' Sidebar ' , - > <nl> $ popover . on ' clickoutside ' , ( e ) - > <nl> if e . target isnt event . target # so we don ' t remove the popover when we click on the link <nl> $ ( e . currentTarget ) . remove ( ) <nl> + $ ( ' . popover_close ' ) . on ' click ' , ( e ) - > <nl> + $ ( e . target ) . parent ( ) . parent ( ) . remove ( ) <nl> + <nl> <nl> render : = > <nl> json = _ . extend @ model . toJSON ( ) , @ model . get_formatted_message ( ) <nl> mmm a / admin / static / js / bootstrap / bootstrap - popover . js <nl> ppp b / admin / static / js / bootstrap / bootstrap - popover . js <nl> <nl> $ . fn . popover . defaults = $ . extend ( { } , $ . fn . tooltip . defaults , { <nl> placement : ' right ' <nl> , content : ' ' <nl> - , template : ' < div class = " popover " > < div class = " arrow " > < / div > < div class = " popover - inner " > < h3 class = " popover - title " > < / h3 > < div class = " popover - content " > < p > < / p > < / div > < / div > < / div > ' <nl> + , template : ' < div class = " popover " > < div class = " arrow " > < / div > < div class = " popover - inner " > < a class = " popover_close " href = " # " > x < / a > < h3 class = " popover - title " > < / h3 > < div class = " popover - content " > < p > < / p > < / div > < / div > < / div > ' <nl> } ) <nl> <nl> - } ( window . jQuery ) ; <nl> \ No newline at end of file <nl> + } ( window . jQuery ) ; <nl> mmm a / admin / static / less / cluster . less <nl> ppp b / admin / static / less / cluster . less <nl> <nl> width : auto ; <nl> } <nl> } <nl> + <nl> + / * popover * / <nl> + . popover_close { <nl> + float : right ; <nl> + margin : 7px ; <nl> + font - size : 20px ; <nl> + font - weight : bold ; <nl> + line - height : @ baseLineHeight ; <nl> + color : @ black ; <nl> + text - shadow : 0 1px 0 rgba ( 255 , 255 , 255 , 1 ) ; <nl> + . opacity ( 20 ) ; <nl> + & : hover { <nl> + color : @ black ; <nl> + text - decoration : none ; <nl> + . opacity ( 40 ) ; <nl> + cursor : pointer ; <nl> + } <nl> + } <nl>
Add a cross to close popover for sidebar and dashboard
rethinkdb/rethinkdb
a223d4cf610b884a59dd7245e80788b51def87bd
2012-07-24T23:02:02Z
mmm a / torch / onnx / symbolic . py <nl> ppp b / torch / onnx / symbolic . py <nl> def log_softmax ( g , input , dim = None ) : <nl> <nl> def unfold ( g , input , dimension , size , step ) : <nl> return g . op ( " ATen " , input , operator_s = " unfold " , dimension_i = dimension , size_i = size , step_i = step ) <nl> + <nl> + <nl> + def expand ( g , input , size ) : <nl> + return g . op ( " ATen " , input , operator_s = " expand " , size_i = size ) <nl>
ATen expand symbolic
pytorch/pytorch
47f999b814515a6fac03be9d242d8f24917d3a80
2017-10-31T00:24:46Z
mmm a / cores / esp8266 / core_esp8266_waveform . cpp <nl> ppp b / cores / esp8266 / core_esp8266_waveform . cpp <nl> int ICACHE_RAM_ATTR stopWaveform ( uint8_t pin ) { <nl> } <nl> / / If user sends in a pin > 16 but < 32 , this will always point to a 0 bit <nl> / / If they send > = 32 , then the shift will result in 0 and it will also return false <nl> - uint32_t mask = 1 < < pin ; <nl> - if ( ! ( waveformEnabled & mask ) ) { <nl> - return false ; / / It ' s not running , nothing to do here <nl> - } <nl> - waveformToDisable | = mask ; <nl> - / / Ensure timely service . . . . <nl> - if ( T1L > microsecondsToClockCycles ( 10 ) ) { <nl> - timer1_write ( microsecondsToClockCycles ( 10 ) ) ; <nl> - } <nl> - while ( waveformToDisable ) { <nl> - / * no - op * / / / Can ' t delay ( ) since stopWaveform may be called from an IRQ <nl> + if ( waveformEnabled & ( 1UL < < pin ) ) { <nl> + waveformToDisable = 1UL < < pin ; <nl> + / / Must not interfere if Timer is due shortly <nl> + if ( T1L > microsecondsToClockCycles ( 10 ) ) { <nl> + timer1_write ( microsecondsToClockCycles ( 10 ) ) ; <nl> + } <nl> + while ( waveformToDisable ) { <nl> + / * no - op * / / / Can ' t delay ( ) since stopWaveform may be called from an IRQ <nl> + } <nl> } <nl> if ( ! waveformEnabled & & ! timer1CB ) { <nl> deinitTimer ( ) ; <nl>
Allow stopWaveform to stop timed - out waveforms ( )
esp8266/Arduino
36e047e908cfa6eafaaf824988070b49f2c2ff2a
2020-04-23T23:00:17Z
mmm a / src / video_core / renderer_opengl / gl_rasterizer . cpp <nl> ppp b / src / video_core / renderer_opengl / gl_rasterizer . cpp <nl> struct FramebufferCacheKey { <nl> } <nl> } ; <nl> <nl> - RasterizerOpenGL : : RasterizerOpenGL ( Core : : Frontend : : EmuWindow & window , Core : : System & system , <nl> - ScreenInfo & info ) <nl> + RasterizerOpenGL : : RasterizerOpenGL ( Core : : System & system , ScreenInfo & info ) <nl> : res_cache { * this } , shader_cache { * this , system } , global_cache { * this } , system { system } , <nl> screen_info { info } , buffer_cache ( * this , STREAM_BUFFER_SIZE ) { <nl> / / Create sampler objects <nl>
Fix bad rebase
yuzu-emu/yuzu
797e351bf816f86f689ee2704eb95c63411d4002
2019-04-08T15:35:22Z
mmm a / tensorflow / python / training / checkpoint_utils . py <nl> ppp b / tensorflow / python / training / checkpoint_utils . py <nl> def init_from_checkpoint ( ckpt_dir_or_file , assignment_map ) : <nl> partitioner = lambda shape , dtype : [ 5 , 1 ] ) <nl> <nl> # Initialize all variables in ` new_scope_1 ` from ` old_scope_1 ` . <nl> - init_from_checkpoint ( ' / tmp / model . ckpt ' , { ' old_scope_1 / ' , ' new_scope_1 ' } ) <nl> + init_from_checkpoint ( ' / tmp / model . ckpt ' , { ' old_scope_1 / ' : ' new_scope_1 ' } ) <nl> <nl> # Use names to specify which variables to initialize from checkpoint . <nl> init_from_checkpoint ( ' / tmp / model . ckpt ' , <nl>
fixed typo in docstring
tensorflow/tensorflow
0d85df2cffdaf284950a67510d132bbdf9f02439
2018-06-20T17:17:25Z
mmm a / lib / SILOptimizer / Utils / CheckedCastBrJumpThreading . cpp <nl> ppp b / lib / SILOptimizer / Utils / CheckedCastBrJumpThreading . cpp <nl> areEquivalentConditionsAlongSomePaths ( CheckedCastBranchInst * DomCCBI , <nl> / / ArgBB is not the entry block and has predecessors . <nl> unsigned idx = 0 ; <nl> for ( auto * PredBB : ArgBB - > getPreds ( ) ) { <nl> + <nl> + / / We must avoid that we are going to change a block twice . <nl> + if ( BlocksToEdit . count ( PredBB ) ! = 0 ) <nl> + return false ; <nl> + <nl> auto IncomingValue = IncomingValues [ idx ] ; <nl> SILValue ReachingValue = isArgValueEquivalentToCondition ( <nl> IncomingValue , DomBB , DomCondition , DT ) ; <nl> mmm a / test / SILOptimizer / devirt_jump_thread_crasher . sil <nl> ppp b / test / SILOptimizer / devirt_jump_thread_crasher . sil <nl> bb15 : / / Preds : bb12 <nl> br bb13 ( % 54 : $ ( ) ) / / id : % 55 <nl> } <nl> <nl> + / / CHECK - LABEL : sil @ multiple_edits_in_adjacent_blocks <nl> + / / CHECK : bb0 ( % 0 : $ * Base ) : <nl> + / / CHECK : checked_cast_br % <nl> + / / CHECK : bb1 : <nl> + / / CHECK : checked_cast_br [ exact ] <nl> + / / CHECK - NOT : checked_cast_br <nl> + / / CHECK : return <nl> + sil @ multiple_edits_in_adjacent_blocks : $ @ convention ( method ) ( @ in Base ) - > ( ) { <nl> + bb0 ( % 0 : $ * Base ) : <nl> + % 1 = load % 0 : $ * Base <nl> + checked_cast_br % 1 : $ Base to $ Derived1 , bb8 , bb1 <nl> + <nl> + bb1 : <nl> + checked_cast_br [ exact ] % 1 : $ Base to $ Derived2 , bb2 , bb5 <nl> + <nl> + bb2 ( % 6 : $ Derived2 ) : <nl> + % 7 = upcast % 6 : $ Derived2 to $ Base <nl> + debug_value % 7 : $ Base , let , name " self " , argno 1 <nl> + checked_cast_br [ exact ] % 7 : $ Base to $ Base , bb3 , bb6 <nl> + <nl> + bb3 ( % 10 : $ Base ) : <nl> + debug_value % 10 : $ Base , let , name " self " , argno 1 <nl> + checked_cast_br % 10 : $ Base to $ Derived1 , bb4 , bb7 <nl> + <nl> + bb4 ( % 13 : $ Derived1 ) : <nl> + debug_value % 13 : $ Derived1 , let , name " scr " <nl> + br bb9 <nl> + <nl> + bb5 : <nl> + br bb9 <nl> + <nl> + bb6 : <nl> + br bb9 <nl> + <nl> + bb7 : <nl> + br bb9 <nl> + <nl> + bb8 ( % 14 : $ Derived1 ) : <nl> + br bb9 <nl> + <nl> + bb9 : <nl> + % 20 = tuple ( ) <nl> + return % 20 : $ ( ) <nl> + } <nl>
SimplifyCFG : fix a crash in checked_cast_br jump threading
apple/swift
07475054721faac47985c291a95e5406c3e27cf3
2016-02-10T20:14:23Z
mmm a / src / video_core / engines / maxwell_3d . h <nl> ppp b / src / video_core / engines / maxwell_3d . h <nl> class Maxwell3D final : public ConstBufferEngineInterface { <nl> <nl> } dirty { } ; <nl> <nl> - std : : array < u8 , Regs : : NUM_REGS > dirty_pointers { } ; <nl> - <nl> / / / Reads a register value located at the input method address <nl> u32 GetRegisterValue ( u32 method ) const ; <nl> <nl> class Maxwell3D final : public ConstBufferEngineInterface { <nl> <nl> bool execute_on { true } ; <nl> <nl> + std : : array < u8 , Regs : : NUM_REGS > dirty_pointers { } ; <nl> + <nl> / / / Retrieves information about a specific TIC entry from the TIC buffer . <nl> Texture : : TICEntry GetTICEntry ( u32 tic_index ) const ; <nl> <nl>
maxwell_3d : Make dirty_pointers private
yuzu-emu/yuzu
9e874898f500a736d764ec7f615b4ae59b6f5768
2020-01-16T09:07:15Z
mmm a / Marlin / Marlin_main . cpp <nl> ppp b / Marlin / Marlin_main . cpp <nl> inline void gcode_M999 ( ) { <nl> inline void move_extruder_servo ( uint8_t e ) { <nl> const int angles [ 2 ] = SWITCHING_EXTRUDER_SERVO_ANGLES ; <nl> MOVE_SERVO ( SWITCHING_EXTRUDER_SERVO_NR , angles [ e ] ) ; <nl> + delay ( 500 ) ; <nl> } <nl> # endif <nl> <nl> void tool_change ( const uint8_t tmp_extruder , const float fr_mm_s / * = 0 . 0 * / , bool n <nl> <nl> # if ENABLED ( SWITCHING_EXTRUDER ) <nl> / / < 0 if the new nozzle is higher , > 0 if lower . A bigger raise when lower . <nl> - float z_diff = hotend_offset [ Z_AXIS ] [ active_extruder ] - hotend_offset [ Z_AXIS ] [ tmp_extruder ] , <nl> - z_raise = 0 . 3 + ( z_diff > 0 . 0 ? z_diff : 0 . 0 ) ; <nl> + const float z_diff = hotend_offset [ Z_AXIS ] [ active_extruder ] - hotend_offset [ Z_AXIS ] [ tmp_extruder ] , <nl> + z_raise = 0 . 3 + ( z_diff > 0 . 0 ? z_diff : 0 . 0 ) ; <nl> <nl> / / Always raise by some amount ( destination copied from current_position earlier ) <nl> - float save_Z = destination [ Z_AXIS ] ; / / save Z for later on <nl> - destination [ Z_AXIS ] + = z_raise ; <nl> - planner . buffer_line_kinematic ( destination , planner . max_feedrate_mm_s [ Z_AXIS ] , active_extruder ) ; <nl> + current_position [ Z_AXIS ] + = z_raise ; <nl> + planner . buffer_line_kinematic ( current_position , planner . max_feedrate_mm_s [ Z_AXIS ] , active_extruder ) ; <nl> stepper . synchronize ( ) ; <nl> <nl> move_extruder_servo ( active_extruder ) ; <nl> - delay ( 500 ) ; <nl> - <nl> - / / Move back down , if needed <nl> - if ( z_raise ! = z_diff ) { <nl> - destination [ Z_AXIS ] = current_position [ Z_AXIS ] + z_diff ; <nl> - planner . buffer_line_kinematic ( destination , planner . max_feedrate_mm_s [ Z_AXIS ] , active_extruder ) ; <nl> - stepper . synchronize ( ) ; <nl> - } <nl> - destination [ Z_AXIS ] = save_Z ; / / restore original Z position so the ' Move to the " old position " ' is correct <nl> # endif <nl> <nl> / * * <nl> void tool_change ( const uint8_t tmp_extruder , const float fr_mm_s / * = 0 . 0 * / , bool n <nl> # endif <nl> <nl> / / Adjustments to the current position <nl> - float xydiff [ 2 ] = { offset_vec . x , offset_vec . y } ; <nl> + const float xydiff [ 2 ] = { offset_vec . x , offset_vec . y } ; <nl> current_position [ Z_AXIS ] + = offset_vec . z ; <nl> <nl> # else / / ! ABL_PLANAR <nl> <nl> - float xydiff [ 2 ] = { <nl> + const float xydiff [ 2 ] = { <nl> hotend_offset [ X_AXIS ] [ tmp_extruder ] - hotend_offset [ X_AXIS ] [ active_extruder ] , <nl> hotend_offset [ Y_AXIS ] [ tmp_extruder ] - hotend_offset [ Y_AXIS ] [ active_extruder ] <nl> } ; <nl> void tool_change ( const uint8_t tmp_extruder , const float fr_mm_s / * = 0 . 0 * / , bool n <nl> prepare_move_to_destination ( ) ; <nl> } <nl> <nl> + # if ENABLED ( SWITCHING_EXTRUDER ) <nl> + / / Move back down , if needed . ( Including when the new tool is higher . ) <nl> + if ( z_raise ! = z_diff ) { <nl> + destination [ Z_AXIS ] + = z_diff ; <nl> + feedrate_mm_s = planner . max_feedrate_mm_s [ Z_AXIS ] ; <nl> + prepare_move_to_destination ( ) ; <nl> + } <nl> + # endif <nl> + <nl> } / / ( tmp_extruder ! = active_extruder ) <nl> <nl> stepper . synchronize ( ) ; <nl> mmm a / Marlin / ultralcd . cpp <nl> ppp b / Marlin / ultralcd . cpp <nl> uint16_t max_display_update_time = 0 ; <nl> } <nl> else if ( screen = = lcd_status_screen & & currentScreen = = lcd_main_menu & & PENDING ( millis ( ) , doubleclick_expire_ms ) ) <nl> screen = lcd_babystep_z ; <nl> - # endif <nl> + # endif <nl> <nl> currentScreen = screen ; <nl> encoderPosition = encoder ; <nl>
Merge pull request from thinkyhead / rc_fix_toolchange_z
MarlinFirmware/Marlin
9b2b53f63aaa9729af7c2839454114f4226238c3
2017-03-19T05:34:41Z
mmm a / MMKVAppExtension . podspec <nl> ppp b / MMKVAppExtension . podspec <nl> Pod : : Spec . new do | s | <nl> s . name = " MMKVAppExtension " <nl> s . version = " 1 . 1 . 0 " <nl> s . summary = " MMKV is a cross - platform key - value storage framework developed by WeChat . " <nl> - s . module_name = " MMKV " <nl> + s . module_name = " MMKVAppExtension " <nl> <nl> s . description = < < - DESC <nl> The MMKV for iOS App Extensions . <nl> Pod : : Spec . new do | s | <nl> " CLANG_CXX_LANGUAGE_STANDARD " = > " gnu + + 17 " , <nl> " CLANG_CXX_LIBRARY " = > " libc + + " , <nl> " CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF " = > " NO " , <nl> - " GCC_PREPROCESSOR_DEFINITIONS " = > " MMKV_IOS_EXTENSION " <nl> + " GCC_PREPROCESSOR_DEFINITIONS " = > " MMKV_IOS_EXTENSION " , <nl> } <nl> <nl> s . dependency ' MMKVCore ' , ' ~ > 1 . 1 . 0 ' <nl> new file mode 100644 <nl> index 0000000 . . b39331b <nl> mmm / dev / null <nl> ppp b / MMKVWatchExtension . podspec <nl> <nl> + Pod : : Spec . new do | s | <nl> + <nl> + s . name = " MMKVWatchExtension " <nl> + s . version = " 1 . 1 . 0 " <nl> + s . summary = " MMKV is a cross - platform key - value storage framework developed by WeChat . " <nl> + s . module_name = " MMKVWatchExtension " <nl> + <nl> + s . description = < < - DESC <nl> + The MMKV for WatchOS App Extensions . <nl> + MMKV is an efficient , complete , easy - to - use mobile key - value storage framework used in the WeChat application . <nl> + It can be a replacement for NSUserDefaults & SQLite . <nl> + DESC <nl> + <nl> + s . homepage = " https : / / github . com / Tencent / MMKV " <nl> + s . license = { : type = > " BSD 3 - Clause " , : file = > " LICENSE . TXT " } <nl> + s . author = { " guoling " = > " guoling @ tencent . com " } <nl> + <nl> + s . ios . deployment_target = " 8 . 0 " <nl> + s . osx . deployment_target = " 10 . 9 " <nl> + <nl> + s . source = { : git = > " https : / / github . com / Tencent / MMKV . git " , : tag = > " v # { s . version } " } <nl> + s . source_files = " iOS / MMKV / MMKV " , " iOS / MMKV / MMKV / * . { h , mm , hpp } " <nl> + s . public_header_files = " iOS / MMKV / MMKV / MMKV . h " , " iOS / MMKV / MMKV / MMKVHandler . h " <nl> + <nl> + s . framework = " CoreFoundation " <nl> + s . ios . frameworks = " UIKit " <nl> + s . libraries = " z " , " c + + " <nl> + s . requires_arc = true <nl> + s . pod_target_xcconfig = { <nl> + " CLANG_CXX_LANGUAGE_STANDARD " = > " gnu + + 17 " , <nl> + " CLANG_CXX_LIBRARY " = > " libc + + " , <nl> + " CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF " = > " NO " , <nl> + " GCC_PREPROCESSOR_DEFINITIONS " = > " MMKV_IOS_EXTENSION " , <nl> + } <nl> + <nl> + s . dependency ' MMKVCore ' , ' ~ > 1 . 1 . 0 ' <nl> + <nl> + end <nl> + <nl>
MMKVWatchExtension pod spec
Tencent/MMKV
2a4cbce30d296af41eb419f1003f6125854ccb3f
2020-04-13T10:14:48Z
mmm a / Code / Sandbox / Plugins / DependencyGraph / MainWindow . cpp <nl> ppp b / Code / Sandbox / Plugins / DependencyGraph / MainWindow . cpp <nl> void CMainWindow : : RegisterDockingWidgets ( ) <nl> RegisterWidget ( " Graph " , createGraphView , false , false ) ; <nl> } <nl> <nl> + void CMainWindow : : CreateDefaultLayout ( CDockableContainer * pSender ) <nl> + { <nl> + CRY_ASSERT ( pSender ) ; <nl> + pSender - > SpawnWidget ( " Graph " ) ; <nl> + } <nl> + <nl> bool CMainWindow : : OnOpen ( ) <nl> { <nl> const std : : vector < CAssetType * > & types = m_pModel - > GetSupportedTypes ( ) ; <nl> mmm a / Code / Sandbox / Plugins / DependencyGraph / MainWindow . h <nl> ppp b / Code / Sandbox / Plugins / DependencyGraph / MainWindow . h <nl> class CMainWindow : public CDockableEditor <nl> CMainWindow ( QWidget * pParent = nullptr ) ; <nl> virtual const char * GetEditorName ( ) const override ; <nl> static void CreateNewWindow ( CAsset * asset ) ; <nl> + protected : <nl> + virtual void CreateDefaultLayout ( CDockableContainer * pSender ) override ; <nl> private : <nl> void InitMenu ( ) ; <nl> void RegisterDockingWidgets ( ) ; <nl>
! XB ( Sandbox ) The dependency graph window is empty , need to go to Window menu and choose Add Pane / Graph to actually see the graph . ( Approved by samuelk )
CRYTEK/CRYENGINE
b2bf432bb120f342ff22ccf9689e20ca672bf1f9
2017-05-15T15:26:29Z
mmm a / CMakeLists . txt <nl> ppp b / CMakeLists . txt <nl> if ( VERBOSE ) <nl> message ( STATUS ) <nl> endif ( ) <nl> <nl> + <nl> # compiler options <nl> if ( CMAKE_COMPILER_IS_GNUCC ) <nl> if ( VERBOSE ) <nl> elseif ( MSVC ) <nl> <nl> set ( CMAKE_C_FLAGS " / MTd " CACHE INTERNAL " default C + + compiler flags " ) <nl> set ( CMAKE_C_FLAGS_DEBUG " / D _DEBUG / MTd / Zi / Ob0 / Od / RTC1 " CACHE INTERNAL " C + + debug flags " ) <nl> - set ( CMAKE_C_FLAGS_MINSIZEREL " / MT / O1 / Ob1 / D NDEBUG " CACHE INTERNAL " C + + minimal size flags " ) <nl> - set ( CMAKE_C_FLAGS_RELEASE " / MT / O2 / Ob2 / D NDEBUG " CACHE INTERNAL " C + + release flags " ) <nl> - set ( CMAKE_C_FLAGS_RELWITHDEBINFO " / MT / Zi / O2 / Ob1 / D NDEBUG " CACHE INTERNAL " C + + release with debug info flags " ) <nl> + set ( CMAKE_C_FLAGS_MINSIZEREL " / MT / O1 / Ob1 " CACHE INTERNAL " C + + minimal size flags " ) <nl> + set ( CMAKE_C_FLAGS_RELEASE " / MT / O2 / Ob2 " CACHE INTERNAL " C + + release flags " ) <nl> + set ( CMAKE_C_FLAGS_RELWITHDEBINFO " / MT / Zi / O2 / Ob1 " CACHE INTERNAL " C + + release with debug info flags " ) <nl> <nl> set ( CMAKE_CXX_FLAGS " / MTd " CACHE INTERNAL " default C + + compiler flags " ) <nl> set ( CMAKE_CXX_FLAGS_DEBUG " / D _DEBUG / MTd / Zi / Ob0 / Od / RTC1 " CACHE INTERNAL " C + + debug flags " ) <nl> - set ( CMAKE_CXX_FLAGS_MINSIZEREL " / MT / O1 / Ob1 / D NDEBUG " CACHE INTERNAL " C + + minimal size flags " ) <nl> - set ( CMAKE_CXX_FLAGS_RELEASE " / MT / O2 / Ob2 / D NDEBUG " CACHE INTERNAL " C + + release flags " ) <nl> - set ( CMAKE_CXX_FLAGS_RELWITHDEBINFO " / MT / Zi / O2 / Ob1 / D NDEBUG " CACHE INTERNAL " C + + release with debug info flags " ) <nl> + set ( CMAKE_CXX_FLAGS_MINSIZEREL " / MT / O1 / Ob1 " CACHE INTERNAL " C + + minimal size flags " ) <nl> + set ( CMAKE_CXX_FLAGS_RELEASE " / MT / O2 / Ob2 " CACHE INTERNAL " C + + release flags " ) <nl> + set ( CMAKE_CXX_FLAGS_RELWITHDEBINFO " / MT / Zi / O2 / Ob1 " CACHE INTERNAL " C + + release with debug info flags " ) <nl> <nl> else ( ) <nl> # unknown compiler <nl> else ( ) <nl> set ( CMAKE_CXX_FLAGS_RELWITHDEBINFO " - O3 - g - fno - omit - frame - pointer " CACHE INTERNAL " C + + release with debug info flags " ) <nl> endif ( ) <nl> <nl> - set ( CMAKE_C_FLAGS " $ { CMAKE_C_FLAGS } $ { BASE_FLAGS } $ { BASE_C_FLAGS } " ) <nl> - set ( CMAKE_C_FLAGS_DEBUG " $ { CMAKE_C_FLAGS_DEBUG } $ { BASE_FLAGS } $ { BASE_C_FLAGS } " ) <nl> - set ( CMAKE_C_FLAGS_RELEASE " $ { CMAKE_C_FLAGS_RELEASE } $ { BASE_FLAGS } $ { BASE_C_FLAGS } " ) <nl> - set ( CMAKE_C_FLAGS_RELWITHDEBINFO " $ { CMAKE_C_FLAGS_RELWITHDEBINFO } $ { BASE_FLAGS } $ { BASE_C_FLAGS } " ) <nl> - set ( CMAKE_C_FLAGS_MINSIZEREL " $ { CMAKE_C_FLAGS_MINSIZEREL } $ { BASE_FLAGS } $ { BASE_C_FLAGS } " ) <nl> + # NDEBUG <nl> + if ( NOT USE_MAINTAINER_MODE AND ( CMAKE_BUILD_TYPE STREQUAL " Release " OR <nl> + CMAKE_BUILD_TYPE STREQUAL " RelWithDebInfo " OR <nl> + CMAKE_BUILD_TYPE STREQUAL " MinSizeRel " <nl> + ) <nl> + ) <nl> + add_definitions ( - DNDEBUG ) <nl> + endif ( ) <nl> + <nl> + set ( CMAKE_C_FLAGS " $ { CMAKE_C_FLAGS } $ { BASE_FLAGS } $ { BASE_C_FLAGS } " ) <nl> + set ( CMAKE_C_FLAGS_DEBUG " $ { CMAKE_C_FLAGS_DEBUG } $ { BASE_FLAGS } $ { BASE_C_FLAGS } " ) <nl> + set ( CMAKE_C_FLAGS_RELEASE " $ { CMAKE_C_FLAGS_RELEASE } $ { BASE_FLAGS } $ { BASE_C_FLAGS } " ) <nl> + set ( CMAKE_C_FLAGS_RELWITHDEBINFO " $ { CMAKE_C_FLAGS_RELWITHDEBINFO } $ { BASE_FLAGS } $ { BASE_C_FLAGS } " ) <nl> + set ( CMAKE_C_FLAGS_MINSIZEREL " $ { CMAKE_C_FLAGS_MINSIZEREL } $ { BASE_FLAGS } $ { BASE_C_FLAGS } " ) <nl> <nl> set ( CMAKE_CXX_FLAGS " $ { CMAKE_CXX_FLAGS } $ { BASE_FLAGS } $ { BASE_CXX_FLAGS } " ) <nl> set ( CMAKE_CXX_FLAGS_DEBUG " $ { CMAKE_CXX_FLAGS_DEBUG } $ { BASE_FLAGS } $ { BASE_CXX_FLAGS } " ) <nl> if ( VERBOSE ) <nl> message ( STATUS ) <nl> endif ( ) <nl> <nl> + if ( ARANGODB_DEBUG_CMAKE ) <nl> + get_directory_property ( DirDefs DIRECTORY $ { CMAKE_CURRENT_SOURCE_DIR } COMPILE_DEFINITIONS ) <nl> + foreach ( d $ { DirDefs } ) <nl> + message ( STATUS " Found Define : " $ { d } ) <nl> + endforeach ( ) <nl> + message ( STATUS " DirDefs : $ { DirDefs } " ) <nl> + endif ( ) <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # # 3RD PARTY <nl>
Try to fix use of NDEBUG
arangodb/arangodb
2273742aec28f9da090bfb188b96abc7bb4abd17
2017-05-18T09:25:02Z
mmm a / tensorflow / examples / label_image / BUILD <nl> ppp b / tensorflow / examples / label_image / BUILD <nl> cc_test ( <nl> deps = [ <nl> " : command_line_flags " , <nl> " / / tensorflow / core : tensorflow " , <nl> + " / / tensorflow / core : test_main " , <nl> " / / tensorflow / core / platform / default / build_config : gtest " , <nl> - " / / tensorflow / core / platform / default / build_config : test_main " , <nl> ] , <nl> ) <nl> <nl> mmm a / tensorflow / examples / label_image / command_line_flags_test . cc <nl> ppp b / tensorflow / examples / label_image / command_line_flags_test . cc <nl> std : : vector < char * > CharPointerVectorFromStrings ( <nl> TEST ( CommandLineFlagsTest , BasicUsage ) { <nl> int some_int = 10 ; <nl> bool some_switch = false ; <nl> - string some_name = " something " ; <nl> + tensorflow : : string some_name = " something " ; <nl> int argc = 4 ; <nl> std : : vector < tensorflow : : string > argv_strings = { <nl> " program_name " , " - - some_int = 20 " , " - - some_switch " , <nl>
Fix examples / label_image / . . .
tensorflow/tensorflow
04bad79a588a09f7642544c5e1cc168f7dfbcab4
2016-01-18T21:46:28Z
mmm a / Telegram / Resources / langs / lang . strings <nl> ppp b / Telegram / Resources / langs / lang . strings <nl> https : / / github . com / telegramdesktop / tdesktop / blob / master / LEGAL <nl> " lng_cant_invite_banned " = " Sorry , only admin can add this user . " ; <nl> " lng_cant_invite_privacy " = " Sorry , you cannot add this user to groups because of their privacy settings . " ; <nl> " lng_cant_invite_privacy_channel " = " Sorry , you cannot add this user to channels because of their privacy settings . " ; <nl> + " lng_cant_invite_bot_to_channel " = " Sorry , bots can only be added to channels as administrators . " ; <nl> " lng_cant_do_this " = " Sorry , this action is unavailable . " ; <nl> + " lng_cant_invite_offer_admin " = " Bots can only be added as administrators . " ; <nl> + " lng_cant_invite_make_admin " = " Make admin " ; <nl> <nl> " lng_send_button " = " Send " ; <nl> " lng_message_ph " = " Write a message . . . " ; <nl> mmm a / Telegram / SourceFiles / apiwrap . cpp <nl> ppp b / Telegram / SourceFiles / apiwrap . cpp <nl> For license and copyright information please follow this link : <nl> <nl> namespace { <nl> <nl> - constexpr auto kReloadChannelMembersTimeout = 1000 ; / / 1 second wait before reload members in channel after adding <nl> - constexpr auto kSaveCloudDraftTimeout = 1000 ; / / save draft to the cloud with 1 sec extra delay <nl> - constexpr auto kSaveDraftBeforeQuitTimeout = 1500 ; / / give the app 1 . 5 secs to save drafts to cloud when quitting <nl> + / / 1 second wait before reload members in channel after adding . <nl> + constexpr auto kReloadChannelMembersTimeout = 1000 ; <nl> + <nl> + / / Save draft to the cloud with 1 sec extra delay . <nl> + constexpr auto kSaveCloudDraftTimeout = 1000 ; <nl> + <nl> + / / Give the app 1 . 5 secs to save drafts to cloud when quitting . <nl> + constexpr auto kSaveDraftBeforeQuitTimeout = 1500 ; <nl> + <nl> + / / Max users in one super group invite request . <nl> + constexpr auto kMaxUsersPerInvite = 100 ; <nl> + <nl> + / / How many messages from chat history server should forward to user , <nl> + / / that was added to this chat . <nl> + constexpr auto kForwardMessagesOnAdd = 100 ; <nl> + <nl> constexpr auto kProxyPromotionInterval = TimeId ( 60 * 60 ) ; <nl> constexpr auto kProxyPromotionMinDelay = TimeId ( 10 ) ; <nl> constexpr auto kSmallDelayMs = 5 ; <nl> void ApiWrap : : checkForUnreadMentions ( <nl> } <nl> } <nl> <nl> + void ApiWrap : : addChatParticipants ( <nl> + not_null < PeerData * > peer , <nl> + const std : : vector < not_null < UserData * > > & users ) { <nl> + if ( const auto chat = peer - > asChat ( ) ) { <nl> + for ( const auto user : users ) { <nl> + request ( MTPmessages_AddChatUser ( <nl> + chat - > inputChat , <nl> + user - > inputUser , <nl> + MTP_int ( kForwardMessagesOnAdd ) <nl> + ) ) . done ( [ = ] ( const MTPUpdates & result ) { <nl> + applyUpdates ( result ) ; <nl> + } ) . fail ( [ = ] ( const RPCError & error ) { <nl> + ShowAddParticipantsError ( error . type ( ) , peer , { 1 , user } ) ; <nl> + } ) . afterDelay ( TimeMs ( 5 ) ) . send ( ) ; <nl> + } <nl> + } else if ( const auto channel = peer - > asChannel ( ) ) { <nl> + const auto bot = ranges : : find_if ( users , [ ] ( not_null < UserData * > user ) { <nl> + return user - > botInfo ! = nullptr ; <nl> + } ) ; <nl> + if ( ! peer - > isMegagroup ( ) & & bot ! = end ( users ) ) { <nl> + ShowAddParticipantsError ( " USER_BOT " , peer , users ) ; <nl> + return ; <nl> + } <nl> + auto list = QVector < MTPInputUser > ( ) ; <nl> + list . reserve ( qMin ( int ( users . size ( ) ) , int ( kMaxUsersPerInvite ) ) ) ; <nl> + const auto send = [ & ] { <nl> + request ( MTPchannels_InviteToChannel ( <nl> + channel - > inputChannel , <nl> + MTP_vector < MTPInputUser > ( list ) <nl> + ) ) . done ( [ = ] ( const MTPUpdates & result ) { <nl> + applyUpdates ( result ) ; <nl> + requestParticipantsCountDelayed ( channel ) ; <nl> + } ) . fail ( [ = ] ( const RPCError & error ) { <nl> + ShowAddParticipantsError ( error . type ( ) , peer , users ) ; <nl> + } ) . afterDelay ( TimeMs ( 5 ) ) . send ( ) ; <nl> + } ; <nl> + for ( const auto user : users ) { <nl> + list . push_back ( user - > inputUser ) ; <nl> + if ( list . size ( ) = = kMaxUsersPerInvite ) { <nl> + send ( ) ; <nl> + list . clear ( ) ; <nl> + } <nl> + } <nl> + if ( ! list . empty ( ) ) { <nl> + send ( ) ; <nl> + } <nl> + } else { <nl> + Unexpected ( " User in ApiWrap : : addChatParticipants . " ) ; <nl> + } <nl> + } <nl> + <nl> void ApiWrap : : cancelEditChatAdmins ( not_null < ChatData * > chat ) { <nl> _chatAdminsEnabledRequests . take ( <nl> chat <nl> void ApiWrap : : sendMessage ( MessageToSend & & message ) { <nl> } <nl> } <nl> <nl> - void ApiWrap : : sendBotStart ( not_null < UserData * > bot ) { <nl> + void ApiWrap : : sendBotStart ( not_null < UserData * > bot , PeerData * chat ) { <nl> Expects ( bot - > botInfo ! = nullptr ) ; <nl> + Expects ( chat = = nullptr | | ! bot - > botInfo - > startGroupToken . isEmpty ( ) ) ; <nl> + <nl> + if ( chat & & chat - > isChannel ( ) & & ! chat - > isMegagroup ( ) ) { <nl> + ShowAddParticipantsError ( " USER_BOT " , chat , { 1 , bot } ) ; <nl> + return ; <nl> + } <nl> <nl> - const auto token = bot - > botInfo - > startToken ; <nl> + auto & info = bot - > botInfo ; <nl> + auto & token = chat ? info - > startGroupToken : info - > startToken ; <nl> if ( token . isEmpty ( ) ) { <nl> auto message = ApiWrap : : MessageToSend ( App : : history ( bot ) ) ; <nl> message . textWithTags = { qsl ( " / start " ) , TextWithTags : : Tags ( ) } ; <nl> sendMessage ( std : : move ( message ) ) ; <nl> - } else { <nl> - bot - > botInfo - > startToken = QString ( ) ; <nl> - const auto randomId = rand_value < uint64 > ( ) ; <nl> - request ( MTPmessages_StartBot ( <nl> - bot - > inputUser , <nl> - MTP_inputPeerEmpty ( ) , <nl> - MTP_long ( randomId ) , <nl> - MTP_string ( token ) <nl> - ) ) . done ( [ = ] ( const MTPUpdates & result ) { <nl> - applyUpdates ( result ) ; <nl> - } ) . send ( ) ; <nl> + return ; <nl> } <nl> + const auto randomId = rand_value < uint64 > ( ) ; <nl> + request ( MTPmessages_StartBot ( <nl> + bot - > inputUser , <nl> + chat ? chat - > input : MTP_inputPeerEmpty ( ) , <nl> + MTP_long ( randomId ) , <nl> + MTP_string ( base : : take ( token ) ) <nl> + ) ) . done ( [ = ] ( const MTPUpdates & result ) { <nl> + applyUpdates ( result ) ; <nl> + } ) . fail ( [ = ] ( const RPCError & error ) { <nl> + if ( chat ) { <nl> + ShowAddParticipantsError ( error . type ( ) , chat , { 1 , bot } ) ; <nl> + } <nl> + } ) . send ( ) ; <nl> } <nl> <nl> void ApiWrap : : sendInlineResult ( <nl> mmm a / Telegram / SourceFiles / apiwrap . h <nl> ppp b / Telegram / SourceFiles / apiwrap . h <nl> class ApiWrap : private MTP : : Sender , private base : : Subscriber { <nl> int availableCount , <nl> const QVector < MTPChannelParticipant > & list ) > callbackList , <nl> Fn < void ( ) > callbackNotModified = nullptr ) ; <nl> + void addChatParticipants ( <nl> + not_null < PeerData * > peer , <nl> + const std : : vector < not_null < UserData * > > & users ) ; <nl> <nl> struct SendOptions { <nl> SendOptions ( not_null < History * > history ) ; <nl> class ApiWrap : private MTP : : Sender , private base : : Subscriber { <nl> bool handleSupportSwitch = false ; <nl> } ; <nl> void sendMessage ( MessageToSend & & message ) ; <nl> - void sendBotStart ( not_null < UserData * > bot ) ; <nl> + void sendBotStart ( not_null < UserData * > bot , PeerData * chat = nullptr ) ; <nl> void sendInlineResult ( <nl> not_null < UserData * > bot , <nl> not_null < InlineBots : : Result * > data , <nl> mmm a / Telegram / SourceFiles / boxes / add_contact_box . cpp <nl> ppp b / Telegram / SourceFiles / boxes / add_contact_box . cpp <nl> For license and copyright information please follow this link : <nl> # include " boxes / confirm_box . h " <nl> # include " boxes / photo_crop_box . h " <nl> # include " boxes / peer_list_controllers . h " <nl> + # include " boxes / edit_participant_box . h " <nl> # include " core / file_utilities . h " <nl> + # include " profile / profile_channel_controllers . h " <nl> # include " chat_helpers / emoji_suggestions_widget . h " <nl> # include " ui / widgets / checkbox . h " <nl> # include " ui / widgets / buttons . h " <nl> QString PeerFloodErrorText ( PeerFloodType type ) { <nl> return lng_cant_send_to_not_contact ( lt_more_info , link ) ; <nl> } <nl> <nl> + void ShowAddParticipantsError ( <nl> + const QString & error , <nl> + not_null < PeerData * > chat , <nl> + const std : : vector < not_null < UserData * > > & users ) { <nl> + if ( error = = qstr ( " USER_BOT " ) ) { <nl> + const auto channel = chat - > asChannel ( ) ; <nl> + if ( ( users . size ( ) = = 1 ) <nl> + & & ( users . front ( ) - > botInfo ! = nullptr ) <nl> + & & channel <nl> + & & ! channel - > isMegagroup ( ) <nl> + & & channel - > canAddAdmins ( ) ) { <nl> + const auto makeAdmin = [ = ] { <nl> + const auto user = users . front ( ) ; <nl> + const auto weak = std : : make_shared < QPointer < EditAdminBox > > ( ) ; <nl> + const auto close = [ = ] { <nl> + if ( * weak ) { <nl> + ( * weak ) - > closeBox ( ) ; <nl> + } <nl> + } ; <nl> + const auto saveCallback = Profile : : SaveAdminCallback ( <nl> + channel , <nl> + user , <nl> + [ = ] ( auto & & . . . ) { close ( ) ; } , <nl> + close ) ; <nl> + auto box = Box < EditAdminBox > ( <nl> + channel , <nl> + user , <nl> + MTP_channelAdminRights ( MTP_flags ( 0 ) ) ) ; <nl> + box - > setSaveCallback ( saveCallback ) ; <nl> + * weak = Ui : : show ( std : : move ( box ) ) ; <nl> + } ; <nl> + Ui : : show ( <nl> + Box < ConfirmBox > ( <nl> + lang ( lng_cant_invite_offer_admin ) , <nl> + lang ( lng_cant_invite_make_admin ) , <nl> + lang ( lng_cancel ) , <nl> + makeAdmin ) , <nl> + LayerOption : : KeepOther ) ; <nl> + return ; <nl> + } <nl> + } <nl> + const auto bot = ranges : : find_if ( users , [ ] ( not_null < UserData * > user ) { <nl> + return user - > botInfo ! = nullptr ; <nl> + } ) ; <nl> + const auto hasBot = ( bot ! = end ( users ) ) ; <nl> + const auto text = [ & ] { <nl> + if ( error = = qstr ( " USER_BOT " ) ) { <nl> + return lang ( lng_cant_invite_bot_to_channel ) ; <nl> + } else if ( error = = qstr ( " USER_LEFT_CHAT " ) ) { <nl> + / / Trying to return a user who has left . <nl> + } else if ( error = = qstr ( " USER_KICKED " ) ) { <nl> + / / Trying to return a user who was kicked by admin . <nl> + return lang ( lng_cant_invite_banned ) ; <nl> + } else if ( error = = qstr ( " USER_PRIVACY_RESTRICTED " ) ) { <nl> + return lang ( lng_cant_invite_privacy ) ; <nl> + } else if ( error = = qstr ( " USER_NOT_MUTUAL_CONTACT " ) ) { <nl> + / / Trying to return user who does not have me in contacts . <nl> + return lang ( lng_failed_add_not_mutual ) ; <nl> + } else if ( error = = qstr ( " USER_ALREADY_PARTICIPANT " ) & & hasBot ) { <nl> + return lang ( lng_bot_already_in_group ) ; <nl> + } else if ( error = = qstr ( " PEER_FLOOD " ) ) { <nl> + const auto isGroup = ( chat - > isChat ( ) | | chat - > isMegagroup ( ) ) ; <nl> + return PeerFloodErrorText ( isGroup <nl> + ? PeerFloodType : : InviteGroup <nl> + : PeerFloodType : : InviteChannel ) ; <nl> + } <nl> + return lang ( lng_failed_add_participant ) ; <nl> + } ( ) ; <nl> + Ui : : show ( Box < InformBox > ( text ) , LayerOption : : KeepOther ) ; <nl> + } <nl> + <nl> class RevokePublicLinkBox : : Inner : public TWidget , private MTP : : Sender { <nl> public : <nl> Inner ( QWidget * parent , Fn < void ( ) > revokeCallback ) ; <nl> mmm a / Telegram / SourceFiles / boxes / add_contact_box . h <nl> ppp b / Telegram / SourceFiles / boxes / add_contact_box . h <nl> enum class PeerFloodType { <nl> InviteChannel , <nl> } ; <nl> QString PeerFloodErrorText ( PeerFloodType type ) ; <nl> + void ShowAddParticipantsError ( <nl> + const QString & error , <nl> + not_null < PeerData * > chat , <nl> + const std : : vector < not_null < UserData * > > & users ) ; <nl> <nl> class AddContactBox : public BoxContent , public RPCSender { <nl> public : <nl> mmm a / Telegram / SourceFiles / boxes / peer_list_controllers . cpp <nl> ppp b / Telegram / SourceFiles / boxes / peer_list_controllers . cpp <nl> void ShareBotGame ( not_null < UserData * > bot , not_null < PeerData * > chat ) { <nl> } <nl> <nl> void AddBotToGroup ( not_null < UserData * > bot , not_null < PeerData * > chat ) { <nl> - if ( auto & info = bot - > botInfo ) { <nl> - if ( ! info - > startGroupToken . isEmpty ( ) ) { <nl> - MTP : : send ( <nl> - MTPmessages_StartBot ( <nl> - bot - > inputUser , <nl> - chat - > input , <nl> - MTP_long ( rand_value < uint64 > ( ) ) , <nl> - MTP_string ( info - > startGroupToken ) ) , <nl> - App : : main ( ) - > rpcDone ( & MainWidget : : sentUpdatesReceived ) , <nl> - App : : main ( ) - > rpcFail ( <nl> - & MainWidget : : addParticipantFail , <nl> - { bot , chat } ) ) ; <nl> - } else { <nl> - App : : main ( ) - > addParticipants ( <nl> - chat , <nl> - { 1 , bot } ) ; <nl> - } <nl> + if ( bot - > botInfo & & ! bot - > botInfo - > startGroupToken . isEmpty ( ) ) { <nl> + Auth ( ) . api ( ) . sendBotStart ( bot , chat ) ; <nl> } else { <nl> - App : : main ( ) - > addParticipants ( <nl> - chat , <nl> - { 1 , bot } ) ; <nl> + Auth ( ) . api ( ) . addChatParticipants ( chat , { 1 , bot } ) ; <nl> } <nl> Ui : : hideLayer ( ) ; <nl> Ui : : showPeerHistory ( chat , ShowAtUnreadMsgId ) ; <nl> } <nl> <nl> + bool InviteSelectedUsers ( <nl> + not_null < PeerListBox * > box , <nl> + not_null < PeerData * > chat ) { <nl> + const auto rows = box - > peerListCollectSelectedRows ( ) ; <nl> + const auto users = ranges : : view : : all ( <nl> + rows <nl> + ) | ranges : : view : : transform ( [ ] ( not_null < PeerData * > peer ) { <nl> + Expects ( peer - > isUser ( ) ) ; <nl> + Expects ( ! peer - > isSelf ( ) ) ; <nl> + <nl> + return not_null < UserData * > ( peer - > asUser ( ) ) ; <nl> + } ) | ranges : : to_vector ; <nl> + if ( users . empty ( ) ) { <nl> + return false ; <nl> + } <nl> + Auth ( ) . api ( ) . addChatParticipants ( chat , users ) ; <nl> + return true ; <nl> + } <nl> + <nl> } / / namespace <nl> <nl> / / Not used for now . <nl> void AddParticipantsBoxController : : updateTitle ( ) { <nl> } <nl> <nl> void AddParticipantsBoxController : : Start ( not_null < ChatData * > chat ) { <nl> - auto initBox = [ chat ] ( not_null < PeerListBox * > box ) { <nl> - box - > addButton ( langFactory ( lng_participant_invite ) , [ box , chat ] { <nl> - auto rows = box - > peerListCollectSelectedRows ( ) ; <nl> - if ( ! rows . empty ( ) ) { <nl> - auto users = std : : vector < not_null < UserData * > > ( ) ; <nl> - for ( auto peer : rows ) { <nl> - auto user = peer - > asUser ( ) ; <nl> - Assert ( user ! = nullptr ) ; <nl> - Assert ( ! user - > isSelf ( ) ) ; <nl> - users . push_back ( peer - > asUser ( ) ) ; <nl> - } <nl> - App : : main ( ) - > addParticipants ( chat , users ) ; <nl> + auto initBox = [ = ] ( not_null < PeerListBox * > box ) { <nl> + box - > addButton ( langFactory ( lng_participant_invite ) , [ = ] { <nl> + if ( InviteSelectedUsers ( box , chat ) ) { <nl> Ui : : showPeerHistory ( chat , ShowAtTheEndMsgId ) ; <nl> } <nl> } ) ; <nl> void AddParticipantsBoxController : : Start ( <nl> bool justCreated ) { <nl> auto initBox = [ channel , justCreated ] ( not_null < PeerListBox * > box ) { <nl> auto subscription = std : : make_shared < rpl : : lifetime > ( ) ; <nl> - box - > addButton ( langFactory ( lng_participant_invite ) , [ box , channel , subscription ] { <nl> - auto rows = box - > peerListCollectSelectedRows ( ) ; <nl> - if ( ! rows . empty ( ) ) { <nl> - auto users = std : : vector < not_null < UserData * > > ( ) ; <nl> - for ( auto peer : rows ) { <nl> - auto user = peer - > asUser ( ) ; <nl> - Assert ( user ! = nullptr ) ; <nl> - Assert ( ! user - > isSelf ( ) ) ; <nl> - users . push_back ( peer - > asUser ( ) ) ; <nl> - } <nl> - App : : main ( ) - > addParticipants ( channel , users ) ; <nl> + box - > addButton ( langFactory ( lng_participant_invite ) , [ = , subscription ] { <nl> + if ( InviteSelectedUsers ( box , channel ) ) { <nl> if ( channel - > isMegagroup ( ) ) { <nl> Ui : : showPeerHistory ( channel , ShowAtTheEndMsgId ) ; <nl> } else { <nl> void AddBotToGroupBoxController : : shareBotGame ( not_null < PeerData * > chat ) { <nl> } <nl> <nl> void AddBotToGroupBoxController : : addBotToGroup ( not_null < PeerData * > chat ) { <nl> - if ( auto megagroup = chat - > asMegagroup ( ) ) { <nl> + if ( const auto megagroup = chat - > asMegagroup ( ) ) { <nl> if ( ! megagroup - > canAddMembers ( ) ) { <nl> Ui : : show ( <nl> Box < InformBox > ( lang ( lng_error_cant_add_member ) ) , <nl> mmm a / Telegram / SourceFiles / boxes / peer_list_controllers . h <nl> ppp b / Telegram / SourceFiles / boxes / peer_list_controllers . h <nl> class AddParticipantsBoxController : public ContactsBoxController { <nl> bool isAlreadyIn ( not_null < UserData * > user ) const ; <nl> int fullCount ( ) const ; <nl> void updateTitle ( ) ; <nl> + bool inviteSelectedUsers ( not_null < PeerData * > chat ) const ; <nl> <nl> PeerData * _peer = nullptr ; <nl> base : : flat_set < not_null < UserData * > > _alreadyIn ; <nl> mmm a / Telegram / SourceFiles / config . h <nl> ppp b / Telegram / SourceFiles / config . h <nl> enum { <nl> <nl> MTPKillFileSessionTimeout = 5000 , / / how much time without upload / download causes additional session kill <nl> <nl> - MaxUsersPerInvite = 100 , / / max users in one super group invite request <nl> - <nl> MTPChannelGetDifferenceLimit = 100 , <nl> <nl> MaxSelectedItems = 100 , <nl> enum { <nl> IdleMsecs = 60 * 1000 , / / after 60secs without user input we think we are idle <nl> <nl> SendViewsTimeout = 1000 , / / send views each second <nl> - <nl> - ForwardOnAdd = 100 , / / how many messages from chat history server should forward to user , that was added to this chat <nl> } ; <nl> <nl> inline const QRegularExpression & cRussianLetters ( ) { <nl> mmm a / Telegram / SourceFiles / mainwidget . cpp <nl> ppp b / Telegram / SourceFiles / mainwidget . cpp <nl> void MainWidget : : deleteAndExit ( ChatData * chat ) { <nl> rpcFail ( & MainWidget : : leaveChatFailed , peer ) ) ; <nl> } <nl> <nl> - void MainWidget : : addParticipants ( <nl> - not_null < PeerData * > chatOrChannel , <nl> - const std : : vector < not_null < UserData * > > & users ) { <nl> - if ( auto chat = chatOrChannel - > asChat ( ) ) { <nl> - for_const ( auto user , users ) { <nl> - MTP : : send ( <nl> - MTPmessages_AddChatUser ( <nl> - chat - > inputChat , <nl> - user - > inputUser , <nl> - MTP_int ( ForwardOnAdd ) ) , <nl> - rpcDone ( & MainWidget : : sentUpdatesReceived ) , <nl> - rpcFail ( & MainWidget : : addParticipantFail , { user , chat } ) , <nl> - 0 , <nl> - 5 ) ; <nl> - } <nl> - } else if ( auto channel = chatOrChannel - > asChannel ( ) ) { <nl> - QVector < MTPInputUser > inputUsers ; <nl> - inputUsers . reserve ( qMin ( int ( users . size ( ) ) , int ( MaxUsersPerInvite ) ) ) ; <nl> - for ( auto i = users . cbegin ( ) , e = users . cend ( ) ; i ! = e ; + + i ) { <nl> - inputUsers . push_back ( ( * i ) - > inputUser ) ; <nl> - if ( inputUsers . size ( ) = = MaxUsersPerInvite ) { <nl> - MTP : : send ( <nl> - MTPchannels_InviteToChannel ( <nl> - channel - > inputChannel , <nl> - MTP_vector < MTPInputUser > ( inputUsers ) ) , <nl> - rpcDone ( & MainWidget : : inviteToChannelDone , { channel } ) , <nl> - rpcFail ( & MainWidget : : addParticipantsFail , { channel } ) , <nl> - 0 , <nl> - 5 ) ; <nl> - inputUsers . clear ( ) ; <nl> - } <nl> - } <nl> - if ( ! inputUsers . isEmpty ( ) ) { <nl> - MTP : : send ( <nl> - MTPchannels_InviteToChannel ( <nl> - channel - > inputChannel , <nl> - MTP_vector < MTPInputUser > ( inputUsers ) ) , <nl> - rpcDone ( & MainWidget : : inviteToChannelDone , { channel } ) , <nl> - rpcFail ( & MainWidget : : addParticipantsFail , { channel } ) , <nl> - 0 , <nl> - 5 ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - bool MainWidget : : addParticipantFail ( UserAndPeer data , const RPCError & error ) { <nl> - if ( MTP : : isDefaultHandledError ( error ) ) return false ; <nl> - <nl> - QString text = lang ( lng_failed_add_participant ) ; <nl> - if ( error . type ( ) = = qstr ( " USER_LEFT_CHAT " ) ) { / / trying to return a user who has left <nl> - } else if ( error . type ( ) = = qstr ( " USER_KICKED " ) ) { / / trying to return a user who was kicked by admin <nl> - text = lang ( lng_cant_invite_banned ) ; <nl> - } else if ( error . type ( ) = = qstr ( " USER_PRIVACY_RESTRICTED " ) ) { <nl> - text = lang ( lng_cant_invite_privacy ) ; <nl> - } else if ( error . type ( ) = = qstr ( " USER_NOT_MUTUAL_CONTACT " ) ) { / / trying to return user who does not have me in contacts <nl> - text = lang ( lng_failed_add_not_mutual ) ; <nl> - } else if ( error . type ( ) = = qstr ( " USER_ALREADY_PARTICIPANT " ) & & data . user - > botInfo ) { <nl> - text = lang ( lng_bot_already_in_group ) ; <nl> - } else if ( error . type ( ) = = qstr ( " PEER_FLOOD " ) ) { <nl> - text = PeerFloodErrorText ( ( data . peer - > isChat ( ) | | data . peer - > isMegagroup ( ) ) ? PeerFloodType : : InviteGroup : PeerFloodType : : InviteChannel ) ; <nl> - } <nl> - Ui : : show ( Box < InformBox > ( text ) ) ; <nl> - return false ; <nl> - } <nl> - <nl> - bool MainWidget : : addParticipantsFail ( <nl> - not_null < ChannelData * > channel , <nl> - const RPCError & error ) { <nl> - if ( MTP : : isDefaultHandledError ( error ) ) return false ; <nl> - <nl> - QString text = lang ( lng_failed_add_participant ) ; <nl> - if ( error . type ( ) = = qstr ( " USER_LEFT_CHAT " ) ) { / / trying to return banned user to his group <nl> - } else if ( error . type ( ) = = qstr ( " USER_KICKED " ) ) { / / trying to return a user who was kicked by admin <nl> - text = lang ( lng_cant_invite_banned ) ; <nl> - } else if ( error . type ( ) = = qstr ( " USER_PRIVACY_RESTRICTED " ) ) { <nl> - text = lang ( channel - > isMegagroup ( ) ? lng_cant_invite_privacy : lng_cant_invite_privacy_channel ) ; <nl> - } else if ( error . type ( ) = = qstr ( " USER_NOT_MUTUAL_CONTACT " ) ) { / / trying to return user who does not have me in contacts <nl> - text = lang ( channel - > isMegagroup ( ) ? lng_failed_add_not_mutual : lng_failed_add_not_mutual_channel ) ; <nl> - } else if ( error . type ( ) = = qstr ( " PEER_FLOOD " ) ) { <nl> - text = PeerFloodErrorText ( PeerFloodType : : InviteGroup ) ; <nl> - } <nl> - Ui : : show ( Box < InformBox > ( text ) ) ; <nl> - return false ; <nl> - } <nl> - <nl> bool MainWidget : : sendMessageFail ( const RPCError & error ) { <nl> if ( MTP : : isDefaultHandledError ( error ) ) return false ; <nl> <nl> bool MainWidget : : deleteChannelFailed ( const RPCError & error ) { <nl> return true ; <nl> } <nl> <nl> - void MainWidget : : inviteToChannelDone ( <nl> - not_null < ChannelData * > channel , <nl> - const MTPUpdates & updates ) { <nl> - sentUpdatesReceived ( updates ) ; <nl> - Auth ( ) . api ( ) . requestParticipantsCountDelayed ( channel ) ; <nl> - } <nl> - <nl> void MainWidget : : historyToDown ( History * history ) { <nl> _history - > historyToDown ( history ) ; <nl> } <nl> mmm a / Telegram / SourceFiles / mainwidget . h <nl> ppp b / Telegram / SourceFiles / mainwidget . h <nl> class MainWidget <nl> return sentUpdatesReceived ( 0 , updates ) ; <nl> } <nl> bool deleteChannelFailed ( const RPCError & error ) ; <nl> - void inviteToChannelDone ( <nl> - not_null < ChannelData * > channel , <nl> - const MTPUpdates & updates ) ; <nl> void historyToDown ( History * hist ) ; <nl> void dialogsToUp ( ) ; <nl> void newUnreadMsg ( <nl> class MainWidget <nl> bool deleteHistory = true ) ; <nl> void deleteAndExit ( ChatData * chat ) ; <nl> <nl> - void addParticipants ( <nl> - not_null < PeerData * > chatOrChannel , <nl> - const std : : vector < not_null < UserData * > > & users ) ; <nl> - struct UserAndPeer { <nl> - UserData * user ; <nl> - PeerData * peer ; <nl> - } ; <nl> - bool addParticipantFail ( UserAndPeer data , const RPCError & e ) ; <nl> - bool addParticipantsFail ( <nl> - not_null < ChannelData * > channel , <nl> - const RPCError & e ) ; / / for multi invite in channels <nl> - <nl> bool sendMessageFail ( const RPCError & error ) ; <nl> <nl> Dialogs : : IndexedList * contactsList ( ) ; <nl>
Suggest adding bots to channels as admins .
telegramdesktop/tdesktop
400273968283b1b0fd0ecf2fba388d913da1b140
2018-12-28T11:42:58Z
mmm a / GOVERNANCE . md <nl> ppp b / GOVERNANCE . md <nl> or you can subscribe to the iCal feed [ here ] ( webcal : / / kubernetes . app . opsgenie . co <nl> * Do a new PR to setup the next version <nl> * Update [ VERSION ] ( VERSION ) to the next development release . E . g . , " 1 . 7 . 0 - dev " . <nl> * ` git mv docs / root / version_history / current . rst docs / root / version_history / v1 . 6 . 0 . rst ` , filling in the previous <nl> - release version number in the filename , and add an entry for the new file in the ` toctree ` in <nl> + release version number in the filename and delete empty sections ( like Incompatible Behavior Changes , Minor Bahavior Changes , etc ) . <nl> + Add an entry for the new file in the ` toctree ` in <nl> [ version_history . rst ] ( docs / root / version_history / version_history . rst ) . <nl> * Create a new " current " version history file at the [ release <nl> notes ] ( docs / root / version_history / current . rst ) for the following version . E . g . , " 1 . 7 . 0 ( pending ) " . Use <nl> new file mode 100644 <nl> index 00000000000 . . 0aab885e7c4 <nl> mmm / dev / null <nl> ppp b / docs / root / version_history / v1 . 13 . 7 . rst <nl> <nl> + 1 . 13 . 7 ( December 7 , 2020 ) <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + Changes <nl> + mmmmmm - <nl> + <nl> + * tls : fix read resumption after triggering buffer high - watermark and all remaining request / response bytes are stored in the SSL connection ' s internal buffers . <nl> + * udp : fixed issue in which receiving truncated UDP datagrams would cause Envoy to crash . <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . 056627ab87e <nl> mmm / dev / null <nl> ppp b / docs / root / version_history / v1 . 14 . 6 . rst <nl> <nl> + 1 . 14 . 6 ( December 7 , 2020 ) <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + Changes <nl> + mmmmmm - <nl> + <nl> + * listener : fix crash when disabling or re - enabling listeners due to overload while processing LDS updates . <nl> + * tls : fix read resumption after triggering buffer high - watermark and all remaining request / response bytes are stored in the SSL connection ' s internal buffers . <nl> + * udp : fixed issue in which receiving truncated UDP datagrams would cause Envoy to crash . <nl> new file mode 100644 <nl> index 00000000000 . . 00871be14e5 <nl> mmm / dev / null <nl> ppp b / docs / root / version_history / v1 . 15 . 3 . rst <nl> <nl> + 1 . 15 . 3 ( December 7 , 2020 ) <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + Changes <nl> + mmmmmm - <nl> + <nl> + * listener : fix crash when disabling or re - enabling listeners due to overload while processing LDS updates . <nl> + * proxy_proto : fixed a bug where network filters would not have the correct downstreamRemoteAddress ( ) when accessed from the StreamInfo . This could result in incorrect enforcement of RBAC rules in the RBAC network filter ( but not in the RBAC HTTP filter ) , or incorrect access log addresses from tcp_proxy . <nl> + * tls : fix read resumption after triggering buffer high - watermark and all remaining request / response bytes are stored in the SSL connection ' s internal buffers . <nl> + * udp : fixed issue in which receiving truncated UDP datagrams would cause Envoy to crash . <nl> + * vrp : allow supervisord to open its log file . <nl> new file mode 100644 <nl> index 00000000000 . . 81c72a624fb <nl> mmm / dev / null <nl> ppp b / docs / root / version_history / v1 . 16 . 1 . rst <nl> <nl> + 1 . 16 . 1 ( November 20 , 2020 ) <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + Bug Fixes <nl> + mmmmmmmmm <nl> + * Changes expected to improve the state of the world and are unlikely to have negative effects * <nl> + <nl> + * examples : examples use v3 configs . <nl> + * listener : fix crash when disabling or re - enabling listeners due to overload while processing LDS updates . <nl> + * proxy_proto : fixed a bug where the wrong downstream address got sent to upstream connections . <nl> + * proxy_proto : fixed a bug where network filters would not have the correct downstreamRemoteAddress ( ) when accessed from the StreamInfo . This could result in incorrect enforcement of RBAC rules in the RBAC network filter ( but not in the RBAC HTTP filter ) , or incorrect access log addresses from tcp_proxy . <nl> + * tls : fix read resumption after triggering buffer high - watermark and all remaining request / response bytes are stored in the SSL connection ' s internal buffers . <nl> + * udp : fixed issue in which receiving truncated UDP datagrams would cause Envoy to crash . <nl> new file mode 100644 <nl> index 00000000000 . . a7714eb3cb5 <nl> mmm / dev / null <nl> ppp b / docs / root / version_history / v1 . 16 . 2 . rst <nl> <nl> + 1 . 16 . 2 ( December 7 , 2020 ) <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + Bug Fixes <nl> + mmmmmmmmm <nl> + * Changes expected to improve the state of the world and are unlikely to have negative effects * <nl> + <nl> + * http : fixed URL parsing for HTTP / 1 . 1 fully qualified URLs and connect requests containing IPv6 addresses . <nl> + * vrp : allow supervisord to open its log file . <nl> mmm a / docs / root / version_history / version_history . rst <nl> ppp b / docs / root / version_history / version_history . rst <nl> Version history <nl> : titlesonly : <nl> <nl> current <nl> + v1 . 16 . 2 <nl> + v1 . 16 . 1 <nl> v1 . 16 . 0 <nl> + v1 . 15 . 3 <nl> v1 . 15 . 2 <nl> v1 . 15 . 1 <nl> v1 . 15 . 0 <nl> + v1 . 14 . 6 <nl> v1 . 14 . 5 <nl> v1 . 14 . 4 <nl> v1 . 14 . 3 <nl> v1 . 14 . 2 <nl> v1 . 14 . 1 <nl> v1 . 14 . 0 <nl> + v1 . 13 . 7 <nl> v1 . 13 . 6 <nl> v1 . 13 . 5 <nl> v1 . 13 . 4 <nl>
docs : Updated version history with stable releases . ( )
envoyproxy/envoy
17447f3ed1e84ac8f9505c7b78ed4ac8c8cd9f2f
2020-12-14T20:16:29Z
mmm a / ChangeLog . md <nl> ppp b / ChangeLog . md <nl> v1 . 39 . 1 : 10 / 30 / 2019 <nl> v1 . 39 . 0 : 10 / 18 / 2019 <nl> mmmmmmmmmmmmmmmmmm - <nl> - The emsdk defaults to the upstream backend ( instead of fastcomp ) from this <nl> - release onward ( but both backends are still fully supported ) . <nl> + release onward ( but both backends are still fully supported ) . See <nl> + https : / / emscripten . org / docs / compiling / WebAssembly . html # backends <nl> - Add support for overriding ` . emscripten ` config variables using environment <nl> variables . Any config variable ` FOO ` can be overridden by ` EM_FOO ` in the <nl> environment . <nl> mmm a / site / source / docs / compiling / WebAssembly . rst <nl> ppp b / site / source / docs / compiling / WebAssembly . rst <nl> WebAssembly is emitted by default , without the need for any special flags . <nl> Backends <nl> mmmmmm - - <nl> <nl> - Emscripten can currently ( July 2019 ) use 2 backends to generate WebAssembly : * * fastcomp * * ( the asm . js backend , together with asm2wasm ) and the * * upstream LLVM wasm backend * * . <nl> - <nl> - Fastcomp is currently the default , but we hope to ` switch the default soon to the upstream backend < https : / / v8 . dev / blog / emscripten - llvm - wasm > ` _ . <nl> - <nl> - To use fastcomp , just use the emsdk normally to get ` ` latest ` ` . For the upstream backend , use ` ` latest - upstream ` ` ( or , if you are not using the emsdk , you can set LLVM in the ` ` . emscripten ` ` file to point to a build you make of very recent LLVM - preferably from git / svn master ) . <nl> + Emscripten emits WebAssembly using the * * upstream LLVM wasm backend * * , since <nl> + version ` ` 1 . 39 . 0 ` ` ( October 2019 ) , and the old * * fastcomp * * backend is <nl> + deprecated ( you can still use the deprecated fastcomp backend by getting <nl> + ` ` latest - fastcomp ` ` instead of the normal ` ` latest ` ` , or ` ` 1 . 39 . 0 - fastcomp ` ` <nl> + instead of ` ` 1 . 39 . 0 ` ` , etc . ) . <nl> <nl> There are some differences you may notice between the two backends , if you <nl> upgrade from fastcomp to upstream : <nl> upgrade from fastcomp to upstream : <nl> ` strip ` on an archive file that contains WebAssembly object files it will <nl> remove the index which makes the archive unusable at link time . <nl> <nl> + * Fastcomp emits asm . js and so has some limitations on function pointers . For <nl> + example , the ` ` RESERVED_FUNCTION_POINTERS ` ` setting exists there to work <nl> + around the fact that we can ' t grow the table . In the upstream backend table <nl> + growth is easy , and you can just enable ` ` ALLOW_TABLE_GROWTH ` ` . <nl> + <nl> * Also see the ` blocker bugs on the wasm backend < https : / / github . com / emscripten - core / emscripten / projects / 1 > ` _ , and the ` wasm backend tagged issues < https : / / github . com / emscripten - core / emscripten / issues ? utf8 = ✓ & q = is % 3Aissue + is % 3Aopen + label % 3A " LLVM + wasm + backend " > ` _ . <nl> <nl> Binaryen codegen options <nl> mmm a / src / runtime_functions . js <nl> ppp b / src / runtime_functions . js <nl> function addFunctionWasm ( func , sig ) { <nl> if ( ! ( err instanceof RangeError ) ) { <nl> throw err ; <nl> } <nl> + # if WASM_BACKEND <nl> + throw ' Unable to grow wasm table . Set ALLOW_TABLE_GROWTH . ' ; <nl> + # else <nl> throw ' Unable to grow wasm table . Use a higher value for RESERVED_FUNCTION_POINTERS or set ALLOW_TABLE_GROWTH . ' ; <nl> + # endif <nl> } <nl> <nl> / / Insert new element <nl> mmm a / src / settings . js <nl> ppp b / src / settings . js <nl> var SAFE_HEAP_LOG = 0 ; <nl> / / In asm . js mode , we cannot simply add function pointers to function tables , so <nl> / / we reserve some slots for them . An alternative to this is to use <nl> / / EMULATED_FUNCTION_POINTERS , in which case we don ' t need to reserve . <nl> + / / [ fastcomp - only ] <nl> var RESERVED_FUNCTION_POINTERS = 0 ; <nl> <nl> / / Whether to allow function pointers to alias if they have a different type . <nl>
[ docs ] Mention upstream is the default + related docs fixes ( )
emscripten-core/emscripten
3174b990bbc19f76f8e97d739b7f31cb22c5e45c
2020-03-02T21:52:25Z
mmm a / xbmc / addons / Repository . cpp <nl> ppp b / xbmc / addons / Repository . cpp <nl> bool CRepositoryUpdateJob : : DoWork ( ) <nl> if ( URIUtils : : IsInternetStream ( newAddon - > Path ( ) ) ) <nl> referer = StringUtils : : Format ( " Referer = % s - % s . zip " , addon - > ID ( ) . c_str ( ) , addon - > Version ( ) . asString ( ) . c_str ( ) ) ; <nl> <nl> - if ( ! newAddon - > CanInstall ( referer ) ) <nl> + if ( newAddon - > CanInstall ( referer ) ) <nl> CAddonInstaller : : Get ( ) . Install ( addon - > ID ( ) , true , referer ) ; <nl> } <nl> else <nl>
Merge pull request from ace20022 / fix_autoupdate
xbmc/xbmc
7cb556aa05ddb3f99e7386aac0dc98a622391ae0
2014-08-31T08:44:38Z