diff
stringlengths
41
2.03M
msg
stringlengths
1
1.5k
repo
stringlengths
5
40
sha
stringlengths
40
40
time
stringlengths
20
20
mmm a / Makefile <nl> ppp b / Makefile <nl> wc : : <nl> test : : <nl> @ $ ( MAKE ) - C test <nl> <nl> + test - perf : : <nl> + @ $ ( MAKE ) - C test test - perf <nl> + <nl> clean : : <nl> @ $ ( MAKE ) - C test clean <nl> <nl> mmm a / test / Makefile <nl> ppp b / test / Makefile <nl> all : : lit . site . cfg Unit / lit . site . cfg <nl> @ $ ( PYTHON ) $ ( LLVM_SRC_ROOT ) / utils / lit / lit . py \ <nl> $ ( LIT_ARGS ) $ ( TESTARGS ) $ ( TESTDIRS ) <nl> <nl> + test - perf : . . / benchmark / lit . site . cfg <nl> + @ echo ' mmm Running swift performance tests mmm ' <nl> + @ $ ( PYTHON ) $ ( LLVM_SRC_ROOT ) / utils / lit / lit . py \ <nl> + $ ( LIT_ARGS ) $ ( TESTARGS ) . . / benchmark <nl> + <nl> FORCE : <nl> <nl> lit . site . cfg : FORCE <nl> Unit / lit . site . cfg : FORCE <nl> @ sed - f unit . tmp $ ( PROJ_SRC_DIR ) / Unit / lit . site . cfg . in > $ @ <nl> @ - rm - f unit . tmp <nl> <nl> + . . / benchmark / lit . site . cfg : FORCE <nl> + @ echo " Making Swift ' . . / benchmark / lit . site . cfg ' file . . . " <nl> + @ $ ( MKDIR ) $ ( dir $ @ ) <nl> + @ $ ( ECHOPATH ) s = @ LLVM_TOOLS_DIR @ = $ ( ToolDir ) = g > > unit . tmp <nl> + @ $ ( ECHOPATH ) s = @ LLVM_LIBS_DIR @ = $ ( LibDir ) = g > > unit . tmp <nl> + @ $ ( ECHOPATH ) s = @ SWIFT_SOURCE_DIR @ = $ ( PROJ_SRC_DIR ) / . . = g > > unit . tmp <nl> + @ $ ( ECHOPATH ) s = @ SWIFT_BINARY_DIR @ = $ ( PROJ_OBJ_DIR ) / . . = g > > unit . tmp <nl> + @ $ ( ECHOPATH ) s = @ CC_UNDER_TEST @ = $ ( CC ) = g > > unit . tmp <nl> + @ sed - f unit . tmp $ ( PROJ_SRC_DIR ) / . . / benchmark / lit . site . cfg . in > $ @ <nl> + @ - rm - f unit . tmp <nl> + <nl> clean : : <nl> @ find . - name Output | xargs rm - fr <nl> <nl>
[ perftests ] Add build system support for running performance tests .
apple/swift
4c41256e062f4f862a4b5c616fad8521261b9b6b
2013-09-05T02:09:19Z
mmm a / dbms / src / DataStreams / BlockInputStreamFromRowInputStream . cpp <nl> ppp b / dbms / src / DataStreams / BlockInputStreamFromRowInputStream . cpp <nl> Block BlockInputStreamFromRowInputStream : : readImpl ( ) <nl> } <nl> catch ( const DB : : Exception & e ) <nl> { <nl> - throw DB : : Exception ( e . displayText ( ) + " ( at row " + Poco : : NumberFormatter : : format ( total_rows + 1 ) + " ) " , e , e . code ( ) ) ; <nl> + throw DB : : Exception ( e . message ( ) + " ( at row " + Poco : : NumberFormatter : : format ( total_rows + 1 ) + " ) " , e , e . code ( ) ) ; <nl> } <nl> <nl> return res ; <nl>
Addition to prev . revision [ # CONV - 2944 ] .
ClickHouse/ClickHouse
7b17b8f342adf339210d865f783bae4d1d5f6671
2012-12-29T16:28:22Z
mmm a / conformance / conformance_objc . m <nl> ppp b / conformance / conformance_objc . m <nl> static void Die ( NSString * format , . . . ) { <nl> } else if ( [ request . messageType isEqual : @ " protobuf_test_messages . proto2 . TestAllTypesProto2 " ] ) { <nl> msgClass = [ TestAllTypesProto2 class ] ; <nl> } else { <nl> - Die ( @ " Protobuf request doesn ' t have specific payload type " ) ; <nl> + Die ( @ " Protobuf request had an unknown message_type : % @ " , request . messageType ) ; <nl> } <nl> - if ( msgClass ) { <nl> - NSError * error = nil ; <nl> - testMessage = [ msgClass parseFromData : request . protobufPayload error : & error ] ; <nl> - if ( ! testMessage ) { <nl> - response . parseError = <nl> - [ NSString stringWithFormat : @ " Parse error : % @ " , error ] ; <nl> - } <nl> + NSError * error = nil ; <nl> + testMessage = [ msgClass parseFromData : request . protobufPayload error : & error ] ; <nl> + if ( ! testMessage ) { <nl> + response . parseError = <nl> + [ NSString stringWithFormat : @ " Parse error : % @ " , error ] ; <nl> } <nl> break ; <nl> } <nl>
Review feedback .
protocolbuffers/protobuf
3caf9fd00a84d71c63c9fb873eb9befd70400153
2017-07-26T20:24:05Z
mmm a / html / admin / js / templates / documentsView . ejs <nl> ppp b / html / admin / js / templates / documentsView . ejs <nl> <nl> < div id = " documentsToolbar " class = " pagination pagination - small pagination - right " > <nl> <nl> < ! - - remove marker for docupdiv - - ! > <nl> - < ul > < li class = " enabled " > < a id = " filterCollection " > < i class = " icon icon - white icon - filter " > < / i > < / a > < / li > < / ul > <nl> + < ul > < li class = " enabled " > < a id = " filterCollection " > < i class = " icon icon - white icon - cog " > < / i > < / a > < / li > < / ul > <nl> <nl> < ul > <nl> < li class = " enabled " > < a id = " collectionPrev " > < i class = " icon icon - white icon - chevron - left " > < / i > < / a > < / li > <nl>
settings icon
arangodb/arangodb
83fd35af3eacd079f0e944f1469bfbaa8b305d51
2013-07-24T17:17:27Z
mmm a / src / serialize . h <nl> ppp b / src / serialize . h <nl> class LimitedString <nl> protected : <nl> std : : string & string ; <nl> public : <nl> - LimitedString ( std : : string & string ) : string ( string ) { } <nl> + LimitedString ( std : : string & _string ) : string ( _string ) { } <nl> <nl> template < typename Stream > <nl> void Unserialize ( Stream & s ) <nl> class CSizeComputer <nl> public : <nl> CSizeComputer ( int nTypeIn , int nVersionIn ) : nSize ( 0 ) , nType ( nTypeIn ) , nVersion ( nVersionIn ) { } <nl> <nl> - void write ( const char * psz , size_t nSize ) <nl> + void write ( const char * psz , size_t _nSize ) <nl> { <nl> - this - > nSize + = nSize ; <nl> + this - > nSize + = _nSize ; <nl> } <nl> <nl> template < typename T > <nl>
Avoid - Wshadow errors
bitcoin/bitcoin
a603925c77d7cd15c03d8028414c8917347e81b7
2016-11-07T21:56:27Z
mmm a / test / format - test . cc <nl> ppp b / test / format - test . cc <nl> namespace { <nl> <nl> / / Format value using the standard library . <nl> template < typename Char , typename T > <nl> - std : : basic_string < Char > std_format ( const T & value ) { <nl> + void std_format ( const T & value , std : : basic_string < Char > & result ) { <nl> std : : basic_ostringstream < Char > os ; <nl> os < < value ; <nl> - return os . str ( ) ; <nl> + result = os . str ( ) ; <nl> } <nl> <nl> # ifdef __MINGW32__ <nl> / / Workaround a bug in formatting long double in MinGW . <nl> - template < typename Char > <nl> - std : : basic_string < Char > std_format ( long double value ) { <nl> + void std_format ( long double value , std : : string & result ) { <nl> char buffer [ 100 ] ; <nl> - sprintf_s ( buffer , sizeof ( buffer ) , " % Lg " , value ) ; <nl> - return buffer ; <nl> + snprintf ( buffer , sizeof ( buffer ) , " % Lg " , value ) ; <nl> + result = buffer ; <nl> } <nl> # endif <nl> <nl> template < typename Char , typename T > <nl> : : testing : : AssertionResult check_write ( const T & value , const char * type ) { <nl> std : : basic_string < Char > actual = <nl> ( fmt : : BasicMemoryWriter < Char > ( ) < < value ) . str ( ) ; <nl> - std : : basic_string < Char > expected = std_format < Char > ( value ) ; <nl> + std : : basic_string < Char > expected ; <nl> + std_format < Char > ( value , expected ) ; <nl> if ( expected = = actual ) <nl> return : : testing : : AssertionSuccess ( ) ; <nl> return : : testing : : AssertionFailure ( ) <nl>
Workaround a bug in formatting long double in MinGW , take 2
fmtlib/fmt
3e379829a0581a6163ee6a5bbff7e3b715d9c704
2015-05-07T14:25:39Z
mmm a / src / ccutil / params . cpp <nl> ppp b / src / ccutil / params . cpp <nl> <nl> # include " tprintf . h " <nl> # include " params . h " <nl> <nl> - # define PLUS ' + ' / / flag states <nl> - # define MINUS ' - ' <nl> - <nl> tesseract : : ParamsVectors * GlobalParams ( ) { <nl> static tesseract : : ParamsVectors global_params = tesseract : : ParamsVectors ( ) ; <nl> return & global_params ; <nl> namespace tesseract { <nl> bool ParamUtils : : ReadParamsFile ( const char * file , <nl> SetParamConstraint constraint , <nl> ParamsVectors * member_params ) { <nl> - int16_t nameoffset ; / / offset for real name <nl> - <nl> - if ( * file = = PLUS ) { <nl> - nameoffset = 1 ; <nl> - } else if ( * file = = MINUS ) { <nl> - nameoffset = 1 ; <nl> - } else { <nl> - nameoffset = 0 ; <nl> - } <nl> - <nl> TFile fp ; <nl> if ( ! fp . Open ( file + nameoffset , nullptr ) ) { <nl> - tprintf ( " read_params_file : Can ' t open % s \ n " , file + nameoffset ) ; <nl> + tprintf ( " read_params_file : Can ' t open % s \ n " , file ) ; <nl> return true ; <nl> } <nl> return ReadParamsFromFp ( constraint , & fp , member_params ) ; <nl>
Merge pull request from stweil / params
tesseract-ocr/tesseract
d24c16f767202f9ba1bca4660578e647d6cb8f41
2019-10-17T19:18:04Z
mmm a / xbmc / guilib / GUIControlFactory . cpp <nl> ppp b / xbmc / guilib / GUIControlFactory . cpp <nl> CGUIControl * CGUIControlFactory : : Create ( int parentID , const CRect & rect , TiXmlEl <nl> hitRect . SetRect ( posX , posY , posX + width , posY + height ) ; <nl> GetHitRect ( pControlNode , hitRect ) ; <nl> <nl> - if ( ! GetNavigation ( pControlNode , " onup " , up , upActions ) ) up = id - 1 ; <nl> - if ( ! GetNavigation ( pControlNode , " ondown " , down , downActions ) ) down = id + 1 ; <nl> + if ( ! GetNavigation ( pControlNode , " onup " , up , upActions ) ) up = id ; <nl> + if ( ! GetNavigation ( pControlNode , " ondown " , down , downActions ) ) down = id ; <nl> if ( ! GetNavigation ( pControlNode , " onleft " , left , leftActions ) ) left = id ; <nl> if ( ! GetNavigation ( pControlNode , " onright " , right , rightActions ) ) right = id ; <nl> if ( ! GetNavigation ( pControlNode , " onnext " , next , nextActions ) ) next = id ; <nl>
changed : default < onup > and < ondown > id ' s should be the control ID rather than ID - 1 or ID + 1 . Fixes .
xbmc/xbmc
71e5255f39748591f36a744c0ed41fb28398d52a
2011-05-14T23:31:41Z
mmm a / dbms / src / Client / Client . cpp <nl> ppp b / dbms / src / Client / Client . cpp <nl> class Client : public Poco : : Util : : Application <nl> copyData ( in , out ) ; <nl> } <nl> <nl> + process ( line ) ; <nl> + } <nl> + <nl> + <nl> + bool process ( const String & line ) <nl> + { <nl> if ( config ( ) . has ( " multiquery " ) ) <nl> { <nl> / / / Несколько запросов , разделенных ' ; ' . <nl> class Client : public Poco : : Util : : Application <nl> while ( isWhitespace ( * begin ) | | * begin = = ' ; ' ) <nl> + + begin ; <nl> <nl> - process ( query , ast ) ; <nl> + if ( ! processSingleQuery ( query , ast ) ) <nl> + return false ; <nl> } <nl> + <nl> + return true ; <nl> } <nl> else <nl> { <nl> - process ( line ) ; <nl> + return processSingleQuery ( line ) ; <nl> } <nl> } <nl> <nl> <nl> - bool process ( const String & line , ASTPtr parsed_query_ = nullptr ) <nl> + bool processSingleQuery ( const String & line , ASTPtr parsed_query_ = nullptr ) <nl> { <nl> if ( exit_strings . end ( ) ! = exit_strings . find ( line ) ) <nl> return false ; <nl>
dbms : added support for multiquery in interactive mode [ # METR - 17471 ] .
ClickHouse/ClickHouse
d9e76da292ee2fa6a7d87c3bd0e035b69812d0f6
2015-07-25T10:58:41Z
mmm a / plugin / plugins / umeng / proj . ios / AnalyticsUmeng . m <nl> ppp b / plugin / plugins / umeng / proj . ios / AnalyticsUmeng . m <nl> - ( void ) logEvent : ( NSString * ) eventId <nl> - ( void ) logEvent : ( NSString * ) eventId withParam : ( NSMutableDictionary * ) paramMap <nl> { <nl> OUTPUT_LOG ( @ " Umeng logEventWithParam invoked " ) ; <nl> - [ MobClick event : eventId attributes : paramMap ] ; <nl> + if ( paramMap ! = nil ) { <nl> + [ MobClick event : eventId attributes : paramMap ] ; <nl> + } else { <nl> + [ MobClick event : eventId ] ; <nl> + } <nl> } <nl> <nl> - ( void ) logTimedEventBegin : ( NSString * ) eventId <nl>
[ plugin - x ] [ Umeng ] fix not sending Event when paramMap is nil
cocos2d/cocos2d-x
cedfd6bbdc8bb8853233c15e91145b8f578a56a5
2013-07-01T08:51:31Z
mmm a / src / mongo / db / pipeline / document_source_cursor . cpp <nl> ppp b / src / mongo / db / pipeline / document_source_cursor . cpp <nl> namespace mongo { <nl> return false ; <nl> } <nl> <nl> - namespace { <nl> - Document extractInfo ( ptr < const TypeExplain > info ) { <nl> - MutableDocument out ; <nl> - <nl> - if ( info - > isClausesSet ( ) ) { <nl> - vector < Value > clauses ; <nl> - for ( size_t i = 0 ; i < info - > sizeClauses ( ) ; i + + ) { <nl> - clauses . push_back ( Value ( extractInfo ( info - > getClausesAt ( i ) ) ) ) ; <nl> - } <nl> - out [ TypeExplain : : clauses ( ) ] = Value : : consume ( clauses ) ; <nl> - } <nl> - <nl> - if ( info - > isCursorSet ( ) ) <nl> - out [ TypeExplain : : cursor ( ) ] = Value ( info - > getCursor ( ) ) ; <nl> - <nl> - if ( info - > isIsMultiKeySet ( ) ) <nl> - out [ TypeExplain : : isMultiKey ( ) ] = Value ( info - > getIsMultiKey ( ) ) ; <nl> - <nl> - if ( info - > isScanAndOrderSet ( ) ) <nl> - out [ TypeExplain : : scanAndOrder ( ) ] = Value ( info - > getScanAndOrder ( ) ) ; <nl> - <nl> - # if 0 / / Disabled pending SERVER - 12015 since until then no aggs will be index only . <nl> - if ( info - > isIndexOnlySet ( ) ) <nl> - out [ TypeExplain : : indexOnly ( ) ] = Value ( info - > getIndexOnly ( ) ) ; <nl> - # endif <nl> - <nl> - if ( info - > isIndexBoundsSet ( ) ) <nl> - out [ TypeExplain : : indexBounds ( ) ] = Value ( info - > getIndexBounds ( ) ) ; <nl> - <nl> - if ( info - > isAllPlansSet ( ) ) { <nl> - vector < Value > allPlans ; <nl> - for ( size_t i = 0 ; i < info - > sizeAllPlans ( ) ; i + + ) { <nl> - allPlans . push_back ( Value ( extractInfo ( info - > getAllPlansAt ( i ) ) ) ) ; <nl> - } <nl> - out [ TypeExplain : : allPlans ( ) ] = Value : : consume ( allPlans ) ; <nl> - } <nl> - <nl> - return out . freeze ( ) ; <nl> - } <nl> - } / / namespace <nl> - <nl> Value DocumentSourceCursor : : serialize ( bool explain ) const { <nl> / / we never parse a documentSourceCursor , so we only serialize for explain <nl> if ( ! explain ) <nl> return Value ( ) ; <nl> <nl> + / / Get planner - level explain info from the underlying PlanExecutor . <nl> + BSONObjBuilder explainBuilder ; <nl> Status explainStatus ( ErrorCodes : : InternalError , " " ) ; <nl> - scoped_ptr < TypeExplain > plan ; <nl> { <nl> Lock : : DBRead lk ( pExpCtx - > opCtx - > lockState ( ) , _ns ) ; <nl> Client : : Context ctx ( pExpCtx - > opCtx , _ns , / * doVersion = * / false ) ; <nl> <nl> - massert ( 17392 , " No _exec . Were we disposed before explained ? " , <nl> - _exec ) ; <nl> + massert ( 17392 , " No _exec . Were we disposed before explained ? " , _exec ) ; <nl> <nl> _exec - > restoreState ( pExpCtx - > opCtx ) ; <nl> - <nl> - TypeExplain * explainRaw ; <nl> - explainStatus = Explain : : legacyExplain ( _exec . get ( ) , & explainRaw ) ; <nl> - if ( explainStatus . isOK ( ) ) <nl> - plan . reset ( explainRaw ) ; <nl> - <nl> + explainStatus = Explain : : explainStages ( _exec . get ( ) , Explain : : QUERY_PLANNER , <nl> + & explainBuilder ) ; <nl> _exec - > saveState ( ) ; <nl> } <nl> <nl> namespace { <nl> if ( ! _projection . isEmpty ( ) ) <nl> out [ " fields " ] = Value ( _projection ) ; <nl> <nl> + / / Add explain results from the query system into the agg explain output . <nl> if ( explainStatus . isOK ( ) ) { <nl> - out [ " plan " ] = Value ( extractInfo ( plan ) ) ; <nl> - } else { <nl> + BSONObj explainObj = explainBuilder . obj ( ) ; <nl> + invariant ( explainObj . hasField ( " queryPlanner " ) ) ; <nl> + out [ " queryPlanner " ] = Value ( explainObj [ " queryPlanner " ] ) ; <nl> + } <nl> + else { <nl> out [ " planError " ] = Value ( explainStatus . toString ( ) ) ; <nl> } <nl> <nl>
SERVER - 14743 agg explain uses explain 2 . 0 format
mongodb/mongo
c1901441f0e9c73d5457d3169145fb55a65c7307
2014-08-26T12:20:27Z
mmm a / configure . ac <nl> ppp b / configure . ac <nl> fi <nl> eval " APP_PREFIX = $ { prefix } " <nl> eval " APP_LIB_DIR = $ { libdir } / $ { APP_NAME_LC } " <nl> eval " APP_INCLUDE_DIR = $ { includedir } / $ { APP_NAME_LC } " <nl> + eval " APP_DATA_DIR = $ { datarootdir } / $ { APP_NAME_LC } " <nl> AC_SUBST ( APP_PREFIX ) <nl> AC_SUBST ( APP_LIB_DIR ) <nl> AC_SUBST ( APP_INCLUDE_DIR ) <nl> + AC_SUBST ( APP_DATA_DIR ) <nl> <nl> # Line below is used so we can use AM_INIT_AUTOMAKE . The corresponding <nl> # . dummy . am does nothing . <nl>
[ autotools ] Add missing APP_DATA_DIR in configure . ac
xbmc/xbmc
b54e7f8b6286e68f4db069dd41bbe78f2661d178
2016-09-08T07:48:39Z
mmm a / swoole_event . cc <nl> ppp b / swoole_event . cc <nl> static PHP_FUNCTION ( swoole_event_add ) <nl> zend_fcall_info_cache fci_cache_write = empty_fcall_info_cache ; <nl> zend_long event_flag = 0 ; <nl> <nl> - <nl> - ZEND_PARSE_PARAMETERS_START ( 1 , 1 ) <nl> + ZEND_PARSE_PARAMETERS_START ( 1 , 4 ) <nl> Z_PARAM_ZVAL ( zfd ) <nl> Z_PARAM_OPTIONAL <nl> Z_PARAM_FUNC_EX ( fci_read , fci_cache_read , 1 , 0 ) <nl> static PHP_FUNCTION ( swoole_event_set ) <nl> zend_long event_flag = 0 ; <nl> <nl> <nl> - ZEND_PARSE_PARAMETERS_START ( 1 , 1 ) <nl> + ZEND_PARSE_PARAMETERS_START ( 1 , 4 ) <nl> Z_PARAM_ZVAL ( zfd ) <nl> Z_PARAM_OPTIONAL <nl> Z_PARAM_FUNC_EX ( fci_read , fci_cache_read , 1 , 0 ) <nl> static PHP_FUNCTION ( swoole_event_cycle ) <nl> zend_fcall_info_cache _fci_cache = empty_fcall_info_cache ; <nl> zend_bool before = 0 ; <nl> <nl> - ZEND_PARSE_PARAMETERS_START ( 1 , 1 ) <nl> + ZEND_PARSE_PARAMETERS_START ( 1 , 2 ) <nl> Z_PARAM_FUNC_EX ( _fci , _fci_cache , 1 , 0 ) <nl> Z_PARAM_OPTIONAL <nl> Z_PARAM_BOOL ( before ) <nl>
Fix ZEND_PARSE_PARAMETERS .
swoole/swoole-src
238320b596eb0fbc33673c3be8fd8dd751da335f
2019-06-12T08:39:19Z
mmm a / aten / src / ATen / native / TensorShape . cpp <nl> ppp b / aten / src / ATen / native / TensorShape . cpp <nl> <nl> # include " ATen / WrapDimUtils . h " <nl> # include " ATen / core / Error . h " <nl> # include " ATen / core / optional . h " <nl> + # include < ATen / native / sparse / SparseUtils . h > <nl> <nl> # include < algorithm > <nl> # include < vector > <nl> static inline Tensor & sparse_transpose_ ( Tensor & self , int64_t dim0 , int64_t di <nl> row0 . copy_ ( row1 ) ; <nl> row1 . copy_ ( tmp ) ; <nl> <nl> + _get_sparse_impl ( self ) - > set_coalesced ( false ) ; <nl> + <nl> auto sizes = self . sizes ( ) . vec ( ) ; <nl> std : : swap ( sizes [ dim0 ] , sizes [ dim1 ] ) ; <nl> <nl> mmm a / test / test_sparse . py <nl> ppp b / test / test_sparse . py <nl> def test_transpose ( self ) : <nl> y = y . transpose ( i , j ) <nl> self . assertEqual ( self . safeToDense ( x ) , y ) <nl> <nl> - def test_transpose_coalesce_invariant ( self ) : <nl> - # If a sparse tensor is coalesced , its transpose should be the same <nl> - # If a sparse tensor is uncoalesed , its transpose should be the same <nl> - x_coalesced = self . _gen_sparse ( 2 , 3 , 4 ) [ 0 ] . coalesce ( ) <nl> - x_indices = x_coalesced . _indices ( ) <nl> - x_values = x_coalesced . _values ( ) <nl> - <nl> - y_uncoalesced = self . SparseTensor ( <nl> - torch . cat ( [ x_indices , x_indices ] , dim = 1 ) , <nl> - torch . cat ( [ x_values , x_values ] ) , <nl> - x_coalesced . size ( ) ) <nl> - <nl> - self . assertTrue ( x_coalesced . is_coalesced ( ) ) <nl> - self . assertFalse ( y_uncoalesced . is_coalesced ( ) ) <nl> - <nl> - self . assertTrue ( x_coalesced . transpose ( 0 , 1 ) . is_coalesced ( ) ) <nl> - self . assertFalse ( y_uncoalesced . transpose ( 0 , 1 ) . is_coalesced ( ) ) <nl> - <nl> - x_coalesced . transpose_ ( 0 , 1 ) <nl> - y_uncoalesced . transpose_ ( 0 , 1 ) <nl> - self . assertTrue ( x_coalesced . is_coalesced ( ) ) <nl> - self . assertFalse ( y_uncoalesced . is_coalesced ( ) ) <nl> + @ cpu_only <nl> + def test_coalesce_transpose_mm ( self ) : <nl> + def test_shape ( di , dj , dk ) : <nl> + x , _ , _ = self . _gen_sparse ( 2 , 20 , [ dj , di ] ) <nl> + y = torch . randn ( dj , dk ) <nl> + <nl> + x_coalesced = x . coalesce ( ) <nl> + self . assertTrue ( x_coalesced . is_coalesced ( ) ) <nl> + <nl> + x_coalesced_t = x . t ( ) <nl> + self . assertFalse ( x_coalesced_t . is_coalesced ( ) ) <nl> + <nl> + res = torch . mm ( x_coalesced_t , y ) <nl> + expected = torch . mm ( self . safeToDense ( x_coalesced_t ) , y ) <nl> + self . assertEqual ( res , expected ) <nl> + <nl> + test_shape ( 10 , 20 , 30 ) <nl> <nl> def test_t_empty ( self ) : <nl> x = self . SparseTensor ( 2 , 3 ) <nl>
set coalesced = false at sparse transpose ( ) and removed transpose invariants ( )
pytorch/pytorch
19ad55cc0288fe154a1fde8592e7819c22443198
2018-08-15T04:25:37Z
mmm a / qt <nl> ppp b / qt <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 6f145e6217604ba449573bdd8362f012a0fb4af0 <nl> + Subproject commit 095c21855d8ccd47c5f04e97dcb742deff4b7797 <nl>
update to latest QT which fixes
wkhtmltopdf/wkhtmltopdf
bc91350e9599cbc267e4e8b2079b083777d849ad
2014-03-28T08:56:19Z
mmm a / cmake / modules / AddSwift . cmake <nl> ppp b / cmake / modules / AddSwift . cmake <nl> function ( add_swift_library name ) <nl> add_dependencies ( " swift - stdlib $ { VARIANT_SUFFIX } " <nl> $ { lipo_target } <nl> $ { lipo_target_static } ) <nl> - if ( NOT " $ { name } " STREQUAL " swiftStdlibCollectionUnittest " ) <nl> + if ( ( NOT " $ { name } " STREQUAL " swiftStdlibCollectionUnittest " ) AND <nl> + ( NOT " $ { name } " STREQUAL " swiftStdlibUnicodeUnittest " ) ) <nl> add_dependencies ( " swift - test - stdlib $ { VARIANT_SUFFIX } " <nl> $ { lipo_target } <nl> $ { lipo_target_static } ) <nl> mmm a / stdlib / private / CMakeLists . txt <nl> ppp b / stdlib / private / CMakeLists . txt <nl> if ( SWIFT_BUILD_SDK_OVERLAY ) <nl> # SwiftPrivatePthreadExtras makes use of Darwin / Glibc , which is part of the <nl> # SDK overlay . It can ' t be built separately from the SDK overlay . <nl> add_subdirectory ( StdlibUnittest ) <nl> + add_subdirectory ( StdlibUnicodeUnittest ) <nl> add_subdirectory ( StdlibCollectionUnittest ) <nl> add_subdirectory ( SwiftPrivateLibcExtras ) <nl> add_subdirectory ( SwiftPrivatePthreadExtras ) <nl> new file mode 100644 <nl> index 000000000000 . . 418eda8b4fb4 <nl> mmm / dev / null <nl> ppp b / stdlib / private / StdlibUnicodeUnittest / CMakeLists . txt <nl> <nl> + set ( swift_stdlib_unittest_compile_flags ) <nl> + if ( SWIFT_SERIALIZE_STDLIB_UNITTEST ) <nl> + list ( APPEND swift_stdlib_unittest_compile_flags " - Xfrontend " " - sil - serialize - all " ) <nl> + endif ( ) <nl> + <nl> + # TODO : support this on non - POSIX platforms . It cannot be currently as it <nl> + # depends on pthreads . <nl> + add_swift_library ( swiftStdlibUnicodeUnittest $ { SWIFT_STDLIB_LIBRARY_BUILD_TYPES } IS_STDLIB <nl> + # This file should be listed the first . Module name is inferred from the <nl> + # filename . <nl> + StdlibUnicodeUnittest . swift <nl> + <nl> + SWIFT_MODULE_DEPENDS StdlibUnittest <nl> + SWIFT_COMPILE_FLAGS $ { swift_stdlib_unittest_compile_flags } <nl> + TARGET_SDKS ALL_POSIX_PLATFORMS <nl> + INSTALL_IN_COMPONENT stdlib - experimental ) <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 24236c07c68c <nl> mmm / dev / null <nl> ppp b / stdlib / private / StdlibUnicodeUnittest / StdlibUnicodeUnittest . swift <nl> <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / <nl> + / / This source file is part of the Swift . org open source project <nl> + / / <nl> + / / Copyright ( c ) 2014 - 2016 Apple Inc . and the Swift project authors <nl> + / / Licensed under Apache License v2 . 0 with Runtime Library Exception <nl> + / / <nl> + / / See http : / / swift . org / LICENSE . txt for license information <nl> + / / See http : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> + / / <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + import StdlibUnittest <nl> + <nl> + public struct UTFTest { <nl> + public struct Flags : OptionSet { <nl> + public let rawValue : Int <nl> + <nl> + public init ( rawValue : Int ) { <nl> + self . rawValue = rawValue <nl> + } <nl> + <nl> + public static let utf8IsInvalid = Flags ( rawValue : 1 < < 0 ) <nl> + public static let utf16IsInvalid = Flags ( rawValue : 1 < < 1 ) <nl> + } <nl> + <nl> + public let string : String <nl> + public let utf8 : [ UInt8 ] <nl> + public let utf16 : [ UInt16 ] <nl> + public let unicodeScalars : [ UnicodeScalar ] <nl> + public let unicodeScalarsRepairedTail : [ UnicodeScalar ] <nl> + public let flags : Flags <nl> + public let loc : SourceLoc <nl> + <nl> + public var utf32 : [ UInt32 ] { <nl> + return unicodeScalars . map ( UInt32 . init ) <nl> + } <nl> + <nl> + public var utf32RepairedTail : [ UInt32 ] { <nl> + return unicodeScalarsRepairedTail . map ( UInt32 . init ) <nl> + } <nl> + <nl> + public init ( <nl> + string : String , <nl> + utf8 : [ UInt8 ] , <nl> + utf16 : [ UInt16 ] , <nl> + scalars : [ UInt32 ] , <nl> + scalarsRepairedTail : [ UInt32 ] = [ ] , <nl> + flags : Flags = [ ] , <nl> + file : String = # file , line : UInt = # line <nl> + ) { <nl> + self . string = string <nl> + self . utf8 = utf8 <nl> + self . utf16 = utf16 <nl> + self . unicodeScalars = scalars . map { UnicodeScalar ( $ 0 ) ! } <nl> + self . unicodeScalarsRepairedTail = <nl> + scalarsRepairedTail . map { UnicodeScalar ( $ 0 ) ! } <nl> + self . flags = flags <nl> + self . loc = SourceLoc ( file , line , comment : " test data " ) <nl> + } <nl> + } <nl> + <nl> + public let utfTests : [ UTFTest ] = [ <nl> + / / <nl> + / / Empty sequence . <nl> + / / <nl> + <nl> + UTFTest ( <nl> + string : " " , <nl> + utf8 : [ ] , <nl> + utf16 : [ ] , <nl> + scalars : [ ] ) , <nl> + <nl> + / / <nl> + / / 1 - byte sequences . <nl> + / / <nl> + <nl> + / / U + 0000 NULL <nl> + UTFTest ( <nl> + string : " \ u { 0000 } " , <nl> + utf8 : [ 0x00 ] , <nl> + utf16 : [ 0x00 ] , <nl> + scalars : [ 0x00 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + UTFTest ( <nl> + string : " A " , <nl> + utf8 : [ 0x41 ] , <nl> + utf16 : [ 0x41 ] , <nl> + scalars : [ 0x41 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + 0042 LATIN CAPITAL LETTER B <nl> + UTFTest ( <nl> + string : " AB " , <nl> + utf8 : [ 0x41 , 0x42 ] , <nl> + utf16 : [ 0x41 , 0x42 ] , <nl> + scalars : [ 0x41 , 0x42 ] ) , <nl> + <nl> + / / U + 0061 LATIN SMALL LETTER A <nl> + / / U + 0062 LATIN SMALL LETTER B <nl> + / / U + 0063 LATIN SMALL LETTER C <nl> + UTFTest ( <nl> + string : " ABC " , <nl> + utf8 : [ 0x41 , 0x42 , 0x43 ] , <nl> + utf16 : [ 0x41 , 0x42 , 0x43 ] , <nl> + scalars : [ 0x41 , 0x42 , 0x43 ] ) , <nl> + <nl> + / / U + 0000 NULL <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + 0042 LATIN CAPITAL LETTER B <nl> + / / U + 0000 NULL <nl> + UTFTest ( <nl> + string : " \ u { 0000 } AB \ u { 0000 } " , <nl> + utf8 : [ 0x00 , 0x41 , 0x42 , 0x00 ] , <nl> + utf16 : [ 0x00 , 0x41 , 0x42 , 0x00 ] , <nl> + scalars : [ 0x00 , 0x41 , 0x42 , 0x00 ] ) , <nl> + <nl> + / / U + 007F DELETE <nl> + UTFTest ( <nl> + string : " \ u { 007F } " , <nl> + utf8 : [ 0x7F ] , <nl> + utf16 : [ 0x7F ] , <nl> + scalars : [ 0x7F ] ) , <nl> + <nl> + / / <nl> + / / 2 - byte sequences . <nl> + / / <nl> + <nl> + / / U + 0283 LATIN SMALL LETTER ESH <nl> + UTFTest ( <nl> + string : " \ u { 0283 } " , <nl> + utf8 : [ 0xCA , 0x83 ] , <nl> + utf16 : [ 0x0283 ] , <nl> + scalars : [ 0x0283 ] ) , <nl> + <nl> + / / U + 03BA GREEK SMALL LETTER KAPPA <nl> + / / U + 1F79 GREEK SMALL LETTER OMICRON WITH OXIA <nl> + / / U + 03C3 GREEK SMALL LETTER SIGMA <nl> + / / U + 03BC GREEK SMALL LETTER MU <nl> + / / U + 03B5 GREEK SMALL LETTER EPSILON <nl> + UTFTest ( <nl> + string : " \ u { 03BA } \ u { 1F79 } \ u { 03C3 } \ u { 03BC } \ u { 03B5 } " , <nl> + utf8 : [ 0xCE , 0xBA , 0xE1 , 0xBD , 0xB9 , 0xCF , 0x83 , 0xCE , 0xBC , 0xCE , 0xB5 ] , <nl> + utf16 : [ 0x03BA , 0x1F79 , 0x03C3 , 0x03BC , 0x03B5 ] , <nl> + scalars : [ 0x03BA , 0x1F79 , 0x03C3 , 0x03BC , 0x03B5 ] ) , <nl> + <nl> + / / U + 0430 CYRILLIC SMALL LETTER A <nl> + / / U + 0431 CYRILLIC SMALL LETTER BE <nl> + / / U + 0432 CYRILLIC SMALL LETTER VE <nl> + UTFTest ( <nl> + string : " \ u { 0430 } \ u { 0431 } \ u { 0432 } " , <nl> + utf8 : [ 0xD0 , 0xB0 , 0xD0 , 0xB1 , 0xD0 , 0xB2 ] , <nl> + utf16 : [ 0x0430 , 0x0431 , 0x0432 ] , <nl> + scalars : [ 0x0430 , 0x0431 , 0x0432 ] ) , <nl> + <nl> + / / <nl> + / / 3 - byte sequences . <nl> + / / <nl> + <nl> + / / U + 4F8B CJK UNIFIED IDEOGRAPH - 4F8B <nl> + / / U + 6587 CJK UNIFIED IDEOGRAPH - 6587 <nl> + UTFTest ( <nl> + string : " \ u { 4F8b } \ u { 6587 } " , <nl> + utf8 : [ 0xE4 , 0xBE , 0x8B , 0xE6 , 0x96 , 0x87 ] , <nl> + utf16 : [ 0x4F8B , 0x6587 ] , <nl> + scalars : [ 0x4F8B , 0x6587 ] ) , <nl> + <nl> + / / U + D55C HANGUL SYLLABLE HAN <nl> + / / U + AE00 HANGUL SYLLABLE GEUL <nl> + UTFTest ( <nl> + string : " \ u { d55c } \ u { ae00 } " , <nl> + utf8 : [ 0xED , 0x95 , 0x9C , 0xEA , 0xB8 , 0x80 ] , <nl> + utf16 : [ 0xD55C , 0xAE00 ] , <nl> + scalars : [ 0xD55C , 0xAE00 ] ) , <nl> + <nl> + / / U + 1112 HANGUL CHOSEONG HIEUH <nl> + / / U + 1161 HANGUL JUNGSEONG A <nl> + / / U + 11AB HANGUL JONGSEONG NIEUN <nl> + / / U + 1100 HANGUL CHOSEONG KIYEOK <nl> + / / U + 1173 HANGUL JUNGSEONG EU <nl> + / / U + 11AF HANGUL JONGSEONG RIEUL <nl> + UTFTest ( <nl> + string : " \ u { 1112 } \ u { 1161 } \ u { 11ab } \ u { 1100 } \ u { 1173 } \ u { 11af } " , <nl> + utf8 : <nl> + [ 0xE1 , 0x84 , 0x92 , 0xE1 , 0x85 , 0xA1 , 0xE1 , 0x86 , 0xAB , <nl> + 0xE1 , 0x84 , 0x80 , 0xE1 , 0x85 , 0xB3 , 0xE1 , 0x86 , 0xAF ] , <nl> + utf16 : [ 0x1112 , 0x1161 , 0x11AB , 0x1100 , 0x1173 , 0x11AF ] , <nl> + scalars : [ 0x1112 , 0x1161 , 0x11AB , 0x1100 , 0x1173 , 0x11AF ] ) , <nl> + <nl> + / / U + 3042 HIRAGANA LETTER A <nl> + / / U + 3044 HIRAGANA LETTER I <nl> + / / U + 3046 HIRAGANA LETTER U <nl> + / / U + 3048 HIRAGANA LETTER E <nl> + / / U + 304A HIRAGANA LETTER O <nl> + UTFTest ( <nl> + string : " \ u { 3042 } \ u { 3044 } \ u { 3046 } \ u { 3048 } \ u { 304a } " , <nl> + utf8 : <nl> + [ 0xE3 , 0x81 , 0x82 , 0xE3 , 0x81 , 0x84 , 0xE3 , 0x81 , 0x86 , <nl> + 0xE3 , 0x81 , 0x88 , 0xE3 , 0x81 , 0x8A ] , <nl> + utf16 : [ 0x3042 , 0x3044 , 0x3046 , 0x3048 , 0x304A ] , <nl> + scalars : [ 0x3042 , 0x3044 , 0x3046 , 0x3048 , 0x304A ] ) , <nl> + <nl> + / / U + D7FF ( unassigned ) <nl> + UTFTest ( <nl> + string : " \ u { D7FF } " , <nl> + utf8 : [ 0xED , 0x9F , 0xBF ] , <nl> + utf16 : [ 0xD7FF ] , <nl> + scalars : [ 0xD7FF ] ) , <nl> + <nl> + / / U + E000 ( private use ) <nl> + UTFTest ( <nl> + string : " \ u { E000 } " , <nl> + utf8 : [ 0xEE , 0x80 , 0x80 ] , <nl> + utf16 : [ 0xE000 ] , <nl> + scalars : [ 0xE000 ] ) , <nl> + <nl> + / / U + FFFD REPLACEMENT CHARACTER <nl> + UTFTest ( <nl> + string : " \ u { FFFD } " , <nl> + utf8 : [ 0xEF , 0xBF , 0xBD ] , <nl> + utf16 : [ 0xFFFD ] , <nl> + scalars : [ 0xFFFD ] ) , <nl> + <nl> + / / U + FFFF ( noncharacter ) <nl> + UTFTest ( <nl> + string : " \ u { FFFF } " , <nl> + utf8 : [ 0xEF , 0xBF , 0xBF ] , <nl> + utf16 : [ 0xFFFF ] , <nl> + scalars : [ 0xFFFF ] ) , <nl> + <nl> + / / <nl> + / / 4 - byte sequences . <nl> + / / <nl> + <nl> + / / U + 1F425 FRONT - FACING BABY CHICK <nl> + UTFTest ( <nl> + string : " \ u { 1F425 } " , <nl> + utf8 : [ 0xF0 , 0x9F , 0x90 , 0xA5 ] , <nl> + utf16 : [ 0xD83D , 0xDC25 ] , <nl> + scalars : [ 0x0001_F425 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + 1F425 FRONT - FACING BABY CHICK <nl> + UTFTest ( <nl> + string : " A \ u { 1F425 } " , <nl> + utf8 : [ 0x41 , 0xF0 , 0x9F , 0x90 , 0xA5 ] , <nl> + utf16 : [ 0x41 , 0xD83D , 0xDC25 ] , <nl> + scalars : [ 0x41 , 0x0001_F425 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + 0042 LATIN CAPITAL LETTER B <nl> + / / U + 1F425 FRONT - FACING BABY CHICK <nl> + UTFTest ( <nl> + string : " AB \ u { 1F425 } " , <nl> + utf8 : [ 0x41 , 0x42 , 0xF0 , 0x9F , 0x90 , 0xA5 ] , <nl> + utf16 : [ 0x41 , 0x42 , 0xD83D , 0xDC25 ] , <nl> + scalars : [ 0x41 , 0x42 , 0x0001_F425 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + 0042 LATIN CAPITAL LETTER B <nl> + / / U + 0043 LATIN CAPITAL LETTER C <nl> + / / U + 1F425 FRONT - FACING BABY CHICK <nl> + UTFTest ( <nl> + string : " ABC \ u { 1F425 } " , <nl> + utf8 : [ 0x41 , 0x42 , 0x43 , 0xF0 , 0x9F , 0x90 , 0xA5 ] , <nl> + utf16 : [ 0x41 , 0x42 , 0x43 , 0xD83D , 0xDC25 ] , <nl> + scalars : [ 0x41 , 0x42 , 0x43 , 0x0001_F425 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + 0042 LATIN CAPITAL LETTER B <nl> + / / U + 0043 LATIN CAPITAL LETTER C <nl> + / / U + 0044 LATIN CAPITAL LETTER D <nl> + / / U + 1F425 FRONT - FACING BABY CHICK <nl> + UTFTest ( <nl> + string : " ABCD \ u { 1F425 } " , <nl> + utf8 : [ 0x41 , 0x42 , 0x43 , 0x44 , 0xF0 , 0x9F , 0x90 , 0xA5 ] , <nl> + utf16 : [ 0x41 , 0x42 , 0x43 , 0x44 , 0xD83D , 0xDC25 ] , <nl> + scalars : [ 0x41 , 0x42 , 0x43 , 0x44 , 0x0001_F425 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + 0042 LATIN CAPITAL LETTER B <nl> + / / U + 0043 LATIN CAPITAL LETTER C <nl> + / / U + 0044 LATIN CAPITAL LETTER D <nl> + / / U + 0045 LATIN CAPITAL LETTER E <nl> + / / U + 1F425 FRONT - FACING BABY CHICK <nl> + UTFTest ( <nl> + string : " ABCDE \ u { 1F425 } " , <nl> + utf8 : [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0xF0 , 0x9F , 0x90 , 0xA5 ] , <nl> + utf16 : [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0xD83D , 0xDC25 ] , <nl> + scalars : [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x0001_F425 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + 0042 LATIN CAPITAL LETTER B <nl> + / / U + 0043 LATIN CAPITAL LETTER C <nl> + / / U + 0044 LATIN CAPITAL LETTER D <nl> + / / U + 0045 LATIN CAPITAL LETTER E <nl> + / / U + 0046 LATIN CAPITAL LETTER F <nl> + / / U + 1F425 FRONT - FACING BABY CHICK <nl> + UTFTest ( <nl> + string : " ABCDEF \ u { 1F425 } " , <nl> + utf8 : [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0xF0 , 0x9F , 0x90 , 0xA5 ] , <nl> + utf16 : [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0xD83D , 0xDC25 ] , <nl> + scalars : [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0x0001_F425 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + 0042 LATIN CAPITAL LETTER B <nl> + / / U + 0043 LATIN CAPITAL LETTER C <nl> + / / U + 0044 LATIN CAPITAL LETTER D <nl> + / / U + 0045 LATIN CAPITAL LETTER E <nl> + / / U + 0046 LATIN CAPITAL LETTER F <nl> + / / U + 0047 LATIN CAPITAL LETTER G <nl> + / / U + 1F425 FRONT - FACING BABY CHICK <nl> + UTFTest ( <nl> + string : " ABCDEFG \ u { 1F425 } " , <nl> + utf8 : [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0x47 , 0xF0 , 0x9F , 0x90 , 0xA5 ] , <nl> + utf16 : [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0x47 , 0xD83D , 0xDC25 ] , <nl> + scalars : [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0x47 , 0x0001_F425 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + 0042 LATIN CAPITAL LETTER B <nl> + / / U + 0043 LATIN CAPITAL LETTER C <nl> + / / U + 0044 LATIN CAPITAL LETTER D <nl> + / / U + 0045 LATIN CAPITAL LETTER E <nl> + / / U + 0046 LATIN CAPITAL LETTER F <nl> + / / U + 0047 LATIN CAPITAL LETTER G <nl> + / / U + 0048 LATIN CAPITAL LETTER H <nl> + / / U + 1F425 FRONT - FACING BABY CHICK <nl> + UTFTest ( <nl> + string : " ABCDEFGH \ u { 1F425 } " , <nl> + utf8 : <nl> + [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0x47 , 0x48 , <nl> + 0xF0 , 0x9F , 0x90 , 0xA5 ] , <nl> + utf16 : <nl> + [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0x47 , 0x48 , <nl> + 0xD83D , 0xDC25 ] , <nl> + scalars : <nl> + [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0x47 , 0x48 , 0x0001_F425 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + 0042 LATIN CAPITAL LETTER B <nl> + / / U + 0043 LATIN CAPITAL LETTER C <nl> + / / U + 0044 LATIN CAPITAL LETTER D <nl> + / / U + 0045 LATIN CAPITAL LETTER E <nl> + / / U + 0046 LATIN CAPITAL LETTER F <nl> + / / U + 0047 LATIN CAPITAL LETTER G <nl> + / / U + 0048 LATIN CAPITAL LETTER H <nl> + / / U + 0049 LATIN CAPITAL LETTER I <nl> + / / U + 1F425 FRONT - FACING BABY CHICK <nl> + UTFTest ( <nl> + string : " ABCDEFGHI \ u { 1F425 } " , <nl> + utf8 : <nl> + [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0x47 , 0x48 , 0x49 , <nl> + 0xF0 , 0x9F , 0x90 , 0xA5 ] , <nl> + utf16 : <nl> + [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0x47 , 0x48 , 0x49 , <nl> + 0xD83D , 0xDC25 ] , <nl> + scalars : <nl> + [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0x47 , 0x48 , 0x49 , 0x0001_F425 ] ) , <nl> + <nl> + / / U + 10000 LINEAR B SYLLABLE B008 A <nl> + UTFTest ( <nl> + string : " \ u { 10000 } " , <nl> + utf8 : [ 0xF0 , 0x90 , 0x80 , 0x80 ] , <nl> + utf16 : [ 0xD800 , 0xDC00 ] , <nl> + scalars : [ 0x0001_0000 ] ) , <nl> + <nl> + / / U + 10100 AEGEAN WORD SEPARATOR LINE <nl> + UTFTest ( <nl> + string : " \ u { 10100 } " , <nl> + utf8 : [ 0xF0 , 0x90 , 0x84 , 0x80 ] , <nl> + utf16 : [ 0xD800 , 0xDD00 ] , <nl> + scalars : [ 0x0001_0100 ] ) , <nl> + <nl> + / / U + 103FF ( unassigned ) <nl> + UTFTest ( <nl> + string : " \ u { 103FF } " , <nl> + utf8 : [ 0xF0 , 0x90 , 0x8F , 0xBF ] , <nl> + utf16 : [ 0xD800 , 0xDFFF ] , <nl> + scalars : [ 0x0001_03FF ] ) , <nl> + <nl> + / / U + E0000 ( unassigned ) <nl> + UTFTest ( <nl> + string : " \ u { E0000 } " , <nl> + utf8 : [ 0xF3 , 0xA0 , 0x80 , 0x80 ] , <nl> + utf16 : [ 0xDB40 , 0xDC00 ] , <nl> + scalars : [ 0x000E_0000 ] ) , <nl> + <nl> + / / U + E0100 VARIATION SELECTOR - 17 <nl> + UTFTest ( <nl> + string : " \ u { E0100 } " , <nl> + utf8 : [ 0xF3 , 0xA0 , 0x84 , 0x80 ] , <nl> + utf16 : [ 0xDB40 , 0xDD00 ] , <nl> + scalars : [ 0x000E_0100 ] ) , <nl> + <nl> + / / U + E03FF ( unassigned ) <nl> + UTFTest ( <nl> + string : " \ u { E03FF } " , <nl> + utf8 : [ 0xF3 , 0xA0 , 0x8F , 0xBF ] , <nl> + utf16 : [ 0xDB40 , 0xDFFF ] , <nl> + scalars : [ 0x000E_03FF ] ) , <nl> + <nl> + / / U + 10FC00 ( private use ) <nl> + UTFTest ( <nl> + string : " \ u { 10FC00 } " , <nl> + utf8 : [ 0xF4 , 0x8F , 0xB0 , 0x80 ] , <nl> + utf16 : [ 0xDBFF , 0xDC00 ] , <nl> + scalars : [ 0x0010_FC00 ] ) , <nl> + <nl> + / / U + 10FD00 ( private use ) <nl> + UTFTest ( <nl> + string : " \ u { 10FD00 } " , <nl> + utf8 : [ 0xF4 , 0x8F , 0xB4 , 0x80 ] , <nl> + utf16 : [ 0xDBFF , 0xDD00 ] , <nl> + scalars : [ 0x0010_FD00 ] ) , <nl> + <nl> + / / U + 10FFFF ( private use , noncharacter ) <nl> + UTFTest ( <nl> + string : " \ u { 10FFFF } " , <nl> + utf8 : [ 0xF4 , 0x8F , 0xBF , 0xBF ] , <nl> + utf16 : [ 0xDBFF , 0xDFFF ] , <nl> + scalars : [ 0x0010_FFFF ] ) , <nl> + ] <nl> + <nl> + <nl> + public struct UTF16Test { <nl> + public let scalarsHead : [ UInt32 ] <nl> + public let scalarsRepairedTail : [ UInt32 ] <nl> + public let encoded : [ UInt16 ] <nl> + public let loc : SourceLoc <nl> + <nl> + public init ( <nl> + _ scalarsHead : [ UInt32 ] , _ scalarsRepairedTail : [ UInt32 ] , <nl> + _ encoded : [ UInt16 ] , <nl> + file : String = # file , line : UInt = # line <nl> + ) { <nl> + self . scalarsHead = scalarsHead <nl> + self . scalarsRepairedTail = scalarsRepairedTail <nl> + self . encoded = encoded <nl> + self . loc = SourceLoc ( file , line , comment : " test data " ) <nl> + } <nl> + } <nl> + <nl> + public let utf16Tests = [ <nl> + " Incomplete " : [ <nl> + / / <nl> + / / Incomplete sequences that end right before EOF . <nl> + / / <nl> + <nl> + / / U + D800 ( high - surrogate ) <nl> + UTF16Test ( [ ] , [ 0xFFFD ] , [ 0xD800 ] ) , <nl> + <nl> + / / U + D800 ( high - surrogate ) <nl> + / / U + D800 ( high - surrogate ) <nl> + UTF16Test ( [ ] , [ 0xFFFD , 0xFFFD ] , [ 0xD800 , 0xD800 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + D800 ( high - surrogate ) <nl> + UTF16Test ( [ 0x0041 ] , [ 0xFFFD ] , [ 0x0041 , 0xD800 ] ) , <nl> + <nl> + / / U + 10000 LINEAR B SYLLABLE B008 A <nl> + / / U + D800 ( high - surrogate ) <nl> + UTF16Test ( <nl> + [ 0x0001_0000 ] , [ 0xFFFD ] , <nl> + [ 0xD800 , 0xDC00 , 0xD800 ] ) , <nl> + <nl> + / / <nl> + / / Incomplete sequences with more code units following them . <nl> + / / <nl> + <nl> + / / U + D800 ( high - surrogate ) <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + UTF16Test ( [ ] , [ 0xFFFD , 0x0041 ] , [ 0xD800 , 0x0041 ] ) , <nl> + <nl> + / / U + D800 ( high - surrogate ) <nl> + / / U + 10000 LINEAR B SYLLABLE B008 A <nl> + UTF16Test ( <nl> + [ ] , [ 0xFFFD , 0x0001_0000 ] , <nl> + [ 0xD800 , 0xD800 , 0xDC00 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + D800 ( high - surrogate ) <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + UTF16Test ( <nl> + [ 0x0041 ] , [ 0xFFFD , 0x0041 ] , <nl> + [ 0x0041 , 0xD800 , 0x0041 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + D800 ( high - surrogate ) <nl> + / / U + 10000 LINEAR B SYLLABLE B008 A <nl> + UTF16Test ( <nl> + [ 0x0041 ] , [ 0xFFFD , 0x0001_0000 ] , <nl> + [ 0x0041 , 0xD800 , 0xD800 , 0xDC00 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + D800 ( high - surrogate ) <nl> + / / U + DB40 ( high - surrogate ) <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + UTF16Test ( <nl> + [ 0x0041 ] , [ 0xFFFD , 0xFFFD , 0x0041 ] , <nl> + [ 0x0041 , 0xD800 , 0xDB40 , 0x0041 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + D800 ( high - surrogate ) <nl> + / / U + DB40 ( high - surrogate ) <nl> + / / U + 10000 LINEAR B SYLLABLE B008 A <nl> + UTF16Test ( <nl> + [ 0x0041 ] , [ 0xFFFD , 0xFFFD , 0x0001_0000 ] , <nl> + [ 0x0041 , 0xD800 , 0xDB40 , 0xD800 , 0xDC00 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + D800 ( high - surrogate ) <nl> + / / U + DB40 ( high - surrogate ) <nl> + / / U + DBFF ( high - surrogate ) <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + UTF16Test ( <nl> + [ 0x0041 ] , [ 0xFFFD , 0xFFFD , 0xFFFD , 0x0041 ] , <nl> + [ 0x0041 , 0xD800 , 0xDB40 , 0xDBFF , 0x0041 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + D800 ( high - surrogate ) <nl> + / / U + DB40 ( high - surrogate ) <nl> + / / U + DBFF ( high - surrogate ) <nl> + / / U + 10000 LINEAR B SYLLABLE B008 A <nl> + UTF16Test ( <nl> + [ 0x0041 ] , [ 0xFFFD , 0xFFFD , 0xFFFD , 0x0001_0000 ] , <nl> + [ 0x0041 , 0xD800 , 0xDB40 , 0xDBFF , 0xD800 , 0xDC00 ] ) , <nl> + ] , <nl> + <nl> + " IllFormed " : [ <nl> + / / <nl> + / / Low - surrogate right before EOF . <nl> + / / <nl> + <nl> + / / U + DC00 ( low - surrogate ) <nl> + UTF16Test ( [ ] , [ 0xFFFD ] , [ 0xDC00 ] ) , <nl> + <nl> + / / U + DC00 ( low - surrogate ) <nl> + / / U + DC00 ( low - surrogate ) <nl> + UTF16Test ( [ ] , [ 0xFFFD , 0xFFFD ] , [ 0xDC00 , 0xDC00 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + DC00 ( low - surrogate ) <nl> + UTF16Test ( [ 0x0041 ] , [ 0xFFFD ] , [ 0x0041 , 0xDC00 ] ) , <nl> + <nl> + / / U + 10000 LINEAR B SYLLABLE B008 A <nl> + / / U + DC00 ( low - surrogate ) <nl> + UTF16Test ( <nl> + [ 0x0001_0000 ] , [ 0xFFFD ] , <nl> + [ 0xD800 , 0xDC00 , 0xDC00 ] ) , <nl> + <nl> + / / <nl> + / / Low - surrogate with more code units following it . <nl> + / / <nl> + <nl> + / / U + DC00 ( low - surrogate ) <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + UTF16Test ( [ ] , [ 0xFFFD , 0x0041 ] , [ 0xDC00 , 0x0041 ] ) , <nl> + <nl> + / / U + DC00 ( low - surrogate ) <nl> + / / U + 10000 LINEAR B SYLLABLE B008 A <nl> + UTF16Test ( <nl> + [ ] , [ 0xFFFD , 0x0001_0000 ] , <nl> + [ 0xDC00 , 0xD800 , 0xDC00 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + DC00 ( low - surrogate ) <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + UTF16Test ( <nl> + [ 0x0041 ] , [ 0xFFFD , 0x0041 ] , <nl> + [ 0x0041 , 0xDC00 , 0x0041 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + DC00 ( low - surrogate ) <nl> + / / U + 10000 LINEAR B SYLLABLE B008 A <nl> + UTF16Test ( <nl> + [ 0x0041 ] , [ 0xFFFD , 0x0001_0000 ] , <nl> + [ 0x0041 , 0xDC00 , 0xD800 , 0xDC00 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + DC00 ( low - surrogate ) <nl> + / / U + DD00 ( low - surrogate ) <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + UTF16Test ( <nl> + [ 0x0041 ] , [ 0xFFFD , 0xFFFD , 0x0041 ] , <nl> + [ 0x0041 , 0xDC00 , 0xDD00 , 0x0041 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + DC00 ( low - surrogate ) <nl> + / / U + DD00 ( low - surrogate ) <nl> + / / U + 10000 LINEAR B SYLLABLE B008 A <nl> + UTF16Test ( <nl> + [ 0x0041 ] , [ 0xFFFD , 0xFFFD , 0x0001_0000 ] , <nl> + [ 0x0041 , 0xDC00 , 0xDD00 , 0xD800 , 0xDC00 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + DC00 ( low - surrogate ) <nl> + / / U + DD00 ( low - surrogate ) <nl> + / / U + DFFF ( low - surrogate ) <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + UTF16Test ( <nl> + [ 0x0041 ] , [ 0xFFFD , 0xFFFD , 0xFFFD , 0x0041 ] , <nl> + [ 0x0041 , 0xDC00 , 0xDD00 , 0xDFFF , 0x0041 ] ) , <nl> + <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + / / U + DC00 ( low - surrogate ) <nl> + / / U + DD00 ( low - surrogate ) <nl> + / / U + DFFF ( low - surrogate ) <nl> + / / U + 10000 LINEAR B SYLLABLE B008 A <nl> + UTF16Test ( <nl> + [ 0x0041 ] , [ 0xFFFD , 0xFFFD , 0xFFFD , 0x0001_0000 ] , <nl> + [ 0x0041 , 0xDC00 , 0xDD00 , 0xDFFF , 0xD800 , 0xDC00 ] ) , <nl> + <nl> + / / <nl> + / / Low - surrogate followed by high - surrogate . <nl> + / / <nl> + <nl> + / / U + DC00 ( low - surrogate ) <nl> + / / U + D800 ( high - surrogate ) <nl> + UTF16Test ( [ ] , [ 0xFFFD , 0xFFFD ] , [ 0xDC00 , 0xD800 ] ) , <nl> + <nl> + / / U + DC00 ( low - surrogate ) <nl> + / / U + DB40 ( high - surrogate ) <nl> + UTF16Test ( [ ] , [ 0xFFFD , 0xFFFD ] , [ 0xDC00 , 0xDB40 ] ) , <nl> + <nl> + / / U + DC00 ( low - surrogate ) <nl> + / / U + DBFF ( high - surrogate ) <nl> + UTF16Test ( [ ] , [ 0xFFFD , 0xFFFD ] , [ 0xDC00 , 0xDBFF ] ) , <nl> + <nl> + <nl> + / / U + DD00 ( low - surrogate ) <nl> + / / U + D800 ( high - surrogate ) <nl> + UTF16Test ( [ ] , [ 0xFFFD , 0xFFFD ] , [ 0xDD00 , 0xD800 ] ) , <nl> + <nl> + / / U + DD00 ( low - surrogate ) <nl> + / / U + DB40 ( high - surrogate ) <nl> + UTF16Test ( [ ] , [ 0xFFFD , 0xFFFD ] , [ 0xDD00 , 0xDB40 ] ) , <nl> + <nl> + / / U + DD00 ( low - surrogate ) <nl> + / / U + DBFF ( high - surrogate ) <nl> + UTF16Test ( [ ] , [ 0xFFFD , 0xFFFD ] , [ 0xDD00 , 0xDBFF ] ) , <nl> + <nl> + <nl> + / / U + DFFF ( low - surrogate ) <nl> + / / U + D800 ( high - surrogate ) <nl> + UTF16Test ( [ ] , [ 0xFFFD , 0xFFFD ] , [ 0xDFFF , 0xD800 ] ) , <nl> + <nl> + / / U + DFFF ( low - surrogate ) <nl> + / / U + DB40 ( high - surrogate ) <nl> + UTF16Test ( [ ] , [ 0xFFFD , 0xFFFD ] , [ 0xDFFF , 0xDB40 ] ) , <nl> + <nl> + / / U + DFFF ( low - surrogate ) <nl> + / / U + DBFF ( high - surrogate ) <nl> + UTF16Test ( [ ] , [ 0xFFFD , 0xFFFD ] , [ 0xDFFF , 0xDBFF ] ) , <nl> + <nl> + <nl> + / / U + DC00 ( low - surrogate ) <nl> + / / U + D800 ( high - surrogate ) <nl> + / / U + 0041 LATIN CAPITAL LETTER A <nl> + UTF16Test ( <nl> + [ ] , [ 0xFFFD , 0xFFFD , 0x0041 ] , <nl> + [ 0xDC00 , 0xD800 , 0x0041 ] ) , <nl> + <nl> + / / U + DC00 ( low - surrogate ) <nl> + / / U + D800 ( high - surrogate ) <nl> + / / U + 10000 LINEAR B SYLLABLE B008 A <nl> + UTF16Test ( <nl> + [ ] , [ 0xFFFD , 0xFFFD , 0x10000 ] , <nl> + [ 0xDC00 , 0xD800 , 0xD800 , 0xDC00 ] ) , <nl> + ] , <nl> + ] <nl> + <nl> mmm a / test / CMakeLists . txt <nl> ppp b / test / CMakeLists . txt <nl> if ( PYTHONINTERP_FOUND ) <nl> endif ( ) <nl> <nl> set ( validation_test_dependencies <nl> - " swiftStdlibCollectionUnittest - $ { SWIFT_SDK_ $ { SDK } _LIB_SUBDIR } " ) <nl> + " swiftStdlibCollectionUnittest - $ { SWIFT_SDK_ $ { SDK } _LIB_SUBDIR } " <nl> + " swiftStdlibUnicodeUnittest - $ { SWIFT_SDK_ $ { SDK } _LIB_SUBDIR } " ) <nl> <nl> set ( command_upload_stdlib ) <nl> set ( command_upload_swift_reflection_test ) <nl> mmm a / validation - test / stdlib / StringViews . swift <nl> ppp b / validation - test / stdlib / StringViews . swift <nl> <nl> <nl> import Swift <nl> import StdlibUnittest <nl> + import StdlibUnicodeUnittest <nl> import StdlibCollectionUnittest <nl> <nl> # if _runtime ( _ObjC ) <nl> tests . test ( " UnicodeScalars - > String " ) { <nl> } <nl> } <nl> <nl> - struct StringViewTest { <nl> - var string : String <nl> - var utf8 : [ UInt8 ] <nl> - var utf16 : [ UInt16 ] <nl> - var unicodeScalars : [ UnicodeScalar ] <nl> - <nl> - init ( string : String , utf8 : [ UInt8 ] , utf16 : [ UInt16 ] , utf32 : [ UInt32 ] ) { <nl> - self . string = string <nl> - self . utf8 = utf8 <nl> - self . utf16 = utf16 <nl> - self . unicodeScalars = utf32 . map { UnicodeScalar ( $ 0 ) ! } <nl> - } <nl> - } <nl> - <nl> - var stringViewTests : [ StringViewTest ] = [ <nl> - StringViewTest ( <nl> - string : " " , <nl> - utf8 : [ ] , <nl> - utf16 : [ ] , <nl> - utf32 : [ ] ) , <nl> - StringViewTest ( <nl> - string : " \ u { 0000 } " , <nl> - utf8 : [ 0x00 ] , <nl> - utf16 : [ 0x00 ] , <nl> - utf32 : [ 0x00 ] ) , <nl> - StringViewTest ( <nl> - string : " a " , <nl> - utf8 : [ 0x61 ] , <nl> - utf16 : [ 0x61 ] , <nl> - utf32 : [ 0x61 ] ) , <nl> - StringViewTest ( <nl> - string : " aa " , <nl> - utf8 : [ 0x61 , 0x61 ] , <nl> - utf16 : [ 0x61 , 0x61 ] , <nl> - utf32 : [ 0x61 , 0x61 ] ) , <nl> - StringViewTest ( <nl> - string : " ab " , <nl> - utf8 : [ 0x61 , 0x62 ] , <nl> - utf16 : [ 0x61 , 0x62 ] , <nl> - utf32 : [ 0x61 , 0x62 ] ) , <nl> - StringViewTest ( <nl> - string : " abc " , <nl> - utf8 : [ 0x61 , 0x62 , 0x63 ] , <nl> - utf16 : [ 0x61 , 0x62 , 0x63 ] , <nl> - utf32 : [ 0x61 , 0x62 , 0x63 ] ) , <nl> - StringViewTest ( <nl> - string : " \ u { 007f } " , <nl> - utf8 : [ 0x7f ] , <nl> - utf16 : [ 0x7f ] , <nl> - utf32 : [ 0x7f ] ) , <nl> - StringViewTest ( <nl> - string : " \ u { 0430 } " , <nl> - utf8 : [ 0xd0 , 0xb0 ] , <nl> - utf16 : [ 0x0430 ] , <nl> - utf32 : [ 0x0430 ] ) , <nl> - StringViewTest ( <nl> - string : " \ u { 0430 } \ u { 0431 } \ u { 0432 } " , <nl> - utf8 : [ 0xd0 , 0xb0 , 0xd0 , 0xb1 , 0xd0 , 0xb2 ] , <nl> - utf16 : [ 0x0430 , 0x0431 , 0x0432 ] , <nl> - utf32 : [ 0x0430 , 0x0431 , 0x0432 ] ) , <nl> - StringViewTest ( <nl> - string : " \ u { 1f425 } " , <nl> - utf8 : [ 0xf0 , 0x9f , 0x90 , 0xa5 ] , <nl> - utf16 : [ 0xd83d , 0xdc25 ] , <nl> - utf32 : [ 0x1f425 ] ) , <nl> - ] <nl> - <nl> # if _runtime ( _ObjC ) <nl> tests . test ( " String . UTF16View . Index / Strideable " ) <nl> - . forEach ( in : stringViewTests ) { <nl> + . forEach ( in : utfTests ) { <nl> test in <nl> <nl> func allIndices < C : Collection > ( of c : C ) - > [ C . Index ] <nl> tests . test ( " String . UTF16View . Index / Strideable " ) <nl> # endif <nl> <nl> tests . test ( " String . UTF8View / Collection " ) <nl> - . forEach ( in : stringViewTests ) { <nl> + . forEach ( in : utfTests ) { <nl> test in <nl> <nl> / / FIXME ( ABI ) : should be ` checkBidirectionalCollection ` . <nl> tests . test ( " String . UTF8View / Collection " ) <nl> <nl> # if _runtime ( _Native ) <nl> tests . test ( " String . UTF16View / BidirectionalCollection " ) <nl> - . forEach ( in : stringViewTests ) { <nl> + . forEach ( in : utfTests ) { <nl> test in <nl> <nl> checkBidirectionalCollection ( test . utf16 , test . string . utf16 ) { $ 0 = = $ 1 } <nl> } <nl> # else <nl> tests . test ( " String . UTF16View / RandomAccessCollection " ) <nl> - . forEach ( in : stringViewTests ) { <nl> + . forEach ( in : utfTests ) { <nl> test in <nl> <nl> checkRandomAccessCollection ( test . utf16 , test . string . utf16 ) { $ 0 = = $ 1 } <nl> tests . test ( " String . UTF16View / RandomAccessCollection " ) <nl> # endif <nl> <nl> tests . test ( " String . UTF32View / BidirectionalCollection " ) <nl> - . forEach ( in : stringViewTests ) { <nl> + . forEach ( in : utfTests ) { <nl> test in <nl> <nl> checkBidirectionalCollection ( <nl> mmm a / validation - test / stdlib / Unicode . swift . gyb <nl> ppp b / validation - test / stdlib / Unicode . swift . gyb <nl> <nl> <nl> import SwiftPrivate <nl> import StdlibUnittest <nl> + import StdlibUnicodeUnittest <nl> import StdlibCollectionUnittest <nl> <nl> - <nl> var UTF16APIs = TestSuite ( " UTF16APIs " ) <nl> <nl> UTF16APIs . test ( " width " ) { <nl> func checkEncodeUTF8 ( _ expected : [ UInt8 ] , <nl> return assertionSuccess ( ) <nl> } <nl> <nl> - struct UTF8Test { <nl> - let scalars : [ UInt32 ] <nl> - let encoded : [ UInt8 ] <nl> - let loc : SourceLoc <nl> - <nl> - init ( <nl> - _ scalars : [ UInt32 ] , _ encoded : [ UInt8 ] , <nl> - file : String = # file , line : UInt = # line <nl> - ) { <nl> - self . scalars = scalars <nl> - self . encoded = encoded <nl> - self . loc = SourceLoc ( file , line , comment : " test data " ) <nl> - } <nl> - } <nl> - <nl> - let UTF8TestsSmokeTest = [ <nl> - / / <nl> - / / 1 - byte sequences <nl> - / / <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - UTF8Test ( [ 0x0041 ] , [ 0x41 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + 0042 LATIN CAPITAL LETTER B <nl> - UTF8Test ( [ 0x0041 , 0x0042 ] , [ 0x41 , 0x42 ] ) , <nl> - <nl> - / / U + 0061 LATIN SMALL LETTER A <nl> - / / U + 0062 LATIN SMALL LETTER B <nl> - / / U + 0063 LATIN SMALL LETTER C <nl> - UTF8Test ( [ 0x0061 , 0x0062 , 0x0063 ] , [ 0x61 , 0x62 , 0x63 ] ) , <nl> - <nl> - / / U + 0000 NULL <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + 0042 LATIN CAPITAL LETTER B <nl> - / / U + 0000 NULL <nl> - UTF8Test ( <nl> - [ 0x0000 , 0x0041 , 0x0042 , 0x0000 ] , <nl> - [ 0x00 , 0x41 , 0x42 , 0x00 ] ) , <nl> - <nl> - / / <nl> - / / 2 - byte sequences <nl> - / / <nl> - <nl> - / / U + 0283 LATIN SMALL LETTER ESH <nl> - UTF8Test ( [ 0x0283 ] , [ 0xca , 0x83 ] ) , <nl> - <nl> - / / U + 03BA GREEK SMALL LETTER KAPPA <nl> - / / U + 1F79 GREEK SMALL LETTER OMICRON WITH OXIA <nl> - / / U + 03C3 GREEK SMALL LETTER SIGMA <nl> - / / U + 03BC GREEK SMALL LETTER MU <nl> - / / U + 03B5 GREEK SMALL LETTER EPSILON <nl> - UTF8Test ( <nl> - [ 0x03ba , 0x1f79 , 0x03c3 , 0x03bc , 0x03b5 ] , <nl> - [ 0xce , 0xba , 0xe1 , 0xbd , 0xb9 , 0xcf , 0x83 , 0xce , 0xbc , 0xce , 0xb5 ] ) , <nl> - <nl> - / / U + 0430 CYRILLIC SMALL LETTER A <nl> - / / U + 0431 CYRILLIC SMALL LETTER BE <nl> - / / U + 0432 CYRILLIC SMALL LETTER VE <nl> - UTF8Test ( [ 0x0430 , 0x0431 , 0x0432 ] , [ 0xd0 , 0xb0 , 0xd0 , 0xb1 , 0xd0 , 0xb2 ] ) , <nl> - <nl> - / / <nl> - / / 3 - byte sequences <nl> - / / <nl> - <nl> - / / U + 4F8B CJK UNIFIED IDEOGRAPH - 4F8B <nl> - / / U + 6587 CJK UNIFIED IDEOGRAPH - 6587 <nl> - UTF8Test ( <nl> - [ 0x4f8b , 0x6587 ] , <nl> - [ 0xe4 , 0xbe , 0x8b , 0xe6 , 0x96 , 0x87 ] ) , <nl> - <nl> - / / U + D55C HANGUL SYLLABLE HAN <nl> - / / U + AE00 HANGUL SYLLABLE GEUL <nl> - UTF8Test ( <nl> - [ 0xd55c , 0xae00 ] , <nl> - [ 0xed , 0x95 , 0x9c , 0xea , 0xb8 , 0x80 ] ) , <nl> - <nl> - / / U + 1112 HANGUL CHOSEONG HIEUH <nl> - / / U + 1161 HANGUL JUNGSEONG A <nl> - / / U + 11AB HANGUL JONGSEONG NIEUN <nl> - / / U + 1100 HANGUL CHOSEONG KIYEOK <nl> - / / U + 1173 HANGUL JUNGSEONG EU <nl> - / / U + 11AF HANGUL JONGSEONG RIEUL <nl> - UTF8Test ( <nl> - [ 0x1112 , 0x1161 , 0x11ab , 0x1100 , 0x1173 , 0x11af ] , <nl> - [ 0xe1 , 0x84 , 0x92 , 0xe1 , 0x85 , 0xa1 , 0xe1 , 0x86 , 0xab , <nl> - 0xe1 , 0x84 , 0x80 , 0xe1 , 0x85 , 0xb3 , 0xe1 , 0x86 , 0xaf ] ) , <nl> - <nl> - / / U + 3042 HIRAGANA LETTER A <nl> - / / U + 3044 HIRAGANA LETTER I <nl> - / / U + 3046 HIRAGANA LETTER U <nl> - / / U + 3048 HIRAGANA LETTER E <nl> - / / U + 304A HIRAGANA LETTER O <nl> - UTF8Test ( <nl> - [ 0x3042 , 0x3044 , 0x3046 , 0x3048 , 0x304a ] , <nl> - [ 0xe3 , 0x81 , 0x82 , 0xe3 , 0x81 , 0x84 , 0xe3 , 0x81 , 0x86 , <nl> - 0xe3 , 0x81 , 0x88 , 0xe3 , 0x81 , 0x8a ] ) , <nl> - <nl> - / / <nl> - / / 4 - byte sequences <nl> - / / <nl> - <nl> - / / U + 1F425 FRONT - FACING BABY CHICK <nl> - UTF8Test ( <nl> - [ 0x0001F425 ] , <nl> - [ 0xf0 , 0x9f , 0x90 , 0xa5 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + 1F425 FRONT - FACING BABY CHICK <nl> - UTF8Test ( <nl> - [ 0x0041 , 0x0001F425 ] , <nl> - [ 0x41 , 0xf0 , 0x9f , 0x90 , 0xa5 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + 0042 LATIN CAPITAL LETTER B <nl> - / / U + 1F425 FRONT - FACING BABY CHICK <nl> - UTF8Test ( <nl> - [ 0x0041 , 0x0042 , 0x0001F425 ] , <nl> - [ 0x41 , 0x42 , 0xf0 , 0x9f , 0x90 , 0xa5 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + 0042 LATIN CAPITAL LETTER B <nl> - / / U + 0043 LATIN CAPITAL LETTER C <nl> - / / U + 1F425 FRONT - FACING BABY CHICK <nl> - UTF8Test ( <nl> - [ 0x0041 , 0x0042 , 0x0043 , 0x0001F425 ] , <nl> - [ 0x41 , 0x42 , 0x43 , 0xf0 , 0x9f , 0x90 , 0xa5 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + 0042 LATIN CAPITAL LETTER B <nl> - / / U + 0043 LATIN CAPITAL LETTER C <nl> - / / U + 0044 LATIN CAPITAL LETTER D <nl> - / / U + 1F425 FRONT - FACING BABY CHICK <nl> - UTF8Test ( <nl> - [ 0x0041 , 0x0042 , 0x0043 , 0x0044 , 0x0001F425 ] , <nl> - [ 0x41 , 0x42 , 0x43 , 0x44 , 0xf0 , 0x9f , 0x90 , 0xa5 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + 0042 LATIN CAPITAL LETTER B <nl> - / / U + 0043 LATIN CAPITAL LETTER C <nl> - / / U + 0044 LATIN CAPITAL LETTER D <nl> - / / U + 0045 LATIN CAPITAL LETTER E <nl> - / / U + 1F425 FRONT - FACING BABY CHICK <nl> - UTF8Test ( <nl> - [ 0x0041 , 0x0042 , 0x0043 , 0x0044 , 0x0045 , 0x0001F425 ] , <nl> - [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0xf0 , 0x9f , 0x90 , 0xa5 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + 0042 LATIN CAPITAL LETTER B <nl> - / / U + 0043 LATIN CAPITAL LETTER C <nl> - / / U + 0044 LATIN CAPITAL LETTER D <nl> - / / U + 0045 LATIN CAPITAL LETTER E <nl> - / / U + 0046 LATIN CAPITAL LETTER F <nl> - / / U + 1F425 FRONT - FACING BABY CHICK <nl> - UTF8Test ( <nl> - [ 0x0041 , 0x0042 , 0x0043 , 0x0044 , 0x0045 , 0x0046 , 0x0001F425 ] , <nl> - [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0xf0 , 0x9f , 0x90 , 0xa5 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + 0042 LATIN CAPITAL LETTER B <nl> - / / U + 0043 LATIN CAPITAL LETTER C <nl> - / / U + 0044 LATIN CAPITAL LETTER D <nl> - / / U + 0045 LATIN CAPITAL LETTER E <nl> - / / U + 0046 LATIN CAPITAL LETTER F <nl> - / / U + 0047 LATIN CAPITAL LETTER G <nl> - / / U + 1F425 FRONT - FACING BABY CHICK <nl> - UTF8Test ( <nl> - [ 0x0041 , 0x0042 , 0x0043 , 0x0044 , 0x0045 , 0x0046 , 0x0047 , 0x0001F425 ] , <nl> - [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0x47 , 0xf0 , 0x9f , 0x90 , 0xa5 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + 0042 LATIN CAPITAL LETTER B <nl> - / / U + 0043 LATIN CAPITAL LETTER C <nl> - / / U + 0044 LATIN CAPITAL LETTER D <nl> - / / U + 0045 LATIN CAPITAL LETTER E <nl> - / / U + 0046 LATIN CAPITAL LETTER F <nl> - / / U + 0047 LATIN CAPITAL LETTER G <nl> - / / U + 0048 LATIN CAPITAL LETTER H <nl> - / / U + 1F425 FRONT - FACING BABY CHICK <nl> - UTF8Test ( <nl> - [ 0x0041 , 0x0042 , 0x0043 , 0x0044 , 0x0045 , 0x0046 , 0x0047 , 0x0048 , <nl> - 0x0001F425 ] , <nl> - [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0x47 , 0x48 , <nl> - 0xf0 , 0x9f , 0x90 , 0xa5 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + 0042 LATIN CAPITAL LETTER B <nl> - / / U + 0043 LATIN CAPITAL LETTER C <nl> - / / U + 0044 LATIN CAPITAL LETTER D <nl> - / / U + 0045 LATIN CAPITAL LETTER E <nl> - / / U + 0046 LATIN CAPITAL LETTER F <nl> - / / U + 0047 LATIN CAPITAL LETTER G <nl> - / / U + 0048 LATIN CAPITAL LETTER H <nl> - / / U + 0049 LATIN CAPITAL LETTER I <nl> - / / U + 1F425 FRONT - FACING BABY CHICK <nl> - UTF8Test ( <nl> - [ 0x0041 , 0x0042 , 0x0043 , 0x0044 , 0x0045 , 0x0046 , 0x0047 , 0x0048 , 0x0049 , <nl> - 0x0001F425 ] , <nl> - [ 0x41 , 0x42 , 0x43 , 0x44 , 0x45 , 0x46 , 0x47 , 0x48 , 0x49 , <nl> - 0xf0 , 0x9f , 0x90 , 0xa5 ] ) , <nl> - <nl> - / / U + E0100 VARIATION SELECTOR - 17 <nl> - UTF8Test ( <nl> - [ 0x000E0100 ] , <nl> - [ 0xf3 , 0xa0 , 0x84 , 0x80 ] ) , <nl> - ] <nl> - <nl> - struct UTF16Test { <nl> - let scalarsHead : [ UInt32 ] <nl> - let scalarsRepairedTail : [ UInt32 ] <nl> - let encoded : [ UInt16 ] <nl> - let loc : SourceLoc <nl> - <nl> - init ( <nl> - _ scalarsHead : [ UInt32 ] , _ scalarsRepairedTail : [ UInt32 ] , <nl> - _ encoded : [ UInt16 ] , <nl> - file : String = # file , line : UInt = # line <nl> - ) { <nl> - self . scalarsHead = scalarsHead <nl> - self . scalarsRepairedTail = scalarsRepairedTail <nl> - self . encoded = encoded <nl> - self . loc = SourceLoc ( file , line , comment : " test data " ) <nl> - } <nl> - } <nl> - <nl> - let UTF16Tests = [ <nl> - " Empty " : [ <nl> - UTF16Test ( [ ] , [ ] , [ ] ) , <nl> - ] , <nl> - <nl> - " SmokeTest " : [ <nl> - / / <nl> - / / 1 - word sequences <nl> - / / <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - UTF16Test ( [ 0x0041 ] , [ ] , [ 0x0041 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + 0042 LATIN CAPITAL LETTER B <nl> - UTF16Test ( [ 0x0041 , 0x0042 ] , [ ] , [ 0x0041 , 0x0042 ] ) , <nl> - <nl> - / / U + 0000 NULL <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + 0042 LATIN CAPITAL LETTER B <nl> - / / U + 0000 NULL <nl> - UTF16Test ( <nl> - [ 0x0000 , 0x0041 , 0x0042 , 0x0000 ] , [ ] , <nl> - [ 0x0000 , 0x0041 , 0x0042 , 0x0000 ] ) , <nl> - <nl> - / / U + 0283 LATIN SMALL LETTER ESH <nl> - UTF16Test ( [ 0x0283 ] , [ ] , [ 0x0283 ] ) , <nl> - <nl> - / / U + 03BA GREEK SMALL LETTER KAPPA <nl> - / / U + 1F79 GREEK SMALL LETTER OMICRON WITH OXIA <nl> - / / U + 03C3 GREEK SMALL LETTER SIGMA <nl> - / / U + 03BC GREEK SMALL LETTER MU <nl> - / / U + 03B5 GREEK SMALL LETTER EPSILON <nl> - UTF16Test ( <nl> - [ 0x03ba , 0x1f79 , 0x03c3 , 0x03bc , 0x03b5 ] , [ ] , <nl> - [ 0x03ba , 0x1f79 , 0x03c3 , 0x03bc , 0x03b5 ] ) , <nl> - <nl> - / / U + 4F8B CJK UNIFIED IDEOGRAPH - 4F8B <nl> - / / U + 6587 CJK UNIFIED IDEOGRAPH - 6587 <nl> - UTF16Test ( <nl> - [ 0x4f8b , 0x6587 ] , [ ] , <nl> - [ 0x4f8b , 0x6587 ] ) , <nl> - <nl> - / / U + D55C HANGUL SYLLABLE HAN <nl> - / / U + AE00 HANGUL SYLLABLE GEUL <nl> - UTF16Test ( <nl> - [ 0xd55c , 0xae00 ] , [ ] , <nl> - [ 0xd55c , 0xae00 ] ) , <nl> - <nl> - / / U + 1112 HANGUL CHOSEONG HIEUH <nl> - / / U + 1161 HANGUL JUNGSEONG A <nl> - / / U + 11AB HANGUL JONGSEONG NIEUN <nl> - / / U + 1100 HANGUL CHOSEONG KIYEOK <nl> - / / U + 1173 HANGUL JUNGSEONG EU <nl> - / / U + 11AF HANGUL JONGSEONG RIEUL <nl> - UTF16Test ( <nl> - [ 0x1112 , 0x1161 , 0x11ab , 0x1100 , 0x1173 , 0x11af ] , [ ] , <nl> - [ 0x1112 , 0x1161 , 0x11ab , 0x1100 , 0x1173 , 0x11af ] ) , <nl> - <nl> - / / U + D7FF ( unassigned ) <nl> - UTF16Test ( [ 0xd7ff ] , [ ] , [ 0xd7ff ] ) , <nl> - <nl> - / / U + E000 ( private use ) <nl> - UTF16Test ( [ 0xe000 ] , [ ] , [ 0xe000 ] ) , <nl> - <nl> - / / U + FFFD REPLACEMENT CHARACTER <nl> - UTF16Test ( [ 0xfffd ] , [ ] , [ 0xfffd ] ) , <nl> - <nl> - / / U + FFFF ( noncharacter ) <nl> - UTF16Test ( [ 0xffff ] , [ ] , [ 0xffff ] ) , <nl> - <nl> - / / <nl> - / / 2 - word sequences <nl> - / / <nl> - <nl> - / / U + 10000 LINEAR B SYLLABLE B008 A <nl> - UTF16Test ( [ 0x00010000 ] , [ ] , [ 0xd800 , 0xdc00 ] ) , <nl> - <nl> - / / U + 10100 AEGEAN WORD SEPARATOR LINE <nl> - UTF16Test ( [ 0x00010100 ] , [ ] , [ 0xd800 , 0xdd00 ] ) , <nl> - <nl> - / / U + 103FF ( unassigned ) <nl> - UTF16Test ( [ 0x000103ff ] , [ ] , [ 0xd800 , 0xdfff ] ) , <nl> - <nl> - <nl> - / / U + E0000 ( unassigned ) <nl> - UTF16Test ( [ 0x000e0000 ] , [ ] , [ 0xdb40 , 0xdc00 ] ) , <nl> - <nl> - / / U + E0100 VARIATION SELECTOR - 17 <nl> - UTF16Test ( [ 0x000e0100 ] , [ ] , [ 0xdb40 , 0xdd00 ] ) , <nl> - <nl> - / / U + E03FF ( unassigned ) <nl> - UTF16Test ( [ 0x000e03ff ] , [ ] , [ 0xdb40 , 0xdfff ] ) , <nl> - <nl> - <nl> - / / U + 10FC00 ( private use ) <nl> - UTF16Test ( [ 0x0010fc00 ] , [ ] , [ 0xdbff , 0xdc00 ] ) , <nl> - <nl> - / / U + 10FD00 ( private use ) <nl> - UTF16Test ( [ 0x0010fd00 ] , [ ] , [ 0xdbff , 0xdd00 ] ) , <nl> - <nl> - / / U + 10FFFF ( private use , noncharacter ) <nl> - UTF16Test ( [ 0x0010ffff ] , [ ] , [ 0xdbff , 0xdfff ] ) , <nl> - ] , <nl> - <nl> - " Incomplete " : [ <nl> - / / <nl> - / / Incomplete sequences that end right before EOF . <nl> - / / <nl> - <nl> - / / U + D800 ( high - surrogate ) <nl> - UTF16Test ( [ ] , [ 0xfffd ] , [ 0xd800 ] ) , <nl> - <nl> - / / U + D800 ( high - surrogate ) <nl> - / / U + D800 ( high - surrogate ) <nl> - UTF16Test ( [ ] , [ 0xfffd , 0xfffd ] , [ 0xd800 , 0xd800 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + D800 ( high - surrogate ) <nl> - UTF16Test ( [ 0x0041 ] , [ 0xfffd ] , [ 0x0041 , 0xd800 ] ) , <nl> - <nl> - / / U + 10000 LINEAR B SYLLABLE B008 A <nl> - / / U + D800 ( high - surrogate ) <nl> - UTF16Test ( <nl> - [ 0x00010000 ] , [ 0xfffd ] , <nl> - [ 0xd800 , 0xdc00 , 0xd800 ] ) , <nl> - <nl> - / / <nl> - / / Incomplete sequences with more code units following them . <nl> - / / <nl> - <nl> - / / U + D800 ( high - surrogate ) <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - UTF16Test ( [ ] , [ 0xfffd , 0x0041 ] , [ 0xd800 , 0x0041 ] ) , <nl> - <nl> - / / U + D800 ( high - surrogate ) <nl> - / / U + 10000 LINEAR B SYLLABLE B008 A <nl> - UTF16Test ( <nl> - [ ] , [ 0xfffd , 0x00010000 ] , <nl> - [ 0xd800 , 0xd800 , 0xdc00 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + D800 ( high - surrogate ) <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - UTF16Test ( <nl> - [ 0x0041 ] , [ 0xfffd , 0x0041 ] , <nl> - [ 0x0041 , 0xd800 , 0x0041 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + D800 ( high - surrogate ) <nl> - / / U + 10000 LINEAR B SYLLABLE B008 A <nl> - UTF16Test ( <nl> - [ 0x0041 ] , [ 0xfffd , 0x00010000 ] , <nl> - [ 0x0041 , 0xd800 , 0xd800 , 0xdc00 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + D800 ( high - surrogate ) <nl> - / / U + DB40 ( high - surrogate ) <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - UTF16Test ( <nl> - [ 0x0041 ] , [ 0xfffd , 0xfffd , 0x0041 ] , <nl> - [ 0x0041 , 0xd800 , 0xdb40 , 0x0041 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + D800 ( high - surrogate ) <nl> - / / U + DB40 ( high - surrogate ) <nl> - / / U + 10000 LINEAR B SYLLABLE B008 A <nl> - UTF16Test ( <nl> - [ 0x0041 ] , [ 0xfffd , 0xfffd , 0x00010000 ] , <nl> - [ 0x0041 , 0xd800 , 0xdb40 , 0xd800 , 0xdc00 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + D800 ( high - surrogate ) <nl> - / / U + DB40 ( high - surrogate ) <nl> - / / U + DBFF ( high - surrogate ) <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - UTF16Test ( <nl> - [ 0x0041 ] , [ 0xfffd , 0xfffd , 0xfffd , 0x0041 ] , <nl> - [ 0x0041 , 0xd800 , 0xdb40 , 0xdbff , 0x0041 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + D800 ( high - surrogate ) <nl> - / / U + DB40 ( high - surrogate ) <nl> - / / U + DBFF ( high - surrogate ) <nl> - / / U + 10000 LINEAR B SYLLABLE B008 A <nl> - UTF16Test ( <nl> - [ 0x0041 ] , [ 0xfffd , 0xfffd , 0xfffd , 0x00010000 ] , <nl> - [ 0x0041 , 0xd800 , 0xdb40 , 0xdbff , 0xd800 , 0xdc00 ] ) , <nl> - ] , <nl> - <nl> - " IllFormed " : [ <nl> - / / <nl> - / / Low - surrogate right before EOF . <nl> - / / <nl> - <nl> - / / U + DC00 ( low - surrogate ) <nl> - UTF16Test ( [ ] , [ 0xfffd ] , [ 0xdc00 ] ) , <nl> - <nl> - / / U + DC00 ( low - surrogate ) <nl> - / / U + DC00 ( low - surrogate ) <nl> - UTF16Test ( [ ] , [ 0xfffd , 0xfffd ] , [ 0xdc00 , 0xdc00 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + DC00 ( low - surrogate ) <nl> - UTF16Test ( [ 0x0041 ] , [ 0xfffd ] , [ 0x0041 , 0xdc00 ] ) , <nl> - <nl> - / / U + 10000 LINEAR B SYLLABLE B008 A <nl> - / / U + DC00 ( low - surrogate ) <nl> - UTF16Test ( <nl> - [ 0x00010000 ] , [ 0xfffd ] , <nl> - [ 0xd800 , 0xdc00 , 0xdc00 ] ) , <nl> - <nl> - / / <nl> - / / Low - surrogate with more code units following it . <nl> - / / <nl> - <nl> - / / U + DC00 ( low - surrogate ) <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - UTF16Test ( [ ] , [ 0xfffd , 0x0041 ] , [ 0xdc00 , 0x0041 ] ) , <nl> - <nl> - / / U + DC00 ( low - surrogate ) <nl> - / / U + 10000 LINEAR B SYLLABLE B008 A <nl> - UTF16Test ( <nl> - [ ] , [ 0xfffd , 0x00010000 ] , <nl> - [ 0xdc00 , 0xd800 , 0xdc00 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + DC00 ( low - surrogate ) <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - UTF16Test ( <nl> - [ 0x0041 ] , [ 0xfffd , 0x0041 ] , <nl> - [ 0x0041 , 0xdc00 , 0x0041 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + DC00 ( low - surrogate ) <nl> - / / U + 10000 LINEAR B SYLLABLE B008 A <nl> - UTF16Test ( <nl> - [ 0x0041 ] , [ 0xfffd , 0x00010000 ] , <nl> - [ 0x0041 , 0xdc00 , 0xd800 , 0xdc00 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + DC00 ( low - surrogate ) <nl> - / / U + DD00 ( low - surrogate ) <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - UTF16Test ( <nl> - [ 0x0041 ] , [ 0xfffd , 0xfffd , 0x0041 ] , <nl> - [ 0x0041 , 0xdc00 , 0xdd00 , 0x0041 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + DC00 ( low - surrogate ) <nl> - / / U + DD00 ( low - surrogate ) <nl> - / / U + 10000 LINEAR B SYLLABLE B008 A <nl> - UTF16Test ( <nl> - [ 0x0041 ] , [ 0xfffd , 0xfffd , 0x00010000 ] , <nl> - [ 0x0041 , 0xdc00 , 0xdd00 , 0xd800 , 0xdc00 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + DC00 ( low - surrogate ) <nl> - / / U + DD00 ( low - surrogate ) <nl> - / / U + DFFF ( low - surrogate ) <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - UTF16Test ( <nl> - [ 0x0041 ] , [ 0xfffd , 0xfffd , 0xfffd , 0x0041 ] , <nl> - [ 0x0041 , 0xdc00 , 0xdd00 , 0xdfff , 0x0041 ] ) , <nl> - <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - / / U + DC00 ( low - surrogate ) <nl> - / / U + DD00 ( low - surrogate ) <nl> - / / U + DFFF ( low - surrogate ) <nl> - / / U + 10000 LINEAR B SYLLABLE B008 A <nl> - UTF16Test ( <nl> - [ 0x0041 ] , [ 0xfffd , 0xfffd , 0xfffd , 0x00010000 ] , <nl> - [ 0x0041 , 0xdc00 , 0xdd00 , 0xdfff , 0xd800 , 0xdc00 ] ) , <nl> - <nl> - / / <nl> - / / Low - surrogate followed by high - surrogate . <nl> - / / <nl> - <nl> - / / U + DC00 ( low - surrogate ) <nl> - / / U + D800 ( high - surrogate ) <nl> - UTF16Test ( [ ] , [ 0xfffd , 0xfffd ] , [ 0xdc00 , 0xd800 ] ) , <nl> - <nl> - / / U + DC00 ( low - surrogate ) <nl> - / / U + DB40 ( high - surrogate ) <nl> - UTF16Test ( [ ] , [ 0xfffd , 0xfffd ] , [ 0xdc00 , 0xdb40 ] ) , <nl> - <nl> - / / U + DC00 ( low - surrogate ) <nl> - / / U + DBFF ( high - surrogate ) <nl> - UTF16Test ( [ ] , [ 0xfffd , 0xfffd ] , [ 0xdc00 , 0xdbff ] ) , <nl> - <nl> - <nl> - / / U + DD00 ( low - surrogate ) <nl> - / / U + D800 ( high - surrogate ) <nl> - UTF16Test ( [ ] , [ 0xfffd , 0xfffd ] , [ 0xdd00 , 0xd800 ] ) , <nl> - <nl> - / / U + DD00 ( low - surrogate ) <nl> - / / U + DB40 ( high - surrogate ) <nl> - UTF16Test ( [ ] , [ 0xfffd , 0xfffd ] , [ 0xdd00 , 0xdb40 ] ) , <nl> - <nl> - / / U + DD00 ( low - surrogate ) <nl> - / / U + DBFF ( high - surrogate ) <nl> - UTF16Test ( [ ] , [ 0xfffd , 0xfffd ] , [ 0xdd00 , 0xdbff ] ) , <nl> - <nl> - <nl> - / / U + DFFF ( low - surrogate ) <nl> - / / U + D800 ( high - surrogate ) <nl> - UTF16Test ( [ ] , [ 0xfffd , 0xfffd ] , [ 0xdfff , 0xd800 ] ) , <nl> - <nl> - / / U + DFFF ( low - surrogate ) <nl> - / / U + DB40 ( high - surrogate ) <nl> - UTF16Test ( [ ] , [ 0xfffd , 0xfffd ] , [ 0xdfff , 0xdb40 ] ) , <nl> - <nl> - / / U + DFFF ( low - surrogate ) <nl> - / / U + DBFF ( high - surrogate ) <nl> - UTF16Test ( [ ] , [ 0xfffd , 0xfffd ] , [ 0xdfff , 0xdbff ] ) , <nl> - <nl> - <nl> - / / U + DC00 ( low - surrogate ) <nl> - / / U + D800 ( high - surrogate ) <nl> - / / U + 0041 LATIN CAPITAL LETTER A <nl> - UTF16Test ( <nl> - [ ] , [ 0xfffd , 0xfffd , 0x0041 ] , <nl> - [ 0xdc00 , 0xd800 , 0x0041 ] ) , <nl> - <nl> - / / U + DC00 ( low - surrogate ) <nl> - / / U + D800 ( high - surrogate ) <nl> - / / U + 10000 LINEAR B SYLLABLE B008 A <nl> - UTF16Test ( <nl> - [ ] , [ 0xfffd , 0xfffd , 0x10000 ] , <nl> - [ 0xdc00 , 0xd800 , 0xd800 , 0xdc00 ] ) , <nl> - ] , <nl> - ] <nl> - <nl> var UnicodeScalarTests = TestSuite ( " UnicodeScalarTests " ) <nl> <nl> UnicodeScalarTests . test ( " literal " ) { <nl> UnicodeScalarTests . test ( " init " ) { <nl> <nl> var UTF8Decoder = TestSuite ( " UTF8Decoder " ) <nl> <nl> - UTF8Decoder . test ( " Empty " ) { <nl> - expectTrue ( checkDecodeUTF8 ( [ ] , [ ] , [ ] ) ) <nl> - } <nl> + UTF8Decoder . test ( " SmokeTest " ) . forEach ( in : utfTests ) { <nl> + test in <nl> <nl> - UTF8Decoder . test ( " SmokeTest " ) { <nl> - for test in UTF8TestsSmokeTest { <nl> - expectTrue ( checkDecodeUTF8 ( test . scalars , [ ] , test . encoded ) , <nl> - stackTrace : test . loc . withCurrentLoc ( ) ) <nl> - } <nl> + expectTrue ( <nl> + checkDecodeUTF8 ( test . utf32 , [ ] , test . utf8 ) , <nl> + stackTrace : test . loc . withCurrentLoc ( ) ) <nl> + return ( ) <nl> } <nl> <nl> UTF8Decoder . test ( " FirstPossibleSequence " ) { <nl> UTF16Decoder . test ( " UTF16 . transcodedLength " ) { <nl> } <nl> } <nl> <nl> - UTF16Decoder . test ( " Decoding " ) { <nl> - for ( name , batch ) in UTF16Tests { <nl> + UTF16Decoder . test ( " Decoding1 " ) . forEach ( in : utfTests ) { <nl> + test in <nl> + <nl> + expectTrue ( <nl> + checkDecodeUTF16 ( <nl> + test . utf32 , test . utf32RepairedTail , test . utf16 ) , <nl> + stackTrace : test . loc . withCurrentLoc ( ) ) <nl> + return ( ) <nl> + } <nl> + <nl> + UTF16Decoder . test ( " Decoding2 " ) { <nl> + for ( name , batch ) in utf16Tests { <nl> print ( " Batch : \ ( name ) " ) <nl> for test in batch { <nl> expectTrue ( checkDecodeUTF16 ( test . scalarsHead , test . scalarsRepairedTail , <nl> UTF32Decoder . test ( " IllFormed " ) { <nl> <nl> var UTF8Encoder = TestSuite ( " UTF8Encoder " ) <nl> <nl> - UTF8Encoder . test ( " SmokeTest " ) { <nl> - for test in UTF8TestsSmokeTest { <nl> - expectTrue ( checkEncodeUTF8 ( test . encoded , test . scalars ) , <nl> - stackTrace : test . loc . withCurrentLoc ( ) ) <nl> - } <nl> + UTF8Encoder . test ( " SmokeTest " ) . forEach ( in : utfTests ) { <nl> + test in <nl> + <nl> + expectTrue ( <nl> + checkEncodeUTF8 ( test . utf8 , test . utf32 ) , <nl> + stackTrace : test . loc . withCurrentLoc ( ) ) <nl> + return ( ) <nl> } <nl> <nl> var UnicodeAPIs = TestSuite ( " UnicodeAPIs " ) <nl> func checkUTF16View ( _ expected : [ UInt16 ] , _ subject : String , <nl> } <nl> <nl> func forStringsWithUnpairedSurrogates ( _ checkClosure : ( UTF16Test , String ) - > Void ) { <nl> - for ( name , batch ) in UTF16Tests { <nl> + for ( name , batch ) in utf16Tests { <nl> print ( " Batch : \ ( name ) " ) <nl> for test in batch { <nl> let subject = NonContiguousNSString ( test . encoded ) as String <nl> checkClosure ( test , subject ) <nl> } <nl> } <nl> + <nl> + for test in utfTests { <nl> + let utf16Test = UTF16Test ( <nl> + test . utf32 , <nl> + test . utf32RepairedTail , <nl> + test . utf16 , <nl> + file : test . loc . file , line : test . loc . line ) <nl> + let subject = NonContiguousNSString ( test . utf16 ) as String <nl> + checkClosure ( utf16Test , subject ) <nl> + } <nl> } <nl> <nl> var StringCookedViews = TestSuite ( " StringCookedViews " ) <nl> <nl> - StringCookedViews . test ( " UTF8ForContiguousUTF16 " ) { <nl> - for test in UTF8TestsSmokeTest { <nl> - / / Add a non - ASCII character at the beginning to force Swift String and <nl> - / / CoreFoundation off the ASCII fast path . <nl> - / / <nl> - / / U + 0283 LATIN SMALL LETTER ESH <nl> - var backingStorage : [ UInt16 ] = [ 0x0283 ] <nl> - let expected : [ UInt8 ] = [ 0xca , 0x83 ] + test . encoded <nl> - let output : ( UInt16 ) - > Void = { backingStorage . append ( $ 0 ) } <nl> - <nl> - var iterator = test . scalars . makeIterator ( ) <nl> - transcode ( <nl> - iterator , <nl> - from : UTF32 . self , <nl> - to : UTF16 . self , <nl> - stoppingOnError : false , <nl> - into : output ) <nl> + StringCookedViews . test ( " UTF8ForContiguousUTF16 " ) . forEach ( in : utfTests ) { <nl> + test in <nl> <nl> - backingStorage . withUnsafeBufferPointer { <nl> - ( ptr ) - > Void in <nl> - let cfstring = CFStringCreateWithCharactersNoCopy ( kCFAllocatorDefault , <nl> - ptr . baseAddress , backingStorage . count , kCFAllocatorNull ) ! <nl> - expectFalse ( CFStringGetCStringPtr ( cfstring , <nl> - CFStringBuiltInEncodings . ASCII . rawValue ) ! = nil ) <nl> - expectTrue ( CFStringGetCharactersPtr ( cfstring ) ! = nil ) <nl> - checkUTF8View ( <nl> - expected , cfstring as NSString as String , test . loc . withCurrentLoc ( ) ) <nl> - return ( ) <nl> - } <nl> + / / Add a non - ASCII character at the beginning to force Swift String and <nl> + / / CoreFoundation off the ASCII fast path . <nl> + / / <nl> + / / U + 0283 LATIN SMALL LETTER ESH <nl> + var backingStorage : [ UInt16 ] = [ 0x0283 ] <nl> + let expected : [ UInt8 ] = [ 0xca , 0x83 ] + test . utf8 <nl> + let output : ( UInt16 ) - > Void = { backingStorage . append ( $ 0 ) } <nl> + <nl> + var iterator = test . utf32 . makeIterator ( ) <nl> + transcode ( <nl> + iterator , <nl> + from : UTF32 . self , <nl> + to : UTF16 . self , <nl> + stoppingOnError : false , <nl> + into : output ) <nl> + <nl> + backingStorage . withUnsafeBufferPointer { <nl> + ( ptr ) - > Void in <nl> + let cfstring = CFStringCreateWithCharactersNoCopy ( kCFAllocatorDefault , <nl> + ptr . baseAddress , backingStorage . count , kCFAllocatorNull ) ! <nl> + expectFalse ( CFStringGetCStringPtr ( cfstring , <nl> + CFStringBuiltInEncodings . ASCII . rawValue ) ! = nil ) <nl> + expectTrue ( CFStringGetCharactersPtr ( cfstring ) ! = nil ) <nl> + checkUTF8View ( <nl> + expected , cfstring as NSString as String , test . loc . withCurrentLoc ( ) ) <nl> + return ( ) <nl> } <nl> + } <nl> <nl> + StringCookedViews . test ( " UTF8ForContiguousUTF16 / StringsWithUnpairedSurrogates " ) { <nl> forStringsWithUnpairedSurrogates { <nl> ( test : UTF16Test , subject : String ) - > Void in <nl> var expected = [ UInt8 ] ( ) <nl> func verifyThatStringIsOpaqueForCoreFoundation ( _ nss : NSString ) { <nl> assert ( CFStringGetCharactersPtr ( copy ) = = nil ) <nl> } <nl> <nl> - StringCookedViews . test ( " UTF8ForNonContiguousUTF16 " ) { <nl> - for test in UTF8TestsSmokeTest { <nl> - var nss = NonContiguousNSString ( test . scalars ) <nl> - verifyThatStringIsOpaqueForCoreFoundation ( nss ) <nl> - checkUTF8View ( test . encoded , nss as String , test . loc . withCurrentLoc ( ) ) <nl> - } <nl> + StringCookedViews . test ( " UTF8ForNonContiguousUTF16 / fromUTF32 " ) . forEach ( in : utfTests ) { <nl> + test in <nl> + <nl> + var nss = NonContiguousNSString ( test . utf32 ) <nl> + verifyThatStringIsOpaqueForCoreFoundation ( nss ) <nl> + checkUTF8View ( test . utf8 , nss as String , test . loc . withCurrentLoc ( ) ) <nl> + } <nl> <nl> - for ( name , batch ) in UTF16Tests { <nl> + StringCookedViews . test ( " UTF8ForNonContiguousUTF16 / fromUTF16 " ) . forEach ( in : utfTests ) { <nl> + test in <nl> + <nl> + var expected = [ UInt8 ] ( ) <nl> + var expectedScalars = test . utf32 + test . utf32RepairedTail <nl> + transcode ( <nl> + expectedScalars . makeIterator ( ) , <nl> + from : UTF32 . self , <nl> + to : UTF8 . self , <nl> + stoppingOnError : false , <nl> + into : { expected . append ( $ 0 ) } ) <nl> + <nl> + var nss = NonContiguousNSString ( test . utf16 ) <nl> + verifyThatStringIsOpaqueForCoreFoundation ( nss ) <nl> + checkUTF8View ( expected , nss as String , test . loc . withCurrentLoc ( ) ) <nl> + } <nl> + <nl> + StringCookedViews . test ( " UTF8ForNonContiguousUTF16 / utf16Tests " ) { <nl> + for ( name , batch ) in utf16Tests { <nl> print ( " Batch : \ ( name ) " ) <nl> for test in batch { <nl> var expected = [ UInt8 ] ( ) <nl> StringCookedViews . test ( " UTF8ForNonContiguousUTF16Extra " ) { <nl> } <nl> } <nl> <nl> - StringCookedViews . test ( " UTF16 " ) { <nl> - for test in UTF8TestsSmokeTest { <nl> - var expected = [ UInt16 ] ( ) <nl> - let output : ( UInt16 ) - > Void = { expected . append ( $ 0 ) } <nl> - var expectedScalars = test . scalars <nl> - var iterator = expectedScalars . makeIterator ( ) <nl> - transcode ( <nl> - iterator , <nl> - from : UTF32 . self , <nl> - to : UTF16 . self , <nl> - stoppingOnError : false , <nl> - into : output ) <nl> + StringCookedViews . test ( " UTF16 " ) . forEach ( in : utfTests ) { <nl> + test in <nl> <nl> - var nss = NonContiguousNSString ( test . scalars ) <nl> - checkUTF16View ( expected , nss as String , test . loc . withCurrentLoc ( ) ) <nl> - } <nl> + var expected = [ UInt16 ] ( ) <nl> + let output : ( UInt16 ) - > Void = { expected . append ( $ 0 ) } <nl> + var expectedScalars = test . utf32 <nl> + var iterator = expectedScalars . makeIterator ( ) <nl> + transcode ( <nl> + iterator , <nl> + from : UTF32 . self , <nl> + to : UTF16 . self , <nl> + stoppingOnError : false , <nl> + into : output ) <nl> <nl> + var nss = NonContiguousNSString ( test . utf32 ) <nl> + checkUTF16View ( expected , nss as String , test . loc . withCurrentLoc ( ) ) <nl> + } <nl> + <nl> + StringCookedViews . test ( " UTF16 / StringsWithUnpairedSurrogates " ) { <nl> forStringsWithUnpairedSurrogates { <nl> ( test : UTF16Test , subject : String ) - > Void in <nl> var expected = [ UInt16 ] ( ) <nl> StringCookedViews . test ( " UTF16 " ) { <nl> } <nl> } <nl> <nl> - StringCookedViews . test ( " UnicodeScalars " ) { <nl> - for test in UTF8TestsSmokeTest { <nl> - let expectedScalars = test . scalars . map { UnicodeScalar ( $ 0 ) ! } <nl> - let subject = NonContiguousNSString ( test . scalars ) as String <nl> - checkSliceableWithBidirectionalIndex ( <nl> - expectedScalars , subject . unicodeScalars ) <nl> - } <nl> + StringCookedViews . test ( " UnicodeScalars " ) . forEach ( in : utfTests ) { <nl> + test in <nl> + <nl> + let subject = NonContiguousNSString ( test . utf32 ) as String <nl> + checkSliceableWithBidirectionalIndex ( <nl> + test . unicodeScalars , subject . unicodeScalars ) <nl> + } <nl> <nl> + StringCookedViews . test ( " UnicodeScalars / StringsWithUnpairedSurrogates " ) { <nl> forStringsWithUnpairedSurrogates { <nl> ( test : UTF16Test , subject : String ) - > Void in <nl> let expectedScalars = ( test . scalarsHead + test . scalarsRepairedTail ) . map { <nl>
stdlib : share the Unicode dataset across different test files
apple/swift
1d6b08ba97bb5749fc7bab637a07acda34c896cf
2016-08-08T06:29:24Z
mmm a / tensorflow / core / common_runtime / shape_refiner . cc <nl> ppp b / tensorflow / core / common_runtime / shape_refiner . cc <nl> Status ShapeRefiner : : EvaluateConstantTensorForEdge ( const Node * node , <nl> kMaxTensorSize , disable_constant_propagation_ ) ; <nl> } <nl> <nl> + Status ShapeRefiner : : EvaluateConstantIntScalarEdge ( const Node * node , <nl> + int dst_idx , bool * evaluated , <nl> + int64 * result ) { <nl> + Tensor scalar ; <nl> + TF_RETURN_IF_ERROR ( <nl> + EvaluateConstantTensorForEdge ( node , dst_idx , evaluated , & scalar ) ) ; <nl> + if ( * evaluated ) { <nl> + DCHECK_EQ ( scalar . NumElements ( ) , 1 ) <nl> + < < " EvaluateConstantIntScalarEdge called on non - scalar edge : " <nl> + < < scalar . NumElements ( ) ; <nl> + if ( scalar . dtype ( ) = = DT_INT32 ) { <nl> + * result = scalar . scalar < int32 > ( ) ( ) ; <nl> + } else { <nl> + DCHECK_EQ ( scalar . dtype ( ) , DT_INT64 ) <nl> + < < " EvaluateConstantIntScalarEdge called on non - integer edge : " <nl> + < < scalar . dtype ( ) ; <nl> + * result = scalar . scalar < int64 > ( ) ( ) ; <nl> + } <nl> + } <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> Status ShapeRefiner : : ConstantPartialShape ( InferenceContext * target_context , <nl> const Node * node , int dst_idx , <nl> ShapeHandle * result ) { <nl> Status ShapeRefiner : : ConstantPartialShape ( InferenceContext * target_context , <nl> std : : vector < DimensionHandle > dims ; <nl> / / Pack is concatenating its input scalars to form the shape tensor vector . <nl> for ( int i = 0 ; i < src_context - > num_inputs ( ) ; + + i ) { <nl> - Tensor scalar ; <nl> - bool evaluated = false ; <nl> - TF_RETURN_IF_ERROR ( EvaluateConstantTensorForEdge ( input_edge - > src ( ) , i , <nl> - & evaluated , & scalar ) ) ; <nl> + int64 size ; <nl> + bool evaluated ; <nl> + TF_RETURN_IF_ERROR ( EvaluateConstantIntScalarEdge ( input_edge - > src ( ) , i , <nl> + & evaluated , & size ) ) ; <nl> if ( evaluated ) { <nl> - int64 size ; <nl> - if ( scalar . dtype ( ) = = DT_INT32 ) { <nl> - size = scalar . scalar < int32 > ( ) ( ) ; <nl> - } else if ( scalar . dtype ( ) = = DT_INT64 ) { <nl> - size = scalar . scalar < int64 > ( ) ( ) ; <nl> - } else { <nl> - return errors : : InvalidArgument ( " Pack input must be int32 or int64 " ) ; <nl> - } <nl> dims . push_back ( size < 0 ? target_context - > UnknownDim ( ) <nl> : target_context - > MakeDim ( size ) ) ; <nl> } else { <nl> Status ShapeRefiner : : ConstantPartialShape ( InferenceContext * target_context , <nl> TF_RETURN_IF_ERROR ( <nl> target_context - > Concatenate ( * result , sub_result , result ) ) ; <nl> } <nl> + } else if ( src_op = = " StridedSlice " ) { <nl> + TF_RETURN_IF_ERROR ( <nl> + PartialStridedSliceShape ( input_edge - > src ( ) , src_context , result ) ) ; <nl> } else { <nl> Tensor t ; <nl> bool evaluated = false ; <nl> Status ShapeRefiner : : ConstantPartialShape ( InferenceContext * target_context , <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> + Status ShapeRefiner : : PartialStridedSliceShape ( Node * slice_node , <nl> + InferenceContext * ctx , <nl> + ShapeHandle * result ) { <nl> + / / Only attempt to evaluate if begin / end / strides all are scalars . <nl> + for ( int i = 1 ; i < = 3 ; + + i ) { <nl> + ShapeHandle input_shape = ctx - > input ( i ) ; <nl> + if ( ctx - > Value ( ctx - > Dim ( input_shape , 0 ) ) ! = 1 ) { <nl> + * result = ctx - > UnknownShape ( ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + } <nl> + <nl> + int begin_mask , end_mask , ellipsis_mask , new_axis_mask , shrink_axis_mask ; <nl> + TF_RETURN_IF_ERROR ( <nl> + GetNodeAttr ( slice_node - > attrs ( ) , " begin_mask " , & begin_mask ) ) ; <nl> + TF_RETURN_IF_ERROR ( GetNodeAttr ( slice_node - > attrs ( ) , " end_mask " , & end_mask ) ) ; <nl> + TF_RETURN_IF_ERROR ( <nl> + GetNodeAttr ( slice_node - > attrs ( ) , " ellipsis_mask " , & ellipsis_mask ) ) ; <nl> + TF_RETURN_IF_ERROR ( <nl> + GetNodeAttr ( slice_node - > attrs ( ) , " new_axis_mask " , & new_axis_mask ) ) ; <nl> + TF_RETURN_IF_ERROR ( <nl> + GetNodeAttr ( slice_node - > attrs ( ) , " shrink_axis_mask " , & shrink_axis_mask ) ) ; <nl> + <nl> + / / Only attempt to evaluate if there are no special masks set ( note that we <nl> + / / can handle begin / end_mask = = 1 ) . <nl> + if ( ! ( begin_mask = = 0 | | begin_mask = = 1 ) | | <nl> + ! ( end_mask = = 0 | | end_mask = = 1 ) | | ellipsis_mask ! = 0 | | <nl> + new_axis_mask ! = 0 | | shrink_axis_mask ! = 0 ) { <nl> + * result = ctx - > UnknownShape ( ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + bool evaluated ; <nl> + int64 begin ; <nl> + if ( begin_mask = = 1 ) { <nl> + begin = 0 ; <nl> + } else { <nl> + TF_RETURN_IF_ERROR ( <nl> + EvaluateConstantIntScalarEdge ( slice_node , 1 , & evaluated , & begin ) ) ; <nl> + if ( ! evaluated ) { <nl> + * result = ctx - > UnknownShape ( ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + } <nl> + <nl> + int64 end ; <nl> + if ( end_mask = = 1 ) { <nl> + end = std : : numeric_limits < int64 > : : max ( ) ; <nl> + } else { <nl> + TF_RETURN_IF_ERROR ( <nl> + EvaluateConstantIntScalarEdge ( slice_node , 2 , & evaluated , & end ) ) ; <nl> + if ( ! evaluated ) { <nl> + * result = ctx - > UnknownShape ( ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + } <nl> + <nl> + int64 stride ; <nl> + TF_RETURN_IF_ERROR ( <nl> + EvaluateConstantIntScalarEdge ( slice_node , 3 , & evaluated , & stride ) ) ; <nl> + if ( ! evaluated ) { <nl> + * result = ctx - > UnknownShape ( ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + / / Apply stride to input interpreted as a partial shape . <nl> + ShapeHandle input ; <nl> + TF_RETURN_IF_ERROR ( ConstantPartialShape ( ctx , slice_node , 0 , & input ) ) ; <nl> + TF_RETURN_IF_ERROR ( ctx - > Subshape ( input , begin , end , stride , result ) ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> Status ShapeRefiner : : RunShapeFn ( const Node * node , <nl> const OpRegistrationData * op_reg_data , <nl> ExtendedInferenceContext * ec ) { <nl> mmm a / tensorflow / core / common_runtime / shape_refiner . h <nl> ppp b / tensorflow / core / common_runtime / shape_refiner . h <nl> class ShapeRefiner { <nl> bool keep_nested_shapes , <nl> ExtendedInferenceContext * outer_context ) ; <nl> <nl> + / / Attempts to evaluate the ' dst_idx ' - th input to ' node ' . If the input edge <nl> + / / value can be evaluated , ' evaluated ' is set to true and the value returned <nl> + / / in ' result ' . Otherwise ' evaluated ' is set to false . <nl> Status EvaluateConstantTensorForEdge ( const Node * node , int dst_idx , <nl> bool * evaluated , Tensor * result ) ; <nl> <nl> + / / Wrapper around EvaluateConstantTensorForEdge for scalar int32 / int64 input <nl> + / / tensors . The caller is responsible for checking that the specified edge is <nl> + / / scalar and int32 or int64 . <nl> + Status EvaluateConstantIntScalarEdge ( const Node * node , int dst_idx , <nl> + bool * evaluated , int64 * result ) ; <nl> + <nl> / / This function tries to materialize as much information about the ' node ' ' s <nl> / / dst_idx input as a statically computable shape , and the result may be <nl> / / partially known , depending on what is statically inferable . <nl> class ShapeRefiner { <nl> const Node * node , int dst_idx , <nl> shape_inference : : ShapeHandle * result ) ; <nl> <nl> + / / Implementation of ConstantPartialShape for StridedSlice nodes . <nl> + Status PartialStridedSliceShape ( Node * slice_node , <nl> + shape_inference : : InferenceContext * ctx , <nl> + shape_inference : : ShapeHandle * result ) ; <nl> + <nl> Status RunShapeFn ( const Node * node , const OpRegistrationData * op_reg_data , <nl> ExtendedInferenceContext * ec ) ; <nl> <nl> mmm a / tensorflow / core / common_runtime / shape_refiner_test . cc <nl> ppp b / tensorflow / core / common_runtime / shape_refiner_test . cc <nl> class ShapeRefinerTest : public : : testing : : Test { <nl> } <nl> <nl> static constexpr int64 kMaxTensorSize = ShapeRefiner : : kMaxTensorSize ; <nl> + <nl> + void TestStridedSlice ( const PartialTensorShape & input_shape , int begin , <nl> + int end , int stride , const char * expected , <nl> + int begin_mask = 0 , int end_mask = 0 , <nl> + int ellipsis_mask = 0 ) { <nl> + Scope root = Scope : : DisabledShapeInferenceScope ( ) ; <nl> + auto placeholder = <nl> + ops : : Placeholder ( root , DT_INT32 , ops : : Placeholder : : Shape ( input_shape ) ) ; <nl> + auto input = ops : : Shape ( root , placeholder ) ; <nl> + auto begin_op = ops : : Const ( root , { begin } ) ; <nl> + auto end_op = ops : : Const ( root , { end } ) ; <nl> + auto stride_op = ops : : Const ( root , { stride } ) ; <nl> + auto slice = ops : : StridedSlice ( root , input , begin_op , end_op , stride_op , <nl> + ops : : StridedSlice : : BeginMask ( begin_mask ) <nl> + . EndMask ( end_mask ) <nl> + . EllipsisMask ( ellipsis_mask ) ) ; <nl> + Node * result ; <nl> + TF_ASSERT_OK ( NodeBuilder ( " test " , " TensorAsShapeInt32 " ) <nl> + . Input ( slice . node ( ) ) <nl> + . Finalize ( root . graph ( ) , & result ) ) ; <nl> + <nl> + ShapeRefiner m ( TF_GRAPH_DEF_VERSION , OpRegistry : : Global ( ) ) ; <nl> + TF_ASSERT_OK ( m . AddNode ( placeholder . node ( ) ) ) ; <nl> + TF_ASSERT_OK ( m . AddNode ( input . node ( ) ) ) ; <nl> + TF_ASSERT_OK ( m . AddNode ( begin_op . node ( ) ) ) ; <nl> + TF_ASSERT_OK ( m . AddNode ( end_op . node ( ) ) ) ; <nl> + TF_ASSERT_OK ( m . AddNode ( stride_op . node ( ) ) ) ; <nl> + TF_ASSERT_OK ( m . AddNode ( slice . node ( ) ) ) ; <nl> + TF_ASSERT_OK ( m . AddNode ( result ) ) ; <nl> + <nl> + shape_inference : : InferenceContext * ctx = m . GetContext ( result ) ; <nl> + EXPECT_EQ ( ctx - > DebugString ( ctx - > output ( 0 ) ) , expected ) ; <nl> + } <nl> } ; <nl> <nl> namespace { <nl> TEST_F ( ShapeRefinerTest , ConstantValueAsShape_ConcatInvalidDimValue ) { <nl> m . AddNode ( result ) . error_message ( ) ) ; <nl> } <nl> <nl> + TEST_F ( ShapeRefinerTest , ConstantValueAsShape_StridedSlice ) { <nl> + TestStridedSlice ( <nl> + / * input_shape = * / { 1 , - 1 , 3 , - 1 , 5 } , <nl> + / * begin = * / 2 , <nl> + / * end = * / 5 , <nl> + / * stride = * / 1 , <nl> + / * expected = * / " [ 3 , ? , 5 ] " ) ; <nl> + } <nl> + <nl> + TEST_F ( ShapeRefinerTest , ConstantValueAsShape_StridedSliceNegativeStride ) { <nl> + / / clang - format off <nl> + TestStridedSlice ( <nl> + / * input_shape = * / { 1 , - 1 , 3 , - 1 , 5 } , <nl> + / * begin = * / 10 , <nl> + / * end = * / 0 , <nl> + / * stride = * / - 1 , <nl> + / * expected = * / " [ 5 , ? , 3 , ? ] " ) ; <nl> + / / clang - format on <nl> + } <nl> + <nl> + TEST_F ( ShapeRefinerTest , ConstantValueAsShape_StridedSliceMasks ) { <nl> + TestStridedSlice ( <nl> + / * input_shape = * / { 1 , - 1 , 3 , - 1 , 5 } , <nl> + / * begin = * / 3 , <nl> + / * end = * / 4 , <nl> + / * stride = * / 1 , <nl> + / * expected = * / " [ 1 , ? , 3 , ? , 5 ] " , <nl> + / * begin_mask = * / 1 , <nl> + / * end_mask = * / 1 ) ; <nl> + } <nl> + <nl> + TEST_F ( ShapeRefinerTest , ConstantValueAsShape_StridedSliceInvalidMask ) { <nl> + TestStridedSlice ( <nl> + / * input_shape = * / { 1 , - 1 , 3 } , <nl> + / * begin = * / 2 , <nl> + / * end = * / 3 , <nl> + / * stride = * / 1 , <nl> + / * expected = * / " [ ? , ? , ? ] " , <nl> + / * begin_mask = * / 0 , <nl> + / * end_mask = * / 0 , <nl> + / * ellipsis_mask = * / 1 ) ; <nl> + } <nl> + <nl> + TEST_F ( ShapeRefinerTest , ConstantValueAsShape_StridedSliceMulti ) { <nl> + Scope root = Scope : : DisabledShapeInferenceScope ( ) ; <nl> + auto input = ops : : Placeholder ( root , DT_INT32 ) ; <nl> + auto begin = ops : : Const ( root , { 0 , 0 } ) ; <nl> + auto end = ops : : Const ( root , { 2 , 2 } ) ; <nl> + auto stride = ops : : Const ( root , { 1 , 1 } ) ; <nl> + auto slice = ops : : StridedSlice ( root , input , begin , end , stride ) ; <nl> + Node * result ; <nl> + TF_ASSERT_OK ( NodeBuilder ( " test " , " TensorAsShapeInt32 " ) <nl> + . Input ( slice . node ( ) ) <nl> + . Finalize ( root . graph ( ) , & result ) ) ; <nl> + <nl> + ShapeRefiner m ( TF_GRAPH_DEF_VERSION , OpRegistry : : Global ( ) ) ; <nl> + TF_ASSERT_OK ( m . AddNode ( input . node ( ) ) ) ; <nl> + TF_ASSERT_OK ( m . AddNode ( begin . node ( ) ) ) ; <nl> + TF_ASSERT_OK ( m . AddNode ( end . node ( ) ) ) ; <nl> + TF_ASSERT_OK ( m . AddNode ( stride . node ( ) ) ) ; <nl> + TF_ASSERT_OK ( m . AddNode ( slice . node ( ) ) ) ; <nl> + TF_ASSERT_OK ( m . AddNode ( result ) ) ; <nl> + <nl> + shape_inference : : InferenceContext * ctx = m . GetContext ( result ) ; <nl> + EXPECT_EQ ( ctx - > DebugString ( ctx - > output ( 0 ) ) , " ? " ) ; <nl> + } <nl> + <nl> namespace { <nl> <nl> / / Dummy op to test ShapeRefiner util functions <nl> mmm a / tensorflow / core / framework / shape_inference . cc <nl> ppp b / tensorflow / core / framework / shape_inference . cc <nl> Status InferenceContext : : Subshape ( ShapeHandle s , int64 start , <nl> return Subshape ( s , start , std : : numeric_limits < int64 > : : max ( ) / * end * / , out ) ; <nl> } <nl> <nl> - Status InferenceContext : : Subshape ( ShapeHandle s , int64 start_in , int64 end_in , <nl> + Status InferenceContext : : Subshape ( ShapeHandle s , int64 start , int64 end , <nl> ShapeHandle * out ) { <nl> - int64 start = start_in ; <nl> - int64 end = end_in ; <nl> + return Subshape ( s , start , end , 1 / * stride * / , out ) ; <nl> + } <nl> + <nl> + Status InferenceContext : : Subshape ( ShapeHandle s , int64 start , int64 end , <nl> + int64 stride , ShapeHandle * out ) { <nl> + int64 start_in = start ; <nl> + int64 end_in = end ; <nl> + <nl> const int32 rank = Rank ( s ) ; <nl> if ( start = = 0 & & ( ( RankKnown ( s ) & & end > = rank ) | | <nl> end = = std : : numeric_limits < int64 > : : max ( ) ) ) { <nl> Status InferenceContext : : Subshape ( ShapeHandle s , int64 start_in , int64 end_in , <nl> <nl> if ( start > rank ) start = rank ; <nl> if ( end > rank ) end = rank ; <nl> + <nl> + if ( stride < 0 & & start = = rank ) - - start ; <nl> + <nl> if ( start < 0 ) { <nl> start = rank + start ; <nl> if ( start < 0 ) { <nl> Status InferenceContext : : Subshape ( ShapeHandle s , int64 start_in , int64 end_in , <nl> " , for shape with rank " , rank ) ; <nl> } <nl> } <nl> - if ( start > end ) { <nl> + if ( stride > 0 & & start > end ) { <nl> * out = nullptr ; <nl> return errors : : InvalidArgument ( <nl> " Subshape must have computed start < = end , but is " , start , " and " , <nl> end , " ( computed from start " , start_in , " and end " , end_in , <nl> " over shape with rank " , rank , " ) " ) ; <nl> + } else if ( stride < 0 & & start < end ) { <nl> + * out = nullptr ; <nl> + return errors : : InvalidArgument ( <nl> + " Subshape must have computed start > = end since stride is negative , " <nl> + " but is " , <nl> + start , " and " , end , " ( computed from start " , start_in , " and end " , <nl> + end_in , " over shape with rank " , rank , " and stride " , stride , " ) " ) ; <nl> } <nl> + <nl> std : : vector < DimensionHandle > dims ; <nl> - dims . reserve ( end - start ) ; <nl> - for ( int i = start ; i < end ; + + i ) { <nl> + dims . reserve ( ( end - start ) / stride ) ; <nl> + for ( int i = start ; stride > 0 ? i < end : i > end ; i + = stride ) { <nl> dims . push_back ( Dim ( s , i ) ) ; <nl> } <nl> return ReturnCreatedShape ( dims , out ) ; <nl> mmm a / tensorflow / core / framework / shape_inference . h <nl> ppp b / tensorflow / core / framework / shape_inference . h <nl> class InferenceContext { <nl> Status Subshape ( ShapeHandle s , int64 start , int64 end , <nl> ShapeHandle * out ) TF_MUST_USE_RESULT ; <nl> <nl> + / / Returns in < * out > a sub - shape of < s > , with dimensions [ start : end : stride ] . <nl> + / / < start > and < end > can be negative , to index from the end of the shape . <nl> + / / < start > and < end > are set to the rank of < s > if > rank of < s > . <nl> + / / < stride > can be negative , to reverse the < s > . <nl> + Status Subshape ( ShapeHandle s , int64 start , int64 end , int64 stride , <nl> + ShapeHandle * out ) TF_MUST_USE_RESULT ; <nl> + <nl> / / Returns in < * out > the result of appending the dimensions of < s2 > to those <nl> / / of < s1 > . <nl> Status Concatenate ( ShapeHandle s1 , ShapeHandle s2 , <nl>
Add logic for StridedSlice ops in ShapeRefiner : : ConstantPartialShape ( ) .
tensorflow/tensorflow
1af09b57ef663d4ab0c02a00e2af1f1e2819d32f
2018-05-08T01:32:07Z
mmm a / lib / Transforms / CMakeLists . txt <nl> ppp b / lib / Transforms / CMakeLists . txt <nl> add_llvm_library ( MLIRTransforms <nl> SimplifyAffineStructures . cpp <nl> StripDebugInfo . cpp <nl> TestConstantFold . cpp <nl> + TestLoopFusion . cpp <nl> Utils / FoldUtils . cpp <nl> Utils / GreedyPatternRewriteDriver . cpp <nl> Utils / LoopFusionUtils . cpp <nl>
Add TestLoopFusion . cpp to CMakeLists . txt
tensorflow/tensorflow
c87cb7050439ac7d6ec7f457b89cb6ad1b02fc31
2019-06-02T03:00:52Z
mmm a / include / allheaders . h <nl> ppp b / include / allheaders . h <nl> <nl> <nl> <nl> # define LIBLEPT_MAJOR_VERSION 1 <nl> - # define LIBLEPT_MINOR_VERSION 61 <nl> + # define LIBLEPT_MINOR_VERSION 62 <nl> <nl> # include " alltypes . h " <nl> <nl> mmm a / include / alltypes . h <nl> ppp b / include / alltypes . h <nl> <nl> # include " watershed . h " <nl> <nl> / * i / o * / <nl> + # include < stdio . h > <nl> # include " imageio . h " <nl> <nl> # endif / * LEPTONICA_ALLTYPES_H * / <nl> mmm a / include / environ . h <nl> ppp b / include / environ . h <nl> <nl> # ifndef LEPTONICA_ENVIRON_H <nl> # define LEPTONICA_ENVIRON_H <nl> <nl> - # if defined ( WIN32 ) | | defined ( WIN64 ) <nl> - / * WINDOWS_SPECIFICS * / <nl> - / * Provide intptr_t from the non - existent stdint . h . * / <nl> + # if defined ( WIN32 ) | | defined ( WIN64 ) <nl> + / * WINDOWS_SPECIFICS * / <nl> + / * Provide intptr_t from the non - existent stdint . h . * / <nl> # if defined ( WIN32 ) <nl> - typedef int intptr_t ; <nl> - typedef unsigned int uintptr_t ; <nl> - # else <nl> - typedef long int intptr_t ; <nl> - typedef unsigned long int uintptr_t ; <nl> - # endif <nl> - <nl> - / * VC + + 6 doesn ' t seem to have powf , expf . * / <nl> - # if ( _MSC_VER < = 1400 ) <nl> - # define powf ( x , y ) ( float ) pow ( ( double ) ( x ) , ( double ) ( y ) ) <nl> - # define expf ( x ) ( float ) exp ( ( double ) ( x ) ) <nl> - # endif <nl> - <nl> - / * DLL EXPORT / IMPORT * / <nl> - # ifdef LEPTONLIB_EXPORTS <nl> - # define LEPT_DLL __declspec ( dllexport ) <nl> - # elif defined ( LEPTONLIB_IMPORTS ) <nl> - # define LEPT_DLL __declspec ( dllimport ) <nl> - # else <nl> - # define LEPT_DLL <nl> - # endif <nl> + typedef int intptr_t ; <nl> + typedef unsigned int uintptr_t ; <nl> + # else <nl> + typedef long int intptr_t ; <nl> + typedef unsigned long int uintptr_t ; <nl> + # endif <nl> + <nl> + / * VC + + 6 doesn ' t seem to have powf , expf . * / <nl> + # if ( _MSC_VER < = 1400 ) <nl> + # define powf ( x , y ) ( float ) pow ( ( double ) ( x ) , ( double ) ( y ) ) <nl> + # define expf ( x ) ( float ) exp ( ( double ) ( x ) ) <nl> + # endif <nl> + <nl> + / * DLL EXPORT / IMPORT * / <nl> + # ifdef LEPTONLIB_EXPORTS <nl> + # define LEPT_DLL __declspec ( dllexport ) <nl> + # elif defined ( LEPTONLIB_IMPORTS ) <nl> + # define LEPT_DLL __declspec ( dllimport ) <nl> + # else <nl> + # define LEPT_DLL <nl> + # endif <nl> # else / * non - WINDOWS - SPECIFICS * / <nl> - # include < stdint . h > <nl> + # include < stdint . h > <nl> # define LEPT_DLL <nl> # endif <nl> - <nl> - / * FILE was undefined somewhere * / <nl> - # include < stdio . h > <nl> <nl> typedef intptr_t l_intptr_t ; <nl> typedef uintptr_t l_uintptr_t ; <nl> mmm a / include / leptprotos . h <nl> ppp b / include / leptprotos . h <nl> <nl> / * <nl> - * This file was autogen ' d by xtractprotos , v . 1 . 3 <nl> + * This file was autogen ' d by xtractprotos , v . 1 . 4 <nl> * / <nl> # ifdef __cplusplus <nl> extern " C " { <nl> LEPT_DLL extern l_int32 pixSauvolaBinarizeTiled ( PIX * pixs , l_int32 whsize , l_f <nl> LEPT_DLL extern l_int32 pixSauvolaBinarize ( PIX * pixs , l_int32 whsize , l_float32 factor , l_int32 addborder , PIX * * ppixm , PIX * * ppixsd , PIX * * ppixth , PIX * * ppixd ) ; <nl> LEPT_DLL extern PIX * pixSauvolaGetThreshold ( PIX * pixm , PIX * pixms , l_float32 factor , PIX * * ppixsd ) ; <nl> LEPT_DLL extern PIX * pixApplyLocalThreshold ( PIX * pixs , PIX * pixth , l_int32 redfactor ) ; <nl> - LEPT_DLL extern PIX * pixWindowedMean ( PIX * pixs , l_int32 size ) ; <nl> - LEPT_DLL extern PIX * pixWindowedMeanSquare ( PIX * pixs , l_int32 size ) ; <nl> - LEPT_DLL extern DPIX * pixMeanSquareAccum ( PIX * pixs ) ; <nl> LEPT_DLL extern PIX * pixExpandBinaryReplicate ( PIX * pixs , l_int32 factor ) ; <nl> LEPT_DLL extern PIX * pixExpandBinaryPower2 ( PIX * pixs , l_int32 factor ) ; <nl> LEPT_DLL extern l_int32 expandBinaryPower2Low ( l_uint32 * datad , l_int32 wd , l_int32 hd , l_int32 wpld , l_uint32 * datas , l_int32 ws , l_int32 hs , l_int32 wpls , l_int32 factor ) ; <nl> LEPT_DLL extern l_int32 boxEqual ( BOX * box1 , BOX * box2 , l_int32 * psame ) ; <nl> LEPT_DLL extern l_int32 boxaEqual ( BOXA * boxa1 , BOXA * boxa2 , l_int32 maxdist , NUMA * * pnaindex , l_int32 * psame ) ; <nl> LEPT_DLL extern l_int32 boxaJoin ( BOXA * boxad , BOXA * boxas , l_int32 istart , l_int32 iend ) ; <nl> LEPT_DLL extern l_int32 boxaGetExtent ( BOXA * boxa , l_int32 * pw , l_int32 * ph , BOX * * pbox ) ; <nl> + LEPT_DLL extern l_int32 boxaGetCoverage ( BOXA * boxa , l_int32 wc , l_int32 hc , l_int32 exactflag , l_float32 * pfract ) ; <nl> LEPT_DLL extern l_int32 boxaSizeRange ( BOXA * boxa , l_int32 * pminw , l_int32 * pminh , l_int32 * pmaxw , l_int32 * pmaxh ) ; <nl> LEPT_DLL extern l_int32 boxaLocationRange ( BOXA * boxa , l_int32 * pminx , l_int32 * pminy , l_int32 * pmaxx , l_int32 * pmaxy ) ; <nl> LEPT_DLL extern BOXA * boxaSelectBySize ( BOXA * boxas , l_int32 width , l_int32 height , l_int32 type , l_int32 relation , l_int32 * pchanged ) ; <nl> LEPT_DLL extern l_int32 pixcmapAddBlackOrWhite ( PIXCMAP * cmap , l_int32 color , l <nl> LEPT_DLL extern l_int32 pixcmapSetBlackAndWhite ( PIXCMAP * cmap , l_int32 setblack , l_int32 setwhite ) ; <nl> LEPT_DLL extern l_int32 pixcmapGetCount ( PIXCMAP * cmap ) ; <nl> LEPT_DLL extern l_int32 pixcmapGetFreeCount ( PIXCMAP * cmap ) ; <nl> + LEPT_DLL extern l_int32 pixcmapGetDepth ( PIXCMAP * cmap ) ; <nl> + LEPT_DLL extern l_int32 pixcmapGetMinDepth ( PIXCMAP * cmap , l_int32 * pmindepth ) ; <nl> LEPT_DLL extern l_int32 pixcmapClear ( PIXCMAP * cmap ) ; <nl> LEPT_DLL extern l_int32 pixcmapGetColor ( PIXCMAP * cmap , l_int32 index , l_int32 * prval , l_int32 * pgval , l_int32 * pbval ) ; <nl> LEPT_DLL extern l_int32 pixcmapResetColor ( PIXCMAP * cmap , l_int32 index , l_int32 rval , l_int32 gval , l_int32 bval ) ; <nl> LEPT_DLL extern l_int32 pixcmapHasColor ( PIXCMAP * cmap , l_int32 * pcolor ) ; <nl> LEPT_DLL extern l_int32 pixcmapCountGrayColors ( PIXCMAP * cmap , l_int32 * pngray ) ; <nl> LEPT_DLL extern l_int32 pixcmapGetRankIntensity ( PIXCMAP * cmap , l_float32 rankval , l_int32 * pindex ) ; <nl> LEPT_DLL extern l_int32 pixcmapGetNearestIndex ( PIXCMAP * cmap , l_int32 rval , l_int32 gval , l_int32 bval , l_int32 * pindex ) ; <nl> + LEPT_DLL extern l_int32 pixcmapGetNearestGrayIndex ( PIXCMAP * cmap , l_int32 val , l_int32 * pindex ) ; <nl> LEPT_DLL extern l_int32 pixcmapGetExtremeValue ( PIXCMAP * cmap , l_int32 type , l_int32 * prval , l_int32 * pgval , l_int32 * pbval ) ; <nl> LEPT_DLL extern PIXCMAP * pixcmapGrayToColor ( l_uint32 color ) ; <nl> LEPT_DLL extern PIXCMAP * pixcmapColorToGray ( PIXCMAP * cmaps , l_float32 rwt , l_float32 gwt , l_float32 bwt ) ; <nl> LEPT_DLL extern PIX * pixFewColorsOctcubeQuant1 ( PIX * pixs , l_int32 level ) ; <nl> LEPT_DLL extern PIX * pixFewColorsOctcubeQuant2 ( PIX * pixs , l_int32 level , NUMA * na , l_int32 ncolors , l_int32 * pnerrors ) ; <nl> LEPT_DLL extern PIX * pixFewColorsOctcubeQuantMixed ( PIX * pixs , l_int32 level , l_int32 darkthresh , l_int32 lightthresh , l_int32 diffthresh , l_float32 minfract , l_int32 maxspan ) ; <nl> LEPT_DLL extern PIX * pixFixedOctcubeQuantGenRGB ( PIX * pixs , l_int32 level ) ; <nl> - LEPT_DLL extern PIX * pixOctcubeQuantFromCmap ( PIX * pixs , PIXCMAP * cmap , l_int32 level , l_int32 metric ) ; <nl> - LEPT_DLL extern PIX * pixOctcubeQuantFromCmapLUT ( PIX * pixs , PIXCMAP * cmap , l_int32 * cmaptab , l_uint32 * rtab , l_uint32 * gtab , l_uint32 * btab ) ; <nl> + LEPT_DLL extern PIX * pixQuantFromCmap ( PIX * pixs , PIXCMAP * cmap , l_int32 mindepth , l_int32 level , l_int32 metric ) ; <nl> + LEPT_DLL extern PIX * pixOctcubeQuantFromCmap ( PIX * pixs , PIXCMAP * cmap , l_int32 mindepth , l_int32 level , l_int32 metric ) ; <nl> + LEPT_DLL extern PIX * pixOctcubeQuantFromCmapLUT ( PIX * pixs , PIXCMAP * cmap , l_int32 mindepth , l_int32 * cmaptab , l_uint32 * rtab , l_uint32 * gtab , l_uint32 * btab ) ; <nl> LEPT_DLL extern NUMA * pixOctcubeHistogram ( PIX * pixs , l_int32 level , l_int32 * pncolors ) ; <nl> LEPT_DLL extern l_int32 * pixcmapToOctcubeLUT ( PIXCMAP * cmap , l_int32 level , l_int32 metric ) ; <nl> LEPT_DLL extern l_int32 pixRemoveUnusedColors ( PIX * pixs ) ; <nl> LEPT_DLL extern PIX * pixColorSegmentCluster ( PIX * pixs , l_int32 maxdist , l_int <nl> LEPT_DLL extern l_int32 pixAssignToNearestColor ( PIX * pixd , PIX * pixs , PIX * pixm , l_int32 level , l_int32 * countarray ) ; <nl> LEPT_DLL extern l_int32 pixColorSegmentClean ( PIX * pixs , l_int32 selsize , l_int32 * countarray ) ; <nl> LEPT_DLL extern l_int32 pixColorSegmentRemoveColors ( PIX * pixd , PIX * pixs , l_int32 finalcolors ) ; <nl> + LEPT_DLL extern PIX * pixMakeRangeMaskHS ( PIX * pixs , l_int32 huecenter , l_int32 huehw , l_int32 satcenter , l_int32 sathw , l_int32 regionflag ) ; <nl> + LEPT_DLL extern PIX * pixMakeRangeMaskHV ( PIX * pixs , l_int32 huecenter , l_int32 huehw , l_int32 valcenter , l_int32 valhw , l_int32 regionflag ) ; <nl> + LEPT_DLL extern PIX * pixMakeRangeMaskSV ( PIX * pixs , l_int32 satcenter , l_int32 sathw , l_int32 valcenter , l_int32 valhw , l_int32 regionflag ) ; <nl> + LEPT_DLL extern PIX * pixMakeHistoHS ( PIX * pixs , l_int32 factor , NUMA * * pnahue , NUMA * * pnasat ) ; <nl> + LEPT_DLL extern PIX * pixMakeHistoHV ( PIX * pixs , l_int32 factor , NUMA * * pnahue , NUMA * * pnaval ) ; <nl> + LEPT_DLL extern PIX * pixMakeHistoSV ( PIX * pixs , l_int32 factor , NUMA * * pnasat , NUMA * * pnaval ) ; <nl> + LEPT_DLL extern l_int32 pixFindHistoPeaksHSV ( PIX * pixs , l_int32 type , l_int32 width , l_int32 height , l_int32 npeaks , l_float32 erasefactor , PTA * * ppta , NUMA * * pnatot , PIXA * * ppixa ) ; <nl> + LEPT_DLL extern PIX * displayHSVColorRange ( l_int32 hval , l_int32 sval , l_int32 vval , l_int32 huehw , l_int32 sathw , l_int32 nsamp , l_int32 factor ) ; <nl> LEPT_DLL extern l_int32 pixEqual ( PIX * pix1 , PIX * pix2 , l_int32 * psame ) ; <nl> LEPT_DLL extern l_int32 pixEqualWithCmap ( PIX * pix1 , PIX * pix2 , l_int32 * psame ) ; <nl> LEPT_DLL extern l_int32 pixUsesCmapColor ( PIX * pixs , l_int32 * pcolor ) ; <nl> LEPT_DLL extern PIX * pixBlockconvAccum ( PIX * pixs ) ; <nl> LEPT_DLL extern PIX * pixBlockconvGrayUnnormalized ( PIX * pixs , l_int32 wc , l_int32 hc ) ; <nl> LEPT_DLL extern PIX * pixBlockconvTiled ( PIX * pix , l_int32 wc , l_int32 hc , l_int32 nx , l_int32 ny ) ; <nl> LEPT_DLL extern PIX * pixBlockconvGrayTile ( PIX * pixs , PIX * pixacc , l_int32 wc , l_int32 hc ) ; <nl> + LEPT_DLL extern PIX * pixWindowedMean ( PIX * pixs , l_int32 wc , l_int32 hc , l_int32 normflag ) ; <nl> + LEPT_DLL extern PIX * pixWindowedMeanSquare ( PIX * pixs , l_int32 size ) ; <nl> + LEPT_DLL extern DPIX * pixMeanSquareAccum ( PIX * pixs ) ; <nl> LEPT_DLL extern PIX * pixBlockrank ( PIX * pixs , PIX * pixacc , l_int32 wc , l_int32 hc , l_float32 rank ) ; <nl> LEPT_DLL extern PIX * pixBlocksum ( PIX * pixs , PIX * pixacc , l_int32 wc , l_int32 hc ) ; <nl> LEPT_DLL extern PIX * pixWoodfillTransform ( PIX * pixs , l_int32 halfsize , PIX * pixacc ) ; <nl> LEPT_DLL extern NUMA * numaContrastTRC ( l_float32 factor ) ; <nl> LEPT_DLL extern PIX * pixEqualizeTRC ( PIX * pixd , PIX * pixs , l_float32 fract , l_int32 factor ) ; <nl> LEPT_DLL extern NUMA * numaEqualizeTRC ( PIX * pix , l_float32 fract , l_int32 factor ) ; <nl> LEPT_DLL extern l_int32 pixTRCMap ( PIX * pixs , PIX * pixm , NUMA * na ) ; <nl> - LEPT_DLL extern PIX * pixUnsharpMasking ( PIX * pix , l_int32 smooth , l_float32 fract ) ; <nl> - LEPT_DLL extern PIX * pixUnsharpMaskingColor ( PIX * pixs , l_int32 smooth , l_float32 fract ) ; <nl> - LEPT_DLL extern PIX * pixUnsharpMaskingGray ( PIX * pixs , l_int32 smooth , l_float32 fract ) ; <nl> + LEPT_DLL extern PIX * pixUnsharpMasking ( PIX * pixs , l_int32 halfwidth , l_float32 fract ) ; <nl> + LEPT_DLL extern PIX * pixUnsharpMaskingGray ( PIX * pixs , l_int32 halfwidth , l_float32 fract ) ; <nl> + LEPT_DLL extern PIX * pixUnsharpMaskingFast ( PIX * pixs , l_int32 halfwidth , l_float32 fract , l_int32 direction ) ; <nl> + LEPT_DLL extern PIX * pixUnsharpMaskingGrayFast ( PIX * pixs , l_int32 halfwidth , l_float32 fract , l_int32 direction ) ; <nl> + LEPT_DLL extern PIX * pixUnsharpMaskingGray1D ( PIX * pixs , l_int32 halfwidth , l_float32 fract , l_int32 direction ) ; <nl> + LEPT_DLL extern PIX * pixUnsharpMaskingGray2D ( PIX * pixs , l_int32 halfwidth , l_float32 fract ) ; <nl> LEPT_DLL extern PIX * pixModifyHue ( PIX * pixd , PIX * pixs , l_float32 fract ) ; <nl> LEPT_DLL extern PIX * pixModifySaturation ( PIX * pixd , PIX * pixs , l_float32 fract ) ; <nl> LEPT_DLL extern l_int32 pixMeasureSaturation ( PIX * pixs , l_int32 factor , l_float32 * psat ) ; <nl> + LEPT_DLL extern PIX * pixMultConstantColor ( PIX * pixs , l_float32 rfact , l_float32 gfact , l_float32 bfact ) ; <nl> + LEPT_DLL extern PIX * pixMultMatrixColor ( PIX * pixs , L_KERNEL * kel ) ; <nl> LEPT_DLL extern PIX * pixHalfEdgeByBandpass ( PIX * pixs , l_int32 sm1h , l_int32 sm1v , l_int32 sm2h , l_int32 sm2v ) ; <nl> LEPT_DLL extern l_int32 fhmtautogen ( SELA * sela , l_int32 fileindex , const char * filename ) ; <nl> LEPT_DLL extern l_int32 fhmtautogen1 ( SELA * sela , l_int32 fileindex , const char * filename ) ; <nl> LEPT_DLL extern l_int32 dpixSetResolution ( DPIX * dpix , l_int32 xres , l_int32 yr <nl> LEPT_DLL extern l_int32 dpixCopyResolution ( DPIX * dpixd , DPIX * dpixs ) ; <nl> LEPT_DLL extern l_float64 * dpixGetData ( DPIX * dpix ) ; <nl> LEPT_DLL extern l_int32 dpixSetData ( DPIX * dpix , l_float64 * data ) ; <nl> - LEPT_DLL extern FPIX * pixConvertToFPix ( PIX * pixs ) ; <nl> + LEPT_DLL extern FPIX * pixConvertToFPix ( PIX * pixs , l_int32 ncomps ) ; <nl> LEPT_DLL extern PIX * fpixConvertToPix ( FPIX * fpixs , l_int32 outdepth , l_int32 negvals , l_int32 errorflag ) ; <nl> LEPT_DLL extern PIX * fpixDisplayMaxDynamicRange ( FPIX * fpixs ) ; <nl> LEPT_DLL extern FPIX * fpixAddBorder ( FPIX * fpixs , l_int32 left , l_int32 right , l_int32 top , l_int32 bot ) ; <nl> LEPT_DLL extern l_int32 makeGrayQuantTableArb ( NUMA * na , l_int32 outdepth , l_in <nl> LEPT_DLL extern l_int32 makeGrayQuantColormapArb ( PIX * pixs , l_int32 * tab , l_int32 outdepth , PIXCMAP * * pcmap ) ; <nl> LEPT_DLL extern PIX * pixGenerateMaskByBand32 ( PIX * pixs , l_uint32 refval , l_int32 delm , l_int32 delp ) ; <nl> LEPT_DLL extern PIX * pixGenerateMaskByDiscr32 ( PIX * pixs , l_uint32 refval1 , l_uint32 refval2 , l_int32 distflag ) ; <nl> - LEPT_DLL extern PIX * pixGrayQuantizeFromHisto ( PIX * pixd , PIX * pixs , PIX * pixm , l_float32 minfract , l_int32 maxsize ) ; <nl> + LEPT_DLL extern PIX * pixGrayQuantFromHisto ( PIX * pixd , PIX * pixs , PIX * pixm , l_float32 minfract , l_int32 maxsize ) ; <nl> + LEPT_DLL extern PIX * pixGrayQuantFromCmap ( PIX * pixs , PIXCMAP * cmap , l_int32 mindepth ) ; <nl> LEPT_DLL extern void ditherToBinaryLow ( l_uint32 * datad , l_int32 w , l_int32 h , l_int32 wpld , l_uint32 * datas , l_int32 wpls , l_uint32 * bufs1 , l_uint32 * bufs2 , l_int32 lowerclip , l_int32 upperclip ) ; <nl> LEPT_DLL extern void ditherToBinaryLineLow ( l_uint32 * lined , l_int32 w , l_uint32 * bufs1 , l_uint32 * bufs2 , l_int32 lowerclip , l_int32 upperclip , l_int32 lastlineflag ) ; <nl> LEPT_DLL extern void thresholdToBinaryLow ( l_uint32 * datad , l_int32 w , l_int32 h , l_int32 wpld , l_uint32 * datas , l_int32 d , l_int32 wpls , l_int32 thresh ) ; <nl> LEPT_DLL extern l_int32 listGetCount ( DLLIST * head ) ; <nl> LEPT_DLL extern l_int32 listReverse ( DLLIST * * phead ) ; <nl> LEPT_DLL extern l_int32 listJoin ( DLLIST * * phead1 , DLLIST * * phead2 ) ; <nl> LEPT_DLL extern PIX * generateBinaryMaze ( l_int32 w , l_int32 h , l_int32 xi , l_int32 yi , l_float32 wallps , l_float32 ranis ) ; <nl> - LEPT_DLL extern PTA * searchBinaryMaze ( PIX * pixs , l_int32 xi , l_int32 yi , l_int32 xf , l_int32 yf , PIX * * ppixd ) ; <nl> - LEPT_DLL extern PTA * searchGrayMaze ( PIX * pixs , l_int32 xi , l_int32 yi , l_int32 xf , l_int32 yf , PIX * * ppixd ) ; <nl> + LEPT_DLL extern PTA * pixSearchBinaryMaze ( PIX * pixs , l_int32 xi , l_int32 yi , l_int32 xf , l_int32 yf , PIX * * ppixd ) ; <nl> + LEPT_DLL extern PTA * pixSearchGrayMaze ( PIX * pixs , l_int32 xi , l_int32 yi , l_int32 xf , l_int32 yf , PIX * * ppixd ) ; <nl> LEPT_DLL extern PIX * pixDisplayPta ( PIX * pixs , PTA * pta ) ; <nl> LEPT_DLL extern PIX * pixDisplayPtaa ( PIX * pixs , PTAA * ptaa ) ; <nl> LEPT_DLL extern PIX * pixDilate ( PIX * pixd , PIX * pixs , SEL * sel ) ; <nl> LEPT_DLL extern PIX * pixDilateCompBrickDwa ( PIX * pixd , PIX * pixs , l_int32 hsiz <nl> LEPT_DLL extern PIX * pixErodeCompBrickDwa ( PIX * pixd , PIX * pixs , l_int32 hsize , l_int32 vsize ) ; <nl> LEPT_DLL extern PIX * pixOpenCompBrickDwa ( PIX * pixd , PIX * pixs , l_int32 hsize , l_int32 vsize ) ; <nl> LEPT_DLL extern PIX * pixCloseCompBrickDwa ( PIX * pixd , PIX * pixs , l_int32 hsize , l_int32 vsize ) ; <nl> + LEPT_DLL extern PIX * pixDilateCompBrickExtendDwa ( PIX * pixd , PIX * pixs , l_int32 hsize , l_int32 vsize ) ; <nl> + LEPT_DLL extern PIX * pixErodeCompBrickExtendDwa ( PIX * pixd , PIX * pixs , l_int32 hsize , l_int32 vsize ) ; <nl> + LEPT_DLL extern PIX * pixOpenCompBrickExtendDwa ( PIX * pixd , PIX * pixs , l_int32 hsize , l_int32 vsize ) ; <nl> + LEPT_DLL extern PIX * pixCloseCompBrickExtendDwa ( PIX * pixd , PIX * pixs , l_int32 hsize , l_int32 vsize ) ; <nl> + LEPT_DLL extern l_int32 getExtendedCompositeParameters ( l_int32 size , l_int32 * pn , l_int32 * pextra , l_int32 * pactualsize ) ; <nl> LEPT_DLL extern PIX * pixMorphSequence ( PIX * pixs , const char * sequence , l_int32 dispsep ) ; <nl> LEPT_DLL extern PIX * pixMorphCompSequence ( PIX * pixs , const char * sequence , l_int32 dispsep ) ; <nl> LEPT_DLL extern PIX * pixMorphSequenceDwa ( PIX * pixs , const char * sequence , l_int32 dispsep ) ; <nl> LEPT_DLL extern l_int32 numaSetCount ( NUMA * na , l_int32 newcount ) ; <nl> LEPT_DLL extern l_int32 numaGetFValue ( NUMA * na , l_int32 index , l_float32 * pval ) ; <nl> LEPT_DLL extern l_int32 numaGetIValue ( NUMA * na , l_int32 index , l_int32 * pival ) ; <nl> LEPT_DLL extern l_int32 numaSetValue ( NUMA * na , l_int32 index , l_float32 val ) ; <nl> + LEPT_DLL extern l_int32 numaShiftValue ( NUMA * na , l_int32 index , l_float32 diff ) ; <nl> LEPT_DLL extern l_int32 * numaGetIArray ( NUMA * na ) ; <nl> LEPT_DLL extern l_float32 * numaGetFArray ( NUMA * na , l_int32 copyflag ) ; <nl> LEPT_DLL extern l_int32 numaGetRefcount ( NUMA * na ) ; <nl> LEPT_DLL extern l_int32 pixColorGrayCmap ( PIX * pixs , BOX * box , l_int32 type , l_ <nl> LEPT_DLL extern l_int32 addColorizedGrayToCmap ( PIXCMAP * cmap , l_int32 type , l_int32 rval , l_int32 gval , l_int32 bval , NUMA * * pna ) ; <nl> LEPT_DLL extern l_int32 pixSetSelectMaskedCmap ( PIX * pixs , PIX * pixm , l_int32 x , l_int32 y , l_int32 sindex , l_int32 rval , l_int32 gval , l_int32 bval ) ; <nl> LEPT_DLL extern l_int32 pixSetMaskedCmap ( PIX * pixs , PIX * pixm , l_int32 x , l_int32 y , l_int32 rval , l_int32 gval , l_int32 bval ) ; <nl> - LEPT_DLL extern char * parseForProtos ( const char * filein ) ; <nl> + LEPT_DLL extern char * parseForProtos ( const char * filein , const char * prestring ) ; <nl> LEPT_DLL extern BOXA * boxaGetWhiteblocks ( BOXA * boxas , BOX * box , l_int32 sortflag , l_int32 maxboxes , l_float32 maxoverlap , l_int32 maxperim , l_float32 fract , l_int32 maxpops ) ; <nl> LEPT_DLL extern BOXA * boxaPruneSortedOnOverlap ( BOXA * boxas , l_float32 maxoverlap ) ; <nl> LEPT_DLL extern void setPixMemoryManager ( void * ( allocator ( size_t ) ) , void ( deallocator ( void * ) ) ) ; <nl> LEPT_DLL extern l_int32 pixSetPadBitsBand ( PIX * pix , l_int32 by , l_int32 bh , l_ <nl> LEPT_DLL extern l_int32 pixSetOrClearBorder ( PIX * pixs , l_int32 left , l_int32 right , l_int32 top , l_int32 bot , l_int32 op ) ; <nl> LEPT_DLL extern l_int32 pixSetBorderVal ( PIX * pixs , l_int32 left , l_int32 right , l_int32 top , l_int32 bot , l_uint32 val ) ; <nl> LEPT_DLL extern l_int32 pixSetMirroredBorder ( PIX * pixs , l_int32 left , l_int32 right , l_int32 top , l_int32 bot ) ; <nl> + LEPT_DLL extern PIX * pixCopyBorder ( PIX * pixd , PIX * pixs , l_int32 left , l_int32 right , l_int32 top , l_int32 bot ) ; <nl> LEPT_DLL extern PIX * pixAddBorder ( PIX * pixs , l_int32 npix , l_uint32 val ) ; <nl> LEPT_DLL extern PIX * pixAddBorderGeneral ( PIX * pixs , l_int32 left , l_int32 right , l_int32 top , l_int32 bot , l_uint32 val ) ; <nl> LEPT_DLL extern PIX * pixRemoveBorder ( PIX * pixs , l_int32 npix ) ; <nl> LEPT_DLL extern PIX * pixRemoveBorderGeneral ( PIX * pixs , l_int32 left , l_int32 right , l_int32 top , l_int32 bot ) ; <nl> LEPT_DLL extern PIX * pixAddMirroredBorder ( PIX * pixs , l_int32 left , l_int32 right , l_int32 top , l_int32 bot ) ; <nl> + LEPT_DLL extern PIX * pixAddRepeatedBorder ( PIX * pixs , l_int32 left , l_int32 right , l_int32 top , l_int32 bot ) ; <nl> + LEPT_DLL extern PIX * pixAddMixedBorder ( PIX * pixs , l_int32 left , l_int32 right , l_int32 top , l_int32 bot ) ; <nl> LEPT_DLL extern PIX * pixCreateRGBImage ( PIX * pixr , PIX * pixg , PIX * pixb ) ; <nl> LEPT_DLL extern PIX * pixGetRGBComponent ( PIX * pixs , l_int32 color ) ; <nl> LEPT_DLL extern l_int32 pixSetRGBComponent ( PIX * pixd , PIX * pixs , l_int32 color ) ; <nl> LEPT_DLL extern void extractRGBValues ( l_uint32 pixel , l_int32 * prval , l_int32 <nl> LEPT_DLL extern l_int32 pixGetRGBLine ( PIX * pixs , l_int32 row , l_uint8 * bufr , l_uint8 * bufg , l_uint8 * bufb ) ; <nl> LEPT_DLL extern PIX * pixEndianByteSwapNew ( PIX * pixs ) ; <nl> LEPT_DLL extern l_int32 pixEndianByteSwap ( PIX * pixs ) ; <nl> + LEPT_DLL extern l_int32 lineEndianByteSwap ( l_uint32 * datad , l_uint32 * datas , l_int32 wpl ) ; <nl> LEPT_DLL extern PIX * pixEndianTwoByteSwapNew ( PIX * pixs ) ; <nl> LEPT_DLL extern l_int32 pixEndianTwoByteSwap ( PIX * pixs ) ; <nl> LEPT_DLL extern l_int32 pixSetMasked ( PIX * pixd , PIX * pixm , l_uint32 val ) ; <nl> LEPT_DLL extern NUMA * pixCountPixelsByRow ( PIX * pix , l_int32 * tab8 ) ; <nl> LEPT_DLL extern l_int32 pixThresholdPixels ( PIX * pix , l_int32 thresh , l_int32 * pabove , l_int32 * tab8 ) ; <nl> LEPT_DLL extern l_int32 * makePixelSumTab8 ( void ) ; <nl> LEPT_DLL extern l_int32 * makePixelCentroidTab8 ( void ) ; <nl> + LEPT_DLL extern l_int32 pixSumPixelValues ( PIX * pix , BOX * box , l_float64 * psum ) ; <nl> LEPT_DLL extern PIX * pixMirroredTiling ( PIX * pixs , l_int32 w , l_int32 h ) ; <nl> LEPT_DLL extern NUMA * pixGetGrayHistogram ( PIX * pixs , l_int32 factor ) ; <nl> LEPT_DLL extern NUMA * pixGetGrayHistogramMasked ( PIX * pixs , PIX * pixm , l_int32 x , l_int32 y , l_int32 factor ) ; <nl> LEPT_DLL extern l_int32 pixGetAverageMasked ( PIX * pixs , PIX * pixm , l_int32 x , l <nl> LEPT_DLL extern l_int32 pixGetAverageTiledRGB ( PIX * pixs , l_int32 sx , l_int32 sy , l_int32 type , PIX * * ppixr , PIX * * ppixg , PIX * * ppixb ) ; <nl> LEPT_DLL extern PIX * pixGetAverageTiled ( PIX * pixs , l_int32 sx , l_int32 sy , l_int32 type ) ; <nl> LEPT_DLL extern l_int32 pixGetExtremeValue ( PIX * pixs , l_int32 factor , l_int32 type , l_int32 * prval , l_int32 * pgval , l_int32 * pbval , l_int32 * pgrayval ) ; <nl> + LEPT_DLL extern l_int32 pixGetMaxValueInRect ( PIX * pixs , BOX * box , l_uint32 * pmaxval , l_int32 * pxmax , l_int32 * pymax ) ; <nl> LEPT_DLL extern PIX * pixaGetAlignedStats ( PIXA * pixa , l_int32 type , l_int32 nbins , l_int32 thresh ) ; <nl> LEPT_DLL extern l_int32 pixaExtractColumnFromEachPix ( PIXA * pixa , l_int32 col , PIX * pixd ) ; <nl> LEPT_DLL extern l_int32 pixGetRowStats ( PIX * pixs , l_int32 type , l_int32 nbins , l_int32 thresh , l_float32 * colvect ) ; <nl> LEPT_DLL extern PIX * pixaDisplayTiledAndScaled ( PIXA * pixa , l_int32 outdepth , <nl> LEPT_DLL extern PIX * pixaaDisplay ( PIXAA * pixaa , l_int32 w , l_int32 h ) ; <nl> LEPT_DLL extern PIX * pixaaDisplayByPixa ( PIXAA * pixaa , l_int32 xspace , l_int32 yspace , l_int32 maxw ) ; <nl> LEPT_DLL extern PIXA * pixaaDisplayTiledAndScaled ( PIXAA * pixaa , l_int32 outdepth , l_int32 tilewidth , l_int32 ncols , l_int32 background , l_int32 spacing , l_int32 border ) ; <nl> + LEPT_DLL extern l_int32 pmsCreate ( size_t minsize , size_t smallest , NUMA * numalloc , const char * logfile ) ; <nl> + LEPT_DLL extern void pmsDestroy ( ) ; <nl> + LEPT_DLL extern void * pmsCustomAlloc ( size_t nbytes ) ; <nl> + LEPT_DLL extern void pmsCustomDealloc ( void * data ) ; <nl> + LEPT_DLL extern void * pmsGetAlloc ( size_t nbytes ) ; <nl> + LEPT_DLL extern l_int32 pmsGetLevelForAlloc ( size_t nbytes , l_int32 * plevel ) ; <nl> + LEPT_DLL extern l_int32 pmsGetLevelForDealloc ( void * data , l_int32 * plevel ) ; <nl> + LEPT_DLL extern void pmsLogInfo ( ) ; <nl> LEPT_DLL extern l_int32 pixAddConstantGray ( PIX * pixs , l_int32 val ) ; <nl> LEPT_DLL extern l_int32 pixMultConstantGray ( PIX * pixs , l_float32 val ) ; <nl> LEPT_DLL extern PIX * pixAddGray ( PIX * pixd , PIX * pixs1 , PIX * pixs2 ) ; <nl> LEPT_DLL extern PIX * pixConvert1To4 ( PIX * pixd , PIX * pixs , l_int32 val0 , l_int <nl> LEPT_DLL extern PIX * pixConvert1To8 ( PIX * pixd , PIX * pixs , l_uint8 val0 , l_uint8 val1 ) ; <nl> LEPT_DLL extern PIX * pixConvert2To8 ( PIX * pixs , l_uint8 val0 , l_uint8 val1 , l_uint8 val2 , l_uint8 val3 , l_int32 cmapflag ) ; <nl> LEPT_DLL extern PIX * pixConvert4To8 ( PIX * pixs , l_int32 cmapflag ) ; <nl> + LEPT_DLL extern PIX * pixConvert8To16 ( PIX * pixs , l_int32 leftshift ) ; <nl> LEPT_DLL extern PIX * pixConvertTo1 ( PIX * pixs , l_int32 threshold ) ; <nl> LEPT_DLL extern PIX * pixConvertTo1BySampling ( PIX * pixs , l_int32 factor , l_int32 threshold ) ; <nl> LEPT_DLL extern PIX * pixConvertTo8 ( PIX * pixs , l_int32 cmapflag ) ; <nl> LEPT_DLL extern PIX * pixConvertTo8BySampling ( PIX * pixs , l_int32 factor , l_int32 cmapflag ) ; <nl> + LEPT_DLL extern PIX * pixConvertTo16 ( PIX * pixs ) ; <nl> LEPT_DLL extern PIX * pixConvertTo32 ( PIX * pixs ) ; <nl> LEPT_DLL extern PIX * pixConvertTo32BySampling ( PIX * pixs , l_int32 factor ) ; <nl> LEPT_DLL extern PIX * pixConvert8To32 ( PIX * pixs ) ; <nl> + LEPT_DLL extern PIX * pixConvertTo8Or32 ( PIX * pixs , l_int32 copyflag , l_int32 warnflag ) ; <nl> LEPT_DLL extern PIX * pixConvertLossless ( PIX * pixs , l_int32 d ) ; <nl> LEPT_DLL extern PIX * pixConvertForPSWrap ( PIX * pixs ) ; <nl> LEPT_DLL extern PIX * pixConvertRGBToHSV ( PIX * pixd , PIX * pixs ) ; <nl> LEPT_DLL extern PIX * pixConvertHSVToRGB ( PIX * pixd , PIX * pixs ) ; <nl> LEPT_DLL extern l_int32 convertRGBToHSV ( l_int32 rval , l_int32 gval , l_int32 bval , l_int32 * phval , l_int32 * psval , l_int32 * pvval ) ; <nl> LEPT_DLL extern l_int32 convertHSVToRGB ( l_int32 hval , l_int32 sval , l_int32 vval , l_int32 * prval , l_int32 * pgval , l_int32 * pbval ) ; <nl> LEPT_DLL extern PIX * pixConvertRGBToHue ( PIX * pixs ) ; <nl> + LEPT_DLL extern PIX * pixConvertRGBToSaturation ( PIX * pixs ) ; <nl> + LEPT_DLL extern PIX * pixConvertRGBToValue ( PIX * pixs ) ; <nl> LEPT_DLL extern PIXTILING * pixTilingCreate ( PIX * pixs , l_int32 nx , l_int32 ny , l_int32 w , l_int32 h , l_int32 xoverlap , l_int32 yoverlap ) ; <nl> LEPT_DLL extern void pixTilingDestroy ( PIXTILING * * ppt ) ; <nl> LEPT_DLL extern l_int32 pixTilingGetCount ( PIXTILING * pt , l_int32 * pnx , l_int32 * pny ) ; <nl> LEPT_DLL extern l_int32 freadHeaderPng ( FILE * fp , l_int32 * pwidth , l_int32 * phe <nl> LEPT_DLL extern l_int32 sreadHeaderPng ( const l_uint8 * data , l_int32 * pwidth , l_int32 * pheight , l_int32 * pbpc , l_int32 * pcpp , l_int32 * piscmap ) ; <nl> LEPT_DLL extern l_int32 pixWritePng ( const char * filename , PIX * pix , l_float32 gamma ) ; <nl> LEPT_DLL extern l_int32 pixWriteStreamPng ( FILE * fp , PIX * pix , l_float32 gamma ) ; <nl> + LEPT_DLL extern void l_pngSetStrip16To8 ( l_int32 flag ) ; <nl> + LEPT_DLL extern void l_pngSetStripAlpha ( l_int32 flag ) ; <nl> + LEPT_DLL extern void l_pngSetZlibCompression ( l_int32 val ) ; <nl> LEPT_DLL extern PIX * pixReadMemPng ( const l_uint8 * cdata , size_t size ) ; <nl> LEPT_DLL extern l_int32 pixWriteMemPng ( l_uint8 * * pdata , size_t * psize , PIX * pix , l_float32 gamma ) ; <nl> LEPT_DLL extern PIX * pixReadStreamPnm ( FILE * fp ) ; <nl> LEPT_DLL extern l_int32 convertFilesToPS ( const char * dirin , const char * substr <nl> LEPT_DLL extern l_int32 sarrayConvertFilesToPS ( SARRAY * sa , l_int32 res , const char * fileout ) ; <nl> LEPT_DLL extern l_int32 convertFilesFittedToPS ( const char * dirin , const char * substr , l_float32 xpts , l_float32 ypts , const char * fileout ) ; <nl> LEPT_DLL extern l_int32 sarrayConvertFilesFittedToPS ( SARRAY * sa , l_float32 xpts , l_float32 ypts , const char * fileout ) ; <nl> + LEPT_DLL extern l_int32 convertSegmentedPagesToPS ( const char * pagedir , const char * maskdir , l_float32 textscale , l_float32 imagescale , l_int32 threshold , l_int32 numpre , l_int32 numpost , const char * fileout ) ; <nl> + LEPT_DLL extern l_int32 pixWriteSegmentedPageToPS ( PIX * pixs , PIX * pixm , l_float32 textscale , l_float32 imagescale , l_int32 threshold , l_int32 pageno , const char * fileout ) ; <nl> + LEPT_DLL extern l_int32 pixWriteMixedToPS ( PIX * pixb , PIX * pixc , l_float32 scale , l_int32 pageno , const char * fileout ) ; <nl> + LEPT_DLL extern NUMA * sarrayFindMaskAndPagePairings ( SARRAY * sapage , SARRAY * samask , l_int32 numpre , l_int32 numpost , l_int32 maxnum ) ; <nl> LEPT_DLL extern l_int32 convertToPSEmbed ( const char * filein , const char * fileout , l_int32 level ) ; <nl> LEPT_DLL extern l_int32 pixWritePSEmbed ( const char * filein , const char * fileout ) ; <nl> LEPT_DLL extern l_int32 pixWriteStreamPS ( FILE * fp , PIX * pix , BOX * box , l_int32 res , l_float32 scale ) ; <nl> LEPT_DLL extern char * encodeAscii85 ( l_uint8 * inarray , l_int32 insize , l_int32 <nl> LEPT_DLL extern l_int32 convertChunkToAscii85 ( l_uint8 * inarray , l_int32 insize , l_int32 * pindex , char * outbuf , l_int32 * pnbout ) ; <nl> LEPT_DLL extern l_uint8 * decodeAscii85 ( char * ina , l_int32 insize , l_int32 * poutsize ) ; <nl> LEPT_DLL extern L_PTRA * ptraCreate ( l_int32 n ) ; <nl> - LEPT_DLL extern void ptraDestroy ( L_PTRA * * ppa , l_int32 freeflag ) ; <nl> + LEPT_DLL extern void ptraDestroy ( L_PTRA * * ppa , l_int32 freeflag , l_int32 warnflag ) ; <nl> LEPT_DLL extern l_int32 ptraAdd ( L_PTRA * pa , void * item ) ; <nl> LEPT_DLL extern l_int32 ptraExtendArray ( L_PTRA * pa ) ; <nl> LEPT_DLL extern l_int32 ptraInsert ( L_PTRA * pa , l_int32 index , void * item , l_int32 shiftflag ) ; <nl> LEPT_DLL extern void * ptraGetHandle ( L_PTRA * pa , l_int32 index ) ; <nl> LEPT_DLL extern void * ptraRemove ( L_PTRA * pa , l_int32 index , l_int32 flag ) ; <nl> + LEPT_DLL extern void * ptraRemoveLast ( L_PTRA * pa ) ; <nl> LEPT_DLL extern void * ptraReplace ( L_PTRA * pa , l_int32 index , void * item , l_int32 freeflag ) ; <nl> LEPT_DLL extern l_int32 ptraSwap ( L_PTRA * pa , l_int32 index1 , l_int32 index2 ) ; <nl> LEPT_DLL extern l_int32 ptraCompactArray ( L_PTRA * pa ) ; <nl> LEPT_DLL extern l_int32 ptraGetMaxIndex ( L_PTRA * pa , l_int32 * pmaxindex ) ; <nl> LEPT_DLL extern l_int32 ptraGetActualCount ( L_PTRA * pa , l_int32 * pcount ) ; <nl> LEPT_DLL extern void * ptraGetPtrToItem ( L_PTRA * pa , l_int32 index ) ; <nl> LEPT_DLL extern L_PTRAA * ptraaCreate ( l_int32 n ) ; <nl> - LEPT_DLL extern void ptraaDestroy ( L_PTRAA * * ppaa , l_int32 freeflag ) ; <nl> + LEPT_DLL extern void ptraaDestroy ( L_PTRAA * * ppaa , l_int32 freeflag , l_int32 warnflag ) ; <nl> LEPT_DLL extern l_int32 ptraaGetSize ( L_PTRAA * paa , l_int32 * psize ) ; <nl> LEPT_DLL extern l_int32 ptraaInsertPtra ( L_PTRAA * paa , l_int32 index , L_PTRA * pa ) ; <nl> LEPT_DLL extern L_PTRA * ptraaGetPtra ( L_PTRAA * paa , l_int32 index , l_int32 accessflag ) ; <nl> LEPT_DLL extern SARRAY * sarrayReadStream ( FILE * fp ) ; <nl> LEPT_DLL extern l_int32 sarrayWrite ( const char * filename , SARRAY * sa ) ; <nl> LEPT_DLL extern l_int32 sarrayWriteStream ( FILE * fp , SARRAY * sa ) ; <nl> LEPT_DLL extern l_int32 sarrayAppend ( const char * filename , SARRAY * sa ) ; <nl> + LEPT_DLL extern SARRAY * getSortedPathnamesInDirectory ( const char * dirname , const char * substr , l_int32 firstpage , l_int32 npages ) ; <nl> + LEPT_DLL extern SARRAY * getFilenamesInDirectory ( const char * dirname ) ; <nl> LEPT_DLL extern PIX * pixScale ( PIX * pixs , l_float32 scalex , l_float32 scaley ) ; <nl> - LEPT_DLL extern PIX * pixScaleLI ( PIX * pix , l_float32 scalex , l_float32 scaley ) ; <nl> + LEPT_DLL extern PIX * pixScaleGeneral ( PIX * pixs , l_float32 scalex , l_float32 scaley , l_float32 sharpfract , l_int32 sharpwidth ) ; <nl> + LEPT_DLL extern PIX * pixScaleLI ( PIX * pixs , l_float32 scalex , l_float32 scaley ) ; <nl> LEPT_DLL extern PIX * pixScaleColorLI ( PIX * pixs , l_float32 scalex , l_float32 scaley ) ; <nl> LEPT_DLL extern PIX * pixScaleColor2xLI ( PIX * pixs ) ; <nl> LEPT_DLL extern PIX * pixScaleColor4xLI ( PIX * pixs ) ; <nl> LEPT_DLL extern FILE * fopenReadStream ( const char * filename ) ; <nl> LEPT_DLL extern l_int32 splitPathAtDirectory ( const char * pathname , char * * pdir , char * * ptail ) ; <nl> LEPT_DLL extern l_int32 splitPathAtExtension ( const char * pathname , char * * pbasename , char * * pextension ) ; <nl> LEPT_DLL extern char * genPathname ( const char * dir , const char * fname ) ; <nl> + LEPT_DLL extern char * genTempFilename ( const char * dir , const char * extension ) ; <nl> + LEPT_DLL extern l_int32 extractNumberFromFilename ( const char * fname , l_int32 numpre , l_int32 numpost ) ; <nl> LEPT_DLL extern void startTimer ( void ) ; <nl> LEPT_DLL extern l_float32 stopTimer ( void ) ; <nl> LEPT_DLL extern l_int32 pixHtmlViewer ( const char * dirin , const char * dirout , const char * rootname , l_int32 thumbwidth , l_int32 viewwidth , l_int32 copyorig ) ; <nl> - LEPT_DLL extern SARRAY * getFilenamesInDirectory ( const char * dirname ) ; <nl> - LEPT_DLL extern SARRAY * getSortedPathnamesInDirectory ( const char * dirname , const char * substr , l_int32 firstpage , l_int32 npages ) ; <nl> LEPT_DLL extern PIX * pixSimpleCaptcha ( PIX * pixs , l_int32 border , l_int32 nterms , l_uint32 seed , l_uint32 color , l_int32 cmapflag ) ; <nl> LEPT_DLL extern PIX * pixRandomHarmonicWarp ( PIX * pixs , l_float32 xmag , l_float32 ymag , l_float32 xfreq , l_float32 yfreq , l_int32 nx , l_int32 ny , l_uint32 seed , l_int32 grayval ) ; <nl> LEPT_DLL extern L_WSHED * wshedCreate ( PIX * pixs , PIX * pixm , l_int32 mindepth , l_int32 debugflag ) ; <nl> mmm a / include / morph . h <nl> ppp b / include / morph . h <nl> enum { <nl> <nl> / * mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - * <nl> * Direction flags for grayscale morphology , granulometry , * <nl> - * and composable Sels * <nl> + * composable Sels , and convolution * <nl> * mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - * / <nl> enum { <nl> - L_HORIZ = 1 , <nl> - L_VERT = 2 <nl> + L_HORIZ = 1 , <nl> + L_VERT = 2 , <nl> + L_BOTH_DIRECTIONS = 3 <nl> } ; <nl> <nl> <nl> enum { <nl> * Min / max selection flags * <nl> * mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - * / <nl> enum { <nl> - L_CHOOSE_MIN = 1 , <nl> - L_CHOOSE_MAX = 2 <nl> + L_CHOOSE_MIN = 1 , / * useful in a downscaling " erosion " * / <nl> + L_CHOOSE_MAX = 2 , / * useful in a downscaling " dilation " * / <nl> + L_CHOOSE_MAX_MIN_DIFF = 3 / * useful in a downscaling contrast * / <nl> } ; <nl> <nl> <nl> mmm a / include / pix . h <nl> ppp b / include / pix . h <nl> <nl> * edge filter flags <nl> * handling negative values in conversion to unsigned int <nl> * relative to zero flags <nl> + * HSV histogram flags <nl> + * region flags ( inclusion , exclusion ) <nl> * / <nl> <nl> <nl> enum { <nl> } ; <nl> <nl> <nl> + / * mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - * <nl> + * HSV histogram flags * <nl> + * mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - * / <nl> + enum { <nl> + L_HS_HISTO = 1 , / * Use hue - saturation histogram * / <nl> + L_HV_HISTO = 2 , / * Use hue - value histogram * / <nl> + L_SV_HISTO = 3 / * Use saturation - value histogram * / <nl> + } ; <nl> + <nl> + <nl> + / * mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - * <nl> + * Region flags ( inclusion , exclusion ) * <nl> + * mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - * / <nl> + enum { <nl> + L_INCLUDE_REGION = 1 , / * Use hue - saturation histogram * / <nl> + L_EXCLUDE_REGION = 2 / * Use hue - value histogram * / <nl> + } ; <nl> + <nl> + <nl> # endif / * LEPTONICA_PIX_H * / <nl> <nl>
Udated leptonica includes to 1 . 62
tesseract-ocr/tesseract
b8621e7818067f56e3a270648541fabf91e8776a
2010-05-19T18:11:41Z
mmm a / android / service / engine / AndroidManifest . xml <nl> ppp b / android / service / engine / AndroidManifest . xml <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < manifest xmlns : android = " http : / / schemas . android . com / apk / res / android " <nl> package = " org . opencv . engine " <nl> - android : versionCode = " 12 " <nl> - android : versionName = " 1 . 2 " > <nl> + android : versionCode = " 13 " <nl> + android : versionName = " 1 . 3 " > <nl> <nl> < uses - sdk android : minSdkVersion = " 8 " / > <nl> < uses - feature android : name = " android . hardware . touchscreen " android : required = " false " / > <nl> mmm a / android / service / engine / jni / Android . mk <nl> ppp b / android / service / engine / jni / Android . mk <nl> LOCAL_C_INCLUDES : = \ <nl> <nl> LOCAL_CFLAGS + = - DPLATFORM_ANDROID <nl> LOCAL_CFLAGS + = - D__SUPPORT_ARMEABI_V7A_FEATURES <nl> - # LOCAL_CFLAGS + = - D__SUPPORT_TEGRA3 <nl> + LOCAL_CFLAGS + = - D__SUPPORT_TEGRA3 <nl> # LOCAL_CFLAGS + = - D__SUPPORT_ARMEABI_FEATURES <nl> <nl> LOCAL_PRELINK_MODULE : = false <nl> LOCAL_PRELINK_MODULE : = false <nl> <nl> LOCAL_CFLAGS + = - DPLATFORM_ANDROID <nl> LOCAL_CFLAGS + = - D__SUPPORT_ARMEABI_V7A_FEATURES <nl> - # LOCAL_CFLAGS + = - D__SUPPORT_TEGRA3 <nl> + LOCAL_CFLAGS + = - D__SUPPORT_TEGRA3 <nl> # LOCAL_CFLAGS + = - D__SUPPORT_ARMEABI_FEATURES <nl> <nl> LOCAL_MODULE : = libOpenCVEngine_jni <nl> mmm a / android / service / engine / jni / Tests / Tests . mk <nl> ppp b / android / service / engine / jni / Tests / Tests . mk <nl> LOCAL_C_INCLUDES : = \ <nl> <nl> LOCAL_CFLAGS + = - O0 - DGTEST_HAS_CLONE = 0 - DGTEST_OS_LINUX_ANDROID = 1 - DGTEST_HAS_TR1_TUPLE = 0 <nl> LOCAL_CFLAGS + = - D__SUPPORT_ARMEABI_V7A_FEATURES <nl> - # LOCAL_CFLAGS + = - D__SUPPORT_TEGRA3 <nl> + LOCAL_CFLAGS + = - D__SUPPORT_TEGRA3 <nl> # LOCAL_CFLAGS + = - D__SUPPORT_ARMEABI_FEATURES <nl> <nl> LOCAL_LDFLAGS = - Wl , - allow - shlib - undefined <nl>
Tegra3 package support enabled ;
opencv/opencv
ddcc83951911e9070ea74e6df2a8b467ffb2f27c
2012-07-16T07:56:12Z
mmm a / src / objective - c / GRPCClient / GRPCCall . m <nl> ppp b / src / objective - c / GRPCClient / GRPCCall . m <nl> - ( void ) startCallWithWriteable : ( id < GRXWriteable > ) writeable { <nl> <nl> [ self sendHeaders ] ; <nl> [ self invokeCall ] ; <nl> - <nl> - / / Connectivity monitor is not required for CFStream <nl> - char * enableCFStream = getenv ( kCFStreamVarName ) ; <nl> } <nl> <nl> / / Now that the RPC has been initiated , request writes can start . <nl> mmm a / src / objective - c / GRPCClient / private / GRPCChannelPool . m <nl> ppp b / src / objective - c / GRPCClient / private / GRPCChannelPool . m <nl> + ( instancetype ) sharedInstance { <nl> - ( instancetype ) initPrivate { <nl> if ( ( self = [ super init ] ) ) { <nl> _channelPool = [ NSMutableDictionary dictionary ] ; <nl> - <nl> - / / Connectivity monitor is not required for CFStream <nl> - char * enableCFStream = getenv ( kCFStreamVarName ) ; <nl> } <nl> return self ; <nl> } <nl>
Removed unused variable enableCFStream
grpc/grpc
dfca76905d152477460b8e33e8249ce6a4c8f27f
2019-07-17T01:32:01Z
mmm a / tensorflow / core / ops / compat / ops_history . v1 . pbtxt <nl> ppp b / tensorflow / core / ops / compat / ops_history . v1 . pbtxt <nl> op { <nl> } <nl> is_stateful : true <nl> } <nl> + op { <nl> + name : " StatefulStandardNormal " <nl> + input_arg { <nl> + name : " resource " <nl> + type : DT_RESOURCE <nl> + } <nl> + input_arg { <nl> + name : " shape " <nl> + type_attr : " shape_dtype " <nl> + } <nl> + output_arg { <nl> + name : " output " <nl> + type_attr : " dtype " <nl> + } <nl> + attr { <nl> + name : " dtype " <nl> + type : " type " <nl> + default_value { <nl> + type : DT_FLOAT <nl> + } <nl> + } <nl> + attr { <nl> + name : " shape_dtype " <nl> + type : " type " <nl> + default_value { <nl> + type : DT_INT64 <nl> + } <nl> + } <nl> + deprecation { <nl> + version : 29 <nl> + } <nl> + is_stateful : true <nl> + } <nl> op { <nl> name : " StatefulStandardNormalV2 " <nl> input_arg { <nl> op { <nl> } <nl> is_stateful : true <nl> } <nl> + op { <nl> + name : " StatefulTruncatedNormal " <nl> + input_arg { <nl> + name : " resource " <nl> + type : DT_RESOURCE <nl> + } <nl> + input_arg { <nl> + name : " algorithm " <nl> + type : DT_INT64 <nl> + } <nl> + input_arg { <nl> + name : " shape " <nl> + type_attr : " shape_dtype " <nl> + } <nl> + output_arg { <nl> + name : " output " <nl> + type_attr : " dtype " <nl> + } <nl> + attr { <nl> + name : " dtype " <nl> + type : " type " <nl> + default_value { <nl> + type : DT_FLOAT <nl> + } <nl> + } <nl> + attr { <nl> + name : " shape_dtype " <nl> + type : " type " <nl> + default_value { <nl> + type : DT_INT64 <nl> + } <nl> + } <nl> + is_stateful : true <nl> + } <nl> + op { <nl> + name : " StatefulUniform " <nl> + input_arg { <nl> + name : " resource " <nl> + type : DT_RESOURCE <nl> + } <nl> + input_arg { <nl> + name : " algorithm " <nl> + type : DT_INT64 <nl> + } <nl> + input_arg { <nl> + name : " shape " <nl> + type_attr : " shape_dtype " <nl> + } <nl> + output_arg { <nl> + name : " output " <nl> + type_attr : " dtype " <nl> + } <nl> + attr { <nl> + name : " dtype " <nl> + type : " type " <nl> + default_value { <nl> + type : DT_FLOAT <nl> + } <nl> + } <nl> + attr { <nl> + name : " shape_dtype " <nl> + type : " type " <nl> + default_value { <nl> + type : DT_INT64 <nl> + } <nl> + } <nl> + is_stateful : true <nl> + } <nl> op { <nl> name : " StatefulUniformFullInt " <nl> input_arg { <nl> mmm a / tensorflow / core / ops / ops . pbtxt <nl> ppp b / tensorflow / core / ops / ops . pbtxt <nl> op { <nl> type : DT_INT64 <nl> } <nl> } <nl> + deprecation { <nl> + version : 29 <nl> + explanation : " Use StatefulStandardNormalV2 instead " <nl> + } <nl> is_stateful : true <nl> } <nl> op { <nl> op { <nl> } <nl> is_stateful : true <nl> } <nl> + op { <nl> + name : " StatefulTruncatedNormal " <nl> + input_arg { <nl> + name : " resource " <nl> + type : DT_RESOURCE <nl> + } <nl> + input_arg { <nl> + name : " algorithm " <nl> + type : DT_INT64 <nl> + } <nl> + input_arg { <nl> + name : " shape " <nl> + type_attr : " shape_dtype " <nl> + } <nl> + output_arg { <nl> + name : " output " <nl> + type_attr : " dtype " <nl> + } <nl> + attr { <nl> + name : " dtype " <nl> + type : " type " <nl> + default_value { <nl> + type : DT_FLOAT <nl> + } <nl> + } <nl> + attr { <nl> + name : " shape_dtype " <nl> + type : " type " <nl> + default_value { <nl> + type : DT_INT64 <nl> + } <nl> + } <nl> + is_stateful : true <nl> + } <nl> + op { <nl> + name : " StatefulUniform " <nl> + input_arg { <nl> + name : " resource " <nl> + type : DT_RESOURCE <nl> + } <nl> + input_arg { <nl> + name : " algorithm " <nl> + type : DT_INT64 <nl> + } <nl> + input_arg { <nl> + name : " shape " <nl> + type_attr : " shape_dtype " <nl> + } <nl> + output_arg { <nl> + name : " output " <nl> + type_attr : " dtype " <nl> + } <nl> + attr { <nl> + name : " dtype " <nl> + type : " type " <nl> + default_value { <nl> + type : DT_FLOAT <nl> + } <nl> + } <nl> + attr { <nl> + name : " shape_dtype " <nl> + type : " type " <nl> + default_value { <nl> + type : DT_INT64 <nl> + } <nl> + } <nl> + is_stateful : true <nl> + } <nl> op { <nl> name : " StatefulUniformFullInt " <nl> input_arg { <nl>
Update ops - related pbtxt files .
tensorflow/tensorflow
59dd2f13605959823a4bf0e46af7ec0d4a2e0840
2019-03-27T23:29:18Z
mmm a / docs / Parameters . rst <nl> ppp b / docs / Parameters . rst <nl> IO Parameters <nl> <nl> - the threshold of margin in early - stopping prediction <nl> <nl> + - ` ` predict_disable_shape_check ` ` : raw - html : ` < a id = " predict_disable_shape_check " title = " Permalink to this parameter " href = " # predict_disable_shape_check " > & # x1F517 ; & # xFE0E ; < / a > ` , default = ` ` false ` ` , type = bool <nl> + <nl> + - used only in ` ` prediction ` ` task <nl> + <nl> + - control whether or not LightGBM raises an error when you try to predict on data with a different number of features than the training data <nl> + <nl> + - if ` ` false ` ` ( the default ) , a fatal error will be raised if the number of features in the dataset you predict on differs from the number seen during training <nl> + <nl> + - if ` ` true ` ` , LightGBM will attempt to predict on whatever data you provide . This is dangerous because you might get incorrect predictions , but you could use it in situations where it is difficult or expensive to generate some features and you are very confident that they were never chosen for splits in the model <nl> + <nl> + - * * Note * * : be very careful setting this parameter to ` ` true ` ` <nl> + <nl> - ` ` convert_model_language ` ` : raw - html : ` < a id = " convert_model_language " title = " Permalink to this parameter " href = " # convert_model_language " > & # x1F517 ; & # xFE0E ; < / a > ` , default = ` ` " " ` ` , type = string <nl> <nl> - used only in ` ` convert_model ` ` task <nl> mmm a / include / LightGBM / config . h <nl> ppp b / include / LightGBM / config . h <nl> struct Config { <nl> / / desc = the threshold of margin in early - stopping prediction <nl> double pred_early_stop_margin = 10 . 0 ; <nl> <nl> + / / desc = used only in ` ` prediction ` ` task <nl> + / / desc = control whether or not LightGBM raises an error when you try to predict on data with a different number of features than the training data <nl> + / / desc = if ` ` false ` ` ( the default ) , a fatal error will be raised if the number of features in the dataset you predict on differs from the number seen during training <nl> + / / desc = if ` ` true ` ` , LightGBM will attempt to predict on whatever data you provide . This is dangerous because you might get incorrect predictions , but you could use it in situations where it is difficult or expensive to generate some features and you are very confident that they were never chosen for splits in the model <nl> + / / desc = * * Note * * : be very careful setting this parameter to ` ` true ` ` <nl> + bool predict_disable_shape_check = false ; <nl> + <nl> / / desc = used only in ` ` convert_model ` ` task <nl> / / desc = only ` ` cpp ` ` is supported yet ; for conversion model to other languages consider using ` m2cgen < https : / / github . com / BayesWitnesses / m2cgen > ` __ utility <nl> / / desc = if ` ` convert_model_language ` ` is set and ` ` task = train ` ` , the model will be also converted <nl> mmm a / src / application / application . cpp <nl> ppp b / src / application / application . cpp <nl> void Application : : Predict ( ) { <nl> if ( config_ . task = = TaskType : : KRefitTree ) { <nl> / / create predictor <nl> Predictor predictor ( boosting_ . get ( ) , - 1 , false , true , false , false , 1 , 1 ) ; <nl> - predictor . Predict ( config_ . data . c_str ( ) , config_ . output_result . c_str ( ) , config_ . header ) ; <nl> + predictor . Predict ( config_ . data . c_str ( ) , config_ . output_result . c_str ( ) , config_ . header , config_ . predict_disable_shape_check ) ; <nl> TextReader < int > result_reader ( config_ . output_result . c_str ( ) , false ) ; <nl> result_reader . ReadAllLines ( ) ; <nl> std : : vector < std : : vector < int > > pred_leaf ( result_reader . Lines ( ) . size ( ) ) ; <nl> void Application : : Predict ( ) { <nl> config_ . pred_early_stop , config_ . pred_early_stop_freq , <nl> config_ . pred_early_stop_margin ) ; <nl> predictor . Predict ( config_ . data . c_str ( ) , <nl> - config_ . output_result . c_str ( ) , config_ . header ) ; <nl> + config_ . output_result . c_str ( ) , config_ . header , config_ . predict_disable_shape_check ) ; <nl> Log : : Info ( " Finished prediction " ) ; <nl> } <nl> } <nl> mmm a / src / application / predictor . hpp <nl> ppp b / src / application / predictor . hpp <nl> class Predictor { <nl> * \ param data_filename Filename of data <nl> * \ param result_filename Filename of output result <nl> * / <nl> - void Predict ( const char * data_filename , const char * result_filename , bool header ) { <nl> + void Predict ( const char * data_filename , const char * result_filename , bool header , bool disable_shape_check ) { <nl> auto writer = VirtualFileWriter : : Make ( result_filename ) ; <nl> if ( ! writer - > Init ( ) ) { <nl> Log : : Fatal ( " Prediction results file % s cannot be found " , result_filename ) ; <nl> class Predictor { <nl> if ( parser = = nullptr ) { <nl> Log : : Fatal ( " Could not recognize the data format of data file % s " , data_filename ) ; <nl> } <nl> - if ( ! header & & parser - > NumFeatures ( ) ! = boosting_ - > MaxFeatureIdx ( ) + 1 ) { <nl> - Log : : Fatal ( " The number of features in data ( % d ) is not the same as it was in training data ( % d ) . " , parser - > NumFeatures ( ) , boosting_ - > MaxFeatureIdx ( ) + 1 ) ; <nl> + if ( ! header & & ! disable_shape_check & & parser - > NumFeatures ( ) ! = boosting_ - > MaxFeatureIdx ( ) + 1 ) { <nl> + Log : : Fatal ( " The number of features in data ( % d ) is not the same as it was in training data ( % d ) . \ n " \ <nl> + " You can set ` ` predict_disable_shape_check = true ` ` to discard this error , but please be aware what you are doing . " , parser - > NumFeatures ( ) , boosting_ - > MaxFeatureIdx ( ) + 1 ) ; <nl> } <nl> TextReader < data_size_t > predict_data_reader ( data_filename , header ) ; <nl> std : : vector < int > feature_remapper ( parser - > NumFeatures ( ) , - 1 ) ; <nl> mmm a / src / c_api . cpp <nl> ppp b / src / c_api . cpp <nl> class Booster { <nl> std : : function < std : : vector < std : : pair < int , double > > ( int row_idx ) > get_row_fun , <nl> const Config & config , <nl> double * out_result , int64_t * out_len ) { <nl> - if ( ncol ! = boosting_ - > MaxFeatureIdx ( ) + 1 ) { <nl> - Log : : Fatal ( " The number of features in data ( % d ) is not the same as it was in training data ( % d ) . " , ncol , boosting_ - > MaxFeatureIdx ( ) + 1 ) ; <nl> + if ( ! config . predict_disable_shape_check & & ncol ! = boosting_ - > MaxFeatureIdx ( ) + 1 ) { <nl> + Log : : Fatal ( " The number of features in data ( % d ) is not the same as it was in training data ( % d ) . \ n " \ <nl> + " You can set ` ` predict_disable_shape_check = true ` ` to discard this error , but please be aware what you are doing . " , ncol , boosting_ - > MaxFeatureIdx ( ) + 1 ) ; <nl> } <nl> std : : lock_guard < std : : mutex > lock ( mutex_ ) ; <nl> if ( single_row_predictor_ [ predict_type ] . get ( ) = = nullptr | | <nl> class Booster { <nl> std : : function < std : : vector < std : : pair < int , double > > ( int row_idx ) > get_row_fun , <nl> const Config & config , <nl> double * out_result , int64_t * out_len ) { <nl> - if ( ncol ! = boosting_ - > MaxFeatureIdx ( ) + 1 ) { <nl> - Log : : Fatal ( " The number of features in data ( % d ) is not the same as it was in training data ( % d ) . " , ncol , boosting_ - > MaxFeatureIdx ( ) + 1 ) ; <nl> + if ( ! config . predict_disable_shape_check & & ncol ! = boosting_ - > MaxFeatureIdx ( ) + 1 ) { <nl> + Log : : Fatal ( " The number of features in data ( % d ) is not the same as it was in training data ( % d ) . \ n " \ <nl> + " You can set ` ` predict_disable_shape_check = true ` ` to discard this error , but please be aware what you are doing . " , ncol , boosting_ - > MaxFeatureIdx ( ) + 1 ) ; <nl> } <nl> std : : lock_guard < std : : mutex > lock ( mutex_ ) ; <nl> bool is_predict_leaf = false ; <nl> class Booster { <nl> Predictor predictor ( boosting_ . get ( ) , num_iteration , is_raw_score , is_predict_leaf , predict_contrib , <nl> config . pred_early_stop , config . pred_early_stop_freq , config . pred_early_stop_margin ) ; <nl> bool bool_data_has_header = data_has_header > 0 ? true : false ; <nl> - predictor . Predict ( data_filename , result_filename , bool_data_has_header ) ; <nl> + predictor . Predict ( data_filename , result_filename , bool_data_has_header , config . predict_disable_shape_check ) ; <nl> } <nl> <nl> void GetPredictAt ( int data_idx , double * out_result , int64_t * out_len ) { <nl> mmm a / src / io / config_auto . cpp <nl> ppp b / src / io / config_auto . cpp <nl> std : : unordered_set < std : : string > Config : : parameter_set ( { <nl> " pred_early_stop " , <nl> " pred_early_stop_freq " , <nl> " pred_early_stop_margin " , <nl> + " predict_disable_shape_check " , <nl> " convert_model_language " , <nl> " convert_model " , <nl> " num_class " , <nl> void Config : : GetMembersFromString ( const std : : unordered_map < std : : string , std : : str <nl> <nl> GetDouble ( params , " pred_early_stop_margin " , & pred_early_stop_margin ) ; <nl> <nl> + GetBool ( params , " predict_disable_shape_check " , & predict_disable_shape_check ) ; <nl> + <nl> GetString ( params , " convert_model_language " , & convert_model_language ) ; <nl> <nl> GetString ( params , " convert_model " , & convert_model ) ; <nl> std : : string Config : : SaveMembersToString ( ) const { <nl> str_buf < < " [ pred_early_stop : " < < pred_early_stop < < " ] \ n " ; <nl> str_buf < < " [ pred_early_stop_freq : " < < pred_early_stop_freq < < " ] \ n " ; <nl> str_buf < < " [ pred_early_stop_margin : " < < pred_early_stop_margin < < " ] \ n " ; <nl> + str_buf < < " [ predict_disable_shape_check : " < < predict_disable_shape_check < < " ] \ n " ; <nl> str_buf < < " [ convert_model_language : " < < convert_model_language < < " ] \ n " ; <nl> str_buf < < " [ convert_model : " < < convert_model < < " ] \ n " ; <nl> str_buf < < " [ num_class : " < < num_class < < " ] \ n " ; <nl>
option to disable the shape checking in prediction ( )
microsoft/LightGBM
f6b8ecf648f77f48d95a15e9ba5220e52f5d584c
2020-01-07T19:21:34Z
mmm a / Code / CryEngine / Cry3DEngine / 3DEngineRender . cpp <nl> ppp b / Code / CryEngine / Cry3DEngine / 3DEngineRender . cpp <nl> void C3DEngine : : PrintDebugInfo ( const SRenderingPassInfo & passInfo ) <nl> objectsStreamingStatus . nReady , objectsStreamingStatus . nInProgress , objectsStreamingStatus . nTotal , objectsStreamingStatus . nActive , float ( objectsStreamingStatus . nAllocatedBytes ) / 1024 / 1024 , float ( objectsStreamingStatus . nMemRequired ) / 1024 / 1024 , GetCVars ( ) - > e_StreamCgfPoolSize ) ; <nl> } <nl> <nl> - bool bOutOfMem ( ( float ( objectsStreamingStatus . nMemRequired ) / 1024 / 1024 ) > GetCVars ( ) - > e_StreamCgfPoolSize ) ; <nl> - bool bCloseToOutOfMem ( ( float ( objectsStreamingStatus . nMemRequired ) / 1024 / 1024 ) > GetCVars ( ) - > e_StreamCgfPoolSize * 90 / 100 ) ; <nl> + bool bOutOfMem ( ( float ( objectsStreamingStatus . nMemRequired ) / 1024 / 1024 ) > GetCVars ( ) - > e_StreamCgfPoolSize * 98 / 100 ) ; <nl> + bool bCloseToOutOfMem ( ( float ( objectsStreamingStatus . nMemRequired ) / 1024 / 1024 ) > GetCVars ( ) - > e_StreamCgfPoolSize * 85 / 100 ) ; <nl> <nl> ColorF color = Col_White ; <nl> if ( bOutOfMem ) <nl> void C3DEngine : : DisplayInfo ( float & fTextPosX , float & fTextPosY , float & fTextStep <nl> float ( objectsStreamingStatus . nAllocatedBytes ) / 1024 / 1024 , float ( objectsStreamingStatus . nMemRequired ) / 1024 / 1024 , GetCVars ( ) - > e_StreamCgfPoolSize ) ; <nl> } <nl> <nl> - bool bOutOfMem ( ( float ( objectsStreamingStatus . nMemRequired ) / 1024 / 1024 ) > GetCVars ( ) - > e_StreamCgfPoolSize ) ; <nl> - bool bCloseToOutOfMem ( ( float ( objectsStreamingStatus . nMemRequired ) / 1024 / 1024 ) > GetCVars ( ) - > e_StreamCgfPoolSize * 90 / 100 ) ; <nl> + bool bOutOfMem ( ( float ( objectsStreamingStatus . nMemRequired ) / 1024 / 1024 ) > GetCVars ( ) - > e_StreamCgfPoolSize * 98 / 100 ) ; <nl> + bool bCloseToOutOfMem ( ( float ( objectsStreamingStatus . nMemRequired ) / 1024 / 1024 ) > GetCVars ( ) - > e_StreamCgfPoolSize * 85 / 100 ) ; <nl> <nl> ColorF color = Col_White ; <nl> if ( bOutOfMem ) <nl> mmm a / Code / CryEngine / Cry3DEngine / ObjMan . h <nl> ppp b / Code / CryEngine / Cry3DEngine / ObjMan . h <nl> class CObjManager : public Cry3DEngineBase <nl> / / implementation parts of ProcessObjectsStreaming <nl> void ProcessObjectsStreaming_Impl ( bool bSyncLoad , const SRenderingPassInfo & passInfo ) ; <nl> void ProcessObjectsStreaming_Sort ( bool bSyncLoad , const SRenderingPassInfo & passInfo ) ; <nl> - void ProcessObjectsStreaming_Release ( ) ; <nl> void ProcessObjectsStreaming_InitLoad ( bool bSyncLoad ) ; <nl> void ProcessObjectsStreaming_Finish ( ) ; <nl> <nl> mmm a / Code / CryEngine / Cry3DEngine / ObjManStreaming . cpp <nl> ppp b / Code / CryEngine / Cry3DEngine / ObjManStreaming . cpp <nl> void CObjManager : : ProcessObjectsStreaming ( const SRenderingPassInfo & passInfo ) <nl> void CObjManager : : ProcessObjectsStreaming_Impl ( bool bSyncLoad , const SRenderingPassInfo & passInfo ) <nl> { <nl> ProcessObjectsStreaming_Sort ( bSyncLoad , passInfo ) ; <nl> - ProcessObjectsStreaming_Release ( ) ; <nl> # ifdef OBJMAN_STREAM_STATS <nl> ProcessObjectsStreaming_Stats ( passInfo ) ; <nl> # endif <nl> void CObjManager : : ProcessObjectsStreaming_Sort ( bool bSyncLoad , const SRenderingP <nl> } <nl> } <nl> <nl> - void CObjManager : : ProcessObjectsStreaming_Release ( ) <nl> - { <nl> - CRY_PROFILE_REGION ( PROFILE_3DENGINE , " ProcessObjectsStreaming_Release " ) ; <nl> - int nMemoryUsage = 0 ; <nl> - <nl> - int nNumStreamableObjects = m_arrStreamableObjects . Count ( ) ; <nl> - SStreamAbleObject * arrStreamableObjects = nNumStreamableObjects ? & m_arrStreamableObjects [ 0 ] : NULL ; <nl> - <nl> - for ( int nObjId = 0 ; nObjId < nNumStreamableObjects ; nObjId + + ) <nl> - { <nl> - const SStreamAbleObject & rObj = arrStreamableObjects [ nObjId ] ; <nl> - <nl> - if ( rObj . GetStreamAbleObject ( ) - > m_eStreamingStatus ! = ecss_NotLoaded ) <nl> - nMemoryUsage + = rObj . GetStreamableContentMemoryUsage ( ) ; <nl> - <nl> - bool bUnload = nMemoryUsage > = GetCVars ( ) - > e_StreamCgfPoolSize * 1024 * 1024 ; <nl> - <nl> - if ( ! bUnload & & GetCVars ( ) - > e_StreamCgfDebug = = 4 ) <nl> - if ( rObj . GetStreamAbleObject ( ) - > m_arrUpdateStreamingPrioriryRoundInfo [ 0 ] . nRoundId < ( CObjManager : : m_nUpdateStreamingPrioriryRoundId - 8 ) ) <nl> - bUnload = true ; <nl> - <nl> - if ( bUnload & & rObj . GetStreamAbleObject ( ) - > IsUnloadable ( ) ) <nl> - { <nl> - if ( rObj . GetStreamAbleObject ( ) - > m_eStreamingStatus = = ecss_Ready ) <nl> - { <nl> - m_arrStreamableToRelease . push_back ( rObj . GetStreamAbleObject ( ) ) ; <nl> - } <nl> - <nl> - / / remove from list if not active for long time <nl> - if ( rObj . GetStreamAbleObject ( ) - > m_eStreamingStatus = = ecss_NotLoaded ) <nl> - { <nl> - if ( rObj . GetStreamAbleObject ( ) - > m_arrUpdateStreamingPrioriryRoundInfo [ 0 ] . nRoundId < ( CObjManager : : m_nUpdateStreamingPrioriryRoundId - 8 ) ) <nl> - { <nl> - rObj . GetStreamAbleObject ( ) - > m_arrUpdateStreamingPrioriryRoundInfo [ 0 ] . nRoundId = 0 ; <nl> - m_arrStreamableToDelete . push_back ( rObj . GetStreamAbleObject ( ) ) ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> - s_nLastStreamingMemoryUsage = nMemoryUsage ; <nl> - } <nl> - <nl> void CObjManager : : ProcessObjectsStreaming_InitLoad ( bool bSyncLoad ) <nl> { <nl> CRY_PROFILE_REGION ( PROFILE_3DENGINE , " ProcessObjectsStreaming_InitLoad " ) ; <nl> <nl> - int nMaxInProgress = GetCVars ( ) - > e_StreamCgfMaxTasksInProgress ; <nl> - int nMaxToStart = GetCVars ( ) - > e_StreamCgfMaxNewTasksPerUpdate ; <nl> - int nMaxMemUsage = GetCVars ( ) - > e_StreamCgfPoolSize * 1024 * 1024 ; <nl> - int nNumStreamableObjects = m_arrStreamableObjects . Count ( ) ; <nl> - SStreamAbleObject * arrStreamableObjects = nNumStreamableObjects ? & m_arrStreamableObjects [ 0 ] : NULL ; <nl> + const int nMaxInProgress = GetCVars ( ) - > e_StreamCgfMaxTasksInProgress ; <nl> + const int nMaxToStart = GetCVars ( ) - > e_StreamCgfMaxNewTasksPerUpdate ; <nl> + const int nMaxMemUsage = GetCVars ( ) - > e_StreamCgfPoolSize * 1024 * 1024 ; <nl> + const int nNumStreamableObjects = m_arrStreamableObjects . Count ( ) ; <nl> <nl> int nMemoryUsage = 0 ; <nl> int nInProgress = 0 ; <nl> void CObjManager : : ProcessObjectsStreaming_InitLoad ( bool bSyncLoad ) <nl> GetRenderer ( ) - > EF_Query ( EFQ_GetMeshPoolInfo , stats ) ; <nl> size_t poolLimit = stats . nPoolSize < < 2 ; / / 4 times the pool limit because the rendermesh pool has been reduced <nl> <nl> - for ( int nObjId = 0 ; nObjId < nNumStreamableObjects ; nObjId + + ) <nl> + / / Count memory usage <nl> + for ( const auto & rObj : m_arrStreamableObjects ) <nl> { <nl> - const SStreamAbleObject & rObj = m_arrStreamableObjects [ nObjId ] ; <nl> const int size = rObj . GetStreamableContentMemoryUsage ( ) ; <nl> <nl> if ( rObj . GetStreamAbleObject ( ) - > m_eStreamingStatus = = ecss_InProgress ) <nl> void CObjManager : : ProcessObjectsStreaming_InitLoad ( bool bSyncLoad ) <nl> if ( rObj . GetStreamAbleObject ( ) - > m_eStreamingStatus ! = ecss_NotLoaded ) <nl> nMemoryUsage + = size ; <nl> } <nl> + s_nLastStreamingMemoryUsage = nMemoryUsage ; <nl> <nl> - for ( int nObjId = 0 ; ( nObjId < nNumStreamableObjects ) & & ( ( nInProgress < nMaxInProgress & & ( nInProgressMem < static_cast < int > ( poolLimit ) | | ! poolLimit ) & & nStarted < nMaxToStart ) | | bSyncLoad ) ; nObjId + + ) <nl> + / / Release stale objects <nl> + for ( const auto & rObj : m_arrStreamableObjects ) <nl> { <nl> - const SStreamAbleObject & rObj = arrStreamableObjects [ nObjId ] ; <nl> - IStreamable * pStatObj = rObj . GetStreamAbleObject ( ) ; <nl> - const int size = rObj . GetStreamableContentMemoryUsage ( ) ; <nl> + if ( rObj . GetStreamAbleObject ( ) - > IsUnloadable ( ) & & rObj . GetStreamAbleObject ( ) - > m_eStreamingStatus ! = ecss_NotLoaded & & <nl> + rObj . GetStreamAbleObject ( ) - > m_arrUpdateStreamingPrioriryRoundInfo [ 0 ] . nRoundId < ( CObjManager : : m_nUpdateStreamingPrioriryRoundId - 8 ) ) <nl> + { <nl> + / / remove from list if not active for long time <nl> + rObj . GetStreamAbleObject ( ) - > m_arrUpdateStreamingPrioriryRoundInfo [ 0 ] . nRoundId = 0 ; <nl> + m_arrStreamableToDelete . push_back ( rObj . GetStreamAbleObject ( ) ) ; <nl> + } <nl> + } <nl> + <nl> + / / Load pending <nl> + auto * unload_iterator = m_arrStreamableObjects . end ( ) - 1 ; <nl> + for ( auto * it = m_arrStreamableObjects . begin ( ) ; ( it ! = m_arrStreamableObjects . end ( ) ) & & ( ( nInProgress < nMaxInProgress & & ( nInProgressMem < static_cast < int > ( poolLimit ) | | ! poolLimit ) & & nStarted < nMaxToStart ) | | bSyncLoad ) ; it + + ) <nl> + { <nl> + IStreamable * pStatObj = it - > GetStreamAbleObject ( ) ; <nl> + const int size = it - > GetStreamableContentMemoryUsage ( ) ; <nl> + <nl> + if ( pStatObj - > m_eStreamingStatus ! = ecss_NotLoaded ) <nl> + continue ; <nl> <nl> if ( poolLimit & & poolLimit < = ( size_t ) ( nInProgressMem + size ) ) <nl> { <nl> void CObjManager : : ProcessObjectsStreaming_InitLoad ( bool bSyncLoad ) <nl> continue ; <nl> } <nl> <nl> - if ( rObj . GetStreamAbleObject ( ) - > m_eStreamingStatus = = ecss_NotLoaded & & nMemoryUsage + size < nMaxMemUsage ) <nl> + / / See if we can free enough memory to stream in higher - priority content <nl> + auto unload_it2 = unload_iterator ; <nl> + auto new_mem_usage = nMemoryUsage ; <nl> + for ( ; new_mem_usage + size > = nMaxMemUsage & & unload_it2 > it ; - - unload_it2 ) <nl> { <nl> - m_arrStreamableToLoad . push_back ( rObj . GetStreamAbleObject ( ) ) ; <nl> - nMemoryUsage + = size ; <nl> - nInProgressMem + = size ; <nl> - + + nInProgress ; <nl> - + + nStarted ; <nl> + if ( unload_it2 - > GetStreamAbleObject ( ) - > IsUnloadable ( ) & & unload_it2 - > GetStreamAbleObject ( ) - > m_eStreamingStatus = = ecss_Ready ) <nl> + new_mem_usage - = unload_it2 - > GetStreamableContentMemoryUsage ( ) ; <nl> + } <nl> + / / If we failed to free memory warn once for each object and continue . <nl> + if ( new_mem_usage + size > = nMaxMemUsage ) <nl> + { <nl> + if ( ! pStatObj - > warnedWhenCGFPoolIsOutOfMemory ) <nl> + { <nl> + string name ; <nl> + pStatObj - > GetStreamableName ( name ) ; <nl> + CryWarning ( EValidatorModule : : VALIDATOR_MODULE_RENDERER , EValidatorSeverity : : VALIDATOR_WARNING , <nl> + " [ WARNING ] object ' % s ' skipped because failed to free CGF pool memory for it " , name . c_str ( ) ) ; <nl> + pStatObj - > warnedWhenCGFPoolIsOutOfMemory = true ; <nl> + } <nl> <nl> - if ( ( GetCVars ( ) - > e_AutoPrecacheCgf = = 2 ) & & ( nObjId > nNumStreamableObjects / 2 ) ) <nl> - break ; <nl> + continue ; <nl> + } <nl> + / / Unload content <nl> + for ( ; unload_iterator ! = unload_it2 ; - - unload_iterator ) <nl> + { <nl> + if ( unload_iterator - > GetStreamAbleObject ( ) - > IsUnloadable ( ) & & unload_iterator - > GetStreamAbleObject ( ) - > m_eStreamingStatus = = ecss_Ready ) <nl> + m_arrStreamableToRelease . push_back ( unload_iterator - > GetStreamAbleObject ( ) ) ; <nl> } <nl> + <nl> + / / Stream in new content <nl> + m_arrStreamableToLoad . push_back ( pStatObj ) ; <nl> + nMemoryUsage = new_mem_usage + size ; <nl> + nInProgressMem + = size ; <nl> + + + nInProgress ; <nl> + + + nStarted ; <nl> + <nl> + if ( GetCVars ( ) - > e_AutoPrecacheCgf = = 2 & & std : : distance ( m_arrStreamableObjects . begin ( ) , it ) * 2 > nNumStreamableObjects ) <nl> + break ; <nl> } <nl> } <nl> <nl> void CObjManager : : GetObjectsStreamingStatus ( I3DEngine : : SObjectsStreamingStatus & <nl> if ( rStreamAbleObject . GetStreamAbleObject ( ) - > m_eStreamingStatus = = ecss_Ready ) <nl> outStatus . nAllocatedBytes + = rStreamAbleObject . GetStreamableContentMemoryUsage ( ) ; <nl> <nl> - if ( rStreamAbleObject . GetStreamAbleObject ( ) - > m_arrUpdateStreamingPrioriryRoundInfo [ 0 ] . nRoundId > = ( CObjManager : : m_nUpdateStreamingPrioriryRoundId - 4 ) ) <nl> + if ( rStreamAbleObject . GetStreamAbleObject ( ) - > m_arrUpdateStreamingPrioriryRoundInfo [ 0 ] . nRoundId > = ( CObjManager : : m_nUpdateStreamingPrioriryRoundId - 8 ) ) <nl> outStatus . nMemRequired + = rStreamAbleObject . GetStreamableContentMemoryUsage ( ) ; <nl> } <nl> } <nl> mmm a / Code / CryEngine / Cry3DEngine / ParticleSystem / Features / FeatureChild . cpp <nl> ppp b / Code / CryEngine / Cry3DEngine / ParticleSystem / Features / FeatureChild . cpp <nl> class CFeatureChildOnBirth : public CFeatureChildBase <nl> <nl> static uint DefaultForType ( ) { return EFT_Child ; } <nl> <nl> - void AddSubInstances ( CParticleComponentRuntime & runtime ) override <nl> + void AddSubInstances ( CParticleComponentRuntime & runtime , TDynArray < SInstance > & instances ) override <nl> { <nl> CParticleContainer & parentContainer = runtime . GetParentContainer ( ) ; <nl> IFStream normAges = parentContainer . GetIFStream ( EPDT_NormalAge ) ; <nl> IFStream lifeTimes = parentContainer . GetIFStream ( EPDT_LifeTime ) ; <nl> <nl> - THeapArray < SInstance > triggers ( runtime . MemHeap ( ) ) ; <nl> - triggers . reserve ( parentContainer . GetNumParticles ( ) ) ; <nl> + instances . reserve ( parentContainer . GetNumParticles ( ) ) ; <nl> for ( auto particleId : parentContainer . GetSpawnedRange ( ) ) <nl> { <nl> const float delay = runtime . DeltaTime ( ) - normAges . Load ( particleId ) * lifeTimes . Load ( particleId ) ; <nl> - triggers . emplace_back ( particleId , delay ) ; <nl> + instances . emplace_back ( particleId , delay ) ; <nl> } <nl> - runtime . AddSubInstances ( triggers ) ; <nl> } <nl> } ; <nl> <nl> class CFeatureChildOnDeath : public CFeatureChildBase <nl> <nl> bool IsDelayed ( ) const override { return true ; } <nl> <nl> - void AddSubInstances ( CParticleComponentRuntime & runtime ) override <nl> + void AddSubInstances ( CParticleComponentRuntime & runtime , TDynArray < SInstance > & instances ) override <nl> { <nl> CParticleContainer & parentContainer = runtime . GetParentContainer ( ) ; <nl> <nl> IFStream normAges = parentContainer . GetIFStream ( EPDT_NormalAge ) ; <nl> IFStream lifeTimes = parentContainer . GetIFStream ( EPDT_LifeTime ) ; <nl> <nl> - THeapArray < SInstance > triggers ( runtime . MemHeap ( ) ) ; <nl> - triggers . reserve ( parentContainer . GetNumParticles ( ) ) ; <nl> + instances . reserve ( parentContainer . GetNumParticles ( ) ) ; <nl> for ( auto particleId : parentContainer . GetFullRange ( ) ) <nl> { <nl> const float normAge = normAges . Load ( particleId ) ; <nl> class CFeatureChildOnDeath : public CFeatureChildBase <nl> { <nl> const float overAge = ( normAge - 1 . 0f ) * lifeTimes . Load ( particleId ) ; <nl> const float delay = runtime . DeltaTime ( ) - overAge ; <nl> - triggers . emplace_back ( particleId , delay ) ; <nl> + instances . emplace_back ( particleId , delay ) ; <nl> } <nl> } <nl> - runtime . AddSubInstances ( triggers ) ; <nl> } <nl> } ; <nl> <nl> class CFeatureChildOnCollide : public CFeatureChildBase <nl> <nl> bool IsDelayed ( ) const override { return true ; } <nl> <nl> - void AddSubInstances ( CParticleComponentRuntime & runtime ) override <nl> + void AddSubInstances ( CParticleComponentRuntime & runtime , TDynArray < SInstance > & instances ) override <nl> { <nl> CParticleContainer & parentContainer = runtime . GetParentContainer ( ) ; <nl> - THeapArray < SInstance > triggers ( runtime . MemHeap ( ) ) ; <nl> - triggers . reserve ( parentContainer . GetNumParticles ( ) ) ; <nl> + instances . reserve ( parentContainer . GetNumParticles ( ) ) ; <nl> <nl> const auto contactPoints = parentContainer . IStream ( EPDT_ContactPoint ) ; <nl> <nl> class CFeatureChildOnCollide : public CFeatureChildBase <nl> if ( contact . m_pSurfaceType - > GetId ( ) = = m_surface ) <nl> continue ; <nl> } <nl> - triggers . emplace_back ( particleId , contact . m_time ) ; <nl> + instances . emplace_back ( particleId , contact . m_time ) ; <nl> } <nl> } <nl> - runtime . AddSubInstances ( triggers ) ; <nl> } <nl> <nl> private : <nl> mmm a / Code / CryEngine / Cry3DEngine / ParticleSystem / Features / FeatureCollision . cpp <nl> ppp b / Code / CryEngine / Cry3DEngine / ParticleSystem / Features / FeatureCollision . cpp <nl> bool CFeatureCollision : : RayWorldIntersection ( SContactPoint & contact , const Vec3 & <nl> if ( m_objectFilter & ~ ent_terrain_raytrace ) <nl> { <nl> ray_hit rayHit ; <nl> - while ( gEnv - > pPhysicalWorld - > RayWorldIntersection ( start , ray , ( m_objectFilter & ~ ent_terrain_raytrace | ent_no_ondemand_activation ) , kCollisionsFlags , & rayHit , 1 ) ) <nl> + for ( uint i = 0 ; i < kTotalLimit & & gEnv - > pPhysicalWorld - > RayWorldIntersection ( start , ray , ( m_objectFilter & ~ ent_terrain_raytrace | ent_no_ondemand_activation ) , kCollisionsFlags , & rayHit , 1 ) ; + + i ) <nl> { <nl> if ( ( rayHit . n | ray ) > = 0 . 0f ) <nl> { <nl> mmm a / Code / CryEngine / Cry3DEngine / ParticleSystem / Features / FeatureComponent . cpp <nl> ppp b / Code / CryEngine / Cry3DEngine / ParticleSystem / Features / FeatureComponent . cpp <nl> class CFeatureComponentActivateIf : public CParticleFeature <nl> ar ( m_attribute , " Attribute " , " Attribute " ) ; <nl> } <nl> <nl> - virtual void CullSubInstances ( CParticleComponentRuntime & runtime , TVarArray < SInstance > & instances ) override <nl> + virtual void CullSubInstances ( CParticleComponentRuntime & runtime , TDynArray < SInstance > & instances ) override <nl> { <nl> if ( ! m_attribute . GetValueAs ( runtime . GetEmitter ( ) - > GetAttributeInstance ( ) , true ) ) <nl> instances . resize ( 0 ) ; <nl> class CFeatureComponentActivateRandom : public CParticleFeature <nl> SERIALIZE_VAR ( ar , m_selectionStart ) ; <nl> } <nl> <nl> - virtual void CullSubInstances ( CParticleComponentRuntime & runtime , TVarArray < SInstance > & instances ) override <nl> + virtual void CullSubInstances ( CParticleComponentRuntime & runtime , TDynArray < SInstance > & instances ) override <nl> { <nl> if ( m_probability = = 1 . 0f ) <nl> return ; <nl> mmm a / Code / CryEngine / Cry3DEngine / ParticleSystem / Features / FeatureLocation . cpp <nl> ppp b / Code / CryEngine / Cry3DEngine / ParticleSystem / Features / FeatureLocation . cpp <nl> class CFeatureLocationOffset : public CParticleFeature <nl> } <nl> } <nl> <nl> - virtual void GetEmitOffsets ( const CParticleComponentRuntime & runtime , TVarArray < Vec3 > offsets ) override <nl> + virtual void GetEmitOffsets ( const CParticleComponentRuntime & runtime , TVarArray < Vec3 > offsets , uint firstInstance ) override <nl> { <nl> SInstanceUpdateBuffer < float > sizes ( runtime , m_scale ) ; <nl> - for ( uint i = 0 ; i < runtime . GetNumInstances ( ) ; + + i ) <nl> + for ( uint i = 0 ; i < offsets . size ( ) ; + + i ) <nl> { <nl> - const float scale = sizes [ i ] * ( sizes . Range ( ) . start + sizes . Range ( ) . end ) * 0 . 5f ; <nl> + uint idx = firstInstance + i ; <nl> + const float scale = sizes [ idx ] * ( sizes . Range ( ) . start + sizes . Range ( ) . end ) * 0 . 5f ; <nl> offsets [ i ] + = m_offset * scale ; <nl> } <nl> } <nl> mmm a / Code / CryEngine / Cry3DEngine / ParticleSystem / Features / FeatureSpawn . cpp <nl> ppp b / Code / CryEngine / Cry3DEngine / ParticleSystem / Features / FeatureSpawn . cpp <nl> class CParticleFeatureSpawnBase : public CParticleFeature <nl> <nl> virtual void AddToComponent ( CParticleComponent * pComponent , SComponentParams * pParams ) override <nl> { <nl> + pComponent - > AddSubInstances . add ( this ) ; <nl> pComponent - > InitSubInstances . add ( this ) ; <nl> pComponent - > SpawnParticles . add ( this ) ; <nl> m_offsetSpawnData = pComponent - > AddInstanceData < SSpawnData > ( ) ; <nl> class CParticleFeatureSpawnBase : public CParticleFeature <nl> SetMax ( pParams - > m_maxTotalLIfe , maxLife ) ; <nl> } <nl> <nl> + void AddSubInstances ( CParticleComponentRuntime & runtime , TDynArray < SInstance > & instances ) override <nl> + { <nl> + if ( ! runtime . IsChild ( ) & & runtime . GetEmitter ( ) - > IsActive ( ) & & runtime . GetNumInstances ( ) = = 0 ) <nl> + { <nl> + / / Add first instance <nl> + instances . push_back ( ) ; <nl> + } <nl> + } <nl> + <nl> virtual void InitSubInstances ( CParticleComponentRuntime & runtime , SUpdateRange instanceRange ) override <nl> { <nl> StartInstances ( runtime , instanceRange , { } ) ; <nl> class CFeatureSpawnDistance : public CParticleFeatureSpawnBase <nl> CParticleFeatureSpawnBase : : InitSubInstances ( runtime , instanceRange ) ; <nl> <nl> THeapArray < QuatTS > locations ( runtime . MemHeap ( ) , instanceRange . size ( ) ) ; <nl> - runtime . GetEmitLocations ( locations ) ; <nl> + runtime . GetEmitLocations ( locations , instanceRange . m_begin ) ; <nl> <nl> for ( auto instanceId : instanceRange ) <nl> { <nl> Vec3 & emitPos = runtime . GetInstanceData ( instanceId , m_offsetEmitPos ) ; <nl> - emitPos = locations [ instanceId ] . t ; <nl> + emitPos = locations [ instanceId - instanceRange . m_begin ] . t ; <nl> } <nl> } <nl> <nl> void GetSpawnCounts ( CParticleComponentRuntime & runtime , TVarArray < float > amounts ) const override <nl> { <nl> THeapArray < QuatTS > locations ( runtime . MemHeap ( ) , amounts . size ( ) ) ; <nl> - runtime . GetEmitLocations ( locations ) ; <nl> + runtime . GetEmitLocations ( locations , 0 ) ; <nl> <nl> for ( uint i = 0 ; i < amounts . size ( ) ; + + i ) <nl> { <nl> Vec3 & emitPos = runtime . GetInstanceData ( i , m_offsetEmitPos ) ; <nl> - const Vec3 emitPos0 = emitPos ; <nl> const Vec3 emitPos1 = locations [ i ] . t ; <nl> - emitPos = emitPos1 ; <nl> - <nl> + const Vec3 emitPos0 = emitPos ; <nl> const float distance = ( emitPos1 - emitPos0 ) . GetLengthFast ( ) ; <nl> amounts [ i ] = distance * ( m_mode = = ESpawnDistanceMode : : ParticlesPerMeter ? amounts [ i ] : rcp ( amounts [ i ] ) ) ; <nl> + emitPos = emitPos1 ; <nl> } <nl> } <nl> <nl> private : <nl> ESpawnDistanceMode m_mode = ESpawnDistanceMode : : ParticlesPerMeter ; <nl> TDataOffset < Vec3 > m_offsetEmitPos ; <nl> - <nl> } ; <nl> <nl> CRY_PFX2_IMPLEMENT_FEATURE ( CParticleFeature , CFeatureSpawnDistance , " Spawn " , " Distance " , colorSpawn ) ; <nl> mmm a / Code / CryEngine / Cry3DEngine / ParticleSystem / Features / ParamModImpl . h <nl> ppp b / Code / CryEngine / Cry3DEngine / ParticleSystem / Features / ParamModImpl . h <nl> auto CParamMod < Domain , T > : : GetValues ( const CParticleComponentRuntime & runtime , T <nl> <nl> for ( auto & pMod : m_modifiers ) <nl> { <nl> - if ( domain > = pMod - > GetDomain ( ) ) <nl> + if ( domain > = ( max ( pMod - > GetDomain ( ) , Domain ) & ~ EDD_HasUpdate ) ) <nl> pMod - > Modify ( runtime , range , stream , domain ) ; <nl> else <nl> minmax = minmax * pMod - > GetMinMax ( ) ; <nl> mmm a / Code / CryEngine / Cry3DEngine / ParticleSystem / ParticleComponentRuntime . cpp <nl> ppp b / Code / CryEngine / Cry3DEngine / ParticleSystem / ParticleComponentRuntime . cpp <nl> void CParticleComponentRuntime : : AddRemoveParticles ( ) <nl> RemoveParticles ( ) ; <nl> AgeUpdate ( ) ; <nl> <nl> + AddInstances ( ) ; <nl> AddParticles ( ) ; <nl> UpdateNewBorns ( ) ; <nl> m_container . ResetSpawnedParticles ( ) ; <nl> void CParticleComponentRuntime : : ComputeVertices ( const SCameraInfo & camInfo , CREP <nl> GetComponent ( ) - > ComputeVertices ( * this , camInfo , pRE , uRenderFlags , fMaxPixels ) ; <nl> } <nl> <nl> - void CParticleComponentRuntime : : AddSubInstances ( TVarArray < SInstance > instances ) <nl> - { <nl> - CRY_PFX2_PROFILE_DETAIL ; <nl> - <nl> - GetComponent ( ) - > CullSubInstances ( * this , instances ) ; <nl> - <nl> - if ( instances . empty ( ) ) <nl> - return ; <nl> - <nl> - uint firstInstance = m_subInstances . size ( ) ; <nl> - uint lastInstance = firstInstance + instances . size ( ) ; <nl> - m_subInstances . append ( instances ) ; <nl> - m_subInstanceData . resize ( ComponentParams ( ) . m_instanceDataStride * m_subInstances . size ( ) ) ; <nl> - <nl> - SUpdateRange instanceRange ( firstInstance , lastInstance ) ; <nl> - GetComponent ( ) - > InitSubInstances ( * this , instanceRange ) ; <nl> - <nl> - DebugStabilityCheck ( ) ; <nl> - } <nl> - <nl> void CParticleComponentRuntime : : RemoveAllSubInstances ( ) <nl> { <nl> m_subInstances . clear ( ) ; <nl> void CParticleComponentRuntime : : ReparentParticles ( TConstArray < TParticleId > swapI <nl> DebugStabilityCheck ( ) ; <nl> } <nl> <nl> - void CParticleComponentRuntime : : GetEmitLocations ( TVarArray < QuatTS > locations ) const <nl> + void CParticleComponentRuntime : : GetEmitLocations ( TVarArray < QuatTS > locations , uint firstInstance ) const <nl> { <nl> auto const & parentContainer = GetParentContainer ( ) ; <nl> auto parentPositions = parentContainer . GetIVec3Stream ( EPVF_Position , GetEmitter ( ) - > GetLocation ( ) . t ) ; <nl> auto parentRotations = parentContainer . GetIQuatStream ( EPQF_Orientation , GetEmitter ( ) - > GetLocation ( ) . q ) ; <nl> <nl> - THeapArray < Vec3 > offsets ( MemHeap ( ) , GetNumInstances ( ) ) ; <nl> + THeapArray < Vec3 > offsets ( MemHeap ( ) , locations . size ( ) ) ; <nl> offsets . fill ( Vec3 ( 0 ) ) ; <nl> - GetComponent ( ) - > GetEmitOffsets ( * this , offsets ) ; <nl> + GetComponent ( ) - > GetEmitOffsets ( * this , offsets , firstInstance ) ; <nl> <nl> - for ( uint idx = 0 ; idx < m_subInstances . size ( ) ; + + idx ) <nl> + for ( uint idx = 0 ; idx < locations . size ( ) ; + + idx ) <nl> { <nl> - TParticleId parentId = GetInstance ( idx ) . m_parentId ; <nl> + TParticleId parentId = GetInstance ( firstInstance + idx ) . m_parentId ; <nl> <nl> QuatTS & loc = locations [ idx ] ; <nl> loc . t = parentPositions . SafeLoad ( parentId ) ; <nl> void CParticleComponentRuntime : : EmitParticle ( ) <nl> m_container . ResetSpawnedParticles ( ) ; <nl> } <nl> <nl> + void CParticleComponentRuntime : : AddInstances ( ) <nl> + { <nl> + CRY_PFX2_PROFILE_DETAIL ; <nl> + <nl> + TDynArray < SInstance > instances ; <nl> + GetComponent ( ) - > AddSubInstances ( * this , instances ) ; <nl> + GetComponent ( ) - > CullSubInstances ( * this , instances ) ; <nl> + <nl> + if ( instances . empty ( ) ) <nl> + return ; <nl> + <nl> + uint firstInstance = m_subInstances . size ( ) ; <nl> + uint lastInstance = firstInstance + instances . size ( ) ; <nl> + m_subInstances . append ( instances ) ; <nl> + m_subInstanceData . resize ( ComponentParams ( ) . m_instanceDataStride * m_subInstances . size ( ) ) ; <nl> + <nl> + SUpdateRange instanceRange ( firstInstance , lastInstance ) ; <nl> + GetComponent ( ) - > InitSubInstances ( * this , instanceRange ) ; <nl> + <nl> + DebugStabilityCheck ( ) ; <nl> + } <nl> + <nl> void CParticleComponentRuntime : : AddParticles ( ) <nl> { <nl> - GetComponent ( ) - > AddSubInstances ( * this ) ; <nl> TDynArray < SSpawnEntry > spawnEntries ; <nl> if ( GetNumInstances ( ) ) <nl> GetComponent ( ) - > SpawnParticles ( * this , spawnEntries ) ; <nl> void CParticleComponentRuntime : : UpdateGPURuntime ( ) <nl> <nl> GetComponent ( ) - > UpdateGPUParams ( * this , params ) ; <nl> <nl> - GetComponent ( ) - > AddSubInstances ( * this ) ; <nl> + AddInstances ( ) ; <nl> TDynArray < SSpawnEntry > spawnEntries ; <nl> if ( GetNumInstances ( ) ) <nl> GetComponent ( ) - > SpawnParticles ( * this , spawnEntries ) ; <nl> mmm a / Code / CryEngine / Cry3DEngine / ParticleSystem / ParticleComponentRuntime . h <nl> ppp b / Code / CryEngine / Cry3DEngine / ParticleSystem / ParticleComponentRuntime . h <nl> class CParticleComponentRuntime : public _i_reference_target_t , public IParticle <nl> const AABB & GetBounds ( ) const { return m_pGpuRuntime ? m_pGpuRuntime - > GetBounds ( ) : m_bounds ; } <nl> bool IsChild ( ) const { return m_pComponent - > GetParentComponent ( ) ! = nullptr ; } <nl> void ReparentParticles ( TConstArray < TParticleId > swapIds ) ; <nl> - void AddSubInstances ( TVarArray < SInstance > instances ) ; <nl> void RemoveAllSubInstances ( ) ; <nl> void RenderAll ( const SRenderContext & renderContext ) ; <nl> <nl> class CParticleComponentRuntime : public _i_reference_target_t , public IParticle <nl> byte * addr = m_subInstanceData . data ( ) + stride * idx + offset ; <nl> return * reinterpret_cast < T * > ( addr ) ; <nl> } <nl> - void GetEmitLocations ( TVarArray < QuatTS > locations ) const ; <nl> + void GetEmitLocations ( TVarArray < QuatTS > locations , uint firstInstance ) const ; <nl> void EmitParticle ( ) ; <nl> <nl> bool HasParticles ( ) const ; <nl> class CParticleComponentRuntime : public _i_reference_target_t , public IParticle <nl> float DeltaTime ( ) const ; <nl> <nl> private : <nl> + void AddInstances ( ) ; <nl> void AddParticles ( ) ; <nl> void RemoveParticles ( ) ; <nl> void UpdateNewBorns ( ) ; <nl> mmm a / Code / CryEngine / Cry3DEngine / ParticleSystem / ParticleEmitter . cpp <nl> ppp b / Code / CryEngine / Cry3DEngine / ParticleSystem / ParticleEmitter . cpp <nl> CParticleEmitter : : CParticleEmitter ( CParticleEffect * pEffect , uint emitterId ) <nl> , m_viewDistRatio ( 1 . 0f ) <nl> , m_active ( false ) <nl> , m_alive ( true ) <nl> - , m_addInstances ( 0 ) <nl> , m_location ( IDENTITY ) <nl> , m_emitterEditVersion ( - 1 ) <nl> , m_effectEditVersion ( - 1 ) <nl> bool CParticleEmitter : : UpdateParticles ( ) <nl> m_stats = { } ; <nl> for ( auto & pRuntime : m_componentRuntimes ) <nl> { <nl> - if ( m_active & & m_addInstances & & ! pRuntime - > IsChild ( ) ) <nl> - { <nl> - SInstance instance ; <nl> - for ( uint id = 0 ; id < m_addInstances ; + + id ) <nl> - pRuntime - > AddSubInstances ( { & instance , 1 } ) ; <nl> - } <nl> pRuntime - > UpdateAll ( ) ; <nl> m_realBounds . Add ( pRuntime - > GetBounds ( ) ) ; <nl> } <nl> m_alive = m_stats . components . alive > 0 ; <nl> - m_addInstances = 0 ; <nl> <nl> PostUpdate ( ) ; <nl> UpdateBoundingBox ( ) ; <nl> void CParticleEmitter : : Kill ( ) <nl> { <nl> m_active = false ; <nl> m_alive = false ; <nl> - m_componentRuntimes . clear ( ) ; <nl> - m_componentRuntimesFor . clear ( ) ; <nl> } <nl> <nl> bool CParticleEmitter : : IsActive ( ) const <nl> void CParticleEmitter : : UpdateRuntimes ( ) <nl> <nl> m_effectEditVersion = m_pEffectOriginal - > GetEditVersion ( ) + m_emitterEditVersion ; <nl> m_alive = true ; <nl> - m_addInstances = 1 ; <nl> } <nl> <nl> void CParticleEmitter : : ResetRenderObjects ( ) <nl> void CParticleEmitter : : Unregister ( ) <nl> m_realBounds . Reset ( ) ; <nl> } <nl> <nl> + void CParticleEmitter : : Clear ( ) <nl> + { <nl> + m_alive = m_active = false ; <nl> + Unregister ( ) ; <nl> + m_componentRuntimes . clear ( ) ; <nl> + m_componentRuntimesFor . clear ( ) ; <nl> + } <nl> + <nl> bool CParticleEmitter : : HasParticles ( ) const <nl> { <nl> for ( auto & pRuntime : m_componentRuntimes ) <nl> mmm a / Code / CryEngine / Cry3DEngine / ParticleSystem / ParticleEmitter . h <nl> ppp b / Code / CryEngine / Cry3DEngine / ParticleSystem / ParticleEmitter . h <nl> class CParticleEmitter : public IParticleEmitter , public Cry3DEngineBase <nl> CParticleEffect * GetCEffect ( ) { return m_pEffect ; } <nl> void Register ( ) ; <nl> void Unregister ( ) ; <nl> + void Clear ( ) ; <nl> void ResetRenderObjects ( ) ; <nl> void UpdateEmitGeomFromEntity ( ) ; <nl> const SVisEnviron & GetVisEnv ( ) const { return m_visEnviron ; } <nl> class CParticleEmitter : public IParticleEmitter , public Cry3DEngineBase <nl> bool m_boundsChanged ; <nl> bool m_active ; <nl> bool m_alive ; <nl> - uint m_addInstances ; <nl> uint m_unrendered ; <nl> EmitterStats m_stats ; <nl> stl : : PSyncMultiThread m_lock ; <nl> mmm a / Code / CryEngine / Cry3DEngine / ParticleSystem / ParticleFeature . h <nl> ppp b / Code / CryEngine / Cry3DEngine / ParticleSystem / ParticleFeature . h <nl> class CParticleFeature : public IParticleFeature <nl> <nl> virtual void OnEdit ( CParticleComponentRuntime & runtime ) { } <nl> <nl> - virtual void AddSubInstances ( CParticleComponentRuntime & runtime ) { } <nl> + virtual void AddSubInstances ( CParticleComponentRuntime & runtime , TDynArray < SInstance > & instances ) { } <nl> <nl> - virtual void CullSubInstances ( CParticleComponentRuntime & runtime , TVarArray < SInstance > & instances ) { } <nl> + virtual void CullSubInstances ( CParticleComponentRuntime & runtime , TDynArray < SInstance > & instances ) { } <nl> <nl> virtual void InitSubInstances ( CParticleComponentRuntime & runtime , SUpdateRange instanceRange ) { } <nl> <nl> virtual void GetSpatialExtents ( const CParticleComponentRuntime & runtime , TConstArray < float > scales , TVarArray < float > extents ) { } <nl> <nl> - virtual void GetEmitOffsets ( const CParticleComponentRuntime & runtime , TVarArray < Vec3 > offsets ) { } <nl> + virtual void GetEmitOffsets ( const CParticleComponentRuntime & runtime , TVarArray < Vec3 > offsets , uint firstInstance ) { } <nl> <nl> / / Particle initialization <nl> virtual void SpawnParticles ( CParticleComponentRuntime & runtime , TDynArray < SSpawnEntry > & spawnEntries ) { } <nl> struct SFeatureDispatchers <nl> TFeatureDispatcher < CParticleComponentRuntime & > MainPreUpdate { & CParticleFeature : : MainPreUpdate } ; <nl> TFeatureDispatcher < CParticleComponentRuntime & > OnEdit { & CParticleFeature : : OnEdit } ; <nl> <nl> - TFeatureDispatcher < CParticleComponentRuntime & > AddSubInstances { & CParticleFeature : : AddSubInstances } ; <nl> - TFeatureDispatcher < CParticleComponentRuntime & , TVarArray < SInstance > & > CullSubInstances { & CParticleFeature : : CullSubInstances } ; <nl> + TFeatureDispatcher < CParticleComponentRuntime & , TDynArray < SInstance > & > AddSubInstances { & CParticleFeature : : AddSubInstances } ; <nl> + TFeatureDispatcher < CParticleComponentRuntime & , TDynArray < SInstance > & > CullSubInstances { & CParticleFeature : : CullSubInstances } ; <nl> TFeatureDispatcher < CParticleComponentRuntime & , SUpdateRange > InitSubInstances { & CParticleFeature : : InitSubInstances } ; <nl> TFeatureDispatcher < CParticleComponentRuntime & , TDynArray < SSpawnEntry > & > SpawnParticles { & CParticleFeature : : SpawnParticles } ; <nl> <nl> TFeatureDispatcher < const CParticleComponentRuntime & , TConstArray < float > , TVarArray < float > > GetSpatialExtents { & CParticleFeature : : GetSpatialExtents } ; <nl> - TFeatureDispatcher < const CParticleComponentRuntime & , TVarArray < Vec3 > > GetEmitOffsets { & CParticleFeature : : GetEmitOffsets } ; <nl> + TFeatureDispatcher < const CParticleComponentRuntime & , TVarArray < Vec3 > , uint > GetEmitOffsets { & CParticleFeature : : GetEmitOffsets } ; <nl> <nl> TFeatureDispatcher < CParticleComponentRuntime & > PreInitParticles { & CParticleFeature : : PreInitParticles } ; <nl> TFeatureDispatcher < CParticleComponentRuntime & > InitParticles { & CParticleFeature : : InitParticles } ; <nl> mmm a / Code / CryEngine / Cry3DEngine / ParticleSystem / ParticleSystem . cpp <nl> ppp b / Code / CryEngine / Cry3DEngine / ParticleSystem / ParticleSystem . cpp <nl> void CParticleSystem : : Update ( ) <nl> } <nl> else <nl> { <nl> - pEmitter - > Unregister ( ) ; <nl> + pEmitter - > Clear ( ) ; <nl> } <nl> } <nl> <nl> mmm a / Code / CryEngine / CryCommon / Cry3DEngine / IStatObj . h <nl> ppp b / Code / CryEngine / CryCommon / Cry3DEngine / IStatObj . h <nl> struct IStreamable <nl> EFileStreamingStatus m_eStreamingStatus ; <nl> uint32 m_nSelectedFrameId : 31 ; <nl> uint32 m_nStatsInUse : 1 ; <nl> + <nl> + bool warnedWhenCGFPoolIsOutOfMemory = false ; <nl> } ; <nl> <nl> / / ! Represents a static object that can be rendered in the scene , represented by the . CGF format <nl> mmm a / Code / CryEngine / CryScriptSystem / CMakeLists . txt <nl> ppp b / Code / CryEngine / CryScriptSystem / CMakeLists . txt <nl> if ( WIN32 ) <nl> target_link_libraries ( $ { THIS_PROJECT } PRIVATE shell32 Gdi32 wininet Ole32 ) <nl> endif ( ) <nl> <nl> - if ( ANDROID ) <nl> - set_source_files_properties ( " vectorlib . c " PROPERTIES LANGUAGE CXX ) <nl> + if ( ANDROID OR ORBIS ) <nl> + # Forcing C11 standard on C files and with that overriding project C + + standard that is being applied . <nl> + set_source_files_properties ( " vectorlib . c " PROPERTIES COMPILE_FLAGS " - std = c11 " ) <nl> endif ( ) <nl> <nl> if ( ORBIS OR CMAKE_CXX_COMPILER_ID STREQUAL " Clang " ) <nl> mmm a / Code / CryEngine / CrySystem / CMakeLists . txt <nl> ppp b / Code / CryEngine / CrySystem / CMakeLists . txt <nl> end_sources ( ) <nl> # END - FILE - LIST <nl> <nl> MACRO ( setup_crysystem ) <nl> - target_link_libraries ( $ { THIS_PROJECT } PRIVATE zlib expat lz4 md5 tomcrypt ) <nl> - use_scaleform ( ) <nl> - if ( WIN32 ) <nl> + target_link_libraries ( $ { THIS_PROJECT } PRIVATE zlib expat lz4 md5 tomcrypt ) <nl> + use_scaleform ( ) <nl> + <nl> + if ( WIN32 ) <nl> set_property ( TARGET $ { THIS_PROJECT } APPEND_STRING PROPERTY LINK_FLAGS " / NODEFAULTLIB : libcmt . lib / NODEFAULTLIB : libcpmt . lib " ) <nl> - target_link_libraries ( $ { THIS_PROJECT } PRIVATE wininet Shell32 Ole32 Gdi32 ) <nl> - elseif ( LINUX ) <nl> - target_link_libraries ( $ { THIS_PROJECT } PRIVATE ncursesw m ) <nl> - elseif ( APPLE ) <nl> - target_link_libraries ( $ { THIS_PROJECT } PRIVATE ncurses m ) <nl> - elseif ( ORBIS ) <nl> - target_link_libraries ( $ { THIS_PROJECT } PRIVATE SceMsgDialog_stub_weak SceImeDialog_stub_weak ) <nl> - target_link_libraries ( $ { THIS_PROJECT } PRIVATE $ < $ < NOT : $ < CONFIG : Release > > : SceDbg_stub_weak > ) <nl> - elseif ( DURANGO ) <nl> - set_property ( TARGET $ { THIS_PROJECT } APPEND PROPERTY COMPILE_FLAGS " \ " / AI $ { DURANGO_PLATFORM_SDK } / ExtensionSDKs / Xbox Services API / 8 . 0 / References / CommonConfiguration / neutral \ " " ) <nl> - target_link_libraries ( $ { THIS_PROJECT } PRIVATE uuid acphal ) <nl> - elseif ( ANDROID ) <nl> - target_include_directories ( $ { THIS_PROJECT } PRIVATE " $ { SDK_DIR } / SDL2 / include / linux " " $ { SDK_DIR } / SDL2 / include / SDL " ) <nl> - endif ( ) <nl> - <nl> - if ( OPTION_ENABLE_CRASHRPT ) <nl> - target_compile_definitions ( $ { THIS_PROJECT } PRIVATE CRY_USE_CRASHRPT = 1 ) <nl> - target_link_libraries ( $ { THIS_PROJECT } PRIVATE crashrpt ) <nl> - endif ( ) <nl> + target_link_libraries ( $ { THIS_PROJECT } PRIVATE wininet Shell32 Ole32 Gdi32 ) <nl> + elseif ( LINUX ) <nl> + target_link_libraries ( $ { THIS_PROJECT } PRIVATE ncursesw m ) <nl> + elseif ( APPLE ) <nl> + target_link_libraries ( $ { THIS_PROJECT } PRIVATE ncurses m ) <nl> + elseif ( ORBIS ) <nl> + target_link_libraries ( $ { THIS_PROJECT } PRIVATE SceMsgDialog_stub_weak SceImeDialog_stub_weak ) <nl> + target_link_libraries ( $ { THIS_PROJECT } PRIVATE $ < $ < NOT : $ < CONFIG : Release > > : SceDbg_stub_weak > ) <nl> + elseif ( DURANGO ) <nl> + set_property ( TARGET $ { THIS_PROJECT } APPEND PROPERTY COMPILE_FLAGS " \ " / AI $ { DURANGO_PLATFORM_SDK } / ExtensionSDKs / Xbox Services API / 8 . 0 / References / CommonConfiguration / neutral \ " " ) <nl> + target_link_libraries ( $ { THIS_PROJECT } PRIVATE uuid acphal ) <nl> + elseif ( ANDROID ) <nl> + target_include_directories ( $ { THIS_PROJECT } PRIVATE " $ { SDK_DIR } / SDL2 / include / linux " " $ { SDK_DIR } / SDL2 / include / SDL " ) <nl> + endif ( ) <nl> + <nl> + if ( OPTION_ENABLE_CRASHRPT ) <nl> + target_compile_definitions ( $ { THIS_PROJECT } PRIVATE CRY_USE_CRASHRPT = 1 ) <nl> + target_link_libraries ( $ { THIS_PROJECT } PRIVATE crashrpt ) <nl> + endif ( ) <nl> <nl> if ( ORBIS OR CMAKE_CXX_COMPILER_ID STREQUAL " Clang " ) <nl> target_compile_options ( $ { THIS_PROJECT } PRIVATE <nl> MACRO ( setup_crysystem ) <nl> - Wno - dynamic - class - memaccess <nl> - Wno - comment <nl> ) <nl> - elseif ( CMAKE_CXX_COMPILER_ID STREQUAL " GNU " ) <nl> + elseif ( CMAKE_CXX_COMPILER_ID STREQUAL " GNU " ) <nl> target_compile_options ( $ { THIS_PROJECT } PRIVATE <nl> - Wno - unused - function <nl> - Wno - unused - value <nl> MACRO ( setup_crysystem ) <nl> - Wno - format <nl> - Wno - switch <nl> ) <nl> - endif ( ) <nl> + endif ( ) <nl> ENDMACRO ( ) <nl> <nl> if ( OPTION_ENABLE_CRASHRPT ) <nl> add_subdirectory ( " $ { CRY_LIBS_DIR } / crashrpt " " $ { CMAKE_CURRENT_BINARY_DIR } / crashrpt " ) <nl> endif ( ) <nl> <nl> - if ( ANDROID ) <nl> - # Force comping " CryDLMalloc . c " as C + + <nl> - set_source_files_properties ( " CryDLMalloc . c " PROPERTIES LANGUAGE CXX ) <nl> + if ( ANDROID OR ORBIS ) <nl> + # Forcing C11 standard on C files and with that overriding project C + + standard that is being applied . <nl> + set_source_files_properties ( " CryDLMalloc . c " PROPERTIES COMPILE_FLAGS " - std = c11 " ) <nl> endif ( ) <nl> <nl> CryEngineModule ( CrySystem PCH " StdAfx . cpp " SOLUTION_FOLDER " CryEngine " ) <nl> if ( OPTION_UNIT_TEST AND NOT OPTION_STATIC_LINKING ) # Currently an additional sta <nl> CryEngineModule ( CrySystemLib PCH " StdAfx . cpp " SOLUTION_FOLDER " CryEngine " FORCE_STATIC ) <nl> setup_crysystem ( ) <nl> endif ( ) <nl> - <nl> mmm a / Code / CryEngine / CrySystem / XConsoleVariable . cpp <nl> ppp b / Code / CryEngine / CrySystem / XConsoleVariable . cpp <nl> void CXConsoleVariableCVarGroup : : OnCVarChangeFunc ( ICVar * pVar ) <nl> <nl> int value = pThis - > GetIVal ( ) ; <nl> <nl> - / / all sys_spec_ * should be clamped by the max available spec <nl> - if ( strnicmp ( pThis - > GetName ( ) , " sys_spec " , 8 ) = = 0 ) <nl> + / / only the global sys_spec should be clamped by the max available spec and not the individual sys_spec_ * <nl> + if ( stricmp ( pThis - > GetName ( ) , " sys_spec " ) = = 0 ) <nl> { <nl> int maxSpec = gEnv - > pSystem - > GetMaxConfigSpec ( ) ; <nl> if ( value > maxSpec ) <nl> mmm a / Code / Sandbox / EditorInterface / IEditor . h <nl> ppp b / Code / Sandbox / EditorInterface / IEditor . h <nl> enum EEditorNotifyEvent <nl> <nl> eNotify_OnDataBaseUpdate , / / DataBase Library was modified . <nl> <nl> - eNotify_OnLayerImportBegin , / / layer import was started <nl> - eNotify_OnLayerImportEnd , / / layer import completed <nl> - <nl> eNotify_OnBeginSWNewScene , / / Sent when SW document is begin to be cleared . <nl> eNotify_OnEndSWNewScene , / / Sent after SW document have been cleared . <nl> eNotify_OnBeginSWMoveTo , / / moveto operation was started <nl> struct IEditor <nl> virtual bool IsCGroup ( CBaseObject * pObject ) = 0 ; <nl> virtual void ResumeUpdateCGroup ( CBaseObject * pObject ) = 0 ; <nl> virtual bool SuspendUpdateCGroup ( CBaseObject * pObject ) = 0 ; <nl> - virtual void SyncPrefabCPrefabObject ( CBaseObject * oObject , const SObjectChangedContext & context ) = 0 ; <nl> + virtual void SyncPrefabCPrefabObject ( CBaseObject * pObject , const SObjectChangedContext & context ) = 0 ; <nl> virtual bool IsModifyInProgressCPrefabObject ( CBaseObject * oObject ) = 0 ; <nl> virtual bool IsCPrefabObject ( CBaseObject * pObject ) = 0 ; <nl> virtual bool IsGroupOpen ( CBaseObject * pObject ) = 0 ; <nl> mmm a / Code / Sandbox / EditorQt / IEditorImpl . h <nl> ppp b / Code / Sandbox / EditorQt / IEditorImpl . h <nl> class SANDBOX_API CEditorImpl : public IEditor , public ISystemEventListener <nl> virtual void RemoveWaitProgress ( CWaitProgress * pProgress ) ; <nl> virtual void RegisterEntity ( IRenderNode * pRenderNode ) ; <nl> virtual void UnRegisterEntityAsJob ( IRenderNode * pRenderNode ) ; <nl> - virtual void SyncPrefabCPrefabObject ( CBaseObject * oObject , const SObjectChangedContext & context ) ; <nl> + virtual void SyncPrefabCPrefabObject ( CBaseObject * pObject , const SObjectChangedContext & context ) ; <nl> virtual bool IsModifyInProgressCPrefabObject ( CBaseObject * oObject ) ; <nl> virtual void OnPrefabMake ( ) ; <nl> virtual IEditorMaterial * LoadMaterial ( const string & name ) ; <nl> class SANDBOX_API CEditorImpl : public IEditor , public ISystemEventListener <nl> void OnObjectHideMaskChanged ( ) ; <nl> <nl> / / ! List of all notify listeners . <nl> - std : : list < IEditorNotifyListener * > m_listeners ; <nl> - <nl> - int m_objectHideMask ; <nl> - EOperationMode m_operationMode ; <nl> - ISystem * m_pSystem ; <nl> - CClassFactory * m_pClassFactory ; <nl> - CEditorCommandManager * m_pCommandManager ; <nl> - CAssetManager * m_pAssetManager ; <nl> - CTrayArea * m_pTrayArea ; <nl> - INotificationCenter * m_pNotificationCenter ; <nl> - CPersonalizationManager * m_pPersonalizationManager ; <nl> - CPreferences * m_pPreferences ; <nl> - CEditorPythonManager * m_pPythonManager ; <nl> - CPolledKeyManager * m_pPolledKeyManager ; <nl> - CObjectManager * m_pObjectManager ; <nl> - CGizmoManager * m_pGizmoManager ; <nl> - CPluginManager * m_pPluginManager ; <nl> - CViewManager * m_pViewManager ; <nl> - IUndoManager * m_pUndoManager ; <nl> - bool m_bUpdates ; <nl> - Version m_fileVersion ; <nl> - Version m_productVersion ; <nl> - CXmlTemplateRegistry m_templateRegistry ; <nl> - CIconManager * m_pIconManager ; <nl> - wstring m_masterCDFolder ; <nl> - string m_userFolder ; <nl> - bool m_bSelectionLocked ; <nl> - CAIManager * m_pAIManager ; <nl> - CUIManager * m_pUIManager ; <nl> - CCustomActionsEditorManager * m_pCustomActionsManager ; <nl> - CEditorFlowGraphModuleManager * m_pFlowGraphModuleManager ; <nl> - CMaterialFXGraphMan * m_pMatFxGraphManager ; <nl> - CFlowGraphDebuggerEditor * m_pFlowGraphDebuggerEditor ; <nl> - CGameEngine * m_pGameEngine ; <nl> - CEntityPrototypeManager * m_pEntityManager ; <nl> - CMaterialManager * m_pMaterialManager ; <nl> - CParticleManager * m_particleManager ; <nl> - CPrefabManager * m_pPrefabManager ; <nl> - CBroadcastManager * m_pGlobalBroadcastManager ; <nl> - CGameTokenManager * m_pGameTokenManager ; <nl> - CLensFlareManager * m_pLensFlareManager ; <nl> - ISourceControl * m_pSourceControl ; <nl> - CFlowGraphManager * m_pFlowGraphManager ; <nl> + std : : list < IEditorNotifyListener * > m_listeners ; <nl> + <nl> + int m_objectHideMask ; <nl> + EOperationMode m_operationMode ; <nl> + ISystem * m_pSystem ; <nl> + CClassFactory * m_pClassFactory ; <nl> + CEditorCommandManager * m_pCommandManager ; <nl> + CAssetManager * m_pAssetManager ; <nl> + CTrayArea * m_pTrayArea ; <nl> + INotificationCenter * m_pNotificationCenter ; <nl> + CPersonalizationManager * m_pPersonalizationManager ; <nl> + CPreferences * m_pPreferences ; <nl> + CEditorPythonManager * m_pPythonManager ; <nl> + CPolledKeyManager * m_pPolledKeyManager ; <nl> + CObjectManager * m_pObjectManager ; <nl> + CGizmoManager * m_pGizmoManager ; <nl> + CPluginManager * m_pPluginManager ; <nl> + CViewManager * m_pViewManager ; <nl> + IUndoManager * m_pUndoManager ; <nl> + bool m_bUpdates ; <nl> + Version m_fileVersion ; <nl> + Version m_productVersion ; <nl> + CXmlTemplateRegistry m_templateRegistry ; <nl> + CIconManager * m_pIconManager ; <nl> + wstring m_masterCDFolder ; <nl> + string m_userFolder ; <nl> + bool m_bSelectionLocked ; <nl> + CAIManager * m_pAIManager ; <nl> + CUIManager * m_pUIManager ; <nl> + CCustomActionsEditorManager * m_pCustomActionsManager ; <nl> + CEditorFlowGraphModuleManager * m_pFlowGraphModuleManager ; <nl> + CMaterialFXGraphMan * m_pMatFxGraphManager ; <nl> + CFlowGraphDebuggerEditor * m_pFlowGraphDebuggerEditor ; <nl> + CGameEngine * m_pGameEngine ; <nl> + CEntityPrototypeManager * m_pEntityManager ; <nl> + CMaterialManager * m_pMaterialManager ; <nl> + CParticleManager * m_particleManager ; <nl> + CPrefabManager * m_pPrefabManager ; <nl> + CBroadcastManager * m_pGlobalBroadcastManager ; <nl> + CGameTokenManager * m_pGameTokenManager ; <nl> + CLensFlareManager * m_pLensFlareManager ; <nl> + ISourceControl * m_pSourceControl ; <nl> + CFlowGraphManager * m_pFlowGraphManager ; <nl> <nl> CUIEnumsDatabase * m_pUIEnumsDatabase ; <nl> / / ! Currently used ruler <nl> mmm a / Code / Sandbox / EditorQt / Objects / Group . cpp <nl> ppp b / Code / Sandbox / EditorQt / Objects / Group . cpp <nl> bool CGroup : : CreateFrom ( std : : vector < CBaseObject * > & objects ) <nl> SetLayer ( pLastSelectedObject - > GetLayer ( ) ) ; <nl> GetIEditorImpl ( ) - > GetIUndoManager ( ) - > Resume ( ) ; <nl> <nl> + / / add ourselves to the last selected group <nl> if ( CBaseObject * pLastParent = pLastSelectedObject - > GetGroup ( ) ) <nl> pLastParent - > AddMember ( this ) ; <nl> } <nl> bool CGroup : : CreateFrom ( std : : vector < CBaseObject * > & objects ) <nl> pObjectPrefab = ( CPrefabObject * ) pObject - > GetPrefab ( ) ; <nl> <nl> / / Sanity check if user is trying to group objects from different prefabs <nl> - if ( pPrefabToCompareAgainst & & pObjectPrefab ) <nl> + if ( pPrefabToCompareAgainst & & pObjectPrefab & & pPrefabToCompareAgainst - > GetPrefabGuid ( ) ! = pObjectPrefab - > GetPrefabGuid ( ) ) <nl> { <nl> return false ; <nl> } <nl> bool CGroup : : CreateFrom ( std : : vector < CBaseObject * > & objects ) <nl> <nl> AddMembers ( objects ) ; <nl> <nl> - / / Signal that we added a group to the prefab <nl> - if ( pPrefabToCompareAgainst ) <nl> - pPrefabToCompareAgainst - > AddMember ( this ) ; <nl> - <nl> GetIEditorImpl ( ) - > GetObjectManager ( ) - > SelectObject ( this ) ; <nl> GetIEditorImpl ( ) - > SetModifiedFlag ( ) ; <nl> - <nl> return true ; <nl> } <nl> <nl> void CGroup : : AddMembers ( std : : vector < CBaseObject * > & objects , bool keepPos / * = tru <nl> return ; <nl> } <nl> <nl> + / / If the object is in another prefab it needs to be removed from it ( aka deserialize from CPrefabItem ) <nl> + / / CASES : <nl> + / / 1 - from top level of a prefab to a group : Needs remove from prefab and add to group ( he ' ll be the one to serialize ) <nl> + / / 2 - from different groups in same prefab : Needs no remove from prefab , but remove from group <nl> + / / 3 - from another prefab : Needs remove from prefab <nl> + / / 4 - from outside group to inside group in prefab : Needs remove from old group and add to new group in prefab <nl> + for ( auto pObj : objects ) <nl> + { <nl> + CBaseObject * pOldParent = pObj - > GetGroup ( ) ; / / This can also be a prefab , and we want it to be like this <nl> + if ( pOldParent ) <nl> + { <nl> + pOldParent - > RemoveMember ( pObj ) ; <nl> + } <nl> + } <nl> + <nl> + CGroup * pPrefab = static_cast < CGroup * > ( GetPrefab ( ) ) ; <nl> + <nl> auto batchProcessDispatcher = GetObjectManager ( ) - > GetBatchProcessDispatcher ( ) ; <nl> batchProcessDispatcher . Start ( objects ) ; <nl> <nl> void CGroup : : AddMembers ( std : : vector < CBaseObject * > & objects , bool keepPos / * = tru <nl> m_members . push_back ( pObj ) ; <nl> } <nl> <nl> - AttachChildren ( objects , keepPos ) ; <nl> - <nl> - CGroup * pPrefab = static_cast < CGroup * > ( GetPrefab ( ) ) ; <nl> - if ( oldNumMembers ! = m_members . size ( ) & & pPrefab ) <nl> + / / Attach children already provokes serialization into lib ( i . e ModifyTransform ) , if the object comes from outside guids must be generated before <nl> + / / This needs to happen here or the prefab delete in the attach will mess up id generation <nl> + if ( pPrefab ) <nl> { <nl> - for ( auto i = oldNumMembers ; i < m_members . size ( ) ; + + i ) <nl> + CPrefabObject * pPrefabObject = ( CPrefabObject * ) pPrefab ; <nl> + for ( auto pObj : objects ) <nl> { <nl> - pPrefab - > AddMember ( m_members [ i ] , true ) ; <nl> + pPrefabObject - > GenerateGUIDsForObjectAndChildren ( pObj ) ; <nl> } <nl> } <nl> <nl> + / / Actually attach the objects to the group instance <nl> + AttachChildren ( objects , keepPos ) ; <nl> + <nl> + / / If in a prefab re serialize the group and regenerate all the members in all the group ' s instances <nl> + UpdatePrefab ( eOCOT_Modify ) ; <nl> + <nl> InvalidateBBox ( ) ; <nl> } <nl> <nl> void CGroup : : RemoveMembers ( std : : vector < CBaseObject * > & members , bool keepPos / * = <nl> FilterOutNonMembers ( members ) ; <nl> <nl> CBaseObject * pPrefab = GetPrefab ( ) ; <nl> - if ( pPrefab ) <nl> - { <nl> - pPrefab - > RemoveMembers ( members , keepPos , placeOnRoot ) ; <nl> - } <nl> - <nl> if ( pPrefab ! = this ) <nl> { <nl> DetachChildren ( members , keepPos , placeOnRoot ) ; <nl> } <nl> <nl> UpdateGroup ( ) ; <nl> + <nl> + / / Since we removed an item the group needs to be re serialized into the prefab item <nl> + UpdatePrefab ( eOCOT_Modify ) ; <nl> + <nl> + / / if we move out from prefab the prefab flag needs to be cleared . <nl> + for ( CBaseObject * pObject : members ) <nl> + { <nl> + if ( ! pObject - > GetPrefab ( ) ) <nl> + pObject - > ClearFlags ( OBJFLAG_PREFAB ) ; <nl> + } <nl> } <nl> <nl> void CGroup : : FilterOutNonMembers ( std : : vector < CBaseObject * > & objects ) <nl> void CGroup : : SerializeMembers ( CObjectArchive & ar ) <nl> { <nl> if ( ! ar . bUndo ) <nl> { <nl> + / / If we are loading a group that ' s already full we need to clean it up and reinstance all it ' s members from the ground up <nl> int num = static_cast < int > ( m_members . size ( ) ) ; <nl> - for ( int i = 0 ; i < num ; + + i ) <nl> + for ( int i = num - 1 ; i > = 0 ; i - - ) <nl> { <nl> CBaseObject * member = m_members [ i ] ; <nl> - member - > DetachThis ( true ) ; <nl> + GetIEditor ( ) - > GetObjectManager ( ) - > DeleteObject ( member ) ; <nl> } <nl> m_members . clear ( ) ; <nl> + m_children . clear ( ) ; <nl> <nl> - / / Loading . <nl> + / / Loading , reload all the children from XML <nl> XmlNodeRef childsRoot = xmlNode - > findChild ( " Objects " ) ; <nl> if ( childsRoot ) <nl> { <nl> void CGroup : : SerializeMembers ( CObjectArchive & ar ) <nl> } <nl> else <nl> { <nl> - if ( m_members . size ( ) > 0 & & ! ar . bUndo & & ! ar . IsSavingInPrefab ( ) ) <nl> + if ( m_members . size ( ) > 0 & & ! ar . bUndo ) <nl> { <nl> / / Saving . <nl> XmlNodeRef root = xmlNode - > newChild ( " Objects " ) ; <nl> void CGroup : : SerializeMembers ( CObjectArchive & ar ) <nl> for ( int i = 0 ; i < num ; + + i ) <nl> { <nl> CBaseObject * obj = m_members [ i ] ; <nl> - ar . SaveObject ( obj , true ) ; <nl> + ar . SaveObject ( obj , true , true ) ; <nl> } <nl> } <nl> } <nl> void CGroup : : DetachChildren ( std : : vector < CBaseObject * > & objects , bool shouldKeepP <nl> { <nl> pGrandParent - > AddMembers ( objects , shouldKeepPos ) ; <nl> } <nl> + / / it ' s important we notify the layer that something changed as we are moving something that was serialized directly inside it to another place ( aka group or prefab ) <nl> + / / before this the layer was not notified at all and you ended up with two copies of the same thing <nl> + GetLayer ( ) - > SetModified ( true ) ; <nl> } <nl> <nl> void CGroup : : DetachAll ( bool keepPos / * = true * / , bool placeOnRoot / * = false * / ) <nl> void CGroup : : AttachChildren ( std : : vector < CBaseObject * > & objects , bool shouldKeepP <nl> <nl> RemoveIfAlreadyChildrenOf ( this , objects ) ; <nl> <nl> - CBatchAttachChildrenTransformationsHandler transormatoinsHandler ( this , objects , shouldKeepPos , shouldInvalidateTM ) ; <nl> + CBatchAttachChildrenTransformationsHandler transformationsHandler ( this , objects , shouldKeepPos , shouldInvalidateTM ) ; <nl> <nl> { <nl> CScopedSuspendUndo suspendUndo ; <nl> <nl> - for ( auto pChild : objects ) <nl> - { <nl> - pChild - > m_bSuppressUpdatePrefab = true ; <nl> - } <nl> - <nl> ForEachParentOf ( objects , [ shouldKeepPos ] ( CGroup * pParent , std : : vector < CBaseObject * > & children ) <nl> { <nl> if ( pParent ) <nl> { <nl> + / / TODO : optimize <nl> + for ( auto pChild : children ) <nl> + { <nl> + / / If this object is in a prefab we have to clean it up ( aka remove the serialized entry from the XML of the item ) , before the object is assigned to the new prefab <nl> + pChild - > UpdatePrefab ( eOCOT_Delete ) ; <nl> + } <nl> + <nl> pParent - > DetachChildren ( children , shouldKeepPos , true ) ; <nl> } <nl> else <nl> void CGroup : : AttachChildren ( std : : vector < CBaseObject * > & objects , bool shouldKeepP <nl> <nl> GetObjectManager ( ) - > NotifyObjectListeners ( objects , CObjectPreAttachedEvent ( this , shouldKeepPos ) ) ; <nl> <nl> - transormatoinsHandler . HandlePreAttach ( ) ; <nl> + transformationsHandler . HandlePreAttach ( ) ; <nl> } <nl> <nl> for ( auto pChild : objects ) <nl> void CGroup : : AttachChildren ( std : : vector < CBaseObject * > & objects , bool shouldKeepP <nl> { <nl> CScopedSuspendUndo suspendUndo ; <nl> <nl> - transormatoinsHandler . HandleAttach ( ) ; <nl> + transformationsHandler . HandleAttach ( ) ; <nl> <nl> GetObjectManager ( ) - > NotifyObjectListeners ( objects , CObjectAttachedEvent ( this ) ) ; <nl> <nl> - for ( auto pChild : objects ) <nl> - { <nl> - pChild - > m_bSuppressUpdatePrefab = false ; <nl> - } <nl> + / / This causes the group to be re - serialized into the prefab <nl> UpdatePrefab ( eOCOT_ModifyTransform ) ; <nl> } <nl> <nl> void CGroup : : AttachChildren ( std : : vector < CBaseObject * > & objects , bool shouldKeepP <nl> { <nl> CUndo : : Record ( new CUndoBatchAttachBaseObject ( objects , oldLayers , shouldKeepPos , false , true ) ) ; <nl> } <nl> + <nl> + / / it ' s important we notify the layer that something changed as we are moving something that was serialized directly inside it to another place ( aka group or prefab ) <nl> + / / before this the layer was not notified at all and you ended up with two copies of the same thing <nl> + GetLayer ( ) - > SetModified ( true ) ; <nl> } <nl> <nl> void CGroup : : SetMaterial ( IEditorMaterial * pMtl ) <nl> void CGroup : : UpdatePivot ( const Vec3 & newWorldPivotPos ) <nl> <nl> CBaseObject : : SetWorldPos ( newWorldPivotPos ) ; <nl> m_bUpdatingPivot = false ; <nl> - } <nl> + } <nl> \ No newline at end of file <nl> mmm a / Code / Sandbox / EditorQt / Objects / ObjectLayerManager . cpp <nl> ppp b / Code / Sandbox / EditorQt / Objects / ObjectLayerManager . cpp <nl> void CLayerChangeEvent : : Send ( ) const <nl> CObjectLayerManager : : CObjectLayerManager ( CObjectManager * pObjectManager ) : <nl> m_pObjectManager ( pObjectManager ) , <nl> m_layersPath ( LAYER_PATH ) , <nl> - m_bCanModifyLayers ( false ) , <nl> + m_bCanModifyLayers ( true ) , <nl> m_bOverwriteDuplicates ( false ) , <nl> m_visibleSetLayer ( CryGUID : : Null ( ) ) <nl> { <nl> void CObjectLayerManager : : OnEditorNotifyEvent ( EEditorNotifyEvent event ) <nl> { <nl> switch ( event ) <nl> { <nl> + case eNotify_OnBeginNewScene : / / Intentional fallthrough <nl> case eNotify_OnBeginSceneOpen : <nl> m_bCanModifyLayers = false ; <nl> break ; <nl> + case eNotify_OnEndNewScene : / / Intentional fallthrough <nl> case eNotify_OnEndSceneOpen : <nl> m_bCanModifyLayers = true ; <nl> break ; <nl> - case eNotify_OnLayerImportBegin : <nl> - m_bCanModifyLayers = false ; <nl> - break ; <nl> - case eNotify_OnLayerImportEnd : <nl> - m_bCanModifyLayers = true ; <nl> - break ; <nl> } <nl> } <nl> <nl> mmm a / Code / Sandbox / EditorQt / Objects / PrefabObject . cpp <nl> ppp b / Code / Sandbox / EditorQt / Objects / PrefabObject . cpp <nl> <nl> # include " CryEditDoc . h " <nl> <nl> # include < Controls / DynamicPopupMenu . h > <nl> + # include < IDataBaseManager . h > <nl> + # include < IUndoManager . h > <nl> # include < LevelEditor / Tools / PickObjectTool . h > <nl> - # include < Objects / ObjectLoader . h > <nl> # include < Objects / InspectorWidgetCreator . h > <nl> + # include < Objects / IObjectLayer . h > <nl> + # include < Objects / ObjectLoader . h > <nl> # include < Preferences / SnappingPreferences . h > <nl> # include < Preferences / ViewportPreferences . h > <nl> # include < Serialization / Decorators / EditorActionButton . h > <nl> # include < Serialization / Decorators / EditToolButton . h > <nl> - # include < IDataBaseManager . h > <nl> - # include < IUndoManager . h > <nl> # include < Viewport . h > <nl> <nl> # include < Util / MFCUtil . h > <nl> class CScopedPrefabEventsDelay <nl> } <nl> } <nl> <nl> - ~ CScopedPrefabEventsDelay ( ) noexcept ( false ) <nl> + ~ CScopedPrefabEventsDelay ( ) noexcept ( false ) <nl> { <nl> Resume ( ) ; <nl> } <nl> void CPrefabObject : : Done ( ) <nl> <nl> bool CPrefabObject : : CreateFrom ( std : : vector < CBaseObject * > & objects ) <nl> { <nl> - if ( ! CGroup : : CreateFrom ( objects ) ) <nl> - return false ; <nl> + / / Clear selection <nl> + GetIEditorImpl ( ) - > GetObjectManager ( ) - > ClearSelection ( ) ; <nl> + CBaseObject * pLastSelectedObject = nullptr ; <nl> + CBaseObject * pParent = nullptr ; <nl> + / / Put the newly created group on the last selected object ' s layer <nl> + if ( objects . size ( ) ) <nl> + { <nl> + pLastSelectedObject = objects [ objects . size ( ) - 1 ] ; <nl> + GetIEditorImpl ( ) - > GetIUndoManager ( ) - > Suspend ( ) ; <nl> + SetLayer ( pLastSelectedObject - > GetLayer ( ) ) ; <nl> + GetIEditorImpl ( ) - > GetIUndoManager ( ) - > Resume ( ) ; <nl> + pParent = pLastSelectedObject - > GetParent ( ) ; <nl> + } <nl> + <nl> + / / Check if the children come from more than one prefab , as that ' s not allowed <nl> + CPrefabObject * pPrefabToCompareAgainst = nullptr ; <nl> + CPrefabObject * pObjectPrefab = nullptr ; <nl> + <nl> + for ( auto pObject : objects ) <nl> + { <nl> + pObjectPrefab = ( CPrefabObject * ) pObject - > GetPrefab ( ) ; <nl> + <nl> + / / Sanity check if user is trying to group objects from different prefabs <nl> + if ( pPrefabToCompareAgainst & & pObjectPrefab & & pPrefabToCompareAgainst - > GetPrefabGuid ( ) ! = pObjectPrefab - > GetPrefabGuid ( ) ) <nl> + { <nl> + CryWarning ( VALIDATOR_MODULE_EDITOR , VALIDATOR_WARNING , " Cannot Create a new prefab from these objects , they are already owned by different prefabs " ) ; <nl> + return false ; <nl> + } <nl> + <nl> + if ( ! pPrefabToCompareAgainst ) <nl> + pPrefabToCompareAgainst = pObjectPrefab ; <nl> + } <nl> + / / If we are creating a prefab inside another prefab we first remove all the objects from the previous owner prefab and then we add them to the new one <nl> + for ( CBaseObject * pObject : objects ) <nl> + { <nl> + if ( pObject - > IsPartOfPrefab ( ) ) <nl> + { <nl> + pObject - > GetPrefab ( ) - > RemoveMember ( pObject , true , true ) ; <nl> + } <nl> + } <nl> + / / Add them to the new one , serialize into the prefab item and update the library <nl> + for ( CBaseObject * pObject : objects ) <nl> + { <nl> + AddMember ( pObject ) ; <nl> + } <nl> + <nl> + / / add the prefab itself to the last selected object parent <nl> + if ( pParent ) <nl> + pParent - > AddMember ( this ) ; <nl> + <nl> + GetIEditorImpl ( ) - > GetObjectManager ( ) - > SelectObject ( this ) ; <nl> + GetIEditorImpl ( ) - > SetModifiedFlag ( ) ; <nl> <nl> CRY_ASSERT_MESSAGE ( m_pPrefabItem , " Trying to create a prefab that has no Prefab Item " ) ; <nl> m_pPrefabItem - > SetModified ( ) ; <nl> int CPrefabObject : : MouseCreateCallback ( IDisplayViewport * view , EMouseEvent event <nl> { <nl> if ( children . GetObject ( i ) - > GetCollisionEntity ( ) ) <nl> { <nl> - IPhysicalEntity * collisionEntity = children . GetObject ( i ) - > GetCollisionEntity ( ) ; <nl> + IPhysicalEntity * collisionEntity = children . GetObject ( i ) - > GetCollisionEntity ( ) ; <nl> pe_params_part collision ; <nl> collisionEntity - > GetParams ( & collision ) ; <nl> collision . flagsAND & = ~ ( geom_colltype_ray ) ; <nl> int CPrefabObject : : MouseCreateCallback ( IDisplayViewport * view , EMouseEvent event <nl> } <nl> } <nl> } <nl> - <nl> + <nl> if ( creationState = = MOUSECREATE_OK ) <nl> { <nl> CSelectionGroup children ; <nl> int CPrefabObject : : MouseCreateCallback ( IDisplayViewport * view , EMouseEvent event <nl> { <nl> if ( children . GetObject ( i ) - > GetCollisionEntity ( ) ) <nl> { <nl> - IPhysicalEntity * collisionEntity = children . GetObject ( i ) - > GetCollisionEntity ( ) ; <nl> + IPhysicalEntity * collisionEntity = children . GetObject ( i ) - > GetCollisionEntity ( ) ; <nl> pe_params_part collision ; <nl> collisionEntity - > GetParams ( & collision ) ; <nl> collision . flagsOR | = ( geom_colltype_ray ) ; <nl> void CPrefabObject : : AddMembers ( std : : vector < CBaseObject * > & objects , bool shouldKe <nl> return ; <nl> } <nl> <nl> - std : : vector < CBaseObject * > objectsToAttach ; <nl> - objectsToAttach . reserve ( objects . size ( ) ) ; <nl> - std : : copy_if ( objects . cbegin ( ) , objects . cend ( ) , std : : back_inserter ( objectsToAttach ) , [ this ] ( CBaseObject * pObject ) <nl> - { <nl> - return ! pObject - > GetParent ( ) ; <nl> - } ) ; <nl> - <nl> - AttachChildren ( objectsToAttach , shouldKeepPos ) ; <nl> + AttachChildren ( objects , shouldKeepPos ) ; <nl> <nl> + / / As we are moving things in the prefab new guids need to be generated for every object we are adding <nl> + / / The guids generated here are serialized in IdInPrefab , also the prefab flag and the correct layer is set <nl> for ( CBaseObject * pObject : objects ) <nl> { <nl> - if ( pObject - > IsKindOf ( RUNTIME_CLASS ( CPrefabObject ) ) ) <nl> - { <nl> - if ( static_cast < CPrefabObject * > ( pObject ) - > m_pPrefabItem = = m_pPrefabItem ) <nl> - { <nl> - Warning ( " Object has the same prefab item " ) ; <nl> - return ; <nl> - } <nl> - } <nl> - <nl> - SetObjectPrefabFlagAndLayer ( pObject ) ; <nl> - InitObjectPrefabId ( pObject ) ; <nl> - SetPrefabFlagForLinkedObjects ( pObject ) ; <nl> - <nl> - CryGUID newGuid = CPrefabChildGuidProvider ( this ) . GetFor ( pObject ) ; <nl> - if ( CUndo : : IsRecording ( ) ) <nl> - { <nl> - CUndo : : Record ( new CUndoChangeGuid ( pObject , newGuid ) ) ; <nl> - } <nl> - GetObjectManager ( ) - > ChangeObjectId ( pObject - > GetId ( ) , newGuid ) ; <nl> + GenerateGUIDsForObjectAndChildren ( pObject ) ; <nl> <nl> + / / Add the top level object to the prefab so that it can be serialized and serialize all the children <nl> SObjectChangedContext context ; <nl> context . m_operation = eOCOT_Add ; <nl> context . m_modifiedObjectGlobalId = pObject - > GetId ( ) ; <nl> context . m_modifiedObjectGuidInPrefab = pObject - > GetIdInPrefab ( ) ; <nl> <nl> + / / Call a sync with eOCOT_Modify <nl> SyncPrefab ( context ) ; <nl> + <nl> + / / In the case that we have moved something inside the prefab from the same layer ( e . g group from layer to Prefab ) , the layer needs to be marked as modified . <nl> + pObject - > GetLayer ( ) - > SetModified ( true ) ; <nl> } <nl> <nl> IObjectManager * pObjectManager = GetIEditor ( ) - > GetObjectManager ( ) ; <nl> pObjectManager - > NotifyPrefabObjectChanged ( this ) ; <nl> <nl> / / if the currently modified prefab is selected make sure to refresh the inspector <nl> - if ( pObjectManager - > GetSelection ( ) - > IsContainObject ( this ) ) <nl> + if ( GetPrefab ( ) & & GetIEditor ( ) - > GetObjectManager ( ) - > GetSelection ( ) - > IsContainObject ( this ) | | pObjectManager - > GetSelection ( ) - > IsContainObject ( GetPrefab ( ) ) ) <nl> pObjectManager - > EmitPopulateInspectorEvent ( ) ; <nl> } <nl> <nl> void CPrefabObject : : RemoveMembers ( std : : vector < CBaseObject * > & members , bool keepP <nl> SyncPrefab ( context ) ; <nl> <nl> pObject - > ClearFlags ( OBJFLAG_PREFAB ) ; <nl> + <nl> + / / In the case that we have moved something outside the prefab from the same layer ( e . g group from Prefab to Layer ) , the layer needs to be marked as modified . <nl> + pObject - > GetLayer ( ) - > SetModified ( true ) ; <nl> } <nl> <nl> CGroup : : ForEachParentOf ( members , [ placeOnRoot , this ] ( CGroup * pParent , std : : vector < CBaseObject * > & children ) <nl> void CPrefabObject : : SyncPrefab ( const SObjectChangedContext & context ) <nl> return ; <nl> } <nl> <nl> - / / Group delete <nl> - if ( context . m_operation = = eOCOT_Delete ) <nl> - { <nl> - CBaseObject * pObj = GetIEditor ( ) - > GetObjectManager ( ) - > FindObject ( context . m_modifiedObjectGlobalId ) ; <nl> - if ( pObj & & pObj - > IsKindOf ( RUNTIME_CLASS ( CGroup ) ) & & ! pObj - > IsKindOf ( RUNTIME_CLASS ( CPrefabObject ) ) ) <nl> - { <nl> - TBaseObjects children ; <nl> - for ( int i = 0 , count = pObj - > GetChildCount ( ) ; i < count ; + + i ) <nl> - { <nl> - children . push_back ( pObj - > GetChild ( i ) ) ; <nl> - } <nl> - for ( int i = 0 , count = children . size ( ) ; i < count ; + + i ) <nl> - { <nl> - RemoveMember ( children [ i ] , true ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> if ( m_pPrefabItem ) <nl> { <nl> m_pPrefabItem - > UpdateFromPrefabObject ( this , context ) ; <nl> } <nl> <nl> - / / Group add <nl> - if ( context . m_operation = = eOCOT_Add ) <nl> - { <nl> - CBaseObject * pObj = GetIEditor ( ) - > GetObjectManager ( ) - > FindObject ( context . m_modifiedObjectGlobalId ) ; <nl> - if ( pObj & & pObj - > IsKindOf ( RUNTIME_CLASS ( CGroup ) ) & & ! pObj - > IsKindOf ( RUNTIME_CLASS ( CPrefabObject ) ) ) <nl> - { <nl> - for ( int i = 0 , count = pObj - > GetChildCount ( ) ; i < count ; + + i ) <nl> - { <nl> - AddMember ( pObj - > GetChild ( i ) , true ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> InvalidateBBox ( ) ; <nl> } <nl> <nl> void CPrefabObject : : RemoveChild ( CBaseObject * child ) <nl> CBaseObject : : RemoveChild ( child ) ; <nl> } <nl> <nl> + void CPrefabObject : : GenerateGUIDsForObjectAndChildren ( CBaseObject * pObject ) <nl> + { <nl> + using namespace Private_PrefabObject ; <nl> + <nl> + TBaseObjects objectsToAssign ; <nl> + <nl> + objectsToAssign . push_back ( pObject ) ; <nl> + <nl> + if ( pObject - > IsKindOf ( RUNTIME_CLASS ( CPrefabObject ) ) ) <nl> + { <nl> + CRY_ASSERT_MESSAGE ( static_cast < CPrefabObject * > ( pObject ) - > m_pPrefabItem ! = m_pPrefabItem , " Object has the same prefab item " ) ; <nl> + } <nl> + <nl> + / / We need to find all the children of this object <nl> + pObject - > GetAllChildren ( objectsToAssign ) ; <nl> + <nl> + / / Make sure to generate all the GUIDS for the children of this object <nl> + for ( CBaseObject * pObjectToAssign : objectsToAssign ) <nl> + { <nl> + SetObjectPrefabFlagAndLayer ( pObjectToAssign ) ; <nl> + / / This is serialized in the IdInPrefab field and also assigned as the new prefab GUID <nl> + InitObjectPrefabId ( pObjectToAssign ) ; <nl> + / / We need this for search , serialization and other things <nl> + SetPrefabFlagForLinkedObjects ( pObjectToAssign ) ; <nl> + <nl> + CryGUID newGuid = CPrefabChildGuidProvider ( this ) . GetFor ( pObjectToAssign ) ; <nl> + if ( CUndo : : IsRecording ( ) ) <nl> + { <nl> + CUndo : : Record ( new CUndoChangeGuid ( pObjectToAssign , newGuid ) ) ; <nl> + } <nl> + / / Assign the new GUID <nl> + GetObjectManager ( ) - > ChangeObjectId ( pObjectToAssign - > GetId ( ) , newGuid ) ; <nl> + } <nl> + <nl> + } <nl> + <nl> void CPrefabObject : : SetMaterial ( IEditorMaterial * pMaterial ) <nl> { <nl> if ( pMaterial ) <nl> mmm a / Code / Sandbox / EditorQt / Objects / PrefabObject . h <nl> ppp b / Code / Sandbox / EditorQt / Objects / PrefabObject . h <nl> class SANDBOX_API CPrefabObject : public CGroup <nl> void SetChangePivotMode ( bool changePivotMode ) { m_bChangePivotPoint = changePivotMode ; } <nl> virtual void OnContextMenu ( CPopupMenuItem * menu ) ; <nl> virtual int MouseCreateCallback ( IDisplayViewport * view , EMouseEvent event , CPoint & point , int flags ) override ; <nl> + / / ! Create new GUID for the prefab , flag it as such and assign the correct layer <nl> + void GenerateGUIDsForObjectAndChildren ( CBaseObject * pObject ) ; <nl> protected : <nl> void SerializeMembers ( Serialization : : IArchive & ar ) ; <nl> virtual void RemoveChild ( CBaseObject * child ) ; <nl> - <nl> CPrefabObject ( ) ; <nl> <nl> void SetPrefabGuid ( CryGUID guid ) { m_prefabGUID = guid ; } <nl> mmm a / Code / Sandbox / EditorQt / Prefabs / PrefabItem . cpp <nl> ppp b / Code / Sandbox / EditorQt / Prefabs / PrefabItem . cpp <nl> <nl> <nl> # include < CryMath / Cry_Math . h > <nl> <nl> - CPrefabItem : : CPrefabItem ( ) <nl> + # define CURRENT_VERSION 1 <nl> + <nl> + CPrefabItem : : CPrefabItem ( ) : <nl> + / / init to current version <nl> + m_version ( CURRENT_VERSION ) <nl> { <nl> m_PrefabClassName = PREFAB_OBJECT_CLASS_NAME ; <nl> m_objectsNode = XmlHelpers : : CreateXmlNode ( " Objects " ) ; <nl> + <nl> } <nl> <nl> void CPrefabItem : : SetPrefabClassName ( string prefabClassNameString ) <nl> void CPrefabItem : : Serialize ( SerializeContext & ctx ) <nl> XmlNodeRef node = ctx . node ; <nl> if ( ctx . bLoading ) <nl> { <nl> - XmlNodeRef objects = node - > findChild ( " Objects " ) ; <nl> - if ( objects ) <nl> + m_objectsNode = node - > findChild ( " Objects " ) ; <nl> + / / we are loading a very old prefab , set version to 0 <nl> + if ( ! node - > getAttr ( " Version " , m_version ) ) <nl> { <nl> - m_objectsNode = objects ; <nl> - / / Flatten groups if not flatten already <nl> - / / The following code will just transform the previous nested groups to flatten hierarchy for easier operation implementation <nl> - std : : queue < XmlNodeRef > groupObjects ; <nl> - std : : deque < XmlNodeRef > objectsToReattach ; <nl> - <nl> - for ( int i = 0 , count = objects - > getChildCount ( ) ; i < count ; + + i ) <nl> - { <nl> - XmlNodeRef objectNode = objects - > getChild ( i ) ; <nl> - string objectType ; <nl> - objectNode - > getAttr ( " Type " , objectType ) ; <nl> - if ( ! objectType . CompareNoCase ( " Group " ) ) <nl> - { <nl> - XmlNodeRef groupObjectsNode = objectNode - > findChild ( " Objects " ) ; <nl> - if ( groupObjectsNode ) <nl> - groupObjects . push ( groupObjectsNode ) ; <nl> - } <nl> - <nl> - / / Process group <nl> - while ( ! groupObjects . empty ( ) ) <nl> - { <nl> - XmlNodeRef group = groupObjects . front ( ) ; <nl> - groupObjects . pop ( ) ; <nl> - <nl> - for ( int j = 0 , childCount = group - > getChildCount ( ) ; j < childCount ; + + j ) <nl> - { <nl> - XmlNodeRef child = group - > getChild ( j ) ; <nl> - string childType ; <nl> - <nl> - child - > getAttr ( " Type " , childType ) ; <nl> - if ( ! childType . CompareNoCase ( " Group " ) ) <nl> - { <nl> - XmlNodeRef groupObjectsNode = child - > findChild ( " Objects " ) ; <nl> - if ( groupObjectsNode ) <nl> - { <nl> - objectsToReattach . push_back ( child ) ; <nl> - groupObjects . push ( groupObjectsNode ) ; <nl> - } <nl> - } <nl> - else <nl> - { <nl> - objectsToReattach . push_back ( child ) ; <nl> - } <nl> - } <nl> - <nl> - group - > getParent ( ) - > removeAllChilds ( ) ; <nl> - } <nl> - } <nl> - <nl> - for ( int i = 0 , count = objectsToReattach . size ( ) ; i < count ; + + i ) <nl> - { <nl> - m_objectsNode - > addChild ( objectsToReattach [ i ] ) ; <nl> - } <nl> + m_version = 0 ; <nl> } <nl> } <nl> else <nl> void CPrefabItem : : Serialize ( SerializeContext & ctx ) <nl> if ( m_objectsNode ) <nl> { <nl> node - > addChild ( m_objectsNode ) ; <nl> + node - > setAttr ( " Version " , m_version ) ; <nl> } <nl> } <nl> } <nl> void CPrefabItem : : CollectLinkedObjects ( CBaseObject * pObj , std : : vector < CBaseObjec <nl> CBaseObject * pLinkedObject = pObj - > GetLinkedObject ( i ) ; <nl> if ( selection . IsContainObject ( pLinkedObject ) ) <nl> selection . RemoveObject ( pLinkedObject ) ; <nl> - <nl> + <nl> linkedObjects . push_back ( pLinkedObject ) ; <nl> <nl> CollectLinkedObjects ( pLinkedObject , linkedObjects , selection ) ; <nl> } <nl> } <nl> + / * VERSIONS <nl> + 0 : Prefabs are saved in a flattened hierarchy , group members are too . For example <nl> + < Object Type = " Group " Layer = " Main " LayerGUID = " 561c3d54 - fd84 - 4a25 - 3fa2 - 2781f36492a8 " Id = " a440327f - e262 - 3aa9 - 6520 - 619fe689071e " Name = " Group - 2 " Pos = " 509 . 65161 , 501 . 59622 , 31 . 999756 " Rotate = " 1 , 0 , 0 , 0 " Scale = " 1 , 1 , 1 " ColorRGB = " 65280 " UseCustomLevelLayerColor = " 0 " Opened = " 0 " / > <nl> + < Object Type = " Brush " Layer = " Main " LayerGUID = " 561c3d54 - fd84 - 4a25 - 3fa2 - 2781f36492a8 " Id = " 27120ffe - ab2b - 6c95 - c25d - 171d8ec67aaf " Name = " primitive_sphere - 1 " Parent = " a440327f - e262 - 3aa9 - 6520 - 619fe689071e " Pos = " - 508 . 02625 , - 501 . 48993 , - 31 . 999756 " Rotate = " 1 , 0 , 0 , 0 " Scale = " 1 , 1 , 1 " ColorRGB = " 16777215 " UseCustomLevelLayerColor = " 0 " MatLayersMask = " 0 " Prefab = " objects / default / primitive_sphere . cgf " IgnoreVisareas = " 0 " CastShadowMaps = " 1 " GIMode = " 1 " RainOccluder = " 1 " SupportSecondVisarea = " 0 " DynamicDistanceShadows = " 0 " Hideable = " 0 " LodRatio = " 100 " ViewDistRatio = " 100 " NotTriangulate = " 0 " NoDynamicWater = " 0 " AIRadius = " - 1 " NoStaticDecals = " 0 " RecvWind = " 0 " Occluder = " 0 " DrawLast = " 0 " ShadowLodBias = " 0 " IgnoreTerrainLayerBlend = " 1 " IgnoreDecalBlend = " 1 " RndFlags = " 60000608 " > <nl> + < CollisionFiltering > <nl> + < Type collision_class_terrain = " 0 " collision_class_wheeled = " 0 " collision_class_living = " 0 " collision_class_articulated = " 0 " collision_class_soft = " 0 " collision_class_particle = " 0 " gcc_player_capsule = " 0 " gcc_player_body = " 0 " gcc_vehicle = " 0 " gcc_large_kickable = " 0 " gcc_ragdoll = " 0 " gcc_rigid = " 0 " gcc_vtol = " 0 " gcc_ai = " 0 " / > <nl> + < Ignore collision_class_terrain = " 0 " collision_class_wheeled = " 0 " collision_class_living = " 0 " collision_class_articulated = " 0 " collision_class_soft = " 0 " collision_class_particle = " 0 " gcc_player_capsule = " 0 " gcc_player_body = " 0 " gcc_vehicle = " 0 " gcc_large_kickable = " 0 " gcc_ragdoll = " 0 " gcc_rigid = " 0 " gcc_vtol = " 0 " gcc_ai = " 0 " / > <nl> + < / CollisionFiltering > <nl> + < / Object > <nl> + " primitive_sphere - 1 " is a child of " Group - 2 " , how do you know ? Because it has a parent attribute with the group guid , top level objects in prefab don ' t have a parent , it ' s implicitly given at load time <nl> + 1 : No more flattened hierarchy , groups are serialized exactly as they are in the level file ( using CGroup : : Serialize ) <nl> + < Object Type = " Group " Layer = " Main " LayerGUID = " 5af8763b - 0eb4 - f6b2 - c9cd - bf985e9fa3dd " Id = " b5621401 - 679a - 2850 - f761 - ae381c539261 " Name = " Group - 4 " Pos = " - 6 . 7286377 , 1 . 715271 , 0 " Rotate = " 1 , 0 , 0 , 0 " Scale = " 1 , 1 , 1 " ColorRGB = " 65280 " UseCustomLevelLayerColor = " 0 " Opened = " 1 " > <nl> + < Objects > <nl> + < Object Type = " Brush " Layer = " Main " LayerGUID = " 5af8763b - 0eb4 - f6b2 - c9cd - bf985e9fa3dd " Id = " 92354280 - 6ddb - a34b - ddf8 - fb1d67141eb7 " Name = " primitive_pyramid - 1 " Parent = " b5621401 - 679a - 2850 - f761 - ae381c539261 " Pos = " 5 . 1032715 , 0 . 83911133 , 0 " Rotate = " 1 , 0 , 0 , 0 " Scale = " 1 , 1 , 1 " ColorRGB = " 16777215 " UseCustomLevelLayerColor = " 0 " MatLayersMask = " 0 " Prefab = " objects / default / primitive_pyramid . cgf " IgnoreVisareas = " 0 " CastShadowMaps = " 1 " GIMode = " 1 " RainOccluder = " 1 " SupportSecondVisarea = " 0 " DynamicDistanceShadows = " 0 " Hideable = " 0 " LodRatio = " 100 " ViewDistRatio = " 100 " NotTriangulate = " 0 " NoDynamicWater = " 0 " AIRadius = " - 1 " NoStaticDecals = " 0 " RecvWind = " 0 " Occluder = " 0 " DrawLast = " 0 " ShadowLodBias = " 0 " IgnoreTerrainLayerBlend = " 1 " IgnoreDecalBlend = " 1 " RndFlags = " 60000408 " > <nl> + < CollisionFiltering > <nl> + < Type collision_class_terrain = " 0 " collision_class_wheeled = " 0 " collision_class_living = " 0 " collision_class_articulated = " 0 " collision_class_soft = " 0 " collision_class_particle = " 0 " gcc_player_capsule = " 0 " gcc_player_body = " 0 " gcc_vehicle = " 0 " gcc_large_kickable = " 0 " gcc_ragdoll = " 0 " gcc_rigid = " 0 " gcc_vtol = " 0 " gcc_ai = " 0 " / > <nl> + < Ignore collision_class_terrain = " 0 " collision_class_wheeled = " 0 " collision_class_living = " 0 " collision_class_articulated = " 0 " collision_class_soft = " 0 " collision_class_particle = " 0 " gcc_player_capsule = " 0 " gcc_player_body = " 0 " gcc_vehicle = " 0 " gcc_large_kickable = " 0 " gcc_ragdoll = " 0 " gcc_rigid = " 0 " gcc_vtol = " 0 " gcc_ai = " 0 " / > <nl> + < / CollisionFiltering > <nl> + < / Object > <nl> + < / Objects > <nl> + < / Object > <nl> + Group members are properly serialized via CGroup : : SerializeMembers instead of flattening ( note the < Objects > tag ) <nl> + * / <nl> + void CPrefabItem : : CheckVersionAndUpgrade ( ) <nl> + { <nl> + if ( m_version < 1 ) <nl> + { <nl> + / / in version 0 all prefabs objects are in a flat list , meaning all objects are added to the top level of the prefab ( even group members are flattened ) , this needs to be updated to a proper hierarchy <nl> + std : : vector < XmlNodeRef > objects ; <nl> + FindAllObjectsInLibrary ( m_objectsNode , objects ) ; <nl> + <nl> + for ( int i = 0 ; i < m_objectsNode - > getChildCount ( ) ; i + + ) <nl> + { <nl> + CryGUID parentGuid ; <nl> + XmlNodeRef objectRef = m_objectsNode - > getChild ( i ) ; <nl> + <nl> + / / parent in top level means we are in a group ( or some other object that has a parent somewhere else in the prefab ) , which in turn means that we have to relocate it to the correct place in the hierarchy <nl> + if ( objectRef - > getAttr ( " Parent " , parentGuid ) ) <nl> + { <nl> + XmlNodeRef parentNode = FindObjectByGuidInFlattenedNodes ( objects , parentGuid ) ; <nl> + <nl> + / / remove node from old parent <nl> + objectRef - > getParent ( ) - > removeChild ( objectRef ) ; <nl> + <nl> + / / and add to new parent , note that groups have an < Objects > child before the actual objects , we need to get that <nl> + XmlNodeRef groupChildRoot = parentNode - > findChild ( " Objects " ) ; <nl> + if ( groupChildRoot ) <nl> + { <nl> + groupChildRoot - > addChild ( objectRef ) ; <nl> + } / / if it ' s the first time we are adding to a group we have to create the < Objects > child as it does not exist in the flattened version of the prefab file <nl> + else if ( parentNode - > haveAttr ( " Type " ) & & strcmp ( parentNode - > getAttr ( " Type " ) , " Group " ) = = 0 ) <nl> + { <nl> + XmlNodeRef child = parentNode - > createNode ( " Objects " ) ; <nl> + parentNode - > addChild ( child ) ; <nl> + child - > addChild ( objectRef ) ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + <nl> + m_version = CURRENT_VERSION ; <nl> + } <nl> <nl> void CPrefabItem : : UpdateFromPrefabObject ( CPrefabObject * pPrefabObject , const SObjectChangedContext & context ) <nl> { <nl> CPrefabManager * const pPrefabManager = GetIEditorImpl ( ) - > GetPrefabManager ( ) ; <nl> / / Skip other prefab types <nl> if ( ! pPrefabObject | | pPrefabObject - > IsModifyInProgress ( ) <nl> - | | ! pPrefabManager | | context . m_modifiedObjectGuidInPrefab = = CryGUID : : Null ( ) | | pPrefabManager - > ShouldSkipPrefabUpdate ( ) ) <nl> + | | ! pPrefabManager | | pPrefabManager - > ShouldSkipPrefabUpdate ( ) ) <nl> { <nl> return ; <nl> } <nl> <nl> IObjectManager * const pObjMan = GetIEditorImpl ( ) - > GetObjectManager ( ) ; <nl> CBaseObject * pObj = pObjMan - > FindObject ( context . m_modifiedObjectGlobalId ) ; <nl> - if ( ! pObj ) <nl> + if ( ! pObj ) <nl> return ; <nl> <nl> + CheckVersionAndUpgrade ( ) ; <nl> + <nl> pPrefabObject - > SetModifyInProgress ( true ) ; <nl> / / Prevent recursive calls to this function when modifying other instances of this same prefab <nl> CPrefabManager : : SkipPrefabUpdate skipUpdates ; <nl> void CPrefabItem : : UpdateFromPrefabObject ( CPrefabObject * pPrefabObject , const SOb <nl> / / Get all objects part of the prefab <nl> pPrefabObject - > GetAllPrefabFlagedChildren ( selection ) ; <nl> <nl> - CBaseObjectsArray allInstancedPrefabs ; <nl> - pObjMan - > FindObjectsOfType ( RUNTIME_CLASS ( CPrefabObject ) , allInstancedPrefabs ) ; <nl> - <nl> / / While modifying the instances we don ' t want the FG manager to send events since they can call into GUI components and cause a crash <nl> / / e . g . we are modifying one FG but in fact we are working on multiple instances of this FG the MFC code does not cope well with this <nl> CFlowGraphManager * const pFlowMan = GetIEditorImpl ( ) - > GetFlowGraphManager ( ) ; <nl> void CPrefabItem : : UpdateFromPrefabObject ( CPrefabObject * pPrefabObject , const SOb <nl> { <nl> CScopedSuspendUndo suspendUndo ; <nl> <nl> + CBaseObjectsArray allInstancedPrefabs ; <nl> + pObjMan - > FindObjectsOfType ( RUNTIME_CLASS ( CPrefabObject ) , allInstancedPrefabs ) ; <nl> + <nl> for ( size_t i = 0 , prefabsCount = allInstancedPrefabs . size ( ) ; i < prefabsCount ; + + i ) <nl> { <nl> CPrefabObject * const pInstancedPrefab = static_cast < CPrefabObject * > ( allInstancedPrefabs [ i ] ) ; <nl> void CPrefabItem : : ModifyLibraryPrefab ( CSelectionGroup & objectsInPrefabAsFlatSele <nl> { <nl> IObjectManager * const pObjManager = GetIEditorImpl ( ) - > GetObjectManager ( ) ; <nl> <nl> + std : : vector < XmlNodeRef > objects ; <nl> + / / Find all the objects in this prefab item <nl> + FindAllObjectsInLibrary ( m_objectsNode , objects ) ; <nl> + / / If this object actually exists in the instance <nl> if ( CBaseObject * const pObj = objectsInPrefabAsFlatSelection . GetObjectByGuidInPrefab ( context . m_modifiedObjectGuidInPrefab ) ) <nl> { <nl> - / / MEMBER ADD <nl> + / / Add a new member to the to level of the prefab <nl> if ( context . m_operation = = eOCOT_Add ) <nl> { <nl> / / If we are trying to add something which already exists in the prefab definition we are trying to modify it <nl> void CPrefabItem : : ModifyLibraryPrefab ( CSelectionGroup & objectsInPrefabAsFlatSele <nl> ModifyLibraryPrefab ( objectsInPrefabAsFlatSelection , pPrefabObject , correctedContext , guidMapping ) ; <nl> return ; <nl> } <nl> - <nl> + / / Create a new archive and serialize the object in it <nl> CObjectArchive ar ( pObjManager , m_objectsNode , false ) ; <nl> <nl> - if ( pObj - > GetParent ( ) = = pPrefabObject ) <nl> - pObj - > DetachThis ( false ) ; <nl> - <nl> ar . SaveObject ( pObj , false , true ) ; <nl> - SaveLinkedObjects ( ar , pObj , true ) ; <nl> <nl> - if ( ! pObj - > GetParent ( ) ) <nl> - pPrefabObject - > AttachChild ( pObj , false ) ; <nl> + / / Update all the linked objects <nl> + SaveLinkedObjects ( ar , pObj , true ) ; <nl> <nl> + / / Update all the ids to link to the correct prefab objects ( parents / ecc ) <nl> XmlNodeRef savedObj = m_objectsNode - > getChild ( m_objectsNode - > getChildCount ( ) - 1 ) ; <nl> RemapIDsInNodeAndChildren ( savedObj , guidMapping , false ) ; <nl> } <nl> / / Member MODIFY <nl> else if ( context . m_operation = = eOCOT_Modify | | context . m_operation = = eOCOT_ModifyTransform | | context . m_operation = = eOCOT_ModifyTransformInLibOnly ) <nl> { <nl> + / / This object could be everywhere in the hierarchy , we do not want to modify it all , just find it in the flattened version ( aka the list of all the objects in the XML ) and reserialize <nl> / / Find - > remove previous definition of the object and serialize the new changes <nl> - if ( XmlNodeRef object = FindObjectByGuid ( pObj - > GetIdInPrefab ( ) , true ) ) <nl> + if ( XmlNodeRef object = FindObjectByGuidInFlattenedNodes ( objects , pObj - > GetIdInPrefab ( ) , true ) ) / / FindObjectByGuid ( pObj - > GetIdInPrefab ( ) , true ) ) <nl> { <nl> - m_objectsNode - > removeChild ( object ) ; <nl> - <nl> - CObjectArchive ar ( pObjManager , m_objectsNode , false ) ; <nl> - <nl> - if ( pObj - > GetParent ( ) = = pPrefabObject ) <nl> - pObj - > DetachThis ( false , true ) ; <nl> + / / Parent could be every level in the hierarchy , like an < Objects > node ( we are in a group ) , or the top level of a prefab <nl> + XmlNodeRef parent = object - > getParent ( ) ; <nl> + parent - > removeChild ( object ) ; <nl> <nl> + CObjectArchive ar ( pObjManager , parent , false ) ; <nl> ar . SaveObject ( pObj , false , true ) ; <nl> <nl> - if ( ! pObj - > GetParent ( ) & & ! pObj - > GetLinkedTo ( ) ) <nl> - pPrefabObject - > AttachChild ( pObj , false ) ; <nl> - <nl> - XmlNodeRef savedObj = m_objectsNode - > getChild ( m_objectsNode - > getChildCount ( ) - 1 ) ; <nl> + XmlNodeRef savedObj = parent - > getChild ( parent - > getChildCount ( ) - 1 ) ; <nl> RemapIDsInNodeAndChildren ( savedObj , guidMapping , false ) ; <nl> } <nl> } <nl> / / Member DELETE <nl> else if ( context . m_operation = = eOCOT_Delete ) <nl> { <nl> - if ( XmlNodeRef object = FindObjectByGuid ( pObj - > GetIdInPrefab ( ) , true ) ) <nl> + / / Just find an object from the flattened hierarchy and then remove it <nl> + if ( XmlNodeRef object = FindObjectByGuidInFlattenedNodes ( objects , pObj - > GetIdInPrefab ( ) , true ) ) / / FindObjectByGuid ( pObj - > GetIdInPrefab ( ) , true ) ) <nl> { <nl> - m_objectsNode - > removeChild ( object ) ; <nl> - <nl> - / / Clear the prefab references to this if it is a parent to objects and it is a GROUP <nl> - string objType ; <nl> - object - > getAttr ( " Type " , objType ) ; <nl> - if ( ! objType . CompareNoCase ( " Group " ) ) <nl> + XmlNodeRef parent = object - > getParent ( ) ; <nl> + parent - > removeChild ( object ) ; <nl> + / / A parent was deleted so just remove the parent attribute <nl> + for ( int i = 0 , count = parent - > getChildCount ( ) ; i < count ; + + i ) <nl> { <nl> - RemoveAllChildsOf ( pObj - > GetIdInPrefab ( ) ) ; <nl> - } <nl> - else <nl> - { <nl> - / / A parent was deleted ( which wasn ' t a group ! ! ! ) so just remove the parent attribute <nl> - for ( int i = 0 , count = m_objectsNode - > getChildCount ( ) ; i < count ; + + i ) <nl> + CryGUID parentGuid = CryGUID : : Null ( ) ; <nl> + if ( parent - > getChild ( i ) - > getAttr ( " Parent " , parentGuid ) & & parentGuid = = pObj - > GetIdInPrefab ( ) ) <nl> { <nl> - CryGUID parentGuid = CryGUID : : Null ( ) ; <nl> - if ( m_objectsNode - > getChild ( i ) - > getAttr ( " Parent " , parentGuid ) & & parentGuid = = pObj - > GetIdInPrefab ( ) ) <nl> - { <nl> - m_objectsNode - > getChild ( i ) - > delAttr ( " Parent " ) ; <nl> - } <nl> + parent - > getChild ( i ) - > delAttr ( " Parent " ) ; <nl> } <nl> } <nl> } <nl> void CPrefabItem : : ModifyLibraryPrefab ( CSelectionGroup & objectsInPrefabAsFlatSele <nl> } / / ~ if ( CBaseObject * const pObj = objectsInPrefabAsFlatSelection . GetObjectByGuidInPrefab ( context . m_modifiedObjectGuidInPrefab ) ) <nl> } <nl> <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + void CPrefabItem : : FindAllObjectsInLibrary ( XmlNodeRef nodeRef , std : : vector < XmlNodeRef > & objects ) <nl> + { <nl> + for ( int i = nodeRef - > getChildCount ( ) - 1 ; i > = 0 ; - - i ) <nl> + { <nl> + XmlNodeRef childNode = nodeRef - > getChild ( i ) ; <nl> + if ( childNode - > isTag ( " Object " ) ) <nl> + { <nl> + objects . push_back ( childNode ) ; <nl> + } <nl> + <nl> + if ( childNode - > getChildCount ( ) ) <nl> + { <nl> + FindAllObjectsInLibrary ( childNode , objects ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / This updates all the instanced objects with the exception of the original prefab instance that is calling the prefab item update ( as it ' s obviously already up to date ) <nl> void CPrefabItem : : ModifyInstancedPrefab ( CSelectionGroup & objectsInPrefabAsFlatSelection , CPrefabObject * pPrefabObject , const SObjectChangedContext & context , const TObjectIdMapping & guidMapping ) <nl> { <nl> IObjectManager * const pObjManager = GetIEditorImpl ( ) - > GetObjectManager ( ) ; <nl> + std : : vector < XmlNodeRef > objects ; <nl> + / / we re generate the list it again because it can be modified if the prefab item m_objectsNode is changed ( which happens in ModifyPrefab ) <nl> + FindAllObjectsInLibrary ( m_objectsNode , objects ) ; <nl> <nl> if ( context . m_operation = = eOCOT_Add ) <nl> { <nl> if ( CBaseObject * const pObj = pObjManager - > FindObject ( context . m_modifiedObjectGlobalId ) ) <nl> { <nl> + / / NB : Note that we search only in the top level hierarchy , for hierarchies the parents ( aka a Group ) will deal with addition / removal of children <nl> if ( XmlNodeRef changedObject = FindObjectByGuid ( pObj - > GetIdInPrefab ( ) , false ) ) <nl> { <nl> / / See if we already have this object as part of the instanced prefab <nl> std : : vector < CBaseObject * > childs ; <nl> pPrefabObject - > GetAllPrefabFlagedChildren ( childs ) ; <nl> - if ( CBaseObject * pModified = FindObjectByPrefabGuid ( childs , pObj - > GetIdInPrefab ( ) ) ) <nl> + CBaseObject * pModified = FindObjectByPrefabGuid ( childs , pObj - > GetIdInPrefab ( ) ) ; <nl> + if ( pModified ) <nl> { <nl> SObjectChangedContext correctedContext = context ; <nl> correctedContext . m_operation = eOCOT_Modify ; <nl> ModifyInstancedPrefab ( objectsInPrefabAsFlatSelection , pPrefabObject , correctedContext , guidMapping ) ; <nl> return ; <nl> } <nl> - <nl> + / / Clone the objects , fix the flags and add it to the current item , this works only for TOP LEVEL ITEMS , <nl> + / / groups will call modify on themselves and regenerate all the objects inside them if something is added <nl> CObjectArchive loadAr ( pObjManager , changedObject , true ) ; <nl> CPrefabChildGuidProvider guidProvider ( pPrefabObject ) ; <nl> loadAr . SetGuidProvider ( & guidProvider ) ; <nl> void CPrefabItem : : ModifyInstancedPrefab ( CSelectionGroup & objectsInPrefabAsFlatSe <nl> { <nl> if ( context . m_operation = = eOCOT_Modify ) <nl> { <nl> - if ( XmlNodeRef changedObject = FindObjectByGuid ( pObj - > GetIdInPrefab ( ) , false ) ) <nl> + if ( XmlNodeRef changedObject = FindObjectByGuidInFlattenedNodes ( objects , pObj - > GetIdInPrefab ( ) , false ) ) <nl> { <nl> + / / Deserialize the object and attach it to the prefab instance <nl> + / / when this is sent to groups it will recreate the whole group as the CGroup : : Serialize deletes and regenerates all it ' s members <nl> + / / Note that in this case no remapping is needed , especially for groups the GenerateGUIDsForObjectAndChildren function called on AddMember in archive resolve ( happens on archive destruction , aka end of this function ) will properly assign guids to this object and its children <nl> + <nl> / / Build load archive <nl> CObjectArchive loadAr ( pObjManager , changedObject , true ) ; <nl> - loadAr . bUndo = true ; <nl> + <nl> loadAr . SetShouldResetInternalMembers ( true ) ; <nl> <nl> / / Load ids remapping info into the load archive <nl> for ( int j = 0 , count = guidMapping . size ( ) ; j < count ; + + j ) <nl> loadAr . RemapID ( guidMapping [ j ] . from , guidMapping [ j ] . to ) ; <nl> <nl> - / / PrefabGUID - > GUID <nl> - RemapIDsInNodeAndChildren ( changedObject , guidMapping , true ) ; <nl> - <nl> / / Set parent attr if we dont have any ( because we don ' t store this in the prefab XML since it is implicitly given ) <nl> bool noParentIdAttr = false ; <nl> if ( ! changedObject - > haveAttr ( " Parent " ) & & ! changedObject - > haveAttr ( " LinkedTo " ) ) <nl> void CPrefabItem : : ModifyInstancedPrefab ( CSelectionGroup & objectsInPrefabAsFlatSe <nl> / / Remove parent attribute if it is directly a child of the prefab <nl> if ( noParentIdAttr ) <nl> changedObject - > delAttr ( " Parent " ) ; <nl> - <nl> - if ( ! pObj - > GetParent ( ) & & ! pObj - > GetLinkedTo ( ) ) <nl> - pPrefabObject - > AttachChild ( pObj , false ) ; <nl> - <nl> - / / GUID - > PrefabGUID <nl> - RemapIDsInNodeAndChildren ( changedObject , guidMapping , false ) ; <nl> } <nl> } <nl> else if ( context . m_operation = = eOCOT_ModifyTransform ) <nl> { <nl> - if ( XmlNodeRef changedObject = FindObjectByGuid ( pObj - > GetIdInPrefab ( ) , false ) ) <nl> + if ( XmlNodeRef changedObject = FindObjectByGuidInFlattenedNodes ( objects , pObj - > GetIdInPrefab ( ) , false ) ) / / FindObjectByGuid ( pObj - > GetIdInPrefab ( ) , false ) ) <nl> { <nl> - CryGUID parentGUID = CryGUID : : Null ( ) ; <nl> - CryGUID linkedToGUID = CryGUID : : Null ( ) ; <nl> - changedObject - > getAttr ( " Parent " , parentGUID ) ; <nl> - changedObject - > getAttr ( " LinkedTo " , linkedToGUID ) ; <nl> - if ( CBaseObject * pObjParent = objectsInPrefabAsFlatSelection . GetObjectByGuidInPrefab ( parentGUID ) ) <nl> - pObjParent - > AttachChild ( pObj ) ; <nl> - else if ( CBaseObject * pLinkedTo = objectsInPrefabAsFlatSelection . GetObjectByGuidInPrefab ( linkedToGUID ) ) <nl> - pObj - > LinkTo ( pLinkedTo ) ; <nl> - <nl> + / / just reset the TM matrix <nl> pObj - > SetLocalTM ( context . m_localTM , eObjectUpdateFlags_Undo ) ; <nl> } <nl> } <nl> XmlNodeRef CPrefabItem : : FindObjectByGuid ( const CryGUID & guid , bool forwardSearch <nl> return nullptr ; <nl> } <nl> <nl> + XmlNodeRef CPrefabItem : : FindObjectByGuidInFlattenedNodes ( std : : vector < XmlNodeRef > & objects , const CryGUID & guid , bool fowardSearch / * = true * / ) <nl> + { <nl> + CryGUID objectId = CryGUID : : Null ( ) ; <nl> + <nl> + if ( fowardSearch ) <nl> + { <nl> + for ( int i = 0 , count = objects . size ( ) ; i < count ; + + i ) <nl> + { <nl> + objects [ i ] - > getAttr ( " Id " , objectId ) ; <nl> + if ( objectId = = guid ) <nl> + return objects [ i ] ; <nl> + } <nl> + } <nl> + else <nl> + { <nl> + for ( int i = objects . size ( ) - 1 ; i > = 0 ; - - i ) <nl> + { <nl> + objects [ i ] - > getAttr ( " Id " , objectId ) ; <nl> + if ( objectId = = guid ) <nl> + return objects [ i ] ; <nl> + } <nl> + } <nl> + <nl> + return nullptr ; <nl> + } <nl> + <nl> std : : set < CryGUID > CPrefabItem : : FindPrefabsGUIDsInChildren ( ) <nl> { <nl> std : : set < CryGUID > guids ; <nl> std : : set < CryGUID > CPrefabItem : : FindPrefabsGUIDsInChildren ( ) <nl> return guids ; <nl> } <nl> <nl> - std : : set < CPrefabItem * > CPrefabItem : : FindPrefabItemsInChildren ( ) <nl> + std : : set < CPrefabItem * > CPrefabItem : : FindPrefabItemsInChildren ( ) <nl> { <nl> std : : set < CryGUID > guids = FindPrefabsGUIDsInChildren ( ) ; <nl> - std : : set < CPrefabItem * > items ; <nl> + std : : set < CPrefabItem * > items ; <nl> <nl> for ( CryGUID guid : guids ) <nl> { <nl> std : : set < CPrefabItem * > CPrefabItem : : FindPrefabItemsInChildren ( ) <nl> { <nl> continue ; <nl> } <nl> - CPrefabItem * pPrefabItem = static_cast < CPrefabItem * > ( pItem ) ; <nl> + CPrefabItem * pPrefabItem = static_cast < CPrefabItem * > ( pItem ) ; <nl> items . insert ( pPrefabItem ) ; <nl> } <nl> <nl> return items ; <nl> } <nl> <nl> - std : : set < CryGUID > CPrefabItem : : FindAllPrefabsGUIDsInChildren ( const std : : set < CryGUID > & toIgnore ) <nl> + std : : set < CryGUID > CPrefabItem : : FindAllPrefabsGUIDsInChildren ( const std : : set < CryGUID > & toIgnore ) <nl> { <nl> std : : set < CryGUID > finalGuids = FindPrefabsGUIDsInChildren ( ) ; <nl> std : : set < CryGUID > guids = FindPrefabsGUIDsInChildren ( ) ; <nl> - for ( const CryGUID & guid : guids ) <nl> + for ( const CryGUID & guid : guids ) <nl> { <nl> if ( std : : find ( toIgnore . begin ( ) , toIgnore . end ( ) , guid ) ! = toIgnore . end ( ) ) <nl> { <nl> std : : set < CryGUID > CPrefabItem : : FindAllPrefabsGUIDsInChildren ( const std : : set < CryG <nl> { <nl> continue ; <nl> } <nl> - CPrefabItem * pPrefabItem = static_cast < CPrefabItem * > ( pItem ) ; <nl> + CPrefabItem * pPrefabItem = static_cast < CPrefabItem * > ( pItem ) ; <nl> std : : set < CryGUID > childGuids = pPrefabItem - > FindAllPrefabsGUIDsInChildren ( toIgnore ) ; <nl> finalGuids . insert ( childGuids . begin ( ) , childGuids . end ( ) ) ; <nl> } <nl> void CPrefabItem : : ExtractObjectsPrefabIDtoGuidMapping ( CSelectionGroup & objects , <nl> for ( int i = 0 , count = objects . GetCount ( ) ; i < count ; + + i ) <nl> { <nl> CBaseObject * pObject = objects . GetObject ( i ) ; <nl> - / / Save group mapping <nl> mapping . push_back ( SObjectIdMapping ( pObject - > GetIdInPrefab ( ) , pObject - > GetId ( ) ) ) ; <nl> - / / If this is a group recursively get all the objects ID mapping inside <nl> - if ( pObject - > IsKindOf ( RUNTIME_CLASS ( CGroup ) ) ) <nl> - { <nl> - groups . push ( pObject ) ; <nl> - while ( ! groups . empty ( ) ) <nl> - { <nl> - CBaseObject * pGroup = groups . front ( ) ; <nl> - groups . pop ( ) ; <nl> - <nl> - for ( int j = 0 , childCount = pGroup - > GetChildCount ( ) ; j < childCount ; + + j ) <nl> - { <nl> - CBaseObject * pChild = pGroup - > GetChild ( j ) ; <nl> - mapping . push_back ( SObjectIdMapping ( pChild - > GetIdInPrefab ( ) , pChild - > GetId ( ) ) ) ; <nl> - / / If group add it for further processing <nl> - if ( pChild - > IsKindOf ( RUNTIME_CLASS ( CGroup ) ) ) <nl> - groups . push ( pChild ) ; <nl> - } <nl> - } <nl> - } <nl> } <nl> } <nl> <nl> void CPrefabItem : : RemoveAllChildsOf ( CryGUID guid ) <nl> { <nl> XmlNodeRef child = m_objectsNode - > getChild ( i ) ; <nl> if ( child - > getAttr ( " Parent " , parentId ) & & guid = = parentId | | <nl> - child - > getAttr ( " LinkedTo " , linkedToId ) & & guid = = linkedToId ) <nl> + child - > getAttr ( " LinkedTo " , linkedToId ) & & guid = = linkedToId ) <nl> { <nl> childrenToRemove . push_front ( child ) ; <nl> string objType ; <nl> mmm a / Code / Sandbox / EditorQt / Prefabs / PrefabItem . h <nl> ppp b / Code / Sandbox / EditorQt / Prefabs / PrefabItem . h <nl> class SANDBOX_API CPrefabItem : public CBaseLibraryItem <nl> <nl> / / ! Searches and finds the XmlNode with a specified Id in m_objectsNode ( the XML representation of this prefab in the prefab library ) <nl> XmlNodeRef FindObjectByGuid ( const CryGUID & guid , bool fowardSearch = true ) ; <nl> + / / ! Searches and finds the XmlNode with a specified Id in an xml library ( the XML representation of this prefab in the prefab library ) <nl> + XmlNodeRef FindObjectByGuidInFlattenedNodes ( std : : vector < XmlNodeRef > & objects , const CryGUID & guid , bool fowardSearch = true ) ; <nl> / / ! Returns the guids of all the direct children of this prefab that are also prefabs <nl> std : : set < CryGUID > FindPrefabsGUIDsInChildren ( ) ; <nl> - / / ! Like FindPrefabsGUIDsInChildren , but also loads the CPrefabItem <nl> + / / ! Like FindPrefabsGUIDsInChildren , but also loads the CPrefabItem <nl> std : : set < CPrefabItem * > FindPrefabItemsInChildren ( ) ; <nl> - / / ! Recursively goes through the whole hierarchy of children <nl> + / / ! Recursively goes through the whole hierarchy of children <nl> / / ! @ param toIgnore the list of children GUIDs to exclude from the search ( with all their children ) <nl> - std : : set < CryGUID > FindAllPrefabsGUIDsInChildren ( const std : : set < CryGUID > & toIgnore ) ; <nl> + std : : set < CryGUID > FindAllPrefabsGUIDsInChildren ( const std : : set < CryGUID > & toIgnore ) ; <nl> <nl> + void CheckVersionAndUpgrade ( ) ; <nl> private : <nl> / / ! Function to serialize changes to the main prefab lib ( this changes only the internal XML representation m_objectsNode ) <nl> void ModifyLibraryPrefab ( CSelectionGroup & objectsInPrefabAsFlatSelection , CPrefabObject * pPrefabObject , const SObjectChangedContext & context , const TObjectIdMapping & guidMapping ) ; <nl> + / / Go through the whole hierarchy serialized in this XML and find all the entries tagged as object , basically flatten the whole hierarchy of the prefab <nl> + void FindAllObjectsInLibrary ( XmlNodeRef nodeRef , std : : vector < XmlNodeRef > & objects ) ; <nl> / / ! Function to update a instanced prefabs in the level <nl> void ModifyInstancedPrefab ( CSelectionGroup & objectsInPrefabAsFlatSelection , CPrefabObject * pPrefabObject , const SObjectChangedContext & context , const TObjectIdMapping & guidMapping ) ; <nl> / / ! Registers prefab event flowgraph nodes from all prefab instances <nl> class SANDBOX_API CPrefabItem : public CBaseLibraryItem <nl> <nl> void SaveLinkedObjects ( CObjectArchive & ar , CBaseObject * pObj , bool bAllowOwnedByPrefab ) ; <nl> void CollectLinkedObjects ( CBaseObject * pObj , std : : vector < CBaseObject * > & linkedObjects , CSelectionGroup & selection ) ; <nl> - <nl> private : <nl> XmlNodeRef m_objectsNode ; <nl> string m_PrefabClassName ; <nl> - } ; <nl> + uint32 m_version ; <nl> + } ; <nl> \ No newline at end of file <nl> mmm a / Code / Sandbox / EditorQt / Terrain / Heightmap . cpp <nl> ppp b / Code / Sandbox / EditorQt / Terrain / Heightmap . cpp <nl> void CHeightmap : : ImportBlock ( CXmlArchive & xmlAr , CPoint newPos , bool useNewPos , <nl> } <nl> else <nl> hmap . SetSubImage ( subRc . left , subRc . top , hmapSubImage , heightOffset , m_fMaxHeight ) ; <nl> + <nl> + GetIEditorImpl ( ) - > GetTerrainManager ( ) - > signalTerrainChanged ( ) ; <nl> } <nl> <nl> if ( xmlAr . pNamedData - > GetDataBlock ( HEIGHTMAP_LAYERINFO_BLOCK_NAME , pData , size ) ) <nl> void CHeightmap : : ImportBlock ( CXmlArchive & xmlAr , CPoint newPos , bool useNewPos , <nl> { <nl> m_layerIdBitmap . SetSubImage ( subRc . left , subRc . top , LayerIdBitmapImage ) ; <nl> } <nl> + <nl> + GetIEditorImpl ( ) - > GetTerrainManager ( ) - > signalLayersChanged ( ) ; <nl> } <nl> <nl> XmlNodeRef rgbLayer = xmlAr . root - > findChild ( " rgbLayer " ) ; <nl> void CHeightmap : : ImportBlock ( CXmlArchive & xmlAr , CPoint newPos , bool useNewPos , <nl> UpdateSectorTexture ( CPoint ( x , y ) , rgbRegion . left , rgbRegion . top , rgbRegion . right , rgbRegion . bottom ) ; <nl> } <nl> } <nl> + <nl> + GetIEditorImpl ( ) - > GetTerrainManager ( ) - > signalTerrainChanged ( ) ; <nl> } <nl> } <nl> <nl> mmm a / Code / Sandbox / EditorQt / Terrain / Layer . cpp <nl> ppp b / Code / Sandbox / EditorQt / Terrain / Layer . cpp <nl> void CLayer : : ImportBlock ( CXmlArchive & xmlAr , const CPoint & offset , int nRot ) <nl> subImageRot . RotateOrt ( subImage , nRot ) ; <nl> <nl> m_layerMask . SetSubImage ( dstMin . x , dstMin . y , nRot ? subImageRot : subImage ) ; <nl> + <nl> + GetIEditorImpl ( ) - > GetTerrainManager ( ) - > signalLayersChanged ( ) ; <nl> } <nl> } <nl> <nl> mmm a / Code / Sandbox / Plugins / EditorCommon / Objects / BaseObject . cpp <nl> ppp b / Code / Sandbox / Plugins / EditorCommon / Objects / BaseObject . cpp <nl> void CBaseObject : : Serialize ( CObjectArchive & ar ) <nl> <nl> xmlNode - > setAttr ( " Name " , GetName ( ) ) ; <nl> <nl> + / * <nl> + If we are serializing in a prefab we don ' t want to serialize a Parent . <nl> + Why ? Because if we have multiple instances of the same prefab which instanced prefab is going to be the parent of this object ? How can the loading code know ? <nl> + If an object is a direct child of a prefab we serialize it without a parent . When the prefab is loaded into the level the parent of this object is resolved to be that instance <nl> + * / <nl> if ( m_parent ) <nl> - xmlNode - > setAttr ( " Parent " , m_parent - > GetId ( ) ) ; <nl> + { <nl> + CBaseObject * pPrefab = GetPrefab ( ) ; <nl> + CBaseObject * pGroup = GetGroup ( ) ; <nl> + if ( ! pPrefab | | ! ar . IsSavingInPrefab ( ) ) / / no prefabs , go for serialization of parent <nl> + { <nl> + xmlNode - > setAttr ( " Parent " , m_parent - > GetId ( ) ) ; <nl> + } <nl> + else if ( pGroup & & ( pGroup ! = pPrefab ) ) / / we have a group that is NOT a prefab ( prefabs derive from groups ) but is contained in a prefab <nl> + { <nl> + xmlNode - > setAttr ( " Parent " , m_parent - > GetId ( ) ) ; <nl> + } <nl> + } <nl> <nl> if ( m_pLinkedTo ) <nl> xmlNode - > setAttr ( " LinkedTo " , m_pLinkedTo - > GetId ( ) ) ; <nl> void CBaseObject : : ResolveParent ( CBaseObject * parent ) <nl> { <nl> bSuspended = GetIEditor ( ) - > SuspendUpdateCGroup ( parent ) ; <nl> parent - > AddMember ( this , false ) ; <nl> + CryLog ( " Reparenting % s to % s " , GetName ( ) , m_parent - > GetName ( ) ) ; <nl> if ( bSuspended ) <nl> GetIEditor ( ) - > ResumeUpdateCGroup ( parent ) ; <nl> } <nl> mmm a / Code / Sandbox / Plugins / EditorTrackView / TrackViewSequenceManager . cpp <nl> ppp b / Code / Sandbox / Plugins / EditorTrackView / TrackViewSequenceManager . cpp <nl> void CTrackViewSequenceManager : : OnEditorNotifyEvent ( EEditorNotifyEvent event ) <nl> case eNotify_OnEndNewScene : <nl> / / Fall through <nl> case eNotify_OnEndSceneOpen : <nl> - / / Fall through <nl> - case eNotify_OnLayerImportEnd : <nl> m_bUnloadingLevel = false ; <nl> SortSequences ( ) ; <nl> break ; <nl>
! I integrate from / / ce / main . . .
CRYTEK/CRYENGINE
91a128dbf38df71547a3e1134d3836ca4a87bde3
2018-09-13T17:02:08Z
mmm a / hphp / hack / src / errors / error_codes . ml <nl> ppp b / hphp / hack / src / errors / error_codes . ml <nl> module Typing = struct <nl> | MissingXhpRequiredAttr <nl> | BadXhpAttrRequiredOverride <nl> | ReifiedTparamVariadic <nl> + | UnresolvedTypeVariable <nl> ( * EXTEND HERE WITH NEW VALUES IF NEEDED * ) <nl> [ @ @ deriving enum , show { with_path = false } ] <nl> let err_code = to_enum <nl> mmm a / hphp / hack / src / errors / errors . ml <nl> ppp b / hphp / hack / src / errors / errors . ml <nl> let typechecker_timeout ( pos , fun_name ) seconds = <nl> add ( Typing . err_code Typing . TypecheckerTimeout ) pos <nl> ( Printf . sprintf " Type checker timed out after % d seconds whilst checking function % s " seconds fun_name ) <nl> <nl> + let unresolved_type_variable pos = <nl> + add ( Typing . err_code Typing . UnresolvedTypeVariable ) pos <nl> + ( " The type of this expression contains an unresolved type variable " ) <nl> + <nl> ( * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ) <nl> ( * Printing * ) <nl> ( * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ) <nl> mmm a / hphp / hack / src / errors / errors . mli <nl> ppp b / hphp / hack / src / errors / errors . mli <nl> val byref_on_property : Pos . t - > unit <nl> val unsupported_trait_use_as : Pos . t - > unit <nl> val unsupported_instead_of : Pos . t - > unit <nl> val invalid_trait_use_as_visibility : Pos . t - > unit <nl> + val unresolved_type_variable : Pos . t - > unit <nl> mmm a / hphp / hack / src / options / globalOptions . ml <nl> ppp b / hphp / hack / src / options / globalOptions . ml <nl> type t = { <nl> tco_coercion_from_dynamic : bool ; <nl> error_codes_treated_strictly : ISet . t ; <nl> tco_check_xhp_attribute : bool ; <nl> + tco_disallow_unresolved_type_variables : bool ; <nl> } [ @ @ deriving show ] <nl> <nl> let tco_experimental_instanceof = " instanceof " <nl> let default = { <nl> tco_coercion_from_dynamic = false ; <nl> error_codes_treated_strictly = ISet . of_list [ ] ; <nl> tco_check_xhp_attribute = false ; <nl> + tco_disallow_unresolved_type_variables = false ; <nl> } <nl> <nl> let make <nl> let make <nl> ? ( tco_coercion_from_dynamic = default . tco_coercion_from_dynamic ) <nl> ? ( error_codes_treated_strictly = default . error_codes_treated_strictly ) <nl> ? ( tco_check_xhp_attribute = default . tco_check_xhp_attribute ) <nl> + ? ( tco_disallow_unresolved_type_variables = default . tco_disallow_unresolved_type_variables ) <nl> ( ) <nl> = { <nl> tco_safe_array ; <nl> let make <nl> tco_coercion_from_dynamic ; <nl> error_codes_treated_strictly ; <nl> tco_check_xhp_attribute ; <nl> + tco_disallow_unresolved_type_variables ; <nl> } <nl> let tco_safe_array t = t . tco_safe_array <nl> let tco_safe_vector_array t = t . tco_safe_vector_array <nl> let tco_ignore_collection_expr_type_arguments t = t . tco_ignore_collection_expr_t <nl> <nl> let tco_check_xhp_attribute t = t . tco_check_xhp_attribute <nl> <nl> + let tco_disallow_unresolved_type_variables t = t . tco_disallow_unresolved_type_variables <nl> + <nl> let setup_pocket_universes env enabled = <nl> let exp_features = env . tco_experimental_features in <nl> let exp_features = if enabled then <nl> mmm a / hphp / hack / src / options / globalOptions . mli <nl> ppp b / hphp / hack / src / options / globalOptions . mli <nl> type t = { <nl> <nl> ( * static check xhp required attribute * ) <nl> tco_check_xhp_attribute : bool ; <nl> + <nl> + ( * <nl> + * Flag to produce an error whenever the TAST contains unresolved type variables <nl> + * ) <nl> + tco_disallow_unresolved_type_variables : bool ; <nl> } [ @ @ deriving show ] <nl> <nl> val make : <nl> val make : <nl> ? tco_coercion_from_dynamic : bool - > <nl> ? error_codes_treated_strictly : ISet . t - > <nl> ? tco_check_xhp_attribute : bool - > <nl> + ? tco_disallow_unresolved_type_variables : bool - > <nl> unit - > <nl> t <nl> <nl> val tco_pessimize_types : t - > bool <nl> val tco_coercion_from_dynamic : t - > bool <nl> val error_codes_treated_strictly : t - > ISet . t <nl> val tco_check_xhp_attribute : t - > bool <nl> + val tco_disallow_unresolved_type_variables : t - > bool <nl> mmm a / hphp / hack / src / options / typecheckerOptions . ml <nl> ppp b / hphp / hack / src / options / typecheckerOptions . ml <nl> let pessimize_types = GlobalOptions . tco_pessimize_types <nl> let coercion_from_dynamic = GlobalOptions . tco_coercion_from_dynamic <nl> <nl> let check_xhp_attribute = GlobalOptions . tco_check_xhp_attribute <nl> + <nl> + let disallow_unresolved_type_variables = GlobalOptions . tco_disallow_unresolved_type_variables <nl> mmm a / hphp / hack / src / server / serverConfig . ml <nl> ppp b / hphp / hack / src / server / serverConfig . ml <nl> let load config_filename options = <nl> ? tco_coercion_from_dynamic : ( bool_opt " coercion_from_dynamic " config ) <nl> ~ error_codes_treated_strictly : ( prepare_error_codes_treated_strictly config ) <nl> ? tco_check_xhp_attribute : ( bool_opt " check_xhp_attribute " config ) <nl> + ? tco_disallow_unresolved_type_variables : ( bool_opt " disallow_unresolved_type_variables " config ) <nl> ( ) <nl> in <nl> Errors . ignored_fixme_codes : = <nl> mmm a / hphp / hack / src / typing / tast_check / tast_check . ml <nl> ppp b / hphp / hack / src / typing / tast_check / tast_check . ml <nl> let visitor opts = <nl> Obj_get_check . handler ; <nl> This_hint_check . handler ; <nl> Static_method_call_check . handler ; <nl> + Unresolved_type_variable_check . handler ; <nl> ] ) <nl> <nl> let program opts = ( visitor opts ) # go <nl> mmm a / hphp / hack / src / typing / tast_check / type_serialization_identity_check . ml <nl> ppp b / hphp / hack / src / typing / tast_check / type_serialization_identity_check . ml <nl> let handler = object <nl> <nl> method ! at_expr env ( ( p , ty ) , _ ) = <nl> try <nl> - let ty = Tast_expand . expand_ty env ty in <nl> + let ty = Tast_expand . expand_ty env ~ pos : p ty in <nl> let serialized_ty = Tast_env . ty_to_json env ty in <nl> let deserialized_ty = Tast_env . json_to_locl_ty serialized_ty in <nl> match deserialized_ty with <nl> new file mode 100644 <nl> index 00000000000 . . 718df80987b <nl> mmm / dev / null <nl> ppp b / hphp / hack / src / typing / tast_check / unresolved_type_variable_check . ml <nl> <nl> + ( * * <nl> + * Copyright ( c ) 2019 , Facebook , Inc . <nl> + * All rights reserved . <nl> + * <nl> + * This source code is licensed under the MIT license found in the <nl> + * LICENSE file in the " hack " directory of this source tree . <nl> + * <nl> + * ) <nl> + <nl> + let handler = object <nl> + inherit Tast_visitor . handler_base <nl> + <nl> + method ! at_expr env ( ( p , ty ) , _ ) = <nl> + if TypecheckerOptions . disallow_unresolved_type_variables ( Tast_env . get_tcopt env ) then <nl> + ignore ( Tast_expand . expand_ty ~ pos : p env ty ) <nl> + end <nl> mmm a / hphp / hack / src / typing / tast_expand . ml <nl> ppp b / hphp / hack / src / typing / tast_expand . ml <nl> module ETast = ExpandedTypeAnnotatedAST <nl> * Transform completely unconstrained types to Tmixed <nl> * Consider using a fresh datatype for TAST types . <nl> * ) <nl> - let expand_ty env ty = <nl> + let expand_ty ? pos env ty = <nl> let rec exp_ty ty = <nl> let _ , ety = Tast_env . expand_type env ty in <nl> let ety = match ety with <nl> let expand_ty env ty = <nl> ( p , Tshape ( fk , Nast . ShapeMap . map exp_sft fields ) ) <nl> | ( p , Tarraykind ak ) - > <nl> ( p , Tarraykind ( exp_array_kind ak ) ) <nl> - ( * TODO TAST : replace with a user error * ) <nl> - | ( p , Tvar v ) - > ( p , Tvar v ) <nl> + | ( p , Tvar v ) - > ( match pos with <nl> + | None - > ( p , Tvar v ) <nl> + | Some pos - > if TypecheckerOptions . disallow_unresolved_type_variables ( Tast_env . get_tcopt env ) <nl> + then Errors . unresolved_type_variable pos ; <nl> + ( p , Tvar v ) ) <nl> ( * TODO TAST : replace with Tfun type * ) <nl> | ( p , Tanon ( x , y ) ) - > ( p , Tanon ( x , y ) ) <nl> | ( p , Terr ) - > ( p , Terr ) in <nl> let expand_ty env ty = <nl> <nl> let expander = object <nl> inherit Tast_visitor . endo <nl> - method ! on_expr_annotation env ( pos , ty ) = ( pos , expand_ty env ty ) <nl> + method ! on_expr_annotation env ( pos , ty ) = ( pos , expand_ty ~ pos env ty ) <nl> end <nl> <nl> module ExpandAST = <nl> mmm a / hphp / hack / test / errors / error_map . ml <nl> ppp b / hphp / hack / test / errors / error_map . ml <nl> MethodVariance = 4313 <nl> MissingXhpRequiredAttr = 4314 <nl> BadXhpAttrRequiredOverride = 4315 <nl> ReifiedTparamVariadic = 4316 <nl> + UnresolvedTypeVariable = 4317 <nl> | } ] <nl>
Produce an error when TAST contains unresolved type variables
facebook/hhvm
c04df7b33320d24215e7c4b957801846fe04ed2c
2019-06-14T15:12:24Z
mmm a / modules / ml / src / svmsgd . cpp <nl> ppp b / modules / ml / src / svmsgd . cpp <nl> void SVMSGDImpl : : readParams ( const FileNode & fn ) <nl> void SVMSGDImpl : : clear ( ) <nl> { <nl> weights_ . release ( ) ; <nl> + shift_ = 0 ; <nl> } <nl> <nl> <nl>
Fixed small bug in SVMSGD : : clear ( ) .
opencv/opencv
c52217236732542b7ce9e70036bdb9a7574bfcd8
2016-02-10T13:59:12Z
new file mode 100644 <nl> index 00000000000 . . 5d669e283b8 <nl> mmm / dev / null <nl> ppp b / js / apps / system / aardvark / frontend / css / databaseView . css <nl> <nl> + # databaseDiv { <nl> + min - height : 300px ; <nl> + background - color : rgba ( 0 , 0 , 0 , 0 . 15 ) ; <nl> + padding : 5px ; <nl> + } <nl> + <nl> + . databaseButtons { <nl> + clear : both ; <nl> + } <nl> + <nl> + . databaseRight { <nl> + width : 70 % ; <nl> + float : left ; <nl> + } <nl> + <nl> + . databaseLeft { <nl> + width : 30 % ; <nl> + float : left ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . e64966abaa9 <nl> mmm / dev / null <nl> ppp b / js / apps / system / aardvark / frontend / js / collections / arangoDatabase . js <nl> <nl> + / * jslint indent : 2 , nomen : true , maxlen : 100 , sloppy : true , vars : true , white : true , plusplus : true * / <nl> + / * global window , Backbone , $ , window * / <nl> + <nl> + window . ArangoDatabase = Backbone . Collection . extend ( { <nl> + model : window . Database , <nl> + <nl> + url : function ( ) { <nl> + return ' / _api / database / ' ; <nl> + } , <nl> + <nl> + parse : function ( response ) { <nl> + return _ . map ( response . result , function ( v ) { <nl> + return { name : v } ; <nl> + } ) ; <nl> + } , <nl> + <nl> + initialize : function ( ) { <nl> + this . fetch ( ) ; <nl> + } , <nl> + <nl> + getDatabases : function ( ) { <nl> + this . fetch ( ) ; <nl> + return this . models ; <nl> + } , <nl> + <nl> + dropDatabase : function ( ) { <nl> + <nl> + } , <nl> + <nl> + createDatabse : function ( ) { <nl> + <nl> + } <nl> + } ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 85ab61e4263 <nl> mmm / dev / null <nl> ppp b / js / apps / system / aardvark / frontend / js / models / arangoDatabase . js <nl> <nl> + / * jslint indent : 2 , nomen : true , maxlen : 120 , vars : true , white : true , plusplus : true * / <nl> + / * global require , window , Backbone * / <nl> + <nl> + window . Database = Backbone . Model . extend ( { <nl> + initialize : function ( ) { <nl> + ' use strict ' ; <nl> + } , <nl> + <nl> + isNew : function ( ) { <nl> + ' use strict ' ; <nl> + return false ; <nl> + } , <nl> + <nl> + url : " / _api / database / " , <nl> + <nl> + methodToURL : { <nl> + ' read ' : ' / _api / database / ' , <nl> + ' create ' : ' / _api / database / ' , <nl> + ' update ' : ' / _api / databse / ' , <nl> + ' delete ' : ' / _api / database / ' + console . log ( this ) <nl> + } , <nl> + <nl> + sync : function ( method , model , options ) { <nl> + options = options | | { } ; <nl> + options . url = model . methodToURL [ method . toLowerCase ( ) ] ; <nl> + <nl> + return Backbone . sync . apply ( this , arguments ) ; <nl> + } , <nl> + <nl> + defaults : { <nl> + } <nl> + <nl> + <nl> + } ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 084fdaac574 <nl> mmm / dev / null <nl> ppp b / js / apps / system / aardvark / frontend / js / views / databaseView . js <nl> <nl> + / * jslint indent : 2 , nomen : true , maxlen : 100 , sloppy : true , vars : true , white : true , plusplus : true * / <nl> + / * global window , document , Backbone , EJS , SwaggerUi , hljs , $ * / <nl> + <nl> + window . databaseView = Backbone . View . extend ( { <nl> + el : ' # content ' , <nl> + <nl> + template : new EJS ( { url : ' js / templates / databaseView . ejs ' } ) , <nl> + <nl> + events : { <nl> + " click # createDatabase " : " createDatabase " , <nl> + " click # removeDatabase " : " removeDatabase " , <nl> + " click # selectDatabase " : " updateDatabase " <nl> + } , <nl> + <nl> + initialize : function ( ) { <nl> + var self = this ; <nl> + this . collection . fetch ( ) ; <nl> + } , <nl> + <nl> + render : function ( ) { <nl> + $ ( this . el ) . html ( this . template . render ( { } ) ) ; <nl> + this . renderOptions ( ) ; <nl> + return this ; <nl> + } , <nl> + <nl> + renderOptions : function ( ) { <nl> + this . collection . map ( function ( dbs ) { <nl> + $ ( ' # selectDatabases ' ) . append ( new Option ( dbs . get ( " name " ) , dbs . get ( " name " ) ) ) ; <nl> + } ) ; <nl> + } , <nl> + <nl> + selectedDatabase : function ( ) { <nl> + return $ ( ' # selectDatabases ' ) . val ( ) ; <nl> + } , <nl> + <nl> + createDatabase : function ( ) { <nl> + this . collection . create ( { name : " helloworld " } ) ; <nl> + } , <nl> + <nl> + removeDatabase : function ( ) { <nl> + var toDelete = this . collection . where ( { name : this . selectedDatabase ( ) } ) ; <nl> + console . log ( toDelete [ 0 ] ) ; <nl> + toDelete [ 0 ] . destroy ( { wait : true } ) ; <nl> + this . updateDatabases ( ) ; <nl> + } , <nl> + <nl> + selectDatabase : function ( ) { <nl> + <nl> + } , <nl> + <nl> + updateDatabases : function ( ) { <nl> + var self = this ; <nl> + this . collection . fetch ( { <nl> + success : function ( ) { <nl> + self . render ( ) ; <nl> + } <nl> + } ) ; <nl> + } <nl> + <nl> + } ) ; <nl>
added database models
arangodb/arangodb
b6aae2733f7f77216a4e88e7e37fdeea15a48047
2013-10-31T17:50:29Z
mmm a / make - package . sh <nl> ppp b / make - package . sh <nl> cp version " $ basedir " <nl> cp src / scripts / uninstall . sh " $ basedir " <nl> cp src / scripts / uninstall_core . sh " $ basedir " <nl> cp files / complex_modifications_rules_example . json " $ basedir " <nl> - cp - R " src / apps / Menu / build / Release / Karabiner - Menu . app " " $ basedir " <nl> + cp - R " src / apps / Menu / build_xcode / build / Release / Karabiner - Menu . app " " $ basedir " <nl> <nl> basedir = " pkgroot / Library / Application Support / org . pqrs / Karabiner - Elements / scripts " <nl> mkdir - p " $ basedir " <nl> new file mode 100644 <nl> index 000000000 . . 453c2d8ec <nl> mmm / dev / null <nl> ppp b / src / apps / Menu / CMakeLists . txt <nl> <nl> + cmake_minimum_required ( VERSION 3 . 9 ) <nl> + <nl> + include ( . . / . . / common . cmake ) <nl> + <nl> + project ( Karabiner - Menu ) <nl> + <nl> + add_compile_options ( <nl> + - Wall <nl> + - Werror <nl> + - O2 <nl> + - fmodules <nl> + - fobjc - arc <nl> + ) <nl> + <nl> + include_directories ( <nl> + / opt / local / include <nl> + / usr / local / include <nl> + . . / . . / share <nl> + . . / . . / vendor <nl> + . . / . . / lib / libkrbn / include <nl> + . . / lib / KarabinerKit / include <nl> + . . / share <nl> + ) <nl> + <nl> + link_directories ( <nl> + . . / . . / lib / libkrbn / build_xcode / build <nl> + . . / lib / KarabinerKit / build_xcode / build <nl> + ) <nl> + <nl> + add_executable ( <nl> + Karabiner - Menu <nl> + MACOSX_BUNDLE <nl> + src / AppDelegate . m <nl> + src / main . m <nl> + src / MenuController . m <nl> + Resources / Assets . xcassets <nl> + Resources / MainMenu . xib <nl> + . . / share / Resources / app . icns <nl> + ) <nl> + <nl> + set_source_files_properties ( <nl> + Resources / Assets . xcassets <nl> + Resources / MainMenu . xib <nl> + . . / share / Resources / app . icns <nl> + PROPERTIES <nl> + MACOSX_PACKAGE_LOCATION <nl> + Resources <nl> + ) <nl> + <nl> + set_target_properties ( <nl> + Karabiner - Menu <nl> + PROPERTIES <nl> + MACOSX_BUNDLE_INFO_PLIST <nl> + $ { CMAKE_CURRENT_LIST_DIR } / Resources / plist . in <nl> + ) <nl> + <nl> + target_link_libraries ( <nl> + Karabiner - Menu <nl> + KarabinerKit <nl> + krbn <nl> + " - framework SystemConfiguration " <nl> + c + + <nl> + ) <nl> mmm a / src / apps / Menu / Makefile <nl> ppp b / src / apps / Menu / Makefile <nl> <nl> - # CONFIGURATION = Debug <nl> - CONFIGURATION = Release <nl> + all : build_xcode <nl> <nl> - all : <nl> - . . / . . / . . / scripts / setversion . sh <nl> - make - C . . / lib / KarabinerKit <nl> - xcodebuild - alltargets - configuration $ ( CONFIGURATION ) build <nl> + clean : clean_builds <nl> <nl> - clean : <nl> - rm - rf build <nl> - rm - f * . xcodeproj / * . mode1 <nl> - rm - f * . xcodeproj / * . mode1v3 <nl> - rm - f * . xcodeproj / * . pbxuser <nl> - rm - rf * . xcodeproj / xcuserdata <nl> - rm - rf * . xcodeproj / project . xcworkspace / xcuserdata <nl> - <nl> - xcode : <nl> - open * . xcodeproj <nl> - <nl> - run : <nl> - . / build / Release / Karabiner - Menu . app / Contents / MacOS / Karabiner - Menu <nl> + include . . / . . / Makefile . rules <nl> deleted file mode 100644 <nl> index eae325c86 . . 000000000 <nl> mmm a / src / apps / Menu / Menu . xcodeproj / project . pbxproj <nl> ppp / dev / null <nl> <nl> - / / ! $ * UTF8 * $ ! <nl> - { <nl> - archiveVersion = 1 ; <nl> - classes = { <nl> - } ; <nl> - objectVersion = 47 ; <nl> - objects = { <nl> - <nl> - / * Begin PBXBuildFile section * / <nl> - 340CACD21E3DD20200A9D86D / * MenuController . m in Sources * / = { isa = PBXBuildFile ; fileRef = 340CACD11E3DD20200A9D86D / * MenuController . m * / ; } ; <nl> - 34496A211E188C0E00276D0B / * AppDelegate . m in Sources * / = { isa = PBXBuildFile ; fileRef = 34496A201E188C0E00276D0B / * AppDelegate . m * / ; } ; <nl> - 34496A241E188C0E00276D0B / * main . m in Sources * / = { isa = PBXBuildFile ; fileRef = 34496A231E188C0E00276D0B / * main . m * / ; } ; <nl> - 34496A261E188C0E00276D0B / * Assets . xcassets in Resources * / = { isa = PBXBuildFile ; fileRef = 34496A251E188C0E00276D0B / * Assets . xcassets * / ; } ; <nl> - 34496A291E188C0E00276D0B / * MainMenu . xib in Resources * / = { isa = PBXBuildFile ; fileRef = 34496A271E188C0E00276D0B / * MainMenu . xib * / ; } ; <nl> - 3452EC9E1E6994F900A5144C / * SystemConfiguration . framework in Frameworks * / = { isa = PBXBuildFile ; fileRef = 3452EC9D1E6994F900A5144C / * SystemConfiguration . framework * / ; } ; <nl> - 34D423381E18ECE5000E4154 / * libc + + . dylib in Frameworks * / = { isa = PBXBuildFile ; fileRef = 34D423371E18ECE5000E4154 / * libc + + . dylib * / ; } ; <nl> - 34D7B1831E3DD57B008E42AC / * libKarabinerKit . a in Frameworks * / = { isa = PBXBuildFile ; fileRef = 34D7B1821E3DD57B008E42AC / * libKarabinerKit . a * / ; } ; <nl> - / * End PBXBuildFile section * / <nl> - <nl> - / * Begin PBXFileReference section * / <nl> - 340CACD01E3DD20200A9D86D / * MenuController . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; path = MenuController . h ; sourceTree = " < group > " ; } ; <nl> - 340CACD11E3DD20200A9D86D / * MenuController . m * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . objc ; path = MenuController . m ; sourceTree = " < group > " ; } ; <nl> - 34496A1C1E188C0E00276D0B / * Karabiner - Menu . app * / = { isa = PBXFileReference ; explicitFileType = wrapper . application ; includeInIndex = 0 ; path = " Karabiner - Menu . app " ; sourceTree = BUILT_PRODUCTS_DIR ; } ; <nl> - 34496A1F1E188C0E00276D0B / * AppDelegate . h * / = { isa = PBXFileReference ; lastKnownFileType = sourcecode . c . h ; path = AppDelegate . h ; sourceTree = " < group > " ; } ; <nl> - 34496A201E188C0E00276D0B / * AppDelegate . m * / = { isa = PBXFileReference ; lastKnownFileType = sourcecode . c . objc ; path = AppDelegate . m ; sourceTree = " < group > " ; } ; <nl> - 34496A231E188C0E00276D0B / * main . m * / = { isa = PBXFileReference ; lastKnownFileType = sourcecode . c . objc ; path = main . m ; sourceTree = " < group > " ; } ; <nl> - 34496A251E188C0E00276D0B / * Assets . xcassets * / = { isa = PBXFileReference ; lastKnownFileType = folder . assetcatalog ; path = Assets . xcassets ; sourceTree = " < group > " ; } ; <nl> - 34496A281E188C0E00276D0B / * Base * / = { isa = PBXFileReference ; lastKnownFileType = file . xib ; name = Base ; path = Base . lproj / MainMenu . xib ; sourceTree = " < group > " ; } ; <nl> - 34496A2A1E188C0E00276D0B / * Info . plist * / = { isa = PBXFileReference ; lastKnownFileType = text . plist . xml ; path = Info . plist ; sourceTree = " < group > " ; } ; <nl> - 3452EC9D1E6994F900A5144C / * SystemConfiguration . framework * / = { isa = PBXFileReference ; lastKnownFileType = wrapper . framework ; name = SystemConfiguration . framework ; path = System / Library / Frameworks / SystemConfiguration . framework ; sourceTree = SDKROOT ; } ; <nl> - 34D423351E18ECB5000E4154 / * libkrbn . h * / = { isa = PBXFileReference ; fileEncoding = 4 ; lastKnownFileType = sourcecode . c . h ; name = libkrbn . h ; path = . . / . . / . . / lib / libkrbn / libkrbn . h ; sourceTree = " < group > " ; } ; <nl> - 34D423371E18ECE5000E4154 / * libc + + . dylib * / = { isa = PBXFileReference ; lastKnownFileType = " compiled . mach - o . dylib " ; name = " libc + + . dylib " ; path = " / usr / lib / libc + + . dylib " ; sourceTree = " < group > " ; } ; <nl> - 34D7B1821E3DD57B008E42AC / * libKarabinerKit . a * / = { isa = PBXFileReference ; lastKnownFileType = archive . ar ; name = libKarabinerKit . a ; path = . . / lib / KarabinerKit / build / Release / libKarabinerKit . a ; sourceTree = " < group > " ; } ; <nl> - / * End PBXFileReference section * / <nl> - <nl> - / * Begin PBXFrameworksBuildPhase section * / <nl> - 34496A191E188C0E00276D0B / * Frameworks * / = { <nl> - isa = PBXFrameworksBuildPhase ; <nl> - buildActionMask = 2147483647 ; <nl> - files = ( <nl> - 3452EC9E1E6994F900A5144C / * SystemConfiguration . framework in Frameworks * / , <nl> - 34D7B1831E3DD57B008E42AC / * libKarabinerKit . a in Frameworks * / , <nl> - 34D423381E18ECE5000E4154 / * libc + + . dylib in Frameworks * / , <nl> - ) ; <nl> - runOnlyForDeploymentPostprocessing = 0 ; <nl> - } ; <nl> - / * End PBXFrameworksBuildPhase section * / <nl> - <nl> - / * Begin PBXGroup section * / <nl> - 34496A131E188C0E00276D0B = { <nl> - isa = PBXGroup ; <nl> - children = ( <nl> - 34496A1E1E188C0E00276D0B / * Menu * / , <nl> - 34496A1D1E188C0E00276D0B / * Products * / , <nl> - 34D423361E18ECE5000E4154 / * Frameworks * / , <nl> - ) ; <nl> - sourceTree = " < group > " ; <nl> - } ; <nl> - 34496A1D1E188C0E00276D0B / * Products * / = { <nl> - isa = PBXGroup ; <nl> - children = ( <nl> - 34496A1C1E188C0E00276D0B / * Karabiner - Menu . app * / , <nl> - ) ; <nl> - name = Products ; <nl> - sourceTree = " < group > " ; <nl> - } ; <nl> - 34496A1E1E188C0E00276D0B / * Menu * / = { <nl> - isa = PBXGroup ; <nl> - children = ( <nl> - 34496A1F1E188C0E00276D0B / * AppDelegate . h * / , <nl> - 34496A201E188C0E00276D0B / * AppDelegate . m * / , <nl> - 34496A251E188C0E00276D0B / * Assets . xcassets * / , <nl> - 34496A2A1E188C0E00276D0B / * Info . plist * / , <nl> - 34496A271E188C0E00276D0B / * MainMenu . xib * / , <nl> - 340CACD01E3DD20200A9D86D / * MenuController . h * / , <nl> - 340CACD11E3DD20200A9D86D / * MenuController . m * / , <nl> - 34496A221E188C0E00276D0B / * Supporting Files * / , <nl> - ) ; <nl> - path = Menu ; <nl> - sourceTree = " < group > " ; <nl> - } ; <nl> - 34496A221E188C0E00276D0B / * Supporting Files * / = { <nl> - isa = PBXGroup ; <nl> - children = ( <nl> - 34D423351E18ECB5000E4154 / * libkrbn . h * / , <nl> - 34496A231E188C0E00276D0B / * main . m * / , <nl> - ) ; <nl> - name = " Supporting Files " ; <nl> - sourceTree = " < group > " ; <nl> - } ; <nl> - 34D423361E18ECE5000E4154 / * Frameworks * / = { <nl> - isa = PBXGroup ; <nl> - children = ( <nl> - 34D423371E18ECE5000E4154 / * libc + + . dylib * / , <nl> - 34D7B1821E3DD57B008E42AC / * libKarabinerKit . a * / , <nl> - 3452EC9D1E6994F900A5144C / * SystemConfiguration . framework * / , <nl> - ) ; <nl> - name = Frameworks ; <nl> - sourceTree = " < group > " ; <nl> - } ; <nl> - / * End PBXGroup section * / <nl> - <nl> - / * Begin PBXNativeTarget section * / <nl> - 34496A1B1E188C0E00276D0B / * Karabiner - Menu * / = { <nl> - isa = PBXNativeTarget ; <nl> - buildConfigurationList = 34496A2D1E188C0E00276D0B / * Build configuration list for PBXNativeTarget " Karabiner - Menu " * / ; <nl> - buildPhases = ( <nl> - 34496A181E188C0E00276D0B / * Sources * / , <nl> - 34496A191E188C0E00276D0B / * Frameworks * / , <nl> - 34496A1A1E188C0E00276D0B / * Resources * / , <nl> - ) ; <nl> - buildRules = ( <nl> - ) ; <nl> - dependencies = ( <nl> - ) ; <nl> - name = " Karabiner - Menu " ; <nl> - productName = Menu ; <nl> - productReference = 34496A1C1E188C0E00276D0B / * Karabiner - Menu . app * / ; <nl> - productType = " com . apple . product - type . application " ; <nl> - } ; <nl> - / * End PBXNativeTarget section * / <nl> - <nl> - / * Begin PBXProject section * / <nl> - 34496A141E188C0E00276D0B / * Project object * / = { <nl> - isa = PBXProject ; <nl> - attributes = { <nl> - LastUpgradeCheck = 0900 ; <nl> - TargetAttributes = { <nl> - 34496A1B1E188C0E00276D0B = { <nl> - CreatedOnToolsVersion = 8 . 2 ; <nl> - ProvisioningStyle = Automatic ; <nl> - } ; <nl> - } ; <nl> - } ; <nl> - buildConfigurationList = 34496A171E188C0E00276D0B / * Build configuration list for PBXProject " Menu " * / ; <nl> - compatibilityVersion = " Xcode 6 . 3 " ; <nl> - developmentRegion = English ; <nl> - hasScannedForEncodings = 0 ; <nl> - knownRegions = ( <nl> - en , <nl> - Base , <nl> - ) ; <nl> - mainGroup = 34496A131E188C0E00276D0B ; <nl> - productRefGroup = 34496A1D1E188C0E00276D0B / * Products * / ; <nl> - projectDirPath = " " ; <nl> - projectRoot = " " ; <nl> - targets = ( <nl> - 34496A1B1E188C0E00276D0B / * Karabiner - Menu * / , <nl> - ) ; <nl> - } ; <nl> - / * End PBXProject section * / <nl> - <nl> - / * Begin PBXResourcesBuildPhase section * / <nl> - 34496A1A1E188C0E00276D0B / * Resources * / = { <nl> - isa = PBXResourcesBuildPhase ; <nl> - buildActionMask = 2147483647 ; <nl> - files = ( <nl> - 34496A261E188C0E00276D0B / * Assets . xcassets in Resources * / , <nl> - 34496A291E188C0E00276D0B / * MainMenu . xib in Resources * / , <nl> - ) ; <nl> - runOnlyForDeploymentPostprocessing = 0 ; <nl> - } ; <nl> - / * End PBXResourcesBuildPhase section * / <nl> - <nl> - / * Begin PBXSourcesBuildPhase section * / <nl> - 34496A181E188C0E00276D0B / * Sources * / = { <nl> - isa = PBXSourcesBuildPhase ; <nl> - buildActionMask = 2147483647 ; <nl> - files = ( <nl> - 34496A241E188C0E00276D0B / * main . m in Sources * / , <nl> - 34496A211E188C0E00276D0B / * AppDelegate . m in Sources * / , <nl> - 340CACD21E3DD20200A9D86D / * MenuController . m in Sources * / , <nl> - ) ; <nl> - runOnlyForDeploymentPostprocessing = 0 ; <nl> - } ; <nl> - / * End PBXSourcesBuildPhase section * / <nl> - <nl> - / * Begin PBXVariantGroup section * / <nl> - 34496A271E188C0E00276D0B / * MainMenu . xib * / = { <nl> - isa = PBXVariantGroup ; <nl> - children = ( <nl> - 34496A281E188C0E00276D0B / * Base * / , <nl> - ) ; <nl> - name = MainMenu . xib ; <nl> - sourceTree = " < group > " ; <nl> - } ; <nl> - / * End PBXVariantGroup section * / <nl> - <nl> - / * Begin XCBuildConfiguration section * / <nl> - 34496A2C1E188C0E00276D0B / * Release * / = { <nl> - isa = XCBuildConfiguration ; <nl> - buildSettings = { <nl> - ALWAYS_SEARCH_USER_PATHS = NO ; <nl> - CLANG_ANALYZER_NONNULL = YES ; <nl> - CLANG_CXX_LANGUAGE_STANDARD = " gnu + + 0x " ; <nl> - CLANG_CXX_LIBRARY = " libc + + " ; <nl> - CLANG_ENABLE_MODULES = YES ; <nl> - CLANG_ENABLE_OBJC_ARC = YES ; <nl> - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES ; <nl> - CLANG_WARN_BOOL_CONVERSION = YES ; <nl> - CLANG_WARN_COMMA = YES ; <nl> - CLANG_WARN_CONSTANT_CONVERSION = YES ; <nl> - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR ; <nl> - CLANG_WARN_DOCUMENTATION_COMMENTS = YES ; <nl> - CLANG_WARN_EMPTY_BODY = YES ; <nl> - CLANG_WARN_ENUM_CONVERSION = YES ; <nl> - CLANG_WARN_INFINITE_RECURSION = YES ; <nl> - CLANG_WARN_INT_CONVERSION = YES ; <nl> - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES ; <nl> - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES ; <nl> - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR ; <nl> - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES ; <nl> - CLANG_WARN_STRICT_PROTOTYPES = YES ; <nl> - CLANG_WARN_SUSPICIOUS_MOVE = YES ; <nl> - CLANG_WARN_UNREACHABLE_CODE = YES ; <nl> - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES ; <nl> - COPY_PHASE_STRIP = NO ; <nl> - DEBUG_INFORMATION_FORMAT = " dwarf - with - dsym " ; <nl> - ENABLE_NS_ASSERTIONS = NO ; <nl> - ENABLE_STRICT_OBJC_MSGSEND = YES ; <nl> - GCC_C_LANGUAGE_STANDARD = gnu99 ; <nl> - GCC_NO_COMMON_BLOCKS = YES ; <nl> - GCC_TREAT_WARNINGS_AS_ERRORS = YES ; <nl> - GCC_WARN_64_TO_32_BIT_CONVERSION = YES ; <nl> - GCC_WARN_ABOUT_RETURN_TYPE = YES ; <nl> - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES ; <nl> - GCC_WARN_MISSING_PARENTHESES = YES ; <nl> - GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES ; <nl> - GCC_WARN_SHADOW = YES ; <nl> - GCC_WARN_SIGN_COMPARE = YES ; <nl> - GCC_WARN_UNDECLARED_SELECTOR = YES ; <nl> - GCC_WARN_UNINITIALIZED_AUTOS = YES ; <nl> - GCC_WARN_UNUSED_FUNCTION = YES ; <nl> - GCC_WARN_UNUSED_LABEL = YES ; <nl> - GCC_WARN_UNUSED_VALUE = YES ; <nl> - GCC_WARN_UNUSED_VARIABLE = YES ; <nl> - HEADER_SEARCH_PATHS = . . / lib / KarabinerKit / ; <nl> - LIBRARY_SEARCH_PATHS = ( <nl> - . . / . . / lib / libkrbn / build / Release , <nl> - . . / lib / KarabinerKit / build / Release , <nl> - ) ; <nl> - MACOSX_DEPLOYMENT_TARGET = 10 . 12 ; <nl> - MTL_ENABLE_DEBUG_INFO = NO ; <nl> - RUN_CLANG_STATIC_ANALYZER = YES ; <nl> - SDKROOT = macosx ; <nl> - WARNING_CFLAGS = " - Wpartial - availability " ; <nl> - } ; <nl> - name = Release ; <nl> - } ; <nl> - 34496A2F1E188C0E00276D0B / * Release * / = { <nl> - isa = XCBuildConfiguration ; <nl> - buildSettings = { <nl> - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon ; <nl> - COMBINE_HIDPI_IMAGES = YES ; <nl> - INFOPLIST_FILE = Menu / Info . plist ; <nl> - LD_RUNPATH_SEARCH_PATHS = " $ ( inherited ) @ executable_path / . . / Frameworks " ; <nl> - PRODUCT_BUNDLE_IDENTIFIER = " org . pqrs . Karabiner - Menu " ; <nl> - PRODUCT_NAME = " $ ( TARGET_NAME ) " ; <nl> - } ; <nl> - name = Release ; <nl> - } ; <nl> - / * End XCBuildConfiguration section * / <nl> - <nl> - / * Begin XCConfigurationList section * / <nl> - 34496A171E188C0E00276D0B / * Build configuration list for PBXProject " Menu " * / = { <nl> - isa = XCConfigurationList ; <nl> - buildConfigurations = ( <nl> - 34496A2C1E188C0E00276D0B / * Release * / , <nl> - ) ; <nl> - defaultConfigurationIsVisible = 0 ; <nl> - defaultConfigurationName = Release ; <nl> - } ; <nl> - 34496A2D1E188C0E00276D0B / * Build configuration list for PBXNativeTarget " Karabiner - Menu " * / = { <nl> - isa = XCConfigurationList ; <nl> - buildConfigurations = ( <nl> - 34496A2F1E188C0E00276D0B / * Release * / , <nl> - ) ; <nl> - defaultConfigurationIsVisible = 0 ; <nl> - defaultConfigurationName = Release ; <nl> - } ; <nl> - / * End XCConfigurationList section * / <nl> - } ; <nl> - rootObject = 34496A141E188C0E00276D0B / * Project object * / ; <nl> - } <nl> deleted file mode 100644 <nl> index 919434a62 . . 000000000 <nl> mmm a / src / apps / Menu / Menu . xcodeproj / project . xcworkspace / contents . xcworkspacedata <nl> ppp / dev / null <nl> <nl> - < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> - < Workspace <nl> - version = " 1 . 0 " > <nl> - < FileRef <nl> - location = " self : " > <nl> - < / FileRef > <nl> - < / Workspace > <nl> deleted file mode 100644 <nl> index 3d0b146c6 . . 000000000 <nl> Binary files a / src / apps / Menu / Menu / Assets . xcassets / AppIcon . appiconset / 1024 . png and / dev / null differ <nl> deleted file mode 100644 <nl> index d5d85928f . . 000000000 <nl> Binary files a / src / apps / Menu / Menu / Assets . xcassets / AppIcon . appiconset / 128 . png and / dev / null differ <nl> deleted file mode 100644 <nl> index 66f95ee65 . . 000000000 <nl> Binary files a / src / apps / Menu / Menu / Assets . xcassets / AppIcon . appiconset / 16 . png and / dev / null differ <nl> deleted file mode 100644 <nl> index 11761fc5d . . 000000000 <nl> Binary files a / src / apps / Menu / Menu / Assets . xcassets / AppIcon . appiconset / 256 - 1 . png and / dev / null differ <nl> deleted file mode 100644 <nl> index 11761fc5d . . 000000000 <nl> Binary files a / src / apps / Menu / Menu / Assets . xcassets / AppIcon . appiconset / 256 . png and / dev / null differ <nl> deleted file mode 100644 <nl> index 946d4f6b2 . . 000000000 <nl> Binary files a / src / apps / Menu / Menu / Assets . xcassets / AppIcon . appiconset / 32 - 1 . png and / dev / null differ <nl> deleted file mode 100644 <nl> index 946d4f6b2 . . 000000000 <nl> Binary files a / src / apps / Menu / Menu / Assets . xcassets / AppIcon . appiconset / 32 . png and / dev / null differ <nl> deleted file mode 100644 <nl> index 49d4a8dd4 . . 000000000 <nl> Binary files a / src / apps / Menu / Menu / Assets . xcassets / AppIcon . appiconset / 512 - 1 . png and / dev / null differ <nl> deleted file mode 100644 <nl> index 49d4a8dd4 . . 000000000 <nl> Binary files a / src / apps / Menu / Menu / Assets . xcassets / AppIcon . appiconset / 512 . png and / dev / null differ <nl> deleted file mode 100644 <nl> index d72803cd0 . . 000000000 <nl> Binary files a / src / apps / Menu / Menu / Assets . xcassets / AppIcon . appiconset / 64 . png and / dev / null differ <nl> deleted file mode 100644 <nl> index 377279b38 . . 000000000 <nl> mmm a / src / apps / Menu / Menu / Assets . xcassets / AppIcon . appiconset / Contents . json <nl> ppp / dev / null <nl> <nl> - { <nl> - " images " : [ <nl> - { <nl> - " size " : " 16x16 " , <nl> - " idiom " : " mac " , <nl> - " filename " : " 16 . png " , <nl> - " scale " : " 1x " <nl> - } , <nl> - { <nl> - " size " : " 16x16 " , <nl> - " idiom " : " mac " , <nl> - " filename " : " 32 . png " , <nl> - " scale " : " 2x " <nl> - } , <nl> - { <nl> - " size " : " 32x32 " , <nl> - " idiom " : " mac " , <nl> - " filename " : " 32 - 1 . png " , <nl> - " scale " : " 1x " <nl> - } , <nl> - { <nl> - " size " : " 32x32 " , <nl> - " idiom " : " mac " , <nl> - " filename " : " 64 . png " , <nl> - " scale " : " 2x " <nl> - } , <nl> - { <nl> - " size " : " 128x128 " , <nl> - " idiom " : " mac " , <nl> - " filename " : " 128 . png " , <nl> - " scale " : " 1x " <nl> - } , <nl> - { <nl> - " size " : " 128x128 " , <nl> - " idiom " : " mac " , <nl> - " filename " : " 256 . png " , <nl> - " scale " : " 2x " <nl> - } , <nl> - { <nl> - " size " : " 256x256 " , <nl> - " idiom " : " mac " , <nl> - " filename " : " 256 - 1 . png " , <nl> - " scale " : " 1x " <nl> - } , <nl> - { <nl> - " size " : " 256x256 " , <nl> - " idiom " : " mac " , <nl> - " filename " : " 512 . png " , <nl> - " scale " : " 2x " <nl> - } , <nl> - { <nl> - " size " : " 512x512 " , <nl> - " idiom " : " mac " , <nl> - " filename " : " 512 - 1 . png " , <nl> - " scale " : " 1x " <nl> - } , <nl> - { <nl> - " size " : " 512x512 " , <nl> - " idiom " : " mac " , <nl> - " filename " : " 1024 . png " , <nl> - " scale " : " 2x " <nl> - } <nl> - ] , <nl> - " info " : { <nl> - " version " : 1 , <nl> - " author " : " xcode " <nl> - } <nl> - } <nl> \ No newline at end of file <nl> similarity index 100 % <nl> rename from src / apps / Menu / Menu / Assets . xcassets / Contents . json <nl> rename to src / apps / Menu / Resources / Assets . xcassets / Contents . json <nl> similarity index 100 % <nl> rename from src / apps / Menu / Menu / Assets . xcassets / MenuIcon . imageset / Contents . json <nl> rename to src / apps / Menu / Resources / Assets . xcassets / MenuIcon . imageset / Contents . json <nl> similarity index 100 % <nl> rename from src / apps / Menu / Menu / Assets . xcassets / MenuIcon . imageset / icon . png <nl> rename to src / apps / Menu / Resources / Assets . xcassets / MenuIcon . imageset / icon . png <nl> similarity index 100 % <nl> rename from src / apps / Menu / Menu / Assets . xcassets / MenuIcon . imageset / icon_x2 . png <nl> rename to src / apps / Menu / Resources / Assets . xcassets / MenuIcon . imageset / icon_x2 . png <nl> similarity index 100 % <nl> rename from src / apps / Menu / Menu / Assets . xcassets / MenuIcon . imageset / icon_x3 . png <nl> rename to src / apps / Menu / Resources / Assets . xcassets / MenuIcon . imageset / icon_x3 . png <nl> similarity index 100 % <nl> rename from src / apps / Menu / Menu / Base . lproj / MainMenu . xib <nl> rename to src / apps / Menu / Resources / MainMenu . xib <nl> similarity index 78 % <nl> rename from src / apps / Menu / Menu / Info . plist . tmpl <nl> rename to src / apps / Menu / Resources / plist . in <nl> mmm a / src / apps / Menu / Menu / Info . plist . tmpl <nl> ppp b / src / apps / Menu / Resources / plist . in <nl> <nl> < key > CFBundleDevelopmentRegion < / key > <nl> < string > en < / string > <nl> < key > CFBundleExecutable < / key > <nl> - < string > $ ( EXECUTABLE_NAME ) < / string > <nl> + < string > @ PLIST_EXECUTABLE_NAME @ < / string > <nl> < key > CFBundleIconFile < / key > <nl> - < string > < / string > <nl> + < string > app . icns < / string > <nl> < key > CFBundleIdentifier < / key > <nl> < string > org . pqrs . Karabiner - Menu < / string > <nl> < key > CFBundleInfoDictionaryVersion < / key > <nl> < string > 6 . 0 < / string > <nl> < key > CFBundleName < / key > <nl> - < string > $ ( PRODUCT_NAME ) < / string > <nl> + < string > @ PLIST_PRODUCT_NAME @ < / string > <nl> < key > CFBundlePackageType < / key > <nl> < string > APPL < / string > <nl> < key > CFBundleShortVersionString < / key > <nl> - < string > PKGVERSION < / string > <nl> + < string > @ KARABINER_VERSION @ < / string > <nl> < key > CFBundleVersion < / key > <nl> - < string > PKGVERSION < / string > <nl> + < string > @ KARABINER_VERSION @ < / string > <nl> < key > LSMinimumSystemVersion < / key > <nl> - < string > $ ( MACOSX_DEPLOYMENT_TARGET ) < / string > <nl> + < string > @ PLIST_MACOSX_DEPLOYMENT_TARGET @ < / string > <nl> < key > NSMainNibFile < / key > <nl> < string > MainMenu < / string > <nl> < key > NSPrincipalClass < / key > <nl> similarity index 100 % <nl> rename from src / apps / Menu / Menu / . gitignore <nl> rename to src / apps / Menu / src / . gitignore <nl> similarity index 100 % <nl> rename from src / apps / Menu / Menu / AppDelegate . h <nl> rename to src / apps / Menu / src / AppDelegate . h <nl> similarity index 100 % <nl> rename from src / apps / Menu / Menu / AppDelegate . m <nl> rename to src / apps / Menu / src / AppDelegate . m <nl> similarity index 100 % <nl> rename from src / apps / Menu / Menu / MenuController . h <nl> rename to src / apps / Menu / src / MenuController . h <nl> similarity index 100 % <nl> rename from src / apps / Menu / Menu / MenuController . m <nl> rename to src / apps / Menu / src / MenuController . m <nl> similarity index 100 % <nl> rename from src / apps / Menu / Menu / main . m <nl> rename to src / apps / Menu / src / main . m <nl>
use cmake @ Menu
pqrs-org/Karabiner-Elements
64455dcea909fb8f32f421579dde509e67b62834
2018-05-22T13:52:36Z
mmm a / src / core / log . c <nl> ppp b / src / core / log . c <nl> void swLog_put ( int level , char * cnt ) <nl> p = localtime ( & t ) ; <nl> snprintf ( date_str , SW_LOG_DATE_STRLEN , " % d - % 02d - % 02d % 02d : % 02d : % 02d " , p - > tm_year + 1900 , p - > tm_mon + 1 , p - > tm_mday , <nl> p - > tm_hour , p - > tm_min , p - > tm_sec ) ; <nl> - n = snprintf ( log_str , SW_LOG_BUFFER_SIZE , " [ % s # % d . % d ] \ t % s \ t % s \ n " , date_str , SwooleG . pid , SwooleTG . id , level_str , <nl> - cnt ) ; <nl> + <nl> + char process_flag = ' . ' ; <nl> + int process_id = 0 ; <nl> + <nl> + switch ( SwooleG . process_type ) <nl> + { <nl> + case SW_PROCESS_MASTER : <nl> + process_flag = ' # ' ; <nl> + process_id = SwooleTG . id ; <nl> + break ; <nl> + case SW_PROCESS_MANAGER : <nl> + process_flag = ' $ ' ; <nl> + break ; <nl> + case SW_PROCESS_WORKER : <nl> + process_flag = ' * ' ; <nl> + process_id = SwooleWG . id ; <nl> + break ; <nl> + case SW_PROCESS_TASKWORKER : <nl> + process_flag = ' ^ ' ; <nl> + process_id = SwooleWG . id ; <nl> + break ; <nl> + default : <nl> + break ; <nl> + } <nl> + <nl> + n = snprintf ( log_str , SW_LOG_BUFFER_SIZE , " [ % s % c % d . % d ] \ t % s \ t % s \ n " , date_str , process_flag , SwooleG . pid , process_id , level_str , cnt ) ; <nl> <nl> if ( write ( SwooleG . log_fd , log_str , n ) < 0 ) <nl> { <nl>
added process_flag to log .
swoole/swoole-src
e6456223bd472de4d32909f6d78663fac86e3851
2015-03-25T03:21:48Z
mmm a / modules / gdscript / gd_parser . cpp <nl> ppp b / modules / gdscript / gd_parser . cpp <nl> void GDParser : : _parse_class ( ClassNode * p_class ) { <nl> <nl> Node * subexpr = NULL ; <nl> <nl> - subexpr = _parse_and_reduce_expression ( p_class , false ) ; <nl> + subexpr = _parse_and_reduce_expression ( p_class , false , autoexport ) ; <nl> if ( ! subexpr ) <nl> return ; <nl> <nl> member . expression = subexpr ; <nl> <nl> if ( autoexport ) { <nl> - if ( subexpr - > type = = Node : : TYPE_ARRAY ) { <nl> + if ( 1 ) / * ( subexpr - > type = = Node : : TYPE_ARRAY ) { <nl> <nl> member . _export . type = Variant : : ARRAY ; <nl> <nl> void GDParser : : _parse_class ( ClassNode * p_class ) { <nl> <nl> member . _export . type = Variant : : DICTIONARY ; <nl> <nl> - } else { <nl> + } else * / { <nl> <nl> if ( subexpr - > type ! = Node : : TYPE_CONSTANT ) { <nl> <nl> new file mode 100644 <nl> index 00000000000 . . 61081b73d19 <nl> mmm / dev / null <nl> ppp b / tools / editor / array_property_edit . cpp <nl> <nl> + # include " array_property_edit . h " <nl> + <nl> + # include " editor_node . h " <nl> + <nl> + # define ITEMS_PER_PAGE 100 <nl> + <nl> + Variant ArrayPropertyEdit : : get_array ( ) const { <nl> + <nl> + Object * o = ObjectDB : : get_instance ( obj ) ; <nl> + if ( ! o ) <nl> + return Array ( ) ; <nl> + return o - > get ( property ) ; <nl> + } <nl> + <nl> + void ArrayPropertyEdit : : _notif_change ( ) { <nl> + _change_notify ( ) ; <nl> + } <nl> + void ArrayPropertyEdit : : _notif_changev ( const String & p_v ) { <nl> + <nl> + _change_notify ( p_v . utf8 ( ) . get_data ( ) ) ; <nl> + } <nl> + <nl> + void ArrayPropertyEdit : : _set_size ( int p_size ) { <nl> + <nl> + Variant arr = get_array ( ) ; <nl> + arr . call ( " resize " , p_size ) ; <nl> + Object * o = ObjectDB : : get_instance ( obj ) ; <nl> + if ( ! o ) <nl> + return ; <nl> + <nl> + o - > set ( property , arr ) ; <nl> + <nl> + } <nl> + <nl> + void ArrayPropertyEdit : : _set_value ( int p_idx , const Variant & p_value ) { <nl> + <nl> + Variant arr = get_array ( ) ; <nl> + arr . set ( p_idx , p_value ) ; <nl> + Object * o = ObjectDB : : get_instance ( obj ) ; <nl> + if ( ! o ) <nl> + return ; <nl> + <nl> + o - > set ( property , arr ) ; <nl> + } <nl> + <nl> + bool ArrayPropertyEdit : : _set ( const StringName & p_name , const Variant & p_value ) { <nl> + <nl> + String pn = p_name ; <nl> + <nl> + if ( pn . begins_with ( " array / " ) ) { <nl> + <nl> + if ( pn = = " array / size " ) { <nl> + <nl> + Variant arr = get_array ( ) ; <nl> + int size = arr . call ( " size " ) ; <nl> + <nl> + int newsize = p_value ; <nl> + if ( newsize = = size ) <nl> + return true ; <nl> + <nl> + UndoRedo * ur = EditorNode : : get_singleton ( ) - > get_undo_redo ( ) ; <nl> + ur - > create_action ( " Resize Array " ) ; <nl> + ur - > add_do_method ( this , " _set_size " , newsize ) ; <nl> + ur - > add_undo_method ( this , " _set_size " , size ) ; <nl> + if ( newsize < size ) { <nl> + for ( int i = newsize ; i < size ; i + + ) { <nl> + ur - > add_undo_method ( this , " _set_value " , i , arr . get ( i ) ) ; <nl> + <nl> + } <nl> + } <nl> + ur - > add_do_method ( this , " _notif_change " ) ; <nl> + ur - > add_undo_method ( this , " _notif_change " ) ; <nl> + ur - > commit_action ( ) ; <nl> + return true ; <nl> + } <nl> + if ( pn = = " array / page " ) { <nl> + page = p_value ; <nl> + _change_notify ( ) ; <nl> + return true ; <nl> + } <nl> + } else if ( pn . begins_with ( " indices " ) ) { <nl> + <nl> + if ( pn . find ( " _ " ) ! = - 1 ) { <nl> + / / type <nl> + int idx = pn . get_slicec ( ' / ' , 1 ) . get_slicec ( ' _ ' , 0 ) . to_int ( ) ; <nl> + <nl> + int type = p_value ; <nl> + <nl> + Variant arr = get_array ( ) ; <nl> + <nl> + Variant value = arr . get ( idx ) ; <nl> + if ( value . get_type ( ) ! = type & & type > = 0 & & type < Variant : : VARIANT_MAX ) { <nl> + Variant : : CallError ce ; <nl> + Variant new_value = Variant : : construct ( Variant : : Type ( type ) , NULL , 0 , ce ) ; <nl> + UndoRedo * ur = EditorNode : : get_singleton ( ) - > get_undo_redo ( ) ; <nl> + <nl> + ur - > create_action ( " Change Array Value Type " ) ; <nl> + ur - > add_do_method ( this , " _set_value " , idx , new_value ) ; <nl> + ur - > add_undo_method ( this , " _set_value " , idx , value ) ; <nl> + ur - > add_do_method ( this , " _notif_change " ) ; <nl> + ur - > add_undo_method ( this , " _notif_change " ) ; <nl> + ur - > commit_action ( ) ; <nl> + <nl> + } <nl> + return true ; <nl> + <nl> + } else { <nl> + int idx = pn . get_slicec ( ' / ' , 1 ) . to_int ( ) ; <nl> + Variant arr = get_array ( ) ; <nl> + <nl> + Variant value = arr . get ( idx ) ; <nl> + UndoRedo * ur = EditorNode : : get_singleton ( ) - > get_undo_redo ( ) ; <nl> + <nl> + ur - > create_action ( " Change Array Value " ) ; <nl> + ur - > add_do_method ( this , " _set_value " , idx , p_value ) ; <nl> + ur - > add_undo_method ( this , " _set_value " , idx , value ) ; <nl> + ur - > add_do_method ( this , " _notif_changev " , p_name ) ; <nl> + ur - > add_undo_method ( this , " _notif_changev " , p_name ) ; <nl> + ur - > commit_action ( ) ; <nl> + return true ; <nl> + } <nl> + } <nl> + <nl> + return false ; <nl> + } <nl> + <nl> + bool ArrayPropertyEdit : : _get ( const StringName & p_name , Variant & r_ret ) const { <nl> + <nl> + Variant arr = get_array ( ) ; <nl> + / / int size = arr . call ( " size " ) ; <nl> + <nl> + String pn = p_name ; <nl> + if ( pn . begins_with ( " array / " ) ) { <nl> + <nl> + if ( pn = = " array / size " ) { <nl> + r_ret = arr . call ( " size " ) ; <nl> + return true ; <nl> + } <nl> + if ( pn = = " array / page " ) { <nl> + r_ret = page ; <nl> + return true ; <nl> + } <nl> + } else if ( pn . begins_with ( " indices " ) ) { <nl> + <nl> + if ( pn . find ( " _ " ) ! = - 1 ) { <nl> + / / type <nl> + int idx = pn . get_slicec ( ' / ' , 1 ) . get_slicec ( ' _ ' , 0 ) . to_int ( ) ; <nl> + bool valid ; <nl> + r_ret = arr . get ( idx , & valid ) ; <nl> + if ( valid ) <nl> + r_ret = r_ret . get_type ( ) ; <nl> + return valid ; <nl> + <nl> + } else { <nl> + int idx = pn . get_slicec ( ' / ' , 1 ) . to_int ( ) ; <nl> + bool valid ; <nl> + r_ret = arr . get ( idx , & valid ) ; <nl> + return valid ; <nl> + } <nl> + } <nl> + <nl> + return false ; <nl> + } <nl> + <nl> + void ArrayPropertyEdit : : _get_property_list ( List < PropertyInfo > * p_list ) const { <nl> + <nl> + Variant arr = get_array ( ) ; <nl> + int size = arr . call ( " size " ) ; <nl> + <nl> + p_list - > push_back ( PropertyInfo ( Variant : : INT , " array / size " , PROPERTY_HINT_RANGE , " 0 , 100000 , 1 " ) ) ; <nl> + int pages = size / ITEMS_PER_PAGE ; <nl> + if ( pages > 0 ) <nl> + p_list - > push_back ( PropertyInfo ( Variant : : INT , " array / page " , PROPERTY_HINT_RANGE , " 0 , " + itos ( pages ) + " , 1 " ) ) ; <nl> + <nl> + int offset = page * ITEMS_PER_PAGE ; <nl> + <nl> + int items = MIN ( size - offset , ITEMS_PER_PAGE ) ; <nl> + <nl> + <nl> + for ( int i = 0 ; i < items ; i + + ) { <nl> + <nl> + Variant v = arr . get ( i + offset ) ; <nl> + if ( arr . get_type ( ) = = Variant : : ARRAY ) { <nl> + p_list - > push_back ( PropertyInfo ( Variant : : INT , " indices / " + itos ( i + offset ) + " _type " , PROPERTY_HINT_ENUM , vtypes ) ) ; <nl> + } <nl> + if ( arr . get_type ( ) ! = Variant : : ARRAY | | v . get_type ( ) ! = Variant : : NIL ) { <nl> + PropertyInfo pi ( v . get_type ( ) , " indices / " + itos ( i + offset ) ) ; <nl> + if ( v . get_type ( ) = = Variant : : OBJECT ) { <nl> + pi . hint = PROPERTY_HINT_RESOURCE_TYPE ; <nl> + pi . hint_string = " Resource " ; <nl> + } <nl> + p_list - > push_back ( pi ) ; <nl> + } <nl> + } <nl> + <nl> + } <nl> + <nl> + void ArrayPropertyEdit : : edit ( Object * p_obj , const StringName & p_prop ) { <nl> + <nl> + page = 0 ; <nl> + property = p_prop ; <nl> + obj = p_obj - > get_instance_ID ( ) ; <nl> + <nl> + } <nl> + <nl> + void ArrayPropertyEdit : : _bind_methods ( ) { <nl> + <nl> + ObjectTypeDB : : bind_method ( _MD ( " _set_size " ) , & ArrayPropertyEdit : : _set_size ) ; <nl> + ObjectTypeDB : : bind_method ( _MD ( " _set_value " ) , & ArrayPropertyEdit : : _set_value ) ; <nl> + ObjectTypeDB : : bind_method ( _MD ( " _notif_change " ) , & ArrayPropertyEdit : : _notif_change ) ; <nl> + ObjectTypeDB : : bind_method ( _MD ( " _notif_changev " ) , & ArrayPropertyEdit : : _notif_changev ) ; <nl> + } <nl> + <nl> + ArrayPropertyEdit : : ArrayPropertyEdit ( ) <nl> + { <nl> + page = 0 ; <nl> + for ( int i = 0 ; i < Variant : : VARIANT_MAX ; i + + ) { <nl> + <nl> + if ( i > 0 ) <nl> + vtypes + = " , " ; <nl> + vtypes + = Variant : : get_type_name ( Variant : : Type ( i ) ) ; <nl> + } <nl> + <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 0bf7468eeb0 <nl> mmm / dev / null <nl> ppp b / tools / editor / array_property_edit . h <nl> <nl> + # ifndef ARRAY_PROPERTY_EDIT_H <nl> + # define ARRAY_PROPERTY_EDIT_H <nl> + <nl> + # include " scene / main / node . h " <nl> + <nl> + class ArrayPropertyEdit : public Reference { <nl> + <nl> + OBJ_TYPE ( ArrayPropertyEdit , Reference ) ; <nl> + <nl> + int page ; <nl> + ObjectID obj ; <nl> + StringName property ; <nl> + String vtypes ; <nl> + Variant get_array ( ) const ; <nl> + <nl> + void _notif_change ( ) ; <nl> + void _notif_changev ( const String & p_v ) ; <nl> + void _set_size ( int p_size ) ; <nl> + void _set_value ( int p_idx , const Variant & p_value ) ; <nl> + <nl> + protected : <nl> + <nl> + static void _bind_methods ( ) ; <nl> + bool _set ( const StringName & p_name , const Variant & p_value ) ; <nl> + bool _get ( const StringName & p_name , Variant & r_ret ) const ; <nl> + void _get_property_list ( List < PropertyInfo > * p_list ) const ; <nl> + <nl> + public : <nl> + <nl> + void edit ( Object * p_obj , const StringName & p_prop ) ; <nl> + <nl> + ArrayPropertyEdit ( ) ; <nl> + } ; <nl> + <nl> + # endif / / ARRAY_PROPERTY_EDIT_H <nl> mmm a / tools / editor / property_editor . cpp <nl> ppp b / tools / editor / property_editor . cpp <nl> <nl> # include " editor_import_export . h " <nl> # include " editor_node . h " <nl> # include " multi_node_edit . h " <nl> + # include " array_property_edit . h " <nl> <nl> void CustomPropertyEditor : : _notification ( int p_what ) { <nl> <nl> void PropertyEditor : : update_tree ( ) { <nl> } <nl> <nl> } break ; <nl> + case Variant : : ARRAY : { <nl> + <nl> + item - > set_cell_mode ( 1 , TreeItem : : CELL_MODE_CUSTOM ) ; <nl> + item - > add_button ( 1 , get_icon ( " EditResource " , " EditorIcons " ) ) ; <nl> + <nl> + <nl> + Variant v = obj - > get ( p . name ) ; <nl> + if ( v . is_array ( ) ) <nl> + item - > set_text ( 1 , " Array [ " + itos ( v . call ( " size " ) ) + " ] " ) ; <nl> + else <nl> + item - > set_text ( 1 , " Array [ ] " ) ; <nl> + item - > set_icon ( 0 , get_icon ( " ArrayData " , " EditorIcons " ) ) ; <nl> + <nl> + <nl> + } break ; <nl> + <nl> case Variant : : INT_ARRAY : { <nl> <nl> item - > set_cell_mode ( 1 , TreeItem : : CELL_MODE_CUSTOM ) ; <nl> - item - > set_editable ( 1 , ! read_only ) ; <nl> - item - > set_text ( 1 , " [ IntArray ] " ) ; <nl> + item - > add_button ( 1 , get_icon ( " EditResource " , " EditorIcons " ) ) ; <nl> + <nl> + Variant v = obj - > get ( p . name ) ; <nl> + if ( v . is_array ( ) ) <nl> + item - > set_text ( 1 , " IntArray [ " + itos ( v . call ( " size " ) ) + " ] " ) ; <nl> + else <nl> + item - > set_text ( 1 , " IntArray [ ] " ) ; <nl> item - > set_icon ( 0 , get_icon ( " ArrayInt " , " EditorIcons " ) ) ; <nl> <nl> <nl> void PropertyEditor : : update_tree ( ) { <nl> case Variant : : REAL_ARRAY : { <nl> <nl> item - > set_cell_mode ( 1 , TreeItem : : CELL_MODE_CUSTOM ) ; <nl> - item - > set_editable ( 1 , ! read_only ) ; <nl> - item - > set_text ( 1 , " [ RealArray ] " ) ; <nl> + item - > add_button ( 1 , get_icon ( " EditResource " , " EditorIcons " ) ) ; <nl> + <nl> + Variant v = obj - > get ( p . name ) ; <nl> + if ( v . is_array ( ) ) <nl> + item - > set_text ( 1 , " FloatArray [ " + itos ( v . call ( " size " ) ) + " ] " ) ; <nl> + else <nl> + item - > set_text ( 1 , " FloatArray [ ] " ) ; <nl> item - > set_icon ( 0 , get_icon ( " ArrayReal " , " EditorIcons " ) ) ; <nl> <nl> + <nl> } break ; <nl> case Variant : : STRING_ARRAY : { <nl> <nl> item - > set_cell_mode ( 1 , TreeItem : : CELL_MODE_CUSTOM ) ; <nl> - item - > set_editable ( 1 , ! read_only ) ; <nl> - item - > set_text ( 1 , " [ StringArray ] " ) ; <nl> + item - > add_button ( 1 , get_icon ( " EditResource " , " EditorIcons " ) ) ; <nl> + <nl> + Variant v = obj - > get ( p . name ) ; <nl> + if ( v . is_array ( ) ) <nl> + item - > set_text ( 1 , " String [ " + itos ( v . call ( " size " ) ) + " ] " ) ; <nl> + else <nl> + item - > set_text ( 1 , " String [ ] " ) ; <nl> item - > set_icon ( 0 , get_icon ( " ArrayString " , " EditorIcons " ) ) ; <nl> <nl> + <nl> } break ; <nl> case Variant : : RAW_ARRAY : { <nl> <nl> item - > set_cell_mode ( 1 , TreeItem : : CELL_MODE_CUSTOM ) ; <nl> - item - > set_editable ( 1 , ! read_only ) ; <nl> - item - > set_text ( 1 , " [ Raw Data ] " ) ; <nl> + item - > add_button ( 1 , get_icon ( " EditResource " , " EditorIcons " ) ) ; <nl> + <nl> + Variant v = obj - > get ( p . name ) ; <nl> + if ( v . is_array ( ) ) <nl> + item - > set_text ( 1 , " Byte [ " + itos ( v . call ( " size " ) ) + " ] " ) ; <nl> + else <nl> + item - > set_text ( 1 , " Byte [ ] " ) ; <nl> item - > set_icon ( 0 , get_icon ( " ArrayData " , " EditorIcons " ) ) ; <nl> <nl> + <nl> + } break ; <nl> + case Variant : : VECTOR2_ARRAY : { <nl> + <nl> + item - > set_cell_mode ( 1 , TreeItem : : CELL_MODE_CUSTOM ) ; <nl> + item - > add_button ( 1 , get_icon ( " EditResource " , " EditorIcons " ) ) ; <nl> + <nl> + Variant v = obj - > get ( p . name ) ; <nl> + if ( v . is_array ( ) ) <nl> + item - > set_text ( 1 , " Vector2 [ " + itos ( v . call ( " size " ) ) + " ] " ) ; <nl> + else <nl> + item - > set_text ( 1 , " Vector2 [ ] " ) ; <nl> + item - > set_icon ( 0 , get_icon ( " Vector2 " , " EditorIcons " ) ) ; <nl> + <nl> + <nl> + } break ; <nl> + case Variant : : VECTOR3_ARRAY : { <nl> + <nl> + item - > set_cell_mode ( 1 , TreeItem : : CELL_MODE_CUSTOM ) ; <nl> + item - > add_button ( 1 , get_icon ( " EditResource " , " EditorIcons " ) ) ; <nl> + <nl> + Variant v = obj - > get ( p . name ) ; <nl> + if ( v . is_array ( ) ) <nl> + item - > set_text ( 1 , " Vector3 [ " + itos ( v . call ( " size " ) ) + " ] " ) ; <nl> + else <nl> + item - > set_text ( 1 , " Vector3 [ ] " ) ; <nl> + item - > set_icon ( 0 , get_icon ( " Vector " , " EditorIcons " ) ) ; <nl> + <nl> + <nl> + } break ; <nl> + case Variant : : COLOR_ARRAY : { <nl> + <nl> + item - > set_cell_mode ( 1 , TreeItem : : CELL_MODE_CUSTOM ) ; <nl> + item - > add_button ( 1 , get_icon ( " EditResource " , " EditorIcons " ) ) ; <nl> + <nl> + Variant v = obj - > get ( p . name ) ; <nl> + if ( v . is_array ( ) ) <nl> + item - > set_text ( 1 , " Color [ " + itos ( v . call ( " size " ) ) + " ] " ) ; <nl> + else <nl> + item - > set_text ( 1 , " Color [ ] " ) ; <nl> + item - > set_icon ( 0 , get_icon ( " Color " , " EditorIcons " ) ) ; <nl> + <nl> + <nl> } break ; <nl> case Variant : : VECTOR2 : { <nl> <nl> void PropertyEditor : : _edit_set ( const String & p_name , const Variant & p_value ) { <nl> } <nl> } <nl> <nl> - if ( ! undo_redo | | obj - > cast_to < MultiNodeEdit > ( ) ) { / / kind of hacky <nl> + if ( ! undo_redo | | obj - > cast_to < MultiNodeEdit > ( ) | | obj - > cast_to < ArrayPropertyEdit > ( ) ) { / / kind of hacky <nl> <nl> obj - > set ( p_name , p_value ) ; <nl> _changed_callbacks ( obj , p_name ) ; <nl> void PropertyEditor : : _edit_button ( Object * p_item , int p_column , int p_button ) { <nl> <nl> emit_signal ( " resource_selected " , r , n ) ; <nl> } <nl> + } else if ( t = = Variant : : ARRAY | | t = = Variant : : INT_ARRAY | | t = = Variant : : REAL_ARRAY | | t = = Variant : : STRING_ARRAY | | t = = Variant : : VECTOR2_ARRAY | | t = = Variant : : VECTOR3_ARRAY | | t = = Variant : : COLOR_ARRAY | | t = = Variant : : RAW_ARRAY ) { <nl> + <nl> + Variant v = obj - > get ( n ) ; <nl> + <nl> + if ( v . get_type ( ) ! = t ) { <nl> + Variant : : CallError ce ; <nl> + v = Variant : : construct ( Variant : : Type ( t ) , NULL , 0 , ce ) ; <nl> + } <nl> + <nl> + Ref < ArrayPropertyEdit > ape = memnew ( ArrayPropertyEdit ) ; <nl> + ape - > edit ( obj , n ) ; <nl> + <nl> + EditorNode : : get_singleton ( ) - > push_item ( ape . ptr ( ) ) ; <nl> } <nl> } <nl> } <nl>
Ability to edit all kinds of arrays from the property editor .
godotengine/godot
04cb3c9eb13b3824f676bc29e037802bffc3bdac
2015-08-25T23:45:51Z
mmm a / include / rocksdb / c . h <nl> ppp b / include / rocksdb / c . h <nl> enum { <nl> rocksdb_zlib_compression = 2 , <nl> rocksdb_bz2_compression = 3 , <nl> rocksdb_lz4_compression = 4 , <nl> - rocksdb_lz4hc_compression = 5 <nl> + rocksdb_lz4hc_compression = 5 , <nl> + rocksdb_xpress_compression = 6 , <nl> + rocksdb_zstd_compression = 7 <nl> } ; <nl> extern ROCKSDB_LIBRARY_API void rocksdb_options_set_compression ( <nl> rocksdb_options_t * , int ) ; <nl>
Add Xpress and ZSTD CompressionType values to C header
facebook/rocksdb
5fa927aa97424f1e5752401141037fbb5d7ab79e
2017-03-14T19:09:21Z
mmm a / hphp / runtime / base / config . cpp <nl> ppp b / hphp / runtime / base / config . cpp <nl> std : : string hdfToIni ( const std : : string & name ) { <nl> boost : : replace_first ( out , " . my_sql . " , " . mysql . " ) ; <nl> boost : : replace_first ( out , " . enable_hip_hop_syntax " , " . force_hh " ) ; <nl> <nl> + / / Fix " XDebug " turning into " x_debug " . <nl> + boost : : replace_first ( out , " hhvm . debugger . x_debug_ " , " xdebug . " ) ; <nl> + / / HHVM - specific option , leave it as such . <nl> + boost : : replace_first ( out , " xdebug . chrome " , " hhvm . debugger . xdebug_chrome " ) ; <nl> + <nl> return out ; <nl> } <nl> <nl> mmm a / hphp / runtime / base / runtime - option . cpp <nl> ppp b / hphp / runtime / base / runtime - option . cpp <nl> std : : string RuntimeOption : : DebuggerDefaultSandboxPath ; <nl> std : : string RuntimeOption : : DebuggerStartupDocument ; <nl> int RuntimeOption : : DebuggerSignalTimeout = 1 ; <nl> <nl> + bool RuntimeOption : : XDebugChrome = false ; <nl> + <nl> std : : string RuntimeOption : : SendmailPath = " sendmail - t - i " ; <nl> std : : string RuntimeOption : : MailForceExtraParameters ; <nl> <nl> void RuntimeOption : : Load ( IniSetting : : Map & ini , Hdf & config , <nl> Config : : Bind ( DebuggerRpcHostDomain , ini , debugger [ " RPC . HostDomain " ] ) ; <nl> Config : : Bind ( DebuggerDefaultRpcTimeout , ini , <nl> debugger [ " RPC . DefaultTimeout " ] , 30 ) ; <nl> + <nl> + Config : : Bind ( XDebugChrome , ini , debugger [ " XDebugChrome " ] , false ) ; <nl> } <nl> } <nl> { <nl> mmm a / hphp / runtime / base / runtime - option . h <nl> ppp b / hphp / runtime / base / runtime - option . h <nl> class RuntimeOption { <nl> static std : : string DebuggerStartupDocument ; <nl> static int DebuggerSignalTimeout ; <nl> <nl> + static bool XDebugChrome ; <nl> + <nl> / / Mail options <nl> static std : : string SendmailPath ; <nl> static std : : string MailForceExtraParameters ; <nl> new file mode 100644 <nl> index 00000000000 . . ee0e7ba5c68 <nl> mmm / dev / null <nl> ppp b / hphp / runtime / ext / xdebug / chrome . cpp <nl> <nl> + / * <nl> + + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> + | HipHop for PHP | <nl> + + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> + | Copyright ( c ) 2010 - 2014 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> + # include " hphp / runtime / ext / xdebug / chrome . h " <nl> + <nl> + # include " hphp / util / exception . h " <nl> + <nl> + # include " hphp / runtime / base / array - init . h " <nl> + # include " hphp / runtime / base / builtin - functions . h " <nl> + # include " hphp / runtime / base / type - string . h " <nl> + # include " hphp / runtime / base / zend - string . h " <nl> + # include " hphp / runtime / ext / xdebug / php5_xdebug / xdebug_xml . h " <nl> + <nl> + # include < folly / json . h > <nl> + # include < folly / Range . h > <nl> + <nl> + using folly : : dynamic ; <nl> + using folly : : StringPiece ; <nl> + <nl> + namespace HPHP { <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + namespace { <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + / * Linked list search for matching attribute . * / <nl> + xdebug_xml_attribute * find_attr ( xdebug_xml_node * node , StringPiece name ) { <nl> + auto attr = node - > attribute ; <nl> + <nl> + while ( attr ! = nullptr ) { <nl> + if ( attr - > name = = name ) { <nl> + return attr ; <nl> + } <nl> + attr = attr - > next ; <nl> + } <nl> + <nl> + return nullptr ; <nl> + } <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + } <nl> + <nl> + std : : string chrome_to_dbgp ( StringPiece chrome ) { <nl> + try { <nl> + auto const dyn = parseJson ( chrome , folly : : json : : serialization_opts { } ) ; <nl> + <nl> + auto const & req = dyn [ " request " ] ; <nl> + auto const & id = req [ " id " ] ; <nl> + auto const & method = req [ " method " ] . getString ( ) ; <nl> + <nl> + if ( method = = " Debugger . resume " ) { <nl> + return folly : : sformat ( " run - i { } " , id ) ; <nl> + } <nl> + throw Exception ( " Unknown command from chrome debugger client " ) ; <nl> + } catch ( const std : : exception & exn ) { <nl> + throw Exception ( " XDebug : % s . Command : ' % s ' . " , exn . what ( ) , chrome . data ( ) ) ; <nl> + } <nl> + } <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + std : : string dbgp_to_chrome ( xdebug_xml_node * xml ) { <nl> + try { <nl> + / / XDebug sends this when it is starting up . <nl> + if ( strcmp ( xml - > tag , " init " ) = = 0 ) { <nl> + return " " ; <nl> + } <nl> + <nl> + assert ( strcmp ( xml - > tag , " response " ) = = 0 ) ; <nl> + <nl> + auto const id_node = find_attr ( xml , " transaction_id " ) ; <nl> + auto const command_node = find_attr ( xml , " command " ) ; <nl> + <nl> + / / The end response has no command and no id . <nl> + if ( command_node = = nullptr & & id_node = = nullptr ) { <nl> + / / Verify this is the end response . <nl> + if ( strcmp ( find_attr ( xml , " status " ) - > value , " stopping " ) = = 0 & & <nl> + strcmp ( find_attr ( xml , " reason " ) - > value , " ok " ) = = 0 ) { <nl> + return " " ; <nl> + } <nl> + throw Exception ( " Bad response " ) ; <nl> + } <nl> + <nl> + dynamic dyn = dynamic : : object ( " response " , dynamic : : object ) ; <nl> + auto & response = dyn [ " response " ] ; <nl> + response [ " id " ] = StringPiece ( id_node - > value , id_node - > value_len ) ; <nl> + <nl> + auto const command = StringPiece ( <nl> + command_node - > value , <nl> + command_node - > value_len <nl> + ) ; <nl> + <nl> + if ( command = = " run " ) { <nl> + response [ " error " ] = dynamic : : object ; <nl> + } else { <nl> + throw Exception ( " Invalid dbgp response " ) ; <nl> + } <nl> + <nl> + auto const opts = folly : : json : : serialization_opts { } ; <nl> + return folly : : json : : serialize ( dyn , opts ) . toStdString ( ) ; <nl> + } catch ( const std : : exception & exn ) { <nl> + xdebug_str xstr = { 0 , 0 , nullptr } ; <nl> + xdebug_xml_return_node ( xml , & xstr ) ; <nl> + auto exn2 = Exception ( " XDebug : % s . Response : ' % s ' " , exn . what ( ) , xstr . d ) ; <nl> + xdebug_str_free ( & xstr ) ; <nl> + throw exn2 ; <nl> + } <nl> + } <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 0619b2a22d3 <nl> mmm / dev / null <nl> ppp b / hphp / runtime / ext / xdebug / chrome . h <nl> <nl> + / * <nl> + + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> + | HipHop for PHP | <nl> + + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> + | Copyright ( c ) 2010 - 2014 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> + # ifndef incl_HHVM_XDEBUG_CHROME_H_ <nl> + # define incl_HHVM_XDEBUG_CHROME_H_ <nl> + <nl> + # include < folly / Range . h > <nl> + <nl> + # include < string > <nl> + <nl> + namespace HPHP { <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + struct xdebug_xml_node ; <nl> + <nl> + / * Converts a chrome debugger protocol / command / to an dbgp / command / . * / <nl> + std : : string chrome_to_dbgp ( folly : : StringPiece ) ; <nl> + <nl> + / * Converts a dbgp / result / to a chrome debugger protocol / result / . * / <nl> + std : : string dbgp_to_chrome ( xdebug_xml_node * ) ; <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + } <nl> + <nl> + # endif <nl> mmm a / hphp / runtime / ext / xdebug / php5_xdebug / xdebug_xml . h <nl> ppp b / hphp / runtime / ext / xdebug / php5_xdebug / xdebug_xml . h <nl> namespace HPHP { <nl> <nl> struct String ; <nl> <nl> - typedef struct _xdebug_xml_attribute xdebug_xml_attribute ; <nl> - typedef struct _xdebug_xml_text_node xdebug_xml_text_node ; <nl> - typedef struct _xdebug_xml_node xdebug_xml_node ; <nl> - <nl> - struct _xdebug_xml_attribute { <nl> + struct xdebug_xml_attribute { <nl> char * name ; <nl> char * value ; <nl> int name_len ; <nl> int value_len ; <nl> - struct _xdebug_xml_attribute * next ; <nl> + xdebug_xml_attribute * next ; <nl> int free_name ; <nl> int free_value ; <nl> } ; <nl> <nl> / * todo : support multiple text nodes inside an element * / <nl> - struct _xdebug_xml_text_node { <nl> + struct xdebug_xml_text_node { <nl> char * text ; <nl> int free_value ; <nl> int encode ; <nl> int text_len ; <nl> } ; <nl> <nl> - struct _xdebug_xml_node { <nl> + struct xdebug_xml_node { <nl> char * tag ; <nl> - struct _xdebug_xml_text_node * text ; <nl> - struct _xdebug_xml_attribute * attribute ; <nl> - struct _xdebug_xml_node * child ; <nl> - struct _xdebug_xml_node * next ; <nl> + xdebug_xml_text_node * text ; <nl> + xdebug_xml_attribute * attribute ; <nl> + xdebug_xml_node * child ; <nl> + xdebug_xml_node * next ; <nl> int free_tag ; <nl> } ; <nl> <nl> mmm a / hphp / runtime / ext / xdebug / xdebug_server . cpp <nl> ppp b / hphp / runtime / ext / xdebug / xdebug_server . cpp <nl> <nl> * / <nl> <nl> # include " hphp / runtime / ext / xdebug / xdebug_server . h " <nl> + <nl> + # include " hphp / runtime / ext / xdebug / chrome . h " <nl> # include " hphp / runtime / ext / xdebug / xdebug_command . h " <nl> # include " hphp / runtime / ext / xdebug / xdebug_hook_handler . h " <nl> # include " hphp / runtime / ext / xdebug / xdebug_utils . h " <nl> bool XDebugServer : : initDbgp ( ) { <nl> break ; <nl> } <nl> / / Create the response <nl> - xdebug_xml_node * response = xdebug_xml_node_init ( " init " ) ; <nl> + auto response = xdebug_xml_node_init ( " init " ) ; <nl> addXmlns ( * response ) ; <nl> <nl> / / Add the engine info <nl> - xdebug_xml_node * child = xdebug_xml_node_init ( " engine " ) ; <nl> + auto child = xdebug_xml_node_init ( " engine " ) ; <nl> xdebug_xml_add_attribute ( child , " version " , XDEBUG_VERSION ) ; <nl> xdebug_xml_add_text ( child , XDEBUG_NAME , 0 ) ; <nl> xdebug_xml_add_child ( response , child ) ; <nl> void XDebugServer : : deinitDbgp ( ) { <nl> setStatus ( Status : : STOPPING , Reason : : OK ) ; <nl> <nl> / / Send the xml shutdown response <nl> - xdebug_xml_node * response = xdebug_xml_node_init ( " response " ) ; <nl> + auto response = xdebug_xml_node_init ( " response " ) ; <nl> addXmlns ( * response ) ; <nl> addStatus ( * response ) ; <nl> if ( m_lastCommand ! = nullptr ) { <nl> void XDebugServer : : deinitDbgp ( ) { <nl> } <nl> <nl> void XDebugServer : : sendMessage ( xdebug_xml_node & xml ) { <nl> - / / Convert xml to an xdebug_str <nl> + if ( RuntimeOption : : XDebugChrome ) { <nl> + auto const response = dbgp_to_chrome ( & xml ) ; <nl> + / / Write the trailing NUL character . <nl> + write ( m_socket , response . data ( ) , response . size ( ) + 1 ) ; <nl> + return ; <nl> + } <nl> + <nl> + / / Convert xml to an xdebug_str . <nl> xdebug_str xml_message = { 0 , 0 , nullptr } ; <nl> xdebug_xml_return_node ( & xml , & xml_message ) ; <nl> size_t msg_len = xml_message . l + sizeof ( XML_MSG_HEADER ) - 1 ; <nl> void XDebugServer : : sendMessage ( xdebug_xml_node & xml ) { <nl> log ( " - > % s \ n \ n " , xml_message . d ) ; <nl> logFlush ( ) ; <nl> <nl> - / / Format the message <nl> - xdebug_str * message ; <nl> - xdebug_str_ptr_init ( message ) ; <nl> - xdebug_str_add ( message , xdebug_sprintf ( " % d " , msg_len , 1 ) , 1 ) ; <nl> - xdebug_str_addl ( message , " \ 0 " , 1 , 0 ) ; <nl> - xdebug_str_add ( message , XML_MSG_HEADER , 0 ) ; <nl> - xdebug_str_add ( message , xml_message . d , 0 ) ; <nl> - xdebug_str_addl ( message , " \ 0 " , 1 , 0 ) ; <nl> - xdebug_str_dtor ( xml_message ) ; <nl> - <nl> - / / Write the message <nl> - write ( m_socket , message - > d , message - > l ) ; <nl> - xdebug_str_ptr_dtor ( message ) ; <nl> + StringBuffer buf ; <nl> + buf . append ( static_cast < int64_t > ( msg_len ) ) ; <nl> + buf . append ( ' \ 0 ' ) ; <nl> + buf . append ( XML_MSG_HEADER ) ; <nl> + buf . append ( xml_message . d ) ; <nl> + buf . append ( ' \ 0 ' ) ; <nl> + <nl> + write ( m_socket , buf . data ( ) , buf . size ( ) ) ; <nl> + return ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> bool XDebugServer : : doCommandLoop ( ) { <nl> } <nl> <nl> / / Initialize the response <nl> - xdebug_xml_node * response = xdebug_xml_node_init ( " response " ) ; <nl> + auto response = xdebug_xml_node_init ( " response " ) ; <nl> addXmlns ( * response ) ; <nl> <nl> try { <nl> / / Parse the command and store it as the last command <nl> - XDebugCommand * cmd = parseCommand ( ) ; <nl> + auto cmd = parseCommand ( ) ; <nl> if ( m_lastCommand ! = nullptr ) { <nl> delete m_lastCommand ; <nl> } <nl> XDebugCommand * XDebugServer : : parseCommand ( ) { <nl> log ( " < - % s \ n " , m_buffer ) ; <nl> logFlush ( ) ; <nl> <nl> - / / Attempt to parse the input . parseInput will initialize cmd_str and args <nl> + / / Attempt to parse the input . parseInput will initialize cmd_str and args . <nl> String cmd_str ; <nl> Array args ; <nl> - parseInput ( cmd_str , args ) ; <nl> + <nl> + / / If we ' re being sent chrome debugger commands , then convert them to dbgp <nl> + / / first . <nl> + std : : string chrome_input ; <nl> + folly : : StringPiece input ( m_buffer ) ; <nl> + if ( RuntimeOption : : XDebugChrome ) { <nl> + chrome_input = chrome_to_dbgp ( input ) ; <nl> + input = chrome_input ; <nl> + } <nl> + <nl> + parseInput ( input , cmd_str , args ) ; <nl> <nl> / / Create the command from the command string & args <nl> return XDebugCommand : : fromString ( * this , cmd_str , args ) ; <nl> } <nl> <nl> - void XDebugServer : : parseInput ( String & cmd , Array & args ) { <nl> + void XDebugServer : : parseInput ( folly : : StringPiece in , String & cmd , Array & args ) { <nl> / / Always start with a blank array <nl> args = Array : : Create ( ) ; <nl> <nl> / / Find the first space in the command . Everything before is assumed to be the <nl> / / command string <nl> - char * ptr = strchr ( m_buffer , ' ' ) ; <nl> + auto ptr = strchr ( const_cast < char * > ( in . data ( ) ) , ' ' ) ; <nl> if ( ptr ! = nullptr ) { <nl> - size_t size = ptr - m_buffer ; <nl> - StringData * cmd_data = StringData : : Make ( m_buffer , size , CopyString ) ; <nl> - cmd = String ( cmd_data ) ; <nl> - } else if ( m_buffer [ 0 ] ! = ' \ 0 ' ) { <nl> + size_t size = ptr - in . data ( ) ; <nl> + cmd = String ( StringData : : Make ( in . data ( ) , size , CopyString ) ) ; <nl> + } else if ( in [ 0 ] ! = ' \ 0 ' ) { <nl> / / There are no spaces , the entire string is the command <nl> - cmd = String ( m_buffer , CopyString ) ; <nl> + cmd = String ( in . data ( ) , CopyString ) ; <nl> return ; <nl> } else { <nl> throw ERROR_PARSE ; <nl> mmm a / hphp / runtime / ext / xdebug / xdebug_server . h <nl> ppp b / hphp / runtime / ext / xdebug / xdebug_server . h <nl> namespace HPHP { <nl> struct XDebugCommand ; <nl> struct XDebugBreakpoint ; <nl> <nl> - class XDebugServer { <nl> + struct XDebugServer { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / Construction / Destruction <nl> <nl> - public : <nl> enum class Mode { <nl> REQ , / / Server created during request init <nl> JIT / / Server created on demand <nl> class XDebugServer { <nl> SKIP_CHAR <nl> } ; <nl> <nl> - / / Parse m_buffer - grab the command and an array of arguments . This was taken <nl> - / / and translated from php5 xdebug in order match parsing behavior . Throws <nl> - / / an ErrorCode on failure . <nl> - void parseInput ( String & cmd , Array & args ) ; <nl> + / / Grab the command and an array of arguments from the given input string . <nl> + / / This was taken and translated from php5 xdebug in order match parsing <nl> + / / behavior . Throws an ErrorCode on failure . <nl> + void parseInput ( folly : : StringPiece in , String & cmd , Array & args ) ; <nl> <nl> const XDebugCommand * m_lastCommand = nullptr ; <nl> char * m_buffer = nullptr ; <nl> new file mode 100644 <nl> index 00000000000 . . adf078095bd <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / ext_xdebug / remote / init - chrome . php <nl> <nl> + < ? php <nl> + require ( __DIR__ . ' / remote . inc ' ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 5f548adb900 <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / ext_xdebug / remote / init - chrome . php . expectf <nl> <nl> + ( cmd ) { " request " : { " id " : 5 , " method " : " Debugger . resume " } } <nl> + About to throw an exception <nl> + Caught the exception ! <nl> + { " response " : { " error " : { } , " id " : " 5 " } } <nl> + ( cmd ) { " request " : { " id " : 6 , " method " : " Debugger . resume " } } <nl> new file mode 100644 <nl> index 00000000000 . . 6efb3f5fabc <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / ext_xdebug / remote / init - chrome . php . test <nl> <nl> + < ? php <nl> + <nl> + try { <nl> + echo " About to throw an exception \ n " ; <nl> + throw new Exception ( " Hello world ! " ) ; <nl> + } catch ( Exception $ e ) { <nl> + echo " Caught the exception ! \ n " ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 59eedc02e3a <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / ext_xdebug / remote / init - chrome . php . test . in <nl> <nl> + { " request " : { " id " : 5 , " method " : " Debugger . resume " } } <nl> + { " request " : { " id " : 6 , " method " : " Debugger . resume " } } <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 00000000000 . . b5e4f90be70 <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / ext_xdebug / remote / init - chrome . php . test . ini <nl> <nl> + xdebug . enable = 1 <nl> + xdebug . remote_enable = 1 <nl> + xdebug . remote_autostart = 1 <nl> + xdebug . overload_var_dump = 0 <nl> + <nl> + hhvm . debugger . xdebug_chrome = 1 <nl> \ No newline at end of file <nl>
Support xdebug handling the Debugger . resume command in chrome debugger protocol
facebook/hhvm
324cff5c1a7e6a6e58a4cc1905a0795106b2fc29
2015-04-22T17:30:44Z
mmm a / scripts / run - tests . sh <nl> ppp b / scripts / run - tests . sh <nl> fi <nl> <nl> # Find or create the output_dir and list_dir <nl> if $ list_only ; then <nl> - list_dir = ` mktemp - d " $ TMPDIR / run - tests . XXXXXXXX " ` <nl> + list_dir = ` mktemp - d " $ { TMPDIR : - / tmp } / run - tests . XXXXXXXX " ` <nl> else <nl> if [ [ - z " $ dir " ] ] ; then <nl> if ! dir = $ ( mktemp - d " test_results . XXXXX " ) ; then <nl>
Use / tmp when $ TMPDIR is not set in run - tests . sh
rethinkdb/rethinkdb
1f82c1682b8c7df7f2d97fa4b84354c675148601
2013-04-25T21:15:35Z
mmm a / src / x87 / builtins - x87 . cc <nl> ppp b / src / x87 / builtins - x87 . cc <nl> void Builtins : : Generate_ArrayCode ( MacroAssembler * masm ) { <nl> } <nl> <nl> <nl> + / / static <nl> + void Builtins : : Generate_NumberConstructor ( MacroAssembler * masm ) { <nl> + / / mmmmmmmmm - - S t a t e mmmmmmmmmmmm - <nl> + / / - - eax : number of arguments <nl> + / / - - edi : constructor function <nl> + / / - - esp [ 0 ] : return address <nl> + / / - - esp [ ( argc - n ) * 4 ] : arg [ n ] ( zero - based ) <nl> + / / - - esp [ ( argc + 1 ) * 4 ] : receiver <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + <nl> + / / 1 . Load the first argument into eax and get rid of the rest ( including the <nl> + / / receiver ) . <nl> + Label no_arguments ; <nl> + { <nl> + __ test ( eax , eax ) ; <nl> + __ j ( zero , & no_arguments , Label : : kNear ) ; <nl> + __ mov ( ebx , Operand ( esp , eax , times_pointer_size , 0 ) ) ; <nl> + __ PopReturnAddressTo ( ecx ) ; <nl> + __ lea ( esp , Operand ( esp , eax , times_pointer_size , kPointerSize ) ) ; <nl> + __ PushReturnAddressFrom ( ecx ) ; <nl> + __ mov ( eax , ebx ) ; <nl> + } <nl> + <nl> + / / 2a . Convert the first argument to a number . <nl> + ToNumberStub stub ( masm - > isolate ( ) ) ; <nl> + __ TailCallStub ( & stub ) ; <nl> + <nl> + / / 2b . No arguments , return + 0 ( already in eax ) . <nl> + __ bind ( & no_arguments ) ; <nl> + __ ret ( 1 * kPointerSize ) ; <nl> + } <nl> + <nl> + <nl> + / / static <nl> + void Builtins : : Generate_NumberConstructor_ConstructStub ( MacroAssembler * masm ) { <nl> + / / mmmmmmmmm - - S t a t e mmmmmmmmmmmm - <nl> + / / - - eax : number of arguments <nl> + / / - - edi : constructor function <nl> + / / - - edx : new target <nl> + / / - - esp [ 0 ] : return address <nl> + / / - - esp [ ( argc - n ) * 4 ] : arg [ n ] ( zero - based ) <nl> + / / - - esp [ ( argc + 1 ) * 4 ] : receiver <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + <nl> + / / 1 . Make sure we operate in the context of the called function . <nl> + __ mov ( esi , FieldOperand ( edi , JSFunction : : kContextOffset ) ) ; <nl> + <nl> + / / 2 . Load the first argument into ebx and get rid of the rest ( including the <nl> + / / receiver ) . <nl> + { <nl> + Label no_arguments , done ; <nl> + __ test ( eax , eax ) ; <nl> + __ j ( zero , & no_arguments , Label : : kNear ) ; <nl> + __ mov ( ebx , Operand ( esp , eax , times_pointer_size , 0 ) ) ; <nl> + __ jmp ( & done , Label : : kNear ) ; <nl> + __ bind ( & no_arguments ) ; <nl> + __ Move ( ebx , Smi : : FromInt ( 0 ) ) ; <nl> + __ bind ( & done ) ; <nl> + __ PopReturnAddressTo ( ecx ) ; <nl> + __ lea ( esp , Operand ( esp , eax , times_pointer_size , kPointerSize ) ) ; <nl> + __ PushReturnAddressFrom ( ecx ) ; <nl> + } <nl> + <nl> + / / 3 . Make sure ebx is a number . <nl> + { <nl> + Label done_convert ; <nl> + __ JumpIfSmi ( ebx , & done_convert ) ; <nl> + __ CompareRoot ( FieldOperand ( ebx , HeapObject : : kMapOffset ) , <nl> + Heap : : kHeapNumberMapRootIndex ) ; <nl> + __ j ( equal , & done_convert ) ; <nl> + { <nl> + FrameScope scope ( masm , StackFrame : : INTERNAL ) ; <nl> + __ Push ( edi ) ; <nl> + __ Push ( edx ) ; <nl> + __ Move ( eax , ebx ) ; <nl> + ToNumberStub stub ( masm - > isolate ( ) ) ; <nl> + __ CallStub ( & stub ) ; <nl> + __ Move ( ebx , eax ) ; <nl> + __ Pop ( edx ) ; <nl> + __ Pop ( edi ) ; <nl> + } <nl> + __ bind ( & done_convert ) ; <nl> + } <nl> + <nl> + / / 4 . Check if new target and constructor differ . <nl> + Label new_object ; <nl> + __ cmp ( edx , edi ) ; <nl> + __ j ( not_equal , & new_object ) ; <nl> + <nl> + / / 5 . Allocate a JSValue wrapper for the number . <nl> + __ AllocateJSValue ( eax , edi , ebx , ecx , & new_object ) ; <nl> + __ Ret ( ) ; <nl> + <nl> + / / 6 . Fallback to the runtime to create new object . <nl> + __ bind ( & new_object ) ; <nl> + { <nl> + FrameScope scope ( masm , StackFrame : : INTERNAL ) ; <nl> + __ Push ( ebx ) ; / / the first argument <nl> + __ Push ( edi ) ; / / constructor function <nl> + __ Push ( edx ) ; / / new target <nl> + __ CallRuntime ( Runtime : : kNewObject ) ; <nl> + __ Pop ( FieldOperand ( eax , JSValue : : kValueOffset ) ) ; <nl> + } <nl> + __ Ret ( ) ; <nl> + } <nl> + <nl> + <nl> / / static <nl> void Builtins : : Generate_StringConstructor ( MacroAssembler * masm ) { <nl> / / mmmmmmmmm - - S t a t e mmmmmmmmmmmm - <nl> void Builtins : : Generate_StringConstructor_ConstructStub ( MacroAssembler * masm ) { <nl> / / - - esp [ ( argc + 1 ) * 4 ] : receiver <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> <nl> - / / 1 . Load the first argument into ebx and get rid of the rest ( including the <nl> + / / 1 . Make sure we operate in the context of the called function . <nl> + __ mov ( esi , FieldOperand ( edi , JSFunction : : kContextOffset ) ) ; <nl> + <nl> + / / 2 . Load the first argument into ebx and get rid of the rest ( including the <nl> / / receiver ) . <nl> { <nl> Label no_arguments , done ; <nl> void Builtins : : Generate_StringConstructor_ConstructStub ( MacroAssembler * masm ) { <nl> __ PushReturnAddressFrom ( ecx ) ; <nl> } <nl> <nl> - / / 2 . Make sure ebx is a string . <nl> + / / 3 . Make sure ebx is a string . <nl> { <nl> Label convert , done_convert ; <nl> __ JumpIfSmi ( ebx , & convert , Label : : kNear ) ; <nl> void Builtins : : Generate_StringConstructor_ConstructStub ( MacroAssembler * masm ) { <nl> __ bind ( & done_convert ) ; <nl> } <nl> <nl> - / / 3 . Check if new target and constructor differ . <nl> + / / 4 . Check if new target and constructor differ . <nl> Label new_object ; <nl> __ cmp ( edx , edi ) ; <nl> __ j ( not_equal , & new_object ) ; <nl> <nl> - / / 4 . Allocate a JSValue wrapper for the string . <nl> - { <nl> - / / mmmmmmmmm - - S t a t e mmmmmmmmmmmm - <nl> - / / - - ebx : the first argument <nl> - / / - - edi : constructor function <nl> - / / - - edx : new target <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - __ Allocate ( JSValue : : kSize , eax , ecx , no_reg , & new_object , TAG_OBJECT ) ; <nl> - <nl> - / / Initialize the JSValue in eax . <nl> - __ LoadGlobalFunctionInitialMap ( edi , ecx ) ; <nl> - __ mov ( FieldOperand ( eax , HeapObject : : kMapOffset ) , ecx ) ; <nl> - __ mov ( FieldOperand ( eax , JSObject : : kPropertiesOffset ) , <nl> - masm - > isolate ( ) - > factory ( ) - > empty_fixed_array ( ) ) ; <nl> - __ mov ( FieldOperand ( eax , JSObject : : kElementsOffset ) , <nl> - masm - > isolate ( ) - > factory ( ) - > empty_fixed_array ( ) ) ; <nl> - __ mov ( FieldOperand ( eax , JSValue : : kValueOffset ) , ebx ) ; <nl> - STATIC_ASSERT ( JSValue : : kSize = = 4 * kPointerSize ) ; <nl> - __ Ret ( ) ; <nl> - } <nl> + / / 5 . Allocate a JSValue wrapper for the string . <nl> + __ AllocateJSValue ( eax , edi , ebx , ecx , & new_object ) ; <nl> + __ Ret ( ) ; <nl> <nl> - / / 5 . Fallback to the runtime to create new object . <nl> + / / 6 . Fallback to the runtime to create new object . <nl> __ bind ( & new_object ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : INTERNAL ) ; <nl> mmm a / src / x87 / macro - assembler - x87 . cc <nl> ppp b / src / x87 / macro - assembler - x87 . cc <nl> void MacroAssembler : : AllocateOneByteSlicedString ( Register result , <nl> } <nl> <nl> <nl> + void MacroAssembler : : AllocateJSValue ( Register result , Register constructor , <nl> + Register value , Register scratch , <nl> + Label * gc_required ) { <nl> + DCHECK ( ! result . is ( constructor ) ) ; <nl> + DCHECK ( ! result . is ( scratch ) ) ; <nl> + DCHECK ( ! result . is ( value ) ) ; <nl> + <nl> + / / Allocate JSValue in new space . <nl> + Allocate ( JSValue : : kSize , result , scratch , no_reg , gc_required , TAG_OBJECT ) ; <nl> + <nl> + / / Initialize the JSValue . <nl> + LoadGlobalFunctionInitialMap ( constructor , scratch ) ; <nl> + mov ( FieldOperand ( result , HeapObject : : kMapOffset ) , scratch ) ; <nl> + LoadRoot ( scratch , Heap : : kEmptyFixedArrayRootIndex ) ; <nl> + mov ( FieldOperand ( result , JSObject : : kPropertiesOffset ) , scratch ) ; <nl> + mov ( FieldOperand ( result , JSObject : : kElementsOffset ) , scratch ) ; <nl> + mov ( FieldOperand ( result , JSValue : : kValueOffset ) , value ) ; <nl> + STATIC_ASSERT ( JSValue : : kSize = = 4 * kPointerSize ) ; <nl> + } <nl> + <nl> + <nl> / / Copy memory , byte - by - byte , from source to destination . Not optimized for <nl> / / long or aligned copies . The contents of scratch and length are destroyed . <nl> / / Source and destination are incremented by length . <nl> mmm a / src / x87 / macro - assembler - x87 . h <nl> ppp b / src / x87 / macro - assembler - x87 . h <nl> class MacroAssembler : public Assembler { <nl> void AllocateOneByteSlicedString ( Register result , Register scratch1 , <nl> Register scratch2 , Label * gc_required ) ; <nl> <nl> + / / Allocate and initialize a JSValue wrapper with the specified { constructor } <nl> + / / and { value } . <nl> + void AllocateJSValue ( Register result , Register constructor , Register value , <nl> + Register scratch , Label * gc_required ) ; <nl> + <nl> / / Copy memory , byte - by - byte , from source to destination . Not optimized for <nl> / / long or aligned copies . <nl> / / The contents of index and scratch are destroyed . <nl> class MacroAssembler : public Assembler { <nl> void Move ( Register dst , const Immediate & x ) ; <nl> void Move ( const Operand & dst , const Immediate & x ) ; <nl> <nl> + void Move ( Register dst , Smi * source ) { Move ( dst , Immediate ( source ) ) ; } <nl> + <nl> / / Push a handle value . <nl> void Push ( Handle < Object > handle ) { push ( Immediate ( handle ) ) ; } <nl> - void Push ( Smi * smi ) { Push ( Handle < Smi > ( smi , isolate ( ) ) ) ; } <nl> + void Push ( Smi * smi ) { Push ( Immediate ( smi ) ) ; } <nl> <nl> Handle < Object > CodeObject ( ) { <nl> DCHECK ( ! code_object_ . is_null ( ) ) ; <nl>
X87 : [ builtins ] Migrate Number constructor similar to String constructor .
v8/v8
fe33d20fd1fb31e1fe22b98be226fe87b2f6cf72
2016-01-14T03:34:04Z
mmm a / x64_dbg_gui / Project / Src / BasicView / Disassembly . cpp <nl> ppp b / x64_dbg_gui / Project / Src / BasicView / Disassembly . cpp <nl> Disassembly : : Disassembly ( QWidget * parent ) : AbstractTableView ( parent ) <nl> <nl> backgroundColor = ConfigColor ( " DisassemblyBackgroundColor " ) ; <nl> <nl> - connect ( Bridge : : getBridge ( ) , SIGNAL ( disassembleAt ( int_t , int_t ) ) , this , SLOT ( disassembleAt ( int_t , int_t ) ) ) ; <nl> - connect ( Bridge : : getBridge ( ) , SIGNAL ( dbgStateChanged ( DBGSTATE ) ) , this , SLOT ( debugStateChangedSlot ( DBGSTATE ) ) ) ; <nl> connect ( Bridge : : getBridge ( ) , SIGNAL ( repaintGui ( ) ) , this , SLOT ( reloadData ( ) ) ) ; <nl> } <nl> <nl> void Disassembly : : keyPressEvent ( QKeyEvent * event ) <nl> QString cmd = " disasm " + QString ( " % 1 " ) . arg ( dest , sizeof ( int_t ) * 2 , 16 , QChar ( ' 0 ' ) ) . toUpper ( ) ; <nl> DbgCmdExec ( cmd . toUtf8 ( ) . constData ( ) ) ; <nl> } <nl> - else if ( ! event - > isAutoRepeat ( ) & & key = = Qt : : Key_Z ) <nl> - { <nl> - mHighlightingMode = true ; <nl> - reloadData ( ) ; <nl> - } <nl> else <nl> AbstractTableView : : keyPressEvent ( event ) ; <nl> } <nl> <nl> - void Disassembly : : keyReleaseEvent ( QKeyEvent * event ) <nl> - { <nl> - if ( ! event - > isAutoRepeat ( ) & & event - > key ( ) = = Qt : : Key_Z ) <nl> - { <nl> - mHighlightingMode = false ; <nl> - reloadData ( ) ; <nl> - } <nl> - } <nl> - <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> ScrollBar Management <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> mmm a / x64_dbg_gui / Project / Src / BasicView / Disassembly . h <nl> ppp b / x64_dbg_gui / Project / Src / BasicView / Disassembly . h <nl> class Disassembly : public AbstractTableView <nl> <nl> / / Keyboard Management <nl> void keyPressEvent ( QKeyEvent * event ) ; <nl> - void keyReleaseEvent ( QKeyEvent * event ) ; <nl> <nl> / / ScrollBar Management <nl> int_t sliderMovedHook ( int type , int_t value , int_t delta ) ; <nl> public slots : <nl> int mCurrentVa ; <nl> int mCharWidth ; <nl> BeaTokenizer : : BeaSingleToken mHighlightToken ; <nl> - bool mHighlightingMode ; <nl> <nl> protected : <nl> bool mRvaDisplayEnabled ; <nl> uint_t mRvaDisplayBase ; <nl> int_t mRvaDisplayPageBase ; <nl> + bool mHighlightingMode ; <nl> } ; <nl> <nl> # endif / / DISASSEMBLY_H <nl> mmm a / x64_dbg_gui / Project / Src / Gui / CPUDisassembly . cpp <nl> ppp b / x64_dbg_gui / Project / Src / Gui / CPUDisassembly . cpp <nl> CPUDisassembly : : CPUDisassembly ( QWidget * parent ) : Disassembly ( parent ) <nl> / / Create the action list for the right click context menu <nl> setupRightClickContextMenu ( ) ; <nl> <nl> + connect ( Bridge : : getBridge ( ) , SIGNAL ( disassembleAt ( int_t , int_t ) ) , this , SLOT ( disassembleAt ( int_t , int_t ) ) ) ; <nl> + connect ( Bridge : : getBridge ( ) , SIGNAL ( dbgStateChanged ( DBGSTATE ) ) , this , SLOT ( debugStateChangedSlot ( DBGSTATE ) ) ) ; <nl> connect ( Bridge : : getBridge ( ) , SIGNAL ( selectionDisasmGet ( SELECTIONDATA * ) ) , this , SLOT ( selectionGet ( SELECTIONDATA * ) ) ) ; <nl> connect ( Bridge : : getBridge ( ) , SIGNAL ( selectionDisasmSet ( const SELECTIONDATA * ) ) , this , SLOT ( selectionSet ( const SELECTIONDATA * ) ) ) ; <nl> <nl> void CPUDisassembly : : contextMenuEvent ( QContextMenuEvent * event ) <nl> mReferencesMenu - > addAction ( mReferenceSelectedAddress ) ; <nl> wMenu - > addMenu ( mReferencesMenu ) ; <nl> <nl> + wMenu - > addSeparator ( ) ; <nl> + wMenu - > addAction ( mToggleHighlightingMode ) ; <nl> + <nl> QAction * wAction = wMenu - > exec ( event - > globalPos ( ) ) ; <nl> } <nl> } <nl> void CPUDisassembly : : setupRightClickContextMenu ( ) <nl> / / String References <nl> mSearchStrings = new QAction ( " & String references " , this ) ; <nl> connect ( mSearchStrings , SIGNAL ( triggered ( ) ) , this , SLOT ( findStrings ( ) ) ) ; <nl> + <nl> + / / Highlighting mode <nl> + mToggleHighlightingMode = new QAction ( " Toggle & highlighting mode " , this ) ; <nl> + mToggleHighlightingMode - > setShortcutContext ( Qt : : WidgetShortcut ) ; <nl> + mToggleHighlightingMode - > setShortcut ( QKeySequence ( " ctrl + h " ) ) ; <nl> + connect ( mToggleHighlightingMode , SIGNAL ( triggered ( ) ) , this , SLOT ( toggleHighlightingMode ( ) ) ) ; <nl> } <nl> <nl> void CPUDisassembly : : gotoOrigin ( ) <nl> void CPUDisassembly : : selectionSet ( const SELECTIONDATA * selection ) <nl> reloadData ( ) ; <nl> Bridge : : getBridge ( ) - > BridgeSetResult ( 1 ) ; <nl> } <nl> + <nl> + void CPUDisassembly : : toggleHighlightingMode ( ) <nl> + { <nl> + if ( mHighlightingMode ) <nl> + mHighlightingMode = false ; <nl> + else <nl> + mHighlightingMode = true ; <nl> + reloadData ( ) ; <nl> + } <nl> mmm a / x64_dbg_gui / Project / Src / Gui / CPUDisassembly . h <nl> ppp b / x64_dbg_gui / Project / Src / Gui / CPUDisassembly . h <nl> public slots : <nl> void findStrings ( ) ; <nl> void selectionGet ( SELECTIONDATA * selection ) ; <nl> void selectionSet ( const SELECTIONDATA * selection ) ; <nl> + void toggleHighlightingMode ( ) ; <nl> <nl> private : <nl> <nl> public slots : <nl> QAction * mReferenceSelectedAddress ; <nl> QAction * mSearchConstant ; <nl> QAction * mSearchStrings ; <nl> + QAction * mToggleHighlightingMode ; <nl> <nl> GotoDialog * mGoto ; <nl> } ; <nl>
GUI : toggle highlighting mode in CPUDisassembly
x64dbg/x64dbg
176947afb0de4c164b14108ffc2bda5344a8be8c
2014-06-18T12:01:44Z
mmm a / ChangeLog <nl> ppp b / ChangeLog <nl> <nl> + 2013 - 08 - 30 : Version 3 . 21 . 7 <nl> + <nl> + Fixed casts of eternal handles . <nl> + <nl> + Turned on global handle zapping . <nl> + <nl> + Always visit branches during HGraph building ( Chromium issue 280333 ) . <nl> + <nl> + Profiler changes : removed deprecated API , support higher sampling <nl> + rate on Windows . <nl> + <nl> + Performance and stability improvements on all platforms . <nl> + <nl> + <nl> 2013 - 08 - 29 : Version 3 . 21 . 6 <nl> <nl> Fixed inlined ' throw ' statements interfering with live range <nl> mmm a / src / version . cc <nl> ppp b / src / version . cc <nl> <nl> / / system so their names cannot be changed without changing the scripts . <nl> # define MAJOR_VERSION 3 <nl> # define MINOR_VERSION 21 <nl> - # define BUILD_NUMBER 7 <nl> + # define BUILD_NUMBER 8 <nl> # define PATCH_LEVEL 0 <nl> / / Use 1 for candidates and 0 otherwise . <nl> / / ( Boolean macro values are not supported by all preprocessors . ) <nl>
Prepare push to trunk . Now working on version 3 . 21 . 8 .
v8/v8
4cf77d7748e8cc4ce3de8346cec60cb232a4fbdf
2013-08-30T11:31:06Z
mmm a / lib / SILGen / SpecializedEmitter . h <nl> ppp b / lib / SILGen / SpecializedEmitter . h <nl> class SpecializedEmitter { <nl> CanFunctionType formalApplyType , <nl> SGFContext ) ; <nl> <nl> + / / / A special function for emitting a call after the arguments <nl> + / / / have already been emitted . <nl> + using LatePartialSuperEmitter = ManagedValue ( SILGenFunction & , <nl> + SILDeclRef , <nl> + SILLocation , <nl> + ArrayRef < Substitution > , <nl> + ArrayRef < ManagedValue > , <nl> + CanFunctionType formalApplyType , <nl> + SGFContext ) ; <nl> + <nl> enum class Kind { <nl> / / / This is a builtin function that will be specially handled <nl> / / / downstream , but doesn ' t require special treatment at the <nl> class SpecializedEmitter { <nl> / / / handled in SILGen , but which can be passed normally - emitted <nl> / / / arguments . <nl> LateEmitter , <nl> + <nl> + / / / This is a partial application to a super method . <nl> + LatePartialSuperEmitter , <nl> } ; <nl> <nl> private : <nl> class SpecializedEmitter { <nl> union { <nl> EarlyEmitter * TheEarlyEmitter ; <nl> LateEmitter * TheLateEmitter ; <nl> + LatePartialSuperEmitter * TheLatePartialSuperEmitter ; <nl> Identifier TheBuiltinName ; <nl> } ; <nl> <nl> class SpecializedEmitter { <nl> / * implicit * / SpecializedEmitter ( LateEmitter * emitter ) <nl> : TheKind ( Kind : : LateEmitter ) , TheLateEmitter ( emitter ) { } <nl> <nl> + / * implicit * / SpecializedEmitter ( LatePartialSuperEmitter * emitter ) <nl> + : TheKind ( Kind : : LatePartialSuperEmitter ) , <nl> + TheLatePartialSuperEmitter ( emitter ) { } <nl> + <nl> / / / Try to find an appropriate emitter for the given declaration . <nl> static Optional < SpecializedEmitter > <nl> forDecl ( SILGenModule & SGM , SILDeclRef decl ) ; <nl> class SpecializedEmitter { <nl> return TheLateEmitter ; <nl> } <nl> <nl> + bool isLatePartialSuperEmitter ( ) const { <nl> + return TheKind = = Kind : : LatePartialSuperEmitter ; <nl> + } <nl> + LatePartialSuperEmitter * getLatePartialSuperEmitter ( ) const { <nl> + assert ( isLatePartialSuperEmitter ( ) ) ; <nl> + return TheLatePartialSuperEmitter ; <nl> + } <nl> + <nl> bool isNamedBuiltin ( ) const { return TheKind = = Kind : : NamedBuiltin ; } <nl> Identifier getBuiltinName ( ) const { <nl> assert ( isNamedBuiltin ( ) ) ; <nl>
Add LatePartialSuperEmitter to short circuit emission of curry thunks
apple/swift
ed599c151685c9f39444ac2b92b3339c34d94676
2015-12-05T09:29:27Z
mmm a / modules / planning / conf / planning . conf <nl> ppp b / modules / planning / conf / planning . conf <nl> <nl> - - flagfile = modules / common / data / global_flagfile . txt <nl> - - nouse_ros_time <nl> - - planning_upper_speed_limit = 15 . 65 <nl> mmmnoenable_spiral_reference_line <nl> - - prioritize_change_lane <nl> - - enable_reference_line_stitching <nl> - - min_length_for_lane_change = 5 . 0 <nl> - - enable_multi_thread_in_dp_poly_path <nl> - - enable_multi_thread_in_dp_st_graph <nl> mmmnoenable_lattice_st_image_dump <nl> mmmdefault_cruise_speed = 10 <nl> + <nl> + - - default_cruise_speed = 9 . 0 <nl> - - noenable_spiral_reference_line <nl>
Planning : ( 1 ) remove duplicate noenable_spiral_reference_line ; ( 2 ) change some gflags used in lattice
ApolloAuto/apollo
04ad19913269346656c0bc61501b5225c3dd7f53
2018-01-18T05:12:22Z
mmm a / include / rocksdb / utilities / transaction . h <nl> ppp b / include / rocksdb / utilities / transaction . h <nl> class Transaction { <nl> / / functions in WriteBatch , but will also do conflict checking on the <nl> / / keys being written . <nl> / / <nl> - / / assume_tracked = true expects the key be already tracked . If valid then it <nl> - / / skips ValidateSnapshot . Returns error otherwise . <nl> + / / assume_tracked = true expects the key be already tracked . More <nl> + / / specifically , it means the the key was previous tracked in the same <nl> + / / savepoint , with the same exclusive flag , and at a lower sequence number . <nl> + / / If valid then it skips ValidateSnapshot . Returns error otherwise . <nl> / / <nl> / / If this Transaction was created on an OptimisticTransactionDB , these <nl> / / functions should always return Status : : OK ( ) . <nl> mmm a / utilities / transactions / pessimistic_transaction . cc <nl> ppp b / utilities / transactions / pessimistic_transaction . cc <nl> Status PessimisticTransaction : : TryLock ( ColumnFamilyHandle * column_family , <nl> if ( s . ok ( ) ) { <nl> / / We must track all the locked keys so that we can unlock them later . If <nl> / / the key is already locked , this func will update some stats on the <nl> - / / tracked key . It could also update the tracked_at_seq if it is lower than <nl> - / / the existing trackey seq . <nl> - TrackKey ( cfh_id , key_str , tracked_at_seq , read_only , exclusive ) ; <nl> + / / tracked key . It could also update the tracked_at_seq if it is lower <nl> + / / than the existing tracked key seq . These stats are necessary for <nl> + / / RollbackToSavePoint to determine whether a key can be safely removed <nl> + / / from tracked_keys_ . Removal can only be done if a key was only locked <nl> + / / during the current savepoint . <nl> + / / <nl> + / / Recall that if assume_tracked is true , we assume that TrackKey has been <nl> + / / called previously since the last savepoint , with the same exclusive <nl> + / / setting , and at a lower sequence number , so skipping here should be <nl> + / / safe . <nl> + if ( ! assume_tracked ) { <nl> + TrackKey ( cfh_id , key_str , tracked_at_seq , read_only , exclusive ) ; <nl> + } else { <nl> + # ifndef NDEBUG <nl> + assert ( tracked_keys_cf - > second . count ( key_str ) > 0 ) ; <nl> + const auto & info = tracked_keys_cf - > second . find ( key_str ) - > second ; <nl> + assert ( info . seq < = tracked_at_seq ) ; <nl> + assert ( info . exclusive = = exclusive ) ; <nl> + # endif <nl> + } <nl> } <nl> <nl> return s ; <nl>
Remove extraneous call to TrackKey ( )
facebook/rocksdb
d655a3aab7b8fe609b870909765e84764f9ae214
2019-04-12T23:37:12Z
mmm a / tools / autodebugger_js . py <nl> ppp b / tools / autodebugger_js . py <nl> <nl> lines = data . split ( ' \ n ' ) <nl> in_func = False <nl> for i in range ( len ( lines ) ) : <nl> + if lines [ i ] . startswith ( ' function ' ) : <nl> + name = lines [ i ] . split ( ' ( ' ) [ 0 ] . split ( ' ' ) [ 1 ] <nl> + args = lines [ i ] . split ( ' ( ' ) [ 1 ] . split ( ' ) ' ) [ 0 ] <nl> + lines [ i ] + = ' print ( " call % s ( " + [ % s ] + " ) " ) ; ' % ( name , args ) <nl> if lines [ i ] . startswith ( ' function ' + func + ' ( ' ) : <nl> in_func = True <nl> continue <nl>
add function calls and params to js autodebugger
emscripten-core/emscripten
750ad0c62407a52e17e4efe8797305ea9eb548cb
2012-12-25T22:02:49Z
mmm a / dbms / src / IO / ReadBufferAIO . cpp <nl> ppp b / dbms / src / IO / ReadBufferAIO . cpp <nl> ReadBufferAIO : : ReadBufferAIO ( const std : : string & filename_ , size_t buffer_size_ , <nl> auto error_code = ( errno = = ENOENT ) ? ErrorCodes : : FILE_DOESNT_EXIST : ErrorCodes : : CANNOT_OPEN_FILE ; <nl> throwFromErrno ( " Cannot open file " + filename , error_code ) ; <nl> } <nl> + <nl> + : : memset ( & request , 0 , sizeof ( request ) ) ; <nl> } <nl> <nl> ReadBufferAIO : : ~ ReadBufferAIO ( ) <nl> bool ReadBufferAIO : : nextImpl ( ) <nl> return true ; <nl> <nl> / / / Создать запрос . <nl> - : : memset ( & request , 0 , sizeof ( request ) ) ; <nl> - <nl> request . aio_lio_opcode = IOCB_CMD_PREAD ; <nl> request . aio_fildes = fd ; <nl> request . aio_buf = reinterpret_cast < UInt64 > ( fill_buffer . internalBuffer ( ) . begin ( ) ) ; <nl> mmm a / dbms / src / IO / WriteBufferAIO . cpp <nl> ppp b / dbms / src / IO / WriteBufferAIO . cpp <nl> WriteBufferAIO : : WriteBufferAIO ( const std : : string & filename_ , size_t buffer_size <nl> auto error_code = ( errno = = ENOENT ) ? ErrorCodes : : FILE_DOESNT_EXIST : ErrorCodes : : CANNOT_OPEN_FILE ; <nl> throwFromErrno ( " Cannot open file " + filename , error_code ) ; <nl> } <nl> + <nl> + : : memset ( & request , 0 , sizeof ( request ) ) ; <nl> } <nl> <nl> WriteBufferAIO : : ~ WriteBufferAIO ( ) <nl> void WriteBufferAIO : : nextImpl ( ) <nl> swapBuffers ( ) ; <nl> <nl> / / / Создать запрос . <nl> - : : memset ( & request , 0 , sizeof ( request ) ) ; <nl> - <nl> request . aio_lio_opcode = IOCB_CMD_PWRITE ; <nl> request . aio_fildes = fd ; <nl> request . aio_buf = reinterpret_cast < UInt64 > ( flush_buffer . buffer ( ) . begin ( ) ) ; <nl>
dbms : Server : feature development . [ # METR - 15090 ]
ClickHouse/ClickHouse
7e757377e4e25ed73a2d613ac3c1d8f2f91d95c8
2015-03-11T13:40:15Z
mmm a / dbms / src / Common / MemoryTracker . cpp <nl> ppp b / dbms / src / Common / MemoryTracker . cpp <nl> void MemoryTracker : : setOrRaiseLimit ( Int64 value ) <nl> } <nl> <nl> <nl> - __thread MemoryTracker * current_memory_tracker = nullptr ; <nl> + thread_local MemoryTracker * current_memory_tracker = nullptr ; <nl> <nl> namespace CurrentMemoryTracker <nl> { <nl> mmm a / dbms / src / Common / MemoryTracker . h <nl> ppp b / dbms / src / Common / MemoryTracker . h <nl> class MemoryTracker <nl> * This pointer is set when memory consumption is monitored in current thread . <nl> * So , you just need to pass it to all the threads that handle one request . <nl> * / <nl> - extern __thread MemoryTracker * current_memory_tracker ; <nl> + extern thread_local MemoryTracker * current_memory_tracker ; <nl> <nl> / / / Convenience methods , that use current_memory_tracker if it is available . <nl> namespace CurrentMemoryTracker <nl> mmm a / libs / libdaemon / src / BaseDaemon . cpp <nl> ppp b / libs / libdaemon / src / BaseDaemon . cpp <nl> class SignalListener : public Poco : : Runnable <nl> * / <nl> static void terminate_handler ( ) <nl> { <nl> - static __thread bool terminating = false ; <nl> + static thread_local bool terminating = false ; <nl> if ( terminating ) <nl> { <nl> abort ( ) ; <nl> mmm a / libs / libpocoext / src / ThreadNumber . cpp <nl> ppp b / libs / libpocoext / src / ThreadNumber . cpp <nl> <nl> # include < Poco / Ext / ThreadNumber . h > <nl> <nl> <nl> - static __thread unsigned thread_number = 0 ; <nl> + static thread_local unsigned thread_number = 0 ; <nl> static unsigned threads = 0 ; <nl> <nl> unsigned Poco : : ThreadNumber : : get ( ) <nl>
Merge pull request from proller / fix4
ClickHouse/ClickHouse
c5b5f2b4f8d9684fa82cde26f608b24a25347bbf
2017-10-22T09:43:11Z
mmm a / tensorflow / contrib / data / __init__ . py <nl> ppp b / tensorflow / contrib / data / __init__ . py <nl> <nl> @ @ prefetch_to_device <nl> @ @ read_batch_features <nl> @ @ rejection_resample <nl> + @ @ reduce_dataset <nl> @ @ sample_from_datasets <nl> @ @ scan <nl> @ @ shuffle_and_repeat <nl> <nl> from tensorflow . contrib . data . python . ops . enumerate_ops import enumerate_dataset <nl> from tensorflow . contrib . data . python . ops . error_ops import ignore_errors <nl> from tensorflow . contrib . data . python . ops . get_single_element import get_single_element <nl> + from tensorflow . contrib . data . python . ops . get_single_element import reduce_dataset <nl> from tensorflow . contrib . data . python . ops . grouping import bucket_by_sequence_length <nl> from tensorflow . contrib . data . python . ops . grouping import group_by_reducer <nl> from tensorflow . contrib . data . python . ops . grouping import group_by_window <nl> mmm a / tensorflow / contrib / data / python / kernel_tests / BUILD <nl> ppp b / tensorflow / contrib / data / python / kernel_tests / BUILD <nl> py_test ( <nl> srcs = [ " get_single_element_test . py " ] , <nl> deps = [ <nl> " / / tensorflow / contrib / data / python / ops : get_single_element " , <nl> + " / / tensorflow / contrib / data / python / ops : grouping " , <nl> " / / tensorflow / python : array_ops " , <nl> " / / tensorflow / python : client_testlib " , <nl> " / / tensorflow / python : constant_op " , <nl> py_test ( <nl> " / / tensorflow / python : errors " , <nl> " / / tensorflow / python : sparse_tensor " , <nl> " / / tensorflow / python / data / ops : dataset_ops " , <nl> + " @ absl_py / / absl / testing : parameterized " , <nl> ] , <nl> ) <nl> <nl> mmm a / tensorflow / contrib / data / python / kernel_tests / get_single_element_test . py <nl> ppp b / tensorflow / contrib / data / python / kernel_tests / get_single_element_test . py <nl> <nl> from __future__ import division <nl> from __future__ import print_function <nl> <nl> + from absl . testing import parameterized <nl> + import numpy as np <nl> + <nl> from tensorflow . contrib . data . python . ops import get_single_element <nl> + from tensorflow . contrib . data . python . ops import grouping <nl> from tensorflow . python . data . ops import dataset_ops <nl> - from tensorflow . python . framework import constant_op <nl> from tensorflow . python . framework import dtypes <nl> from tensorflow . python . framework import errors <nl> from tensorflow . python . framework import sparse_tensor <nl> <nl> from tensorflow . python . platform import test <nl> <nl> <nl> - class GetSingleElementTest ( test . TestCase ) : <nl> + class GetSingleElementTest ( test . TestCase , parameterized . TestCase ) : <nl> <nl> - def testGetSingleElement ( self ) : <nl> - skip_value = array_ops . placeholder ( dtypes . int64 , shape = [ ] ) <nl> - take_value = array_ops . placeholder_with_default ( <nl> - constant_op . constant ( 1 , dtype = dtypes . int64 ) , shape = [ ] ) <nl> + @ parameterized . named_parameters ( <nl> + ( " Zero " , 0 , 1 ) , <nl> + ( " Five " , 5 , 1 ) , <nl> + ( " Ten " , 10 , 1 ) , <nl> + ( " Empty " , 100 , 1 , errors . InvalidArgumentError , " Dataset was empty . " ) , <nl> + ( " MoreThanOne " , 0 , 2 , errors . InvalidArgumentError , <nl> + " Dataset had more than one element . " ) , <nl> + ) <nl> + def testGetSingleElement ( self , skip , take , error = None , error_msg = None ) : <nl> + skip_t = array_ops . placeholder ( dtypes . int64 , shape = [ ] ) <nl> + take_t = array_ops . placeholder ( dtypes . int64 , shape = [ ] ) <nl> <nl> def make_sparse ( x ) : <nl> x_1d = array_ops . reshape ( x , [ 1 ] ) <nl> x_2d = array_ops . reshape ( x , [ 1 , 1 ] ) <nl> return sparse_tensor . SparseTensor ( x_2d , x_1d , x_1d ) <nl> <nl> - dataset = ( dataset_ops . Dataset . range ( 100 ) <nl> - . skip ( skip_value ) <nl> - . map ( lambda x : ( x * x , make_sparse ( x ) ) ) <nl> - . take ( take_value ) ) <nl> - <nl> + dataset = dataset_ops . Dataset . range ( 100 ) . skip ( skip_t ) . map ( <nl> + lambda x : ( x * x , make_sparse ( x ) ) ) . take ( take_t ) <nl> element = get_single_element . get_single_element ( dataset ) <nl> <nl> with self . test_session ( ) as sess : <nl> - for x in [ 0 , 5 , 10 ] : <nl> - dense_val , sparse_val = sess . run ( element , feed_dict = { skip_value : x } ) <nl> - self . assertEqual ( x * x , dense_val ) <nl> - self . assertAllEqual ( [ [ x ] ] , sparse_val . indices ) <nl> - self . assertAllEqual ( [ x ] , sparse_val . values ) <nl> - self . assertAllEqual ( [ x ] , sparse_val . dense_shape ) <nl> - <nl> - with self . assertRaisesRegexp ( errors . InvalidArgumentError , <nl> - " Dataset was empty . " ) : <nl> - sess . run ( element , feed_dict = { skip_value : 100 } ) <nl> - <nl> - with self . assertRaisesRegexp ( errors . InvalidArgumentError , <nl> - " Dataset had more than one element . " ) : <nl> - sess . run ( element , feed_dict = { skip_value : 0 , take_value : 2 } ) <nl> + if error is None : <nl> + dense_val , sparse_val = sess . run ( <nl> + element , feed_dict = { <nl> + skip_t : skip , <nl> + take_t : take <nl> + } ) <nl> + self . assertEqual ( skip * skip , dense_val ) <nl> + self . assertAllEqual ( [ [ skip ] ] , sparse_val . indices ) <nl> + self . assertAllEqual ( [ skip ] , sparse_val . values ) <nl> + self . assertAllEqual ( [ skip ] , sparse_val . dense_shape ) <nl> + else : <nl> + with self . assertRaisesRegexp ( error , error_msg ) : <nl> + sess . run ( element , feed_dict = { skip_t : skip , take_t : take } ) <nl> + <nl> + @ parameterized . named_parameters ( <nl> + ( " SumZero " , 0 ) , <nl> + ( " SumOne " , 1 ) , <nl> + ( " SumFive " , 5 ) , <nl> + ( " SumTen " , 10 ) , <nl> + ) <nl> + def testReduceDataset ( self , stop ) : <nl> + def init_fn ( _ ) : <nl> + return np . int64 ( 0 ) <nl> + <nl> + def reduce_fn ( state , value ) : <nl> + return state + value <nl> + <nl> + def finalize_fn ( state ) : <nl> + return state <nl> + <nl> + sum_reducer = grouping . Reducer ( init_fn , reduce_fn , finalize_fn ) <nl> + <nl> + stop_t = array_ops . placeholder ( dtypes . int64 , shape = [ ] ) <nl> + dataset = dataset_ops . Dataset . range ( stop_t ) <nl> + element = get_single_element . reduce_dataset ( dataset , sum_reducer ) <nl> + <nl> + with self . test_session ( ) as sess : <nl> + value = sess . run ( element , feed_dict = { stop_t : stop } ) <nl> + self . assertEqual ( stop * ( stop - 1 ) / 2 , value ) <nl> <nl> <nl> if __name__ = = " __main__ " : <nl> mmm a / tensorflow / contrib / data / python / ops / BUILD <nl> ppp b / tensorflow / contrib / data / python / ops / BUILD <nl> py_library ( <nl> srcs = [ " get_single_element . py " ] , <nl> srcs_version = " PY2AND3 " , <nl> deps = [ <nl> + " : grouping " , <nl> " / / tensorflow / python : dataset_ops_gen " , <nl> " / / tensorflow / python / data / ops : dataset_ops " , <nl> " / / tensorflow / python / data / util : nest " , <nl> " / / tensorflow / python / data / util : sparse " , <nl> + " / / third_party / py / numpy " , <nl> ] , <nl> ) <nl> <nl> py_library ( <nl> " / / tensorflow / python / data / util : convert " , <nl> " / / tensorflow / python / data / util : nest " , <nl> " / / tensorflow / python / data / util : sparse " , <nl> + " / / third_party / py / numpy " , <nl> ] , <nl> ) <nl> <nl> mmm a / tensorflow / contrib / data / python / ops / get_single_element . py <nl> ppp b / tensorflow / contrib / data / python / ops / get_single_element . py <nl> <nl> from __future__ import division <nl> from __future__ import print_function <nl> <nl> + import numpy as np <nl> + <nl> + from tensorflow . contrib . data . python . ops import grouping <nl> from tensorflow . python . data . ops import dataset_ops <nl> from tensorflow . python . data . util import nest <nl> from tensorflow . python . data . util import sparse <nl> def preprocessing_fn ( input_str ) : <nl> return sparse . deserialize_sparse_tensors ( <nl> nested_ret , dataset . output_types , dataset . output_shapes , <nl> dataset . output_classes ) <nl> + <nl> + <nl> + def reduce_dataset ( dataset , reducer ) : <nl> + " " " Returns the result of reducing the ` dataset ` using ` reducer ` . <nl> + <nl> + Args : <nl> + dataset : A @ { tf . data . Dataset } object . <nl> + reducer : A @ { tf . contrib . data . Reducer } object representing the reduce logic . <nl> + <nl> + Returns : <nl> + A nested structure of @ { tf . Tensor } objects , corresponding to the result <nl> + of reducing ` dataset ` using ` reducer ` . <nl> + <nl> + Raises : <nl> + TypeError : if ` dataset ` is not a ` tf . data . Dataset ` object . <nl> + " " " <nl> + if not isinstance ( dataset , dataset_ops . Dataset ) : <nl> + raise TypeError ( " ` dataset ` must be a ` tf . data . Dataset ` object . " ) <nl> + <nl> + # The sentinel dataset is used in case the reduced dataset is empty . <nl> + sentinel_dataset = dataset_ops . Dataset . from_tensors ( <nl> + reducer . finalize_func ( reducer . init_func ( np . int64 ( 0 ) ) ) ) <nl> + reduced_dataset = dataset . apply ( <nl> + grouping . group_by_reducer ( lambda x : np . int64 ( 0 ) , reducer ) ) <nl> + <nl> + return get_single_element ( <nl> + reduced_dataset . concatenate ( sentinel_dataset ) . take ( 1 ) ) <nl>
[ tf . data ] Adding ` tf . contrib . data . reduce_dataset ` which can be used to reduce a dataset to a single element .
tensorflow/tensorflow
e9869ece182be721dc07fe8ecb7c7288f2fce90f
2018-07-19T19:23:32Z
mmm a / scripts / travis_java_script . sh <nl> ppp b / scripts / travis_java_script . sh <nl> <nl> # Test java package of xgboost <nl> + set - e <nl> cd java <nl> . / create_wrap . sh <nl> cd xgboost4j <nl>
Update travis_java_script . sh
dmlc/xgboost
969ea57159a1d8fc7027dfa6c0f3af81a0fb1e19
2015-07-08T00:28:45Z
mmm a / BUILD . gn <nl> ppp b / BUILD . gn <nl> v8_source_set ( " v8_base " ) { <nl> " src / objects / bigint - inl . h " , <nl> " src / objects / bigint . cc " , <nl> " src / objects / bigint . h " , <nl> + " src / objects / code - inl . h " , <nl> + " src / objects / code . h " , <nl> " src / objects / compilation - cache - inl . h " , <nl> " src / objects / compilation - cache . h " , <nl> " src / objects / debug - objects - inl . h " , <nl> mmm a / src / compiler / pipeline . h <nl> ppp b / src / compiler / pipeline . h <nl> <nl> / / Do not include anything from src / compiler here ! <nl> # include " src / globals . h " <nl> # include " src / objects . h " <nl> + # include " src / objects / code . h " <nl> # include " src / zone / zone - containers . h " <nl> <nl> namespace v8 { <nl> mmm a / src / compiler / type - cache . h <nl> ppp b / src / compiler / type - cache . h <nl> <nl> <nl> # include " src / compiler / types . h " <nl> # include " src / date . h " <nl> + # include " src / objects / code . h " <nl> # include " src / objects / string . h " <nl> <nl> namespace v8 { <nl> mmm a / src / frames . h <nl> ppp b / src / frames . h <nl> <nl> # include " src / flags . h " <nl> # include " src / handles . h " <nl> # include " src / objects . h " <nl> + # include " src / objects / code . h " <nl> # include " src / safepoint - table . h " <nl> <nl> namespace v8 { <nl> mmm a / src / heap / heap . h <nl> ppp b / src / heap / heap . h <nl> class HeapTester ; <nl> class TestMemoryAllocatorScope ; <nl> } / / namespace heap <nl> <nl> + class BytecodeArray ; <nl> + <nl> using v8 : : MemoryPressureLevel ; <nl> <nl> / / Defines all the roots in Heap . <nl> mmm a / src / heap / objects - visiting . h <nl> ppp b / src / heap / objects - visiting . h <nl> namespace v8 { <nl> namespace internal { <nl> <nl> class BigInt ; <nl> + class BytecodeArray ; <nl> <nl> # define TYPED_VISITOR_ID_LIST ( V ) \ <nl> V ( AllocationSite ) \ <nl> mmm a / src / heap / spaces - inl . h <nl> ppp b / src / heap / spaces - inl . h <nl> <nl> # include " src / heap / incremental - marking . h " <nl> # include " src / heap / spaces . h " <nl> # include " src / msan . h " <nl> + # include " src / objects / code - inl . h " <nl> <nl> namespace v8 { <nl> namespace internal { <nl> mmm a / src / interpreter / bytecode - array - accessor . cc <nl> ppp b / src / interpreter / bytecode - array - accessor . cc <nl> <nl> # include " src / interpreter / bytecode - decoder . h " <nl> # include " src / interpreter / interpreter - intrinsics . h " <nl> # include " src / objects - inl . h " <nl> + # include " src / objects / code - inl . h " <nl> <nl> namespace v8 { <nl> namespace internal { <nl> mmm a / src / interpreter / bytecode - array - accessor . h <nl> ppp b / src / interpreter / bytecode - array - accessor . h <nl> <nl> <nl> namespace v8 { <nl> namespace internal { <nl> + <nl> + class BytecodeArray ; <nl> + <nl> namespace interpreter { <nl> <nl> class BytecodeArrayAccessor ; <nl> mmm a / src / interpreter / bytecode - array - iterator . cc <nl> ppp b / src / interpreter / bytecode - array - iterator . cc <nl> <nl> <nl> # include " src / interpreter / bytecode - array - iterator . h " <nl> # include " src / objects - inl . h " <nl> + # include " src / objects / code - inl . h " <nl> <nl> namespace v8 { <nl> namespace internal { <nl> mmm a / src / interpreter / bytecode - array - random - iterator . cc <nl> ppp b / src / interpreter / bytecode - array - random - iterator . cc <nl> <nl> <nl> # include " src / interpreter / bytecode - array - random - iterator . h " <nl> # include " src / objects - inl . h " <nl> + # include " src / objects / code - inl . h " <nl> <nl> namespace v8 { <nl> namespace internal { <nl> mmm a / src / isolate . h <nl> ppp b / src / isolate . h <nl> <nl> # include " src / handles . h " <nl> # include " src / heap / heap . h " <nl> # include " src / messages . h " <nl> + # include " src / objects / code . h " <nl> # include " src / regexp / regexp - stack . h " <nl> # include " src / runtime / runtime . h " <nl> # include " src / zone / zone . h " <nl> mmm a / src / objects - inl . h <nl> ppp b / src / objects - inl . h <nl> int PropertyDetails : : field_width_in_words ( ) const { <nl> TYPE_CHECKER ( BreakPoint , TUPLE2_TYPE ) <nl> TYPE_CHECKER ( BreakPointInfo , TUPLE2_TYPE ) <nl> TYPE_CHECKER ( ByteArray , BYTE_ARRAY_TYPE ) <nl> - TYPE_CHECKER ( BytecodeArray , BYTECODE_ARRAY_TYPE ) <nl> TYPE_CHECKER ( CallHandlerInfo , TUPLE2_TYPE ) <nl> TYPE_CHECKER ( Cell , CELL_TYPE ) <nl> - TYPE_CHECKER ( Code , CODE_TYPE ) <nl> TYPE_CHECKER ( ConstantElementsPair , TUPLE2_TYPE ) <nl> TYPE_CHECKER ( CoverageInfo , FIXED_ARRAY_TYPE ) <nl> TYPE_CHECKER ( FixedDoubleArray , FIXED_DOUBLE_ARRAY_TYPE ) <nl> bool Object : : IsMinusZero ( ) const { <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / Cast operations <nl> <nl> - CAST_ACCESSOR ( AbstractCode ) <nl> CAST_ACCESSOR ( AccessCheckInfo ) <nl> CAST_ACCESSOR ( AccessorInfo ) <nl> CAST_ACCESSOR ( AccessorPair ) <nl> CAST_ACCESSOR ( AsyncGeneratorRequest ) <nl> CAST_ACCESSOR ( BigInt ) <nl> CAST_ACCESSOR ( BoilerplateDescription ) <nl> CAST_ACCESSOR ( ByteArray ) <nl> - CAST_ACCESSOR ( BytecodeArray ) <nl> CAST_ACCESSOR ( CallHandlerInfo ) <nl> CAST_ACCESSOR ( Cell ) <nl> - CAST_ACCESSOR ( Code ) <nl> CAST_ACCESSOR ( ConstantElementsPair ) <nl> CAST_ACCESSOR ( ContextExtension ) <nl> - CAST_ACCESSOR ( DeoptimizationInputData ) <nl> - CAST_ACCESSOR ( DependentCode ) <nl> CAST_ACCESSOR ( DescriptorArray ) <nl> CAST_ACCESSOR ( EnumCache ) <nl> CAST_ACCESSOR ( FixedArray ) <nl> CAST_ACCESSOR ( FixedTypedArrayBase ) <nl> CAST_ACCESSOR ( Foreign ) <nl> CAST_ACCESSOR ( FunctionTemplateInfo ) <nl> CAST_ACCESSOR ( GlobalDictionary ) <nl> - CAST_ACCESSOR ( HandlerTable ) <nl> CAST_ACCESSOR ( HeapObject ) <nl> CAST_ACCESSOR ( InterceptorInfo ) <nl> CAST_ACCESSOR ( JSArray ) <nl> DEFINE_DEOPT_ENTRY_ACCESSORS ( BytecodeOffsetRaw , Smi ) <nl> DEFINE_DEOPT_ENTRY_ACCESSORS ( TranslationIndex , Smi ) <nl> DEFINE_DEOPT_ENTRY_ACCESSORS ( Pc , Smi ) <nl> <nl> - BailoutId DeoptimizationInputData : : BytecodeOffset ( int i ) { <nl> - return BailoutId ( BytecodeOffsetRaw ( i ) - > value ( ) ) ; <nl> - } <nl> - <nl> - void DeoptimizationInputData : : SetBytecodeOffset ( int i , BailoutId value ) { <nl> - SetBytecodeOffsetRaw ( i , Smi : : FromInt ( value . ToInt ( ) ) ) ; <nl> - } <nl> - <nl> - <nl> - int DeoptimizationInputData : : DeoptCount ( ) { <nl> - return ( length ( ) - kFirstDeoptEntryIndex ) / kDeoptEntrySize ; <nl> - } <nl> - <nl> - <nl> - int HandlerTable : : GetRangeStart ( int index ) const { <nl> - return Smi : : ToInt ( get ( index * kRangeEntrySize + kRangeStartIndex ) ) ; <nl> - } <nl> - <nl> - int HandlerTable : : GetRangeEnd ( int index ) const { <nl> - return Smi : : ToInt ( get ( index * kRangeEntrySize + kRangeEndIndex ) ) ; <nl> - } <nl> - <nl> - int HandlerTable : : GetRangeHandler ( int index ) const { <nl> - return HandlerOffsetField : : decode ( <nl> - Smi : : ToInt ( get ( index * kRangeEntrySize + kRangeHandlerIndex ) ) ) ; <nl> - } <nl> - <nl> - int HandlerTable : : GetRangeData ( int index ) const { <nl> - return Smi : : ToInt ( get ( index * kRangeEntrySize + kRangeDataIndex ) ) ; <nl> - } <nl> - <nl> - void HandlerTable : : SetRangeStart ( int index , int value ) { <nl> - set ( index * kRangeEntrySize + kRangeStartIndex , Smi : : FromInt ( value ) ) ; <nl> - } <nl> - <nl> - <nl> - void HandlerTable : : SetRangeEnd ( int index , int value ) { <nl> - set ( index * kRangeEntrySize + kRangeEndIndex , Smi : : FromInt ( value ) ) ; <nl> - } <nl> - <nl> - <nl> - void HandlerTable : : SetRangeHandler ( int index , int offset , <nl> - CatchPrediction prediction ) { <nl> - int value = HandlerOffsetField : : encode ( offset ) | <nl> - HandlerPredictionField : : encode ( prediction ) ; <nl> - set ( index * kRangeEntrySize + kRangeHandlerIndex , Smi : : FromInt ( value ) ) ; <nl> - } <nl> - <nl> - void HandlerTable : : SetRangeData ( int index , int value ) { <nl> - set ( index * kRangeEntrySize + kRangeDataIndex , Smi : : FromInt ( value ) ) ; <nl> - } <nl> - <nl> - <nl> - void HandlerTable : : SetReturnOffset ( int index , int value ) { <nl> - set ( index * kReturnEntrySize + kReturnOffsetIndex , Smi : : FromInt ( value ) ) ; <nl> - } <nl> - <nl> - void HandlerTable : : SetReturnHandler ( int index , int offset ) { <nl> - int value = HandlerOffsetField : : encode ( offset ) ; <nl> - set ( index * kReturnEntrySize + kReturnHandlerIndex , Smi : : FromInt ( value ) ) ; <nl> - } <nl> - <nl> - int HandlerTable : : NumberOfRangeEntries ( ) const { <nl> - return length ( ) / kRangeEntrySize ; <nl> - } <nl> - <nl> template < typename Derived , typename Shape > <nl> HashTable < Derived , Shape > * HashTable < Derived , Shape > : : cast ( Object * obj ) { <nl> SLOW_DCHECK ( obj - > IsHashTable ( ) ) ; <nl> Address ByteArray : : GetDataStartAddress ( ) { <nl> return reinterpret_cast < Address > ( this ) - kHeapObjectTag + kHeaderSize ; <nl> } <nl> <nl> - byte BytecodeArray : : get ( int index ) { <nl> - DCHECK ( index > = 0 & & index < this - > length ( ) ) ; <nl> - return READ_BYTE_FIELD ( this , kHeaderSize + index * kCharSize ) ; <nl> - } <nl> - <nl> - void BytecodeArray : : set ( int index , byte value ) { <nl> - DCHECK ( index > = 0 & & index < this - > length ( ) ) ; <nl> - WRITE_BYTE_FIELD ( this , kHeaderSize + index * kCharSize , value ) ; <nl> - } <nl> - <nl> - void BytecodeArray : : set_frame_size ( int frame_size ) { <nl> - DCHECK_GE ( frame_size , 0 ) ; <nl> - DCHECK ( IsAligned ( frame_size , static_cast < unsigned > ( kPointerSize ) ) ) ; <nl> - WRITE_INT_FIELD ( this , kFrameSizeOffset , frame_size ) ; <nl> - } <nl> - <nl> - int BytecodeArray : : frame_size ( ) const { <nl> - return READ_INT_FIELD ( this , kFrameSizeOffset ) ; <nl> - } <nl> - <nl> - int BytecodeArray : : register_count ( ) const { <nl> - return frame_size ( ) / kPointerSize ; <nl> - } <nl> - <nl> - void BytecodeArray : : set_parameter_count ( int number_of_parameters ) { <nl> - DCHECK_GE ( number_of_parameters , 0 ) ; <nl> - / / Parameter count is stored as the size on stack of the parameters to allow <nl> - / / it to be used directly by generated code . <nl> - WRITE_INT_FIELD ( this , kParameterSizeOffset , <nl> - ( number_of_parameters < < kPointerSizeLog2 ) ) ; <nl> - } <nl> - <nl> - interpreter : : Register BytecodeArray : : incoming_new_target_or_generator_register ( ) <nl> - const { <nl> - int register_operand = <nl> - READ_INT_FIELD ( this , kIncomingNewTargetOrGeneratorRegisterOffset ) ; <nl> - if ( register_operand = = 0 ) { <nl> - return interpreter : : Register : : invalid_value ( ) ; <nl> - } else { <nl> - return interpreter : : Register : : FromOperand ( register_operand ) ; <nl> - } <nl> - } <nl> - <nl> - void BytecodeArray : : set_incoming_new_target_or_generator_register ( <nl> - interpreter : : Register incoming_new_target_or_generator_register ) { <nl> - if ( ! incoming_new_target_or_generator_register . is_valid ( ) ) { <nl> - WRITE_INT_FIELD ( this , kIncomingNewTargetOrGeneratorRegisterOffset , 0 ) ; <nl> - } else { <nl> - DCHECK ( incoming_new_target_or_generator_register . index ( ) < <nl> - register_count ( ) ) ; <nl> - DCHECK_NE ( 0 , incoming_new_target_or_generator_register . ToOperand ( ) ) ; <nl> - WRITE_INT_FIELD ( this , kIncomingNewTargetOrGeneratorRegisterOffset , <nl> - incoming_new_target_or_generator_register . ToOperand ( ) ) ; <nl> - } <nl> - } <nl> - <nl> - int BytecodeArray : : interrupt_budget ( ) const { <nl> - return READ_INT_FIELD ( this , kInterruptBudgetOffset ) ; <nl> - } <nl> - <nl> - void BytecodeArray : : set_interrupt_budget ( int interrupt_budget ) { <nl> - DCHECK_GE ( interrupt_budget , 0 ) ; <nl> - WRITE_INT_FIELD ( this , kInterruptBudgetOffset , interrupt_budget ) ; <nl> - } <nl> - <nl> - int BytecodeArray : : osr_loop_nesting_level ( ) const { <nl> - return READ_INT8_FIELD ( this , kOSRNestingLevelOffset ) ; <nl> - } <nl> - <nl> - void BytecodeArray : : set_osr_loop_nesting_level ( int depth ) { <nl> - DCHECK ( 0 < = depth & & depth < = AbstractCode : : kMaxLoopNestingMarker ) ; <nl> - STATIC_ASSERT ( AbstractCode : : kMaxLoopNestingMarker < kMaxInt8 ) ; <nl> - WRITE_INT8_FIELD ( this , kOSRNestingLevelOffset , depth ) ; <nl> - } <nl> - <nl> - BytecodeArray : : Age BytecodeArray : : bytecode_age ( ) const { <nl> - / / Bytecode is aged by the concurrent marker . <nl> - return static_cast < Age > ( RELAXED_READ_INT8_FIELD ( this , kBytecodeAgeOffset ) ) ; <nl> - } <nl> - <nl> - void BytecodeArray : : set_bytecode_age ( BytecodeArray : : Age age ) { <nl> - DCHECK_GE ( age , kFirstBytecodeAge ) ; <nl> - DCHECK_LE ( age , kLastBytecodeAge ) ; <nl> - STATIC_ASSERT ( kLastBytecodeAge < = kMaxInt8 ) ; <nl> - / / Bytecode is aged by the concurrent marker . <nl> - RELAXED_WRITE_INT8_FIELD ( this , kBytecodeAgeOffset , static_cast < int8_t > ( age ) ) ; <nl> - } <nl> - <nl> - int BytecodeArray : : parameter_count ( ) const { <nl> - / / Parameter count is stored as the size on stack of the parameters to allow <nl> - / / it to be used directly by generated code . <nl> - return READ_INT_FIELD ( this , kParameterSizeOffset ) > > kPointerSizeLog2 ; <nl> - } <nl> - <nl> - ACCESSORS ( BytecodeArray , constant_pool , FixedArray , kConstantPoolOffset ) <nl> - ACCESSORS ( BytecodeArray , handler_table , FixedArray , kHandlerTableOffset ) <nl> - ACCESSORS ( BytecodeArray , source_position_table , Object , <nl> - kSourcePositionTableOffset ) <nl> - <nl> - void BytecodeArray : : clear_padding ( ) { <nl> - int data_size = kHeaderSize + length ( ) ; <nl> - memset ( address ( ) + data_size , 0 , SizeFor ( length ( ) ) - data_size ) ; <nl> - } <nl> - <nl> - Address BytecodeArray : : GetFirstBytecodeAddress ( ) { <nl> - return reinterpret_cast < Address > ( this ) - kHeapObjectTag + kHeaderSize ; <nl> - } <nl> - <nl> - ByteArray * BytecodeArray : : SourcePositionTable ( ) { <nl> - Object * maybe_table = source_position_table ( ) ; <nl> - if ( maybe_table - > IsByteArray ( ) ) return ByteArray : : cast ( maybe_table ) ; <nl> - DCHECK ( maybe_table - > IsSourcePositionTableWithFrameCache ( ) ) ; <nl> - return SourcePositionTableWithFrameCache : : cast ( maybe_table ) <nl> - - > source_position_table ( ) ; <nl> - } <nl> - <nl> - int BytecodeArray : : BytecodeArraySize ( ) { return SizeFor ( this - > length ( ) ) ; } <nl> - <nl> - int BytecodeArray : : SizeIncludingMetadata ( ) { <nl> - int size = BytecodeArraySize ( ) ; <nl> - size + = constant_pool ( ) - > Size ( ) ; <nl> - size + = handler_table ( ) - > Size ( ) ; <nl> - size + = SourcePositionTable ( ) - > Size ( ) ; <nl> - return size ; <nl> - } <nl> - <nl> ACCESSORS ( FixedTypedArrayBase , base_pointer , Object , kBasePointerOffset ) <nl> <nl> <nl> bool Map : : IsSpecialReceiverMap ( ) const { <nl> return result ; <nl> } <nl> <nl> - DependentCode * DependentCode : : next_link ( ) { <nl> - return DependentCode : : cast ( get ( kNextLinkIndex ) ) ; <nl> - } <nl> - <nl> - <nl> - void DependentCode : : set_next_link ( DependentCode * next ) { <nl> - set ( kNextLinkIndex , next ) ; <nl> - } <nl> - <nl> - int DependentCode : : flags ( ) { return Smi : : ToInt ( get ( kFlagsIndex ) ) ; } <nl> - <nl> - void DependentCode : : set_flags ( int flags ) { <nl> - set ( kFlagsIndex , Smi : : FromInt ( flags ) ) ; <nl> - } <nl> - <nl> - <nl> - int DependentCode : : count ( ) { return CountField : : decode ( flags ( ) ) ; } <nl> - <nl> - void DependentCode : : set_count ( int value ) { <nl> - set_flags ( CountField : : update ( flags ( ) , value ) ) ; <nl> - } <nl> - <nl> - <nl> - DependentCode : : DependencyGroup DependentCode : : group ( ) { <nl> - return static_cast < DependencyGroup > ( GroupField : : decode ( flags ( ) ) ) ; <nl> - } <nl> - <nl> - <nl> - void DependentCode : : set_group ( DependentCode : : DependencyGroup group ) { <nl> - set_flags ( GroupField : : update ( flags ( ) , static_cast < int > ( group ) ) ) ; <nl> - } <nl> - <nl> - <nl> - void DependentCode : : set_object_at ( int i , Object * object ) { <nl> - set ( kCodesStartIndex + i , object ) ; <nl> - } <nl> - <nl> - <nl> - Object * DependentCode : : object_at ( int i ) { <nl> - return get ( kCodesStartIndex + i ) ; <nl> - } <nl> - <nl> - <nl> - void DependentCode : : clear_at ( int i ) { <nl> - set_undefined ( kCodesStartIndex + i ) ; <nl> - } <nl> - <nl> - <nl> - void DependentCode : : copy ( int from , int to ) { <nl> - set ( kCodesStartIndex + to , get ( kCodesStartIndex + from ) ) ; <nl> - } <nl> - <nl> - Code : : Kind Code : : kind ( ) const { <nl> - return KindField : : decode ( READ_UINT32_FIELD ( this , kFlagsOffset ) ) ; <nl> - } <nl> - <nl> - void Code : : initialize_flags ( Kind kind ) { <nl> - WRITE_UINT32_FIELD ( this , kFlagsOffset , KindField : : encode ( kind ) ) ; <nl> - } <nl> - <nl> - void Code : : set_kind ( Kind kind ) { <nl> - STATIC_ASSERT ( Code : : NUMBER_OF_KINDS < = KindField : : kMax + 1 ) ; <nl> - uint32_t previous = READ_UINT32_FIELD ( this , kFlagsOffset ) ; <nl> - uint32_t updated_value = KindField : : update ( previous , kind ) ; <nl> - WRITE_UINT32_FIELD ( this , kFlagsOffset , updated_value ) ; <nl> - } <nl> - <nl> - / / For initialization . <nl> - void Code : : set_raw_kind_specific_flags1 ( int value ) { <nl> - WRITE_INT_FIELD ( this , kKindSpecificFlags1Offset , value ) ; <nl> - } <nl> - <nl> - <nl> - void Code : : set_raw_kind_specific_flags2 ( int value ) { <nl> - WRITE_INT_FIELD ( this , kKindSpecificFlags2Offset , value ) ; <nl> - } <nl> - <nl> - inline bool Code : : is_interpreter_trampoline_builtin ( ) const { <nl> - Builtins * builtins = GetIsolate ( ) - > builtins ( ) ; <nl> - bool is_interpreter_trampoline = <nl> - ( this = = builtins - > builtin ( Builtins : : kInterpreterEntryTrampoline ) | | <nl> - this = = builtins - > builtin ( Builtins : : kInterpreterEnterBytecodeAdvance ) | | <nl> - this = = builtins - > builtin ( Builtins : : kInterpreterEnterBytecodeDispatch ) ) ; <nl> - DCHECK_IMPLIES ( is_interpreter_trampoline , ! Builtins : : IsLazy ( builtin_index ( ) ) ) ; <nl> - return is_interpreter_trampoline ; <nl> - } <nl> - <nl> - inline bool Code : : checks_optimization_marker ( ) const { <nl> - Builtins * builtins = GetIsolate ( ) - > builtins ( ) ; <nl> - bool checks_marker = <nl> - ( this = = builtins - > builtin ( Builtins : : kCompileLazy ) | | <nl> - this = = builtins - > builtin ( Builtins : : kInterpreterEntryTrampoline ) | | <nl> - this = = builtins - > builtin ( Builtins : : kCheckOptimizationMarker ) ) ; <nl> - DCHECK_IMPLIES ( checks_marker , ! Builtins : : IsLazy ( builtin_index ( ) ) ) ; <nl> - return checks_marker | | <nl> - ( kind ( ) = = OPTIMIZED_FUNCTION & & marked_for_deoptimization ( ) ) ; <nl> - } <nl> - <nl> - inline bool Code : : has_unwinding_info ( ) const { <nl> - return HasUnwindingInfoField : : decode ( READ_UINT32_FIELD ( this , kFlagsOffset ) ) ; <nl> - } <nl> - <nl> - inline void Code : : set_has_unwinding_info ( bool state ) { <nl> - uint32_t previous = READ_UINT32_FIELD ( this , kFlagsOffset ) ; <nl> - uint32_t updated_value = HasUnwindingInfoField : : update ( previous , state ) ; <nl> - WRITE_UINT32_FIELD ( this , kFlagsOffset , updated_value ) ; <nl> - } <nl> - <nl> - inline bool Code : : has_tagged_params ( ) const { <nl> - int flags = READ_UINT32_FIELD ( this , kKindSpecificFlags2Offset ) ; <nl> - return HasTaggedStackField : : decode ( flags ) ; <nl> - } <nl> - <nl> - inline void Code : : set_has_tagged_params ( bool value ) { <nl> - int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags2Offset ) ; <nl> - int updated = HasTaggedStackField : : update ( previous , value ) ; <nl> - WRITE_UINT32_FIELD ( this , kKindSpecificFlags2Offset , updated ) ; <nl> - } <nl> - <nl> - inline bool Code : : is_turbofanned ( ) const { <nl> - return IsTurbofannedField : : decode ( <nl> - READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> - } <nl> - <nl> - <nl> - inline void Code : : set_is_turbofanned ( bool value ) { <nl> - int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> - int updated = IsTurbofannedField : : update ( previous , value ) ; <nl> - WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> - } <nl> - <nl> - inline bool Code : : can_have_weak_objects ( ) const { <nl> - DCHECK ( kind ( ) = = OPTIMIZED_FUNCTION ) ; <nl> - return CanHaveWeakObjectsField : : decode ( <nl> - READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> - } <nl> - <nl> - <nl> - inline void Code : : set_can_have_weak_objects ( bool value ) { <nl> - DCHECK ( kind ( ) = = OPTIMIZED_FUNCTION ) ; <nl> - int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> - int updated = CanHaveWeakObjectsField : : update ( previous , value ) ; <nl> - WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> - } <nl> - <nl> - inline bool Code : : is_construct_stub ( ) const { <nl> - DCHECK ( kind ( ) = = BUILTIN ) ; <nl> - return IsConstructStubField : : decode ( <nl> - READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> - } <nl> - <nl> - inline void Code : : set_is_construct_stub ( bool value ) { <nl> - DCHECK ( kind ( ) = = BUILTIN ) ; <nl> - int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> - int updated = IsConstructStubField : : update ( previous , value ) ; <nl> - WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> - } <nl> - <nl> - inline bool Code : : is_promise_rejection ( ) const { <nl> - DCHECK ( kind ( ) = = BUILTIN ) ; <nl> - return IsPromiseRejectionField : : decode ( <nl> - READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> - } <nl> - <nl> - inline void Code : : set_is_promise_rejection ( bool value ) { <nl> - DCHECK ( kind ( ) = = BUILTIN ) ; <nl> - int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> - int updated = IsPromiseRejectionField : : update ( previous , value ) ; <nl> - WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> - } <nl> - <nl> - inline bool Code : : is_exception_caught ( ) const { <nl> - DCHECK ( kind ( ) = = BUILTIN ) ; <nl> - return IsExceptionCaughtField : : decode ( <nl> - READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> - } <nl> - <nl> - inline void Code : : set_is_exception_caught ( bool value ) { <nl> - DCHECK ( kind ( ) = = BUILTIN ) ; <nl> - int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> - int updated = IsExceptionCaughtField : : update ( previous , value ) ; <nl> - WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> - } <nl> - <nl> - inline HandlerTable : : CatchPrediction Code : : GetBuiltinCatchPrediction ( ) { <nl> - if ( is_promise_rejection ( ) ) return HandlerTable : : PROMISE ; <nl> - if ( is_exception_caught ( ) ) return HandlerTable : : CAUGHT ; <nl> - return HandlerTable : : UNCAUGHT ; <nl> - } <nl> - <nl> - int Code : : builtin_index ( ) const { <nl> - int index = READ_INT_FIELD ( this , kBuiltinIndexOffset ) ; <nl> - DCHECK ( index = = - 1 | | Builtins : : IsBuiltinId ( index ) ) ; <nl> - return index ; <nl> - } <nl> - <nl> - void Code : : set_builtin_index ( int index ) { <nl> - DCHECK ( index = = - 1 | | Builtins : : IsBuiltinId ( index ) ) ; <nl> - WRITE_INT_FIELD ( this , kBuiltinIndexOffset , index ) ; <nl> - } <nl> - <nl> - bool Code : : is_builtin ( ) const { return builtin_index ( ) ! = - 1 ; } <nl> - <nl> - unsigned Code : : stack_slots ( ) const { <nl> - DCHECK ( is_turbofanned ( ) ) ; <nl> - return StackSlotsField : : decode ( <nl> - READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> - } <nl> - <nl> - <nl> - void Code : : set_stack_slots ( unsigned slots ) { <nl> - CHECK ( slots < = ( 1 < < kStackSlotsBitCount ) ) ; <nl> - DCHECK ( is_turbofanned ( ) ) ; <nl> - int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> - int updated = StackSlotsField : : update ( previous , slots ) ; <nl> - WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> - } <nl> - <nl> - unsigned Code : : safepoint_table_offset ( ) const { <nl> - DCHECK ( is_turbofanned ( ) ) ; <nl> - return SafepointTableOffsetField : : decode ( <nl> - READ_UINT32_FIELD ( this , kKindSpecificFlags2Offset ) ) ; <nl> - } <nl> - <nl> - <nl> - void Code : : set_safepoint_table_offset ( unsigned offset ) { <nl> - CHECK ( offset < = ( 1 < < kSafepointTableOffsetBitCount ) ) ; <nl> - DCHECK ( is_turbofanned ( ) ) ; <nl> - DCHECK ( IsAligned ( offset , static_cast < unsigned > ( kIntSize ) ) ) ; <nl> - int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags2Offset ) ; <nl> - int updated = SafepointTableOffsetField : : update ( previous , offset ) ; <nl> - WRITE_UINT32_FIELD ( this , kKindSpecificFlags2Offset , updated ) ; <nl> - } <nl> - <nl> - <nl> - bool Code : : marked_for_deoptimization ( ) const { <nl> - DCHECK ( kind ( ) = = OPTIMIZED_FUNCTION ) ; <nl> - return MarkedForDeoptimizationField : : decode ( <nl> - READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> - } <nl> - <nl> - <nl> - void Code : : set_marked_for_deoptimization ( bool flag ) { <nl> - DCHECK ( kind ( ) = = OPTIMIZED_FUNCTION ) ; <nl> - DCHECK_IMPLIES ( flag , AllowDeoptimization : : IsAllowed ( GetIsolate ( ) ) ) ; <nl> - int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> - int updated = MarkedForDeoptimizationField : : update ( previous , flag ) ; <nl> - WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> - } <nl> - <nl> - bool Code : : deopt_already_counted ( ) const { <nl> - DCHECK ( kind ( ) = = OPTIMIZED_FUNCTION ) ; <nl> - return DeoptAlreadyCountedField : : decode ( <nl> - READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> - } <nl> - <nl> - void Code : : set_deopt_already_counted ( bool flag ) { <nl> - DCHECK ( kind ( ) = = OPTIMIZED_FUNCTION ) ; <nl> - DCHECK_IMPLIES ( flag , AllowDeoptimization : : IsAllowed ( GetIsolate ( ) ) ) ; <nl> - int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> - int updated = DeoptAlreadyCountedField : : update ( previous , flag ) ; <nl> - WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> - } <nl> - <nl> - bool Code : : is_stub ( ) const { return kind ( ) = = STUB ; } <nl> - bool Code : : is_optimized_code ( ) const { return kind ( ) = = OPTIMIZED_FUNCTION ; } <nl> - bool Code : : is_wasm_code ( ) const { return kind ( ) = = WASM_FUNCTION ; } <nl> - <nl> - Address Code : : constant_pool ( ) { <nl> - Address constant_pool = NULL ; <nl> - if ( FLAG_enable_embedded_constant_pool ) { <nl> - int offset = constant_pool_offset ( ) ; <nl> - if ( offset < instruction_size ( ) ) { <nl> - constant_pool = FIELD_ADDR ( this , kHeaderSize + offset ) ; <nl> - } <nl> - } <nl> - return constant_pool ; <nl> - } <nl> - <nl> - Code * Code : : GetCodeFromTargetAddress ( Address address ) { <nl> - HeapObject * code = HeapObject : : FromAddress ( address - Code : : kHeaderSize ) ; <nl> - / / GetCodeFromTargetAddress might be called when marking objects during mark <nl> - / / sweep . reinterpret_cast is therefore used instead of the more appropriate <nl> - / / Code : : cast . Code : : cast does not work when the object ' s map is <nl> - / / marked . <nl> - Code * result = reinterpret_cast < Code * > ( code ) ; <nl> - return result ; <nl> - } <nl> - <nl> - Object * Code : : GetObjectFromCodeEntry ( Address code_entry ) { <nl> - return HeapObject : : FromAddress ( code_entry - Code : : kHeaderSize ) ; <nl> - } <nl> - <nl> - Object * Code : : GetObjectFromEntryAddress ( Address location_of_address ) { <nl> - return GetObjectFromCodeEntry ( Memory : : Address_at ( location_of_address ) ) ; <nl> - } <nl> - <nl> - <nl> - bool Code : : CanContainWeakObjects ( ) { <nl> - return is_optimized_code ( ) & & can_have_weak_objects ( ) ; <nl> - } <nl> - <nl> - <nl> - bool Code : : IsWeakObject ( Object * object ) { <nl> - return ( CanContainWeakObjects ( ) & & IsWeakObjectInOptimizedCode ( object ) ) ; <nl> - } <nl> - <nl> - <nl> - bool Code : : IsWeakObjectInOptimizedCode ( Object * object ) { <nl> - if ( object - > IsMap ( ) ) { <nl> - return Map : : cast ( object ) - > CanTransition ( ) ; <nl> - } <nl> - if ( object - > IsCell ( ) ) { <nl> - object = Cell : : cast ( object ) - > value ( ) ; <nl> - } else if ( object - > IsPropertyCell ( ) ) { <nl> - object = PropertyCell : : cast ( object ) - > value ( ) ; <nl> - } <nl> - if ( object - > IsJSReceiver ( ) | | object - > IsContext ( ) ) { <nl> - return true ; <nl> - } <nl> - return false ; <nl> - } <nl> - <nl> - <nl> - int AbstractCode : : instruction_size ( ) { <nl> - if ( IsCode ( ) ) { <nl> - return GetCode ( ) - > instruction_size ( ) ; <nl> - } else { <nl> - return GetBytecodeArray ( ) - > length ( ) ; <nl> - } <nl> - } <nl> - <nl> - ByteArray * AbstractCode : : source_position_table ( ) { <nl> - if ( IsCode ( ) ) { <nl> - return GetCode ( ) - > SourcePositionTable ( ) ; <nl> - } else { <nl> - return GetBytecodeArray ( ) - > SourcePositionTable ( ) ; <nl> - } <nl> - } <nl> - <nl> - void AbstractCode : : set_source_position_table ( ByteArray * source_position_table ) { <nl> - if ( IsCode ( ) ) { <nl> - GetCode ( ) - > set_source_position_table ( source_position_table ) ; <nl> - } else { <nl> - GetBytecodeArray ( ) - > set_source_position_table ( source_position_table ) ; <nl> - } <nl> - } <nl> - <nl> - Object * AbstractCode : : stack_frame_cache ( ) { <nl> - Object * maybe_table ; <nl> - if ( IsCode ( ) ) { <nl> - maybe_table = GetCode ( ) - > source_position_table ( ) ; <nl> - } else { <nl> - maybe_table = GetBytecodeArray ( ) - > source_position_table ( ) ; <nl> - } <nl> - if ( maybe_table - > IsSourcePositionTableWithFrameCache ( ) ) { <nl> - return SourcePositionTableWithFrameCache : : cast ( maybe_table ) <nl> - - > stack_frame_cache ( ) ; <nl> - } <nl> - return Smi : : kZero ; <nl> - } <nl> - <nl> - int AbstractCode : : SizeIncludingMetadata ( ) { <nl> - if ( IsCode ( ) ) { <nl> - return GetCode ( ) - > SizeIncludingMetadata ( ) ; <nl> - } else { <nl> - return GetBytecodeArray ( ) - > SizeIncludingMetadata ( ) ; <nl> - } <nl> - } <nl> - int AbstractCode : : ExecutableSize ( ) { <nl> - if ( IsCode ( ) ) { <nl> - return GetCode ( ) - > ExecutableSize ( ) ; <nl> - } else { <nl> - return GetBytecodeArray ( ) - > BytecodeArraySize ( ) ; <nl> - } <nl> - } <nl> - <nl> - Address AbstractCode : : instruction_start ( ) { <nl> - if ( IsCode ( ) ) { <nl> - return GetCode ( ) - > instruction_start ( ) ; <nl> - } else { <nl> - return GetBytecodeArray ( ) - > GetFirstBytecodeAddress ( ) ; <nl> - } <nl> - } <nl> - <nl> - Address AbstractCode : : instruction_end ( ) { <nl> - if ( IsCode ( ) ) { <nl> - return GetCode ( ) - > instruction_end ( ) ; <nl> - } else { <nl> - return GetBytecodeArray ( ) - > GetFirstBytecodeAddress ( ) + <nl> - GetBytecodeArray ( ) - > length ( ) ; <nl> - } <nl> - } <nl> - <nl> - bool AbstractCode : : contains ( byte * inner_pointer ) { <nl> - return ( address ( ) < = inner_pointer ) & & ( inner_pointer < = address ( ) + Size ( ) ) ; <nl> - } <nl> - <nl> - AbstractCode : : Kind AbstractCode : : kind ( ) { <nl> - if ( IsCode ( ) ) { <nl> - return static_cast < AbstractCode : : Kind > ( GetCode ( ) - > kind ( ) ) ; <nl> - } else { <nl> - return INTERPRETED_FUNCTION ; <nl> - } <nl> - } <nl> - <nl> - Code * AbstractCode : : GetCode ( ) { return Code : : cast ( this ) ; } <nl> - <nl> - BytecodeArray * AbstractCode : : GetBytecodeArray ( ) { <nl> - return BytecodeArray : : cast ( this ) ; <nl> - } <nl> - <nl> Object * Map : : prototype ( ) const { <nl> return READ_FIELD ( this , kPrototypeOffset ) ; <nl> } <nl> SMI_ACCESSORS ( JSMessageObject , start_position , kStartPositionOffset ) <nl> SMI_ACCESSORS ( JSMessageObject , end_position , kEndPositionOffset ) <nl> SMI_ACCESSORS ( JSMessageObject , error_level , kErrorLevelOffset ) <nl> <nl> - INT_ACCESSORS ( Code , instruction_size , kInstructionSizeOffset ) <nl> - INT_ACCESSORS ( Code , constant_pool_offset , kConstantPoolOffset ) <nl> - # define CODE_ACCESSORS ( name , type , offset ) \ <nl> - ACCESSORS_CHECKED2 ( Code , name , type , offset , true , \ <nl> - ! GetHeap ( ) - > InNewSpace ( value ) ) <nl> - CODE_ACCESSORS ( relocation_info , ByteArray , kRelocationInfoOffset ) <nl> - CODE_ACCESSORS ( handler_table , FixedArray , kHandlerTableOffset ) <nl> - CODE_ACCESSORS ( deoptimization_data , FixedArray , kDeoptimizationDataOffset ) <nl> - CODE_ACCESSORS ( source_position_table , Object , kSourcePositionTableOffset ) <nl> - CODE_ACCESSORS ( trap_handler_index , Smi , kTrapHandlerIndex ) <nl> - CODE_ACCESSORS ( raw_type_feedback_info , Object , kTypeFeedbackInfoOffset ) <nl> - CODE_ACCESSORS ( next_code_link , Object , kNextCodeLinkOffset ) <nl> - # undef CODE_ACCESSORS <nl> - <nl> - void Code : : WipeOutHeader ( ) { <nl> - WRITE_FIELD ( this , kRelocationInfoOffset , nullptr ) ; <nl> - WRITE_FIELD ( this , kHandlerTableOffset , nullptr ) ; <nl> - WRITE_FIELD ( this , kDeoptimizationDataOffset , nullptr ) ; <nl> - WRITE_FIELD ( this , kSourcePositionTableOffset , nullptr ) ; <nl> - / / Do not wipe out major / minor keys on a code stub or IC <nl> - if ( ! READ_FIELD ( this , kTypeFeedbackInfoOffset ) - > IsSmi ( ) ) { <nl> - WRITE_FIELD ( this , kTypeFeedbackInfoOffset , nullptr ) ; <nl> - } <nl> - WRITE_FIELD ( this , kNextCodeLinkOffset , nullptr ) ; <nl> - } <nl> - <nl> - void Code : : clear_padding ( ) { <nl> - memset ( address ( ) + kHeaderPaddingStart , 0 , kHeaderSize - kHeaderPaddingStart ) ; <nl> - Address data_end = <nl> - has_unwinding_info ( ) ? unwinding_info_end ( ) : instruction_end ( ) ; <nl> - memset ( data_end , 0 , CodeSize ( ) - ( data_end - address ( ) ) ) ; <nl> - } <nl> - <nl> - ByteArray * Code : : SourcePositionTable ( ) const { <nl> - Object * maybe_table = source_position_table ( ) ; <nl> - if ( maybe_table - > IsByteArray ( ) ) return ByteArray : : cast ( maybe_table ) ; <nl> - DCHECK ( maybe_table - > IsSourcePositionTableWithFrameCache ( ) ) ; <nl> - return SourcePositionTableWithFrameCache : : cast ( maybe_table ) <nl> - - > source_position_table ( ) ; <nl> - } <nl> - <nl> - uint32_t Code : : stub_key ( ) const { <nl> - DCHECK ( is_stub ( ) ) ; <nl> - Smi * smi_key = Smi : : cast ( raw_type_feedback_info ( ) ) ; <nl> - return static_cast < uint32_t > ( smi_key - > value ( ) ) ; <nl> - } <nl> - <nl> - <nl> - void Code : : set_stub_key ( uint32_t key ) { <nl> - DCHECK ( is_stub ( ) ) ; <nl> - set_raw_type_feedback_info ( Smi : : FromInt ( key ) ) ; <nl> - } <nl> - <nl> - byte * Code : : instruction_start ( ) const { <nl> - return const_cast < byte * > ( FIELD_ADDR_CONST ( this , kHeaderSize ) ) ; <nl> - } <nl> - <nl> - byte * Code : : instruction_end ( ) const { <nl> - return instruction_start ( ) + instruction_size ( ) ; <nl> - } <nl> - <nl> - int Code : : GetUnwindingInfoSizeOffset ( ) const { <nl> - DCHECK ( has_unwinding_info ( ) ) ; <nl> - return RoundUp ( kHeaderSize + instruction_size ( ) , kInt64Size ) ; <nl> - } <nl> - <nl> - int Code : : unwinding_info_size ( ) const { <nl> - DCHECK ( has_unwinding_info ( ) ) ; <nl> - return static_cast < int > ( <nl> - READ_UINT64_FIELD ( this , GetUnwindingInfoSizeOffset ( ) ) ) ; <nl> - } <nl> - <nl> - void Code : : set_unwinding_info_size ( int value ) { <nl> - DCHECK ( has_unwinding_info ( ) ) ; <nl> - WRITE_UINT64_FIELD ( this , GetUnwindingInfoSizeOffset ( ) , value ) ; <nl> - } <nl> - <nl> - byte * Code : : unwinding_info_start ( ) const { <nl> - DCHECK ( has_unwinding_info ( ) ) ; <nl> - return const_cast < byte * > ( <nl> - FIELD_ADDR_CONST ( this , GetUnwindingInfoSizeOffset ( ) ) ) + <nl> - kInt64Size ; <nl> - } <nl> - <nl> - byte * Code : : unwinding_info_end ( ) const { <nl> - DCHECK ( has_unwinding_info ( ) ) ; <nl> - return unwinding_info_start ( ) + unwinding_info_size ( ) ; <nl> - } <nl> - <nl> - int Code : : body_size ( ) const { <nl> - int unpadded_body_size = <nl> - has_unwinding_info ( ) <nl> - ? static_cast < int > ( unwinding_info_end ( ) - instruction_start ( ) ) <nl> - : instruction_size ( ) ; <nl> - return RoundUp ( unpadded_body_size , kObjectAlignment ) ; <nl> - } <nl> - <nl> - int Code : : SizeIncludingMetadata ( ) const { <nl> - int size = CodeSize ( ) ; <nl> - size + = relocation_info ( ) - > Size ( ) ; <nl> - size + = deoptimization_data ( ) - > Size ( ) ; <nl> - size + = handler_table ( ) - > Size ( ) ; <nl> - return size ; <nl> - } <nl> - <nl> - ByteArray * Code : : unchecked_relocation_info ( ) const { <nl> - return reinterpret_cast < ByteArray * > ( READ_FIELD ( this , kRelocationInfoOffset ) ) ; <nl> - } <nl> - <nl> - byte * Code : : relocation_start ( ) const { <nl> - return unchecked_relocation_info ( ) - > GetDataStartAddress ( ) ; <nl> - } <nl> - <nl> - int Code : : relocation_size ( ) const { <nl> - return unchecked_relocation_info ( ) - > length ( ) ; <nl> - } <nl> - <nl> - byte * Code : : entry ( ) const { return instruction_start ( ) ; } <nl> - <nl> - bool Code : : contains ( byte * inner_pointer ) { <nl> - return ( address ( ) < = inner_pointer ) & & ( inner_pointer < = address ( ) + Size ( ) ) ; <nl> - } <nl> - <nl> - int Code : : ExecutableSize ( ) const { <nl> - / / Check that the assumptions about the layout of the code object holds . <nl> - DCHECK_EQ ( static_cast < int > ( instruction_start ( ) - address ( ) ) , <nl> - Code : : kHeaderSize ) ; <nl> - return instruction_size ( ) + Code : : kHeaderSize ; <nl> - } <nl> - <nl> - int Code : : CodeSize ( ) const { return SizeFor ( body_size ( ) ) ; } <nl> <nl> ACCESSORS ( JSArray , length , Object , kLengthOffset ) <nl> <nl> mmm a / src / objects . cc <nl> ppp b / src / objects . cc <nl> <nl> # include " src / map - updater . h " <nl> # include " src / messages . h " <nl> # include " src / objects - body - descriptors - inl . h " <nl> + # include " src / objects / code - inl . h " <nl> # include " src / objects / compilation - cache - inl . h " <nl> # include " src / objects / debug - objects - inl . h " <nl> # include " src / objects / frame - array - inl . h " <nl> mmm a / src / objects . h <nl> ppp b / src / objects . h <nl> class AccessorPair ; <nl> class AllocationSite ; <nl> class Cell ; <nl> class ConsString ; <nl> + class DependentCode ; <nl> class ElementsAccessor ; <nl> class EnumCache ; <nl> class FixedArrayBase ; <nl> template < SearchMode search_mode , typename T > <nl> inline int Search ( T * array , Name * name , int valid_entries = 0 , <nl> int * out_insertion_index = NULL ) ; <nl> <nl> - / / HandlerTable is a fixed array containing entries for exception handlers in <nl> - / / the code object it is associated with . The tables comes in two flavors : <nl> - / / 1 ) Based on ranges : Used for unoptimized code . Contains one entry per <nl> - / / exception handler and a range representing the try - block covered by that <nl> - / / handler . Layout looks as follows : <nl> - / / [ range - start , range - end , handler - offset , handler - data ] <nl> - / / 2 ) Based on return addresses : Used for turbofanned code . Contains one entry <nl> - / / per call - site that could throw an exception . Layout looks as follows : <nl> - / / [ return - address - offset , handler - offset ] <nl> - class HandlerTable : public FixedArray { <nl> - public : <nl> - / / Conservative prediction whether a given handler will locally catch an <nl> - / / exception or cause a re - throw to outside the code boundary . Since this is <nl> - / / undecidable it is merely an approximation ( e . g . useful for debugger ) . <nl> - enum CatchPrediction { <nl> - UNCAUGHT , / / The handler will ( likely ) rethrow the exception . <nl> - CAUGHT , / / The exception will be caught by the handler . <nl> - PROMISE , / / The exception will be caught and cause a promise rejection . <nl> - DESUGARING , / / The exception will be caught , but both the exception and the <nl> - / / catching are part of a desugaring and should therefore not <nl> - / / be visible to the user ( we won ' t notify the debugger of such <nl> - / / exceptions ) . <nl> - ASYNC_AWAIT , / / The exception will be caught and cause a promise rejection <nl> - / / in the desugaring of an async function , so special <nl> - / / async / await handling in the debugger can take place . <nl> - } ; <nl> - <nl> - / / Getters for handler table based on ranges . <nl> - inline int GetRangeStart ( int index ) const ; <nl> - inline int GetRangeEnd ( int index ) const ; <nl> - inline int GetRangeHandler ( int index ) const ; <nl> - inline int GetRangeData ( int index ) const ; <nl> - <nl> - / / Setters for handler table based on ranges . <nl> - inline void SetRangeStart ( int index , int value ) ; <nl> - inline void SetRangeEnd ( int index , int value ) ; <nl> - inline void SetRangeHandler ( int index , int offset , CatchPrediction pred ) ; <nl> - inline void SetRangeData ( int index , int value ) ; <nl> - <nl> - / / Setters for handler table based on return addresses . <nl> - inline void SetReturnOffset ( int index , int value ) ; <nl> - inline void SetReturnHandler ( int index , int offset ) ; <nl> - <nl> - / / Lookup handler in a table based on ranges . The { pc_offset } is an offset to <nl> - / / the start of the potentially throwing instruction ( using return addresses <nl> - / / for this value would be invalid ) . <nl> - int LookupRange ( int pc_offset , int * data , CatchPrediction * prediction ) ; <nl> - <nl> - / / Lookup handler in a table based on return addresses . <nl> - int LookupReturn ( int pc_offset ) ; <nl> - <nl> - / / Returns the number of entries in the table . <nl> - inline int NumberOfRangeEntries ( ) const ; <nl> - <nl> - / / Returns the required length of the underlying fixed array . <nl> - static int LengthForRange ( int entries ) { return entries * kRangeEntrySize ; } <nl> - static int LengthForReturn ( int entries ) { return entries * kReturnEntrySize ; } <nl> - <nl> - DECL_CAST ( HandlerTable ) <nl> - <nl> - # ifdef ENABLE_DISASSEMBLER <nl> - void HandlerTableRangePrint ( std : : ostream & os ) ; / / NOLINT <nl> - void HandlerTableReturnPrint ( std : : ostream & os ) ; / / NOLINT <nl> - # endif <nl> - <nl> - private : <nl> - / / Layout description for handler table based on ranges . <nl> - static const int kRangeStartIndex = 0 ; <nl> - static const int kRangeEndIndex = 1 ; <nl> - static const int kRangeHandlerIndex = 2 ; <nl> - static const int kRangeDataIndex = 3 ; <nl> - static const int kRangeEntrySize = 4 ; <nl> - <nl> - / / Layout description for handler table based on return addresses . <nl> - static const int kReturnOffsetIndex = 0 ; <nl> - static const int kReturnHandlerIndex = 1 ; <nl> - static const int kReturnEntrySize = 2 ; <nl> - <nl> - / / Encoding of the { handler } field . <nl> - class HandlerPredictionField : public BitField < CatchPrediction , 0 , 3 > { } ; <nl> - class HandlerOffsetField : public BitField < int , 3 , 29 > { } ; <nl> - } ; <nl> - <nl> / / ByteArray represents fixed sized byte arrays . Used for the relocation info <nl> / / that is attached to code objects . <nl> class ByteArray : public FixedArrayBase { <nl> class PodArray : public ByteArray { <nl> DISALLOW_IMPLICIT_CONSTRUCTORS ( PodArray < T > ) ; <nl> } ; <nl> <nl> - / / BytecodeArray represents a sequence of interpreter bytecodes . <nl> - class BytecodeArray : public FixedArrayBase { <nl> - public : <nl> - enum Age { <nl> - kNoAgeBytecodeAge = 0 , <nl> - kQuadragenarianBytecodeAge , <nl> - kQuinquagenarianBytecodeAge , <nl> - kSexagenarianBytecodeAge , <nl> - kSeptuagenarianBytecodeAge , <nl> - kOctogenarianBytecodeAge , <nl> - kAfterLastBytecodeAge , <nl> - kFirstBytecodeAge = kNoAgeBytecodeAge , <nl> - kLastBytecodeAge = kAfterLastBytecodeAge - 1 , <nl> - kBytecodeAgeCount = kAfterLastBytecodeAge - kFirstBytecodeAge - 1 , <nl> - kIsOldBytecodeAge = kSexagenarianBytecodeAge <nl> - } ; <nl> - <nl> - static int SizeFor ( int length ) { <nl> - return OBJECT_POINTER_ALIGN ( kHeaderSize + length ) ; <nl> - } <nl> - <nl> - / / Setter and getter <nl> - inline byte get ( int index ) ; <nl> - inline void set ( int index , byte value ) ; <nl> - <nl> - / / Returns data start address . <nl> - inline Address GetFirstBytecodeAddress ( ) ; <nl> - <nl> - / / Accessors for frame size . <nl> - inline int frame_size ( ) const ; <nl> - inline void set_frame_size ( int frame_size ) ; <nl> - <nl> - / / Accessor for register count ( derived from frame_size ) . <nl> - inline int register_count ( ) const ; <nl> - <nl> - / / Accessors for parameter count ( including implicit ' this ' receiver ) . <nl> - inline int parameter_count ( ) const ; <nl> - inline void set_parameter_count ( int number_of_parameters ) ; <nl> - <nl> - / / Register used to pass the incoming new . target or generator object from the <nl> - / / fucntion call . <nl> - inline interpreter : : Register incoming_new_target_or_generator_register ( ) <nl> - const ; <nl> - inline void set_incoming_new_target_or_generator_register ( <nl> - interpreter : : Register incoming_new_target_or_generator_register ) ; <nl> - <nl> - / / Accessors for profiling count . <nl> - inline int interrupt_budget ( ) const ; <nl> - inline void set_interrupt_budget ( int interrupt_budget ) ; <nl> - <nl> - / / Accessors for OSR loop nesting level . <nl> - inline int osr_loop_nesting_level ( ) const ; <nl> - inline void set_osr_loop_nesting_level ( int depth ) ; <nl> - <nl> - / / Accessors for bytecode ' s code age . <nl> - inline Age bytecode_age ( ) const ; <nl> - inline void set_bytecode_age ( Age age ) ; <nl> - <nl> - / / Accessors for the constant pool . <nl> - DECL_ACCESSORS ( constant_pool , FixedArray ) <nl> - <nl> - / / Accessors for handler table containing offsets of exception handlers . <nl> - DECL_ACCESSORS ( handler_table , FixedArray ) <nl> - <nl> - / / Accessors for source position table containing mappings between byte code <nl> - / / offset and source position or SourcePositionTableWithFrameCache . <nl> - DECL_ACCESSORS ( source_position_table , Object ) <nl> - <nl> - inline ByteArray * SourcePositionTable ( ) ; <nl> - <nl> - DECL_CAST ( BytecodeArray ) <nl> - <nl> - / / Dispatched behavior . <nl> - inline int BytecodeArraySize ( ) ; <nl> - <nl> - inline int instruction_size ( ) ; <nl> - <nl> - / / Returns the size of bytecode and its metadata . This includes the size of <nl> - / / bytecode , constant pool , source position table , and handler table . <nl> - inline int SizeIncludingMetadata ( ) ; <nl> - <nl> - int SourcePosition ( int offset ) ; <nl> - int SourceStatementPosition ( int offset ) ; <nl> - <nl> - DECL_PRINTER ( BytecodeArray ) <nl> - DECL_VERIFIER ( BytecodeArray ) <nl> - <nl> - void Disassemble ( std : : ostream & os ) ; <nl> - <nl> - void CopyBytecodesTo ( BytecodeArray * to ) ; <nl> - <nl> - / / Bytecode aging <nl> - bool IsOld ( ) const ; <nl> - void MakeOlder ( ) ; <nl> - <nl> - / / Clear uninitialized padding space . This ensures that the snapshot content <nl> - / / is deterministic . <nl> - inline void clear_padding ( ) ; <nl> - <nl> - / / Layout description . <nl> - # define BYTECODE_ARRAY_FIELDS ( V ) \ <nl> - / * Pointer fields . * / \ <nl> - V ( kConstantPoolOffset , kPointerSize ) \ <nl> - V ( kHandlerTableOffset , kPointerSize ) \ <nl> - V ( kSourcePositionTableOffset , kPointerSize ) \ <nl> - V ( kFrameSizeOffset , kIntSize ) \ <nl> - V ( kParameterSizeOffset , kIntSize ) \ <nl> - V ( kIncomingNewTargetOrGeneratorRegisterOffset , kIntSize ) \ <nl> - V ( kInterruptBudgetOffset , kIntSize ) \ <nl> - V ( kOSRNestingLevelOffset , kCharSize ) \ <nl> - V ( kBytecodeAgeOffset , kCharSize ) \ <nl> - / * Total size . * / \ <nl> - V ( kHeaderSize , 0 ) <nl> - <nl> - DEFINE_FIELD_OFFSET_CONSTANTS ( FixedArrayBase : : kHeaderSize , <nl> - BYTECODE_ARRAY_FIELDS ) <nl> - # undef BYTECODE_ARRAY_FIELDS <nl> - <nl> - / / Maximal memory consumption for a single BytecodeArray . <nl> - static const int kMaxSize = 512 * MB ; <nl> - / / Maximal length of a single BytecodeArray . <nl> - static const int kMaxLength = kMaxSize - kHeaderSize ; <nl> - <nl> - class BodyDescriptor ; <nl> - / / No weak fields . <nl> - typedef BodyDescriptor BodyDescriptorWeak ; <nl> - <nl> - private : <nl> - DISALLOW_IMPLICIT_CONSTRUCTORS ( BytecodeArray ) ; <nl> - } ; <nl> - <nl> - <nl> / / FreeSpace are fixed - size free memory blocks used by the heap and GC . <nl> / / They look like heap objects ( are heap object tagged and have a map ) so that <nl> / / the heap remains iterable . They have a size and a next pointer . <nl> TYPED_ARRAYS ( FIXED_TYPED_ARRAY_TRAITS ) <nl> <nl> # undef FIXED_TYPED_ARRAY_TRAITS <nl> <nl> - / / DeoptimizationInputData is a fixed array used to hold the deoptimization <nl> - / / data for optimized code . It also contains information about functions that <nl> - / / were inlined . If N different functions were inlined then first N elements of <nl> - / / the literal array will contain these functions . <nl> - / / <nl> - / / It can be empty . <nl> - class DeoptimizationInputData : public FixedArray { <nl> - public : <nl> - / / Layout description . Indices in the array . <nl> - static const int kTranslationByteArrayIndex = 0 ; <nl> - static const int kInlinedFunctionCountIndex = 1 ; <nl> - static const int kLiteralArrayIndex = 2 ; <nl> - static const int kOsrBytecodeOffsetIndex = 3 ; <nl> - static const int kOsrPcOffsetIndex = 4 ; <nl> - static const int kOptimizationIdIndex = 5 ; <nl> - static const int kSharedFunctionInfoIndex = 6 ; <nl> - static const int kWeakCellCacheIndex = 7 ; <nl> - static const int kInliningPositionsIndex = 8 ; <nl> - static const int kFirstDeoptEntryIndex = 9 ; <nl> - <nl> - / / Offsets of deopt entry elements relative to the start of the entry . <nl> - static const int kBytecodeOffsetRawOffset = 0 ; <nl> - static const int kTranslationIndexOffset = 1 ; <nl> - static const int kPcOffset = 2 ; <nl> - static const int kDeoptEntrySize = 3 ; <nl> - <nl> - / / Simple element accessors . <nl> - # define DECL_ELEMENT_ACCESSORS ( name , type ) \ <nl> - inline type * name ( ) ; \ <nl> - inline void Set # # name ( type * value ) ; <nl> - <nl> - DECL_ELEMENT_ACCESSORS ( TranslationByteArray , ByteArray ) <nl> - DECL_ELEMENT_ACCESSORS ( InlinedFunctionCount , Smi ) <nl> - DECL_ELEMENT_ACCESSORS ( LiteralArray , FixedArray ) <nl> - DECL_ELEMENT_ACCESSORS ( OsrBytecodeOffset , Smi ) <nl> - DECL_ELEMENT_ACCESSORS ( OsrPcOffset , Smi ) <nl> - DECL_ELEMENT_ACCESSORS ( OptimizationId , Smi ) <nl> - DECL_ELEMENT_ACCESSORS ( SharedFunctionInfo , Object ) <nl> - DECL_ELEMENT_ACCESSORS ( WeakCellCache , Object ) <nl> - DECL_ELEMENT_ACCESSORS ( InliningPositions , PodArray < InliningPosition > ) <nl> - <nl> - # undef DECL_ELEMENT_ACCESSORS <nl> - <nl> - / / Accessors for elements of the ith deoptimization entry . <nl> - # define DECL_ENTRY_ACCESSORS ( name , type ) \ <nl> - inline type * name ( int i ) ; \ <nl> - inline void Set # # name ( int i , type * value ) ; <nl> - <nl> - DECL_ENTRY_ACCESSORS ( BytecodeOffsetRaw , Smi ) <nl> - DECL_ENTRY_ACCESSORS ( TranslationIndex , Smi ) <nl> - DECL_ENTRY_ACCESSORS ( Pc , Smi ) <nl> - <nl> - # undef DECL_ENTRY_ACCESSORS <nl> - <nl> - inline BailoutId BytecodeOffset ( int i ) ; <nl> - <nl> - inline void SetBytecodeOffset ( int i , BailoutId value ) ; <nl> - <nl> - inline int DeoptCount ( ) ; <nl> - <nl> - static const int kNotInlinedIndex = - 1 ; <nl> - <nl> - / / Returns the inlined function at the given position in LiteralArray , or the <nl> - / / outer function if index = = kNotInlinedIndex . <nl> - class SharedFunctionInfo * GetInlinedFunction ( int index ) ; <nl> - <nl> - / / Allocates a DeoptimizationInputData . <nl> - static Handle < DeoptimizationInputData > New ( Isolate * isolate , <nl> - int deopt_entry_count , <nl> - PretenureFlag pretenure ) ; <nl> - <nl> - DECL_CAST ( DeoptimizationInputData ) <nl> - <nl> - # ifdef ENABLE_DISASSEMBLER <nl> - void DeoptimizationInputDataPrint ( std : : ostream & os ) ; / / NOLINT <nl> - # endif <nl> - <nl> - private : <nl> - static int IndexForEntry ( int i ) { <nl> - return kFirstDeoptEntryIndex + ( i * kDeoptEntrySize ) ; <nl> - } <nl> - <nl> - <nl> - static int LengthFor ( int entry_count ) { return IndexForEntry ( entry_count ) ; } <nl> - } ; <nl> - <nl> class TemplateList : public FixedArray { <nl> public : <nl> static Handle < TemplateList > New ( Isolate * isolate , int size ) ; <nl> class TemplateList : public FixedArray { <nl> DISALLOW_IMPLICIT_CONSTRUCTORS ( TemplateList ) ; <nl> } ; <nl> <nl> - / / Code describes objects with on - the - fly generated machine code . <nl> - class Code : public HeapObject { <nl> - public : <nl> - / / Opaque data type for encapsulating code flags like kind , inline <nl> - / / cache state , and arguments count . <nl> - typedef uint32_t Flags ; <nl> - <nl> - # define CODE_KIND_LIST ( V ) \ <nl> - V ( OPTIMIZED_FUNCTION ) \ <nl> - V ( BYTECODE_HANDLER ) \ <nl> - V ( STUB ) \ <nl> - V ( BUILTIN ) \ <nl> - V ( REGEXP ) \ <nl> - V ( WASM_FUNCTION ) \ <nl> - V ( WASM_TO_JS_FUNCTION ) \ <nl> - V ( JS_TO_WASM_FUNCTION ) \ <nl> - V ( WASM_INTERPRETER_ENTRY ) \ <nl> - V ( C_WASM_ENTRY ) <nl> - <nl> - enum Kind { <nl> - # define DEFINE_CODE_KIND_ENUM ( name ) name , <nl> - CODE_KIND_LIST ( DEFINE_CODE_KIND_ENUM ) <nl> - # undef DEFINE_CODE_KIND_ENUM <nl> - NUMBER_OF_KINDS <nl> - } ; <nl> - <nl> - static const char * Kind2String ( Kind kind ) ; <nl> - <nl> - # if defined ( OBJECT_PRINT ) | | defined ( ENABLE_DISASSEMBLER ) <nl> - / / Printing <nl> - static const char * ICState2String ( InlineCacheState state ) ; <nl> - # endif / / defined ( OBJECT_PRINT ) | | defined ( ENABLE_DISASSEMBLER ) <nl> - <nl> - # ifdef ENABLE_DISASSEMBLER <nl> - void Disassemble ( const char * name , std : : ostream & os ) ; / / NOLINT <nl> - # endif / / ENABLE_DISASSEMBLER <nl> - <nl> - / / [ instruction_size ] : Size of the native instructions <nl> - inline int instruction_size ( ) const ; <nl> - inline void set_instruction_size ( int value ) ; <nl> - <nl> - / / [ relocation_info ] : Code relocation information <nl> - DECL_ACCESSORS ( relocation_info , ByteArray ) <nl> - void InvalidateRelocation ( ) ; <nl> - void InvalidateEmbeddedObjects ( ) ; <nl> - <nl> - / / [ handler_table ] : Fixed array containing offsets of exception handlers . <nl> - DECL_ACCESSORS ( handler_table , FixedArray ) <nl> - <nl> - / / [ deoptimization_data ] : Array containing data for deopt . <nl> - DECL_ACCESSORS ( deoptimization_data , FixedArray ) <nl> - <nl> - / / [ source_position_table ] : ByteArray for the source positions table or <nl> - / / SourcePositionTableWithFrameCache . <nl> - DECL_ACCESSORS ( source_position_table , Object ) <nl> - <nl> - inline ByteArray * SourcePositionTable ( ) const ; <nl> - <nl> - / / [ trap_handler_index ] : An index into the trap handler ' s master list of code <nl> - / / objects . <nl> - DECL_ACCESSORS ( trap_handler_index , Smi ) <nl> - <nl> - / / [ raw_type_feedback_info ] : This field stores various things , depending on <nl> - / / the kind of the code object . <nl> - / / STUB and ICs = > major / minor key as Smi . <nl> - / / TODO ( mvstanton ) : rename raw_type_feedback_info to stub_key , since the <nl> - / / field is no longer overloaded . <nl> - DECL_ACCESSORS ( raw_type_feedback_info , Object ) <nl> - inline uint32_t stub_key ( ) const ; <nl> - inline void set_stub_key ( uint32_t key ) ; <nl> - <nl> - / / [ next_code_link ] : Link for lists of optimized or deoptimized code . <nl> - / / Note that storage for this field is overlapped with typefeedback_info . <nl> - DECL_ACCESSORS ( next_code_link , Object ) <nl> - <nl> - / / [ constant_pool offset ] : Offset of the constant pool . <nl> - / / Valid for FLAG_enable_embedded_constant_pool only <nl> - inline int constant_pool_offset ( ) const ; <nl> - inline void set_constant_pool_offset ( int offset ) ; <nl> - <nl> - / / Unchecked accessors to be used during GC . <nl> - inline ByteArray * unchecked_relocation_info ( ) const ; <nl> - <nl> - inline int relocation_size ( ) const ; <nl> - <nl> - / / [ kind ] : Access to specific code kind . <nl> - inline Kind kind ( ) const ; <nl> - inline void set_kind ( Kind kind ) ; <nl> - <nl> - inline bool is_stub ( ) const ; <nl> - inline bool is_optimized_code ( ) const ; <nl> - inline bool is_wasm_code ( ) const ; <nl> - <nl> - inline void set_raw_kind_specific_flags1 ( int value ) ; <nl> - inline void set_raw_kind_specific_flags2 ( int value ) ; <nl> - <nl> - / / Testers for interpreter builtins . <nl> - inline bool is_interpreter_trampoline_builtin ( ) const ; <nl> - <nl> - / / Tells whether the code checks the optimization marker in the function ' s <nl> - / / feedback vector . <nl> - inline bool checks_optimization_marker ( ) const ; <nl> - <nl> - / / [ has_tagged_params ] : For compiled code or builtins : Tells whether the <nl> - / / outgoing parameters of this code are tagged pointers . True for other kinds . <nl> - inline bool has_tagged_params ( ) const ; <nl> - inline void set_has_tagged_params ( bool value ) ; <nl> - <nl> - / / [ is_turbofanned ] : For kind STUB or OPTIMIZED_FUNCTION , tells whether the <nl> - / / code object was generated by the TurboFan optimizing compiler . <nl> - inline bool is_turbofanned ( ) const ; <nl> - inline void set_is_turbofanned ( bool value ) ; <nl> - <nl> - / / [ can_have_weak_objects ] : For kind OPTIMIZED_FUNCTION , tells whether the <nl> - / / embedded objects in code should be treated weakly . <nl> - inline bool can_have_weak_objects ( ) const ; <nl> - inline void set_can_have_weak_objects ( bool value ) ; <nl> - <nl> - / / [ is_construct_stub ] : For kind BUILTIN , tells whether the code object <nl> - / / represents a hand - written construct stub <nl> - / / ( e . g . , NumberConstructor_ConstructStub ) . <nl> - inline bool is_construct_stub ( ) const ; <nl> - inline void set_is_construct_stub ( bool value ) ; <nl> - <nl> - / / [ builtin_index ] : For builtins , tells which builtin index the code object <nl> - / / has . The builtin index is a non - negative integer for builtins , and - 1 <nl> - / / otherwise . <nl> - inline int builtin_index ( ) const ; <nl> - inline void set_builtin_index ( int id ) ; <nl> - inline bool is_builtin ( ) const ; <nl> - <nl> - / / [ stack_slots ] : For kind OPTIMIZED_FUNCTION , the number of stack slots <nl> - / / reserved in the code prologue . <nl> - inline unsigned stack_slots ( ) const ; <nl> - inline void set_stack_slots ( unsigned slots ) ; <nl> - <nl> - / / [ safepoint_table_start ] : For kind OPTIMIZED_FUNCTION , the offset in <nl> - / / the instruction stream where the safepoint table starts . <nl> - inline unsigned safepoint_table_offset ( ) const ; <nl> - inline void set_safepoint_table_offset ( unsigned offset ) ; <nl> - <nl> - / / [ marked_for_deoptimization ] : For kind OPTIMIZED_FUNCTION tells whether <nl> - / / the code is going to be deoptimized because of dead embedded maps . <nl> - inline bool marked_for_deoptimization ( ) const ; <nl> - inline void set_marked_for_deoptimization ( bool flag ) ; <nl> - <nl> - / / [ deopt_already_counted ] : For kind OPTIMIZED_FUNCTION tells whether <nl> - / / the code was already deoptimized . <nl> - inline bool deopt_already_counted ( ) const ; <nl> - inline void set_deopt_already_counted ( bool flag ) ; <nl> - <nl> - / / [ is_promise_rejection ] : For kind BUILTIN tells whether the <nl> - / / exception thrown by the code will lead to promise rejection or <nl> - / / uncaught if both this and is_exception_caught is set . <nl> - / / Use GetBuiltinCatchPrediction to access this . <nl> - inline void set_is_promise_rejection ( bool flag ) ; <nl> - <nl> - / / [ is_exception_caught ] : For kind BUILTIN tells whether the <nl> - / / exception thrown by the code will be caught internally or <nl> - / / uncaught if both this and is_promise_rejection is set . <nl> - / / Use GetBuiltinCatchPrediction to access this . <nl> - inline void set_is_exception_caught ( bool flag ) ; <nl> - <nl> - / / [ constant_pool ] : The constant pool for this function . <nl> - inline Address constant_pool ( ) ; <nl> - <nl> - / / Get the safepoint entry for the given pc . <nl> - SafepointEntry GetSafepointEntry ( Address pc ) ; <nl> - <nl> - / / The entire code object including its header is copied verbatim to the <nl> - / / snapshot so that it can be written in one , fast , memcpy during <nl> - / / deserialization . The deserializer will overwrite some pointers , rather <nl> - / / like a runtime linker , but the random allocation addresses used in the <nl> - / / mksnapshot process would still be present in the unlinked snapshot data , <nl> - / / which would make snapshot production non - reproducible . This method wipes <nl> - / / out the to - be - overwritten header data for reproducible snapshots . <nl> - inline void WipeOutHeader ( ) ; <nl> - <nl> - / / Clear uninitialized padding space . This ensures that the snapshot content <nl> - / / is deterministic . <nl> - inline void clear_padding ( ) ; <nl> - / / Initialize the flags field . Similar to clear_padding above this ensure that <nl> - / / the snapshot content is deterministic . <nl> - inline void initialize_flags ( Kind kind ) ; <nl> - <nl> - / / Convert a target address into a code object . <nl> - static inline Code * GetCodeFromTargetAddress ( Address address ) ; <nl> - <nl> - / / Convert an entry address into an object . <nl> - static inline Object * GetObjectFromEntryAddress ( Address location_of_address ) ; <nl> - <nl> - / / Convert a code entry into an object . <nl> - static inline Object * GetObjectFromCodeEntry ( Address code_entry ) ; <nl> - <nl> - / / Returns the address of the first instruction . <nl> - inline byte * instruction_start ( ) const ; <nl> - <nl> - / / Returns the address right after the last instruction . <nl> - inline byte * instruction_end ( ) const ; <nl> - <nl> - / / Returns the size of the instructions , padding , relocation and unwinding <nl> - / / information . <nl> - inline int body_size ( ) const ; <nl> - <nl> - / / Returns the size of code and its metadata . This includes the size of code <nl> - / / relocation information , deoptimization data and handler table . <nl> - inline int SizeIncludingMetadata ( ) const ; <nl> - <nl> - / / Returns the address of the first relocation info ( read backwards ! ) . <nl> - inline byte * relocation_start ( ) const ; <nl> - <nl> - / / [ has_unwinding_info ] : Whether this code object has unwinding information . <nl> - / / If it doesn ' t , unwinding_information_start ( ) will point to invalid data . <nl> - / / <nl> - / / The body of all code objects has the following layout . <nl> - / / <nl> - / / + mmmmmmmmmmmmmmmmmmmmmmmm - - + < - - instruction_start ( ) <nl> - / / | instructions | <nl> - / / | . . . | <nl> - / / + mmmmmmmmmmmmmmmmmmmmmmmm - - + <nl> - / / | relocation info | <nl> - / / | . . . | <nl> - / / + mmmmmmmmmmmmmmmmmmmmmmmm - - + < - - instruction_end ( ) <nl> - / / <nl> - / / If has_unwinding_info ( ) is false , instruction_end ( ) points to the first <nl> - / / memory location after the end of the code object . Otherwise , the body <nl> - / / continues as follows : <nl> - / / <nl> - / / + mmmmmmmmmmmmmmmmmmmmmmmm - - + <nl> - / / | padding to the next | <nl> - / / | 8 - byte aligned address | <nl> - / / + mmmmmmmmmmmmmmmmmmmmmmmm - - + < - - instruction_end ( ) <nl> - / / | [ unwinding_info_size ] | <nl> - / / | as uint64_t | <nl> - / / + mmmmmmmmmmmmmmmmmmmmmmmm - - + < - - unwinding_info_start ( ) <nl> - / / | unwinding info | <nl> - / / | . . . | <nl> - / / + mmmmmmmmmmmmmmmmmmmmmmmm - - + < - - unwinding_info_end ( ) <nl> - / / <nl> - / / and unwinding_info_end ( ) points to the first memory location after the end <nl> - / / of the code object . <nl> - / / <nl> - DECL_BOOLEAN_ACCESSORS ( has_unwinding_info ) <nl> - <nl> - / / [ unwinding_info_size ] : Size of the unwinding information . <nl> - inline int unwinding_info_size ( ) const ; <nl> - inline void set_unwinding_info_size ( int value ) ; <nl> - <nl> - / / Returns the address of the unwinding information , if any . <nl> - inline byte * unwinding_info_start ( ) const ; <nl> - <nl> - / / Returns the address right after the end of the unwinding information . <nl> - inline byte * unwinding_info_end ( ) const ; <nl> - <nl> - / / Code entry point . <nl> - inline byte * entry ( ) const ; <nl> - <nl> - / / Returns true if pc is inside this object ' s instructions . <nl> - inline bool contains ( byte * pc ) ; <nl> - <nl> - / / Relocate the code by delta bytes . Called to signal that this code <nl> - / / object has been moved by delta bytes . <nl> - void Relocate ( intptr_t delta ) ; <nl> - <nl> - / / Migrate code described by desc . <nl> - void CopyFrom ( const CodeDesc & desc ) ; <nl> - <nl> - / / Returns the object size for a given body ( used for allocation ) . <nl> - static int SizeFor ( int body_size ) { <nl> - DCHECK_SIZE_TAG_ALIGNED ( body_size ) ; <nl> - return RoundUp ( kHeaderSize + body_size , kCodeAlignment ) ; <nl> - } <nl> - <nl> - / / Calculate the size of the code object to report for log events . This takes <nl> - / / the layout of the code object into account . <nl> - inline int ExecutableSize ( ) const ; <nl> - <nl> - DECL_CAST ( Code ) <nl> - <nl> - / / Dispatched behavior . <nl> - inline int CodeSize ( ) const ; <nl> - <nl> - DECL_PRINTER ( Code ) <nl> - DECL_VERIFIER ( Code ) <nl> - <nl> - void PrintDeoptLocation ( FILE * out , Address pc ) ; <nl> - bool CanDeoptAt ( Address pc ) ; <nl> - <nl> - inline HandlerTable : : CatchPrediction GetBuiltinCatchPrediction ( ) ; <nl> - # ifdef VERIFY_HEAP <nl> - void VerifyEmbeddedObjectsDependency ( ) ; <nl> - # endif <nl> - <nl> - # ifdef DEBUG <nl> - enum VerifyMode { kNoContextSpecificPointers , kNoContextRetainingPointers } ; <nl> - void VerifyEmbeddedObjects ( VerifyMode mode = kNoContextRetainingPointers ) ; <nl> - # endif / / DEBUG <nl> - <nl> - inline bool CanContainWeakObjects ( ) ; <nl> - <nl> - inline bool IsWeakObject ( Object * object ) ; <nl> - <nl> - static inline bool IsWeakObjectInOptimizedCode ( Object * object ) ; <nl> - <nl> - static Handle < WeakCell > WeakCellFor ( Handle < Code > code ) ; <nl> - WeakCell * CachedWeakCell ( ) ; <nl> - <nl> - / / Return true if the function is inlined in the code . <nl> - bool Inlines ( SharedFunctionInfo * sfi ) ; <nl> - <nl> - class OptimizedCodeIterator { <nl> - public : <nl> - explicit OptimizedCodeIterator ( Isolate * isolate ) ; <nl> - Code * Next ( ) ; <nl> - <nl> - private : <nl> - Context * next_context_ ; <nl> - Code * current_code_ ; <nl> - Isolate * isolate_ ; <nl> - <nl> - DisallowHeapAllocation no_gc ; <nl> - DISALLOW_COPY_AND_ASSIGN ( OptimizedCodeIterator ) <nl> - } ; <nl> - <nl> - static const int kConstantPoolSize = <nl> - FLAG_enable_embedded_constant_pool ? kIntSize : 0 ; <nl> - <nl> - / / Layout description . <nl> - static const int kRelocationInfoOffset = HeapObject : : kHeaderSize ; <nl> - static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize ; <nl> - static const int kDeoptimizationDataOffset = <nl> - kHandlerTableOffset + kPointerSize ; <nl> - static const int kSourcePositionTableOffset = <nl> - kDeoptimizationDataOffset + kPointerSize ; <nl> - / / For FUNCTION kind , we store the type feedback info here . <nl> - static const int kTypeFeedbackInfoOffset = <nl> - kSourcePositionTableOffset + kPointerSize ; <nl> - static const int kNextCodeLinkOffset = kTypeFeedbackInfoOffset + kPointerSize ; <nl> - static const int kInstructionSizeOffset = kNextCodeLinkOffset + kPointerSize ; <nl> - static const int kFlagsOffset = kInstructionSizeOffset + kIntSize ; <nl> - static const int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize ; <nl> - static const int kKindSpecificFlags2Offset = <nl> - kKindSpecificFlags1Offset + kIntSize ; <nl> - static const int kConstantPoolOffset = kKindSpecificFlags2Offset + kIntSize ; <nl> - static const int kBuiltinIndexOffset = <nl> - kConstantPoolOffset + kConstantPoolSize ; <nl> - static const int kTrapHandlerIndex = kBuiltinIndexOffset + kIntSize ; <nl> - static const int kHeaderPaddingStart = kTrapHandlerIndex + kPointerSize ; <nl> - <nl> - / / Add padding to align the instruction start following right after <nl> - / / the Code object header . <nl> - static const int kHeaderSize = <nl> - ( kHeaderPaddingStart + kCodeAlignmentMask ) & ~ kCodeAlignmentMask ; <nl> - <nl> - / / Data or code not directly visited by GC directly starts here . <nl> - / / The serializer needs to copy bytes starting from here verbatim . <nl> - / / Objects embedded into code is visited via reloc info . <nl> - static const int kDataStart = kInstructionSizeOffset ; <nl> - <nl> - inline int GetUnwindingInfoSizeOffset ( ) const ; <nl> - <nl> - class BodyDescriptor ; <nl> - <nl> - / / Flags layout . BitField < type , shift , size > . <nl> - class HasUnwindingInfoField : public BitField < bool , 0 , 1 > { } ; <nl> - class KindField : public BitField < Kind , HasUnwindingInfoField : : kNext , 5 > { } ; <nl> - STATIC_ASSERT ( NUMBER_OF_KINDS < = KindField : : kMax ) ; <nl> - <nl> - / / KindSpecificFlags1 layout ( STUB , BUILTIN and OPTIMIZED_FUNCTION ) <nl> - static const int kStackSlotsFirstBit = 0 ; <nl> - static const int kStackSlotsBitCount = 24 ; <nl> - static const int kMarkedForDeoptimizationBit = <nl> - kStackSlotsFirstBit + kStackSlotsBitCount ; <nl> - static const int kDeoptAlreadyCountedBit = kMarkedForDeoptimizationBit + 1 ; <nl> - static const int kIsTurbofannedBit = kDeoptAlreadyCountedBit + 1 ; <nl> - static const int kCanHaveWeakObjects = kIsTurbofannedBit + 1 ; <nl> - / / Could be moved to overlap previous bits when we need more space . <nl> - static const int kIsConstructStub = kCanHaveWeakObjects + 1 ; <nl> - static const int kIsPromiseRejection = kIsConstructStub + 1 ; <nl> - static const int kIsExceptionCaught = kIsPromiseRejection + 1 ; <nl> - <nl> - STATIC_ASSERT ( kStackSlotsFirstBit + kStackSlotsBitCount < = 32 ) ; <nl> - STATIC_ASSERT ( kIsExceptionCaught + 1 < = 32 ) ; <nl> - <nl> - class StackSlotsField : public BitField < int , <nl> - kStackSlotsFirstBit , kStackSlotsBitCount > { } ; / / NOLINT <nl> - class MarkedForDeoptimizationField <nl> - : public BitField < bool , kMarkedForDeoptimizationBit , 1 > { } ; / / NOLINT <nl> - class DeoptAlreadyCountedField <nl> - : public BitField < bool , kDeoptAlreadyCountedBit , 1 > { } ; / / NOLINT <nl> - class IsTurbofannedField : public BitField < bool , kIsTurbofannedBit , 1 > { <nl> - } ; / / NOLINT <nl> - class CanHaveWeakObjectsField <nl> - : public BitField < bool , kCanHaveWeakObjects , 1 > { } ; / / NOLINT <nl> - class IsConstructStubField : public BitField < bool , kIsConstructStub , 1 > { <nl> - } ; / / NOLINT <nl> - class IsPromiseRejectionField <nl> - : public BitField < bool , kIsPromiseRejection , 1 > { } ; / / NOLINT <nl> - class IsExceptionCaughtField : public BitField < bool , kIsExceptionCaught , 1 > { <nl> - } ; / / NOLINT <nl> - <nl> - / / KindSpecificFlags2 layout ( ALL ) <nl> - static const int kHasTaggedStackBit = 0 ; <nl> - class HasTaggedStackField : public BitField < bool , kHasTaggedStackBit , 1 > { } ; <nl> - <nl> - / / KindSpecificFlags2 layout ( STUB and OPTIMIZED_FUNCTION ) <nl> - static const int kSafepointTableOffsetFirstBit = kHasTaggedStackBit + 1 ; <nl> - static const int kSafepointTableOffsetBitCount = 30 ; <nl> - <nl> - STATIC_ASSERT ( kSafepointTableOffsetFirstBit + <nl> - kSafepointTableOffsetBitCount < = 32 ) ; <nl> - STATIC_ASSERT ( 1 + kSafepointTableOffsetBitCount < = 32 ) ; <nl> - <nl> - class SafepointTableOffsetField : public BitField < int , <nl> - kSafepointTableOffsetFirstBit , <nl> - kSafepointTableOffsetBitCount > { } ; / / NOLINT <nl> - <nl> - static const int kArgumentsBits = 16 ; <nl> - static const int kMaxArguments = ( 1 < < kArgumentsBits ) - 1 ; <nl> - <nl> - private : <nl> - friend class RelocIterator ; <nl> - <nl> - bool is_promise_rejection ( ) const ; <nl> - bool is_exception_caught ( ) const ; <nl> - <nl> - DISALLOW_IMPLICIT_CONSTRUCTORS ( Code ) ; <nl> - } ; <nl> - <nl> - class AbstractCode : public HeapObject { <nl> - public : <nl> - / / All code kinds and INTERPRETED_FUNCTION . <nl> - enum Kind { <nl> - # define DEFINE_CODE_KIND_ENUM ( name ) name , <nl> - CODE_KIND_LIST ( DEFINE_CODE_KIND_ENUM ) <nl> - # undef DEFINE_CODE_KIND_ENUM <nl> - INTERPRETED_FUNCTION , <nl> - NUMBER_OF_KINDS <nl> - } ; <nl> - <nl> - static const char * Kind2String ( Kind kind ) ; <nl> - <nl> - int SourcePosition ( int offset ) ; <nl> - int SourceStatementPosition ( int offset ) ; <nl> - <nl> - / / Returns the address of the first instruction . <nl> - inline Address instruction_start ( ) ; <nl> - <nl> - / / Returns the address right after the last instruction . <nl> - inline Address instruction_end ( ) ; <nl> - <nl> - / / Returns the size of the code instructions . <nl> - inline int instruction_size ( ) ; <nl> - <nl> - / / Return the source position table . <nl> - inline ByteArray * source_position_table ( ) ; <nl> - <nl> - / / Set the source position table . <nl> - inline void set_source_position_table ( ByteArray * source_position_table ) ; <nl> - <nl> - inline Object * stack_frame_cache ( ) ; <nl> - static void SetStackFrameCache ( Handle < AbstractCode > abstract_code , <nl> - Handle < UnseededNumberDictionary > cache ) ; <nl> - void DropStackFrameCache ( ) ; <nl> - <nl> - / / Returns the size of instructions and the metadata . <nl> - inline int SizeIncludingMetadata ( ) ; <nl> - <nl> - / / Returns true if pc is inside this object ' s instructions . <nl> - inline bool contains ( byte * pc ) ; <nl> - <nl> - / / Returns the AbstractCode : : Kind of the code . <nl> - inline Kind kind ( ) ; <nl> - <nl> - / / Calculate the size of the code object to report for log events . This takes <nl> - / / the layout of the code object into account . <nl> - inline int ExecutableSize ( ) ; <nl> - <nl> - DECL_CAST ( AbstractCode ) <nl> - inline Code * GetCode ( ) ; <nl> - inline BytecodeArray * GetBytecodeArray ( ) ; <nl> - <nl> - / / Max loop nesting marker used to postpose OSR . We don ' t take loop <nl> - / / nesting that is deeper than 5 levels into account . <nl> - static const int kMaxLoopNestingMarker = 6 ; <nl> - } ; <nl> - <nl> - / / Dependent code is a singly linked list of fixed arrays . Each array contains <nl> - / / code objects in weak cells for one dependent group . The suffix of the array <nl> - / / can be filled with the undefined value if the number of codes is less than <nl> - / / the length of the array . <nl> - / / <nl> - / / + mmmmmm + mmmmmmmmmmmmmmm - - + mmmmmm - - + mmmmmm - - + mmm - - + mmmmmm - - + mmmmmmmmm - - + mmm - - + <nl> - / / | next | count & group 1 | code 1 | code 2 | . . . | code n | undefined | . . . | <nl> - / / + mmmmmm + mmmmmmmmmmmmmmm - - + mmmmmm - - + mmmmmm - - + mmm - - + mmmmmm - - + mmmmmmmmm - - + mmm - - + <nl> - / / | <nl> - / / V <nl> - / / + mmmmmm + mmmmmmmmmmmmmmm - - + mmmmmm - - + mmmmmm - - + mmm - - + mmmmmm - - + mmmmmmmmm - - + mmm - - + <nl> - / / | next | count & group 2 | code 1 | code 2 | . . . | code m | undefined | . . . | <nl> - / / + mmmmmm + mmmmmmmmmmmmmmm - - + mmmmmm - - + mmmmmm - - + mmm - - + mmmmmm - - + mmmmmmmmm - - + mmm - - + <nl> - / / | <nl> - / / V <nl> - / / empty_fixed_array ( ) <nl> - / / <nl> - / / The list of fixed arrays is ordered by dependency groups . <nl> - <nl> - class DependentCode : public FixedArray { <nl> - public : <nl> - enum DependencyGroup { <nl> - / / Group of code that weakly embed this map and depend on being <nl> - / / deoptimized when the map is garbage collected . <nl> - kWeakCodeGroup , <nl> - / / Group of code that embed a transition to this map , and depend on being <nl> - / / deoptimized when the transition is replaced by a new version . <nl> - kTransitionGroup , <nl> - / / Group of code that omit run - time prototype checks for prototypes <nl> - / / described by this map . The group is deoptimized whenever an object <nl> - / / described by this map changes shape ( and transitions to a new map ) , <nl> - / / possibly invalidating the assumptions embedded in the code . <nl> - kPrototypeCheckGroup , <nl> - / / Group of code that depends on global property values in property cells <nl> - / / not being changed . <nl> - kPropertyCellChangedGroup , <nl> - / / Group of code that omit run - time checks for field ( s ) introduced by <nl> - / / this map , i . e . for the field type . <nl> - kFieldOwnerGroup , <nl> - / / Group of code that omit run - time type checks for initial maps of <nl> - / / constructors . <nl> - kInitialMapChangedGroup , <nl> - / / Group of code that depends on tenuring information in AllocationSites <nl> - / / not being changed . <nl> - kAllocationSiteTenuringChangedGroup , <nl> - / / Group of code that depends on element transition information in <nl> - / / AllocationSites not being changed . <nl> - kAllocationSiteTransitionChangedGroup <nl> - } ; <nl> - <nl> - static const int kGroupCount = kAllocationSiteTransitionChangedGroup + 1 ; <nl> - static const int kNextLinkIndex = 0 ; <nl> - static const int kFlagsIndex = 1 ; <nl> - static const int kCodesStartIndex = 2 ; <nl> - <nl> - bool Contains ( DependencyGroup group , WeakCell * code_cell ) ; <nl> - bool IsEmpty ( DependencyGroup group ) ; <nl> - <nl> - static Handle < DependentCode > InsertCompilationDependencies ( <nl> - Handle < DependentCode > entries , DependencyGroup group , <nl> - Handle < Foreign > info ) ; <nl> - <nl> - static Handle < DependentCode > InsertWeakCode ( Handle < DependentCode > entries , <nl> - DependencyGroup group , <nl> - Handle < WeakCell > code_cell ) ; <nl> - <nl> - void UpdateToFinishedCode ( DependencyGroup group , Foreign * info , <nl> - WeakCell * code_cell ) ; <nl> - <nl> - void RemoveCompilationDependencies ( DependentCode : : DependencyGroup group , <nl> - Foreign * info ) ; <nl> - <nl> - void DeoptimizeDependentCodeGroup ( Isolate * isolate , <nl> - DependentCode : : DependencyGroup group ) ; <nl> - <nl> - bool MarkCodeForDeoptimization ( Isolate * isolate , <nl> - DependentCode : : DependencyGroup group ) ; <nl> - <nl> - / / The following low - level accessors should only be used by this class <nl> - / / and the mark compact collector . <nl> - inline DependentCode * next_link ( ) ; <nl> - inline void set_next_link ( DependentCode * next ) ; <nl> - inline int count ( ) ; <nl> - inline void set_count ( int value ) ; <nl> - inline DependencyGroup group ( ) ; <nl> - inline void set_group ( DependencyGroup group ) ; <nl> - inline Object * object_at ( int i ) ; <nl> - inline void set_object_at ( int i , Object * object ) ; <nl> - inline void clear_at ( int i ) ; <nl> - inline void copy ( int from , int to ) ; <nl> - DECL_CAST ( DependentCode ) <nl> - <nl> - static const char * DependencyGroupName ( DependencyGroup group ) ; <nl> - static void SetMarkedForDeoptimization ( Code * code , DependencyGroup group ) ; <nl> - <nl> - private : <nl> - static Handle < DependentCode > Insert ( Handle < DependentCode > entries , <nl> - DependencyGroup group , <nl> - Handle < Object > object ) ; <nl> - static Handle < DependentCode > New ( DependencyGroup group , Handle < Object > object , <nl> - Handle < DependentCode > next ) ; <nl> - static Handle < DependentCode > EnsureSpace ( Handle < DependentCode > entries ) ; <nl> - / / Compact by removing cleared weak cells and return true if there was <nl> - / / any cleared weak cell . <nl> - bool Compact ( ) ; <nl> - static int Grow ( int number_of_entries ) { <nl> - if ( number_of_entries < 5 ) return number_of_entries + 1 ; <nl> - return number_of_entries * 5 / 4 ; <nl> - } <nl> - inline int flags ( ) ; <nl> - inline void set_flags ( int flags ) ; <nl> - class GroupField : public BitField < int , 0 , 3 > { } ; <nl> - class CountField : public BitField < int , 3 , 27 > { } ; <nl> - STATIC_ASSERT ( kGroupCount < = GroupField : : kMax + 1 ) ; <nl> - } ; <nl> - <nl> class PrototypeInfo ; <nl> <nl> / / An abstract superclass , a marker class really , for simple structure classes . <nl> new file mode 100644 <nl> index 00000000000 . . 386779fd90d <nl> mmm / dev / null <nl> ppp b / src / objects / code - inl . h <nl> <nl> + / / Copyright 2017 the V8 project authors . All rights reserved . <nl> + / / Use of this source code is governed by a BSD - style license that can be <nl> + / / found in the LICENSE file . <nl> + <nl> + # ifndef V8_OBJECTS_CODE_INL_H_ <nl> + # define V8_OBJECTS_CODE_INL_H_ <nl> + <nl> + # include " src / objects / code . h " <nl> + <nl> + # include " src / objects / dictionary . h " <nl> + # include " src / v8memory . h " <nl> + <nl> + / / Has to be the last include ( doesn ' t have include guards ) : <nl> + # include " src / objects / object - macros . h " <nl> + <nl> + namespace v8 { <nl> + namespace internal { <nl> + <nl> + TYPE_CHECKER ( BytecodeArray , BYTECODE_ARRAY_TYPE ) <nl> + TYPE_CHECKER ( Code , CODE_TYPE ) <nl> + <nl> + CAST_ACCESSOR ( AbstractCode ) <nl> + CAST_ACCESSOR ( BytecodeArray ) <nl> + CAST_ACCESSOR ( Code ) <nl> + CAST_ACCESSOR ( DependentCode ) <nl> + CAST_ACCESSOR ( DeoptimizationInputData ) <nl> + CAST_ACCESSOR ( HandlerTable ) <nl> + <nl> + int AbstractCode : : instruction_size ( ) { <nl> + if ( IsCode ( ) ) { <nl> + return GetCode ( ) - > instruction_size ( ) ; <nl> + } else { <nl> + return GetBytecodeArray ( ) - > length ( ) ; <nl> + } <nl> + } <nl> + <nl> + ByteArray * AbstractCode : : source_position_table ( ) { <nl> + if ( IsCode ( ) ) { <nl> + return GetCode ( ) - > SourcePositionTable ( ) ; <nl> + } else { <nl> + return GetBytecodeArray ( ) - > SourcePositionTable ( ) ; <nl> + } <nl> + } <nl> + <nl> + void AbstractCode : : set_source_position_table ( ByteArray * source_position_table ) { <nl> + if ( IsCode ( ) ) { <nl> + GetCode ( ) - > set_source_position_table ( source_position_table ) ; <nl> + } else { <nl> + GetBytecodeArray ( ) - > set_source_position_table ( source_position_table ) ; <nl> + } <nl> + } <nl> + <nl> + Object * AbstractCode : : stack_frame_cache ( ) { <nl> + Object * maybe_table ; <nl> + if ( IsCode ( ) ) { <nl> + maybe_table = GetCode ( ) - > source_position_table ( ) ; <nl> + } else { <nl> + maybe_table = GetBytecodeArray ( ) - > source_position_table ( ) ; <nl> + } <nl> + if ( maybe_table - > IsSourcePositionTableWithFrameCache ( ) ) { <nl> + return SourcePositionTableWithFrameCache : : cast ( maybe_table ) <nl> + - > stack_frame_cache ( ) ; <nl> + } <nl> + return Smi : : kZero ; <nl> + } <nl> + <nl> + int AbstractCode : : SizeIncludingMetadata ( ) { <nl> + if ( IsCode ( ) ) { <nl> + return GetCode ( ) - > SizeIncludingMetadata ( ) ; <nl> + } else { <nl> + return GetBytecodeArray ( ) - > SizeIncludingMetadata ( ) ; <nl> + } <nl> + } <nl> + int AbstractCode : : ExecutableSize ( ) { <nl> + if ( IsCode ( ) ) { <nl> + return GetCode ( ) - > ExecutableSize ( ) ; <nl> + } else { <nl> + return GetBytecodeArray ( ) - > BytecodeArraySize ( ) ; <nl> + } <nl> + } <nl> + <nl> + Address AbstractCode : : instruction_start ( ) { <nl> + if ( IsCode ( ) ) { <nl> + return GetCode ( ) - > instruction_start ( ) ; <nl> + } else { <nl> + return GetBytecodeArray ( ) - > GetFirstBytecodeAddress ( ) ; <nl> + } <nl> + } <nl> + <nl> + Address AbstractCode : : instruction_end ( ) { <nl> + if ( IsCode ( ) ) { <nl> + return GetCode ( ) - > instruction_end ( ) ; <nl> + } else { <nl> + return GetBytecodeArray ( ) - > GetFirstBytecodeAddress ( ) + <nl> + GetBytecodeArray ( ) - > length ( ) ; <nl> + } <nl> + } <nl> + <nl> + bool AbstractCode : : contains ( byte * inner_pointer ) { <nl> + return ( address ( ) < = inner_pointer ) & & ( inner_pointer < = address ( ) + Size ( ) ) ; <nl> + } <nl> + <nl> + AbstractCode : : Kind AbstractCode : : kind ( ) { <nl> + if ( IsCode ( ) ) { <nl> + return static_cast < AbstractCode : : Kind > ( GetCode ( ) - > kind ( ) ) ; <nl> + } else { <nl> + return INTERPRETED_FUNCTION ; <nl> + } <nl> + } <nl> + <nl> + Code * AbstractCode : : GetCode ( ) { return Code : : cast ( this ) ; } <nl> + <nl> + BytecodeArray * AbstractCode : : GetBytecodeArray ( ) { <nl> + return BytecodeArray : : cast ( this ) ; <nl> + } <nl> + <nl> + DependentCode * DependentCode : : next_link ( ) { <nl> + return DependentCode : : cast ( get ( kNextLinkIndex ) ) ; <nl> + } <nl> + <nl> + void DependentCode : : set_next_link ( DependentCode * next ) { <nl> + set ( kNextLinkIndex , next ) ; <nl> + } <nl> + <nl> + int DependentCode : : flags ( ) { return Smi : : ToInt ( get ( kFlagsIndex ) ) ; } <nl> + <nl> + void DependentCode : : set_flags ( int flags ) { <nl> + set ( kFlagsIndex , Smi : : FromInt ( flags ) ) ; <nl> + } <nl> + <nl> + int DependentCode : : count ( ) { return CountField : : decode ( flags ( ) ) ; } <nl> + <nl> + void DependentCode : : set_count ( int value ) { <nl> + set_flags ( CountField : : update ( flags ( ) , value ) ) ; <nl> + } <nl> + <nl> + DependentCode : : DependencyGroup DependentCode : : group ( ) { <nl> + return static_cast < DependencyGroup > ( GroupField : : decode ( flags ( ) ) ) ; <nl> + } <nl> + <nl> + void DependentCode : : set_group ( DependentCode : : DependencyGroup group ) { <nl> + set_flags ( GroupField : : update ( flags ( ) , static_cast < int > ( group ) ) ) ; <nl> + } <nl> + <nl> + void DependentCode : : set_object_at ( int i , Object * object ) { <nl> + set ( kCodesStartIndex + i , object ) ; <nl> + } <nl> + <nl> + Object * DependentCode : : object_at ( int i ) { return get ( kCodesStartIndex + i ) ; } <nl> + <nl> + void DependentCode : : clear_at ( int i ) { set_undefined ( kCodesStartIndex + i ) ; } <nl> + <nl> + void DependentCode : : copy ( int from , int to ) { <nl> + set ( kCodesStartIndex + to , get ( kCodesStartIndex + from ) ) ; <nl> + } <nl> + <nl> + INT_ACCESSORS ( Code , instruction_size , kInstructionSizeOffset ) <nl> + INT_ACCESSORS ( Code , constant_pool_offset , kConstantPoolOffset ) <nl> + # define CODE_ACCESSORS ( name , type , offset ) \ <nl> + ACCESSORS_CHECKED2 ( Code , name , type , offset , true , \ <nl> + ! GetHeap ( ) - > InNewSpace ( value ) ) <nl> + CODE_ACCESSORS ( relocation_info , ByteArray , kRelocationInfoOffset ) <nl> + CODE_ACCESSORS ( handler_table , FixedArray , kHandlerTableOffset ) <nl> + CODE_ACCESSORS ( deoptimization_data , FixedArray , kDeoptimizationDataOffset ) <nl> + CODE_ACCESSORS ( source_position_table , Object , kSourcePositionTableOffset ) <nl> + CODE_ACCESSORS ( trap_handler_index , Smi , kTrapHandlerIndex ) <nl> + CODE_ACCESSORS ( raw_type_feedback_info , Object , kTypeFeedbackInfoOffset ) <nl> + CODE_ACCESSORS ( next_code_link , Object , kNextCodeLinkOffset ) <nl> + # undef CODE_ACCESSORS <nl> + <nl> + void Code : : WipeOutHeader ( ) { <nl> + WRITE_FIELD ( this , kRelocationInfoOffset , nullptr ) ; <nl> + WRITE_FIELD ( this , kHandlerTableOffset , nullptr ) ; <nl> + WRITE_FIELD ( this , kDeoptimizationDataOffset , nullptr ) ; <nl> + WRITE_FIELD ( this , kSourcePositionTableOffset , nullptr ) ; <nl> + / / Do not wipe out major / minor keys on a code stub or IC <nl> + if ( ! READ_FIELD ( this , kTypeFeedbackInfoOffset ) - > IsSmi ( ) ) { <nl> + WRITE_FIELD ( this , kTypeFeedbackInfoOffset , nullptr ) ; <nl> + } <nl> + WRITE_FIELD ( this , kNextCodeLinkOffset , nullptr ) ; <nl> + } <nl> + <nl> + void Code : : clear_padding ( ) { <nl> + memset ( address ( ) + kHeaderPaddingStart , 0 , kHeaderSize - kHeaderPaddingStart ) ; <nl> + Address data_end = <nl> + has_unwinding_info ( ) ? unwinding_info_end ( ) : instruction_end ( ) ; <nl> + memset ( data_end , 0 , CodeSize ( ) - ( data_end - address ( ) ) ) ; <nl> + } <nl> + <nl> + ByteArray * Code : : SourcePositionTable ( ) const { <nl> + Object * maybe_table = source_position_table ( ) ; <nl> + if ( maybe_table - > IsByteArray ( ) ) return ByteArray : : cast ( maybe_table ) ; <nl> + DCHECK ( maybe_table - > IsSourcePositionTableWithFrameCache ( ) ) ; <nl> + return SourcePositionTableWithFrameCache : : cast ( maybe_table ) <nl> + - > source_position_table ( ) ; <nl> + } <nl> + <nl> + uint32_t Code : : stub_key ( ) const { <nl> + DCHECK ( is_stub ( ) ) ; <nl> + Smi * smi_key = Smi : : cast ( raw_type_feedback_info ( ) ) ; <nl> + return static_cast < uint32_t > ( smi_key - > value ( ) ) ; <nl> + } <nl> + <nl> + void Code : : set_stub_key ( uint32_t key ) { <nl> + DCHECK ( is_stub ( ) ) ; <nl> + set_raw_type_feedback_info ( Smi : : FromInt ( key ) ) ; <nl> + } <nl> + <nl> + byte * Code : : instruction_start ( ) const { <nl> + return const_cast < byte * > ( FIELD_ADDR_CONST ( this , kHeaderSize ) ) ; <nl> + } <nl> + <nl> + byte * Code : : instruction_end ( ) const { <nl> + return instruction_start ( ) + instruction_size ( ) ; <nl> + } <nl> + <nl> + int Code : : GetUnwindingInfoSizeOffset ( ) const { <nl> + DCHECK ( has_unwinding_info ( ) ) ; <nl> + return RoundUp ( kHeaderSize + instruction_size ( ) , kInt64Size ) ; <nl> + } <nl> + <nl> + int Code : : unwinding_info_size ( ) const { <nl> + DCHECK ( has_unwinding_info ( ) ) ; <nl> + return static_cast < int > ( <nl> + READ_UINT64_FIELD ( this , GetUnwindingInfoSizeOffset ( ) ) ) ; <nl> + } <nl> + <nl> + void Code : : set_unwinding_info_size ( int value ) { <nl> + DCHECK ( has_unwinding_info ( ) ) ; <nl> + WRITE_UINT64_FIELD ( this , GetUnwindingInfoSizeOffset ( ) , value ) ; <nl> + } <nl> + <nl> + byte * Code : : unwinding_info_start ( ) const { <nl> + DCHECK ( has_unwinding_info ( ) ) ; <nl> + return const_cast < byte * > ( <nl> + FIELD_ADDR_CONST ( this , GetUnwindingInfoSizeOffset ( ) ) ) + <nl> + kInt64Size ; <nl> + } <nl> + <nl> + byte * Code : : unwinding_info_end ( ) const { <nl> + DCHECK ( has_unwinding_info ( ) ) ; <nl> + return unwinding_info_start ( ) + unwinding_info_size ( ) ; <nl> + } <nl> + <nl> + int Code : : body_size ( ) const { <nl> + int unpadded_body_size = <nl> + has_unwinding_info ( ) <nl> + ? static_cast < int > ( unwinding_info_end ( ) - instruction_start ( ) ) <nl> + : instruction_size ( ) ; <nl> + return RoundUp ( unpadded_body_size , kObjectAlignment ) ; <nl> + } <nl> + <nl> + int Code : : SizeIncludingMetadata ( ) const { <nl> + int size = CodeSize ( ) ; <nl> + size + = relocation_info ( ) - > Size ( ) ; <nl> + size + = deoptimization_data ( ) - > Size ( ) ; <nl> + size + = handler_table ( ) - > Size ( ) ; <nl> + return size ; <nl> + } <nl> + <nl> + ByteArray * Code : : unchecked_relocation_info ( ) const { <nl> + return reinterpret_cast < ByteArray * > ( READ_FIELD ( this , kRelocationInfoOffset ) ) ; <nl> + } <nl> + <nl> + byte * Code : : relocation_start ( ) const { <nl> + return unchecked_relocation_info ( ) - > GetDataStartAddress ( ) ; <nl> + } <nl> + <nl> + int Code : : relocation_size ( ) const { <nl> + return unchecked_relocation_info ( ) - > length ( ) ; <nl> + } <nl> + <nl> + byte * Code : : entry ( ) const { return instruction_start ( ) ; } <nl> + <nl> + bool Code : : contains ( byte * inner_pointer ) { <nl> + return ( address ( ) < = inner_pointer ) & & ( inner_pointer < = address ( ) + Size ( ) ) ; <nl> + } <nl> + <nl> + int Code : : ExecutableSize ( ) const { <nl> + / / Check that the assumptions about the layout of the code object holds . <nl> + DCHECK_EQ ( static_cast < int > ( instruction_start ( ) - address ( ) ) , <nl> + Code : : kHeaderSize ) ; <nl> + return instruction_size ( ) + Code : : kHeaderSize ; <nl> + } <nl> + <nl> + int Code : : CodeSize ( ) const { return SizeFor ( body_size ( ) ) ; } <nl> + <nl> + Code : : Kind Code : : kind ( ) const { <nl> + return KindField : : decode ( READ_UINT32_FIELD ( this , kFlagsOffset ) ) ; <nl> + } <nl> + <nl> + void Code : : initialize_flags ( Kind kind ) { <nl> + WRITE_UINT32_FIELD ( this , kFlagsOffset , KindField : : encode ( kind ) ) ; <nl> + } <nl> + <nl> + void Code : : set_kind ( Kind kind ) { <nl> + STATIC_ASSERT ( Code : : NUMBER_OF_KINDS < = KindField : : kMax + 1 ) ; <nl> + uint32_t previous = READ_UINT32_FIELD ( this , kFlagsOffset ) ; <nl> + uint32_t updated_value = KindField : : update ( previous , kind ) ; <nl> + WRITE_UINT32_FIELD ( this , kFlagsOffset , updated_value ) ; <nl> + } <nl> + <nl> + / / For initialization . <nl> + void Code : : set_raw_kind_specific_flags1 ( int value ) { <nl> + WRITE_INT_FIELD ( this , kKindSpecificFlags1Offset , value ) ; <nl> + } <nl> + <nl> + void Code : : set_raw_kind_specific_flags2 ( int value ) { <nl> + WRITE_INT_FIELD ( this , kKindSpecificFlags2Offset , value ) ; <nl> + } <nl> + <nl> + inline bool Code : : is_interpreter_trampoline_builtin ( ) const { <nl> + Builtins * builtins = GetIsolate ( ) - > builtins ( ) ; <nl> + bool is_interpreter_trampoline = <nl> + ( this = = builtins - > builtin ( Builtins : : kInterpreterEntryTrampoline ) | | <nl> + this = = builtins - > builtin ( Builtins : : kInterpreterEnterBytecodeAdvance ) | | <nl> + this = = builtins - > builtin ( Builtins : : kInterpreterEnterBytecodeDispatch ) ) ; <nl> + DCHECK_IMPLIES ( is_interpreter_trampoline , ! Builtins : : IsLazy ( builtin_index ( ) ) ) ; <nl> + return is_interpreter_trampoline ; <nl> + } <nl> + <nl> + inline bool Code : : checks_optimization_marker ( ) const { <nl> + Builtins * builtins = GetIsolate ( ) - > builtins ( ) ; <nl> + bool checks_marker = <nl> + ( this = = builtins - > builtin ( Builtins : : kCompileLazy ) | | <nl> + this = = builtins - > builtin ( Builtins : : kInterpreterEntryTrampoline ) | | <nl> + this = = builtins - > builtin ( Builtins : : kCheckOptimizationMarker ) ) ; <nl> + DCHECK_IMPLIES ( checks_marker , ! Builtins : : IsLazy ( builtin_index ( ) ) ) ; <nl> + return checks_marker | | <nl> + ( kind ( ) = = OPTIMIZED_FUNCTION & & marked_for_deoptimization ( ) ) ; <nl> + } <nl> + <nl> + inline bool Code : : has_unwinding_info ( ) const { <nl> + return HasUnwindingInfoField : : decode ( READ_UINT32_FIELD ( this , kFlagsOffset ) ) ; <nl> + } <nl> + <nl> + inline void Code : : set_has_unwinding_info ( bool state ) { <nl> + uint32_t previous = READ_UINT32_FIELD ( this , kFlagsOffset ) ; <nl> + uint32_t updated_value = HasUnwindingInfoField : : update ( previous , state ) ; <nl> + WRITE_UINT32_FIELD ( this , kFlagsOffset , updated_value ) ; <nl> + } <nl> + <nl> + inline bool Code : : has_tagged_params ( ) const { <nl> + int flags = READ_UINT32_FIELD ( this , kKindSpecificFlags2Offset ) ; <nl> + return HasTaggedStackField : : decode ( flags ) ; <nl> + } <nl> + <nl> + inline void Code : : set_has_tagged_params ( bool value ) { <nl> + int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags2Offset ) ; <nl> + int updated = HasTaggedStackField : : update ( previous , value ) ; <nl> + WRITE_UINT32_FIELD ( this , kKindSpecificFlags2Offset , updated ) ; <nl> + } <nl> + <nl> + inline bool Code : : is_turbofanned ( ) const { <nl> + return IsTurbofannedField : : decode ( <nl> + READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> + } <nl> + <nl> + inline void Code : : set_is_turbofanned ( bool value ) { <nl> + int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> + int updated = IsTurbofannedField : : update ( previous , value ) ; <nl> + WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> + } <nl> + <nl> + inline bool Code : : can_have_weak_objects ( ) const { <nl> + DCHECK ( kind ( ) = = OPTIMIZED_FUNCTION ) ; <nl> + return CanHaveWeakObjectsField : : decode ( <nl> + READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> + } <nl> + <nl> + inline void Code : : set_can_have_weak_objects ( bool value ) { <nl> + DCHECK ( kind ( ) = = OPTIMIZED_FUNCTION ) ; <nl> + int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> + int updated = CanHaveWeakObjectsField : : update ( previous , value ) ; <nl> + WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> + } <nl> + <nl> + inline bool Code : : is_construct_stub ( ) const { <nl> + DCHECK ( kind ( ) = = BUILTIN ) ; <nl> + return IsConstructStubField : : decode ( <nl> + READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> + } <nl> + <nl> + inline void Code : : set_is_construct_stub ( bool value ) { <nl> + DCHECK ( kind ( ) = = BUILTIN ) ; <nl> + int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> + int updated = IsConstructStubField : : update ( previous , value ) ; <nl> + WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> + } <nl> + <nl> + inline bool Code : : is_promise_rejection ( ) const { <nl> + DCHECK ( kind ( ) = = BUILTIN ) ; <nl> + return IsPromiseRejectionField : : decode ( <nl> + READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> + } <nl> + <nl> + inline void Code : : set_is_promise_rejection ( bool value ) { <nl> + DCHECK ( kind ( ) = = BUILTIN ) ; <nl> + int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> + int updated = IsPromiseRejectionField : : update ( previous , value ) ; <nl> + WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> + } <nl> + <nl> + inline bool Code : : is_exception_caught ( ) const { <nl> + DCHECK ( kind ( ) = = BUILTIN ) ; <nl> + return IsExceptionCaughtField : : decode ( <nl> + READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> + } <nl> + <nl> + inline void Code : : set_is_exception_caught ( bool value ) { <nl> + DCHECK ( kind ( ) = = BUILTIN ) ; <nl> + int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> + int updated = IsExceptionCaughtField : : update ( previous , value ) ; <nl> + WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> + } <nl> + <nl> + inline HandlerTable : : CatchPrediction Code : : GetBuiltinCatchPrediction ( ) { <nl> + if ( is_promise_rejection ( ) ) return HandlerTable : : PROMISE ; <nl> + if ( is_exception_caught ( ) ) return HandlerTable : : CAUGHT ; <nl> + return HandlerTable : : UNCAUGHT ; <nl> + } <nl> + <nl> + int Code : : builtin_index ( ) const { <nl> + int index = READ_INT_FIELD ( this , kBuiltinIndexOffset ) ; <nl> + DCHECK ( index = = - 1 | | Builtins : : IsBuiltinId ( index ) ) ; <nl> + return index ; <nl> + } <nl> + <nl> + void Code : : set_builtin_index ( int index ) { <nl> + DCHECK ( index = = - 1 | | Builtins : : IsBuiltinId ( index ) ) ; <nl> + WRITE_INT_FIELD ( this , kBuiltinIndexOffset , index ) ; <nl> + } <nl> + <nl> + bool Code : : is_builtin ( ) const { return builtin_index ( ) ! = - 1 ; } <nl> + <nl> + unsigned Code : : stack_slots ( ) const { <nl> + DCHECK ( is_turbofanned ( ) ) ; <nl> + return StackSlotsField : : decode ( <nl> + READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> + } <nl> + <nl> + void Code : : set_stack_slots ( unsigned slots ) { <nl> + CHECK ( slots < = ( 1 < < kStackSlotsBitCount ) ) ; <nl> + DCHECK ( is_turbofanned ( ) ) ; <nl> + int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> + int updated = StackSlotsField : : update ( previous , slots ) ; <nl> + WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> + } <nl> + <nl> + unsigned Code : : safepoint_table_offset ( ) const { <nl> + DCHECK ( is_turbofanned ( ) ) ; <nl> + return SafepointTableOffsetField : : decode ( <nl> + READ_UINT32_FIELD ( this , kKindSpecificFlags2Offset ) ) ; <nl> + } <nl> + <nl> + void Code : : set_safepoint_table_offset ( unsigned offset ) { <nl> + CHECK ( offset < = ( 1 < < kSafepointTableOffsetBitCount ) ) ; <nl> + DCHECK ( is_turbofanned ( ) ) ; <nl> + DCHECK ( IsAligned ( offset , static_cast < unsigned > ( kIntSize ) ) ) ; <nl> + int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags2Offset ) ; <nl> + int updated = SafepointTableOffsetField : : update ( previous , offset ) ; <nl> + WRITE_UINT32_FIELD ( this , kKindSpecificFlags2Offset , updated ) ; <nl> + } <nl> + <nl> + bool Code : : marked_for_deoptimization ( ) const { <nl> + DCHECK ( kind ( ) = = OPTIMIZED_FUNCTION ) ; <nl> + return MarkedForDeoptimizationField : : decode ( <nl> + READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> + } <nl> + <nl> + void Code : : set_marked_for_deoptimization ( bool flag ) { <nl> + DCHECK ( kind ( ) = = OPTIMIZED_FUNCTION ) ; <nl> + DCHECK_IMPLIES ( flag , AllowDeoptimization : : IsAllowed ( GetIsolate ( ) ) ) ; <nl> + int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> + int updated = MarkedForDeoptimizationField : : update ( previous , flag ) ; <nl> + WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> + } <nl> + <nl> + bool Code : : deopt_already_counted ( ) const { <nl> + DCHECK ( kind ( ) = = OPTIMIZED_FUNCTION ) ; <nl> + return DeoptAlreadyCountedField : : decode ( <nl> + READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ) ; <nl> + } <nl> + <nl> + void Code : : set_deopt_already_counted ( bool flag ) { <nl> + DCHECK ( kind ( ) = = OPTIMIZED_FUNCTION ) ; <nl> + DCHECK_IMPLIES ( flag , AllowDeoptimization : : IsAllowed ( GetIsolate ( ) ) ) ; <nl> + int previous = READ_UINT32_FIELD ( this , kKindSpecificFlags1Offset ) ; <nl> + int updated = DeoptAlreadyCountedField : : update ( previous , flag ) ; <nl> + WRITE_UINT32_FIELD ( this , kKindSpecificFlags1Offset , updated ) ; <nl> + } <nl> + <nl> + bool Code : : is_stub ( ) const { return kind ( ) = = STUB ; } <nl> + bool Code : : is_optimized_code ( ) const { return kind ( ) = = OPTIMIZED_FUNCTION ; } <nl> + bool Code : : is_wasm_code ( ) const { return kind ( ) = = WASM_FUNCTION ; } <nl> + <nl> + Address Code : : constant_pool ( ) { <nl> + Address constant_pool = nullptr ; <nl> + if ( FLAG_enable_embedded_constant_pool ) { <nl> + int offset = constant_pool_offset ( ) ; <nl> + if ( offset < instruction_size ( ) ) { <nl> + constant_pool = FIELD_ADDR ( this , kHeaderSize + offset ) ; <nl> + } <nl> + } <nl> + return constant_pool ; <nl> + } <nl> + <nl> + Code * Code : : GetCodeFromTargetAddress ( Address address ) { <nl> + HeapObject * code = HeapObject : : FromAddress ( address - Code : : kHeaderSize ) ; <nl> + / / GetCodeFromTargetAddress might be called when marking objects during mark <nl> + / / sweep . reinterpret_cast is therefore used instead of the more appropriate <nl> + / / Code : : cast . Code : : cast does not work when the object ' s map is <nl> + / / marked . <nl> + Code * result = reinterpret_cast < Code * > ( code ) ; <nl> + return result ; <nl> + } <nl> + <nl> + Object * Code : : GetObjectFromCodeEntry ( Address code_entry ) { <nl> + return HeapObject : : FromAddress ( code_entry - Code : : kHeaderSize ) ; <nl> + } <nl> + <nl> + Object * Code : : GetObjectFromEntryAddress ( Address location_of_address ) { <nl> + return GetObjectFromCodeEntry ( Memory : : Address_at ( location_of_address ) ) ; <nl> + } <nl> + <nl> + bool Code : : CanContainWeakObjects ( ) { <nl> + return is_optimized_code ( ) & & can_have_weak_objects ( ) ; <nl> + } <nl> + <nl> + bool Code : : IsWeakObject ( Object * object ) { <nl> + return ( CanContainWeakObjects ( ) & & IsWeakObjectInOptimizedCode ( object ) ) ; <nl> + } <nl> + <nl> + bool Code : : IsWeakObjectInOptimizedCode ( Object * object ) { <nl> + if ( object - > IsMap ( ) ) { <nl> + return Map : : cast ( object ) - > CanTransition ( ) ; <nl> + } <nl> + if ( object - > IsCell ( ) ) { <nl> + object = Cell : : cast ( object ) - > value ( ) ; <nl> + } else if ( object - > IsPropertyCell ( ) ) { <nl> + object = PropertyCell : : cast ( object ) - > value ( ) ; <nl> + } <nl> + if ( object - > IsJSReceiver ( ) | | object - > IsContext ( ) ) { <nl> + return true ; <nl> + } <nl> + return false ; <nl> + } <nl> + <nl> + byte BytecodeArray : : get ( int index ) { <nl> + DCHECK ( index > = 0 & & index < this - > length ( ) ) ; <nl> + return READ_BYTE_FIELD ( this , kHeaderSize + index * kCharSize ) ; <nl> + } <nl> + <nl> + void BytecodeArray : : set ( int index , byte value ) { <nl> + DCHECK ( index > = 0 & & index < this - > length ( ) ) ; <nl> + WRITE_BYTE_FIELD ( this , kHeaderSize + index * kCharSize , value ) ; <nl> + } <nl> + <nl> + void BytecodeArray : : set_frame_size ( int frame_size ) { <nl> + DCHECK_GE ( frame_size , 0 ) ; <nl> + DCHECK ( IsAligned ( frame_size , static_cast < unsigned > ( kPointerSize ) ) ) ; <nl> + WRITE_INT_FIELD ( this , kFrameSizeOffset , frame_size ) ; <nl> + } <nl> + <nl> + int BytecodeArray : : frame_size ( ) const { <nl> + return READ_INT_FIELD ( this , kFrameSizeOffset ) ; <nl> + } <nl> + <nl> + int BytecodeArray : : register_count ( ) const { <nl> + return frame_size ( ) / kPointerSize ; <nl> + } <nl> + <nl> + void BytecodeArray : : set_parameter_count ( int number_of_parameters ) { <nl> + DCHECK_GE ( number_of_parameters , 0 ) ; <nl> + / / Parameter count is stored as the size on stack of the parameters to allow <nl> + / / it to be used directly by generated code . <nl> + WRITE_INT_FIELD ( this , kParameterSizeOffset , <nl> + ( number_of_parameters < < kPointerSizeLog2 ) ) ; <nl> + } <nl> + <nl> + interpreter : : Register BytecodeArray : : incoming_new_target_or_generator_register ( ) <nl> + const { <nl> + int register_operand = <nl> + READ_INT_FIELD ( this , kIncomingNewTargetOrGeneratorRegisterOffset ) ; <nl> + if ( register_operand = = 0 ) { <nl> + return interpreter : : Register : : invalid_value ( ) ; <nl> + } else { <nl> + return interpreter : : Register : : FromOperand ( register_operand ) ; <nl> + } <nl> + } <nl> + <nl> + void BytecodeArray : : set_incoming_new_target_or_generator_register ( <nl> + interpreter : : Register incoming_new_target_or_generator_register ) { <nl> + if ( ! incoming_new_target_or_generator_register . is_valid ( ) ) { <nl> + WRITE_INT_FIELD ( this , kIncomingNewTargetOrGeneratorRegisterOffset , 0 ) ; <nl> + } else { <nl> + DCHECK ( incoming_new_target_or_generator_register . index ( ) < <nl> + register_count ( ) ) ; <nl> + DCHECK_NE ( 0 , incoming_new_target_or_generator_register . ToOperand ( ) ) ; <nl> + WRITE_INT_FIELD ( this , kIncomingNewTargetOrGeneratorRegisterOffset , <nl> + incoming_new_target_or_generator_register . ToOperand ( ) ) ; <nl> + } <nl> + } <nl> + <nl> + int BytecodeArray : : interrupt_budget ( ) const { <nl> + return READ_INT_FIELD ( this , kInterruptBudgetOffset ) ; <nl> + } <nl> + <nl> + void BytecodeArray : : set_interrupt_budget ( int interrupt_budget ) { <nl> + DCHECK_GE ( interrupt_budget , 0 ) ; <nl> + WRITE_INT_FIELD ( this , kInterruptBudgetOffset , interrupt_budget ) ; <nl> + } <nl> + <nl> + int BytecodeArray : : osr_loop_nesting_level ( ) const { <nl> + return READ_INT8_FIELD ( this , kOSRNestingLevelOffset ) ; <nl> + } <nl> + <nl> + void BytecodeArray : : set_osr_loop_nesting_level ( int depth ) { <nl> + DCHECK ( 0 < = depth & & depth < = AbstractCode : : kMaxLoopNestingMarker ) ; <nl> + STATIC_ASSERT ( AbstractCode : : kMaxLoopNestingMarker < kMaxInt8 ) ; <nl> + WRITE_INT8_FIELD ( this , kOSRNestingLevelOffset , depth ) ; <nl> + } <nl> + <nl> + BytecodeArray : : Age BytecodeArray : : bytecode_age ( ) const { <nl> + / / Bytecode is aged by the concurrent marker . <nl> + return static_cast < Age > ( RELAXED_READ_INT8_FIELD ( this , kBytecodeAgeOffset ) ) ; <nl> + } <nl> + <nl> + void BytecodeArray : : set_bytecode_age ( BytecodeArray : : Age age ) { <nl> + DCHECK_GE ( age , kFirstBytecodeAge ) ; <nl> + DCHECK_LE ( age , kLastBytecodeAge ) ; <nl> + STATIC_ASSERT ( kLastBytecodeAge < = kMaxInt8 ) ; <nl> + / / Bytecode is aged by the concurrent marker . <nl> + RELAXED_WRITE_INT8_FIELD ( this , kBytecodeAgeOffset , static_cast < int8_t > ( age ) ) ; <nl> + } <nl> + <nl> + int BytecodeArray : : parameter_count ( ) const { <nl> + / / Parameter count is stored as the size on stack of the parameters to allow <nl> + / / it to be used directly by generated code . <nl> + return READ_INT_FIELD ( this , kParameterSizeOffset ) > > kPointerSizeLog2 ; <nl> + } <nl> + <nl> + ACCESSORS ( BytecodeArray , constant_pool , FixedArray , kConstantPoolOffset ) <nl> + ACCESSORS ( BytecodeArray , handler_table , FixedArray , kHandlerTableOffset ) <nl> + ACCESSORS ( BytecodeArray , source_position_table , Object , <nl> + kSourcePositionTableOffset ) <nl> + <nl> + void BytecodeArray : : clear_padding ( ) { <nl> + int data_size = kHeaderSize + length ( ) ; <nl> + memset ( address ( ) + data_size , 0 , SizeFor ( length ( ) ) - data_size ) ; <nl> + } <nl> + <nl> + Address BytecodeArray : : GetFirstBytecodeAddress ( ) { <nl> + return reinterpret_cast < Address > ( this ) - kHeapObjectTag + kHeaderSize ; <nl> + } <nl> + <nl> + ByteArray * BytecodeArray : : SourcePositionTable ( ) { <nl> + Object * maybe_table = source_position_table ( ) ; <nl> + if ( maybe_table - > IsByteArray ( ) ) return ByteArray : : cast ( maybe_table ) ; <nl> + DCHECK ( maybe_table - > IsSourcePositionTableWithFrameCache ( ) ) ; <nl> + return SourcePositionTableWithFrameCache : : cast ( maybe_table ) <nl> + - > source_position_table ( ) ; <nl> + } <nl> + <nl> + int BytecodeArray : : BytecodeArraySize ( ) { return SizeFor ( this - > length ( ) ) ; } <nl> + <nl> + int BytecodeArray : : SizeIncludingMetadata ( ) { <nl> + int size = BytecodeArraySize ( ) ; <nl> + size + = constant_pool ( ) - > Size ( ) ; <nl> + size + = handler_table ( ) - > Size ( ) ; <nl> + size + = SourcePositionTable ( ) - > Size ( ) ; <nl> + return size ; <nl> + } <nl> + <nl> + int HandlerTable : : GetRangeStart ( int index ) const { <nl> + return Smi : : ToInt ( get ( index * kRangeEntrySize + kRangeStartIndex ) ) ; <nl> + } <nl> + <nl> + int HandlerTable : : GetRangeEnd ( int index ) const { <nl> + return Smi : : ToInt ( get ( index * kRangeEntrySize + kRangeEndIndex ) ) ; <nl> + } <nl> + <nl> + int HandlerTable : : GetRangeHandler ( int index ) const { <nl> + return HandlerOffsetField : : decode ( <nl> + Smi : : ToInt ( get ( index * kRangeEntrySize + kRangeHandlerIndex ) ) ) ; <nl> + } <nl> + <nl> + int HandlerTable : : GetRangeData ( int index ) const { <nl> + return Smi : : ToInt ( get ( index * kRangeEntrySize + kRangeDataIndex ) ) ; <nl> + } <nl> + <nl> + void HandlerTable : : SetRangeStart ( int index , int value ) { <nl> + set ( index * kRangeEntrySize + kRangeStartIndex , Smi : : FromInt ( value ) ) ; <nl> + } <nl> + <nl> + void HandlerTable : : SetRangeEnd ( int index , int value ) { <nl> + set ( index * kRangeEntrySize + kRangeEndIndex , Smi : : FromInt ( value ) ) ; <nl> + } <nl> + <nl> + void HandlerTable : : SetRangeHandler ( int index , int offset , <nl> + CatchPrediction prediction ) { <nl> + int value = HandlerOffsetField : : encode ( offset ) | <nl> + HandlerPredictionField : : encode ( prediction ) ; <nl> + set ( index * kRangeEntrySize + kRangeHandlerIndex , Smi : : FromInt ( value ) ) ; <nl> + } <nl> + <nl> + void HandlerTable : : SetRangeData ( int index , int value ) { <nl> + set ( index * kRangeEntrySize + kRangeDataIndex , Smi : : FromInt ( value ) ) ; <nl> + } <nl> + <nl> + void HandlerTable : : SetReturnOffset ( int index , int value ) { <nl> + set ( index * kReturnEntrySize + kReturnOffsetIndex , Smi : : FromInt ( value ) ) ; <nl> + } <nl> + <nl> + void HandlerTable : : SetReturnHandler ( int index , int offset ) { <nl> + int value = HandlerOffsetField : : encode ( offset ) ; <nl> + set ( index * kReturnEntrySize + kReturnHandlerIndex , Smi : : FromInt ( value ) ) ; <nl> + } <nl> + <nl> + int HandlerTable : : NumberOfRangeEntries ( ) const { <nl> + return length ( ) / kRangeEntrySize ; <nl> + } <nl> + <nl> + BailoutId DeoptimizationInputData : : BytecodeOffset ( int i ) { <nl> + return BailoutId ( BytecodeOffsetRaw ( i ) - > value ( ) ) ; <nl> + } <nl> + <nl> + void DeoptimizationInputData : : SetBytecodeOffset ( int i , BailoutId value ) { <nl> + SetBytecodeOffsetRaw ( i , Smi : : FromInt ( value . ToInt ( ) ) ) ; <nl> + } <nl> + <nl> + int DeoptimizationInputData : : DeoptCount ( ) { <nl> + return ( length ( ) - kFirstDeoptEntryIndex ) / kDeoptEntrySize ; <nl> + } <nl> + <nl> + } / / namespace internal <nl> + } / / namespace v8 <nl> + <nl> + # include " src / objects / object - macros - undef . h " <nl> + <nl> + # endif / / V8_OBJECTS_CODE_INL_H_ <nl> new file mode 100644 <nl> index 00000000000 . . fa3d607c2fd <nl> mmm / dev / null <nl> ppp b / src / objects / code . h <nl> <nl> + / / Copyright 2017 the V8 project authors . All rights reserved . <nl> + / / Use of this source code is governed by a BSD - style license that can be <nl> + / / found in the LICENSE file . <nl> + <nl> + # ifndef V8_OBJECTS_CODE_H_ <nl> + # define V8_OBJECTS_CODE_H_ <nl> + <nl> + # include " src / objects . h " <nl> + <nl> + / / Has to be the last include ( doesn ' t have include guards ) : <nl> + # include " src / objects / object - macros . h " <nl> + <nl> + namespace v8 { <nl> + namespace internal { <nl> + <nl> + class ByteArray ; <nl> + class BytecodeArray ; <nl> + <nl> + / / HandlerTable is a fixed array containing entries for exception handlers in <nl> + / / the code object it is associated with . The tables comes in two flavors : <nl> + / / 1 ) Based on ranges : Used for unoptimized code . Contains one entry per <nl> + / / exception handler and a range representing the try - block covered by that <nl> + / / handler . Layout looks as follows : <nl> + / / [ range - start , range - end , handler - offset , handler - data ] <nl> + / / 2 ) Based on return addresses : Used for turbofanned code . Contains one entry <nl> + / / per call - site that could throw an exception . Layout looks as follows : <nl> + / / [ return - address - offset , handler - offset ] <nl> + class HandlerTable : public FixedArray { <nl> + public : <nl> + / / Conservative prediction whether a given handler will locally catch an <nl> + / / exception or cause a re - throw to outside the code boundary . Since this is <nl> + / / undecidable it is merely an approximation ( e . g . useful for debugger ) . <nl> + enum CatchPrediction { <nl> + UNCAUGHT , / / The handler will ( likely ) rethrow the exception . <nl> + CAUGHT , / / The exception will be caught by the handler . <nl> + PROMISE , / / The exception will be caught and cause a promise rejection . <nl> + DESUGARING , / / The exception will be caught , but both the exception and the <nl> + / / catching are part of a desugaring and should therefore not <nl> + / / be visible to the user ( we won ' t notify the debugger of such <nl> + / / exceptions ) . <nl> + ASYNC_AWAIT , / / The exception will be caught and cause a promise rejection <nl> + / / in the desugaring of an async function , so special <nl> + / / async / await handling in the debugger can take place . <nl> + } ; <nl> + <nl> + / / Getters for handler table based on ranges . <nl> + inline int GetRangeStart ( int index ) const ; <nl> + inline int GetRangeEnd ( int index ) const ; <nl> + inline int GetRangeHandler ( int index ) const ; <nl> + inline int GetRangeData ( int index ) const ; <nl> + <nl> + / / Setters for handler table based on ranges . <nl> + inline void SetRangeStart ( int index , int value ) ; <nl> + inline void SetRangeEnd ( int index , int value ) ; <nl> + inline void SetRangeHandler ( int index , int offset , CatchPrediction pred ) ; <nl> + inline void SetRangeData ( int index , int value ) ; <nl> + <nl> + / / Setters for handler table based on return addresses . <nl> + inline void SetReturnOffset ( int index , int value ) ; <nl> + inline void SetReturnHandler ( int index , int offset ) ; <nl> + <nl> + / / Lookup handler in a table based on ranges . The { pc_offset } is an offset to <nl> + / / the start of the potentially throwing instruction ( using return addresses <nl> + / / for this value would be invalid ) . <nl> + int LookupRange ( int pc_offset , int * data , CatchPrediction * prediction ) ; <nl> + <nl> + / / Lookup handler in a table based on return addresses . <nl> + int LookupReturn ( int pc_offset ) ; <nl> + <nl> + / / Returns the number of entries in the table . <nl> + inline int NumberOfRangeEntries ( ) const ; <nl> + <nl> + / / Returns the required length of the underlying fixed array . <nl> + static int LengthForRange ( int entries ) { return entries * kRangeEntrySize ; } <nl> + static int LengthForReturn ( int entries ) { return entries * kReturnEntrySize ; } <nl> + <nl> + DECL_CAST ( HandlerTable ) <nl> + <nl> + # ifdef ENABLE_DISASSEMBLER <nl> + void HandlerTableRangePrint ( std : : ostream & os ) ; / / NOLINT <nl> + void HandlerTableReturnPrint ( std : : ostream & os ) ; / / NOLINT <nl> + # endif <nl> + <nl> + private : <nl> + / / Layout description for handler table based on ranges . <nl> + static const int kRangeStartIndex = 0 ; <nl> + static const int kRangeEndIndex = 1 ; <nl> + static const int kRangeHandlerIndex = 2 ; <nl> + static const int kRangeDataIndex = 3 ; <nl> + static const int kRangeEntrySize = 4 ; <nl> + <nl> + / / Layout description for handler table based on return addresses . <nl> + static const int kReturnOffsetIndex = 0 ; <nl> + static const int kReturnHandlerIndex = 1 ; <nl> + static const int kReturnEntrySize = 2 ; <nl> + <nl> + / / Encoding of the { handler } field . <nl> + class HandlerPredictionField : public BitField < CatchPrediction , 0 , 3 > { } ; <nl> + class HandlerOffsetField : public BitField < int , 3 , 29 > { } ; <nl> + } ; <nl> + <nl> + / / Code describes objects with on - the - fly generated machine code . <nl> + class Code : public HeapObject { <nl> + public : <nl> + / / Opaque data type for encapsulating code flags like kind , inline <nl> + / / cache state , and arguments count . <nl> + typedef uint32_t Flags ; <nl> + <nl> + # define CODE_KIND_LIST ( V ) \ <nl> + V ( OPTIMIZED_FUNCTION ) \ <nl> + V ( BYTECODE_HANDLER ) \ <nl> + V ( STUB ) \ <nl> + V ( BUILTIN ) \ <nl> + V ( REGEXP ) \ <nl> + V ( WASM_FUNCTION ) \ <nl> + V ( WASM_TO_JS_FUNCTION ) \ <nl> + V ( JS_TO_WASM_FUNCTION ) \ <nl> + V ( WASM_INTERPRETER_ENTRY ) \ <nl> + V ( C_WASM_ENTRY ) <nl> + <nl> + enum Kind { <nl> + # define DEFINE_CODE_KIND_ENUM ( name ) name , <nl> + CODE_KIND_LIST ( DEFINE_CODE_KIND_ENUM ) <nl> + # undef DEFINE_CODE_KIND_ENUM <nl> + NUMBER_OF_KINDS <nl> + } ; <nl> + <nl> + static const char * Kind2String ( Kind kind ) ; <nl> + <nl> + # if defined ( OBJECT_PRINT ) | | defined ( ENABLE_DISASSEMBLER ) <nl> + / / Printing <nl> + static const char * ICState2String ( InlineCacheState state ) ; <nl> + # endif / / defined ( OBJECT_PRINT ) | | defined ( ENABLE_DISASSEMBLER ) <nl> + <nl> + # ifdef ENABLE_DISASSEMBLER <nl> + void Disassemble ( const char * name , std : : ostream & os ) ; / / NOLINT <nl> + # endif <nl> + <nl> + / / [ instruction_size ] : Size of the native instructions <nl> + inline int instruction_size ( ) const ; <nl> + inline void set_instruction_size ( int value ) ; <nl> + <nl> + / / [ relocation_info ] : Code relocation information <nl> + DECL_ACCESSORS ( relocation_info , ByteArray ) <nl> + void InvalidateRelocation ( ) ; <nl> + void InvalidateEmbeddedObjects ( ) ; <nl> + <nl> + / / [ handler_table ] : Fixed array containing offsets of exception handlers . <nl> + DECL_ACCESSORS ( handler_table , FixedArray ) <nl> + <nl> + / / [ deoptimization_data ] : Array containing data for deopt . <nl> + DECL_ACCESSORS ( deoptimization_data , FixedArray ) <nl> + <nl> + / / [ source_position_table ] : ByteArray for the source positions table or <nl> + / / SourcePositionTableWithFrameCache . <nl> + DECL_ACCESSORS ( source_position_table , Object ) <nl> + <nl> + inline ByteArray * SourcePositionTable ( ) const ; <nl> + <nl> + / / [ trap_handler_index ] : An index into the trap handler ' s master list of code <nl> + / / objects . <nl> + DECL_ACCESSORS ( trap_handler_index , Smi ) <nl> + <nl> + / / [ raw_type_feedback_info ] : This field stores various things , depending on <nl> + / / the kind of the code object . <nl> + / / STUB and ICs = > major / minor key as Smi . <nl> + / / TODO ( mvstanton ) : rename raw_type_feedback_info to stub_key , since the <nl> + / / field is no longer overloaded . <nl> + DECL_ACCESSORS ( raw_type_feedback_info , Object ) <nl> + inline uint32_t stub_key ( ) const ; <nl> + inline void set_stub_key ( uint32_t key ) ; <nl> + <nl> + / / [ next_code_link ] : Link for lists of optimized or deoptimized code . <nl> + / / Note that storage for this field is overlapped with typefeedback_info . <nl> + DECL_ACCESSORS ( next_code_link , Object ) <nl> + <nl> + / / [ constant_pool offset ] : Offset of the constant pool . <nl> + / / Valid for FLAG_enable_embedded_constant_pool only <nl> + inline int constant_pool_offset ( ) const ; <nl> + inline void set_constant_pool_offset ( int offset ) ; <nl> + <nl> + / / Unchecked accessors to be used during GC . <nl> + inline ByteArray * unchecked_relocation_info ( ) const ; <nl> + <nl> + inline int relocation_size ( ) const ; <nl> + <nl> + / / [ kind ] : Access to specific code kind . <nl> + inline Kind kind ( ) const ; <nl> + inline void set_kind ( Kind kind ) ; <nl> + <nl> + inline bool is_stub ( ) const ; <nl> + inline bool is_optimized_code ( ) const ; <nl> + inline bool is_wasm_code ( ) const ; <nl> + <nl> + inline void set_raw_kind_specific_flags1 ( int value ) ; <nl> + inline void set_raw_kind_specific_flags2 ( int value ) ; <nl> + <nl> + / / Testers for interpreter builtins . <nl> + inline bool is_interpreter_trampoline_builtin ( ) const ; <nl> + <nl> + / / Tells whether the code checks the optimization marker in the function ' s <nl> + / / feedback vector . <nl> + inline bool checks_optimization_marker ( ) const ; <nl> + <nl> + / / [ has_tagged_params ] : For compiled code or builtins : Tells whether the <nl> + / / outgoing parameters of this code are tagged pointers . True for other kinds . <nl> + inline bool has_tagged_params ( ) const ; <nl> + inline void set_has_tagged_params ( bool value ) ; <nl> + <nl> + / / [ is_turbofanned ] : For kind STUB or OPTIMIZED_FUNCTION , tells whether the <nl> + / / code object was generated by the TurboFan optimizing compiler . <nl> + inline bool is_turbofanned ( ) const ; <nl> + inline void set_is_turbofanned ( bool value ) ; <nl> + <nl> + / / [ can_have_weak_objects ] : For kind OPTIMIZED_FUNCTION , tells whether the <nl> + / / embedded objects in code should be treated weakly . <nl> + inline bool can_have_weak_objects ( ) const ; <nl> + inline void set_can_have_weak_objects ( bool value ) ; <nl> + <nl> + / / [ is_construct_stub ] : For kind BUILTIN , tells whether the code object <nl> + / / represents a hand - written construct stub <nl> + / / ( e . g . , NumberConstructor_ConstructStub ) . <nl> + inline bool is_construct_stub ( ) const ; <nl> + inline void set_is_construct_stub ( bool value ) ; <nl> + <nl> + / / [ builtin_index ] : For builtins , tells which builtin index the code object <nl> + / / has . The builtin index is a non - negative integer for builtins , and - 1 <nl> + / / otherwise . <nl> + inline int builtin_index ( ) const ; <nl> + inline void set_builtin_index ( int id ) ; <nl> + inline bool is_builtin ( ) const ; <nl> + <nl> + / / [ stack_slots ] : For kind OPTIMIZED_FUNCTION , the number of stack slots <nl> + / / reserved in the code prologue . <nl> + inline unsigned stack_slots ( ) const ; <nl> + inline void set_stack_slots ( unsigned slots ) ; <nl> + <nl> + / / [ safepoint_table_start ] : For kind OPTIMIZED_FUNCTION , the offset in <nl> + / / the instruction stream where the safepoint table starts . <nl> + inline unsigned safepoint_table_offset ( ) const ; <nl> + inline void set_safepoint_table_offset ( unsigned offset ) ; <nl> + <nl> + / / [ marked_for_deoptimization ] : For kind OPTIMIZED_FUNCTION tells whether <nl> + / / the code is going to be deoptimized because of dead embedded maps . <nl> + inline bool marked_for_deoptimization ( ) const ; <nl> + inline void set_marked_for_deoptimization ( bool flag ) ; <nl> + <nl> + / / [ deopt_already_counted ] : For kind OPTIMIZED_FUNCTION tells whether <nl> + / / the code was already deoptimized . <nl> + inline bool deopt_already_counted ( ) const ; <nl> + inline void set_deopt_already_counted ( bool flag ) ; <nl> + <nl> + / / [ is_promise_rejection ] : For kind BUILTIN tells whether the <nl> + / / exception thrown by the code will lead to promise rejection or <nl> + / / uncaught if both this and is_exception_caught is set . <nl> + / / Use GetBuiltinCatchPrediction to access this . <nl> + inline void set_is_promise_rejection ( bool flag ) ; <nl> + <nl> + / / [ is_exception_caught ] : For kind BUILTIN tells whether the <nl> + / / exception thrown by the code will be caught internally or <nl> + / / uncaught if both this and is_promise_rejection is set . <nl> + / / Use GetBuiltinCatchPrediction to access this . <nl> + inline void set_is_exception_caught ( bool flag ) ; <nl> + <nl> + / / [ constant_pool ] : The constant pool for this function . <nl> + inline Address constant_pool ( ) ; <nl> + <nl> + / / Get the safepoint entry for the given pc . <nl> + SafepointEntry GetSafepointEntry ( Address pc ) ; <nl> + <nl> + / / The entire code object including its header is copied verbatim to the <nl> + / / snapshot so that it can be written in one , fast , memcpy during <nl> + / / deserialization . The deserializer will overwrite some pointers , rather <nl> + / / like a runtime linker , but the random allocation addresses used in the <nl> + / / mksnapshot process would still be present in the unlinked snapshot data , <nl> + / / which would make snapshot production non - reproducible . This method wipes <nl> + / / out the to - be - overwritten header data for reproducible snapshots . <nl> + inline void WipeOutHeader ( ) ; <nl> + <nl> + / / Clear uninitialized padding space . This ensures that the snapshot content <nl> + / / is deterministic . <nl> + inline void clear_padding ( ) ; <nl> + / / Initialize the flags field . Similar to clear_padding above this ensure that <nl> + / / the snapshot content is deterministic . <nl> + inline void initialize_flags ( Kind kind ) ; <nl> + <nl> + / / Convert a target address into a code object . <nl> + static inline Code * GetCodeFromTargetAddress ( Address address ) ; <nl> + <nl> + / / Convert an entry address into an object . <nl> + static inline Object * GetObjectFromEntryAddress ( Address location_of_address ) ; <nl> + <nl> + / / Convert a code entry into an object . <nl> + static inline Object * GetObjectFromCodeEntry ( Address code_entry ) ; <nl> + <nl> + / / Returns the address of the first instruction . <nl> + inline byte * instruction_start ( ) const ; <nl> + <nl> + / / Returns the address right after the last instruction . <nl> + inline byte * instruction_end ( ) const ; <nl> + <nl> + / / Returns the size of the instructions , padding , relocation and unwinding <nl> + / / information . <nl> + inline int body_size ( ) const ; <nl> + <nl> + / / Returns the size of code and its metadata . This includes the size of code <nl> + / / relocation information , deoptimization data and handler table . <nl> + inline int SizeIncludingMetadata ( ) const ; <nl> + <nl> + / / Returns the address of the first relocation info ( read backwards ! ) . <nl> + inline byte * relocation_start ( ) const ; <nl> + <nl> + / / [ has_unwinding_info ] : Whether this code object has unwinding information . <nl> + / / If it doesn ' t , unwinding_information_start ( ) will point to invalid data . <nl> + / / <nl> + / / The body of all code objects has the following layout . <nl> + / / <nl> + / / + mmmmmmmmmmmmmmmmmmmmmmmm - - + < - - instruction_start ( ) <nl> + / / | instructions | <nl> + / / | . . . | <nl> + / / + mmmmmmmmmmmmmmmmmmmmmmmm - - + <nl> + / / | relocation info | <nl> + / / | . . . | <nl> + / / + mmmmmmmmmmmmmmmmmmmmmmmm - - + < - - instruction_end ( ) <nl> + / / <nl> + / / If has_unwinding_info ( ) is false , instruction_end ( ) points to the first <nl> + / / memory location after the end of the code object . Otherwise , the body <nl> + / / continues as follows : <nl> + / / <nl> + / / + mmmmmmmmmmmmmmmmmmmmmmmm - - + <nl> + / / | padding to the next | <nl> + / / | 8 - byte aligned address | <nl> + / / + mmmmmmmmmmmmmmmmmmmmmmmm - - + < - - instruction_end ( ) <nl> + / / | [ unwinding_info_size ] | <nl> + / / | as uint64_t | <nl> + / / + mmmmmmmmmmmmmmmmmmmmmmmm - - + < - - unwinding_info_start ( ) <nl> + / / | unwinding info | <nl> + / / | . . . | <nl> + / / + mmmmmmmmmmmmmmmmmmmmmmmm - - + < - - unwinding_info_end ( ) <nl> + / / <nl> + / / and unwinding_info_end ( ) points to the first memory location after the end <nl> + / / of the code object . <nl> + / / <nl> + DECL_BOOLEAN_ACCESSORS ( has_unwinding_info ) <nl> + <nl> + / / [ unwinding_info_size ] : Size of the unwinding information . <nl> + inline int unwinding_info_size ( ) const ; <nl> + inline void set_unwinding_info_size ( int value ) ; <nl> + <nl> + / / Returns the address of the unwinding information , if any . <nl> + inline byte * unwinding_info_start ( ) const ; <nl> + <nl> + / / Returns the address right after the end of the unwinding information . <nl> + inline byte * unwinding_info_end ( ) const ; <nl> + <nl> + / / Code entry point . <nl> + inline byte * entry ( ) const ; <nl> + <nl> + / / Returns true if pc is inside this object ' s instructions . <nl> + inline bool contains ( byte * pc ) ; <nl> + <nl> + / / Relocate the code by delta bytes . Called to signal that this code <nl> + / / object has been moved by delta bytes . <nl> + void Relocate ( intptr_t delta ) ; <nl> + <nl> + / / Migrate code described by desc . <nl> + void CopyFrom ( const CodeDesc & desc ) ; <nl> + <nl> + / / Returns the object size for a given body ( used for allocation ) . <nl> + static int SizeFor ( int body_size ) { <nl> + DCHECK_SIZE_TAG_ALIGNED ( body_size ) ; <nl> + return RoundUp ( kHeaderSize + body_size , kCodeAlignment ) ; <nl> + } <nl> + <nl> + / / Calculate the size of the code object to report for log events . This takes <nl> + / / the layout of the code object into account . <nl> + inline int ExecutableSize ( ) const ; <nl> + <nl> + DECL_CAST ( Code ) <nl> + <nl> + / / Dispatched behavior . <nl> + inline int CodeSize ( ) const ; <nl> + <nl> + DECL_PRINTER ( Code ) <nl> + DECL_VERIFIER ( Code ) <nl> + <nl> + void PrintDeoptLocation ( FILE * out , Address pc ) ; <nl> + bool CanDeoptAt ( Address pc ) ; <nl> + <nl> + inline HandlerTable : : CatchPrediction GetBuiltinCatchPrediction ( ) ; <nl> + # ifdef VERIFY_HEAP <nl> + void VerifyEmbeddedObjectsDependency ( ) ; <nl> + # endif <nl> + <nl> + # ifdef DEBUG <nl> + enum VerifyMode { kNoContextSpecificPointers , kNoContextRetainingPointers } ; <nl> + void VerifyEmbeddedObjects ( VerifyMode mode = kNoContextRetainingPointers ) ; <nl> + # endif / / DEBUG <nl> + <nl> + inline bool CanContainWeakObjects ( ) ; <nl> + <nl> + inline bool IsWeakObject ( Object * object ) ; <nl> + <nl> + static inline bool IsWeakObjectInOptimizedCode ( Object * object ) ; <nl> + <nl> + static Handle < WeakCell > WeakCellFor ( Handle < Code > code ) ; <nl> + WeakCell * CachedWeakCell ( ) ; <nl> + <nl> + / / Return true if the function is inlined in the code . <nl> + bool Inlines ( SharedFunctionInfo * sfi ) ; <nl> + <nl> + class OptimizedCodeIterator { <nl> + public : <nl> + explicit OptimizedCodeIterator ( Isolate * isolate ) ; <nl> + Code * Next ( ) ; <nl> + <nl> + private : <nl> + Context * next_context_ ; <nl> + Code * current_code_ ; <nl> + Isolate * isolate_ ; <nl> + <nl> + DisallowHeapAllocation no_gc ; <nl> + DISALLOW_COPY_AND_ASSIGN ( OptimizedCodeIterator ) <nl> + } ; <nl> + <nl> + static const int kConstantPoolSize = <nl> + FLAG_enable_embedded_constant_pool ? kIntSize : 0 ; <nl> + <nl> + / / Layout description . <nl> + static const int kRelocationInfoOffset = HeapObject : : kHeaderSize ; <nl> + static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize ; <nl> + static const int kDeoptimizationDataOffset = <nl> + kHandlerTableOffset + kPointerSize ; <nl> + static const int kSourcePositionTableOffset = <nl> + kDeoptimizationDataOffset + kPointerSize ; <nl> + / / For FUNCTION kind , we store the type feedback info here . <nl> + static const int kTypeFeedbackInfoOffset = <nl> + kSourcePositionTableOffset + kPointerSize ; <nl> + static const int kNextCodeLinkOffset = kTypeFeedbackInfoOffset + kPointerSize ; <nl> + static const int kInstructionSizeOffset = kNextCodeLinkOffset + kPointerSize ; <nl> + static const int kFlagsOffset = kInstructionSizeOffset + kIntSize ; <nl> + static const int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize ; <nl> + static const int kKindSpecificFlags2Offset = <nl> + kKindSpecificFlags1Offset + kIntSize ; <nl> + static const int kConstantPoolOffset = kKindSpecificFlags2Offset + kIntSize ; <nl> + static const int kBuiltinIndexOffset = <nl> + kConstantPoolOffset + kConstantPoolSize ; <nl> + static const int kTrapHandlerIndex = kBuiltinIndexOffset + kIntSize ; <nl> + static const int kHeaderPaddingStart = kTrapHandlerIndex + kPointerSize ; <nl> + <nl> + / / Add padding to align the instruction start following right after <nl> + / / the Code object header . <nl> + static const int kHeaderSize = <nl> + ( kHeaderPaddingStart + kCodeAlignmentMask ) & ~ kCodeAlignmentMask ; <nl> + <nl> + / / Data or code not directly visited by GC directly starts here . <nl> + / / The serializer needs to copy bytes starting from here verbatim . <nl> + / / Objects embedded into code is visited via reloc info . <nl> + static const int kDataStart = kInstructionSizeOffset ; <nl> + <nl> + inline int GetUnwindingInfoSizeOffset ( ) const ; <nl> + <nl> + class BodyDescriptor ; <nl> + <nl> + / / Flags layout . BitField < type , shift , size > . <nl> + class HasUnwindingInfoField : public BitField < bool , 0 , 1 > { } ; <nl> + class KindField : public BitField < Kind , HasUnwindingInfoField : : kNext , 5 > { } ; <nl> + STATIC_ASSERT ( NUMBER_OF_KINDS < = KindField : : kMax ) ; <nl> + <nl> + / / KindSpecificFlags1 layout ( STUB , BUILTIN and OPTIMIZED_FUNCTION ) <nl> + static const int kStackSlotsFirstBit = 0 ; <nl> + static const int kStackSlotsBitCount = 24 ; <nl> + static const int kMarkedForDeoptimizationBit = <nl> + kStackSlotsFirstBit + kStackSlotsBitCount ; <nl> + static const int kDeoptAlreadyCountedBit = kMarkedForDeoptimizationBit + 1 ; <nl> + static const int kIsTurbofannedBit = kDeoptAlreadyCountedBit + 1 ; <nl> + static const int kCanHaveWeakObjects = kIsTurbofannedBit + 1 ; <nl> + / / Could be moved to overlap previous bits when we need more space . <nl> + static const int kIsConstructStub = kCanHaveWeakObjects + 1 ; <nl> + static const int kIsPromiseRejection = kIsConstructStub + 1 ; <nl> + static const int kIsExceptionCaught = kIsPromiseRejection + 1 ; <nl> + <nl> + STATIC_ASSERT ( kStackSlotsFirstBit + kStackSlotsBitCount < = 32 ) ; <nl> + STATIC_ASSERT ( kIsExceptionCaught + 1 < = 32 ) ; <nl> + <nl> + class StackSlotsField <nl> + : public BitField < int , kStackSlotsFirstBit , kStackSlotsBitCount > { <nl> + } ; / / NOLINT <nl> + class MarkedForDeoptimizationField <nl> + : public BitField < bool , kMarkedForDeoptimizationBit , 1 > { } ; / / NOLINT <nl> + class DeoptAlreadyCountedField <nl> + : public BitField < bool , kDeoptAlreadyCountedBit , 1 > { } ; / / NOLINT <nl> + class IsTurbofannedField : public BitField < bool , kIsTurbofannedBit , 1 > { <nl> + } ; / / NOLINT <nl> + class CanHaveWeakObjectsField <nl> + : public BitField < bool , kCanHaveWeakObjects , 1 > { } ; / / NOLINT <nl> + class IsConstructStubField : public BitField < bool , kIsConstructStub , 1 > { <nl> + } ; / / NOLINT <nl> + class IsPromiseRejectionField <nl> + : public BitField < bool , kIsPromiseRejection , 1 > { } ; / / NOLINT <nl> + class IsExceptionCaughtField : public BitField < bool , kIsExceptionCaught , 1 > { <nl> + } ; / / NOLINT <nl> + <nl> + / / KindSpecificFlags2 layout ( ALL ) <nl> + static const int kHasTaggedStackBit = 0 ; <nl> + class HasTaggedStackField : public BitField < bool , kHasTaggedStackBit , 1 > { } ; <nl> + <nl> + / / KindSpecificFlags2 layout ( STUB and OPTIMIZED_FUNCTION ) <nl> + static const int kSafepointTableOffsetFirstBit = kHasTaggedStackBit + 1 ; <nl> + static const int kSafepointTableOffsetBitCount = 30 ; <nl> + <nl> + STATIC_ASSERT ( kSafepointTableOffsetFirstBit + kSafepointTableOffsetBitCount < = <nl> + 32 ) ; <nl> + STATIC_ASSERT ( 1 + kSafepointTableOffsetBitCount < = 32 ) ; <nl> + <nl> + class SafepointTableOffsetField <nl> + : public BitField < int , kSafepointTableOffsetFirstBit , <nl> + kSafepointTableOffsetBitCount > { } ; / / NOLINT <nl> + <nl> + static const int kArgumentsBits = 16 ; <nl> + static const int kMaxArguments = ( 1 < < kArgumentsBits ) - 1 ; <nl> + <nl> + private : <nl> + friend class RelocIterator ; <nl> + <nl> + bool is_promise_rejection ( ) const ; <nl> + bool is_exception_caught ( ) const ; <nl> + <nl> + DISALLOW_IMPLICIT_CONSTRUCTORS ( Code ) ; <nl> + } ; <nl> + <nl> + class AbstractCode : public HeapObject { <nl> + public : <nl> + / / All code kinds and INTERPRETED_FUNCTION . <nl> + enum Kind { <nl> + # define DEFINE_CODE_KIND_ENUM ( name ) name , <nl> + CODE_KIND_LIST ( DEFINE_CODE_KIND_ENUM ) <nl> + # undef DEFINE_CODE_KIND_ENUM <nl> + INTERPRETED_FUNCTION , <nl> + NUMBER_OF_KINDS <nl> + } ; <nl> + <nl> + static const char * Kind2String ( Kind kind ) ; <nl> + <nl> + int SourcePosition ( int offset ) ; <nl> + int SourceStatementPosition ( int offset ) ; <nl> + <nl> + / / Returns the address of the first instruction . <nl> + inline Address instruction_start ( ) ; <nl> + <nl> + / / Returns the address right after the last instruction . <nl> + inline Address instruction_end ( ) ; <nl> + <nl> + / / Returns the size of the code instructions . <nl> + inline int instruction_size ( ) ; <nl> + <nl> + / / Return the source position table . <nl> + inline ByteArray * source_position_table ( ) ; <nl> + <nl> + / / Set the source position table . <nl> + inline void set_source_position_table ( ByteArray * source_position_table ) ; <nl> + <nl> + inline Object * stack_frame_cache ( ) ; <nl> + static void SetStackFrameCache ( Handle < AbstractCode > abstract_code , <nl> + Handle < UnseededNumberDictionary > cache ) ; <nl> + void DropStackFrameCache ( ) ; <nl> + <nl> + / / Returns the size of instructions and the metadata . <nl> + inline int SizeIncludingMetadata ( ) ; <nl> + <nl> + / / Returns true if pc is inside this object ' s instructions . <nl> + inline bool contains ( byte * pc ) ; <nl> + <nl> + / / Returns the AbstractCode : : Kind of the code . <nl> + inline Kind kind ( ) ; <nl> + <nl> + / / Calculate the size of the code object to report for log events . This takes <nl> + / / the layout of the code object into account . <nl> + inline int ExecutableSize ( ) ; <nl> + <nl> + DECL_CAST ( AbstractCode ) <nl> + inline Code * GetCode ( ) ; <nl> + inline BytecodeArray * GetBytecodeArray ( ) ; <nl> + <nl> + / / Max loop nesting marker used to postpose OSR . We don ' t take loop <nl> + / / nesting that is deeper than 5 levels into account . <nl> + static const int kMaxLoopNestingMarker = 6 ; <nl> + } ; <nl> + <nl> + / / Dependent code is a singly linked list of fixed arrays . Each array contains <nl> + / / code objects in weak cells for one dependent group . The suffix of the array <nl> + / / can be filled with the undefined value if the number of codes is less than <nl> + / / the length of the array . <nl> + / / <nl> + / / + mmmmmm + mmmmmmmmmmmmmmm - - + mmmmmm - - + mmmmmm - - + mmm - - + mmmmmm - - + mmmmmmmmm - - + mmm - - + <nl> + / / | next | count & group 1 | code 1 | code 2 | . . . | code n | undefined | . . . | <nl> + / / + mmmmmm + mmmmmmmmmmmmmmm - - + mmmmmm - - + mmmmmm - - + mmm - - + mmmmmm - - + mmmmmmmmm - - + mmm - - + <nl> + / / | <nl> + / / V <nl> + / / + mmmmmm + mmmmmmmmmmmmmmm - - + mmmmmm - - + mmmmmm - - + mmm - - + mmmmmm - - + mmmmmmmmm - - + mmm - - + <nl> + / / | next | count & group 2 | code 1 | code 2 | . . . | code m | undefined | . . . | <nl> + / / + mmmmmm + mmmmmmmmmmmmmmm - - + mmmmmm - - + mmmmmm - - + mmm - - + mmmmmm - - + mmmmmmmmm - - + mmm - - + <nl> + / / | <nl> + / / V <nl> + / / empty_fixed_array ( ) <nl> + / / <nl> + / / The list of fixed arrays is ordered by dependency groups . <nl> + <nl> + class DependentCode : public FixedArray { <nl> + public : <nl> + enum DependencyGroup { <nl> + / / Group of code that weakly embed this map and depend on being <nl> + / / deoptimized when the map is garbage collected . <nl> + kWeakCodeGroup , <nl> + / / Group of code that embed a transition to this map , and depend on being <nl> + / / deoptimized when the transition is replaced by a new version . <nl> + kTransitionGroup , <nl> + / / Group of code that omit run - time prototype checks for prototypes <nl> + / / described by this map . The group is deoptimized whenever an object <nl> + / / described by this map changes shape ( and transitions to a new map ) , <nl> + / / possibly invalidating the assumptions embedded in the code . <nl> + kPrototypeCheckGroup , <nl> + / / Group of code that depends on global property values in property cells <nl> + / / not being changed . <nl> + kPropertyCellChangedGroup , <nl> + / / Group of code that omit run - time checks for field ( s ) introduced by <nl> + / / this map , i . e . for the field type . <nl> + kFieldOwnerGroup , <nl> + / / Group of code that omit run - time type checks for initial maps of <nl> + / / constructors . <nl> + kInitialMapChangedGroup , <nl> + / / Group of code that depends on tenuring information in AllocationSites <nl> + / / not being changed . <nl> + kAllocationSiteTenuringChangedGroup , <nl> + / / Group of code that depends on element transition information in <nl> + / / AllocationSites not being changed . <nl> + kAllocationSiteTransitionChangedGroup <nl> + } ; <nl> + <nl> + static const int kGroupCount = kAllocationSiteTransitionChangedGroup + 1 ; <nl> + static const int kNextLinkIndex = 0 ; <nl> + static const int kFlagsIndex = 1 ; <nl> + static const int kCodesStartIndex = 2 ; <nl> + <nl> + bool Contains ( DependencyGroup group , WeakCell * code_cell ) ; <nl> + bool IsEmpty ( DependencyGroup group ) ; <nl> + <nl> + static Handle < DependentCode > InsertCompilationDependencies ( <nl> + Handle < DependentCode > entries , DependencyGroup group , <nl> + Handle < Foreign > info ) ; <nl> + <nl> + static Handle < DependentCode > InsertWeakCode ( Handle < DependentCode > entries , <nl> + DependencyGroup group , <nl> + Handle < WeakCell > code_cell ) ; <nl> + <nl> + void UpdateToFinishedCode ( DependencyGroup group , Foreign * info , <nl> + WeakCell * code_cell ) ; <nl> + <nl> + void RemoveCompilationDependencies ( DependentCode : : DependencyGroup group , <nl> + Foreign * info ) ; <nl> + <nl> + void DeoptimizeDependentCodeGroup ( Isolate * isolate , <nl> + DependentCode : : DependencyGroup group ) ; <nl> + <nl> + bool MarkCodeForDeoptimization ( Isolate * isolate , <nl> + DependentCode : : DependencyGroup group ) ; <nl> + <nl> + / / The following low - level accessors should only be used by this class <nl> + / / and the mark compact collector . <nl> + inline DependentCode * next_link ( ) ; <nl> + inline void set_next_link ( DependentCode * next ) ; <nl> + inline int count ( ) ; <nl> + inline void set_count ( int value ) ; <nl> + inline DependencyGroup group ( ) ; <nl> + inline void set_group ( DependencyGroup group ) ; <nl> + inline Object * object_at ( int i ) ; <nl> + inline void set_object_at ( int i , Object * object ) ; <nl> + inline void clear_at ( int i ) ; <nl> + inline void copy ( int from , int to ) ; <nl> + DECL_CAST ( DependentCode ) <nl> + <nl> + static const char * DependencyGroupName ( DependencyGroup group ) ; <nl> + static void SetMarkedForDeoptimization ( Code * code , DependencyGroup group ) ; <nl> + <nl> + private : <nl> + static Handle < DependentCode > Insert ( Handle < DependentCode > entries , <nl> + DependencyGroup group , <nl> + Handle < Object > object ) ; <nl> + static Handle < DependentCode > New ( DependencyGroup group , Handle < Object > object , <nl> + Handle < DependentCode > next ) ; <nl> + static Handle < DependentCode > EnsureSpace ( Handle < DependentCode > entries ) ; <nl> + / / Compact by removing cleared weak cells and return true if there was <nl> + / / any cleared weak cell . <nl> + bool Compact ( ) ; <nl> + static int Grow ( int number_of_entries ) { <nl> + if ( number_of_entries < 5 ) return number_of_entries + 1 ; <nl> + return number_of_entries * 5 / 4 ; <nl> + } <nl> + inline int flags ( ) ; <nl> + inline void set_flags ( int flags ) ; <nl> + class GroupField : public BitField < int , 0 , 3 > { } ; <nl> + class CountField : public BitField < int , 3 , 27 > { } ; <nl> + STATIC_ASSERT ( kGroupCount < = GroupField : : kMax + 1 ) ; <nl> + } ; <nl> + <nl> + / / BytecodeArray represents a sequence of interpreter bytecodes . <nl> + class BytecodeArray : public FixedArrayBase { <nl> + public : <nl> + enum Age { <nl> + kNoAgeBytecodeAge = 0 , <nl> + kQuadragenarianBytecodeAge , <nl> + kQuinquagenarianBytecodeAge , <nl> + kSexagenarianBytecodeAge , <nl> + kSeptuagenarianBytecodeAge , <nl> + kOctogenarianBytecodeAge , <nl> + kAfterLastBytecodeAge , <nl> + kFirstBytecodeAge = kNoAgeBytecodeAge , <nl> + kLastBytecodeAge = kAfterLastBytecodeAge - 1 , <nl> + kBytecodeAgeCount = kAfterLastBytecodeAge - kFirstBytecodeAge - 1 , <nl> + kIsOldBytecodeAge = kSexagenarianBytecodeAge <nl> + } ; <nl> + <nl> + static int SizeFor ( int length ) { <nl> + return OBJECT_POINTER_ALIGN ( kHeaderSize + length ) ; <nl> + } <nl> + <nl> + / / Setter and getter <nl> + inline byte get ( int index ) ; <nl> + inline void set ( int index , byte value ) ; <nl> + <nl> + / / Returns data start address . <nl> + inline Address GetFirstBytecodeAddress ( ) ; <nl> + <nl> + / / Accessors for frame size . <nl> + inline int frame_size ( ) const ; <nl> + inline void set_frame_size ( int frame_size ) ; <nl> + <nl> + / / Accessor for register count ( derived from frame_size ) . <nl> + inline int register_count ( ) const ; <nl> + <nl> + / / Accessors for parameter count ( including implicit ' this ' receiver ) . <nl> + inline int parameter_count ( ) const ; <nl> + inline void set_parameter_count ( int number_of_parameters ) ; <nl> + <nl> + / / Register used to pass the incoming new . target or generator object from the <nl> + / / fucntion call . <nl> + inline interpreter : : Register incoming_new_target_or_generator_register ( ) <nl> + const ; <nl> + inline void set_incoming_new_target_or_generator_register ( <nl> + interpreter : : Register incoming_new_target_or_generator_register ) ; <nl> + <nl> + / / Accessors for profiling count . <nl> + inline int interrupt_budget ( ) const ; <nl> + inline void set_interrupt_budget ( int interrupt_budget ) ; <nl> + <nl> + / / Accessors for OSR loop nesting level . <nl> + inline int osr_loop_nesting_level ( ) const ; <nl> + inline void set_osr_loop_nesting_level ( int depth ) ; <nl> + <nl> + / / Accessors for bytecode ' s code age . <nl> + inline Age bytecode_age ( ) const ; <nl> + inline void set_bytecode_age ( Age age ) ; <nl> + <nl> + / / Accessors for the constant pool . <nl> + DECL_ACCESSORS ( constant_pool , FixedArray ) <nl> + <nl> + / / Accessors for handler table containing offsets of exception handlers . <nl> + DECL_ACCESSORS ( handler_table , FixedArray ) <nl> + <nl> + / / Accessors for source position table containing mappings between byte code <nl> + / / offset and source position or SourcePositionTableWithFrameCache . <nl> + DECL_ACCESSORS ( source_position_table , Object ) <nl> + <nl> + inline ByteArray * SourcePositionTable ( ) ; <nl> + <nl> + DECL_CAST ( BytecodeArray ) <nl> + <nl> + / / Dispatched behavior . <nl> + inline int BytecodeArraySize ( ) ; <nl> + <nl> + inline int instruction_size ( ) ; <nl> + <nl> + / / Returns the size of bytecode and its metadata . This includes the size of <nl> + / / bytecode , constant pool , source position table , and handler table . <nl> + inline int SizeIncludingMetadata ( ) ; <nl> + <nl> + int SourcePosition ( int offset ) ; <nl> + int SourceStatementPosition ( int offset ) ; <nl> + <nl> + DECL_PRINTER ( BytecodeArray ) <nl> + DECL_VERIFIER ( BytecodeArray ) <nl> + <nl> + void Disassemble ( std : : ostream & os ) ; <nl> + <nl> + void CopyBytecodesTo ( BytecodeArray * to ) ; <nl> + <nl> + / / Bytecode aging <nl> + bool IsOld ( ) const ; <nl> + void MakeOlder ( ) ; <nl> + <nl> + / / Clear uninitialized padding space . This ensures that the snapshot content <nl> + / / is deterministic . <nl> + inline void clear_padding ( ) ; <nl> + <nl> + / / Layout description . <nl> + # define BYTECODE_ARRAY_FIELDS ( V ) \ <nl> + / * Pointer fields . * / \ <nl> + V ( kConstantPoolOffset , kPointerSize ) \ <nl> + V ( kHandlerTableOffset , kPointerSize ) \ <nl> + V ( kSourcePositionTableOffset , kPointerSize ) \ <nl> + V ( kFrameSizeOffset , kIntSize ) \ <nl> + V ( kParameterSizeOffset , kIntSize ) \ <nl> + V ( kIncomingNewTargetOrGeneratorRegisterOffset , kIntSize ) \ <nl> + V ( kInterruptBudgetOffset , kIntSize ) \ <nl> + V ( kOSRNestingLevelOffset , kCharSize ) \ <nl> + V ( kBytecodeAgeOffset , kCharSize ) \ <nl> + / * Total size . * / \ <nl> + V ( kHeaderSize , 0 ) <nl> + <nl> + DEFINE_FIELD_OFFSET_CONSTANTS ( FixedArrayBase : : kHeaderSize , <nl> + BYTECODE_ARRAY_FIELDS ) <nl> + # undef BYTECODE_ARRAY_FIELDS <nl> + <nl> + / / Maximal memory consumption for a single BytecodeArray . <nl> + static const int kMaxSize = 512 * MB ; <nl> + / / Maximal length of a single BytecodeArray . <nl> + static const int kMaxLength = kMaxSize - kHeaderSize ; <nl> + <nl> + class BodyDescriptor ; <nl> + / / No weak fields . <nl> + typedef BodyDescriptor BodyDescriptorWeak ; <nl> + <nl> + private : <nl> + DISALLOW_IMPLICIT_CONSTRUCTORS ( BytecodeArray ) ; <nl> + } ; <nl> + <nl> + / / DeoptimizationInputData is a fixed array used to hold the deoptimization <nl> + / / data for optimized code . It also contains information about functions that <nl> + / / were inlined . If N different functions were inlined then first N elements of <nl> + / / the literal array will contain these functions . <nl> + / / <nl> + / / It can be empty . <nl> + class DeoptimizationInputData : public FixedArray { <nl> + public : <nl> + / / Layout description . Indices in the array . <nl> + static const int kTranslationByteArrayIndex = 0 ; <nl> + static const int kInlinedFunctionCountIndex = 1 ; <nl> + static const int kLiteralArrayIndex = 2 ; <nl> + static const int kOsrBytecodeOffsetIndex = 3 ; <nl> + static const int kOsrPcOffsetIndex = 4 ; <nl> + static const int kOptimizationIdIndex = 5 ; <nl> + static const int kSharedFunctionInfoIndex = 6 ; <nl> + static const int kWeakCellCacheIndex = 7 ; <nl> + static const int kInliningPositionsIndex = 8 ; <nl> + static const int kFirstDeoptEntryIndex = 9 ; <nl> + <nl> + / / Offsets of deopt entry elements relative to the start of the entry . <nl> + static const int kBytecodeOffsetRawOffset = 0 ; <nl> + static const int kTranslationIndexOffset = 1 ; <nl> + static const int kPcOffset = 2 ; <nl> + static const int kDeoptEntrySize = 3 ; <nl> + <nl> + / / Simple element accessors . <nl> + # define DECL_ELEMENT_ACCESSORS ( name , type ) \ <nl> + inline type * name ( ) ; \ <nl> + inline void Set # # name ( type * value ) ; <nl> + <nl> + DECL_ELEMENT_ACCESSORS ( TranslationByteArray , ByteArray ) <nl> + DECL_ELEMENT_ACCESSORS ( InlinedFunctionCount , Smi ) <nl> + DECL_ELEMENT_ACCESSORS ( LiteralArray , FixedArray ) <nl> + DECL_ELEMENT_ACCESSORS ( OsrBytecodeOffset , Smi ) <nl> + DECL_ELEMENT_ACCESSORS ( OsrPcOffset , Smi ) <nl> + DECL_ELEMENT_ACCESSORS ( OptimizationId , Smi ) <nl> + DECL_ELEMENT_ACCESSORS ( SharedFunctionInfo , Object ) <nl> + DECL_ELEMENT_ACCESSORS ( WeakCellCache , Object ) <nl> + DECL_ELEMENT_ACCESSORS ( InliningPositions , PodArray < InliningPosition > ) <nl> + <nl> + # undef DECL_ELEMENT_ACCESSORS <nl> + <nl> + / / Accessors for elements of the ith deoptimization entry . <nl> + # define DECL_ENTRY_ACCESSORS ( name , type ) \ <nl> + inline type * name ( int i ) ; \ <nl> + inline void Set # # name ( int i , type * value ) ; <nl> + <nl> + DECL_ENTRY_ACCESSORS ( BytecodeOffsetRaw , Smi ) <nl> + DECL_ENTRY_ACCESSORS ( TranslationIndex , Smi ) <nl> + DECL_ENTRY_ACCESSORS ( Pc , Smi ) <nl> + <nl> + # undef DECL_ENTRY_ACCESSORS <nl> + <nl> + inline BailoutId BytecodeOffset ( int i ) ; <nl> + <nl> + inline void SetBytecodeOffset ( int i , BailoutId value ) ; <nl> + <nl> + inline int DeoptCount ( ) ; <nl> + <nl> + static const int kNotInlinedIndex = - 1 ; <nl> + <nl> + / / Returns the inlined function at the given position in LiteralArray , or the <nl> + / / outer function if index = = kNotInlinedIndex . <nl> + class SharedFunctionInfo * GetInlinedFunction ( int index ) ; <nl> + <nl> + / / Allocates a DeoptimizationInputData . <nl> + static Handle < DeoptimizationInputData > New ( Isolate * isolate , <nl> + int deopt_entry_count , <nl> + PretenureFlag pretenure ) ; <nl> + <nl> + DECL_CAST ( DeoptimizationInputData ) <nl> + <nl> + # ifdef ENABLE_DISASSEMBLER <nl> + void DeoptimizationInputDataPrint ( std : : ostream & os ) ; / / NOLINT <nl> + # endif <nl> + <nl> + private : <nl> + static int IndexForEntry ( int i ) { <nl> + return kFirstDeoptEntryIndex + ( i * kDeoptEntrySize ) ; <nl> + } <nl> + <nl> + static int LengthFor ( int entry_count ) { return IndexForEntry ( entry_count ) ; } <nl> + } ; <nl> + <nl> + } / / namespace internal <nl> + } / / namespace v8 <nl> + <nl> + # include " src / objects / object - macros - undef . h " <nl> + <nl> + # endif / / V8_OBJECTS_CODE_H_ <nl> mmm a / src / objects / debug - objects . h <nl> ppp b / src / objects / debug - objects . h <nl> <nl> namespace v8 { <nl> namespace internal { <nl> <nl> + class BytecodeArray ; <nl> + <nl> / / The DebugInfo class holds additional information for a function being <nl> / / debugged . <nl> class DebugInfo : public Struct { <nl> mmm a / src / objects / map . h <nl> ppp b / src / objects / map . h <nl> <nl> # define V8_OBJECTS_MAP_H_ <nl> <nl> # include " src / objects . h " <nl> + # include " src / objects / code . h " <nl> <nl> # include " src / globals . h " <nl> <nl> mmm a / src / objects / shared - function - info . h <nl> ppp b / src / objects / shared - function - info . h <nl> <nl> namespace v8 { <nl> namespace internal { <nl> <nl> + class BytecodeArray ; <nl> class CoverageInfo ; <nl> class DebugInfo ; <nl> <nl> mmm a / src / v8 . gyp <nl> ppp b / src / v8 . gyp <nl> <nl> ' objects / bigint - inl . h ' , <nl> ' objects / bigint . cc ' , <nl> ' objects / bigint . h ' , <nl> + ' objects / code - inl . h ' , <nl> + ' objects / code . h ' , <nl> ' objects / compilation - cache . h ' , <nl> ' objects / compilation - cache - inl . h ' , <nl> ' objects / debug - objects - inl . h ' , <nl> mmm a / src / visitors . cc <nl> ppp b / src / visitors . cc <nl> <nl> <nl> # include " src / visitors . h " <nl> <nl> - # include " src / objects . h " <nl> + # include " src / objects / code . h " <nl> <nl> namespace v8 { <nl> namespace internal { <nl> mmm a / test / cctest / interpreter / bytecode - expectations - printer . h <nl> ppp b / test / cctest / interpreter / bytecode - expectations - printer . h <nl> class Isolate ; <nl> <nl> namespace internal { <nl> <nl> + class BytecodeArray ; <nl> class SourcePositionTableIterator ; <nl> <nl> namespace interpreter { <nl> mmm a / test / unittests / source - position - table - unittest . cc <nl> ppp b / test / unittests / source - position - table - unittest . cc <nl> <nl> # include " src / v8 . h " <nl> <nl> # include " src / objects . h " <nl> + # include " src / objects / code . h " <nl> # include " src / source - position - table . h " <nl> # include " test / unittests / test - utils . h " <nl> <nl>
[ objects . h splitting ] Move Code & related classes .
v8/v8
d953b2ab726acca0b3abe90ce090a16d7ccc2ae3
2017-10-13T14:22:11Z
mmm a / tensorflow / core / tpu / kernels / BUILD <nl> ppp b / tensorflow / core / tpu / kernels / BUILD <nl> cc_library ( <nl> " / / tensorflow / compiler / xla : shape_util " , <nl> " / / tensorflow / compiler / xla : statusor " , <nl> " / / tensorflow / compiler / xla : xla_data_proto_cc " , <nl> - " / / tensorflow / compiler / xla / client : compile_only_client " , <nl> " / / tensorflow / compiler / xla / service : computation_layout " , <nl> " / / tensorflow / compiler / xla / service : dump " , <nl> " / / tensorflow / compiler / xla / service : hlo " , <nl> cc_library ( <nl> " / / tensorflow / core / framework : protos_all_cc " , <nl> " / / tensorflow / core / protobuf / tpu : compile_metadata_proto_cc " , <nl> " / / tensorflow / stream_executor / tpu : proto_helper " , <nl> + " @ com_google_absl / / absl / strings " , <nl> " @ com_google_absl / / absl / types : optional " , <nl> " @ com_google_absl / / absl / types : span " , <nl> ] , <nl> mmm a / tensorflow / core / tpu / kernels / tpu_compile_op_common . cc <nl> ppp b / tensorflow / core / tpu / kernels / tpu_compile_op_common . cc <nl> Status TpuCompileOpKernelCommon : : AssignReturnValueToCore ( <nl> <nl> Status TpuCompileOpKernelCommon : : BuildComputationArgumentDescriptions ( <nl> const std : : vector < TensorShape > & arg_shapes , <nl> - const OpInputList & guaranteed_constants , const XlaCompiler & compiler , <nl> + const GuaranteedConsts & guaranteed_constants , const XlaCompiler & compiler , <nl> std : : vector < XlaCompiler : : Argument > * args , <nl> std : : vector < tpu : : ShardingAndIndex > * arg_core_mapping , <nl> std : : vector < std : : vector < xla : : Shape > > * per_core_arg_shapes ) { <nl> / / Builds a description of the computation ' s arguments . <nl> int constant_count = 0 ; <nl> + size_t guaranteed_constants_size = 0 ; <nl> for ( int i = 0 ; i < metadata_ . args_size ( ) ; + + i ) { <nl> const tpu : : TPUCompileMetadataProto : : Arg & proto_arg = metadata_ . args ( i ) ; <nl> args - > push_back ( XlaCompiler : : Argument ( ) ) ; <nl> Status TpuCompileOpKernelCommon : : BuildComputationArgumentDescriptions ( <nl> break ; <nl> case tpu : : TPUCompileMetadataProto : : Arg : : GUARANTEED_CONSTANT : <nl> arg . kind = XlaCompiler : : Argument : : kConstant ; <nl> - TF_RET_CHECK ( constant_count < guaranteed_constants . size ( ) ) <nl> + guaranteed_constants_size = <nl> + guaranteed_constants . index ( ) = = 0 <nl> + ? std : : get < 0 > ( guaranteed_constants ) . size ( ) <nl> + : std : : get < 1 > ( guaranteed_constants ) - > size ( ) ; <nl> + TF_RET_CHECK ( constant_count < guaranteed_constants_size ) <nl> < < " More constant args in TPUCompileMetadataProto than constant " <nl> " tensors . " ; <nl> - arg . constant_value = guaranteed_constants [ constant_count + + ] ; <nl> + if ( guaranteed_constants . index ( ) = = 0 ) { <nl> + / / ` guaranteed_constants ` is of type ` absl : : Span < const TensorProto * <nl> + / / const > ` . <nl> + Tensor tensor ; <nl> + CHECK ( tensor . FromProto ( <nl> + * std : : get < 0 > ( guaranteed_constants ) [ constant_count + + ] ) ) <nl> + < < " Failed to deserialize invalid ` TensorProto ` into ` Tensor ` . " ; <nl> + arg . constant_value = tensor ; <nl> + } else { <nl> + / / ` guaranteed_constants ` is of type ` const OpInputList * const ` . <nl> + arg . constant_value = <nl> + ( * std : : get < 1 > ( guaranteed_constants ) ) [ constant_count + + ] ; <nl> + } <nl> break ; <nl> case tpu : : TPUCompileMetadataProto : : Arg : : INVALID : <nl> default : <nl> Status TpuCompileOpKernelCommon : : BuildComputationArgumentDescriptions ( <nl> TF_RETURN_IF_ERROR ( SetPerCoreArgShapes ( <nl> proto_arg , i , & xla_arg_shape , arg_core_mapping , per_core_arg_shapes ) ) ; <nl> } <nl> - TF_RET_CHECK ( constant_count = = guaranteed_constants . size ( ) ) <nl> + TF_RET_CHECK ( constant_count = = guaranteed_constants_size ) <nl> < < " Not all of the constant tensors were consumed . " ; <nl> <nl> return Status : : OK ( ) ; <nl> Status TpuCompileOpKernelCommon : : CompileTFFunctionToHlo ( <nl> const FunctionLibraryDefinition & flib_def , int graph_def_version , <nl> const XlaCompiler : : ShapeRepresentationFn shape_representation_fn , <nl> const std : : vector < TensorShape > & arg_shapes , <nl> - const OpInputList & guaranteed_constants , const NameAttrList & function , <nl> + const GuaranteedConsts & guaranteed_constants , const NameAttrList & function , <nl> std : : function < Status ( ResourceMgr * ) > populate_resource_manager_fn , <nl> xla : : CompileOnlyClient * client , <nl> std : : vector < tpu : : ShardingAndIndex > * arg_core_mapping , <nl> Status TpuCompileOpKernelCommon : : CompileTFFunctionToHlo ( <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> - / * static * / Status TpuCompileOpKernelCommon : : ComputeArgumentShapes ( <nl> + / * static * / <nl> + Status TpuCompileOpKernelCommon : : ComputeArgumentShapes ( <nl> const tpu : : TPUCompileMetadataProto & metadata , <nl> const std : : vector < TensorShape > & dynamic_shapes , <nl> std : : vector < TensorShape > * arg_shapes ) { <nl> Status TpuCompileOpKernelCommon : : CompileLocallyAndFillHostCache ( <nl> const OpInputList & guaranteed_constants , const TpuCompilationCacheKey & key , <nl> TpuProgramGroupInterface * tpu_program_group ) { <nl> absl : : Time start_time = absl : : Now ( ) ; <nl> - Status compile_status = <nl> - Compile ( * flib_runtime - > GetFunctionLibraryDefinition ( ) , <nl> - flib_runtime - > graph_def_version ( ) , mesh_state , dynamic_shapes , <nl> - guaranteed_constants , tpu_program_group ) ; <nl> + std : : vector < TensorShape > arg_shapes ; <nl> + TF_RETURN_IF_ERROR ( <nl> + ComputeArgumentShapes ( metadata_ , dynamic_shapes , & arg_shapes ) ) ; <nl> + Status compile_status ; <nl> + if ( use_mlir_ ) { <nl> + compile_status = Compile ( MlirToHloArgs { mlir_module_ } , mesh_state - > data ( ) , <nl> + arg_shapes , tpu_program_group ) ; <nl> + } else { <nl> + compile_status = <nl> + Compile ( FunctionToHloArgs { & function_ , <nl> + flib_runtime - > GetFunctionLibraryDefinition ( ) , <nl> + flib_runtime - > graph_def_version ( ) , <nl> + { & guaranteed_constants } } , <nl> + mesh_state - > data ( ) , arg_shapes , tpu_program_group ) ; <nl> + } <nl> <nl> absl : : Time end_time = absl : : Now ( ) ; <nl> auto duration = end_time - start_time ; <nl> mmm a / tensorflow / core / tpu / kernels / tpu_compile_op_common . h <nl> ppp b / tensorflow / core / tpu / kernels / tpu_compile_op_common . h <nl> class TpuCompileOpKernelCommon { <nl> <nl> void Compute ( OpKernelContext * ctx ) ; <nl> <nl> + / / Lowers Mlir or TF Function computation into HLO IR and using XLA compiler <nl> + / / compiles into TPU programs ready for execution . <nl> + virtual Status Compile ( <nl> + const std : : variant < MlirToHloArgs , FunctionToHloArgs > & computation , <nl> + const XLA_TpuMeshState * mesh_state , <nl> + const std : : vector < TensorShape > & arg_shapes , <nl> + TpuProgramGroupInterface * tpu_program_group ) = 0 ; <nl> + <nl> / / Computes shapes for each argument . Uses both the static shape from the <nl> / / metadata , and the dynamic shapes where the static shape is not <nl> / / defined . There must be one dynamic_shape for each argument with a <nl> class TpuCompileOpKernelCommon { <nl> protected : <nl> Status ComputeInternal ( OpKernelContext * ctx ) ; <nl> <nl> - / / Compile function that invokes the different helper functions to compile <nl> - / / the given function . <nl> - virtual Status Compile ( const FunctionLibraryDefinition & flib_def , <nl> - int graph_def_version , <nl> - const TpuMeshStateInterface * mesh_state , <nl> - const std : : vector < TensorShape > & dynamic_shapes , <nl> - const OpInputList & guaranteed_constants , <nl> - TpuProgramGroupInterface * tpu_program_group ) = 0 ; <nl> - <nl> / / Compile TPU program locally and populate the host compilation cache . <nl> Status CompileLocallyAndFillHostCache ( <nl> FunctionLibraryRuntime * flib_runtime , <nl> class TpuCompileOpKernelCommon { <nl> const FunctionLibraryDefinition & flib_def , int graph_def_version , <nl> const XlaCompiler : : ShapeRepresentationFn shape_representation_fn , <nl> const std : : vector < TensorShape > & arg_shapes , <nl> - const OpInputList & guaranteed_constants , const NameAttrList & function , <nl> + const GuaranteedConsts & guaranteed_constants , <nl> + const NameAttrList & function , <nl> std : : function < Status ( ResourceMgr * ) > populate_resource_manager_fn , <nl> xla : : CompileOnlyClient * client , <nl> std : : vector < tpu : : ShardingAndIndex > * arg_core_mapping , <nl> class TpuCompileOpKernelCommon { <nl> / / computation . <nl> Status BuildComputationArgumentDescriptions ( <nl> const std : : vector < TensorShape > & arg_shapes , <nl> - const OpInputList & guaranteed_constants , const XlaCompiler & compiler , <nl> + const GuaranteedConsts & guaranteed_constants , const XlaCompiler & compiler , <nl> std : : vector < XlaCompiler : : Argument > * args , <nl> std : : vector < tpu : : ShardingAndIndex > * arg_core_mapping , <nl> std : : vector < std : : vector < xla : : Shape > > * per_core_arg_shapes ) ; <nl> mmm a / tensorflow / core / tpu / kernels / tpu_compile_op_support . h <nl> ppp b / tensorflow / core / tpu / kernels / tpu_compile_op_support . h <nl> limitations under the License . <nl> # include < string > <nl> # include < vector > <nl> <nl> - # include " tensorflow / core / tpu / kernels / tpu_compilation_cache_key . h " <nl> - # include " tensorflow / core / tpu / kernels / tpu_compile . pb . h " <nl> + # include " absl / strings / string_view . h " <nl> # include " absl / types / optional . h " <nl> # include " absl / types / span . h " <nl> # include " tensorflow / cc / framework / ops . h " <nl> limitations under the License . <nl> # include " tensorflow / compiler / xla / shape_tree . h " <nl> # include " tensorflow / compiler / xla / statusor . h " <nl> # include " tensorflow / compiler / xla / xla_data . pb . h " <nl> + # include " tensorflow / core / framework / function . h " <nl> # include " tensorflow / core / framework / op_kernel . h " <nl> + # include " tensorflow / core / framework / tensor . pb . h " <nl> # include " tensorflow / core / framework / tensor_shape . h " <nl> # include " tensorflow / core / framework / types . pb . h " <nl> # include " tensorflow / core / protobuf / tpu / compile_metadata . pb . h " <nl> + # include " tensorflow / core / tpu / kernels / tpu_compile . pb . h " <nl> <nl> namespace tensorflow { <nl> namespace tpu { <nl> <nl> namespace se = : : stream_executor ; <nl> <nl> + / / List of parameters for lowering Mlir to HLO IR . <nl> + struct MlirToHloArgs { <nl> + absl : : string_view mlir_module ; <nl> + } ; <nl> + <nl> + / / Variant of guaranteed constant tensors types . <nl> + using GuaranteedConsts = std : : variant < absl : : Span < const TensorProto * const > , <nl> + const OpInputList * const > ; <nl> + <nl> + / / List of parameters for lowering function library definition to HLO IR . <nl> + struct FunctionToHloArgs { <nl> + const NameAttrList * const function ; <nl> + const FunctionLibraryDefinition * const flib_def ; <nl> + int graph_def_version ; <nl> + GuaranteedConsts guaranteed_constants ; <nl> + } ; <nl> + <nl> / / Persistent cache for compiled TPU program and the related compiler metadata <nl> / / intended for TPU inference . <nl> / / TODO ( henrytan ) : there is an opportunity to consolidate the interface with the <nl>
TPU Op library refactor
tensorflow/tensorflow
cedf4f2c5baf34ea3aa60e5855615ca0720916df
2020-07-13T16:32:32Z
mmm a / UnitTests / Makefile . unittests <nl> ppp b / UnitTests / Makefile . unittests <nl> SERVER_OPT : = \ <nl> - - javascript . action - directory @ top_srcdir @ / js / actions / system \ <nl> - - javascript . gc - interval 1 \ <nl> - - javascript . modules - path @ top_srcdir @ / js / server / modules : @ top_srcdir @ / js / common / modules \ <nl> + - - javascript . package - path @ top_srcdir @ / js / common / test - data / modules \ <nl> - - javascript . startup - directory @ top_srcdir @ / js \ <nl> - - ruby . action - directory @ top_srcdir @ / mr / actions / system \ <nl> - - ruby . modules - path @ top_srcdir @ / mr / server / modules : @ top_srcdir @ / mr / common / modules \ <nl> CLIENT_OPT : = \ <nl> - - configuration none \ <nl> - - javascript . startup - directory @ top_srcdir @ / js \ <nl> - - javascript . modules - path @ top_srcdir @ / js / client / modules : @ top_srcdir @ / js / common / modules \ <nl> + - - javascript . package - path @ top_srcdir @ / js / common / test - data / modules \ <nl> - - no - colors \ <nl> - - quiet <nl> <nl> endif <nl> # # # @ brief SHELL SERVER TESTS ( BASICS ) <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> <nl> - SHELL_COMMON = @ top_srcdir @ / js / common / tests / shell - document . js \ <nl> + SHELL_COMMON = @ top_srcdir @ / js / common / tests / shell - require . js \ <nl> + @ top_srcdir @ / js / common / tests / shell - document . js \ <nl> @ top_srcdir @ / js / common / tests / shell - edge . js \ <nl> @ top_srcdir @ / js / common / tests / shell - database . js \ <nl> @ top_srcdir @ / js / common / tests / shell - collection . js \ <nl> mmm a / js / common / bootstrap / modules . js <nl> ppp b / js / common / bootstrap / modules . js <nl> function stop_color_print ( ) { <nl> var GlobalPackage = new Package ( " / " , { name : " ArangoDB " } , undefined , PACKAGE_PATH ) ; <nl> <nl> Package . prototype . defineSystemModule = function ( path ) { <nl> - this . _moduleCache [ path ] = new Module ( path , ' system ' , GlobalPackage ) ; <nl> + var result = this . _moduleCache [ path ] = new Module ( path , ' system ' , GlobalPackage ) ; <nl> + <nl> + return result ; <nl> } ; <nl> <nl> Package . prototype . defineModule = function ( path , module ) { <nl> this . _moduleCache [ path ] = module ; <nl> + <nl> + return module ; <nl> } ; <nl> <nl> Package . prototype . clearModule = function ( path ) { <nl> function stop_color_print ( ) { <nl> return null ; <nl> } ; <nl> <nl> + Package . prototype . moduleNames = function ( ) { <nl> + var name ; <nl> + var names = [ ] ; <nl> + <nl> + for ( name in this . _moduleCache ) { <nl> + if ( this . _moduleCache . hasOwnProperty ( name ) ) { <nl> + names . push ( name ) ; <nl> + } <nl> + } <nl> + <nl> + return names ; <nl> + } ; <nl> + <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / / @ } <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> function stop_color_print ( ) { <nl> var internal = GlobalPackage . module ( " / internal " ) . exports ; <nl> var console = GlobalPackage . module ( " / console " ) . exports ; <nl> <nl> + internal . GlobalPackage = GlobalPackage ; <nl> + <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / / @ brief normalizes a module name <nl> / / / <nl> function stop_color_print ( ) { <nl> } <nl> <nl> var norm = module . normalize ( path ) ; <nl> + var m = GlobalPackage . module ( norm ) ; <nl> <nl> - if ( norm in ModuleCache ) { <nl> - var m = ModuleCache [ norm ] ; <nl> - <nl> - m . _normalized = { } ; <nl> - <nl> - if ( m . _type = = = ' system ' ) { <nl> - return ; <nl> - } <nl> + if ( m = = = null ) { <nl> + return ; <nl> + } <nl> <nl> - if ( norm = = = " / org / arangodb " <nl> - | | norm = = = " / org / arangodb / actions " <nl> - | | norm = = = " / org / arangodb / arango - collection " <nl> - | | norm = = = " / org / arangodb / arango - database " <nl> - | | norm = = = " / org / arangodb / arango - error " <nl> - | | norm = = = " / org / arangodb / arango - statement " <nl> - | | norm = = = " / org / arangodb / shaped - json " ) { <nl> - return ; <nl> - } <nl> + if ( m . _type = = = ' system ' ) { <nl> + return ; <nl> + } <nl> <nl> - delete ModuleCache [ norm ] ; <nl> + if ( norm = = = " / org / arangodb " <nl> + | | norm = = = " / org / arangodb / actions " <nl> + | | norm = = = " / org / arangodb / arango - collection " <nl> + | | norm = = = " / org / arangodb / arango - database " <nl> + | | norm = = = " / org / arangodb / arango - error " <nl> + | | norm = = = " / org / arangodb / arango - statement " <nl> + | | norm = = = " / org / arangodb / shaped - json " ) { <nl> + return ; <nl> } <nl> + <nl> + GlobalPackage . clearModule ( norm ) ; <nl> } ; <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> function stop_color_print ( ) { <nl> <nl> Module . prototype . unloadAll = function ( ) { <nl> var i ; <nl> - var path ; <nl> - var unload = [ ] ; <nl> + var names ; <nl> <nl> - for ( path in ModuleCache ) { <nl> - if ( ModuleCache . hasOwnProperty ( path ) ) { <nl> - unload . push ( path ) ; <nl> - } <nl> - } <nl> + names = GlobalPackage . moduleNames ( ) ; <nl> <nl> - for ( i = 0 ; i < unload . length ; + + i ) { <nl> - this . unload ( unload [ i ] ) ; <nl> + for ( i = 0 ; i < names . length ; + + i ) { <nl> + this . unload ( names [ i ] ) ; <nl> } <nl> } ; <nl> <nl> new file mode 100644 <nl> index 00000000000 . . 5dbf9b79770 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / . gitignore <nl> <nl> + lib <nl> + _site <nl> + include <nl> + bin <nl> + src <nl> + . Python <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . dfa3fce78f8 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / README . txt <nl> @ @ - 0 , 0 + 1 @ @ <nl> + The Official Specs for CommonJS <nl> new file mode 100644 <nl> index 00000000000 . . 49012e352fe <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / bootstrap . py <nl> <nl> + # ! / usr / bin / env python <nl> + # # WARNING : This file is generated <nl> + # ! / usr / bin / env python <nl> + " " " Create a " virtual " Python installation <nl> + " " " <nl> + <nl> + import sys <nl> + import os <nl> + import optparse <nl> + import shutil <nl> + import logging <nl> + import distutils . sysconfig <nl> + try : <nl> + import subprocess <nl> + except ImportError , e : <nl> + if sys . version_info < = ( 2 , 3 ) : <nl> + print ' ERROR : % s ' % e <nl> + print ' ERROR : this script requires Python 2 . 4 or greater ; or at least the subprocess module . ' <nl> + print ' If you copy subprocess . py from a newer version of Python this script will probably work ' <nl> + sys . exit ( 101 ) <nl> + else : <nl> + raise <nl> + try : <nl> + set <nl> + except NameError : <nl> + from sets import Set as set <nl> + <nl> + join = os . path . join <nl> + py_version = ' python % s . % s ' % ( sys . version_info [ 0 ] , sys . version_info [ 1 ] ) <nl> + is_jython = sys . platform . startswith ( ' java ' ) <nl> + expected_exe = is_jython and ' jython ' or ' python ' <nl> + <nl> + REQUIRED_MODULES = [ ' os ' , ' posix ' , ' posixpath ' , ' ntpath ' , ' genericpath ' , <nl> + ' fnmatch ' , ' locale ' , ' encodings ' , ' codecs ' , <nl> + ' stat ' , ' UserDict ' , ' readline ' , ' copy_reg ' , ' types ' , <nl> + ' re ' , ' sre ' , ' sre_parse ' , ' sre_constants ' , ' sre_compile ' , <nl> + ' lib - dynload ' , ' config ' , ' zlib ' ] <nl> + <nl> + if sys . version_info [ : 2 ] = = ( 2 , 6 ) : <nl> + REQUIRED_MODULES . extend ( [ ' warnings ' , ' linecache ' , ' _abcoll ' , ' abc ' ] ) <nl> + if sys . version_info [ : 2 ] < = ( 2 , 3 ) : <nl> + REQUIRED_MODULES . extend ( [ ' sets ' , ' __future__ ' ] ) <nl> + <nl> + class Logger ( object ) : <nl> + <nl> + " " " <nl> + Logging object for use in command - line script . Allows ranges of <nl> + levels , to avoid some redundancy of displayed information . <nl> + " " " <nl> + <nl> + DEBUG = logging . DEBUG <nl> + INFO = logging . INFO <nl> + NOTIFY = ( logging . INFO + logging . WARN ) / 2 <nl> + WARN = WARNING = logging . WARN <nl> + ERROR = logging . ERROR <nl> + FATAL = logging . FATAL <nl> + <nl> + LEVELS = [ DEBUG , INFO , NOTIFY , WARN , ERROR , FATAL ] <nl> + <nl> + def __init__ ( self , consumers ) : <nl> + self . consumers = consumers <nl> + self . indent = 0 <nl> + self . in_progress = None <nl> + self . in_progress_hanging = False <nl> + <nl> + def debug ( self , msg , * args , * * kw ) : <nl> + self . log ( self . DEBUG , msg , * args , * * kw ) <nl> + def info ( self , msg , * args , * * kw ) : <nl> + self . log ( self . INFO , msg , * args , * * kw ) <nl> + def notify ( self , msg , * args , * * kw ) : <nl> + self . log ( self . NOTIFY , msg , * args , * * kw ) <nl> + def warn ( self , msg , * args , * * kw ) : <nl> + self . log ( self . WARN , msg , * args , * * kw ) <nl> + def error ( self , msg , * args , * * kw ) : <nl> + self . log ( self . WARN , msg , * args , * * kw ) <nl> + def fatal ( self , msg , * args , * * kw ) : <nl> + self . log ( self . FATAL , msg , * args , * * kw ) <nl> + def log ( self , level , msg , * args , * * kw ) : <nl> + if args : <nl> + if kw : <nl> + raise TypeError ( <nl> + " You may give positional or keyword arguments , not both " ) <nl> + args = args or kw <nl> + rendered = None <nl> + for consumer_level , consumer in self . consumers : <nl> + if self . level_matches ( level , consumer_level ) : <nl> + if ( self . in_progress_hanging <nl> + and consumer in ( sys . stdout , sys . stderr ) ) : <nl> + self . in_progress_hanging = False <nl> + sys . stdout . write ( ' \ n ' ) <nl> + sys . stdout . flush ( ) <nl> + if rendered is None : <nl> + if args : <nl> + rendered = msg % args <nl> + else : <nl> + rendered = msg <nl> + rendered = ' ' * self . indent + rendered <nl> + if hasattr ( consumer , ' write ' ) : <nl> + consumer . write ( rendered + ' \ n ' ) <nl> + else : <nl> + consumer ( rendered ) <nl> + <nl> + def start_progress ( self , msg ) : <nl> + assert not self . in_progress , ( <nl> + " Tried to start_progress ( % r ) while in_progress % r " <nl> + % ( msg , self . in_progress ) ) <nl> + if self . level_matches ( self . NOTIFY , self . _stdout_level ( ) ) : <nl> + sys . stdout . write ( msg ) <nl> + sys . stdout . flush ( ) <nl> + self . in_progress_hanging = True <nl> + else : <nl> + self . in_progress_hanging = False <nl> + self . in_progress = msg <nl> + <nl> + def end_progress ( self , msg = ' done . ' ) : <nl> + assert self . in_progress , ( <nl> + " Tried to end_progress without start_progress " ) <nl> + if self . stdout_level_matches ( self . NOTIFY ) : <nl> + if not self . in_progress_hanging : <nl> + # Some message has been printed out since start_progress <nl> + sys . stdout . write ( ' . . . ' + self . in_progress + msg + ' \ n ' ) <nl> + sys . stdout . flush ( ) <nl> + else : <nl> + sys . stdout . write ( msg + ' \ n ' ) <nl> + sys . stdout . flush ( ) <nl> + self . in_progress = None <nl> + self . in_progress_hanging = False <nl> + <nl> + def show_progress ( self ) : <nl> + " " " If we are in a progress scope , and no log messages have been <nl> + shown , write out another ' . ' " " " <nl> + if self . in_progress_hanging : <nl> + sys . stdout . write ( ' . ' ) <nl> + sys . stdout . flush ( ) <nl> + <nl> + def stdout_level_matches ( self , level ) : <nl> + " " " Returns true if a message at this level will go to stdout " " " <nl> + return self . level_matches ( level , self . _stdout_level ( ) ) <nl> + <nl> + def _stdout_level ( self ) : <nl> + " " " Returns the level that stdout runs at " " " <nl> + for level , consumer in self . consumers : <nl> + if consumer is sys . stdout : <nl> + return level <nl> + return self . FATAL <nl> + <nl> + def level_matches ( self , level , consumer_level ) : <nl> + " " " <nl> + > > > l = Logger ( ) <nl> + > > > l . level_matches ( 3 , 4 ) <nl> + False <nl> + > > > l . level_matches ( 3 , 2 ) <nl> + True <nl> + > > > l . level_matches ( slice ( None , 3 ) , 3 ) <nl> + False <nl> + > > > l . level_matches ( slice ( None , 3 ) , 2 ) <nl> + True <nl> + > > > l . level_matches ( slice ( 1 , 3 ) , 1 ) <nl> + True <nl> + > > > l . level_matches ( slice ( 2 , 3 ) , 1 ) <nl> + False <nl> + " " " <nl> + if isinstance ( level , slice ) : <nl> + start , stop = level . start , level . stop <nl> + if start is not None and start > consumer_level : <nl> + return False <nl> + if stop is not None or stop < = consumer_level : <nl> + return False <nl> + return True <nl> + else : <nl> + return level > = consumer_level <nl> + <nl> + # @ classmethod <nl> + def level_for_integer ( cls , level ) : <nl> + levels = cls . LEVELS <nl> + if level < 0 : <nl> + return levels [ 0 ] <nl> + if level > = len ( levels ) : <nl> + return levels [ - 1 ] <nl> + return levels [ level ] <nl> + <nl> + level_for_integer = classmethod ( level_for_integer ) <nl> + <nl> + def mkdir ( path ) : <nl> + if not os . path . exists ( path ) : <nl> + logger . info ( ' Creating % s ' , path ) <nl> + os . makedirs ( path ) <nl> + else : <nl> + logger . info ( ' Directory % s already exists ' , path ) <nl> + <nl> + def copyfile ( src , dest , symlink = True ) : <nl> + if not os . path . exists ( src ) : <nl> + # Some bad symlink in the src <nl> + logger . warn ( ' Cannot find file % s ( bad symlink ) ' , src ) <nl> + return <nl> + if os . path . exists ( dest ) : <nl> + logger . debug ( ' File % s already exists ' , dest ) <nl> + return <nl> + if not os . path . exists ( os . path . dirname ( dest ) ) : <nl> + logger . info ( ' Creating parent directories for % s ' % os . path . dirname ( dest ) ) <nl> + os . makedirs ( os . path . dirname ( dest ) ) <nl> + if symlink and hasattr ( os , ' symlink ' ) : <nl> + logger . info ( ' Symlinking % s ' , dest ) <nl> + os . symlink ( os . path . abspath ( src ) , dest ) <nl> + else : <nl> + logger . info ( ' Copying to % s ' , dest ) <nl> + if os . path . isdir ( src ) : <nl> + shutil . copytree ( src , dest , True ) <nl> + else : <nl> + shutil . copy2 ( src , dest ) <nl> + <nl> + def writefile ( dest , content , overwrite = True ) : <nl> + if not os . path . exists ( dest ) : <nl> + logger . info ( ' Writing % s ' , dest ) <nl> + f = open ( dest , ' wb ' ) <nl> + f . write ( content ) <nl> + f . close ( ) <nl> + return <nl> + else : <nl> + f = open ( dest , ' rb ' ) <nl> + c = f . read ( ) <nl> + f . close ( ) <nl> + if c ! = content : <nl> + if not overwrite : <nl> + logger . notify ( ' File % s exists with different content ; not overwriting ' , dest ) <nl> + return <nl> + logger . notify ( ' Overwriting % s with new content ' , dest ) <nl> + f = open ( dest , ' wb ' ) <nl> + f . write ( content ) <nl> + f . close ( ) <nl> + else : <nl> + logger . info ( ' Content % s already in place ' , dest ) <nl> + <nl> + def rmtree ( dir ) : <nl> + if os . path . exists ( dir ) : <nl> + logger . notify ( ' Deleting tree % s ' , dir ) <nl> + shutil . rmtree ( dir ) <nl> + else : <nl> + logger . info ( ' Do not need to delete % s ; already gone ' , dir ) <nl> + <nl> + def make_exe ( fn ) : <nl> + if hasattr ( os , ' chmod ' ) : <nl> + oldmode = os . stat ( fn ) . st_mode & 07777 <nl> + newmode = ( oldmode | 0555 ) & 07777 <nl> + os . chmod ( fn , newmode ) <nl> + logger . info ( ' Changed mode of % s to % s ' , fn , oct ( newmode ) ) <nl> + <nl> + def install_setuptools ( py_executable , unzip = False ) : <nl> + setup_fn = ' setuptools - 0 . 6c9 - py % s . egg ' % sys . version [ : 3 ] <nl> + search_dirs = [ ' . ' , os . path . dirname ( __file__ ) , join ( os . path . dirname ( __file__ ) , ' support - files ' ) ] <nl> + if os . path . splitext ( os . path . dirname ( __file__ ) ) [ 0 ] ! = ' virtualenv ' : <nl> + # Probably some boot script ; just in case virtualenv is installed . . . <nl> + try : <nl> + import virtualenv <nl> + except ImportError : <nl> + pass <nl> + else : <nl> + search_dirs . append ( os . path . join ( os . path . dirname ( virtualenv . __file__ ) , ' support - files ' ) ) <nl> + for dir in search_dirs : <nl> + if os . path . exists ( join ( dir , setup_fn ) ) : <nl> + setup_fn = join ( dir , setup_fn ) <nl> + break <nl> + if is_jython and os . _name = = ' nt ' : <nl> + # Jython ' s . bat sys . executable can ' t handle a command line <nl> + # argument with newlines <nl> + import tempfile <nl> + fd , ez_setup = tempfile . mkstemp ( ' . py ' ) <nl> + os . write ( fd , EZ_SETUP_PY ) <nl> + os . close ( fd ) <nl> + cmd = [ py_executable , ez_setup ] <nl> + else : <nl> + cmd = [ py_executable , ' - c ' , EZ_SETUP_PY ] <nl> + if unzip : <nl> + cmd . append ( ' - - always - unzip ' ) <nl> + env = { } <nl> + if logger . stdout_level_matches ( logger . DEBUG ) : <nl> + cmd . append ( ' - v ' ) <nl> + if os . path . exists ( setup_fn ) : <nl> + logger . info ( ' Using existing Setuptools egg : % s ' , setup_fn ) <nl> + cmd . append ( setup_fn ) <nl> + if os . environ . get ( ' PYTHONPATH ' ) : <nl> + env [ ' PYTHONPATH ' ] = setup_fn + os . path . pathsep + os . environ [ ' PYTHONPATH ' ] <nl> + else : <nl> + env [ ' PYTHONPATH ' ] = setup_fn <nl> + else : <nl> + logger . info ( ' No Setuptools egg found ; downloading ' ) <nl> + cmd . extend ( [ ' - - always - copy ' , ' - U ' , ' setuptools ' ] ) <nl> + logger . start_progress ( ' Installing setuptools . . . ' ) <nl> + logger . indent + = 2 <nl> + cwd = None <nl> + if not os . access ( os . getcwd ( ) , os . W_OK ) : <nl> + cwd = ' / tmp ' <nl> + try : <nl> + call_subprocess ( cmd , show_stdout = False , <nl> + filter_stdout = filter_ez_setup , <nl> + extra_env = env , <nl> + cwd = cwd ) <nl> + finally : <nl> + logger . indent - = 2 <nl> + logger . end_progress ( ) <nl> + if is_jython and os . _name = = ' nt ' : <nl> + os . remove ( ez_setup ) <nl> + <nl> + def filter_ez_setup ( line ) : <nl> + if not line . strip ( ) : <nl> + return Logger . DEBUG <nl> + for prefix in [ ' Reading ' , ' Best match ' , ' Processing setuptools ' , <nl> + ' Copying setuptools ' , ' Adding setuptools ' , <nl> + ' Installing ' , ' Installed ' ] : <nl> + if line . startswith ( prefix ) : <nl> + return Logger . DEBUG <nl> + return Logger . INFO <nl> + <nl> + def main ( ) : <nl> + parser = optparse . OptionParser ( <nl> + version = " 1 . 3 . 4dev " , <nl> + usage = " % prog [ OPTIONS ] DEST_DIR " ) <nl> + <nl> + parser . add_option ( <nl> + ' - v ' , ' - - verbose ' , <nl> + action = ' count ' , <nl> + dest = ' verbose ' , <nl> + default = 0 , <nl> + help = " Increase verbosity " ) <nl> + <nl> + parser . add_option ( <nl> + ' - q ' , ' - - quiet ' , <nl> + action = ' count ' , <nl> + dest = ' quiet ' , <nl> + default = 0 , <nl> + help = ' Decrease verbosity ' ) <nl> + <nl> + parser . add_option ( <nl> + ' - p ' , ' - - python ' , <nl> + dest = ' python ' , <nl> + metavar = ' PYTHON_EXE ' , <nl> + help = ' The Python interpreter to use , e . g . , - - python = python2 . 5 will use the python2 . 5 ' <nl> + ' interpreter to create the new environment . The default is the interpreter that ' <nl> + ' virtualenv was installed with ( % s ) ' % sys . executable ) <nl> + <nl> + parser . add_option ( <nl> + ' - - clear ' , <nl> + dest = ' clear ' , <nl> + action = ' store_true ' , <nl> + help = " Clear out the non - root install and start from scratch " ) <nl> + <nl> + parser . add_option ( <nl> + ' - - no - site - packages ' , <nl> + dest = ' no_site_packages ' , <nl> + action = ' store_true ' , <nl> + help = " Don ' t give access to the global site - packages dir to the " <nl> + " virtual environment " ) <nl> + <nl> + parser . add_option ( <nl> + ' - - unzip - setuptools ' , <nl> + dest = ' unzip_setuptools ' , <nl> + action = ' store_true ' , <nl> + help = " Unzip Setuptools when installing it " ) <nl> + <nl> + parser . add_option ( <nl> + ' - - relocatable ' , <nl> + dest = ' relocatable ' , <nl> + action = ' store_true ' , <nl> + help = ' Make an EXISTING virtualenv environment relocatable . ' <nl> + ' This fixes up scripts and makes all . pth files relative ' ) <nl> + <nl> + if ' extend_parser ' in globals ( ) : <nl> + extend_parser ( parser ) <nl> + <nl> + options , args = parser . parse_args ( ) <nl> + <nl> + global logger <nl> + <nl> + if ' adjust_options ' in globals ( ) : <nl> + adjust_options ( options , args ) <nl> + <nl> + verbosity = options . verbose - options . quiet <nl> + logger = Logger ( [ ( Logger . level_for_integer ( 2 - verbosity ) , sys . stdout ) ] ) <nl> + <nl> + if options . python and not os . environ . get ( ' VIRTUALENV_INTERPRETER_RUNNING ' ) : <nl> + env = os . environ . copy ( ) <nl> + interpreter = resolve_interpreter ( options . python ) <nl> + if interpreter = = sys . executable : <nl> + logger . warn ( ' Already using interpreter % s ' % interpreter ) <nl> + else : <nl> + logger . notify ( ' Running virtualenv with interpreter % s ' % interpreter ) <nl> + env [ ' VIRTUALENV_INTERPRETER_RUNNING ' ] = ' true ' <nl> + file = __file__ <nl> + if file . endswith ( ' . pyc ' ) : <nl> + file = file [ : - 1 ] <nl> + os . execvpe ( interpreter , [ interpreter , file ] + sys . argv [ 1 : ] , env ) <nl> + <nl> + if not args : <nl> + print ' You must provide a DEST_DIR ' <nl> + parser . print_help ( ) <nl> + sys . exit ( 2 ) <nl> + if len ( args ) > 1 : <nl> + print ' There must be only one argument : DEST_DIR ( you gave % s ) ' % ( <nl> + ' ' . join ( args ) ) <nl> + parser . print_help ( ) <nl> + sys . exit ( 2 ) <nl> + <nl> + home_dir = args [ 0 ] <nl> + <nl> + if os . environ . get ( ' WORKING_ENV ' ) : <nl> + logger . fatal ( ' ERROR : you cannot run virtualenv while in a workingenv ' ) <nl> + logger . fatal ( ' Please deactivate your workingenv , then re - run this script ' ) <nl> + sys . exit ( 3 ) <nl> + <nl> + if os . environ . get ( ' PYTHONHOME ' ) : <nl> + if sys . platform = = ' win32 ' : <nl> + name = ' % PYTHONHOME % ' <nl> + else : <nl> + name = ' $ PYTHONHOME ' <nl> + logger . warn ( ' % s is set ; this can cause problems creating environments ' % name ) <nl> + <nl> + if options . relocatable : <nl> + make_environment_relocatable ( home_dir ) <nl> + return <nl> + <nl> + create_environment ( home_dir , site_packages = not options . no_site_packages , clear = options . clear , <nl> + unzip_setuptools = options . unzip_setuptools ) <nl> + if ' after_install ' in globals ( ) : <nl> + after_install ( options , home_dir ) <nl> + <nl> + def call_subprocess ( cmd , show_stdout = True , <nl> + filter_stdout = None , cwd = None , <nl> + raise_on_returncode = True , extra_env = None ) : <nl> + cmd_parts = [ ] <nl> + for part in cmd : <nl> + if len ( part ) > 40 : <nl> + part = part [ : 30 ] + " . . . " + part [ - 5 : ] <nl> + if ' ' in part or ' \ n ' in part or ' " ' in part or " ' " in part : <nl> + part = ' " % s " ' % part . replace ( ' " ' , ' \ \ " ' ) <nl> + cmd_parts . append ( part ) <nl> + cmd_desc = ' ' . join ( cmd_parts ) <nl> + if show_stdout : <nl> + stdout = None <nl> + else : <nl> + stdout = subprocess . PIPE <nl> + logger . debug ( " Running command % s " % cmd_desc ) <nl> + if extra_env : <nl> + env = os . environ . copy ( ) <nl> + env . update ( extra_env ) <nl> + else : <nl> + env = None <nl> + try : <nl> + proc = subprocess . Popen ( <nl> + cmd , stderr = subprocess . STDOUT , stdin = None , stdout = stdout , <nl> + cwd = cwd , env = env ) <nl> + except Exception , e : <nl> + logger . fatal ( <nl> + " Error % s while executing command % s " % ( e , cmd_desc ) ) <nl> + raise <nl> + all_output = [ ] <nl> + if stdout is not None : <nl> + stdout = proc . stdout <nl> + while 1 : <nl> + line = stdout . readline ( ) <nl> + if not line : <nl> + break <nl> + line = line . rstrip ( ) <nl> + all_output . append ( line ) <nl> + if filter_stdout : <nl> + level = filter_stdout ( line ) <nl> + if isinstance ( level , tuple ) : <nl> + level , line = level <nl> + logger . log ( level , line ) <nl> + if not logger . stdout_level_matches ( level ) : <nl> + logger . show_progress ( ) <nl> + else : <nl> + logger . info ( line ) <nl> + else : <nl> + proc . communicate ( ) <nl> + proc . wait ( ) <nl> + if proc . returncode : <nl> + if raise_on_returncode : <nl> + if all_output : <nl> + logger . notify ( ' Complete output from command % s : ' % cmd_desc ) <nl> + logger . notify ( ' \ n ' . join ( all_output ) + ' \ nmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - ' ) <nl> + raise OSError ( <nl> + " Command % s failed with error code % s " <nl> + % ( cmd_desc , proc . returncode ) ) <nl> + else : <nl> + logger . warn ( <nl> + " Command % s had error code % s " <nl> + % ( cmd_desc , proc . returncode ) ) <nl> + <nl> + <nl> + def create_environment ( home_dir , site_packages = True , clear = False , <nl> + unzip_setuptools = False ) : <nl> + " " " <nl> + Creates a new environment in ` ` home_dir ` ` . <nl> + <nl> + If ` ` site_packages ` ` is true ( the default ) then the global <nl> + ` ` site - packages / ` ` directory will be on the path . <nl> + <nl> + If ` ` clear ` ` is true ( default False ) then the environment will <nl> + first be cleared . <nl> + " " " <nl> + home_dir , lib_dir , inc_dir , bin_dir = path_locations ( home_dir ) <nl> + <nl> + py_executable = install_python ( <nl> + home_dir , lib_dir , inc_dir , bin_dir , <nl> + site_packages = site_packages , clear = clear ) <nl> + <nl> + install_distutils ( lib_dir , home_dir ) <nl> + <nl> + install_setuptools ( py_executable , unzip = unzip_setuptools ) <nl> + <nl> + install_activate ( home_dir , bin_dir ) <nl> + <nl> + def path_locations ( home_dir ) : <nl> + " " " Return the path locations for the environment ( where libraries are , <nl> + where scripts go , etc ) " " " <nl> + # XXX : We ' d use distutils . sysconfig . get_python_inc / lib but its <nl> + # prefix arg is broken : http : / / bugs . python . org / issue3386 <nl> + if sys . platform = = ' win32 ' : <nl> + # Windows has lots of problems with executables with spaces in <nl> + # the name ; this function will remove them ( using the ~ 1 <nl> + # format ) : <nl> + mkdir ( home_dir ) <nl> + if ' ' in home_dir : <nl> + try : <nl> + import win32api <nl> + except ImportError : <nl> + print ' Error : the path " % s " has a space in it ' % home_dir <nl> + print ' To handle these kinds of paths , the win32api module must be installed : ' <nl> + print ' http : / / sourceforge . net / projects / pywin32 / ' <nl> + sys . exit ( 3 ) <nl> + home_dir = win32api . GetShortPathName ( home_dir ) <nl> + lib_dir = join ( home_dir , ' Lib ' ) <nl> + inc_dir = join ( home_dir , ' Include ' ) <nl> + bin_dir = join ( home_dir , ' Scripts ' ) <nl> + elif is_jython : <nl> + lib_dir = join ( home_dir , ' Lib ' ) <nl> + inc_dir = join ( home_dir , ' Include ' ) <nl> + bin_dir = join ( home_dir , ' bin ' ) <nl> + else : <nl> + lib_dir = join ( home_dir , ' lib ' , py_version ) <nl> + inc_dir = join ( home_dir , ' include ' , py_version ) <nl> + bin_dir = join ( home_dir , ' bin ' ) <nl> + return home_dir , lib_dir , inc_dir , bin_dir <nl> + <nl> + def install_python ( home_dir , lib_dir , inc_dir , bin_dir , site_packages , clear ) : <nl> + " " " Install just the base environment , no distutils patches etc " " " <nl> + if sys . executable . startswith ( bin_dir ) : <nl> + print ' Please use the * system * python to run this script ' <nl> + return <nl> + <nl> + if clear : <nl> + rmtree ( lib_dir ) <nl> + # # FIXME : why not delete it ? <nl> + # # Maybe it should delete everything with # ! / path / to / venv / python in it <nl> + logger . notify ( ' Not deleting % s ' , bin_dir ) <nl> + <nl> + if hasattr ( sys , ' real_prefix ' ) : <nl> + logger . notify ( ' Using real prefix % r ' % sys . real_prefix ) <nl> + prefix = sys . real_prefix <nl> + else : <nl> + prefix = sys . prefix <nl> + mkdir ( lib_dir ) <nl> + fix_lib64 ( lib_dir ) <nl> + stdlib_dirs = [ os . path . dirname ( os . __file__ ) ] <nl> + if sys . platform = = ' win32 ' : <nl> + stdlib_dirs . append ( join ( os . path . dirname ( stdlib_dirs [ 0 ] ) , ' DLLs ' ) ) <nl> + elif sys . platform = = ' darwin ' : <nl> + stdlib_dirs . append ( join ( stdlib_dirs [ 0 ] , ' site - packages ' ) ) <nl> + for stdlib_dir in stdlib_dirs : <nl> + if not os . path . isdir ( stdlib_dir ) : <nl> + continue <nl> + if hasattr ( os , ' symlink ' ) : <nl> + logger . info ( ' Symlinking Python bootstrap modules ' ) <nl> + else : <nl> + logger . info ( ' Copying Python bootstrap modules ' ) <nl> + logger . indent + = 2 <nl> + try : <nl> + for fn in os . listdir ( stdlib_dir ) : <nl> + if fn ! = ' site - packages ' and os . path . splitext ( fn ) [ 0 ] in REQUIRED_MODULES : <nl> + copyfile ( join ( stdlib_dir , fn ) , join ( lib_dir , fn ) ) <nl> + finally : <nl> + logger . indent - = 2 <nl> + mkdir ( join ( lib_dir , ' site - packages ' ) ) <nl> + writefile ( join ( lib_dir , ' site . py ' ) , SITE_PY ) <nl> + writefile ( join ( lib_dir , ' orig - prefix . txt ' ) , prefix ) <nl> + site_packages_filename = join ( lib_dir , ' no - global - site - packages . txt ' ) <nl> + if not site_packages : <nl> + writefile ( site_packages_filename , ' ' ) <nl> + else : <nl> + if os . path . exists ( site_packages_filename ) : <nl> + logger . info ( ' Deleting % s ' % site_packages_filename ) <nl> + os . unlink ( site_packages_filename ) <nl> + <nl> + stdinc_dir = join ( prefix , ' include ' , py_version ) <nl> + if os . path . exists ( stdinc_dir ) : <nl> + copyfile ( stdinc_dir , inc_dir ) <nl> + else : <nl> + logger . debug ( ' No include dir % s ' % stdinc_dir ) <nl> + <nl> + if sys . exec_prefix ! = prefix : <nl> + if sys . platform = = ' win32 ' : <nl> + exec_dir = join ( sys . exec_prefix , ' lib ' ) <nl> + elif is_jython : <nl> + exec_dir = join ( sys . exec_prefix , ' Lib ' ) <nl> + else : <nl> + exec_dir = join ( sys . exec_prefix , ' lib ' , py_version ) <nl> + for fn in os . listdir ( exec_dir ) : <nl> + copyfile ( join ( exec_dir , fn ) , join ( lib_dir , fn ) ) <nl> + <nl> + if is_jython : <nl> + # Jython has either jython - dev . jar and javalib / dir , or just <nl> + # jython . jar <nl> + for name in ' jython - dev . jar ' , ' javalib ' , ' jython . jar ' : <nl> + src = join ( prefix , name ) <nl> + if os . path . exists ( src ) : <nl> + copyfile ( src , join ( home_dir , name ) ) <nl> + # XXX : registry should always exist after Jython 2 . 5rc1 <nl> + src = join ( prefix , ' registry ' ) <nl> + if os . path . exists ( src ) : <nl> + copyfile ( src , join ( home_dir , ' registry ' ) , symlink = False ) <nl> + copyfile ( join ( prefix , ' cachedir ' ) , join ( home_dir , ' cachedir ' ) , <nl> + symlink = False ) <nl> + <nl> + mkdir ( bin_dir ) <nl> + py_executable = join ( bin_dir , os . path . basename ( sys . executable ) ) <nl> + if ' Python . framework ' in prefix : <nl> + if py_executable . endswith ( ' / Python ' ) : <nl> + # The name of the python executable is not quite what <nl> + # we want , rename it . <nl> + py_executable = os . path . join ( <nl> + os . path . dirname ( py_executable ) , ' python ' ) <nl> + <nl> + logger . notify ( ' New % s executable in % s ' , expected_exe , py_executable ) <nl> + if sys . executable ! = py_executable : <nl> + # # FIXME : could I just hard link ? <nl> + executable = sys . executable <nl> + if sys . platform = = ' cygwin ' and os . path . exists ( executable + ' . exe ' ) : <nl> + # Cygwin misreports sys . executable sometimes <nl> + executable + = ' . exe ' <nl> + py_executable + = ' . exe ' <nl> + logger . info ( ' Executable actually exists in % s ' % executable ) <nl> + shutil . copyfile ( executable , py_executable ) <nl> + make_exe ( py_executable ) <nl> + if sys . platform = = ' win32 ' or sys . platform = = ' cygwin ' : <nl> + pythonw = os . path . join ( os . path . dirname ( sys . executable , ' pythonw . exe ' ) ) <nl> + if os . path . exists ( pythonw ) : <nl> + logger . info ( ' Also created pythonw . exe ' ) <nl> + shutil . copyfile ( pythonw , os . path . join ( os . path . dirname ( py_executable , ' pythonw . exe ' ) ) ) <nl> + <nl> + if os . path . splitext ( os . path . basename ( py_executable ) ) [ 0 ] ! = expected_exe : <nl> + secondary_exe = os . path . join ( os . path . dirname ( py_executable ) , <nl> + expected_exe ) <nl> + py_executable_ext = os . path . splitext ( py_executable ) [ 1 ] <nl> + if py_executable_ext = = ' . exe ' : <nl> + # python2 . 4 gives an extension of ' . 4 ' : P <nl> + secondary_exe + = py_executable_ext <nl> + if os . path . exists ( secondary_exe ) : <nl> + logger . warn ( ' Not overwriting existing % s script % s ( you must use % s ) ' <nl> + % ( expected_exe , secondary_exe , py_executable ) ) <nl> + else : <nl> + logger . notify ( ' Also creating executable in % s ' % secondary_exe ) <nl> + shutil . copyfile ( sys . executable , secondary_exe ) <nl> + make_exe ( secondary_exe ) <nl> + <nl> + if ' Python . framework ' in prefix : <nl> + logger . debug ( ' MacOSX Python framework detected ' ) <nl> + <nl> + # Copy the framework ' s dylib into the virtual <nl> + # environment <nl> + virtual_lib = os . path . join ( home_dir , ' . Python ' ) <nl> + <nl> + if os . path . exists ( virtual_lib ) : <nl> + os . unlink ( virtual_lib ) <nl> + copyfile ( <nl> + os . path . join ( prefix , ' Python ' ) , <nl> + virtual_lib ) <nl> + <nl> + # And then change the install_name of the copied python executable <nl> + try : <nl> + call_subprocess ( <nl> + [ " install_name_tool " , " - change " , <nl> + os . path . join ( prefix , ' Python ' ) , <nl> + ' @ executable_path / . . / . Python ' , <nl> + py_executable ] ) <nl> + except : <nl> + logger . fatal ( <nl> + " Could not call install_name_tool - - you must have Apple ' s development tools installed " ) <nl> + raise <nl> + <nl> + # Some tools depend on pythonX . Y being present <nl> + pth = py_executable + ' % s . % s ' % ( <nl> + sys . version_info [ 0 ] , sys . version_info [ 1 ] ) <nl> + if os . path . exists ( pth ) : <nl> + os . unlink ( pth ) <nl> + os . symlink ( ' python ' , pth ) <nl> + <nl> + if sys . platform = = ' win32 ' and ' ' in py_executable : <nl> + # There ' s a bug with subprocess on Windows when using a first <nl> + # argument that has a space in it . Instead we have to quote <nl> + # the value : <nl> + py_executable = ' " % s " ' % py_executable <nl> + cmd = [ py_executable , ' - c ' , ' import sys ; print sys . prefix ' ] <nl> + logger . info ( ' Testing executable with % s % s " % s " ' % tuple ( cmd ) ) <nl> + proc = subprocess . Popen ( cmd , <nl> + stdout = subprocess . PIPE ) <nl> + proc_stdout , proc_stderr = proc . communicate ( ) <nl> + proc_stdout = os . path . normcase ( os . path . abspath ( proc_stdout . strip ( ) ) ) <nl> + if proc_stdout ! = os . path . normcase ( os . path . abspath ( home_dir ) ) : <nl> + logger . fatal ( <nl> + ' ERROR : The executable % s is not functioning ' % py_executable ) <nl> + logger . fatal ( <nl> + ' ERROR : It thinks sys . prefix is % r ( should be % r ) ' <nl> + % ( proc_stdout , os . path . normcase ( os . path . abspath ( home_dir ) ) ) ) <nl> + logger . fatal ( <nl> + ' ERROR : virtualenv is not compatible with this system or executable ' ) <nl> + sys . exit ( 100 ) <nl> + else : <nl> + logger . info ( ' Got sys . prefix result : % r ' % proc_stdout ) <nl> + <nl> + pydistutils = os . path . expanduser ( ' ~ / . pydistutils . cfg ' ) <nl> + if os . path . exists ( pydistutils ) : <nl> + logger . notify ( ' Please make sure you remove any previous custom paths from ' <nl> + ' your % s file . ' % pydistutils ) <nl> + # # FIXME : really this should be calculated earlier <nl> + return py_executable <nl> + <nl> + def install_activate ( home_dir , bin_dir ) : <nl> + if sys . platform = = ' win32 ' or is_jython and os . _name = = ' nt ' : <nl> + files = { ' activate . bat ' : ACTIVATE_BAT , <nl> + ' deactivate . bat ' : DEACTIVATE_BAT } <nl> + if os . environ . get ( ' OS ' ) = = ' Windows_NT ' and os . environ . get ( ' OSTYPE ' ) = = ' cygwin ' : <nl> + files [ ' activate ' ] = ACTIVATE_SH <nl> + else : <nl> + files = { ' activate ' : ACTIVATE_SH } <nl> + files [ ' activate_this . py ' ] = ACTIVATE_THIS <nl> + for name , content in files . items ( ) : <nl> + content = content . replace ( ' __VIRTUAL_ENV__ ' , os . path . abspath ( home_dir ) ) <nl> + content = content . replace ( ' __VIRTUAL_NAME__ ' , os . path . basename ( os . path . abspath ( home_dir ) ) ) <nl> + content = content . replace ( ' __BIN_NAME__ ' , os . path . basename ( bin_dir ) ) <nl> + writefile ( os . path . join ( bin_dir , name ) , content ) <nl> + <nl> + def install_distutils ( lib_dir , home_dir ) : <nl> + distutils_path = os . path . join ( lib_dir , ' distutils ' ) <nl> + mkdir ( distutils_path ) <nl> + # # FIXME : maybe this prefix setting should only be put in place if <nl> + # # there ' s a local distutils . cfg with a prefix setting ? <nl> + home_dir = os . path . abspath ( home_dir ) <nl> + # # FIXME : this is breaking things , removing for now : <nl> + # distutils_cfg = DISTUTILS_CFG + " \ n [ install ] \ nprefix = % s \ n " % home_dir <nl> + writefile ( os . path . join ( distutils_path , ' __init__ . py ' ) , DISTUTILS_INIT ) <nl> + writefile ( os . path . join ( distutils_path , ' distutils . cfg ' ) , DISTUTILS_CFG , overwrite = False ) <nl> + <nl> + def fix_lib64 ( lib_dir ) : <nl> + " " " <nl> + Some platforms ( particularly Gentoo on x64 ) put things in lib64 / pythonX . Y <nl> + instead of lib / pythonX . Y . If this is such a platform we ' ll just create a <nl> + symlink so lib64 points to lib <nl> + " " " <nl> + if [ p for p in distutils . sysconfig . get_config_vars ( ) . values ( ) <nl> + if isinstance ( p , basestring ) and ' lib64 ' in p ] : <nl> + logger . debug ( ' This system uses lib64 ; symlinking lib64 to lib ' ) <nl> + assert os . path . basename ( lib_dir ) = = ' python % s ' % sys . version [ : 3 ] , ( <nl> + " Unexpected python lib dir : % r " % lib_dir ) <nl> + lib_parent = os . path . dirname ( lib_dir ) <nl> + assert os . path . basename ( lib_parent ) = = ' lib ' , ( <nl> + " Unexpected parent dir : % r " % lib_parent ) <nl> + copyfile ( lib_parent , os . path . join ( os . path . dirname ( lib_parent ) , ' lib64 ' ) ) <nl> + <nl> + def resolve_interpreter ( exe ) : <nl> + " " " <nl> + If the executable given isn ' t an absolute path , search $ PATH for the interpreter <nl> + " " " <nl> + if os . path . abspath ( exe ) ! = exe : <nl> + paths = os . environ . get ( ' PATH ' , ' ' ) . split ( os . pathsep ) <nl> + for path in paths : <nl> + if os . path . exists ( os . path . join ( path , exe ) ) : <nl> + exe = os . path . join ( path , exe ) <nl> + break <nl> + if not os . path . exists ( exe ) : <nl> + logger . fatal ( ' The executable % s ( from - - python = % s ) does not exist ' % ( exe , exe ) ) <nl> + sys . exit ( 3 ) <nl> + return exe <nl> + <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + # # Relocating the environment : <nl> + <nl> + def make_environment_relocatable ( home_dir ) : <nl> + " " " <nl> + Makes the already - existing environment use relative paths , and takes out <nl> + the # ! - based environment selection in scripts . <nl> + " " " <nl> + activate_this = os . path . join ( home_dir , ' bin ' , ' activate_this . py ' ) <nl> + if not os . path . exists ( activate_this ) : <nl> + logger . fatal ( <nl> + ' The environment doesn \ ' t have a file % s - - please re - run virtualenv ' <nl> + ' on this environment to update it ' % activate_this ) <nl> + fixup_scripts ( home_dir ) <nl> + fixup_pth_and_egg_link ( home_dir ) <nl> + # # FIXME : need to fix up distutils . cfg <nl> + <nl> + OK_ABS_SCRIPTS = [ ' python ' , ' python % s ' % sys . version [ : 3 ] , <nl> + ' activate ' , ' activate . bat ' , ' activate_this . py ' ] <nl> + <nl> + def fixup_scripts ( home_dir ) : <nl> + # This is what we expect at the top of scripts : <nl> + shebang = ' # ! % s / bin / python ' % os . path . normcase ( os . path . abspath ( home_dir ) ) <nl> + # This is what we ' ll put : <nl> + new_shebang = ' # ! / usr / bin / env python % s ' % sys . version [ : 3 ] <nl> + activate = " import os ; activate_this = os . path . join ( os . path . dirname ( __file__ ) , ' activate_this . py ' ) ; execfile ( activate_this , dict ( __file__ = activate_this ) ) ; del os , activate_this " <nl> + bin_dir = os . path . join ( home_dir , ' bin ' ) <nl> + for filename in os . listdir ( bin_dir ) : <nl> + filename = os . path . join ( bin_dir , filename ) <nl> + f = open ( filename , ' rb ' ) <nl> + lines = f . readlines ( ) <nl> + f . close ( ) <nl> + if not lines : <nl> + logger . warn ( ' Script % s is an empty file ' % filename ) <nl> + continue <nl> + if lines [ 0 ] . strip ( ) ! = shebang : <nl> + if os . path . basename ( filename ) in OK_ABS_SCRIPTS : <nl> + logger . debug ( ' Cannot make script % s relative ' % filename ) <nl> + elif lines [ 0 ] . strip ( ) = = new_shebang : <nl> + logger . info ( ' Script % s has already been made relative ' % filename ) <nl> + else : <nl> + logger . warn ( ' Script % s cannot be made relative ( it \ ' s not a normal script that starts with % s ) ' <nl> + % ( filename , shebang ) ) <nl> + continue <nl> + logger . notify ( ' Making script % s relative ' % filename ) <nl> + lines = [ new_shebang + ' \ n ' , activate + ' \ n ' ] + lines [ 1 : ] <nl> + f = open ( filename , ' wb ' ) <nl> + f . writelines ( lines ) <nl> + f . close ( ) <nl> + <nl> + def fixup_pth_and_egg_link ( home_dir ) : <nl> + " " " Makes . pth and . egg - link files use relative paths " " " <nl> + home_dir = os . path . normcase ( os . path . abspath ( home_dir ) ) <nl> + for path in sys . path : <nl> + if not path : <nl> + path = ' . ' <nl> + if not os . path . isdir ( path ) : <nl> + continue <nl> + path = os . path . normcase ( os . path . abspath ( path ) ) <nl> + if not path . startswith ( home_dir ) : <nl> + logger . debug ( ' Skipping system ( non - environment ) directory % s ' % path ) <nl> + continue <nl> + for filename in os . listdir ( path ) : <nl> + filename = os . path . join ( path , filename ) <nl> + if filename . endswith ( ' . pth ' ) : <nl> + if not os . access ( filename , os . W_OK ) : <nl> + logger . warn ( ' Cannot write . pth file % s , skipping ' % filename ) <nl> + else : <nl> + fixup_pth_file ( filename ) <nl> + if filename . endswith ( ' . egg - link ' ) : <nl> + if not os . access ( filename , os . W_OK ) : <nl> + logger . warn ( ' Cannot write . egg - link file % s , skipping ' % filename ) <nl> + else : <nl> + fixup_egg_link ( filename ) <nl> + <nl> + def fixup_pth_file ( filename ) : <nl> + lines = [ ] <nl> + prev_lines = [ ] <nl> + f = open ( filename ) <nl> + prev_lines = f . readlines ( ) <nl> + f . close ( ) <nl> + for line in prev_lines : <nl> + line = line . strip ( ) <nl> + if ( not line or line . startswith ( ' # ' ) or line . startswith ( ' import ' ) <nl> + or os . path . abspath ( line ) ! = line ) : <nl> + lines . append ( line ) <nl> + else : <nl> + new_value = make_relative_path ( filename , line ) <nl> + if line ! = new_value : <nl> + logger . debug ( ' Rewriting path % s as % s ( in % s ) ' % ( line , new_value , filename ) ) <nl> + lines . append ( new_value ) <nl> + if lines = = prev_lines : <nl> + logger . info ( ' No changes to . pth file % s ' % filename ) <nl> + return <nl> + logger . notify ( ' Making paths in . pth file % s relative ' % filename ) <nl> + f = open ( filename , ' w ' ) <nl> + f . write ( ' \ n ' . join ( lines ) + ' \ n ' ) <nl> + f . close ( ) <nl> + <nl> + def fixup_egg_link ( filename ) : <nl> + f = open ( filename ) <nl> + link = f . read ( ) . strip ( ) <nl> + f . close ( ) <nl> + if os . path . abspath ( link ) ! = link : <nl> + logger . debug ( ' Link in % s already relative ' % filename ) <nl> + return <nl> + new_link = make_relative_path ( filename , link ) <nl> + logger . notify ( ' Rewriting link % s in % s as % s ' % ( link , filename , new_link ) ) <nl> + f = open ( filename , ' w ' ) <nl> + f . write ( new_link ) <nl> + f . close ( ) <nl> + <nl> + def make_relative_path ( source , dest , dest_is_directory = True ) : <nl> + " " " <nl> + Make a filename relative , where the filename is dest , and it is <nl> + being referred to from the filename source . <nl> + <nl> + > > > make_relative_path ( ' / usr / share / something / a - file . pth ' , <nl> + . . . ' / usr / share / another - place / src / Directory ' ) <nl> + ' . . / another - place / src / Directory ' <nl> + > > > make_relative_path ( ' / usr / share / something / a - file . pth ' , <nl> + . . . ' / home / user / src / Directory ' ) <nl> + ' . . / . . / . . / home / user / src / Directory ' <nl> + > > > make_relative_path ( ' / usr / share / a - file . pth ' , ' / usr / share / ' ) <nl> + ' . / ' <nl> + " " " <nl> + source = os . path . dirname ( source ) <nl> + if not dest_is_directory : <nl> + dest_filename = os . path . basename ( dest ) <nl> + dest = os . path . dirname ( dest ) <nl> + dest = os . path . normpath ( os . path . abspath ( dest ) ) <nl> + source = os . path . normpath ( os . path . abspath ( source ) ) <nl> + dest_parts = dest . strip ( os . path . sep ) . split ( os . path . sep ) <nl> + source_parts = source . strip ( os . path . sep ) . split ( os . path . sep ) <nl> + while dest_parts and source_parts and dest_parts [ 0 ] = = source_parts [ 0 ] : <nl> + dest_parts . pop ( 0 ) <nl> + source_parts . pop ( 0 ) <nl> + full_parts = [ ' . . ' ] * len ( source_parts ) + dest_parts <nl> + if not dest_is_directory : <nl> + full_parts . append ( dest_filename ) <nl> + if not full_parts : <nl> + # Special case for the current directory ( otherwise it ' d be ' ' ) <nl> + return ' . / ' <nl> + return os . path . sep . join ( full_parts ) <nl> + <nl> + <nl> + <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + # # Bootstrap script creation : <nl> + <nl> + def create_bootstrap_script ( extra_text , python_version = ' ' ) : <nl> + " " " <nl> + Creates a bootstrap script , which is like this script but with <nl> + extend_parser , adjust_options , and after_install hooks . <nl> + <nl> + This returns a string that ( written to disk of course ) can be used <nl> + as a bootstrap script with your own customizations . The script <nl> + will be the standard virtualenv . py script , with your extra text <nl> + added ( your extra text should be Python code ) . <nl> + <nl> + If you include these functions , they will be called : <nl> + <nl> + ` ` extend_parser ( optparse_parser ) ` ` : <nl> + You can add or remove options from the parser here . <nl> + <nl> + ` ` adjust_options ( options , args ) ` ` : <nl> + You can change options here , or change the args ( if you accept <nl> + different kinds of arguments , be sure you modify ` ` args ` ` so it is <nl> + only ` ` [ DEST_DIR ] ` ` ) . <nl> + <nl> + ` ` after_install ( options , home_dir ) ` ` : <nl> + <nl> + After everything is installed , this function is called . This <nl> + is probably the function you are most likely to use . An <nl> + example would be : : <nl> + <nl> + def after_install ( options , home_dir ) : <nl> + subprocess . call ( [ join ( home_dir , ' bin ' , ' easy_install ' ) , <nl> + ' MyPackage ' ] ) <nl> + subprocess . call ( [ join ( home_dir , ' bin ' , ' my - package - script ' ) , <nl> + ' setup ' , home_dir ] ) <nl> + <nl> + This example immediately installs a package , and runs a setup <nl> + script from that package . <nl> + <nl> + If you provide something like ` ` python_version = ' 2 . 4 ' ` ` then the <nl> + script will start with ` ` # ! / usr / bin / env python2 . 4 ` ` instead of <nl> + ` ` # ! / usr / bin / env python ` ` . You can use this when the script must <nl> + be run with a particular Python version . <nl> + " " " <nl> + filename = __file__ <nl> + if filename . endswith ( ' . pyc ' ) : <nl> + filename = filename [ : - 1 ] <nl> + f = open ( filename , ' rb ' ) <nl> + content = f . read ( ) <nl> + f . close ( ) <nl> + py_exe = ' python % s ' % python_version <nl> + content = ( ( ' # ! / usr / bin / env % s \ n ' % py_exe ) <nl> + + ' # # WARNING : This file is generated \ n ' <nl> + + content ) <nl> + return content . replace ( ' # # EXT ' ' END # # ' , extra_text ) <nl> + <nl> + def adjust_options ( options , args ) : <nl> + args [ : ] = [ ' . ' ] <nl> + <nl> + def after_install ( options , home_dir ) : <nl> + if sys . platform = = ' win32 ' : <nl> + bin_dir = join ( home_dir , ' Scripts ' ) <nl> + else : <nl> + bin_dir = join ( home_dir , ' bin ' ) <nl> + subprocess . call ( [ join ( bin_dir , ' easy_install ' ) , ' paver = = 1 . 0 . 1 ' ] ) <nl> + subprocess . call ( [ join ( bin_dir , ' easy_install ' ) , ' pip ' ] ) <nl> + subprocess . call ( [ join ( bin_dir , ' paver ' ) , ' initial ' ] ) <nl> + <nl> + # # file site . py <nl> + SITE_PY = " " " <nl> + eJy1PP1z2zaWv / OvwNKToZTKdJJ2OztO3Zt8uFvvuEm2Tmdz63p0lARJrCmSJUjL2pu7v / 3eBwAC <nl> + JCXbu3uaTCwRwMPDw / vGA8MwfFOWMl + ITbFoMimUTKr5WpRJvVZiWVSiXqfV4rhMqnoHT + e3yUoq <nl> + URdC7VSMveIgeP4vfoLn4vM6VQYF + JY0dbFJ6nSeZNlOpJuyqGq5EIumSvOVSPO0TpMs / Qf0KPJY <nl> + PP / XMQgucgErz1JZiTtZKYCrRLEUn3b1usjFqClxzS / jPyZfjydCzau0rKFDpXEGiqyTOsilXACa <nl> + 0LNRQMq0lseqlPN0mc5tx23RZAtRZslciv / 6L14adY2iQBUbuV3LSoockAGYEmCViAd8TSsxLxYy <nl> + FuKtnCc4AT9viRUwtAnumUIy5oXIinwFa8rlXCqVVDsxmjU1ASKUxaIAnFLAoE6zLNgW1a0aw5bS <nl> + fmzhkUiYPfzFMHvAOnH + PucAjh / z4Jc8vZ8wbOAeBFevmW0quUzvRYJg4ae8l / OpfjZKl2KRLpdA <nl> + g7weY5eAEVAiS2cnJW3Hd3qHvj8hrCxXJjCHRJS5MzfSiDj4mIsCkK2Q8jXw9UaJ0SZJc2Cvn5I5 <nl> + 4fK3NF8UWzUmnIG + SvzWqNrBOBgNoAy9HZQnAslr6N / kWXors90YCPJ5LYNKqiarkYUXaSXndVGl <nl> + UhEAQG0n5H2qAEIC + 8 + LZl4ykjZhcmSqAAnArUCRQBHFRtjSfJmumopkQixT4DXYxx8 + / izen7 + 9 <nl> + ePNBc4UBxlK22gDOAIW2xsEJJhAnjapOsgJEMA4u8Y9IFgsUixXOD3i1HU4e3JtgBGsv4 + 4YZ4uA <nl> + 7O / lLE1yMw2ssQbxp7kCGvffMGSi1kCf / zk8Gyz8zT6q0ML523ZdgBTlyUaKdaKIl5Ezgu80nO / j <nl> + sl6 / Bm5QCKcGUinenMUiRXhAEpdmoyKXogQWy9JcjgOg0Iz6 + rsIrPChyI9przucABCqIIdG59mY <nl> + ZswlLLQP6zVKuOm8o5XpLoHd501RkagD / + dz0h5Zkt8SjorYnr / N5CrNc0QIeSGIjiKaWN2mwImL <nl> + WFxSL5Jk00lErG + 4J4pEA7yETAc8Ke + TTZlJ0JVNWSKZHxB8mkzWwux1xhwHPWtSiLRr7VIHee9V <nl> + / KXDdYRmva4kAG9mntAtiwKEFbQsYVMmmwnPti2Ic4IBeaJByBPUE8bid6DoG6WajbSNyCugWYih <nl> + gmWRZcUWSHYaBEIcYSdjRn3mhFZog / 8BLv6fyXq + DgJnJgtYg0Lk94FCIKDEZa65WiPhcZtm5a6S <nl> + SXPWFEW1kBVN9ThinzDij + yMaw0 + FLU2Q7xc3OVik9aokmbayKVso / KoZv34mtcNywBbq4hmpmtL <nl> + pw0uLyvXyUwaJ2ImlygJepNe222HOYOBOcl61gL1I1AU2oAsMmULMqxYUOksa0lmG2Cw8CV5WjYZ <nl> + dVLIYCKBiTYlwd8kaIQL7d4Ae7MhDVAhscGdg / 0B3P4BYrRdp0CfOUAADYNaCrZvltYVmvRWHwW + <nl> + mTbjeX7g1Iultk085TJJM22Xkzy4oIfnVUXiO5cljppoYihYYV6jM7bKgY4o5mEYBoFxYHbKfC3s <nl> + t + l01qRo76bToK52p8AdAoU8YOjiAyyUpuOWZVVssNmidwX6APQyjgiOxCdSFJK9Uo + ZXiMFXK1c <nl> + mq5ofh2OFKhKgk8 / n / 9w8eX8SpyJ61YrTboq6QbmPM8T4ExS6sAXnWlbdQQ9UXelqL7ED2ChaV8X <nl> + qaLRJIEyqRtgP0D9c9VQMyxj7jUG5x / evL08n / 5ydf7z9Ori8zkgCKZCBke0ZABXN + ClqRj4Gxhr <nl> + oWJtIoPeCHrw9s2VfRBMUzX9jZ3ZMxZ27Qddn35zI87ORPRbcpdEQbCQS + DMW4n8O3pOjt6Y9weW <nl> + C2MLbcZ + K9LctFMzeDHOJCheIxoBoKfTeZYohZ2n0wiIQAMGPjAgZm8RmXIEA8udO3SsUcFPJYFo <nl> + OQ6Z4H8DKCYzGodoMIruENMJuHkzT5TkXrR8GDedokhPpyM9IfA6cSP4IyylkTBdUKSrFNw + 2lUU <nl> + 8ZkqMvyJ8FFIiLkxVkAlgrTXsUB8l2SNVCNnUUtAfyVrBDkCixSZSaIJ7ePYdgRqL1Eu8empR060 <nl> + EmneSPtwE1tU + 7RZ6jVXclPcyQUYa9xRZ9niZ2qB2KvMQJXCskAPkP1geTV + RoKRBusSYB + 0NcDa <nl> + G4JiCGJoccThnswVcD2HTiQHOq5j1VlWxV2Kxmm2042gW0EyUcMaQ6ihFejFe1RHFQr6FrymHCm1 <nl> + lRHIXtWwg0N4I0jUTotWimMCd4lq4Ya + 3ubFNp9yrHOGEj4a271ETtO7iR3aLTgSP4DOAyQLCARa <nl> + ojEUcBEFMtsxIA / Lh + UCZckXBUBgGNBqqcKBZUIDWiJHGTgtwhi / FsTNlUT7cmemINfcEMOBRK2x <nl> + fWDEBiHB4qzEW1nRTIZG0HSDiR2S + Fx3GXPI4gPoUDEGHT3S0LiTod / 1KSghcelKqTMO1f + XL1 + Y <nl> + bdSaImhEbIaLRpOzJM0clzvQ4im4ucaCczxObABxdQ5gGqVZUxxfiaJk6w37yYE + mMgr8BXXdV2e <nl> + npxst9tYx49FtTpRy5M / / unbb / / 0gpXEYkH8A8txpEUnU + ITakMPKP7OaNrvzc51 + DHNfW4kWCNJ <nl> + VpxcF8Tvz026KMTp8dgqFOTi1ibg / 8ZuggKZmkmZykDbsMXomTp + Fn + tQvFMjNy + ozEbQR1UWbUO <nl> + wREpJGgDlQQj6gLMDhjJedHkdeSoLyW + AnUPEd1CzppVZCf3jIb5AUtFOR1ZHjh + eYMY + Jxh + Epp <nl> + RTVFLUFskebLwiH9z8w2CZlirSGQvKize9HWbliLGeIuHi / v1rFxhMasMFXIHSgRfpdHC6Dt3Jcc <nl> + / Gg / 6vOudP0o8 / EMgTF9gWFe7cWMUHAIF9yLiSt1DlejewXStGXVDArGVY2goMEjmTG1NTiy / xGC <nl> + RHNvgkPeWN0D6NTJDZl40uwC9HDn6Vm7Lis4rgHywJl4SU8k + GOnvbYXvLVNllECoMOjHlUYsLfR <nl> + aKcL4MuRATARYfVLyD31tlx87GwK78EAsIJzBshgyx4zYYvrFIVH4QA79az + vtFM4yEQuEnU / 3HA <nl> + CeMznqBSIEzlyGfcfRxuact5kg7C + w0O8ZTZJZJotUe2urpjUKYO2qVlmqPqdfYonmcFeIlWKRIf <nl> + te2 + r0A + Nz4esmVaADUZWnI4nc7I2fPkL9L9MNuyajAudcN2xGiTKjJuSKY1 / AdeBYXDlLsAWhI0 <nl> + C + axQuYv7N8gcna9 + sse9rCERoZwu + 7zQnoGQ8Mx7UcCyaiDdxCCHEjYl0XyHFkbZMBhzgZ5sg3N <nl> + cq9wE4xYgZg5BoS0DOBOje0wXCA8iTHFTQKKkO9rJUvxlQhh + 7qS + jjV / W / lUhPwjpwO5CnoSPnM <nl> + jaKdCPqsE1H7DO3H0pRaLwvg4Bl4PG5e2GVzw7Q2wAdf3dfbFilQyBTzh2MX1RtDGDf3 + Iczp0dL <nl> + LDOJYShvIu8EwMw0Dux2a9Cw4QaMt + fdufRjNzDHsaOoUK / k5h7Cv6hK1bxQ0RjtaRtoDyg / 5oo + <nl> + bSy2l + kshD / eBoTjGw + SzLroYCC / SKptmkekYvQKz3zi9dCxi / Ws0MkVxTsngAqmsE5 + qICF6fTp <nl> + BBgeZbUsIchW2i / vgz240tDC5eGh59den35901 / + ZF9Own6GiXl + X1eJQnpmTFZmW6Rn38KiWoTF <nl> + JflOn0bp80X046tCQZgnPl59EUgITtRtk93Tlt6yJGLz4Jq8j0EdNM + D5OqsjtgFEEG9hYxyEj2d <nl> + MR + P7FMXd2BhTwDyJIY5sCkGkuaTfwbOoY2COY4XuzwrkkVXqPEDzd9 + Mx3I5blIfvtN + MAsHWIM <nl> + if2o46vZmelcVwwu2wypZJKRN + AMQkcAdOJ1r085ZpVLAZpmspsBtxA / pt0o9RZ + r3svsjOfI6IH <nl> + xMHF7DeIJpVOQN0laUYJX0Dj + Bj1nAmEObYfxseDdBhlTBqBT / FiMhirqOsXsDERR97j / nK05 / LG <nl> + ZCsHIkbzKROlOuKt5GGBNtzzCL7fY3EO2Jv + 1JwSXxqrwQRW4jnuxHOxpYMtyqqA0ckByoINygAc <nl> + NN36eORdU1V8yEEbWsrqGLP + fKZvTAodwvfBnHyQNWJiu80pS + WcABdDMhLpvJNdSdS6DMN7sy5M <nl> + tCrzu7SCscA + o + jHjz + dR / 1N19PgoGFw7j4amXi8QkK4T1ChkSZO9JQxTKGnDPnndXzkcWhXiszB <nl> + k8kFabL1CdtLAZkQYngPHggGvbMLPs1B53y + lvPbqaQTKmRTHOqkw95hM2JiD678SgGVLKncAVYy <nl> + zxqkFVv0z3gg1eRzyozWEhS3LgPDQ2Y6d + LIf5klKzGiwQuMOjU3UmB6l1TarJVVgYVHokkXJ6t0 <nl> + IeTvTZKhRy + XS8AF09a6KebpKfgU7 / nojMtblJw3VVrvgASJKnTWn07ZnI6zHS905CHJCV4mIJ67 <nl> + nYorXDa2M + EWhlzDuU5cJLrcOMAcyyB30XNoz4spzjql + q0JI9U / oqLHQXeGAgCEABTWH4510O63 <nl> + SGpyjxZoz12iopb0SOkGGQWZFoQyGmOQw7 / pp8 + ILm / twXK1H8vVYSxXXSxXg1iufCxXh7F0RQI3 <nl> + 1sarRhKGYtZuQnPwWNcNN3ma82S + 5n5YJYTVQABRlMZzNzLF5W1eUMuZfQJCats5aqKH7TFtyuVH <nl> + VcHZLw0SuR / T1zpKMIWJzmA69NWDeSnm7H / fUbU / 9iSOqahgRsNZ3hZJncSeXKyyYgZia9GdtAAm <nl> + ontqzWmS / G4648ROx1KFn / 7z848fP2B3BBWag00ahpuIhgWXMnqeVCvVl6bWqyyBHamnfyZNwzTA <nl> + o0cG1TzLEf / 3vsBqE2QcsaWzyUKU4AFQ8YDt5h6xR1HnuT6L18 + ZyTnNfCbCvA7bRe0h0ptPn96 / <nl> + + fwmpGg / / N / QFRhDW186XHxMD9uh77 + 53S3FcQwItQ6aW + PnrsmjdcsRD9tYA7YTTry46Tx49RiD <nl> + PRh / + Kv8f6UUbAkQKtZ5n6cQ6tHB678UtPboYxixV2PiJtXZWbFtjuw5Looj + vucFC + RyKpZyfrt <nl> + + Z8vPlxevP305vOPjqOCDsfHq5NX4vynL4LOL1HNsuVO8OiuxpNyUH9uqbVYFPCvwWhr0dScI4FR <nl> + 7y8vdSpxg6W7WMuFmjGG53zMbqFxyMhJGPtQn48jRpl2452qZjpOpqpn9Oo3XJ + rCl3vRcXSM3Sp <nl> + Gh0g6Gp1U9VO5y4x8Ah0dknBILgEApqoKq82sUvFKWpd6T2AlLYk9uAyo5C4d5zlJGhN + s / LE9Bg <nl> + eNIO1uroOnJxjW5iVWYpxBuvI5tj1sPw + LZlGP3QnsAwXkNy6gyHmXVHXvVeLFC3vo54bXr8uGW0 <nl> + 3xvAsGWw97DuXNLxJdWjYfGFiLATJzIjeQ9f7dbrPVCwYZiJrnETDdOlsPoEQkCxTsHNBZ5cg41A <nl> + bxYgdHbCz4edOjGsLPD0MHq3WRz / NdIE8Xv / + utA97rKjv8uSvDVBR91RwPEdDu / B / c8lrE4 / / jD <nl> + OGLkqJZK / LXBckcwm5R0cKScztf5iGc6UjJb6vNPXyFig7Zm1NwZXsmy0sOHHbgIJeCZGpFte6YM <nl> + / SIsR7CwJ7iUcQc0VnJazPAOg3tOZj5H4mots0wX / 128vzwHDweLS1GCOO18DtNxVI9nPLo4hO9Y <nl> + dEDhCRA0V8jGFTpadAq4iL1ug4kiFDka7R0c2n2iZEx / VC / zUiWpctEe4bIZllNeGSM3w3aYnWXu <nl> + 7ndDOrvdiO4oOcwY008VlVn5nAEcTU8Tdt / Br8cCVpP74sOONK9NXU2WzkGbguIFtToBUUESgwJj <nl> + / ityzj4VlTLF3fCw3FXpal1jhg8Gx1RYit1 / evPl8uIDVWq + + rr1EAdYdEJe64TPOs + wkAUjc / ji <nl> + Fqcgb02nQ5yrmxAG6iD4023iQ9QznqA3jpNg + KfbxNX1Z07UwisANdWUXSFBZ9UZNiQ9rUQwrjZm <nl> + w49bqNJi5oOhvBkW8 + rzSHd9fX60PTsGhXIUpvEJqdNlqWk4MoPdwonuR69xWWKudzEa7gStQxJm <nl> + PjMYettr2Vei4X56sogXfQCjfm9 / DlPE0Ouql + Mw2z5uoRBMW9pfcyev5 / Sb5yjKQMSRO3jsMtmw <nl> + KtbdmQO9Yr8eMPGdRtdI4qBCD3 / NQ + 1neJhYYvd8ajMQK5fYFGDULXU5dAOeFNoFUCBUozZyJHcy <nl> + fv7KW6NjEx5eo9ZdYCF / BEWoK8aoNLeogBPhy + / sPnIToYWq9FREjr + Sy7yw5Qz42a7Rt3zpr3FQ <nl> + BijhhmJXJflKjhjWxMD8yif2nnQhaVuPY67TzuGt5m7wUO / 3MHhfLIZz / AazDh / 0 + t3KXVcb + dTB <nl> + DoP1yj6EKtmCdodwe8R7tTeljd31idAowlD + 92gPvR5AT8NCv + v3gZMG / DCxjHtp7VWnODyyDdqv <nl> + nFcQMNWKUvqOFTYeomuYWxt41lrh0D7VB9j290DFvVMW58JlFFyo3gpD3aETkIZ / 4YwT3VJJqZSy <nl> + rcTWbQt5J7MC3CKIuLBS9jdbKTuOBwPyB / BqUUGC / qrd8SS / JQ / x3d8uJuLdh5 / h / 7fyI8QUeAti <nl> + Iv4OCIh3RQWxFd / EQcInWGVbc9BUNAqvShA0SibjdTS + w / bJWwcmrnX5r1 / 3a / WDwJKnasOXjgFF <nl> + XiPdTmutoylqhd + m6r7vhhkXaWhXQt2IZNhfi4z1uye6Z7yuNxkqSidN0G7ndXh58e78w9V5XN8j <nl> + H5mfoZNG8I / jcUX6IK / CQ4uJsE / mDT65cTzGH2VWDjiMOuYydc0Yc4kI3PLSxll8QzaxvnVSYeAs <nl> + yt2imMfYE7iKLiaJegse5NgJrx60cJ55QVijsT7qaN1YfAzUEL92JT6EjjRGr4lGEkLJDGv6 + XEc <nl> + DtugiaD8I / x5frtduOlLXZxNC + xi2q565A + 3SmfNdNbwXGYi1M7sTpg7LFmaqM1s7l7l + JibO86g <nl> + TigfLZdJk9VC5hBVUJhLl01Bq7q3L1hOmFtYl9OVBEpUZNtkp5yj70SJEGcN6b4cJs4pRQZR6E / J <nl> + LetevBYiGr4aBdAJUYodCmeoauZrlmMOB7S66x0Qb9P861dRj8g8KceI89aJg3Wiy8QYrWSt188P <nl> + RuPrl60Zpezh3LuMNC / BwriccgTqs3z + / Hko / uNhy8 + oxFlR3IJLArCHAkJxSc17bLZenN2tvldr <nl> + WmJgyflaXsODG8py2udNTsm5A0NpQ6T9a2BEuDeR5UfTv2MDOW1V8YEg9 + CDBW07fslTevcAJlck <nl> + qlz9Cge6Ho9wDEuCbogSNU / TiAN12I9d0eC1CUy0aX6R98Dx6Ybu3UMrnmRwmLlG74oqqCz3WHTO <nl> + REiAQ8z069noIhZdHAA8p592Gs3pRZ7WbcnvC / eQS18NRL + VTYrmK5FsUTLMOjrEcG7geKzaepfF <nl> + QRb1vPVifu2m3Dqr5OaHcAfWBkkrlkuDKTw0mzQvZDU3RhV3LJ2ntQPG9EM4PBjie22A4mAApRA0 <nl> + PBmGhZVo2 / oHuy8uph / pvO / YzKTLPGr7dgpOjyR5p6wljtv5KRFjCWn51nwZwywfKLGr / QFvLvEH <nl> + nVbEek / vSq5786TJ9VVbPmdv798CHHq9g1WQlh09HeG8BcTCZ6bVjnx7M9cpT8XwlHC7S6u6SbKp <nl> + vg46RZdtag9ANZ72xsLBuzjWZwGHugBX81jXboLvYKohkJ5YemWqZyE + 1 + F57N4C8AvmywJ9vVee <nl> + Hsek7wu + e + pocOz5lakjf4zKN9XMvUJgF8sJ1Z5E427pVK8XniBEujKJ0rJDHvaTpjSwXFf4sQAy <nl> + AAB / 2PGLvuqcAzkFVFzGti / 13wP67TeHwLpKZrCGj / LtvuLR9yjcoro24c + ybHy + NbiVKBkLc / NN <nl> + Cx5fEkIpYZVvLzaaE / lufTY0P37JBxb8iPO0CCc7fqYi7WYbjjxEK4vfIVK1nYJ / ikp61DCt0M3D <nl> + Yrh1wi0ork15aoMhvjmSU4p25JZI4Ke + HawSTfAdEUjQ4 / o2OrR8Hn9o7bpHYFduzl56a / erwV0a <nl> + 6LH7 + WWIBuyCakI8qu7QYjT994juRB8LDqc39Gdp3y / FWQ7iQY3aRLPkJpm73 / F + 5zG / nqqtYnNq <nl> + td1d76xp7y1Gw859Tu5zMx / E4XN7HYdOVxeavXyDdeB + ydhuDoYjHVQebcLy4phrV4799wOxOesF <nl> + jE + 57 + Ls9lCyY9 + VGuhuX2jg3hte0LumyH3me7 / Cdmsvedk7q7CLf9EXlklqtIfLrfqCNL / 0hUNw <nl> + LDLRRJf5HVoL900wfrGPZXC2LhYN55nLRf0bsXjjg7Ty0Jsf + ND64DseOrdY7fw + k5n2ftpyT2dL <nl> + xTPuMcil7Wzj1u / Dio8H / D6 / 9uqJfp8H / 5F + n35PB / C / xkfXaA1WYz3gIFIf76UXLSPAmCkQCTOz <nl> + nTdEGPkcubVN4L2l96F9wxPR2y2YNsKKHNm / / E0gfuIyD7ek0Ltrfyj16UuX6dmreenloQfevDJc <nl> + XjtEmKGqQ7fLvkFPG7BPZ / YHDhk0XfHmHpB06nEC / ZSLJ8wvJ9dtHplMFHNNm2Yy7W1mQLNyL3Da <nl> + ty9OGUNf6rSh128j2RPUjW0xDe0IJgTQfNh8gKnfs1FnQm9s6r5QkiqAsPbZXOUDZp1L540S9DIJ <nl> + BlX7b66sQCckmNdkIzyx75Sifpz7UPZlaZjbnMvYEMQrPg776wu9Wo1sDxWCgPWCfl8CI2LUhM4W <nl> + 2gz7MyWuj + mawzHK5I39hXumHYe / pZhHr + 3FY2WOoDCHCJ2XTebmxu2Y3gC0RZxqKZZOXR0oiBOg <nl> + cyt9Cti7SmpdnT3biQg8b50AxiIIoqN + aYCDPJoXB3tDqxfieF8RvFsELsTL / R0XnTpzPeIVj1AP <nl> + jFCNKTV2DBWew + + rbhffE2TO1Qm6aezZaMwR6 / c4wde765enNtGD / I7N7j1WpH3o2L / rtp704Lst <nl> + nNHEK9WEzmPx8H / cBX8TOqy5FPudxt7liD2OpUniM6TQax8 + qzQjvPfFhV1ELd + dwoLE6Jka06Kc <nl> + Ck2Nu30y7i22VVl9GFwa + TCMnvYDUAhl2ITjh69Tg3p + oX3sWUMvBLJ + GV4ocuSBDh59XuARxjlq <nl> + sesOpwsNjxpOhaK2vJQ7dHlP7zeINbvs3MsLHvfbgu7KWx7YY9r5asjw + JePGN8 / orbDXx3yO22v <nl> + rwfLkdnXw6IGPPLqUMg8jsG6gMIckZrGejgj4Xi3ryWjw03t0pAr0C + iOgl82Rf53 + TrTbXlt8Yg <nl> + + D / cC / Pm <nl> + " " " . decode ( " base64 " ) . decode ( " zlib " ) <nl> + <nl> + # # file ez_setup . py <nl> + EZ_SETUP_PY = " " " <nl> + eJzNWmtv20YW / a5fwagwJCEyzfdDgbLoNikQoOgWaVNg4XjleVpsKJIlKTvaRf / 73jvDp2Qp7SIf <nl> + lkVqmxzeuc9zzx3pmxfFod7m2WQ6nf49z + uqLklhVKLeF3Wep5WRZFVN0pTUCSyavJPGId8bTySr <nl> + jTo39pUYr8WnpVEQ9ok8iFmlH5rFYWn8tq9qWMDSPRdGvU2qiUxSga / UWxBCdsLgSSlYnZcH4ymp <nl> + t0ZSLw2ScYNwrl7ADXFtnRdGLvVOrfzVajIx4JJlvjPEvzfqvpHsirysUctNr6VaN741X5xYVorf <nl> + 96COQYyqECyRCTMeRVmBE3Dv / tUl / g6reP6UpTnhk11Slnm5NPJSeYdkBklrUWakFt2i3tKl2pTB <nl> + Kp4bVW7Qg1HtiyI9JNnDBI0lRVHmRZng63mBQVB + uL8 / tuD + 3pxMfkE3Kb8ytTFKFEa5h98rNIWV <nl> + SaHMa6KqtCweSsKHcTQxGSaN86pDNXnz9vtvP / zwy + bXt + 9 / fvePH421MbXMgMXT7smH9z + gW / HJ <nl> + tq6L1c1NcSgSU + eWmZcPN01OVDdX1Q381212MzWucBOzce / tyr2bTHbc33BSExD4HxWwWf / GNexN <nl> + 7evi4JiuKR4eZitjFkWOw4iMLdvxLR55EY3jgIbS8VkgAkZmywtSvFYKDWMSEc9yhedbjqQ08oVw <nl> + pR17duj6jJ6R4ox18QM / DP2YRyTgkWSeZ4UWibkVOqHD4 / iylE4XDwwgEbeDmDtUBIEtieuQQPiO <nl> + 8GTknLPIHetCqWszS7LQjWMSuH4Yx6HPCI + lT6zAji5K6XRxIxIxuMsDwbjjOF4o7TCWISdBEEvC <nl> + zkjxxroEjuX5xPEE94QtKAtDKSw3JsQTgQyFf1FK7xdGHWJHPugRccKkpA63QR / LpS61mfe8FHaU <nl> + L9SVDvV9N + YBxDWUoUd4GNsOCCKxFZ2xiB3nC9jDBQdPBiF3uCOlsD3Lit3Akw7xzkSaHeWLtKzA <nl> + ozIgxKEht6RLiUU9UNCK7JA54UUpnS6BHdixIwRzfemFIhLEDhgPiO2AVCc8J + UoX6QdQaJBEXEp <nl> + IgiWH7MYpEibhzSM5JmsY0f5IizBQy + IHBbHEZU0dKmMLJf4lgAxtrgoxW + lECqkHUjOwTDf920v <nl> + 8mwWQh7yOIoD / 5yUo6yjFo1t1yaMUNexwBmQr6H0POZDwENbXpTSWQQpJ2HPgHuSSpfFIZWxFzAL <nl> + XAXZK5yLUjqLIqw6KGDXYZzGLHQokx6koRNIJyLyXNb5Y4uEiCWPLFAHMg8STboCatMPAwGYYwfn <nl> + Iu2PLSJSOIRLQAc7tGwhwLkhgIxPGQAXCc7VkX8Uo4i7MrC92GOMkCi0PUgc7oaUMe5yn5 + REowt <nl> + cv0gArSObDsARIkiL3RABCCf78WCOdZFKT1KMT8g0g8p + Be6AFRDYIEhnudCgfnkXDUGY4uoIyMS <nl> + + g6Adkx86gLYWhBqLnwJLcF3z0gJxxY5FsRIxoQzlwS2L3zb9qEMoTVEwnbP5ks4tsgnkYx9L7JC <nl> + 7gXEkjQImbSlA2GAR865CgjHFnmAlYQ7ICrEAvRcz7ZtyUXk2vAvPKdLdNTVLOxpTgweiTmNGKZg <nl> + SEnkWtggrctSOosYJW4E2AC9w4tcZmHOQraBsxkT4OSLUjqL7NCxQwA5CHTMme1bfmwRP6KugDqP <nl> + / XORjscWge7Ms6Ap2ehh6sWB8JikworAVmadi3R8hAyQZNCgHeG7UcQDQCcihBUAeLHA9c716UZK <nl> + Z5EUEFpX + MQOqe0wCBPzPZuGgnguiURwUUrQeZdA2dgSUZM4ggMw2bEbuQC6fuxArwIpf0wGxA5Y <nl> + ajWpy8NK8 + YtqbZpQlvaDBxsIj4zAYzxnbrzFpltsxYeDtdNuJDG5pGkCbA2sYFbc9BpkwGtXxpI <nl> + 5BYrZUAijfY + Uv + W5umHePEEOGINtA9FqBfNrfis7wJNb5eBnGbli3Un5bYVfdfLwwvoM5D616 + R <nl> + ZVY1FyXQ8 / loBV5TNKmxoKH5V0CmCbBp / sIw5j / lVZXQdMDigZnD37u / LaYnwq46M0ePFqO / UB / x <nl> + Oannjr5fQnDLTLlLO / SI46tFDU1eH3HyZafWhpJKrAfEfAmEfwMTxzqvTLYv4TedTN0LXKTksLb9 <nl> + SRMkYP / f7ut8B35gMCQcYKLI + E1n9mDgw / FsRz5BLGEGegRXEXQQOA9NK0i91VPZfaP0vVFt833K <nl> + cSgh2tdDae2Ale13VJQw6xGYGKtesJKFg0yG3jUkDC + dUvuMq1eEcT9yxL2Bo8n8aZuwbbu7AK1x <nl> + wtTyjNnNbGGCktpL97glyhlMo1tRjubcpwRGJ9pnguBLyEid4ErlLAd / pKUg / NCrD3vAkHk / drva <nl> + rhkxlZi60VJJo0Kp0jhEDZ4sz3ilfdOqURBIFHQqeATLKqlhXIQBcjCW6og39ueZUGOhHnG51guc <nl> + mqfow2fHXNSymRlFI0yN5GW + h52EVkXXGTF2oqpg1NNzal909 / cqX0qSwFz886Gqxe7tZ / RXpgMB <nl> + Q2oN9 / SASihCCxqPKYjG6OHVbDNU / Xwi1UajENi / NmbFp4dNKap8XzJRzRBhcPtdzvepqHDYHQDo <nl> + 8WNdE1B1HPKgcdt80SMJpty6L5pBXTYeOyrBtuyWR4XWY0BbJCZ4VpT13FriJgOQa4C62 + nVcEin <nl> + 7WnNpgnMRgHzGmXoAAGwH8saOUg9fAbhu5daQBo6pHl0usNItNkk13zaa / x6PX3ZuGrxqpE9VGEs <nl> + 4Fe98rs8k2nCanDNaoj + w8j / VbSf / rLts / 9Mvs9fr6 + qRVfLbQ2rE6mP2Rjwp4xksxpLqisRwAw8 <nl> + hVE10py6YLXsswxS2TR + SgVkSLv8RB7WEJYyAJAAW1oNZVJW4Ih9heUwAwmHNvTG9YeB8jPzSN7H <nl> + 7GM2 / 25fliAN4FwLuCqP + tYCulafy8Ik5UN1a91d7lkqfmklxjGARB + HczmstNujOr3DV74BaxWS <nl> + 559Gop7LwfNZ8yaBkkjoHjv4j3n9fQ594XI + 6077XFl / 7XaLxQ / lOeqzb55pqqqMSd8UjDRnmpIo <nl> + + NQ2JLU + 6FMU4 / + 0yWqIxqPctsl + qcfiPdz1tMFq3L / ve + aZvpjrbtg2Q2wqrN6TtDeiaTLjRtKe <nl> + FJfQa6gD2bqFFEp1nrV8dW0MwOz6qgLufVUh9Z4OC + foKFPnKsgd9g70mfFyTBEr8ihA + zVQct0U <nl> + fsuTbN62kHapFleVDMUpnvwjdPOWWiNUta9DkVZ1NddiFysssG8f8wQTqBAE + 2WrTtXVxwjP8VKp <nl> + yEEQeqNqvZTmD6NVSMYxLuN38YKV5hMpszn6 + frrXfqguwHWBsmr57L8SqUEHoDPxaPI8A8wpwBl <nl> + J1uRFsj73ulsG3CPLlWAnGD + 4xH9HF0xgZawNABdJnhrB + WcCXAkvAJ1iMwXEFo8IR4TGGerSr09 <nl> + 7AEKwc1JsyVAd8Nx + h1BZd5mszmZzAHExAo9rMTsCNsi3eK50I1pC + EFJeqnvPzUbLo0Ct1dclqT <nl> + 5uMVRAqFElfVZIIoAh5girWrBSC5r8SmckrRdKuhAebia0YRkmJ5kjID0D0hVCrLllhNJ68Bo1DJ <nl> + Wic4WTbEKRWieKV / zI + 41zg7WxhWfbGaqi2O + p4quQYfTPiZFyKbnyz7xngPpP / mqUxqAB + IMfhX <nl> + 0W3A8E9L / ITnCaOHdIGVWIYAjSwvy71KjlQcCVNxH6YHsvBaqPUtJrZX83HJuSEcDDBxIJkvxhpr <nl> + FFHWaKxYTp / oFNwJD0xlhx7Du5dgGMShcHUMAbDBSu3C0rwS88UJRFT1SgkdPm + 6WQtaoGCKv7Sw <nl> + NfkzF / bvHWT6HAjL4 / Jcx + 577rtLn32pHvsWqFWzqm0Qz5Hpo88ULzFpPTx0WH0isV9zecBQk7p1 <nl> + SsnGY8RoilAxw9IYzA4s3 + 3AUHPEIdvjHNIMZO3VxEi5OIVeoPy8eImnLXcLlaZPYlaqtBYGtvEv <nl> + pgpain4 + 6lWo9mkPgUX7DCbAT / POrDHhTIbE3dxsGm9tNsYaRkLLtEx79pdHhH8CwCtwxbmYVnkq <nl> + oFbPjMYt6Ydmoon9CaEvxS5 / VHirIqE / ulYTMHSOGqA3 / QLuHjH1s5S8Karfx2RlMHkN2c7pMPgn <nl> + Bjr4eYF / H01tq / PZ / j + n5KUy6wR / UcpJNj9Xd2253Y1nduVsawGJD1Zh94fAMZUp + OT5DMVdvpID <nl> + OvWV5hemMJ3m059PaNF02SLKFEDwQTWiEo9 / IQmBJPUJPX1G3mz + HujUtP2ShVkcxtPnVH994vQb <nl> + BuZi1hxrFl1 / akeYqofnD + qpgSVC90laX + tzYhD5gMPdARF5mMVlM / 8g12rPlTuxvUMU5 + 7ZNf6J <nl> + K + Y9q1ZC2l6omuaspLP + WXfMjO / eNUfUsm2qzx5Ty67Z6RFQt + jbKf5xVa7g3xKwAsaHhmlqQtZu <nl> + ZELz3VXzxV33slmBxV3rLHComE71pKCb9NAxEAEYIet2YlBfC1m3d80HUeuixfvz4XS + UYxhs2my <nl> + vnNJI2NpKLe8aihR64BXx8buSA3T4Br0NCtBSradTz9mw + 91fMzmt / / 64 + 7l4o + poieL4Rij3h5g <nl> + 0TOIDY1cfbEmNQSiwIvpaZG2iKhVhf / frpRgU1Hvub24gzFMOfKleqofwugKj1Z3z5s / e2pyQjb0 <nl> + qFN94IAJmNH6cb2ebTZYsJvNrPsUJEWJoKaq4deOaoft37f2HbxzfQ3O0qUyaF + D2umWO6u75 / qi <nl> + woheJi7S138BSGV4QQ = = <nl> + " " " . decode ( " base64 " ) . decode ( " zlib " ) <nl> + <nl> + # # file activate . sh <nl> + ACTIVATE_SH = " " " <nl> + eJytU99P2zAQfvdfcaQ8ABqN + srUh6IhUYmViXSdNECum1waS6ld2U6zgva / 75ykNP0xpGnkIYl9 <nl> + n8 / fffddB8aZtJDKHGFRWAczhMJiAqV0GQRWFyZGmEkVitjJlXAYwEVq9AJmwmYXrANrXUAslNIO <nl> + TKFAOkikwdjla8YS3JyCs3N4ZUCPTOERLhUEp / z + 7gufDB / G3wd3 / NtgfBvAM3wGl6GqkP7x2 / 1j <nl> + 0DcE / lpq4yrg216hLDo4OFTFU8mqb6eu3Ga6yBNI0BHnqigQKoEXm32CMpNxBplYIQj6UCjWi4UP <nl> + u0y4Sq8mFakWizwn3ZyGOd1NMtBfqo1fLAUJ2xy1XYAfpK0uXBN2Us2bNDtALwScet4QZ0LN0UJJ <nl> + TRKJf63BC07XGrRLYo7JnrjXg4j0vNT16md0yyc3D9HwfnRE5Kq0S7Mjz9 / aFPWOdSnqHTSJgAc9 <nl> + inrvtqgJbyjUkE30ZjTZEjshXkSkD4HSKkHrTOGNhnvcOhBhnsIGcLJ3 + 9aem3t / M3J0HZTGYE6t <nl> + Vw5Wwkgxy9G2Db17MWMtnv2A89aS84A1CrSLYQf + JA1rbzeLFjrk / Ho44qPB1xvOrxpY2 / psX0qf <nl> + zPeg0iuYkrNRiQXC007ep2BayUgc96XzvpIiJ2Nb9FaFAe0o8t5cxs2MayNJlAaOCJlzy6swLMuy <nl> + + 4KOnLrqkptDq1NXCoOh8BlC9maZxxatKaU8SvBpOn2GuhbMLW5Pn71T1Hl9gFra8h77oJn / gHn / <nl> + z1n / 9znfzDgp8gduuMqz <nl> + " " " . decode ( " base64 " ) . decode ( " zlib " ) <nl> + <nl> + # # file activate . bat <nl> + ACTIVATE_BAT = " " " <nl> + eJx9kMsOgjAQRfdN + g + zoAn8goZEDESJPBpEViSzkFbZ0IX8f + RRaVW0u5mee3PanbjeFSgpKXmI <nl> + Hqq4KC9BglFW + YjWhEgJJa2ETvXQCNl2ogFe5CkvwaUEhjPm543vcOdAiacjLxzzJFw6f2bZCsZ0 <nl> + 2YitXPtswawi1zwgC9II0QPD / RELyuOb1jB / Sg0rNhM31Ss4n2I + 7ibLb8epQGco2Rja1Fs / zeoa <nl> + cR9nWnprJaMspOQJdBR1 / g = = <nl> + " " " . decode ( " base64 " ) . decode ( " zlib " ) <nl> + <nl> + # # file deactivate . bat <nl> + DEACTIVATE_BAT = " " " <nl> + eJxzSE3OyFfIT0vj4spMU0hJTcvMS01RiPf3cYkP8wwKCXX0iQ8I8vcNCFHQ4FIAguLUEgWIgK0q <nl> + FlWqXJpcICVYpGzx2OAY4oFsPpCLbjpQCLvZILVcXFaufi5cACHzOrI = <nl> + " " " . decode ( " base64 " ) . decode ( " zlib " ) <nl> + <nl> + # # file distutils - init . py <nl> + DISTUTILS_INIT = " " " <nl> + eJytVl2r4zYQfdevGBKKbcia0r5dCPvQD7jQlkILLZRF6NpyrK4jGUm + SfrrO2M5tmQnbR9qSJCl <nl> + o9HMmZljqXNvrAfjmAojd5uHF2G10icH94lvjG7U6WdhnbSwT1 + VA208CHhX1g + ik / odzqYeOnkA <nl> + Z + AioRIaBidBefAGGqVr8K0E5 + tOvTFWK6vFWcIRnSl74dtymqEl5wevOsdpPkL8aZTOV / A8dqvk <nl> + vFGd5Lw4QDabyQqmmtmINvZMgzw9poDjxpV8s2e2X7wwwOfOWUmDfJyiZ / crRhoxMx8Fvag + i5ME <nl> + 4eELB6LvJTpOBL0hUzowRLR0phJeGQ3Chcmb8 / K8GPq4K5jsnAxu8DEEzkulkQWff3mAVXQjTF5l <nl> + BaaXC4kjoykUmeNcaeXRXH / LiqK0UtR5we5lQfCofKqRf8bYfo / R + aqFt0F1NZdXD4tpqI10OvPw <nl> + WZsLtPjDmE / Sj8FhQSBAWVl5Y2 + ToRYw + guWjbk4 + EBl1ApbV6aWgRGCIIPWDFNljYfLmnwqeysb <nl> + dSWfm / DeCd9gEinJGRr9 + qssMNdYE7FaVuZ8FroulxCmQJcJTIjB4Twxmqk64dwCyhPEVCv01LKh <nl> + VhCd + kty01OGHeROdk0Eoof8xtkSqbHC3jiy46jpfjJapkh6ttAj / PEpgbF / xEeFk5QGcYfp73gg <nl> + 9AC7HzBXu6JIzCXRluv4QnhbZx5T / 5Dw + YUHjQkG1rNR1o7L4liYyzE0mkrFvTBGrpM28VDGY3sT <nl> + ewQrv8U / q94GCqPcoNiUzHQ2TmYz1uYRHh4S0RKamy / NspK8TYNGrDWnLBjZRxonrwhw + dru5NZ + <nl> + 9i1K + wY7J2wPv7ViFPFKdF1oNWk / DPQZCAEBBcSmskUfgrBjp / XGqWu21CvtGaOfpH + HCpPEsgs6 <nl> + NQvbw00P96xRmzK + V3ACLCKvR7hytJSnoMUX1BBUIhRi1OoOnchHGre9S5hS6tpdFH41spXHWbFt <nl> + 4ZAPK8 / mXea0vWDpEn0rdJ0 / cN9KP1gdYOw / FC6ysy3mtEtmXV + 1Cio272 + + NRo / ERUamoFlujQ2 <nl> + x7y42peTHHPXy0o1qjpi9YXkHEndJm6QxDC5Vb1pfjw8VqeYjK2z6aH3Iwv2zEm8S9Sm4nzq38eL <nl> + 7Fn8MTWrvRsmUYifMUlXpadM4uKWSedRRPFDSatPmY1BQKL7P1K98Sr16V + IR8Rz4qPFx8SvmFzt <nl> + pRr / / vX3H797gV9aM3Q1vE43ltTYtPmdbmYfqS / C80o3ELxx4N0Mb9BE4tA0B7z1uvH10iq0dL / m <nl> + OIkiEa512LF1yf4GZEHtwg = = <nl> + " " " . decode ( " base64 " ) . decode ( " zlib " ) <nl> + <nl> + # # file distutils . cfg <nl> + DISTUTILS_CFG = " " " <nl> + eJxNj00KwkAMhfc9xYNuxe4Ft57AjYiUtDO1wXSmNJnK3N5pdSEEAu8nH6lxHVlRhtDHMPATA4uH <nl> + xJ4EFmGbvfJiicSHFRzUSISMY6hq3GLCRLnIvSTnEefN0FIjw5tF0Hkk9Q5dRunBsVoyFi24aaLg <nl> + 9FDOlL0FPGluf4QjcInLlxd6f6rqkgPu / 5nHLg0cXCscXoozRrP51DRT3j9QNl99AP53T2Q = <nl> + " " " . decode ( " base64 " ) . decode ( " zlib " ) <nl> + <nl> + # # file activate_this . py <nl> + ACTIVATE_THIS = " " " <nl> + eJx1UsGOnDAMvecrIlYriDRlKvU20h5aaY + teuilGo1QALO4CwlKAjP8fe1QGGalRoLEefbzs + Mk <nl> + Sb7NcvRo3iTcoGqwgyy06As + HWSNVciKaBTFywYoJWc7yit2ndBVwEkHkIzKCV0YdQdmkvShs6YH <nl> + E3IhfjFaaSNLoHxQy2sLJrL0ow98JQmEG / rAYn7OobVGogngBgf0P0hjgwgt7HOUaI5DdBVJkggR <nl> + 3HwSktaqWcCtgiHIH7qHV + esW2CnkRJ + 9R5cQGsikkWEV / J7leVGs9TV4TvcO5QOOrTHYI + xeCjY <nl> + JR / m9GPDHv2oSZunUokS2A / WBelnvx6tF6LUJO2FjjlH5zU6Q + Kz / 9m69LxvSZVSwiOlGnT1rt / A <nl> + 77j + WDQZ8x9k2mFJetOle88 + lc8sJJ / AeerI + fTlQigTfVqJUiXoKaaC3AqmI + KOnivjMLbvBVFU <nl> + 1JDruuadNGcPmkgiBTnQXUGUDd6IK9JEQ9yPdM96xZP8bieeMRqTuqbxIbbey2DjVUNzRs1rosFS <nl> + TsLAdS / 0fBGNdTGKhuqD7mUmsFlgGjN2eSj1tM3GnjfXwwCmzjhMbR4rLZXXk + Z / 6Hp7Pn2 + kJ49 <nl> + jfgLHgI4Jg = = <nl> + " " " . decode ( " base64 " ) . decode ( " zlib " ) <nl> + <nl> + if __name__ = = ' __main__ ' : <nl> + main ( ) <nl> + <nl> + # # TODO : <nl> + # # Copy python . exe . manifest <nl> + # # Monkeypatch distutils . sysconfig <nl> new file mode 100644 <nl> index 00000000000 . . 0b083dbaa18 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / docs / _hooks / extend_md . py <nl> <nl> + import markdown <nl> + <nl> + MARKDOWN_EXTENSIONS = [ " def_list " , " fenced_code " , " codehilite " , " tables " ] <nl> + <nl> + def extended_markdown ( text ) : <nl> + if isinstance ( text , str ) : <nl> + text = text . decode ( " utf8 " ) <nl> + return markdown . markdown ( text , extensions = MARKDOWN_EXTENSIONS , <nl> + output_format = " html " ) <nl> + <nl> + Config . transformers [ ' markdown ' ] = extended_markdown <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . b816a467f01 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / docs / _hooks / transformers . py <nl> @ @ - 0 , 0 + 1 @ @ <nl> + Config . transformers [ ' noop ' ] = lambda source : source <nl> new file mode 100644 <nl> index 00000000000 . . d11ea6a64cd <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / docs / _layout / default . html <nl> <nl> + < ! DOCTYPE html > <nl> + < html > <nl> + < head > <nl> + < meta http - equiv = " Content - Type " content = " text / html ; charset = UTF - 8 " > <nl> + < title > CommonJS : JavaScript Standard Library < / title > <nl> + < link href = " { { page . root } } css / styles . css " rel = " stylesheet " type = " text / css " > <nl> + < link href = " { { page . root } } css / colorful . css " rel = " stylesheet " type = " text / css " > <nl> + < style type = " text / css " > <nl> + . content { <nl> + background - image : url ( { { page . root } } images / banner_home . jpg ) ; <nl> + } <nl> + . news_wrapper { <nl> + margin - top : 152px ; <nl> + } <nl> + . content - left { <nl> + margin - left : 42px ; <nl> + margin - top : 180px ; <nl> + } <nl> + { % if page . urlparts | first = = " impl " % } <nl> + . nav2 { <nl> + background - image : url ( { { page . root } } images / nav_commonjs_on . png ) ; / * turn on the corresponding nav item * / <nl> + } <nl> + . content - left h1 { <nl> + color : # 4e5d2e ; / * change the color of page headers * / <nl> + } <nl> + . content { <nl> + background - image : url ( { { page . root } } images / banner_green . jpg ) ; / * change the color of the bg image * / <nl> + } <nl> + { % endif % } <nl> + { % if page . urlparts | first = = " specs " % } <nl> + . nav1 { <nl> + background - image : url ( { { page . root } } images / nav_js_on . png ) ; / * turn the corresponding nav item on * / <nl> + } <nl> + . content - left h1 { <nl> + color : # 266790 ; / * change the color of the page headers * / <nl> + } <nl> + . content { <nl> + background - image : url ( { { page . root } } images / banner_blue . jpg ) ; / * change the color of the bg image * / <nl> + } <nl> + { % endif % } <nl> + < / style > <nl> + < script type = " text / javascript " > <nl> + var _gaq = _gaq | | [ ] ; <nl> + _gaq . push ( [ ' _setAccount ' , ' UA - 125377 - 8 ' ] ) ; <nl> + _gaq . push ( [ ' _trackPageview ' ] ) ; <nl> + <nl> + ( function ( ) { <nl> + var ga = document . createElement ( ' script ' ) ; <nl> + ga . src = ( ' https : ' = = document . location . protocol ? <nl> + ' https : / / ssl ' : ' http : / / www ' ) + <nl> + ' . google - analytics . com / ga . js ' ; <nl> + ga . setAttribute ( ' async ' , ' true ' ) ; <nl> + document . documentElement . firstChild . appendChild ( ga ) ; <nl> + } ) ( ) ; <nl> + < / script > <nl> + < / head > <nl> + < body > <nl> + < div class = " header_wrapper " > <nl> + < div class = " header_bg " > <nl> + < div class = " nav_wrapper " > <nl> + < div class = " nav_div " > < / div > <nl> + < div class = " nav_item nav2 " > < a href = " { { page . root } } impl / index . html " > get it < / a > < / div > <nl> + < div class = " nav_div " > < / div > <nl> + < div class = " nav_item nav1 " > < a href = " { { page . root } } specs / 0 . 1 . html " > spec < / a > < / div > <nl> + < div class = " nav_div " > < / div > <nl> + < / div > <nl> + < a href = " { { page . root } } index . html " > < img border = " 0 " class = " logo " src = " { { page . root } } images / logo . png " width = " 200 " height = " 53 " > < / a > <nl> + < div class = " tagline " > javascript : not just for browsers any more ! < / div > <nl> + < / div > <nl> + < / div > <nl> + < div class = " content_wrapper " > <nl> + < div class = " content_bg " > <nl> + < div class = " content " > <nl> + < div class = " content - left " > <nl> + { { content } } <nl> + < / div > <nl> + < div class = " news_wrapper " > <nl> + < div class = " news - top " > <nl> + < h1 > Site Updates < / h1 > <nl> + < / div > <nl> + < div class = " news_items " > <nl> + < ul > <nl> + < li > / / Work is ongoing in fleshing out the content and bringing in new CommonJS 0 . 5 specs . < / li > <nl> + < li > / / Formatting has been cleaned up around the site and on the < a href = " { { page . root } } specs / modules / 1 . 0 . html " > Modules 1 . 0 < / a > page . < / a > <nl> + < / li > <nl> + < / ul > <nl> + < br > <nl> + < br > <nl> + < h1 > CommonJS Links < / h1 > <nl> + < ul > <nl> + < li > / / < a href = " http : / / wiki . commonjs . org / " > Wiki < / a > ( standards - in - training ! ) < / li > <nl> + < li > / / < a href = " http : / / groups . google . com / group / commonjs / " > Mailing list < / a > < / li > <nl> + < li > / / < a href = " http : / / twitter . com / commonjs " > Twitter < / a > < / li > <nl> + < li > / / < a href = " irc : / / irc . freenode . net / commonjs " > # commonjs on irc . freenode . net < / a > < / li > <nl> + < / ul > <nl> + < / div > <nl> + < / div > <nl> + < div class = " col_level " > & nbsp ; < / div > <nl> + < / div > <nl> + < / div > <nl> + < / div > <nl> + < div class = " footer_wrapper " > © Copyright 2009 Kevin Dangoor and many < a href = " { { page . root } } contributors . html " > CommonJS contributors < / a > . < a href = " { { page . root } } license . html " > MIT license < / a > . < / div > <nl> + < / body > <nl> + < / html > <nl> new file mode 100644 <nl> index 00000000000 . . b9d3a62dff5 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / docs / contributors . html . markdown <nl> <nl> + mmm <nl> + layout : default <nl> + title : CommonJS Contributors <nl> + mmm <nl> + <nl> + The CommonJS Contributors <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + Creating the CommonJS APIs has been a volunteer effort , and the people below have contributed their time and energy to creating a consensus around these APIs . Without working through the details and making compromises , we would never have standardized anything or seen any implementations come into existence . <nl> + <nl> + The following people have contributed substantially to the work of creating the CommonJS APIs : <nl> + <nl> + * Ihab Awad <nl> + * Ash Berlin <nl> + * Aristid Breitkreuz <nl> + * Kevin Dangoor <nl> + * Daniel Friesen <nl> + * Wes Garland <nl> + * Kris Kowal <nl> + * Dean Landolt <nl> + * Peter Michaux <nl> + * George Moschovitis <nl> + * Michael O ' Brien <nl> + * Tom Robinson <nl> + * Hannes Wallnoefer <nl> + * Mike Wilson <nl> + * Ondrej Zara <nl> + * Chris Zumbrunn <nl> + * Kris Zyp <nl> + <nl> + My apologies to any contributor whose name was omitted . With thousands of messages of discussion during 2009 , there are many people who have come and pitched in to the project with their ideas . <nl> + <nl> + Additionally , thanks are due to all of the people who have been involved in building the implementations of the CommonJS APIs . Many of the people on the list above are implementers , but there are many other people involved in their projects and many other projects that are not represented here . <nl> + <nl> + Thanks to you all for making this project a success ! <nl> new file mode 100644 <nl> index 00000000000 . . 72750df39d7 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / docs / css / colorful . css <nl> <nl> + . codehilite . hll { background - color : # ffffcc } <nl> + . codehilite . c { color : # 808080 } / * Comment * / <nl> + . codehilite . err { color : # F00000 ; background - color : # F0A0A0 } / * Error * / <nl> + . codehilite . k { color : # 008000 ; font - weight : bold } / * Keyword * / <nl> + . codehilite . o { color : # 303030 } / * Operator * / <nl> + . codehilite . cm { color : # 808080 } / * Comment . Multiline * / <nl> + . codehilite . cp { color : # 507090 } / * Comment . Preproc * / <nl> + . codehilite . c1 { color : # 808080 } / * Comment . Single * / <nl> + . codehilite . cs { color : # cc0000 ; font - weight : bold } / * Comment . Special * / <nl> + . codehilite . gd { color : # A00000 } / * Generic . Deleted * / <nl> + . codehilite . ge { font - style : italic } / * Generic . Emph * / <nl> + . codehilite . gr { color : # FF0000 } / * Generic . Error * / <nl> + . codehilite . gh { color : # 000080 ; font - weight : bold } / * Generic . Heading * / <nl> + . codehilite . gi { color : # 00A000 } / * Generic . Inserted * / <nl> + . codehilite . go { color : # 808080 } / * Generic . Output * / <nl> + . codehilite . gp { color : # c65d09 ; font - weight : bold } / * Generic . Prompt * / <nl> + . codehilite . gs { font - weight : bold } / * Generic . Strong * / <nl> + . codehilite . gu { color : # 800080 ; font - weight : bold } / * Generic . Subheading * / <nl> + . codehilite . gt { color : # 0040D0 } / * Generic . Traceback * / <nl> + . codehilite . kc { color : # 008000 ; font - weight : bold } / * Keyword . Constant * / <nl> + . codehilite . kd { color : # 008000 ; font - weight : bold } / * Keyword . Declaration * / <nl> + . codehilite . kn { color : # 008000 ; font - weight : bold } / * Keyword . Namespace * / <nl> + . codehilite . kp { color : # 003080 ; font - weight : bold } / * Keyword . Pseudo * / <nl> + . codehilite . kr { color : # 008000 ; font - weight : bold } / * Keyword . Reserved * / <nl> + . codehilite . kt { color : # 303090 ; font - weight : bold } / * Keyword . Type * / <nl> + . codehilite . m { color : # 6000E0 ; font - weight : bold } / * Literal . Number * / <nl> + . codehilite . s { background - color : # fff0f0 } / * Literal . String * / <nl> + . codehilite . na { color : # 0000C0 } / * Name . Attribute * / <nl> + . codehilite . nb { color : # 007020 } / * Name . Builtin * / <nl> + . codehilite . nc { color : # B00060 ; font - weight : bold } / * Name . Class * / <nl> + . codehilite . no { color : # 003060 ; font - weight : bold } / * Name . Constant * / <nl> + . codehilite . nd { color : # 505050 ; font - weight : bold } / * Name . Decorator * / <nl> + . codehilite . ni { color : # 800000 ; font - weight : bold } / * Name . Entity * / <nl> + . codehilite . ne { color : # F00000 ; font - weight : bold } / * Name . Exception * / <nl> + . codehilite . nf { color : # 0060B0 ; font - weight : bold } / * Name . Function * / <nl> + . codehilite . nl { color : # 907000 ; font - weight : bold } / * Name . Label * / <nl> + . codehilite . nn { color : # 0e84b5 ; font - weight : bold } / * Name . Namespace * / <nl> + . codehilite . nt { color : # 007000 } / * Name . Tag * / <nl> + . codehilite . nv { color : # 906030 } / * Name . Variable * / <nl> + . codehilite . ow { color : # 000000 ; font - weight : bold } / * Operator . Word * / <nl> + . codehilite . w { color : # bbbbbb } / * Text . Whitespace * / <nl> + . codehilite . mf { color : # 6000E0 ; font - weight : bold } / * Literal . Number . Float * / <nl> + . codehilite . mh { color : # 005080 ; font - weight : bold } / * Literal . Number . Hex * / <nl> + . codehilite . mi { color : # 0000D0 ; font - weight : bold } / * Literal . Number . Integer * / <nl> + . codehilite . mo { color : # 4000E0 ; font - weight : bold } / * Literal . Number . Oct * / <nl> + . codehilite . sb { background - color : # fff0f0 } / * Literal . String . Backtick * / <nl> + . codehilite . sc { color : # 0040D0 } / * Literal . String . Char * / <nl> + . codehilite . sd { color : # D04020 } / * Literal . String . Doc * / <nl> + . codehilite . s2 { background - color : # fff0f0 } / * Literal . String . Double * / <nl> + . codehilite . se { color : # 606060 ; font - weight : bold ; background - color : # fff0f0 } / * Literal . String . Escape * / <nl> + . codehilite . sh { background - color : # fff0f0 } / * Literal . String . Heredoc * / <nl> + . codehilite . si { background - color : # e0e0e0 } / * Literal . String . Interpol * / <nl> + . codehilite . sx { color : # D02000 ; background - color : # fff0f0 } / * Literal . String . Other * / <nl> + . codehilite . sr { color : # 000000 ; background - color : # fff0ff } / * Literal . String . Regex * / <nl> + . codehilite . s1 { background - color : # fff0f0 } / * Literal . String . Single * / <nl> + . codehilite . ss { color : # A06000 } / * Literal . String . Symbol * / <nl> + . codehilite . bp { color : # 007020 } / * Name . Builtin . Pseudo * / <nl> + . codehilite . vc { color : # 306090 } / * Name . Variable . Class * / <nl> + . codehilite . vg { color : # d07000 ; font - weight : bold } / * Name . Variable . Global * / <nl> + . codehilite . vi { color : # 3030B0 } / * Name . Variable . Instance * / <nl> + . codehilite . il { color : # 0000D0 ; font - weight : bold } / * Literal . Number . Integer . Long * / <nl> new file mode 100644 <nl> index 00000000000 . . ef95359ffa2 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / docs / css / default . css <nl> <nl> + . codehilite . hll { background - color : # ffffcc } <nl> + . codehilite { background : # f8f8f8 ; } <nl> + . codehilite . c { color : # 408080 ; font - style : italic } / * Comment * / <nl> + . codehilite . err { border : 1px solid # FF0000 } / * Error * / <nl> + . codehilite . k { color : # 008000 ; font - weight : bold } / * Keyword * / <nl> + . codehilite . o { color : # 666666 } / * Operator * / <nl> + . codehilite . cm { color : # 408080 ; font - style : italic } / * Comment . Multiline * / <nl> + . codehilite . cp { color : # BC7A00 } / * Comment . Preproc * / <nl> + . codehilite . c1 { color : # 408080 ; font - style : italic } / * Comment . Single * / <nl> + . codehilite . cs { color : # 408080 ; font - style : italic } / * Comment . Special * / <nl> + . codehilite . gd { color : # A00000 } / * Generic . Deleted * / <nl> + . codehilite . ge { font - style : italic } / * Generic . Emph * / <nl> + . codehilite . gr { color : # FF0000 } / * Generic . Error * / <nl> + . codehilite . gh { color : # 000080 ; font - weight : bold } / * Generic . Heading * / <nl> + . codehilite . gi { color : # 00A000 } / * Generic . Inserted * / <nl> + . codehilite . go { color : # 808080 } / * Generic . Output * / <nl> + . codehilite . gp { color : # 000080 ; font - weight : bold } / * Generic . Prompt * / <nl> + . codehilite . gs { font - weight : bold } / * Generic . Strong * / <nl> + . codehilite . gu { color : # 800080 ; font - weight : bold } / * Generic . Subheading * / <nl> + . codehilite . gt { color : # 0040D0 } / * Generic . Traceback * / <nl> + . codehilite . kc { color : # 008000 ; font - weight : bold } / * Keyword . Constant * / <nl> + . codehilite . kd { color : # 008000 ; font - weight : bold } / * Keyword . Declaration * / <nl> + . codehilite . kn { color : # 008000 ; font - weight : bold } / * Keyword . Namespace * / <nl> + . codehilite . kp { color : # 008000 } / * Keyword . Pseudo * / <nl> + . codehilite . kr { color : # 008000 ; font - weight : bold } / * Keyword . Reserved * / <nl> + . codehilite . kt { color : # B00040 } / * Keyword . Type * / <nl> + . codehilite . m { color : # 666666 } / * Literal . Number * / <nl> + . codehilite . s { color : # BA2121 } / * Literal . String * / <nl> + . codehilite . na { color : # 7D9029 } / * Name . Attribute * / <nl> + . codehilite . nb { color : # 008000 } / * Name . Builtin * / <nl> + . codehilite . nc { color : # 0000FF ; font - weight : bold } / * Name . Class * / <nl> + . codehilite . no { color : # 880000 } / * Name . Constant * / <nl> + . codehilite . nd { color : # AA22FF } / * Name . Decorator * / <nl> + . codehilite . ni { color : # 999999 ; font - weight : bold } / * Name . Entity * / <nl> + . codehilite . ne { color : # D2413A ; font - weight : bold } / * Name . Exception * / <nl> + . codehilite . nf { color : # 0000FF } / * Name . Function * / <nl> + . codehilite . nl { color : # A0A000 } / * Name . Label * / <nl> + . codehilite . nn { color : # 0000FF ; font - weight : bold } / * Name . Namespace * / <nl> + . codehilite . nt { color : # 008000 ; font - weight : bold } / * Name . Tag * / <nl> + . codehilite . nv { color : # 19177C } / * Name . Variable * / <nl> + . codehilite . ow { color : # AA22FF ; font - weight : bold } / * Operator . Word * / <nl> + . codehilite . w { color : # bbbbbb } / * Text . Whitespace * / <nl> + . codehilite . mf { color : # 666666 } / * Literal . Number . Float * / <nl> + . codehilite . mh { color : # 666666 } / * Literal . Number . Hex * / <nl> + . codehilite . mi { color : # 666666 } / * Literal . Number . Integer * / <nl> + . codehilite . mo { color : # 666666 } / * Literal . Number . Oct * / <nl> + . codehilite . sb { color : # BA2121 } / * Literal . String . Backtick * / <nl> + . codehilite . sc { color : # BA2121 } / * Literal . String . Char * / <nl> + . codehilite . sd { color : # BA2121 ; font - style : italic } / * Literal . String . Doc * / <nl> + . codehilite . s2 { color : # BA2121 } / * Literal . String . Double * / <nl> + . codehilite . se { color : # BB6622 ; font - weight : bold } / * Literal . String . Escape * / <nl> + . codehilite . sh { color : # BA2121 } / * Literal . String . Heredoc * / <nl> + . codehilite . si { color : # BB6688 ; font - weight : bold } / * Literal . String . Interpol * / <nl> + . codehilite . sx { color : # 008000 } / * Literal . String . Other * / <nl> + . codehilite . sr { color : # BB6688 } / * Literal . String . Regex * / <nl> + . codehilite . s1 { color : # BA2121 } / * Literal . String . Single * / <nl> + . codehilite . ss { color : # 19177C } / * Literal . String . Symbol * / <nl> + . codehilite . bp { color : # 008000 } / * Name . Builtin . Pseudo * / <nl> + . codehilite . vc { color : # 19177C } / * Name . Variable . Class * / <nl> + . codehilite . vg { color : # 19177C } / * Name . Variable . Global * / <nl> + . codehilite . vi { color : # 19177C } / * Name . Variable . Instance * / <nl> + . codehilite . il { color : # 666666 } / * Literal . Number . Integer . Long * / <nl> new file mode 100644 <nl> index 00000000000 . . 5941e66eb00 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / docs / css / styles . css <nl> <nl> + @ charset " UTF - 8 " ; <nl> + <nl> + body { <nl> + background - color : # 3c3c3c ; <nl> + font - family : Helvetica , Arial , sans - serif ; <nl> + margin : 0px ; <nl> + padding : 0px ; <nl> + font - size : 14px ; <nl> + line - height : 18px ; <nl> + } <nl> + . col_level { <nl> + font - size : 0px ; <nl> + clear : both ; <nl> + height : 1px ; <nl> + } <nl> + <nl> + <nl> + / * PAGE HEADER * / <nl> + <nl> + . header_wrapper { <nl> + height : 107px ; <nl> + background - image : url ( . . / images / header_wrapper_bg . png ) ; <nl> + background - repeat : repeat - x ; <nl> + } <nl> + . header_bg { <nl> + width : 970px ; <nl> + margin - right : auto ; <nl> + margin - left : auto ; <nl> + height : 107px ; <nl> + background - image : url ( . . / images / header_gradient . jpg ) ; <nl> + background - repeat : no - repeat ; <nl> + background - position : center ; <nl> + } <nl> + . tagline { <nl> + float : left ; <nl> + margin - left : 15px ; <nl> + line - height : 107px ; <nl> + font - size : 18px ; <nl> + color : # 9f9f9f ; <nl> + } <nl> + img . logo { <nl> + float : left ; <nl> + margin - top : 24px ; <nl> + margin - left : 0px ; <nl> + } <nl> + . nav_wrapper { <nl> + float : right ; <nl> + height : 107px ; <nl> + } <nl> + . nav_item { <nl> + float : right ; <nl> + width : 125px ; <nl> + color : # FFFFFF ; <nl> + text - align : center ; <nl> + padding - top : 60px ; <nl> + height : 47px ; <nl> + font - size : 22px ; <nl> + font - weight : normal ; <nl> + } <nl> + . nav_item a : link , . nav_item a : visited { <nl> + color : # FFFFFF ; <nl> + text - decoration : none ; <nl> + } <nl> + . nav_item a : hover { <nl> + color : # CCCCCC ; <nl> + } <nl> + . nav1 { <nl> + background - image : url ( . . / images / nav_js . png ) ; <nl> + background - repeat : repeat - x ; <nl> + background - position : bottom ; <nl> + } <nl> + . nav2 { <nl> + background - image : url ( . . / images / nav_commonjs . png ) ; <nl> + background - repeat : repeat - x ; <nl> + background - position : bottom ; <nl> + } <nl> + . nav3 { <nl> + background - image : url ( . . / images / nav_browsers . png ) ; <nl> + background - repeat : repeat - x ; <nl> + background - position : bottom ; <nl> + } <nl> + . nav_div { <nl> + float : right ; <nl> + background - image : url ( . . / images / nav_div . png ) ; <nl> + width : 1px ; <nl> + background - position : bottom ; <nl> + height : 107px ; <nl> + background - repeat : no - repeat ; <nl> + } <nl> + <nl> + <nl> + <nl> + <nl> + / * PAGE BODY * / <nl> + <nl> + . content_wrapper { <nl> + background - image : url ( . . / images / content - wrapper_bg . png ) ; <nl> + background - repeat : repeat - x ; <nl> + background - color : # efefef ; <nl> + } <nl> + <nl> + . content_bg { <nl> + width : 1000px ; <nl> + margin - right : auto ; <nl> + margin - left : auto ; <nl> + background - image : url ( . . / images / content_bg . png ) ; <nl> + background - repeat : repeat - y ; <nl> + } <nl> + <nl> + . content { <nl> + position : relative ; <nl> + background - image : url ( . . / images / banner_gray . jpg ) ; <nl> + background - repeat : no - repeat ; <nl> + background - position : center 11px ; <nl> + } <nl> + . content - left { <nl> + width : 680px ; <nl> + margin - left : 60px ; <nl> + float : left ; <nl> + margin - top : 60px ; <nl> + padding - bottom : 20px ; <nl> + } <nl> + . content - left h1 { <nl> + font - size : 28px ; <nl> + color : # 863e3e ; <nl> + font - weight : normal ; <nl> + margin - top : 0px ; <nl> + margin - right : 0px ; <nl> + margin - bottom : 6px ; <nl> + margin - left : 0px ; <nl> + } <nl> + <nl> + <nl> + <nl> + <nl> + / * NEWS * / <nl> + <nl> + . news_wrapper { <nl> + width : 219px ; <nl> + right : 14px ; <nl> + float : right ; <nl> + margin - right : 27px ; <nl> + margin - top : 70px ; <nl> + font - size : 12px ; <nl> + line - height : 13px ; <nl> + } <nl> + . news - top { <nl> + background - image : url ( . . / images / news_bg - top . png ) ; <nl> + background - repeat : no - repeat ; <nl> + height : 25px ; <nl> + background - position : left top ; <nl> + padding - left : 24px ; <nl> + vertical - align : bottom ; <nl> + padding - top : 20px ; <nl> + } <nl> + . news_items { <nl> + background - image : url ( . . / images / news_bg - btm . png ) ; <nl> + background - repeat : no - repeat ; <nl> + background - position : left bottom ; <nl> + padding - left : 24px ; <nl> + color : # 9d9d9d ; <nl> + padding - right : 12px ; <nl> + } <nl> + . news_items ul { <nl> + list - style : none ; <nl> + margin - left : 0 ; <nl> + padding - left : 1em ; <nl> + text - indent : - . 9em ; <nl> + margin - top : 0px ; <nl> + } <nl> + . news_items li { <nl> + margin - bottom : 8px ; <nl> + margin - left : 8px ; <nl> + } <nl> + . news_items a : link , . news_items a : visited { <nl> + color : # 90d5ff ; <nl> + text - decoration : none ; <nl> + } <nl> + . news_items a : hover { <nl> + text - decoration : underline ; <nl> + } <nl> + . news_wrapper h1 { <nl> + font - weight : normal ; <nl> + font - size : 16px ; <nl> + margin - bottom : 8px ; <nl> + color : # 636363 ; <nl> + margin - top : 0px ; <nl> + } <nl> + <nl> + <nl> + <nl> + <nl> + / * PAGE FOOT * / <nl> + <nl> + . footer_wrapper { <nl> + font - size : 10px ; <nl> + border - top - width : 10px ; <nl> + border - top - style : solid ; <nl> + border - top - color : # 636363 ; <nl> + text - align : center ; <nl> + padding - top : 10px ; <nl> + padding - bottom : 10px ; <nl> + color : # 999999 ; <nl> + } <nl> + . footer_bg { <nl> + width : 970px ; <nl> + margin - right : auto ; <nl> + margin - left : auto ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . dc4401ee16c <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / docs / history . html . markdown <nl> <nl> + mmm <nl> + layout : default <nl> + title : CommonJS Project History <nl> + mmm <nl> + <nl> + CommonJS Project History <nl> + = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + * January 2009 : the group was formed as " ServerJS " following a blog post on Kevin Dangoor ' s Blue Sky on Mars <nl> + * March 2009 : the dust had settled around " securable modules " as the module style for the group . This is CommonJS API 0 . 1 <nl> + * April 2009 : CommonJS modules were shown off with several implementations at the first JSConf in Washington , DC . <nl> + * August 2009 : The group name was formally changed to CommonJS to reflect the broader applicability of the APIs . <nl> new file mode 100644 <nl> index 00000000000 . . 476bd2ea054 <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / banner_blue . jpg differ <nl> new file mode 100644 <nl> index 00000000000 . . 70c7c20739f <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / banner_gray . jpg differ <nl> new file mode 100644 <nl> index 00000000000 . . 55c28c3e9ae <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / banner_green . jpg differ <nl> new file mode 100644 <nl> index 00000000000 . . 89f707eecae <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / banner_home . jpg differ <nl> new file mode 100644 <nl> index 00000000000 . . dd95ae0fe36 <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / banner_orange . jpg differ <nl> new file mode 100644 <nl> index 00000000000 . . b09c8486a7a <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / banner_red . jpg differ <nl> new file mode 100644 <nl> index 00000000000 . . fc7451b0fbf <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / content - wrapper_bg . png differ <nl> new file mode 100644 <nl> index 00000000000 . . ef089c632ec <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / content_bg . png differ <nl> new file mode 100644 <nl> index 00000000000 . . d85bccdfd52 <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / explosion . jpg differ <nl> new file mode 100644 <nl> index 00000000000 . . 3202c3802d8 <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / header_gradient . jpg differ <nl> new file mode 100644 <nl> index 00000000000 . . 49c5e8ad75e <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / header_wrapper_bg . png differ <nl> new file mode 100644 <nl> index 00000000000 . . 90b43b4693c <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / logo . png differ <nl> new file mode 100644 <nl> index 00000000000 . . a3e8bc0bff8 <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / nav_browsers . png differ <nl> new file mode 100644 <nl> index 00000000000 . . 30bf37cd217 <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / nav_browsers_on . png differ <nl> new file mode 100644 <nl> index 00000000000 . . 9daddb62c4a <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / nav_commonjs . png differ <nl> new file mode 100644 <nl> index 00000000000 . . 92933821a86 <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / nav_commonjs_on . png differ <nl> new file mode 100644 <nl> index 00000000000 . . 063c76902fa <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / nav_div . png differ <nl> new file mode 100644 <nl> index 00000000000 . . 4ab2cbb60df <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / nav_js . png differ <nl> new file mode 100644 <nl> index 00000000000 . . 668c2adeeca <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / nav_js_on . png differ <nl> new file mode 100644 <nl> index 00000000000 . . 14ccb2a6dee <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / news_bg - btm . png differ <nl> new file mode 100644 <nl> index 00000000000 . . 3aeed16ca92 <nl> Binary files / dev / null and b / js / common / test - data / modules / commonjs / docs / images / news_bg - top . png differ <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . 45ce4e74762 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / docs / impl / index . html . markdown <nl> <nl> + mmm <nl> + layout : default <nl> + Title : Get CommonJS <nl> + mmm <nl> + <nl> + Getting CommonJS <nl> + = = = = = = = = = = = = = = = = <nl> + <nl> + There are several implementations of the CommonJS standard , and you can choose the one that fits what you ' re trying to do . <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . 301b785eca7 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / docs / index . html . markdown <nl> <nl> + mmm <nl> + layout : default <nl> + title : CommonJS API <nl> + mmm <nl> + <nl> + CommonJS <nl> + = = = = = = = = <nl> + <nl> + JavaScript is a powerful object oriented language with some of the fastest dynamic language interpreters around . The official JavaScript specification defines APIs for some objects that are useful for building browser - based applications . However , the spec does not define a standard library that is useful for building a broader range of applications . <nl> + <nl> + The CommonJS API will fill that gap by defining APIs that handle many common application needs , ultimately providing a standard library as rich as those of Python , Ruby and Java . The intention is that an application developer will be able to write an application using the CommonJS APIs and then run that application across different JavaScript interpreters and host environments . With CommonJS - compliant systems , you can use JavaScript to write : <nl> + <nl> + * Server - side JavaScript applications <nl> + * Command line tools <nl> + * Desktop GUI - based applications <nl> + * Hybrid applications ( Titanium , Adobe AIR ) <nl> + <nl> + Read an [ additional introduction by Kris Kowal at Ars Technica ] ( http : / / arstechnica . com / web / news / 2009 / 12 / commonjs - effort - sets - javascript - on - path - for - world - domination . ars ) . <nl> + <nl> + Current version : [ 0 . 1 ] ( specs / 0 . 1 . html ) <nl> + In development : [ 0 . 5 ] ( specs / 0 . 5 . html ) <nl> + <nl> + Implementations <nl> + mmmmmmmmmmmmmmm <nl> + <nl> + < table id = " implementations " class = " tablesorter " > <nl> + < thead > <nl> + < tr > < th > Project < / th > < th > API Version < / th > < th > Interpreter < / tr > <nl> + < / thead > <nl> + < tbody > <nl> + < tr > < td > < a href = " impl / narwhal . html " > Narwhal < / a > < / td > < td > 0 . 1 + < / td > < td > < a href = " interp / rhino . html " > Rhino < / a > , < a href = " interp / mozilla . html " > Mozilla < / a > < / td > < / tr > <nl> + < tr > < td > < a href = " impl / v8cgi . html " > v8cgi < / a > < / td > < td > 0 . 1 + < / td > < td > < a href = " interp / v8 . html " > v8 < / a > < / td > < / tr > <nl> + < tr > < td > < a href = " impl / helma . html " > Helma < / a > < / td > < td > 0 . 1 + < / td > < td > < a href = " interp / rhino . html " > Rhino < / a > < / td > < / tr > <nl> + < tr > < td > < a href = " impl / persevere . html " > Persevere < / a > < / td > < td > 0 . 1 + < / td > < td > < a href = " interp / rhino . html " > Rhino < / a > < / td > < / tr > <nl> + < tr > < td > < a href = " impl / gpsee . html " > GPSEE < / a > < / td > < td > 0 . 1 + < / td > < td > < a href = " interp / spidermonkey . html " > SpiderMonkey < / a > < / td > < / tr > <nl> + < tr > < td > < a href = " impl / flusspferd . html " > Flusspferd < / a > < / td > < td > 0 . 1 + < / td > < td > < a href = " interp / spidermonkey . html " > SpiderMonkey < / a > < / td > < / tr > <nl> + < tr > < td > < a href = " impl / monkeyscript . html " > MonkeyScript < / a > < / td > < td > 0 . 0 < / td > < td > < a href = " interp / rhino . html " > Rhino < / a > < / td > < / tr > <nl> + < / tbody > <nl> + < / table > <nl> + <nl> + More information about CommonJS <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + * [ Group Process ] ( process . html ) <nl> + * [ Project History ] ( history . html ) <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . 8c42f773fa5 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / docs / license . html . markdown <nl> <nl> + mmm <nl> + layout : default <nl> + title : License <nl> + mmm <nl> + <nl> + CommonJS Documentation and Code License <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + The output of the CommonJS group is protected under copyright laws , but is intended for the good of the JavaScript development community . CommonJS related projects are licensed under whatever terms the author ( s ) wish to apply , but the CommonJS specifications and test suites are all licensed under the MIT - style license presented below . <nl> + <nl> + Copyright 2009 Kevin Dangoor and many < a href = " { { page . root } } commonjs / contributors . html " > CommonJS contributors < / a > <nl> + <nl> + License <nl> + mmmmmm - <nl> + <nl> + Permission is hereby granted , free of charge , to any person obtaining a copy <nl> + of this software and associated documentation files ( the " Software " ) , to deal <nl> + in the Software without restriction , including without limitation the rights <nl> + to use , copy , modify , merge , publish , distribute , sublicense , and / or sell <nl> + copies of the Software , and to permit persons to whom the Software is <nl> + furnished to do so , subject to the following conditions : <nl> + <nl> + The above copyright notice and this permission notice shall be included in <nl> + all copies or substantial portions of the Software . <nl> + <nl> + THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR <nl> + IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY , <nl> + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL THE <nl> + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER <nl> + LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM , <nl> + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> + THE SOFTWARE . <nl> new file mode 100644 <nl> index 00000000000 . . e7bfef0860c <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / docs / process . html . markdown <nl> <nl> + mmm <nl> + layout : default <nl> + title : CommonJS Process <nl> + mmm <nl> + <nl> + CommonJS Process <nl> + = = = = = = = = = = = = = = = = <nl> + <nl> + The CommonJS group has , to date , operated in an informal manner . Our goal is to make meaningful progress toward these goals : <nl> + <nl> + 1 . Design reasonable APIs for common application needs <nl> + 2 . Document those designs <nl> + 3 . Implement those designs in different interpreters and environments <nl> + <nl> + The process followed through the development of CommonJS 0 . 5 has been : <nl> + <nl> + 1 . Discussion of an API area is started on the mailing list <nl> + 2 . A page is created [ on the wiki ] [ wiki ] to collect proposals and prior art <nl> + 3 . Further discussion and iteration on the proposals <nl> + 4 . A rough consensus is reached <nl> + 5 . The proposal graduates from the wiki to this website <nl> + <nl> + So far , achieving rough consensus among the group has been a successful route to meeting these goals . Everyone involved has interoperability on their mind and interop necessarily involves compromise and minimal [ bikeshedding ] [ ] . <nl> + <nl> + As applications built upon the CommonJS APIs start appearing , we will likely need more process to handle changes to the API . <nl> + <nl> + Further reading <nl> + mmmmmmmmmmmmmmm <nl> + <nl> + For an interesting take on API design from a highly regarded master , take a look at [ this tech talk by Josh Bloch ] [ bloch ] . <nl> + <nl> + [ wiki ] : http : / / wiki . commonjs . org / " CommonJS Wiki " <nl> + [ bikeshedding ] : http : / / en . wikipedia . org / wiki / Parkinson % 27s_Law_of_Triviality " Parkinson ' s Law of Triviality " <nl> + [ bloch ] : http : / / www . youtube . com / watch ? v = aAb7hSCtvGw " Josh Bloch on API design " <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 00000000000 . . b93e5960926 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / docs / specs / 0 . 1 . html . markdown <nl> <nl> + mmm <nl> + layout : default <nl> + title : CommonJS API 0 . 1 <nl> + mmm <nl> + <nl> + CommonJS API 0 . 1 <nl> + = = = = = = = = = = = = = = = = <nl> + <nl> + As an initial step to allowing code re - use between JavaScript interpreters and libraries , we have defined a common module format : <nl> + <nl> + * [ Modules 1 . 0 ] ( modules / 1 . 0 . html ) <nl> + <nl> + This format has gained broad acceptance in the community and had several implementations which were demonstrated at JSConf 2009 in Washington DC . <nl> new file mode 100644 <nl> index 00000000000 . . c492146246c <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / docs / specs / 0 . 5 . html . markdown <nl> <nl> + mmm <nl> + layout : default <nl> + title : CommonJS API 0 . 5 <nl> + mmm <nl> + <nl> + CommonJS API 0 . 5 <nl> + = = = = = = = = = = = = = = = = <nl> + <nl> + CommonJS 0 . 5 is currently being developed . It will enable a much broader range of applications to be developed an run seamlessly in different environments . <nl> + <nl> + Here are the current specifications and discussions for 0 . 5 : <nl> + <nl> + * [ Modules 1 . 0 ] ( modules / 1 . 0 . html ) <nl> + * [ Binary Data Type ] ( http : / / wiki . commonjs . org / wiki / Binary ) <nl> + * [ Encodings ] ( http : / / wiki . commonjs . org / wiki / Encodings ) <nl> + * [ I / O Streams ] ( http : / / wiki . commonjs . org / wiki / IO ) <nl> + * [ Filesystem ] ( http : / / wiki . commonjs . org / wiki / Filesystem ) <nl> + * [ System interface ] ( http : / / wiki . commonjs . org / wiki / System ) <nl> + * [ Unit Testing ] ( http : / / wiki . commonjs . org / wiki / Unit_Testing ) <nl> + * [ Sockets ] ( http : / / wiki . commonjs . org / wiki / Sockets ) <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . 277de3bd0f3 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / docs / specs / modules / 1 . 0 . html . markdown <nl> <nl> + mmm <nl> + layout : default <nl> + title : CommonJS Modules 1 . 0 <nl> + mmm <nl> + <nl> + CommonJS Modules <nl> + = = = = = = = = = = = = = = = = <nl> + <nl> + This specification addresses how modules should be written in order to be interoperable among a class of module systems that can be both client and server side , secure or insecure , implemented today or supported by future systems with syntax extensions . These modules are offered privacy of their top scope , facility for importing singleton objects from other modules , and exporting their own API . By implication , this specification defines the minimum features that a module system must provide in order to support interoperable modules . <nl> + <nl> + Contract <nl> + mmmmmm - - <nl> + <nl> + # # # Module Context # # # <nl> + <nl> + 1 . In a module , there is a free variable " require " , that is a function . <nl> + 1 . The " require " function accepts a module identifier . <nl> + 2 . " require " returns the exported API of the foreign module . <nl> + 3 . If there is a dependency cycle , the foreign module may not have finished executing at the time it is required by one of its transitive dependencies ; in this case , the object returned by " require " must contain at least the exports that the foreign module has prepared before the call to require that led to the current module ' s execution . <nl> + 4 . If the requested module cannot be returned , " require " must throw an error . <nl> + 2 . In a module , there is a free variable called " exports " , that is an object that the module may add its API to as it executes . <nl> + 3 . modules must use the " exports " object as the only means of exporting . <nl> + <nl> + # # # Module Identifiers # # # <nl> + <nl> + 1 . A module identifier is a String of " terms " delimited by forward slashes . <nl> + 2 . A term must be a camelCase identifier , " . " , or " . . " . <nl> + 3 . Module identifiers may not have file - name extensions like " . js " . <nl> + 4 . Module identifiers may be " relative " or " top - level " . A module identifier is " relative " if the first term is " . " or " . . " . <nl> + 5 . Top - level identifiers are resolved off the conceptual module name space root . <nl> + 6 . Relative identifiers are resolved relative to the identifier of the module in which " require " is written and called . <nl> + <nl> + # # # Unspecified # # # <nl> + <nl> + This specification leaves the following important points of interoperability unspecified : <nl> + <nl> + 1 . Whether modules are stored with a database , file system , or factory functions , or are interchangeable with link libraries . <nl> + 2 . Whether a PATH is supported by the module loader for resolving module identifiers . <nl> + <nl> + Sample Code <nl> + mmmmmmmmm - - <nl> + <nl> + * math . js : * <nl> + <nl> + : : : js <nl> + exports . add = function ( ) { <nl> + var sum = arguments [ 0 ] ; <nl> + for ( var i = 1 ; i < arguments . length ; i + + ) { <nl> + sum + = arguments [ i ] ; <nl> + } <nl> + return sum ; <nl> + } ; <nl> + <nl> + * increment . js : * <nl> + <nl> + : : : js <nl> + var add = require ( ' math ' ) . add ; <nl> + <nl> + exports . increment = function ( val ) { <nl> + return add ( val , 1 ) ; <nl> + } ; <nl> + <nl> + * program . js : * <nl> + <nl> + : : : js <nl> + var inc = require ( ' increment ' ) . increment ; <nl> + var a = 1 ; <nl> + inc ( a ) ; / / 2 <nl> + <nl> + Related Documents <nl> + mmmmmmmmmmmmmmm - - <nl> + <nl> + * Proposal to ECMA TC39 : [ Module System for ES - Harmony ] ( http : / / docs . google . com / Doc ? id = dfgxb7gk_34gpk37z9v & hl = en ) <nl> + * Presentation to ECMA TC39 : [ Modules ] ( http : / / docs . google . com / Presentation ? docid = dcd8d5dk_0cs639jg8 & hl = en ) <nl> new file mode 100644 <nl> index 00000000000 . . 83b45ef4953 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / pavement . py <nl> <nl> + import sys <nl> + <nl> + from paver . easy import * <nl> + import paver . virtual <nl> + <nl> + options ( <nl> + virtualenv = Bunch ( <nl> + packages_to_install = [ ' pip ' ] , <nl> + paver_command_line = " initial " <nl> + ) <nl> + ) <nl> + <nl> + @ task <nl> + def initial ( ) : <nl> + " " " Initial setup help . " " " <nl> + venv_command = " Scripts / activate . bat " if sys . platform = = ' win32 ' \ <nl> + else " source bin / activate " <nl> + <nl> + print " " " This is the source for the CommonJS website . <nl> + <nl> + You can build the website , by running these two commands ( the <nl> + result will be in _site ) : <nl> + <nl> + % s <nl> + paver build <nl> + " " " % ( venv_command ) <nl> + <nl> + @ task <nl> + def build ( options ) : <nl> + " " " Builds the documentation . " " " <nl> + if not path ( " src / growl " ) . exists ( ) : <nl> + sh ( " pip install - r requirements . txt " ) <nl> + sh ( " growl . py . . . / _site " , cwd = " docs " ) <nl> + <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 00000000000 . . 277c859580b <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / requirements . txt <nl> <nl> + - e git : / / github . com / dangoor / growl . git # egg = growl <nl> + PyYAML <nl> + Jinja2 <nl> + Markdown <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 00000000000 . . da5bf4fd188 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / absolute / b . js <nl> @ @ - 0 , 0 + 1 @ @ <nl> + exports . foo = function ( ) { } ; <nl> new file mode 100644 <nl> index 00000000000 . . 7980ecf1436 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / absolute / program . js <nl> <nl> + var test = require ( ' test ' ) ; <nl> + var a = require ( ' submodule / a ' ) ; <nl> + var b = require ( ' b ' ) ; <nl> + test . assert ( a . foo ( ) . foo = = = b . foo , ' require works with absolute identifiers ' ) ; <nl> + test . print ( ' DONE ' , ' info ' ) ; <nl> new file mode 100644 <nl> index 00000000000 . . bc138b87da7 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / absolute / submodule / a . js <nl> <nl> + exports . foo = function ( ) { <nl> + return require ( ' b ' ) ; <nl> + } ; <nl> new file mode 100644 <nl> index 00000000000 . . 5d0984eec87 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / absolute / test . js <nl> <nl> + <nl> + exports . print = typeof print ! = = " undefined " ? print : function ( ) { <nl> + var system = require ( " system " ) ; <nl> + var stdio = system . stdio ; <nl> + stdio . print . apply ( stdio , arguments ) ; <nl> + } ; <nl> + <nl> + exports . assert = function ( guard , message ) { <nl> + if ( guard ) { <nl> + exports . print ( ' PASS ' + message , ' pass ' ) ; <nl> + } else { <nl> + exports . print ( ' FAIL ' + message , ' fail ' ) ; <nl> + } <nl> + } ; <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . e0188fa08cc <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / cyclic / a . js <nl> <nl> + exports . a = function ( ) { <nl> + return b ; <nl> + } ; <nl> + var b = require ( ' b ' ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 873a3057762 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / cyclic / b . js <nl> <nl> + var a = require ( ' a ' ) ; <nl> + exports . b = function ( ) { <nl> + return a ; <nl> + } ; <nl> new file mode 100644 <nl> index 00000000000 . . 2ee4758dbe2 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / cyclic / program . js <nl> <nl> + var test = require ( ' test ' ) ; <nl> + var a = require ( ' a ' ) ; <nl> + var b = require ( ' b ' ) ; <nl> + <nl> + test . assert ( a . a , ' a exists ' ) ; <nl> + test . assert ( b . b , ' b exists ' ) <nl> + test . assert ( a . a ( ) . b = = = b . b , ' a gets b ' ) ; <nl> + test . assert ( b . b ( ) . a = = = a . a , ' b gets a ' ) ; <nl> + <nl> + test . print ( ' DONE ' , ' info ' ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 5d0984eec87 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / cyclic / test . js <nl> <nl> + <nl> + exports . print = typeof print ! = = " undefined " ? print : function ( ) { <nl> + var system = require ( " system " ) ; <nl> + var stdio = system . stdio ; <nl> + stdio . print . apply ( stdio , arguments ) ; <nl> + } ; <nl> + <nl> + exports . assert = function ( guard , message ) { <nl> + if ( guard ) { <nl> + exports . print ( ' PASS ' + message , ' pass ' ) ; <nl> + } else { <nl> + exports . print ( ' FAIL ' + message , ' fail ' ) ; <nl> + } <nl> + } ; <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . 7c0e50b0b14 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / determinism / program . js <nl> <nl> + var test = require ( ' test ' ) ; <nl> + require ( ' submodule / a ' ) ; <nl> + test . print ( ' DONE ' , ' info ' ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 215ea1d9a73 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / determinism / submodule / a . js <nl> <nl> + var test = require ( ' test ' ) ; <nl> + var pass = false ; <nl> + var test = require ( ' test ' ) ; <nl> + try { <nl> + require ( ' a ' ) ; <nl> + } catch ( exception ) { <nl> + pass = true ; <nl> + } <nl> + test . assert ( pass , ' require does not fall back to relative modules when absolutes are not available . ' ) <nl> new file mode 100644 <nl> index 00000000000 . . 139597f9cb0 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / determinism / submodule / b . js <nl> <nl> + <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . 5d0984eec87 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / determinism / test . js <nl> <nl> + <nl> + exports . print = typeof print ! = = " undefined " ? print : function ( ) { <nl> + var system = require ( " system " ) ; <nl> + var stdio = system . stdio ; <nl> + stdio . print . apply ( stdio , arguments ) ; <nl> + } ; <nl> + <nl> + exports . assert = function ( guard , message ) { <nl> + if ( guard ) { <nl> + exports . print ( ' PASS ' + message , ' pass ' ) ; <nl> + } else { <nl> + exports . print ( ' FAIL ' + message , ' fail ' ) ; <nl> + } <nl> + } ; <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . 99c929e44fa <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / exactExports / a . js <nl> <nl> + exports . program = function ( ) { <nl> + return require ( ' program ' ) ; <nl> + } ; <nl> new file mode 100644 <nl> index 00000000000 . . e82bd6db2c7 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / exactExports / program . js <nl> <nl> + var test = require ( ' test ' ) ; <nl> + var a = require ( ' a ' ) ; <nl> + test . assert ( a . program ( ) = = = exports , ' exact exports ' ) ; <nl> + test . print ( ' DONE ' , ' info ' ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 5d0984eec87 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / exactExports / test . js <nl> <nl> + <nl> + exports . print = typeof print ! = = " undefined " ? print : function ( ) { <nl> + var system = require ( " system " ) ; <nl> + var stdio = system . stdio ; <nl> + stdio . print . apply ( stdio , arguments ) ; <nl> + } ; <nl> + <nl> + exports . assert = function ( guard , message ) { <nl> + if ( guard ) { <nl> + exports . print ( ' PASS ' + message , ' pass ' ) ; <nl> + } else { <nl> + exports . print ( ' FAIL ' + message , ' fail ' ) ; <nl> + } <nl> + } ; <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . 1653f1b863d <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / hasOwnProperty / program . js <nl> <nl> + var hasOwnProperty = require ( ' hasOwnProperty ' ) ; <nl> + var toString = require ( ' toString ' ) ; <nl> + var test = require ( ' test ' ) ; <nl> + test . print ( ' DONE ' , ' info ' ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 5d0984eec87 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / hasOwnProperty / test . js <nl> <nl> + <nl> + exports . print = typeof print ! = = " undefined " ? print : function ( ) { <nl> + var system = require ( " system " ) ; <nl> + var stdio = system . stdio ; <nl> + stdio . print . apply ( stdio , arguments ) ; <nl> + } ; <nl> + <nl> + exports . assert = function ( guard , message ) { <nl> + if ( guard ) { <nl> + exports . print ( ' PASS ' + message , ' pass ' ) ; <nl> + } else { <nl> + exports . print ( ' FAIL ' + message , ' fail ' ) ; <nl> + } <nl> + } ; <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . 69c48af67a8 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / method / a . js <nl> <nl> + exports . foo = function ( ) { <nl> + return this ; <nl> + } ; <nl> + exports . set = function ( x ) { <nl> + this . x = x ; <nl> + } ; <nl> + exports . get = function ( ) { <nl> + return this . x ; <nl> + } ; <nl> + exports . getClosed = function ( ) { <nl> + return exports . x ; <nl> + } ; <nl> new file mode 100644 <nl> index 00000000000 . . 192811c5a7e <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / method / program . js <nl> <nl> + var test = require ( ' test ' ) ; <nl> + var a = require ( ' a ' ) ; <nl> + var foo = a . foo ; <nl> + test . assert ( a . foo ( ) = = a , ' calling a module member ' ) ; <nl> + test . assert ( foo ( ) = = ( function ( ) { return this } ) ( ) , ' members not implicitly bound ' ) ; <nl> + a . set ( 10 ) ; <nl> + test . assert ( a . get ( ) = = 10 , ' get and set ' ) <nl> + test . print ( ' DONE ' , ' info ' ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 5d0984eec87 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / method / test . js <nl> <nl> + <nl> + exports . print = typeof print ! = = " undefined " ? print : function ( ) { <nl> + var system = require ( " system " ) ; <nl> + var stdio = system . stdio ; <nl> + stdio . print . apply ( stdio , arguments ) ; <nl> + } ; <nl> + <nl> + exports . assert = function ( guard , message ) { <nl> + if ( guard ) { <nl> + exports . print ( ' PASS ' + message , ' pass ' ) ; <nl> + } else { <nl> + exports . print ( ' FAIL ' + message , ' fail ' ) ; <nl> + } <nl> + } ; <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . c6b03aa28f6 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / missing / program . js <nl> <nl> + var test = require ( ' test ' ) ; <nl> + try { <nl> + require ( ' bogus ' ) ; <nl> + test . print ( ' FAIL require throws error when module missing ' , ' fail ' ) ; <nl> + } catch ( exception ) { <nl> + test . print ( ' PASS require throws error when module missing ' , ' pass ' ) ; <nl> + } <nl> + test . print ( ' DONE ' , ' info ' ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 5d0984eec87 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / missing / test . js <nl> <nl> + <nl> + exports . print = typeof print ! = = " undefined " ? print : function ( ) { <nl> + var system = require ( " system " ) ; <nl> + var stdio = system . stdio ; <nl> + stdio . print . apply ( stdio , arguments ) ; <nl> + } ; <nl> + <nl> + exports . assert = function ( guard , message ) { <nl> + if ( guard ) { <nl> + exports . print ( ' PASS ' + message , ' pass ' ) ; <nl> + } else { <nl> + exports . print ( ' FAIL ' + message , ' fail ' ) ; <nl> + } <nl> + } ; <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . a949e1dcf59 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / monkeys / a . js <nl> @ @ - 0 , 0 + 1 @ @ <nl> + require ( ' program ' ) . monkey = 10 ; <nl> new file mode 100644 <nl> index 00000000000 . . 42d67112eef <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / monkeys / program . js <nl> <nl> + var a = require ( ' a ' ) ; <nl> + var test = require ( ' test ' ) ; <nl> + test . assert ( exports . monkey = = 10 , ' monkeys permitted ' ) ; <nl> + test . print ( ' DONE ' , ' info ' ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 5d0984eec87 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / monkeys / test . js <nl> <nl> + <nl> + exports . print = typeof print ! = = " undefined " ? print : function ( ) { <nl> + var system = require ( " system " ) ; <nl> + var stdio = system . stdio ; <nl> + stdio . print . apply ( stdio , arguments ) ; <nl> + } ; <nl> + <nl> + exports . assert = function ( guard , message ) { <nl> + if ( guard ) { <nl> + exports . print ( ' PASS ' + message , ' pass ' ) ; <nl> + } else { <nl> + exports . print ( ' FAIL ' + message , ' fail ' ) ; <nl> + } <nl> + } ; <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . 69fd2822831 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / nested / a / b / c / d . js <nl> <nl> + exports . foo = function ( ) { <nl> + return 1 ; <nl> + } ; <nl> new file mode 100644 <nl> index 00000000000 . . c014b572777 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / nested / program . js <nl> <nl> + var test = require ( ' test ' ) ; <nl> + test . assert ( require ( ' a / b / c / d ' ) . foo ( ) = = 1 , ' nested module identifier ' ) ; <nl> + test . print ( ' DONE ' , ' info ' ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 5d0984eec87 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / nested / test . js <nl> <nl> + <nl> + exports . print = typeof print ! = = " undefined " ? print : function ( ) { <nl> + var system = require ( " system " ) ; <nl> + var stdio = system . stdio ; <nl> + stdio . print . apply ( stdio , arguments ) ; <nl> + } ; <nl> + <nl> + exports . assert = function ( guard , message ) { <nl> + if ( guard ) { <nl> + exports . print ( ' PASS ' + message , ' pass ' ) ; <nl> + } else { <nl> + exports . print ( ' FAIL ' + message , ' fail ' ) ; <nl> + } <nl> + } ; <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . b3e4b6ed7cf <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / relative / program . js <nl> <nl> + var test = require ( ' test ' ) ; <nl> + var a = require ( ' submodule / a ' ) ; <nl> + var b = require ( ' submodule / b ' ) ; <nl> + test . assert ( a . foo = = b . foo , ' a and b share foo through a relative require ' ) ; <nl> + test . print ( ' DONE ' , ' info ' ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 42e4ca0864e <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / relative / submodule / a . js <nl> @ @ - 0 , 0 + 1 @ @ <nl> + exports . foo = require ( ' . / b ' ) . foo ; <nl> new file mode 100644 <nl> index 00000000000 . . 9042c16b5af <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / relative / submodule / b . js <nl> <nl> + exports . foo = function ( ) { <nl> + } ; <nl> new file mode 100644 <nl> index 00000000000 . . 5d0984eec87 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / relative / test . js <nl> <nl> + <nl> + exports . print = typeof print ! = = " undefined " ? print : function ( ) { <nl> + var system = require ( " system " ) ; <nl> + var stdio = system . stdio ; <nl> + stdio . print . apply ( stdio , arguments ) ; <nl> + } ; <nl> + <nl> + exports . assert = function ( guard , message ) { <nl> + if ( guard ) { <nl> + exports . print ( ' PASS ' + message , ' pass ' ) ; <nl> + } else { <nl> + exports . print ( ' FAIL ' + message , ' fail ' ) ; <nl> + } <nl> + } ; <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . 4df7bb8d26d <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / transitive / a . js <nl> @ @ - 0 , 0 + 1 @ @ <nl> + exports . foo = require ( ' b ' ) . foo ; <nl> new file mode 100644 <nl> index 00000000000 . . 30ea70dd177 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / transitive / b . js <nl> @ @ - 0 , 0 + 1 @ @ <nl> + exports . foo = require ( ' c ' ) . foo ; <nl> new file mode 100644 <nl> index 00000000000 . . 69fd2822831 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / transitive / c . js <nl> <nl> + exports . foo = function ( ) { <nl> + return 1 ; <nl> + } ; <nl> new file mode 100644 <nl> index 00000000000 . . 98bb9964450 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / transitive / program . js <nl> <nl> + var test = require ( ' test ' ) ; <nl> + test . assert ( require ( ' a ' ) . foo ( ) = = 1 , ' transitive ' ) ; <nl> + test . print ( ' DONE ' , ' info ' ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 5d0984eec87 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / modules / 1 . 0 / transitive / test . js <nl> <nl> + <nl> + exports . print = typeof print ! = = " undefined " ? print : function ( ) { <nl> + var system = require ( " system " ) ; <nl> + var stdio = system . stdio ; <nl> + stdio . print . apply ( stdio , arguments ) ; <nl> + } ; <nl> + <nl> + exports . assert = function ( guard , message ) { <nl> + if ( guard ) { <nl> + exports . print ( ' PASS ' + message , ' pass ' ) ; <nl> + } else { <nl> + exports . print ( ' FAIL ' + message , ' fail ' ) ; <nl> + } <nl> + } ; <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . 14ae2b93422 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / commonjs / tests / unit - testing / 1 . 0 / program . js <nl> <nl> + / / From Node . js test / mjsunit / test - assert . js <nl> + / / Felix Geisendörfer ( felixge ) , backported from NodeJS <nl> + / / Karl Guertin ( greyrest ) , backported from NodeJS <nl> + / / Kris Kowal ( kriskowal ) , conversion to CommonJS <nl> + <nl> + / / strangely meta , no ? <nl> + <nl> + var assert = require ( ' assert ' ) ; <nl> + <nl> + function makeBlock ( f ) { <nl> + var args = Array . prototype . slice . call ( arguments , 1 ) ; <nl> + return function ( ) { <nl> + return f . apply ( this , args ) ; <nl> + } <nl> + } <nl> + <nl> + exports [ ' test AssertionError instanceof Error ' ] = function ( ) { <nl> + assert . ok ( new assert . AssertionError ( { } ) instanceof Error ) ; <nl> + } ; <nl> + <nl> + exports [ ' test ok false ' ] = function ( ) { <nl> + assert [ ' throws ' ] ( makeBlock ( assert . ok , false ) , assert . AssertionError ) ; <nl> + } ; <nl> + <nl> + exports [ ' test ok ( true ) ' ] = makeBlock ( assert . ok , true ) ; <nl> + exports [ ' test ok ( " test " ) ' ] = makeBlock ( assert . ok , " test " ) ; <nl> + exports [ ' test equal true false ' ] = function ( ) { <nl> + assert [ ' throws ' ] ( makeBlock ( assert . equal , true , false ) , assert . AssertionError , ' equal ' ) ; <nl> + } ; <nl> + <nl> + exports [ ' test equal null null ' ] = makeBlock ( assert . equal , null , null ) ; <nl> + exports [ ' test equal undefined undefined ' ] = makeBlock ( assert . equal , undefined , undefined ) ; <nl> + exports [ ' test equal null undefined ' ] = makeBlock ( assert . equal , null , undefined ) ; <nl> + exports [ ' test equal 2 " 2 " ' ] = makeBlock ( assert . equal , 2 , " 2 " ) ; <nl> + exports [ ' test equal " 2 " 2 ' ] = makeBlock ( assert . equal , " 2 " , 2 ) ; <nl> + exports [ ' test equal true true ' ] = makeBlock ( assert . equal , true , true ) ; <nl> + exports [ ' test notEqual true false ' ] = makeBlock ( assert . notEqual , true , false ) ; <nl> + exports [ ' test notEqual true true ' ] = function ( ) { <nl> + assert [ ' throws ' ] ( makeBlock ( assert . notEqual , true , true ) , assert . AssertionError , ' notEqual ' ) ; <nl> + } ; <nl> + exports [ ' test strictEqual 2 " 2 " ' ] = function ( ) { <nl> + assert [ ' throws ' ] ( makeBlock ( assert . strictEqual , 2 , " 2 " ) , assert . AssertionError , ' strictEqual ' ) ; <nl> + } ; <nl> + exports [ ' test strictEqual null undefined ' ] = function ( ) { <nl> + assert [ ' throws ' ] ( makeBlock ( assert . strictEqual , null , undefined ) , assert . AssertionError , ' strictEqual ' ) ; <nl> + } ; <nl> + exports [ ' test notStrictEqual 2 " 2 " ' ] = makeBlock ( assert . notStrictEqual , 2 , " 2 " ) ; <nl> + <nl> + / / deepEquals <nl> + <nl> + / / 7 . 2 <nl> + exports [ ' test 7 . 2 deepEqual date ' ] = makeBlock ( assert . deepEqual , new Date ( 2000 , 3 , 14 ) , new Date ( 2000 , 3 , 14 ) ) ; <nl> + exports [ ' test 7 . 2 deepEqual date negative ' ] = function ( ) { <nl> + assert [ ' throws ' ] ( makeBlock ( assert . deepEqual , new Date ( ) , new Date ( 2000 , 3 , 14 ) ) , assert . AssertionError , ' deepEqual date ' ) ; <nl> + } ; <nl> + <nl> + / / 7 . 3 <nl> + exports [ ' test 7 . 3 deepEqual 4 " 4 " ' ] = makeBlock ( assert . deepEqual , 4 , " 4 " ) ; <nl> + exports [ ' test 7 . 3 deepEqual " 4 " 4 ' ] = makeBlock ( assert . deepEqual , " 4 " , 4 ) ; <nl> + exports [ ' test 7 . 3 deepEqual true 1 ' ] = makeBlock ( assert . deepEqual , true , 1 ) ; <nl> + exports [ ' test 7 . 3 deepEqual 4 " 5 " ' ] = function ( ) { <nl> + assert [ ' throws ' ] ( makeBlock ( assert . deepEqual , 4 , " 5 " ) ) ; <nl> + } ; <nl> + <nl> + / / 7 . 4 <nl> + / / having the same number of owned properties & & the same set of keys <nl> + exports [ ' test 7 . 4 deepEqual { a : 4 } { a : 4 } ' ] = makeBlock ( assert . deepEqual , { a : 4 } , { a : 4 } ) ; <nl> + exports [ ' test 7 . 4 deepEqual { a : 4 , b : " 2 " } { a : 4 , b : " 2 " } ' ] = makeBlock ( assert . deepEqual , { a : 4 , b : " 2 " } , { a : 4 , b : " 2 " } ) ; <nl> + exports [ ' test 7 . 4 deepEqual [ 4 ] [ " 4 " ] ' ] = makeBlock ( assert . deepEqual , [ 4 ] , [ " 4 " ] ) ; <nl> + exports [ ' test 7 . 4 deepEqual { a : 4 } { a : 4 , b : true } ' ] = function ( ) { <nl> + assert [ ' throws ' ] ( makeBlock ( assert . deepEqual , { a : 4 } , { a : 4 , b : true } ) , assert . AssertionError ) ; <nl> + } ; <nl> + <nl> + exports [ ' test deepEqual [ " a " ] , { 0 : " a " } ' ] = makeBlock ( assert . deepEqual , [ " a " ] , { 0 : " a " } ) ; <nl> + / / ( although not necessarily the same order ) , <nl> + exports [ ' test deepEqual { a : 4 , b : " 1 " } { b : " 1 " , a : 4 } ' ] = makeBlock ( assert . deepEqual , { a : 4 , b : " 1 " } , { b : " 1 " , a : 4 } ) ; <nl> + <nl> + exports [ ' test deepEqual arrays with non - numeric properties ' ] = function ( ) { <nl> + var a1 = [ 1 , 2 , 3 ] ; <nl> + var a2 = [ 1 , 2 , 3 ] ; <nl> + a1 . a = " test " ; <nl> + a1 . b = true ; <nl> + a2 . b = true ; <nl> + a2 . a = " test " <nl> + assert [ ' throws ' ] ( makeBlock ( assert . deepEqual , Object . keys ( a1 ) , Object . keys ( a2 ) ) , assert . AssertionError ) ; <nl> + makeBlock ( assert . deepEqual , a1 , a2 ) ; <nl> + } ; <nl> + <nl> + exports [ ' test deepEqual identical prototype ' ] = function ( ) { <nl> + / / having an identical prototype property <nl> + var nbRoot = { <nl> + toString : function ( ) { return this . first + ' ' + this . last ; } <nl> + } <nl> + var nameBuilder = function ( first , last ) { <nl> + this . first = first ; <nl> + this . last = last ; <nl> + return this ; <nl> + } <nl> + nameBuilder . prototype = nbRoot ; <nl> + var nameBuilder2 = function ( first , last ) { <nl> + this . first = first ; <nl> + this . last = last ; <nl> + return this ; <nl> + } <nl> + nameBuilder2 . prototype = nbRoot ; <nl> + var nb1 = new nameBuilder ( ' Ryan ' , ' Dahl ' ) ; <nl> + var nb2 = new nameBuilder2 ( ' Ryan ' , ' Dahl ' ) ; <nl> + <nl> + assert . deepEqual ( nb1 , nb2 ) ; <nl> + <nl> + nameBuilder2 . prototype = Object ; <nl> + nb2 = new nameBuilder2 ( ' Ryan ' , ' Dahl ' ) ; <nl> + assert [ ' throws ' ] ( makeBlock ( assert . deepEqual , nb1 , nb2 ) , assert . AssertionError ) ; <nl> + <nl> + } ; <nl> + <nl> + exports [ ' test deepEqual " a " { } ' ] = function ( ) { <nl> + assert [ ' throws ' ] ( makeBlock ( assert . deepEqual , ' a ' , { } ) , assert . AssertionError ) ; <nl> + } ; <nl> + <nl> + exports [ ' test deepEqual " " " " ' ] = function ( ) { <nl> + assert . deepEqual ( " " , " " ) ; <nl> + } ; <nl> + <nl> + exports [ ' test deepEqual " " [ " " ] ' ] = function ( ) { <nl> + assert [ ' throws ' ] ( makeBlock ( assert . deepEqual , ' ' , [ ' ' ] ) , assert . AssertionError ) ; <nl> + } ; <nl> + <nl> + exports [ ' test deepEqual [ " " ] [ " " ] ' ] = function ( ) { <nl> + assert . deepEqual ( [ " " ] , [ " " ] ) ; <nl> + } ; <nl> + <nl> + exports [ ' test throw AssertionError ' ] = function ( ) { <nl> + <nl> + / / Testing the throwing <nl> + function thrower ( errorConstructor ) { <nl> + throw new errorConstructor ( ' test ' ) ; <nl> + } <nl> + var aethrow = makeBlock ( thrower , assert . AssertionError ) ; <nl> + var aethrow = makeBlock ( thrower , assert . AssertionError ) ; <nl> + / / the basic calls work <nl> + assert [ ' throws ' ] ( makeBlock ( thrower , assert . AssertionError ) , assert . AssertionError , ' message ' ) ; <nl> + assert [ ' throws ' ] ( makeBlock ( thrower , assert . AssertionError ) , assert . AssertionError ) ; <nl> + assert [ ' throws ' ] ( makeBlock ( thrower , assert . AssertionError ) ) ; <nl> + / / if not passing an error , catch all . <nl> + assert [ ' throws ' ] ( makeBlock ( thrower , TypeError ) ) ; <nl> + / / when passing a type , only catch errors of the appropriate type <nl> + var threw = false ; <nl> + try { <nl> + assert [ ' throws ' ] ( makeBlock ( thrower , TypeError ) , assert . AssertionError ) ; <nl> + } catch ( e ) { <nl> + threw = true ; <nl> + assert . ok ( e instanceof TypeError , ' type ' ) ; <nl> + } <nl> + assert . ok ( threw , ' assert . throws with an explicit error is eating extra errors ' , assert . AssertionError ) ; <nl> + threw = false ; <nl> + <nl> + } ; <nl> + <nl> + if ( module = = require . main ) <nl> + require ( " test " ) . run ( exports ) ; <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . 19a088badc8 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / node_modules / TestA / index . js <nl> <nl> + exports . version = " A 1 . 0 . 0 " ; <nl> + exports . x = require ( " . / x " ) ; <nl> + exports . B = require ( " TestB " ) ; <nl> + exports . C = require ( " TestC " ) ; <nl> + exports . D = require ( " TestD " ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 7ec079f710b <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / node_modules / TestA / node_modules / TestB / index . js <nl> @ @ - 0 , 0 + 1 @ @ <nl> + exports . version = " B 2 . 0 . 0 " ; <nl> new file mode 100644 <nl> index 00000000000 . . 447071a2a91 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / node_modules / TestA / node_modules / TestB / package . json <nl> <nl> + { <nl> + " name " : " B " , <nl> + " description " : " B " , <nl> + " main " : " index " , <nl> + " version " : " 2 . 0 . 0 " <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 303ee384334 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / node_modules / TestA / node_modules / TestC / index . js <nl> <nl> + exports . version = " C 1 . 0 . 0 " ; <nl> + exports . B = require ( " TestB " ) ; <nl> new file mode 100644 <nl> index 00000000000 . . b03bb8c694b <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / node_modules / TestA / node_modules / TestC / package . json <nl> <nl> + { <nl> + " name " : " C " , <nl> + " description " : " C " , <nl> + " main " : " index " , <nl> + " version " : " 1 . 0 . 0 " <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 4d781bfde6a <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / node_modules / TestA / package . json <nl> <nl> + { <nl> + " name " : " A " , <nl> + " description " : " A " , <nl> + " main " : " index " , <nl> + " version " : " 1 . 0 . 0 " <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 6847468a84f <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / node_modules / TestA / x . js <nl> @ @ - 0 , 0 + 1 @ @ <nl> + exports . version = " x 1 . 0 . 0 " ; <nl> new file mode 100644 <nl> index 00000000000 . . 613ef085a3c <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / node_modules / TestB / index . js <nl> @ @ - 0 , 0 + 1 @ @ <nl> + exports . version = " B 1 . 0 . 0 " ; <nl> new file mode 100644 <nl> index 00000000000 . . c71c4e3d7c4 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / node_modules / TestB / package . json <nl> <nl> + { <nl> + " name " : " B " , <nl> + " description " : " B " , <nl> + " main " : " index " , <nl> + " version " : " 1 . 0 . 0 " <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 33b2d22cf4b <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / node_modules / TestD / index . js <nl> @ @ - 0 , 0 + 1 @ @ <nl> + exports . version = " D 1 . 0 . 0 " ; <nl> new file mode 100644 <nl> index 00000000000 . . 5e1206560e2 <nl> mmm / dev / null <nl> ppp b / js / common / test - data / modules / node_modules / TestD / package . json <nl> <nl> + { <nl> + " name " : " D " , <nl> + " description " : " D " , <nl> + " main " : " index " , <nl> + " version " : " 1 . 0 . 0 " <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . bbf503b2004 <nl> mmm / dev / null <nl> ppp b / js / common / tests / shell - require . js <nl> <nl> + / * jslint indent : 2 , nomen : true , maxlen : 80 * / <nl> + / * global require , assertEqual , assertTrue * / <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / @ brief test the module and package require <nl> + / / / <nl> + / / / @ file <nl> + / / / <nl> + / / / DISCLAIMER <nl> + / / / <nl> + / / / Copyright 2010 - 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> + var jsunity = require ( " jsunity " ) ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / - - SECTION - - require package suite <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / @ brief test suite <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + function RequirePackageSuite ( ) { <nl> + <nl> + return { <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / @ brief test package loading <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + testPackage : function ( ) { <nl> + var m = require ( " TestA " ) ; <nl> + <nl> + assertEqual ( m . version , " A 1 . 0 . 0 " ) ; <nl> + assertEqual ( m . x . version , " x 1 . 0 . 0 " ) ; <nl> + assertEqual ( m . B . version , " B 2 . 0 . 0 " ) ; <nl> + assertEqual ( m . C . version , " C 1 . 0 . 0 " ) ; <nl> + assertEqual ( m . C . B . version , " B 2 . 0 . 0 " ) ; <nl> + assertEqual ( m . D . version , " D 1 . 0 . 0 " ) ; <nl> + <nl> + assertEqual ( m . B , m . C . B ) ; <nl> + <nl> + var n = require ( " TestB " ) ; <nl> + <nl> + assertEqual ( n . version , " B 1 . 0 . 0 " ) ; <nl> + assertNotEqual ( n , m . B ) ; <nl> + } <nl> + <nl> + } ; <nl> + } <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / - - SECTION - - require module suite <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / @ brief test suite <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + function RequireModuleSuite ( ) { <nl> + var internal = require ( " internal " ) ; <nl> + var console = require ( " console " ) ; <nl> + var modulePath = internal . MODULES_PATH ; <nl> + var first = modulePath [ 0 ] ; <nl> + <nl> + function appendModulePath ( testPath ) { <nl> + internal . MODULES_PATH = modulePath . concat ( [ first + " / . . / . . / common / test - data / modules / commonjs / tests / modules / 1 . 0 / " + testPath ] ) ; <nl> + module . root . unloadAll ( ) ; <nl> + <nl> + var test = internal . GlobalPackage . defineSystemModule ( " / test " ) ; <nl> + <nl> + test . exports . print = internal . print ; <nl> + <nl> + test . exports . assert = function ( guard , message ) { <nl> + console . log ( " running test % s " , message ) ; <nl> + assertEqual ( guard ! = = false , true ) ; <nl> + } ; <nl> + } <nl> + <nl> + return { <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / @ brief tear down <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + tearDown : function ( ) { <nl> + internal . MODULES_PATH = modulePath ; <nl> + module . root . unloadAll ( ) ; <nl> + } , <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / @ brief test module loading <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + testRequireCommonJS : function ( ) { <nl> + var i ; <nl> + var tests = [ <nl> + " absolute " , " cyclic " , " determinism " , " exactExports " , " hasOwnProperty " , <nl> + " method " , " missing " , " monkeys " , " nested " , " relative " , " transitive " ] ; <nl> + <nl> + for ( i = 0 ; i < tests . length ; i + + ) { <nl> + var name = tests [ i ] ; <nl> + <nl> + console . log ( " running CommonJS test ' % s ' " , name ) ; <nl> + appendModulePath ( name ) ; <nl> + require ( " program " ) ; <nl> + } <nl> + } <nl> + <nl> + } ; <nl> + } <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / - - SECTION - - main <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / @ brief executes the test suite <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + jsunity . run ( RequirePackageSuite ) ; <nl> + jsunity . run ( RequireModuleSuite ) ; <nl> + <nl> + return jsunity . done ( ) ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / - - SECTION - - END - OF - FILE <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + <nl> + / / Local Variables : <nl> + / / mode : outline - minor <nl> + / / outline - regexp : " / / / @ brief \ \ | / / / @ addtogroup \ \ | / / - - SECTION - - \ \ | / / / @ page \ \ | / / / @ } " <nl> + / / End : <nl>
added tests , fixed unloadAll
arangodb/arangodb
c9226054fc7e8c52937109b430be35b128532cfe
2013-02-26T17:12:28Z
mmm a / hphp / runtime / base / execution - context . cpp <nl> ppp b / hphp / runtime / base / execution - context . cpp <nl> StrNR ExecutionContext : : createFunction ( const String & args , <nl> } <nl> <nl> VMRegAnchor _ ; <nl> + auto const ar = GetCallerFrame ( ) ; <nl> / / It doesn ' t matter if there ' s a user function named __lambda_func ; we only <nl> / / use this name during parsing , and then change it to an impossible name <nl> / / with a NUL byte before we merge it into the request ' s func map . This also <nl> StrNR ExecutionContext : : createFunction ( const String & args , <nl> / / user function named __lambda_func when you call create_function . Huzzah ! ) <nl> static StringData * oldName = makeStaticString ( " __lambda_func " ) ; <nl> std : : ostringstream codeStr ; <nl> - codeStr < < ( vmfp ( ) - > unit ( ) - > isHHFile ( ) ? " < ? hh " : " < ? php " ) <nl> + codeStr < < ( ar - > unit ( ) - > isHHFile ( ) ? " < ? hh " : " < ? php " ) <nl> < < " function " < < oldName - > data ( ) <nl> < < " ( " < < args . data ( ) < < " ) { " <nl> < < code . data ( ) < < " } \ n " ; <nl> mmm a / hphp / runtime / base / preg . cpp <nl> ppp b / hphp / runtime / base / preg . cpp <nl> static Variant php_pcre_replace ( const String & pattern , const String & subject , <nl> auto data = result . data ( ) + result_len ; <nl> if ( eval ) { <nl> VMRegAnchor _ ; <nl> + auto const ar = GetCallerFrame ( ) ; <nl> / / reserve space for " < ? php return " + code + " ; " <nl> String prefixedCode ( full_len - result_len + 14 , ReserveString ) ; <nl> prefixedCode + = <nl> - ( vmfp ( ) - > unit ( ) - > isHHFile ( ) ? " < ? hh return " : " < ? php return " ) ; <nl> + ( ar - > unit ( ) - > isHHFile ( ) ? " < ? hh return " : " < ? php return " ) ; <nl> prefixedCode + = folly : : StringPiece { data , full_len - result_len } ; <nl> prefixedCode + = " ; " ; <nl> auto const unit = g_context - > compileEvalString ( prefixedCode . get ( ) ) ; <nl> - auto const ar = GetCallerFrame ( ) ; <nl> auto const ctx = ar - > func ( ) - > cls ( ) ; <nl> auto const func = unit - > getMain ( ctx ) ; <nl> ObjectData * thiz ; <nl> new file mode 100644 <nl> index 00000000000 . . 8d2bb8ac209 <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / create_function / file - mode . php <nl> <nl> + < ? php <nl> + / / Copyright 2004 - present Facebook . All Rights Reserved . <nl> + <nl> + $ f = create_function ( ' $ x ' , ' return vec [ $ x ] ; ' ) ; <nl> + var_dump ( $ f ( 123 ) ) ; <nl> new file mode 100644 <nl> index 00000000000 . . c7e51d16a88 <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / create_function / file - mode . php . expectf <nl> <nl> + Notice : Use of undefined constant vec - assumed ' vec ' <nl> + <nl> + Notice : Uninitialized string offset : 123 <nl> + string ( 0 ) " " <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . a8254487663 <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / preg - file - mode . php <nl> <nl> + < ? php <nl> + / / Copyright 2004 - present Facebook . All Rights Reserved . <nl> + <nl> + var_dump ( preg_replace ( ' / ( . * ) / e ' , ' ( vec [ 1 , 2 , 3 ] ) [ 1 ] ' , ' ' ) ) ; <nl> new file mode 100644 <nl> index 00000000000 . . aacae02226a <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / preg - file - mode . php . expectf <nl> <nl> + Deprecated : preg_replace ( ) : The / e modifier is deprecated , use preg_replace_callback instead in % s / preg - file - mode . php on line 4 <nl> + <nl> + Fatal error : syntax error , unexpected ' , ' , expecting ' ] ' <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . 8fa036e2e62 <nl> mmm / dev / null <nl> ppp b / hphp / test / zend / good / ext / reflection / tests / config . ini <nl> @ @ - 0 , 0 + 1 @ @ <nl> + hhvm . hack . lang . look_for_typechecker = false <nl>
Use correct frame when determining ? php or ? hh
facebook/hhvm
458c115692e430ff08070348078d981d0ef14343
2017-03-30T16:18:22Z
mmm a / src / backfill_progress . cc <nl> ppp b / src / backfill_progress . cc <nl> <nl> - / / Copyright 2010 - 2012 RethinkDB , all rights reserved . <nl> + / / Copyright 2010 - 2014 RethinkDB , all rights reserved . <nl> # include " backfill_progress . hpp " <nl> <nl> - # include " errors . hpp " <nl> - # include < boost / bind . hpp > <nl> - <nl> # include " concurrency / pmap . hpp " <nl> # include " containers / scoped . hpp " <nl> <nl> traversal_progress_combiner_t : : ~ traversal_progress_combiner_t ( ) { <nl> guarantee ( ! is_destructing ) ; <nl> is_destructing = true ; <nl> - pmap ( constituents . size ( ) , boost : : bind ( & traversal_progress_combiner_t : : destroy_constituent , this , _1 ) ) ; <nl> + pmap ( constituents . size ( ) , std : : bind ( & traversal_progress_combiner_t : : destroy_constituent , this , ph : : _1 ) ) ; <nl> } <nl> <nl> void traversal_progress_combiner_t : : destroy_constituent ( int i ) { <nl> progress_completion_fraction_t traversal_progress_combiner_t : : guess_completion ( ) <nl> int released = 0 , total = 0 ; <nl> <nl> std : : vector < progress_completion_fraction_t > fractions ( constituents . size ( ) , progress_completion_fraction_t ( ) ) ; <nl> - pmap ( fractions . size ( ) , boost : : bind ( & traversal_progress_combiner_t : : get_constituent_fraction , this , _1 , & fractions ) ) ; <nl> + pmap ( fractions . size ( ) , std : : bind ( & traversal_progress_combiner_t : : get_constituent_fraction , this , ph : : _1 , & fractions ) ) ; <nl> <nl> for ( std : : vector < progress_completion_fraction_t > : : const_iterator it = fractions . begin ( ) ; <nl> it ! = fractions . end ( ) ; <nl>
Removed boost : : bind from backfill_progress . cc .
rethinkdb/rethinkdb
6434c13c00ef92578aec08b3b3454d432531aa92
2014-01-22T12:27:10Z
new file mode 100644 <nl> index 000000000000 . . 27225dec5a0e <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / Makefile <nl> <nl> + BUILDDIR = / Users / Shared / xbmc - depends / osx - 10 . 4_i386 <nl> + <nl> + SUBDIRS = \ <nl> + help2man autoconf automake pkg - config yasm cmake \ <nl> + pcre expat gettext readline sqlite3 \ <nl> + liblzo liblzo2 freetype2 fontconfig \ <nl> + openssl libssh2 curl \ <nl> + jpeg tiff libpng libogg \ <nl> + libvorbis libmad fribidi libwavpack libmpeg2 \ <nl> + faad2 libcdio libsamplerate librtmp \ <nl> + libGLEW libsdl libsdl_mixer libsdl_image \ <nl> + samba python26 mysqlclient boost \ <nl> + <nl> + . PHONY : setup $ ( SUBDIRS ) <nl> + <nl> + all : setup $ ( SUBDIRS ) <nl> + <nl> + setup : <nl> + mkdir - p $ ( BUILDDIR ) / bin <nl> + mkdir - p $ ( BUILDDIR ) / lib <nl> + mkdir - p $ ( BUILDDIR ) / slib <nl> + mkdir - p $ ( BUILDDIR ) / share <nl> + mkdir - p $ ( BUILDDIR ) / include <nl> + <nl> + $ ( SUBDIRS ) : <nl> + $ ( MAKE ) - C $ @ <nl> + <nl> + clean : <nl> + for d in $ ( SUBDIRS ) ; do $ ( MAKE ) - C $ $ d clean ; done <nl> + <nl> + distclean : : <nl> + for d in $ ( SUBDIRS ) ; do $ ( MAKE ) - C $ $ d distclean ; done <nl> + rm - rf $ ( BUILDDIR ) <nl> new file mode 100644 <nl> index 000000000000 . . 7bcace2812fe <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / afpfs - ng / 01 - gcrypt . patch <nl> <nl> + diff - ru afpfs - ng - 0 . 8 . 1 / configure . ac afpfs - ng - 0 . 8 . 1 + iPhone / configure . ac <nl> + mmm afpfs - ng - 0 . 8 . 1 / configure . ac 2008 - 03 - 08 16 : 23 : 12 . 000000000 + 0000 <nl> ppp + afpfs - ng - 0 . 8 . 1 + iPhone / configure . ac 2010 - 10 - 24 05 : 26 : 15 . 000000000 + 0000 <nl> + <nl> + case $ host in <nl> + * - * - darwin * ) <nl> + AC_MSG_CHECKING ( [ for correct gcrypt version ] ) <nl> + - AC_RUN_IFELSE ( <nl> + - [ AC_LANG_PROGRAM ( [ <nl> + - # include < gcrypt . h > <nl> + - # include < stdio . h > ] , [ <nl> + - char * p = GCRYPT_VERSION ; <nl> + - unsigned int vers ; <nl> + - vers = atoi ( p ) * 10000 ; <nl> + - p = strchr ( p , ' . ' ) + 1 ; <nl> + - vers + = atoi ( p ) * 100 ; <nl> + - p = strchr ( p , ' . ' ) + 1 ; <nl> + - vers + = atoi ( p ) ; <nl> + - if ( vers < 10400 ) return 1 ; <nl> + - ] ) ] , <nl> + - [ AC_MSG_RESULT ( [ yes ] ) ] , <nl> + - [ AC_MSG_ERROR ( [ version is < 1 . 4 . 0 ] ) ] ) <nl> + AM_CONDITIONAL ( HAVE_LIBGCRYPT , true ) <nl> + AC_DEFINE ( [ HAVE_LIBGCRYPT ] , [ 1 ] ) <nl> + ; ; <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 931658178854 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / afpfs - ng / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = afpfs - ng <nl> + VERSION = 0 . 8 . 1 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / downloads . sourceforge . net / sourceforge / afpfs - ng / <nl> + ARCHIVE = $ ( SOURCE ) . tar . bz2 <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes \ <nl> + - - disable - fuse ac_cv_func_malloc_0_nonnull = yes <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / lib / . libs / libafpclient . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; patch - p1 < . . / 01 - gcrypt . patch <nl> + cd $ ( SOURCE ) ; autoreconf - vif <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 24a0387fe35a <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / autoconf / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + # lib name , version <nl> + LIBNAME = autoconf <nl> + VERSION = 2 . 63 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + PREFIX : = / Users / Shared / xbmc - depends / osx - 10 . 4_i386 <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / bin / autoconf <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + sed - i bak - e " s / ' libtoolize ' / ' glibtoolize ' / " $ ( SOURCE ) / bin / autoreconf . in <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 7abc82ec971c <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / automake / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + # lib name , version <nl> + LIBNAME = automake <nl> + VERSION = 1 . 10 . 3 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + PREFIX : = / Users / Shared / xbmc - depends / osx - 10 . 4_i386 <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / bin / automake <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 23dde97261f5 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / boost / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + LIBNAME = boost <nl> + VERSION = 1_44_0 <nl> + SOURCE = $ ( LIBNAME ) _ $ ( VERSION ) <nl> + # download location and format <nl> + # git clone git : / / gitorious . org / boostoniphone / boostoniphone . git <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE = $ ( SOURCE ) . tar . bz2 <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / prefix / lib / libboost_system . a <nl> + <nl> + all : $ ( LIBDYLIB ) . compiled . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( LIBDYLIB ) : $ ( ARCHIVE ) <nl> + <nl> + . compiled : <nl> + rm - rf src build prefix framework <nl> + echo src > > . gitignore <nl> + echo build > > . gitignore <nl> + echo prefix > > . gitignore <nl> + echo framework > > . gitignore <nl> + sh . / boost . sh <nl> + touch $ @ <nl> + <nl> + . installed : <nl> + cp - rf prefix / * $ ( PREFIX ) <nl> + touch $ @ <nl> + <nl> + clean : <nl> + distclean : : <nl> + rm - rf src build prefix framework . compiled . installed <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . e25b1d18da74 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / boost / boost . sh <nl> <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + # Filename : boost . sh <nl> + # Author : Pete Goodliffe <nl> + # Copyright : ( c ) Copyright 2009 Pete Goodliffe <nl> + # Licence : Please feel free to use this , with attribution <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + # <nl> + # Builds a Boost framework for the iPhone . <nl> + # Creates a set of universal libraries that can be used on an iPhone and in the <nl> + # iPhone simulator . Then creates a pseudo - framework to make using boost in Xcode <nl> + # less painful . <nl> + # <nl> + # To configure the script , define : <nl> + # BOOST_LIBS : which libraries to build <nl> + # BOOST_VERSION : version number of the boost library ( e . g . 1_41_0 ) <nl> + # IPHONE_SDKVERSION : iPhone SDK version ( e . g . 3 . 0 ) <nl> + # <nl> + # Then go get the source tar . bz of the boost you want to build , shove it in the <nl> + # same directory as this script , and run " . / boost . sh " . Grab a cuppa . And voila . <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + : $ { BOOST_VERSION : = 1_44_0 } <nl> + # : $ { BOOST_LIBS : = " thread signals filesystem regex program_options system " } <nl> + : $ { BOOST_LIBS : = " thread " } <nl> + : $ { IPHONE_SDKVERSION : = 4 . 2 } <nl> + : $ { EXTRA_CPPFLAGS : = " - DBOOST_AC_USE_PTHREADS - DBOOST_SP_USE_PTHREADS " } <nl> + <nl> + # The EXTRA_CPPFLAGS definition works around a thread race issue in <nl> + # shared_ptr . I encountered this historically and have not verified that <nl> + # the fix is no longer required . Without using the posix thread primitives <nl> + # an invalid compare - and - swap ARM instruction ( non - thread - safe ) was used for the <nl> + # shared_ptr use count causing nasty and subtle bugs . <nl> + # <nl> + # Should perhaps also consider / use instead : - BOOST_SP_USE_PTHREADS <nl> + <nl> + : $ { TARBALLDIR : = ` pwd ` } <nl> + : $ { SRCDIR : = ` pwd ` / src } <nl> + : $ { BUILDDIR : = ` pwd ` / build } <nl> + : $ { PREFIXDIR : = ` pwd ` / prefix } <nl> + : $ { FRAMEWORKDIR : = ` pwd ` / framework } <nl> + <nl> + BOOST_TARBALL = $ TARBALLDIR / boost_ $ BOOST_VERSION . tar . bz2 <nl> + BOOST_SRC = $ SRCDIR / boost_ $ { BOOST_VERSION } <nl> + <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + ARM_DEV_DIR = / Developer / Platforms / iPhoneOS . platform / Developer / usr / bin / <nl> + SIM_DEV_DIR = / Developer / Platforms / iPhoneSimulator . platform / Developer / usr / bin / <nl> + <nl> + ARM_COMBINED_LIB = $ BUILDDIR / lib_boost_arm . a <nl> + SIM_COMBINED_LIB = $ BUILDDIR / lib_boost_x86 . a <nl> + <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + echo " BOOST_VERSION : $ BOOST_VERSION " <nl> + echo " BOOST_LIBS : $ BOOST_LIBS " <nl> + echo " BOOST_TARBALL : $ BOOST_TARBALL " <nl> + echo " BOOST_SRC : $ BOOST_SRC " <nl> + echo " BUILDDIR : $ BUILDDIR " <nl> + echo " PREFIXDIR : $ PREFIXDIR " <nl> + echo " FRAMEWORKDIR : $ FRAMEWORKDIR " <nl> + echo " IPHONE_SDKVERSION : $ IPHONE_SDKVERSION " <nl> + echo <nl> + <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + # Functions <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + abort ( ) <nl> + { <nl> + echo <nl> + echo " Aborted : $ @ " <nl> + exit 1 <nl> + } <nl> + <nl> + doneSection ( ) <nl> + { <nl> + echo <nl> + echo " = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = " <nl> + echo " Done " <nl> + echo <nl> + } <nl> + <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + cleanEverythingReadyToStart ( ) <nl> + { <nl> + echo Cleaning everything before we start to build . . . <nl> + rm - rf $ BOOST_SRC <nl> + rm - rf $ BUILDDIR <nl> + rm - rf $ PREFIXDIR <nl> + rm - rf $ FRAMEWORKDIR <nl> + doneSection <nl> + } <nl> + <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + unpackBoost ( ) <nl> + { <nl> + echo Unpacking boost into $ SRCDIR . . . <nl> + [ - d $ SRCDIR ] | | mkdir - p $ SRCDIR <nl> + [ - d $ BOOST_SRC ] | | ( cd $ SRCDIR ; tar xfj $ BOOST_TARBALL ) <nl> + [ - d $ BOOST_SRC ] & & echo " . . . unpacked as $ BOOST_SRC " <nl> + doneSection <nl> + } <nl> + <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + writeBjamUserConfig ( ) <nl> + { <nl> + # You need to do this to point bjam at the right compiler <nl> + # ONLY SEEMS TO WORK IN HOME DIR GRR <nl> + echo Writing usr - config <nl> + # mkdir - p $ BUILDDIR <nl> + # cat > ~ / user - config . jam < < EOF <nl> + cat > > $ BOOST_SRC / tools / build / v2 / user - config . jam < < EOF <nl> + using darwin : 4 . 2 . 1 ~ iphone <nl> + : / Developer / Platforms / iPhoneOS . platform / Developer / usr / bin / gcc - 4 . 2 - arch armv7 - mthumb - fvisibility = hidden - fvisibility - inlines - hidden $ EXTRA_CPPFLAGS <nl> + : < striper > <nl> + : < architecture > arm < target - os > iphone <nl> + ; <nl> + using darwin : 4 . 2 . 1 ~ iphonesim <nl> + : / Developer / Platforms / iPhoneSimulator . platform / Developer / usr / bin / gcc - 4 . 2 - arch i386 - fvisibility = hidden - fvisibility - inlines - hidden $ EXTRA_CPPFLAGS <nl> + : < striper > <nl> + : < architecture > x86 < target - os > iphone <nl> + ; <nl> + EOF <nl> + doneSection <nl> + } <nl> + <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + inventMissingHeaders ( ) <nl> + { <nl> + # These files are missing in the ARM iPhoneOS SDK , but they are in the simulator . <nl> + # They are supported on the device , so we copy them from x86 SDK to a staging area <nl> + # to use them on ARM , too . <nl> + echo Invent missing headers <nl> + cp / Developer / Platforms / iPhoneSimulator . platform / Developer / SDKs / iPhoneSimulator $ { IPHONE_SDKVERSION } . sdk / usr / include / { crt_externs , bzlib } . h $ BOOST_SRC <nl> + } <nl> + <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + bootstrapBoost ( ) <nl> + { <nl> + cd $ BOOST_SRC <nl> + BOOST_LIBS_COMMA = $ ( echo $ BOOST_LIBS | sed - e " s / / , / g " ) <nl> + echo " Bootstrapping ( with libs $ BOOST_LIBS_COMMA ) " <nl> + . / bootstrap . sh - - with - libraries = $ BOOST_LIBS_COMMA <nl> + doneSection <nl> + } <nl> + <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + buildBoostForiPhoneOS_1_44_0 ( ) <nl> + { <nl> + cd $ BOOST_SRC <nl> + <nl> + . / bjam - - prefix = " $ PREFIXDIR " toolset = darwin architecture = arm target - os = iphone macosx - version = iphone - $ { IPHONE_SDKVERSION } define = _LITTLE_ENDIAN link = static install <nl> + doneSection <nl> + <nl> + # . / bjam toolset = darwin architecture = x86 target - os = iphone macosx - version = iphonesim - $ { IPHONE_SDKVERSION } link = static stage <nl> + # doneSection <nl> + } <nl> + <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # $ 1 : Name of a boost library to lipoficate ( technical term ) <nl> + lipoficate ( ) <nl> + { <nl> + : $ { 1 : ? } <nl> + NAME = $ 1 <nl> + echo liboficate : $ 1 <nl> + ARMV6 = $ BOOST_SRC / bin . v2 / libs / $ NAME / build / darwin - 4 . 2 . 1 ~ iphone / release / architecture - arm / link - static / macosx - version - iphone - $ IPHONE_SDKVERSION / target - os - iphone / threading - multi / libboost_ $ NAME . a <nl> + # I386 = $ BOOST_SRC / bin . v2 / libs / $ NAME / build / darwin - 4 . 2 . 1 ~ iphonesim / release / architecture - x86 / link - static / macosx - version - iphonesim - $ IPHONE_SDKVERSION / target - os - iphone / threading - multi / libboost_ $ NAME . a <nl> + <nl> + mkdir - p $ PREFIXDIR / lib <nl> + lipo \ <nl> + - create \ <nl> + " $ ARMV6 " \ <nl> + - o " $ PREFIXDIR / lib / libboost_ $ NAME . a " \ <nl> + | | abort " Lipo $ 1 failed " <nl> + } <nl> + <nl> + # This creates universal versions of each individual boost library <nl> + lipoAllBoostLibraries ( ) <nl> + { <nl> + for i in $ BOOST_LIBS ; do lipoficate $ i ; done ; <nl> + <nl> + doneSection <nl> + } <nl> + <nl> + scrunchAllLibsTogetherInOneLibPerPlatform ( ) <nl> + { <nl> + ALL_LIBS_ARM = " " <nl> + ALL_LIBS_SIM = " " <nl> + for NAME in $ BOOST_LIBS ; do <nl> + ALL_LIBS_ARM = " $ ALL_LIBS_ARM $ BOOST_SRC / bin . v2 / libs / $ NAME / build / darwin - 4 . 2 . 1 ~ iphone / release / architecture - arm / link - static / macosx - version - iphone - $ IPHONE_SDKVERSION / target - os - iphone / threading - multi / libboost_ $ NAME . a " ; <nl> + # ALL_LIBS_SIM = " $ ALL_LIBS_SIM $ BOOST_SRC / bin . v2 / libs / $ NAME / build / darwin - 4 . 2 . 1 ~ iphonesim / release / architecture - x86 / link - static / macosx - version - iphonesim - $ IPHONE_SDKVERSION / target - os - iphone / threading - multi / libboost_ $ NAME . a " ; <nl> + done ; <nl> + <nl> + mkdir - p $ BUILDDIR / armv6 / obj <nl> + mkdir - p $ BUILDDIR / armv7 / obj <nl> + # mkdir - p $ BUILDDIR / i386 / obj <nl> + <nl> + ALL_LIBS = " " <nl> + <nl> + echo Splitting all existing fat binaries . . . <nl> + for NAME in $ BOOST_LIBS ; do <nl> + ALL_LIBS = " $ ALL_LIBS libboost_ $ NAME . a " <nl> + lipo " $ BOOST_SRC / bin . v2 / libs / $ NAME / build / darwin - 4 . 2 . 1 ~ iphone / release / architecture - arm / link - static / macosx - version - iphone - $ IPHONE_SDKVERSION / target - os - iphone / threading - multi / libboost_ $ NAME . a " - thin armv6 - o $ BUILDDIR / armv6 / libboost_ $ NAME . a <nl> + lipo " $ BOOST_SRC / bin . v2 / libs / $ NAME / build / darwin - 4 . 2 . 1 ~ iphone / release / architecture - arm / link - static / macosx - version - iphone - $ IPHONE_SDKVERSION / target - os - iphone / threading - multi / libboost_ $ NAME . a " - thin armv7 - o $ BUILDDIR / armv7 / libboost_ $ NAME . a <nl> + # cp " $ BOOST_SRC / bin . v2 / libs / $ NAME / build / darwin - 4 . 2 . 1 ~ iphonesim / release / architecture - x86 / link - static / macosx - version - iphonesim - $ IPHONE_SDKVERSION / target - os - iphone / threading - multi / libboost_ $ NAME . a " $ BUILDDIR / i386 / <nl> + done <nl> + <nl> + echo " Decomposing each architecture ' s . a files " <nl> + for NAME in $ ALL_LIBS ; do <nl> + echo Decomposing $ NAME . . . <nl> + ( cd $ BUILDDIR / armv6 / obj ; ar - x . . / $ NAME ) ; <nl> + ( cd $ BUILDDIR / armv7 / obj ; ar - x . . / $ NAME ) ; <nl> + # ( cd $ BUILDDIR / i386 / obj ; ar - x . . / $ NAME ) ; <nl> + done <nl> + <nl> + echo " Linking each architecture into an uberlib ( $ ALL_LIBS = > libboost . a ) " <nl> + rm $ BUILDDIR / * / libboost . a <nl> + echo . . . armv6 <nl> + ( cd $ BUILDDIR / armv6 ; $ ARM_DEV_DIR / ar crus libboost . a obj / * . o ; ) <nl> + echo . . . armv7 <nl> + ( cd $ BUILDDIR / armv7 ; $ ARM_DEV_DIR / ar crus libboost . a obj / * . o ; ) <nl> + # echo . . . i386 <nl> + # ( cd $ BUILDDIR / i386 ; $ SIM_DEV_DIR / ar crus libboost . a obj / * . o ; ) <nl> + } <nl> + <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + VERSION_TYPE = Alpha <nl> + FRAMEWORK_NAME = boost <nl> + FRAMEWORK_VERSION = A <nl> + <nl> + FRAMEWORK_CURRENT_VERSION = $ BOOST_VERSION <nl> + FRAMEWORK_COMPATIBILITY_VERSION = $ BOOST_VERSION <nl> + <nl> + buildFramework ( ) <nl> + { <nl> + FRAMEWORK_BUNDLE = $ FRAMEWORKDIR / $ FRAMEWORK_NAME . framework <nl> + <nl> + rm - rf $ FRAMEWORK_BUNDLE <nl> + <nl> + echo " Framework : Setting up directories . . . " <nl> + mkdir - p $ FRAMEWORK_BUNDLE <nl> + mkdir - p $ FRAMEWORK_BUNDLE / Versions <nl> + mkdir - p $ FRAMEWORK_BUNDLE / Versions / $ FRAMEWORK_VERSION <nl> + mkdir - p $ FRAMEWORK_BUNDLE / Versions / $ FRAMEWORK_VERSION / Resources <nl> + mkdir - p $ FRAMEWORK_BUNDLE / Versions / $ FRAMEWORK_VERSION / Headers <nl> + mkdir - p $ FRAMEWORK_BUNDLE / Versions / $ FRAMEWORK_VERSION / Documentation <nl> + <nl> + echo " Framework : Creating symlinks . . . " <nl> + ln - s $ FRAMEWORK_VERSION $ FRAMEWORK_BUNDLE / Versions / Current <nl> + ln - s Versions / Current / Headers $ FRAMEWORK_BUNDLE / Headers <nl> + ln - s Versions / Current / Resources $ FRAMEWORK_BUNDLE / Resources <nl> + ln - s Versions / Current / Documentation $ FRAMEWORK_BUNDLE / Documentation <nl> + ln - s Versions / Current / $ FRAMEWORK_NAME $ FRAMEWORK_BUNDLE / $ FRAMEWORK_NAME <nl> + <nl> + FRAMEWORK_INSTALL_NAME = $ FRAMEWORK_BUNDLE / Versions / $ FRAMEWORK_VERSION / $ FRAMEWORK_NAME <nl> + <nl> + echo " Lipoing library into $ FRAMEWORK_INSTALL_NAME . . . " <nl> + lipo \ <nl> + - create \ <nl> + - arch armv6 " $ BUILDDIR / armv6 / libboost . a " \ <nl> + - arch armv7 " $ BUILDDIR / armv7 / libboost . a " \ <nl> + - o " $ FRAMEWORK_INSTALL_NAME " \ <nl> + | | abort " Lipo $ 1 failed " <nl> + <nl> + echo " Framework : Copying includes . . . " <nl> + cp - r $ PREFIXDIR / include / boost / * $ FRAMEWORK_BUNDLE / Headers / <nl> + <nl> + echo " Framework : Creating plist . . . " <nl> + cat > $ FRAMEWORK_BUNDLE / Resources / Info . plist < < EOF <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < ! DOCTYPE plist PUBLIC " - / / Apple / / DTD PLIST 1 . 0 / / EN " " http : / / www . apple . com / DTDs / PropertyList - 1 . 0 . dtd " > <nl> + < plist version = " 1 . 0 " > <nl> + < dict > <nl> + < key > CFBundleDevelopmentRegion < / key > <nl> + < string > English < / string > <nl> + < key > CFBundleExecutable < / key > <nl> + < string > $ { FRAMEWORK_NAME } < / string > <nl> + < key > CFBundleIdentifier < / key > <nl> + < string > org . boost < / string > <nl> + < key > CFBundleInfoDictionaryVersion < / key > <nl> + < string > 6 . 0 < / string > <nl> + < key > CFBundlePackageType < / key > <nl> + < string > FMWK < / string > <nl> + < key > CFBundleSignature < / key > <nl> + < string > ? ? ? ? < / string > <nl> + < key > CFBundleVersion < / key > <nl> + < string > $ { FRAMEWORK_CURRENT_VERSION } < / string > <nl> + < / dict > <nl> + < / plist > <nl> + EOF <nl> + doneSection <nl> + } <nl> + <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + # Execution starts here <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + [ - f " $ BOOST_TARBALL " ] | | abort " Source tarball missing . " <nl> + <nl> + mkdir - p $ BUILDDIR <nl> + <nl> + case $ BOOST_VERSION in <nl> + 1_44_0 ) <nl> + cleanEverythingReadyToStart <nl> + unpackBoost <nl> + inventMissingHeaders <nl> + writeBjamUserConfig <nl> + bootstrapBoost <nl> + buildBoostForiPhoneOS_1_44_0 <nl> + scrunchAllLibsTogetherInOneLibPerPlatform <nl> + lipoAllBoostLibraries <nl> + buildFramework <nl> + ; ; <nl> + default ) <nl> + echo " This version ( $ BOOST_VERSION ) is not supported " <nl> + ; ; <nl> + esac <nl> + <nl> + echo " Completed successfully " <nl> + <nl> + # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . ec4eb82e3e6e <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / cmake / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + # lib name , version <nl> + APPNAME = cmake <nl> + VERSION = 2 . 8 . 4 <nl> + SOURCE = $ ( APPNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + # BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + BASE_URL = http : / / www . cmake . org / files / v2 . 8 <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + PREFIX : = / Users / Shared / xbmc - depends / osx - 10 . 4_i386 <nl> + CONFIGURE = . / bootstrap - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) <nl> + <nl> + APP = $ ( SOURCE ) / $ ( APPNAME ) <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( APP ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( APP ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + # make - C $ ( SOURCE ) install <nl> + # touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100755 <nl> index 000000000000 . . 251d39ecb577 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / config . mk <nl> <nl> + # Find where this Makefile is located <nl> + TOP : = $ ( dir $ ( lastword $ ( MAKEFILE_LIST ) ) ) <nl> + <nl> + platform_os = MacOSX <nl> + platform_sdk_version = 10 . 4u <nl> + platform_min_version = macosx - version - min = 10 . 4 <nl> + platform_gcc_version = 4 . 0 . 1 <nl> + platform_host = i386 - apple - darwin8 <nl> + platform_path = / Developer <nl> + platform_os_cflags = - arch i386 <nl> + platform_os_ldflags = - arch i386 <nl> + prefix_path = / Users / Shared / xbmc - depends / osx - 10 . 4_i386 <nl> + platform_sdk_path = $ { platform_path } / SDKs / $ { platform_os } $ { platform_sdk_version } . sdk <nl> + platform_bin_path = $ { platform_path } / usr / bin <nl> + <nl> + export platform_sdk_version <nl> + export NM = / usr / bin / nm <nl> + export CPP = / usr / bin / cpp - 4 . 0 <nl> + export CXXCPP = $ { CPP } <nl> + export CPPFLAGS = - no - cpp - precomp - I $ { prefix_path } / include <nl> + export CC = / usr / bin / gcc - 4 . 0 <nl> + export CFLAGS = - std = gnu89 - no - cpp - precomp - m $ { platform_min_version } - isysroot $ { platform_sdk_path } $ { platform_os_cflags } - I $ { platform_sdk_path } / usr / include <nl> + export LD = $ { platform_bin_path } / ld <nl> + export LDFLAGS = - m $ { platform_min_version } - isysroot $ { platform_sdk_path } $ { platform_os_ldflags } - L $ { prefix_path } / lib - L $ { platform_sdk_path } / usr / lib <nl> + export CXX = / usr / bin / g + + - 4 . 0 <nl> + export CXXFLAGS = - m $ { platform_min_version } - isysroot $ { platform_sdk_path } $ { platform_os_cflags } <nl> + export AR = $ { platform_bin_path } / ar <nl> + export AS = $ { platform_bin_path } / as <nl> + export STRIP = $ { platform_bin_path } / strip <nl> + export RANLIB = $ { platform_bin_path } / ranlib <nl> + export ACLOCAL = aclocal - I / Developer / usr / share / aclocal - I $ { prefix_path } / share / aclocal <nl> + export LIBTOOL = / Developer / usr / bin / glibtool <nl> + export LIBTOOLIZE = / Developer / usr / bin / glibtoolize <nl> + export HOST = $ { platform_host } <nl> + export PREFIX = $ { prefix_path } <nl> + export DEVROOT = $ { platform_path } <nl> + export SDKROOT = $ { platform_sdk_path } <nl> + export PKG_CONFIG_PATH = $ { prefix_path } : $ { platform_sdk_path } / usr / lib / pkgconfig <nl> + export PATH : = $ { prefix_path } / bin : $ { platform_bin_path } : / Developer / usr / bin : $ ( PATH ) <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 6c1c4e20e7d8 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / curl / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = curl <nl> + VERSION = 7 . 19 . 4 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . bz2 <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes ac_cv_file___dev_urandom_ = yes <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 2b99b91e549c <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / dpkg / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + # lib name , version <nl> + APPNAME = dpkg <nl> + VERSION = 1 . 14 . 30 <nl> + SOURCE = $ ( APPNAME ) _ $ ( VERSION ) <nl> + SOURCE_DEBIAN = $ ( APPNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + export LIBTOOL = builds / unix / libtool <nl> + PREFIX : = / Users / Shared / xbmc - depends / osx - 10 . 4_i386 <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - enable - static - - disable - shared <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE_DEBIAN ) <nl> + <nl> + all : $ ( APPNAME ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE_DEBIAN ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE_DEBIAN ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE_DEBIAN ) > > . gitignore <nl> + cd $ ( SOURCE_DEBIAN ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( APPNAME ) : $ ( SOURCE_DEBIAN ) <nl> + make - C $ ( SOURCE_DEBIAN ) / lib CFLAGS = " " LDFLAGS = " " <nl> + make - C $ ( SOURCE_DEBIAN ) / libcompat CFLAGS = " " LDFLAGS = " " <nl> + make - C $ ( SOURCE_DEBIAN ) / src CFLAGS = " " LDFLAGS = " " <nl> + make - C $ ( SOURCE_DEBIAN ) / dpkg - deb CFLAGS = " " LDFLAGS = " " <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE_DEBIAN ) / dpkg - deb install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE_DEBIAN ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE_DEBIAN ) . installed <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 135a808164ec <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / expat / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = expat <nl> + VERSION = 2 . 0 . 1 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 0e48adfffb97 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / faad2 / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = faad2 <nl> + VERSION = 2 . 7 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / libfaad / . libs / libfaad . 2 . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 334cbbaf81d1 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / fontconfig / 01 - fontconfig - cross - compile - fix . patch <nl> <nl> + diff - Naur fontconfig - 2 . 6 . 0 . orig / doc / Makefile . am fontconfig - 2 . 6 . 0 / doc / Makefile . am <nl> + mmm fontconfig - 2 . 6 . 0 . orig / doc / Makefile . am 2007 - 11 - 06 01 : 05 : 37 . 000000000 + 0100 <nl> ppp + fontconfig - 2 . 6 . 0 / doc / Makefile . am 2010 - 05 - 22 00 : 03 : 00 . 000000000 + 0200 <nl> + <nl> + # TORTIOUS ACTION , ARISING OUT OF OR IN CONNECTION WITH THE USE OR <nl> + # PERFORMANCE OF THIS SOFTWARE . <nl> + <nl> + - CC = @ CC_FOR_BUILD @ <nl> + EXEEXT = @ EXEEXT_FOR_BUILD @ <nl> + - LINK = $ ( CCLD ) $ ( AM_CFLAGS ) $ ( CFLAGS ) $ ( AM_LDFLAGS ) $ ( LDFLAGS ) - o $ @ <nl> + + COMPILE = $ ( CC_FOR_BUILD ) $ ( DEFS ) $ ( DEFAULT_INCLUDES ) $ ( INCLUDES ) $ ( AM_CPPFLAGS ) \ <nl> + + $ ( CPPFLAGS_FOR_BUILD ) $ ( AM_CFLAGS ) $ ( CFLAGS_FOR_BUILD ) <nl> + + LINK = $ ( CC_FOR_BUILD ) $ ( AM_CFLAGS ) $ ( CFLAGS_FOR_BUILD ) $ ( AM_LDFLAGS ) $ ( LDFLAGS_FOR_BUILD ) - o $ @ <nl> + <nl> + DOC_SRC = $ ( srcdir ) <nl> + DOC_MODULE = fontconfig <nl> + diff - Naur fontconfig - 2 . 6 . 0 . orig / fc - arch / Makefile . am fontconfig - 2 . 6 . 0 / fc - arch / Makefile . am <nl> + mmm fontconfig - 2 . 6 . 0 . orig / fc - arch / Makefile . am 2008 - 01 - 02 17 : 44 : 39 . 000000000 + 0100 <nl> ppp + fontconfig - 2 . 6 . 0 / fc - arch / Makefile . am 2010 - 05 - 21 23 : 59 : 18 . 000000000 + 0200 <nl> + <nl> + # PERFORMANCE OF THIS SOFTWARE . <nl> + # <nl> + <nl> + - CC = @ CC_FOR_BUILD @ <nl> + EXEEXT = @ EXEEXT_FOR_BUILD @ <nl> + - LINK = $ ( CCLD ) $ ( AM_CFLAGS ) $ ( CFLAGS ) $ ( AM_LDFLAGS ) $ ( LDFLAGS ) - o $ @ <nl> + + COMPILE = $ ( CC_FOR_BUILD ) $ ( DEFS ) $ ( DEFAULT_INCLUDES ) $ ( INCLUDES ) $ ( AM_CPPFLAGS ) \ <nl> + + $ ( CPPFLAGS_FOR_BUILD ) $ ( AM_CFLAGS ) $ ( CFLAGS_FOR_BUILD ) <nl> + + LINK = $ ( CC_FOR_BUILD ) $ ( AM_CFLAGS ) $ ( CFLAGS_FOR_BUILD ) $ ( AM_LDFLAGS ) $ ( LDFLAGS_FOR_BUILD ) - o $ @ <nl> + <nl> + INCLUDES = - I $ { top_srcdir } / src - I $ { top_srcdir } $ ( WARN_CFLAGS ) <nl> + <nl> + diff - Naur fontconfig - 2 . 6 . 0 . orig / fc - case / Makefile . am fontconfig - 2 . 6 . 0 / fc - case / Makefile . am <nl> + mmm fontconfig - 2 . 6 . 0 . orig / fc - case / Makefile . am 2010 - 05 - 21 23 : 55 : 02 . 000000000 + 0200 <nl> ppp + fontconfig - 2 . 6 . 0 / fc - case / Makefile . am 2010 - 05 - 22 00 : 04 : 09 . 000000000 + 0200 <nl> + <nl> + # PERFORMANCE OF THIS SOFTWARE . <nl> + # <nl> + <nl> + - CC = @ CC_FOR_BUILD @ <nl> + EXEEXT = @ EXEEXT_FOR_BUILD @ <nl> + - LINK = $ ( CCLD ) $ ( AM_CFLAGS ) $ ( CFLAGS ) $ ( AM_LDFLAGS ) $ ( LDFLAGS ) - o $ @ <nl> + + COMPILE = $ ( CC_FOR_BUILD ) $ ( DEFS ) $ ( DEFAULT_INCLUDES ) $ ( INCLUDES ) $ ( AM_CPPFLAGS ) \ <nl> + + $ ( CPPFLAGS_FOR_BUILD ) $ ( AM_CFLAGS ) $ ( CFLAGS_FOR_BUILD ) <nl> + + LINK = $ ( CC_FOR_BUILD ) $ ( AM_CFLAGS ) $ ( CFLAGS_FOR_BUILD ) $ ( AM_LDFLAGS ) $ ( LDFLAGS_FOR_BUILD ) - o $ @ <nl> + <nl> + INCLUDES = - I $ { top_srcdir } / src - I $ { top_srcdir } $ ( WARN_CFLAGS ) <nl> + <nl> + diff - Naur fontconfig - 2 . 6 . 0 . orig / fc - glyphname / Makefile . am fontconfig - 2 . 6 . 0 / fc - glyphname / Makefile . am <nl> + mmm fontconfig - 2 . 6 . 0 . orig / fc - glyphname / Makefile . am 2008 - 01 - 02 17 : 44 : 39 . 000000000 + 0100 <nl> ppp + fontconfig - 2 . 6 . 0 / fc - glyphname / Makefile . am 2010 - 05 - 22 00 : 04 : 54 . 000000000 + 0200 <nl> + <nl> + # PERFORMANCE OF THIS SOFTWARE . <nl> + # <nl> + <nl> + - CC = @ CC_FOR_BUILD @ <nl> + EXEEXT = @ EXEEXT_FOR_BUILD @ <nl> + - LINK = $ ( CCLD ) $ ( AM_CFLAGS ) $ ( CFLAGS ) $ ( AM_LDFLAGS ) $ ( LDFLAGS ) - o $ @ <nl> + + COMPILE = $ ( CC_FOR_BUILD ) $ ( DEFS ) $ ( DEFAULT_INCLUDES ) $ ( INCLUDES ) $ ( AM_CPPFLAGS ) \ <nl> + + $ ( CPPFLAGS_FOR_BUILD ) $ ( AM_CFLAGS ) $ ( CFLAGS_FOR_BUILD ) <nl> + + LINK = $ ( CC_FOR_BUILD ) $ ( AM_CFLAGS ) $ ( CFLAGS_FOR_BUILD ) $ ( AM_LDFLAGS ) $ ( LDFLAGS_FOR_BUILD ) - o $ @ <nl> + <nl> + INCLUDES = - I $ { top_srcdir } / src - I $ { top_srcdir } $ ( WARN_CFLAGS ) <nl> + <nl> + diff - Naur fontconfig - 2 . 6 . 0 . orig / fc - lang / Makefile . am fontconfig - 2 . 6 . 0 / fc - lang / Makefile . am <nl> + mmm fontconfig - 2 . 6 . 0 . orig / fc - lang / Makefile . am 2008 - 01 - 02 17 : 44 : 39 . 000000000 + 0100 <nl> ppp + fontconfig - 2 . 6 . 0 / fc - lang / Makefile . am 2010 - 05 - 22 00 : 05 : 44 . 000000000 + 0200 <nl> + <nl> + # PERFORMANCE OF THIS SOFTWARE . <nl> + # <nl> + <nl> + - CC = @ CC_FOR_BUILD @ <nl> + EXEEXT = @ EXEEXT_FOR_BUILD @ <nl> + - LINK = $ ( CCLD ) $ ( AM_CFLAGS ) $ ( CFLAGS ) $ ( AM_LDFLAGS ) $ ( LDFLAGS ) - o $ @ <nl> + + COMPILE = $ ( CC_FOR_BUILD ) $ ( DEFS ) $ ( DEFAULT_INCLUDES ) $ ( INCLUDES ) $ ( AM_CPPFLAGS ) \ <nl> + + $ ( CPPFLAGS_FOR_BUILD ) $ ( AM_CFLAGS ) $ ( CFLAGS_FOR_BUILD ) <nl> + + LINK = $ ( CC_FOR_BUILD ) $ ( AM_CFLAGS ) $ ( CFLAGS_FOR_BUILD ) $ ( AM_LDFLAGS ) $ ( LDFLAGS_FOR_BUILD ) - o $ @ <nl> + <nl> + INCLUDES = - I $ { top_srcdir } / src - I $ { top_srcdir } $ ( WARN_CFLAGS ) <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 3c79e1886514 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / fontconfig / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = fontconfig <nl> + VERSION = 2 . 6 . 0 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress - Wl , - undefined , dynamic_lookup <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes - - with - arch = arm - - disable - libxml2 - - disable - docs - - with - freetype - config = $ ( PREFIX ) / bin / freetype - config <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / lib $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; patch - p1 < . . / 01 - fontconfig - cross - compile - fix . patch <nl> + cd $ ( SOURCE ) ; autoreconf - vif ; automake <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 2020e9c91b71 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / freetype2 / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = freetype <nl> + VERSION = 2 . 3 . 9 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . bz2 <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + # force using internal libtool <nl> + export LIBTOOL = builds / unix / libtool <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes \ <nl> + - - without - old - mac - fonts - - without - fsspec - - without - fsref - - without - ats <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / objs / . libs / lib $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 71bc2a129839 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / fribidi / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = fribidi <nl> + VERSION = 0 . 19 . 1 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + # BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + BASE_URL = http : / / fribidi . org / download <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes - - disable - docs <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / lib $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . da129dea470d <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / gettext / 01 - gettext - tools - Makefile . in . patch <nl> <nl> + mmm gettext - tools / Makefile . in . orig 2010 - 06 - 03 16 : 38 : 55 . 000000000 - 0500 <nl> ppp + gettext - tools / Makefile . in 2010 - 06 - 04 01 : 16 : 07 . 000000000 - 0500 <nl> + <nl> + top_srcdir = @ top_srcdir @ <nl> + AUTOMAKE_OPTIONS = 1 . 5 gnu no - dependencies <nl> + ACLOCAL_AMFLAGS = - I m4 - I . . / gettext - runtime / m4 - I . . / autoconf - lib - link / m4 - I . . / m4 - I gnulib - m4 - I libgettextpo / gnulib - m4 <nl> + - SUBDIRS = doc intl gnulib - lib libgrep src libgettextpo po projects styles misc man m4 tests gnulib - tests examples <nl> + + SUBDIRS = doc intl gnulib - lib libgrep src libgettextpo po projects styles misc man m4 tests gnulib - tests <nl> + <nl> + # Allow users to use " gnulib - tool - - update " . <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . ecbee3c0ec34 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / gettext / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = gettext <nl> + VERSION = 0 . 17 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress - Wl , - undefined , dynamic_lookup <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared \ <nl> + - - disable - csharp - - disable - native - java - - disable - java - - without - emacs \ <nl> + - - disable - libasprintf - - disable - openmp \ <nl> + - - with - included - gettext \ <nl> + - - with - included - glib \ <nl> + - - with - included - libcroco \ <nl> + - - with - included - libxml \ <nl> + - - without - git - - without - cvs \ <nl> + ac_cv_func___fsetlocking = no ac_cv_func_posix_spawn = no <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / lib $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; patch - p0 < . . / 01 - gettext - tools - Makefile . in . patch <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . f00a124f513d <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / help2man / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = help2man <nl> + VERSION = 1 . 38 . 2 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + CONFIGURE_NATIVE = CFLAGS = " " CXXFLAGS = " " LDFLAGS = " " CPPFLAGS = " " \ <nl> + CPP = " / usr / bin / cpp " \ <nl> + CC = " gcc - 4 . 2 " \ <nl> + CXX = " g + + - 4 . 2 " \ <nl> + LD = " ld " \ <nl> + . / configure - - prefix = $ ( PREFIX ) <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / help2man <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE_NATIVE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 410b5039dbf4 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / jpeg / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = jpeg <nl> + VERSION = 8b <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( LIBNAME ) src . v $ ( VERSION ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / lib $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . c48dbd460ac0 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libGLEW / 01 - Makefile . patch <nl> <nl> + mmm Makefile . orig 2010 - 11 - 04 07 : 55 : 35 . 000000000 + 1100 <nl> ppp + Makefile 2010 - 11 - 16 18 : 00 : 37 . 000000000 + 1100 <nl> + <nl> + mkdir bin <nl> + <nl> + lib / $ ( LIB . STATIC ) : $ ( LIB . OBJS ) <nl> + - $ ( AR ) cr $ @ $ ^ <nl> + + $ ( AR ) crs $ @ $ ^ <nl> + <nl> + lib / $ ( LIB . SHARED ) : $ ( LIB . SOBJS ) <nl> + $ ( LD ) $ ( LDFLAGS . SO ) - o $ @ $ ^ $ ( LIB . LDFLAGS ) $ ( LIB . LIBS ) <nl> + <nl> + ifeq ( $ ( filter - out mingw % cygwin , $ ( SYSTEM ) ) , ) <nl> + $ ( INSTALL ) - m 0644 lib / $ ( LIB . DEVLNK ) $ ( LIBDIR ) / <nl> + else <nl> + - $ ( STRIP ) - x lib / $ ( LIB . STATIC ) <nl> + $ ( INSTALL ) - m 0644 lib / $ ( LIB . STATIC ) $ ( LIBDIR ) / <nl> + $ ( LN ) $ ( LIB . SHARED ) $ ( LIBDIR ) / $ ( LIB . DEVLNK ) <nl> + endif <nl> new file mode 100644 <nl> index 000000000000 . . d1b652a10bed <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libGLEW / 02 - Makefile . darwin . patch <nl> <nl> + mmm config / Makefile . darwin . orig 2010 - 11 - 04 07 : 55 : 35 . 000000000 + 1100 <nl> ppp + config / Makefile . darwin 2010 - 11 - 16 18 : 28 : 44 . 000000000 + 1100 <nl> + <nl> + NAME = $ ( GLEW_NAME ) <nl> + - CC = cc <nl> + - LD = cc <nl> + - CFLAGS . EXTRA = - no - cpp - precomp - dynamic - fno - common <nl> + + CC = $ ( CC . ARCH ) <nl> + + LD = $ ( CC . ARCH ) <nl> + + CFLAGS . EXTRA = - dynamic - fno - common $ ( CFLAGS . ARCH ) <nl> + ifneq ( undefined , $ ( origin GLEW_MX ) ) <nl> + CFLAGS . EXTRA + = - DGLEW_MX <nl> + endif <nl> + PICFLAG = - fPIC <nl> + LDFLAGS . SO = - dynamiclib - install_name $ ( GLEW_DEST ) / lib / $ ( LIB . SHARED ) <nl> + - LDFLAGS . EXTRA = <nl> + + LDFLAGS . EXTRA = $ ( LDFLAGS . ARCH ) <nl> + ifneq ( undefined , $ ( origin GLEW_APPLE_GLX ) ) <nl> + CFLAGS . EXTRA + = - I / usr / X11R6 / include - D ' GLEW_APPLE_GLX ' <nl> + LDFLAGS . GL = - L / usr / X11R6 / lib - lXmu - lXi - lGLU - lGL - lXext - lX11 <nl> new file mode 100644 <nl> index 000000000000 . . 6b2afadc0017 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libGLEW / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = glew <nl> + VERSION = 1 . 5 . 8 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + # BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + BASE_URL = http : / / voxel . dl . sourceforge . net / project / glew / glew / 1 . 5 . 8 <nl> + ARCHIVE = $ ( SOURCE ) . tgz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + # export CFLAGS + = - undefined dynamic_lookup <nl> + # export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + export GLEW_DEST = $ ( PREFIX ) <nl> + export CC . ARCH = / usr / bin / gcc - 4 . 0 <nl> + export CFLAGS . ARCH = $ ( CFLAGS ) <nl> + export LDFLAGS . ARCH = $ ( LDFLAGS ) <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; patch - p0 < . . / 01 - Makefile . patch <nl> + cd $ ( SOURCE ) ; patch - p0 < . . / 02 - Makefile . darwin . patch <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 6ecd4459e56a <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libcdio / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = libcdio <nl> + VERSION = 0 . 82 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress - Wl , - undefined , dynamic_lookup <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes \ <nl> + am_cv_func_iconv = yes am_cv_func_iconv_works = yes <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; autoconf <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + cp $ ( SOURCE ) / include / cdio / cdtext . h $ ( PREFIX ) / include / cdio / <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 31e094847ca2 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libgcrypt / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = libgcrypt <nl> + VERSION = 1 . 4 . 0 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = ftp : / / ftp . gnupg . org / gcrypt / libgcrypt <nl> + ARCHIVE = $ ( SOURCE ) . tar . bz2 <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup - fgnu89 - inline <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes \ <nl> + ac_cv_func_gethrtime = no <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / libgcrypt . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; autoreconf - vif <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . cdbd5d76dad1 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libgpg - error / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = libgpg - error <nl> + VERSION = 1 . 10 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = ftp : / / ftp . gnupg . org / gcrypt / libgpg - error <nl> + ARCHIVE = $ ( SOURCE ) . tar . bz2 <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / libgpg - error . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 5df71ee48ab9 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / liblzo / 01 - liblzo - only - build - lib . patch <nl> <nl> + diff - ruN lzo - 1 . 08 . org / Makefile . am lzo - 1 . 08 / Makefile . am <nl> + mmm lzo - 1 . 08 . org / Makefile . am 2002 - 07 - 12 21 : 31 : 52 . 000000000 - 0400 <nl> ppp + lzo - 1 . 08 / Makefile . am 2010 - 10 - 29 12 : 13 : 48 . 000000000 - 0400 <nl> + <nl> + <nl> + AUTOMAKE_OPTIONS = 1 . 6 gnu <nl> + <nl> + - SUBDIRS = include src ltest examples tests minilzo <nl> + + SUBDIRS = include src <nl> + <nl> + EXTRA_DIST = BUGS <nl> + <nl> + diff - ruN lzo - 1 . 08 . org / Makefile . in lzo - 1 . 08 / Makefile . in <nl> + mmm lzo - 1 . 08 . org / Makefile . in 2002 - 07 - 12 21 : 31 : 52 . 000000000 - 0400 <nl> ppp + lzo - 1 . 08 / Makefile . in 2010 - 10 - 29 12 : 17 : 18 . 000000000 - 0400 <nl> + <nl> + <nl> + AUTOMAKE_OPTIONS = 1 . 6 gnu <nl> + <nl> + - SUBDIRS = include src ltest examples tests minilzo <nl> + + SUBDIRS = include src <nl> + <nl> + EXTRA_DIST = BUGS <nl> + <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 98cfee1ad953 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / liblzo / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = lzo <nl> + VERSION = 1 . 08 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / src / . libs / lib $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; patch - p1 < . . / 01 - liblzo - only - build - lib . patch <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . f3d59609328e <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / liblzo2 / 01 - liblzo2 - only - build - lib . patch <nl> <nl> + diff - ruN lzo - 2 . 03 . org / Makefile . am lzo - 2 . 03 / Makefile . am <nl> + mmm lzo - 2 . 03 . org / Makefile . am 2008 - 04 - 30 08 : 51 : 49 . 000000000 - 0400 <nl> ppp + lzo - 2 . 03 / Makefile . am 2010 - 10 - 29 12 : 38 : 51 . 000000000 - 0400 <nl> + <nl> + <nl> + AUTOMAKE_OPTIONS = 1 . 9 . 6 gnu <nl> + <nl> + - SUBDIRS = include src lzotest examples tests minilzo <nl> + + SUBDIRS = include src <nl> + <nl> + EXTRA_DIST = BUGS <nl> + <nl> + diff - ruN lzo - 2 . 03 . org / Makefile . in lzo - 2 . 03 / Makefile . in <nl> + mmm lzo - 2 . 03 . org / Makefile . in 2008 - 04 - 30 08 : 51 : 49 . 000000000 - 0400 <nl> ppp + lzo - 2 . 03 / Makefile . in 2010 - 10 - 29 12 : 56 : 42 . 000000000 - 0400 <nl> + <nl> + target_os = @ target_os @ <nl> + target_vendor = @ target_vendor @ <nl> + AUTOMAKE_OPTIONS = 1 . 9 . 6 gnu <nl> + - SUBDIRS = include src lzotest examples tests minilzo <nl> + + SUBDIRS = include src <nl> + EXTRA_DIST = BUGS <nl> + all : config . h <nl> + $ ( MAKE ) $ ( AM_MAKEFLAGS ) all - recursive <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . c5dd91270764 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / liblzo2 / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = lzo <nl> + VERSION = 2 . 03 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / src / . libs / lib $ ( LIBNAME ) 2 . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; patch - p1 < . . / 01 - liblzo2 - only - build - lib . patch <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 0ac88acb8415 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libmad / 01 - libmad - pkgconfig . patch <nl> <nl> + diff - ruN libmad - 0 . 15 . 1b . orig / Makefile . am libmad - 0 . 15 . 1b / Makefile . am <nl> + mmm libmad - 0 . 15 . 1b . orig / Makefile . am 2004 - 02 - 17 02 : 02 : 03 . 000000000 + 0000 <nl> ppp + libmad - 0 . 15 . 1b / Makefile . am 2005 - 08 - 25 12 : 08 : 04 . 000000000 + 0000 <nl> + <nl> + minimad_INCLUDES = <nl> + minimad_LDADD = libmad . la <nl> + <nl> + - EXTRA_DIST = mad . h . sed \ <nl> + + EXTRA_DIST = mad . h . sed mad . pc . in \ <nl> + CHANGES COPYRIGHT CREDITS README TODO VERSION <nl> + <nl> + + pkgconfigdir = $ ( libdir ) / pkgconfig <nl> + + pkgconfig_DATA = mad . pc <nl> + + <nl> + exported_headers = version . h fixed . h bit . h timer . h stream . h frame . h \ <nl> + synth . h decoder . h <nl> + <nl> + diff - ruN libmad - 0 . 15 . 1b . orig / Makefile . in libmad - 0 . 15 . 1b / Makefile . in <nl> + mmm libmad - 0 . 15 . 1b . orig / Makefile . in 2004 - 02 - 17 02 : 33 : 23 . 000000000 + 0000 <nl> ppp + libmad - 0 . 15 . 1b / Makefile . in 2005 - 08 - 25 12 : 09 : 34 . 000000000 + 0000 <nl> + <nl> + <nl> + @ SET_MAKE @ <nl> + <nl> + + pkgconfigdir = $ ( libdir ) / pkgconfig <nl> + + pkgconfig_DATA = mad . pc <nl> + <nl> + SOURCES = $ ( libmad_la_SOURCES ) $ ( EXTRA_libmad_la_SOURCES ) $ ( minimad_SOURCES ) <nl> + <nl> + <nl> + $ ( srcdir ) / Makefile . am $ ( srcdir ) / Makefile . in \ <nl> + $ ( srcdir ) / config . h . in $ ( srcdir ) / libmad . list . in \ <nl> + $ ( top_srcdir ) / configure COPYING INSTALL TODO config . guess \ <nl> + - config . sub depcomp install - sh ltmain . sh missing mkinstalldirs <nl> + + config . sub depcomp install - sh ltmain . sh missing mkinstalldirs mad . pc . in <nl> + subdir = . <nl> + ACLOCAL_M4 = $ ( top_srcdir ) / aclocal . m4 <nl> + am__aclocal_m4_deps = $ ( top_srcdir ) / configure . ac <nl> + <nl> + configure . lineno configure . status . lineno <nl> + mkinstalldirs = $ ( SHELL ) $ ( top_srcdir ) / mkinstalldirs <nl> + CONFIG_HEADER = config . h <nl> + - CONFIG_CLEAN_FILES = libmad . list <nl> + + CONFIG_CLEAN_FILES = libmad . list mad . pc <nl> + am__installdirs = $ ( DESTDIR ) $ ( libdir ) $ ( DESTDIR ) $ ( includedir ) <nl> + libLTLIBRARIES_INSTALL = $ ( INSTALL ) <nl> + LTLIBRARIES = $ ( lib_LTLIBRARIES ) <nl> + <nl> + minimad_SOURCES = minimad . c <nl> + minimad_INCLUDES = <nl> + minimad_LDADD = libmad . la <nl> + - EXTRA_DIST = mad . h . sed \ <nl> + + EXTRA_DIST = mad . h . sed mad . pc . in \ <nl> + CHANGES COPYRIGHT CREDITS README TODO VERSION <nl> + <nl> + exported_headers = version . h fixed . h bit . h timer . h stream . h frame . h \ <nl> + <nl> + rm - f stamp - h1 <nl> + touch $ @ <nl> + <nl> + + mad . pc : $ ( top_builddir ) / config . status mad . pc . in <nl> + + cd $ ( top_builddir ) & & CONFIG_FILES = $ @ CONFIG_HEADERS = $ ( SHELL ) . / config . status <nl> + + <nl> + + install - pkgconfigDATA : $ ( pkgconfig_DATA ) <nl> + + @ $ ( NORMAL_INSTALL ) <nl> + + $ ( mkinstalldirs ) $ ( DESTDIR ) $ ( pkgconfigdir ) <nl> + + @ list = ' $ ( pkgconfig_DATA ) ' ; for p in $ $ list ; do \ <nl> + + if test - f $ ( srcdir ) / $ $ p ; then \ <nl> + + echo " $ ( INSTALL_DATA ) $ ( srcdir ) / $ $ p $ ( DESTDIR ) $ ( pkgconfigdir ) / $ $ p " ; \ <nl> + + $ ( INSTALL_DATA ) $ ( srcdir ) / $ $ p $ ( DESTDIR ) $ ( pkgconfigdir ) / $ $ p ; \ <nl> + + else if test - f $ $ p ; then \ <nl> + + echo " $ ( INSTALL_DATA ) $ $ p $ ( DESTDIR ) $ ( pkgconfigdir ) / $ $ p " ; \ <nl> + + $ ( INSTALL_DATA ) $ $ p $ ( DESTDIR ) $ ( pkgconfigdir ) / $ $ p ; \ <nl> + + fi ; fi ; \ <nl> + + done <nl> + + <nl> + + uninstall - pkgconfigDATA : <nl> + + @ $ ( NORMAL_UNINSTALL ) <nl> + + list = ' $ ( pkgconfig_DATA ) ' ; for p in $ $ list ; do \ <nl> + + rm - f $ ( DESTDIR ) $ ( pkgconfigdir ) / $ $ p ; \ <nl> + + done <nl> + + <nl> + distclean - hdr : <nl> + - rm - f config . h stamp - h1 <nl> + libmad . list : $ ( top_builddir ) / config . status $ ( srcdir ) / libmad . list . in <nl> + <nl> + <nl> + info - am : <nl> + <nl> + - install - data - am : install - includeHEADERS <nl> + + install - data - am : install - includeHEADERS install - pkgconfigDATA <nl> + <nl> + install - exec - am : install - libLTLIBRARIES <nl> + <nl> + <nl> + ps - am : <nl> + <nl> + uninstall - am : uninstall - includeHEADERS uninstall - info - am \ <nl> + - uninstall - libLTLIBRARIES <nl> + + uninstall - libLTLIBRARIES install - pkgconfigDATA <nl> + <nl> + uninstall - info : uninstall - info - recursive <nl> + <nl> + diff - ruN libmad - 0 . 15 . 1b . orig / mad . pc . in libmad - 0 . 15 . 1b / mad . pc . in <nl> + mmm libmad - 0 . 15 . 1b . orig / mad . pc . in 1970 - 01 - 01 00 : 00 : 00 . 000000000 + 0000 <nl> ppp + libmad - 0 . 15 . 1b / mad . pc . in 2005 - 08 - 25 12 : 08 : 04 . 000000000 + 0000 <nl> + <nl> + + prefix = @ prefix @ <nl> + + exec_prefix = @ exec_prefix @ <nl> + + libdir = @ libdir @ <nl> + + includedir = @ includedir @ <nl> + + <nl> + + Name : MAD <nl> + + Description : libmad - MPEG audio decoder library <nl> + + Version : @ VERSION @ <nl> + + Libs : - L $ { libdir } - lmad <nl> + + Cflags : <nl> new file mode 100644 <nl> index 000000000000 . . 1367a5c558a0 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libmad / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = libmad <nl> + VERSION = 0 . 15 . 1b <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes - - enable - fpm = default <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; patch - p1 < . . / 01 - libmad - pkgconfig . patch <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 532e53af4e58 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libmpeg2 / 01 - libmpeg2 - add - asm - leading - underscores . patch <nl> <nl> + diff - ruN libmpeg2 - 0 . 5 . 1 . org / libmpeg2 / motion_comp_arm_s . S libmpeg2 - 0 . 5 . 1 / libmpeg2 / motion_comp_arm_s . S <nl> + mmm libmpeg2 - 0 . 5 . 1 . org / libmpeg2 / motion_comp_arm_s . S 2008 - 07 - 09 15 : 16 : 05 . 000000000 - 0400 <nl> ppp + libmpeg2 - 0 . 5 . 1 / libmpeg2 / motion_comp_arm_s . S 2010 - 10 - 29 13 : 33 : 02 . 000000000 - 0400 <nl> + <nl> + <nl> + @ mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + . align <nl> + - . global MC_put_o_16_arm <nl> + - MC_put_o_16_arm : <nl> + + . global _MC_put_o_16_arm <nl> + + _MC_put_o_16_arm : <nl> + @ @ void func ( uint8_t * dest , const uint8_t * ref , int stride , int height ) <nl> + pld [ r1 ] <nl> + stmfd sp ! , { r4 - r11 , lr } @ R14 is also called LR <nl> + <nl> + <nl> + @ mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + . align <nl> + - . global MC_put_o_8_arm <nl> + - MC_put_o_8_arm : <nl> + + . global _MC_put_o_8_arm <nl> + + _MC_put_o_8_arm : <nl> + @ @ void func ( uint8_t * dest , const uint8_t * ref , int stride , int height ) <nl> + pld [ r1 ] <nl> + stmfd sp ! , { r4 - r10 , lr } @ R14 is also called LR <nl> + <nl> + . endm <nl> + <nl> + . align <nl> + - . global MC_put_x_16_arm <nl> + - MC_put_x_16_arm : <nl> + + . global _MC_put_x_16_arm <nl> + + _MC_put_x_16_arm : <nl> + @ @ void func ( uint8_t * dest , const uint8_t * ref , int stride , int height ) <nl> + pld [ r1 ] <nl> + stmfd sp ! , { r4 - r11 , lr } @ R14 is also called LR <nl> + <nl> + <nl> + @ mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + . align <nl> + - . global MC_put_x_8_arm <nl> + - MC_put_x_8_arm : <nl> + + . global _MC_put_x_8_arm <nl> + + _MC_put_x_8_arm : <nl> + @ @ void func ( uint8_t * dest , const uint8_t * ref , int stride , int height ) <nl> + pld [ r1 ] <nl> + stmfd sp ! , { r4 - r11 , lr } @ R14 is also called LR <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 329551b65e07 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libmpeg2 / 02 - neon . patch <nl> <nl> + Index : include / mpeg2 . h <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + mmm include / mpeg2 . h ( révision 1193 ) <nl> ppp + include / mpeg2 . h ( copie de travail ) <nl> + <nl> + # define MPEG2_ACCEL_SPARC_VIS 1 <nl> + # define MPEG2_ACCEL_SPARC_VIS2 2 <nl> + # define MPEG2_ACCEL_ARM 1 <nl> + + # define MPEG2_ACCEL_ARM_NEON 2 <nl> + # define MPEG2_ACCEL_DETECT 0x80000000 <nl> + <nl> + uint32_t mpeg2_accel ( uint32_t accel ) ; <nl> + Index : libmpeg2 / motion_comp_neon . c <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + mmm libmpeg2 / motion_comp_neon . c ( révision 0 ) <nl> ppp + libmpeg2 / motion_comp_neon . c ( révision 0 ) <nl> + <nl> + + / * <nl> + + * motion_comp_neon . c <nl> + + * Copyright ( C ) 2009 Rémi Denis - Courmont <nl> + + * <nl> + + * This file is part of mpeg2dec , a free MPEG - 2 video stream decoder . <nl> + + * See http : / / libmpeg2 . sourceforge . net / for updates . <nl> + + * <nl> + + * mpeg2dec is free software ; you can redistribute it and / or modify <nl> + + * it under the terms of the GNU General Public License as published by <nl> + + * the Free Software Foundation ; either version 2 of the License , or <nl> + + * ( at your option ) any later version . <nl> + + * <nl> + + * mpeg2dec is distributed in the hope that it will be useful , <nl> + + * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> + + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> + + * GNU General Public License for more details . <nl> + + * <nl> + + * You should have received a copy of the GNU General Public License along <nl> + + * with mpeg2dec ; if not , write to the Free Software Foundation , Inc . , <nl> + + * 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 USA . <nl> + + * / <nl> + + <nl> + + # include " config . h " <nl> + + <nl> + + # if defined ( ARCH_ARM ) <nl> + + <nl> + + # include < stdint . h > <nl> + + # include < string . h > <nl> + + <nl> + + # include " mpeg2 . h " <nl> + + # include " attributes . h " <nl> + + # include " mpeg2_internal . h " <nl> + + <nl> + + / * dest = ref * / <nl> + + static void MC_put_o_16_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + do { <nl> + + memcpy ( dest , ref , 16 ) ; <nl> + + ref + = stride ; <nl> + + dest + = stride ; <nl> + + } while ( - - height ) ; <nl> + + } <nl> + + <nl> + + static void MC_put_o_8_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + do { <nl> + + memcpy ( dest , ref , 8 ) ; <nl> + + ref + = stride ; <nl> + + dest + = stride ; <nl> + + } while ( - - height ) ; <nl> + + } <nl> + + <nl> + + / * dest = ( src1 + src2 + 1 ) / 2 * / <nl> + + static void MC_avg_1_16_neon ( uint8_t * dest , const uint8_t * src1 , <nl> + + const uint8_t * src2 , <nl> + + const int stride , unsigned height ) <nl> + + { <nl> + + do { <nl> + + asm volatile ( <nl> + + " vld1 . u8 { q0 } , [ % [ src1 ] ] \ n " <nl> + + " vld1 . u8 { q1 } , [ % [ src2 ] ] \ n " <nl> + + " vrhadd . u8 q0 , q0 , q1 \ n " <nl> + + / * XXX : three cycles stall * / <nl> + + " vst1 . u8 { q0 } , [ % [ dest ] ] \ n " <nl> + + : <nl> + + : [ dest ] " r " ( dest ) , [ src1 ] " r " ( src1 ) , [ src2 ] " r " ( src2 ) <nl> + + : " memory " , " q0 " , " q1 " ) ; <nl> + + src1 + = stride ; <nl> + + src2 + = stride ; <nl> + + dest + = stride ; <nl> + + } while ( - - height ) ; <nl> + + } <nl> + + <nl> + + static void MC_avg_1_8_neon ( uint8_t * dest , const uint8_t * src1 , <nl> + + const uint8_t * src2 , <nl> + + const int stride , unsigned height ) <nl> + + { <nl> + + do { <nl> + + asm volatile ( <nl> + + " vld1 . u8 { d0 } , [ % [ src1 ] ] \ n " <nl> + + " vld1 . u8 { d1 } , [ % [ src2 ] ] \ n " <nl> + + " vrhadd . u8 d0 , d0 , d1 \ n " <nl> + + " vst1 . u8 { d0 } , [ % [ dest ] ] \ n " <nl> + + : <nl> + + : [ dest ] " r " ( dest ) , [ src1 ] " r " ( src1 ) , [ src2 ] " r " ( src2 ) <nl> + + : " memory " , " q0 " ) ; <nl> + + <nl> + + src1 + = stride ; <nl> + + src2 + = stride ; <nl> + + dest + = stride ; <nl> + + } while ( - - height ) ; <nl> + + } <nl> + + <nl> + + / * dest = ( dest + ( ( src1 + src2 + 1 ) / 2 ) + 1 ) / 2 * / <nl> + + static void MC_avg_2_16_neon ( uint8_t * dest , const uint8_t * src1 , <nl> + + const uint8_t * src2 , <nl> + + const int stride , unsigned height ) <nl> + + { <nl> + + do { <nl> + + asm volatile ( <nl> + + " vld1 . u8 { q0 } , [ % [ src1 ] ] \ n " <nl> + + " vld1 . u8 { q1 } , [ % [ src2 ] ] \ n " <nl> + + " vrhadd . u8 q0 , q0 , q1 \ n " <nl> + + " vld1 . u8 { q2 } , [ % [ dest ] ] \ n " <nl> + + / * XXX : one cycle stall * / <nl> + + " vrhadd . u8 q0 , q0 , q2 \ n " <nl> + + / * XXX : three cycles stall * / <nl> + + " vst1 . u8 { q0 } , [ % [ dest ] ] \ n " <nl> + + : <nl> + + : [ dest ] " r " ( dest ) , [ src1 ] " r " ( src1 ) , [ src2 ] " r " ( src2 ) <nl> + + : " memory " , " q0 " , " q1 " , " q2 " ) ; <nl> + + src1 + = stride ; <nl> + + src2 + = stride ; <nl> + + dest + = stride ; <nl> + + } while ( - - height ) ; <nl> + + } <nl> + + <nl> + + static void MC_avg_2_8_neon ( uint8_t * dest , const uint8_t * src1 , <nl> + + const uint8_t * src2 , <nl> + + const int stride , unsigned height ) <nl> + + { <nl> + + do { <nl> + + asm volatile ( <nl> + + " vld1 . u8 { d0 } , [ % [ src1 ] ] \ n " <nl> + + " vld1 . u8 { d1 } , [ % [ src2 ] ] \ n " <nl> + + " vrhadd . u8 d0 , d0 , d1 \ n " <nl> + + " vld1 . u8 { d2 } , [ % [ dest ] ] \ n " <nl> + + " vrhadd . u8 d0 , d0 , d2 \ n " <nl> + + " vst1 . u8 { d0 } , [ % [ dest ] ] \ n " <nl> + + : <nl> + + : [ dest ] " r " ( dest ) , [ src1 ] " r " ( src1 ) , [ src2 ] " r " ( src2 ) <nl> + + : " memory " , " q0 " , " d2 " ) ; <nl> + + src1 + = stride ; <nl> + + src2 + = stride ; <nl> + + dest + = stride ; <nl> + + } while ( - - height ) ; <nl> + + } <nl> + + <nl> + + static void MC_avg_o_16_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + MC_avg_1_16_neon ( dest , dest , ref , stride , height ) ; <nl> + + } <nl> + + <nl> + + static void MC_avg_o_8_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + MC_avg_1_8_neon ( dest , dest , ref , stride , height ) ; <nl> + + } <nl> + + <nl> + + static void MC_put_x_16_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + MC_avg_1_16_neon ( dest , ref , ref + 1 , stride , height ) ; <nl> + + } <nl> + + <nl> + + static void MC_put_x_8_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + MC_avg_1_8_neon ( dest , ref , ref + 1 , stride , height ) ; <nl> + + } <nl> + + <nl> + + static void MC_avg_x_16_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + MC_avg_2_16_neon ( dest , ref , ref + 1 , stride , height ) ; <nl> + + } <nl> + + <nl> + + static void MC_avg_x_8_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + MC_avg_2_8_neon ( dest , ref , ref + 1 , stride , height ) ; <nl> + + } <nl> + + <nl> + + static void MC_put_y_16_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + MC_avg_1_16_neon ( dest , ref , ref + stride , stride , height ) ; <nl> + + } <nl> + + static void MC_put_y_8_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + MC_avg_1_8_neon ( dest , ref , ref + stride , stride , height ) ; <nl> + + } <nl> + + <nl> + + static void MC_avg_y_16_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + MC_avg_2_16_neon ( dest , ref , ref + stride , stride , height ) ; <nl> + + } <nl> + + <nl> + + static void MC_avg_y_8_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + MC_avg_2_8_neon ( dest , ref , ref + stride , stride , height ) ; <nl> + + } <nl> + + <nl> + + static void MC_put_xy_16_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + do { <nl> + + asm volatile ( <nl> + + " vld1 . u8 { q0 } , [ % [ ref ] ] \ n " <nl> + + " vld1 . u8 { q1 } , [ % [ refx ] ] \ n " <nl> + + " vrhadd . u8 q0 , q0 , q1 \ n " <nl> + + " vld1 . u8 { q2 } , [ % [ refy ] ] \ n " <nl> + + " vld1 . u8 { q3 } , [ % [ refxy ] ] \ n " <nl> + + " vrhadd . u8 q2 , q2 , q3 \ n " <nl> + + / * XXX : three cycles stall * / <nl> + + " vrhadd . u8 q0 , q0 , q2 \ n " <nl> + + / * XXX : three cycles stall * / <nl> + + " vst1 . u8 { q0 } , [ % [ dest ] ] \ n " <nl> + + : <nl> + + : [ dest ] " r " ( dest ) , [ ref ] " r " ( ref ) , [ refx ] " r " ( ref + 1 ) , <nl> + + [ refy ] " r " ( ref + stride ) , [ refxy ] " r " ( ref + stride + 1 ) <nl> + + : " memory " , " q0 " , " q1 " , " q2 " , " q3 " ) ; <nl> + + ref + = stride ; <nl> + + dest + = stride ; <nl> + + } while ( - - height ) ; <nl> + + } <nl> + + <nl> + + static void MC_put_xy_8_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + do { <nl> + + asm volatile ( <nl> + + " vld1 . u8 { d0 } , [ % [ ref ] ] \ n " <nl> + + " vld1 . u8 { d1 } , [ % [ refx ] ] \ n " <nl> + + " vrhadd . u8 d0 , d0 , d1 \ n " <nl> + + " vld1 . u8 { d2 } , [ % [ refy ] ] \ n " <nl> + + " vld1 . u8 { d3 } , [ % [ refxy ] ] \ n " <nl> + + " vrhadd . u8 d2 , d2 , d3 \ n " <nl> + + / * XXX : three cycles stall * / <nl> + + " vrhadd . u8 d0 , d0 , d2 \ n " <nl> + + / * XXX : three cycles stall * / <nl> + + " vst1 . u8 { d0 } , [ % [ dest ] ] \ n " <nl> + + : <nl> + + : [ dest ] " r " ( dest ) , [ ref ] " r " ( ref ) , [ refx ] " r " ( ref + 1 ) , <nl> + + [ refy ] " r " ( ref + stride ) , [ refxy ] " r " ( ref + stride + 1 ) <nl> + + : " memory " , " q0 " , " q1 " ) ; <nl> + + ref + = stride ; <nl> + + dest + = stride ; <nl> + + } while ( - - height ) ; <nl> + + } <nl> + + <nl> + + static void MC_avg_xy_16_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + do { <nl> + + asm volatile ( <nl> + + " vld1 . u8 { q0 } , [ % [ ref ] ] \ n " <nl> + + " vld1 . u8 { q1 } , [ % [ refx ] ] \ n " <nl> + + " vrhadd . u8 q0 , q0 , q1 \ n " <nl> + + " vld1 . u8 { q2 } , [ % [ refy ] ] \ n " <nl> + + " vld1 . u8 { q3 } , [ % [ refxy ] ] \ n " <nl> + + " vrhadd . u8 q2 , q2 , q3 \ n " <nl> + + " vld1 . u8 { q4 } , [ % [ dest ] ] \ n " <nl> + + / * XXX : one cycle stall * / <nl> + + " vrhadd . u8 q0 , q0 , q2 \ n " <nl> + + / * XXX : three cycles stall * / <nl> + + " vrhadd . u8 q0 , q4 , q0 \ n " <nl> + + " vst1 . u8 { q0 } , [ % [ dest ] ] \ n " <nl> + + : <nl> + + : [ dest ] " r " ( dest ) , [ ref ] " r " ( ref ) , [ refx ] " r " ( ref + 1 ) , <nl> + + [ refy ] " r " ( ref + stride ) , [ refxy ] " r " ( ref + stride + 1 ) <nl> + + : " memory " , " q0 " , " q1 " , " q2 " , " q3 " , " q4 " ) ; <nl> + + ref + = stride ; <nl> + + dest + = stride ; <nl> + + } while ( - - height ) ; <nl> + + } <nl> + + <nl> + + static void MC_avg_xy_8_neon ( uint8_t * dest , const uint8_t * ref , <nl> + + const int stride , int height ) <nl> + + { <nl> + + do { <nl> + + asm volatile ( <nl> + + " vld1 . u8 { d0 } , [ % [ ref ] ] \ n " <nl> + + " vld1 . u8 { d1 } , [ % [ refx ] ] \ n " <nl> + + " vrhadd . u8 d0 , d0 , d1 \ n " <nl> + + " vld1 . u8 { d2 } , [ % [ refy ] ] \ n " <nl> + + " vld1 . u8 { d3 } , [ % [ refxy ] ] \ n " <nl> + + " vrhadd . u8 d2 , d2 , d3 \ n " <nl> + + " vld1 . u8 { d4 } , [ % [ dest ] ] \ n " <nl> + + / * XXX : one cycle stall * / <nl> + + " vrhadd . u8 d0 , d0 , d2 \ n " <nl> + + / * XXX : three cycles stall * / <nl> + + " vrhadd . u8 d0 , d4 , d0 \ n " <nl> + + " vst1 . u8 { d0 } , [ % [ dest ] ] \ n " <nl> + + : <nl> + + : [ dest ] " r " ( dest ) , [ ref ] " r " ( ref ) , [ refx ] " r " ( ref + 1 ) , <nl> + + [ refy ] " r " ( ref + stride ) , [ refxy ] " r " ( ref + stride + 1 ) <nl> + + : " memory " , " q0 " , " q1 " , " d4 " ) ; <nl> + + ref + = stride ; <nl> + + dest + = stride ; <nl> + + } while ( - - height ) ; <nl> + + } <nl> + + <nl> + + MPEG2_MC_EXTERN ( neon ) <nl> + + <nl> + + # endif / * ARCH_ARM * / <nl> + <nl> + Modification de propriétés sur libmpeg2 / motion_comp_neon . c <nl> + ___________________________________________________________________ <nl> + Ajouté : svn : eol - style <nl> + + native <nl> + <nl> + Index : libmpeg2 / mpeg2_internal . h <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + mmm libmpeg2 / mpeg2_internal . h ( révision 1193 ) <nl> ppp + libmpeg2 / mpeg2_internal . h ( copie de travail ) <nl> + <nl> + extern mpeg2_mc_t mpeg2_mc_alpha ; <nl> + extern mpeg2_mc_t mpeg2_mc_vis ; <nl> + extern mpeg2_mc_t mpeg2_mc_arm ; <nl> + + extern mpeg2_mc_t mpeg2_mc_neon ; <nl> + <nl> + # endif / * LIBMPEG2_MPEG2_INTERNAL_H * / <nl> + Index : libmpeg2 / motion_comp . c <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + mmm libmpeg2 / motion_comp . c ( révision 1193 ) <nl> ppp + libmpeg2 / motion_comp . c ( copie de travail ) <nl> + <nl> + else <nl> + # endif <nl> + # ifdef ARCH_ARM <nl> + + # ifdef ARCH_ARM <nl> + + if ( accel & MPEG2_ACCEL_ARM ) <nl> + + mpeg2_mc = mpeg2_mc_neon ; <nl> + + else <nl> + + # endif <nl> + if ( accel & MPEG2_ACCEL_ARM ) { <nl> + mpeg2_mc = mpeg2_mc_arm ; <nl> + } else <nl> + Index : libmpeg2 / Makefile . am <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + mmm libmpeg2 / Makefile . am ( révision 1193 ) <nl> ppp + libmpeg2 / Makefile . am ( copie de travail ) <nl> + <nl> + motion_comp_vis . c motion_comp_arm . c \ <nl> + cpu_accel . c cpu_state . c <nl> + if ARCH_ARM <nl> + - libmpeg2arch_la_SOURCES + = motion_comp_arm_s . S <nl> + + libmpeg2arch_la_SOURCES + = motion_comp_arm_s . S motion_comp_neon . c <nl> + endif <nl> + libmpeg2arch_la_CFLAGS = $ ( OPT_CFLAGS ) $ ( ARCH_OPT_CFLAGS ) $ ( LIBMPEG2_CFLAGS ) <nl> + <nl> + Index : configure . ac <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + mmm configure . ac ( révision 1193 ) <nl> ppp + configure . ac ( copie de travail ) <nl> + <nl> + AC_DEFINE ( [ ARCH_ALPHA ] , , [ alpha architecture ] ) ; ; <nl> + arm * ) <nl> + arm_conditional = : <nl> + - AC_DEFINE ( [ ARCH_ARM ] , , [ ARM architecture ] ) ; ; <nl> + + AC_DEFINE ( [ ARCH_ARM ] , , [ ARM architecture ] ) <nl> + + AC_MSG_CHECKING ( [ if inline ARM Advanced SIMD assembly is supported ] ) <nl> + + AC_TRY_COMPILE ( [ ] , <nl> + + [ asm ( " vqmovun . s64 d0 , q1 " : : : " d0 " ) ; ] , <nl> + + [ AC_DEFINE ( [ ARCH_ARM_NEON ] , , [ ARM Advanced SIMD assembly ] ) <nl> + + AC_MSG_RESULT ( yes ) ] , <nl> + + [ AC_MSG_RESULT ( no ) ] ) <nl> + + ; ; <nl> + esac <nl> + elif test x " $ CC " = x " tendracc " ; then <nl> + dnl TenDRA portability checking compiler <nl> new file mode 100644 <nl> index 000000000000 . . 98f766ed6a3c <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libmpeg2 / 03 - config - fix . patch <nl> <nl> + mmm a / libmpeg2 / Makefile . in 2011 - 01 - 29 10 : 17 : 27 . 000000000 + 0100 <nl> ppp + b / libmpeg2 / Makefile . in 2011 - 01 - 29 10 : 28 : 26 . 000000000 + 0100 <nl> + <nl> + - # Makefile . in generated by automake 1 . 10 . 1 from Makefile . am . <nl> + + # Makefile . in generated by automake 1 . 10 from Makefile . am . <nl> + # @ configure_input @ <nl> + <nl> + # Copyright ( C ) 1994 , 1995 , 1996 , 1997 , 1998 , 1999 , 2000 , 2001 , 2002 , <nl> + - # 2003 , 2004 , 2005 , 2006 , 2007 , 2008 Free Software Foundation , Inc . <nl> + + # 2003 , 2004 , 2005 , 2006 Free Software Foundation , Inc . <nl> + # This Makefile . in is free software ; the Free Software Foundation <nl> + # gives unlimited permission to copy and / or distribute it , <nl> + # with or without modifications , as long as this notice is preserved . <nl> + <nl> + POST_UNINSTALL = : <nl> + build_triplet = @ build @ <nl> + host_triplet = @ host @ <nl> + - @ ARCH_ARM_TRUE @ am__append_1 = motion_comp_arm_s . S <nl> + + @ ARCH_ARM_TRUE @ am__append_1 = motion_comp_arm_s . S motion_comp_neon . c <nl> + subdir = libmpeg2 <nl> + DIST_COMMON = $ ( srcdir ) / Makefile . am $ ( srcdir ) / Makefile . in \ <nl> + $ ( srcdir ) / libmpeg2 . pc . in <nl> + ACLOCAL_M4 = $ ( top_srcdir ) / aclocal . m4 <nl> + am__aclocal_m4_deps = $ ( top_srcdir ) / m4 / cflags . m4 \ <nl> + $ ( top_srcdir ) / m4 / inttypes . m4 $ ( top_srcdir ) / m4 / keywords . m4 \ <nl> + - $ ( top_srcdir ) / m4 / nonpic . m4 $ ( top_srcdir ) / configure . ac <nl> + + $ ( top_srcdir ) / m4 / libtool . m4 $ ( top_srcdir ) / m4 / ltoptions . m4 \ <nl> + + $ ( top_srcdir ) / m4 / ltsugar . m4 $ ( top_srcdir ) / m4 / ltversion . m4 \ <nl> + + $ ( top_srcdir ) / m4 / lt ~ obsolete . m4 $ ( top_srcdir ) / m4 / nonpic . m4 \ <nl> + + $ ( top_srcdir ) / configure . ac <nl> + am__configure_deps = $ ( am__aclocal_m4_deps ) $ ( CONFIGURE_DEPENDENCIES ) \ <nl> + $ ( ACLOCAL_M4 ) <nl> + mkinstalldirs = $ ( install_sh ) - d <nl> + <nl> + am__libmpeg2arch_la_SOURCES_DIST = motion_comp_mmx . c idct_mmx . c \ <nl> + motion_comp_altivec . c idct_altivec . c motion_comp_alpha . c \ <nl> + idct_alpha . c motion_comp_vis . c motion_comp_arm . c cpu_accel . c \ <nl> + - cpu_state . c motion_comp_arm_s . S <nl> + - @ ARCH_ARM_TRUE @ am__objects_1 = motion_comp_arm_s . lo <nl> + + cpu_state . c motion_comp_arm_s . S motion_comp_neon . c <nl> + + @ ARCH_ARM_TRUE @ am__objects_1 = motion_comp_arm_s . lo \ <nl> + + @ ARCH_ARM_TRUE @ libmpeg2arch_la - motion_comp_neon . lo <nl> + am_libmpeg2arch_la_OBJECTS = libmpeg2arch_la - motion_comp_mmx . lo \ <nl> + libmpeg2arch_la - idct_mmx . lo \ <nl> + libmpeg2arch_la - motion_comp_altivec . lo \ <nl> + <nl> + libmpeg2arch_la_LINK = $ ( LIBTOOL ) - - tag = CC $ ( AM_LIBTOOLFLAGS ) \ <nl> + $ ( LIBTOOLFLAGS ) - - mode = link $ ( CCLD ) $ ( libmpeg2arch_la_CFLAGS ) \ <nl> + $ ( CFLAGS ) $ ( AM_LDFLAGS ) $ ( LDFLAGS ) - o $ @ <nl> + - DEFAULT_INCLUDES = - I . @ am__isrc @ - I $ ( top_builddir ) / include <nl> + + DEFAULT_INCLUDES = - I . - I $ ( top_builddir ) / include @ am__isrc @ <nl> + depcomp = $ ( SHELL ) $ ( top_srcdir ) / . auto / depcomp <nl> + am__depfiles_maybe = depfiles <nl> + CPPASCOMPILE = $ ( CCAS ) $ ( DEFS ) $ ( DEFAULT_INCLUDES ) $ ( INCLUDES ) \ <nl> + <nl> + CFLAGS = @ CFLAGS @ <nl> + CPP = @ CPP @ <nl> + CPPFLAGS = @ CPPFLAGS @ <nl> + - CXX = @ CXX @ <nl> + - CXXCPP = @ CXXCPP @ <nl> + - CXXDEPMODE = @ CXXDEPMODE @ <nl> + - CXXFLAGS = @ CXXFLAGS @ <nl> + CYGPATH_W = @ CYGPATH_W @ <nl> + DEFS = @ DEFS @ <nl> + DEPDIR = @ DEPDIR @ <nl> + DLLTOOL = @ DLLTOOL @ <nl> + DSYMUTIL = @ DSYMUTIL @ <nl> + - ECHO = @ ECHO @ <nl> + + DUMPBIN = @ DUMPBIN @ <nl> + ECHO_C = @ ECHO_C @ <nl> + ECHO_N = @ ECHO_N @ <nl> + ECHO_T = @ ECHO_T @ <nl> + EGREP = @ EGREP @ <nl> + EXEEXT = @ EXEEXT @ <nl> + - F77 = @ F77 @ <nl> + - FFLAGS = @ FFLAGS @ <nl> + + FGREP = @ FGREP @ <nl> + GREP = @ GREP @ <nl> + INSTALL = @ INSTALL @ <nl> + INSTALL_DATA = @ INSTALL_DATA @ <nl> + INSTALL_PROGRAM = @ INSTALL_PROGRAM @ <nl> + INSTALL_SCRIPT = @ INSTALL_SCRIPT @ <nl> + INSTALL_STRIP_PROGRAM = @ INSTALL_STRIP_PROGRAM @ <nl> + + LD = @ LD @ <nl> + LDFLAGS = @ LDFLAGS @ <nl> + LIBMPEG2_CFLAGS = @ LIBMPEG2_CFLAGS @ <nl> + LIBOBJS = @ LIBOBJS @ <nl> + <nl> + LIBTOOL = @ LIBTOOL @ <nl> + LIBVO_CFLAGS = @ LIBVO_CFLAGS @ <nl> + LIBVO_LIBS = @ LIBVO_LIBS @ <nl> + + LIPO = @ LIPO @ <nl> + LN_S = @ LN_S @ <nl> + LTLIBOBJS = @ LTLIBOBJS @ <nl> + MAINT = @ MAINT @ <nl> + MAKEINFO = @ MAKEINFO @ <nl> + MKDIR_P = @ MKDIR_P @ <nl> + MPEG2DEC_CFLAGS = @ MPEG2DEC_CFLAGS @ <nl> + + NM = @ NM @ <nl> + NMEDIT = @ NMEDIT @ <nl> + OBJDUMP = @ OBJDUMP @ <nl> + OBJEXT = @ OBJEXT @ <nl> + OPT_CFLAGS = @ OPT_CFLAGS @ <nl> + + OTOOL = @ OTOOL @ <nl> + + OTOOL64 = @ OTOOL64 @ <nl> + PACKAGE = @ PACKAGE @ <nl> + PACKAGE_BUGREPORT = @ PACKAGE_BUGREPORT @ <nl> + PACKAGE_NAME = @ PACKAGE_NAME @ <nl> + <nl> + abs_top_builddir = @ abs_top_builddir @ <nl> + abs_top_srcdir = @ abs_top_srcdir @ <nl> + ac_ct_CC = @ ac_ct_CC @ <nl> + - ac_ct_CXX = @ ac_ct_CXX @ <nl> + - ac_ct_F77 = @ ac_ct_F77 @ <nl> + + ac_ct_DUMPBIN = @ ac_ct_DUMPBIN @ <nl> + am__include = @ am__include @ <nl> + am__leading_dot = @ am__leading_dot @ <nl> + am__quote = @ am__quote @ <nl> + <nl> + libexecdir = @ libexecdir @ <nl> + localedir = @ localedir @ <nl> + localstatedir = @ localstatedir @ <nl> + + lt_ECHO = @ lt_ECHO @ <nl> + mandir = @ mandir @ <nl> + mkdir_p = @ mkdir_p @ <nl> + oldincludedir = @ oldincludedir @ <nl> + <nl> + @ list = ' $ ( lib_LTLIBRARIES ) ' ; for p in $ $ list ; do \ <nl> + if test - f $ $ p ; then \ <nl> + f = $ ( am__strip_dir ) \ <nl> + - echo " $ ( LIBTOOL ) $ ( AM_LIBTOOLFLAGS ) $ ( LIBTOOLFLAGS ) - - mode = install $ ( libLTLIBRARIES_INSTALL ) $ ( INSTALL_STRIP_FLAG ) ' $ $ p ' ' $ ( DESTDIR ) $ ( libdir ) / $ $ f ' " ; \ <nl> + - $ ( LIBTOOL ) $ ( AM_LIBTOOLFLAGS ) $ ( LIBTOOLFLAGS ) - - mode = install $ ( libLTLIBRARIES_INSTALL ) $ ( INSTALL_STRIP_FLAG ) " $ $ p " " $ ( DESTDIR ) $ ( libdir ) / $ $ f " ; \ <nl> + + echo " $ ( LIBTOOL ) - - mode = install $ ( libLTLIBRARIES_INSTALL ) $ ( INSTALL_STRIP_FLAG ) ' $ $ p ' ' $ ( DESTDIR ) $ ( libdir ) / $ $ f ' " ; \ <nl> + + $ ( LIBTOOL ) - - mode = install $ ( libLTLIBRARIES_INSTALL ) $ ( INSTALL_STRIP_FLAG ) " $ $ p " " $ ( DESTDIR ) $ ( libdir ) / $ $ f " ; \ <nl> + else : ; fi ; \ <nl> + done <nl> + <nl> + <nl> + @ $ ( NORMAL_UNINSTALL ) <nl> + @ list = ' $ ( lib_LTLIBRARIES ) ' ; for p in $ $ list ; do \ <nl> + p = $ ( am__strip_dir ) \ <nl> + - echo " $ ( LIBTOOL ) $ ( AM_LIBTOOLFLAGS ) $ ( LIBTOOLFLAGS ) - - mode = uninstall rm - f ' $ ( DESTDIR ) $ ( libdir ) / $ $ p ' " ; \ <nl> + - $ ( LIBTOOL ) $ ( AM_LIBTOOLFLAGS ) $ ( LIBTOOLFLAGS ) - - mode = uninstall rm - f " $ ( DESTDIR ) $ ( libdir ) / $ $ p " ; \ <nl> + + echo " $ ( LIBTOOL ) - - mode = uninstall rm - f ' $ ( DESTDIR ) $ ( libdir ) / $ $ p ' " ; \ <nl> + + $ ( LIBTOOL ) - - mode = uninstall rm - f " $ ( DESTDIR ) $ ( libdir ) / $ $ p " ; \ <nl> + done <nl> + <nl> + clean - libLTLIBRARIES : <nl> + <nl> + @ AMDEP_TRUE @ @ am__include @ @ am__quote @ . / $ ( DEPDIR ) / libmpeg2arch_la - motion_comp_altivec . Plo @ am__quote @ <nl> + @ AMDEP_TRUE @ @ am__include @ @ am__quote @ . / $ ( DEPDIR ) / libmpeg2arch_la - motion_comp_arm . Plo @ am__quote @ <nl> + @ AMDEP_TRUE @ @ am__include @ @ am__quote @ . / $ ( DEPDIR ) / libmpeg2arch_la - motion_comp_mmx . Plo @ am__quote @ <nl> + + @ AMDEP_TRUE @ @ am__include @ @ am__quote @ . / $ ( DEPDIR ) / libmpeg2arch_la - motion_comp_neon . Plo @ am__quote @ <nl> + @ AMDEP_TRUE @ @ am__include @ @ am__quote @ . / $ ( DEPDIR ) / libmpeg2arch_la - motion_comp_vis . Plo @ am__quote @ <nl> + @ AMDEP_TRUE @ @ am__include @ @ am__quote @ . / $ ( DEPDIR ) / motion_comp . Plo @ am__quote @ <nl> + @ AMDEP_TRUE @ @ am__include @ @ am__quote @ . / $ ( DEPDIR ) / motion_comp_arm_s . Plo @ am__quote @ <nl> + <nl> + @ AMDEP_TRUE @ @ am__fastdepCC_FALSE @ DEPDIR = $ ( DEPDIR ) $ ( CCDEPMODE ) $ ( depcomp ) @ AMDEPBACKSLASH @ <nl> + @ am__fastdepCC_FALSE @ $ ( LIBTOOL ) - - tag = CC $ ( AM_LIBTOOLFLAGS ) $ ( LIBTOOLFLAGS ) - - mode = compile $ ( CC ) $ ( DEFS ) $ ( DEFAULT_INCLUDES ) $ ( INCLUDES ) $ ( AM_CPPFLAGS ) $ ( CPPFLAGS ) $ ( libmpeg2arch_la_CFLAGS ) $ ( CFLAGS ) - c - o libmpeg2arch_la - cpu_state . lo ` test - f ' cpu_state . c ' | | echo ' $ ( srcdir ) / ' ` cpu_state . c <nl> + <nl> + + libmpeg2arch_la - motion_comp_neon . lo : motion_comp_neon . c <nl> + + @ am__fastdepCC_TRUE @ $ ( LIBTOOL ) - - tag = CC $ ( AM_LIBTOOLFLAGS ) $ ( LIBTOOLFLAGS ) - - mode = compile $ ( CC ) $ ( DEFS ) $ ( DEFAULT_INCLUDES ) $ ( INCLUDES ) $ ( AM_CPPFLAGS ) $ ( CPPFLAGS ) $ ( libmpeg2arch_la_CFLAGS ) $ ( CFLAGS ) - MT libmpeg2arch_la - motion_comp_neon . lo - MD - MP - MF $ ( DEPDIR ) / libmpeg2arch_la - motion_comp_neon . Tpo - c - o libmpeg2arch_la - motion_comp_neon . lo ` test - f ' motion_comp_neon . c ' | | echo ' $ ( srcdir ) / ' ` motion_comp_neon . c <nl> + + @ am__fastdepCC_TRUE @ mv - f $ ( DEPDIR ) / libmpeg2arch_la - motion_comp_neon . Tpo $ ( DEPDIR ) / libmpeg2arch_la - motion_comp_neon . Plo <nl> + + @ AMDEP_TRUE @ @ am__fastdepCC_FALSE @ source = ' motion_comp_neon . c ' object = ' libmpeg2arch_la - motion_comp_neon . lo ' libtool = yes @ AMDEPBACKSLASH @ <nl> + + @ AMDEP_TRUE @ @ am__fastdepCC_FALSE @ DEPDIR = $ ( DEPDIR ) $ ( CCDEPMODE ) $ ( depcomp ) @ AMDEPBACKSLASH @ <nl> + + @ am__fastdepCC_FALSE @ $ ( LIBTOOL ) - - tag = CC $ ( AM_LIBTOOLFLAGS ) $ ( LIBTOOLFLAGS ) - - mode = compile $ ( CC ) $ ( DEFS ) $ ( DEFAULT_INCLUDES ) $ ( INCLUDES ) $ ( AM_CPPFLAGS ) $ ( CPPFLAGS ) $ ( libmpeg2arch_la_CFLAGS ) $ ( CFLAGS ) - c - o libmpeg2arch_la - motion_comp_neon . lo ` test - f ' motion_comp_neon . c ' | | echo ' $ ( srcdir ) / ' ` motion_comp_neon . c <nl> + + <nl> + mostlyclean - libtool : <nl> + - rm - f * . lo <nl> + <nl> + <nl> + unique = ` for i in $ $ list ; do \ <nl> + if test - f " $ $ i " ; then echo $ $ i ; else echo $ ( srcdir ) / $ $ i ; fi ; \ <nl> + done | \ <nl> + - $ ( AWK ) ' { files [ $ $ 0 ] = 1 ; nonemtpy = 1 ; } \ <nl> + - END { if ( nonempty ) { for ( i in files ) print i ; } ; } ' ` ; \ <nl> + + $ ( AWK ) ' { files [ $ $ 0 ] = 1 ; } \ <nl> + + END { for ( i in files ) print i ; } ' ` ; \ <nl> + mkid - fID $ $ unique <nl> + tags : TAGS <nl> + <nl> + <nl> + unique = ` for i in $ $ list ; do \ <nl> + if test - f " $ $ i " ; then echo $ $ i ; else echo $ ( srcdir ) / $ $ i ; fi ; \ <nl> + done | \ <nl> + - $ ( AWK ) ' { files [ $ $ 0 ] = 1 ; nonempty = 1 ; } \ <nl> + - END { if ( nonempty ) { for ( i in files ) print i ; } ; } ' ` ; \ <nl> + + $ ( AWK ) ' { files [ $ $ 0 ] = 1 ; } \ <nl> + + END { for ( i in files ) print i ; } ' ` ; \ <nl> + if test - z " $ ( ETAGS_ARGS ) $ $ tags $ $ unique " ; then : ; else \ <nl> + test - n " $ $ unique " | | unique = $ $ empty_fix ; \ <nl> + $ ( ETAGS ) $ ( ETAGSFLAGS ) $ ( AM_ETAGSFLAGS ) $ ( ETAGS_ARGS ) \ <nl> + <nl> + CTAGS : ctags - recursive $ ( HEADERS ) $ ( SOURCES ) $ ( TAGS_DEPENDENCIES ) \ <nl> + $ ( TAGS_FILES ) $ ( LISP ) <nl> + tags = ; \ <nl> + + here = ` pwd ` ; \ <nl> + list = ' $ ( SOURCES ) $ ( HEADERS ) $ ( LISP ) $ ( TAGS_FILES ) ' ; \ <nl> + unique = ` for i in $ $ list ; do \ <nl> + if test - f " $ $ i " ; then echo $ $ i ; else echo $ ( srcdir ) / $ $ i ; fi ; \ <nl> + done | \ <nl> + - $ ( AWK ) ' { files [ $ $ 0 ] = 1 ; nonempty = 1 ; } \ <nl> + - END { if ( nonempty ) { for ( i in files ) print i ; } ; } ' ` ; \ <nl> + + $ ( AWK ) ' { files [ $ $ 0 ] = 1 ; } \ <nl> + + END { for ( i in files ) print i ; } ' ` ; \ <nl> + test - z " $ ( CTAGS_ARGS ) $ $ tags $ $ unique " \ <nl> + | | $ ( CTAGS ) $ ( CTAGSFLAGS ) $ ( AM_CTAGSFLAGS ) $ ( CTAGS_ARGS ) \ <nl> + $ $ tags $ $ unique <nl> new file mode 100644 <nl> index 000000000000 . . 2295ad7e7e40 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libmpeg2 / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = libmpeg2 <nl> + VERSION = 0 . 5 . 1 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes - - disable - sdl <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; patch - p1 < . . / 01 - libmpeg2 - add - asm - leading - underscores . patch <nl> + cd $ ( SOURCE ) ; patch - p1 < . . / 03 - config - fix . patch <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 7b2fae6f967d <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libogg / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = libogg <nl> + VERSION = 1 . 1 . 4 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . a21ec20e5125 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libpng / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = libpng <nl> + # VERSION = 1 . 4 . 4 <nl> + VERSION = 1 . 2 . 38 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . b71ffb4484c6 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / librtmp / 01 - make_shared_lib_for_darwin - tag2 . 3 . patch <nl> <nl> + diff - uNr rtmpdump - 2 . 3 / Makefile rtmpdump - 2 . 3 - org / Makefile <nl> + mmm rtmpdump - 2 . 3 / Makefile 2010 - 06 - 30 15 : 58 : 35 . 000000000 - 0400 <nl> ppp + rtmpdump - 2 . 3 - org / Makefile 2011 - 01 - 23 13 : 50 : 03 . 000000000 - 0500 <nl> + <nl> + <nl> + prefix = / usr / local <nl> + <nl> + - CC = $ ( CROSS_COMPILE ) gcc <nl> + - LD = $ ( CROSS_COMPILE ) ld <nl> + + # CC = $ ( CROSS_COMPILE ) gcc <nl> + + # LD = $ ( CROSS_COMPILE ) ld <nl> + <nl> + SYS = posix <nl> + # SYS = mingw <nl> + <nl> + <nl> + LIBS_posix = <nl> + LIBS_mingw = - lws2_32 - lwinmm - lgdi32 <nl> + + LIBS_darwin = <nl> + LIBS = $ ( CRYPTO_LIB ) - lz $ ( LIBS_ $ ( SYS ) ) $ ( XLIBS ) <nl> + <nl> + THREADLIB_posix = - lpthread <nl> + THREADLIB_mingw = <nl> + + THREADLIB_darwin = - lpthread <nl> + THREADLIB = $ ( THREADLIB_ $ ( SYS ) ) <nl> + SLIBS = $ ( THREADLIB ) $ ( LIBS ) <nl> + <nl> + <nl> + <nl> + EXT_posix = <nl> + EXT_mingw = . exe <nl> + + EXT_darwin = <nl> + EXT = $ ( EXT_ $ ( SYS ) ) <nl> + <nl> + all : $ ( LIBRTMP ) progs <nl> + diff - uNr rtmpdump - 2 . 3 / librtmp / Makefile rtmpdump - 2 . 3 - org / librtmp / Makefile <nl> + mmm rtmpdump - 2 . 3 / librtmp / Makefile 2010 - 06 - 30 16 : 01 : 28 . 000000000 - 0400 <nl> ppp + rtmpdump - 2 . 3 - org / librtmp / Makefile 2011 - 01 - 23 13 : 56 : 46 . 000000000 - 0500 <nl> + <nl> + <nl> + prefix = / usr / local <nl> + <nl> + - CC = $ ( CROSS_COMPILE ) gcc <nl> + - LD = $ ( CROSS_COMPILE ) ld <nl> + - AR = $ ( CROSS_COMPILE ) ar <nl> + + # CC = $ ( CROSS_COMPILE ) gcc <nl> + + # LD = $ ( CROSS_COMPILE ) ld <nl> + + # AR = $ ( CROSS_COMPILE ) ar <nl> + <nl> + SYS = posix <nl> + CRYPTO = OPENSSL <nl> + <nl> + <nl> + SO_posix = so . 0 <nl> + SO_mingw = dll <nl> + + SO_darwin = so . 0 <nl> + SO_EXT = $ ( SO_ $ ( SYS ) ) <nl> + <nl> + + SO_LDFLAGS_posix = - shared - Wl , - soname , $ @ <nl> + + SO_LDFLAGS_mingw = <nl> + + SO_LDFLAGS_darwin = - bundle - flat_namespace - undefined suppress - fno - common \ <nl> + + - headerpad_max_install_names $ ( XLDFLAGS ) <nl> + + SO_LDFLAGS = $ ( SO_LDFLAGS_ $ ( SYS ) ) <nl> + + <nl> + SHARED = yes <nl> + SODEF_yes = - fPIC <nl> + SOLIB_yes = librtmp . $ ( SO_EXT ) <nl> + <nl> + $ ( AR ) rs $ @ $ ? <nl> + <nl> + librtmp . $ ( SO_EXT ) : $ ( OBJS ) <nl> + - $ ( CC ) - shared - Wl , - soname , $ @ $ ( LDFLAGS ) - o $ @ $ ^ $ > $ ( CRYPTO_LIB ) <nl> + + $ ( CC ) $ ( SO_LDFLAGS ) $ ( LDFLAGS ) - o $ @ $ ^ $ > $ ( CRYPTO_LIB ) <nl> + ln - sf $ @ librtmp . so <nl> + <nl> + log . o : log . c log . h Makefile <nl> new file mode 100644 <nl> index 000000000000 . . 305ba9f78b8a <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / librtmp / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = rtmpdump <nl> + VERSION = 2 . 3 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / rtmpdump . mplayerhq . hu / download <nl> + ARCHIVE = $ ( SOURCE ) . tgz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; patch - p1 < . . / 01 - make_shared_lib_for_darwin - tag2 . 3 . patch <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make SYS = darwin prefix = $ ( PREFIX ) XCFLAGS = " $ ( CFLAGS ) " XLDFLAGS = " $ ( LDFLAGS ) " - C $ ( SOURCE ) / librtmp <nl> + <nl> + . installed : <nl> + make SYS = darwin prefix = $ ( PREFIX ) - C $ ( SOURCE ) / librtmp install <nl> + cp $ ( PREFIX ) / lib / librtmp . so . . / . . / . . / . . / system / <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm - f . . / . . / . . / . . / system / librtmp . so <nl> + rm - f . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . b14b0dac571a <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libsamplerate / 01 - libsamplerate - arm . patch <nl> <nl> + diff - ruN libsamplerate - 0 . 1 . 7 / src / float_cast . h . org src / float_cast . h <nl> + mmm libsamplerate - 0 . 1 . 7 / src / float_cast . h . org 2010 - 10 - 28 21 : 00 : 19 . 000000000 - 0400 <nl> ppp + libsamplerate - 0 . 1 . 7 / src / float_cast . h 2010 - 10 - 28 21 : 00 : 52 . 000000000 - 0400 <nl> + <nl> + return res [ 1 ] ; <nl> + } / * double2int * / <nl> + <nl> + - # elif ( defined ( __MACH__ ) & & defined ( __APPLE__ ) ) <nl> + + # elif ( defined ( __MACH__ ) & & defined ( __APPLE__ ) & & ! defined ( __arm__ ) ) <nl> + <nl> + / * For Apple MacOSX . * / <nl> + <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 3af786962e7f <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libsamplerate / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = libsamplerate <nl> + VERSION = 0 . 1 . 7 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes - - disable - sndfile - - disable - fftw <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; patch - p1 < . . / 01 - libsamplerate - arm . patch <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 6213a01e4e7d <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libsdl / 01 - SDL_SetWidthHeight . patch <nl> <nl> + Index : include / SDL_video . h <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + mmm include / SDL_video . h ( revision 4116 ) <nl> ppp + include / SDL_video . h ( working copy ) <nl> + <nl> + extern DECLSPEC SDL_Rect * * SDLCALL SDL_ListModes ( SDL_PixelFormat * format , Uint32 flags ) ; <nl> + <nl> + / * <nl> + + * Alter the width and height of the current surface to the given sizes . <nl> + + * / <nl> + + extern DECLSPEC void SDLCALL SDL_SetWidthHeight ( int width , int height ) ; <nl> + + <nl> + + / * <nl> + * Set up a video mode with the specified width , height and bits - per - pixel . <nl> + * <nl> + * If ' bpp ' is 0 , it is treated as the current display bits per pixel . <nl> + Index : src / video / SDL_video . c <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + mmm src / video / SDL_video . c ( revision 4116 ) <nl> ppp + src / video / SDL_video . c ( working copy ) <nl> + <nl> + return ( 0 ) ; <nl> + } <nl> + } <nl> + + <nl> + + void SDL_SetWidthHeight ( int width , int height ) <nl> + + { <nl> + + if ( current_video ! = NULL & & current_video - > screen ! = NULL ) { <nl> + + current_video - > screen - > w = width ; <nl> + + current_video - > screen - > h = height ; <nl> + + } <nl> + + } <nl> new file mode 100644 <nl> index 000000000000 . . 11c17650e72d <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libsdl / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = SDL <nl> + VERSION = 1 . 2 . 13 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + # BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + BASE_URL = http : / / www . libsdl . org / release / <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress - Wl , - undefined , dynamic_lookup <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) \ <nl> + - - enable - static - - disable - shared <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; patch - p0 < . . / 01 - SDL_SetWidthHeight . patch <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 638488d4260d <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libsdl_image / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = SDL_image <nl> + VERSION = 1 . 2 . 7 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + # BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + BASE_URL = http : / / www . libsdl . org / projects / SDL_image / release <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress - Wl , - undefined , dynamic_lookup <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) \ <nl> + - - enable - static - - disable - shared - - disable - sdltest <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / $ ( LIBNAME ) . a <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 9f5307266ba5 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libsdl_mixer / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = SDL_mixer <nl> + VERSION = 1 . 2 . 8 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + # BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + BASE_URL = http : / / www . libsdl . org / projects / SDL_mixer / release <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - liconv - Wl , - read_only_relocs , suppress - Wl , - undefined , dynamic_lookup <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) \ <nl> + - - disable - music - ogg - - disable - music - mp3 \ <nl> + - - disable - music - mod - - disable - music - midi - - disable - smpegtest - - disable - sdltest <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / $ ( LIBNAME ) . a <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . e77452ccf847 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libssh2 / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = libssh2 <nl> + VERSION = 1 . 2 . 7 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress - Wl , - undefined , dynamic_lookup <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes \ <nl> + - - with - openssl - - without - libgcrypt ac_cv_func_EVP_aes_128_ctr = no <nl> + <nl> + SHELL : = / bin / bash <nl> + RM : = rm - rf <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . ed9823628d28 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libvorbis / 01 - libvorbis - fix - libtool - flags . patch <nl> <nl> + diff - ruN libvorbis - 1 . 2 . 0 / configure libvorbis - 1 . 2 . 0 . mod / configure <nl> + mmm libvorbis - 1 . 2 . 0 / configure 2007 - 07 - 25 12 : 46 : 37 . 000000000 - 0400 <nl> ppp + libvorbis - 1 . 2 . 0 . mod / configure 2010 - 10 - 29 11 : 46 : 06 . 000000000 - 0400 <nl> + <nl> + CFLAGS = " - O20 - ffast - math - D__NO_MATH_INLINES - fsigned - char - mv8 " <nl> + PROFILE = " - pg - g - O20 - D__NO_MATH_INLINES - fsigned - char - mv8 " ; ; <nl> + * - * - darwin * ) <nl> + - DEBUG = " - DDARWIN - fno - common - force_cpusubtype_ALL - Wall - g - O0 - fsigned - char " <nl> + - CFLAGS = " - DDARWIN - fno - common - force_cpusubtype_ALL - Wall - g - O4 - ffast - math - fsigned - char " <nl> + - PROFILE = " - DDARWIN - fno - common - force_cpusubtype_ALL - Wall - g - pg - O4 - ffast - math - fsigned - char " ; ; <nl> + + DEBUG = " - DARWIN_NO_CARBON - fno - common - noforce_cpusubtype_ALL - Wall - g - O0 - fsigned - char " <nl> + + CFLAGS = " - DARWIN_NO_CARBON - fno - common - noforce_cpusubtype_ALL - Wall - g - O4 - ffast - math - fsigned - char " <nl> + + PROFILE = " - DARWIN_NO_CARBON - fno - common - noforce_cpusubtype_ALL - Wall - g - pg - O4 - ffast - math - fsigned - char " ; ; <nl> + * ) <nl> + DEBUG = " - g - Wall - W - D__NO_MATH_INLINES - fsigned - char " <nl> + CFLAGS = " - O20 - D__NO_MATH_INLINES - fsigned - char " <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 7f37d2472eb5 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libvorbis / 02 - libvorbis - only - build - lib . patch <nl> <nl> + diff - ruN libvorbis - 1 . 2 . 0 . org / Makefile . in libvorbis - 1 . 2 . 0 / Makefile . in <nl> + mmm libvorbis - 1 . 2 . 0 . org / Makefile . in 2007 - 07 - 25 12 : 46 : 36 . 000000000 - 0400 <nl> ppp + libvorbis - 1 . 2 . 0 / Makefile . in 2010 - 10 - 29 11 : 47 : 46 . 000000000 - 0400 <nl> + <nl> + top_builddir = @ top_builddir @ <nl> + top_srcdir = @ top_srcdir @ <nl> + AUTOMAKE_OPTIONS = 1 . 6 foreign dist - zip dist - bzip2 <nl> + - SUBDIRS = lib include doc examples vq <nl> + + SUBDIRS = lib include <nl> + m4datadir = $ ( datadir ) / aclocal <nl> + m4data_DATA = vorbis . m4 <nl> + pkgconfigdir = $ ( libdir ) / pkgconfig <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 5b1a680d9a48 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libvorbis / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = libvorbis <nl> + VERSION = 1 . 2 . 0 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress - Wl , - undefined , dynamic_lookup <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes - - disable - oggtest - - disable - docs - - disable - examples <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; patch - p1 < . . / 01 - libvorbis - fix - libtool - flags . patch <nl> + cd $ ( SOURCE ) ; patch - p1 < . . / 02 - libvorbis - only - build - lib . patch <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 956780da6fbd <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / libwavpack / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = wavpack <nl> + VERSION = 4 . 60 . 1 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . bz2 <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / lib $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . d0c3b101a7e0 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / mysqlclient / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + LIBNAME = mysql <nl> + VERSION = 5 . 1 . 55 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + # BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + BASE_URL = http : / / mysql . mirrors . pair . com / Downloads / MySQL - 5 . 1 <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared \ <nl> + - - enable - thread - safe - client - with - extra - charsets = complex \ <nl> + - - without - readline - - without - server - - without - bench - - without - docs - - without - man \ <nl> + ac_cv_func_locking = no \ <nl> + ac_cv_func_thr_setconcurrency = no \ <nl> + ac_cv_func_clock_gettime = no \ <nl> + ac_cv_func_gethrtime = no \ <nl> + ac_cv_func_printstack = no \ <nl> + ac_cv_func_backtrace = no \ <nl> + ac_cv_func_backtrace_symbols = no \ <nl> + ac_cv_func_gethostbyname_r = no \ <nl> + ac_cv_func_bfill = no \ <nl> + ac_cv_func_bmove = no \ <nl> + ac_cv_func_bsearch = no \ <nl> + ac_cv_func_bzero = no \ <nl> + ac_cv_func_fconvert = no \ <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / libmysql / . libs / $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) / scripts install <nl> + make - C $ ( SOURCE ) / include install <nl> + make - C $ ( SOURCE ) / libmysql install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm - f . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 4eb7470922bb <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / openssl / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = openssl <nl> + VERSION = 1 . 0 . 0a <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / Configure darwin - i386 - cc zlib no - asm no - krb5 shared - - openssldir = $ ( PREFIX ) <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / src / . libs / lib $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . e2c2cb0242e0 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / pcre / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = pcre <nl> + VERSION = 7 . 9 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes \ <nl> + - - disable - stack - for - recursion <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . dc0943996066 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / pkg - config / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + # lib name , version <nl> + LIBNAME = pkg - config <nl> + VERSION = 0 . 23 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + PREFIX : = / Users / Shared / xbmc - depends / osx - 10 . 4_i386 <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - enable - indirect - deps - - with - pc - path = $ ( PREFIX ) / lib / pkgconfig : $ ( PREFIX ) / share / pkgconfig <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / bin / pkg - config <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm - f . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 267e2c3b9c4a <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / python26 / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + # <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = Python <nl> + VERSION = 2 . 6 . 5 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . bz2 <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export EXTRA_CFLAGS = $ ( CFLAGS ) <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared \ <nl> + - - disable - toolbox - glue <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / libpython2 . 6 . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( LIBDYLIB ) : $ ( ARCHIVE ) <nl> + rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + cd $ ( SOURCE ) ; make <nl> + <nl> + . installed : <nl> + cd $ ( SOURCE ) ; make install <nl> + find $ ( PREFIX ) / lib / python2 . 6 - type f - name * . pyc - exec rm - f { } \ ; <nl> + find $ ( PREFIX ) / lib / python2 . 6 - type f - name * . pyo - exec rm - f { } \ ; <nl> + touch $ @ <nl> + <nl> + clean : <nl> + rm - rf $ ( SOURCE ) . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 3c595f5a97cc <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / readline / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = readline <nl> + VERSION = 6 . 0 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes ac_cv_header_termcap_h = no ac_cv_func_strcoll_works = yes bash_cv_func_sigsetjmp = present bash_cv_func_ctype_nonascii = no bash_cv_must_reinstall_sighandlers = no bash_cv_func_strcoll_broken = yes <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / shlib / ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; autoconf <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 2a26b560c586 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / samba / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = samba <nl> + VERSION = 3 . 5 . 6 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress - Wl , - unexported_symbol , _MD5 * - lc <nl> + # believe it or not , this is how you setup samba for cross - compile <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared = yes \ <nl> + - - without - cluster - support - - disable - swat - - without - ldap - - without - pam - - without - pam_smbpass - - with - fhs \ <nl> + samba_cv_HAVE_LINUX_READAHEAD = no \ <nl> + samba_cv_HAVE_STRUCT_FLOCK64 = no \ <nl> + samba_cv_HAVE_LINUX_SPLICE = no \ <nl> + samba_cv_SIZEOF_DEV_T = no \ <nl> + samba_cv_SIZEOF_INO_T = yes \ <nl> + samba_cv_SIZEOF_OFF_T = yes \ <nl> + samba_cv_SIZEOF_TIME_T = no \ <nl> + samba_cv_have_longlong = yes \ <nl> + samba_cv_have_setresgid = no \ <nl> + samba_cv_have_setresuid = no \ <nl> + ac_cv_func_creat64 = no \ <nl> + ac_cv_func_fseek64 = no \ <nl> + ac_cv_func_fseeko64 = no \ <nl> + ac_cv_func_ftell64 = no \ <nl> + ac_cv_func_ftello64 = no \ <nl> + ac_cv_func_open64 = no \ <nl> + ac_cv_func_fopen64 = no \ <nl> + ac_cv_func_opendir64 = no \ <nl> + ac_cv_func_readdir64 = no \ <nl> + ac_cv_func_seekdir64 = no \ <nl> + ac_cv_func_telldir64 = no \ <nl> + ac_cv_func_rewinddir64 = no \ <nl> + ac_cv_func_closedir64 = no \ <nl> + ac_cv_func_getpwanam = no \ <nl> + ac_cv_func_getprpwnam = no \ <nl> + ac_cv_func_getpwent_r = no \ <nl> + ac_cv_func_getpassphrase = no \ <nl> + ac_cv_func_llistxattr = no \ <nl> + ac_cv_func_lremovexattr = no \ <nl> + ac_cv_func_lsetxattr = no \ <nl> + ac_cv_func_lgetxattr = no \ <nl> + ac_cv_func_extattr_delete_fd = no \ <nl> + ac_cv_func_extattr_delete_file = no \ <nl> + ac_cv_func_extattr_delete_link = no \ <nl> + ac_cv_func_extattr_get_fd = no \ <nl> + ac_cv_func_extattr_get_file = no \ <nl> + ac_cv_func_extattr_get_link = no \ <nl> + ac_cv_func_extattr_list_fd = no \ <nl> + ac_cv_func_extattr_list_file = no \ <nl> + ac_cv_func_extattr_list_link = no \ <nl> + ac_cv_func_extattr_set_fd = no \ <nl> + ac_cv_func_extattr_set_file = no \ <nl> + ac_cv_func_extattr_set_link = no \ <nl> + ac_cv_func_strndup = no \ <nl> + ac_cv_func_strnlen = no \ <nl> + ac_cv_func_memalign = no \ <nl> + ac_cv_func_posix_memalign = no \ <nl> + ac_cv_func_posix_fallocate = no \ <nl> + ac_cv_func_posix_fallocate64 = no \ <nl> + ac_cv_header_libunwind_h = no \ <nl> + ac_cv_header_execinfo_h = no \ <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / source3 / bin / libsmbclient . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( LIBDYLIB ) : $ ( ARCHIVE ) <nl> + rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) / source3 ; . / autogen . sh <nl> + cd $ ( SOURCE ) / source3 ; $ ( CONFIGURE ) <nl> + # cp - f / Developer / Platforms / iPhoneSimulator . platform / Developer / SDKs / iPhoneSimulator $ ( platform_sdk_version ) . sdk / usr / include / crt_externs . h $ ( PREFIX ) / include / <nl> + cd $ ( SOURCE ) / source3 ; make bin / libsmbclient . dylib <nl> + <nl> + . installed : <nl> + cp - f $ ( SOURCE ) / source3 / include / libsmbclient . h $ ( PREFIX ) / include / <nl> + cp - f $ ( SOURCE ) / source3 / bin / libtdb . dylib . 1 $ ( PREFIX ) / lib / <nl> + cp - f $ ( SOURCE ) / source3 / bin / libtalloc . dylib . 2 $ ( PREFIX ) / lib / <nl> + cp - f $ ( SOURCE ) / source3 / bin / libsmbclient . dylib . 0 $ ( PREFIX ) / lib / <nl> + cd $ ( PREFIX ) / lib ; ln - sf libsmbclient . dylib . 0 libsmbclient . dylib <nl> + install_name_tool - id $ ( PREFIX ) / lib / libtdb . dylib . 1 $ ( PREFIX ) / lib / libtdb . dylib . 1 <nl> + install_name_tool - id $ ( PREFIX ) / lib / libtalloc . dylib . 2 $ ( PREFIX ) / lib / libtalloc . dylib . 2 <nl> + install_name_tool - id $ ( PREFIX ) / lib / libsmbclient . dylib . 0 $ ( PREFIX ) / lib / libsmbclient . dylib . 0 <nl> + install_name_tool - change bin / libtdb . dylib . 1 $ ( PREFIX ) / lib / libtdb . dylib . 1 \ <nl> + $ ( PREFIX ) / lib / libsmbclient . dylib . 0 <nl> + install_name_tool - change bin / libtalloc . dylib . 2 $ ( PREFIX ) / lib / libtalloc . dylib . 2 \ <nl> + $ ( PREFIX ) / lib / libsmbclient . dylib . 0 <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) / source3 clean <nl> + rm - f . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . f183d7a5b23f <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / sqlite3 / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = sqlite <nl> + VERSION = 3 . 6 . 11 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + # BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + BASE_URL = http : / / www . sqlite . org <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup - DSQLITE_ENABLE_COLUMN_METADATA = 1 <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + export TCLLIBDIR = / dev / null <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared \ <nl> + - - enable - threadsafe - - disable - tcl \ <nl> + - - with - readline - inc = " - I $ { PREFIX } / include " \ <nl> + - - with - readline - lib = " - L $ { PREFIX } / lib - lreadline - lm - lncurses " <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / . libs / lib $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm - f . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . a435546fd1e4 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / tar / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + # app name , version <nl> + APPNAME = tar <nl> + VERSION = 1 . 23 <nl> + SOURCE = $ ( APPNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + / / BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + BASE_URL = http : / / ftp . gnu . org / gnu / tar <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + export LIBTOOL = builds / unix / libtool <nl> + PREFIX : = / Users / Shared / xbmc - depends / osx - 10 . 4_i386 <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) \ <nl> + - - program - transform - name = s / tar / gtar / - - disable - dependency - tracking <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) / src / tar <nl> + <nl> + all : $ ( SOURCE ) / src / tar . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( SOURCE ) / src / tar : $ ( SOURCE ) <nl> + cd $ ( SOURCE ) ; make <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + cd $ ( PREFIX ) / bin ; ln - s gtar tar ; ln - s gtar gnutar <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 0eba08e95c36 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / test / configure . ac <nl> <nl> + AC_INIT <nl> + <nl> + PKG_PROG_PKG_CONFIG <nl> new file mode 100644 <nl> index 000000000000 . . e3a931808d83 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / tiff / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + include . . / config . mk <nl> + <nl> + # lib name , version <nl> + LIBNAME = tiff <nl> + VERSION = 3 . 8 . 2 <nl> + SOURCE = $ ( LIBNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + export CFLAGS + = - undefined dynamic_lookup <nl> + export CXXFLAGS + = - undefined dynamic_lookup <nl> + export LDFLAGS + = - Wl , - read_only_relocs , suppress <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) - - enable - shared <nl> + <nl> + LIBDYLIB = $ ( SOURCE ) / libtiff / . libs / lib $ ( LIBNAME ) . dylib <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( LIBDYLIB ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( LIBDYLIB ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl> new file mode 100644 <nl> index 000000000000 . . 0e31ec243392 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / xbmc / Makefile <nl> <nl> + # A quick and dirty Makefile to configure xbmc <nl> + # <nl> + <nl> + include . . / config . mk <nl> + <nl> + SOURCE = . . / . . / . . / . . / <nl> + # configuration settings <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) \ <nl> + - - enable - external - python \ <nl> + PKG_CONFIG_PATH = $ ( PREFIX ) / lib / pkgconfig <nl> + <nl> + all : configure <nl> + <nl> + configure : <nl> + cd $ ( SOURCE ) ; . / bootstrap <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + # cd $ ( SOURCE ) ; make xcode_depends <nl> new file mode 100644 <nl> index 000000000000 . . 777b2c33dba4 <nl> mmm / dev / null <nl> ppp b / tools / osx / osx - depends / yasm / Makefile <nl> <nl> + # A quick and dirty Makefile to download / build and install <nl> + # <nl> + # Usage : <nl> + # make <nl> + # sudo make install <nl> + <nl> + # lib name , version <nl> + APPNAME = yasm <nl> + VERSION = 1 . 1 . 0 <nl> + SOURCE = $ ( APPNAME ) - $ ( VERSION ) <nl> + # download location and format <nl> + # BASE_URL = http : / / mirrors . xbmc . org / build - deps / darwin - libs <nl> + BASE_URL = http : / / www . tortall . net / projects / yasm / releases <nl> + ARCHIVE = $ ( SOURCE ) . tar . gz <nl> + <nl> + RETRIEVE_TOOL = / usr / bin / curl <nl> + RETRIEVE_TOOL_FLAGS = - Ls - - output $ ( ARCHIVE ) <nl> + ARCHIVE_TOOL = tar <nl> + ARCHIVE_TOOL_FLAGS = xf <nl> + <nl> + # configuration settings <nl> + PREFIX : = / Users / Shared / xbmc - depends / osx - 10 . 4_i386 <nl> + CONFIGURE = . / configure - - prefix = $ ( PREFIX ) - - host = $ ( HOST ) <nl> + <nl> + APP = $ ( SOURCE ) / $ ( APPNAME ) <nl> + <nl> + CLEAN_FILES = $ ( ARCHIVE ) $ ( SOURCE ) <nl> + <nl> + all : $ ( APP ) . installed <nl> + <nl> + $ ( ARCHIVE ) : <nl> + $ ( RETRIEVE_TOOL ) $ ( RETRIEVE_TOOL_FLAGS ) $ ( BASE_URL ) / $ ( ARCHIVE ) <nl> + echo $ ( ARCHIVE ) > . gitignore <nl> + <nl> + $ ( SOURCE ) : $ ( ARCHIVE ) <nl> + - rm - rf $ ( SOURCE ) <nl> + $ ( ARCHIVE_TOOL ) $ ( ARCHIVE_TOOL_FLAGS ) $ ( ARCHIVE ) <nl> + echo $ ( SOURCE ) > > . gitignore <nl> + cd $ ( SOURCE ) ; $ ( CONFIGURE ) <nl> + <nl> + $ ( APP ) : $ ( SOURCE ) <nl> + make - C $ ( SOURCE ) <nl> + <nl> + . installed : <nl> + make - C $ ( SOURCE ) install <nl> + touch $ @ <nl> + <nl> + clean : <nl> + make - C $ ( SOURCE ) clean <nl> + rm . installed <nl> + <nl> + distclean : : <nl> + rm - rf $ ( SOURCE ) . installed <nl>
[ osx ] add new osx depends build system , this will replace macports
xbmc/xbmc
e3702d213df818935d27c438bb8dc5f6d33c1d91
2011-03-05T22:37:58Z
mmm a / media - converter / src / videoconv . rs <nl> ppp b / media - converter / src / videoconv . rs <nl> impl < ' a > Read for PadReader < ' a > { <nl> return Ok ( 0 ) ; <nl> } <nl> <nl> - if to_copy = = out . len ( ) { <nl> - out . copy_from_slice ( & self . chunk [ self . chunk_offs . . ( self . chunk_offs + to_copy ) ] ) ; <nl> - } else { <nl> - / * FIXME : there ' s probably some cool functional way to do this * / <nl> - for i in 0 . . to_copy { <nl> - out [ i ] = self . chunk [ self . chunk_offs + i ] ; <nl> - } <nl> - } <nl> + out [ . . to_copy ] . copy_from_slice ( & self . chunk [ self . chunk_offs . . ( self . chunk_offs + to_copy ) ] ) ; <nl> <nl> self . chunk_offs + = to_copy ; <nl> <nl> impl VideoConvState { <nl> None = > { <nl> let blank = include_bytes ! ( " . . / blank . ogv " ) ; <nl> <nl> - let remaining = blank . len ( ) - offs ; <nl> + let to_copy = std : : cmp : : min ( blank . len ( ) - offs , out . len ( ) ) ; <nl> <nl> - if out . len ( ) < = remaining { <nl> - out . copy_from_slice ( & blank [ offs . . ( offs + out . len ( ) ) ] ) ; <nl> - Ok ( out . len ( ) ) <nl> - } else { <nl> - / * FIXME : there ' s probably some cool functional way to do this * / <nl> - for i in 0 . . remaining { <nl> - out [ i ] = blank [ offs + i ] ; <nl> - } <nl> - Ok ( remaining ) <nl> - } <nl> + out [ . . to_copy ] . copy_from_slice ( & blank [ offs . . ( offs + to_copy ) ] ) ; <nl> + <nl> + Ok ( to_copy ) <nl> } , <nl> } <nl> } <nl>
media - converter : Simplify array copy
ValveSoftware/Proton
370dc01d07eba692e6d19ceebc7b9e0da07ad0c2
2020-10-19T18:52:04Z
mmm a / modules / ocl / src / gemm . cpp <nl> ppp b / modules / ocl / src / gemm . cpp <nl> void cv : : ocl : : clBlasSetup ( ) <nl> <nl> void cv : : ocl : : clBlasTeardown ( ) <nl> { <nl> - CV_Error ( CV_StsNotImplemented , " OpenCL BLAS is not implemented " ) ; <nl> + / / intentionally do nothing <nl> } <nl> <nl> # else <nl>
Fix a crash of ocl program if clAmdBlas is not linked .
opencv/opencv
ea165394484460f6907c32d447003baab89eaeb4
2013-09-03T02:30:37Z
mmm a / test / test_nn . py <nl> ppp b / test / test_nn . py <nl> def test_module_to_argparse ( self ) : <nl> with self . assertRaises ( TypeError ) : <nl> net . to ( cpu , torch . tensor ( 3 , dtype = torch . long ) , non_blocking = True ) <nl> <nl> + def test_RNN_nonlinearity ( self ) : <nl> + rnn = torch . nn . RNN ( 1 , 10 ) <nl> + self . assertEqual ( rnn . nonlinearity , ' tanh ' ) <nl> + <nl> + rnn = torch . nn . RNN ( 1 , 10 , nonlinearity = ' relu ' ) <nl> + self . assertEqual ( rnn . nonlinearity , ' relu ' ) <nl> + <nl> + with self . assertRaisesRegex ( ValueError , ' Unknown nonlinearity ' ) : <nl> + rnn = torch . nn . RNN ( 1 , 10 , nonlinearity = ' garbage ' ) <nl> + <nl> def test_module_apply_inplace_op ( self ) : <nl> def add_one_inplace ( t ) : <nl> return t . add_ ( 1 . 0 ) <nl> mmm a / torch / nn / modules / rnn . py <nl> ppp b / torch / nn / modules / rnn . py <nl> class RNN ( RNNBase ) : <nl> " " " <nl> <nl> def __init__ ( self , * args , * * kwargs ) : <nl> - if ' nonlinearity ' in kwargs : <nl> - if kwargs [ ' nonlinearity ' ] = = ' tanh ' : <nl> - mode = ' RNN_TANH ' <nl> - elif kwargs [ ' nonlinearity ' ] = = ' relu ' : <nl> - mode = ' RNN_RELU ' <nl> - else : <nl> - raise ValueError ( " Unknown nonlinearity ' { } ' " . format ( <nl> - kwargs [ ' nonlinearity ' ] ) ) <nl> - del kwargs [ ' nonlinearity ' ] <nl> - else : <nl> + self . nonlinearity = kwargs . pop ( ' nonlinearity ' , ' tanh ' ) <nl> + if self . nonlinearity = = ' tanh ' : <nl> mode = ' RNN_TANH ' <nl> - <nl> + elif self . nonlinearity = = ' relu ' : <nl> + mode = ' RNN_RELU ' <nl> + else : <nl> + raise ValueError ( " Unknown nonlinearity ' { } ' " . format ( self . nonlinearity ) ) <nl> super ( RNN , self ) . __init__ ( mode , * args , * * kwargs ) <nl> <nl> <nl>
Fix RNN nonlinearity ( )
pytorch/pytorch
2e7dd5479638c2cdd6c12f7f70881bf3778f7bcd
2019-10-17T23:46:09Z
deleted file mode 100644 <nl> index d20c2297a . . 000000000 <nl> mmm a / hedley . h <nl> ppp / dev / null <nl> <nl> - / * Hedley - https : / / nemequ . github . io / hedley <nl> - * Created by Evan Nemerson < evan @ nemerson . com > <nl> - * <nl> - * To the extent possible under law , the author ( s ) have dedicated all <nl> - * copyright and related and neighboring rights to this software to <nl> - * the public domain worldwide . This software is distributed without <nl> - * any warranty . <nl> - * <nl> - * For details , see < http : / / creativecommons . org / publicdomain / zero / 1 . 0 / > . <nl> - * SPDX - License - Identifier : CC0 - 1 . 0 <nl> - * / <nl> - <nl> - # if ! defined ( HEDLEY_VERSION ) | | ( HEDLEY_VERSION < 9 ) <nl> - # if defined ( HEDLEY_VERSION ) <nl> - # undef HEDLEY_VERSION <nl> - # endif <nl> - # define HEDLEY_VERSION 9 <nl> - <nl> - # if defined ( HEDLEY_STRINGIFY_EX ) <nl> - # undef HEDLEY_STRINGIFY_EX <nl> - # endif <nl> - # define HEDLEY_STRINGIFY_EX ( x ) # x <nl> - <nl> - # if defined ( HEDLEY_STRINGIFY ) <nl> - # undef HEDLEY_STRINGIFY <nl> - # endif <nl> - # define HEDLEY_STRINGIFY ( x ) HEDLEY_STRINGIFY_EX ( x ) <nl> - <nl> - # if defined ( HEDLEY_CONCAT_EX ) <nl> - # undef HEDLEY_CONCAT_EX <nl> - # endif <nl> - # define HEDLEY_CONCAT_EX ( a , b ) a # # b <nl> - <nl> - # if defined ( HEDLEY_CONCAT ) <nl> - # undef HEDLEY_CONCAT <nl> - # endif <nl> - # define HEDLEY_CONCAT ( a , b ) HEDLEY_CONCAT_EX ( a , b ) <nl> - <nl> - # if defined ( HEDLEY_VERSION_ENCODE ) <nl> - # undef HEDLEY_VERSION_ENCODE <nl> - # endif <nl> - # define HEDLEY_VERSION_ENCODE ( major , minor , revision ) ( ( ( major ) * 1000000 ) + ( ( minor ) * 1000 ) + ( revision ) ) <nl> - <nl> - # if defined ( HEDLEY_VERSION_DECODE_MAJOR ) <nl> - # undef HEDLEY_VERSION_DECODE_MAJOR <nl> - # endif <nl> - # define HEDLEY_VERSION_DECODE_MAJOR ( version ) ( ( version ) / 1000000 ) <nl> - <nl> - # if defined ( HEDLEY_VERSION_DECODE_MINOR ) <nl> - # undef HEDLEY_VERSION_DECODE_MINOR <nl> - # endif <nl> - # define HEDLEY_VERSION_DECODE_MINOR ( version ) ( ( ( version ) % 1000000 ) / 1000 ) <nl> - <nl> - # if defined ( HEDLEY_VERSION_DECODE_REVISION ) <nl> - # undef HEDLEY_VERSION_DECODE_REVISION <nl> - # endif <nl> - # define HEDLEY_VERSION_DECODE_REVISION ( version ) ( ( version ) % 1000 ) <nl> - <nl> - # if defined ( HEDLEY_GNUC_VERSION ) <nl> - # undef HEDLEY_GNUC_VERSION <nl> - # endif <nl> - # if defined ( __GNUC__ ) & & defined ( __GNUC_PATCHLEVEL__ ) <nl> - # define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE ( __GNUC__ , __GNUC_MINOR__ , __GNUC_PATCHLEVEL__ ) <nl> - # elif defined ( __GNUC__ ) <nl> - # define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE ( __GNUC__ , __GNUC_MINOR__ , 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GNUC_VERSION_CHECK ) <nl> - # undef HEDLEY_GNUC_VERSION_CHECK <nl> - # endif <nl> - # if defined ( HEDLEY_GNUC_VERSION ) <nl> - # define HEDLEY_GNUC_VERSION_CHECK ( major , minor , patch ) ( HEDLEY_GNUC_VERSION > = HEDLEY_VERSION_ENCODE ( major , minor , patch ) ) <nl> - # else <nl> - # define HEDLEY_GNUC_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_MSVC_VERSION ) <nl> - # undef HEDLEY_MSVC_VERSION <nl> - # endif <nl> - # if defined ( _MSC_FULL_VER ) & & ( _MSC_FULL_VER > = 140000000 ) <nl> - # define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE ( _MSC_FULL_VER / 10000000 , ( _MSC_FULL_VER % 10000000 ) / 100000 , ( _MSC_FULL_VER % 100000 ) / 100 ) <nl> - # elif defined ( _MSC_FULL_VER ) <nl> - # define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE ( _MSC_FULL_VER / 1000000 , ( _MSC_FULL_VER % 1000000 ) / 10000 , ( _MSC_FULL_VER % 10000 ) / 10 ) <nl> - # elif defined ( _MSC_VER ) <nl> - # define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE ( _MSC_VER / 100 , _MSC_VER % 100 , 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_MSVC_VERSION_CHECK ) <nl> - # undef HEDLEY_MSVC_VERSION_CHECK <nl> - # endif <nl> - # if ! defined ( _MSC_VER ) <nl> - # define HEDLEY_MSVC_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # elif defined ( _MSC_VER ) & & ( _MSC_VER > = 1400 ) <nl> - # define HEDLEY_MSVC_VERSION_CHECK ( major , minor , patch ) ( _MSC_FULL_VER > = ( ( major * 10000000 ) + ( minor * 100000 ) + ( patch ) ) ) <nl> - # elif defined ( _MSC_VER ) & & ( _MSC_VER > = 1200 ) <nl> - # define HEDLEY_MSVC_VERSION_CHECK ( major , minor , patch ) ( _MSC_FULL_VER > = ( ( major * 1000000 ) + ( minor * 10000 ) + ( patch ) ) ) <nl> - # else <nl> - # define HEDLEY_MSVC_VERSION_CHECK ( major , minor , patch ) ( _MSC_VER > = ( ( major * 100 ) + ( minor ) ) ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_INTEL_VERSION ) <nl> - # undef HEDLEY_INTEL_VERSION <nl> - # endif <nl> - # if defined ( __INTEL_COMPILER ) & & defined ( __INTEL_COMPILER_UPDATE ) <nl> - # define HEDLEY_INTEL_VERSION HEDLEY_VERSION_ENCODE ( __INTEL_COMPILER / 100 , __INTEL_COMPILER % 100 , __INTEL_COMPILER_UPDATE ) <nl> - # elif defined ( __INTEL_COMPILER ) <nl> - # define HEDLEY_INTEL_VERSION HEDLEY_VERSION_ENCODE ( __INTEL_COMPILER / 100 , __INTEL_COMPILER % 100 , 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_INTEL_VERSION_CHECK ) <nl> - # undef HEDLEY_INTEL_VERSION_CHECK <nl> - # endif <nl> - # if defined ( HEDLEY_INTEL_VERSION ) <nl> - # define HEDLEY_INTEL_VERSION_CHECK ( major , minor , patch ) ( HEDLEY_INTEL_VERSION > = HEDLEY_VERSION_ENCODE ( major , minor , patch ) ) <nl> - # else <nl> - # define HEDLEY_INTEL_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_PGI_VERSION ) <nl> - # undef HEDLEY_PGI_VERSION <nl> - # endif <nl> - # if defined ( __PGI ) & & defined ( __PGIC__ ) & & defined ( __PGIC_MINOR__ ) & & defined ( __PGIC_PATCHLEVEL__ ) <nl> - # define HEDLEY_PGI_VERSION HEDLEY_VERSION_ENCODE ( __PGIC__ , __PGIC_MINOR__ , __PGIC_PATCHLEVEL__ ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_PGI_VERSION_CHECK ) <nl> - # undef HEDLEY_PGI_VERSION_CHECK <nl> - # endif <nl> - # if defined ( HEDLEY_PGI_VERSION ) <nl> - # define HEDLEY_PGI_VERSION_CHECK ( major , minor , patch ) ( HEDLEY_PGI_VERSION > = HEDLEY_VERSION_ENCODE ( major , minor , patch ) ) <nl> - # else <nl> - # define HEDLEY_PGI_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_SUNPRO_VERSION ) <nl> - # undef HEDLEY_SUNPRO_VERSION <nl> - # endif <nl> - # if defined ( __SUNPRO_C ) & & ( __SUNPRO_C > 0x1000 ) <nl> - # define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE ( ( ( ( __SUNPRO_C > > 16 ) & 0xf ) * 10 ) + ( ( __SUNPRO_C > > 12 ) & 0xf ) , ( ( ( __SUNPRO_C > > 8 ) & 0xf ) * 10 ) + ( ( __SUNPRO_C > > 4 ) & 0xf ) , ( __SUNPRO_C & 0xf ) * 10 ) <nl> - # elif defined ( __SUNPRO_C ) <nl> - # define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE ( ( __SUNPRO_C > > 8 ) & 0xf , ( __SUNPRO_C > > 4 ) & 0xf , ( __SUNPRO_C ) & 0xf ) <nl> - # elif defined ( __SUNPRO_CC ) & & ( __SUNPRO_CC > 0x1000 ) <nl> - # define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE ( ( ( ( __SUNPRO_CC > > 16 ) & 0xf ) * 10 ) + ( ( __SUNPRO_CC > > 12 ) & 0xf ) , ( ( ( __SUNPRO_CC > > 8 ) & 0xf ) * 10 ) + ( ( __SUNPRO_CC > > 4 ) & 0xf ) , ( __SUNPRO_CC & 0xf ) * 10 ) <nl> - # elif defined ( __SUNPRO_CC ) <nl> - # define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE ( ( __SUNPRO_CC > > 8 ) & 0xf , ( __SUNPRO_CC > > 4 ) & 0xf , ( __SUNPRO_CC ) & 0xf ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_SUNPRO_VERSION_CHECK ) <nl> - # undef HEDLEY_SUNPRO_VERSION_CHECK <nl> - # endif <nl> - # if defined ( HEDLEY_SUNPRO_VERSION ) <nl> - # define HEDLEY_SUNPRO_VERSION_CHECK ( major , minor , patch ) ( HEDLEY_SUNPRO_VERSION > = HEDLEY_VERSION_ENCODE ( major , minor , patch ) ) <nl> - # else <nl> - # define HEDLEY_SUNPRO_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_EMSCRIPTEN_VERSION ) <nl> - # undef HEDLEY_EMSCRIPTEN_VERSION <nl> - # endif <nl> - # if defined ( __EMSCRIPTEN__ ) <nl> - # define HEDLEY_EMSCRIPTEN_VERSION HEDLEY_VERSION_ENCODE ( __EMSCRIPTEN_major__ , __EMSCRIPTEN_minor__ , __EMSCRIPTEN_tiny__ ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_EMSCRIPTEN_VERSION_CHECK ) <nl> - # undef HEDLEY_EMSCRIPTEN_VERSION_CHECK <nl> - # endif <nl> - # if defined ( HEDLEY_EMSCRIPTEN_VERSION ) <nl> - # define HEDLEY_EMSCRIPTEN_VERSION_CHECK ( major , minor , patch ) ( HEDLEY_EMSCRIPTEN_VERSION > = HEDLEY_VERSION_ENCODE ( major , minor , patch ) ) <nl> - # else <nl> - # define HEDLEY_EMSCRIPTEN_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_ARM_VERSION ) <nl> - # undef HEDLEY_ARM_VERSION <nl> - # endif <nl> - # if defined ( __CC_ARM ) & & defined ( __ARMCOMPILER_VERSION ) <nl> - # define HEDLEY_ARM_VERSION HEDLEY_VERSION_ENCODE ( __ARMCOMPILER_VERSION / 1000000 , ( __ARMCOMPILER_VERSION % 1000000 ) / 10000 , ( __ARMCOMPILER_VERSION % 10000 ) / 100 ) <nl> - # elif defined ( __CC_ARM ) & & defined ( __ARMCC_VERSION ) <nl> - # define HEDLEY_ARM_VERSION HEDLEY_VERSION_ENCODE ( __ARMCC_VERSION / 1000000 , ( __ARMCC_VERSION % 1000000 ) / 10000 , ( __ARMCC_VERSION % 10000 ) / 100 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_ARM_VERSION_CHECK ) <nl> - # undef HEDLEY_ARM_VERSION_CHECK <nl> - # endif <nl> - # if defined ( HEDLEY_ARM_VERSION ) <nl> - # define HEDLEY_ARM_VERSION_CHECK ( major , minor , patch ) ( HEDLEY_ARM_VERSION > = HEDLEY_VERSION_ENCODE ( major , minor , patch ) ) <nl> - # else <nl> - # define HEDLEY_ARM_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_IBM_VERSION ) <nl> - # undef HEDLEY_IBM_VERSION <nl> - # endif <nl> - # if defined ( __ibmxl__ ) <nl> - # define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE ( __ibmxl_version__ , __ibmxl_release__ , __ibmxl_modification__ ) <nl> - # elif defined ( __xlC__ ) & & defined ( __xlC_ver__ ) <nl> - # define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE ( __xlC__ > > 8 , __xlC__ & 0xff , ( __xlC_ver__ > > 8 ) & 0xff ) <nl> - # elif defined ( __xlC__ ) <nl> - # define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE ( __xlC__ > > 8 , __xlC__ & 0xff , 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_IBM_VERSION_CHECK ) <nl> - # undef HEDLEY_IBM_VERSION_CHECK <nl> - # endif <nl> - # if defined ( HEDLEY_IBM_VERSION ) <nl> - # define HEDLEY_IBM_VERSION_CHECK ( major , minor , patch ) ( HEDLEY_IBM_VERSION > = HEDLEY_VERSION_ENCODE ( major , minor , patch ) ) <nl> - # else <nl> - # define HEDLEY_IBM_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_TI_VERSION ) <nl> - # undef HEDLEY_TI_VERSION <nl> - # endif <nl> - # if defined ( __TI_COMPILER_VERSION__ ) <nl> - # define HEDLEY_TI_VERSION HEDLEY_VERSION_ENCODE ( __TI_COMPILER_VERSION__ / 1000000 , ( __TI_COMPILER_VERSION__ % 1000000 ) / 1000 , ( __TI_COMPILER_VERSION__ % 1000 ) ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_TI_VERSION_CHECK ) <nl> - # undef HEDLEY_TI_VERSION_CHECK <nl> - # endif <nl> - # if defined ( HEDLEY_TI_VERSION ) <nl> - # define HEDLEY_TI_VERSION_CHECK ( major , minor , patch ) ( HEDLEY_TI_VERSION > = HEDLEY_VERSION_ENCODE ( major , minor , patch ) ) <nl> - # else <nl> - # define HEDLEY_TI_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_CRAY_VERSION ) <nl> - # undef HEDLEY_CRAY_VERSION <nl> - # endif <nl> - # if defined ( _CRAYC ) <nl> - # if defined ( _RELEASE_PATCHLEVEL ) <nl> - # define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE ( _RELEASE_MAJOR , _RELEASE_MINOR , _RELEASE_PATCHLEVEL ) <nl> - # else <nl> - # define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE ( _RELEASE_MAJOR , _RELEASE_MINOR , 0 ) <nl> - # endif <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_CRAY_VERSION_CHECK ) <nl> - # undef HEDLEY_CRAY_VERSION_CHECK <nl> - # endif <nl> - # if defined ( HEDLEY_CRAY_VERSION ) <nl> - # define HEDLEY_CRAY_VERSION_CHECK ( major , minor , patch ) ( HEDLEY_CRAY_VERSION > = HEDLEY_VERSION_ENCODE ( major , minor , patch ) ) <nl> - # else <nl> - # define HEDLEY_CRAY_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_IAR_VERSION ) <nl> - # undef HEDLEY_IAR_VERSION <nl> - # endif <nl> - # if defined ( __IAR_SYSTEMS_ICC__ ) <nl> - # if __VER__ > 1000 <nl> - # define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE ( ( __VER__ / 1000000 ) , ( ( __VER__ / 1000 ) % 1000 ) , ( __VER__ % 1000 ) ) <nl> - # else <nl> - # define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE ( VER / 100 , __VER__ % 100 , 0 ) <nl> - # endif <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_IAR_VERSION_CHECK ) <nl> - # undef HEDLEY_IAR_VERSION_CHECK <nl> - # endif <nl> - # if defined ( HEDLEY_IAR_VERSION ) <nl> - # define HEDLEY_IAR_VERSION_CHECK ( major , minor , patch ) ( HEDLEY_IAR_VERSION > = HEDLEY_VERSION_ENCODE ( major , minor , patch ) ) <nl> - # else <nl> - # define HEDLEY_IAR_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_TINYC_VERSION ) <nl> - # undef HEDLEY_TINYC_VERSION <nl> - # endif <nl> - # if defined ( __TINYC__ ) <nl> - # define HEDLEY_TINYC_VERSION HEDLEY_VERSION_ENCODE ( __TINYC__ / 1000 , ( __TINYC__ / 100 ) % 10 , __TINYC__ % 100 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_TINYC_VERSION_CHECK ) <nl> - # undef HEDLEY_TINYC_VERSION_CHECK <nl> - # endif <nl> - # if defined ( HEDLEY_TINYC_VERSION ) <nl> - # define HEDLEY_TINYC_VERSION_CHECK ( major , minor , patch ) ( HEDLEY_TINYC_VERSION > = HEDLEY_VERSION_ENCODE ( major , minor , patch ) ) <nl> - # else <nl> - # define HEDLEY_TINYC_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_DMC_VERSION ) <nl> - # undef HEDLEY_DMC_VERSION <nl> - # endif <nl> - # if defined ( __DMC__ ) <nl> - # define HEDLEY_DMC_VERSION HEDLEY_VERSION_ENCODE ( __DMC__ > > 8 , ( __DMC__ > > 4 ) & 0xf , __DMC__ & 0xf ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_DMC_VERSION_CHECK ) <nl> - # undef HEDLEY_DMC_VERSION_CHECK <nl> - # endif <nl> - # if defined ( HEDLEY_DMC_VERSION ) <nl> - # define HEDLEY_DMC_VERSION_CHECK ( major , minor , patch ) ( HEDLEY_DMC_VERSION > = HEDLEY_VERSION_ENCODE ( major , minor , patch ) ) <nl> - # else <nl> - # define HEDLEY_DMC_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_COMPCERT_VERSION ) <nl> - # undef HEDLEY_COMPCERT_VERSION <nl> - # endif <nl> - # if defined ( __COMPCERT_VERSION__ ) <nl> - # define HEDLEY_COMPCERT_VERSION HEDLEY_VERSION_ENCODE ( __COMPCERT_VERSION__ / 10000 , ( __COMPCERT_VERSION__ / 100 ) % 100 , __COMPCERT_VERSION__ % 100 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_COMPCERT_VERSION_CHECK ) <nl> - # undef HEDLEY_COMPCERT_VERSION_CHECK <nl> - # endif <nl> - # if defined ( HEDLEY_COMPCERT_VERSION ) <nl> - # define HEDLEY_COMPCERT_VERSION_CHECK ( major , minor , patch ) ( HEDLEY_COMPCERT_VERSION > = HEDLEY_VERSION_ENCODE ( major , minor , patch ) ) <nl> - # else <nl> - # define HEDLEY_COMPCERT_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_PELLES_VERSION ) <nl> - # undef HEDLEY_PELLES_VERSION <nl> - # endif <nl> - # if defined ( __POCC__ ) <nl> - # define HEDLEY_PELLES_VERSION HEDLEY_VERSION_ENCODE ( __POCC__ / 100 , __POCC__ % 100 , 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_PELLES_VERSION_CHECK ) <nl> - # undef HEDLEY_PELLES_VERSION_CHECK <nl> - # endif <nl> - # if defined ( HEDLEY_PELLES_VERSION ) <nl> - # define HEDLEY_PELLES_VERSION_CHECK ( major , minor , patch ) ( HEDLEY_PELLES_VERSION > = HEDLEY_VERSION_ENCODE ( major , minor , patch ) ) <nl> - # else <nl> - # define HEDLEY_PELLES_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GCC_VERSION ) <nl> - # undef HEDLEY_GCC_VERSION <nl> - # endif <nl> - # if \ <nl> - defined ( HEDLEY_GNUC_VERSION ) & & \ <nl> - ! defined ( __clang__ ) & & \ <nl> - ! defined ( HEDLEY_INTEL_VERSION ) & & \ <nl> - ! defined ( HEDLEY_PGI_VERSION ) & & \ <nl> - ! defined ( HEDLEY_ARM_VERSION ) & & \ <nl> - ! defined ( HEDLEY_TI_VERSION ) & & \ <nl> - ! defined ( __COMPCERT__ ) <nl> - # define HEDLEY_GCC_VERSION HEDLEY_GNUC_VERSION <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GCC_VERSION_CHECK ) <nl> - # undef HEDLEY_GCC_VERSION_CHECK <nl> - # endif <nl> - # if defined ( HEDLEY_GCC_VERSION ) <nl> - # define HEDLEY_GCC_VERSION_CHECK ( major , minor , patch ) ( HEDLEY_GCC_VERSION > = HEDLEY_VERSION_ENCODE ( major , minor , patch ) ) <nl> - # else <nl> - # define HEDLEY_GCC_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_HAS_ATTRIBUTE ) <nl> - # undef HEDLEY_HAS_ATTRIBUTE <nl> - # endif <nl> - # if defined ( __has_attribute ) <nl> - # define HEDLEY_HAS_ATTRIBUTE ( attribute ) __has_attribute ( attribute ) <nl> - # else <nl> - # define HEDLEY_HAS_ATTRIBUTE ( attribute ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GNUC_HAS_ATTRIBUTE ) <nl> - # undef HEDLEY_GNUC_HAS_ATTRIBUTE <nl> - # endif <nl> - # if defined ( __has_attribute ) <nl> - # define HEDLEY_GNUC_HAS_ATTRIBUTE ( attribute , major , minor , patch ) __has_attribute ( attribute ) <nl> - # else <nl> - # define HEDLEY_GNUC_HAS_ATTRIBUTE ( attribute , major , minor , patch ) HEDLEY_GNUC_VERSION_CHECK ( major , minor , patch ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GCC_HAS_ATTRIBUTE ) <nl> - # undef HEDLEY_GCC_HAS_ATTRIBUTE <nl> - # endif <nl> - # if defined ( __has_attribute ) <nl> - # define HEDLEY_GCC_HAS_ATTRIBUTE ( attribute , major , minor , patch ) __has_attribute ( attribute ) <nl> - # else <nl> - # define HEDLEY_GCC_HAS_ATTRIBUTE ( attribute , major , minor , patch ) HEDLEY_GCC_VERSION_CHECK ( major , minor , patch ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_HAS_CPP_ATTRIBUTE ) <nl> - # undef HEDLEY_HAS_CPP_ATTRIBUTE <nl> - # endif <nl> - # if defined ( __has_cpp_attribute ) & & defined ( __cplusplus ) <nl> - # define HEDLEY_HAS_CPP_ATTRIBUTE ( attribute ) __has_cpp_attribute ( attribute ) <nl> - # else <nl> - # define HEDLEY_HAS_CPP_ATTRIBUTE ( attribute ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GNUC_HAS_CPP_ATTRIBUTE ) <nl> - # undef HEDLEY_GNUC_HAS_CPP_ATTRIBUTE <nl> - # endif <nl> - # if defined ( __has_cpp_attribute ) & & defined ( __cplusplus ) <nl> - # define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE ( attribute , major , minor , patch ) __has_cpp_attribute ( attribute ) <nl> - # else <nl> - # define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE ( attribute , major , minor , patch ) HEDLEY_GNUC_VERSION_CHECK ( major , minor , patch ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GCC_HAS_CPP_ATTRIBUTE ) <nl> - # undef HEDLEY_GCC_HAS_CPP_ATTRIBUTE <nl> - # endif <nl> - # if defined ( __has_cpp_attribute ) & & defined ( __cplusplus ) <nl> - # define HEDLEY_GCC_HAS_CPP_ATTRIBUTE ( attribute , major , minor , patch ) __has_cpp_attribute ( attribute ) <nl> - # else <nl> - # define HEDLEY_GCC_HAS_CPP_ATTRIBUTE ( attribute , major , minor , patch ) HEDLEY_GCC_VERSION_CHECK ( major , minor , patch ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_HAS_BUILTIN ) <nl> - # undef HEDLEY_HAS_BUILTIN <nl> - # endif <nl> - # if defined ( __has_builtin ) <nl> - # define HEDLEY_HAS_BUILTIN ( builtin ) __has_builtin ( builtin ) <nl> - # else <nl> - # define HEDLEY_HAS_BUILTIN ( builtin ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GNUC_HAS_BUILTIN ) <nl> - # undef HEDLEY_GNUC_HAS_BUILTIN <nl> - # endif <nl> - # if defined ( __has_builtin ) <nl> - # define HEDLEY_GNUC_HAS_BUILTIN ( builtin , major , minor , patch ) __has_builtin ( builtin ) <nl> - # else <nl> - # define HEDLEY_GNUC_HAS_BUILTIN ( builtin , major , minor , patch ) HEDLEY_GNUC_VERSION_CHECK ( major , minor , patch ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GCC_HAS_BUILTIN ) <nl> - # undef HEDLEY_GCC_HAS_BUILTIN <nl> - # endif <nl> - # if defined ( __has_builtin ) <nl> - # define HEDLEY_GCC_HAS_BUILTIN ( builtin , major , minor , patch ) __has_builtin ( builtin ) <nl> - # else <nl> - # define HEDLEY_GCC_HAS_BUILTIN ( builtin , major , minor , patch ) HEDLEY_GCC_VERSION_CHECK ( major , minor , patch ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_HAS_FEATURE ) <nl> - # undef HEDLEY_HAS_FEATURE <nl> - # endif <nl> - # if defined ( __has_feature ) <nl> - # define HEDLEY_HAS_FEATURE ( feature ) __has_feature ( feature ) <nl> - # else <nl> - # define HEDLEY_HAS_FEATURE ( feature ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GNUC_HAS_FEATURE ) <nl> - # undef HEDLEY_GNUC_HAS_FEATURE <nl> - # endif <nl> - # if defined ( __has_feature ) <nl> - # define HEDLEY_GNUC_HAS_FEATURE ( feature , major , minor , patch ) __has_feature ( feature ) <nl> - # else <nl> - # define HEDLEY_GNUC_HAS_FEATURE ( feature , major , minor , patch ) HEDLEY_GNUC_VERSION_CHECK ( major , minor , patch ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GCC_HAS_FEATURE ) <nl> - # undef HEDLEY_GCC_HAS_FEATURE <nl> - # endif <nl> - # if defined ( __has_feature ) <nl> - # define HEDLEY_GCC_HAS_FEATURE ( feature , major , minor , patch ) __has_feature ( feature ) <nl> - # else <nl> - # define HEDLEY_GCC_HAS_FEATURE ( feature , major , minor , patch ) HEDLEY_GCC_VERSION_CHECK ( major , minor , patch ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_HAS_EXTENSION ) <nl> - # undef HEDLEY_HAS_EXTENSION <nl> - # endif <nl> - # if defined ( __has_extension ) <nl> - # define HEDLEY_HAS_EXTENSION ( extension ) __has_extension ( extension ) <nl> - # else <nl> - # define HEDLEY_HAS_EXTENSION ( extension ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GNUC_HAS_EXTENSION ) <nl> - # undef HEDLEY_GNUC_HAS_EXTENSION <nl> - # endif <nl> - # if defined ( __has_extension ) <nl> - # define HEDLEY_GNUC_HAS_EXTENSION ( extension , major , minor , patch ) __has_extension ( extension ) <nl> - # else <nl> - # define HEDLEY_GNUC_HAS_EXTENSION ( extension , major , minor , patch ) HEDLEY_GNUC_VERSION_CHECK ( major , minor , patch ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GCC_HAS_EXTENSION ) <nl> - # undef HEDLEY_GCC_HAS_EXTENSION <nl> - # endif <nl> - # if defined ( __has_extension ) <nl> - # define HEDLEY_GCC_HAS_EXTENSION ( extension , major , minor , patch ) __has_extension ( extension ) <nl> - # else <nl> - # define HEDLEY_GCC_HAS_EXTENSION ( extension , major , minor , patch ) HEDLEY_GCC_VERSION_CHECK ( major , minor , patch ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_HAS_DECLSPEC_ATTRIBUTE ) <nl> - # undef HEDLEY_HAS_DECLSPEC_ATTRIBUTE <nl> - # endif <nl> - # if defined ( __has_declspec_attribute ) <nl> - # define HEDLEY_HAS_DECLSPEC_ATTRIBUTE ( attribute ) __has_declspec_attribute ( attribute ) <nl> - # else <nl> - # define HEDLEY_HAS_DECLSPEC_ATTRIBUTE ( attribute ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE ) <nl> - # undef HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE <nl> - # endif <nl> - # if defined ( __has_declspec_attribute ) <nl> - # define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE ( attribute , major , minor , patch ) __has_declspec_attribute ( attribute ) <nl> - # else <nl> - # define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE ( attribute , major , minor , patch ) HEDLEY_GNUC_VERSION_CHECK ( major , minor , patch ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE ) <nl> - # undef HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE <nl> - # endif <nl> - # if defined ( __has_declspec_attribute ) <nl> - # define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE ( attribute , major , minor , patch ) __has_declspec_attribute ( attribute ) <nl> - # else <nl> - # define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE ( attribute , major , minor , patch ) HEDLEY_GCC_VERSION_CHECK ( major , minor , patch ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_HAS_WARNING ) <nl> - # undef HEDLEY_HAS_WARNING <nl> - # endif <nl> - # if defined ( __has_warning ) <nl> - # define HEDLEY_HAS_WARNING ( warning ) __has_warning ( warning ) <nl> - # else <nl> - # define HEDLEY_HAS_WARNING ( warning ) ( 0 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GNUC_HAS_WARNING ) <nl> - # undef HEDLEY_GNUC_HAS_WARNING <nl> - # endif <nl> - # if defined ( __has_warning ) <nl> - # define HEDLEY_GNUC_HAS_WARNING ( warning , major , minor , patch ) __has_warning ( warning ) <nl> - # else <nl> - # define HEDLEY_GNUC_HAS_WARNING ( warning , major , minor , patch ) HEDLEY_GNUC_VERSION_CHECK ( major , minor , patch ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_GCC_HAS_WARNING ) <nl> - # undef HEDLEY_GCC_HAS_WARNING <nl> - # endif <nl> - # if defined ( __has_warning ) <nl> - # define HEDLEY_GCC_HAS_WARNING ( warning , major , minor , patch ) __has_warning ( warning ) <nl> - # else <nl> - # define HEDLEY_GCC_HAS_WARNING ( warning , major , minor , patch ) HEDLEY_GCC_VERSION_CHECK ( major , minor , patch ) <nl> - # endif <nl> - <nl> - # if \ <nl> - ( defined ( __STDC_VERSION__ ) & & ( __STDC_VERSION__ > = 199901L ) ) | | \ <nl> - defined ( __clang__ ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 3 , 0 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_IAR_VERSION_CHECK ( 8 , 0 , 0 ) | | \ <nl> - HEDLEY_PGI_VERSION_CHECK ( 18 , 4 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 4 , 1 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 6 , 0 , 0 ) | | \ <nl> - HEDLEY_CRAY_VERSION_CHECK ( 5 , 0 , 0 ) | | \ <nl> - HEDLEY_TINYC_VERSION_CHECK ( 0 , 9 , 17 ) | | \ <nl> - HEDLEY_SUNPRO_VERSION_CHECK ( 8 , 0 , 0 ) | | \ <nl> - ( HEDLEY_IBM_VERSION_CHECK ( 10 , 1 , 0 ) & & defined ( __C99_PRAGMA_OPERATOR ) ) <nl> - # define HEDLEY_PRAGMA ( value ) _Pragma ( # value ) <nl> - # elif HEDLEY_MSVC_VERSION_CHECK ( 15 , 0 , 0 ) <nl> - # define HEDLEY_PRAGMA ( value ) __pragma ( value ) <nl> - # else <nl> - # define HEDLEY_PRAGMA ( value ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_DIAGNOSTIC_PUSH ) <nl> - # undef HEDLEY_DIAGNOSTIC_PUSH <nl> - # endif <nl> - # if defined ( HEDLEY_DIAGNOSTIC_POP ) <nl> - # undef HEDLEY_DIAGNOSTIC_POP <nl> - # endif <nl> - # if defined ( __clang__ ) <nl> - # define HEDLEY_DIAGNOSTIC_PUSH _Pragma ( " clang diagnostic push " ) <nl> - # define HEDLEY_DIAGNOSTIC_POP _Pragma ( " clang diagnostic pop " ) <nl> - # elif HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_PUSH _Pragma ( " warning ( push ) " ) <nl> - # define HEDLEY_DIAGNOSTIC_POP _Pragma ( " warning ( pop ) " ) <nl> - # elif HEDLEY_GCC_VERSION_CHECK ( 4 , 6 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_PUSH _Pragma ( " GCC diagnostic push " ) <nl> - # define HEDLEY_DIAGNOSTIC_POP _Pragma ( " GCC diagnostic pop " ) <nl> - # elif HEDLEY_MSVC_VERSION_CHECK ( 15 , 0 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_PUSH __pragma ( warning ( push ) ) <nl> - # define HEDLEY_DIAGNOSTIC_POP __pragma ( warning ( pop ) ) <nl> - # elif HEDLEY_ARM_VERSION_CHECK ( 5 , 6 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_PUSH _Pragma ( " push " ) <nl> - # define HEDLEY_DIAGNOSTIC_POP _Pragma ( " pop " ) <nl> - # elif HEDLEY_TI_VERSION_CHECK ( 8 , 1 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_PUSH _Pragma ( " diag_push " ) <nl> - # define HEDLEY_DIAGNOSTIC_POP _Pragma ( " diag_pop " ) <nl> - # elif HEDLEY_PELLES_VERSION_CHECK ( 2 , 90 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_PUSH _Pragma ( " warning ( push ) " ) <nl> - # define HEDLEY_DIAGNOSTIC_POP _Pragma ( " warning ( pop ) " ) <nl> - # else <nl> - # define HEDLEY_DIAGNOSTIC_PUSH <nl> - # define HEDLEY_DIAGNOSTIC_POP <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED ) <nl> - # undef HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED <nl> - # endif <nl> - # if HEDLEY_HAS_WARNING ( " - Wdeprecated - declarations " ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma ( " clang diagnostic ignored \ " - Wdeprecated - declarations \ " " ) <nl> - # elif HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma ( " warning ( disable : 1478 1786 ) " ) <nl> - # elif HEDLEY_PGI_VERSION_CHECK ( 17 , 10 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma ( " diag_suppress 1215 , 1444 " ) <nl> - # elif HEDLEY_GCC_VERSION_CHECK ( 4 , 3 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma ( " GCC diagnostic ignored \ " - Wdeprecated - declarations \ " " ) <nl> - # elif HEDLEY_MSVC_VERSION_CHECK ( 15 , 0 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma ( warning ( disable : 4996 ) ) <nl> - # elif HEDLEY_TI_VERSION_CHECK ( 8 , 0 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma ( " diag_suppress 1291 , 1718 " ) <nl> - # elif HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 13 , 0 ) & & ! defined ( __cplusplus ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma ( " error_messages ( off , E_DEPRECATED_ATT , E_DEPRECATED_ATT_MESS ) " ) <nl> - # elif HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 13 , 0 ) & & defined ( __cplusplus ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma ( " error_messages ( off , symdeprecated , symdeprecated2 ) " ) <nl> - # elif HEDLEY_IAR_VERSION_CHECK ( 8 , 0 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma ( " diag_suppress = Pe1444 , Pe1215 " ) <nl> - # elif HEDLEY_PELLES_VERSION_CHECK ( 2 , 90 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma ( " warn ( disable : 2241 ) " ) <nl> - # else <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS ) <nl> - # undef HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS <nl> - # endif <nl> - # if HEDLEY_HAS_WARNING ( " - Wunknown - pragmas " ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma ( " clang diagnostic ignored \ " - Wunknown - pragmas \ " " ) <nl> - # elif HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma ( " warning ( disable : 161 ) " ) <nl> - # elif HEDLEY_PGI_VERSION_CHECK ( 17 , 10 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma ( " diag_suppress 1675 " ) <nl> - # elif HEDLEY_GCC_VERSION_CHECK ( 4 , 3 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma ( " GCC diagnostic ignored \ " - Wunknown - pragmas \ " " ) <nl> - # elif HEDLEY_MSVC_VERSION_CHECK ( 15 , 0 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma ( warning ( disable : 4068 ) ) <nl> - # elif HEDLEY_TI_VERSION_CHECK ( 8 , 0 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma ( " diag_suppress 163 " ) <nl> - # elif HEDLEY_IAR_VERSION_CHECK ( 8 , 0 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma ( " diag_suppress = Pe161 " ) <nl> - # else <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL ) <nl> - # undef HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL <nl> - # endif <nl> - # if HEDLEY_HAS_WARNING ( " - Wcast - qual " ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma ( " clang diagnostic ignored \ " - Wcast - qual \ " " ) <nl> - # elif HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma ( " warning ( disable : 2203 2331 ) " ) <nl> - # elif HEDLEY_GCC_VERSION_CHECK ( 3 , 0 , 0 ) <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma ( " GCC diagnostic ignored \ " - Wcast - qual \ " " ) <nl> - # else <nl> - # define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_DEPRECATED ) <nl> - # undef HEDLEY_DEPRECATED <nl> - # endif <nl> - # if defined ( HEDLEY_DEPRECATED_FOR ) <nl> - # undef HEDLEY_DEPRECATED_FOR <nl> - # endif <nl> - # if defined ( __cplusplus ) & & ( __cplusplus > = 201402L ) <nl> - # define HEDLEY_DEPRECATED ( since ) [ [ deprecated ( " Since " # since ) ] ] <nl> - # define HEDLEY_DEPRECATED_FOR ( since , replacement ) [ [ deprecated ( " Since " # since " ; use " # replacement ) ] ] <nl> - # elif \ <nl> - HEDLEY_HAS_EXTENSION ( attribute_deprecated_with_message ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 4 , 5 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 5 , 6 , 0 ) | | \ <nl> - HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 13 , 0 ) | | \ <nl> - HEDLEY_PGI_VERSION_CHECK ( 17 , 10 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 8 , 3 , 0 ) <nl> - # define HEDLEY_DEPRECATED ( since ) __attribute__ ( ( __deprecated__ ( " Since " # since ) ) ) <nl> - # define HEDLEY_DEPRECATED_FOR ( since , replacement ) __attribute__ ( ( __deprecated__ ( " Since " # since " ; use " # replacement ) ) ) <nl> - # elif \ <nl> - HEDLEY_HAS_ATTRIBUTE ( deprecated ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 3 , 1 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 4 , 1 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 8 , 0 , 0 ) | | \ <nl> - ( HEDLEY_TI_VERSION_CHECK ( 7 , 3 , 0 ) & & defined ( __TI_GNU_ATTRIBUTE_SUPPORT__ ) ) <nl> - # define HEDLEY_DEPRECATED ( since ) __attribute__ ( ( __deprecated__ ) ) <nl> - # define HEDLEY_DEPRECATED_FOR ( since , replacement ) __attribute__ ( ( __deprecated__ ) ) <nl> - # elif HEDLEY_MSVC_VERSION_CHECK ( 14 , 0 , 0 ) <nl> - # define HEDLEY_DEPRECATED ( since ) __declspec ( deprecated ( " Since " # since ) ) <nl> - # define HEDLEY_DEPRECATED_FOR ( since , replacement ) __declspec ( deprecated ( " Since " # since " ; use " # replacement ) ) <nl> - # elif \ <nl> - HEDLEY_MSVC_VERSION_CHECK ( 13 , 10 , 0 ) | | \ <nl> - HEDLEY_PELLES_VERSION_CHECK ( 6 , 50 , 0 ) <nl> - # define HEDLEY_DEPRECATED ( since ) _declspec ( deprecated ) <nl> - # define HEDLEY_DEPRECATED_FOR ( since , replacement ) __declspec ( deprecated ) <nl> - # elif HEDLEY_IAR_VERSION_CHECK ( 8 , 0 , 0 ) <nl> - # define HEDLEY_DEPRECATED ( since ) _Pragma ( " deprecated " ) <nl> - # define HEDLEY_DEPRECATED_FOR ( since , replacement ) _Pragma ( " deprecated " ) <nl> - # else <nl> - # define HEDLEY_DEPRECATED ( since ) <nl> - # define HEDLEY_DEPRECATED_FOR ( since , replacement ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_UNAVAILABLE ) <nl> - # undef HEDLEY_UNAVAILABLE <nl> - # endif <nl> - # if \ <nl> - HEDLEY_HAS_ATTRIBUTE ( warning ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 4 , 3 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) <nl> - # define HEDLEY_UNAVAILABLE ( available_since ) __attribute__ ( ( __warning__ ( " Not available until " # available_since ) ) ) <nl> - # else <nl> - # define HEDLEY_UNAVAILABLE ( available_since ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_WARN_UNUSED_RESULT ) <nl> - # undef HEDLEY_WARN_UNUSED_RESULT <nl> - # endif <nl> - # if defined ( __cplusplus ) & & ( __cplusplus > = 201703L ) <nl> - # define HEDLEY_WARN_UNUSED_RESULT [ [ nodiscard ] ] <nl> - # elif \ <nl> - HEDLEY_HAS_ATTRIBUTE ( warn_unused_result ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 3 , 4 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 8 , 0 , 0 ) | | \ <nl> - ( HEDLEY_TI_VERSION_CHECK ( 7 , 3 , 0 ) & & defined ( __TI_GNU_ATTRIBUTE_SUPPORT__ ) ) | | \ <nl> - ( HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 15 , 0 ) & & defined ( __cplusplus ) ) | | \ <nl> - HEDLEY_PGI_VERSION_CHECK ( 17 , 10 , 0 ) <nl> - # define HEDLEY_WARN_UNUSED_RESULT __attribute__ ( ( __warn_unused_result__ ) ) <nl> - # elif defined ( _Check_return_ ) / * SAL * / <nl> - # define HEDLEY_WARN_UNUSED_RESULT _Check_return_ <nl> - # else <nl> - # define HEDLEY_WARN_UNUSED_RESULT <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_SENTINEL ) <nl> - # undef HEDLEY_SENTINEL <nl> - # endif <nl> - # if \ <nl> - HEDLEY_HAS_ATTRIBUTE ( sentinel ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 4 , 0 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 5 , 4 , 0 ) <nl> - # define HEDLEY_SENTINEL ( position ) __attribute__ ( ( __sentinel__ ( position ) ) ) <nl> - # else <nl> - # define HEDLEY_SENTINEL ( position ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_NO_RETURN ) <nl> - # undef HEDLEY_NO_RETURN <nl> - # endif <nl> - # if HEDLEY_IAR_VERSION_CHECK ( 8 , 0 , 0 ) <nl> - # define HEDLEY_NO_RETURN __noreturn <nl> - # elif HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) <nl> - # define HEDLEY_NO_RETURN __attribute__ ( ( __noreturn__ ) ) <nl> - # elif defined ( __STDC_VERSION__ ) & & __STDC_VERSION__ > = 201112L <nl> - # define HEDLEY_NO_RETURN _Noreturn <nl> - # elif defined ( __cplusplus ) & & ( __cplusplus > = 201103L ) <nl> - # define HEDLEY_NO_RETURN [ [ noreturn ] ] <nl> - # elif \ <nl> - HEDLEY_HAS_ATTRIBUTE ( noreturn ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 3 , 2 , 0 ) | | \ <nl> - HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 11 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 4 , 1 , 0 ) | | \ <nl> - HEDLEY_IBM_VERSION_CHECK ( 10 , 1 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 18 , 0 , 0 ) | | \ <nl> - ( HEDLEY_TI_VERSION_CHECK ( 17 , 3 , 0 ) & & defined ( __TI_GNU_ATTRIBUTE_SUPPORT__ ) ) <nl> - # define HEDLEY_NO_RETURN __attribute__ ( ( __noreturn__ ) ) <nl> - # elif HEDLEY_MSVC_VERSION_CHECK ( 13 , 10 , 0 ) <nl> - # define HEDLEY_NO_RETURN __declspec ( noreturn ) <nl> - # elif HEDLEY_TI_VERSION_CHECK ( 6 , 0 , 0 ) & & defined ( __cplusplus ) <nl> - # define HEDLEY_NO_RETURN _Pragma ( " FUNC_NEVER_RETURNS ; " ) <nl> - # elif HEDLEY_COMPCERT_VERSION_CHECK ( 3 , 2 , 0 ) <nl> - # define HEDLEY_NO_RETURN __attribute ( ( noreturn ) ) <nl> - # elif HEDLEY_PELLES_VERSION_CHECK ( 9 , 0 , 0 ) <nl> - # define HEDLEY_NO_RETURN __declspec ( noreturn ) <nl> - # else <nl> - # define HEDLEY_NO_RETURN <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_UNREACHABLE ) <nl> - # undef HEDLEY_UNREACHABLE <nl> - # endif <nl> - # if defined ( HEDLEY_UNREACHABLE_RETURN ) <nl> - # undef HEDLEY_UNREACHABLE_RETURN <nl> - # endif <nl> - # if \ <nl> - ( HEDLEY_HAS_BUILTIN ( __builtin_unreachable ) & & ( ! defined ( HEDLEY_ARM_VERSION ) ) ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 4 , 5 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_IBM_VERSION_CHECK ( 13 , 1 , 5 ) <nl> - # define HEDLEY_UNREACHABLE ( ) __builtin_unreachable ( ) <nl> - # elif HEDLEY_MSVC_VERSION_CHECK ( 13 , 10 , 0 ) <nl> - # define HEDLEY_UNREACHABLE ( ) __assume ( 0 ) <nl> - # elif HEDLEY_TI_VERSION_CHECK ( 6 , 0 , 0 ) <nl> - # if defined ( __cplusplus ) <nl> - # define HEDLEY_UNREACHABLE ( ) std : : _nassert ( 0 ) <nl> - # else <nl> - # define HEDLEY_UNREACHABLE ( ) _nassert ( 0 ) <nl> - # endif <nl> - # define HEDLEY_UNREACHABLE_RETURN ( value ) return value <nl> - # elif defined ( EXIT_FAILURE ) <nl> - # define HEDLEY_UNREACHABLE ( ) abort ( ) <nl> - # else <nl> - # define HEDLEY_UNREACHABLE ( ) <nl> - # define HEDLEY_UNREACHABLE_RETURN ( value ) return value <nl> - # endif <nl> - # if ! defined ( HEDLEY_UNREACHABLE_RETURN ) <nl> - # define HEDLEY_UNREACHABLE_RETURN ( value ) HEDLEY_UNREACHABLE ( ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_ASSUME ) <nl> - # undef HEDLEY_ASSUME <nl> - # endif <nl> - # if \ <nl> - HEDLEY_MSVC_VERSION_CHECK ( 13 , 10 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) <nl> - # define HEDLEY_ASSUME ( expr ) __assume ( expr ) <nl> - # elif HEDLEY_HAS_BUILTIN ( __builtin_assume ) <nl> - # define HEDLEY_ASSUME ( expr ) __builtin_assume ( expr ) <nl> - # elif HEDLEY_TI_VERSION_CHECK ( 6 , 0 , 0 ) <nl> - # if defined ( __cplusplus ) <nl> - # define HEDLEY_ASSUME ( expr ) std : : _nassert ( expr ) <nl> - # else <nl> - # define HEDLEY_ASSUME ( expr ) _nassert ( expr ) <nl> - # endif <nl> - # elif \ <nl> - ( HEDLEY_HAS_BUILTIN ( __builtin_unreachable ) & & ! defined ( HEDLEY_ARM_VERSION ) ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 4 , 5 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_IBM_VERSION_CHECK ( 13 , 1 , 5 ) <nl> - # define HEDLEY_ASSUME ( expr ) ( ( void ) ( ( expr ) ? 1 : ( __builtin_unreachable ( ) , 1 ) ) ) <nl> - # else <nl> - # define HEDLEY_ASSUME ( expr ) ( ( void ) ( expr ) ) <nl> - # endif <nl> - <nl> - <nl> - HEDLEY_DIAGNOSTIC_PUSH <nl> - # if \ <nl> - HEDLEY_HAS_WARNING ( " - Wvariadic - macros " ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 4 , 0 , 0 ) <nl> - # if defined ( __clang__ ) <nl> - # pragma clang diagnostic ignored " - Wvariadic - macros " <nl> - # elif defined ( HEDLEY_GCC_VERSION ) <nl> - # pragma GCC diagnostic ignored " - Wvariadic - macros " <nl> - # endif <nl> - # endif <nl> - # if defined ( HEDLEY_NON_NULL ) <nl> - # undef HEDLEY_NON_NULL <nl> - # endif <nl> - # if \ <nl> - HEDLEY_HAS_ATTRIBUTE ( nonnull ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 3 , 3 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 4 , 1 , 0 ) <nl> - # define HEDLEY_NON_NULL ( . . . ) __attribute__ ( ( __nonnull__ ( __VA_ARGS__ ) ) ) <nl> - # else <nl> - # define HEDLEY_NON_NULL ( . . . ) <nl> - # endif <nl> - HEDLEY_DIAGNOSTIC_POP <nl> - <nl> - # if defined ( HEDLEY_PRINTF_FORMAT ) <nl> - # undef HEDLEY_PRINTF_FORMAT <nl> - # endif <nl> - # if defined ( __MINGW32__ ) & & HEDLEY_GCC_HAS_ATTRIBUTE ( format , 4 , 4 , 0 ) & & ! defined ( __USE_MINGW_ANSI_STDIO ) <nl> - # define HEDLEY_PRINTF_FORMAT ( string_idx , first_to_check ) __attribute__ ( ( __format__ ( ms_printf , string_idx , first_to_check ) ) ) <nl> - # elif defined ( __MINGW32__ ) & & HEDLEY_GCC_HAS_ATTRIBUTE ( format , 4 , 4 , 0 ) & & defined ( __USE_MINGW_ANSI_STDIO ) <nl> - # define HEDLEY_PRINTF_FORMAT ( string_idx , first_to_check ) __attribute__ ( ( __format__ ( gnu_printf , string_idx , first_to_check ) ) ) <nl> - # elif \ <nl> - HEDLEY_HAS_ATTRIBUTE ( format ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 3 , 1 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 5 , 6 , 0 ) | | \ <nl> - HEDLEY_IBM_VERSION_CHECK ( 10 , 1 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 8 , 0 , 0 ) | | \ <nl> - ( HEDLEY_TI_VERSION_CHECK ( 7 , 3 , 0 ) & & defined ( __TI_GNU_ATTRIBUTE_SUPPORT__ ) ) <nl> - # define HEDLEY_PRINTF_FORMAT ( string_idx , first_to_check ) __attribute__ ( ( __format__ ( __printf__ , string_idx , first_to_check ) ) ) <nl> - # elif HEDLEY_PELLES_VERSION_CHECK ( 6 , 0 , 0 ) <nl> - # define HEDLEY_PRINTF_FORMAT ( string_idx , first_to_check ) __declspec ( vaformat ( printf , string_idx , first_to_check ) ) <nl> - # else <nl> - # define HEDLEY_PRINTF_FORMAT ( string_idx , first_to_check ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_CONSTEXPR ) <nl> - # undef HEDLEY_CONSTEXPR <nl> - # endif <nl> - # if defined ( __cplusplus ) <nl> - # if __cplusplus > = 201103L <nl> - # define HEDLEY_CONSTEXPR constexpr <nl> - # endif <nl> - # endif <nl> - # if ! defined ( HEDLEY_CONSTEXPR ) <nl> - # define HEDLEY_CONSTEXPR <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_PREDICT ) <nl> - # undef HEDLEY_PREDICT <nl> - # endif <nl> - # if defined ( HEDLEY_LIKELY ) <nl> - # undef HEDLEY_LIKELY <nl> - # endif <nl> - # if defined ( HEDLEY_UNLIKELY ) <nl> - # undef HEDLEY_UNLIKELY <nl> - # endif <nl> - # if defined ( HEDLEY_UNPREDICTABLE ) <nl> - # undef HEDLEY_UNPREDICTABLE <nl> - # endif <nl> - # if HEDLEY_HAS_BUILTIN ( __builtin_unpredictable ) <nl> - # define HEDLEY_UNPREDICTABLE ( expr ) __builtin_unpredictable ( ! ! ( expr ) ) <nl> - # endif <nl> - # if \ <nl> - HEDLEY_HAS_BUILTIN ( __builtin_expect_with_probability ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 9 , 0 , 0 ) <nl> - # define HEDLEY_PREDICT ( expr , value , probability ) __builtin_expect_with_probability ( expr , value , probability ) <nl> - # define HEDLEY_PREDICT_TRUE ( expr , probability ) __builtin_expect_with_probability ( ! ! ( expr ) , 1 , probability ) <nl> - # define HEDLEY_PREDICT_FALSE ( expr , probability ) __builtin_expect_with_probability ( ! ! ( expr ) , 0 , probability ) <nl> - # define HEDLEY_LIKELY ( expr ) __builtin_expect ( ! ! ( expr ) , 1 ) <nl> - # define HEDLEY_UNLIKELY ( expr ) __builtin_expect ( ! ! ( expr ) , 0 ) <nl> - # if ! defined ( HEDLEY_BUILTIN_UNPREDICTABLE ) <nl> - # define HEDLEY_BUILTIN_UNPREDICTABLE ( expr ) __builtin_expect_with_probability ( ! ! ( expr ) , 1 , 0 . 5 ) <nl> - # endif <nl> - # elif \ <nl> - HEDLEY_HAS_BUILTIN ( __builtin_expect ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 3 , 0 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - ( HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 15 , 0 ) & & defined ( __cplusplus ) ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 4 , 1 , 0 ) | | \ <nl> - HEDLEY_IBM_VERSION_CHECK ( 10 , 1 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 6 , 1 , 0 ) | | \ <nl> - HEDLEY_TINYC_VERSION_CHECK ( 0 , 9 , 27 ) <nl> - # define HEDLEY_PREDICT ( expr , expected , probability ) \ <nl> - ( ( ( probability ) > = 0 . 9 ) ? __builtin_expect ( ! ! ( expr ) , ( expected ) ) : ( ( ( void ) ( expected ) ) , ! ! ( expr ) ) ) <nl> - # define HEDLEY_PREDICT_TRUE ( expr , probability ) \ <nl> - ( __extension__ ( { \ <nl> - HEDLEY_CONSTEXPR double hedley_probability_ = ( probability ) ; \ <nl> - ( ( hedley_probability_ > = 0 . 9 ) ? __builtin_expect ( ! ! ( expr ) , 1 ) : ( ( hedley_probability_ < = 0 . 1 ) ? __builtin_expect ( ! ! ( expr ) , 0 ) : ! ! ( expr ) ) ) ; \ <nl> - } ) ) <nl> - # define HEDLEY_PREDICT_FALSE ( expr , probability ) \ <nl> - ( __extension__ ( { \ <nl> - HEDLEY_CONSTEXPR double hedley_probability_ = ( probability ) ; \ <nl> - ( ( hedley_probability_ > = 0 . 9 ) ? __builtin_expect ( ! ! ( expr ) , 0 ) : ( ( hedley_probability_ < = 0 . 1 ) ? __builtin_expect ( ! ! ( expr ) , 1 ) : ! ! ( expr ) ) ) ; \ <nl> - } ) ) <nl> - # define HEDLEY_LIKELY ( expr ) __builtin_expect ( ! ! ( expr ) , 1 ) <nl> - # define HEDLEY_UNLIKELY ( expr ) __builtin_expect ( ! ! ( expr ) , 0 ) <nl> - # else <nl> - # define HEDLEY_PREDICT ( expr , expected , probability ) ( ( ( void ) ( expected ) ) , ! ! ( expr ) ) <nl> - # define HEDLEY_PREDICT_TRUE ( expr , probability ) ( ! ! ( expr ) ) <nl> - # define HEDLEY_PREDICT_FALSE ( expr , probability ) ( ! ! ( expr ) ) <nl> - # define HEDLEY_LIKELY ( expr ) ( ! ! ( expr ) ) <nl> - # define HEDLEY_UNLIKELY ( expr ) ( ! ! ( expr ) ) <nl> - # endif <nl> - # if ! defined ( HEDLEY_UNPREDICTABLE ) <nl> - # define HEDLEY_UNPREDICTABLE ( expr ) HEDLEY_PREDICT ( expr , 1 , 0 . 5 ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_MALLOC ) <nl> - # undef HEDLEY_MALLOC <nl> - # endif <nl> - # if \ <nl> - HEDLEY_HAS_ATTRIBUTE ( malloc ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 3 , 1 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 11 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 4 , 1 , 0 ) | | \ <nl> - HEDLEY_IBM_VERSION_CHECK ( 12 , 1 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 8 , 0 , 0 ) | | \ <nl> - ( HEDLEY_TI_VERSION_CHECK ( 7 , 3 , 0 ) & & defined ( __TI_GNU_ATTRIBUTE_SUPPORT__ ) ) <nl> - # define HEDLEY_MALLOC __attribute__ ( ( __malloc__ ) ) <nl> - # elif HEDLEY_MSVC_VERSION_CHECK ( 14 , 0 , 0 ) <nl> - # define HEDLEY_MALLOC __declspec ( restrict ) <nl> - # else <nl> - # define HEDLEY_MALLOC <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_PURE ) <nl> - # undef HEDLEY_PURE <nl> - # endif <nl> - # if \ <nl> - HEDLEY_HAS_ATTRIBUTE ( pure ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 2 , 96 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 11 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 4 , 1 , 0 ) | | \ <nl> - HEDLEY_IBM_VERSION_CHECK ( 10 , 1 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 8 , 0 , 0 ) | | \ <nl> - ( HEDLEY_TI_VERSION_CHECK ( 7 , 3 , 0 ) & & defined ( __TI_GNU_ATTRIBUTE_SUPPORT__ ) ) | | \ <nl> - HEDLEY_PGI_VERSION_CHECK ( 17 , 10 , 0 ) <nl> - # define HEDLEY_PURE __attribute__ ( ( __pure__ ) ) <nl> - # elif HEDLEY_TI_VERSION_CHECK ( 6 , 0 , 0 ) & & defined ( __cplusplus ) <nl> - # define HEDLEY_PURE _Pragma ( " FUNC_IS_PURE ; " ) <nl> - # else <nl> - # define HEDLEY_PURE <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_CONST ) <nl> - # undef HEDLEY_CONST <nl> - # endif <nl> - # if \ <nl> - HEDLEY_HAS_ATTRIBUTE ( const ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 2 , 5 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 11 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 4 , 1 , 0 ) | | \ <nl> - HEDLEY_IBM_VERSION_CHECK ( 10 , 1 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 8 , 0 , 0 ) | | \ <nl> - ( HEDLEY_TI_VERSION_CHECK ( 7 , 3 , 0 ) & & defined ( __TI_GNU_ATTRIBUTE_SUPPORT__ ) ) | | \ <nl> - HEDLEY_PGI_VERSION_CHECK ( 17 , 10 , 0 ) <nl> - # define HEDLEY_CONST __attribute__ ( ( __const__ ) ) <nl> - # else <nl> - # define HEDLEY_CONST HEDLEY_PURE <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_RESTRICT ) <nl> - # undef HEDLEY_RESTRICT <nl> - # endif <nl> - # if defined ( __STDC_VERSION__ ) & & ( __STDC_VERSION__ > = 199901L ) & & ! defined ( __cplusplus ) <nl> - # define HEDLEY_RESTRICT restrict <nl> - # elif \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 3 , 1 , 0 ) | | \ <nl> - HEDLEY_MSVC_VERSION_CHECK ( 14 , 0 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 4 , 1 , 0 ) | | \ <nl> - HEDLEY_IBM_VERSION_CHECK ( 10 , 1 , 0 ) | | \ <nl> - HEDLEY_PGI_VERSION_CHECK ( 17 , 10 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 8 , 0 , 0 ) | | \ <nl> - ( HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 14 , 0 ) & & defined ( __cplusplus ) ) | | \ <nl> - HEDLEY_IAR_VERSION_CHECK ( 8 , 0 , 0 ) | | \ <nl> - defined ( __clang__ ) <nl> - # define HEDLEY_RESTRICT __restrict <nl> - # elif HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 3 , 0 ) & & ! defined ( __cplusplus ) <nl> - # define HEDLEY_RESTRICT _Restrict <nl> - # else <nl> - # define HEDLEY_RESTRICT <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_INLINE ) <nl> - # undef HEDLEY_INLINE <nl> - # endif <nl> - # if \ <nl> - ( defined ( __STDC_VERSION__ ) & & ( __STDC_VERSION__ > = 199901L ) ) | | \ <nl> - ( defined ( __cplusplus ) & & ( __cplusplus > = 199711L ) ) <nl> - # define HEDLEY_INLINE inline <nl> - # elif \ <nl> - defined ( HEDLEY_GCC_VERSION ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 6 , 2 , 0 ) <nl> - # define HEDLEY_INLINE __inline__ <nl> - # elif \ <nl> - HEDLEY_MSVC_VERSION_CHECK ( 12 , 0 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 4 , 1 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 8 , 0 , 0 ) <nl> - # define HEDLEY_INLINE __inline <nl> - # else <nl> - # define HEDLEY_INLINE <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_ALWAYS_INLINE ) <nl> - # undef HEDLEY_ALWAYS_INLINE <nl> - # endif <nl> - # if \ <nl> - HEDLEY_HAS_ATTRIBUTE ( always_inline ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 4 , 0 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 11 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 4 , 1 , 0 ) | | \ <nl> - HEDLEY_IBM_VERSION_CHECK ( 10 , 1 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 8 , 0 , 0 ) | | \ <nl> - ( HEDLEY_TI_VERSION_CHECK ( 7 , 3 , 0 ) & & defined ( __TI_GNU_ATTRIBUTE_SUPPORT__ ) ) <nl> - # define HEDLEY_ALWAYS_INLINE __attribute__ ( ( __always_inline__ ) ) HEDLEY_INLINE <nl> - # elif HEDLEY_MSVC_VERSION_CHECK ( 12 , 0 , 0 ) <nl> - # define HEDLEY_ALWAYS_INLINE __forceinline <nl> - # elif HEDLEY_TI_VERSION_CHECK ( 7 , 0 , 0 ) & & defined ( __cplusplus ) <nl> - # define HEDLEY_ALWAYS_INLINE _Pragma ( " FUNC_ALWAYS_INLINE ; " ) <nl> - # elif HEDLEY_IAR_VERSION_CHECK ( 8 , 0 , 0 ) <nl> - # define HEDLEY_ALWAYS_INLINE _Pragma ( " inline = forced " ) <nl> - # else <nl> - # define HEDLEY_ALWAYS_INLINE HEDLEY_INLINE <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_NEVER_INLINE ) <nl> - # undef HEDLEY_NEVER_INLINE <nl> - # endif <nl> - # if \ <nl> - HEDLEY_HAS_ATTRIBUTE ( noinline ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 4 , 0 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 11 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 4 , 1 , 0 ) | | \ <nl> - HEDLEY_IBM_VERSION_CHECK ( 10 , 1 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 8 , 0 , 0 ) | | \ <nl> - ( HEDLEY_TI_VERSION_CHECK ( 7 , 3 , 0 ) & & defined ( __TI_GNU_ATTRIBUTE_SUPPORT__ ) ) <nl> - # define HEDLEY_NEVER_INLINE __attribute__ ( ( __noinline__ ) ) <nl> - # elif HEDLEY_MSVC_VERSION_CHECK ( 13 , 10 , 0 ) <nl> - # define HEDLEY_NEVER_INLINE __declspec ( noinline ) <nl> - # elif HEDLEY_PGI_VERSION_CHECK ( 10 , 2 , 0 ) <nl> - # define HEDLEY_NEVER_INLINE _Pragma ( " noinline " ) <nl> - # elif HEDLEY_TI_VERSION_CHECK ( 6 , 0 , 0 ) & & defined ( __cplusplus ) <nl> - # define HEDLEY_NEVER_INLINE _Pragma ( " FUNC_CANNOT_INLINE ; " ) <nl> - # elif HEDLEY_IAR_VERSION_CHECK ( 8 , 0 , 0 ) <nl> - # define HEDLEY_NEVER_INLINE _Pragma ( " inline = never " ) <nl> - # elif HEDLEY_COMPCERT_VERSION_CHECK ( 3 , 2 , 0 ) <nl> - # define HEDLEY_NEVER_INLINE __attribute ( ( noinline ) ) <nl> - # elif HEDLEY_PELLES_VERSION_CHECK ( 9 , 0 , 0 ) <nl> - # define HEDLEY_NEVER_INLINE __declspec ( noinline ) <nl> - # else <nl> - # define HEDLEY_NEVER_INLINE <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_PRIVATE ) <nl> - # undef HEDLEY_PRIVATE <nl> - # endif <nl> - # if defined ( HEDLEY_PUBLIC ) <nl> - # undef HEDLEY_PUBLIC <nl> - # endif <nl> - # if defined ( HEDLEY_IMPORT ) <nl> - # undef HEDLEY_IMPORT <nl> - # endif <nl> - # if defined ( _WIN32 ) | | defined ( __CYGWIN__ ) <nl> - # define HEDLEY_PRIVATE <nl> - # define HEDLEY_PUBLIC __declspec ( dllexport ) <nl> - # define HEDLEY_IMPORT __declspec ( dllimport ) <nl> - # else <nl> - # if \ <nl> - HEDLEY_HAS_ATTRIBUTE ( visibility ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 3 , 3 , 0 ) | | \ <nl> - HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 11 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 4 , 1 , 0 ) | | \ <nl> - HEDLEY_IBM_VERSION_CHECK ( 13 , 1 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 8 , 0 , 0 ) | | \ <nl> - ( HEDLEY_TI_VERSION_CHECK ( 7 , 3 , 0 ) & & defined ( __TI_EABI__ ) & & defined ( __TI_GNU_ATTRIBUTE_SUPPORT__ ) ) <nl> - # define HEDLEY_PRIVATE __attribute__ ( ( __visibility__ ( " hidden " ) ) ) <nl> - # define HEDLEY_PUBLIC __attribute__ ( ( __visibility__ ( " default " ) ) ) <nl> - # else <nl> - # define HEDLEY_PRIVATE <nl> - # define HEDLEY_PUBLIC <nl> - # endif <nl> - # define HEDLEY_IMPORT extern <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_NO_THROW ) <nl> - # undef HEDLEY_NO_THROW <nl> - # endif <nl> - # if \ <nl> - HEDLEY_HAS_ATTRIBUTE ( nothrow ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 3 , 3 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) <nl> - # define HEDLEY_NO_THROW __attribute__ ( ( __nothrow__ ) ) <nl> - # elif \ <nl> - HEDLEY_MSVC_VERSION_CHECK ( 13 , 1 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 4 , 1 , 0 ) <nl> - # define HEDLEY_NO_THROW __declspec ( nothrow ) <nl> - # else <nl> - # define HEDLEY_NO_THROW <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_FALL_THROUGH ) <nl> - # undef HEDLEY_FALL_THROUGH <nl> - # endif <nl> - # if \ <nl> - defined ( __cplusplus ) & & \ <nl> - ( ! defined ( HEDLEY_SUNPRO_VERSION ) | | HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 15 , 0 ) ) & & \ <nl> - ! defined ( HEDLEY_PGI_VERSION ) <nl> - # if \ <nl> - ( __cplusplus > = 201703L ) | | \ <nl> - ( ( __cplusplus > = 201103L ) & & HEDLEY_HAS_CPP_ATTRIBUTE ( fallthrough ) ) <nl> - # define HEDLEY_FALL_THROUGH [ [ fallthrough ] ] <nl> - # elif ( __cplusplus > = 201103L ) & & HEDLEY_HAS_CPP_ATTRIBUTE ( clang : : fallthrough ) <nl> - # define HEDLEY_FALL_THROUGH [ [ clang : : fallthrough ] ] <nl> - # elif ( __cplusplus > = 201103L ) & & HEDLEY_GCC_VERSION_CHECK ( 7 , 0 , 0 ) <nl> - # define HEDLEY_FALL_THROUGH [ [ gnu : : fallthrough ] ] <nl> - # endif <nl> - # endif <nl> - # if ! defined ( HEDLEY_FALL_THROUGH ) <nl> - # if HEDLEY_GNUC_HAS_ATTRIBUTE ( fallthrough , 7 , 0 , 0 ) & & ! defined ( HEDLEY_PGI_VERSION ) <nl> - # define HEDLEY_FALL_THROUGH __attribute__ ( ( __fallthrough__ ) ) <nl> - # elif defined ( __fallthrough ) / * SAL * / <nl> - # define HEDLEY_FALL_THROUGH __fallthrough <nl> - # else <nl> - # define HEDLEY_FALL_THROUGH <nl> - # endif <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_RETURNS_NON_NULL ) <nl> - # undef HEDLEY_RETURNS_NON_NULL <nl> - # endif <nl> - # if \ <nl> - HEDLEY_HAS_ATTRIBUTE ( returns_nonnull ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 4 , 9 , 0 ) <nl> - # define HEDLEY_RETURNS_NON_NULL __attribute__ ( ( __returns_nonnull__ ) ) <nl> - # elif defined ( _Ret_notnull_ ) / * SAL * / <nl> - # define HEDLEY_RETURNS_NON_NULL _Ret_notnull_ <nl> - # else <nl> - # define HEDLEY_RETURNS_NON_NULL <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_ARRAY_PARAM ) <nl> - # undef HEDLEY_ARRAY_PARAM <nl> - # endif <nl> - # if \ <nl> - defined ( __STDC_VERSION__ ) & & ( __STDC_VERSION__ > = 199901L ) & & \ <nl> - ! defined ( __STDC_NO_VLA__ ) & & \ <nl> - ! defined ( __cplusplus ) & & \ <nl> - ! defined ( HEDLEY_PGI_VERSION ) & & \ <nl> - ! defined ( HEDLEY_TINYC_VERSION ) <nl> - # define HEDLEY_ARRAY_PARAM ( name ) ( name ) <nl> - # else <nl> - # define HEDLEY_ARRAY_PARAM ( name ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_IS_CONSTANT ) <nl> - # undef HEDLEY_IS_CONSTANT <nl> - # endif <nl> - # if defined ( HEDLEY_REQUIRE_CONSTEXPR ) <nl> - # undef HEDLEY_REQUIRE_CONSTEXPR <nl> - # endif <nl> - / * Note the double - underscore . For internal use only ; no API <nl> - * guarantees ! * / <nl> - # if defined ( HEDLEY__IS_CONSTEXPR ) <nl> - # undef HEDLEY__IS_CONSTEXPR <nl> - # endif <nl> - <nl> - # if \ <nl> - HEDLEY_HAS_BUILTIN ( __builtin_constant_p ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 3 , 4 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_TINYC_VERSION_CHECK ( 0 , 9 , 19 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 4 , 1 , 0 ) | | \ <nl> - HEDLEY_IBM_VERSION_CHECK ( 13 , 1 , 0 ) | | \ <nl> - HEDLEY_TI_VERSION_CHECK ( 6 , 1 , 0 ) | | \ <nl> - HEDLEY_SUNPRO_VERSION_CHECK ( 5 , 10 , 0 ) | | \ <nl> - HEDLEY_CRAY_VERSION_CHECK ( 8 , 1 , 0 ) <nl> - # define HEDLEY_IS_CONSTANT ( expr ) __builtin_constant_p ( expr ) <nl> - # endif <nl> - # if ! defined ( __cplusplus ) <nl> - # if \ <nl> - HEDLEY_HAS_BUILTIN ( __builtin_types_compatible_p ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 3 , 4 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - HEDLEY_IBM_VERSION_CHECK ( 13 , 1 , 0 ) | | \ <nl> - HEDLEY_CRAY_VERSION_CHECK ( 8 , 1 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 5 , 4 , 0 ) | | \ <nl> - HEDLEY_TINYC_VERSION_CHECK ( 0 , 9 , 24 ) <nl> - # if defined ( __INTPTR_TYPE__ ) <nl> - # define HEDLEY__IS_CONSTEXPR ( expr ) __builtin_types_compatible_p ( __typeof__ ( ( 1 ? ( void * ) ( ( __INTPTR_TYPE__ ) ( ( expr ) * 0 ) ) : ( int * ) 0 ) ) , int * ) <nl> - # else <nl> - # include < stdint . h > <nl> - # define HEDLEY__IS_CONSTEXPR ( expr ) __builtin_types_compatible_p ( __typeof__ ( ( 1 ? ( void * ) ( ( intptr_t ) ( ( expr ) * 0 ) ) : ( int * ) 0 ) ) , int * ) <nl> - # endif <nl> - # elif \ <nl> - ( defined ( __STDC_VERSION__ ) & & ( __STDC_VERSION__ > = 201112L ) & & ! defined ( HEDLEY_SUNPRO_VERSION ) & & ! defined ( HEDLEY_PGI_VERSION ) ) | | \ <nl> - HEDLEY_HAS_EXTENSION ( c_generic_selections ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 4 , 9 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 17 , 0 , 0 ) | | \ <nl> - HEDLEY_IBM_VERSION_CHECK ( 12 , 1 , 0 ) | | \ <nl> - HEDLEY_ARM_VERSION_CHECK ( 5 , 3 , 0 ) <nl> - # if defined ( __INTPTR_TYPE__ ) <nl> - # define HEDLEY__IS_CONSTEXPR ( expr ) _Generic ( ( 1 ? ( void * ) ( ( __INTPTR_TYPE__ ) ( ( expr ) * 0 ) ) : ( int * ) 0 ) , int * : 1 , void * : 0 ) <nl> - # else <nl> - # include < stdint . h > <nl> - # define HEDLEY__IS_CONSTEXPR ( expr ) _Generic ( ( 1 ? ( void * ) ( ( intptr_t ) * 0 ) : ( int * ) 0 ) , int * : 1 , void * : 0 ) <nl> - # endif <nl> - # elif \ <nl> - defined ( HEDLEY_GCC_VERSION ) | | \ <nl> - defined ( HEDLEY_INTEL_VERSION ) | | \ <nl> - defined ( HEDLEY_TINYC_VERSION ) | | \ <nl> - defined ( HEDLEY_TI_VERSION ) | | \ <nl> - defined ( __clang__ ) <nl> - # define HEDLEY__IS_CONSTEXPR ( expr ) ( \ <nl> - sizeof ( void ) ! = \ <nl> - sizeof ( * ( \ <nl> - 1 ? \ <nl> - ( ( void * ) ( ( expr ) * 0L ) ) : \ <nl> - ( ( struct { char v [ sizeof ( void ) * 2 ] ; } * ) 1 ) \ <nl> - ) \ <nl> - ) \ <nl> - ) <nl> - # endif <nl> - # endif <nl> - # if defined ( HEDLEY__IS_CONSTEXPR ) <nl> - # if ! defined ( HEDLEY_IS_CONSTANT ) <nl> - # define HEDLEY_IS_CONSTANT ( expr ) HEDLEY__IS_CONSTEXPR ( expr ) <nl> - # endif <nl> - # define HEDLEY_REQUIRE_CONSTEXPR ( expr ) ( HEDLEY__IS_CONSTEXPR ( expr ) ? ( expr ) : ( - 1 ) ) <nl> - # else <nl> - # if ! defined ( HEDLEY_IS_CONSTANT ) <nl> - # define HEDLEY_IS_CONSTANT ( expr ) ( 0 ) <nl> - # endif <nl> - # define HEDLEY_REQUIRE_CONSTEXPR ( expr ) ( expr ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_BEGIN_C_DECLS ) <nl> - # undef HEDLEY_BEGIN_C_DECLS <nl> - # endif <nl> - # if defined ( HEDLEY_END_C_DECLS ) <nl> - # undef HEDLEY_END_C_DECLS <nl> - # endif <nl> - # if defined ( HEDLEY_C_DECL ) <nl> - # undef HEDLEY_C_DECL <nl> - # endif <nl> - # if defined ( __cplusplus ) <nl> - # define HEDLEY_BEGIN_C_DECLS extern " C " { <nl> - # define HEDLEY_END_C_DECLS } <nl> - # define HEDLEY_C_DECL extern " C " <nl> - # else <nl> - # define HEDLEY_BEGIN_C_DECLS <nl> - # define HEDLEY_END_C_DECLS <nl> - # define HEDLEY_C_DECL <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_STATIC_ASSERT ) <nl> - # undef HEDLEY_STATIC_ASSERT <nl> - # endif <nl> - # if \ <nl> - ! defined ( __cplusplus ) & & ( \ <nl> - ( defined ( __STDC_VERSION__ ) & & ( __STDC_VERSION__ > = 201112L ) ) | | \ <nl> - HEDLEY_HAS_FEATURE ( c_static_assert ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 6 , 0 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) | | \ <nl> - defined ( _Static_assert ) \ <nl> - ) <nl> - # define HEDLEY_STATIC_ASSERT ( expr , message ) _Static_assert ( expr , message ) <nl> - # elif \ <nl> - ( defined ( __cplusplus ) & & ( __cplusplus > = 201703L ) ) | | \ <nl> - HEDLEY_MSVC_VERSION_CHECK ( 16 , 0 , 0 ) | | \ <nl> - ( defined ( __cplusplus ) & & HEDLEY_TI_VERSION_CHECK ( 8 , 3 , 0 ) ) <nl> - # define HEDLEY_STATIC_ASSERT ( expr , message ) static_assert ( expr , message ) <nl> - # elif defined ( __cplusplus ) & & ( __cplusplus > = 201103L ) <nl> - # define HEDLEY_STATIC_ASSERT ( expr , message ) static_assert ( expr ) <nl> - # else <nl> - # define HEDLEY_STATIC_ASSERT ( expr , message ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_CONST_CAST ) <nl> - # undef HEDLEY_CONST_CAST <nl> - # endif <nl> - # if defined ( __cplusplus ) <nl> - # define HEDLEY_CONST_CAST ( T , expr ) ( const_cast < T > ( expr ) ) <nl> - # elif \ <nl> - HEDLEY_HAS_WARNING ( " - Wcast - qual " ) | | \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 4 , 6 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) <nl> - # define HEDLEY_CONST_CAST ( T , expr ) ( __extension__ ( { \ <nl> - HEDLEY_DIAGNOSTIC_PUSH \ <nl> - HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ <nl> - ( ( T ) ( expr ) ) ; \ <nl> - HEDLEY_DIAGNOSTIC_POP \ <nl> - } ) ) <nl> - # else <nl> - # define HEDLEY_CONST_CAST ( T , expr ) ( ( T ) ( expr ) ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_REINTERPRET_CAST ) <nl> - # undef HEDLEY_REINTERPRET_CAST <nl> - # endif <nl> - # if defined ( __cplusplus ) <nl> - # define HEDLEY_REINTERPRET_CAST ( T , expr ) ( reinterpret_cast < T > ( expr ) ) <nl> - # else <nl> - # define HEDLEY_REINTERPRET_CAST ( T , expr ) ( * ( ( T * ) & ( expr ) ) ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_STATIC_CAST ) <nl> - # undef HEDLEY_STATIC_CAST <nl> - # endif <nl> - # if defined ( __cplusplus ) <nl> - # define HEDLEY_STATIC_CAST ( T , expr ) ( static_cast < T > ( expr ) ) <nl> - # else <nl> - # define HEDLEY_STATIC_CAST ( T , expr ) ( ( T ) ( expr ) ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_CPP_CAST ) <nl> - # undef HEDLEY_CPP_CAST <nl> - # endif <nl> - # if defined ( __cplusplus ) <nl> - # define HEDLEY_CPP_CAST ( T , expr ) static_cast < T > ( expr ) <nl> - # else <nl> - # define HEDLEY_CPP_CAST ( T , expr ) ( expr ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_MESSAGE ) <nl> - # undef HEDLEY_MESSAGE <nl> - # endif <nl> - # if HEDLEY_HAS_WARNING ( " - Wunknown - pragmas " ) <nl> - # define HEDLEY_MESSAGE ( msg ) \ <nl> - HEDLEY_DIAGNOSTIC_PUSH \ <nl> - HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ <nl> - HEDLEY_PRAGMA ( message msg ) \ <nl> - HEDLEY_DIAGNOSTIC_POP <nl> - # elif \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 4 , 4 , 0 ) | | \ <nl> - HEDLEY_INTEL_VERSION_CHECK ( 13 , 0 , 0 ) <nl> - # define HEDLEY_MESSAGE ( msg ) HEDLEY_PRAGMA ( message msg ) <nl> - # elif HEDLEY_CRAY_VERSION_CHECK ( 5 , 0 , 0 ) <nl> - # define HEDLEY_MESSAGE ( msg ) HEDLEY_PRAGMA ( _CRI message msg ) <nl> - # elif HEDLEY_IAR_VERSION_CHECK ( 8 , 0 , 0 ) <nl> - # define HEDLEY_MESSAGE ( msg ) HEDLEY_PRAGMA ( message ( msg ) ) <nl> - # elif HEDLEY_PELLES_VERSION_CHECK ( 2 , 0 , 0 ) <nl> - # define HEDLEY_MESSAGE ( msg ) HEDLEY_PRAGMA ( message ( msg ) ) <nl> - # else <nl> - # define HEDLEY_MESSAGE ( msg ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_WARNING ) <nl> - # undef HEDLEY_WARNING <nl> - # endif <nl> - # if HEDLEY_HAS_WARNING ( " - Wunknown - pragmas " ) <nl> - # define HEDLEY_WARNING ( msg ) \ <nl> - HEDLEY_DIAGNOSTIC_PUSH \ <nl> - HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ <nl> - HEDLEY_PRAGMA ( clang warning msg ) \ <nl> - HEDLEY_DIAGNOSTIC_POP <nl> - # elif \ <nl> - HEDLEY_GCC_VERSION_CHECK ( 4 , 8 , 0 ) | | \ <nl> - HEDLEY_PGI_VERSION_CHECK ( 18 , 4 , 0 ) <nl> - # define HEDLEY_WARNING ( msg ) HEDLEY_PRAGMA ( GCC warning msg ) <nl> - # elif HEDLEY_MSVC_VERSION_CHECK ( 15 , 0 , 0 ) <nl> - # define HEDLEY_WARNING ( msg ) HEDLEY_PRAGMA ( message ( msg ) ) <nl> - # else <nl> - # define HEDLEY_WARNING ( msg ) HEDLEY_MESSAGE ( msg ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_REQUIRE_MSG ) <nl> - # undef HEDLEY_REQUIRE_MSG <nl> - # endif <nl> - # if HEDLEY_HAS_ATTRIBUTE ( diagnose_if ) <nl> - # if HEDLEY_HAS_WARNING ( " - Wgcc - compat " ) <nl> - # define HEDLEY_REQUIRE_MSG ( expr , msg ) \ <nl> - HEDLEY_DIAGNOSTIC_PUSH \ <nl> - _Pragma ( " clang diagnostic ignored \ " - Wgcc - compat \ " " ) \ <nl> - __attribute__ ( ( __diagnose_if__ ( ! ( expr ) , msg , " error " ) ) ) \ <nl> - HEDLEY_DIAGNOSTIC_POP <nl> - # else <nl> - # define HEDLEY_REQUIRE_MSG ( expr , msg ) __attribute__ ( ( __diagnose_if__ ( ! ( expr ) , msg , " error " ) ) ) <nl> - # endif <nl> - # else <nl> - # define HEDLEY_REQUIRE_MSG ( expr , msg ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_REQUIRE ) <nl> - # undef HEDLEY_REQUIRE <nl> - # endif <nl> - # define HEDLEY_REQUIRE ( expr ) HEDLEY_REQUIRE_MSG ( expr , # expr ) <nl> - <nl> - # if defined ( HEDLEY_FLAGS ) <nl> - # undef HEDLEY_FLAGS <nl> - # endif <nl> - # if HEDLEY_HAS_ATTRIBUTE ( flag_enum ) <nl> - # define HEDLEY_FLAGS __attribute__ ( ( __flag_enum__ ) ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_FLAGS_CAST ) <nl> - # undef HEDLEY_FLAGS_CAST <nl> - # endif <nl> - # if HEDLEY_INTEL_VERSION_CHECK ( 19 , 0 , 0 ) <nl> - # define HEDLEY_FLAGS_CAST ( T , expr ) ( __extension__ ( { \ <nl> - HEDLEY_DIAGNOSTIC_PUSH \ <nl> - _Pragma ( " warning ( disable : 188 ) " ) \ <nl> - ( ( T ) ( expr ) ) ; \ <nl> - HEDLEY_DIAGNOSTIC_POP \ <nl> - } ) ) <nl> - # else <nl> - # define HEDLEY_FLAGS_CAST ( T , expr ) HEDLEY_STATIC_CAST ( T , expr ) <nl> - # endif <nl> - <nl> - / * Remaining macros are deprecated . * / <nl> - <nl> - # if defined ( HEDLEY_GCC_NOT_CLANG_VERSION_CHECK ) <nl> - # undef HEDLEY_GCC_NOT_CLANG_VERSION_CHECK <nl> - # endif <nl> - # if defined ( __clang__ ) <nl> - # define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK ( major , minor , patch ) ( 0 ) <nl> - # else <nl> - # define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK ( major , minor , patch ) HEDLEY_GCC_VERSION_CHECK ( major , minor , patch ) <nl> - # endif <nl> - <nl> - # if defined ( HEDLEY_CLANG_HAS_ATTRIBUTE ) <nl> - # undef HEDLEY_CLANG_HAS_ATTRIBUTE <nl> - # endif <nl> - # define HEDLEY_CLANG_HAS_ATTRIBUTE ( attribute ) HEDLEY_HAS_ATTRIBUTE ( attribute ) <nl> - <nl> - # if defined ( HEDLEY_CLANG_HAS_CPP_ATTRIBUTE ) <nl> - # undef HEDLEY_CLANG_HAS_CPP_ATTRIBUTE <nl> - # endif <nl> - # define HEDLEY_CLANG_HAS_CPP_ATTRIBUTE ( attribute ) HEDLEY_HAS_CPP_ATTRIBUTE ( attribute ) <nl> - <nl> - # if defined ( HEDLEY_CLANG_HAS_BUILTIN ) <nl> - # undef HEDLEY_CLANG_HAS_BUILTIN <nl> - # endif <nl> - # define HEDLEY_CLANG_HAS_BUILTIN ( builtin ) HEDLEY_HAS_BUILTIN ( builtin ) <nl> - <nl> - # if defined ( HEDLEY_CLANG_HAS_FEATURE ) <nl> - # undef HEDLEY_CLANG_HAS_FEATURE <nl> - # endif <nl> - # define HEDLEY_CLANG_HAS_FEATURE ( feature ) HEDLEY_HAS_FEATURE ( feature ) <nl> - <nl> - # if defined ( HEDLEY_CLANG_HAS_EXTENSION ) <nl> - # undef HEDLEY_CLANG_HAS_EXTENSION <nl> - # endif <nl> - # define HEDLEY_CLANG_HAS_EXTENSION ( extension ) HEDLEY_HAS_EXTENSION ( extension ) <nl> - <nl> - # if defined ( HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE ) <nl> - # undef HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE <nl> - # endif <nl> - # define HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE ( attribute ) HEDLEY_HAS_DECLSPEC_ATTRIBUTE ( attribute ) <nl> - <nl> - # if defined ( HEDLEY_CLANG_HAS_WARNING ) <nl> - # undef HEDLEY_CLANG_HAS_WARNING <nl> - # endif <nl> - # define HEDLEY_CLANG_HAS_WARNING ( warning ) HEDLEY_HAS_WARNING ( warning ) <nl> - <nl> - # endif / * ! defined ( HEDLEY_VERSION ) | | ( HEDLEY_VERSION < X ) * / <nl>
: fire : remove leftover file
nlohmann/json
65e4b973bdc04420335f6e76950f53632ed903c2
2019-07-21T12:10:37Z
mmm a / src / CalcViewModel / Common / CopyPasteManager . cpp <nl> ppp b / src / CalcViewModel / Common / CopyPasteManager . cpp <nl> CopyPasteManager : : GetMaxOperandLengthAndValue ( ViewMode mode , CategoryGroupType m <nl> <nl> Platform : : String ^ CopyPasteManager : : SanitizeOperand ( Platform : : String ^ operand ) <nl> { <nl> - wchar_t unWantedChars [ ] = { L ' \ ' ' , L ' _ ' , L ' ` ' , L ' ( ' , L ' ) ' , L ' - ' , L ' + ' } ; <nl> + constexpr wchar_t unWantedChars [ ] = { L ' \ ' ' , L ' _ ' , L ' ` ' , L ' ( ' , L ' ) ' , L ' - ' , L ' + ' } ; <nl> <nl> - return ref new String ( Utils : : RemoveUnwantedCharsFromString ( operand - > Data ( ) , unWantedChars , static_cast < int > ( size ( unWantedChars ) ) ) . c_str ( ) ) ; <nl> + return ref new String ( Utils : : RemoveUnwantedCharsFromString ( operand - > Data ( ) , unWantedChars ) . c_str ( ) ) ; <nl> } <nl> <nl> IBox < unsigned long long int > ^ CopyPasteManager : : TryOperandToULL ( String ^ operand , NumberBase numberBase ) <nl> ULONG32 CopyPasteManager : : ProgrammerOperandLength ( Platform : : String ^ operand , Nu <nl> / / euro ( € ) - 8364 <nl> Platform : : String ^ CopyPasteManager : : RemoveUnwantedCharsFromString ( Platform : : String ^ input ) <nl> { <nl> - wchar_t unWantedChars [ ] = { L ' ' , L ' , ' , L ' " ' , 165 , 164 , 8373 , 36 , 8353 , 8361 , 8362 , 8358 , 8377 , 163 , 8364 , 8234 , 8235 , 8236 , 8237 } ; <nl> - return ref new String ( Utils : : RemoveUnwantedCharsFromString ( input - > Data ( ) , unWantedChars , 18 ) . c_str ( ) ) ; <nl> + constexpr wchar_t unWantedChars [ ] = { L ' ' , L ' , ' , L ' " ' , 165 , 164 , 8373 , 36 , 8353 , 8361 , 8362 , 8358 , 8377 , 163 , 8364 , 8234 , 8235 , 8236 , 8237 } ; <nl> + return ref new String ( Utils : : RemoveUnwantedCharsFromString ( input - > Data ( ) , unWantedChars ) . c_str ( ) ) ; <nl> } <nl> <nl> bool CopyPasteManager : : IsErrorMessage ( Platform : : String ^ message ) <nl> mmm a / src / CalcViewModel / Common / Utils . cpp <nl> ppp b / src / CalcViewModel / Common / Utils . cpp <nl> String ^ Utils : : GetStringValue ( String ^ input ) <nl> <nl> double Utils : : GetDoubleFromWstring ( wstring input ) <nl> { <nl> - wchar_t unWantedChars [ ] = { L ' ' , L ' , ' , 8234 , 8235 , 8236 , 8237 } ; <nl> - wstring ws = RemoveUnwantedCharsFromString ( input , unWantedChars , 6 ) ; <nl> + constexpr wchar_t unWantedChars [ ] = { L ' ' , L ' , ' , 8234 , 8235 , 8236 , 8237 } ; <nl> + wstring ws = RemoveUnwantedCharsFromString ( input , unWantedChars ) ; <nl> return stod ( ws ) ; <nl> } <nl> <nl> bool Utils : : IsLastCharacterTarget ( _In_ wstring const & input , _In_ wchar_t target <nl> return ! input . empty ( ) & & input . back ( ) = = target ; <nl> } <nl> <nl> - / / Return wstring after removing characters specified by unwantedChars array <nl> - wstring Utils : : RemoveUnwantedCharsFromString ( wstring input , wchar_t * unwantedChars , unsigned int size ) <nl> - { <nl> - for ( unsigned int i = 0 ; i < size ; + + i ) <nl> - { <nl> - input . erase ( std : : remove ( input . begin ( ) , input . end ( ) , unwantedChars [ i ] ) , input . end ( ) ) ; <nl> - } <nl> - return input ; <nl> - } <nl> - <nl> void Utils : : SerializeCommandsAndTokens ( <nl> _In_ shared_ptr < vector < pair < wstring , int > > > const & tokens , <nl> _In_ shared_ptr < vector < shared_ptr < IExpressionCommand > > > const & commands , <nl> mmm a / src / CalcViewModel / Common / Utils . h <nl> ppp b / src / CalcViewModel / Common / Utils . h <nl> namespace Utils <nl> void IFTPlatformException ( HRESULT hr ) ; <nl> Platform : : String ^ GetStringValue ( Platform : : String ^ input ) ; <nl> bool IsLastCharacterTarget ( std : : wstring const & input , wchar_t target ) ; <nl> - std : : wstring RemoveUnwantedCharsFromString ( std : : wstring inputString , wchar_t * unwantedChars , unsigned int size ) ; <nl> + <nl> + / / Return wstring after removing characters specified by unwantedChars array <nl> + template < size_t N > <nl> + std : : wstring RemoveUnwantedCharsFromString ( std : : wstring inputString , const wchar_t ( & unwantedChars ) [ N ] ) <nl> + { <nl> + for ( const wchar_t unwantedChar : unwantedChars ) <nl> + { <nl> + inputString . erase ( std : : remove ( inputString . begin ( ) , inputString . end ( ) , unwantedChar ) , inputString . end ( ) ) ; <nl> + } <nl> + return inputString ; <nl> + } <nl> + <nl> double GetDoubleFromWstring ( std : : wstring input ) ; <nl> int GetWindowId ( ) ; <nl> void RunOnUIThreadNonblocking ( std : : function < void ( ) > & & function , _In_ Windows : : UI : : Core : : CoreDispatcher ^ currentDispatcher ) ; <nl>
Updating RemoveUnwantedCharsFromString to be a template ( )
microsoft/calculator
582e10faed005c3123528ddcff947ed616721ac1
2019-11-19T03:02:45Z
new file mode 100644 <nl> index 00000000000 . . b5216615e99 <nl> mmm / dev / null <nl> ppp b / modules / websocket / lws_helper . cpp <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * lws_helper . cpp * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * This file is part of : * / <nl> + / * GODOT ENGINE * / <nl> + / * https : / / godotengine . org * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * Copyright ( c ) 2007 - 2018 Juan Linietsky , Ariel Manzur . * / <nl> + / * Copyright ( c ) 2014 - 2018 Godot Engine contributors ( cf . AUTHORS . md ) * / <nl> + / * * / <nl> + / * Permission is hereby granted , free of charge , to any person obtaining * / <nl> + / * a copy of this software and associated documentation files ( the * / <nl> + / * " Software " ) , to deal in the Software without restriction , including * / <nl> + / * without limitation the rights to use , copy , modify , merge , publish , * / <nl> + / * distribute , sublicense , and / or sell copies of the Software , and to * / <nl> + / * permit persons to whom the Software is furnished to do so , subject to * / <nl> + / * the following conditions : * / <nl> + / * * / <nl> + / * The above copyright notice and this permission notice shall be * / <nl> + / * included in all copies or substantial portions of the Software . * / <nl> + / * * / <nl> + / * THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , * / <nl> + / * EXPRESS OR IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * / <nl> + / * MERCHANTABILITY , FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . * / <nl> + / * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * / <nl> + / * CLAIM , DAMAGES OR OTHER LIABILITY , WHETHER IN AN ACTION OF CONTRACT , * / <nl> + / * TORT OR OTHERWISE , ARISING FROM , OUT OF OR IN CONNECTION WITH THE * / <nl> + / * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE . * / <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> + # if ! defined ( JAVASCRIPT_ENABLED ) <nl> + <nl> + # include " lws_helper . h " <nl> + <nl> + _LWSRef * _lws_create_ref ( void * obj ) { <nl> + <nl> + _LWSRef * out = ( _LWSRef * ) memalloc ( sizeof ( _LWSRef ) ) ; <nl> + out - > is_destroying = false ; <nl> + out - > free_context = false ; <nl> + out - > is_polling = false ; <nl> + out - > obj = obj ; <nl> + out - > is_valid = true ; <nl> + out - > lws_structs = NULL ; <nl> + out - > lws_names = NULL ; <nl> + return out ; <nl> + } <nl> + <nl> + void _lws_free_ref ( _LWSRef * ref ) { <nl> + / / Free strings and structs <nl> + memfree ( ref - > lws_structs ) ; <nl> + memfree ( ref - > lws_names ) ; <nl> + / / Free ref <nl> + memfree ( ref ) ; <nl> + } <nl> + <nl> + bool _lws_destroy ( struct lws_context * context , _LWSRef * ref ) { <nl> + if ( context = = NULL | | ref - > is_destroying ) <nl> + return false ; <nl> + <nl> + if ( ref - > is_polling ) { <nl> + ref - > free_context = true ; <nl> + return false ; <nl> + } <nl> + <nl> + ref - > is_destroying = true ; <nl> + lws_context_destroy ( context ) ; <nl> + _lws_free_ref ( ref ) ; <nl> + return true ; <nl> + } <nl> + <nl> + bool _lws_poll ( struct lws_context * context , _LWSRef * ref ) { <nl> + <nl> + ERR_FAIL_COND_V ( context = = NULL , false ) ; <nl> + ERR_FAIL_COND_V ( ref = = NULL , false ) ; <nl> + <nl> + ref - > is_polling = true ; <nl> + lws_service ( context , 0 ) ; <nl> + ref - > is_polling = false ; <nl> + <nl> + if ( ! ref - > free_context ) <nl> + return false ; / / Nothing to do <nl> + <nl> + bool is_valid = ref - > is_valid ; / / Might have been destroyed by poll <nl> + <nl> + _lws_destroy ( context , ref ) ; / / Will destroy context and ref <nl> + <nl> + return is_valid ; / / If the object should NULL its context and ref <nl> + } <nl> + <nl> + / * <nl> + * Prepare the protocol_structs to be fed to context . <nl> + * Also prepare the protocol string used by the client . <nl> + * / <nl> + void _lws_make_protocols ( void * p_obj , lws_callback_function * p_callback , PoolVector < String > p_names , _LWSRef * * r_lws_ref ) { <nl> + / / The input strings might go away after this call , we need to copy them . <nl> + / / We will clear them when destroying the context . <nl> + int i ; <nl> + int len = p_names . size ( ) ; <nl> + size_t data_size = sizeof ( struct LWSPeer : : PeerData ) ; <nl> + PoolVector < String > : : Read pnr = p_names . read ( ) ; <nl> + <nl> + / / This is a reference connecting the object with lws keep track of status , mallocs , etc . <nl> + / / Must survive as long the context . <nl> + / / Must be freed manually when context creation fails . <nl> + _LWSRef * ref = _lws_create_ref ( p_obj ) ; <nl> + <nl> + / / LWS protocol structs . <nl> + ref - > lws_structs = ( struct lws_protocols * ) memalloc ( sizeof ( struct lws_protocols ) * ( len + 2 ) ) ; <nl> + memset ( ref - > lws_structs , 0 , sizeof ( struct lws_protocols ) * ( len + 2 ) ) ; <nl> + <nl> + CharString strings = p_names . join ( " , " ) . ascii ( ) ; <nl> + int str_len = strings . length ( ) ; <nl> + <nl> + / / Joined string of protocols , double the size : comma separated first , NULL separated last <nl> + ref - > lws_names = ( char * ) memalloc ( ( str_len + 1 ) * 2 ) ; / / Plus the terminator <nl> + <nl> + char * names_ptr = ref - > lws_names ; <nl> + struct lws_protocols * structs_ptr = ref - > lws_structs ; <nl> + <nl> + / / Comma separated protocols string to be used in client Sec - WebSocket - Protocol header <nl> + if ( str_len > 0 ) <nl> + copymem ( names_ptr , strings . get_data ( ) , str_len ) ; <nl> + names_ptr [ str_len ] = ' \ 0 ' ; / / NULL terminator <nl> + <nl> + / / NULL terminated protocol strings to be used in protocol structs <nl> + if ( str_len > 0 ) <nl> + copymem ( & names_ptr [ str_len + 1 ] , strings . get_data ( ) , str_len ) ; <nl> + names_ptr [ ( str_len * 2 ) + 1 ] = ' \ 0 ' ; / / NULL terminator <nl> + int pos = str_len + 1 ; <nl> + <nl> + / / The first protocol is the default for any http request ( before upgrade ) . <nl> + / / It is also used as the websocket protocol when no subprotocol is specified . <nl> + structs_ptr [ 0 ] . name = " default " ; <nl> + structs_ptr [ 0 ] . callback = p_callback ; <nl> + structs_ptr [ 0 ] . per_session_data_size = data_size ; <nl> + structs_ptr [ 0 ] . rx_buffer_size = LWS_BUF_SIZE ; <nl> + structs_ptr [ 0 ] . tx_packet_size = LWS_PACKET_SIZE ; <nl> + / / Add user defined protocols <nl> + for ( i = 0 ; i < len ; i + + ) { <nl> + structs_ptr [ i + 1 ] . name = ( const char * ) & names_ptr [ pos ] ; <nl> + structs_ptr [ i + 1 ] . callback = p_callback ; <nl> + structs_ptr [ i + 1 ] . per_session_data_size = data_size ; <nl> + structs_ptr [ i + 1 ] . rx_buffer_size = LWS_BUF_SIZE ; <nl> + structs_ptr [ i + 1 ] . tx_packet_size = LWS_PACKET_SIZE ; <nl> + pos + = pnr [ i ] . ascii ( ) . length ( ) + 1 ; <nl> + names_ptr [ pos - 1 ] = ' \ 0 ' ; <nl> + } <nl> + / / Add protocols terminator <nl> + structs_ptr [ len + 1 ] . name = NULL ; <nl> + structs_ptr [ len + 1 ] . callback = NULL ; <nl> + structs_ptr [ len + 1 ] . per_session_data_size = 0 ; <nl> + structs_ptr [ len + 1 ] . rx_buffer_size = 0 ; <nl> + <nl> + * r_lws_ref = ref ; <nl> + } <nl> + <nl> + # endif <nl> mmm a / modules / websocket / lws_helper . h <nl> ppp b / modules / websocket / lws_helper . h <nl> struct _LWSRef { <nl> char * lws_names ; <nl> } ; <nl> <nl> - static _LWSRef * _lws_create_ref ( void * obj ) { <nl> - <nl> - _LWSRef * out = ( _LWSRef * ) memalloc ( sizeof ( _LWSRef ) ) ; <nl> - out - > is_destroying = false ; <nl> - out - > free_context = false ; <nl> - out - > is_polling = false ; <nl> - out - > obj = obj ; <nl> - out - > is_valid = true ; <nl> - out - > lws_structs = NULL ; <nl> - out - > lws_names = NULL ; <nl> - return out ; <nl> - } <nl> - <nl> - static void _lws_free_ref ( _LWSRef * ref ) { <nl> - / / Free strings and structs <nl> - memfree ( ref - > lws_structs ) ; <nl> - memfree ( ref - > lws_names ) ; <nl> - / / Free ref <nl> - memfree ( ref ) ; <nl> - } <nl> - <nl> - static bool _lws_destroy ( struct lws_context * context , _LWSRef * ref ) { <nl> - if ( context = = NULL | | ref - > is_destroying ) <nl> - return false ; <nl> - <nl> - if ( ref - > is_polling ) { <nl> - ref - > free_context = true ; <nl> - return false ; <nl> - } <nl> - <nl> - ref - > is_destroying = true ; <nl> - lws_context_destroy ( context ) ; <nl> - _lws_free_ref ( ref ) ; <nl> - return true ; <nl> - } <nl> - <nl> - static bool _lws_poll ( struct lws_context * context , _LWSRef * ref ) { <nl> - <nl> - ERR_FAIL_COND_V ( context = = NULL , false ) ; <nl> - ERR_FAIL_COND_V ( ref = = NULL , false ) ; <nl> - <nl> - ref - > is_polling = true ; <nl> - lws_service ( context , 0 ) ; <nl> - ref - > is_polling = false ; <nl> - <nl> - if ( ! ref - > free_context ) <nl> - return false ; / / Nothing to do <nl> - <nl> - bool is_valid = ref - > is_valid ; / / Might have been destroyed by poll <nl> - <nl> - _lws_destroy ( context , ref ) ; / / Will destroy context and ref <nl> - <nl> - return is_valid ; / / If the object should NULL its context and ref <nl> - } <nl> - <nl> - / * <nl> - * Prepare the protocol_structs to be fed to context . <nl> - * Also prepare the protocol string used by the client . <nl> - * / <nl> - static void _lws_make_protocols ( void * p_obj , lws_callback_function * p_callback , PoolVector < String > p_names , _LWSRef * * r_lws_ref ) { <nl> - / / The input strings might go away after this call , we need to copy them . <nl> - / / We will clear them when destroying the context . <nl> - int i ; <nl> - int len = p_names . size ( ) ; <nl> - size_t data_size = sizeof ( struct LWSPeer : : PeerData ) ; <nl> - PoolVector < String > : : Read pnr = p_names . read ( ) ; <nl> - <nl> - / / This is a reference connecting the object with lws keep track of status , mallocs , etc . <nl> - / / Must survive as long the context . <nl> - / / Must be freed manually when context creation fails . <nl> - _LWSRef * ref = _lws_create_ref ( p_obj ) ; <nl> - <nl> - / / LWS protocol structs . <nl> - ref - > lws_structs = ( struct lws_protocols * ) memalloc ( sizeof ( struct lws_protocols ) * ( len + 2 ) ) ; <nl> - memset ( ref - > lws_structs , 0 , sizeof ( struct lws_protocols ) * ( len + 2 ) ) ; <nl> - <nl> - CharString strings = p_names . join ( " , " ) . ascii ( ) ; <nl> - int str_len = strings . length ( ) ; <nl> - <nl> - / / Joined string of protocols , double the size : comma separated first , NULL separated last <nl> - ref - > lws_names = ( char * ) memalloc ( ( str_len + 1 ) * 2 ) ; / / Plus the terminator <nl> - <nl> - char * names_ptr = ref - > lws_names ; <nl> - struct lws_protocols * structs_ptr = ref - > lws_structs ; <nl> - <nl> - / / Comma separated protocols string to be used in client Sec - WebSocket - Protocol header <nl> - if ( str_len > 0 ) <nl> - copymem ( names_ptr , strings . get_data ( ) , str_len ) ; <nl> - names_ptr [ str_len ] = ' \ 0 ' ; / / NULL terminator <nl> - <nl> - / / NULL terminated protocol strings to be used in protocol structs <nl> - if ( str_len > 0 ) <nl> - copymem ( & names_ptr [ str_len + 1 ] , strings . get_data ( ) , str_len ) ; <nl> - names_ptr [ ( str_len * 2 ) + 1 ] = ' \ 0 ' ; / / NULL terminator <nl> - int pos = str_len + 1 ; <nl> - <nl> - / / The first protocol is the default for any http request ( before upgrade ) . <nl> - / / It is also used as the websocket protocol when no subprotocol is specified . <nl> - structs_ptr [ 0 ] . name = " default " ; <nl> - structs_ptr [ 0 ] . callback = p_callback ; <nl> - structs_ptr [ 0 ] . per_session_data_size = data_size ; <nl> - structs_ptr [ 0 ] . rx_buffer_size = LWS_BUF_SIZE ; <nl> - structs_ptr [ 0 ] . tx_packet_size = LWS_PACKET_SIZE ; <nl> - / / Add user defined protocols <nl> - for ( i = 0 ; i < len ; i + + ) { <nl> - structs_ptr [ i + 1 ] . name = ( const char * ) & names_ptr [ pos ] ; <nl> - structs_ptr [ i + 1 ] . callback = p_callback ; <nl> - structs_ptr [ i + 1 ] . per_session_data_size = data_size ; <nl> - structs_ptr [ i + 1 ] . rx_buffer_size = LWS_BUF_SIZE ; <nl> - structs_ptr [ i + 1 ] . tx_packet_size = LWS_PACKET_SIZE ; <nl> - pos + = pnr [ i ] . ascii ( ) . length ( ) + 1 ; <nl> - names_ptr [ pos - 1 ] = ' \ 0 ' ; <nl> - } <nl> - / / Add protocols terminator <nl> - structs_ptr [ len + 1 ] . name = NULL ; <nl> - structs_ptr [ len + 1 ] . callback = NULL ; <nl> - structs_ptr [ len + 1 ] . per_session_data_size = 0 ; <nl> - structs_ptr [ len + 1 ] . rx_buffer_size = 0 ; <nl> - <nl> - * r_lws_ref = ref ; <nl> - } <nl> + _LWSRef * _lws_create_ref ( void * obj ) ; <nl> + void _lws_free_ref ( _LWSRef * ref ) ; <nl> + bool _lws_destroy ( struct lws_context * context , _LWSRef * ref ) ; <nl> + bool _lws_poll ( struct lws_context * context , _LWSRef * ref ) ; <nl> + void _lws_make_protocols ( void * p_obj , lws_callback_function * p_callback , PoolVector < String > p_names , _LWSRef * * r_lws_ref ) ; <nl> <nl> / * clang - format off * / <nl> # define LWS_HELPER ( CNAME ) \ <nl>
Fix - Wunused - function in websocket module
godotengine/godot
8b2688786f4c294397b2fc9aaa9e2aab1c7c074e
2018-09-29T20:26:32Z
mmm a / js / common / modules / org / arangodb / general - graph . js <nl> ppp b / js / common / modules / org / arangodb / general - graph . js <nl> var _list = function ( ) { <nl> return _ . pluck ( gdb . toArray ( ) , " _key " ) ; <nl> } ; <nl> <nl> + <nl> + <nl> + <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief create a list of edge definitions <nl> + / / / @ startDocuBlock JSF_general_graph_edge_definitions <nl> + / / / <nl> + / / / The edge definitions for a graph is an array containing arbitrary many directed <nl> + / / / and / or undirected relations as defined below . <nl> + / / / The list of edge definitions of a graph can be managed by the graph module itself . <nl> + / / / This function is the entry point for the management and will return the correct list . <nl> + / / / <nl> + / / / @ EXAMPLES <nl> + / / / <nl> + / / / <nl> + / / / @ EXAMPLE_ARANGOSH_OUTPUT { generalGraphEdgeDefinitions } <nl> + / / / var graph = require ( " org / arangodb / general - graph " ) ; <nl> + / / / directed - relation = graph . _directedRelationDefinition ( " lives_in " , " user " , " city " ) ; <nl> + / / / undirected - relation = graph . _directedRelationDefinition ( " knows " , " user " ) ; <nl> + / / / edgedefinitions = graph . _edgeDefinitions ( directed - relation , undirected - relation ) ; <nl> + / / / @ END_EXAMPLE_ARANGOSH_OUTPUT <nl> + / / / <nl> + / / / @ endDocuBlock <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> <nl> var _edgeDefinitions = function ( ) { <nl> <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief extend a list of edge definitions <nl> + / / / @ startDocuBlock JSF_general_graph_extend_edge_definitions <nl> + / / / <nl> + / / / In order to add more edge definitions to the graph before creating <nl> + / / / this function can be used to add more definitions to the initial list . <nl> + / / / <nl> + / / / @ EXAMPLES <nl> + / / / <nl> + / / / @ EXAMPLE_ARANGOSH_OUTPUT { generalGraphEdgeDefinitionsExtend } <nl> + / / / var graph = require ( " org / arangodb / general - graph " ) ; <nl> + / / / directed - relation = graph . _directedRelationDefinition ( " lives_in " , " user " , " city " ) ; <nl> + / / / undirected - relation = graph . _directedRelationDefinition ( " knows " , " user " ) ; <nl> + / / / edgedefinitions = graph . _edgeDefinitions ( directed - relation ) ; <nl> + / / / edgedefinitions = graph . _extendEdgeDefinitions ( undirected - relation ) ; <nl> + / / / @ END_EXAMPLE_ARANGOSH_OUTPUT <nl> + / / / <nl> + / / / @ endDocuBlock <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> - <nl> var _extendEdgeDefinitions = function ( edgeDefinition ) { <nl> <nl> var args = arguments , i = 0 ; <nl> var Graph = function ( graphName , edgeDefinitions , vertexCollections , edgeCollecti <nl> <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief load a graph . <nl> + / / / @ startDocuBlock JSF_general_graph_graph <nl> + / / / ` general - graph . _graph ( graph - name ) ` <nl> + / / / * Load a graph * <nl> + / / / <nl> + / / / A graph can be loaded by its name . <nl> + / / / <nl> + / / / * * graph - name * : string - unique identifier of the graph <nl> + / / / <nl> + / / / @ EXAMPLES <nl> + / / / <nl> + / / / Load a graph : <nl> + / / / <nl> + / / / @ EXAMPLE_ARANGOSH_OUTPUT { generalGraphVertexCollectionSave } <nl> + / / / ~ var examples = require ( " org / arangodb / graph - examples / example - graph . js " ) ; <nl> + / / / ~ var g1 = examples . loadGraph ( " social " ) ; <nl> + / / / var graph = require ( " org / arangodb / general - graph " ) ; <nl> + / / / g = graph . _graph ( " social " ) ; <nl> + / / / @ END_EXAMPLE_ARANGOSH_OUTPUT <nl> + / / / <nl> + / / / @ endDocuBlock <nl> + / / / <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> var _graph = function ( graphName ) { <nl> var checkIfMayBeDropped = function ( colName , graphName , graphs ) { <nl> } ; <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief drop a graph . <nl> + / / / @ startDocuBlock JSF_general_graph_drop <nl> + / / / ` general - graph . _drop ( graph - name , drop - collections ) ` <nl> + / / / * Remove a graph * <nl> + / / / <nl> + / / / A graph can be dropped by its name . <nl> + / / / This will automatically drop al collections contained in the graph as <nl> + / / / long as they are not used within other graphs . <nl> + / / / To prohibit the drop of collections , the optional parameter * drop - collections * can be set to * false * . <nl> + / / / <nl> + / / / * * graph - name * : string - unique identifier of the graph <nl> + / / / * * drop - collections * : boolean ( optional ) - Define if collections should be dropped ( default : true ) <nl> + / / / <nl> + / / / @ EXAMPLES <nl> + / / / <nl> + / / / Drop a graph : <nl> + / / / <nl> + / / / @ EXAMPLE_ARANGOSH_OUTPUT { generalGraphVertexCollectionSave } <nl> + / / / ~ var examples = require ( " org / arangodb / graph - examples / example - graph . js " ) ; <nl> + / / / ~ var g1 = examples . loadGraph ( " social " ) ; <nl> + / / / var graph = require ( " org / arangodb / general - graph " ) ; <nl> + / / / graph . _drop ( " social " ) ; <nl> + / / / @ END_EXAMPLE_ARANGOSH_OUTPUT <nl> + / / / <nl> + / / / @ endDocuBlock <nl> + / / / <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> var _drop = function ( graphId , dropCollections ) { <nl>
Added more in - code documentation for the graph module
arangodb/arangodb
5f43e43979e73cfa4b6cfdef2aa27738b252d278
2014-06-17T09:21:22Z
new file mode 100644 <nl> index 000000000 . . 3cb7646c9 <nl> mmm / dev / null <nl> ppp b / . gitmodules <nl> <nl> + [ submodule " src / dbg / capstone_wrapper " ] <nl> + path = src / dbg / capstone_wrapper <nl> + url = https : / / github . com / x64dbg / capstone_wrapper . git <nl> deleted file mode 100644 <nl> index 2777d913a . . 000000000 <nl> mmm a / src / capstone_wrapper / capstone_wrapper . cpp <nl> ppp / dev / null <nl> <nl> - # include " capstone_wrapper . h " <nl> - # include < windows . h > <nl> - <nl> - csh Capstone : : mHandle = 0 ; <nl> - <nl> - void Capstone : : GlobalInitialize ( ) <nl> - { <nl> - # ifdef _WIN64 <nl> - cs_open ( CS_ARCH_X86 , CS_MODE_64 , & mHandle ) ; <nl> - # else / / x86 <nl> - cs_open ( CS_ARCH_X86 , CS_MODE_32 , & mHandle ) ; <nl> - # endif / / _WIN64 <nl> - cs_option ( mHandle , CS_OPT_DETAIL , CS_OPT_ON ) ; <nl> - } <nl> - <nl> - void Capstone : : GlobalFinalize ( ) <nl> - { <nl> - if ( mHandle ) / / close handle <nl> - cs_close ( & mHandle ) ; <nl> - } <nl> - <nl> - Capstone : : Capstone ( ) <nl> - { <nl> - mInstr = nullptr ; <nl> - mSuccess = false ; <nl> - } <nl> - <nl> - Capstone : : ~ Capstone ( ) <nl> - { <nl> - if ( mInstr ) / / free last disassembled instruction <nl> - cs_free ( mInstr , 1 ) ; <nl> - } <nl> - <nl> - bool Capstone : : Disassemble ( size_t addr , const unsigned char data [ MAX_DISASM_BUFFER ] ) <nl> - { <nl> - return Disassemble ( addr , data , MAX_DISASM_BUFFER ) ; <nl> - } <nl> - <nl> - bool Capstone : : Disassemble ( size_t addr , const unsigned char * data , int size ) <nl> - { <nl> - if ( ! data ) <nl> - return false ; <nl> - if ( mInstr ) / / free last disassembled instruction <nl> - { <nl> - cs_free ( mInstr , 1 ) ; <nl> - mInstr = nullptr ; <nl> - } <nl> - return mSuccess = ! ! cs_disasm ( mHandle , data , size , addr , 1 , & mInstr ) ; <nl> - } <nl> - <nl> - const cs_insn * Capstone : : GetInstr ( ) const <nl> - { <nl> - if ( ! Success ( ) ) <nl> - return nullptr ; <nl> - return mInstr ; <nl> - } <nl> - <nl> - bool Capstone : : Success ( ) const <nl> - { <nl> - return mSuccess ; <nl> - } <nl> - <nl> - const char * Capstone : : RegName ( x86_reg reg ) const <nl> - { <nl> - return cs_reg_name ( mHandle , reg ) ; <nl> - } <nl> - <nl> - bool Capstone : : InGroup ( cs_group_type group ) const <nl> - { <nl> - if ( ! Success ( ) ) <nl> - return false ; <nl> - return cs_insn_group ( mHandle , mInstr , group ) ; <nl> - } <nl> - <nl> - std : : string Capstone : : OperandText ( int opindex ) const <nl> - { <nl> - if ( ! Success ( ) | | opindex > = mInstr - > detail - > x86 . op_count ) <nl> - return " " ; <nl> - const auto & op = mInstr - > detail - > x86 . operands [ opindex ] ; <nl> - std : : string result ; <nl> - char temp [ 32 ] = " " ; <nl> - switch ( op . type ) <nl> - { <nl> - case X86_OP_REG : <nl> - { <nl> - result = RegName ( x86_reg ( op . reg ) ) ; <nl> - } <nl> - break ; <nl> - <nl> - case X86_OP_IMM : <nl> - { <nl> - sprintf_s ( temp , " % llX " , op . imm ) ; <nl> - result = temp ; <nl> - } <nl> - break ; <nl> - <nl> - case X86_OP_MEM : <nl> - { <nl> - const auto & mem = op . mem ; <nl> - if ( op . mem . base = = X86_REG_RIP ) / / rip - relative <nl> - { <nl> - sprintf_s ( temp , " % llX " , Address ( ) + op . mem . disp + Size ( ) ) ; <nl> - result + = temp ; <nl> - } <nl> - else / / normal <nl> - { <nl> - bool prependPlus = false ; <nl> - if ( mem . base ) <nl> - { <nl> - result + = RegName ( x86_reg ( mem . base ) ) ; <nl> - prependPlus = true ; <nl> - } <nl> - if ( mem . index ) <nl> - { <nl> - if ( prependPlus ) <nl> - result + = " + " ; <nl> - result + = RegName ( x86_reg ( mem . index ) ) ; <nl> - sprintf_s ( temp , " * % X " , mem . scale ) ; <nl> - result + = temp ; <nl> - prependPlus = true ; <nl> - } <nl> - if ( mem . disp ) <nl> - { <nl> - char operatorText = ' + ' ; <nl> - if ( mem . disp < 0 ) <nl> - { <nl> - operatorText = ' - ' ; <nl> - sprintf_s ( temp , " % llX " , mem . disp * - 1 ) ; <nl> - } <nl> - else <nl> - sprintf_s ( temp , " % llX " , mem . disp ) ; <nl> - if ( prependPlus ) <nl> - result + = operatorText ; <nl> - result + = temp ; <nl> - } <nl> - } <nl> - } <nl> - break ; <nl> - <nl> - case X86_OP_FP : <nl> - case X86_OP_INVALID : <nl> - { <nl> - } <nl> - break ; <nl> - } <nl> - return result ; <nl> - } <nl> - <nl> - int Capstone : : Size ( ) const <nl> - { <nl> - if ( ! Success ( ) ) <nl> - return 1 ; <nl> - return GetInstr ( ) - > size ; <nl> - } <nl> - <nl> - size_t Capstone : : Address ( ) const <nl> - { <nl> - if ( ! Success ( ) ) <nl> - return 0 ; <nl> - return size_t ( GetInstr ( ) - > address ) ; <nl> - } <nl> - <nl> - const cs_x86 & Capstone : : x86 ( ) const <nl> - { <nl> - if ( ! Success ( ) ) <nl> - DebugBreak ( ) ; <nl> - return GetInstr ( ) - > detail - > x86 ; <nl> - } <nl> - <nl> - bool Capstone : : IsFilling ( ) const <nl> - { <nl> - if ( ! Success ( ) ) <nl> - return false ; <nl> - switch ( GetId ( ) ) <nl> - { <nl> - case X86_INS_NOP : <nl> - case X86_INS_INT3 : <nl> - return true ; <nl> - default : <nl> - return false ; <nl> - } <nl> - } <nl> - <nl> - bool Capstone : : IsLoop ( ) const <nl> - { <nl> - if ( ! Success ( ) ) <nl> - return false ; <nl> - switch ( GetId ( ) ) <nl> - { <nl> - case X86_INS_LOOP : <nl> - case X86_INS_LOOPE : <nl> - case X86_INS_LOOPNE : <nl> - return true ; <nl> - default : <nl> - return false ; <nl> - } <nl> - } <nl> - <nl> - x86_insn Capstone : : GetId ( ) const <nl> - { <nl> - if ( ! Success ( ) ) <nl> - DebugBreak ( ) ; <nl> - return x86_insn ( mInstr - > id ) ; <nl> - } <nl> - <nl> - std : : string Capstone : : InstructionText ( ) const <nl> - { <nl> - if ( ! Success ( ) ) <nl> - return " ? ? ? " ; <nl> - std : : string result = Mnemonic ( ) ; <nl> - if ( OpCount ( ) ) <nl> - { <nl> - result + = " " ; <nl> - result + = mInstr - > op_str ; <nl> - } <nl> - return result ; <nl> - } <nl> - <nl> - int Capstone : : OpCount ( ) const <nl> - { <nl> - if ( ! Success ( ) ) <nl> - return 0 ; <nl> - return x86 ( ) . op_count ; <nl> - } <nl> - <nl> - cs_x86_op Capstone : : operator [ ] ( int index ) const <nl> - { <nl> - if ( ! Success ( ) | | index > = OpCount ( ) ) <nl> - DebugBreak ( ) ; <nl> - return x86 ( ) . operands [ index ] ; <nl> - } <nl> - <nl> - bool Capstone : : IsNop ( ) const <nl> - { <nl> - return GetId ( ) = = X86_INS_NOP ; <nl> - } <nl> - <nl> - bool Capstone : : IsInt3 ( ) const <nl> - { <nl> - if ( ! Success ( ) ) <nl> - return false ; <nl> - switch ( GetId ( ) ) <nl> - { <nl> - case X86_INS_INT3 : <nl> - return true ; <nl> - case X86_INS_INT : <nl> - { <nl> - cs_x86_op op = x86 ( ) . operands [ 0 ] ; <nl> - return op . type = = X86_OP_IMM & & op . imm = = 3 ; <nl> - } <nl> - default : <nl> - return false ; <nl> - } <nl> - } <nl> - <nl> - std : : string Capstone : : Mnemonic ( ) const <nl> - { <nl> - if ( ! Success ( ) ) <nl> - return " ? ? ? " ; <nl> - return mInstr - > mnemonic ; <nl> - } <nl> - <nl> - const char * Capstone : : MemSizeName ( int size ) const <nl> - { <nl> - switch ( size ) <nl> - { <nl> - case 1 : <nl> - return " byte " ; <nl> - case 2 : <nl> - return " word " ; <nl> - case 4 : <nl> - return " dword " ; <nl> - case 6 : <nl> - return " fword " ; <nl> - case 8 : <nl> - return " qword " ; <nl> - case 10 : <nl> - return " tword " ; <nl> - case 16 : <nl> - return " dqword " ; <nl> - case 32 : <nl> - return " yword " ; <nl> - case 64 : <nl> - return " zword " ; <nl> - default : <nl> - return nullptr ; <nl> - } <nl> - } <nl> - <nl> - size_t Capstone : : BranchDestination ( ) const <nl> - { <nl> - if ( ! Success ( ) ) <nl> - return 0 ; <nl> - if ( InGroup ( CS_GRP_JUMP ) | | InGroup ( CS_GRP_CALL ) | | IsLoop ( ) ) <nl> - { <nl> - const auto & op = x86 ( ) . operands [ 0 ] ; <nl> - if ( op . type = = CS_OP_IMM ) <nl> - return size_t ( op . imm ) ; <nl> - } <nl> - return 0 ; <nl> - } <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index 64c78b0b4 . . 000000000 <nl> mmm a / src / capstone_wrapper / capstone_wrapper . h <nl> ppp / dev / null <nl> <nl> - # ifndef _CAPSTONE_WRAPPER_H <nl> - # define _CAPSTONE_WRAPPER_H <nl> - <nl> - # include " . . / dbg / capstone / capstone . h " <nl> - # include < string > <nl> - <nl> - # define MAX_DISASM_BUFFER 16 <nl> - <nl> - class Capstone <nl> - { <nl> - public : <nl> - static void GlobalInitialize ( ) ; <nl> - static void GlobalFinalize ( ) ; <nl> - Capstone ( ) ; <nl> - ~ Capstone ( ) ; <nl> - bool Disassemble ( size_t addr , const unsigned char data [ MAX_DISASM_BUFFER ] ) ; <nl> - bool Disassemble ( size_t addr , const unsigned char * data , int size ) ; <nl> - const cs_insn * GetInstr ( ) const ; <nl> - bool Success ( ) const ; <nl> - const char * RegName ( x86_reg reg ) const ; <nl> - bool InGroup ( cs_group_type group ) const ; <nl> - std : : string OperandText ( int opindex ) const ; <nl> - int Size ( ) const ; <nl> - size_t Address ( ) const ; <nl> - const cs_x86 & x86 ( ) const ; <nl> - bool IsFilling ( ) const ; <nl> - bool IsLoop ( ) const ; <nl> - x86_insn GetId ( ) const ; <nl> - std : : string InstructionText ( ) const ; <nl> - int OpCount ( ) const ; <nl> - cs_x86_op operator [ ] ( int index ) const ; <nl> - bool IsNop ( ) const ; <nl> - bool IsInt3 ( ) const ; <nl> - std : : string Mnemonic ( ) const ; <nl> - const char * MemSizeName ( int size ) const ; <nl> - size_t BranchDestination ( ) const ; <nl> - <nl> - private : <nl> - static csh mHandle ; <nl> - cs_insn * mInstr ; <nl> - bool mSuccess ; <nl> - } ; <nl> - <nl> - # endif / / _CAPSTONE_WRAPPER_H <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index 3cc1f772c . . 000000000 <nl> mmm a / src / capstone_wrapper / capstone_wrapper . vcxproj <nl> ppp / dev / null <nl> <nl> -  < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> - < Project DefaultTargets = " Build " ToolsVersion = " 12 . 0 " xmlns = " http : / / schemas . microsoft . com / developer / msbuild / 2003 " > <nl> - < ItemGroup Label = " ProjectConfigurations " > <nl> - < ProjectConfiguration Include = " Debug | Win32 " > <nl> - < Configuration > Debug < / Configuration > <nl> - < Platform > Win32 < / Platform > <nl> - < / ProjectConfiguration > <nl> - < ProjectConfiguration Include = " Debug | x64 " > <nl> - < Configuration > Debug < / Configuration > <nl> - < Platform > x64 < / Platform > <nl> - < / ProjectConfiguration > <nl> - < ProjectConfiguration Include = " Release | Win32 " > <nl> - < Configuration > Release < / Configuration > <nl> - < Platform > Win32 < / Platform > <nl> - < / ProjectConfiguration > <nl> - < ProjectConfiguration Include = " Release | x64 " > <nl> - < Configuration > Release < / Configuration > <nl> - < Platform > x64 < / Platform > <nl> - < / ProjectConfiguration > <nl> - < / ItemGroup > <nl> - < PropertyGroup Label = " Globals " > <nl> - < ProjectGuid > { C9B06E6E - 3534 - 4E7B - 9C00 - C3EA33CC4E15 } < / ProjectGuid > <nl> - < RootNamespace > capstone_wrapper < / RootNamespace > <nl> - < / PropertyGroup > <nl> - < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . Default . props " / > <nl> - < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " Label = " Configuration " > <nl> - < ConfigurationType > StaticLibrary < / ConfigurationType > <nl> - < UseDebugLibraries > true < / UseDebugLibraries > <nl> - < PlatformToolset > v120_xp < / PlatformToolset > <nl> - < CharacterSet > MultiByte < / CharacterSet > <nl> - < / PropertyGroup > <nl> - < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | x64 ' " Label = " Configuration " > <nl> - < ConfigurationType > StaticLibrary < / ConfigurationType > <nl> - < UseDebugLibraries > true < / UseDebugLibraries > <nl> - < PlatformToolset > v120_xp < / PlatformToolset > <nl> - < CharacterSet > MultiByte < / CharacterSet > <nl> - < / PropertyGroup > <nl> - < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " Label = " Configuration " > <nl> - < ConfigurationType > StaticLibrary < / ConfigurationType > <nl> - < UseDebugLibraries > false < / UseDebugLibraries > <nl> - < PlatformToolset > v120_xp < / PlatformToolset > <nl> - < WholeProgramOptimization > true < / WholeProgramOptimization > <nl> - < CharacterSet > MultiByte < / CharacterSet > <nl> - < / PropertyGroup > <nl> - < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | x64 ' " Label = " Configuration " > <nl> - < ConfigurationType > StaticLibrary < / ConfigurationType > <nl> - < UseDebugLibraries > false < / UseDebugLibraries > <nl> - < PlatformToolset > v120_xp < / PlatformToolset > <nl> - < WholeProgramOptimization > true < / WholeProgramOptimization > <nl> - < CharacterSet > MultiByte < / CharacterSet > <nl> - < / PropertyGroup > <nl> - < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . props " / > <nl> - < ImportGroup Label = " ExtensionSettings " > <nl> - < / ImportGroup > <nl> - < ImportGroup Label = " PropertySheets " Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > <nl> - < Import Project = " $ ( UserRootDir ) \ Microsoft . Cpp . $ ( Platform ) . user . props " Condition = " exists ( ' $ ( UserRootDir ) \ Microsoft . Cpp . $ ( Platform ) . user . props ' ) " Label = " LocalAppDataPlatform " / > <nl> - < / ImportGroup > <nl> - < ImportGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | x64 ' " Label = " PropertySheets " > <nl> - < Import Project = " $ ( UserRootDir ) \ Microsoft . Cpp . $ ( Platform ) . user . props " Condition = " exists ( ' $ ( UserRootDir ) \ Microsoft . Cpp . $ ( Platform ) . user . props ' ) " Label = " LocalAppDataPlatform " / > <nl> - < / ImportGroup > <nl> - < ImportGroup Label = " PropertySheets " Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > <nl> - < Import Project = " $ ( UserRootDir ) \ Microsoft . Cpp . $ ( Platform ) . user . props " Condition = " exists ( ' $ ( UserRootDir ) \ Microsoft . Cpp . $ ( Platform ) . user . props ' ) " Label = " LocalAppDataPlatform " / > <nl> - < / ImportGroup > <nl> - < ImportGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | x64 ' " Label = " PropertySheets " > <nl> - < Import Project = " $ ( UserRootDir ) \ Microsoft . Cpp . $ ( Platform ) . user . props " Condition = " exists ( ' $ ( UserRootDir ) \ Microsoft . Cpp . $ ( Platform ) . user . props ' ) " Label = " LocalAppDataPlatform " / > <nl> - < / ImportGroup > <nl> - < PropertyGroup Label = " UserMacros " / > <nl> - < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > <nl> - < TargetExt > . lib < / TargetExt > <nl> - < OutDir > $ ( ProjectDir ) . . \ . . \ bin \ x32 \ < / OutDir > <nl> - < IntDir > $ ( Platform ) \ $ ( Configuration ) \ < / IntDir > <nl> - < / PropertyGroup > <nl> - < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | x64 ' " > <nl> - < TargetExt > . lib < / TargetExt > <nl> - < OutDir > $ ( ProjectDir ) . . \ . . \ bin \ x64 \ < / OutDir > <nl> - < / PropertyGroup > <nl> - < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > <nl> - < TargetExt > . lib < / TargetExt > <nl> - < OutDir > $ ( ProjectDir ) . . \ . . \ bin \ x32 \ < / OutDir > <nl> - < IntDir > $ ( Platform ) \ $ ( Configuration ) \ < / IntDir > <nl> - < / PropertyGroup > <nl> - < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | x64 ' " > <nl> - < TargetExt > . lib < / TargetExt > <nl> - < OutDir > $ ( ProjectDir ) . . \ . . \ bin \ x64 \ < / OutDir > <nl> - < / PropertyGroup > <nl> - < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > <nl> - < ClCompile > <nl> - < WarningLevel > Level3 < / WarningLevel > <nl> - < Optimization > Disabled < / Optimization > <nl> - < SDLCheck > true < / SDLCheck > <nl> - < / ClCompile > <nl> - < Link > <nl> - < GenerateDebugInformation > true < / GenerateDebugInformation > <nl> - < / Link > <nl> - < / ItemDefinitionGroup > <nl> - < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | x64 ' " > <nl> - < ClCompile > <nl> - < WarningLevel > Level3 < / WarningLevel > <nl> - < Optimization > Disabled < / Optimization > <nl> - < SDLCheck > true < / SDLCheck > <nl> - < / ClCompile > <nl> - < Link > <nl> - < GenerateDebugInformation > true < / GenerateDebugInformation > <nl> - < / Link > <nl> - < / ItemDefinitionGroup > <nl> - < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > <nl> - < ClCompile > <nl> - < WarningLevel > Level3 < / WarningLevel > <nl> - < Optimization > MaxSpeed < / Optimization > <nl> - < FunctionLevelLinking > true < / FunctionLevelLinking > <nl> - < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> - < SDLCheck > true < / SDLCheck > <nl> - < WholeProgramOptimization > false < / WholeProgramOptimization > <nl> - < / ClCompile > <nl> - < Link > <nl> - < GenerateDebugInformation > true < / GenerateDebugInformation > <nl> - < EnableCOMDATFolding > true < / EnableCOMDATFolding > <nl> - < OptimizeReferences > true < / OptimizeReferences > <nl> - < / Link > <nl> - < / ItemDefinitionGroup > <nl> - < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | x64 ' " > <nl> - < ClCompile > <nl> - < WarningLevel > Level3 < / WarningLevel > <nl> - < Optimization > MaxSpeed < / Optimization > <nl> - < FunctionLevelLinking > true < / FunctionLevelLinking > <nl> - < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> - < SDLCheck > true < / SDLCheck > <nl> - < WholeProgramOptimization > false < / WholeProgramOptimization > <nl> - < / ClCompile > <nl> - < Link > <nl> - < GenerateDebugInformation > true < / GenerateDebugInformation > <nl> - < EnableCOMDATFolding > true < / EnableCOMDATFolding > <nl> - < OptimizeReferences > true < / OptimizeReferences > <nl> - < / Link > <nl> - < / ItemDefinitionGroup > <nl> - < ItemGroup > <nl> - < ClCompile Include = " capstone_wrapper . cpp " / > <nl> - < / ItemGroup > <nl> - < ItemGroup > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ arm . h " / > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ arm64 . h " / > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ capstone . h " / > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ mips . h " / > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ platform . h " / > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ ppc . h " / > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ sparc . h " / > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ systemz . h " / > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ x86 . h " / > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ xcore . h " / > <nl> - < ClInclude Include = " capstone_wrapper . h " / > <nl> - < / ItemGroup > <nl> - < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . targets " / > <nl> - < ImportGroup Label = " ExtensionTargets " > <nl> - < / ImportGroup > <nl> - < / Project > <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index 798f98b3d . . 000000000 <nl> mmm a / src / capstone_wrapper / capstone_wrapper . vcxproj . filters <nl> ppp / dev / null <nl> <nl> -  < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> - < Project ToolsVersion = " 4 . 0 " xmlns = " http : / / schemas . microsoft . com / developer / msbuild / 2003 " > <nl> - < ItemGroup > <nl> - < Filter Include = " Source Files " > <nl> - < UniqueIdentifier > { 4FC737F1 - C7A5 - 4376 - A066 - 2A32D752A2FF } < / UniqueIdentifier > <nl> - < Extensions > cpp ; c ; cc ; cxx ; def ; odl ; idl ; hpj ; bat ; asm ; asmx < / Extensions > <nl> - < / Filter > <nl> - < Filter Include = " Header Files " > <nl> - < UniqueIdentifier > { 93995380 - 89BD - 4b04 - 88EB - 625FBE52EBFB } < / UniqueIdentifier > <nl> - < Extensions > h ; hh ; hpp ; hxx ; hm ; inl ; inc ; xsd < / Extensions > <nl> - < / Filter > <nl> - < Filter Include = " Header Files \ capstone " > <nl> - < UniqueIdentifier > { 4ccbf4c1 - 9486 - 4a56 - ae45 - 53ffa1bdea25 } < / UniqueIdentifier > <nl> - < / Filter > <nl> - < / ItemGroup > <nl> - < ItemGroup > <nl> - < ClCompile Include = " capstone_wrapper . cpp " > <nl> - < Filter > Source Files < / Filter > <nl> - < / ClCompile > <nl> - < / ItemGroup > <nl> - < ItemGroup > <nl> - < ClInclude Include = " capstone_wrapper . h " > <nl> - < Filter > Header Files < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ arm . h " > <nl> - < Filter > Header Files \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ arm64 . h " > <nl> - < Filter > Header Files \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ capstone . h " > <nl> - < Filter > Header Files \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ mips . h " > <nl> - < Filter > Header Files \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ platform . h " > <nl> - < Filter > Header Files \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ ppc . h " > <nl> - < Filter > Header Files \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ sparc . h " > <nl> - < Filter > Header Files \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ systemz . h " > <nl> - < Filter > Header Files \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ x86 . h " > <nl> - < Filter > Header Files \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " . . \ dbg \ capstone \ xcore . h " > <nl> - < Filter > Header Files \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < / ItemGroup > <nl> - < / Project > <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index 2a22e69ac . . 000000000 <nl> mmm a / src / capstone_wrapper / capstone_wrapper . vcxproj . user <nl> ppp / dev / null <nl> <nl> -  < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> - < Project ToolsVersion = " 12 . 0 " xmlns = " http : / / schemas . microsoft . com / developer / msbuild / 2003 " > <nl> - < PropertyGroup / > <nl> - < / Project > <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index a60373dce . . 000000000 <nl> mmm a / src / dbg / capstone / arm . h <nl> ppp / dev / null <nl> <nl> - # ifndef CAPSTONE_ARM_H <nl> - # define CAPSTONE_ARM_H <nl> - <nl> - / * Capstone Disassembly Engine * / <nl> - / * By Nguyen Anh Quynh < aquynh @ gmail . com > , 2013 - 2014 * / <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - <nl> - # include < stdint . h > <nl> - # include " platform . h " <nl> - <nl> - # ifdef _MSC_VER <nl> - # pragma warning ( disable : 4201 ) <nl> - # endif <nl> - <nl> - / / > ARM shift type <nl> - typedef enum arm_shifter <nl> - { <nl> - ARM_SFT_INVALID = 0 , <nl> - ARM_SFT_ASR , / / shift with immediate const <nl> - ARM_SFT_LSL , / / shift with immediate const <nl> - ARM_SFT_LSR , / / shift with immediate const <nl> - ARM_SFT_ROR , / / shift with immediate const <nl> - ARM_SFT_RRX , / / shift with immediate const <nl> - ARM_SFT_ASR_REG , / / shift with register <nl> - ARM_SFT_LSL_REG , / / shift with register <nl> - ARM_SFT_LSR_REG , / / shift with register <nl> - ARM_SFT_ROR_REG , / / shift with register <nl> - ARM_SFT_RRX_REG , / / shift with register <nl> - } arm_shifter ; <nl> - <nl> - / / > ARM condition code <nl> - typedef enum arm_cc <nl> - { <nl> - ARM_CC_INVALID = 0 , <nl> - ARM_CC_EQ , / / Equal Equal <nl> - ARM_CC_NE , / / Not equal Not equal , or unordered <nl> - ARM_CC_HS , / / Carry set > , = = , or unordered <nl> - ARM_CC_LO , / / Carry clear Less than <nl> - ARM_CC_MI , / / Minus , negative Less than <nl> - ARM_CC_PL , / / Plus , positive or zero > , = = , or unordered <nl> - ARM_CC_VS , / / Overflow Unordered <nl> - ARM_CC_VC , / / No overflow Not unordered <nl> - ARM_CC_HI , / / Unsigned higher Greater than , or unordered <nl> - ARM_CC_LS , / / Unsigned lower or same Less than or equal <nl> - ARM_CC_GE , / / Greater than or equal Greater than or equal <nl> - ARM_CC_LT , / / Less than Less than , or unordered <nl> - ARM_CC_GT , / / Greater than Greater than <nl> - ARM_CC_LE , / / Less than or equal < , = = , or unordered <nl> - ARM_CC_AL / / Always ( unconditional ) Always ( unconditional ) <nl> - } arm_cc ; <nl> - <nl> - typedef enum arm_sysreg <nl> - { <nl> - / / > Special registers for MSR <nl> - ARM_SYSREG_INVALID = 0 , <nl> - <nl> - / / SPSR * registers can be OR combined <nl> - ARM_SYSREG_SPSR_C = 1 , <nl> - ARM_SYSREG_SPSR_X = 2 , <nl> - ARM_SYSREG_SPSR_S = 4 , <nl> - ARM_SYSREG_SPSR_F = 8 , <nl> - <nl> - / / CPSR * registers can be OR combined <nl> - ARM_SYSREG_CPSR_C = 16 , <nl> - ARM_SYSREG_CPSR_X = 32 , <nl> - ARM_SYSREG_CPSR_S = 64 , <nl> - ARM_SYSREG_CPSR_F = 128 , <nl> - <nl> - / / independent registers <nl> - ARM_SYSREG_APSR = 256 , <nl> - ARM_SYSREG_APSR_G , <nl> - ARM_SYSREG_APSR_NZCVQ , <nl> - ARM_SYSREG_APSR_NZCVQG , <nl> - <nl> - ARM_SYSREG_IAPSR , <nl> - ARM_SYSREG_IAPSR_G , <nl> - ARM_SYSREG_IAPSR_NZCVQG , <nl> - <nl> - ARM_SYSREG_EAPSR , <nl> - ARM_SYSREG_EAPSR_G , <nl> - ARM_SYSREG_EAPSR_NZCVQG , <nl> - <nl> - ARM_SYSREG_XPSR , <nl> - ARM_SYSREG_XPSR_G , <nl> - ARM_SYSREG_XPSR_NZCVQG , <nl> - <nl> - ARM_SYSREG_IPSR , <nl> - ARM_SYSREG_EPSR , <nl> - ARM_SYSREG_IEPSR , <nl> - <nl> - ARM_SYSREG_MSP , <nl> - ARM_SYSREG_PSP , <nl> - ARM_SYSREG_PRIMASK , <nl> - ARM_SYSREG_BASEPRI , <nl> - ARM_SYSREG_BASEPRI_MAX , <nl> - ARM_SYSREG_FAULTMASK , <nl> - ARM_SYSREG_CONTROL , <nl> - } arm_sysreg ; <nl> - <nl> - / / > The memory barrier constants map directly to the 4 - bit encoding of <nl> - / / > the option field for Memory Barrier operations . <nl> - typedef enum arm_mem_barrier <nl> - { <nl> - ARM_MB_INVALID = 0 , <nl> - ARM_MB_RESERVED_0 , <nl> - ARM_MB_OSHLD , <nl> - ARM_MB_OSHST , <nl> - ARM_MB_OSH , <nl> - ARM_MB_RESERVED_4 , <nl> - ARM_MB_NSHLD , <nl> - ARM_MB_NSHST , <nl> - ARM_MB_NSH , <nl> - ARM_MB_RESERVED_8 , <nl> - ARM_MB_ISHLD , <nl> - ARM_MB_ISHST , <nl> - ARM_MB_ISH , <nl> - ARM_MB_RESERVED_12 , <nl> - ARM_MB_LD , <nl> - ARM_MB_ST , <nl> - ARM_MB_SY , <nl> - } arm_mem_barrier ; <nl> - <nl> - / / > Operand type for instruction ' s operands <nl> - typedef enum arm_op_type <nl> - { <nl> - ARM_OP_INVALID = 0 , / / = CS_OP_INVALID ( Uninitialized ) . <nl> - ARM_OP_REG , / / = CS_OP_REG ( Register operand ) . <nl> - ARM_OP_IMM , / / = CS_OP_IMM ( Immediate operand ) . <nl> - ARM_OP_MEM , / / = CS_OP_MEM ( Memory operand ) . <nl> - ARM_OP_FP , / / = CS_OP_FP ( Floating - Point operand ) . <nl> - ARM_OP_CIMM = 64 , / / C - Immediate ( coprocessor registers ) <nl> - ARM_OP_PIMM , / / P - Immediate ( coprocessor registers ) <nl> - ARM_OP_SETEND , / / operand for SETEND instruction <nl> - ARM_OP_SYSREG , / / MSR / MSR special register operand <nl> - } arm_op_type ; <nl> - <nl> - / / > Operand type for SETEND instruction <nl> - typedef enum arm_setend_type <nl> - { <nl> - ARM_SETEND_INVALID = 0 , / / Uninitialized . <nl> - ARM_SETEND_BE , / / BE operand . <nl> - ARM_SETEND_LE , / / LE operand <nl> - } arm_setend_type ; <nl> - <nl> - typedef enum arm_cpsmode_type <nl> - { <nl> - ARM_CPSMODE_INVALID = 0 , <nl> - ARM_CPSMODE_IE = 2 , <nl> - ARM_CPSMODE_ID = 3 <nl> - } arm_cpsmode_type ; <nl> - <nl> - / / > Operand type for SETEND instruction <nl> - typedef enum arm_cpsflag_type <nl> - { <nl> - ARM_CPSFLAG_INVALID = 0 , <nl> - ARM_CPSFLAG_F = 1 , <nl> - ARM_CPSFLAG_I = 2 , <nl> - ARM_CPSFLAG_A = 4 , <nl> - ARM_CPSFLAG_NONE = 16 , / / no flag <nl> - } arm_cpsflag_type ; <nl> - <nl> - / / > Data type for elements of vector instructions . <nl> - typedef enum arm_vectordata_type <nl> - { <nl> - ARM_VECTORDATA_INVALID = 0 , <nl> - <nl> - / / Integer type <nl> - ARM_VECTORDATA_I8 , <nl> - ARM_VECTORDATA_I16 , <nl> - ARM_VECTORDATA_I32 , <nl> - ARM_VECTORDATA_I64 , <nl> - <nl> - / / Signed integer type <nl> - ARM_VECTORDATA_S8 , <nl> - ARM_VECTORDATA_S16 , <nl> - ARM_VECTORDATA_S32 , <nl> - ARM_VECTORDATA_S64 , <nl> - <nl> - / / Unsigned integer type <nl> - ARM_VECTORDATA_U8 , <nl> - ARM_VECTORDATA_U16 , <nl> - ARM_VECTORDATA_U32 , <nl> - ARM_VECTORDATA_U64 , <nl> - <nl> - / / Data type for VMUL / VMULL <nl> - ARM_VECTORDATA_P8 , <nl> - <nl> - / / Floating type <nl> - ARM_VECTORDATA_F32 , <nl> - ARM_VECTORDATA_F64 , <nl> - <nl> - / / Convert float < - > float <nl> - ARM_VECTORDATA_F16F64 , / / f16 . f64 <nl> - ARM_VECTORDATA_F64F16 , / / f64 . f16 <nl> - ARM_VECTORDATA_F32F16 , / / f32 . f16 <nl> - ARM_VECTORDATA_F16F32 , / / f32 . f16 <nl> - ARM_VECTORDATA_F64F32 , / / f64 . f32 <nl> - ARM_VECTORDATA_F32F64 , / / f32 . f64 <nl> - <nl> - / / Convert integer < - > float <nl> - ARM_VECTORDATA_S32F32 , / / s32 . f32 <nl> - ARM_VECTORDATA_U32F32 , / / u32 . f32 <nl> - ARM_VECTORDATA_F32S32 , / / f32 . s32 <nl> - ARM_VECTORDATA_F32U32 , / / f32 . u32 <nl> - ARM_VECTORDATA_F64S16 , / / f64 . s16 <nl> - ARM_VECTORDATA_F32S16 , / / f32 . s16 <nl> - ARM_VECTORDATA_F64S32 , / / f64 . s32 <nl> - ARM_VECTORDATA_S16F64 , / / s16 . f64 <nl> - ARM_VECTORDATA_S16F32 , / / s16 . f64 <nl> - ARM_VECTORDATA_S32F64 , / / s32 . f64 <nl> - ARM_VECTORDATA_U16F64 , / / u16 . f64 <nl> - ARM_VECTORDATA_U16F32 , / / u16 . f32 <nl> - ARM_VECTORDATA_U32F64 , / / u32 . f64 <nl> - ARM_VECTORDATA_F64U16 , / / f64 . u16 <nl> - ARM_VECTORDATA_F32U16 , / / f32 . u16 <nl> - ARM_VECTORDATA_F64U32 , / / f64 . u32 <nl> - } arm_vectordata_type ; <nl> - <nl> - / / Instruction ' s operand referring to memory <nl> - / / This is associated with ARM_OP_MEM operand type above <nl> - typedef struct arm_op_mem <nl> - { <nl> - unsigned int base ; / / base register <nl> - unsigned int index ; / / index register <nl> - int scale ; / / scale for index register ( can be 1 , or - 1 ) <nl> - int disp ; / / displacement / offset value <nl> - } arm_op_mem ; <nl> - <nl> - / / Instruction operand <nl> - typedef struct cs_arm_op <nl> - { <nl> - int vector_index ; / / Vector Index for some vector operands ( or - 1 if irrelevant ) <nl> - struct <nl> - { <nl> - arm_shifter type ; <nl> - unsigned int value ; <nl> - } shift ; <nl> - arm_op_type type ; / / operand type <nl> - union <nl> - { <nl> - unsigned int reg ; / / register value for REG / SYSREG operand <nl> - int32_t imm ; / / immediate value for C - IMM , P - IMM or IMM operand <nl> - double fp ; / / floating point value for FP operand <nl> - arm_op_mem mem ; / / base / index / scale / disp value for MEM operand <nl> - arm_setend_type setend ; / / SETEND instruction ' s operand type <nl> - } ; <nl> - / / in some instructions , an operand can be subtracted or added to <nl> - / / the base register , <nl> - bool subtracted ; / / if TRUE , this operand is subtracted . otherwise , it is added . <nl> - } cs_arm_op ; <nl> - <nl> - / / Instruction structure <nl> - typedef struct cs_arm <nl> - { <nl> - bool usermode ; / / User - mode registers to be loaded ( for LDM / STM instructions ) <nl> - int vector_size ; / / Scalar size for vector instructions <nl> - arm_vectordata_type vector_data ; / / Data type for elements of vector instructions <nl> - arm_cpsmode_type cps_mode ; / / CPS mode for CPS instruction <nl> - arm_cpsflag_type cps_flag ; / / CPS mode for CPS instruction <nl> - arm_cc cc ; / / conditional code for this insn <nl> - bool update_flags ; / / does this insn update flags ? <nl> - bool writeback ; / / does this insn write - back ? <nl> - arm_mem_barrier mem_barrier ; / / Option for some memory barrier instructions <nl> - <nl> - / / Number of operands of this instruction , <nl> - / / or 0 when instruction has no operand . <nl> - uint8_t op_count ; <nl> - <nl> - cs_arm_op operands [ 36 ] ; / / operands for this instruction . <nl> - } cs_arm ; <nl> - <nl> - / / > ARM registers <nl> - typedef enum arm_reg <nl> - { <nl> - ARM_REG_INVALID = 0 , <nl> - ARM_REG_APSR , <nl> - ARM_REG_APSR_NZCV , <nl> - ARM_REG_CPSR , <nl> - ARM_REG_FPEXC , <nl> - ARM_REG_FPINST , <nl> - ARM_REG_FPSCR , <nl> - ARM_REG_FPSCR_NZCV , <nl> - ARM_REG_FPSID , <nl> - ARM_REG_ITSTATE , <nl> - ARM_REG_LR , <nl> - ARM_REG_PC , <nl> - ARM_REG_SP , <nl> - ARM_REG_SPSR , <nl> - ARM_REG_D0 , <nl> - ARM_REG_D1 , <nl> - ARM_REG_D2 , <nl> - ARM_REG_D3 , <nl> - ARM_REG_D4 , <nl> - ARM_REG_D5 , <nl> - ARM_REG_D6 , <nl> - ARM_REG_D7 , <nl> - ARM_REG_D8 , <nl> - ARM_REG_D9 , <nl> - ARM_REG_D10 , <nl> - ARM_REG_D11 , <nl> - ARM_REG_D12 , <nl> - ARM_REG_D13 , <nl> - ARM_REG_D14 , <nl> - ARM_REG_D15 , <nl> - ARM_REG_D16 , <nl> - ARM_REG_D17 , <nl> - ARM_REG_D18 , <nl> - ARM_REG_D19 , <nl> - ARM_REG_D20 , <nl> - ARM_REG_D21 , <nl> - ARM_REG_D22 , <nl> - ARM_REG_D23 , <nl> - ARM_REG_D24 , <nl> - ARM_REG_D25 , <nl> - ARM_REG_D26 , <nl> - ARM_REG_D27 , <nl> - ARM_REG_D28 , <nl> - ARM_REG_D29 , <nl> - ARM_REG_D30 , <nl> - ARM_REG_D31 , <nl> - ARM_REG_FPINST2 , <nl> - ARM_REG_MVFR0 , <nl> - ARM_REG_MVFR1 , <nl> - ARM_REG_MVFR2 , <nl> - ARM_REG_Q0 , <nl> - ARM_REG_Q1 , <nl> - ARM_REG_Q2 , <nl> - ARM_REG_Q3 , <nl> - ARM_REG_Q4 , <nl> - ARM_REG_Q5 , <nl> - ARM_REG_Q6 , <nl> - ARM_REG_Q7 , <nl> - ARM_REG_Q8 , <nl> - ARM_REG_Q9 , <nl> - ARM_REG_Q10 , <nl> - ARM_REG_Q11 , <nl> - ARM_REG_Q12 , <nl> - ARM_REG_Q13 , <nl> - ARM_REG_Q14 , <nl> - ARM_REG_Q15 , <nl> - ARM_REG_R0 , <nl> - ARM_REG_R1 , <nl> - ARM_REG_R2 , <nl> - ARM_REG_R3 , <nl> - ARM_REG_R4 , <nl> - ARM_REG_R5 , <nl> - ARM_REG_R6 , <nl> - ARM_REG_R7 , <nl> - ARM_REG_R8 , <nl> - ARM_REG_R9 , <nl> - ARM_REG_R10 , <nl> - ARM_REG_R11 , <nl> - ARM_REG_R12 , <nl> - ARM_REG_S0 , <nl> - ARM_REG_S1 , <nl> - ARM_REG_S2 , <nl> - ARM_REG_S3 , <nl> - ARM_REG_S4 , <nl> - ARM_REG_S5 , <nl> - ARM_REG_S6 , <nl> - ARM_REG_S7 , <nl> - ARM_REG_S8 , <nl> - ARM_REG_S9 , <nl> - ARM_REG_S10 , <nl> - ARM_REG_S11 , <nl> - ARM_REG_S12 , <nl> - ARM_REG_S13 , <nl> - ARM_REG_S14 , <nl> - ARM_REG_S15 , <nl> - ARM_REG_S16 , <nl> - ARM_REG_S17 , <nl> - ARM_REG_S18 , <nl> - ARM_REG_S19 , <nl> - ARM_REG_S20 , <nl> - ARM_REG_S21 , <nl> - ARM_REG_S22 , <nl> - ARM_REG_S23 , <nl> - ARM_REG_S24 , <nl> - ARM_REG_S25 , <nl> - ARM_REG_S26 , <nl> - ARM_REG_S27 , <nl> - ARM_REG_S28 , <nl> - ARM_REG_S29 , <nl> - ARM_REG_S30 , <nl> - ARM_REG_S31 , <nl> - <nl> - ARM_REG_ENDING , / / < - - mark the end of the list or registers <nl> - <nl> - / / > alias registers <nl> - ARM_REG_R13 = ARM_REG_SP , <nl> - ARM_REG_R14 = ARM_REG_LR , <nl> - ARM_REG_R15 = ARM_REG_PC , <nl> - <nl> - ARM_REG_SB = ARM_REG_R9 , <nl> - ARM_REG_SL = ARM_REG_R10 , <nl> - ARM_REG_FP = ARM_REG_R11 , <nl> - ARM_REG_IP = ARM_REG_R12 , <nl> - } arm_reg ; <nl> - <nl> - / / > ARM instruction <nl> - typedef enum arm_insn <nl> - { <nl> - ARM_INS_INVALID = 0 , <nl> - <nl> - ARM_INS_ADC , <nl> - ARM_INS_ADD , <nl> - ARM_INS_ADR , <nl> - ARM_INS_AESD , <nl> - ARM_INS_AESE , <nl> - ARM_INS_AESIMC , <nl> - ARM_INS_AESMC , <nl> - ARM_INS_AND , <nl> - ARM_INS_BFC , <nl> - ARM_INS_BFI , <nl> - ARM_INS_BIC , <nl> - ARM_INS_BKPT , <nl> - ARM_INS_BL , <nl> - ARM_INS_BLX , <nl> - ARM_INS_BX , <nl> - ARM_INS_BXJ , <nl> - ARM_INS_B , <nl> - ARM_INS_CDP , <nl> - ARM_INS_CDP2 , <nl> - ARM_INS_CLREX , <nl> - ARM_INS_CLZ , <nl> - ARM_INS_CMN , <nl> - ARM_INS_CMP , <nl> - ARM_INS_CPS , <nl> - ARM_INS_CRC32B , <nl> - ARM_INS_CRC32CB , <nl> - ARM_INS_CRC32CH , <nl> - ARM_INS_CRC32CW , <nl> - ARM_INS_CRC32H , <nl> - ARM_INS_CRC32W , <nl> - ARM_INS_DBG , <nl> - ARM_INS_DMB , <nl> - ARM_INS_DSB , <nl> - ARM_INS_EOR , <nl> - ARM_INS_VMOV , <nl> - ARM_INS_FLDMDBX , <nl> - ARM_INS_FLDMIAX , <nl> - ARM_INS_VMRS , <nl> - ARM_INS_FSTMDBX , <nl> - ARM_INS_FSTMIAX , <nl> - ARM_INS_HINT , <nl> - ARM_INS_HLT , <nl> - ARM_INS_ISB , <nl> - ARM_INS_LDA , <nl> - ARM_INS_LDAB , <nl> - ARM_INS_LDAEX , <nl> - ARM_INS_LDAEXB , <nl> - ARM_INS_LDAEXD , <nl> - ARM_INS_LDAEXH , <nl> - ARM_INS_LDAH , <nl> - ARM_INS_LDC2L , <nl> - ARM_INS_LDC2 , <nl> - ARM_INS_LDCL , <nl> - ARM_INS_LDC , <nl> - ARM_INS_LDMDA , <nl> - ARM_INS_LDMDB , <nl> - ARM_INS_LDM , <nl> - ARM_INS_LDMIB , <nl> - ARM_INS_LDRBT , <nl> - ARM_INS_LDRB , <nl> - ARM_INS_LDRD , <nl> - ARM_INS_LDREX , <nl> - ARM_INS_LDREXB , <nl> - ARM_INS_LDREXD , <nl> - ARM_INS_LDREXH , <nl> - ARM_INS_LDRH , <nl> - ARM_INS_LDRHT , <nl> - ARM_INS_LDRSB , <nl> - ARM_INS_LDRSBT , <nl> - ARM_INS_LDRSH , <nl> - ARM_INS_LDRSHT , <nl> - ARM_INS_LDRT , <nl> - ARM_INS_LDR , <nl> - ARM_INS_MCR , <nl> - ARM_INS_MCR2 , <nl> - ARM_INS_MCRR , <nl> - ARM_INS_MCRR2 , <nl> - ARM_INS_MLA , <nl> - ARM_INS_MLS , <nl> - ARM_INS_MOV , <nl> - ARM_INS_MOVT , <nl> - ARM_INS_MOVW , <nl> - ARM_INS_MRC , <nl> - ARM_INS_MRC2 , <nl> - ARM_INS_MRRC , <nl> - ARM_INS_MRRC2 , <nl> - ARM_INS_MRS , <nl> - ARM_INS_MSR , <nl> - ARM_INS_MUL , <nl> - ARM_INS_MVN , <nl> - ARM_INS_ORR , <nl> - ARM_INS_PKHBT , <nl> - ARM_INS_PKHTB , <nl> - ARM_INS_PLDW , <nl> - ARM_INS_PLD , <nl> - ARM_INS_PLI , <nl> - ARM_INS_QADD , <nl> - ARM_INS_QADD16 , <nl> - ARM_INS_QADD8 , <nl> - ARM_INS_QASX , <nl> - ARM_INS_QDADD , <nl> - ARM_INS_QDSUB , <nl> - ARM_INS_QSAX , <nl> - ARM_INS_QSUB , <nl> - ARM_INS_QSUB16 , <nl> - ARM_INS_QSUB8 , <nl> - ARM_INS_RBIT , <nl> - ARM_INS_REV , <nl> - ARM_INS_REV16 , <nl> - ARM_INS_REVSH , <nl> - ARM_INS_RFEDA , <nl> - ARM_INS_RFEDB , <nl> - ARM_INS_RFEIA , <nl> - ARM_INS_RFEIB , <nl> - ARM_INS_RSB , <nl> - ARM_INS_RSC , <nl> - ARM_INS_SADD16 , <nl> - ARM_INS_SADD8 , <nl> - ARM_INS_SASX , <nl> - ARM_INS_SBC , <nl> - ARM_INS_SBFX , <nl> - ARM_INS_SDIV , <nl> - ARM_INS_SEL , <nl> - ARM_INS_SETEND , <nl> - ARM_INS_SHA1C , <nl> - ARM_INS_SHA1H , <nl> - ARM_INS_SHA1M , <nl> - ARM_INS_SHA1P , <nl> - ARM_INS_SHA1SU0 , <nl> - ARM_INS_SHA1SU1 , <nl> - ARM_INS_SHA256H , <nl> - ARM_INS_SHA256H2 , <nl> - ARM_INS_SHA256SU0 , <nl> - ARM_INS_SHA256SU1 , <nl> - ARM_INS_SHADD16 , <nl> - ARM_INS_SHADD8 , <nl> - ARM_INS_SHASX , <nl> - ARM_INS_SHSAX , <nl> - ARM_INS_SHSUB16 , <nl> - ARM_INS_SHSUB8 , <nl> - ARM_INS_SMC , <nl> - ARM_INS_SMLABB , <nl> - ARM_INS_SMLABT , <nl> - ARM_INS_SMLAD , <nl> - ARM_INS_SMLADX , <nl> - ARM_INS_SMLAL , <nl> - ARM_INS_SMLALBB , <nl> - ARM_INS_SMLALBT , <nl> - ARM_INS_SMLALD , <nl> - ARM_INS_SMLALDX , <nl> - ARM_INS_SMLALTB , <nl> - ARM_INS_SMLALTT , <nl> - ARM_INS_SMLATB , <nl> - ARM_INS_SMLATT , <nl> - ARM_INS_SMLAWB , <nl> - ARM_INS_SMLAWT , <nl> - ARM_INS_SMLSD , <nl> - ARM_INS_SMLSDX , <nl> - ARM_INS_SMLSLD , <nl> - ARM_INS_SMLSLDX , <nl> - ARM_INS_SMMLA , <nl> - ARM_INS_SMMLAR , <nl> - ARM_INS_SMMLS , <nl> - ARM_INS_SMMLSR , <nl> - ARM_INS_SMMUL , <nl> - ARM_INS_SMMULR , <nl> - ARM_INS_SMUAD , <nl> - ARM_INS_SMUADX , <nl> - ARM_INS_SMULBB , <nl> - ARM_INS_SMULBT , <nl> - ARM_INS_SMULL , <nl> - ARM_INS_SMULTB , <nl> - ARM_INS_SMULTT , <nl> - ARM_INS_SMULWB , <nl> - ARM_INS_SMULWT , <nl> - ARM_INS_SMUSD , <nl> - ARM_INS_SMUSDX , <nl> - ARM_INS_SRSDA , <nl> - ARM_INS_SRSDB , <nl> - ARM_INS_SRSIA , <nl> - ARM_INS_SRSIB , <nl> - ARM_INS_SSAT , <nl> - ARM_INS_SSAT16 , <nl> - ARM_INS_SSAX , <nl> - ARM_INS_SSUB16 , <nl> - ARM_INS_SSUB8 , <nl> - ARM_INS_STC2L , <nl> - ARM_INS_STC2 , <nl> - ARM_INS_STCL , <nl> - ARM_INS_STC , <nl> - ARM_INS_STL , <nl> - ARM_INS_STLB , <nl> - ARM_INS_STLEX , <nl> - ARM_INS_STLEXB , <nl> - ARM_INS_STLEXD , <nl> - ARM_INS_STLEXH , <nl> - ARM_INS_STLH , <nl> - ARM_INS_STMDA , <nl> - ARM_INS_STMDB , <nl> - ARM_INS_STM , <nl> - ARM_INS_STMIB , <nl> - ARM_INS_STRBT , <nl> - ARM_INS_STRB , <nl> - ARM_INS_STRD , <nl> - ARM_INS_STREX , <nl> - ARM_INS_STREXB , <nl> - ARM_INS_STREXD , <nl> - ARM_INS_STREXH , <nl> - ARM_INS_STRH , <nl> - ARM_INS_STRHT , <nl> - ARM_INS_STRT , <nl> - ARM_INS_STR , <nl> - ARM_INS_SUB , <nl> - ARM_INS_SVC , <nl> - ARM_INS_SWP , <nl> - ARM_INS_SWPB , <nl> - ARM_INS_SXTAB , <nl> - ARM_INS_SXTAB16 , <nl> - ARM_INS_SXTAH , <nl> - ARM_INS_SXTB , <nl> - ARM_INS_SXTB16 , <nl> - ARM_INS_SXTH , <nl> - ARM_INS_TEQ , <nl> - ARM_INS_TRAP , <nl> - ARM_INS_TST , <nl> - ARM_INS_UADD16 , <nl> - ARM_INS_UADD8 , <nl> - ARM_INS_UASX , <nl> - ARM_INS_UBFX , <nl> - ARM_INS_UDF , <nl> - ARM_INS_UDIV , <nl> - ARM_INS_UHADD16 , <nl> - ARM_INS_UHADD8 , <nl> - ARM_INS_UHASX , <nl> - ARM_INS_UHSAX , <nl> - ARM_INS_UHSUB16 , <nl> - ARM_INS_UHSUB8 , <nl> - ARM_INS_UMAAL , <nl> - ARM_INS_UMLAL , <nl> - ARM_INS_UMULL , <nl> - ARM_INS_UQADD16 , <nl> - ARM_INS_UQADD8 , <nl> - ARM_INS_UQASX , <nl> - ARM_INS_UQSAX , <nl> - ARM_INS_UQSUB16 , <nl> - ARM_INS_UQSUB8 , <nl> - ARM_INS_USAD8 , <nl> - ARM_INS_USADA8 , <nl> - ARM_INS_USAT , <nl> - ARM_INS_USAT16 , <nl> - ARM_INS_USAX , <nl> - ARM_INS_USUB16 , <nl> - ARM_INS_USUB8 , <nl> - ARM_INS_UXTAB , <nl> - ARM_INS_UXTAB16 , <nl> - ARM_INS_UXTAH , <nl> - ARM_INS_UXTB , <nl> - ARM_INS_UXTB16 , <nl> - ARM_INS_UXTH , <nl> - ARM_INS_VABAL , <nl> - ARM_INS_VABA , <nl> - ARM_INS_VABDL , <nl> - ARM_INS_VABD , <nl> - ARM_INS_VABS , <nl> - ARM_INS_VACGE , <nl> - ARM_INS_VACGT , <nl> - ARM_INS_VADD , <nl> - ARM_INS_VADDHN , <nl> - ARM_INS_VADDL , <nl> - ARM_INS_VADDW , <nl> - ARM_INS_VAND , <nl> - ARM_INS_VBIC , <nl> - ARM_INS_VBIF , <nl> - ARM_INS_VBIT , <nl> - ARM_INS_VBSL , <nl> - ARM_INS_VCEQ , <nl> - ARM_INS_VCGE , <nl> - ARM_INS_VCGT , <nl> - ARM_INS_VCLE , <nl> - ARM_INS_VCLS , <nl> - ARM_INS_VCLT , <nl> - ARM_INS_VCLZ , <nl> - ARM_INS_VCMP , <nl> - ARM_INS_VCMPE , <nl> - ARM_INS_VCNT , <nl> - ARM_INS_VCVTA , <nl> - ARM_INS_VCVTB , <nl> - ARM_INS_VCVT , <nl> - ARM_INS_VCVTM , <nl> - ARM_INS_VCVTN , <nl> - ARM_INS_VCVTP , <nl> - ARM_INS_VCVTT , <nl> - ARM_INS_VDIV , <nl> - ARM_INS_VDUP , <nl> - ARM_INS_VEOR , <nl> - ARM_INS_VEXT , <nl> - ARM_INS_VFMA , <nl> - ARM_INS_VFMS , <nl> - ARM_INS_VFNMA , <nl> - ARM_INS_VFNMS , <nl> - ARM_INS_VHADD , <nl> - ARM_INS_VHSUB , <nl> - ARM_INS_VLD1 , <nl> - ARM_INS_VLD2 , <nl> - ARM_INS_VLD3 , <nl> - ARM_INS_VLD4 , <nl> - ARM_INS_VLDMDB , <nl> - ARM_INS_VLDMIA , <nl> - ARM_INS_VLDR , <nl> - ARM_INS_VMAXNM , <nl> - ARM_INS_VMAX , <nl> - ARM_INS_VMINNM , <nl> - ARM_INS_VMIN , <nl> - ARM_INS_VMLA , <nl> - ARM_INS_VMLAL , <nl> - ARM_INS_VMLS , <nl> - ARM_INS_VMLSL , <nl> - ARM_INS_VMOVL , <nl> - ARM_INS_VMOVN , <nl> - ARM_INS_VMSR , <nl> - ARM_INS_VMUL , <nl> - ARM_INS_VMULL , <nl> - ARM_INS_VMVN , <nl> - ARM_INS_VNEG , <nl> - ARM_INS_VNMLA , <nl> - ARM_INS_VNMLS , <nl> - ARM_INS_VNMUL , <nl> - ARM_INS_VORN , <nl> - ARM_INS_VORR , <nl> - ARM_INS_VPADAL , <nl> - ARM_INS_VPADDL , <nl> - ARM_INS_VPADD , <nl> - ARM_INS_VPMAX , <nl> - ARM_INS_VPMIN , <nl> - ARM_INS_VQABS , <nl> - ARM_INS_VQADD , <nl> - ARM_INS_VQDMLAL , <nl> - ARM_INS_VQDMLSL , <nl> - ARM_INS_VQDMULH , <nl> - ARM_INS_VQDMULL , <nl> - ARM_INS_VQMOVUN , <nl> - ARM_INS_VQMOVN , <nl> - ARM_INS_VQNEG , <nl> - ARM_INS_VQRDMULH , <nl> - ARM_INS_VQRSHL , <nl> - ARM_INS_VQRSHRN , <nl> - ARM_INS_VQRSHRUN , <nl> - ARM_INS_VQSHL , <nl> - ARM_INS_VQSHLU , <nl> - ARM_INS_VQSHRN , <nl> - ARM_INS_VQSHRUN , <nl> - ARM_INS_VQSUB , <nl> - ARM_INS_VRADDHN , <nl> - ARM_INS_VRECPE , <nl> - ARM_INS_VRECPS , <nl> - ARM_INS_VREV16 , <nl> - ARM_INS_VREV32 , <nl> - ARM_INS_VREV64 , <nl> - ARM_INS_VRHADD , <nl> - ARM_INS_VRINTA , <nl> - ARM_INS_VRINTM , <nl> - ARM_INS_VRINTN , <nl> - ARM_INS_VRINTP , <nl> - ARM_INS_VRINTR , <nl> - ARM_INS_VRINTX , <nl> - ARM_INS_VRINTZ , <nl> - ARM_INS_VRSHL , <nl> - ARM_INS_VRSHRN , <nl> - ARM_INS_VRSHR , <nl> - ARM_INS_VRSQRTE , <nl> - ARM_INS_VRSQRTS , <nl> - ARM_INS_VRSRA , <nl> - ARM_INS_VRSUBHN , <nl> - ARM_INS_VSELEQ , <nl> - ARM_INS_VSELGE , <nl> - ARM_INS_VSELGT , <nl> - ARM_INS_VSELVS , <nl> - ARM_INS_VSHLL , <nl> - ARM_INS_VSHL , <nl> - ARM_INS_VSHRN , <nl> - ARM_INS_VSHR , <nl> - ARM_INS_VSLI , <nl> - ARM_INS_VSQRT , <nl> - ARM_INS_VSRA , <nl> - ARM_INS_VSRI , <nl> - ARM_INS_VST1 , <nl> - ARM_INS_VST2 , <nl> - ARM_INS_VST3 , <nl> - ARM_INS_VST4 , <nl> - ARM_INS_VSTMDB , <nl> - ARM_INS_VSTMIA , <nl> - ARM_INS_VSTR , <nl> - ARM_INS_VSUB , <nl> - ARM_INS_VSUBHN , <nl> - ARM_INS_VSUBL , <nl> - ARM_INS_VSUBW , <nl> - ARM_INS_VSWP , <nl> - ARM_INS_VTBL , <nl> - ARM_INS_VTBX , <nl> - ARM_INS_VCVTR , <nl> - ARM_INS_VTRN , <nl> - ARM_INS_VTST , <nl> - ARM_INS_VUZP , <nl> - ARM_INS_VZIP , <nl> - ARM_INS_ADDW , <nl> - ARM_INS_ASR , <nl> - ARM_INS_DCPS1 , <nl> - ARM_INS_DCPS2 , <nl> - ARM_INS_DCPS3 , <nl> - ARM_INS_IT , <nl> - ARM_INS_LSL , <nl> - ARM_INS_LSR , <nl> - ARM_INS_ASRS , <nl> - ARM_INS_LSRS , <nl> - ARM_INS_ORN , <nl> - ARM_INS_ROR , <nl> - ARM_INS_RRX , <nl> - ARM_INS_SUBS , <nl> - ARM_INS_SUBW , <nl> - ARM_INS_TBB , <nl> - ARM_INS_TBH , <nl> - ARM_INS_CBNZ , <nl> - ARM_INS_CBZ , <nl> - ARM_INS_MOVS , <nl> - ARM_INS_POP , <nl> - ARM_INS_PUSH , <nl> - <nl> - / / special instructions <nl> - ARM_INS_NOP , <nl> - ARM_INS_YIELD , <nl> - ARM_INS_WFE , <nl> - ARM_INS_WFI , <nl> - ARM_INS_SEV , <nl> - ARM_INS_SEVL , <nl> - ARM_INS_VPUSH , <nl> - ARM_INS_VPOP , <nl> - <nl> - ARM_INS_ENDING , / / < - - mark the end of the list of instructions <nl> - } arm_insn ; <nl> - <nl> - / / > Group of ARM instructions <nl> - typedef enum arm_insn_group <nl> - { <nl> - ARM_GRP_INVALID = 0 , / / = CS_GRP_INVALID <nl> - <nl> - / / > Generic groups <nl> - / / all jump instructions ( conditional + direct + indirect jumps ) <nl> - ARM_GRP_JUMP , / / = CS_GRP_JUMP <nl> - <nl> - / / > Architecture - specific groups <nl> - ARM_GRP_CRYPTO = 128 , <nl> - ARM_GRP_DATABARRIER , <nl> - ARM_GRP_DIVIDE , <nl> - ARM_GRP_FPARMV8 , <nl> - ARM_GRP_MULTPRO , <nl> - ARM_GRP_NEON , <nl> - ARM_GRP_T2EXTRACTPACK , <nl> - ARM_GRP_THUMB2DSP , <nl> - ARM_GRP_TRUSTZONE , <nl> - ARM_GRP_V4T , <nl> - ARM_GRP_V5T , <nl> - ARM_GRP_V5TE , <nl> - ARM_GRP_V6 , <nl> - ARM_GRP_V6T2 , <nl> - ARM_GRP_V7 , <nl> - ARM_GRP_V8 , <nl> - ARM_GRP_VFP2 , <nl> - ARM_GRP_VFP3 , <nl> - ARM_GRP_VFP4 , <nl> - ARM_GRP_ARM , <nl> - ARM_GRP_MCLASS , <nl> - ARM_GRP_NOTMCLASS , <nl> - ARM_GRP_THUMB , <nl> - ARM_GRP_THUMB1ONLY , <nl> - ARM_GRP_THUMB2 , <nl> - ARM_GRP_PREV8 , <nl> - ARM_GRP_FPVMLX , <nl> - ARM_GRP_MULOPS , <nl> - ARM_GRP_CRC , <nl> - ARM_GRP_DPVFP , <nl> - ARM_GRP_V6M , <nl> - <nl> - ARM_GRP_ENDING , <nl> - } arm_insn_group ; <nl> - <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> - <nl> - # endif <nl> deleted file mode 100644 <nl> index 4b6354fc0 . . 000000000 <nl> mmm a / src / dbg / capstone / arm64 . h <nl> ppp / dev / null <nl> <nl> - # ifndef CAPSTONE_ARM64_H <nl> - # define CAPSTONE_ARM64_H <nl> - <nl> - / * Capstone Disassembly Engine * / <nl> - / * By Nguyen Anh Quynh < aquynh @ gmail . com > , 2013 - 2014 * / <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - <nl> - # include < stdint . h > <nl> - # include " platform . h " <nl> - <nl> - # ifdef _MSC_VER <nl> - # pragma warning ( disable : 4201 ) <nl> - # endif <nl> - <nl> - / / > ARM64 shift type <nl> - typedef enum arm64_shifter <nl> - { <nl> - ARM64_SFT_INVALID = 0 , <nl> - ARM64_SFT_LSL = 1 , <nl> - ARM64_SFT_MSL = 2 , <nl> - ARM64_SFT_LSR = 3 , <nl> - ARM64_SFT_ASR = 4 , <nl> - ARM64_SFT_ROR = 5 , <nl> - } arm64_shifter ; <nl> - <nl> - / / > ARM64 extender type <nl> - typedef enum arm64_extender <nl> - { <nl> - ARM64_EXT_INVALID = 0 , <nl> - ARM64_EXT_UXTB = 1 , <nl> - ARM64_EXT_UXTH = 2 , <nl> - ARM64_EXT_UXTW = 3 , <nl> - ARM64_EXT_UXTX = 4 , <nl> - ARM64_EXT_SXTB = 5 , <nl> - ARM64_EXT_SXTH = 6 , <nl> - ARM64_EXT_SXTW = 7 , <nl> - ARM64_EXT_SXTX = 8 , <nl> - } arm64_extender ; <nl> - <nl> - / / > ARM64 condition code <nl> - typedef enum arm64_cc <nl> - { <nl> - ARM64_CC_INVALID = 0 , <nl> - ARM64_CC_EQ = 1 , / / Equal <nl> - ARM64_CC_NE = 2 , / / Not equal : Not equal , or unordered <nl> - ARM64_CC_HS = 3 , / / Unsigned higher or same : > , = = , or unordered <nl> - ARM64_CC_LO = 4 , / / Unsigned lower or same : Less than <nl> - ARM64_CC_MI = 5 , / / Minus , negative : Less than <nl> - ARM64_CC_PL = 6 , / / Plus , positive or zero : > , = = , or unordered <nl> - ARM64_CC_VS = 7 , / / Overflow : Unordered <nl> - ARM64_CC_VC = 8 , / / No overflow : Ordered <nl> - ARM64_CC_HI = 9 , / / Unsigned higher : Greater than , or unordered <nl> - ARM64_CC_LS = 10 , / / Unsigned lower or same : Less than or equal <nl> - ARM64_CC_GE = 11 , / / Greater than or equal : Greater than or equal <nl> - ARM64_CC_LT = 12 , / / Less than : Less than , or unordered <nl> - ARM64_CC_GT = 13 , / / Signed greater than : Greater than <nl> - ARM64_CC_LE = 14 , / / Signed less than or equal : < , = = , or unordered <nl> - ARM64_CC_AL = 15 , / / Always ( unconditional ) : Always ( unconditional ) <nl> - ARM64_CC_NV = 16 , / / Always ( unconditional ) : Always ( unconditional ) <nl> - / / Note the NV exists purely to disassemble 0b1111 . Execution <nl> - / / is " always " . <nl> - } arm64_cc ; <nl> - <nl> - / / > System registers <nl> - typedef enum arm64_mrs_reg <nl> - { <nl> - / / > System registers for MRS <nl> - ARM64_SYSREG_INVALID = 0 , <nl> - ARM64_SYSREG_MDCCSR_EL0 = 0x9808 , / / 10 011 0000 0001 000 <nl> - ARM64_SYSREG_DBGDTRRX_EL0 = 0x9828 , / / 10 011 0000 0101 000 <nl> - ARM64_SYSREG_MDRAR_EL1 = 0x8080 , / / 10 000 0001 0000 000 <nl> - ARM64_SYSREG_OSLSR_EL1 = 0x808c , / / 10 000 0001 0001 100 <nl> - ARM64_SYSREG_DBGAUTHSTATUS_EL1 = 0x83f6 , / / 10 000 0111 1110 110 <nl> - ARM64_SYSREG_PMCEID0_EL0 = 0xdce6 , / / 11 011 1001 1100 110 <nl> - ARM64_SYSREG_PMCEID1_EL0 = 0xdce7 , / / 11 011 1001 1100 111 <nl> - ARM64_SYSREG_MIDR_EL1 = 0xc000 , / / 11 000 0000 0000 000 <nl> - ARM64_SYSREG_CCSIDR_EL1 = 0xc800 , / / 11 001 0000 0000 000 <nl> - ARM64_SYSREG_CLIDR_EL1 = 0xc801 , / / 11 001 0000 0000 001 <nl> - ARM64_SYSREG_CTR_EL0 = 0xd801 , / / 11 011 0000 0000 001 <nl> - ARM64_SYSREG_MPIDR_EL1 = 0xc005 , / / 11 000 0000 0000 101 <nl> - ARM64_SYSREG_REVIDR_EL1 = 0xc006 , / / 11 000 0000 0000 110 <nl> - ARM64_SYSREG_AIDR_EL1 = 0xc807 , / / 11 001 0000 0000 111 <nl> - ARM64_SYSREG_DCZID_EL0 = 0xd807 , / / 11 011 0000 0000 111 <nl> - ARM64_SYSREG_ID_PFR0_EL1 = 0xc008 , / / 11 000 0000 0001 000 <nl> - ARM64_SYSREG_ID_PFR1_EL1 = 0xc009 , / / 11 000 0000 0001 001 <nl> - ARM64_SYSREG_ID_DFR0_EL1 = 0xc00a , / / 11 000 0000 0001 010 <nl> - ARM64_SYSREG_ID_AFR0_EL1 = 0xc00b , / / 11 000 0000 0001 011 <nl> - ARM64_SYSREG_ID_MMFR0_EL1 = 0xc00c , / / 11 000 0000 0001 100 <nl> - ARM64_SYSREG_ID_MMFR1_EL1 = 0xc00d , / / 11 000 0000 0001 101 <nl> - ARM64_SYSREG_ID_MMFR2_EL1 = 0xc00e , / / 11 000 0000 0001 110 <nl> - ARM64_SYSREG_ID_MMFR3_EL1 = 0xc00f , / / 11 000 0000 0001 111 <nl> - ARM64_SYSREG_ID_ISAR0_EL1 = 0xc010 , / / 11 000 0000 0010 000 <nl> - ARM64_SYSREG_ID_ISAR1_EL1 = 0xc011 , / / 11 000 0000 0010 001 <nl> - ARM64_SYSREG_ID_ISAR2_EL1 = 0xc012 , / / 11 000 0000 0010 010 <nl> - ARM64_SYSREG_ID_ISAR3_EL1 = 0xc013 , / / 11 000 0000 0010 011 <nl> - ARM64_SYSREG_ID_ISAR4_EL1 = 0xc014 , / / 11 000 0000 0010 100 <nl> - ARM64_SYSREG_ID_ISAR5_EL1 = 0xc015 , / / 11 000 0000 0010 101 <nl> - ARM64_SYSREG_ID_A64PFR0_EL1 = 0xc020 , / / 11 000 0000 0100 000 <nl> - ARM64_SYSREG_ID_A64PFR1_EL1 = 0xc021 , / / 11 000 0000 0100 001 <nl> - ARM64_SYSREG_ID_A64DFR0_EL1 = 0xc028 , / / 11 000 0000 0101 000 <nl> - ARM64_SYSREG_ID_A64DFR1_EL1 = 0xc029 , / / 11 000 0000 0101 001 <nl> - ARM64_SYSREG_ID_A64AFR0_EL1 = 0xc02c , / / 11 000 0000 0101 100 <nl> - ARM64_SYSREG_ID_A64AFR1_EL1 = 0xc02d , / / 11 000 0000 0101 101 <nl> - ARM64_SYSREG_ID_A64ISAR0_EL1 = 0xc030 , / / 11 000 0000 0110 000 <nl> - ARM64_SYSREG_ID_A64ISAR1_EL1 = 0xc031 , / / 11 000 0000 0110 001 <nl> - ARM64_SYSREG_ID_A64MMFR0_EL1 = 0xc038 , / / 11 000 0000 0111 000 <nl> - ARM64_SYSREG_ID_A64MMFR1_EL1 = 0xc039 , / / 11 000 0000 0111 001 <nl> - ARM64_SYSREG_MVFR0_EL1 = 0xc018 , / / 11 000 0000 0011 000 <nl> - ARM64_SYSREG_MVFR1_EL1 = 0xc019 , / / 11 000 0000 0011 001 <nl> - ARM64_SYSREG_MVFR2_EL1 = 0xc01a , / / 11 000 0000 0011 010 <nl> - ARM64_SYSREG_RVBAR_EL1 = 0xc601 , / / 11 000 1100 0000 001 <nl> - ARM64_SYSREG_RVBAR_EL2 = 0xe601 , / / 11 100 1100 0000 001 <nl> - ARM64_SYSREG_RVBAR_EL3 = 0xf601 , / / 11 110 1100 0000 001 <nl> - ARM64_SYSREG_ISR_EL1 = 0xc608 , / / 11 000 1100 0001 000 <nl> - ARM64_SYSREG_CNTPCT_EL0 = 0xdf01 , / / 11 011 1110 0000 001 <nl> - ARM64_SYSREG_CNTVCT_EL0 = 0xdf02 , / / 11 011 1110 0000 010 <nl> - <nl> - / / Trace registers <nl> - ARM64_SYSREG_TRCSTATR = 0x8818 , / / 10 001 0000 0011 000 <nl> - ARM64_SYSREG_TRCIDR8 = 0x8806 , / / 10 001 0000 0000 110 <nl> - ARM64_SYSREG_TRCIDR9 = 0x880e , / / 10 001 0000 0001 110 <nl> - ARM64_SYSREG_TRCIDR10 = 0x8816 , / / 10 001 0000 0010 110 <nl> - ARM64_SYSREG_TRCIDR11 = 0x881e , / / 10 001 0000 0011 110 <nl> - ARM64_SYSREG_TRCIDR12 = 0x8826 , / / 10 001 0000 0100 110 <nl> - ARM64_SYSREG_TRCIDR13 = 0x882e , / / 10 001 0000 0101 110 <nl> - ARM64_SYSREG_TRCIDR0 = 0x8847 , / / 10 001 0000 1000 111 <nl> - ARM64_SYSREG_TRCIDR1 = 0x884f , / / 10 001 0000 1001 111 <nl> - ARM64_SYSREG_TRCIDR2 = 0x8857 , / / 10 001 0000 1010 111 <nl> - ARM64_SYSREG_TRCIDR3 = 0x885f , / / 10 001 0000 1011 111 <nl> - ARM64_SYSREG_TRCIDR4 = 0x8867 , / / 10 001 0000 1100 111 <nl> - ARM64_SYSREG_TRCIDR5 = 0x886f , / / 10 001 0000 1101 111 <nl> - ARM64_SYSREG_TRCIDR6 = 0x8877 , / / 10 001 0000 1110 111 <nl> - ARM64_SYSREG_TRCIDR7 = 0x887f , / / 10 001 0000 1111 111 <nl> - ARM64_SYSREG_TRCOSLSR = 0x888c , / / 10 001 0001 0001 100 <nl> - ARM64_SYSREG_TRCPDSR = 0x88ac , / / 10 001 0001 0101 100 <nl> - ARM64_SYSREG_TRCDEVAFF0 = 0x8bd6 , / / 10 001 0111 1010 110 <nl> - ARM64_SYSREG_TRCDEVAFF1 = 0x8bde , / / 10 001 0111 1011 110 <nl> - ARM64_SYSREG_TRCLSR = 0x8bee , / / 10 001 0111 1101 110 <nl> - ARM64_SYSREG_TRCAUTHSTATUS = 0x8bf6 , / / 10 001 0111 1110 110 <nl> - ARM64_SYSREG_TRCDEVARCH = 0x8bfe , / / 10 001 0111 1111 110 <nl> - ARM64_SYSREG_TRCDEVID = 0x8b97 , / / 10 001 0111 0010 111 <nl> - ARM64_SYSREG_TRCDEVTYPE = 0x8b9f , / / 10 001 0111 0011 111 <nl> - ARM64_SYSREG_TRCPIDR4 = 0x8ba7 , / / 10 001 0111 0100 111 <nl> - ARM64_SYSREG_TRCPIDR5 = 0x8baf , / / 10 001 0111 0101 111 <nl> - ARM64_SYSREG_TRCPIDR6 = 0x8bb7 , / / 10 001 0111 0110 111 <nl> - ARM64_SYSREG_TRCPIDR7 = 0x8bbf , / / 10 001 0111 0111 111 <nl> - ARM64_SYSREG_TRCPIDR0 = 0x8bc7 , / / 10 001 0111 1000 111 <nl> - ARM64_SYSREG_TRCPIDR1 = 0x8bcf , / / 10 001 0111 1001 111 <nl> - ARM64_SYSREG_TRCPIDR2 = 0x8bd7 , / / 10 001 0111 1010 111 <nl> - ARM64_SYSREG_TRCPIDR3 = 0x8bdf , / / 10 001 0111 1011 111 <nl> - ARM64_SYSREG_TRCCIDR0 = 0x8be7 , / / 10 001 0111 1100 111 <nl> - ARM64_SYSREG_TRCCIDR1 = 0x8bef , / / 10 001 0111 1101 111 <nl> - ARM64_SYSREG_TRCCIDR2 = 0x8bf7 , / / 10 001 0111 1110 111 <nl> - ARM64_SYSREG_TRCCIDR3 = 0x8bff , / / 10 001 0111 1111 111 <nl> - <nl> - / / GICv3 registers <nl> - ARM64_SYSREG_ICC_IAR1_EL1 = 0xc660 , / / 11 000 1100 1100 000 <nl> - ARM64_SYSREG_ICC_IAR0_EL1 = 0xc640 , / / 11 000 1100 1000 000 <nl> - ARM64_SYSREG_ICC_HPPIR1_EL1 = 0xc662 , / / 11 000 1100 1100 010 <nl> - ARM64_SYSREG_ICC_HPPIR0_EL1 = 0xc642 , / / 11 000 1100 1000 010 <nl> - ARM64_SYSREG_ICC_RPR_EL1 = 0xc65b , / / 11 000 1100 1011 011 <nl> - ARM64_SYSREG_ICH_VTR_EL2 = 0xe659 , / / 11 100 1100 1011 001 <nl> - ARM64_SYSREG_ICH_EISR_EL2 = 0xe65b , / / 11 100 1100 1011 011 <nl> - ARM64_SYSREG_ICH_ELSR_EL2 = 0xe65d , / / 11 100 1100 1011 101 <nl> - } arm64_sysreg ; <nl> - <nl> - typedef enum arm64_msr_reg <nl> - { <nl> - / / > System registers for MSR <nl> - ARM64_SYSREG_DBGDTRTX_EL0 = 0x9828 , / / 10 011 0000 0101 000 <nl> - ARM64_SYSREG_OSLAR_EL1 = 0x8084 , / / 10 000 0001 0000 100 <nl> - ARM64_SYSREG_PMSWINC_EL0 = 0xdce4 , / / 11 011 1001 1100 100 <nl> - <nl> - / / Trace Registers <nl> - ARM64_SYSREG_TRCOSLAR = 0x8884 , / / 10 001 0001 0000 100 <nl> - ARM64_SYSREG_TRCLAR = 0x8be6 , / / 10 001 0111 1100 110 <nl> - <nl> - / / GICv3 registers <nl> - ARM64_SYSREG_ICC_EOIR1_EL1 = 0xc661 , / / 11 000 1100 1100 001 <nl> - ARM64_SYSREG_ICC_EOIR0_EL1 = 0xc641 , / / 11 000 1100 1000 001 <nl> - ARM64_SYSREG_ICC_DIR_EL1 = 0xc659 , / / 11 000 1100 1011 001 <nl> - ARM64_SYSREG_ICC_SGI1R_EL1 = 0xc65d , / / 11 000 1100 1011 101 <nl> - ARM64_SYSREG_ICC_ASGI1R_EL1 = 0xc65e , / / 11 000 1100 1011 110 <nl> - ARM64_SYSREG_ICC_SGI0R_EL1 = 0xc65f , / / 11 000 1100 1011 111 <nl> - } arm64_msr_reg ; <nl> - <nl> - / / > System PState Field ( MSR instruction ) <nl> - typedef enum arm64_pstate <nl> - { <nl> - ARM64_PSTATE_INVALID = 0 , <nl> - ARM64_PSTATE_SPSEL = 0x05 , <nl> - ARM64_PSTATE_DAIFSET = 0x1e , <nl> - ARM64_PSTATE_DAIFCLR = 0x1f <nl> - } arm64_pstate ; <nl> - <nl> - / / > Vector arrangement specifier ( for FloatingPoint / Advanced SIMD insn ) <nl> - typedef enum arm64_vas <nl> - { <nl> - ARM64_VAS_INVALID = 0 , <nl> - ARM64_VAS_8B , <nl> - ARM64_VAS_16B , <nl> - ARM64_VAS_4H , <nl> - ARM64_VAS_8H , <nl> - ARM64_VAS_2S , <nl> - ARM64_VAS_4S , <nl> - ARM64_VAS_1D , <nl> - ARM64_VAS_2D , <nl> - ARM64_VAS_1Q , <nl> - } arm64_vas ; <nl> - <nl> - / / > Vector element size specifier <nl> - typedef enum arm64_vess <nl> - { <nl> - ARM64_VESS_INVALID = 0 , <nl> - ARM64_VESS_B , <nl> - ARM64_VESS_H , <nl> - ARM64_VESS_S , <nl> - ARM64_VESS_D , <nl> - } arm64_vess ; <nl> - <nl> - / / > Memory barrier operands <nl> - typedef enum arm64_barrier_op <nl> - { <nl> - ARM64_BARRIER_INVALID = 0 , <nl> - ARM64_BARRIER_OSHLD = 0x1 , <nl> - ARM64_BARRIER_OSHST = 0x2 , <nl> - ARM64_BARRIER_OSH = 0x3 , <nl> - ARM64_BARRIER_NSHLD = 0x5 , <nl> - ARM64_BARRIER_NSHST = 0x6 , <nl> - ARM64_BARRIER_NSH = 0x7 , <nl> - ARM64_BARRIER_ISHLD = 0x9 , <nl> - ARM64_BARRIER_ISHST = 0xa , <nl> - ARM64_BARRIER_ISH = 0xb , <nl> - ARM64_BARRIER_LD = 0xd , <nl> - ARM64_BARRIER_ST = 0xe , <nl> - ARM64_BARRIER_SY = 0xf <nl> - } arm64_barrier_op ; <nl> - <nl> - / / > Operand type for instruction ' s operands <nl> - typedef enum arm64_op_type <nl> - { <nl> - ARM64_OP_INVALID = 0 , / / = CS_OP_INVALID ( Uninitialized ) . <nl> - ARM64_OP_REG , / / = CS_OP_REG ( Register operand ) . <nl> - ARM64_OP_IMM , / / = CS_OP_IMM ( Immediate operand ) . <nl> - ARM64_OP_MEM , / / = CS_OP_MEM ( Memory operand ) . <nl> - ARM64_OP_FP , / / = CS_OP_FP ( Floating - Point operand ) . <nl> - ARM64_OP_CIMM = 64 , / / C - Immediate <nl> - ARM64_OP_REG_MRS , / / MRS register operand . <nl> - ARM64_OP_REG_MSR , / / MSR register operand . <nl> - ARM64_OP_PSTATE , / / PState operand . <nl> - ARM64_OP_SYS , / / SYS operand for IC / DC / AT / TLBI instructions . <nl> - ARM64_OP_PREFETCH , / / Prefetch operand ( PRFM ) . <nl> - ARM64_OP_BARRIER , / / Memory barrier operand ( ISB / DMB / DSB instructions ) . <nl> - } arm64_op_type ; <nl> - <nl> - / / > TLBI operations <nl> - typedef enum arm64_tlbi_op <nl> - { <nl> - ARM64_TLBI_INVALID = 0 , <nl> - ARM64_TLBI_VMALLE1IS , <nl> - ARM64_TLBI_VAE1IS , <nl> - ARM64_TLBI_ASIDE1IS , <nl> - ARM64_TLBI_VAAE1IS , <nl> - ARM64_TLBI_VALE1IS , <nl> - ARM64_TLBI_VAALE1IS , <nl> - ARM64_TLBI_ALLE2IS , <nl> - ARM64_TLBI_VAE2IS , <nl> - ARM64_TLBI_ALLE1IS , <nl> - ARM64_TLBI_VALE2IS , <nl> - ARM64_TLBI_VMALLS12E1IS , <nl> - ARM64_TLBI_ALLE3IS , <nl> - ARM64_TLBI_VAE3IS , <nl> - ARM64_TLBI_VALE3IS , <nl> - ARM64_TLBI_IPAS2E1IS , <nl> - ARM64_TLBI_IPAS2LE1IS , <nl> - ARM64_TLBI_IPAS2E1 , <nl> - ARM64_TLBI_IPAS2LE1 , <nl> - ARM64_TLBI_VMALLE1 , <nl> - ARM64_TLBI_VAE1 , <nl> - ARM64_TLBI_ASIDE1 , <nl> - ARM64_TLBI_VAAE1 , <nl> - ARM64_TLBI_VALE1 , <nl> - ARM64_TLBI_VAALE1 , <nl> - ARM64_TLBI_ALLE2 , <nl> - ARM64_TLBI_VAE2 , <nl> - ARM64_TLBI_ALLE1 , <nl> - ARM64_TLBI_VALE2 , <nl> - ARM64_TLBI_VMALLS12E1 , <nl> - ARM64_TLBI_ALLE3 , <nl> - ARM64_TLBI_VAE3 , <nl> - ARM64_TLBI_VALE3 , <nl> - } arm64_tlbi_op ; <nl> - <nl> - / / > AT operations <nl> - typedef enum arm64_at_op <nl> - { <nl> - ARM64_AT_S1E1R , <nl> - ARM64_AT_S1E1W , <nl> - ARM64_AT_S1E0R , <nl> - ARM64_AT_S1E0W , <nl> - ARM64_AT_S1E2R , <nl> - ARM64_AT_S1E2W , <nl> - ARM64_AT_S12E1R , <nl> - ARM64_AT_S12E1W , <nl> - ARM64_AT_S12E0R , <nl> - ARM64_AT_S12E0W , <nl> - ARM64_AT_S1E3R , <nl> - ARM64_AT_S1E3W , <nl> - } arm64_at_op ; <nl> - <nl> - / / > DC operations <nl> - typedef enum arm64_dc_op <nl> - { <nl> - ARM64_DC_INVALID = 0 , <nl> - ARM64_DC_ZVA , <nl> - ARM64_DC_IVAC , <nl> - ARM64_DC_ISW , <nl> - ARM64_DC_CVAC , <nl> - ARM64_DC_CSW , <nl> - ARM64_DC_CVAU , <nl> - ARM64_DC_CIVAC , <nl> - ARM64_DC_CISW , <nl> - } arm64_dc_op ; <nl> - <nl> - / / > IC operations <nl> - typedef enum arm64_ic_op <nl> - { <nl> - ARM64_IC_INVALID = 0 , <nl> - ARM64_IC_IALLUIS , <nl> - ARM64_IC_IALLU , <nl> - ARM64_IC_IVAU , <nl> - } arm64_ic_op ; <nl> - <nl> - / / > Prefetch operations ( PRFM ) <nl> - typedef enum arm64_prefetch_op <nl> - { <nl> - ARM64_PRFM_INVALID = 0 , <nl> - ARM64_PRFM_PLDL1KEEP = 0x00 + 1 , <nl> - ARM64_PRFM_PLDL1STRM = 0x01 + 1 , <nl> - ARM64_PRFM_PLDL2KEEP = 0x02 + 1 , <nl> - ARM64_PRFM_PLDL2STRM = 0x03 + 1 , <nl> - ARM64_PRFM_PLDL3KEEP = 0x04 + 1 , <nl> - ARM64_PRFM_PLDL3STRM = 0x05 + 1 , <nl> - ARM64_PRFM_PLIL1KEEP = 0x08 + 1 , <nl> - ARM64_PRFM_PLIL1STRM = 0x09 + 1 , <nl> - ARM64_PRFM_PLIL2KEEP = 0x0a + 1 , <nl> - ARM64_PRFM_PLIL2STRM = 0x0b + 1 , <nl> - ARM64_PRFM_PLIL3KEEP = 0x0c + 1 , <nl> - ARM64_PRFM_PLIL3STRM = 0x0d + 1 , <nl> - ARM64_PRFM_PSTL1KEEP = 0x10 + 1 , <nl> - ARM64_PRFM_PSTL1STRM = 0x11 + 1 , <nl> - ARM64_PRFM_PSTL2KEEP = 0x12 + 1 , <nl> - ARM64_PRFM_PSTL2STRM = 0x13 + 1 , <nl> - ARM64_PRFM_PSTL3KEEP = 0x14 + 1 , <nl> - ARM64_PRFM_PSTL3STRM = 0x15 + 1 , <nl> - } arm64_prefetch_op ; <nl> - <nl> - / / Instruction ' s operand referring to memory <nl> - / / This is associated with ARM64_OP_MEM operand type above <nl> - typedef struct arm64_op_mem <nl> - { <nl> - unsigned int base ; / / base register <nl> - unsigned int index ; / / index register <nl> - int32_t disp ; / / displacement / offset value <nl> - } arm64_op_mem ; <nl> - <nl> - / / Instruction operand <nl> - typedef struct cs_arm64_op <nl> - { <nl> - int vector_index ; / / Vector Index for some vector operands ( or - 1 if irrelevant ) <nl> - arm64_vas vas ; / / Vector Arrangement Specifier <nl> - arm64_vess vess ; / / Vector Element Size Specifier <nl> - struct <nl> - { <nl> - arm64_shifter type ; / / shifter type of this operand <nl> - unsigned int value ; / / shifter value of this operand <nl> - } shift ; <nl> - arm64_extender ext ; / / extender type of this operand <nl> - arm64_op_type type ; / / operand type <nl> - union <nl> - { <nl> - unsigned int reg ; / / register value for REG operand <nl> - int64_t imm ; / / immediate value , or index for C - IMM or IMM operand <nl> - double fp ; / / floating point value for FP operand <nl> - arm64_op_mem mem ; / / base / index / scale / disp value for MEM operand <nl> - arm64_pstate pstate ; / / PState field of MSR instruction . <nl> - unsigned int sys ; / / IC / DC / AT / TLBI operation ( see arm64_ic_op , arm64_dc_op , arm64_at_op , arm64_tlbi_op ) <nl> - arm64_prefetch_op prefetch ; / / PRFM operation . <nl> - arm64_barrier_op barrier ; / / Memory barrier operation ( ISB / DMB / DSB instructions ) . <nl> - } ; <nl> - } cs_arm64_op ; <nl> - <nl> - / / Instruction structure <nl> - typedef struct cs_arm64 <nl> - { <nl> - arm64_cc cc ; / / conditional code for this insn <nl> - bool update_flags ; / / does this insn update flags ? <nl> - bool writeback ; / / does this insn request writeback ? ' True ' means ' yes ' <nl> - <nl> - / / Number of operands of this instruction , <nl> - / / or 0 when instruction has no operand . <nl> - uint8_t op_count ; <nl> - <nl> - cs_arm64_op operands [ 8 ] ; / / operands for this instruction . <nl> - } cs_arm64 ; <nl> - <nl> - / / > ARM64 registers <nl> - typedef enum arm64_reg <nl> - { <nl> - ARM64_REG_INVALID = 0 , <nl> - <nl> - ARM64_REG_X29 , <nl> - ARM64_REG_X30 , <nl> - ARM64_REG_NZCV , <nl> - ARM64_REG_SP , <nl> - ARM64_REG_WSP , <nl> - ARM64_REG_WZR , <nl> - ARM64_REG_XZR , <nl> - ARM64_REG_B0 , <nl> - ARM64_REG_B1 , <nl> - ARM64_REG_B2 , <nl> - ARM64_REG_B3 , <nl> - ARM64_REG_B4 , <nl> - ARM64_REG_B5 , <nl> - ARM64_REG_B6 , <nl> - ARM64_REG_B7 , <nl> - ARM64_REG_B8 , <nl> - ARM64_REG_B9 , <nl> - ARM64_REG_B10 , <nl> - ARM64_REG_B11 , <nl> - ARM64_REG_B12 , <nl> - ARM64_REG_B13 , <nl> - ARM64_REG_B14 , <nl> - ARM64_REG_B15 , <nl> - ARM64_REG_B16 , <nl> - ARM64_REG_B17 , <nl> - ARM64_REG_B18 , <nl> - ARM64_REG_B19 , <nl> - ARM64_REG_B20 , <nl> - ARM64_REG_B21 , <nl> - ARM64_REG_B22 , <nl> - ARM64_REG_B23 , <nl> - ARM64_REG_B24 , <nl> - ARM64_REG_B25 , <nl> - ARM64_REG_B26 , <nl> - ARM64_REG_B27 , <nl> - ARM64_REG_B28 , <nl> - ARM64_REG_B29 , <nl> - ARM64_REG_B30 , <nl> - ARM64_REG_B31 , <nl> - ARM64_REG_D0 , <nl> - ARM64_REG_D1 , <nl> - ARM64_REG_D2 , <nl> - ARM64_REG_D3 , <nl> - ARM64_REG_D4 , <nl> - ARM64_REG_D5 , <nl> - ARM64_REG_D6 , <nl> - ARM64_REG_D7 , <nl> - ARM64_REG_D8 , <nl> - ARM64_REG_D9 , <nl> - ARM64_REG_D10 , <nl> - ARM64_REG_D11 , <nl> - ARM64_REG_D12 , <nl> - ARM64_REG_D13 , <nl> - ARM64_REG_D14 , <nl> - ARM64_REG_D15 , <nl> - ARM64_REG_D16 , <nl> - ARM64_REG_D17 , <nl> - ARM64_REG_D18 , <nl> - ARM64_REG_D19 , <nl> - ARM64_REG_D20 , <nl> - ARM64_REG_D21 , <nl> - ARM64_REG_D22 , <nl> - ARM64_REG_D23 , <nl> - ARM64_REG_D24 , <nl> - ARM64_REG_D25 , <nl> - ARM64_REG_D26 , <nl> - ARM64_REG_D27 , <nl> - ARM64_REG_D28 , <nl> - ARM64_REG_D29 , <nl> - ARM64_REG_D30 , <nl> - ARM64_REG_D31 , <nl> - ARM64_REG_H0 , <nl> - ARM64_REG_H1 , <nl> - ARM64_REG_H2 , <nl> - ARM64_REG_H3 , <nl> - ARM64_REG_H4 , <nl> - ARM64_REG_H5 , <nl> - ARM64_REG_H6 , <nl> - ARM64_REG_H7 , <nl> - ARM64_REG_H8 , <nl> - ARM64_REG_H9 , <nl> - ARM64_REG_H10 , <nl> - ARM64_REG_H11 , <nl> - ARM64_REG_H12 , <nl> - ARM64_REG_H13 , <nl> - ARM64_REG_H14 , <nl> - ARM64_REG_H15 , <nl> - ARM64_REG_H16 , <nl> - ARM64_REG_H17 , <nl> - ARM64_REG_H18 , <nl> - ARM64_REG_H19 , <nl> - ARM64_REG_H20 , <nl> - ARM64_REG_H21 , <nl> - ARM64_REG_H22 , <nl> - ARM64_REG_H23 , <nl> - ARM64_REG_H24 , <nl> - ARM64_REG_H25 , <nl> - ARM64_REG_H26 , <nl> - ARM64_REG_H27 , <nl> - ARM64_REG_H28 , <nl> - ARM64_REG_H29 , <nl> - ARM64_REG_H30 , <nl> - ARM64_REG_H31 , <nl> - ARM64_REG_Q0 , <nl> - ARM64_REG_Q1 , <nl> - ARM64_REG_Q2 , <nl> - ARM64_REG_Q3 , <nl> - ARM64_REG_Q4 , <nl> - ARM64_REG_Q5 , <nl> - ARM64_REG_Q6 , <nl> - ARM64_REG_Q7 , <nl> - ARM64_REG_Q8 , <nl> - ARM64_REG_Q9 , <nl> - ARM64_REG_Q10 , <nl> - ARM64_REG_Q11 , <nl> - ARM64_REG_Q12 , <nl> - ARM64_REG_Q13 , <nl> - ARM64_REG_Q14 , <nl> - ARM64_REG_Q15 , <nl> - ARM64_REG_Q16 , <nl> - ARM64_REG_Q17 , <nl> - ARM64_REG_Q18 , <nl> - ARM64_REG_Q19 , <nl> - ARM64_REG_Q20 , <nl> - ARM64_REG_Q21 , <nl> - ARM64_REG_Q22 , <nl> - ARM64_REG_Q23 , <nl> - ARM64_REG_Q24 , <nl> - ARM64_REG_Q25 , <nl> - ARM64_REG_Q26 , <nl> - ARM64_REG_Q27 , <nl> - ARM64_REG_Q28 , <nl> - ARM64_REG_Q29 , <nl> - ARM64_REG_Q30 , <nl> - ARM64_REG_Q31 , <nl> - ARM64_REG_S0 , <nl> - ARM64_REG_S1 , <nl> - ARM64_REG_S2 , <nl> - ARM64_REG_S3 , <nl> - ARM64_REG_S4 , <nl> - ARM64_REG_S5 , <nl> - ARM64_REG_S6 , <nl> - ARM64_REG_S7 , <nl> - ARM64_REG_S8 , <nl> - ARM64_REG_S9 , <nl> - ARM64_REG_S10 , <nl> - ARM64_REG_S11 , <nl> - ARM64_REG_S12 , <nl> - ARM64_REG_S13 , <nl> - ARM64_REG_S14 , <nl> - ARM64_REG_S15 , <nl> - ARM64_REG_S16 , <nl> - ARM64_REG_S17 , <nl> - ARM64_REG_S18 , <nl> - ARM64_REG_S19 , <nl> - ARM64_REG_S20 , <nl> - ARM64_REG_S21 , <nl> - ARM64_REG_S22 , <nl> - ARM64_REG_S23 , <nl> - ARM64_REG_S24 , <nl> - ARM64_REG_S25 , <nl> - ARM64_REG_S26 , <nl> - ARM64_REG_S27 , <nl> - ARM64_REG_S28 , <nl> - ARM64_REG_S29 , <nl> - ARM64_REG_S30 , <nl> - ARM64_REG_S31 , <nl> - ARM64_REG_W0 , <nl> - ARM64_REG_W1 , <nl> - ARM64_REG_W2 , <nl> - ARM64_REG_W3 , <nl> - ARM64_REG_W4 , <nl> - ARM64_REG_W5 , <nl> - ARM64_REG_W6 , <nl> - ARM64_REG_W7 , <nl> - ARM64_REG_W8 , <nl> - ARM64_REG_W9 , <nl> - ARM64_REG_W10 , <nl> - ARM64_REG_W11 , <nl> - ARM64_REG_W12 , <nl> - ARM64_REG_W13 , <nl> - ARM64_REG_W14 , <nl> - ARM64_REG_W15 , <nl> - ARM64_REG_W16 , <nl> - ARM64_REG_W17 , <nl> - ARM64_REG_W18 , <nl> - ARM64_REG_W19 , <nl> - ARM64_REG_W20 , <nl> - ARM64_REG_W21 , <nl> - ARM64_REG_W22 , <nl> - ARM64_REG_W23 , <nl> - ARM64_REG_W24 , <nl> - ARM64_REG_W25 , <nl> - ARM64_REG_W26 , <nl> - ARM64_REG_W27 , <nl> - ARM64_REG_W28 , <nl> - ARM64_REG_W29 , <nl> - ARM64_REG_W30 , <nl> - ARM64_REG_X0 , <nl> - ARM64_REG_X1 , <nl> - ARM64_REG_X2 , <nl> - ARM64_REG_X3 , <nl> - ARM64_REG_X4 , <nl> - ARM64_REG_X5 , <nl> - ARM64_REG_X6 , <nl> - ARM64_REG_X7 , <nl> - ARM64_REG_X8 , <nl> - ARM64_REG_X9 , <nl> - ARM64_REG_X10 , <nl> - ARM64_REG_X11 , <nl> - ARM64_REG_X12 , <nl> - ARM64_REG_X13 , <nl> - ARM64_REG_X14 , <nl> - ARM64_REG_X15 , <nl> - ARM64_REG_X16 , <nl> - ARM64_REG_X17 , <nl> - ARM64_REG_X18 , <nl> - ARM64_REG_X19 , <nl> - ARM64_REG_X20 , <nl> - ARM64_REG_X21 , <nl> - ARM64_REG_X22 , <nl> - ARM64_REG_X23 , <nl> - ARM64_REG_X24 , <nl> - ARM64_REG_X25 , <nl> - ARM64_REG_X26 , <nl> - ARM64_REG_X27 , <nl> - ARM64_REG_X28 , <nl> - <nl> - ARM64_REG_V0 , <nl> - ARM64_REG_V1 , <nl> - ARM64_REG_V2 , <nl> - ARM64_REG_V3 , <nl> - ARM64_REG_V4 , <nl> - ARM64_REG_V5 , <nl> - ARM64_REG_V6 , <nl> - ARM64_REG_V7 , <nl> - ARM64_REG_V8 , <nl> - ARM64_REG_V9 , <nl> - ARM64_REG_V10 , <nl> - ARM64_REG_V11 , <nl> - ARM64_REG_V12 , <nl> - ARM64_REG_V13 , <nl> - ARM64_REG_V14 , <nl> - ARM64_REG_V15 , <nl> - ARM64_REG_V16 , <nl> - ARM64_REG_V17 , <nl> - ARM64_REG_V18 , <nl> - ARM64_REG_V19 , <nl> - ARM64_REG_V20 , <nl> - ARM64_REG_V21 , <nl> - ARM64_REG_V22 , <nl> - ARM64_REG_V23 , <nl> - ARM64_REG_V24 , <nl> - ARM64_REG_V25 , <nl> - ARM64_REG_V26 , <nl> - ARM64_REG_V27 , <nl> - ARM64_REG_V28 , <nl> - ARM64_REG_V29 , <nl> - ARM64_REG_V30 , <nl> - ARM64_REG_V31 , <nl> - <nl> - ARM64_REG_ENDING , / / < - - mark the end of the list of registers <nl> - <nl> - / / > alias registers <nl> - <nl> - ARM64_REG_IP1 = ARM64_REG_X16 , <nl> - ARM64_REG_IP0 = ARM64_REG_X17 , <nl> - ARM64_REG_FP = ARM64_REG_X29 , <nl> - ARM64_REG_LR = ARM64_REG_X30 , <nl> - } arm64_reg ; <nl> - <nl> - / / > ARM64 instruction <nl> - typedef enum arm64_insn <nl> - { <nl> - ARM64_INS_INVALID = 0 , <nl> - <nl> - ARM64_INS_ABS , <nl> - ARM64_INS_ADC , <nl> - ARM64_INS_ADDHN , <nl> - ARM64_INS_ADDHN2 , <nl> - ARM64_INS_ADDP , <nl> - ARM64_INS_ADD , <nl> - ARM64_INS_ADDV , <nl> - ARM64_INS_ADR , <nl> - ARM64_INS_ADRP , <nl> - ARM64_INS_AESD , <nl> - ARM64_INS_AESE , <nl> - ARM64_INS_AESIMC , <nl> - ARM64_INS_AESMC , <nl> - ARM64_INS_AND , <nl> - ARM64_INS_ASR , <nl> - ARM64_INS_B , <nl> - ARM64_INS_BFM , <nl> - ARM64_INS_BIC , <nl> - ARM64_INS_BIF , <nl> - ARM64_INS_BIT , <nl> - ARM64_INS_BL , <nl> - ARM64_INS_BLR , <nl> - ARM64_INS_BR , <nl> - ARM64_INS_BRK , <nl> - ARM64_INS_BSL , <nl> - ARM64_INS_CBNZ , <nl> - ARM64_INS_CBZ , <nl> - ARM64_INS_CCMN , <nl> - ARM64_INS_CCMP , <nl> - ARM64_INS_CLREX , <nl> - ARM64_INS_CLS , <nl> - ARM64_INS_CLZ , <nl> - ARM64_INS_CMEQ , <nl> - ARM64_INS_CMGE , <nl> - ARM64_INS_CMGT , <nl> - ARM64_INS_CMHI , <nl> - ARM64_INS_CMHS , <nl> - ARM64_INS_CMLE , <nl> - ARM64_INS_CMLT , <nl> - ARM64_INS_CMTST , <nl> - ARM64_INS_CNT , <nl> - ARM64_INS_MOV , <nl> - ARM64_INS_CRC32B , <nl> - ARM64_INS_CRC32CB , <nl> - ARM64_INS_CRC32CH , <nl> - ARM64_INS_CRC32CW , <nl> - ARM64_INS_CRC32CX , <nl> - ARM64_INS_CRC32H , <nl> - ARM64_INS_CRC32W , <nl> - ARM64_INS_CRC32X , <nl> - ARM64_INS_CSEL , <nl> - ARM64_INS_CSINC , <nl> - ARM64_INS_CSINV , <nl> - ARM64_INS_CSNEG , <nl> - ARM64_INS_DCPS1 , <nl> - ARM64_INS_DCPS2 , <nl> - ARM64_INS_DCPS3 , <nl> - ARM64_INS_DMB , <nl> - ARM64_INS_DRPS , <nl> - ARM64_INS_DSB , <nl> - ARM64_INS_DUP , <nl> - ARM64_INS_EON , <nl> - ARM64_INS_EOR , <nl> - ARM64_INS_ERET , <nl> - ARM64_INS_EXTR , <nl> - ARM64_INS_EXT , <nl> - ARM64_INS_FABD , <nl> - ARM64_INS_FABS , <nl> - ARM64_INS_FACGE , <nl> - ARM64_INS_FACGT , <nl> - ARM64_INS_FADD , <nl> - ARM64_INS_FADDP , <nl> - ARM64_INS_FCCMP , <nl> - ARM64_INS_FCCMPE , <nl> - ARM64_INS_FCMEQ , <nl> - ARM64_INS_FCMGE , <nl> - ARM64_INS_FCMGT , <nl> - ARM64_INS_FCMLE , <nl> - ARM64_INS_FCMLT , <nl> - ARM64_INS_FCMP , <nl> - ARM64_INS_FCMPE , <nl> - ARM64_INS_FCSEL , <nl> - ARM64_INS_FCVTAS , <nl> - ARM64_INS_FCVTAU , <nl> - ARM64_INS_FCVT , <nl> - ARM64_INS_FCVTL , <nl> - ARM64_INS_FCVTL2 , <nl> - ARM64_INS_FCVTMS , <nl> - ARM64_INS_FCVTMU , <nl> - ARM64_INS_FCVTNS , <nl> - ARM64_INS_FCVTNU , <nl> - ARM64_INS_FCVTN , <nl> - ARM64_INS_FCVTN2 , <nl> - ARM64_INS_FCVTPS , <nl> - ARM64_INS_FCVTPU , <nl> - ARM64_INS_FCVTXN , <nl> - ARM64_INS_FCVTXN2 , <nl> - ARM64_INS_FCVTZS , <nl> - ARM64_INS_FCVTZU , <nl> - ARM64_INS_FDIV , <nl> - ARM64_INS_FMADD , <nl> - ARM64_INS_FMAX , <nl> - ARM64_INS_FMAXNM , <nl> - ARM64_INS_FMAXNMP , <nl> - ARM64_INS_FMAXNMV , <nl> - ARM64_INS_FMAXP , <nl> - ARM64_INS_FMAXV , <nl> - ARM64_INS_FMIN , <nl> - ARM64_INS_FMINNM , <nl> - ARM64_INS_FMINNMP , <nl> - ARM64_INS_FMINNMV , <nl> - ARM64_INS_FMINP , <nl> - ARM64_INS_FMINV , <nl> - ARM64_INS_FMLA , <nl> - ARM64_INS_FMLS , <nl> - ARM64_INS_FMOV , <nl> - ARM64_INS_FMSUB , <nl> - ARM64_INS_FMUL , <nl> - ARM64_INS_FMULX , <nl> - ARM64_INS_FNEG , <nl> - ARM64_INS_FNMADD , <nl> - ARM64_INS_FNMSUB , <nl> - ARM64_INS_FNMUL , <nl> - ARM64_INS_FRECPE , <nl> - ARM64_INS_FRECPS , <nl> - ARM64_INS_FRECPX , <nl> - ARM64_INS_FRINTA , <nl> - ARM64_INS_FRINTI , <nl> - ARM64_INS_FRINTM , <nl> - ARM64_INS_FRINTN , <nl> - ARM64_INS_FRINTP , <nl> - ARM64_INS_FRINTX , <nl> - ARM64_INS_FRINTZ , <nl> - ARM64_INS_FRSQRTE , <nl> - ARM64_INS_FRSQRTS , <nl> - ARM64_INS_FSQRT , <nl> - ARM64_INS_FSUB , <nl> - ARM64_INS_HINT , <nl> - ARM64_INS_HLT , <nl> - ARM64_INS_HVC , <nl> - ARM64_INS_INS , <nl> - <nl> - ARM64_INS_ISB , <nl> - ARM64_INS_LD1 , <nl> - ARM64_INS_LD1R , <nl> - ARM64_INS_LD2R , <nl> - ARM64_INS_LD2 , <nl> - ARM64_INS_LD3R , <nl> - ARM64_INS_LD3 , <nl> - ARM64_INS_LD4 , <nl> - ARM64_INS_LD4R , <nl> - <nl> - ARM64_INS_LDARB , <nl> - ARM64_INS_LDARH , <nl> - ARM64_INS_LDAR , <nl> - ARM64_INS_LDAXP , <nl> - ARM64_INS_LDAXRB , <nl> - ARM64_INS_LDAXRH , <nl> - ARM64_INS_LDAXR , <nl> - ARM64_INS_LDNP , <nl> - ARM64_INS_LDP , <nl> - ARM64_INS_LDPSW , <nl> - ARM64_INS_LDRB , <nl> - ARM64_INS_LDR , <nl> - ARM64_INS_LDRH , <nl> - ARM64_INS_LDRSB , <nl> - ARM64_INS_LDRSH , <nl> - ARM64_INS_LDRSW , <nl> - ARM64_INS_LDTRB , <nl> - ARM64_INS_LDTRH , <nl> - ARM64_INS_LDTRSB , <nl> - <nl> - ARM64_INS_LDTRSH , <nl> - ARM64_INS_LDTRSW , <nl> - ARM64_INS_LDTR , <nl> - ARM64_INS_LDURB , <nl> - ARM64_INS_LDUR , <nl> - ARM64_INS_LDURH , <nl> - ARM64_INS_LDURSB , <nl> - ARM64_INS_LDURSH , <nl> - ARM64_INS_LDURSW , <nl> - ARM64_INS_LDXP , <nl> - ARM64_INS_LDXRB , <nl> - ARM64_INS_LDXRH , <nl> - ARM64_INS_LDXR , <nl> - ARM64_INS_LSL , <nl> - ARM64_INS_LSR , <nl> - ARM64_INS_MADD , <nl> - ARM64_INS_MLA , <nl> - ARM64_INS_MLS , <nl> - ARM64_INS_MOVI , <nl> - ARM64_INS_MOVK , <nl> - ARM64_INS_MOVN , <nl> - ARM64_INS_MOVZ , <nl> - ARM64_INS_MRS , <nl> - ARM64_INS_MSR , <nl> - ARM64_INS_MSUB , <nl> - ARM64_INS_MUL , <nl> - ARM64_INS_MVNI , <nl> - ARM64_INS_NEG , <nl> - ARM64_INS_NOT , <nl> - ARM64_INS_ORN , <nl> - ARM64_INS_ORR , <nl> - ARM64_INS_PMULL2 , <nl> - ARM64_INS_PMULL , <nl> - ARM64_INS_PMUL , <nl> - ARM64_INS_PRFM , <nl> - ARM64_INS_PRFUM , <nl> - ARM64_INS_RADDHN , <nl> - ARM64_INS_RADDHN2 , <nl> - ARM64_INS_RBIT , <nl> - ARM64_INS_RET , <nl> - ARM64_INS_REV16 , <nl> - ARM64_INS_REV32 , <nl> - ARM64_INS_REV64 , <nl> - ARM64_INS_REV , <nl> - ARM64_INS_ROR , <nl> - ARM64_INS_RSHRN2 , <nl> - ARM64_INS_RSHRN , <nl> - ARM64_INS_RSUBHN , <nl> - ARM64_INS_RSUBHN2 , <nl> - ARM64_INS_SABAL2 , <nl> - ARM64_INS_SABAL , <nl> - <nl> - ARM64_INS_SABA , <nl> - ARM64_INS_SABDL2 , <nl> - ARM64_INS_SABDL , <nl> - ARM64_INS_SABD , <nl> - ARM64_INS_SADALP , <nl> - ARM64_INS_SADDLP , <nl> - ARM64_INS_SADDLV , <nl> - ARM64_INS_SADDL2 , <nl> - ARM64_INS_SADDL , <nl> - ARM64_INS_SADDW2 , <nl> - ARM64_INS_SADDW , <nl> - ARM64_INS_SBC , <nl> - ARM64_INS_SBFM , <nl> - ARM64_INS_SCVTF , <nl> - ARM64_INS_SDIV , <nl> - ARM64_INS_SHA1C , <nl> - ARM64_INS_SHA1H , <nl> - ARM64_INS_SHA1M , <nl> - ARM64_INS_SHA1P , <nl> - ARM64_INS_SHA1SU0 , <nl> - ARM64_INS_SHA1SU1 , <nl> - ARM64_INS_SHA256H2 , <nl> - ARM64_INS_SHA256H , <nl> - ARM64_INS_SHA256SU0 , <nl> - ARM64_INS_SHA256SU1 , <nl> - ARM64_INS_SHADD , <nl> - ARM64_INS_SHLL2 , <nl> - ARM64_INS_SHLL , <nl> - ARM64_INS_SHL , <nl> - ARM64_INS_SHRN2 , <nl> - ARM64_INS_SHRN , <nl> - ARM64_INS_SHSUB , <nl> - ARM64_INS_SLI , <nl> - ARM64_INS_SMADDL , <nl> - ARM64_INS_SMAXP , <nl> - ARM64_INS_SMAXV , <nl> - ARM64_INS_SMAX , <nl> - ARM64_INS_SMC , <nl> - ARM64_INS_SMINP , <nl> - ARM64_INS_SMINV , <nl> - ARM64_INS_SMIN , <nl> - ARM64_INS_SMLAL2 , <nl> - ARM64_INS_SMLAL , <nl> - ARM64_INS_SMLSL2 , <nl> - ARM64_INS_SMLSL , <nl> - ARM64_INS_SMOV , <nl> - ARM64_INS_SMSUBL , <nl> - ARM64_INS_SMULH , <nl> - ARM64_INS_SMULL2 , <nl> - ARM64_INS_SMULL , <nl> - ARM64_INS_SQABS , <nl> - ARM64_INS_SQADD , <nl> - ARM64_INS_SQDMLAL , <nl> - ARM64_INS_SQDMLAL2 , <nl> - ARM64_INS_SQDMLSL , <nl> - ARM64_INS_SQDMLSL2 , <nl> - ARM64_INS_SQDMULH , <nl> - ARM64_INS_SQDMULL , <nl> - ARM64_INS_SQDMULL2 , <nl> - ARM64_INS_SQNEG , <nl> - ARM64_INS_SQRDMULH , <nl> - ARM64_INS_SQRSHL , <nl> - ARM64_INS_SQRSHRN , <nl> - ARM64_INS_SQRSHRN2 , <nl> - ARM64_INS_SQRSHRUN , <nl> - ARM64_INS_SQRSHRUN2 , <nl> - ARM64_INS_SQSHLU , <nl> - ARM64_INS_SQSHL , <nl> - ARM64_INS_SQSHRN , <nl> - ARM64_INS_SQSHRN2 , <nl> - ARM64_INS_SQSHRUN , <nl> - ARM64_INS_SQSHRUN2 , <nl> - ARM64_INS_SQSUB , <nl> - ARM64_INS_SQXTN2 , <nl> - ARM64_INS_SQXTN , <nl> - ARM64_INS_SQXTUN2 , <nl> - ARM64_INS_SQXTUN , <nl> - ARM64_INS_SRHADD , <nl> - ARM64_INS_SRI , <nl> - ARM64_INS_SRSHL , <nl> - ARM64_INS_SRSHR , <nl> - ARM64_INS_SRSRA , <nl> - ARM64_INS_SSHLL2 , <nl> - ARM64_INS_SSHLL , <nl> - ARM64_INS_SSHL , <nl> - ARM64_INS_SSHR , <nl> - ARM64_INS_SSRA , <nl> - ARM64_INS_SSUBL2 , <nl> - ARM64_INS_SSUBL , <nl> - ARM64_INS_SSUBW2 , <nl> - ARM64_INS_SSUBW , <nl> - ARM64_INS_ST1 , <nl> - ARM64_INS_ST2 , <nl> - ARM64_INS_ST3 , <nl> - ARM64_INS_ST4 , <nl> - ARM64_INS_STLRB , <nl> - ARM64_INS_STLRH , <nl> - ARM64_INS_STLR , <nl> - ARM64_INS_STLXP , <nl> - ARM64_INS_STLXRB , <nl> - ARM64_INS_STLXRH , <nl> - ARM64_INS_STLXR , <nl> - ARM64_INS_STNP , <nl> - ARM64_INS_STP , <nl> - ARM64_INS_STRB , <nl> - ARM64_INS_STR , <nl> - ARM64_INS_STRH , <nl> - ARM64_INS_STTRB , <nl> - ARM64_INS_STTRH , <nl> - ARM64_INS_STTR , <nl> - ARM64_INS_STURB , <nl> - ARM64_INS_STUR , <nl> - ARM64_INS_STURH , <nl> - ARM64_INS_STXP , <nl> - ARM64_INS_STXRB , <nl> - ARM64_INS_STXRH , <nl> - ARM64_INS_STXR , <nl> - ARM64_INS_SUBHN , <nl> - ARM64_INS_SUBHN2 , <nl> - ARM64_INS_SUB , <nl> - ARM64_INS_SUQADD , <nl> - ARM64_INS_SVC , <nl> - ARM64_INS_SYSL , <nl> - ARM64_INS_SYS , <nl> - ARM64_INS_TBL , <nl> - ARM64_INS_TBNZ , <nl> - ARM64_INS_TBX , <nl> - ARM64_INS_TBZ , <nl> - ARM64_INS_TRN1 , <nl> - ARM64_INS_TRN2 , <nl> - ARM64_INS_UABAL2 , <nl> - ARM64_INS_UABAL , <nl> - ARM64_INS_UABA , <nl> - ARM64_INS_UABDL2 , <nl> - ARM64_INS_UABDL , <nl> - ARM64_INS_UABD , <nl> - ARM64_INS_UADALP , <nl> - ARM64_INS_UADDLP , <nl> - ARM64_INS_UADDLV , <nl> - ARM64_INS_UADDL2 , <nl> - ARM64_INS_UADDL , <nl> - ARM64_INS_UADDW2 , <nl> - ARM64_INS_UADDW , <nl> - ARM64_INS_UBFM , <nl> - ARM64_INS_UCVTF , <nl> - ARM64_INS_UDIV , <nl> - ARM64_INS_UHADD , <nl> - ARM64_INS_UHSUB , <nl> - ARM64_INS_UMADDL , <nl> - ARM64_INS_UMAXP , <nl> - ARM64_INS_UMAXV , <nl> - ARM64_INS_UMAX , <nl> - ARM64_INS_UMINP , <nl> - ARM64_INS_UMINV , <nl> - ARM64_INS_UMIN , <nl> - ARM64_INS_UMLAL2 , <nl> - ARM64_INS_UMLAL , <nl> - ARM64_INS_UMLSL2 , <nl> - ARM64_INS_UMLSL , <nl> - ARM64_INS_UMOV , <nl> - ARM64_INS_UMSUBL , <nl> - ARM64_INS_UMULH , <nl> - ARM64_INS_UMULL2 , <nl> - ARM64_INS_UMULL , <nl> - ARM64_INS_UQADD , <nl> - ARM64_INS_UQRSHL , <nl> - ARM64_INS_UQRSHRN , <nl> - ARM64_INS_UQRSHRN2 , <nl> - ARM64_INS_UQSHL , <nl> - ARM64_INS_UQSHRN , <nl> - ARM64_INS_UQSHRN2 , <nl> - ARM64_INS_UQSUB , <nl> - ARM64_INS_UQXTN2 , <nl> - ARM64_INS_UQXTN , <nl> - ARM64_INS_URECPE , <nl> - ARM64_INS_URHADD , <nl> - ARM64_INS_URSHL , <nl> - ARM64_INS_URSHR , <nl> - ARM64_INS_URSQRTE , <nl> - ARM64_INS_URSRA , <nl> - ARM64_INS_USHLL2 , <nl> - ARM64_INS_USHLL , <nl> - ARM64_INS_USHL , <nl> - ARM64_INS_USHR , <nl> - ARM64_INS_USQADD , <nl> - ARM64_INS_USRA , <nl> - ARM64_INS_USUBL2 , <nl> - ARM64_INS_USUBL , <nl> - ARM64_INS_USUBW2 , <nl> - ARM64_INS_USUBW , <nl> - ARM64_INS_UZP1 , <nl> - ARM64_INS_UZP2 , <nl> - ARM64_INS_XTN2 , <nl> - ARM64_INS_XTN , <nl> - ARM64_INS_ZIP1 , <nl> - ARM64_INS_ZIP2 , <nl> - <nl> - / / alias insn <nl> - ARM64_INS_MNEG , <nl> - ARM64_INS_UMNEGL , <nl> - ARM64_INS_SMNEGL , <nl> - ARM64_INS_NOP , <nl> - ARM64_INS_YIELD , <nl> - ARM64_INS_WFE , <nl> - ARM64_INS_WFI , <nl> - ARM64_INS_SEV , <nl> - ARM64_INS_SEVL , <nl> - ARM64_INS_NGC , <nl> - ARM64_INS_SBFIZ , <nl> - ARM64_INS_UBFIZ , <nl> - ARM64_INS_SBFX , <nl> - ARM64_INS_UBFX , <nl> - ARM64_INS_BFI , <nl> - ARM64_INS_BFXIL , <nl> - ARM64_INS_CMN , <nl> - ARM64_INS_MVN , <nl> - ARM64_INS_TST , <nl> - ARM64_INS_CSET , <nl> - ARM64_INS_CINC , <nl> - ARM64_INS_CSETM , <nl> - ARM64_INS_CINV , <nl> - ARM64_INS_CNEG , <nl> - ARM64_INS_SXTB , <nl> - ARM64_INS_SXTH , <nl> - ARM64_INS_SXTW , <nl> - ARM64_INS_CMP , <nl> - ARM64_INS_UXTB , <nl> - ARM64_INS_UXTH , <nl> - ARM64_INS_UXTW , <nl> - ARM64_INS_IC , <nl> - ARM64_INS_DC , <nl> - ARM64_INS_AT , <nl> - ARM64_INS_TLBI , <nl> - <nl> - ARM64_INS_ENDING , / / < - - mark the end of the list of insn <nl> - } arm64_insn ; <nl> - <nl> - / / > Group of ARM64 instructions <nl> - typedef enum arm64_insn_group <nl> - { <nl> - ARM64_GRP_INVALID = 0 , / / = CS_GRP_INVALID <nl> - <nl> - / / > Generic groups <nl> - / / all jump instructions ( conditional + direct + indirect jumps ) <nl> - ARM64_GRP_JUMP , / / = CS_GRP_JUMP <nl> - <nl> - / / > Architecture - specific groups <nl> - ARM64_GRP_CRYPTO = 128 , <nl> - ARM64_GRP_FPARMV8 , <nl> - ARM64_GRP_NEON , <nl> - ARM64_GRP_CRC , <nl> - <nl> - ARM64_GRP_ENDING , / / < - - mark the end of the list of groups <nl> - } arm64_insn_group ; <nl> - <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> - <nl> - # endif <nl> deleted file mode 100644 <nl> index bdf37640a . . 000000000 <nl> mmm a / src / dbg / capstone / capstone . h <nl> ppp / dev / null <nl> <nl> - # ifndef CAPSTONE_ENGINE_H <nl> - # define CAPSTONE_ENGINE_H <nl> - <nl> - / * Capstone Disassembly Engine * / <nl> - / * By Nguyen Anh Quynh < aquynh @ gmail . com > , 2013 - 2014 * / <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - <nl> - # include < stdint . h > <nl> - # include < stdarg . h > <nl> - # if defined ( CAPSTONE_HAS_OSXKERNEL ) <nl> - # include < libkern / libkern . h > <nl> - # else <nl> - # include < stdlib . h > <nl> - # include < stdio . h > <nl> - # endif <nl> - <nl> - # include " platform . h " <nl> - <nl> - # ifdef _MSC_VER <nl> - # pragma warning ( disable : 4201 ) <nl> - # pragma warning ( disable : 4100 ) <nl> - # ifdef CAPSTONE_SHARED <nl> - # define CAPSTONE_EXPORT __declspec ( dllexport ) <nl> - # else / / defined ( CAPSTONE_STATIC ) <nl> - # define CAPSTONE_EXPORT <nl> - # endif <nl> - # else <nl> - # ifdef __GNUC__ <nl> - # define CAPSTONE_EXPORT __attribute__ ( ( visibility ( " default " ) ) ) <nl> - # else <nl> - # define CAPSTONE_EXPORT <nl> - # endif <nl> - # endif <nl> - <nl> - # ifdef __GNUC__ <nl> - # define CAPSTONE_DEPRECATED __attribute__ ( ( deprecated ) ) <nl> - # elif defined ( _MSC_VER ) <nl> - # define CAPSTONE_DEPRECATED __declspec ( deprecated ) <nl> - # else <nl> - # pragma message ( " WARNING : You need to implement CAPSTONE_DEPRECATED for this compiler " ) <nl> - # define CAPSTONE_DEPRECATED <nl> - # endif <nl> - <nl> - / / Capstone API version <nl> - # define CS_API_MAJOR 3 <nl> - # define CS_API_MINOR 0 <nl> - <nl> - / / Macro to create combined version which can be compared to <nl> - / / result of cs_version ( ) API . <nl> - # define CS_MAKE_VERSION ( major , minor ) ( ( major < < 8 ) + minor ) <nl> - <nl> - / / Handle using with all API <nl> - typedef size_t csh ; <nl> - <nl> - / / Architecture type <nl> - typedef enum cs_arch <nl> - { <nl> - CS_ARCH_ARM = 0 , / / ARM architecture ( including Thumb , Thumb - 2 ) <nl> - CS_ARCH_ARM64 , / / ARM - 64 , also called AArch64 <nl> - CS_ARCH_MIPS , / / Mips architecture <nl> - CS_ARCH_X86 , / / X86 architecture ( including x86 & x86 - 64 ) <nl> - CS_ARCH_PPC , / / PowerPC architecture <nl> - CS_ARCH_SPARC , / / Sparc architecture <nl> - CS_ARCH_SYSZ , / / SystemZ architecture <nl> - CS_ARCH_XCORE , / / XCore architecture <nl> - CS_ARCH_MAX , <nl> - CS_ARCH_ALL = 0xFFFF , / / All architectures - for cs_support ( ) <nl> - } cs_arch ; <nl> - <nl> - / / Support value to verify diet mode of the engine . <nl> - / / If cs_support ( CS_SUPPORT_DIET ) return True , the engine was compiled <nl> - / / in diet mode . <nl> - # define CS_SUPPORT_DIET ( CS_ARCH_ALL + 1 ) <nl> - <nl> - / / Support value to verify X86 reduce mode of the engine . <nl> - / / If cs_support ( CS_SUPPORT_X86_REDUCE ) return True , the engine was compiled <nl> - / / in X86 reduce mode . <nl> - # define CS_SUPPORT_X86_REDUCE ( CS_ARCH_ALL + 2 ) <nl> - <nl> - / / Mode type <nl> - typedef enum cs_mode <nl> - { <nl> - CS_MODE_LITTLE_ENDIAN = 0 , / / little - endian mode ( default mode ) <nl> - CS_MODE_ARM = 0 , / / 32 - bit ARM <nl> - CS_MODE_16 = 1 < < 1 , / / 16 - bit mode ( X86 ) <nl> - CS_MODE_32 = 1 < < 2 , / / 32 - bit mode ( X86 ) <nl> - CS_MODE_64 = 1 < < 3 , / / 64 - bit mode ( X86 , PPC ) <nl> - CS_MODE_THUMB = 1 < < 4 , / / ARM ' s Thumb mode , including Thumb - 2 <nl> - CS_MODE_MCLASS = 1 < < 5 , / / ARM ' s Cortex - M series <nl> - CS_MODE_V8 = 1 < < 6 , / / ARMv8 A32 encodings for ARM <nl> - CS_MODE_MICRO = 1 < < 4 , / / MicroMips mode ( MIPS ) <nl> - CS_MODE_MIPS3 = 1 < < 5 , / / Mips III ISA <nl> - CS_MODE_MIPS32R6 = 1 < < 6 , / / Mips32r6 ISA <nl> - CS_MODE_MIPSGP64 = 1 < < 7 , / / General Purpose Registers are 64 - bit wide ( MIPS ) <nl> - CS_MODE_V9 = 1 < < 4 , / / SparcV9 mode ( Sparc ) <nl> - CS_MODE_BIG_ENDIAN = 1 < < 31 , / / big - endian mode <nl> - CS_MODE_MIPS32 = CS_MODE_32 , / / Mips32 ISA ( Mips ) <nl> - CS_MODE_MIPS64 = CS_MODE_64 , / / Mips64 ISA ( Mips ) <nl> - } cs_mode ; <nl> - <nl> - typedef void * ( * cs_malloc_t ) ( size_t size ) ; <nl> - typedef void * ( * cs_calloc_t ) ( size_t nmemb , size_t size ) ; <nl> - typedef void * ( * cs_realloc_t ) ( void * ptr , size_t size ) ; <nl> - typedef void ( * cs_free_t ) ( void * ptr ) ; <nl> - typedef int ( * cs_vsnprintf_t ) ( char * str , size_t size , const char * format , va_list ap ) ; <nl> - <nl> - <nl> - / / User - defined dynamic memory related functions : malloc / calloc / realloc / free / vsnprintf ( ) <nl> - / / By default , Capstone uses system ' s malloc ( ) , calloc ( ) , realloc ( ) , free ( ) & vsnprintf ( ) . <nl> - typedef struct cs_opt_mem <nl> - { <nl> - cs_malloc_t malloc ; <nl> - cs_calloc_t calloc ; <nl> - cs_realloc_t realloc ; <nl> - cs_free_t free ; <nl> - cs_vsnprintf_t vsnprintf ; <nl> - } cs_opt_mem ; <nl> - <nl> - / / Runtime option for the disassembled engine <nl> - typedef enum cs_opt_type <nl> - { <nl> - CS_OPT_SYNTAX = 1 , / / Assembly output syntax <nl> - CS_OPT_DETAIL , / / Break down instruction structure into details <nl> - CS_OPT_MODE , / / Change engine ' s mode at run - time <nl> - CS_OPT_MEM , / / User - defined dynamic memory related functions <nl> - CS_OPT_SKIPDATA , / / Skip data when disassembling . Then engine is in SKIPDATA mode . <nl> - CS_OPT_SKIPDATA_SETUP , / / Setup user - defined function for SKIPDATA option <nl> - } cs_opt_type ; <nl> - <nl> - / / Runtime option value ( associated with option type above ) <nl> - typedef enum cs_opt_value <nl> - { <nl> - CS_OPT_OFF = 0 , / / Turn OFF an option - default option of CS_OPT_DETAIL , CS_OPT_SKIPDATA . <nl> - CS_OPT_ON = 3 , / / Turn ON an option ( CS_OPT_DETAIL , CS_OPT_SKIPDATA ) . <nl> - CS_OPT_SYNTAX_DEFAULT = 0 , / / Default asm syntax ( CS_OPT_SYNTAX ) . <nl> - CS_OPT_SYNTAX_INTEL , / / X86 Intel asm syntax - default on X86 ( CS_OPT_SYNTAX ) . <nl> - CS_OPT_SYNTAX_ATT , / / X86 ATT asm syntax ( CS_OPT_SYNTAX ) . <nl> - CS_OPT_SYNTAX_NOREGNAME , / / Prints register name with only number ( CS_OPT_SYNTAX ) <nl> - } cs_opt_value ; <nl> - <nl> - / / > Common instruction operand types - to be consistent across all architectures . <nl> - typedef enum cs_op_type <nl> - { <nl> - CS_OP_INVALID = 0 , / / uninitialized / invalid operand . <nl> - CS_OP_REG , / / Register operand . <nl> - CS_OP_IMM , / / Immediate operand . <nl> - CS_OP_MEM , / / Memory operand . <nl> - CS_OP_FP , / / Floating - Point operand . <nl> - } cs_op_type ; <nl> - <nl> - / / > Common instruction groups - to be consistent across all architectures . <nl> - typedef enum cs_group_type <nl> - { <nl> - CS_GRP_INVALID = 0 , / / uninitialized / invalid group . <nl> - CS_GRP_JUMP , / / all jump instructions ( conditional + direct + indirect jumps ) <nl> - CS_GRP_CALL , / / all call instructions <nl> - CS_GRP_RET , / / all return instructions <nl> - CS_GRP_INT , / / all interrupt instructions ( int + syscall ) <nl> - CS_GRP_IRET , / / all interrupt return instructions <nl> - } cs_group_type ; <nl> - <nl> - / * <nl> - User - defined callback function for SKIPDATA option . <nl> - See tests / test_skipdata . c for sample code demonstrating this API . <nl> - <nl> - @ code : the input buffer containing code to be disassembled . <nl> - This is the same buffer passed to cs_disasm ( ) . <nl> - @ code_size : size ( in bytes ) of the above @ code buffer . <nl> - @ offset : the position of the currently - examining byte in the input <nl> - buffer @ code mentioned above . <nl> - @ user_data : user - data passed to cs_option ( ) via @ user_data field in <nl> - cs_opt_skipdata struct below . <nl> - <nl> - @ return : return number of bytes to skip , or 0 to immediately stop disassembling . <nl> - * / <nl> - typedef size_t ( * cs_skipdata_cb_t ) ( const uint8_t * code , size_t code_size , size_t offset , void * user_data ) ; <nl> - <nl> - / / User - customized setup for SKIPDATA option <nl> - typedef struct cs_opt_skipdata <nl> - { <nl> - / / Capstone considers data to skip as special " instructions " . <nl> - / / User can specify the string for this instruction ' s " mnemonic " here . <nl> - / / By default ( if @ mnemonic is NULL ) , Capstone use " . byte " . <nl> - const char * mnemonic ; <nl> - <nl> - / / User - defined callback function to be called when Capstone hits data . <nl> - / / If the returned value from this callback is positive ( > 0 ) , Capstone <nl> - / / will skip exactly that number of bytes & continue . Otherwise , if <nl> - / / the callback returns 0 , Capstone stops disassembling and returns <nl> - / / immediately from cs_disasm ( ) <nl> - / / NOTE : if this callback pointer is NULL , Capstone would skip a number <nl> - / / of bytes depending on architectures , as following : <nl> - / / Arm : 2 bytes ( Thumb mode ) or 4 bytes . <nl> - / / Arm64 : 4 bytes . <nl> - / / Mips : 4 bytes . <nl> - / / PowerPC : 4 bytes . <nl> - / / Sparc : 4 bytes . <nl> - / / SystemZ : 2 bytes . <nl> - / / X86 : 1 bytes . <nl> - / / XCore : 2 bytes . <nl> - cs_skipdata_cb_t callback ; / / default value is NULL <nl> - <nl> - / / User - defined data to be passed to @ callback function pointer . <nl> - void * user_data ; <nl> - } cs_opt_skipdata ; <nl> - <nl> - <nl> - # include " arm . h " <nl> - # include " arm64 . h " <nl> - # include " mips . h " <nl> - # include " ppc . h " <nl> - # include " sparc . h " <nl> - # include " systemz . h " <nl> - # include " x86 . h " <nl> - # include " xcore . h " <nl> - <nl> - / / NOTE : All information in cs_detail is only available when CS_OPT_DETAIL = CS_OPT_ON <nl> - typedef struct cs_detail <nl> - { <nl> - uint8_t regs_read [ 12 ] ; / / list of implicit registers read by this insn <nl> - uint8_t regs_read_count ; / / number of implicit registers read by this insn <nl> - <nl> - uint8_t regs_write [ 20 ] ; / / list of implicit registers modified by this insn <nl> - uint8_t regs_write_count ; / / number of implicit registers modified by this insn <nl> - <nl> - uint8_t groups [ 8 ] ; / / list of group this instruction belong to <nl> - uint8_t groups_count ; / / number of groups this insn belongs to <nl> - <nl> - / / Architecture - specific instruction info <nl> - union <nl> - { <nl> - cs_x86 x86 ; / / X86 architecture , including 16 - bit , 32 - bit & 64 - bit mode <nl> - cs_arm64 arm64 ; / / ARM64 architecture ( aka AArch64 ) <nl> - cs_arm arm ; / / ARM architecture ( including Thumb / Thumb2 ) <nl> - cs_mips mips ; / / MIPS architecture <nl> - cs_ppc ppc ; / / PowerPC architecture <nl> - cs_sparc sparc ; / / Sparc architecture <nl> - cs_sysz sysz ; / / SystemZ architecture <nl> - cs_xcore xcore ; / / XCore architecture <nl> - } ; <nl> - } cs_detail ; <nl> - <nl> - / / Detail information of disassembled instruction <nl> - typedef struct cs_insn <nl> - { <nl> - / / Instruction ID ( basically a numeric ID for the instruction mnemonic ) <nl> - / / Find the instruction id in the ' [ ARCH ] _insn ' enum in the header file <nl> - / / of corresponding architecture , such as ' arm_insn ' in arm . h for ARM , <nl> - / / ' x86_insn ' in x86 . h for X86 , etc . . . <nl> - / / This information is available even when CS_OPT_DETAIL = CS_OPT_OFF <nl> - / / NOTE : in Skipdata mode , " data " instruction has 0 for this id field . <nl> - unsigned int id ; <nl> - <nl> - / / Address ( EIP ) of this instruction <nl> - / / This information is available even when CS_OPT_DETAIL = CS_OPT_OFF <nl> - uint64_t address ; <nl> - <nl> - / / Size of this instruction <nl> - / / This information is available even when CS_OPT_DETAIL = CS_OPT_OFF <nl> - uint16_t size ; <nl> - / / Machine bytes of this instruction , with number of bytes indicated by @ size above <nl> - / / This information is available even when CS_OPT_DETAIL = CS_OPT_OFF <nl> - uint8_t bytes [ 16 ] ; <nl> - <nl> - / / Ascii text of instruction mnemonic <nl> - / / This information is available even when CS_OPT_DETAIL = CS_OPT_OFF <nl> - char mnemonic [ 32 ] ; <nl> - <nl> - / / Ascii text of instruction operands <nl> - / / This information is available even when CS_OPT_DETAIL = CS_OPT_OFF <nl> - char op_str [ 160 ] ; <nl> - <nl> - / / Pointer to cs_detail . <nl> - / / NOTE : detail pointer is only valid when both requirements below are met : <nl> - / / ( 1 ) CS_OP_DETAIL = CS_OPT_ON <nl> - / / ( 2 ) Engine is not in Skipdata mode ( CS_OP_SKIPDATA option set to CS_OPT_ON ) <nl> - / / <nl> - / / NOTE 2 : when in Skipdata mode , or when detail mode is OFF , even if this pointer <nl> - / / is not NULL , its content is still irrelevant . <nl> - cs_detail * detail ; <nl> - } cs_insn ; <nl> - <nl> - <nl> - / / Calculate the offset of a disassembled instruction in its buffer , given its position <nl> - / / in its array of disassembled insn <nl> - / / NOTE : this macro works with position ( > = 1 ) , not index <nl> - # define CS_INSN_OFFSET ( insns , post ) ( insns [ post - 1 ] . address - insns [ 0 ] . address ) <nl> - <nl> - <nl> - / / All type of errors encountered by Capstone API . <nl> - / / These are values returned by cs_errno ( ) <nl> - typedef enum cs_err <nl> - { <nl> - CS_ERR_OK = 0 , / / No error : everything was fine <nl> - CS_ERR_MEM , / / Out - Of - Memory error : cs_open ( ) , cs_disasm ( ) , cs_disasm_iter ( ) <nl> - CS_ERR_ARCH , / / Unsupported architecture : cs_open ( ) <nl> - CS_ERR_HANDLE , / / Invalid handle : cs_op_count ( ) , cs_op_index ( ) <nl> - CS_ERR_CSH , / / Invalid csh argument : cs_close ( ) , cs_errno ( ) , cs_option ( ) <nl> - CS_ERR_MODE , / / Invalid / unsupported mode : cs_open ( ) <nl> - CS_ERR_OPTION , / / Invalid / unsupported option : cs_option ( ) <nl> - CS_ERR_DETAIL , / / Information is unavailable because detail option is OFF <nl> - CS_ERR_MEMSETUP , / / Dynamic memory management uninitialized ( see CS_OPT_MEM ) <nl> - CS_ERR_VERSION , / / Unsupported version ( bindings ) <nl> - CS_ERR_DIET , / / Access irrelevant data in " diet " engine <nl> - CS_ERR_SKIPDATA , / / Access irrelevant data for " data " instruction in SKIPDATA mode <nl> - CS_ERR_X86_ATT , / / X86 AT & T syntax is unsupported ( opt - out at compile time ) <nl> - CS_ERR_X86_INTEL , / / X86 Intel syntax is unsupported ( opt - out at compile time ) <nl> - } cs_err ; <nl> - <nl> - / * <nl> - Return combined API version & major and minor version numbers . <nl> - <nl> - @ major : major number of API version <nl> - @ minor : minor number of API version <nl> - <nl> - @ return hexical number as ( major < < 8 | minor ) , which encodes both <nl> - major & minor versions . <nl> - NOTE : This returned value can be compared with version number made <nl> - with macro CS_MAKE_VERSION <nl> - <nl> - For example , second API version would return 1 in @ major , and 1 in @ minor <nl> - The return value would be 0x0101 <nl> - <nl> - NOTE : if you only care about returned value , but not major and minor values , <nl> - set both @ major & @ minor arguments to NULL . <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - unsigned int cs_version ( int * major , int * minor ) ; <nl> - <nl> - <nl> - / * <nl> - This API can be used to either ask for archs supported by this library , <nl> - or check to see if the library was compile with ' diet ' option ( or called <nl> - in ' diet ' mode ) . <nl> - <nl> - To check if a particular arch is supported by this library , set @ query to <nl> - arch mode ( CS_ARCH_ * value ) . <nl> - To verify if this library supports all the archs , use CS_ARCH_ALL . <nl> - <nl> - To check if this library is in ' diet ' mode , set @ query to CS_SUPPORT_DIET . <nl> - <nl> - @ return True if this library supports the given arch , or in ' diet ' mode . <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - bool cs_support ( int query ) ; <nl> - <nl> - / * <nl> - Initialize CS handle : this must be done before any usage of CS . <nl> - <nl> - @ arch : architecture type ( CS_ARCH_ * ) <nl> - @ mode : hardware mode . This is combined of CS_MODE_ * <nl> - @ handle : pointer to handle , which will be updated at return time <nl> - <nl> - @ return CS_ERR_OK on success , or other value on failure ( refer to cs_err enum <nl> - for detailed error ) . <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - cs_err cs_open ( cs_arch arch , cs_mode mode , csh * handle ) ; <nl> - <nl> - / * <nl> - Close CS handle : MUST do to release the handle when it is not used anymore . <nl> - NOTE : this must be only called when there is no longer usage of Capstone , <nl> - not even access to cs_insn array . The reason is the this API releases some <nl> - cached memory , thus access to any Capstone API after cs_close ( ) might crash <nl> - your application . <nl> - <nl> - In fact , this API invalidate @ handle by ZERO out its value ( i . e * handle = 0 ) . <nl> - <nl> - @ handle : pointer to a handle returned by cs_open ( ) <nl> - <nl> - @ return CS_ERR_OK on success , or other value on failure ( refer to cs_err enum <nl> - for detailed error ) . <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - cs_err cs_close ( csh * handle ) ; <nl> - <nl> - / * <nl> - Set option for disassembling engine at runtime <nl> - <nl> - @ handle : handle returned by cs_open ( ) <nl> - @ type : type of option to be set <nl> - @ value : option value corresponding with @ type <nl> - <nl> - @ return : CS_ERR_OK on success , or other value on failure . <nl> - Refer to cs_err enum for detailed error . <nl> - <nl> - NOTE : in the case of CS_OPT_MEM , handle ' s value can be anything , <nl> - so that cs_option ( handle , CS_OPT_MEM , value ) can ( i . e must ) be called <nl> - even before cs_open ( ) <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - cs_err cs_option ( csh handle , cs_opt_type type , size_t value ) ; <nl> - <nl> - / * <nl> - Report the last error number when some API function fail . <nl> - Like glibc ' s errno , cs_errno might not retain its old value once accessed . <nl> - <nl> - @ handle : handle returned by cs_open ( ) <nl> - <nl> - @ return : error code of cs_err enum type ( CS_ERR_ * , see above ) <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - cs_err cs_errno ( csh handle ) ; <nl> - <nl> - <nl> - / * <nl> - Return a string describing given error code . <nl> - <nl> - @ code : error code ( see CS_ERR_ * above ) <nl> - <nl> - @ return : returns a pointer to a string that describes the error code <nl> - passed in the argument @ code <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - const char * cs_strerror ( cs_err code ) ; <nl> - <nl> - / * <nl> - Disassemble binary code , given the code buffer , size , address and number <nl> - of instructions to be decoded . <nl> - This API dynamically allocate memory to contain disassembled instruction . <nl> - Resulted instructions will be put into @ * insn <nl> - <nl> - NOTE 1 : this API will automatically determine memory needed to contain <nl> - output disassembled instructions in @ insn . <nl> - <nl> - NOTE 2 : caller must free the allocated memory itself to avoid memory leaking . <nl> - <nl> - NOTE 3 : for system with scarce memory to be dynamically allocated such as <nl> - OS kernel or firmware , the API cs_disasm_iter ( ) might be a better choice than <nl> - cs_disasm ( ) . The reason is that with cs_disasm ( ) , based on limited available <nl> - memory , we have to calculate in advance how many instructions to be disassembled , <nl> - which complicates things . This is especially troublesome for the case @ count = 0 , <nl> - when cs_disasm ( ) runs uncontrollably ( until either end of input buffer , or <nl> - when it encounters an invalid instruction ) . <nl> - <nl> - @ handle : handle returned by cs_open ( ) <nl> - @ code : buffer containing raw binary code to be disassembled . <nl> - @ code_size : size of the above code buffer . <nl> - @ address : address of the first instruction in given raw code buffer . <nl> - @ insn : array of instructions filled in by this API . <nl> - NOTE : @ insn will be allocated by this function , and should be freed <nl> - with cs_free ( ) API . <nl> - @ count : number of instructions to be disassembled , or 0 to get all of them <nl> - <nl> - @ return : the number of successfully disassembled instructions , <nl> - or 0 if this function failed to disassemble the given code <nl> - <nl> - On failure , call cs_errno ( ) for error code . <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - size_t cs_disasm ( csh handle , <nl> - const uint8_t * code , size_t code_size , <nl> - uint64_t address , <nl> - size_t count , <nl> - cs_insn * * insn ) ; <nl> - <nl> - / * <nl> - Deprecated function - to be retired in the next version ! <nl> - Use cs_disasm ( ) instead of cs_disasm_ex ( ) <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - CAPSTONE_DEPRECATED <nl> - size_t cs_disasm_ex ( csh handle , <nl> - const uint8_t * code , size_t code_size , <nl> - uint64_t address , <nl> - size_t count , <nl> - cs_insn * * insn ) ; <nl> - <nl> - / * <nl> - Free memory allocated by cs_malloc ( ) or cs_disasm ( ) ( argument @ insn ) <nl> - <nl> - @ insn : pointer returned by @ insn argument in cs_disasm ( ) or cs_malloc ( ) <nl> - @ count : number of cs_insn structures returned by cs_disasm ( ) , or 1 <nl> - to free memory allocated by cs_malloc ( ) . <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - void cs_free ( cs_insn * insn , size_t count ) ; <nl> - <nl> - <nl> - / * <nl> - Allocate memory for 1 instruction to be used by cs_disasm_iter ( ) . <nl> - <nl> - @ handle : handle returned by cs_open ( ) <nl> - <nl> - NOTE : when no longer in use , you can reclaim the memory allocated for <nl> - this instruction with cs_free ( insn , 1 ) <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - cs_insn * cs_malloc ( csh handle ) ; <nl> - <nl> - / * <nl> - Fast API to disassemble binary code , given the code buffer , size , address <nl> - and number of instructions to be decoded . <nl> - This API put the resulted instruction into a given cache in @ insn . <nl> - See tests / test_iter . c for sample code demonstrating this API . <nl> - <nl> - NOTE 1 : this API will update @ code , @ size & @ address to point to the next <nl> - instruction in the input buffer . Therefore , it is convenient to use <nl> - cs_disasm_iter ( ) inside a loop to quickly iterate all the instructions . <nl> - While decoding one instruction at a time can also be achieved with <nl> - cs_disasm ( count = 1 ) , some benchmarks shown that cs_disasm_iter ( ) can be 30 % <nl> - faster on random input . <nl> - <nl> - NOTE 2 : the cache in @ insn can be created with cs_malloc ( ) API . <nl> - <nl> - NOTE 3 : for system with scarce memory to be dynamically allocated such as <nl> - OS kernel or firmware , this API is recommended over cs_disasm ( ) , which <nl> - allocates memory based on the number of instructions to be disassembled . <nl> - The reason is that with cs_disasm ( ) , based on limited available memory , <nl> - we have to calculate in advance how many instructions to be disassembled , <nl> - which complicates things . This is especially troublesome for the case <nl> - @ count = 0 , when cs_disasm ( ) runs uncontrollably ( until either end of input <nl> - buffer , or when it encounters an invalid instruction ) . <nl> - <nl> - @ handle : handle returned by cs_open ( ) <nl> - @ code : buffer containing raw binary code to be disassembled <nl> - @ code_size : size of above code <nl> - @ address : address of the first insn in given raw code buffer <nl> - @ insn : pointer to instruction to be filled in by this API . <nl> - <nl> - @ return : true if this API successfully decode 1 instruction , <nl> - or false otherwise . <nl> - <nl> - On failure , call cs_errno ( ) for error code . <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - bool cs_disasm_iter ( csh handle , <nl> - const uint8_t * * code , size_t * size , <nl> - uint64_t * address , cs_insn * insn ) ; <nl> - <nl> - / * <nl> - Return friendly name of register in a string . <nl> - Find the instruction id from header file of corresponding architecture ( arm . h for ARM , <nl> - x86 . h for X86 , . . . ) <nl> - <nl> - WARN : when in ' diet ' mode , this API is irrelevant because engine does not <nl> - store register name . <nl> - <nl> - @ handle : handle returned by cs_open ( ) <nl> - @ reg_id : register id <nl> - <nl> - @ return : string name of the register , or NULL if @ reg_id is invalid . <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - const char * cs_reg_name ( csh handle , unsigned int reg_id ) ; <nl> - <nl> - / * <nl> - Return friendly name of an instruction in a string . <nl> - Find the instruction id from header file of corresponding architecture ( arm . h for ARM , x86 . h for X86 , . . . ) <nl> - <nl> - WARN : when in ' diet ' mode , this API is irrelevant because the engine does not <nl> - store instruction name . <nl> - <nl> - @ handle : handle returned by cs_open ( ) <nl> - @ insn_id : instruction id <nl> - <nl> - @ return : string name of the instruction , or NULL if @ insn_id is invalid . <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - const char * cs_insn_name ( csh handle , unsigned int insn_id ) ; <nl> - <nl> - / * <nl> - Return friendly name of a group id ( that an instruction can belong to ) <nl> - Find the group id from header file of corresponding architecture ( arm . h for ARM , x86 . h for X86 , . . . ) <nl> - <nl> - WARN : when in ' diet ' mode , this API is irrelevant because the engine does not <nl> - store group name . <nl> - <nl> - @ handle : handle returned by cs_open ( ) <nl> - @ group_id : group id <nl> - <nl> - @ return : string name of the group , or NULL if @ group_id is invalid . <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - const char * cs_group_name ( csh handle , unsigned int group_id ) ; <nl> - <nl> - / * <nl> - Check if a disassembled instruction belong to a particular group . <nl> - Find the group id from header file of corresponding architecture ( arm . h for ARM , x86 . h for X86 , . . . ) <nl> - Internally , this simply verifies if @ group_id matches any member of insn - > groups array . <nl> - <nl> - NOTE : this API is only valid when detail option is ON ( which is OFF by default ) . <nl> - <nl> - WARN : when in ' diet ' mode , this API is irrelevant because the engine does not <nl> - update @ groups array . <nl> - <nl> - @ handle : handle returned by cs_open ( ) <nl> - @ insn : disassembled instruction structure received from cs_disasm ( ) or cs_disasm_iter ( ) <nl> - @ group_id : group that you want to check if this instruction belong to . <nl> - <nl> - @ return : true if this instruction indeed belongs to aboved group , or false otherwise . <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - bool cs_insn_group ( csh handle , const cs_insn * insn , unsigned int group_id ) ; <nl> - <nl> - / * <nl> - Check if a disassembled instruction IMPLICITLY used a particular register . <nl> - Find the register id from header file of corresponding architecture ( arm . h for ARM , x86 . h for X86 , . . . ) <nl> - Internally , this simply verifies if @ reg_id matches any member of insn - > regs_read array . <nl> - <nl> - NOTE : this API is only valid when detail option is ON ( which is OFF by default ) <nl> - <nl> - WARN : when in ' diet ' mode , this API is irrelevant because the engine does not <nl> - update @ regs_read array . <nl> - <nl> - @ insn : disassembled instruction structure received from cs_disasm ( ) or cs_disasm_iter ( ) <nl> - @ reg_id : register that you want to check if this instruction used it . <nl> - <nl> - @ return : true if this instruction indeed implicitly used aboved register , or false otherwise . <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - bool cs_reg_read ( csh handle , const cs_insn * insn , unsigned int reg_id ) ; <nl> - <nl> - / * <nl> - Check if a disassembled instruction IMPLICITLY modified a particular register . <nl> - Find the register id from header file of corresponding architecture ( arm . h for ARM , x86 . h for X86 , . . . ) <nl> - Internally , this simply verifies if @ reg_id matches any member of insn - > regs_write array . <nl> - <nl> - NOTE : this API is only valid when detail option is ON ( which is OFF by default ) <nl> - <nl> - WARN : when in ' diet ' mode , this API is irrelevant because the engine does not <nl> - update @ regs_write array . <nl> - <nl> - @ insn : disassembled instruction structure received from cs_disasm ( ) or cs_disasm_iter ( ) <nl> - @ reg_id : register that you want to check if this instruction modified it . <nl> - <nl> - @ return : true if this instruction indeed implicitly modified aboved register , or false otherwise . <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - bool cs_reg_write ( csh handle , const cs_insn * insn , unsigned int reg_id ) ; <nl> - <nl> - / * <nl> - Count the number of operands of a given type . <nl> - Find the operand type in header file of corresponding architecture ( arm . h for ARM , x86 . h for X86 , . . . ) <nl> - <nl> - NOTE : this API is only valid when detail option is ON ( which is OFF by default ) <nl> - <nl> - @ handle : handle returned by cs_open ( ) <nl> - @ insn : disassembled instruction structure received from cs_disasm ( ) or cs_disasm_iter ( ) <nl> - @ op_type : Operand type to be found . <nl> - <nl> - @ return : number of operands of given type @ op_type in instruction @ insn , <nl> - or - 1 on failure . <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - int cs_op_count ( csh handle , const cs_insn * insn , unsigned int op_type ) ; <nl> - <nl> - / * <nl> - Retrieve the position of operand of given type in < arch > . operands [ ] array . <nl> - Later , the operand can be accessed using the returned position . <nl> - Find the operand type in header file of corresponding architecture ( arm . h for ARM , x86 . h for X86 , . . . ) <nl> - <nl> - NOTE : this API is only valid when detail option is ON ( which is OFF by default ) <nl> - <nl> - @ handle : handle returned by cs_open ( ) <nl> - @ insn : disassembled instruction structure received from cs_disasm ( ) or cs_disasm_iter ( ) <nl> - @ op_type : Operand type to be found . <nl> - @ position : position of the operand to be found . This must be in the range <nl> - [ 1 , cs_op_count ( handle , insn , op_type ) ] <nl> - <nl> - @ return : index of operand of given type @ op_type in < arch > . operands [ ] array <nl> - in instruction @ insn , or - 1 on failure . <nl> - * / <nl> - CAPSTONE_EXPORT <nl> - int cs_op_index ( csh handle , const cs_insn * insn , unsigned int op_type , <nl> - unsigned int position ) ; <nl> - <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> - <nl> - # endif <nl> deleted file mode 100644 <nl> index e776a6c91 . . 000000000 <nl> Binary files a / src / dbg / capstone / capstone_x64 . a and / dev / null differ <nl> deleted file mode 100644 <nl> index 4687ba5c8 . . 000000000 <nl> Binary files a / src / dbg / capstone / capstone_x64 . lib and / dev / null differ <nl> deleted file mode 100644 <nl> index eb6f6eee6 . . 000000000 <nl> Binary files a / src / dbg / capstone / capstone_x86 . a and / dev / null differ <nl> deleted file mode 100644 <nl> index b9371a94e . . 000000000 <nl> Binary files a / src / dbg / capstone / capstone_x86 . lib and / dev / null differ <nl> deleted file mode 100644 <nl> index 2fe5ff429 . . 000000000 <nl> mmm a / src / dbg / capstone / mips . h <nl> ppp / dev / null <nl> <nl> - # ifndef CAPSTONE_MIPS_H <nl> - # define CAPSTONE_MIPS_H <nl> - <nl> - / * Capstone Disassembly Engine * / <nl> - / * By Nguyen Anh Quynh < aquynh @ gmail . com > , 2013 - 2014 * / <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - <nl> - # include < stdint . h > <nl> - # include " platform . h " <nl> - <nl> - / / GCC MIPS toolchain has a default macro called " mips " which breaks <nl> - / / compilation <nl> - # undef mips <nl> - <nl> - # ifdef _MSC_VER <nl> - # pragma warning ( disable : 4201 ) <nl> - # endif <nl> - <nl> - / / > Operand type for instruction ' s operands <nl> - typedef enum mips_op_type <nl> - { <nl> - MIPS_OP_INVALID = 0 , / / = CS_OP_INVALID ( Uninitialized ) . <nl> - MIPS_OP_REG , / / = CS_OP_REG ( Register operand ) . <nl> - MIPS_OP_IMM , / / = CS_OP_IMM ( Immediate operand ) . <nl> - MIPS_OP_MEM , / / = CS_OP_MEM ( Memory operand ) . <nl> - } mips_op_type ; <nl> - <nl> - / / Instruction ' s operand referring to memory <nl> - / / This is associated with MIPS_OP_MEM operand type above <nl> - typedef struct mips_op_mem <nl> - { <nl> - unsigned int base ; / / base register <nl> - int64_t disp ; / / displacement / offset value <nl> - } mips_op_mem ; <nl> - <nl> - / / Instruction operand <nl> - typedef struct cs_mips_op <nl> - { <nl> - mips_op_type type ; / / operand type <nl> - union <nl> - { <nl> - unsigned int reg ; / / register value for REG operand <nl> - int64_t imm ; / / immediate value for IMM operand <nl> - mips_op_mem mem ; / / base / index / scale / disp value for MEM operand <nl> - } ; <nl> - } cs_mips_op ; <nl> - <nl> - / / Instruction structure <nl> - typedef struct cs_mips <nl> - { <nl> - / / Number of operands of this instruction , <nl> - / / or 0 when instruction has no operand . <nl> - uint8_t op_count ; <nl> - cs_mips_op operands [ 8 ] ; / / operands for this instruction . <nl> - } cs_mips ; <nl> - <nl> - / / > MIPS registers <nl> - typedef enum mips_reg <nl> - { <nl> - MIPS_REG_INVALID = 0 , <nl> - / / > General purpose registers <nl> - MIPS_REG_0 , <nl> - MIPS_REG_1 , <nl> - MIPS_REG_2 , <nl> - MIPS_REG_3 , <nl> - MIPS_REG_4 , <nl> - MIPS_REG_5 , <nl> - MIPS_REG_6 , <nl> - MIPS_REG_7 , <nl> - MIPS_REG_8 , <nl> - MIPS_REG_9 , <nl> - MIPS_REG_10 , <nl> - MIPS_REG_11 , <nl> - MIPS_REG_12 , <nl> - MIPS_REG_13 , <nl> - MIPS_REG_14 , <nl> - MIPS_REG_15 , <nl> - MIPS_REG_16 , <nl> - MIPS_REG_17 , <nl> - MIPS_REG_18 , <nl> - MIPS_REG_19 , <nl> - MIPS_REG_20 , <nl> - MIPS_REG_21 , <nl> - MIPS_REG_22 , <nl> - MIPS_REG_23 , <nl> - MIPS_REG_24 , <nl> - MIPS_REG_25 , <nl> - MIPS_REG_26 , <nl> - MIPS_REG_27 , <nl> - MIPS_REG_28 , <nl> - MIPS_REG_29 , <nl> - MIPS_REG_30 , <nl> - MIPS_REG_31 , <nl> - <nl> - / / > DSP registers <nl> - MIPS_REG_DSPCCOND , <nl> - MIPS_REG_DSPCARRY , <nl> - MIPS_REG_DSPEFI , <nl> - MIPS_REG_DSPOUTFLAG , <nl> - MIPS_REG_DSPOUTFLAG16_19 , <nl> - MIPS_REG_DSPOUTFLAG20 , <nl> - MIPS_REG_DSPOUTFLAG21 , <nl> - MIPS_REG_DSPOUTFLAG22 , <nl> - MIPS_REG_DSPOUTFLAG23 , <nl> - MIPS_REG_DSPPOS , <nl> - MIPS_REG_DSPSCOUNT , <nl> - <nl> - / / > ACC registers <nl> - MIPS_REG_AC0 , <nl> - MIPS_REG_AC1 , <nl> - MIPS_REG_AC2 , <nl> - MIPS_REG_AC3 , <nl> - <nl> - / / > COP registers <nl> - MIPS_REG_CC0 , <nl> - MIPS_REG_CC1 , <nl> - MIPS_REG_CC2 , <nl> - MIPS_REG_CC3 , <nl> - MIPS_REG_CC4 , <nl> - MIPS_REG_CC5 , <nl> - MIPS_REG_CC6 , <nl> - MIPS_REG_CC7 , <nl> - <nl> - / / > FPU registers <nl> - MIPS_REG_F0 , <nl> - MIPS_REG_F1 , <nl> - MIPS_REG_F2 , <nl> - MIPS_REG_F3 , <nl> - MIPS_REG_F4 , <nl> - MIPS_REG_F5 , <nl> - MIPS_REG_F6 , <nl> - MIPS_REG_F7 , <nl> - MIPS_REG_F8 , <nl> - MIPS_REG_F9 , <nl> - MIPS_REG_F10 , <nl> - MIPS_REG_F11 , <nl> - MIPS_REG_F12 , <nl> - MIPS_REG_F13 , <nl> - MIPS_REG_F14 , <nl> - MIPS_REG_F15 , <nl> - MIPS_REG_F16 , <nl> - MIPS_REG_F17 , <nl> - MIPS_REG_F18 , <nl> - MIPS_REG_F19 , <nl> - MIPS_REG_F20 , <nl> - MIPS_REG_F21 , <nl> - MIPS_REG_F22 , <nl> - MIPS_REG_F23 , <nl> - MIPS_REG_F24 , <nl> - MIPS_REG_F25 , <nl> - MIPS_REG_F26 , <nl> - MIPS_REG_F27 , <nl> - MIPS_REG_F28 , <nl> - MIPS_REG_F29 , <nl> - MIPS_REG_F30 , <nl> - MIPS_REG_F31 , <nl> - <nl> - MIPS_REG_FCC0 , <nl> - MIPS_REG_FCC1 , <nl> - MIPS_REG_FCC2 , <nl> - MIPS_REG_FCC3 , <nl> - MIPS_REG_FCC4 , <nl> - MIPS_REG_FCC5 , <nl> - MIPS_REG_FCC6 , <nl> - MIPS_REG_FCC7 , <nl> - <nl> - / / > AFPR128 <nl> - MIPS_REG_W0 , <nl> - MIPS_REG_W1 , <nl> - MIPS_REG_W2 , <nl> - MIPS_REG_W3 , <nl> - MIPS_REG_W4 , <nl> - MIPS_REG_W5 , <nl> - MIPS_REG_W6 , <nl> - MIPS_REG_W7 , <nl> - MIPS_REG_W8 , <nl> - MIPS_REG_W9 , <nl> - MIPS_REG_W10 , <nl> - MIPS_REG_W11 , <nl> - MIPS_REG_W12 , <nl> - MIPS_REG_W13 , <nl> - MIPS_REG_W14 , <nl> - MIPS_REG_W15 , <nl> - MIPS_REG_W16 , <nl> - MIPS_REG_W17 , <nl> - MIPS_REG_W18 , <nl> - MIPS_REG_W19 , <nl> - MIPS_REG_W20 , <nl> - MIPS_REG_W21 , <nl> - MIPS_REG_W22 , <nl> - MIPS_REG_W23 , <nl> - MIPS_REG_W24 , <nl> - MIPS_REG_W25 , <nl> - MIPS_REG_W26 , <nl> - MIPS_REG_W27 , <nl> - MIPS_REG_W28 , <nl> - MIPS_REG_W29 , <nl> - MIPS_REG_W30 , <nl> - MIPS_REG_W31 , <nl> - <nl> - MIPS_REG_HI , <nl> - MIPS_REG_LO , <nl> - <nl> - MIPS_REG_P0 , <nl> - MIPS_REG_P1 , <nl> - MIPS_REG_P2 , <nl> - <nl> - MIPS_REG_MPL0 , <nl> - MIPS_REG_MPL1 , <nl> - MIPS_REG_MPL2 , <nl> - <nl> - MIPS_REG_ENDING , / / < - - mark the end of the list or registers <nl> - <nl> - / / alias registers <nl> - MIPS_REG_ZERO = MIPS_REG_0 , <nl> - MIPS_REG_AT = MIPS_REG_1 , <nl> - MIPS_REG_V0 = MIPS_REG_2 , <nl> - MIPS_REG_V1 = MIPS_REG_3 , <nl> - MIPS_REG_A0 = MIPS_REG_4 , <nl> - MIPS_REG_A1 = MIPS_REG_5 , <nl> - MIPS_REG_A2 = MIPS_REG_6 , <nl> - MIPS_REG_A3 = MIPS_REG_7 , <nl> - MIPS_REG_T0 = MIPS_REG_8 , <nl> - MIPS_REG_T1 = MIPS_REG_9 , <nl> - MIPS_REG_T2 = MIPS_REG_10 , <nl> - MIPS_REG_T3 = MIPS_REG_11 , <nl> - MIPS_REG_T4 = MIPS_REG_12 , <nl> - MIPS_REG_T5 = MIPS_REG_13 , <nl> - MIPS_REG_T6 = MIPS_REG_14 , <nl> - MIPS_REG_T7 = MIPS_REG_15 , <nl> - MIPS_REG_S0 = MIPS_REG_16 , <nl> - MIPS_REG_S1 = MIPS_REG_17 , <nl> - MIPS_REG_S2 = MIPS_REG_18 , <nl> - MIPS_REG_S3 = MIPS_REG_19 , <nl> - MIPS_REG_S4 = MIPS_REG_20 , <nl> - MIPS_REG_S5 = MIPS_REG_21 , <nl> - MIPS_REG_S6 = MIPS_REG_22 , <nl> - MIPS_REG_S7 = MIPS_REG_23 , <nl> - MIPS_REG_T8 = MIPS_REG_24 , <nl> - MIPS_REG_T9 = MIPS_REG_25 , <nl> - MIPS_REG_K0 = MIPS_REG_26 , <nl> - MIPS_REG_K1 = MIPS_REG_27 , <nl> - MIPS_REG_GP = MIPS_REG_28 , <nl> - MIPS_REG_SP = MIPS_REG_29 , <nl> - MIPS_REG_FP = MIPS_REG_30 , MIPS_REG_S8 = MIPS_REG_30 , <nl> - MIPS_REG_RA = MIPS_REG_31 , <nl> - <nl> - MIPS_REG_HI0 = MIPS_REG_AC0 , <nl> - MIPS_REG_HI1 = MIPS_REG_AC1 , <nl> - MIPS_REG_HI2 = MIPS_REG_AC2 , <nl> - MIPS_REG_HI3 = MIPS_REG_AC3 , <nl> - <nl> - MIPS_REG_LO0 = MIPS_REG_HI0 , <nl> - MIPS_REG_LO1 = MIPS_REG_HI1 , <nl> - MIPS_REG_LO2 = MIPS_REG_HI2 , <nl> - MIPS_REG_LO3 = MIPS_REG_HI3 , <nl> - } mips_reg ; <nl> - <nl> - / / > MIPS instruction <nl> - typedef enum mips_insn <nl> - { <nl> - MIPS_INS_INVALID = 0 , <nl> - <nl> - MIPS_INS_ABSQ_S , <nl> - MIPS_INS_ADD , <nl> - MIPS_INS_ADDIUPC , <nl> - MIPS_INS_ADDQH , <nl> - MIPS_INS_ADDQH_R , <nl> - MIPS_INS_ADDQ , <nl> - MIPS_INS_ADDQ_S , <nl> - MIPS_INS_ADDSC , <nl> - MIPS_INS_ADDS_A , <nl> - MIPS_INS_ADDS_S , <nl> - MIPS_INS_ADDS_U , <nl> - MIPS_INS_ADDUH , <nl> - MIPS_INS_ADDUH_R , <nl> - MIPS_INS_ADDU , <nl> - MIPS_INS_ADDU_S , <nl> - MIPS_INS_ADDVI , <nl> - MIPS_INS_ADDV , <nl> - MIPS_INS_ADDWC , <nl> - MIPS_INS_ADD_A , <nl> - MIPS_INS_ADDI , <nl> - MIPS_INS_ADDIU , <nl> - MIPS_INS_ALIGN , <nl> - MIPS_INS_ALUIPC , <nl> - MIPS_INS_AND , <nl> - MIPS_INS_ANDI , <nl> - MIPS_INS_APPEND , <nl> - MIPS_INS_ASUB_S , <nl> - MIPS_INS_ASUB_U , <nl> - MIPS_INS_AUI , <nl> - MIPS_INS_AUIPC , <nl> - MIPS_INS_AVER_S , <nl> - MIPS_INS_AVER_U , <nl> - MIPS_INS_AVE_S , <nl> - MIPS_INS_AVE_U , <nl> - MIPS_INS_BADDU , <nl> - MIPS_INS_BAL , <nl> - MIPS_INS_BALC , <nl> - MIPS_INS_BALIGN , <nl> - MIPS_INS_BC , <nl> - MIPS_INS_BC0F , <nl> - MIPS_INS_BC0FL , <nl> - MIPS_INS_BC0T , <nl> - MIPS_INS_BC0TL , <nl> - MIPS_INS_BC1EQZ , <nl> - MIPS_INS_BC1F , <nl> - MIPS_INS_BC1FL , <nl> - MIPS_INS_BC1NEZ , <nl> - MIPS_INS_BC1T , <nl> - MIPS_INS_BC1TL , <nl> - MIPS_INS_BC2EQZ , <nl> - MIPS_INS_BC2F , <nl> - MIPS_INS_BC2FL , <nl> - MIPS_INS_BC2NEZ , <nl> - MIPS_INS_BC2T , <nl> - MIPS_INS_BC2TL , <nl> - MIPS_INS_BC3F , <nl> - MIPS_INS_BC3FL , <nl> - MIPS_INS_BC3T , <nl> - MIPS_INS_BC3TL , <nl> - MIPS_INS_BCLRI , <nl> - MIPS_INS_BCLR , <nl> - MIPS_INS_BEQ , <nl> - MIPS_INS_BEQC , <nl> - MIPS_INS_BEQL , <nl> - MIPS_INS_BEQZALC , <nl> - MIPS_INS_BEQZC , <nl> - MIPS_INS_BGEC , <nl> - MIPS_INS_BGEUC , <nl> - MIPS_INS_BGEZ , <nl> - MIPS_INS_BGEZAL , <nl> - MIPS_INS_BGEZALC , <nl> - MIPS_INS_BGEZALL , <nl> - MIPS_INS_BGEZALS , <nl> - MIPS_INS_BGEZC , <nl> - MIPS_INS_BGEZL , <nl> - MIPS_INS_BGTZ , <nl> - MIPS_INS_BGTZALC , <nl> - MIPS_INS_BGTZC , <nl> - MIPS_INS_BGTZL , <nl> - MIPS_INS_BINSLI , <nl> - MIPS_INS_BINSL , <nl> - MIPS_INS_BINSRI , <nl> - MIPS_INS_BINSR , <nl> - MIPS_INS_BITREV , <nl> - MIPS_INS_BITSWAP , <nl> - MIPS_INS_BLEZ , <nl> - MIPS_INS_BLEZALC , <nl> - MIPS_INS_BLEZC , <nl> - MIPS_INS_BLEZL , <nl> - MIPS_INS_BLTC , <nl> - MIPS_INS_BLTUC , <nl> - MIPS_INS_BLTZ , <nl> - MIPS_INS_BLTZAL , <nl> - MIPS_INS_BLTZALC , <nl> - MIPS_INS_BLTZALL , <nl> - MIPS_INS_BLTZALS , <nl> - MIPS_INS_BLTZC , <nl> - MIPS_INS_BLTZL , <nl> - MIPS_INS_BMNZI , <nl> - MIPS_INS_BMNZ , <nl> - MIPS_INS_BMZI , <nl> - MIPS_INS_BMZ , <nl> - MIPS_INS_BNE , <nl> - MIPS_INS_BNEC , <nl> - MIPS_INS_BNEGI , <nl> - MIPS_INS_BNEG , <nl> - MIPS_INS_BNEL , <nl> - MIPS_INS_BNEZALC , <nl> - MIPS_INS_BNEZC , <nl> - MIPS_INS_BNVC , <nl> - MIPS_INS_BNZ , <nl> - MIPS_INS_BOVC , <nl> - MIPS_INS_BPOSGE32 , <nl> - MIPS_INS_BREAK , <nl> - MIPS_INS_BSELI , <nl> - MIPS_INS_BSEL , <nl> - MIPS_INS_BSETI , <nl> - MIPS_INS_BSET , <nl> - MIPS_INS_BZ , <nl> - MIPS_INS_BEQZ , <nl> - MIPS_INS_B , <nl> - MIPS_INS_BNEZ , <nl> - MIPS_INS_BTEQZ , <nl> - MIPS_INS_BTNEZ , <nl> - MIPS_INS_CACHE , <nl> - MIPS_INS_CEIL , <nl> - MIPS_INS_CEQI , <nl> - MIPS_INS_CEQ , <nl> - MIPS_INS_CFC1 , <nl> - MIPS_INS_CFCMSA , <nl> - MIPS_INS_CINS , <nl> - MIPS_INS_CINS32 , <nl> - MIPS_INS_CLASS , <nl> - MIPS_INS_CLEI_S , <nl> - MIPS_INS_CLEI_U , <nl> - MIPS_INS_CLE_S , <nl> - MIPS_INS_CLE_U , <nl> - MIPS_INS_CLO , <nl> - MIPS_INS_CLTI_S , <nl> - MIPS_INS_CLTI_U , <nl> - MIPS_INS_CLT_S , <nl> - MIPS_INS_CLT_U , <nl> - MIPS_INS_CLZ , <nl> - MIPS_INS_CMPGDU , <nl> - MIPS_INS_CMPGU , <nl> - MIPS_INS_CMPU , <nl> - MIPS_INS_CMP , <nl> - MIPS_INS_COPY_S , <nl> - MIPS_INS_COPY_U , <nl> - MIPS_INS_CTC1 , <nl> - MIPS_INS_CTCMSA , <nl> - MIPS_INS_CVT , <nl> - MIPS_INS_C , <nl> - MIPS_INS_CMPI , <nl> - MIPS_INS_DADD , <nl> - MIPS_INS_DADDI , <nl> - MIPS_INS_DADDIU , <nl> - MIPS_INS_DADDU , <nl> - MIPS_INS_DAHI , <nl> - MIPS_INS_DALIGN , <nl> - MIPS_INS_DATI , <nl> - MIPS_INS_DAUI , <nl> - MIPS_INS_DBITSWAP , <nl> - MIPS_INS_DCLO , <nl> - MIPS_INS_DCLZ , <nl> - MIPS_INS_DDIV , <nl> - MIPS_INS_DDIVU , <nl> - MIPS_INS_DERET , <nl> - MIPS_INS_DEXT , <nl> - MIPS_INS_DEXTM , <nl> - MIPS_INS_DEXTU , <nl> - MIPS_INS_DI , <nl> - MIPS_INS_DINS , <nl> - MIPS_INS_DINSM , <nl> - MIPS_INS_DINSU , <nl> - MIPS_INS_DIV , <nl> - MIPS_INS_DIVU , <nl> - MIPS_INS_DIV_S , <nl> - MIPS_INS_DIV_U , <nl> - MIPS_INS_DLSA , <nl> - MIPS_INS_DMFC0 , <nl> - MIPS_INS_DMFC1 , <nl> - MIPS_INS_DMFC2 , <nl> - MIPS_INS_DMOD , <nl> - MIPS_INS_DMODU , <nl> - MIPS_INS_DMTC0 , <nl> - MIPS_INS_DMTC1 , <nl> - MIPS_INS_DMTC2 , <nl> - MIPS_INS_DMUH , <nl> - MIPS_INS_DMUHU , <nl> - MIPS_INS_DMUL , <nl> - MIPS_INS_DMULT , <nl> - MIPS_INS_DMULTU , <nl> - MIPS_INS_DMULU , <nl> - MIPS_INS_DOTP_S , <nl> - MIPS_INS_DOTP_U , <nl> - MIPS_INS_DPADD_S , <nl> - MIPS_INS_DPADD_U , <nl> - MIPS_INS_DPAQX_SA , <nl> - MIPS_INS_DPAQX_S , <nl> - MIPS_INS_DPAQ_SA , <nl> - MIPS_INS_DPAQ_S , <nl> - MIPS_INS_DPAU , <nl> - MIPS_INS_DPAX , <nl> - MIPS_INS_DPA , <nl> - MIPS_INS_DPOP , <nl> - MIPS_INS_DPSQX_SA , <nl> - MIPS_INS_DPSQX_S , <nl> - MIPS_INS_DPSQ_SA , <nl> - MIPS_INS_DPSQ_S , <nl> - MIPS_INS_DPSUB_S , <nl> - MIPS_INS_DPSUB_U , <nl> - MIPS_INS_DPSU , <nl> - MIPS_INS_DPSX , <nl> - MIPS_INS_DPS , <nl> - MIPS_INS_DROTR , <nl> - MIPS_INS_DROTR32 , <nl> - MIPS_INS_DROTRV , <nl> - MIPS_INS_DSBH , <nl> - MIPS_INS_DSHD , <nl> - MIPS_INS_DSLL , <nl> - MIPS_INS_DSLL32 , <nl> - MIPS_INS_DSLLV , <nl> - MIPS_INS_DSRA , <nl> - MIPS_INS_DSRA32 , <nl> - MIPS_INS_DSRAV , <nl> - MIPS_INS_DSRL , <nl> - MIPS_INS_DSRL32 , <nl> - MIPS_INS_DSRLV , <nl> - MIPS_INS_DSUB , <nl> - MIPS_INS_DSUBU , <nl> - MIPS_INS_EHB , <nl> - MIPS_INS_EI , <nl> - MIPS_INS_ERET , <nl> - MIPS_INS_EXT , <nl> - MIPS_INS_EXTP , <nl> - MIPS_INS_EXTPDP , <nl> - MIPS_INS_EXTPDPV , <nl> - MIPS_INS_EXTPV , <nl> - MIPS_INS_EXTRV_RS , <nl> - MIPS_INS_EXTRV_R , <nl> - MIPS_INS_EXTRV_S , <nl> - MIPS_INS_EXTRV , <nl> - MIPS_INS_EXTR_RS , <nl> - MIPS_INS_EXTR_R , <nl> - MIPS_INS_EXTR_S , <nl> - MIPS_INS_EXTR , <nl> - MIPS_INS_EXTS , <nl> - MIPS_INS_EXTS32 , <nl> - MIPS_INS_ABS , <nl> - MIPS_INS_FADD , <nl> - MIPS_INS_FCAF , <nl> - MIPS_INS_FCEQ , <nl> - MIPS_INS_FCLASS , <nl> - MIPS_INS_FCLE , <nl> - MIPS_INS_FCLT , <nl> - MIPS_INS_FCNE , <nl> - MIPS_INS_FCOR , <nl> - MIPS_INS_FCUEQ , <nl> - MIPS_INS_FCULE , <nl> - MIPS_INS_FCULT , <nl> - MIPS_INS_FCUNE , <nl> - MIPS_INS_FCUN , <nl> - MIPS_INS_FDIV , <nl> - MIPS_INS_FEXDO , <nl> - MIPS_INS_FEXP2 , <nl> - MIPS_INS_FEXUPL , <nl> - MIPS_INS_FEXUPR , <nl> - MIPS_INS_FFINT_S , <nl> - MIPS_INS_FFINT_U , <nl> - MIPS_INS_FFQL , <nl> - MIPS_INS_FFQR , <nl> - MIPS_INS_FILL , <nl> - MIPS_INS_FLOG2 , <nl> - MIPS_INS_FLOOR , <nl> - MIPS_INS_FMADD , <nl> - MIPS_INS_FMAX_A , <nl> - MIPS_INS_FMAX , <nl> - MIPS_INS_FMIN_A , <nl> - MIPS_INS_FMIN , <nl> - MIPS_INS_MOV , <nl> - MIPS_INS_FMSUB , <nl> - MIPS_INS_FMUL , <nl> - MIPS_INS_MUL , <nl> - MIPS_INS_NEG , <nl> - MIPS_INS_FRCP , <nl> - MIPS_INS_FRINT , <nl> - MIPS_INS_FRSQRT , <nl> - MIPS_INS_FSAF , <nl> - MIPS_INS_FSEQ , <nl> - MIPS_INS_FSLE , <nl> - MIPS_INS_FSLT , <nl> - MIPS_INS_FSNE , <nl> - MIPS_INS_FSOR , <nl> - MIPS_INS_FSQRT , <nl> - MIPS_INS_SQRT , <nl> - MIPS_INS_FSUB , <nl> - MIPS_INS_SUB , <nl> - MIPS_INS_FSUEQ , <nl> - MIPS_INS_FSULE , <nl> - MIPS_INS_FSULT , <nl> - MIPS_INS_FSUNE , <nl> - MIPS_INS_FSUN , <nl> - MIPS_INS_FTINT_S , <nl> - MIPS_INS_FTINT_U , <nl> - MIPS_INS_FTQ , <nl> - MIPS_INS_FTRUNC_S , <nl> - MIPS_INS_FTRUNC_U , <nl> - MIPS_INS_HADD_S , <nl> - MIPS_INS_HADD_U , <nl> - MIPS_INS_HSUB_S , <nl> - MIPS_INS_HSUB_U , <nl> - MIPS_INS_ILVEV , <nl> - MIPS_INS_ILVL , <nl> - MIPS_INS_ILVOD , <nl> - MIPS_INS_ILVR , <nl> - MIPS_INS_INS , <nl> - MIPS_INS_INSERT , <nl> - MIPS_INS_INSV , <nl> - MIPS_INS_INSVE , <nl> - MIPS_INS_J , <nl> - MIPS_INS_JAL , <nl> - MIPS_INS_JALR , <nl> - MIPS_INS_JALRS , <nl> - MIPS_INS_JALS , <nl> - MIPS_INS_JALX , <nl> - MIPS_INS_JIALC , <nl> - MIPS_INS_JIC , <nl> - MIPS_INS_JR , <nl> - MIPS_INS_JRADDIUSP , <nl> - MIPS_INS_JRC , <nl> - MIPS_INS_JALRC , <nl> - MIPS_INS_LB , <nl> - MIPS_INS_LBUX , <nl> - MIPS_INS_LBU , <nl> - MIPS_INS_LD , <nl> - MIPS_INS_LDC1 , <nl> - MIPS_INS_LDC2 , <nl> - MIPS_INS_LDC3 , <nl> - MIPS_INS_LDI , <nl> - MIPS_INS_LDL , <nl> - MIPS_INS_LDPC , <nl> - MIPS_INS_LDR , <nl> - MIPS_INS_LDXC1 , <nl> - MIPS_INS_LH , <nl> - MIPS_INS_LHX , <nl> - MIPS_INS_LHU , <nl> - MIPS_INS_LL , <nl> - MIPS_INS_LLD , <nl> - MIPS_INS_LSA , <nl> - MIPS_INS_LUXC1 , <nl> - MIPS_INS_LUI , <nl> - MIPS_INS_LW , <nl> - MIPS_INS_LWC1 , <nl> - MIPS_INS_LWC2 , <nl> - MIPS_INS_LWC3 , <nl> - MIPS_INS_LWL , <nl> - MIPS_INS_LWPC , <nl> - MIPS_INS_LWR , <nl> - MIPS_INS_LWUPC , <nl> - MIPS_INS_LWU , <nl> - MIPS_INS_LWX , <nl> - MIPS_INS_LWXC1 , <nl> - MIPS_INS_LI , <nl> - MIPS_INS_MADD , <nl> - MIPS_INS_MADDF , <nl> - MIPS_INS_MADDR_Q , <nl> - MIPS_INS_MADDU , <nl> - MIPS_INS_MADDV , <nl> - MIPS_INS_MADD_Q , <nl> - MIPS_INS_MAQ_SA , <nl> - MIPS_INS_MAQ_S , <nl> - MIPS_INS_MAXA , <nl> - MIPS_INS_MAXI_S , <nl> - MIPS_INS_MAXI_U , <nl> - MIPS_INS_MAX_A , <nl> - MIPS_INS_MAX , <nl> - MIPS_INS_MAX_S , <nl> - MIPS_INS_MAX_U , <nl> - MIPS_INS_MFC0 , <nl> - MIPS_INS_MFC1 , <nl> - MIPS_INS_MFC2 , <nl> - MIPS_INS_MFHC1 , <nl> - MIPS_INS_MFHI , <nl> - MIPS_INS_MFLO , <nl> - MIPS_INS_MINA , <nl> - MIPS_INS_MINI_S , <nl> - MIPS_INS_MINI_U , <nl> - MIPS_INS_MIN_A , <nl> - MIPS_INS_MIN , <nl> - MIPS_INS_MIN_S , <nl> - MIPS_INS_MIN_U , <nl> - MIPS_INS_MOD , <nl> - MIPS_INS_MODSUB , <nl> - MIPS_INS_MODU , <nl> - MIPS_INS_MOD_S , <nl> - MIPS_INS_MOD_U , <nl> - MIPS_INS_MOVE , <nl> - MIPS_INS_MOVF , <nl> - MIPS_INS_MOVN , <nl> - MIPS_INS_MOVT , <nl> - MIPS_INS_MOVZ , <nl> - MIPS_INS_MSUB , <nl> - MIPS_INS_MSUBF , <nl> - MIPS_INS_MSUBR_Q , <nl> - MIPS_INS_MSUBU , <nl> - MIPS_INS_MSUBV , <nl> - MIPS_INS_MSUB_Q , <nl> - MIPS_INS_MTC0 , <nl> - MIPS_INS_MTC1 , <nl> - MIPS_INS_MTC2 , <nl> - MIPS_INS_MTHC1 , <nl> - MIPS_INS_MTHI , <nl> - MIPS_INS_MTHLIP , <nl> - MIPS_INS_MTLO , <nl> - MIPS_INS_MTM0 , <nl> - MIPS_INS_MTM1 , <nl> - MIPS_INS_MTM2 , <nl> - MIPS_INS_MTP0 , <nl> - MIPS_INS_MTP1 , <nl> - MIPS_INS_MTP2 , <nl> - MIPS_INS_MUH , <nl> - MIPS_INS_MUHU , <nl> - MIPS_INS_MULEQ_S , <nl> - MIPS_INS_MULEU_S , <nl> - MIPS_INS_MULQ_RS , <nl> - MIPS_INS_MULQ_S , <nl> - MIPS_INS_MULR_Q , <nl> - MIPS_INS_MULSAQ_S , <nl> - MIPS_INS_MULSA , <nl> - MIPS_INS_MULT , <nl> - MIPS_INS_MULTU , <nl> - MIPS_INS_MULU , <nl> - MIPS_INS_MULV , <nl> - MIPS_INS_MUL_Q , <nl> - MIPS_INS_MUL_S , <nl> - MIPS_INS_NLOC , <nl> - MIPS_INS_NLZC , <nl> - MIPS_INS_NMADD , <nl> - MIPS_INS_NMSUB , <nl> - MIPS_INS_NOR , <nl> - MIPS_INS_NORI , <nl> - MIPS_INS_NOT , <nl> - MIPS_INS_OR , <nl> - MIPS_INS_ORI , <nl> - MIPS_INS_PACKRL , <nl> - MIPS_INS_PAUSE , <nl> - MIPS_INS_PCKEV , <nl> - MIPS_INS_PCKOD , <nl> - MIPS_INS_PCNT , <nl> - MIPS_INS_PICK , <nl> - MIPS_INS_POP , <nl> - MIPS_INS_PRECEQU , <nl> - MIPS_INS_PRECEQ , <nl> - MIPS_INS_PRECEU , <nl> - MIPS_INS_PRECRQU_S , <nl> - MIPS_INS_PRECRQ , <nl> - MIPS_INS_PRECRQ_RS , <nl> - MIPS_INS_PRECR , <nl> - MIPS_INS_PRECR_SRA , <nl> - MIPS_INS_PRECR_SRA_R , <nl> - MIPS_INS_PREF , <nl> - MIPS_INS_PREPEND , <nl> - MIPS_INS_RADDU , <nl> - MIPS_INS_RDDSP , <nl> - MIPS_INS_RDHWR , <nl> - MIPS_INS_REPLV , <nl> - MIPS_INS_REPL , <nl> - MIPS_INS_RINT , <nl> - MIPS_INS_ROTR , <nl> - MIPS_INS_ROTRV , <nl> - MIPS_INS_ROUND , <nl> - MIPS_INS_SAT_S , <nl> - MIPS_INS_SAT_U , <nl> - MIPS_INS_SB , <nl> - MIPS_INS_SC , <nl> - MIPS_INS_SCD , <nl> - MIPS_INS_SD , <nl> - MIPS_INS_SDBBP , <nl> - MIPS_INS_SDC1 , <nl> - MIPS_INS_SDC2 , <nl> - MIPS_INS_SDC3 , <nl> - MIPS_INS_SDL , <nl> - MIPS_INS_SDR , <nl> - MIPS_INS_SDXC1 , <nl> - MIPS_INS_SEB , <nl> - MIPS_INS_SEH , <nl> - MIPS_INS_SELEQZ , <nl> - MIPS_INS_SELNEZ , <nl> - MIPS_INS_SEL , <nl> - MIPS_INS_SEQ , <nl> - MIPS_INS_SEQI , <nl> - MIPS_INS_SH , <nl> - MIPS_INS_SHF , <nl> - MIPS_INS_SHILO , <nl> - MIPS_INS_SHILOV , <nl> - MIPS_INS_SHLLV , <nl> - MIPS_INS_SHLLV_S , <nl> - MIPS_INS_SHLL , <nl> - MIPS_INS_SHLL_S , <nl> - MIPS_INS_SHRAV , <nl> - MIPS_INS_SHRAV_R , <nl> - MIPS_INS_SHRA , <nl> - MIPS_INS_SHRA_R , <nl> - MIPS_INS_SHRLV , <nl> - MIPS_INS_SHRL , <nl> - MIPS_INS_SLDI , <nl> - MIPS_INS_SLD , <nl> - MIPS_INS_SLL , <nl> - MIPS_INS_SLLI , <nl> - MIPS_INS_SLLV , <nl> - MIPS_INS_SLT , <nl> - MIPS_INS_SLTI , <nl> - MIPS_INS_SLTIU , <nl> - MIPS_INS_SLTU , <nl> - MIPS_INS_SNE , <nl> - MIPS_INS_SNEI , <nl> - MIPS_INS_SPLATI , <nl> - MIPS_INS_SPLAT , <nl> - MIPS_INS_SRA , <nl> - MIPS_INS_SRAI , <nl> - MIPS_INS_SRARI , <nl> - MIPS_INS_SRAR , <nl> - MIPS_INS_SRAV , <nl> - MIPS_INS_SRL , <nl> - MIPS_INS_SRLI , <nl> - MIPS_INS_SRLRI , <nl> - MIPS_INS_SRLR , <nl> - MIPS_INS_SRLV , <nl> - MIPS_INS_SSNOP , <nl> - MIPS_INS_ST , <nl> - MIPS_INS_SUBQH , <nl> - MIPS_INS_SUBQH_R , <nl> - MIPS_INS_SUBQ , <nl> - MIPS_INS_SUBQ_S , <nl> - MIPS_INS_SUBSUS_U , <nl> - MIPS_INS_SUBSUU_S , <nl> - MIPS_INS_SUBS_S , <nl> - MIPS_INS_SUBS_U , <nl> - MIPS_INS_SUBUH , <nl> - MIPS_INS_SUBUH_R , <nl> - MIPS_INS_SUBU , <nl> - MIPS_INS_SUBU_S , <nl> - MIPS_INS_SUBVI , <nl> - MIPS_INS_SUBV , <nl> - MIPS_INS_SUXC1 , <nl> - MIPS_INS_SW , <nl> - MIPS_INS_SWC1 , <nl> - MIPS_INS_SWC2 , <nl> - MIPS_INS_SWC3 , <nl> - MIPS_INS_SWL , <nl> - MIPS_INS_SWR , <nl> - MIPS_INS_SWXC1 , <nl> - MIPS_INS_SYNC , <nl> - MIPS_INS_SYSCALL , <nl> - MIPS_INS_TEQ , <nl> - MIPS_INS_TEQI , <nl> - MIPS_INS_TGE , <nl> - MIPS_INS_TGEI , <nl> - MIPS_INS_TGEIU , <nl> - MIPS_INS_TGEU , <nl> - MIPS_INS_TLBP , <nl> - MIPS_INS_TLBR , <nl> - MIPS_INS_TLBWI , <nl> - MIPS_INS_TLBWR , <nl> - MIPS_INS_TLT , <nl> - MIPS_INS_TLTI , <nl> - MIPS_INS_TLTIU , <nl> - MIPS_INS_TLTU , <nl> - MIPS_INS_TNE , <nl> - MIPS_INS_TNEI , <nl> - MIPS_INS_TRUNC , <nl> - MIPS_INS_V3MULU , <nl> - MIPS_INS_VMM0 , <nl> - MIPS_INS_VMULU , <nl> - MIPS_INS_VSHF , <nl> - MIPS_INS_WAIT , <nl> - MIPS_INS_WRDSP , <nl> - MIPS_INS_WSBH , <nl> - MIPS_INS_XOR , <nl> - MIPS_INS_XORI , <nl> - <nl> - / / > some alias instructions <nl> - MIPS_INS_NOP , <nl> - MIPS_INS_NEGU , <nl> - <nl> - / / > special instructions <nl> - MIPS_INS_JALR_HB , / / jump and link with Hazard Barrier <nl> - MIPS_INS_JR_HB , / / jump register with Hazard Barrier <nl> - <nl> - MIPS_INS_ENDING , <nl> - } mips_insn ; <nl> - <nl> - / / > Group of MIPS instructions <nl> - typedef enum mips_insn_group <nl> - { <nl> - MIPS_GRP_INVALID = 0 , / / = CS_GRP_INVALID <nl> - <nl> - / / > Generic groups <nl> - / / all jump instructions ( conditional + direct + indirect jumps ) <nl> - MIPS_GRP_JUMP , / / = CS_GRP_JUMP <nl> - <nl> - / / > Architecture - specific groups <nl> - MIPS_GRP_BITCOUNT = 128 , <nl> - MIPS_GRP_DSP , <nl> - MIPS_GRP_DSPR2 , <nl> - MIPS_GRP_FPIDX , <nl> - MIPS_GRP_MSA , <nl> - MIPS_GRP_MIPS32R2 , <nl> - MIPS_GRP_MIPS64 , <nl> - MIPS_GRP_MIPS64R2 , <nl> - MIPS_GRP_SEINREG , <nl> - MIPS_GRP_STDENC , <nl> - MIPS_GRP_SWAP , <nl> - MIPS_GRP_MICROMIPS , <nl> - MIPS_GRP_MIPS16MODE , <nl> - MIPS_GRP_FP64BIT , <nl> - MIPS_GRP_NONANSFPMATH , <nl> - MIPS_GRP_NOTFP64BIT , <nl> - MIPS_GRP_NOTINMICROMIPS , <nl> - MIPS_GRP_NOTNACL , <nl> - MIPS_GRP_NOTMIPS32R6 , <nl> - MIPS_GRP_NOTMIPS64R6 , <nl> - MIPS_GRP_CNMIPS , <nl> - MIPS_GRP_MIPS32 , <nl> - MIPS_GRP_MIPS32R6 , <nl> - MIPS_GRP_MIPS64R6 , <nl> - MIPS_GRP_MIPS2 , <nl> - MIPS_GRP_MIPS3 , <nl> - MIPS_GRP_MIPS3_32 , <nl> - MIPS_GRP_MIPS3_32R2 , <nl> - MIPS_GRP_MIPS4_32 , <nl> - MIPS_GRP_MIPS4_32R2 , <nl> - MIPS_GRP_MIPS5_32R2 , <nl> - MIPS_GRP_GP32BIT , <nl> - MIPS_GRP_GP64BIT , <nl> - <nl> - MIPS_GRP_ENDING , <nl> - } mips_insn_group ; <nl> - <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> - <nl> - # endif <nl> deleted file mode 100644 <nl> index 92a7dacee . . 000000000 <nl> mmm a / src / dbg / capstone / platform . h <nl> ppp / dev / null <nl> <nl> - / * Capstone Disassembly Engine * / <nl> - / * By Axel Souchet & Nguyen Anh Quynh , 2014 * / <nl> - <nl> - / / handle C99 issue ( for pre - 2013 VisualStudio ) <nl> - # ifndef CAPSTONE_PLATFORM_H <nl> - # define CAPSTONE_PLATFORM_H <nl> - <nl> - # if ! defined ( __MINGW32__ ) & & ! defined ( __MINGW64__ ) & & ( defined ( WIN32 ) | | defined ( WIN64 ) | | defined ( _WIN32 ) | | defined ( _WIN64 ) ) <nl> - / / MSVC <nl> - <nl> - / / stdbool . h <nl> - # if ( _MSC_VER < 1800 ) <nl> - # ifndef __cplusplus <nl> - typedef unsigned char bool ; <nl> - # define false 0 <nl> - # define true 1 <nl> - # endif <nl> - <nl> - # else <nl> - / / VisualStudio 2013 + - > C99 is supported <nl> - # include < stdbool . h > <nl> - # endif <nl> - <nl> - # else / / not MSVC - > C99 is supported <nl> - # include < stdbool . h > <nl> - # endif <nl> - <nl> - # endif <nl> deleted file mode 100644 <nl> index 1c3e54c54 . . 000000000 <nl> mmm a / src / dbg / capstone / ppc . h <nl> ppp / dev / null <nl> <nl> - # ifndef CAPSTONE_PPC_H <nl> - # define CAPSTONE_PPC_H <nl> - <nl> - / * Capstone Disassembly Engine * / <nl> - / * By Nguyen Anh Quynh < aquynh @ gmail . com > , 2013 - 2014 * / <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - <nl> - # include < stdint . h > <nl> - # include " platform . h " <nl> - <nl> - # ifdef _MSC_VER <nl> - # pragma warning ( disable : 4201 ) <nl> - # endif <nl> - <nl> - / / > PPC branch codes for some branch instructions <nl> - typedef enum ppc_bc <nl> - { <nl> - PPC_BC_INVALID = 0 , <nl> - PPC_BC_LT = ( 0 < < 5 ) | 12 , <nl> - PPC_BC_LE = ( 1 < < 5 ) | 4 , <nl> - PPC_BC_EQ = ( 2 < < 5 ) | 12 , <nl> - PPC_BC_GE = ( 0 < < 5 ) | 4 , <nl> - PPC_BC_GT = ( 1 < < 5 ) | 12 , <nl> - PPC_BC_NE = ( 2 < < 5 ) | 4 , <nl> - PPC_BC_UN = ( 3 < < 5 ) | 12 , <nl> - PPC_BC_NU = ( 3 < < 5 ) | 4 , <nl> - <nl> - / / extra conditions <nl> - PPC_BC_SO = ( 4 < < 5 ) | 12 , / / summary overflow <nl> - PPC_BC_NS = ( 4 < < 5 ) | 4 , / / not summary overflow <nl> - } ppc_bc ; <nl> - <nl> - / / > PPC branch hint for some branch instructions <nl> - typedef enum ppc_bh <nl> - { <nl> - PPC_BH_INVALID = 0 , / / no hint <nl> - PPC_BH_PLUS , / / PLUS hint <nl> - PPC_BH_MINUS , / / MINUS hint <nl> - } ppc_bh ; <nl> - <nl> - / / > Operand type for instruction ' s operands <nl> - typedef enum ppc_op_type <nl> - { <nl> - PPC_OP_INVALID = 0 , / / = CS_OP_INVALID ( Uninitialized ) . <nl> - PPC_OP_REG , / / = CS_OP_REG ( Register operand ) . <nl> - PPC_OP_IMM , / / = CS_OP_IMM ( Immediate operand ) . <nl> - PPC_OP_MEM , / / = CS_OP_MEM ( Memory operand ) . <nl> - PPC_OP_CRX = 64 , / / Condition Register field <nl> - } ppc_op_type ; <nl> - <nl> - / / Instruction ' s operand referring to memory <nl> - / / This is associated with PPC_OP_MEM operand type above <nl> - typedef struct ppc_op_mem <nl> - { <nl> - unsigned int base ; / / base register <nl> - int32_t disp ; / / displacement / offset value <nl> - } ppc_op_mem ; <nl> - <nl> - typedef struct ppc_op_crx <nl> - { <nl> - unsigned int scale ; <nl> - unsigned int reg ; <nl> - ppc_bc cond ; <nl> - } ppc_op_crx ; <nl> - <nl> - / / Instruction operand <nl> - typedef struct cs_ppc_op <nl> - { <nl> - ppc_op_type type ; / / operand type <nl> - union <nl> - { <nl> - unsigned int reg ; / / register value for REG operand <nl> - int32_t imm ; / / immediate value for IMM operand <nl> - ppc_op_mem mem ; / / base / disp value for MEM operand <nl> - ppc_op_crx crx ; / / operand with condition register <nl> - } ; <nl> - } cs_ppc_op ; <nl> - <nl> - / / Instruction structure <nl> - typedef struct cs_ppc <nl> - { <nl> - / / branch code for branch instructions <nl> - ppc_bc bc ; <nl> - <nl> - / / branch hint for branch instructions <nl> - ppc_bh bh ; <nl> - <nl> - / / if update_cr0 = True , then this ' dot ' insn updates CR0 <nl> - bool update_cr0 ; <nl> - <nl> - / / Number of operands of this instruction , <nl> - / / or 0 when instruction has no operand . <nl> - uint8_t op_count ; <nl> - cs_ppc_op operands [ 8 ] ; / / operands for this instruction . <nl> - } cs_ppc ; <nl> - <nl> - / / > PPC registers <nl> - typedef enum ppc_reg <nl> - { <nl> - PPC_REG_INVALID = 0 , <nl> - <nl> - PPC_REG_CARRY , <nl> - PPC_REG_CC , <nl> - PPC_REG_CR0 , <nl> - PPC_REG_CR1 , <nl> - PPC_REG_CR2 , <nl> - PPC_REG_CR3 , <nl> - PPC_REG_CR4 , <nl> - PPC_REG_CR5 , <nl> - PPC_REG_CR6 , <nl> - PPC_REG_CR7 , <nl> - PPC_REG_CTR , <nl> - PPC_REG_F0 , <nl> - PPC_REG_F1 , <nl> - PPC_REG_F2 , <nl> - PPC_REG_F3 , <nl> - PPC_REG_F4 , <nl> - PPC_REG_F5 , <nl> - PPC_REG_F6 , <nl> - PPC_REG_F7 , <nl> - PPC_REG_F8 , <nl> - PPC_REG_F9 , <nl> - PPC_REG_F10 , <nl> - PPC_REG_F11 , <nl> - PPC_REG_F12 , <nl> - PPC_REG_F13 , <nl> - PPC_REG_F14 , <nl> - PPC_REG_F15 , <nl> - PPC_REG_F16 , <nl> - PPC_REG_F17 , <nl> - PPC_REG_F18 , <nl> - PPC_REG_F19 , <nl> - PPC_REG_F20 , <nl> - PPC_REG_F21 , <nl> - PPC_REG_F22 , <nl> - PPC_REG_F23 , <nl> - PPC_REG_F24 , <nl> - PPC_REG_F25 , <nl> - PPC_REG_F26 , <nl> - PPC_REG_F27 , <nl> - PPC_REG_F28 , <nl> - PPC_REG_F29 , <nl> - PPC_REG_F30 , <nl> - PPC_REG_F31 , <nl> - PPC_REG_LR , <nl> - PPC_REG_R0 , <nl> - PPC_REG_R1 , <nl> - PPC_REG_R2 , <nl> - PPC_REG_R3 , <nl> - PPC_REG_R4 , <nl> - PPC_REG_R5 , <nl> - PPC_REG_R6 , <nl> - PPC_REG_R7 , <nl> - PPC_REG_R8 , <nl> - PPC_REG_R9 , <nl> - PPC_REG_R10 , <nl> - PPC_REG_R11 , <nl> - PPC_REG_R12 , <nl> - PPC_REG_R13 , <nl> - PPC_REG_R14 , <nl> - PPC_REG_R15 , <nl> - PPC_REG_R16 , <nl> - PPC_REG_R17 , <nl> - PPC_REG_R18 , <nl> - PPC_REG_R19 , <nl> - PPC_REG_R20 , <nl> - PPC_REG_R21 , <nl> - PPC_REG_R22 , <nl> - PPC_REG_R23 , <nl> - PPC_REG_R24 , <nl> - PPC_REG_R25 , <nl> - PPC_REG_R26 , <nl> - PPC_REG_R27 , <nl> - PPC_REG_R28 , <nl> - PPC_REG_R29 , <nl> - PPC_REG_R30 , <nl> - PPC_REG_R31 , <nl> - PPC_REG_V0 , <nl> - PPC_REG_V1 , <nl> - PPC_REG_V2 , <nl> - PPC_REG_V3 , <nl> - PPC_REG_V4 , <nl> - PPC_REG_V5 , <nl> - PPC_REG_V6 , <nl> - PPC_REG_V7 , <nl> - PPC_REG_V8 , <nl> - PPC_REG_V9 , <nl> - PPC_REG_V10 , <nl> - PPC_REG_V11 , <nl> - PPC_REG_V12 , <nl> - PPC_REG_V13 , <nl> - PPC_REG_V14 , <nl> - PPC_REG_V15 , <nl> - PPC_REG_V16 , <nl> - PPC_REG_V17 , <nl> - PPC_REG_V18 , <nl> - PPC_REG_V19 , <nl> - PPC_REG_V20 , <nl> - PPC_REG_V21 , <nl> - PPC_REG_V22 , <nl> - PPC_REG_V23 , <nl> - PPC_REG_V24 , <nl> - PPC_REG_V25 , <nl> - PPC_REG_V26 , <nl> - PPC_REG_V27 , <nl> - PPC_REG_V28 , <nl> - PPC_REG_V29 , <nl> - PPC_REG_V30 , <nl> - PPC_REG_V31 , <nl> - PPC_REG_VRSAVE , <nl> - PPC_REG_VS0 , <nl> - PPC_REG_VS1 , <nl> - PPC_REG_VS2 , <nl> - PPC_REG_VS3 , <nl> - PPC_REG_VS4 , <nl> - PPC_REG_VS5 , <nl> - PPC_REG_VS6 , <nl> - PPC_REG_VS7 , <nl> - PPC_REG_VS8 , <nl> - PPC_REG_VS9 , <nl> - PPC_REG_VS10 , <nl> - PPC_REG_VS11 , <nl> - PPC_REG_VS12 , <nl> - PPC_REG_VS13 , <nl> - PPC_REG_VS14 , <nl> - PPC_REG_VS15 , <nl> - PPC_REG_VS16 , <nl> - PPC_REG_VS17 , <nl> - PPC_REG_VS18 , <nl> - PPC_REG_VS19 , <nl> - PPC_REG_VS20 , <nl> - PPC_REG_VS21 , <nl> - PPC_REG_VS22 , <nl> - PPC_REG_VS23 , <nl> - PPC_REG_VS24 , <nl> - PPC_REG_VS25 , <nl> - PPC_REG_VS26 , <nl> - PPC_REG_VS27 , <nl> - PPC_REG_VS28 , <nl> - PPC_REG_VS29 , <nl> - PPC_REG_VS30 , <nl> - PPC_REG_VS31 , <nl> - PPC_REG_VS32 , <nl> - PPC_REG_VS33 , <nl> - PPC_REG_VS34 , <nl> - PPC_REG_VS35 , <nl> - PPC_REG_VS36 , <nl> - PPC_REG_VS37 , <nl> - PPC_REG_VS38 , <nl> - PPC_REG_VS39 , <nl> - PPC_REG_VS40 , <nl> - PPC_REG_VS41 , <nl> - PPC_REG_VS42 , <nl> - PPC_REG_VS43 , <nl> - PPC_REG_VS44 , <nl> - PPC_REG_VS45 , <nl> - PPC_REG_VS46 , <nl> - PPC_REG_VS47 , <nl> - PPC_REG_VS48 , <nl> - PPC_REG_VS49 , <nl> - PPC_REG_VS50 , <nl> - PPC_REG_VS51 , <nl> - PPC_REG_VS52 , <nl> - PPC_REG_VS53 , <nl> - PPC_REG_VS54 , <nl> - PPC_REG_VS55 , <nl> - PPC_REG_VS56 , <nl> - PPC_REG_VS57 , <nl> - PPC_REG_VS58 , <nl> - PPC_REG_VS59 , <nl> - PPC_REG_VS60 , <nl> - PPC_REG_VS61 , <nl> - PPC_REG_VS62 , <nl> - PPC_REG_VS63 , <nl> - <nl> - / / extra registers for PPCMapping . c <nl> - PPC_REG_RM , <nl> - PPC_REG_CTR8 , <nl> - PPC_REG_LR8 , <nl> - PPC_REG_CR1EQ , <nl> - <nl> - PPC_REG_ENDING , / / < - - mark the end of the list of registers <nl> - } ppc_reg ; <nl> - <nl> - / / > PPC instruction <nl> - typedef enum ppc_insn <nl> - { <nl> - PPC_INS_INVALID = 0 , <nl> - <nl> - PPC_INS_ADD , <nl> - PPC_INS_ADDC , <nl> - PPC_INS_ADDE , <nl> - PPC_INS_ADDI , <nl> - PPC_INS_ADDIC , <nl> - PPC_INS_ADDIS , <nl> - PPC_INS_ADDME , <nl> - PPC_INS_ADDZE , <nl> - PPC_INS_AND , <nl> - PPC_INS_ANDC , <nl> - PPC_INS_ANDIS , <nl> - PPC_INS_ANDI , <nl> - PPC_INS_B , <nl> - PPC_INS_BA , <nl> - PPC_INS_BC , <nl> - PPC_INS_BCCTR , <nl> - PPC_INS_BCCTRL , <nl> - PPC_INS_BCL , <nl> - PPC_INS_BCLR , <nl> - PPC_INS_BCLRL , <nl> - PPC_INS_BCTR , <nl> - PPC_INS_BCTRL , <nl> - PPC_INS_BDNZ , <nl> - PPC_INS_BDNZA , <nl> - PPC_INS_BDNZL , <nl> - PPC_INS_BDNZLA , <nl> - PPC_INS_BDNZLR , <nl> - PPC_INS_BDNZLRL , <nl> - PPC_INS_BDZ , <nl> - PPC_INS_BDZA , <nl> - PPC_INS_BDZL , <nl> - PPC_INS_BDZLA , <nl> - PPC_INS_BDZLR , <nl> - PPC_INS_BDZLRL , <nl> - PPC_INS_BL , <nl> - PPC_INS_BLA , <nl> - PPC_INS_BLR , <nl> - PPC_INS_BLRL , <nl> - PPC_INS_BRINC , <nl> - PPC_INS_CMPD , <nl> - PPC_INS_CMPDI , <nl> - PPC_INS_CMPLD , <nl> - PPC_INS_CMPLDI , <nl> - PPC_INS_CMPLW , <nl> - PPC_INS_CMPLWI , <nl> - PPC_INS_CMPW , <nl> - PPC_INS_CMPWI , <nl> - PPC_INS_CNTLZD , <nl> - PPC_INS_CNTLZW , <nl> - PPC_INS_CREQV , <nl> - PPC_INS_CRXOR , <nl> - PPC_INS_CRAND , <nl> - PPC_INS_CRANDC , <nl> - PPC_INS_CRNAND , <nl> - PPC_INS_CRNOR , <nl> - PPC_INS_CROR , <nl> - PPC_INS_CRORC , <nl> - PPC_INS_DCBA , <nl> - PPC_INS_DCBF , <nl> - PPC_INS_DCBI , <nl> - PPC_INS_DCBST , <nl> - PPC_INS_DCBT , <nl> - PPC_INS_DCBTST , <nl> - PPC_INS_DCBZ , <nl> - PPC_INS_DCBZL , <nl> - PPC_INS_DCCCI , <nl> - PPC_INS_DIVD , <nl> - PPC_INS_DIVDU , <nl> - PPC_INS_DIVW , <nl> - PPC_INS_DIVWU , <nl> - PPC_INS_DSS , <nl> - PPC_INS_DSSALL , <nl> - PPC_INS_DST , <nl> - PPC_INS_DSTST , <nl> - PPC_INS_DSTSTT , <nl> - PPC_INS_DSTT , <nl> - PPC_INS_EIEIO , <nl> - PPC_INS_EQV , <nl> - PPC_INS_EVABS , <nl> - PPC_INS_EVADDIW , <nl> - PPC_INS_EVADDSMIAAW , <nl> - PPC_INS_EVADDSSIAAW , <nl> - PPC_INS_EVADDUMIAAW , <nl> - PPC_INS_EVADDUSIAAW , <nl> - PPC_INS_EVADDW , <nl> - PPC_INS_EVAND , <nl> - PPC_INS_EVANDC , <nl> - PPC_INS_EVCMPEQ , <nl> - PPC_INS_EVCMPGTS , <nl> - PPC_INS_EVCMPGTU , <nl> - PPC_INS_EVCMPLTS , <nl> - PPC_INS_EVCMPLTU , <nl> - PPC_INS_EVCNTLSW , <nl> - PPC_INS_EVCNTLZW , <nl> - PPC_INS_EVDIVWS , <nl> - PPC_INS_EVDIVWU , <nl> - PPC_INS_EVEQV , <nl> - PPC_INS_EVEXTSB , <nl> - PPC_INS_EVEXTSH , <nl> - PPC_INS_EVLDD , <nl> - PPC_INS_EVLDDX , <nl> - PPC_INS_EVLDH , <nl> - PPC_INS_EVLDHX , <nl> - PPC_INS_EVLDW , <nl> - PPC_INS_EVLDWX , <nl> - PPC_INS_EVLHHESPLAT , <nl> - PPC_INS_EVLHHESPLATX , <nl> - PPC_INS_EVLHHOSSPLAT , <nl> - PPC_INS_EVLHHOSSPLATX , <nl> - PPC_INS_EVLHHOUSPLAT , <nl> - PPC_INS_EVLHHOUSPLATX , <nl> - PPC_INS_EVLWHE , <nl> - PPC_INS_EVLWHEX , <nl> - PPC_INS_EVLWHOS , <nl> - PPC_INS_EVLWHOSX , <nl> - PPC_INS_EVLWHOU , <nl> - PPC_INS_EVLWHOUX , <nl> - PPC_INS_EVLWHSPLAT , <nl> - PPC_INS_EVLWHSPLATX , <nl> - PPC_INS_EVLWWSPLAT , <nl> - PPC_INS_EVLWWSPLATX , <nl> - PPC_INS_EVMERGEHI , <nl> - PPC_INS_EVMERGEHILO , <nl> - PPC_INS_EVMERGELO , <nl> - PPC_INS_EVMERGELOHI , <nl> - PPC_INS_EVMHEGSMFAA , <nl> - PPC_INS_EVMHEGSMFAN , <nl> - PPC_INS_EVMHEGSMIAA , <nl> - PPC_INS_EVMHEGSMIAN , <nl> - PPC_INS_EVMHEGUMIAA , <nl> - PPC_INS_EVMHEGUMIAN , <nl> - PPC_INS_EVMHESMF , <nl> - PPC_INS_EVMHESMFA , <nl> - PPC_INS_EVMHESMFAAW , <nl> - PPC_INS_EVMHESMFANW , <nl> - PPC_INS_EVMHESMI , <nl> - PPC_INS_EVMHESMIA , <nl> - PPC_INS_EVMHESMIAAW , <nl> - PPC_INS_EVMHESMIANW , <nl> - PPC_INS_EVMHESSF , <nl> - PPC_INS_EVMHESSFA , <nl> - PPC_INS_EVMHESSFAAW , <nl> - PPC_INS_EVMHESSFANW , <nl> - PPC_INS_EVMHESSIAAW , <nl> - PPC_INS_EVMHESSIANW , <nl> - PPC_INS_EVMHEUMI , <nl> - PPC_INS_EVMHEUMIA , <nl> - PPC_INS_EVMHEUMIAAW , <nl> - PPC_INS_EVMHEUMIANW , <nl> - PPC_INS_EVMHEUSIAAW , <nl> - PPC_INS_EVMHEUSIANW , <nl> - PPC_INS_EVMHOGSMFAA , <nl> - PPC_INS_EVMHOGSMFAN , <nl> - PPC_INS_EVMHOGSMIAA , <nl> - PPC_INS_EVMHOGSMIAN , <nl> - PPC_INS_EVMHOGUMIAA , <nl> - PPC_INS_EVMHOGUMIAN , <nl> - PPC_INS_EVMHOSMF , <nl> - PPC_INS_EVMHOSMFA , <nl> - PPC_INS_EVMHOSMFAAW , <nl> - PPC_INS_EVMHOSMFANW , <nl> - PPC_INS_EVMHOSMI , <nl> - PPC_INS_EVMHOSMIA , <nl> - PPC_INS_EVMHOSMIAAW , <nl> - PPC_INS_EVMHOSMIANW , <nl> - PPC_INS_EVMHOSSF , <nl> - PPC_INS_EVMHOSSFA , <nl> - PPC_INS_EVMHOSSFAAW , <nl> - PPC_INS_EVMHOSSFANW , <nl> - PPC_INS_EVMHOSSIAAW , <nl> - PPC_INS_EVMHOSSIANW , <nl> - PPC_INS_EVMHOUMI , <nl> - PPC_INS_EVMHOUMIA , <nl> - PPC_INS_EVMHOUMIAAW , <nl> - PPC_INS_EVMHOUMIANW , <nl> - PPC_INS_EVMHOUSIAAW , <nl> - PPC_INS_EVMHOUSIANW , <nl> - PPC_INS_EVMRA , <nl> - PPC_INS_EVMWHSMF , <nl> - PPC_INS_EVMWHSMFA , <nl> - PPC_INS_EVMWHSMI , <nl> - PPC_INS_EVMWHSMIA , <nl> - PPC_INS_EVMWHSSF , <nl> - PPC_INS_EVMWHSSFA , <nl> - PPC_INS_EVMWHUMI , <nl> - PPC_INS_EVMWHUMIA , <nl> - PPC_INS_EVMWLSMIAAW , <nl> - PPC_INS_EVMWLSMIANW , <nl> - PPC_INS_EVMWLSSIAAW , <nl> - PPC_INS_EVMWLSSIANW , <nl> - PPC_INS_EVMWLUMI , <nl> - PPC_INS_EVMWLUMIA , <nl> - PPC_INS_EVMWLUMIAAW , <nl> - PPC_INS_EVMWLUMIANW , <nl> - PPC_INS_EVMWLUSIAAW , <nl> - PPC_INS_EVMWLUSIANW , <nl> - PPC_INS_EVMWSMF , <nl> - PPC_INS_EVMWSMFA , <nl> - PPC_INS_EVMWSMFAA , <nl> - PPC_INS_EVMWSMFAN , <nl> - PPC_INS_EVMWSMI , <nl> - PPC_INS_EVMWSMIA , <nl> - PPC_INS_EVMWSMIAA , <nl> - PPC_INS_EVMWSMIAN , <nl> - PPC_INS_EVMWSSF , <nl> - PPC_INS_EVMWSSFA , <nl> - PPC_INS_EVMWSSFAA , <nl> - PPC_INS_EVMWSSFAN , <nl> - PPC_INS_EVMWUMI , <nl> - PPC_INS_EVMWUMIA , <nl> - PPC_INS_EVMWUMIAA , <nl> - PPC_INS_EVMWUMIAN , <nl> - PPC_INS_EVNAND , <nl> - PPC_INS_EVNEG , <nl> - PPC_INS_EVNOR , <nl> - PPC_INS_EVOR , <nl> - PPC_INS_EVORC , <nl> - PPC_INS_EVRLW , <nl> - PPC_INS_EVRLWI , <nl> - PPC_INS_EVRNDW , <nl> - PPC_INS_EVSLW , <nl> - PPC_INS_EVSLWI , <nl> - PPC_INS_EVSPLATFI , <nl> - PPC_INS_EVSPLATI , <nl> - PPC_INS_EVSRWIS , <nl> - PPC_INS_EVSRWIU , <nl> - PPC_INS_EVSRWS , <nl> - PPC_INS_EVSRWU , <nl> - PPC_INS_EVSTDD , <nl> - PPC_INS_EVSTDDX , <nl> - PPC_INS_EVSTDH , <nl> - PPC_INS_EVSTDHX , <nl> - PPC_INS_EVSTDW , <nl> - PPC_INS_EVSTDWX , <nl> - PPC_INS_EVSTWHE , <nl> - PPC_INS_EVSTWHEX , <nl> - PPC_INS_EVSTWHO , <nl> - PPC_INS_EVSTWHOX , <nl> - PPC_INS_EVSTWWE , <nl> - PPC_INS_EVSTWWEX , <nl> - PPC_INS_EVSTWWO , <nl> - PPC_INS_EVSTWWOX , <nl> - PPC_INS_EVSUBFSMIAAW , <nl> - PPC_INS_EVSUBFSSIAAW , <nl> - PPC_INS_EVSUBFUMIAAW , <nl> - PPC_INS_EVSUBFUSIAAW , <nl> - PPC_INS_EVSUBFW , <nl> - PPC_INS_EVSUBIFW , <nl> - PPC_INS_EVXOR , <nl> - PPC_INS_EXTSB , <nl> - PPC_INS_EXTSH , <nl> - PPC_INS_EXTSW , <nl> - PPC_INS_FABS , <nl> - PPC_INS_FADD , <nl> - PPC_INS_FADDS , <nl> - PPC_INS_FCFID , <nl> - PPC_INS_FCFIDS , <nl> - PPC_INS_FCFIDU , <nl> - PPC_INS_FCFIDUS , <nl> - PPC_INS_FCMPU , <nl> - PPC_INS_FCPSGN , <nl> - PPC_INS_FCTID , <nl> - PPC_INS_FCTIDUZ , <nl> - PPC_INS_FCTIDZ , <nl> - PPC_INS_FCTIW , <nl> - PPC_INS_FCTIWUZ , <nl> - PPC_INS_FCTIWZ , <nl> - PPC_INS_FDIV , <nl> - PPC_INS_FDIVS , <nl> - PPC_INS_FMADD , <nl> - PPC_INS_FMADDS , <nl> - PPC_INS_FMR , <nl> - PPC_INS_FMSUB , <nl> - PPC_INS_FMSUBS , <nl> - PPC_INS_FMUL , <nl> - PPC_INS_FMULS , <nl> - PPC_INS_FNABS , <nl> - PPC_INS_FNEG , <nl> - PPC_INS_FNMADD , <nl> - PPC_INS_FNMADDS , <nl> - PPC_INS_FNMSUB , <nl> - PPC_INS_FNMSUBS , <nl> - PPC_INS_FRE , <nl> - PPC_INS_FRES , <nl> - PPC_INS_FRIM , <nl> - PPC_INS_FRIN , <nl> - PPC_INS_FRIP , <nl> - PPC_INS_FRIZ , <nl> - PPC_INS_FRSP , <nl> - PPC_INS_FRSQRTE , <nl> - PPC_INS_FRSQRTES , <nl> - PPC_INS_FSEL , <nl> - PPC_INS_FSQRT , <nl> - PPC_INS_FSQRTS , <nl> - PPC_INS_FSUB , <nl> - PPC_INS_FSUBS , <nl> - PPC_INS_ICBI , <nl> - PPC_INS_ICCCI , <nl> - PPC_INS_ISEL , <nl> - PPC_INS_ISYNC , <nl> - PPC_INS_LA , <nl> - PPC_INS_LBZ , <nl> - PPC_INS_LBZU , <nl> - PPC_INS_LBZUX , <nl> - PPC_INS_LBZX , <nl> - PPC_INS_LD , <nl> - PPC_INS_LDARX , <nl> - PPC_INS_LDBRX , <nl> - PPC_INS_LDU , <nl> - PPC_INS_LDUX , <nl> - PPC_INS_LDX , <nl> - PPC_INS_LFD , <nl> - PPC_INS_LFDU , <nl> - PPC_INS_LFDUX , <nl> - PPC_INS_LFDX , <nl> - PPC_INS_LFIWAX , <nl> - PPC_INS_LFIWZX , <nl> - PPC_INS_LFS , <nl> - PPC_INS_LFSU , <nl> - PPC_INS_LFSUX , <nl> - PPC_INS_LFSX , <nl> - PPC_INS_LHA , <nl> - PPC_INS_LHAU , <nl> - PPC_INS_LHAUX , <nl> - PPC_INS_LHAX , <nl> - PPC_INS_LHBRX , <nl> - PPC_INS_LHZ , <nl> - PPC_INS_LHZU , <nl> - PPC_INS_LHZUX , <nl> - PPC_INS_LHZX , <nl> - PPC_INS_LI , <nl> - PPC_INS_LIS , <nl> - PPC_INS_LMW , <nl> - PPC_INS_LSWI , <nl> - PPC_INS_LVEBX , <nl> - PPC_INS_LVEHX , <nl> - PPC_INS_LVEWX , <nl> - PPC_INS_LVSL , <nl> - PPC_INS_LVSR , <nl> - PPC_INS_LVX , <nl> - PPC_INS_LVXL , <nl> - PPC_INS_LWA , <nl> - PPC_INS_LWARX , <nl> - PPC_INS_LWAUX , <nl> - PPC_INS_LWAX , <nl> - PPC_INS_LWBRX , <nl> - PPC_INS_LWZ , <nl> - PPC_INS_LWZU , <nl> - PPC_INS_LWZUX , <nl> - PPC_INS_LWZX , <nl> - PPC_INS_LXSDX , <nl> - PPC_INS_LXVD2X , <nl> - PPC_INS_LXVDSX , <nl> - PPC_INS_LXVW4X , <nl> - PPC_INS_MBAR , <nl> - PPC_INS_MCRF , <nl> - PPC_INS_MFCR , <nl> - PPC_INS_MFCTR , <nl> - PPC_INS_MFDCR , <nl> - PPC_INS_MFFS , <nl> - PPC_INS_MFLR , <nl> - PPC_INS_MFMSR , <nl> - PPC_INS_MFOCRF , <nl> - PPC_INS_MFSPR , <nl> - PPC_INS_MFSR , <nl> - PPC_INS_MFSRIN , <nl> - PPC_INS_MFTB , <nl> - PPC_INS_MFVSCR , <nl> - PPC_INS_MSYNC , <nl> - PPC_INS_MTCRF , <nl> - PPC_INS_MTCTR , <nl> - PPC_INS_MTDCR , <nl> - PPC_INS_MTFSB0 , <nl> - PPC_INS_MTFSB1 , <nl> - PPC_INS_MTFSF , <nl> - PPC_INS_MTLR , <nl> - PPC_INS_MTMSR , <nl> - PPC_INS_MTMSRD , <nl> - PPC_INS_MTOCRF , <nl> - PPC_INS_MTSPR , <nl> - PPC_INS_MTSR , <nl> - PPC_INS_MTSRIN , <nl> - PPC_INS_MTVSCR , <nl> - PPC_INS_MULHD , <nl> - PPC_INS_MULHDU , <nl> - PPC_INS_MULHW , <nl> - PPC_INS_MULHWU , <nl> - PPC_INS_MULLD , <nl> - PPC_INS_MULLI , <nl> - PPC_INS_MULLW , <nl> - PPC_INS_NAND , <nl> - PPC_INS_NEG , <nl> - PPC_INS_NOP , <nl> - PPC_INS_ORI , <nl> - PPC_INS_NOR , <nl> - PPC_INS_OR , <nl> - PPC_INS_ORC , <nl> - PPC_INS_ORIS , <nl> - PPC_INS_POPCNTD , <nl> - PPC_INS_POPCNTW , <nl> - PPC_INS_RFCI , <nl> - PPC_INS_RFDI , <nl> - PPC_INS_RFI , <nl> - PPC_INS_RFID , <nl> - PPC_INS_RFMCI , <nl> - PPC_INS_RLDCL , <nl> - PPC_INS_RLDCR , <nl> - PPC_INS_RLDIC , <nl> - PPC_INS_RLDICL , <nl> - PPC_INS_RLDICR , <nl> - PPC_INS_RLDIMI , <nl> - PPC_INS_RLWIMI , <nl> - PPC_INS_RLWINM , <nl> - PPC_INS_RLWNM , <nl> - PPC_INS_SC , <nl> - PPC_INS_SLBIA , <nl> - PPC_INS_SLBIE , <nl> - PPC_INS_SLBMFEE , <nl> - PPC_INS_SLBMTE , <nl> - PPC_INS_SLD , <nl> - PPC_INS_SLW , <nl> - PPC_INS_SRAD , <nl> - PPC_INS_SRADI , <nl> - PPC_INS_SRAW , <nl> - PPC_INS_SRAWI , <nl> - PPC_INS_SRD , <nl> - PPC_INS_SRW , <nl> - PPC_INS_STB , <nl> - PPC_INS_STBU , <nl> - PPC_INS_STBUX , <nl> - PPC_INS_STBX , <nl> - PPC_INS_STD , <nl> - PPC_INS_STDBRX , <nl> - PPC_INS_STDCX , <nl> - PPC_INS_STDU , <nl> - PPC_INS_STDUX , <nl> - PPC_INS_STDX , <nl> - PPC_INS_STFD , <nl> - PPC_INS_STFDU , <nl> - PPC_INS_STFDUX , <nl> - PPC_INS_STFDX , <nl> - PPC_INS_STFIWX , <nl> - PPC_INS_STFS , <nl> - PPC_INS_STFSU , <nl> - PPC_INS_STFSUX , <nl> - PPC_INS_STFSX , <nl> - PPC_INS_STH , <nl> - PPC_INS_STHBRX , <nl> - PPC_INS_STHU , <nl> - PPC_INS_STHUX , <nl> - PPC_INS_STHX , <nl> - PPC_INS_STMW , <nl> - PPC_INS_STSWI , <nl> - PPC_INS_STVEBX , <nl> - PPC_INS_STVEHX , <nl> - PPC_INS_STVEWX , <nl> - PPC_INS_STVX , <nl> - PPC_INS_STVXL , <nl> - PPC_INS_STW , <nl> - PPC_INS_STWBRX , <nl> - PPC_INS_STWCX , <nl> - PPC_INS_STWU , <nl> - PPC_INS_STWUX , <nl> - PPC_INS_STWX , <nl> - PPC_INS_STXSDX , <nl> - PPC_INS_STXVD2X , <nl> - PPC_INS_STXVW4X , <nl> - PPC_INS_SUBF , <nl> - PPC_INS_SUBFC , <nl> - PPC_INS_SUBFE , <nl> - PPC_INS_SUBFIC , <nl> - PPC_INS_SUBFME , <nl> - PPC_INS_SUBFZE , <nl> - PPC_INS_SYNC , <nl> - PPC_INS_TD , <nl> - PPC_INS_TDI , <nl> - PPC_INS_TLBIA , <nl> - PPC_INS_TLBIE , <nl> - PPC_INS_TLBIEL , <nl> - PPC_INS_TLBIVAX , <nl> - PPC_INS_TLBLD , <nl> - PPC_INS_TLBLI , <nl> - PPC_INS_TLBRE , <nl> - PPC_INS_TLBSX , <nl> - PPC_INS_TLBSYNC , <nl> - PPC_INS_TLBWE , <nl> - PPC_INS_TRAP , <nl> - PPC_INS_TW , <nl> - PPC_INS_TWI , <nl> - PPC_INS_VADDCUW , <nl> - PPC_INS_VADDFP , <nl> - PPC_INS_VADDSBS , <nl> - PPC_INS_VADDSHS , <nl> - PPC_INS_VADDSWS , <nl> - PPC_INS_VADDUBM , <nl> - PPC_INS_VADDUBS , <nl> - PPC_INS_VADDUHM , <nl> - PPC_INS_VADDUHS , <nl> - PPC_INS_VADDUWM , <nl> - PPC_INS_VADDUWS , <nl> - PPC_INS_VAND , <nl> - PPC_INS_VANDC , <nl> - PPC_INS_VAVGSB , <nl> - PPC_INS_VAVGSH , <nl> - PPC_INS_VAVGSW , <nl> - PPC_INS_VAVGUB , <nl> - PPC_INS_VAVGUH , <nl> - PPC_INS_VAVGUW , <nl> - PPC_INS_VCFSX , <nl> - PPC_INS_VCFUX , <nl> - PPC_INS_VCMPBFP , <nl> - PPC_INS_VCMPEQFP , <nl> - PPC_INS_VCMPEQUB , <nl> - PPC_INS_VCMPEQUH , <nl> - PPC_INS_VCMPEQUW , <nl> - PPC_INS_VCMPGEFP , <nl> - PPC_INS_VCMPGTFP , <nl> - PPC_INS_VCMPGTSB , <nl> - PPC_INS_VCMPGTSH , <nl> - PPC_INS_VCMPGTSW , <nl> - PPC_INS_VCMPGTUB , <nl> - PPC_INS_VCMPGTUH , <nl> - PPC_INS_VCMPGTUW , <nl> - PPC_INS_VCTSXS , <nl> - PPC_INS_VCTUXS , <nl> - PPC_INS_VEXPTEFP , <nl> - PPC_INS_VLOGEFP , <nl> - PPC_INS_VMADDFP , <nl> - PPC_INS_VMAXFP , <nl> - PPC_INS_VMAXSB , <nl> - PPC_INS_VMAXSH , <nl> - PPC_INS_VMAXSW , <nl> - PPC_INS_VMAXUB , <nl> - PPC_INS_VMAXUH , <nl> - PPC_INS_VMAXUW , <nl> - PPC_INS_VMHADDSHS , <nl> - PPC_INS_VMHRADDSHS , <nl> - PPC_INS_VMINFP , <nl> - PPC_INS_VMINSB , <nl> - PPC_INS_VMINSH , <nl> - PPC_INS_VMINSW , <nl> - PPC_INS_VMINUB , <nl> - PPC_INS_VMINUH , <nl> - PPC_INS_VMINUW , <nl> - PPC_INS_VMLADDUHM , <nl> - PPC_INS_VMRGHB , <nl> - PPC_INS_VMRGHH , <nl> - PPC_INS_VMRGHW , <nl> - PPC_INS_VMRGLB , <nl> - PPC_INS_VMRGLH , <nl> - PPC_INS_VMRGLW , <nl> - PPC_INS_VMSUMMBM , <nl> - PPC_INS_VMSUMSHM , <nl> - PPC_INS_VMSUMSHS , <nl> - PPC_INS_VMSUMUBM , <nl> - PPC_INS_VMSUMUHM , <nl> - PPC_INS_VMSUMUHS , <nl> - PPC_INS_VMULESB , <nl> - PPC_INS_VMULESH , <nl> - PPC_INS_VMULEUB , <nl> - PPC_INS_VMULEUH , <nl> - PPC_INS_VMULOSB , <nl> - PPC_INS_VMULOSH , <nl> - PPC_INS_VMULOUB , <nl> - PPC_INS_VMULOUH , <nl> - PPC_INS_VNMSUBFP , <nl> - PPC_INS_VNOR , <nl> - PPC_INS_VOR , <nl> - PPC_INS_VPERM , <nl> - PPC_INS_VPKPX , <nl> - PPC_INS_VPKSHSS , <nl> - PPC_INS_VPKSHUS , <nl> - PPC_INS_VPKSWSS , <nl> - PPC_INS_VPKSWUS , <nl> - PPC_INS_VPKUHUM , <nl> - PPC_INS_VPKUHUS , <nl> - PPC_INS_VPKUWUM , <nl> - PPC_INS_VPKUWUS , <nl> - PPC_INS_VREFP , <nl> - PPC_INS_VRFIM , <nl> - PPC_INS_VRFIN , <nl> - PPC_INS_VRFIP , <nl> - PPC_INS_VRFIZ , <nl> - PPC_INS_VRLB , <nl> - PPC_INS_VRLH , <nl> - PPC_INS_VRLW , <nl> - PPC_INS_VRSQRTEFP , <nl> - PPC_INS_VSEL , <nl> - PPC_INS_VSL , <nl> - PPC_INS_VSLB , <nl> - PPC_INS_VSLDOI , <nl> - PPC_INS_VSLH , <nl> - PPC_INS_VSLO , <nl> - PPC_INS_VSLW , <nl> - PPC_INS_VSPLTB , <nl> - PPC_INS_VSPLTH , <nl> - PPC_INS_VSPLTISB , <nl> - PPC_INS_VSPLTISH , <nl> - PPC_INS_VSPLTISW , <nl> - PPC_INS_VSPLTW , <nl> - PPC_INS_VSR , <nl> - PPC_INS_VSRAB , <nl> - PPC_INS_VSRAH , <nl> - PPC_INS_VSRAW , <nl> - PPC_INS_VSRB , <nl> - PPC_INS_VSRH , <nl> - PPC_INS_VSRO , <nl> - PPC_INS_VSRW , <nl> - PPC_INS_VSUBCUW , <nl> - PPC_INS_VSUBFP , <nl> - PPC_INS_VSUBSBS , <nl> - PPC_INS_VSUBSHS , <nl> - PPC_INS_VSUBSWS , <nl> - PPC_INS_VSUBUBM , <nl> - PPC_INS_VSUBUBS , <nl> - PPC_INS_VSUBUHM , <nl> - PPC_INS_VSUBUHS , <nl> - PPC_INS_VSUBUWM , <nl> - PPC_INS_VSUBUWS , <nl> - PPC_INS_VSUM2SWS , <nl> - PPC_INS_VSUM4SBS , <nl> - PPC_INS_VSUM4SHS , <nl> - PPC_INS_VSUM4UBS , <nl> - PPC_INS_VSUMSWS , <nl> - PPC_INS_VUPKHPX , <nl> - PPC_INS_VUPKHSB , <nl> - PPC_INS_VUPKHSH , <nl> - PPC_INS_VUPKLPX , <nl> - PPC_INS_VUPKLSB , <nl> - PPC_INS_VUPKLSH , <nl> - PPC_INS_VXOR , <nl> - PPC_INS_WAIT , <nl> - PPC_INS_WRTEE , <nl> - PPC_INS_WRTEEI , <nl> - PPC_INS_XOR , <nl> - PPC_INS_XORI , <nl> - PPC_INS_XORIS , <nl> - PPC_INS_XSABSDP , <nl> - PPC_INS_XSADDDP , <nl> - PPC_INS_XSCMPODP , <nl> - PPC_INS_XSCMPUDP , <nl> - PPC_INS_XSCPSGNDP , <nl> - PPC_INS_XSCVDPSP , <nl> - PPC_INS_XSCVDPSXDS , <nl> - PPC_INS_XSCVDPSXWS , <nl> - PPC_INS_XSCVDPUXDS , <nl> - PPC_INS_XSCVDPUXWS , <nl> - PPC_INS_XSCVSPDP , <nl> - PPC_INS_XSCVSXDDP , <nl> - PPC_INS_XSCVUXDDP , <nl> - PPC_INS_XSDIVDP , <nl> - PPC_INS_XSMADDADP , <nl> - PPC_INS_XSMADDMDP , <nl> - PPC_INS_XSMAXDP , <nl> - PPC_INS_XSMINDP , <nl> - PPC_INS_XSMSUBADP , <nl> - PPC_INS_XSMSUBMDP , <nl> - PPC_INS_XSMULDP , <nl> - PPC_INS_XSNABSDP , <nl> - PPC_INS_XSNEGDP , <nl> - PPC_INS_XSNMADDADP , <nl> - PPC_INS_XSNMADDMDP , <nl> - PPC_INS_XSNMSUBADP , <nl> - PPC_INS_XSNMSUBMDP , <nl> - PPC_INS_XSRDPI , <nl> - PPC_INS_XSRDPIC , <nl> - PPC_INS_XSRDPIM , <nl> - PPC_INS_XSRDPIP , <nl> - PPC_INS_XSRDPIZ , <nl> - PPC_INS_XSREDP , <nl> - PPC_INS_XSRSQRTEDP , <nl> - PPC_INS_XSSQRTDP , <nl> - PPC_INS_XSSUBDP , <nl> - PPC_INS_XSTDIVDP , <nl> - PPC_INS_XSTSQRTDP , <nl> - PPC_INS_XVABSDP , <nl> - PPC_INS_XVABSSP , <nl> - PPC_INS_XVADDDP , <nl> - PPC_INS_XVADDSP , <nl> - PPC_INS_XVCMPEQDP , <nl> - PPC_INS_XVCMPEQSP , <nl> - PPC_INS_XVCMPGEDP , <nl> - PPC_INS_XVCMPGESP , <nl> - PPC_INS_XVCMPGTDP , <nl> - PPC_INS_XVCMPGTSP , <nl> - PPC_INS_XVCPSGNDP , <nl> - PPC_INS_XVCPSGNSP , <nl> - PPC_INS_XVCVDPSP , <nl> - PPC_INS_XVCVDPSXDS , <nl> - PPC_INS_XVCVDPSXWS , <nl> - PPC_INS_XVCVDPUXDS , <nl> - PPC_INS_XVCVDPUXWS , <nl> - PPC_INS_XVCVSPDP , <nl> - PPC_INS_XVCVSPSXDS , <nl> - PPC_INS_XVCVSPSXWS , <nl> - PPC_INS_XVCVSPUXDS , <nl> - PPC_INS_XVCVSPUXWS , <nl> - PPC_INS_XVCVSXDDP , <nl> - PPC_INS_XVCVSXDSP , <nl> - PPC_INS_XVCVSXWDP , <nl> - PPC_INS_XVCVSXWSP , <nl> - PPC_INS_XVCVUXDDP , <nl> - PPC_INS_XVCVUXDSP , <nl> - PPC_INS_XVCVUXWDP , <nl> - PPC_INS_XVCVUXWSP , <nl> - PPC_INS_XVDIVDP , <nl> - PPC_INS_XVDIVSP , <nl> - PPC_INS_XVMADDADP , <nl> - PPC_INS_XVMADDASP , <nl> - PPC_INS_XVMADDMDP , <nl> - PPC_INS_XVMADDMSP , <nl> - PPC_INS_XVMAXDP , <nl> - PPC_INS_XVMAXSP , <nl> - PPC_INS_XVMINDP , <nl> - PPC_INS_XVMINSP , <nl> - PPC_INS_XVMSUBADP , <nl> - PPC_INS_XVMSUBASP , <nl> - PPC_INS_XVMSUBMDP , <nl> - PPC_INS_XVMSUBMSP , <nl> - PPC_INS_XVMULDP , <nl> - PPC_INS_XVMULSP , <nl> - PPC_INS_XVNABSDP , <nl> - PPC_INS_XVNABSSP , <nl> - PPC_INS_XVNEGDP , <nl> - PPC_INS_XVNEGSP , <nl> - PPC_INS_XVNMADDADP , <nl> - PPC_INS_XVNMADDASP , <nl> - PPC_INS_XVNMADDMDP , <nl> - PPC_INS_XVNMADDMSP , <nl> - PPC_INS_XVNMSUBADP , <nl> - PPC_INS_XVNMSUBASP , <nl> - PPC_INS_XVNMSUBMDP , <nl> - PPC_INS_XVNMSUBMSP , <nl> - PPC_INS_XVRDPI , <nl> - PPC_INS_XVRDPIC , <nl> - PPC_INS_XVRDPIM , <nl> - PPC_INS_XVRDPIP , <nl> - PPC_INS_XVRDPIZ , <nl> - PPC_INS_XVREDP , <nl> - PPC_INS_XVRESP , <nl> - PPC_INS_XVRSPI , <nl> - PPC_INS_XVRSPIC , <nl> - PPC_INS_XVRSPIM , <nl> - PPC_INS_XVRSPIP , <nl> - PPC_INS_XVRSPIZ , <nl> - PPC_INS_XVRSQRTEDP , <nl> - PPC_INS_XVRSQRTESP , <nl> - PPC_INS_XVSQRTDP , <nl> - PPC_INS_XVSQRTSP , <nl> - PPC_INS_XVSUBDP , <nl> - PPC_INS_XVSUBSP , <nl> - PPC_INS_XVTDIVDP , <nl> - PPC_INS_XVTDIVSP , <nl> - PPC_INS_XVTSQRTDP , <nl> - PPC_INS_XVTSQRTSP , <nl> - PPC_INS_XXLAND , <nl> - PPC_INS_XXLANDC , <nl> - PPC_INS_XXLNOR , <nl> - PPC_INS_XXLOR , <nl> - PPC_INS_XXLXOR , <nl> - PPC_INS_XXMRGHW , <nl> - PPC_INS_XXMRGLW , <nl> - PPC_INS_XXPERMDI , <nl> - PPC_INS_XXSEL , <nl> - PPC_INS_XXSLDWI , <nl> - PPC_INS_XXSPLTW , <nl> - PPC_INS_BCA , <nl> - PPC_INS_BCLA , <nl> - <nl> - / / extra & alias instructions <nl> - PPC_INS_SLWI , <nl> - PPC_INS_SRWI , <nl> - PPC_INS_SLDI , <nl> - <nl> - PPC_INS_BTA , <nl> - PPC_INS_CRSET , <nl> - PPC_INS_CRNOT , <nl> - PPC_INS_CRMOVE , <nl> - PPC_INS_CRCLR , <nl> - PPC_INS_MFBR0 , <nl> - PPC_INS_MFBR1 , <nl> - PPC_INS_MFBR2 , <nl> - PPC_INS_MFBR3 , <nl> - PPC_INS_MFBR4 , <nl> - PPC_INS_MFBR5 , <nl> - PPC_INS_MFBR6 , <nl> - PPC_INS_MFBR7 , <nl> - PPC_INS_MFXER , <nl> - PPC_INS_MFRTCU , <nl> - PPC_INS_MFRTCL , <nl> - PPC_INS_MFDSCR , <nl> - PPC_INS_MFDSISR , <nl> - PPC_INS_MFDAR , <nl> - PPC_INS_MFSRR2 , <nl> - PPC_INS_MFSRR3 , <nl> - PPC_INS_MFCFAR , <nl> - PPC_INS_MFAMR , <nl> - PPC_INS_MFPID , <nl> - PPC_INS_MFTBLO , <nl> - PPC_INS_MFTBHI , <nl> - PPC_INS_MFDBATU , <nl> - PPC_INS_MFDBATL , <nl> - PPC_INS_MFIBATU , <nl> - PPC_INS_MFIBATL , <nl> - PPC_INS_MFDCCR , <nl> - PPC_INS_MFICCR , <nl> - PPC_INS_MFDEAR , <nl> - PPC_INS_MFESR , <nl> - PPC_INS_MFSPEFSCR , <nl> - PPC_INS_MFTCR , <nl> - PPC_INS_MFASR , <nl> - PPC_INS_MFPVR , <nl> - PPC_INS_MFTBU , <nl> - PPC_INS_MTCR , <nl> - PPC_INS_MTBR0 , <nl> - PPC_INS_MTBR1 , <nl> - PPC_INS_MTBR2 , <nl> - PPC_INS_MTBR3 , <nl> - PPC_INS_MTBR4 , <nl> - PPC_INS_MTBR5 , <nl> - PPC_INS_MTBR6 , <nl> - PPC_INS_MTBR7 , <nl> - PPC_INS_MTXER , <nl> - PPC_INS_MTDSCR , <nl> - PPC_INS_MTDSISR , <nl> - PPC_INS_MTDAR , <nl> - PPC_INS_MTSRR2 , <nl> - PPC_INS_MTSRR3 , <nl> - PPC_INS_MTCFAR , <nl> - PPC_INS_MTAMR , <nl> - PPC_INS_MTPID , <nl> - PPC_INS_MTTBL , <nl> - PPC_INS_MTTBU , <nl> - PPC_INS_MTTBLO , <nl> - PPC_INS_MTTBHI , <nl> - PPC_INS_MTDBATU , <nl> - PPC_INS_MTDBATL , <nl> - PPC_INS_MTIBATU , <nl> - PPC_INS_MTIBATL , <nl> - PPC_INS_MTDCCR , <nl> - PPC_INS_MTICCR , <nl> - PPC_INS_MTDEAR , <nl> - PPC_INS_MTESR , <nl> - PPC_INS_MTSPEFSCR , <nl> - PPC_INS_MTTCR , <nl> - PPC_INS_NOT , <nl> - PPC_INS_MR , <nl> - PPC_INS_ROTLD , <nl> - PPC_INS_ROTLDI , <nl> - PPC_INS_CLRLDI , <nl> - PPC_INS_ROTLWI , <nl> - PPC_INS_CLRLWI , <nl> - PPC_INS_ROTLW , <nl> - PPC_INS_SUB , <nl> - PPC_INS_SUBC , <nl> - PPC_INS_LWSYNC , <nl> - PPC_INS_PTESYNC , <nl> - PPC_INS_TDLT , <nl> - PPC_INS_TDEQ , <nl> - PPC_INS_TDGT , <nl> - PPC_INS_TDNE , <nl> - PPC_INS_TDLLT , <nl> - PPC_INS_TDLGT , <nl> - PPC_INS_TDU , <nl> - PPC_INS_TDLTI , <nl> - PPC_INS_TDEQI , <nl> - PPC_INS_TDGTI , <nl> - PPC_INS_TDNEI , <nl> - PPC_INS_TDLLTI , <nl> - PPC_INS_TDLGTI , <nl> - PPC_INS_TDUI , <nl> - PPC_INS_TLBREHI , <nl> - PPC_INS_TLBRELO , <nl> - PPC_INS_TLBWEHI , <nl> - PPC_INS_TLBWELO , <nl> - PPC_INS_TWLT , <nl> - PPC_INS_TWEQ , <nl> - PPC_INS_TWGT , <nl> - PPC_INS_TWNE , <nl> - PPC_INS_TWLLT , <nl> - PPC_INS_TWLGT , <nl> - PPC_INS_TWU , <nl> - PPC_INS_TWLTI , <nl> - PPC_INS_TWEQI , <nl> - PPC_INS_TWGTI , <nl> - PPC_INS_TWNEI , <nl> - PPC_INS_TWLLTI , <nl> - PPC_INS_TWLGTI , <nl> - PPC_INS_TWUI , <nl> - PPC_INS_WAITRSV , <nl> - PPC_INS_WAITIMPL , <nl> - PPC_INS_XNOP , <nl> - PPC_INS_XVMOVDP , <nl> - PPC_INS_XVMOVSP , <nl> - PPC_INS_XXSPLTD , <nl> - PPC_INS_XXMRGHD , <nl> - PPC_INS_XXMRGLD , <nl> - PPC_INS_XXSWAPD , <nl> - PPC_INS_BT , <nl> - PPC_INS_BF , <nl> - PPC_INS_BDNZT , <nl> - PPC_INS_BDNZF , <nl> - PPC_INS_BDZF , <nl> - PPC_INS_BDZT , <nl> - PPC_INS_BFA , <nl> - PPC_INS_BDNZTA , <nl> - PPC_INS_BDNZFA , <nl> - PPC_INS_BDZTA , <nl> - PPC_INS_BDZFA , <nl> - PPC_INS_BTCTR , <nl> - PPC_INS_BFCTR , <nl> - PPC_INS_BTCTRL , <nl> - PPC_INS_BFCTRL , <nl> - PPC_INS_BTL , <nl> - PPC_INS_BFL , <nl> - PPC_INS_BDNZTL , <nl> - PPC_INS_BDNZFL , <nl> - PPC_INS_BDZTL , <nl> - PPC_INS_BDZFL , <nl> - PPC_INS_BTLA , <nl> - PPC_INS_BFLA , <nl> - PPC_INS_BDNZTLA , <nl> - PPC_INS_BDNZFLA , <nl> - PPC_INS_BDZTLA , <nl> - PPC_INS_BDZFLA , <nl> - PPC_INS_BTLR , <nl> - PPC_INS_BFLR , <nl> - PPC_INS_BDNZTLR , <nl> - PPC_INS_BDZTLR , <nl> - PPC_INS_BDZFLR , <nl> - PPC_INS_BTLRL , <nl> - PPC_INS_BFLRL , <nl> - PPC_INS_BDNZTLRL , <nl> - PPC_INS_BDNZFLRL , <nl> - PPC_INS_BDZTLRL , <nl> - PPC_INS_BDZFLRL , <nl> - <nl> - PPC_INS_ENDING , / / < - - mark the end of the list of instructions <nl> - } ppc_insn ; <nl> - <nl> - / / > Group of PPC instructions <nl> - typedef enum ppc_insn_group <nl> - { <nl> - PPC_GRP_INVALID = 0 , / / = CS_GRP_INVALID <nl> - <nl> - / / > Generic groups <nl> - / / all jump instructions ( conditional + direct + indirect jumps ) <nl> - PPC_GRP_JUMP , / / = CS_GRP_JUMP <nl> - <nl> - / / > Architecture - specific groups <nl> - PPC_GRP_ALTIVEC = 128 , <nl> - PPC_GRP_MODE32 , <nl> - PPC_GRP_MODE64 , <nl> - PPC_GRP_BOOKE , <nl> - PPC_GRP_NOTBOOKE , <nl> - PPC_GRP_SPE , <nl> - PPC_GRP_VSX , <nl> - PPC_GRP_E500 , <nl> - PPC_GRP_PPC4XX , <nl> - PPC_GRP_PPC6XX , <nl> - <nl> - PPC_GRP_ENDING , / / < - - mark the end of the list of groups <nl> - } ppc_insn_group ; <nl> - <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> - <nl> - # endif <nl> deleted file mode 100644 <nl> index ddb945ad2 . . 000000000 <nl> mmm a / src / dbg / capstone / sparc . h <nl> ppp / dev / null <nl> <nl> - # ifndef CAPSTONE_SPARC_H <nl> - # define CAPSTONE_SPARC_H <nl> - <nl> - / * Capstone Disassembly Engine * / <nl> - / * By Nguyen Anh Quynh < aquynh @ gmail . com > , 2014 * / <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - <nl> - # include < stdint . h > <nl> - # include " platform . h " <nl> - <nl> - / / GCC SPARC toolchain has a default macro called " sparc " which breaks <nl> - / / compilation <nl> - # undef sparc <nl> - <nl> - # ifdef _MSC_VER <nl> - # pragma warning ( disable : 4201 ) <nl> - # endif <nl> - <nl> - / / > Enums corresponding to Sparc condition codes , both icc ' s and fcc ' s . <nl> - typedef enum sparc_cc <nl> - { <nl> - SPARC_CC_INVALID = 0 , / / invalid CC ( default ) <nl> - / / > Integer condition codes <nl> - SPARC_CC_ICC_A = 8 + 256 , / / Always <nl> - SPARC_CC_ICC_N = 0 + 256 , / / Never <nl> - SPARC_CC_ICC_NE = 9 + 256 , / / Not Equal <nl> - SPARC_CC_ICC_E = 1 + 256 , / / Equal <nl> - SPARC_CC_ICC_G = 10 + 256 , / / Greater <nl> - SPARC_CC_ICC_LE = 2 + 256 , / / Less or Equal <nl> - SPARC_CC_ICC_GE = 11 + 256 , / / Greater or Equal <nl> - SPARC_CC_ICC_L = 3 + 256 , / / Less <nl> - SPARC_CC_ICC_GU = 12 + 256 , / / Greater Unsigned <nl> - SPARC_CC_ICC_LEU = 4 + 256 , / / Less or Equal Unsigned <nl> - SPARC_CC_ICC_CC = 13 + 256 , / / Carry Clear / Great or Equal Unsigned <nl> - SPARC_CC_ICC_CS = 5 + 256 , / / Carry Set / Less Unsigned <nl> - SPARC_CC_ICC_POS = 14 + 256 , / / Positive <nl> - SPARC_CC_ICC_NEG = 6 + 256 , / / Negative <nl> - SPARC_CC_ICC_VC = 15 + 256 , / / Overflow Clear <nl> - SPARC_CC_ICC_VS = 7 + 256 , / / Overflow Set <nl> - <nl> - / / > Floating condition codes <nl> - SPARC_CC_FCC_A = 8 + 16 + 256 , / / Always <nl> - SPARC_CC_FCC_N = 0 + 16 + 256 , / / Never <nl> - SPARC_CC_FCC_U = 7 + 16 + 256 , / / Unordered <nl> - SPARC_CC_FCC_G = 6 + 16 + 256 , / / Greater <nl> - SPARC_CC_FCC_UG = 5 + 16 + 256 , / / Unordered or Greater <nl> - SPARC_CC_FCC_L = 4 + 16 + 256 , / / Less <nl> - SPARC_CC_FCC_UL = 3 + 16 + 256 , / / Unordered or Less <nl> - SPARC_CC_FCC_LG = 2 + 16 + 256 , / / Less or Greater <nl> - SPARC_CC_FCC_NE = 1 + 16 + 256 , / / Not Equal <nl> - SPARC_CC_FCC_E = 9 + 16 + 256 , / / Equal <nl> - SPARC_CC_FCC_UE = 10 + 16 + 256 , / / Unordered or Equal <nl> - SPARC_CC_FCC_GE = 11 + 16 + 256 , / / Greater or Equal <nl> - SPARC_CC_FCC_UGE = 12 + 16 + 256 , / / Unordered or Greater or Equal <nl> - SPARC_CC_FCC_LE = 13 + 16 + 256 , / / Less or Equal <nl> - SPARC_CC_FCC_ULE = 14 + 16 + 256 , / / Unordered or Less or Equal <nl> - SPARC_CC_FCC_O = 15 + 16 + 256 , / / Ordered <nl> - } sparc_cc ; <nl> - <nl> - / / > Branch hint <nl> - typedef enum sparc_hint <nl> - { <nl> - SPARC_HINT_INVALID = 0 , / / no hint <nl> - SPARC_HINT_A = 1 < < 0 , / / annul delay slot instruction <nl> - SPARC_HINT_PT = 1 < < 1 , / / branch taken <nl> - SPARC_HINT_PN = 1 < < 2 , / / branch NOT taken <nl> - } sparc_hint ; <nl> - <nl> - / / > Operand type for instruction ' s operands <nl> - typedef enum sparc_op_type <nl> - { <nl> - SPARC_OP_INVALID = 0 , / / = CS_OP_INVALID ( Uninitialized ) . <nl> - SPARC_OP_REG , / / = CS_OP_REG ( Register operand ) . <nl> - SPARC_OP_IMM , / / = CS_OP_IMM ( Immediate operand ) . <nl> - SPARC_OP_MEM , / / = CS_OP_MEM ( Memory operand ) . <nl> - } sparc_op_type ; <nl> - <nl> - / / Instruction ' s operand referring to memory <nl> - / / This is associated with SPARC_OP_MEM operand type above <nl> - typedef struct sparc_op_mem <nl> - { <nl> - uint8_t base ; / / base register <nl> - uint8_t index ; / / index register <nl> - int32_t disp ; / / displacement / offset value <nl> - } sparc_op_mem ; <nl> - <nl> - / / Instruction operand <nl> - typedef struct cs_sparc_op <nl> - { <nl> - sparc_op_type type ; / / operand type <nl> - union <nl> - { <nl> - unsigned int reg ; / / register value for REG operand <nl> - int32_t imm ; / / immediate value for IMM operand <nl> - sparc_op_mem mem ; / / base / disp value for MEM operand <nl> - } ; <nl> - } cs_sparc_op ; <nl> - <nl> - / / Instruction structure <nl> - typedef struct cs_sparc <nl> - { <nl> - sparc_cc cc ; / / code condition for this insn <nl> - sparc_hint hint ; / / branch hint : encoding as bitwise OR of sparc_hint . <nl> - / / Number of operands of this instruction , <nl> - / / or 0 when instruction has no operand . <nl> - uint8_t op_count ; <nl> - cs_sparc_op operands [ 4 ] ; / / operands for this instruction . <nl> - } cs_sparc ; <nl> - <nl> - / / > SPARC registers <nl> - typedef enum sparc_reg <nl> - { <nl> - SPARC_REG_INVALID = 0 , <nl> - <nl> - SPARC_REG_F0 , <nl> - SPARC_REG_F1 , <nl> - SPARC_REG_F2 , <nl> - SPARC_REG_F3 , <nl> - SPARC_REG_F4 , <nl> - SPARC_REG_F5 , <nl> - SPARC_REG_F6 , <nl> - SPARC_REG_F7 , <nl> - SPARC_REG_F8 , <nl> - SPARC_REG_F9 , <nl> - SPARC_REG_F10 , <nl> - SPARC_REG_F11 , <nl> - SPARC_REG_F12 , <nl> - SPARC_REG_F13 , <nl> - SPARC_REG_F14 , <nl> - SPARC_REG_F15 , <nl> - SPARC_REG_F16 , <nl> - SPARC_REG_F17 , <nl> - SPARC_REG_F18 , <nl> - SPARC_REG_F19 , <nl> - SPARC_REG_F20 , <nl> - SPARC_REG_F21 , <nl> - SPARC_REG_F22 , <nl> - SPARC_REG_F23 , <nl> - SPARC_REG_F24 , <nl> - SPARC_REG_F25 , <nl> - SPARC_REG_F26 , <nl> - SPARC_REG_F27 , <nl> - SPARC_REG_F28 , <nl> - SPARC_REG_F29 , <nl> - SPARC_REG_F30 , <nl> - SPARC_REG_F31 , <nl> - SPARC_REG_F32 , <nl> - SPARC_REG_F34 , <nl> - SPARC_REG_F36 , <nl> - SPARC_REG_F38 , <nl> - SPARC_REG_F40 , <nl> - SPARC_REG_F42 , <nl> - SPARC_REG_F44 , <nl> - SPARC_REG_F46 , <nl> - SPARC_REG_F48 , <nl> - SPARC_REG_F50 , <nl> - SPARC_REG_F52 , <nl> - SPARC_REG_F54 , <nl> - SPARC_REG_F56 , <nl> - SPARC_REG_F58 , <nl> - SPARC_REG_F60 , <nl> - SPARC_REG_F62 , <nl> - SPARC_REG_FCC0 , / / Floating condition codes <nl> - SPARC_REG_FCC1 , <nl> - SPARC_REG_FCC2 , <nl> - SPARC_REG_FCC3 , <nl> - SPARC_REG_FP , <nl> - SPARC_REG_G0 , <nl> - SPARC_REG_G1 , <nl> - SPARC_REG_G2 , <nl> - SPARC_REG_G3 , <nl> - SPARC_REG_G4 , <nl> - SPARC_REG_G5 , <nl> - SPARC_REG_G6 , <nl> - SPARC_REG_G7 , <nl> - SPARC_REG_I0 , <nl> - SPARC_REG_I1 , <nl> - SPARC_REG_I2 , <nl> - SPARC_REG_I3 , <nl> - SPARC_REG_I4 , <nl> - SPARC_REG_I5 , <nl> - SPARC_REG_I7 , <nl> - SPARC_REG_ICC , / / Integer condition codes <nl> - SPARC_REG_L0 , <nl> - SPARC_REG_L1 , <nl> - SPARC_REG_L2 , <nl> - SPARC_REG_L3 , <nl> - SPARC_REG_L4 , <nl> - SPARC_REG_L5 , <nl> - SPARC_REG_L6 , <nl> - SPARC_REG_L7 , <nl> - SPARC_REG_O0 , <nl> - SPARC_REG_O1 , <nl> - SPARC_REG_O2 , <nl> - SPARC_REG_O3 , <nl> - SPARC_REG_O4 , <nl> - SPARC_REG_O5 , <nl> - SPARC_REG_O7 , <nl> - SPARC_REG_SP , <nl> - SPARC_REG_Y , <nl> - <nl> - / / special register <nl> - SPARC_REG_XCC , <nl> - <nl> - SPARC_REG_ENDING , / / < - - mark the end of the list of registers <nl> - <nl> - / / extras <nl> - SPARC_REG_O6 = SPARC_REG_SP , <nl> - SPARC_REG_I6 = SPARC_REG_FP , <nl> - } sparc_reg ; <nl> - <nl> - / / > SPARC instruction <nl> - typedef enum sparc_insn <nl> - { <nl> - SPARC_INS_INVALID = 0 , <nl> - <nl> - SPARC_INS_ADDCC , <nl> - SPARC_INS_ADDX , <nl> - SPARC_INS_ADDXCC , <nl> - SPARC_INS_ADDXC , <nl> - SPARC_INS_ADDXCCC , <nl> - SPARC_INS_ADD , <nl> - SPARC_INS_ALIGNADDR , <nl> - SPARC_INS_ALIGNADDRL , <nl> - SPARC_INS_ANDCC , <nl> - SPARC_INS_ANDNCC , <nl> - SPARC_INS_ANDN , <nl> - SPARC_INS_AND , <nl> - SPARC_INS_ARRAY16 , <nl> - SPARC_INS_ARRAY32 , <nl> - SPARC_INS_ARRAY8 , <nl> - SPARC_INS_B , <nl> - SPARC_INS_JMP , <nl> - SPARC_INS_BMASK , <nl> - SPARC_INS_FB , <nl> - SPARC_INS_BRGEZ , <nl> - SPARC_INS_BRGZ , <nl> - SPARC_INS_BRLEZ , <nl> - SPARC_INS_BRLZ , <nl> - SPARC_INS_BRNZ , <nl> - SPARC_INS_BRZ , <nl> - SPARC_INS_BSHUFFLE , <nl> - SPARC_INS_CALL , <nl> - SPARC_INS_CASX , <nl> - SPARC_INS_CAS , <nl> - SPARC_INS_CMASK16 , <nl> - SPARC_INS_CMASK32 , <nl> - SPARC_INS_CMASK8 , <nl> - SPARC_INS_CMP , <nl> - SPARC_INS_EDGE16 , <nl> - SPARC_INS_EDGE16L , <nl> - SPARC_INS_EDGE16LN , <nl> - SPARC_INS_EDGE16N , <nl> - SPARC_INS_EDGE32 , <nl> - SPARC_INS_EDGE32L , <nl> - SPARC_INS_EDGE32LN , <nl> - SPARC_INS_EDGE32N , <nl> - SPARC_INS_EDGE8 , <nl> - SPARC_INS_EDGE8L , <nl> - SPARC_INS_EDGE8LN , <nl> - SPARC_INS_EDGE8N , <nl> - SPARC_INS_FABSD , <nl> - SPARC_INS_FABSQ , <nl> - SPARC_INS_FABSS , <nl> - SPARC_INS_FADDD , <nl> - SPARC_INS_FADDQ , <nl> - SPARC_INS_FADDS , <nl> - SPARC_INS_FALIGNDATA , <nl> - SPARC_INS_FAND , <nl> - SPARC_INS_FANDNOT1 , <nl> - SPARC_INS_FANDNOT1S , <nl> - SPARC_INS_FANDNOT2 , <nl> - SPARC_INS_FANDNOT2S , <nl> - SPARC_INS_FANDS , <nl> - SPARC_INS_FCHKSM16 , <nl> - SPARC_INS_FCMPD , <nl> - SPARC_INS_FCMPEQ16 , <nl> - SPARC_INS_FCMPEQ32 , <nl> - SPARC_INS_FCMPGT16 , <nl> - SPARC_INS_FCMPGT32 , <nl> - SPARC_INS_FCMPLE16 , <nl> - SPARC_INS_FCMPLE32 , <nl> - SPARC_INS_FCMPNE16 , <nl> - SPARC_INS_FCMPNE32 , <nl> - SPARC_INS_FCMPQ , <nl> - SPARC_INS_FCMPS , <nl> - SPARC_INS_FDIVD , <nl> - SPARC_INS_FDIVQ , <nl> - SPARC_INS_FDIVS , <nl> - SPARC_INS_FDMULQ , <nl> - SPARC_INS_FDTOI , <nl> - SPARC_INS_FDTOQ , <nl> - SPARC_INS_FDTOS , <nl> - SPARC_INS_FDTOX , <nl> - SPARC_INS_FEXPAND , <nl> - SPARC_INS_FHADDD , <nl> - SPARC_INS_FHADDS , <nl> - SPARC_INS_FHSUBD , <nl> - SPARC_INS_FHSUBS , <nl> - SPARC_INS_FITOD , <nl> - SPARC_INS_FITOQ , <nl> - SPARC_INS_FITOS , <nl> - SPARC_INS_FLCMPD , <nl> - SPARC_INS_FLCMPS , <nl> - SPARC_INS_FLUSHW , <nl> - SPARC_INS_FMEAN16 , <nl> - SPARC_INS_FMOVD , <nl> - SPARC_INS_FMOVQ , <nl> - SPARC_INS_FMOVRDGEZ , <nl> - SPARC_INS_FMOVRQGEZ , <nl> - SPARC_INS_FMOVRSGEZ , <nl> - SPARC_INS_FMOVRDGZ , <nl> - SPARC_INS_FMOVRQGZ , <nl> - SPARC_INS_FMOVRSGZ , <nl> - SPARC_INS_FMOVRDLEZ , <nl> - SPARC_INS_FMOVRQLEZ , <nl> - SPARC_INS_FMOVRSLEZ , <nl> - SPARC_INS_FMOVRDLZ , <nl> - SPARC_INS_FMOVRQLZ , <nl> - SPARC_INS_FMOVRSLZ , <nl> - SPARC_INS_FMOVRDNZ , <nl> - SPARC_INS_FMOVRQNZ , <nl> - SPARC_INS_FMOVRSNZ , <nl> - SPARC_INS_FMOVRDZ , <nl> - SPARC_INS_FMOVRQZ , <nl> - SPARC_INS_FMOVRSZ , <nl> - SPARC_INS_FMOVS , <nl> - SPARC_INS_FMUL8SUX16 , <nl> - SPARC_INS_FMUL8ULX16 , <nl> - SPARC_INS_FMUL8X16 , <nl> - SPARC_INS_FMUL8X16AL , <nl> - SPARC_INS_FMUL8X16AU , <nl> - SPARC_INS_FMULD , <nl> - SPARC_INS_FMULD8SUX16 , <nl> - SPARC_INS_FMULD8ULX16 , <nl> - SPARC_INS_FMULQ , <nl> - SPARC_INS_FMULS , <nl> - SPARC_INS_FNADDD , <nl> - SPARC_INS_FNADDS , <nl> - SPARC_INS_FNAND , <nl> - SPARC_INS_FNANDS , <nl> - SPARC_INS_FNEGD , <nl> - SPARC_INS_FNEGQ , <nl> - SPARC_INS_FNEGS , <nl> - SPARC_INS_FNHADDD , <nl> - SPARC_INS_FNHADDS , <nl> - SPARC_INS_FNOR , <nl> - SPARC_INS_FNORS , <nl> - SPARC_INS_FNOT1 , <nl> - SPARC_INS_FNOT1S , <nl> - SPARC_INS_FNOT2 , <nl> - SPARC_INS_FNOT2S , <nl> - SPARC_INS_FONE , <nl> - SPARC_INS_FONES , <nl> - SPARC_INS_FOR , <nl> - SPARC_INS_FORNOT1 , <nl> - SPARC_INS_FORNOT1S , <nl> - SPARC_INS_FORNOT2 , <nl> - SPARC_INS_FORNOT2S , <nl> - SPARC_INS_FORS , <nl> - SPARC_INS_FPACK16 , <nl> - SPARC_INS_FPACK32 , <nl> - SPARC_INS_FPACKFIX , <nl> - SPARC_INS_FPADD16 , <nl> - SPARC_INS_FPADD16S , <nl> - SPARC_INS_FPADD32 , <nl> - SPARC_INS_FPADD32S , <nl> - SPARC_INS_FPADD64 , <nl> - SPARC_INS_FPMERGE , <nl> - SPARC_INS_FPSUB16 , <nl> - SPARC_INS_FPSUB16S , <nl> - SPARC_INS_FPSUB32 , <nl> - SPARC_INS_FPSUB32S , <nl> - SPARC_INS_FQTOD , <nl> - SPARC_INS_FQTOI , <nl> - SPARC_INS_FQTOS , <nl> - SPARC_INS_FQTOX , <nl> - SPARC_INS_FSLAS16 , <nl> - SPARC_INS_FSLAS32 , <nl> - SPARC_INS_FSLL16 , <nl> - SPARC_INS_FSLL32 , <nl> - SPARC_INS_FSMULD , <nl> - SPARC_INS_FSQRTD , <nl> - SPARC_INS_FSQRTQ , <nl> - SPARC_INS_FSQRTS , <nl> - SPARC_INS_FSRA16 , <nl> - SPARC_INS_FSRA32 , <nl> - SPARC_INS_FSRC1 , <nl> - SPARC_INS_FSRC1S , <nl> - SPARC_INS_FSRC2 , <nl> - SPARC_INS_FSRC2S , <nl> - SPARC_INS_FSRL16 , <nl> - SPARC_INS_FSRL32 , <nl> - SPARC_INS_FSTOD , <nl> - SPARC_INS_FSTOI , <nl> - SPARC_INS_FSTOQ , <nl> - SPARC_INS_FSTOX , <nl> - SPARC_INS_FSUBD , <nl> - SPARC_INS_FSUBQ , <nl> - SPARC_INS_FSUBS , <nl> - SPARC_INS_FXNOR , <nl> - SPARC_INS_FXNORS , <nl> - SPARC_INS_FXOR , <nl> - SPARC_INS_FXORS , <nl> - SPARC_INS_FXTOD , <nl> - SPARC_INS_FXTOQ , <nl> - SPARC_INS_FXTOS , <nl> - SPARC_INS_FZERO , <nl> - SPARC_INS_FZEROS , <nl> - SPARC_INS_JMPL , <nl> - SPARC_INS_LDD , <nl> - SPARC_INS_LD , <nl> - SPARC_INS_LDQ , <nl> - SPARC_INS_LDSB , <nl> - SPARC_INS_LDSH , <nl> - SPARC_INS_LDSW , <nl> - SPARC_INS_LDUB , <nl> - SPARC_INS_LDUH , <nl> - SPARC_INS_LDX , <nl> - SPARC_INS_LZCNT , <nl> - SPARC_INS_MEMBAR , <nl> - SPARC_INS_MOVDTOX , <nl> - SPARC_INS_MOV , <nl> - SPARC_INS_MOVRGEZ , <nl> - SPARC_INS_MOVRGZ , <nl> - SPARC_INS_MOVRLEZ , <nl> - SPARC_INS_MOVRLZ , <nl> - SPARC_INS_MOVRNZ , <nl> - SPARC_INS_MOVRZ , <nl> - SPARC_INS_MOVSTOSW , <nl> - SPARC_INS_MOVSTOUW , <nl> - SPARC_INS_MULX , <nl> - SPARC_INS_NOP , <nl> - SPARC_INS_ORCC , <nl> - SPARC_INS_ORNCC , <nl> - SPARC_INS_ORN , <nl> - SPARC_INS_OR , <nl> - SPARC_INS_PDIST , <nl> - SPARC_INS_PDISTN , <nl> - SPARC_INS_POPC , <nl> - SPARC_INS_RD , <nl> - SPARC_INS_RESTORE , <nl> - SPARC_INS_RETT , <nl> - SPARC_INS_SAVE , <nl> - SPARC_INS_SDIVCC , <nl> - SPARC_INS_SDIVX , <nl> - SPARC_INS_SDIV , <nl> - SPARC_INS_SETHI , <nl> - SPARC_INS_SHUTDOWN , <nl> - SPARC_INS_SIAM , <nl> - SPARC_INS_SLLX , <nl> - SPARC_INS_SLL , <nl> - SPARC_INS_SMULCC , <nl> - SPARC_INS_SMUL , <nl> - SPARC_INS_SRAX , <nl> - SPARC_INS_SRA , <nl> - SPARC_INS_SRLX , <nl> - SPARC_INS_SRL , <nl> - SPARC_INS_STBAR , <nl> - SPARC_INS_STB , <nl> - SPARC_INS_STD , <nl> - SPARC_INS_ST , <nl> - SPARC_INS_STH , <nl> - SPARC_INS_STQ , <nl> - SPARC_INS_STX , <nl> - SPARC_INS_SUBCC , <nl> - SPARC_INS_SUBX , <nl> - SPARC_INS_SUBXCC , <nl> - SPARC_INS_SUB , <nl> - SPARC_INS_SWAP , <nl> - SPARC_INS_TADDCCTV , <nl> - SPARC_INS_TADDCC , <nl> - SPARC_INS_T , <nl> - SPARC_INS_TSUBCCTV , <nl> - SPARC_INS_TSUBCC , <nl> - SPARC_INS_UDIVCC , <nl> - SPARC_INS_UDIVX , <nl> - SPARC_INS_UDIV , <nl> - SPARC_INS_UMULCC , <nl> - SPARC_INS_UMULXHI , <nl> - SPARC_INS_UMUL , <nl> - SPARC_INS_UNIMP , <nl> - SPARC_INS_FCMPED , <nl> - SPARC_INS_FCMPEQ , <nl> - SPARC_INS_FCMPES , <nl> - SPARC_INS_WR , <nl> - SPARC_INS_XMULX , <nl> - SPARC_INS_XMULXHI , <nl> - SPARC_INS_XNORCC , <nl> - SPARC_INS_XNOR , <nl> - SPARC_INS_XORCC , <nl> - SPARC_INS_XOR , <nl> - <nl> - / / alias instructions <nl> - SPARC_INS_RET , <nl> - SPARC_INS_RETL , <nl> - <nl> - SPARC_INS_ENDING , / / < - - mark the end of the list of instructions <nl> - } sparc_insn ; <nl> - <nl> - / / > Group of SPARC instructions <nl> - typedef enum sparc_insn_group <nl> - { <nl> - SPARC_GRP_INVALID = 0 , / / = CS_GRP_INVALID <nl> - <nl> - / / > Generic groups <nl> - / / all jump instructions ( conditional + direct + indirect jumps ) <nl> - SPARC_GRP_JUMP , / / = CS_GRP_JUMP <nl> - <nl> - / / > Architecture - specific groups <nl> - SPARC_GRP_HARDQUAD = 128 , <nl> - SPARC_GRP_V9 , <nl> - SPARC_GRP_VIS , <nl> - SPARC_GRP_VIS2 , <nl> - SPARC_GRP_VIS3 , <nl> - SPARC_GRP_32BIT , <nl> - SPARC_GRP_64BIT , <nl> - <nl> - SPARC_GRP_ENDING , / / < - - mark the end of the list of groups <nl> - } sparc_insn_group ; <nl> - <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> - <nl> - # endif <nl> deleted file mode 100644 <nl> index 0db8cc244 . . 000000000 <nl> mmm a / src / dbg / capstone / systemz . h <nl> ppp / dev / null <nl> <nl> - # ifndef CAPSTONE_SYSTEMZ_H <nl> - # define CAPSTONE_SYSTEMZ_H <nl> - <nl> - / * Capstone Disassembly Engine * / <nl> - / * By Nguyen Anh Quynh < aquynh @ gmail . com > , 2014 * / <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - <nl> - # include < stdint . h > <nl> - # include " platform . h " <nl> - <nl> - # ifdef _MSC_VER <nl> - # pragma warning ( disable : 4201 ) <nl> - # endif <nl> - <nl> - / / > Enums corresponding to SystemZ condition codes <nl> - typedef enum sysz_cc <nl> - { <nl> - SYSZ_CC_INVALID = 0 , / / invalid CC ( default ) <nl> - <nl> - SYSZ_CC_O , <nl> - SYSZ_CC_H , <nl> - SYSZ_CC_NLE , <nl> - SYSZ_CC_L , <nl> - SYSZ_CC_NHE , <nl> - SYSZ_CC_LH , <nl> - SYSZ_CC_NE , <nl> - SYSZ_CC_E , <nl> - SYSZ_CC_NLH , <nl> - SYSZ_CC_HE , <nl> - SYSZ_CC_NL , <nl> - SYSZ_CC_LE , <nl> - SYSZ_CC_NH , <nl> - SYSZ_CC_NO , <nl> - } sysz_cc ; <nl> - <nl> - / / > Operand type for instruction ' s operands <nl> - typedef enum sysz_op_type <nl> - { <nl> - SYSZ_OP_INVALID = 0 , / / = CS_OP_INVALID ( Uninitialized ) . <nl> - SYSZ_OP_REG , / / = CS_OP_REG ( Register operand ) . <nl> - SYSZ_OP_IMM , / / = CS_OP_IMM ( Immediate operand ) . <nl> - SYSZ_OP_MEM , / / = CS_OP_MEM ( Memory operand ) . <nl> - SYSZ_OP_ACREG = 64 , / / Access register operand . <nl> - } sysz_op_type ; <nl> - <nl> - / / Instruction ' s operand referring to memory <nl> - / / This is associated with SYSZ_OP_MEM operand type above <nl> - typedef struct sysz_op_mem <nl> - { <nl> - uint8_t base ; / / base register <nl> - uint8_t index ; / / index register <nl> - uint64_t length ; / / BDLAddr operand <nl> - int64_t disp ; / / displacement / offset value <nl> - } sysz_op_mem ; <nl> - <nl> - / / Instruction operand <nl> - typedef struct cs_sysz_op <nl> - { <nl> - sysz_op_type type ; / / operand type <nl> - union <nl> - { <nl> - unsigned int reg ; / / register value for REG operand <nl> - int64_t imm ; / / immediate value for IMM operand <nl> - sysz_op_mem mem ; / / base / disp value for MEM operand <nl> - } ; <nl> - } cs_sysz_op ; <nl> - <nl> - / / Instruction structure <nl> - typedef struct cs_sysz <nl> - { <nl> - sysz_cc cc ; / / Code condition <nl> - / / Number of operands of this instruction , <nl> - / / or 0 when instruction has no operand . <nl> - uint8_t op_count ; <nl> - cs_sysz_op operands [ 6 ] ; / / operands for this instruction . <nl> - } cs_sysz ; <nl> - <nl> - / / > SystemZ registers <nl> - typedef enum sysz_reg <nl> - { <nl> - SYSZ_REG_INVALID = 0 , <nl> - <nl> - SYSZ_REG_0 , <nl> - SYSZ_REG_1 , <nl> - SYSZ_REG_2 , <nl> - SYSZ_REG_3 , <nl> - SYSZ_REG_4 , <nl> - SYSZ_REG_5 , <nl> - SYSZ_REG_6 , <nl> - SYSZ_REG_7 , <nl> - SYSZ_REG_8 , <nl> - SYSZ_REG_9 , <nl> - SYSZ_REG_10 , <nl> - SYSZ_REG_11 , <nl> - SYSZ_REG_12 , <nl> - SYSZ_REG_13 , <nl> - SYSZ_REG_14 , <nl> - SYSZ_REG_15 , <nl> - SYSZ_REG_CC , <nl> - SYSZ_REG_F0 , <nl> - SYSZ_REG_F1 , <nl> - SYSZ_REG_F2 , <nl> - SYSZ_REG_F3 , <nl> - SYSZ_REG_F4 , <nl> - SYSZ_REG_F5 , <nl> - SYSZ_REG_F6 , <nl> - SYSZ_REG_F7 , <nl> - SYSZ_REG_F8 , <nl> - SYSZ_REG_F9 , <nl> - SYSZ_REG_F10 , <nl> - SYSZ_REG_F11 , <nl> - SYSZ_REG_F12 , <nl> - SYSZ_REG_F13 , <nl> - SYSZ_REG_F14 , <nl> - SYSZ_REG_F15 , <nl> - <nl> - SYSZ_REG_R0L , <nl> - <nl> - SYSZ_REG_ENDING , <nl> - } sysz_reg ; <nl> - <nl> - / / > SystemZ instruction <nl> - typedef enum sysz_insn <nl> - { <nl> - SYSZ_INS_INVALID = 0 , <nl> - <nl> - SYSZ_INS_A , <nl> - SYSZ_INS_ADB , <nl> - SYSZ_INS_ADBR , <nl> - SYSZ_INS_AEB , <nl> - SYSZ_INS_AEBR , <nl> - SYSZ_INS_AFI , <nl> - SYSZ_INS_AG , <nl> - SYSZ_INS_AGF , <nl> - SYSZ_INS_AGFI , <nl> - SYSZ_INS_AGFR , <nl> - SYSZ_INS_AGHI , <nl> - SYSZ_INS_AGHIK , <nl> - SYSZ_INS_AGR , <nl> - SYSZ_INS_AGRK , <nl> - SYSZ_INS_AGSI , <nl> - SYSZ_INS_AH , <nl> - SYSZ_INS_AHI , <nl> - SYSZ_INS_AHIK , <nl> - SYSZ_INS_AHY , <nl> - SYSZ_INS_AIH , <nl> - SYSZ_INS_AL , <nl> - SYSZ_INS_ALC , <nl> - SYSZ_INS_ALCG , <nl> - SYSZ_INS_ALCGR , <nl> - SYSZ_INS_ALCR , <nl> - SYSZ_INS_ALFI , <nl> - SYSZ_INS_ALG , <nl> - SYSZ_INS_ALGF , <nl> - SYSZ_INS_ALGFI , <nl> - SYSZ_INS_ALGFR , <nl> - SYSZ_INS_ALGHSIK , <nl> - SYSZ_INS_ALGR , <nl> - SYSZ_INS_ALGRK , <nl> - SYSZ_INS_ALHSIK , <nl> - SYSZ_INS_ALR , <nl> - SYSZ_INS_ALRK , <nl> - SYSZ_INS_ALY , <nl> - SYSZ_INS_AR , <nl> - SYSZ_INS_ARK , <nl> - SYSZ_INS_ASI , <nl> - SYSZ_INS_AXBR , <nl> - SYSZ_INS_AY , <nl> - SYSZ_INS_BCR , <nl> - SYSZ_INS_BRC , <nl> - SYSZ_INS_BRCL , <nl> - SYSZ_INS_CGIJ , <nl> - SYSZ_INS_CGRJ , <nl> - SYSZ_INS_CIJ , <nl> - SYSZ_INS_CLGIJ , <nl> - SYSZ_INS_CLGRJ , <nl> - SYSZ_INS_CLIJ , <nl> - SYSZ_INS_CLRJ , <nl> - SYSZ_INS_CRJ , <nl> - SYSZ_INS_BER , <nl> - SYSZ_INS_JE , <nl> - SYSZ_INS_JGE , <nl> - SYSZ_INS_LOCE , <nl> - SYSZ_INS_LOCGE , <nl> - SYSZ_INS_LOCGRE , <nl> - SYSZ_INS_LOCRE , <nl> - SYSZ_INS_STOCE , <nl> - SYSZ_INS_STOCGE , <nl> - SYSZ_INS_BHR , <nl> - SYSZ_INS_BHER , <nl> - SYSZ_INS_JHE , <nl> - SYSZ_INS_JGHE , <nl> - SYSZ_INS_LOCHE , <nl> - SYSZ_INS_LOCGHE , <nl> - SYSZ_INS_LOCGRHE , <nl> - SYSZ_INS_LOCRHE , <nl> - SYSZ_INS_STOCHE , <nl> - SYSZ_INS_STOCGHE , <nl> - SYSZ_INS_JH , <nl> - SYSZ_INS_JGH , <nl> - SYSZ_INS_LOCH , <nl> - SYSZ_INS_LOCGH , <nl> - SYSZ_INS_LOCGRH , <nl> - SYSZ_INS_LOCRH , <nl> - SYSZ_INS_STOCH , <nl> - SYSZ_INS_STOCGH , <nl> - SYSZ_INS_CGIJNLH , <nl> - SYSZ_INS_CGRJNLH , <nl> - SYSZ_INS_CIJNLH , <nl> - SYSZ_INS_CLGIJNLH , <nl> - SYSZ_INS_CLGRJNLH , <nl> - SYSZ_INS_CLIJNLH , <nl> - SYSZ_INS_CLRJNLH , <nl> - SYSZ_INS_CRJNLH , <nl> - SYSZ_INS_CGIJE , <nl> - SYSZ_INS_CGRJE , <nl> - SYSZ_INS_CIJE , <nl> - SYSZ_INS_CLGIJE , <nl> - SYSZ_INS_CLGRJE , <nl> - SYSZ_INS_CLIJE , <nl> - SYSZ_INS_CLRJE , <nl> - SYSZ_INS_CRJE , <nl> - SYSZ_INS_CGIJNLE , <nl> - SYSZ_INS_CGRJNLE , <nl> - SYSZ_INS_CIJNLE , <nl> - SYSZ_INS_CLGIJNLE , <nl> - SYSZ_INS_CLGRJNLE , <nl> - SYSZ_INS_CLIJNLE , <nl> - SYSZ_INS_CLRJNLE , <nl> - SYSZ_INS_CRJNLE , <nl> - SYSZ_INS_CGIJH , <nl> - SYSZ_INS_CGRJH , <nl> - SYSZ_INS_CIJH , <nl> - SYSZ_INS_CLGIJH , <nl> - SYSZ_INS_CLGRJH , <nl> - SYSZ_INS_CLIJH , <nl> - SYSZ_INS_CLRJH , <nl> - SYSZ_INS_CRJH , <nl> - SYSZ_INS_CGIJNL , <nl> - SYSZ_INS_CGRJNL , <nl> - SYSZ_INS_CIJNL , <nl> - SYSZ_INS_CLGIJNL , <nl> - SYSZ_INS_CLGRJNL , <nl> - SYSZ_INS_CLIJNL , <nl> - SYSZ_INS_CLRJNL , <nl> - SYSZ_INS_CRJNL , <nl> - SYSZ_INS_CGIJHE , <nl> - SYSZ_INS_CGRJHE , <nl> - SYSZ_INS_CIJHE , <nl> - SYSZ_INS_CLGIJHE , <nl> - SYSZ_INS_CLGRJHE , <nl> - SYSZ_INS_CLIJHE , <nl> - SYSZ_INS_CLRJHE , <nl> - SYSZ_INS_CRJHE , <nl> - SYSZ_INS_CGIJNHE , <nl> - SYSZ_INS_CGRJNHE , <nl> - SYSZ_INS_CIJNHE , <nl> - SYSZ_INS_CLGIJNHE , <nl> - SYSZ_INS_CLGRJNHE , <nl> - SYSZ_INS_CLIJNHE , <nl> - SYSZ_INS_CLRJNHE , <nl> - SYSZ_INS_CRJNHE , <nl> - SYSZ_INS_CGIJL , <nl> - SYSZ_INS_CGRJL , <nl> - SYSZ_INS_CIJL , <nl> - SYSZ_INS_CLGIJL , <nl> - SYSZ_INS_CLGRJL , <nl> - SYSZ_INS_CLIJL , <nl> - SYSZ_INS_CLRJL , <nl> - SYSZ_INS_CRJL , <nl> - SYSZ_INS_CGIJNH , <nl> - SYSZ_INS_CGRJNH , <nl> - SYSZ_INS_CIJNH , <nl> - SYSZ_INS_CLGIJNH , <nl> - SYSZ_INS_CLGRJNH , <nl> - SYSZ_INS_CLIJNH , <nl> - SYSZ_INS_CLRJNH , <nl> - SYSZ_INS_CRJNH , <nl> - SYSZ_INS_CGIJLE , <nl> - SYSZ_INS_CGRJLE , <nl> - SYSZ_INS_CIJLE , <nl> - SYSZ_INS_CLGIJLE , <nl> - SYSZ_INS_CLGRJLE , <nl> - SYSZ_INS_CLIJLE , <nl> - SYSZ_INS_CLRJLE , <nl> - SYSZ_INS_CRJLE , <nl> - SYSZ_INS_CGIJNE , <nl> - SYSZ_INS_CGRJNE , <nl> - SYSZ_INS_CIJNE , <nl> - SYSZ_INS_CLGIJNE , <nl> - SYSZ_INS_CLGRJNE , <nl> - SYSZ_INS_CLIJNE , <nl> - SYSZ_INS_CLRJNE , <nl> - SYSZ_INS_CRJNE , <nl> - SYSZ_INS_CGIJLH , <nl> - SYSZ_INS_CGRJLH , <nl> - SYSZ_INS_CIJLH , <nl> - SYSZ_INS_CLGIJLH , <nl> - SYSZ_INS_CLGRJLH , <nl> - SYSZ_INS_CLIJLH , <nl> - SYSZ_INS_CLRJLH , <nl> - SYSZ_INS_CRJLH , <nl> - SYSZ_INS_BLR , <nl> - SYSZ_INS_BLER , <nl> - SYSZ_INS_JLE , <nl> - SYSZ_INS_JGLE , <nl> - SYSZ_INS_LOCLE , <nl> - SYSZ_INS_LOCGLE , <nl> - SYSZ_INS_LOCGRLE , <nl> - SYSZ_INS_LOCRLE , <nl> - SYSZ_INS_STOCLE , <nl> - SYSZ_INS_STOCGLE , <nl> - SYSZ_INS_BLHR , <nl> - SYSZ_INS_JLH , <nl> - SYSZ_INS_JGLH , <nl> - SYSZ_INS_LOCLH , <nl> - SYSZ_INS_LOCGLH , <nl> - SYSZ_INS_LOCGRLH , <nl> - SYSZ_INS_LOCRLH , <nl> - SYSZ_INS_STOCLH , <nl> - SYSZ_INS_STOCGLH , <nl> - SYSZ_INS_JL , <nl> - SYSZ_INS_JGL , <nl> - SYSZ_INS_LOCL , <nl> - SYSZ_INS_LOCGL , <nl> - SYSZ_INS_LOCGRL , <nl> - SYSZ_INS_LOCRL , <nl> - SYSZ_INS_LOC , <nl> - SYSZ_INS_LOCG , <nl> - SYSZ_INS_LOCGR , <nl> - SYSZ_INS_LOCR , <nl> - SYSZ_INS_STOCL , <nl> - SYSZ_INS_STOCGL , <nl> - SYSZ_INS_BNER , <nl> - SYSZ_INS_JNE , <nl> - SYSZ_INS_JGNE , <nl> - SYSZ_INS_LOCNE , <nl> - SYSZ_INS_LOCGNE , <nl> - SYSZ_INS_LOCGRNE , <nl> - SYSZ_INS_LOCRNE , <nl> - SYSZ_INS_STOCNE , <nl> - SYSZ_INS_STOCGNE , <nl> - SYSZ_INS_BNHR , <nl> - SYSZ_INS_BNHER , <nl> - SYSZ_INS_JNHE , <nl> - SYSZ_INS_JGNHE , <nl> - SYSZ_INS_LOCNHE , <nl> - SYSZ_INS_LOCGNHE , <nl> - SYSZ_INS_LOCGRNHE , <nl> - SYSZ_INS_LOCRNHE , <nl> - SYSZ_INS_STOCNHE , <nl> - SYSZ_INS_STOCGNHE , <nl> - SYSZ_INS_JNH , <nl> - SYSZ_INS_JGNH , <nl> - SYSZ_INS_LOCNH , <nl> - SYSZ_INS_LOCGNH , <nl> - SYSZ_INS_LOCGRNH , <nl> - SYSZ_INS_LOCRNH , <nl> - SYSZ_INS_STOCNH , <nl> - SYSZ_INS_STOCGNH , <nl> - SYSZ_INS_BNLR , <nl> - SYSZ_INS_BNLER , <nl> - SYSZ_INS_JNLE , <nl> - SYSZ_INS_JGNLE , <nl> - SYSZ_INS_LOCNLE , <nl> - SYSZ_INS_LOCGNLE , <nl> - SYSZ_INS_LOCGRNLE , <nl> - SYSZ_INS_LOCRNLE , <nl> - SYSZ_INS_STOCNLE , <nl> - SYSZ_INS_STOCGNLE , <nl> - SYSZ_INS_BNLHR , <nl> - SYSZ_INS_JNLH , <nl> - SYSZ_INS_JGNLH , <nl> - SYSZ_INS_LOCNLH , <nl> - SYSZ_INS_LOCGNLH , <nl> - SYSZ_INS_LOCGRNLH , <nl> - SYSZ_INS_LOCRNLH , <nl> - SYSZ_INS_STOCNLH , <nl> - SYSZ_INS_STOCGNLH , <nl> - SYSZ_INS_JNL , <nl> - SYSZ_INS_JGNL , <nl> - SYSZ_INS_LOCNL , <nl> - SYSZ_INS_LOCGNL , <nl> - SYSZ_INS_LOCGRNL , <nl> - SYSZ_INS_LOCRNL , <nl> - SYSZ_INS_STOCNL , <nl> - SYSZ_INS_STOCGNL , <nl> - SYSZ_INS_BNOR , <nl> - SYSZ_INS_JNO , <nl> - SYSZ_INS_JGNO , <nl> - SYSZ_INS_LOCNO , <nl> - SYSZ_INS_LOCGNO , <nl> - SYSZ_INS_LOCGRNO , <nl> - SYSZ_INS_LOCRNO , <nl> - SYSZ_INS_STOCNO , <nl> - SYSZ_INS_STOCGNO , <nl> - SYSZ_INS_BOR , <nl> - SYSZ_INS_JO , <nl> - SYSZ_INS_JGO , <nl> - SYSZ_INS_LOCO , <nl> - SYSZ_INS_LOCGO , <nl> - SYSZ_INS_LOCGRO , <nl> - SYSZ_INS_LOCRO , <nl> - SYSZ_INS_STOCO , <nl> - SYSZ_INS_STOCGO , <nl> - SYSZ_INS_STOC , <nl> - SYSZ_INS_STOCG , <nl> - SYSZ_INS_BASR , <nl> - SYSZ_INS_BR , <nl> - SYSZ_INS_BRAS , <nl> - SYSZ_INS_BRASL , <nl> - SYSZ_INS_J , <nl> - SYSZ_INS_JG , <nl> - SYSZ_INS_BRCT , <nl> - SYSZ_INS_BRCTG , <nl> - SYSZ_INS_C , <nl> - SYSZ_INS_CDB , <nl> - SYSZ_INS_CDBR , <nl> - SYSZ_INS_CDFBR , <nl> - SYSZ_INS_CDGBR , <nl> - SYSZ_INS_CDLFBR , <nl> - SYSZ_INS_CDLGBR , <nl> - SYSZ_INS_CEB , <nl> - SYSZ_INS_CEBR , <nl> - SYSZ_INS_CEFBR , <nl> - SYSZ_INS_CEGBR , <nl> - SYSZ_INS_CELFBR , <nl> - SYSZ_INS_CELGBR , <nl> - SYSZ_INS_CFDBR , <nl> - SYSZ_INS_CFEBR , <nl> - SYSZ_INS_CFI , <nl> - SYSZ_INS_CFXBR , <nl> - SYSZ_INS_CG , <nl> - SYSZ_INS_CGDBR , <nl> - SYSZ_INS_CGEBR , <nl> - SYSZ_INS_CGF , <nl> - SYSZ_INS_CGFI , <nl> - SYSZ_INS_CGFR , <nl> - SYSZ_INS_CGFRL , <nl> - SYSZ_INS_CGH , <nl> - SYSZ_INS_CGHI , <nl> - SYSZ_INS_CGHRL , <nl> - SYSZ_INS_CGHSI , <nl> - SYSZ_INS_CGR , <nl> - SYSZ_INS_CGRL , <nl> - SYSZ_INS_CGXBR , <nl> - SYSZ_INS_CH , <nl> - SYSZ_INS_CHF , <nl> - SYSZ_INS_CHHSI , <nl> - SYSZ_INS_CHI , <nl> - SYSZ_INS_CHRL , <nl> - SYSZ_INS_CHSI , <nl> - SYSZ_INS_CHY , <nl> - SYSZ_INS_CIH , <nl> - SYSZ_INS_CL , <nl> - SYSZ_INS_CLC , <nl> - SYSZ_INS_CLFDBR , <nl> - SYSZ_INS_CLFEBR , <nl> - SYSZ_INS_CLFHSI , <nl> - SYSZ_INS_CLFI , <nl> - SYSZ_INS_CLFXBR , <nl> - SYSZ_INS_CLG , <nl> - SYSZ_INS_CLGDBR , <nl> - SYSZ_INS_CLGEBR , <nl> - SYSZ_INS_CLGF , <nl> - SYSZ_INS_CLGFI , <nl> - SYSZ_INS_CLGFR , <nl> - SYSZ_INS_CLGFRL , <nl> - SYSZ_INS_CLGHRL , <nl> - SYSZ_INS_CLGHSI , <nl> - SYSZ_INS_CLGR , <nl> - SYSZ_INS_CLGRL , <nl> - SYSZ_INS_CLGXBR , <nl> - SYSZ_INS_CLHF , <nl> - SYSZ_INS_CLHHSI , <nl> - SYSZ_INS_CLHRL , <nl> - SYSZ_INS_CLI , <nl> - SYSZ_INS_CLIH , <nl> - SYSZ_INS_CLIY , <nl> - SYSZ_INS_CLR , <nl> - SYSZ_INS_CLRL , <nl> - SYSZ_INS_CLST , <nl> - SYSZ_INS_CLY , <nl> - SYSZ_INS_CPSDR , <nl> - SYSZ_INS_CR , <nl> - SYSZ_INS_CRL , <nl> - SYSZ_INS_CS , <nl> - SYSZ_INS_CSG , <nl> - SYSZ_INS_CSY , <nl> - SYSZ_INS_CXBR , <nl> - SYSZ_INS_CXFBR , <nl> - SYSZ_INS_CXGBR , <nl> - SYSZ_INS_CXLFBR , <nl> - SYSZ_INS_CXLGBR , <nl> - SYSZ_INS_CY , <nl> - SYSZ_INS_DDB , <nl> - SYSZ_INS_DDBR , <nl> - SYSZ_INS_DEB , <nl> - SYSZ_INS_DEBR , <nl> - SYSZ_INS_DL , <nl> - SYSZ_INS_DLG , <nl> - SYSZ_INS_DLGR , <nl> - SYSZ_INS_DLR , <nl> - SYSZ_INS_DSG , <nl> - SYSZ_INS_DSGF , <nl> - SYSZ_INS_DSGFR , <nl> - SYSZ_INS_DSGR , <nl> - SYSZ_INS_DXBR , <nl> - SYSZ_INS_EAR , <nl> - SYSZ_INS_FIDBR , <nl> - SYSZ_INS_FIDBRA , <nl> - SYSZ_INS_FIEBR , <nl> - SYSZ_INS_FIEBRA , <nl> - SYSZ_INS_FIXBR , <nl> - SYSZ_INS_FIXBRA , <nl> - SYSZ_INS_FLOGR , <nl> - SYSZ_INS_IC , <nl> - SYSZ_INS_ICY , <nl> - SYSZ_INS_IIHF , <nl> - SYSZ_INS_IIHH , <nl> - SYSZ_INS_IIHL , <nl> - SYSZ_INS_IILF , <nl> - SYSZ_INS_IILH , <nl> - SYSZ_INS_IILL , <nl> - SYSZ_INS_IPM , <nl> - SYSZ_INS_L , <nl> - SYSZ_INS_LA , <nl> - SYSZ_INS_LAA , <nl> - SYSZ_INS_LAAG , <nl> - SYSZ_INS_LAAL , <nl> - SYSZ_INS_LAALG , <nl> - SYSZ_INS_LAN , <nl> - SYSZ_INS_LANG , <nl> - SYSZ_INS_LAO , <nl> - SYSZ_INS_LAOG , <nl> - SYSZ_INS_LARL , <nl> - SYSZ_INS_LAX , <nl> - SYSZ_INS_LAXG , <nl> - SYSZ_INS_LAY , <nl> - SYSZ_INS_LB , <nl> - SYSZ_INS_LBH , <nl> - SYSZ_INS_LBR , <nl> - SYSZ_INS_LCDBR , <nl> - SYSZ_INS_LCEBR , <nl> - SYSZ_INS_LCGFR , <nl> - SYSZ_INS_LCGR , <nl> - SYSZ_INS_LCR , <nl> - SYSZ_INS_LCXBR , <nl> - SYSZ_INS_LD , <nl> - SYSZ_INS_LDEB , <nl> - SYSZ_INS_LDEBR , <nl> - SYSZ_INS_LDGR , <nl> - SYSZ_INS_LDR , <nl> - SYSZ_INS_LDXBR , <nl> - SYSZ_INS_LDXBRA , <nl> - SYSZ_INS_LDY , <nl> - SYSZ_INS_LE , <nl> - SYSZ_INS_LEDBR , <nl> - SYSZ_INS_LEDBRA , <nl> - SYSZ_INS_LER , <nl> - SYSZ_INS_LEXBR , <nl> - SYSZ_INS_LEXBRA , <nl> - SYSZ_INS_LEY , <nl> - SYSZ_INS_LFH , <nl> - SYSZ_INS_LG , <nl> - SYSZ_INS_LGB , <nl> - SYSZ_INS_LGBR , <nl> - SYSZ_INS_LGDR , <nl> - SYSZ_INS_LGF , <nl> - SYSZ_INS_LGFI , <nl> - SYSZ_INS_LGFR , <nl> - SYSZ_INS_LGFRL , <nl> - SYSZ_INS_LGH , <nl> - SYSZ_INS_LGHI , <nl> - SYSZ_INS_LGHR , <nl> - SYSZ_INS_LGHRL , <nl> - SYSZ_INS_LGR , <nl> - SYSZ_INS_LGRL , <nl> - SYSZ_INS_LH , <nl> - SYSZ_INS_LHH , <nl> - SYSZ_INS_LHI , <nl> - SYSZ_INS_LHR , <nl> - SYSZ_INS_LHRL , <nl> - SYSZ_INS_LHY , <nl> - SYSZ_INS_LLC , <nl> - SYSZ_INS_LLCH , <nl> - SYSZ_INS_LLCR , <nl> - SYSZ_INS_LLGC , <nl> - SYSZ_INS_LLGCR , <nl> - SYSZ_INS_LLGF , <nl> - SYSZ_INS_LLGFR , <nl> - SYSZ_INS_LLGFRL , <nl> - SYSZ_INS_LLGH , <nl> - SYSZ_INS_LLGHR , <nl> - SYSZ_INS_LLGHRL , <nl> - SYSZ_INS_LLH , <nl> - SYSZ_INS_LLHH , <nl> - SYSZ_INS_LLHR , <nl> - SYSZ_INS_LLHRL , <nl> - SYSZ_INS_LLIHF , <nl> - SYSZ_INS_LLIHH , <nl> - SYSZ_INS_LLIHL , <nl> - SYSZ_INS_LLILF , <nl> - SYSZ_INS_LLILH , <nl> - SYSZ_INS_LLILL , <nl> - SYSZ_INS_LMG , <nl> - SYSZ_INS_LNDBR , <nl> - SYSZ_INS_LNEBR , <nl> - SYSZ_INS_LNGFR , <nl> - SYSZ_INS_LNGR , <nl> - SYSZ_INS_LNR , <nl> - SYSZ_INS_LNXBR , <nl> - SYSZ_INS_LPDBR , <nl> - SYSZ_INS_LPEBR , <nl> - SYSZ_INS_LPGFR , <nl> - SYSZ_INS_LPGR , <nl> - SYSZ_INS_LPR , <nl> - SYSZ_INS_LPXBR , <nl> - SYSZ_INS_LR , <nl> - SYSZ_INS_LRL , <nl> - SYSZ_INS_LRV , <nl> - SYSZ_INS_LRVG , <nl> - SYSZ_INS_LRVGR , <nl> - SYSZ_INS_LRVR , <nl> - SYSZ_INS_LT , <nl> - SYSZ_INS_LTDBR , <nl> - SYSZ_INS_LTEBR , <nl> - SYSZ_INS_LTG , <nl> - SYSZ_INS_LTGF , <nl> - SYSZ_INS_LTGFR , <nl> - SYSZ_INS_LTGR , <nl> - SYSZ_INS_LTR , <nl> - SYSZ_INS_LTXBR , <nl> - SYSZ_INS_LXDB , <nl> - SYSZ_INS_LXDBR , <nl> - SYSZ_INS_LXEB , <nl> - SYSZ_INS_LXEBR , <nl> - SYSZ_INS_LXR , <nl> - SYSZ_INS_LY , <nl> - SYSZ_INS_LZDR , <nl> - SYSZ_INS_LZER , <nl> - SYSZ_INS_LZXR , <nl> - SYSZ_INS_MADB , <nl> - SYSZ_INS_MADBR , <nl> - SYSZ_INS_MAEB , <nl> - SYSZ_INS_MAEBR , <nl> - SYSZ_INS_MDB , <nl> - SYSZ_INS_MDBR , <nl> - SYSZ_INS_MDEB , <nl> - SYSZ_INS_MDEBR , <nl> - SYSZ_INS_MEEB , <nl> - SYSZ_INS_MEEBR , <nl> - SYSZ_INS_MGHI , <nl> - SYSZ_INS_MH , <nl> - SYSZ_INS_MHI , <nl> - SYSZ_INS_MHY , <nl> - SYSZ_INS_MLG , <nl> - SYSZ_INS_MLGR , <nl> - SYSZ_INS_MS , <nl> - SYSZ_INS_MSDB , <nl> - SYSZ_INS_MSDBR , <nl> - SYSZ_INS_MSEB , <nl> - SYSZ_INS_MSEBR , <nl> - SYSZ_INS_MSFI , <nl> - SYSZ_INS_MSG , <nl> - SYSZ_INS_MSGF , <nl> - SYSZ_INS_MSGFI , <nl> - SYSZ_INS_MSGFR , <nl> - SYSZ_INS_MSGR , <nl> - SYSZ_INS_MSR , <nl> - SYSZ_INS_MSY , <nl> - SYSZ_INS_MVC , <nl> - SYSZ_INS_MVGHI , <nl> - SYSZ_INS_MVHHI , <nl> - SYSZ_INS_MVHI , <nl> - SYSZ_INS_MVI , <nl> - SYSZ_INS_MVIY , <nl> - SYSZ_INS_MVST , <nl> - SYSZ_INS_MXBR , <nl> - SYSZ_INS_MXDB , <nl> - SYSZ_INS_MXDBR , <nl> - SYSZ_INS_N , <nl> - SYSZ_INS_NC , <nl> - SYSZ_INS_NG , <nl> - SYSZ_INS_NGR , <nl> - SYSZ_INS_NGRK , <nl> - SYSZ_INS_NI , <nl> - SYSZ_INS_NIHF , <nl> - SYSZ_INS_NIHH , <nl> - SYSZ_INS_NIHL , <nl> - SYSZ_INS_NILF , <nl> - SYSZ_INS_NILH , <nl> - SYSZ_INS_NILL , <nl> - SYSZ_INS_NIY , <nl> - SYSZ_INS_NR , <nl> - SYSZ_INS_NRK , <nl> - SYSZ_INS_NY , <nl> - SYSZ_INS_O , <nl> - SYSZ_INS_OC , <nl> - SYSZ_INS_OG , <nl> - SYSZ_INS_OGR , <nl> - SYSZ_INS_OGRK , <nl> - SYSZ_INS_OI , <nl> - SYSZ_INS_OIHF , <nl> - SYSZ_INS_OIHH , <nl> - SYSZ_INS_OIHL , <nl> - SYSZ_INS_OILF , <nl> - SYSZ_INS_OILH , <nl> - SYSZ_INS_OILL , <nl> - SYSZ_INS_OIY , <nl> - SYSZ_INS_OR , <nl> - SYSZ_INS_ORK , <nl> - SYSZ_INS_OY , <nl> - SYSZ_INS_PFD , <nl> - SYSZ_INS_PFDRL , <nl> - SYSZ_INS_RISBG , <nl> - SYSZ_INS_RISBHG , <nl> - SYSZ_INS_RISBLG , <nl> - SYSZ_INS_RLL , <nl> - SYSZ_INS_RLLG , <nl> - SYSZ_INS_RNSBG , <nl> - SYSZ_INS_ROSBG , <nl> - SYSZ_INS_RXSBG , <nl> - SYSZ_INS_S , <nl> - SYSZ_INS_SDB , <nl> - SYSZ_INS_SDBR , <nl> - SYSZ_INS_SEB , <nl> - SYSZ_INS_SEBR , <nl> - SYSZ_INS_SG , <nl> - SYSZ_INS_SGF , <nl> - SYSZ_INS_SGFR , <nl> - SYSZ_INS_SGR , <nl> - SYSZ_INS_SGRK , <nl> - SYSZ_INS_SH , <nl> - SYSZ_INS_SHY , <nl> - SYSZ_INS_SL , <nl> - SYSZ_INS_SLB , <nl> - SYSZ_INS_SLBG , <nl> - SYSZ_INS_SLBR , <nl> - SYSZ_INS_SLFI , <nl> - SYSZ_INS_SLG , <nl> - SYSZ_INS_SLBGR , <nl> - SYSZ_INS_SLGF , <nl> - SYSZ_INS_SLGFI , <nl> - SYSZ_INS_SLGFR , <nl> - SYSZ_INS_SLGR , <nl> - SYSZ_INS_SLGRK , <nl> - SYSZ_INS_SLL , <nl> - SYSZ_INS_SLLG , <nl> - SYSZ_INS_SLLK , <nl> - SYSZ_INS_SLR , <nl> - SYSZ_INS_SLRK , <nl> - SYSZ_INS_SLY , <nl> - SYSZ_INS_SQDB , <nl> - SYSZ_INS_SQDBR , <nl> - SYSZ_INS_SQEB , <nl> - SYSZ_INS_SQEBR , <nl> - SYSZ_INS_SQXBR , <nl> - SYSZ_INS_SR , <nl> - SYSZ_INS_SRA , <nl> - SYSZ_INS_SRAG , <nl> - SYSZ_INS_SRAK , <nl> - SYSZ_INS_SRK , <nl> - SYSZ_INS_SRL , <nl> - SYSZ_INS_SRLG , <nl> - SYSZ_INS_SRLK , <nl> - SYSZ_INS_SRST , <nl> - SYSZ_INS_ST , <nl> - SYSZ_INS_STC , <nl> - SYSZ_INS_STCH , <nl> - SYSZ_INS_STCY , <nl> - SYSZ_INS_STD , <nl> - SYSZ_INS_STDY , <nl> - SYSZ_INS_STE , <nl> - SYSZ_INS_STEY , <nl> - SYSZ_INS_STFH , <nl> - SYSZ_INS_STG , <nl> - SYSZ_INS_STGRL , <nl> - SYSZ_INS_STH , <nl> - SYSZ_INS_STHH , <nl> - SYSZ_INS_STHRL , <nl> - SYSZ_INS_STHY , <nl> - SYSZ_INS_STMG , <nl> - SYSZ_INS_STRL , <nl> - SYSZ_INS_STRV , <nl> - SYSZ_INS_STRVG , <nl> - SYSZ_INS_STY , <nl> - SYSZ_INS_SXBR , <nl> - SYSZ_INS_SY , <nl> - SYSZ_INS_TM , <nl> - SYSZ_INS_TMHH , <nl> - SYSZ_INS_TMHL , <nl> - SYSZ_INS_TMLH , <nl> - SYSZ_INS_TMLL , <nl> - SYSZ_INS_TMY , <nl> - SYSZ_INS_X , <nl> - SYSZ_INS_XC , <nl> - SYSZ_INS_XG , <nl> - SYSZ_INS_XGR , <nl> - SYSZ_INS_XGRK , <nl> - SYSZ_INS_XI , <nl> - SYSZ_INS_XIHF , <nl> - SYSZ_INS_XILF , <nl> - SYSZ_INS_XIY , <nl> - SYSZ_INS_XR , <nl> - SYSZ_INS_XRK , <nl> - SYSZ_INS_XY , <nl> - <nl> - SYSZ_INS_ENDING , / / < - - mark the end of the list of instructions <nl> - } sysz_insn ; <nl> - <nl> - / / > Group of SystemZ instructions <nl> - typedef enum sysz_insn_group <nl> - { <nl> - SYSZ_GRP_INVALID = 0 , / / = CS_GRP_INVALID <nl> - <nl> - / / > Generic groups <nl> - / / all jump instructions ( conditional + direct + indirect jumps ) <nl> - SYSZ_GRP_JUMP , / / = CS_GRP_JUMP <nl> - <nl> - / / > Architecture - specific groups <nl> - SYSZ_GRP_DISTINCTOPS = 128 , <nl> - SYSZ_GRP_FPEXTENSION , <nl> - SYSZ_GRP_HIGHWORD , <nl> - SYSZ_GRP_INTERLOCKEDACCESS1 , <nl> - SYSZ_GRP_LOADSTOREONCOND , <nl> - <nl> - SYSZ_GRP_ENDING , / / < - - mark the end of the list of groups <nl> - } sysz_insn_group ; <nl> - <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> - <nl> - # endif <nl> deleted file mode 100644 <nl> index cb083b1a0 . . 000000000 <nl> mmm a / src / dbg / capstone / x86 . h <nl> ppp / dev / null <nl> <nl> - # ifndef CAPSTONE_X86_H <nl> - # define CAPSTONE_X86_H <nl> - <nl> - / * Capstone Disassembly Engine * / <nl> - / * By Nguyen Anh Quynh < aquynh @ gmail . com > , 2013 - 2014 * / <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - <nl> - # include < stdint . h > <nl> - <nl> - / / Calculate relative address for X86 - 64 , given cs_insn structure <nl> - # define X86_REL_ADDR ( insn ) ( insn . address + insn . size + insn . detail - > x86 . disp ) <nl> - <nl> - / / > X86 registers <nl> - typedef enum x86_reg <nl> - { <nl> - X86_REG_INVALID = 0 , <nl> - X86_REG_AH , X86_REG_AL , X86_REG_AX , X86_REG_BH , X86_REG_BL , <nl> - X86_REG_BP , X86_REG_BPL , X86_REG_BX , X86_REG_CH , X86_REG_CL , <nl> - X86_REG_CS , X86_REG_CX , X86_REG_DH , X86_REG_DI , X86_REG_DIL , <nl> - X86_REG_DL , X86_REG_DS , X86_REG_DX , X86_REG_EAX , X86_REG_EBP , <nl> - X86_REG_EBX , X86_REG_ECX , X86_REG_EDI , X86_REG_EDX , X86_REG_EFLAGS , <nl> - X86_REG_EIP , X86_REG_EIZ , X86_REG_ES , X86_REG_ESI , X86_REG_ESP , <nl> - X86_REG_FPSW , X86_REG_FS , X86_REG_GS , X86_REG_IP , X86_REG_RAX , <nl> - X86_REG_RBP , X86_REG_RBX , X86_REG_RCX , X86_REG_RDI , X86_REG_RDX , <nl> - X86_REG_RIP , X86_REG_RIZ , X86_REG_RSI , X86_REG_RSP , X86_REG_SI , <nl> - X86_REG_SIL , X86_REG_SP , X86_REG_SPL , X86_REG_SS , X86_REG_CR0 , <nl> - X86_REG_CR1 , X86_REG_CR2 , X86_REG_CR3 , X86_REG_CR4 , X86_REG_CR5 , <nl> - X86_REG_CR6 , X86_REG_CR7 , X86_REG_CR8 , X86_REG_CR9 , X86_REG_CR10 , <nl> - X86_REG_CR11 , X86_REG_CR12 , X86_REG_CR13 , X86_REG_CR14 , X86_REG_CR15 , <nl> - X86_REG_DR0 , X86_REG_DR1 , X86_REG_DR2 , X86_REG_DR3 , X86_REG_DR4 , <nl> - X86_REG_DR5 , X86_REG_DR6 , X86_REG_DR7 , X86_REG_FP0 , X86_REG_FP1 , <nl> - X86_REG_FP2 , X86_REG_FP3 , X86_REG_FP4 , X86_REG_FP5 , X86_REG_FP6 , X86_REG_FP7 , <nl> - X86_REG_K0 , X86_REG_K1 , X86_REG_K2 , X86_REG_K3 , X86_REG_K4 , <nl> - X86_REG_K5 , X86_REG_K6 , X86_REG_K7 , X86_REG_MM0 , X86_REG_MM1 , <nl> - X86_REG_MM2 , X86_REG_MM3 , X86_REG_MM4 , X86_REG_MM5 , X86_REG_MM6 , <nl> - X86_REG_MM7 , X86_REG_R8 , X86_REG_R9 , X86_REG_R10 , X86_REG_R11 , <nl> - X86_REG_R12 , X86_REG_R13 , X86_REG_R14 , X86_REG_R15 , <nl> - X86_REG_ST0 , X86_REG_ST1 , X86_REG_ST2 , X86_REG_ST3 , <nl> - X86_REG_ST4 , X86_REG_ST5 , X86_REG_ST6 , X86_REG_ST7 , <nl> - X86_REG_XMM0 , X86_REG_XMM1 , X86_REG_XMM2 , X86_REG_XMM3 , X86_REG_XMM4 , <nl> - X86_REG_XMM5 , X86_REG_XMM6 , X86_REG_XMM7 , X86_REG_XMM8 , X86_REG_XMM9 , <nl> - X86_REG_XMM10 , X86_REG_XMM11 , X86_REG_XMM12 , X86_REG_XMM13 , X86_REG_XMM14 , <nl> - X86_REG_XMM15 , X86_REG_XMM16 , X86_REG_XMM17 , X86_REG_XMM18 , X86_REG_XMM19 , <nl> - X86_REG_XMM20 , X86_REG_XMM21 , X86_REG_XMM22 , X86_REG_XMM23 , X86_REG_XMM24 , <nl> - X86_REG_XMM25 , X86_REG_XMM26 , X86_REG_XMM27 , X86_REG_XMM28 , X86_REG_XMM29 , <nl> - X86_REG_XMM30 , X86_REG_XMM31 , X86_REG_YMM0 , X86_REG_YMM1 , X86_REG_YMM2 , <nl> - X86_REG_YMM3 , X86_REG_YMM4 , X86_REG_YMM5 , X86_REG_YMM6 , X86_REG_YMM7 , <nl> - X86_REG_YMM8 , X86_REG_YMM9 , X86_REG_YMM10 , X86_REG_YMM11 , X86_REG_YMM12 , <nl> - X86_REG_YMM13 , X86_REG_YMM14 , X86_REG_YMM15 , X86_REG_YMM16 , X86_REG_YMM17 , <nl> - X86_REG_YMM18 , X86_REG_YMM19 , X86_REG_YMM20 , X86_REG_YMM21 , X86_REG_YMM22 , <nl> - X86_REG_YMM23 , X86_REG_YMM24 , X86_REG_YMM25 , X86_REG_YMM26 , X86_REG_YMM27 , <nl> - X86_REG_YMM28 , X86_REG_YMM29 , X86_REG_YMM30 , X86_REG_YMM31 , X86_REG_ZMM0 , <nl> - X86_REG_ZMM1 , X86_REG_ZMM2 , X86_REG_ZMM3 , X86_REG_ZMM4 , X86_REG_ZMM5 , <nl> - X86_REG_ZMM6 , X86_REG_ZMM7 , X86_REG_ZMM8 , X86_REG_ZMM9 , X86_REG_ZMM10 , <nl> - X86_REG_ZMM11 , X86_REG_ZMM12 , X86_REG_ZMM13 , X86_REG_ZMM14 , X86_REG_ZMM15 , <nl> - X86_REG_ZMM16 , X86_REG_ZMM17 , X86_REG_ZMM18 , X86_REG_ZMM19 , X86_REG_ZMM20 , <nl> - X86_REG_ZMM21 , X86_REG_ZMM22 , X86_REG_ZMM23 , X86_REG_ZMM24 , X86_REG_ZMM25 , <nl> - X86_REG_ZMM26 , X86_REG_ZMM27 , X86_REG_ZMM28 , X86_REG_ZMM29 , X86_REG_ZMM30 , <nl> - X86_REG_ZMM31 , X86_REG_R8B , X86_REG_R9B , X86_REG_R10B , X86_REG_R11B , <nl> - X86_REG_R12B , X86_REG_R13B , X86_REG_R14B , X86_REG_R15B , X86_REG_R8D , <nl> - X86_REG_R9D , X86_REG_R10D , X86_REG_R11D , X86_REG_R12D , X86_REG_R13D , <nl> - X86_REG_R14D , X86_REG_R15D , X86_REG_R8W , X86_REG_R9W , X86_REG_R10W , <nl> - X86_REG_R11W , X86_REG_R12W , X86_REG_R13W , X86_REG_R14W , X86_REG_R15W , <nl> - <nl> - X86_REG_ENDING / / < - - mark the end of the list of registers <nl> - } x86_reg ; <nl> - <nl> - / / > Operand type for instruction ' s operands <nl> - typedef enum x86_op_type <nl> - { <nl> - X86_OP_INVALID = 0 , / / = CS_OP_INVALID ( Uninitialized ) . <nl> - X86_OP_REG , / / = CS_OP_REG ( Register operand ) . <nl> - X86_OP_IMM , / / = CS_OP_IMM ( Immediate operand ) . <nl> - X86_OP_MEM , / / = CS_OP_MEM ( Memory operand ) . <nl> - X86_OP_FP , / / = CS_OP_FP ( Floating - Point operand ) . <nl> - } x86_op_type ; <nl> - <nl> - / / > AVX broadcast type <nl> - typedef enum x86_avx_bcast <nl> - { <nl> - X86_AVX_BCAST_INVALID = 0 , / / Uninitialized . <nl> - X86_AVX_BCAST_2 , / / AVX512 broadcast type { 1to2 } <nl> - X86_AVX_BCAST_4 , / / AVX512 broadcast type { 1to4 } <nl> - X86_AVX_BCAST_8 , / / AVX512 broadcast type { 1to8 } <nl> - X86_AVX_BCAST_16 , / / AVX512 broadcast type { 1to16 } <nl> - } x86_avx_bcast ; <nl> - <nl> - / / > SSE Code Condition type <nl> - typedef enum x86_sse_cc <nl> - { <nl> - X86_SSE_CC_INVALID = 0 , / / Uninitialized . <nl> - X86_SSE_CC_EQ , <nl> - X86_SSE_CC_LT , <nl> - X86_SSE_CC_LE , <nl> - X86_SSE_CC_UNORD , <nl> - X86_SSE_CC_NEQ , <nl> - X86_SSE_CC_NLT , <nl> - X86_SSE_CC_NLE , <nl> - X86_SSE_CC_ORD , <nl> - X86_SSE_CC_EQ_UQ , <nl> - X86_SSE_CC_NGE , <nl> - X86_SSE_CC_NGT , <nl> - X86_SSE_CC_FALSE , <nl> - X86_SSE_CC_NEQ_OQ , <nl> - X86_SSE_CC_GE , <nl> - X86_SSE_CC_GT , <nl> - X86_SSE_CC_TRUE , <nl> - } x86_sse_cc ; <nl> - <nl> - / / > AVX Code Condition type <nl> - typedef enum x86_avx_cc <nl> - { <nl> - X86_AVX_CC_INVALID = 0 , / / Uninitialized . <nl> - X86_AVX_CC_EQ , <nl> - X86_AVX_CC_LT , <nl> - X86_AVX_CC_LE , <nl> - X86_AVX_CC_UNORD , <nl> - X86_AVX_CC_NEQ , <nl> - X86_AVX_CC_NLT , <nl> - X86_AVX_CC_NLE , <nl> - X86_AVX_CC_ORD , <nl> - X86_AVX_CC_EQ_UQ , <nl> - X86_AVX_CC_NGE , <nl> - X86_AVX_CC_NGT , <nl> - X86_AVX_CC_FALSE , <nl> - X86_AVX_CC_NEQ_OQ , <nl> - X86_AVX_CC_GE , <nl> - X86_AVX_CC_GT , <nl> - X86_AVX_CC_TRUE , <nl> - X86_AVX_CC_EQ_OS , <nl> - X86_AVX_CC_LT_OQ , <nl> - X86_AVX_CC_LE_OQ , <nl> - X86_AVX_CC_UNORD_S , <nl> - X86_AVX_CC_NEQ_US , <nl> - X86_AVX_CC_NLT_UQ , <nl> - X86_AVX_CC_NLE_UQ , <nl> - X86_AVX_CC_ORD_S , <nl> - X86_AVX_CC_EQ_US , <nl> - X86_AVX_CC_NGE_UQ , <nl> - X86_AVX_CC_NGT_UQ , <nl> - X86_AVX_CC_FALSE_OS , <nl> - X86_AVX_CC_NEQ_OS , <nl> - X86_AVX_CC_GE_OQ , <nl> - X86_AVX_CC_GT_OQ , <nl> - X86_AVX_CC_TRUE_US , <nl> - } x86_avx_cc ; <nl> - <nl> - / / > AVX static rounding mode type <nl> - typedef enum x86_avx_rm <nl> - { <nl> - X86_AVX_RM_INVALID = 0 , / / Uninitialized . <nl> - X86_AVX_RM_RN , / / Round to nearest <nl> - X86_AVX_RM_RD , / / Round down <nl> - X86_AVX_RM_RU , / / Round up <nl> - X86_AVX_RM_RZ , / / Round toward zero <nl> - } x86_avx_rm ; <nl> - <nl> - / / > Instruction prefixes - to be used in cs_x86 . prefix [ ] <nl> - typedef enum x86_prefix <nl> - { <nl> - X86_PREFIX_LOCK = 0xf0 , / / lock ( cs_x86 . prefix [ 0 ] <nl> - X86_PREFIX_REP = 0xf3 , / / rep ( cs_x86 . prefix [ 0 ] <nl> - X86_PREFIX_REPNE = 0xf2 , / / repne ( cs_x86 . prefix [ 0 ] <nl> - <nl> - X86_PREFIX_CS = 0x2e , / / segment override CS ( cs_x86 . prefix [ 1 ] <nl> - X86_PREFIX_SS = 0x36 , / / segment override SS ( cs_x86 . prefix [ 1 ] <nl> - X86_PREFIX_DS = 0x3e , / / segment override DS ( cs_x86 . prefix [ 1 ] <nl> - X86_PREFIX_ES = 0x26 , / / segment override ES ( cs_x86 . prefix [ 1 ] <nl> - X86_PREFIX_FS = 0x64 , / / segment override FS ( cs_x86 . prefix [ 1 ] <nl> - X86_PREFIX_GS = 0x65 , / / segment override GS ( cs_x86 . prefix [ 1 ] <nl> - <nl> - X86_PREFIX_OPSIZE = 0x66 , / / operand - size override ( cs_x86 . prefix [ 2 ] <nl> - X86_PREFIX_ADDRSIZE = 0x67 , / / address - size override ( cs_x86 . prefix [ 3 ] <nl> - } x86_prefix ; <nl> - <nl> - / / Instruction ' s operand referring to memory <nl> - / / This is associated with X86_OP_MEM operand type above <nl> - typedef struct x86_op_mem <nl> - { <nl> - unsigned int segment ; / / segment register ( or X86_REG_INVALID if irrelevant ) <nl> - unsigned int base ; / / base register ( or X86_REG_INVALID if irrelevant ) <nl> - unsigned int index ; / / index register ( or X86_REG_INVALID if irrelevant ) <nl> - int scale ; / / scale for index register <nl> - int64_t disp ; / / displacement value <nl> - } x86_op_mem ; <nl> - <nl> - / / Instruction operand <nl> - typedef struct cs_x86_op <nl> - { <nl> - x86_op_type type ; / / operand type <nl> - union <nl> - { <nl> - x86_reg reg ; / / register value for REG operand <nl> - int64_t imm ; / / immediate value for IMM operand <nl> - double fp ; / / floating point value for FP operand <nl> - x86_op_mem mem ; / / base / index / scale / disp value for MEM operand <nl> - } ; <nl> - <nl> - / / size of this operand ( in bytes ) . <nl> - uint8_t size ; <nl> - <nl> - / / AVX broadcast type , or 0 if irrelevant <nl> - x86_avx_bcast avx_bcast ; <nl> - <nl> - / / AVX zero opmask { z } <nl> - bool avx_zero_opmask ; <nl> - } cs_x86_op ; <nl> - <nl> - / / Instruction structure <nl> - typedef struct cs_x86 <nl> - { <nl> - / / Instruction prefix , which can be up to 4 bytes . <nl> - / / A prefix byte gets value 0 when irrelevant . <nl> - / / prefix [ 0 ] indicates REP / REPNE / LOCK prefix ( See X86_PREFIX_REP / REPNE / LOCK above ) <nl> - / / prefix [ 1 ] indicates segment override ( irrelevant for x86_64 ) : <nl> - / / See X86_PREFIX_CS / SS / DS / ES / FS / GS above . <nl> - / / prefix [ 2 ] indicates operand - size override ( X86_PREFIX_OPSIZE ) <nl> - / / prefix [ 3 ] indicates address - size override ( X86_PREFIX_ADDRSIZE ) <nl> - uint8_t prefix [ 4 ] ; <nl> - <nl> - / / Instruction opcode , wich can be from 1 to 4 bytes in size . <nl> - / / This contains VEX opcode as well . <nl> - / / An trailing opcode byte gets value 0 when irrelevant . <nl> - uint8_t opcode [ 4 ] ; <nl> - <nl> - / / REX prefix : only a non - zero value is relavant for x86_64 <nl> - uint8_t rex ; <nl> - <nl> - / / Address size , which can be overrided with above prefix [ 5 ] . <nl> - uint8_t addr_size ; <nl> - <nl> - / / ModR / M byte <nl> - uint8_t modrm ; <nl> - <nl> - / / SIB value , or 0 when irrelevant . <nl> - uint8_t sib ; <nl> - <nl> - / / Displacement value , or 0 when irrelevant . <nl> - int32_t disp ; <nl> - <nl> - / * SIB state * / <nl> - / / SIB index register , or X86_REG_INVALID when irrelevant . <nl> - x86_reg sib_index ; <nl> - / / SIB scale . only applicable if sib_index is relavant . <nl> - int8_t sib_scale ; <nl> - / / SIB base register , or X86_REG_INVALID when irrelevant . <nl> - x86_reg sib_base ; <nl> - <nl> - / / SSE Code Condition <nl> - x86_sse_cc sse_cc ; <nl> - <nl> - / / AVX Code Condition <nl> - x86_avx_cc avx_cc ; <nl> - <nl> - / / AVX Suppress all Exception <nl> - bool avx_sae ; <nl> - <nl> - / / AVX static rounding mode <nl> - x86_avx_rm avx_rm ; <nl> - <nl> - / / Number of operands of this instruction , <nl> - / / or 0 when instruction has no operand . <nl> - uint8_t op_count ; <nl> - <nl> - cs_x86_op operands [ 8 ] ; / / operands for this instruction . <nl> - } cs_x86 ; <nl> - <nl> - / / > X86 instructions <nl> - typedef enum x86_insn <nl> - { <nl> - X86_INS_INVALID = 0 , <nl> - <nl> - X86_INS_AAA , <nl> - X86_INS_AAD , <nl> - X86_INS_AAM , <nl> - X86_INS_AAS , <nl> - X86_INS_FABS , <nl> - X86_INS_ADC , <nl> - X86_INS_ADCX , <nl> - X86_INS_ADD , <nl> - X86_INS_ADDPD , <nl> - X86_INS_ADDPS , <nl> - X86_INS_ADDSD , <nl> - X86_INS_ADDSS , <nl> - X86_INS_ADDSUBPD , <nl> - X86_INS_ADDSUBPS , <nl> - X86_INS_FADD , <nl> - X86_INS_FIADD , <nl> - X86_INS_FADDP , <nl> - X86_INS_ADOX , <nl> - X86_INS_AESDECLAST , <nl> - X86_INS_AESDEC , <nl> - X86_INS_AESENCLAST , <nl> - X86_INS_AESENC , <nl> - X86_INS_AESIMC , <nl> - X86_INS_AESKEYGENASSIST , <nl> - X86_INS_AND , <nl> - X86_INS_ANDN , <nl> - X86_INS_ANDNPD , <nl> - X86_INS_ANDNPS , <nl> - X86_INS_ANDPD , <nl> - X86_INS_ANDPS , <nl> - X86_INS_ARPL , <nl> - X86_INS_BEXTR , <nl> - X86_INS_BLCFILL , <nl> - X86_INS_BLCI , <nl> - X86_INS_BLCIC , <nl> - X86_INS_BLCMSK , <nl> - X86_INS_BLCS , <nl> - X86_INS_BLENDPD , <nl> - X86_INS_BLENDPS , <nl> - X86_INS_BLENDVPD , <nl> - X86_INS_BLENDVPS , <nl> - X86_INS_BLSFILL , <nl> - X86_INS_BLSI , <nl> - X86_INS_BLSIC , <nl> - X86_INS_BLSMSK , <nl> - X86_INS_BLSR , <nl> - X86_INS_BOUND , <nl> - X86_INS_BSF , <nl> - X86_INS_BSR , <nl> - X86_INS_BSWAP , <nl> - X86_INS_BT , <nl> - X86_INS_BTC , <nl> - X86_INS_BTR , <nl> - X86_INS_BTS , <nl> - X86_INS_BZHI , <nl> - X86_INS_CALL , <nl> - X86_INS_CBW , <nl> - X86_INS_CDQ , <nl> - X86_INS_CDQE , <nl> - X86_INS_FCHS , <nl> - X86_INS_CLAC , <nl> - X86_INS_CLC , <nl> - X86_INS_CLD , <nl> - X86_INS_CLFLUSH , <nl> - X86_INS_CLGI , <nl> - X86_INS_CLI , <nl> - X86_INS_CLTS , <nl> - X86_INS_CMC , <nl> - X86_INS_CMOVA , <nl> - X86_INS_CMOVAE , <nl> - X86_INS_CMOVB , <nl> - X86_INS_CMOVBE , <nl> - X86_INS_FCMOVBE , <nl> - X86_INS_FCMOVB , <nl> - X86_INS_CMOVE , <nl> - X86_INS_FCMOVE , <nl> - X86_INS_CMOVG , <nl> - X86_INS_CMOVGE , <nl> - X86_INS_CMOVL , <nl> - X86_INS_CMOVLE , <nl> - X86_INS_FCMOVNBE , <nl> - X86_INS_FCMOVNB , <nl> - X86_INS_CMOVNE , <nl> - X86_INS_FCMOVNE , <nl> - X86_INS_CMOVNO , <nl> - X86_INS_CMOVNP , <nl> - X86_INS_FCMOVNU , <nl> - X86_INS_CMOVNS , <nl> - X86_INS_CMOVO , <nl> - X86_INS_CMOVP , <nl> - X86_INS_FCMOVU , <nl> - X86_INS_CMOVS , <nl> - X86_INS_CMP , <nl> - X86_INS_CMPPD , <nl> - X86_INS_CMPPS , <nl> - X86_INS_CMPSB , <nl> - X86_INS_CMPSD , <nl> - X86_INS_CMPSQ , <nl> - X86_INS_CMPSS , <nl> - X86_INS_CMPSW , <nl> - X86_INS_CMPXCHG16B , <nl> - X86_INS_CMPXCHG , <nl> - X86_INS_CMPXCHG8B , <nl> - X86_INS_COMISD , <nl> - X86_INS_COMISS , <nl> - X86_INS_FCOMP , <nl> - X86_INS_FCOMPI , <nl> - X86_INS_FCOMI , <nl> - X86_INS_FCOM , <nl> - X86_INS_FCOS , <nl> - X86_INS_CPUID , <nl> - X86_INS_CQO , <nl> - X86_INS_CRC32 , <nl> - X86_INS_CVTDQ2PD , <nl> - X86_INS_CVTDQ2PS , <nl> - X86_INS_CVTPD2DQ , <nl> - X86_INS_CVTPD2PS , <nl> - X86_INS_CVTPS2DQ , <nl> - X86_INS_CVTPS2PD , <nl> - X86_INS_CVTSD2SI , <nl> - X86_INS_CVTSD2SS , <nl> - X86_INS_CVTSI2SD , <nl> - X86_INS_CVTSI2SS , <nl> - X86_INS_CVTSS2SD , <nl> - X86_INS_CVTSS2SI , <nl> - X86_INS_CVTTPD2DQ , <nl> - X86_INS_CVTTPS2DQ , <nl> - X86_INS_CVTTSD2SI , <nl> - X86_INS_CVTTSS2SI , <nl> - X86_INS_CWD , <nl> - X86_INS_CWDE , <nl> - X86_INS_DAA , <nl> - X86_INS_DAS , <nl> - X86_INS_DATA16 , <nl> - X86_INS_DEC , <nl> - X86_INS_DIV , <nl> - X86_INS_DIVPD , <nl> - X86_INS_DIVPS , <nl> - X86_INS_FDIVR , <nl> - X86_INS_FIDIVR , <nl> - X86_INS_FDIVRP , <nl> - X86_INS_DIVSD , <nl> - X86_INS_DIVSS , <nl> - X86_INS_FDIV , <nl> - X86_INS_FIDIV , <nl> - X86_INS_FDIVP , <nl> - X86_INS_DPPD , <nl> - X86_INS_DPPS , <nl> - X86_INS_RET , <nl> - X86_INS_ENCLS , <nl> - X86_INS_ENCLU , <nl> - X86_INS_ENTER , <nl> - X86_INS_EXTRACTPS , <nl> - X86_INS_EXTRQ , <nl> - X86_INS_F2XM1 , <nl> - X86_INS_LCALL , <nl> - X86_INS_LJMP , <nl> - X86_INS_FBLD , <nl> - X86_INS_FBSTP , <nl> - X86_INS_FCOMPP , <nl> - X86_INS_FDECSTP , <nl> - X86_INS_FEMMS , <nl> - X86_INS_FFREE , <nl> - X86_INS_FICOM , <nl> - X86_INS_FICOMP , <nl> - X86_INS_FINCSTP , <nl> - X86_INS_FLDCW , <nl> - X86_INS_FLDENV , <nl> - X86_INS_FLDL2E , <nl> - X86_INS_FLDL2T , <nl> - X86_INS_FLDLG2 , <nl> - X86_INS_FLDLN2 , <nl> - X86_INS_FLDPI , <nl> - X86_INS_FNCLEX , <nl> - X86_INS_FNINIT , <nl> - X86_INS_FNOP , <nl> - X86_INS_FNSTCW , <nl> - X86_INS_FNSTSW , <nl> - X86_INS_FPATAN , <nl> - X86_INS_FPREM , <nl> - X86_INS_FPREM1 , <nl> - X86_INS_FPTAN , <nl> - X86_INS_FRNDINT , <nl> - X86_INS_FRSTOR , <nl> - X86_INS_FNSAVE , <nl> - X86_INS_FSCALE , <nl> - X86_INS_FSETPM , <nl> - X86_INS_FSINCOS , <nl> - X86_INS_FNSTENV , <nl> - X86_INS_FXAM , <nl> - X86_INS_FXRSTOR , <nl> - X86_INS_FXRSTOR64 , <nl> - X86_INS_FXSAVE , <nl> - X86_INS_FXSAVE64 , <nl> - X86_INS_FXTRACT , <nl> - X86_INS_FYL2X , <nl> - X86_INS_FYL2XP1 , <nl> - X86_INS_MOVAPD , <nl> - X86_INS_MOVAPS , <nl> - X86_INS_ORPD , <nl> - X86_INS_ORPS , <nl> - X86_INS_VMOVAPD , <nl> - X86_INS_VMOVAPS , <nl> - X86_INS_XORPD , <nl> - X86_INS_XORPS , <nl> - X86_INS_GETSEC , <nl> - X86_INS_HADDPD , <nl> - X86_INS_HADDPS , <nl> - X86_INS_HLT , <nl> - X86_INS_HSUBPD , <nl> - X86_INS_HSUBPS , <nl> - X86_INS_IDIV , <nl> - X86_INS_FILD , <nl> - X86_INS_IMUL , <nl> - X86_INS_IN , <nl> - X86_INS_INC , <nl> - X86_INS_INSB , <nl> - X86_INS_INSERTPS , <nl> - X86_INS_INSERTQ , <nl> - X86_INS_INSD , <nl> - X86_INS_INSW , <nl> - X86_INS_INT , <nl> - X86_INS_INT1 , <nl> - X86_INS_INT3 , <nl> - X86_INS_INTO , <nl> - X86_INS_INVD , <nl> - X86_INS_INVEPT , <nl> - X86_INS_INVLPG , <nl> - X86_INS_INVLPGA , <nl> - X86_INS_INVPCID , <nl> - X86_INS_INVVPID , <nl> - X86_INS_IRET , <nl> - X86_INS_IRETD , <nl> - X86_INS_IRETQ , <nl> - X86_INS_FISTTP , <nl> - X86_INS_FIST , <nl> - X86_INS_FISTP , <nl> - X86_INS_UCOMISD , <nl> - X86_INS_UCOMISS , <nl> - X86_INS_VCMP , <nl> - X86_INS_VCOMISD , <nl> - X86_INS_VCOMISS , <nl> - X86_INS_VCVTSD2SS , <nl> - X86_INS_VCVTSI2SD , <nl> - X86_INS_VCVTSI2SS , <nl> - X86_INS_VCVTSS2SD , <nl> - X86_INS_VCVTTSD2SI , <nl> - X86_INS_VCVTTSD2USI , <nl> - X86_INS_VCVTTSS2SI , <nl> - X86_INS_VCVTTSS2USI , <nl> - X86_INS_VCVTUSI2SD , <nl> - X86_INS_VCVTUSI2SS , <nl> - X86_INS_VUCOMISD , <nl> - X86_INS_VUCOMISS , <nl> - X86_INS_JAE , <nl> - X86_INS_JA , <nl> - X86_INS_JBE , <nl> - X86_INS_JB , <nl> - X86_INS_JCXZ , <nl> - X86_INS_JECXZ , <nl> - X86_INS_JE , <nl> - X86_INS_JGE , <nl> - X86_INS_JG , <nl> - X86_INS_JLE , <nl> - X86_INS_JL , <nl> - X86_INS_JMP , <nl> - X86_INS_JNE , <nl> - X86_INS_JNO , <nl> - X86_INS_JNP , <nl> - X86_INS_JNS , <nl> - X86_INS_JO , <nl> - X86_INS_JP , <nl> - X86_INS_JRCXZ , <nl> - X86_INS_JS , <nl> - X86_INS_KANDB , <nl> - X86_INS_KANDD , <nl> - X86_INS_KANDNB , <nl> - X86_INS_KANDND , <nl> - X86_INS_KANDNQ , <nl> - X86_INS_KANDNW , <nl> - X86_INS_KANDQ , <nl> - X86_INS_KANDW , <nl> - X86_INS_KMOVB , <nl> - X86_INS_KMOVD , <nl> - X86_INS_KMOVQ , <nl> - X86_INS_KMOVW , <nl> - X86_INS_KNOTB , <nl> - X86_INS_KNOTD , <nl> - X86_INS_KNOTQ , <nl> - X86_INS_KNOTW , <nl> - X86_INS_KORB , <nl> - X86_INS_KORD , <nl> - X86_INS_KORQ , <nl> - X86_INS_KORTESTW , <nl> - X86_INS_KORW , <nl> - X86_INS_KSHIFTLW , <nl> - X86_INS_KSHIFTRW , <nl> - X86_INS_KUNPCKBW , <nl> - X86_INS_KXNORB , <nl> - X86_INS_KXNORD , <nl> - X86_INS_KXNORQ , <nl> - X86_INS_KXNORW , <nl> - X86_INS_KXORB , <nl> - X86_INS_KXORD , <nl> - X86_INS_KXORQ , <nl> - X86_INS_KXORW , <nl> - X86_INS_LAHF , <nl> - X86_INS_LAR , <nl> - X86_INS_LDDQU , <nl> - X86_INS_LDMXCSR , <nl> - X86_INS_LDS , <nl> - X86_INS_FLDZ , <nl> - X86_INS_FLD1 , <nl> - X86_INS_FLD , <nl> - X86_INS_LEA , <nl> - X86_INS_LEAVE , <nl> - X86_INS_LES , <nl> - X86_INS_LFENCE , <nl> - X86_INS_LFS , <nl> - X86_INS_LGDT , <nl> - X86_INS_LGS , <nl> - X86_INS_LIDT , <nl> - X86_INS_LLDT , <nl> - X86_INS_LMSW , <nl> - X86_INS_OR , <nl> - X86_INS_SUB , <nl> - X86_INS_XOR , <nl> - X86_INS_LODSB , <nl> - X86_INS_LODSD , <nl> - X86_INS_LODSQ , <nl> - X86_INS_LODSW , <nl> - X86_INS_LOOP , <nl> - X86_INS_LOOPE , <nl> - X86_INS_LOOPNE , <nl> - X86_INS_RETF , <nl> - X86_INS_RETFQ , <nl> - X86_INS_LSL , <nl> - X86_INS_LSS , <nl> - X86_INS_LTR , <nl> - X86_INS_XADD , <nl> - X86_INS_LZCNT , <nl> - X86_INS_MASKMOVDQU , <nl> - X86_INS_MAXPD , <nl> - X86_INS_MAXPS , <nl> - X86_INS_MAXSD , <nl> - X86_INS_MAXSS , <nl> - X86_INS_MFENCE , <nl> - X86_INS_MINPD , <nl> - X86_INS_MINPS , <nl> - X86_INS_MINSD , <nl> - X86_INS_MINSS , <nl> - X86_INS_CVTPD2PI , <nl> - X86_INS_CVTPI2PD , <nl> - X86_INS_CVTPI2PS , <nl> - X86_INS_CVTPS2PI , <nl> - X86_INS_CVTTPD2PI , <nl> - X86_INS_CVTTPS2PI , <nl> - X86_INS_EMMS , <nl> - X86_INS_MASKMOVQ , <nl> - X86_INS_MOVD , <nl> - X86_INS_MOVDQ2Q , <nl> - X86_INS_MOVNTQ , <nl> - X86_INS_MOVQ2DQ , <nl> - X86_INS_MOVQ , <nl> - X86_INS_PABSB , <nl> - X86_INS_PABSD , <nl> - X86_INS_PABSW , <nl> - X86_INS_PACKSSDW , <nl> - X86_INS_PACKSSWB , <nl> - X86_INS_PACKUSWB , <nl> - X86_INS_PADDB , <nl> - X86_INS_PADDD , <nl> - X86_INS_PADDQ , <nl> - X86_INS_PADDSB , <nl> - X86_INS_PADDSW , <nl> - X86_INS_PADDUSB , <nl> - X86_INS_PADDUSW , <nl> - X86_INS_PADDW , <nl> - X86_INS_PALIGNR , <nl> - X86_INS_PANDN , <nl> - X86_INS_PAND , <nl> - X86_INS_PAVGB , <nl> - X86_INS_PAVGW , <nl> - X86_INS_PCMPEQB , <nl> - X86_INS_PCMPEQD , <nl> - X86_INS_PCMPEQW , <nl> - X86_INS_PCMPGTB , <nl> - X86_INS_PCMPGTD , <nl> - X86_INS_PCMPGTW , <nl> - X86_INS_PEXTRW , <nl> - X86_INS_PHADDSW , <nl> - X86_INS_PHADDW , <nl> - X86_INS_PHADDD , <nl> - X86_INS_PHSUBD , <nl> - X86_INS_PHSUBSW , <nl> - X86_INS_PHSUBW , <nl> - X86_INS_PINSRW , <nl> - X86_INS_PMADDUBSW , <nl> - X86_INS_PMADDWD , <nl> - X86_INS_PMAXSW , <nl> - X86_INS_PMAXUB , <nl> - X86_INS_PMINSW , <nl> - X86_INS_PMINUB , <nl> - X86_INS_PMOVMSKB , <nl> - X86_INS_PMULHRSW , <nl> - X86_INS_PMULHUW , <nl> - X86_INS_PMULHW , <nl> - X86_INS_PMULLW , <nl> - X86_INS_PMULUDQ , <nl> - X86_INS_POR , <nl> - X86_INS_PSADBW , <nl> - X86_INS_PSHUFB , <nl> - X86_INS_PSHUFW , <nl> - X86_INS_PSIGNB , <nl> - X86_INS_PSIGND , <nl> - X86_INS_PSIGNW , <nl> - X86_INS_PSLLD , <nl> - X86_INS_PSLLQ , <nl> - X86_INS_PSLLW , <nl> - X86_INS_PSRAD , <nl> - X86_INS_PSRAW , <nl> - X86_INS_PSRLD , <nl> - X86_INS_PSRLQ , <nl> - X86_INS_PSRLW , <nl> - X86_INS_PSUBB , <nl> - X86_INS_PSUBD , <nl> - X86_INS_PSUBQ , <nl> - X86_INS_PSUBSB , <nl> - X86_INS_PSUBSW , <nl> - X86_INS_PSUBUSB , <nl> - X86_INS_PSUBUSW , <nl> - X86_INS_PSUBW , <nl> - X86_INS_PUNPCKHBW , <nl> - X86_INS_PUNPCKHDQ , <nl> - X86_INS_PUNPCKHWD , <nl> - X86_INS_PUNPCKLBW , <nl> - X86_INS_PUNPCKLDQ , <nl> - X86_INS_PUNPCKLWD , <nl> - X86_INS_PXOR , <nl> - X86_INS_MONITOR , <nl> - X86_INS_MONTMUL , <nl> - X86_INS_MOV , <nl> - X86_INS_MOVABS , <nl> - X86_INS_MOVBE , <nl> - X86_INS_MOVDDUP , <nl> - X86_INS_MOVDQA , <nl> - X86_INS_MOVDQU , <nl> - X86_INS_MOVHLPS , <nl> - X86_INS_MOVHPD , <nl> - X86_INS_MOVHPS , <nl> - X86_INS_MOVLHPS , <nl> - X86_INS_MOVLPD , <nl> - X86_INS_MOVLPS , <nl> - X86_INS_MOVMSKPD , <nl> - X86_INS_MOVMSKPS , <nl> - X86_INS_MOVNTDQA , <nl> - X86_INS_MOVNTDQ , <nl> - X86_INS_MOVNTI , <nl> - X86_INS_MOVNTPD , <nl> - X86_INS_MOVNTPS , <nl> - X86_INS_MOVNTSD , <nl> - X86_INS_MOVNTSS , <nl> - X86_INS_MOVSB , <nl> - X86_INS_MOVSD , <nl> - X86_INS_MOVSHDUP , <nl> - X86_INS_MOVSLDUP , <nl> - X86_INS_MOVSQ , <nl> - X86_INS_MOVSS , <nl> - X86_INS_MOVSW , <nl> - X86_INS_MOVSX , <nl> - X86_INS_MOVSXD , <nl> - X86_INS_MOVUPD , <nl> - X86_INS_MOVUPS , <nl> - X86_INS_MOVZX , <nl> - X86_INS_MPSADBW , <nl> - X86_INS_MUL , <nl> - X86_INS_MULPD , <nl> - X86_INS_MULPS , <nl> - X86_INS_MULSD , <nl> - X86_INS_MULSS , <nl> - X86_INS_MULX , <nl> - X86_INS_FMUL , <nl> - X86_INS_FIMUL , <nl> - X86_INS_FMULP , <nl> - X86_INS_MWAIT , <nl> - X86_INS_NEG , <nl> - X86_INS_NOP , <nl> - X86_INS_NOT , <nl> - X86_INS_OUT , <nl> - X86_INS_OUTSB , <nl> - X86_INS_OUTSD , <nl> - X86_INS_OUTSW , <nl> - X86_INS_PACKUSDW , <nl> - X86_INS_PAUSE , <nl> - X86_INS_PAVGUSB , <nl> - X86_INS_PBLENDVB , <nl> - X86_INS_PBLENDW , <nl> - X86_INS_PCLMULQDQ , <nl> - X86_INS_PCMPEQQ , <nl> - X86_INS_PCMPESTRI , <nl> - X86_INS_PCMPESTRM , <nl> - X86_INS_PCMPGTQ , <nl> - X86_INS_PCMPISTRI , <nl> - X86_INS_PCMPISTRM , <nl> - X86_INS_PDEP , <nl> - X86_INS_PEXT , <nl> - X86_INS_PEXTRB , <nl> - X86_INS_PEXTRD , <nl> - X86_INS_PEXTRQ , <nl> - X86_INS_PF2ID , <nl> - X86_INS_PF2IW , <nl> - X86_INS_PFACC , <nl> - X86_INS_PFADD , <nl> - X86_INS_PFCMPEQ , <nl> - X86_INS_PFCMPGE , <nl> - X86_INS_PFCMPGT , <nl> - X86_INS_PFMAX , <nl> - X86_INS_PFMIN , <nl> - X86_INS_PFMUL , <nl> - X86_INS_PFNACC , <nl> - X86_INS_PFPNACC , <nl> - X86_INS_PFRCPIT1 , <nl> - X86_INS_PFRCPIT2 , <nl> - X86_INS_PFRCP , <nl> - X86_INS_PFRSQIT1 , <nl> - X86_INS_PFRSQRT , <nl> - X86_INS_PFSUBR , <nl> - X86_INS_PFSUB , <nl> - X86_INS_PHMINPOSUW , <nl> - X86_INS_PI2FD , <nl> - X86_INS_PI2FW , <nl> - X86_INS_PINSRB , <nl> - X86_INS_PINSRD , <nl> - X86_INS_PINSRQ , <nl> - X86_INS_PMAXSB , <nl> - X86_INS_PMAXSD , <nl> - X86_INS_PMAXUD , <nl> - X86_INS_PMAXUW , <nl> - X86_INS_PMINSB , <nl> - X86_INS_PMINSD , <nl> - X86_INS_PMINUD , <nl> - X86_INS_PMINUW , <nl> - X86_INS_PMOVSXBD , <nl> - X86_INS_PMOVSXBQ , <nl> - X86_INS_PMOVSXBW , <nl> - X86_INS_PMOVSXDQ , <nl> - X86_INS_PMOVSXWD , <nl> - X86_INS_PMOVSXWQ , <nl> - X86_INS_PMOVZXBD , <nl> - X86_INS_PMOVZXBQ , <nl> - X86_INS_PMOVZXBW , <nl> - X86_INS_PMOVZXDQ , <nl> - X86_INS_PMOVZXWD , <nl> - X86_INS_PMOVZXWQ , <nl> - X86_INS_PMULDQ , <nl> - X86_INS_PMULHRW , <nl> - X86_INS_PMULLD , <nl> - X86_INS_POP , <nl> - X86_INS_POPAW , <nl> - X86_INS_POPAL , <nl> - X86_INS_POPCNT , <nl> - X86_INS_POPF , <nl> - X86_INS_POPFD , <nl> - X86_INS_POPFQ , <nl> - X86_INS_PREFETCH , <nl> - X86_INS_PREFETCHNTA , <nl> - X86_INS_PREFETCHT0 , <nl> - X86_INS_PREFETCHT1 , <nl> - X86_INS_PREFETCHT2 , <nl> - X86_INS_PREFETCHW , <nl> - X86_INS_PSHUFD , <nl> - X86_INS_PSHUFHW , <nl> - X86_INS_PSHUFLW , <nl> - X86_INS_PSLLDQ , <nl> - X86_INS_PSRLDQ , <nl> - X86_INS_PSWAPD , <nl> - X86_INS_PTEST , <nl> - X86_INS_PUNPCKHQDQ , <nl> - X86_INS_PUNPCKLQDQ , <nl> - X86_INS_PUSH , <nl> - X86_INS_PUSHAW , <nl> - X86_INS_PUSHAL , <nl> - X86_INS_PUSHF , <nl> - X86_INS_PUSHFD , <nl> - X86_INS_PUSHFQ , <nl> - X86_INS_RCL , <nl> - X86_INS_RCPPS , <nl> - X86_INS_RCPSS , <nl> - X86_INS_RCR , <nl> - X86_INS_RDFSBASE , <nl> - X86_INS_RDGSBASE , <nl> - X86_INS_RDMSR , <nl> - X86_INS_RDPMC , <nl> - X86_INS_RDRAND , <nl> - X86_INS_RDSEED , <nl> - X86_INS_RDTSC , <nl> - X86_INS_RDTSCP , <nl> - X86_INS_ROL , <nl> - X86_INS_ROR , <nl> - X86_INS_RORX , <nl> - X86_INS_ROUNDPD , <nl> - X86_INS_ROUNDPS , <nl> - X86_INS_ROUNDSD , <nl> - X86_INS_ROUNDSS , <nl> - X86_INS_RSM , <nl> - X86_INS_RSQRTPS , <nl> - X86_INS_RSQRTSS , <nl> - X86_INS_SAHF , <nl> - X86_INS_SAL , <nl> - X86_INS_SALC , <nl> - X86_INS_SAR , <nl> - X86_INS_SARX , <nl> - X86_INS_SBB , <nl> - X86_INS_SCASB , <nl> - X86_INS_SCASD , <nl> - X86_INS_SCASQ , <nl> - X86_INS_SCASW , <nl> - X86_INS_SETAE , <nl> - X86_INS_SETA , <nl> - X86_INS_SETBE , <nl> - X86_INS_SETB , <nl> - X86_INS_SETE , <nl> - X86_INS_SETGE , <nl> - X86_INS_SETG , <nl> - X86_INS_SETLE , <nl> - X86_INS_SETL , <nl> - X86_INS_SETNE , <nl> - X86_INS_SETNO , <nl> - X86_INS_SETNP , <nl> - X86_INS_SETNS , <nl> - X86_INS_SETO , <nl> - X86_INS_SETP , <nl> - X86_INS_SETS , <nl> - X86_INS_SFENCE , <nl> - X86_INS_SGDT , <nl> - X86_INS_SHA1MSG1 , <nl> - X86_INS_SHA1MSG2 , <nl> - X86_INS_SHA1NEXTE , <nl> - X86_INS_SHA1RNDS4 , <nl> - X86_INS_SHA256MSG1 , <nl> - X86_INS_SHA256MSG2 , <nl> - X86_INS_SHA256RNDS2 , <nl> - X86_INS_SHL , <nl> - X86_INS_SHLD , <nl> - X86_INS_SHLX , <nl> - X86_INS_SHR , <nl> - X86_INS_SHRD , <nl> - X86_INS_SHRX , <nl> - X86_INS_SHUFPD , <nl> - X86_INS_SHUFPS , <nl> - X86_INS_SIDT , <nl> - X86_INS_FSIN , <nl> - X86_INS_SKINIT , <nl> - X86_INS_SLDT , <nl> - X86_INS_SMSW , <nl> - X86_INS_SQRTPD , <nl> - X86_INS_SQRTPS , <nl> - X86_INS_SQRTSD , <nl> - X86_INS_SQRTSS , <nl> - X86_INS_FSQRT , <nl> - X86_INS_STAC , <nl> - X86_INS_STC , <nl> - X86_INS_STD , <nl> - X86_INS_STGI , <nl> - X86_INS_STI , <nl> - X86_INS_STMXCSR , <nl> - X86_INS_STOSB , <nl> - X86_INS_STOSD , <nl> - X86_INS_STOSQ , <nl> - X86_INS_STOSW , <nl> - X86_INS_STR , <nl> - X86_INS_FST , <nl> - X86_INS_FSTP , <nl> - X86_INS_FSTPNCE , <nl> - X86_INS_SUBPD , <nl> - X86_INS_SUBPS , <nl> - X86_INS_FSUBR , <nl> - X86_INS_FISUBR , <nl> - X86_INS_FSUBRP , <nl> - X86_INS_SUBSD , <nl> - X86_INS_SUBSS , <nl> - X86_INS_FSUB , <nl> - X86_INS_FISUB , <nl> - X86_INS_FSUBP , <nl> - X86_INS_SWAPGS , <nl> - X86_INS_SYSCALL , <nl> - X86_INS_SYSENTER , <nl> - X86_INS_SYSEXIT , <nl> - X86_INS_SYSRET , <nl> - X86_INS_T1MSKC , <nl> - X86_INS_TEST , <nl> - X86_INS_UD2 , <nl> - X86_INS_FTST , <nl> - X86_INS_TZCNT , <nl> - X86_INS_TZMSK , <nl> - X86_INS_FUCOMPI , <nl> - X86_INS_FUCOMI , <nl> - X86_INS_FUCOMPP , <nl> - X86_INS_FUCOMP , <nl> - X86_INS_FUCOM , <nl> - X86_INS_UD2B , <nl> - X86_INS_UNPCKHPD , <nl> - X86_INS_UNPCKHPS , <nl> - X86_INS_UNPCKLPD , <nl> - X86_INS_UNPCKLPS , <nl> - X86_INS_VADDPD , <nl> - X86_INS_VADDPS , <nl> - X86_INS_VADDSD , <nl> - X86_INS_VADDSS , <nl> - X86_INS_VADDSUBPD , <nl> - X86_INS_VADDSUBPS , <nl> - X86_INS_VAESDECLAST , <nl> - X86_INS_VAESDEC , <nl> - X86_INS_VAESENCLAST , <nl> - X86_INS_VAESENC , <nl> - X86_INS_VAESIMC , <nl> - X86_INS_VAESKEYGENASSIST , <nl> - X86_INS_VALIGND , <nl> - X86_INS_VALIGNQ , <nl> - X86_INS_VANDNPD , <nl> - X86_INS_VANDNPS , <nl> - X86_INS_VANDPD , <nl> - X86_INS_VANDPS , <nl> - X86_INS_VBLENDMPD , <nl> - X86_INS_VBLENDMPS , <nl> - X86_INS_VBLENDPD , <nl> - X86_INS_VBLENDPS , <nl> - X86_INS_VBLENDVPD , <nl> - X86_INS_VBLENDVPS , <nl> - X86_INS_VBROADCASTF128 , <nl> - X86_INS_VBROADCASTI128 , <nl> - X86_INS_VBROADCASTI32X4 , <nl> - X86_INS_VBROADCASTI64X4 , <nl> - X86_INS_VBROADCASTSD , <nl> - X86_INS_VBROADCASTSS , <nl> - X86_INS_VCMPPD , <nl> - X86_INS_VCMPPS , <nl> - X86_INS_VCMPSD , <nl> - X86_INS_VCMPSS , <nl> - X86_INS_VCVTDQ2PD , <nl> - X86_INS_VCVTDQ2PS , <nl> - X86_INS_VCVTPD2DQX , <nl> - X86_INS_VCVTPD2DQ , <nl> - X86_INS_VCVTPD2PSX , <nl> - X86_INS_VCVTPD2PS , <nl> - X86_INS_VCVTPD2UDQ , <nl> - X86_INS_VCVTPH2PS , <nl> - X86_INS_VCVTPS2DQ , <nl> - X86_INS_VCVTPS2PD , <nl> - X86_INS_VCVTPS2PH , <nl> - X86_INS_VCVTPS2UDQ , <nl> - X86_INS_VCVTSD2SI , <nl> - X86_INS_VCVTSD2USI , <nl> - X86_INS_VCVTSS2SI , <nl> - X86_INS_VCVTSS2USI , <nl> - X86_INS_VCVTTPD2DQX , <nl> - X86_INS_VCVTTPD2DQ , <nl> - X86_INS_VCVTTPD2UDQ , <nl> - X86_INS_VCVTTPS2DQ , <nl> - X86_INS_VCVTTPS2UDQ , <nl> - X86_INS_VCVTUDQ2PD , <nl> - X86_INS_VCVTUDQ2PS , <nl> - X86_INS_VDIVPD , <nl> - X86_INS_VDIVPS , <nl> - X86_INS_VDIVSD , <nl> - X86_INS_VDIVSS , <nl> - X86_INS_VDPPD , <nl> - X86_INS_VDPPS , <nl> - X86_INS_VERR , <nl> - X86_INS_VERW , <nl> - X86_INS_VEXTRACTF128 , <nl> - X86_INS_VEXTRACTF32X4 , <nl> - X86_INS_VEXTRACTF64X4 , <nl> - X86_INS_VEXTRACTI128 , <nl> - X86_INS_VEXTRACTI32X4 , <nl> - X86_INS_VEXTRACTI64X4 , <nl> - X86_INS_VEXTRACTPS , <nl> - X86_INS_VFMADD132PD , <nl> - X86_INS_VFMADD132PS , <nl> - X86_INS_VFMADD213PD , <nl> - X86_INS_VFMADD213PS , <nl> - X86_INS_VFMADDPD , <nl> - X86_INS_VFMADD231PD , <nl> - X86_INS_VFMADDPS , <nl> - X86_INS_VFMADD231PS , <nl> - X86_INS_VFMADDSD , <nl> - X86_INS_VFMADD213SD , <nl> - X86_INS_VFMADD132SD , <nl> - X86_INS_VFMADD231SD , <nl> - X86_INS_VFMADDSS , <nl> - X86_INS_VFMADD213SS , <nl> - X86_INS_VFMADD132SS , <nl> - X86_INS_VFMADD231SS , <nl> - X86_INS_VFMADDSUB132PD , <nl> - X86_INS_VFMADDSUB132PS , <nl> - X86_INS_VFMADDSUB213PD , <nl> - X86_INS_VFMADDSUB213PS , <nl> - X86_INS_VFMADDSUBPD , <nl> - X86_INS_VFMADDSUB231PD , <nl> - X86_INS_VFMADDSUBPS , <nl> - X86_INS_VFMADDSUB231PS , <nl> - X86_INS_VFMSUB132PD , <nl> - X86_INS_VFMSUB132PS , <nl> - X86_INS_VFMSUB213PD , <nl> - X86_INS_VFMSUB213PS , <nl> - X86_INS_VFMSUBADD132PD , <nl> - X86_INS_VFMSUBADD132PS , <nl> - X86_INS_VFMSUBADD213PD , <nl> - X86_INS_VFMSUBADD213PS , <nl> - X86_INS_VFMSUBADDPD , <nl> - X86_INS_VFMSUBADD231PD , <nl> - X86_INS_VFMSUBADDPS , <nl> - X86_INS_VFMSUBADD231PS , <nl> - X86_INS_VFMSUBPD , <nl> - X86_INS_VFMSUB231PD , <nl> - X86_INS_VFMSUBPS , <nl> - X86_INS_VFMSUB231PS , <nl> - X86_INS_VFMSUBSD , <nl> - X86_INS_VFMSUB213SD , <nl> - X86_INS_VFMSUB132SD , <nl> - X86_INS_VFMSUB231SD , <nl> - X86_INS_VFMSUBSS , <nl> - X86_INS_VFMSUB213SS , <nl> - X86_INS_VFMSUB132SS , <nl> - X86_INS_VFMSUB231SS , <nl> - X86_INS_VFNMADD132PD , <nl> - X86_INS_VFNMADD132PS , <nl> - X86_INS_VFNMADD213PD , <nl> - X86_INS_VFNMADD213PS , <nl> - X86_INS_VFNMADDPD , <nl> - X86_INS_VFNMADD231PD , <nl> - X86_INS_VFNMADDPS , <nl> - X86_INS_VFNMADD231PS , <nl> - X86_INS_VFNMADDSD , <nl> - X86_INS_VFNMADD213SD , <nl> - X86_INS_VFNMADD132SD , <nl> - X86_INS_VFNMADD231SD , <nl> - X86_INS_VFNMADDSS , <nl> - X86_INS_VFNMADD213SS , <nl> - X86_INS_VFNMADD132SS , <nl> - X86_INS_VFNMADD231SS , <nl> - X86_INS_VFNMSUB132PD , <nl> - X86_INS_VFNMSUB132PS , <nl> - X86_INS_VFNMSUB213PD , <nl> - X86_INS_VFNMSUB213PS , <nl> - X86_INS_VFNMSUBPD , <nl> - X86_INS_VFNMSUB231PD , <nl> - X86_INS_VFNMSUBPS , <nl> - X86_INS_VFNMSUB231PS , <nl> - X86_INS_VFNMSUBSD , <nl> - X86_INS_VFNMSUB213SD , <nl> - X86_INS_VFNMSUB132SD , <nl> - X86_INS_VFNMSUB231SD , <nl> - X86_INS_VFNMSUBSS , <nl> - X86_INS_VFNMSUB213SS , <nl> - X86_INS_VFNMSUB132SS , <nl> - X86_INS_VFNMSUB231SS , <nl> - X86_INS_VFRCZPD , <nl> - X86_INS_VFRCZPS , <nl> - X86_INS_VFRCZSD , <nl> - X86_INS_VFRCZSS , <nl> - X86_INS_VORPD , <nl> - X86_INS_VORPS , <nl> - X86_INS_VXORPD , <nl> - X86_INS_VXORPS , <nl> - X86_INS_VGATHERDPD , <nl> - X86_INS_VGATHERDPS , <nl> - X86_INS_VGATHERPF0DPD , <nl> - X86_INS_VGATHERPF0DPS , <nl> - X86_INS_VGATHERPF0QPD , <nl> - X86_INS_VGATHERPF0QPS , <nl> - X86_INS_VGATHERPF1DPD , <nl> - X86_INS_VGATHERPF1DPS , <nl> - X86_INS_VGATHERPF1QPD , <nl> - X86_INS_VGATHERPF1QPS , <nl> - X86_INS_VGATHERQPD , <nl> - X86_INS_VGATHERQPS , <nl> - X86_INS_VHADDPD , <nl> - X86_INS_VHADDPS , <nl> - X86_INS_VHSUBPD , <nl> - X86_INS_VHSUBPS , <nl> - X86_INS_VINSERTF128 , <nl> - X86_INS_VINSERTF32X4 , <nl> - X86_INS_VINSERTF64X4 , <nl> - X86_INS_VINSERTI128 , <nl> - X86_INS_VINSERTI32X4 , <nl> - X86_INS_VINSERTI64X4 , <nl> - X86_INS_VINSERTPS , <nl> - X86_INS_VLDDQU , <nl> - X86_INS_VLDMXCSR , <nl> - X86_INS_VMASKMOVDQU , <nl> - X86_INS_VMASKMOVPD , <nl> - X86_INS_VMASKMOVPS , <nl> - X86_INS_VMAXPD , <nl> - X86_INS_VMAXPS , <nl> - X86_INS_VMAXSD , <nl> - X86_INS_VMAXSS , <nl> - X86_INS_VMCALL , <nl> - X86_INS_VMCLEAR , <nl> - X86_INS_VMFUNC , <nl> - X86_INS_VMINPD , <nl> - X86_INS_VMINPS , <nl> - X86_INS_VMINSD , <nl> - X86_INS_VMINSS , <nl> - X86_INS_VMLAUNCH , <nl> - X86_INS_VMLOAD , <nl> - X86_INS_VMMCALL , <nl> - X86_INS_VMOVQ , <nl> - X86_INS_VMOVDDUP , <nl> - X86_INS_VMOVD , <nl> - X86_INS_VMOVDQA32 , <nl> - X86_INS_VMOVDQA64 , <nl> - X86_INS_VMOVDQA , <nl> - X86_INS_VMOVDQU16 , <nl> - X86_INS_VMOVDQU32 , <nl> - X86_INS_VMOVDQU64 , <nl> - X86_INS_VMOVDQU8 , <nl> - X86_INS_VMOVDQU , <nl> - X86_INS_VMOVHLPS , <nl> - X86_INS_VMOVHPD , <nl> - X86_INS_VMOVHPS , <nl> - X86_INS_VMOVLHPS , <nl> - X86_INS_VMOVLPD , <nl> - X86_INS_VMOVLPS , <nl> - X86_INS_VMOVMSKPD , <nl> - X86_INS_VMOVMSKPS , <nl> - X86_INS_VMOVNTDQA , <nl> - X86_INS_VMOVNTDQ , <nl> - X86_INS_VMOVNTPD , <nl> - X86_INS_VMOVNTPS , <nl> - X86_INS_VMOVSD , <nl> - X86_INS_VMOVSHDUP , <nl> - X86_INS_VMOVSLDUP , <nl> - X86_INS_VMOVSS , <nl> - X86_INS_VMOVUPD , <nl> - X86_INS_VMOVUPS , <nl> - X86_INS_VMPSADBW , <nl> - X86_INS_VMPTRLD , <nl> - X86_INS_VMPTRST , <nl> - X86_INS_VMREAD , <nl> - X86_INS_VMRESUME , <nl> - X86_INS_VMRUN , <nl> - X86_INS_VMSAVE , <nl> - X86_INS_VMULPD , <nl> - X86_INS_VMULPS , <nl> - X86_INS_VMULSD , <nl> - X86_INS_VMULSS , <nl> - X86_INS_VMWRITE , <nl> - X86_INS_VMXOFF , <nl> - X86_INS_VMXON , <nl> - X86_INS_VPABSB , <nl> - X86_INS_VPABSD , <nl> - X86_INS_VPABSQ , <nl> - X86_INS_VPABSW , <nl> - X86_INS_VPACKSSDW , <nl> - X86_INS_VPACKSSWB , <nl> - X86_INS_VPACKUSDW , <nl> - X86_INS_VPACKUSWB , <nl> - X86_INS_VPADDB , <nl> - X86_INS_VPADDD , <nl> - X86_INS_VPADDQ , <nl> - X86_INS_VPADDSB , <nl> - X86_INS_VPADDSW , <nl> - X86_INS_VPADDUSB , <nl> - X86_INS_VPADDUSW , <nl> - X86_INS_VPADDW , <nl> - X86_INS_VPALIGNR , <nl> - X86_INS_VPANDD , <nl> - X86_INS_VPANDND , <nl> - X86_INS_VPANDNQ , <nl> - X86_INS_VPANDN , <nl> - X86_INS_VPANDQ , <nl> - X86_INS_VPAND , <nl> - X86_INS_VPAVGB , <nl> - X86_INS_VPAVGW , <nl> - X86_INS_VPBLENDD , <nl> - X86_INS_VPBLENDMD , <nl> - X86_INS_VPBLENDMQ , <nl> - X86_INS_VPBLENDVB , <nl> - X86_INS_VPBLENDW , <nl> - X86_INS_VPBROADCASTB , <nl> - X86_INS_VPBROADCASTD , <nl> - X86_INS_VPBROADCASTMB2Q , <nl> - X86_INS_VPBROADCASTMW2D , <nl> - X86_INS_VPBROADCASTQ , <nl> - X86_INS_VPBROADCASTW , <nl> - X86_INS_VPCLMULQDQ , <nl> - X86_INS_VPCMOV , <nl> - X86_INS_VPCMP , <nl> - X86_INS_VPCMPD , <nl> - X86_INS_VPCMPEQB , <nl> - X86_INS_VPCMPEQD , <nl> - X86_INS_VPCMPEQQ , <nl> - X86_INS_VPCMPEQW , <nl> - X86_INS_VPCMPESTRI , <nl> - X86_INS_VPCMPESTRM , <nl> - X86_INS_VPCMPGTB , <nl> - X86_INS_VPCMPGTD , <nl> - X86_INS_VPCMPGTQ , <nl> - X86_INS_VPCMPGTW , <nl> - X86_INS_VPCMPISTRI , <nl> - X86_INS_VPCMPISTRM , <nl> - X86_INS_VPCMPQ , <nl> - X86_INS_VPCMPUD , <nl> - X86_INS_VPCMPUQ , <nl> - X86_INS_VPCOMB , <nl> - X86_INS_VPCOMD , <nl> - X86_INS_VPCOMQ , <nl> - X86_INS_VPCOMUB , <nl> - X86_INS_VPCOMUD , <nl> - X86_INS_VPCOMUQ , <nl> - X86_INS_VPCOMUW , <nl> - X86_INS_VPCOMW , <nl> - X86_INS_VPCONFLICTD , <nl> - X86_INS_VPCONFLICTQ , <nl> - X86_INS_VPERM2F128 , <nl> - X86_INS_VPERM2I128 , <nl> - X86_INS_VPERMD , <nl> - X86_INS_VPERMI2D , <nl> - X86_INS_VPERMI2PD , <nl> - X86_INS_VPERMI2PS , <nl> - X86_INS_VPERMI2Q , <nl> - X86_INS_VPERMIL2PD , <nl> - X86_INS_VPERMIL2PS , <nl> - X86_INS_VPERMILPD , <nl> - X86_INS_VPERMILPS , <nl> - X86_INS_VPERMPD , <nl> - X86_INS_VPERMPS , <nl> - X86_INS_VPERMQ , <nl> - X86_INS_VPERMT2D , <nl> - X86_INS_VPERMT2PD , <nl> - X86_INS_VPERMT2PS , <nl> - X86_INS_VPERMT2Q , <nl> - X86_INS_VPEXTRB , <nl> - X86_INS_VPEXTRD , <nl> - X86_INS_VPEXTRQ , <nl> - X86_INS_VPEXTRW , <nl> - X86_INS_VPGATHERDD , <nl> - X86_INS_VPGATHERDQ , <nl> - X86_INS_VPGATHERQD , <nl> - X86_INS_VPGATHERQQ , <nl> - X86_INS_VPHADDBD , <nl> - X86_INS_VPHADDBQ , <nl> - X86_INS_VPHADDBW , <nl> - X86_INS_VPHADDDQ , <nl> - X86_INS_VPHADDD , <nl> - X86_INS_VPHADDSW , <nl> - X86_INS_VPHADDUBD , <nl> - X86_INS_VPHADDUBQ , <nl> - X86_INS_VPHADDUBW , <nl> - X86_INS_VPHADDUDQ , <nl> - X86_INS_VPHADDUWD , <nl> - X86_INS_VPHADDUWQ , <nl> - X86_INS_VPHADDWD , <nl> - X86_INS_VPHADDWQ , <nl> - X86_INS_VPHADDW , <nl> - X86_INS_VPHMINPOSUW , <nl> - X86_INS_VPHSUBBW , <nl> - X86_INS_VPHSUBDQ , <nl> - X86_INS_VPHSUBD , <nl> - X86_INS_VPHSUBSW , <nl> - X86_INS_VPHSUBWD , <nl> - X86_INS_VPHSUBW , <nl> - X86_INS_VPINSRB , <nl> - X86_INS_VPINSRD , <nl> - X86_INS_VPINSRQ , <nl> - X86_INS_VPINSRW , <nl> - X86_INS_VPLZCNTD , <nl> - X86_INS_VPLZCNTQ , <nl> - X86_INS_VPMACSDD , <nl> - X86_INS_VPMACSDQH , <nl> - X86_INS_VPMACSDQL , <nl> - X86_INS_VPMACSSDD , <nl> - X86_INS_VPMACSSDQH , <nl> - X86_INS_VPMACSSDQL , <nl> - X86_INS_VPMACSSWD , <nl> - X86_INS_VPMACSSWW , <nl> - X86_INS_VPMACSWD , <nl> - X86_INS_VPMACSWW , <nl> - X86_INS_VPMADCSSWD , <nl> - X86_INS_VPMADCSWD , <nl> - X86_INS_VPMADDUBSW , <nl> - X86_INS_VPMADDWD , <nl> - X86_INS_VPMASKMOVD , <nl> - X86_INS_VPMASKMOVQ , <nl> - X86_INS_VPMAXSB , <nl> - X86_INS_VPMAXSD , <nl> - X86_INS_VPMAXSQ , <nl> - X86_INS_VPMAXSW , <nl> - X86_INS_VPMAXUB , <nl> - X86_INS_VPMAXUD , <nl> - X86_INS_VPMAXUQ , <nl> - X86_INS_VPMAXUW , <nl> - X86_INS_VPMINSB , <nl> - X86_INS_VPMINSD , <nl> - X86_INS_VPMINSQ , <nl> - X86_INS_VPMINSW , <nl> - X86_INS_VPMINUB , <nl> - X86_INS_VPMINUD , <nl> - X86_INS_VPMINUQ , <nl> - X86_INS_VPMINUW , <nl> - X86_INS_VPMOVDB , <nl> - X86_INS_VPMOVDW , <nl> - X86_INS_VPMOVMSKB , <nl> - X86_INS_VPMOVQB , <nl> - X86_INS_VPMOVQD , <nl> - X86_INS_VPMOVQW , <nl> - X86_INS_VPMOVSDB , <nl> - X86_INS_VPMOVSDW , <nl> - X86_INS_VPMOVSQB , <nl> - X86_INS_VPMOVSQD , <nl> - X86_INS_VPMOVSQW , <nl> - X86_INS_VPMOVSXBD , <nl> - X86_INS_VPMOVSXBQ , <nl> - X86_INS_VPMOVSXBW , <nl> - X86_INS_VPMOVSXDQ , <nl> - X86_INS_VPMOVSXWD , <nl> - X86_INS_VPMOVSXWQ , <nl> - X86_INS_VPMOVUSDB , <nl> - X86_INS_VPMOVUSDW , <nl> - X86_INS_VPMOVUSQB , <nl> - X86_INS_VPMOVUSQD , <nl> - X86_INS_VPMOVUSQW , <nl> - X86_INS_VPMOVZXBD , <nl> - X86_INS_VPMOVZXBQ , <nl> - X86_INS_VPMOVZXBW , <nl> - X86_INS_VPMOVZXDQ , <nl> - X86_INS_VPMOVZXWD , <nl> - X86_INS_VPMOVZXWQ , <nl> - X86_INS_VPMULDQ , <nl> - X86_INS_VPMULHRSW , <nl> - X86_INS_VPMULHUW , <nl> - X86_INS_VPMULHW , <nl> - X86_INS_VPMULLD , <nl> - X86_INS_VPMULLW , <nl> - X86_INS_VPMULUDQ , <nl> - X86_INS_VPORD , <nl> - X86_INS_VPORQ , <nl> - X86_INS_VPOR , <nl> - X86_INS_VPPERM , <nl> - X86_INS_VPROTB , <nl> - X86_INS_VPROTD , <nl> - X86_INS_VPROTQ , <nl> - X86_INS_VPROTW , <nl> - X86_INS_VPSADBW , <nl> - X86_INS_VPSCATTERDD , <nl> - X86_INS_VPSCATTERDQ , <nl> - X86_INS_VPSCATTERQD , <nl> - X86_INS_VPSCATTERQQ , <nl> - X86_INS_VPSHAB , <nl> - X86_INS_VPSHAD , <nl> - X86_INS_VPSHAQ , <nl> - X86_INS_VPSHAW , <nl> - X86_INS_VPSHLB , <nl> - X86_INS_VPSHLD , <nl> - X86_INS_VPSHLQ , <nl> - X86_INS_VPSHLW , <nl> - X86_INS_VPSHUFB , <nl> - X86_INS_VPSHUFD , <nl> - X86_INS_VPSHUFHW , <nl> - X86_INS_VPSHUFLW , <nl> - X86_INS_VPSIGNB , <nl> - X86_INS_VPSIGND , <nl> - X86_INS_VPSIGNW , <nl> - X86_INS_VPSLLDQ , <nl> - X86_INS_VPSLLD , <nl> - X86_INS_VPSLLQ , <nl> - X86_INS_VPSLLVD , <nl> - X86_INS_VPSLLVQ , <nl> - X86_INS_VPSLLW , <nl> - X86_INS_VPSRAD , <nl> - X86_INS_VPSRAQ , <nl> - X86_INS_VPSRAVD , <nl> - X86_INS_VPSRAVQ , <nl> - X86_INS_VPSRAW , <nl> - X86_INS_VPSRLDQ , <nl> - X86_INS_VPSRLD , <nl> - X86_INS_VPSRLQ , <nl> - X86_INS_VPSRLVD , <nl> - X86_INS_VPSRLVQ , <nl> - X86_INS_VPSRLW , <nl> - X86_INS_VPSUBB , <nl> - X86_INS_VPSUBD , <nl> - X86_INS_VPSUBQ , <nl> - X86_INS_VPSUBSB , <nl> - X86_INS_VPSUBSW , <nl> - X86_INS_VPSUBUSB , <nl> - X86_INS_VPSUBUSW , <nl> - X86_INS_VPSUBW , <nl> - X86_INS_VPTESTMD , <nl> - X86_INS_VPTESTMQ , <nl> - X86_INS_VPTESTNMD , <nl> - X86_INS_VPTESTNMQ , <nl> - X86_INS_VPTEST , <nl> - X86_INS_VPUNPCKHBW , <nl> - X86_INS_VPUNPCKHDQ , <nl> - X86_INS_VPUNPCKHQDQ , <nl> - X86_INS_VPUNPCKHWD , <nl> - X86_INS_VPUNPCKLBW , <nl> - X86_INS_VPUNPCKLDQ , <nl> - X86_INS_VPUNPCKLQDQ , <nl> - X86_INS_VPUNPCKLWD , <nl> - X86_INS_VPXORD , <nl> - X86_INS_VPXORQ , <nl> - X86_INS_VPXOR , <nl> - X86_INS_VRCP14PD , <nl> - X86_INS_VRCP14PS , <nl> - X86_INS_VRCP14SD , <nl> - X86_INS_VRCP14SS , <nl> - X86_INS_VRCP28PD , <nl> - X86_INS_VRCP28PS , <nl> - X86_INS_VRCP28SD , <nl> - X86_INS_VRCP28SS , <nl> - X86_INS_VRCPPS , <nl> - X86_INS_VRCPSS , <nl> - X86_INS_VRNDSCALEPD , <nl> - X86_INS_VRNDSCALEPS , <nl> - X86_INS_VRNDSCALESD , <nl> - X86_INS_VRNDSCALESS , <nl> - X86_INS_VROUNDPD , <nl> - X86_INS_VROUNDPS , <nl> - X86_INS_VROUNDSD , <nl> - X86_INS_VROUNDSS , <nl> - X86_INS_VRSQRT14PD , <nl> - X86_INS_VRSQRT14PS , <nl> - X86_INS_VRSQRT14SD , <nl> - X86_INS_VRSQRT14SS , <nl> - X86_INS_VRSQRT28PD , <nl> - X86_INS_VRSQRT28PS , <nl> - X86_INS_VRSQRT28SD , <nl> - X86_INS_VRSQRT28SS , <nl> - X86_INS_VRSQRTPS , <nl> - X86_INS_VRSQRTSS , <nl> - X86_INS_VSCATTERDPD , <nl> - X86_INS_VSCATTERDPS , <nl> - X86_INS_VSCATTERPF0DPD , <nl> - X86_INS_VSCATTERPF0DPS , <nl> - X86_INS_VSCATTERPF0QPD , <nl> - X86_INS_VSCATTERPF0QPS , <nl> - X86_INS_VSCATTERPF1DPD , <nl> - X86_INS_VSCATTERPF1DPS , <nl> - X86_INS_VSCATTERPF1QPD , <nl> - X86_INS_VSCATTERPF1QPS , <nl> - X86_INS_VSCATTERQPD , <nl> - X86_INS_VSCATTERQPS , <nl> - X86_INS_VSHUFPD , <nl> - X86_INS_VSHUFPS , <nl> - X86_INS_VSQRTPD , <nl> - X86_INS_VSQRTPS , <nl> - X86_INS_VSQRTSD , <nl> - X86_INS_VSQRTSS , <nl> - X86_INS_VSTMXCSR , <nl> - X86_INS_VSUBPD , <nl> - X86_INS_VSUBPS , <nl> - X86_INS_VSUBSD , <nl> - X86_INS_VSUBSS , <nl> - X86_INS_VTESTPD , <nl> - X86_INS_VTESTPS , <nl> - X86_INS_VUNPCKHPD , <nl> - X86_INS_VUNPCKHPS , <nl> - X86_INS_VUNPCKLPD , <nl> - X86_INS_VUNPCKLPS , <nl> - X86_INS_VZEROALL , <nl> - X86_INS_VZEROUPPER , <nl> - X86_INS_WAIT , <nl> - X86_INS_WBINVD , <nl> - X86_INS_WRFSBASE , <nl> - X86_INS_WRGSBASE , <nl> - X86_INS_WRMSR , <nl> - X86_INS_XABORT , <nl> - X86_INS_XACQUIRE , <nl> - X86_INS_XBEGIN , <nl> - X86_INS_XCHG , <nl> - X86_INS_FXCH , <nl> - X86_INS_XCRYPTCBC , <nl> - X86_INS_XCRYPTCFB , <nl> - X86_INS_XCRYPTCTR , <nl> - X86_INS_XCRYPTECB , <nl> - X86_INS_XCRYPTOFB , <nl> - X86_INS_XEND , <nl> - X86_INS_XGETBV , <nl> - X86_INS_XLATB , <nl> - X86_INS_XRELEASE , <nl> - X86_INS_XRSTOR , <nl> - X86_INS_XRSTOR64 , <nl> - X86_INS_XSAVE , <nl> - X86_INS_XSAVE64 , <nl> - X86_INS_XSAVEOPT , <nl> - X86_INS_XSAVEOPT64 , <nl> - X86_INS_XSETBV , <nl> - X86_INS_XSHA1 , <nl> - X86_INS_XSHA256 , <nl> - X86_INS_XSTORE , <nl> - X86_INS_XTEST , <nl> - <nl> - X86_INS_ENDING , / / mark the end of the list of insn <nl> - } x86_insn ; <nl> - <nl> - / / > Group of X86 instructions <nl> - typedef enum x86_insn_group <nl> - { <nl> - X86_GRP_INVALID = 0 , / / = CS_GRP_INVALID <nl> - <nl> - / / > Generic groups <nl> - / / all jump instructions ( conditional + direct + indirect jumps ) <nl> - X86_GRP_JUMP , / / = CS_GRP_JUMP <nl> - / / all call instructions <nl> - X86_GRP_CALL , / / = CS_GRP_CALL <nl> - / / all return instructions <nl> - X86_GRP_RET , / / = CS_GRP_RET <nl> - / / all interrupt instructions ( int + syscall ) <nl> - X86_GRP_INT , / / = CS_GRP_INT <nl> - / / all interrupt return instructions <nl> - X86_GRP_IRET , / / = CS_GRP_IRET <nl> - <nl> - / / > Architecture - specific groups <nl> - X86_GRP_VM = 128 , / / all virtualization instructions ( VT - x + AMD - V ) <nl> - X86_GRP_3DNOW , <nl> - X86_GRP_AES , <nl> - X86_GRP_ADX , <nl> - X86_GRP_AVX , <nl> - X86_GRP_AVX2 , <nl> - X86_GRP_AVX512 , <nl> - X86_GRP_BMI , <nl> - X86_GRP_BMI2 , <nl> - X86_GRP_CMOV , <nl> - X86_GRP_F16C , <nl> - X86_GRP_FMA , <nl> - X86_GRP_FMA4 , <nl> - X86_GRP_FSGSBASE , <nl> - X86_GRP_HLE , <nl> - X86_GRP_MMX , <nl> - X86_GRP_MODE32 , <nl> - X86_GRP_MODE64 , <nl> - X86_GRP_RTM , <nl> - X86_GRP_SHA , <nl> - X86_GRP_SSE1 , <nl> - X86_GRP_SSE2 , <nl> - X86_GRP_SSE3 , <nl> - X86_GRP_SSE41 , <nl> - X86_GRP_SSE42 , <nl> - X86_GRP_SSE4A , <nl> - X86_GRP_SSSE3 , <nl> - X86_GRP_PCLMUL , <nl> - X86_GRP_XOP , <nl> - X86_GRP_CDI , <nl> - X86_GRP_ERI , <nl> - X86_GRP_TBM , <nl> - X86_GRP_16BITMODE , <nl> - X86_GRP_NOT64BITMODE , <nl> - X86_GRP_SGX , <nl> - X86_GRP_DQI , <nl> - X86_GRP_BWI , <nl> - X86_GRP_PFI , <nl> - X86_GRP_VLX , <nl> - X86_GRP_SMAP , <nl> - X86_GRP_NOVLX , <nl> - <nl> - X86_GRP_ENDING <nl> - } x86_insn_group ; <nl> - <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> - <nl> - # endif <nl> deleted file mode 100644 <nl> index b1c718a56 . . 000000000 <nl> mmm a / src / dbg / capstone / xcore . h <nl> ppp / dev / null <nl> <nl> - # ifndef CAPSTONE_XCORE_H <nl> - # define CAPSTONE_XCORE_H <nl> - <nl> - / * Capstone Disassembly Engine * / <nl> - / * By Nguyen Anh Quynh < aquynh @ gmail . com > , 2014 * / <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - <nl> - # include < stdint . h > <nl> - # include " platform . h " <nl> - <nl> - # ifdef _MSC_VER <nl> - # pragma warning ( disable : 4201 ) <nl> - # endif <nl> - <nl> - / / > Operand type for instruction ' s operands <nl> - typedef enum xcore_op_type <nl> - { <nl> - XCORE_OP_INVALID = 0 , / / = CS_OP_INVALID ( Uninitialized ) . <nl> - XCORE_OP_REG , / / = CS_OP_REG ( Register operand ) . <nl> - XCORE_OP_IMM , / / = CS_OP_IMM ( Immediate operand ) . <nl> - XCORE_OP_MEM , / / = CS_OP_MEM ( Memory operand ) . <nl> - } xcore_op_type ; <nl> - <nl> - / / Instruction ' s operand referring to memory <nl> - / / This is associated with XCORE_OP_MEM operand type above <nl> - typedef struct xcore_op_mem <nl> - { <nl> - uint8_t base ; / / base register <nl> - uint8_t index ; / / index register <nl> - int32_t disp ; / / displacement / offset value <nl> - int direct ; / / + 1 : forward , - 1 : backward <nl> - } xcore_op_mem ; <nl> - <nl> - / / Instruction operand <nl> - typedef struct cs_xcore_op <nl> - { <nl> - xcore_op_type type ; / / operand type <nl> - union <nl> - { <nl> - unsigned int reg ; / / register value for REG operand <nl> - int32_t imm ; / / immediate value for IMM operand <nl> - xcore_op_mem mem ; / / base / disp value for MEM operand <nl> - } ; <nl> - } cs_xcore_op ; <nl> - <nl> - / / Instruction structure <nl> - typedef struct cs_xcore <nl> - { <nl> - / / Number of operands of this instruction , <nl> - / / or 0 when instruction has no operand . <nl> - uint8_t op_count ; <nl> - cs_xcore_op operands [ 8 ] ; / / operands for this instruction . <nl> - } cs_xcore ; <nl> - <nl> - / / > XCore registers <nl> - typedef enum xcore_reg <nl> - { <nl> - XCORE_REG_INVALID = 0 , <nl> - <nl> - XCORE_REG_CP , <nl> - XCORE_REG_DP , <nl> - XCORE_REG_LR , <nl> - XCORE_REG_SP , <nl> - XCORE_REG_R0 , <nl> - XCORE_REG_R1 , <nl> - XCORE_REG_R2 , <nl> - XCORE_REG_R3 , <nl> - XCORE_REG_R4 , <nl> - XCORE_REG_R5 , <nl> - XCORE_REG_R6 , <nl> - XCORE_REG_R7 , <nl> - XCORE_REG_R8 , <nl> - XCORE_REG_R9 , <nl> - XCORE_REG_R10 , <nl> - XCORE_REG_R11 , <nl> - <nl> - / / > pseudo registers <nl> - XCORE_REG_PC , / / pc <nl> - <nl> - / / internal thread registers <nl> - / / see The - XMOS - XS1 - Architecture ( X7879A ) . pdf <nl> - XCORE_REG_SCP , / / save pc <nl> - XCORE_REG_SSR , / / save status <nl> - XCORE_REG_ET , / / exception type <nl> - XCORE_REG_ED , / / exception data <nl> - XCORE_REG_SED , / / save exception data <nl> - XCORE_REG_KEP , / / kernel entry pointer <nl> - XCORE_REG_KSP , / / kernel stack pointer <nl> - XCORE_REG_ID , / / thread ID <nl> - <nl> - XCORE_REG_ENDING , / / < - - mark the end of the list of registers <nl> - } xcore_reg ; <nl> - <nl> - / / > XCore instruction <nl> - typedef enum xcore_insn <nl> - { <nl> - XCORE_INS_INVALID = 0 , <nl> - <nl> - XCORE_INS_ADD , <nl> - XCORE_INS_ANDNOT , <nl> - XCORE_INS_AND , <nl> - XCORE_INS_ASHR , <nl> - XCORE_INS_BAU , <nl> - XCORE_INS_BITREV , <nl> - XCORE_INS_BLA , <nl> - XCORE_INS_BLAT , <nl> - XCORE_INS_BL , <nl> - XCORE_INS_BF , <nl> - XCORE_INS_BT , <nl> - XCORE_INS_BU , <nl> - XCORE_INS_BRU , <nl> - XCORE_INS_BYTEREV , <nl> - XCORE_INS_CHKCT , <nl> - XCORE_INS_CLRE , <nl> - XCORE_INS_CLRPT , <nl> - XCORE_INS_CLRSR , <nl> - XCORE_INS_CLZ , <nl> - XCORE_INS_CRC8 , <nl> - XCORE_INS_CRC32 , <nl> - XCORE_INS_DCALL , <nl> - XCORE_INS_DENTSP , <nl> - XCORE_INS_DGETREG , <nl> - XCORE_INS_DIVS , <nl> - XCORE_INS_DIVU , <nl> - XCORE_INS_DRESTSP , <nl> - XCORE_INS_DRET , <nl> - XCORE_INS_ECALLF , <nl> - XCORE_INS_ECALLT , <nl> - XCORE_INS_EDU , <nl> - XCORE_INS_EEF , <nl> - XCORE_INS_EET , <nl> - XCORE_INS_EEU , <nl> - XCORE_INS_ENDIN , <nl> - XCORE_INS_ENTSP , <nl> - XCORE_INS_EQ , <nl> - XCORE_INS_EXTDP , <nl> - XCORE_INS_EXTSP , <nl> - XCORE_INS_FREER , <nl> - XCORE_INS_FREET , <nl> - XCORE_INS_GETD , <nl> - XCORE_INS_GET , <nl> - XCORE_INS_GETN , <nl> - XCORE_INS_GETR , <nl> - XCORE_INS_GETSR , <nl> - XCORE_INS_GETST , <nl> - XCORE_INS_GETTS , <nl> - XCORE_INS_INCT , <nl> - XCORE_INS_INIT , <nl> - XCORE_INS_INPW , <nl> - XCORE_INS_INSHR , <nl> - XCORE_INS_INT , <nl> - XCORE_INS_IN , <nl> - XCORE_INS_KCALL , <nl> - XCORE_INS_KENTSP , <nl> - XCORE_INS_KRESTSP , <nl> - XCORE_INS_KRET , <nl> - XCORE_INS_LADD , <nl> - XCORE_INS_LD16S , <nl> - XCORE_INS_LD8U , <nl> - XCORE_INS_LDA16 , <nl> - XCORE_INS_LDAP , <nl> - XCORE_INS_LDAW , <nl> - XCORE_INS_LDC , <nl> - XCORE_INS_LDW , <nl> - XCORE_INS_LDIVU , <nl> - XCORE_INS_LMUL , <nl> - XCORE_INS_LSS , <nl> - XCORE_INS_LSUB , <nl> - XCORE_INS_LSU , <nl> - XCORE_INS_MACCS , <nl> - XCORE_INS_MACCU , <nl> - XCORE_INS_MJOIN , <nl> - XCORE_INS_MKMSK , <nl> - XCORE_INS_MSYNC , <nl> - XCORE_INS_MUL , <nl> - XCORE_INS_NEG , <nl> - XCORE_INS_NOT , <nl> - XCORE_INS_OR , <nl> - XCORE_INS_OUTCT , <nl> - XCORE_INS_OUTPW , <nl> - XCORE_INS_OUTSHR , <nl> - XCORE_INS_OUTT , <nl> - XCORE_INS_OUT , <nl> - XCORE_INS_PEEK , <nl> - XCORE_INS_REMS , <nl> - XCORE_INS_REMU , <nl> - XCORE_INS_RETSP , <nl> - XCORE_INS_SETCLK , <nl> - XCORE_INS_SET , <nl> - XCORE_INS_SETC , <nl> - XCORE_INS_SETD , <nl> - XCORE_INS_SETEV , <nl> - XCORE_INS_SETN , <nl> - XCORE_INS_SETPSC , <nl> - XCORE_INS_SETPT , <nl> - XCORE_INS_SETRDY , <nl> - XCORE_INS_SETSR , <nl> - XCORE_INS_SETTW , <nl> - XCORE_INS_SETV , <nl> - XCORE_INS_SEXT , <nl> - XCORE_INS_SHL , <nl> - XCORE_INS_SHR , <nl> - XCORE_INS_SSYNC , <nl> - XCORE_INS_ST16 , <nl> - XCORE_INS_ST8 , <nl> - XCORE_INS_STW , <nl> - XCORE_INS_SUB , <nl> - XCORE_INS_SYNCR , <nl> - XCORE_INS_TESTCT , <nl> - XCORE_INS_TESTLCL , <nl> - XCORE_INS_TESTWCT , <nl> - XCORE_INS_TSETMR , <nl> - XCORE_INS_START , <nl> - XCORE_INS_WAITEF , <nl> - XCORE_INS_WAITET , <nl> - XCORE_INS_WAITEU , <nl> - XCORE_INS_XOR , <nl> - XCORE_INS_ZEXT , <nl> - <nl> - XCORE_INS_ENDING , / / < - - mark the end of the list of instructions <nl> - } xcore_insn ; <nl> - <nl> - / / > Group of XCore instructions <nl> - typedef enum xcore_insn_group <nl> - { <nl> - XCORE_GRP_INVALID = 0 , / / = CS_GRP_INVALID <nl> - <nl> - / / > Generic groups <nl> - / / all jump instructions ( conditional + direct + indirect jumps ) <nl> - XCORE_GRP_JUMP , / / = CS_GRP_JUMP <nl> - <nl> - XCORE_GRP_ENDING , / / < - - mark the end of the list of groups <nl> - } xcore_insn_group ; <nl> - <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> - <nl> - # endif <nl> new file mode 160000 <nl> index 000000000 . . 65d1e69b2 <nl> mmm / dev / null <nl> ppp b / src / dbg / capstone_wrapper <nl> @ @ - 0 , 0 + 1 @ @ <nl> + Subproject commit 65d1e69b29075dfeb4efee4b3daef4f477b80e71 <nl> mmm a / src / dbg / x64_dbg_dbg . vcxproj <nl> ppp b / src / dbg / x64_dbg_dbg . vcxproj <nl> <nl> < ClInclude Include = " BasicBlock . h " / > <nl> < ClInclude Include = " bookmark . h " / > <nl> < ClInclude Include = " breakpoint . h " / > <nl> - < ClInclude Include = " capstone \ arm . h " / > <nl> - < ClInclude Include = " capstone \ arm64 . h " / > <nl> - < ClInclude Include = " capstone \ capstone . h " / > <nl> - < ClInclude Include = " capstone \ mips . h " / > <nl> - < ClInclude Include = " capstone \ platform . h " / > <nl> - < ClInclude Include = " capstone \ ppc . h " / > <nl> - < ClInclude Include = " capstone \ sparc . h " / > <nl> - < ClInclude Include = " capstone \ systemz . h " / > <nl> - < ClInclude Include = " capstone \ x86 . h " / > <nl> - < ClInclude Include = " capstone \ xcore . h " / > <nl> < ClInclude Include = " CodeFollowPass . h " / > <nl> < ClInclude Include = " command . h " / > <nl> < ClInclude Include = " commandline . h " / > <nl> <nl> < SubSystem > Windows < / SubSystem > <nl> < EnableCOMDATFolding > true < / EnableCOMDATFolding > <nl> < OptimizeReferences > true < / OptimizeReferences > <nl> - < AdditionalDependencies > $ ( ProjectDir ) . . \ . . \ bin \ x32 \ capstone_wrapper . lib ; capstone \ capstone_x86 . lib ; yara \ yara_x86 . lib ; lz4 \ lz4_x86 . lib ; jansson \ jansson_x86 . lib ; DeviceNameResolver \ DeviceNameResolver_x86 . lib ; XEDParse \ XEDParse_x86 . lib ; $ ( SolutionDir ) bin \ x32 \ x32bridge . lib ; dbghelp \ dbghelp_x86 . lib ; TitanEngine \ TitanEngine_x86 . lib ; psapi . lib ; kernel32 . lib ; user32 . lib ; gdi32 . lib ; winspool . lib ; comdlg32 . lib ; advapi32 . lib ; shell32 . lib ; ole32 . lib ; oleaut32 . lib ; uuid . lib ; odbc32 . lib ; odbccp32 . lib ; shlwapi . lib ; % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> + < AdditionalDependencies > $ ( ProjectDir ) . . \ capstone_wrapper \ bin \ x32 \ capstone_wrapper . lib ; $ ( ProjectDir ) . . \ capstone_wrapper \ capstone \ capstone_x86 . lib ; yara \ yara_x86 . lib ; lz4 \ lz4_x86 . lib ; jansson \ jansson_x86 . lib ; DeviceNameResolver \ DeviceNameResolver_x86 . lib ; XEDParse \ XEDParse_x86 . lib ; $ ( SolutionDir ) bin \ x32 \ x32bridge . lib ; dbghelp \ dbghelp_x86 . lib ; TitanEngine \ TitanEngine_x86 . lib ; psapi . lib ; kernel32 . lib ; user32 . lib ; gdi32 . lib ; winspool . lib ; comdlg32 . lib ; advapi32 . lib ; shell32 . lib ; ole32 . lib ; oleaut32 . lib ; uuid . lib ; odbc32 . lib ; odbccp32 . lib ; shlwapi . lib ; % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> < / Link > <nl> < / ItemDefinitionGroup > <nl> < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > <nl> <nl> < SubSystem > Windows < / SubSystem > <nl> < EnableCOMDATFolding > false < / EnableCOMDATFolding > <nl> < OptimizeReferences > false < / OptimizeReferences > <nl> - < AdditionalDependencies > $ ( ProjectDir ) . . \ . . \ bin \ x32 \ capstone_wrapper . lib ; capstone \ capstone_x86 . lib ; yara \ yara_x86 . lib ; lz4 \ lz4_x86 . lib ; jansson \ jansson_x86 . lib ; DeviceNameResolver \ DeviceNameResolver_x86 . lib ; XEDParse \ XEDParse_x86 . lib ; $ ( SolutionDir ) bin \ x32 \ x32bridge . lib ; dbghelp \ dbghelp_x86 . lib ; TitanEngine \ TitanEngine_x86 . lib ; psapi . lib ; kernel32 . lib ; user32 . lib ; gdi32 . lib ; winspool . lib ; comdlg32 . lib ; advapi32 . lib ; shell32 . lib ; ole32 . lib ; oleaut32 . lib ; uuid . lib ; odbc32 . lib ; odbccp32 . lib ; shlwapi . lib ; % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> + < AdditionalDependencies > $ ( ProjectDir ) . . \ capstone_wrapper \ bin \ x32 \ capstone_wrapper . lib ; $ ( ProjectDir ) . . \ capstone_wrapper \ capstone \ capstone_x86 . lib ; yara \ yara_x86 . lib ; lz4 \ lz4_x86 . lib ; jansson \ jansson_x86 . lib ; DeviceNameResolver \ DeviceNameResolver_x86 . lib ; XEDParse \ XEDParse_x86 . lib ; $ ( SolutionDir ) bin \ x32 \ x32bridge . lib ; dbghelp \ dbghelp_x86 . lib ; TitanEngine \ TitanEngine_x86 . lib ; psapi . lib ; kernel32 . lib ; user32 . lib ; gdi32 . lib ; winspool . lib ; comdlg32 . lib ; advapi32 . lib ; shell32 . lib ; ole32 . lib ; oleaut32 . lib ; uuid . lib ; odbc32 . lib ; odbccp32 . lib ; shlwapi . lib ; % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> < / Link > <nl> < / ItemDefinitionGroup > <nl> < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | x64 ' " > <nl> <nl> < SubSystem > Windows < / SubSystem > <nl> < EnableCOMDATFolding > true < / EnableCOMDATFolding > <nl> < OptimizeReferences > true < / OptimizeReferences > <nl> - < AdditionalDependencies > $ ( ProjectDir ) . . \ . . \ bin \ x64 \ capstone_wrapper . lib ; capstone \ capstone_x64 . lib ; yara \ yara_x64 . lib ; lz4 \ lz4_x64 . lib ; jansson \ jansson_x64 . lib ; DeviceNameResolver \ DeviceNameResolver_x64 . lib ; XEDParse \ XEDParse_x64 . lib ; $ ( SolutionDir ) bin \ x64 \ x64bridge . lib ; dbghelp \ dbghelp_x64 . lib ; TitanEngine \ TitanEngine_x64 . lib ; psapi . lib ; kernel32 . lib ; user32 . lib ; gdi32 . lib ; winspool . lib ; comdlg32 . lib ; advapi32 . lib ; shell32 . lib ; ole32 . lib ; oleaut32 . lib ; uuid . lib ; odbc32 . lib ; odbccp32 . lib ; shlwapi . lib ; % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> + < AdditionalDependencies > $ ( ProjectDir ) . . \ capstone_wrapper \ bin \ x64 \ capstone_wrapper . lib ; $ ( ProjectDir ) . . \ capstone_wrapper \ capstone \ capstone_x64 . lib ; yara \ yara_x64 . lib ; lz4 \ lz4_x64 . lib ; jansson \ jansson_x64 . lib ; DeviceNameResolver \ DeviceNameResolver_x64 . lib ; XEDParse \ XEDParse_x64 . lib ; $ ( SolutionDir ) bin \ x64 \ x64bridge . lib ; dbghelp \ dbghelp_x64 . lib ; TitanEngine \ TitanEngine_x64 . lib ; psapi . lib ; kernel32 . lib ; user32 . lib ; gdi32 . lib ; winspool . lib ; comdlg32 . lib ; advapi32 . lib ; shell32 . lib ; ole32 . lib ; oleaut32 . lib ; uuid . lib ; odbc32 . lib ; odbccp32 . lib ; shlwapi . lib ; % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> < / Link > <nl> < / ItemDefinitionGroup > <nl> < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | x64 ' " > <nl> <nl> < SubSystem > Windows < / SubSystem > <nl> < EnableCOMDATFolding > false < / EnableCOMDATFolding > <nl> < OptimizeReferences > false < / OptimizeReferences > <nl> - < AdditionalDependencies > $ ( ProjectDir ) . . \ . . \ bin \ x64 \ capstone_wrapper . lib ; capstone \ capstone_x64 . lib ; yara \ yara_x64 . lib ; lz4 \ lz4_x64 . lib ; jansson \ jansson_x64 . lib ; DeviceNameResolver \ DeviceNameResolver_x64 . lib ; XEDParse \ XEDParse_x64 . lib ; $ ( SolutionDir ) bin \ x64 \ x64bridge . lib ; dbghelp \ dbghelp_x64 . lib ; TitanEngine \ TitanEngine_x64 . lib ; psapi . lib ; kernel32 . lib ; user32 . lib ; gdi32 . lib ; winspool . lib ; comdlg32 . lib ; advapi32 . lib ; shell32 . lib ; ole32 . lib ; oleaut32 . lib ; uuid . lib ; odbc32 . lib ; odbccp32 . lib ; shlwapi . lib ; % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> + < AdditionalDependencies > $ ( ProjectDir ) . . \ capstone_wrapper \ bin \ x64 \ capstone_wrapper . lib ; $ ( ProjectDir ) . . \ capstone_wrapper \ capstone \ capstone_x64 . lib ; yara \ yara_x64 . lib ; lz4 \ lz4_x64 . lib ; jansson \ jansson_x64 . lib ; DeviceNameResolver \ DeviceNameResolver_x64 . lib ; XEDParse \ XEDParse_x64 . lib ; $ ( SolutionDir ) bin \ x64 \ x64bridge . lib ; dbghelp \ dbghelp_x64 . lib ; TitanEngine \ TitanEngine_x64 . lib ; psapi . lib ; kernel32 . lib ; user32 . lib ; gdi32 . lib ; winspool . lib ; comdlg32 . lib ; advapi32 . lib ; shell32 . lib ; ole32 . lib ; oleaut32 . lib ; uuid . lib ; odbc32 . lib ; odbccp32 . lib ; shlwapi . lib ; % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> < / Link > <nl> < / ItemDefinitionGroup > <nl> < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . targets " / > <nl> mmm a / src / dbg / x64_dbg_dbg . vcxproj . filters <nl> ppp b / src / dbg / x64_dbg_dbg . vcxproj . filters <nl> <nl> < Filter Include = " Header Files \ Third Party \ yara \ yara " > <nl> < UniqueIdentifier > { f79c5166 - e315 - 44ca - 9e93 - dabc9f00fa78 } < / UniqueIdentifier > <nl> < / Filter > <nl> - < Filter Include = " Header Files \ Third Party \ capstone " > <nl> - < UniqueIdentifier > { 1c3bf89b - 90a5 - 4de7 - a96f - e73e4250c274 } < / UniqueIdentifier > <nl> - < / Filter > <nl> < Filter Include = " Header Files \ Analysis " > <nl> < UniqueIdentifier > { 3aba2399 - cfdf - 40be - 9265 - 2062f983bbfd } < / UniqueIdentifier > <nl> < / Filter > <nl> <nl> < ClInclude Include = " jansson \ jansson_x64dbg . h " > <nl> < Filter > Header Files \ Third Party \ jansson < / Filter > <nl> < / ClInclude > <nl> - < ClInclude Include = " capstone \ arm . h " > <nl> - < Filter > Header Files \ Third Party \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " capstone \ arm64 . h " > <nl> - < Filter > Header Files \ Third Party \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " capstone \ capstone . h " > <nl> - < Filter > Header Files \ Third Party \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " capstone \ mips . h " > <nl> - < Filter > Header Files \ Third Party \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " capstone \ platform . h " > <nl> - < Filter > Header Files \ Third Party \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " capstone \ ppc . h " > <nl> - < Filter > Header Files \ Third Party \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " capstone \ sparc . h " > <nl> - < Filter > Header Files \ Third Party \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " capstone \ systemz . h " > <nl> - < Filter > Header Files \ Third Party \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " capstone \ x86 . h " > <nl> - < Filter > Header Files \ Third Party \ capstone < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " capstone \ xcore . h " > <nl> - < Filter > Header Files \ Third Party \ capstone < / Filter > <nl> - < / ClInclude > <nl> < ClInclude Include = " expressionparser . h " > <nl> < Filter > Header Files \ Core < / Filter > <nl> < / ClInclude > <nl> mmm a / src / gui / x64dbg . pro <nl> ppp b / src / gui / x64dbg . pro <nl> LIBS + = - luser32 <nl> <nl> ! contains ( QMAKE_HOST . arch , x86_64 ) { <nl> # Windows x86 ( 32bit ) specific build <nl> - LIBS + = - L " $ $ PWD / . . / dbg / capstone / " - lcapstone_x86 <nl> - LIBS + = - L " $ $ PWD / Src / ThirdPartyLibs / snowman / " - lsnowman_x86 <nl> - LIBS + = - L " $ $ { X64_BIN_DIR } / " - lx32bridge - lcapstone_wrapper <nl> + LIBS + = - L " $ $ PWD / . . / capstone_wrapper / capstone " - lcapstone_x86 <nl> + LIBS + = - L " $ $ PWD / . . / capstone_wrapper / bin / x32 " - lcapstone_wrapper <nl> + LIBS + = - L " $ $ PWD / Src / ThirdPartyLibs / snowman " - lsnowman_x86 <nl> + LIBS + = - L " $ $ { X64_BIN_DIR } " - lx32bridge <nl> } else { <nl> # Windows x64 ( 64bit ) specific build <nl> - LIBS + = - L " $ $ PWD / . . / dbg / capstone / " - lcapstone_x64 <nl> - LIBS + = - L " $ $ PWD / Src / ThirdPartyLibs / snowman / " - lsnowman_x64 <nl> - LIBS + = - L " $ $ { X64_BIN_DIR } / " - lx64bridge - lcapstone_wrapper <nl> + LIBS + = - L " $ $ PWD / . . / capstone_wrapper / capstone " - lcapstone_x64 <nl> + LIBS + = - L " $ $ PWD / . . / capstone_wrapper / bin / x64 " - lcapstone_wrapper <nl> + LIBS + = - L " $ $ PWD / Src / ThirdPartyLibs / snowman " - lsnowman_x64 <nl> + LIBS + = - L " $ $ { X64_BIN_DIR } " - lx64bridge <nl> } <nl>
PROJECT : capstone_wrapper as a submodule
x64dbg/x64dbg
63c3101f384075719d5950319a61bcb5498b6249
2016-01-07T16:06:30Z
mmm a / libraries / testing / include / eosio / testing / tester . hpp <nl> ppp b / libraries / testing / include / eosio / testing / tester . hpp <nl> namespace eosio { namespace testing { <nl> return control - > get_database ( ) . find < ObjectType , IndexBy > ( forward < Args > ( args ) . . . ) ; <nl> } <nl> <nl> - public_key_type get_public_key ( name keyname , string role = " owner " ) const ; <nl> - private_key_type get_private_key ( name keyname , string role = " owner " ) const ; <nl> + template < typename KeyType = fc : : ecc : : private_key_shim > <nl> + private_key_type get_private_key ( name keyname , string role = " owner " ) const { <nl> + return private_key_type : : regenerate < KeyType > ( fc : : sha256 : : hash ( string ( keyname ) + role ) ) ; <nl> + } <nl> + <nl> + template < typename KeyType = fc : : ecc : : private_key_shim > <nl> + public_key_type get_public_key ( name keyname , string role = " owner " ) const { <nl> + return get_private_key < KeyType > ( keyname , role ) . get_public_key ( ) ; <nl> + } <nl> <nl> void set_code ( account_name name , const char * wast ) ; <nl> void set_code ( account_name name , const vector < uint8_t > wasm ) ; <nl> namespace eosio { namespace testing { <nl> <nl> <nl> unique_ptr < chain_controller > control ; <nl> + std : : map < chain : : public_key_type , chain : : private_key_type > block_signing_private_keys ; <nl> <nl> bool chain_has_transaction ( const transaction_id_type & txid ) const ; <nl> const transaction_receipt & get_transaction_receipt ( const transaction_id_type & txid ) const ; <nl> mmm a / libraries / testing / tester . cpp <nl> ppp b / libraries / testing / tester . cpp <nl> <nl> <nl> # include < fc / utility . hpp > <nl> # include < fc / io / json . hpp > <nl> + # include < eosio / chain / producer_object . hpp > <nl> <nl> # include " WAST / WAST . h " <nl> # include " WASM / WASM . h " <nl> namespace eosio { namespace testing { <nl> } <nl> <nl> <nl> - public_key_type base_tester : : get_public_key ( name keyname , string role ) const { <nl> - return get_private_key ( keyname , role ) . get_public_key ( ) ; <nl> - } <nl> - <nl> - <nl> - private_key_type base_tester : : get_private_key ( name keyname , string role ) const { <nl> - return private_key_type : : regenerate < fc : : ecc : : private_key_shim > ( fc : : sha256 : : hash ( string ( keyname ) + role ) ) ; <nl> - } <nl> - <nl> - <nl> void base_tester : : close ( ) { <nl> control . reset ( ) ; <nl> chain_transactions . clear ( ) ; <nl> namespace eosio { namespace testing { <nl> auto head_time = control - > head_block_time ( ) ; <nl> auto next_time = head_time + skip_time ; <nl> uint32_t slot = control - > get_slot_at_time ( next_time ) ; <nl> - auto sch_pro = control - > get_scheduled_producer ( slot ) ; <nl> - auto priv_key = get_private_key ( sch_pro , " active " ) ; <nl> + auto sch_pro = control - > get_scheduled_producer ( slot ) ; <nl> + const auto & sch_pro_signing_key = control - > get_producer ( sch_pro ) . signing_key ; <nl> + <nl> + private_key_type priv_key ; <nl> + / / Check if signing private key exist in the list <nl> + auto private_key_itr = block_signing_private_keys . find ( sch_pro_signing_key ) ; <nl> + if ( private_key_itr = = block_signing_private_keys . end ( ) ) { <nl> + / / If it ' s not found , default to active k1 key <nl> + priv_key = get_private_key ( sch_pro , " active " ) ; <nl> + } else { <nl> + priv_key = private_key_itr - > second ; <nl> + } <nl> <nl> return control - > generate_block ( next_time , sch_pro , priv_key , skip_flag ) ; <nl> } <nl> mmm a / tests / chain_tests / block_tests . cpp <nl> ppp b / tests / chain_tests / block_tests . cpp <nl> BOOST_AUTO_TEST_CASE ( account_ram_limit ) { try { <nl> <nl> } FC_LOG_AND_RETHROW ( ) } <nl> <nl> + BOOST_AUTO_TEST_CASE ( producer_r1_key ) { try { <nl> + <nl> + / / Use validating_tester to check that the block is synced properly <nl> + validating_tester chain ; <nl> + <nl> + / / Set new producer <nl> + account_name tester_producer_name = " tester " ; <nl> + chain . create_account ( tester_producer_name ) ; <nl> + auto producer_r1_priv_key = chain . get_private_key < fc : : crypto : : r1 : : private_key_shim > ( tester_producer_name , " active " ) ; <nl> + auto producer_r1_pub_key = producer_r1_priv_key . get_public_key ( ) ; <nl> + chain . push_action ( N ( eosio ) , N ( setprods ) , N ( eosio ) , <nl> + fc : : mutable_variant_object ( ) ( " version " , 1 ) ( " producers " , vector < producer_key > { { tester_producer_name , producer_r1_pub_key } } ) ) ; <nl> + <nl> + / / Add signing key to the tester object , so it can sign with the correct key <nl> + chain . block_signing_private_keys [ producer_r1_pub_key ] = producer_r1_priv_key ; <nl> + <nl> + / / Produce blocks , it should not throw any exception <nl> + BOOST_CHECK_NO_THROW ( chain . produce_blocks ( 1000 ) ) ; <nl> + <nl> + } FC_LOG_AND_RETHROW ( ) } <nl> + <nl> BOOST_AUTO_TEST_SUITE_END ( ) <nl>
Add unit test to verify producer can produce block with r1 signing key
EOSIO/eos
2961e1bcdbd96131addd4c3dd96f3fb94efcdf1e
2018-04-19T01:58:03Z
mmm a / folly / test / DynamicTest . cpp <nl> ppp b / folly / test / DynamicTest . cpp <nl> <nl> <nl> using folly : : dynamic ; <nl> <nl> - # ifndef FOLLY_SANITIZE_ADDRESS <nl> / / This test runs without any external dependencies , including json . <nl> / / This means that if there ' s a test failure , there ' s no way to print <nl> / / a useful runtime representation of the folly : : dynamic . We will <nl> using folly : : dynamic ; <nl> void dynamic : : print_as_pseudo_json ( std : : ostream & out ) const { <nl> out < < " < folly : : dynamic object of type " < < type_ < < " > " ; <nl> } <nl> - # endif <nl> <nl> TEST ( Dynamic , Default ) { <nl> dynamic obj ; <nl>
fix asan build
facebook/folly
2bbf87af3ab2fa277c9a9a81d907d754ccf28c50
2017-11-15T06:57:33Z
mmm a / SConstruct <nl> ppp b / SConstruct <nl> add_option ( ' cache - dir ' , <nl> ) <nl> <nl> add_option ( " cxx - std " , <nl> - choices = [ " 14 " , " 17 " ] , <nl> - default = " 14 " , <nl> + choices = [ " 17 " ] , <nl> + default = " 17 " , <nl> help = " Select the C + + langauge standard to build with " , <nl> ) <nl> <nl> elif env . TargetOSIs ( ' windows ' ) : <nl> env . Append ( CPPDEFINES = [ " UNICODE " ] ) <nl> <nl> # Temporary fixes to allow compilation with VS2017 <nl> - env . Append ( CPPDEFINES = [ " _SILENCE_FPOS_SEEKPOS_DEPRECATION_WARNING " ] ) <nl> + env . Append ( CPPDEFINES = [ <nl> + " _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS " , <nl> + " _SILENCE_FPOS_SEEKPOS_DEPRECATION_WARNING " , <nl> + ] ) <nl> <nl> # / EHsc exception handling style for visual studio <nl> # / W3 warning level <nl> env . Append ( CCFLAGS = [ " / EHsc " , " / W3 " ] ) <nl> <nl> - # some warnings we don ' t like : <nl> - # c4355 <nl> - # ' this ' : used in base member initializer list <nl> - # The this pointer is valid only within nonstatic member functions . It cannot be used in the initializer list for a base class . <nl> - # c4800 <nl> - # ' type ' : forcing value to bool ' true ' or ' false ' ( performance warning ) <nl> - # This warning is generated when a value that is not bool is assigned or coerced into type bool . <nl> - # c4267 <nl> - # ' var ' : conversion from ' size_t ' to ' type ' , possible loss of data <nl> - # When compiling with / Wp64 , or when compiling on a 64 - bit operating system , type is 32 bits but size_t is 64 bits when compiling for 64 - bit targets . To fix this warning , use size_t instead of a type . <nl> - # c4244 <nl> - # ' conversion ' conversion from ' type1 ' to ' type2 ' , possible loss of data <nl> - # An integer type is converted to a smaller integer type . <nl> - # c4290 <nl> - # C + + exception specification ignored except to indicate a function is not __declspec ( nothrow <nl> - # A function is declared using exception specification , which Visual C + + accepts but does not <nl> - # implement <nl> - # c4068 <nl> - # unknown pragma - - added so that we can specify unknown pragmas for other compilers <nl> - # c4351 <nl> - # on extremely old versions of MSVC ( pre 2k5 ) , default constructing an array member in a <nl> - # constructor ' s initialization list would not zero the array members " in some cases " . <nl> - # since we don ' t target MSVC versions that old , this warning is safe to ignore . <nl> - # c4373 <nl> - # Older versions of MSVC would fail to make a function in a derived class override a virtual <nl> - # function in the parent , when defined inline and at least one of the parameters is made const . <nl> - # The behavior is incorrect under the standard . MSVC is fixed now , and the warning exists <nl> - # merely to alert users who may have relied upon the older , non - compliant behavior . Our code <nl> - # should not have any problems with the older behavior , so we can just disable this warning . <nl> - env . Append ( CCFLAGS = [ " / wd4355 " , " / wd4800 " , " / wd4267 " , " / wd4244 " , <nl> - " / wd4290 " , " / wd4068 " , " / wd4351 " , " / wd4373 " ] ) <nl> + # Suppress some warnings we don ' t like , or find necessary to <nl> + # suppress . Please keep this list alphabetized and commented . <nl> + env . Append ( CCFLAGS = [ <nl> + <nl> + # C4068 : unknown pragma . added so that we can specify unknown <nl> + # pragmas for other compilers . <nl> + " / wd4068 " , <nl> + <nl> + # C4244 : ' conversion ' conversion from ' type1 ' to ' type2 ' , <nl> + # possible loss of data . An integer type is converted to a <nl> + # smaller integer type . <nl> + " / wd4244 " , <nl> + <nl> + # C4267 : ' var ' : conversion from ' size_t ' to ' type ' , possible <nl> + # loss of data . When compiling with / Wp64 , or when compiling <nl> + # on a 64 - bit operating system , type is 32 bits but size_t is <nl> + # 64 bits when compiling for 64 - bit targets . To fix this <nl> + # warning , use size_t instead of a type . <nl> + " / wd4267 " , <nl> + <nl> + # C4290 : C + + exception specification ignored except to <nl> + # indicate a function is not __declspec ( nothrow ) . A function <nl> + # is declared using exception specification , which Visual C + + <nl> + # accepts but does not implement . <nl> + " / wd4290 " , <nl> + <nl> + # C4351 : On extremely old versions of MSVC ( pre 2k5 ) , default <nl> + # constructing an array member in a constructor ' s <nl> + # initialization list would not zero the array members " in <nl> + # some cases " . Since we don ' t target MSVC versions that old , <nl> + # this warning is safe to ignore . <nl> + " / wd4351 " , <nl> + <nl> + # C4355 : ' this ' : used in base member initializer list . The <nl> + # this pointer is valid only within nonstatic member <nl> + # functions . It cannot be used in the initializer list for a <nl> + # base class <nl> + " / wd4355 " , <nl> + <nl> + # C4373 : Older versions of MSVC would fail to make a function <nl> + # in a derived class override a virtual function in the <nl> + # parent , when defined inline and at least one of the <nl> + # parameters is made const . The behavior is incorrect under <nl> + # the standard . MSVC is fixed now , and the warning exists <nl> + # merely to alert users who may have relied upon the older , <nl> + # non - compliant behavior . Our code should not have any <nl> + # problems with the older behavior , so we can just disable <nl> + # this warning . <nl> + " / wd4373 " , <nl> + <nl> + # C4800 : ' type ' : forcing value to bool ' true ' or ' false ' <nl> + # ( performance warning ) . This warning is generated when a <nl> + # value that is not bool is assigned or coerced into type <nl> + # bool . <nl> + " / wd4800 " , <nl> + <nl> + # C5041 : out - of - line definition for constexpr static data <nl> + # member is not needed and is deprecated in C + + 17 . We still <nl> + # have these , but we don ' t want to fix them up before we roll <nl> + # over to C + + 17 . <nl> + " / wd5041 " , <nl> + ] ) <nl> <nl> # mozjs - 60 requires the following <nl> # ' declaration ' : no matching operator delete found ; memory will not be freed if <nl> def doConfigure ( myenv ) : <nl> <nl> if myenv . ToolchainIs ( ' msvc ' ) : <nl> myenv . AppendUnique ( CXXFLAGS = [ ' / Zc : __cplusplus ' ] ) <nl> - if get_option ( ' cxx - std ' ) = = " 14 " : <nl> - myenv . AppendUnique ( CCFLAGS = [ ' / std : c + + 14 ' ] ) <nl> - elif get_option ( ' cxx - std ' ) = = " 17 " : <nl> + if get_option ( ' cxx - std ' ) = = " 17 " : <nl> myenv . AppendUnique ( CCFLAGS = [ ' / std : c + + 17 ' ] ) <nl> else : <nl> - if get_option ( ' cxx - std ' ) = = " 14 " : <nl> - if not AddToCXXFLAGSIfSupported ( myenv , ' - std = c + + 14 ' ) : <nl> - myenv . ConfError ( ' Compiler does not honor - std = c + + 14 ' ) <nl> - elif get_option ( ' cxx - std ' ) = = " 17 " : <nl> + if get_option ( ' cxx - std ' ) = = " 17 " : <nl> if not AddToCXXFLAGSIfSupported ( myenv , ' - std = c + + 17 ' ) : <nl> myenv . ConfError ( ' Compiler does not honor - std = c + + 17 ' ) <nl> <nl> def doConfigure ( myenv ) : <nl> if using_system_version_of_cxx_libraries ( ) : <nl> print ( ' WARNING : System versions of C + + libraries must be compiled with C + + 14 / 17 support ' ) <nl> <nl> - def CheckCxx14 ( context ) : <nl> - test_body = " " " <nl> - # if __cplusplus < 201402L <nl> - # error <nl> - # endif <nl> - auto DeducedReturnTypesAreACXX14Feature ( ) { <nl> - return 0 ; <nl> - } <nl> - " " " <nl> - <nl> - context . Message ( ' Checking for C + + 14 . . . ' ) <nl> - ret = context . TryCompile ( textwrap . dedent ( test_body ) , " . cpp " ) <nl> - context . Result ( ret ) <nl> - return ret <nl> - <nl> def CheckCxx17 ( context ) : <nl> test_body = " " " <nl> # if __cplusplus < 201703L <nl> def doConfigure ( myenv ) : <nl> return ret <nl> <nl> conf = Configure ( myenv , help = False , custom_tests = { <nl> - ' CheckCxx14 ' : CheckCxx14 , <nl> ' CheckCxx17 ' : CheckCxx17 , <nl> } ) <nl> <nl> - if not conf . CheckCxx14 ( ) : <nl> - myenv . ConfError ( ' C + + 14 support is required to build MongoDB ' ) <nl> - <nl> if get_option ( ' cxx - std ' ) = = " 17 " and not conf . CheckCxx17 ( ) : <nl> - myenv . ConfError ( ' C + + 17 was requested , but the compiler appears not to offer it ' ) <nl> + myenv . ConfError ( ' C + + 17 support is required to build MongoDB ' ) <nl> <nl> conf . Finish ( ) <nl> <nl> mmm a / etc / evergreen . yml <nl> ppp b / etc / evergreen . yml <nl> buildvariants : <nl> - name : publish_packages <nl> - name : push <nl> <nl> - - name : enterprise - ubuntu1804 - 64 - gcc - cxx17 <nl> - display_name : ~ Enterprise Ubuntu 18 . 04 ( System GCC 7 . x C + + 17 DEBUG ) <nl> - modules : <nl> - - enterprise <nl> - run_on : <nl> - - ubuntu1804 - test <nl> - batchtime : 1440 # 1 day <nl> - expansions : <nl> - compile_flags : > - <nl> - - - dbg = on <nl> - - - opt = on <nl> - - - ssl <nl> - - j $ ( grep - c ^ processor / proc / cpuinfo ) <nl> - CC = gcc - 7 <nl> - CXX = g + + - 7 <nl> - - - cxx - std = 17 <nl> - - - disable - warnings - as - errors <nl> - repo_edition : enterprise <nl> - scons_cache_scope : shared <nl> - tooltags : " ssl sasl " <nl> - build_mongoreplay : true <nl> - display_tasks : <nl> - - * dbtest <nl> - - * unittests <nl> - tasks : <nl> - - name : compile_all_run_unittests_TG <nl> - distros : <nl> - - ubuntu1804 - build <nl> - - name : audit <nl> - - name : ese <nl> - - name : jsCore <nl> - - name : jsCore_auth <nl> - - name : jsCore_txns <nl> - - name : causally_consistent_jscore_txns_passthrough <nl> - - name : sasl <nl> - - name : snmp <nl> - - name : ssl <nl> - - name : sslSpecial <nl> - <nl> - - name : enterprise - ubuntu1804 - 64 - clang - cxx17 <nl> - display_name : ~ Enterprise Ubuntu 18 . 04 ( System clang 6 . 0 C + + 17 libc + + DEBUG ) <nl> - modules : <nl> - - enterprise <nl> - run_on : <nl> - - ubuntu1804 - test <nl> - batchtime : 1440 # 1 day <nl> - expansions : <nl> - compile_flags : > - <nl> - - - dbg = on <nl> - - - opt = on <nl> - - - ssl <nl> - - j $ ( grep - c ^ processor / proc / cpuinfo ) <nl> - CC = clang - 6 . 0 <nl> - CXX = clang + + - 6 . 0 <nl> - - - libc + + <nl> - - - cxx - std = 17 <nl> - - - disable - warnings - as - errors <nl> - CXXFLAGS = " - Wno - register " <nl> - repo_edition : enterprise <nl> - scons_cache_scope : shared <nl> - tooltags : " ssl sasl " <nl> - build_mongoreplay : true <nl> - display_tasks : <nl> - - * dbtest <nl> - - * unittests <nl> - tasks : <nl> - - name : compile_all_run_unittests_TG <nl> - distros : <nl> - - ubuntu1804 - build <nl> - - name : audit <nl> - - name : ese <nl> - - name : jsCore <nl> - - name : jsCore_auth <nl> - - name : jsCore_txns <nl> - - name : causally_consistent_jscore_txns_passthrough <nl> - - name : replica_sets_auth <nl> - - name : sasl <nl> - - name : sharding_auth <nl> - - name : snmp <nl> - - name : ssl <nl> - - name : sslSpecial <nl> - - name : stitch_support_lib_build_and_test <nl> - - name : stitch_support_lib_build_and_archive <nl> - - name : watchdog_wiredtiger <nl> - <nl> - name : ubuntu1604 <nl> display_name : SSL Ubuntu 16 . 04 <nl> run_on : <nl> buildvariants : <nl> distros : <nl> - rhel70 - small <nl> <nl> - - name : enterprise - osx - 1011 - xcode - 10 - cxx17 <nl> - display_name : ~ Enterprise macOS 10 . 11 ( XCode 10 . 1 C + + 17 ) <nl> - modules : <nl> - - enterprise <nl> - run_on : <nl> - - macos - 1014 <nl> - batchtime : 1440 # 1 day <nl> - expansions : <nl> - test_flags : - - excludeWithAnyTags = requires_ssl_mongo_tools <nl> - compile_env : DEVELOPER_DIR = / Applications / Xcode10 . 1 . app <nl> - compile_flags : > - <nl> - - - ssl <nl> - - j $ ( sysctl - n hw . logicalcpu ) <nl> - - - libc + + <nl> - - - variables - files = etc / scons / xcode_macosx . vars <nl> - - - cxx - std = 17 <nl> - CXXFLAGS = " - Wno - register " <nl> - resmoke_jobs_max : 1 <nl> - tooltags : " ssl sasl " <nl> - build_mongoreplay : true <nl> - display_tasks : <nl> - - * dbtest <nl> - - * unittests <nl> - tasks : <nl> - - name : compile_all_run_unittests_TG <nl> - - name : audit <nl> - - name : auth_audit <nl> - - name : ese <nl> - - name : jsCore <nl> - - name : jsCore_auth <nl> - - name : jsCore_txns <nl> - - name : causally_consistent_jscore_txns_passthrough <nl> - - name : jstestfuzz_gen <nl> - - name : jstestfuzz_concurrent_gen <nl> - - name : jstestfuzz_concurrent_replication_gen <nl> - - name : jstestfuzz_concurrent_sharded_gen <nl> - - name : jstestfuzz_replication_gen <nl> - - name : jstestfuzz_sharded_gen <nl> - - name : logical_session_cache_replication_1sec_refresh_jscore_passthrough <nl> - - name : logical_session_cache_sharding_1sec_refresh_jscore_passthrough <nl> - - name : logical_session_cache_standalone_1sec_refresh_jscore_passthrough <nl> - - name : replica_sets_auth <nl> - - name : replica_sets_jscore_passthrough <nl> - - name : sasl <nl> - - name : ssl <nl> - - name : sslSpecial <nl> - - name : stitch_support_lib_build_and_test <nl> - - name : stitch_support_lib_build_and_archive <nl> - <nl> - name : enterprise - osx - 1010 - openssl <nl> display_name : ~ Enterprise macOS 10 . 10 OpenSSL <nl> modules : <nl> buildvariants : <nl> - j $ ( grep - c ^ processor / proc / cpuinfo ) <nl> - - toolchain - root = $ ( dirname $ ( pwd ) ) / android_toolchain - arm - 21 <nl> - - variables - files = etc / scons / android_toolchain . vars <nl> - - - cxx - std = 17 <nl> LIBS = clang_rt . builtins - arm - android <nl> LIBPATH = " $ ( dirname $ ( $ ( dirname $ ( pwd ) ) / android_toolchain - arm - 21 / bin / clang - print - file - name = libclang_rt . builtins - arm - android . a ) ) \ $ BUILD_ROOT / mongo - embedded - sdk - \ $ MONGO_VERSION / lib " <nl> - - lto <nl> buildvariants : <nl> - j $ ( grep - c ^ processor / proc / cpuinfo ) <nl> - - toolchain - root = $ ( dirname $ ( pwd ) ) / android_toolchain - arm64 - 21 <nl> - - variables - files = etc / scons / android_toolchain . vars <nl> - - - cxx - std = 17 <nl> LIBPATH = " \ $ BUILD_ROOT / mongo - embedded - sdk - \ $ MONGO_VERSION / lib " <nl> - - lto <nl> AR = $ ( dirname $ ( pwd ) ) / android_toolchain - arm64 - 21 / bin / llvm - ar <nl> buildvariants : <nl> - j $ ( grep - c ^ processor / proc / cpuinfo ) <nl> - - toolchain - root = $ ( dirname $ ( pwd ) ) / android_toolchain - x86_64 - 21 <nl> - - variables - files = etc / scons / android_toolchain . vars <nl> - - - cxx - std = 17 <nl> LIBPATH = " \ $ BUILD_ROOT / mongo - embedded - sdk - \ $ MONGO_VERSION / lib " <nl> - - lto <nl> AR = $ ( dirname $ ( pwd ) ) / android_toolchain - x86_64 - 21 / bin / llvm - ar <nl> buildvariants : <nl> stepback : false <nl> tasks : <nl> - name : shared_scons_cache_pruning <nl> - <nl> - - name : windows - 64 - vs2017 - cxx17 <nl> - display_name : " Windows VS2017 Canary C + + 17 Builder " <nl> - run_on : <nl> - - windows - 64 - vs2017 - test <nl> - modules : <nl> - - enterprise <nl> - expansions : <nl> - platform_decompress : unzip <nl> - exe : " . exe " <nl> - content_type : application / zip <nl> - compile_flags : CPPPATH = " c : / sasl / include c : / snmp / include " LIBPATH = " c : / sasl / lib c : / snmp / lib " MSVC_VERSION = 14 . 1 CXXFLAGS = " / wd4834 / wd5033 / wd5041 " CPPDEFINES = " _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS " - - cxx - std = 17 - - dynamic - windows - - dbg = off - - opt = on - j $ ( ( $ ( grep - c ^ processor / proc / cpuinfo ) / 2 ) ) <nl> - # We invoke SCons using - - jobs = ( # of CPUs / 4 ) to avoid causing out of memory errors due to <nl> - # spawning a large number of linker processes . <nl> - num_scons_link_jobs_available : $ ( ( $ ( grep - c ^ processor / proc / cpuinfo ) / 4 ) ) <nl> - python : python <nl> - python3 : ' / cygdrive / c / python / python36 / python . exe ' <nl> - ext : zip <nl> - use_scons_cache : true <nl> - multiversion_platform : windows <nl> - multiversion_edition : enterprise <nl> - tooltags : " " <nl> - build_mongoreplay : false <nl> - display_tasks : <nl> - - * dbtest <nl> - - * unittests <nl> - tasks : <nl> - - name : compile_all_run_unittests_TG <nl> - distros : <nl> - - windows - 64 - vs2017 - compile <nl> - - name : audit <nl> - - name : ese <nl> - - name : jsCore <nl> - - name : jsCore_auth <nl> - - name : jsCore_txns <nl> - - name : causally_consistent_jscore_txns_passthrough <nl> - - name : sasl <nl> - - name : snmp <nl> - - name : ssl <nl> - - name : sslSpecial <nl> mmm a / src / mongo / db / index / sort_key_generator_test . cpp <nl> ppp b / src / mongo / db / index / sort_key_generator_test . cpp <nl> TEST ( SortKeyGeneratorTest , SortKeyGenerationForArraysRespectsCompoundOrdering ) { <nl> DEATH_TEST ( SortKeyGeneratorTest , <nl> SortPatternComponentWithStringIsFatal , <nl> " Invariant failure elt . type ( ) = = BSONType : : Object " ) { <nl> - stdx : : make_unique < SortKeyGenerator > ( BSON ( " a " <nl> - < < " foo " ) , <nl> - nullptr ) ; <nl> + MONGO_COMPILER_VARIABLE_UNUSED auto ignored = <nl> + stdx : : make_unique < SortKeyGenerator > ( BSON ( " a " <nl> + < < " foo " ) , <nl> + nullptr ) ; <nl> } <nl> <nl> DEATH_TEST ( SortKeyGeneratorTest , <nl> SortPatternComponentWhoseObjectHasMultipleKeysIsFatal , <nl> " Invariant failure elt . embeddedObject ( ) . nFields ( ) = = 1 " ) { <nl> - stdx : : make_unique < SortKeyGenerator > ( BSON ( " a " < < BSON ( " $ meta " <nl> - < < " textScore " <nl> - < < " extra " <nl> - < < 1 ) ) , <nl> - nullptr ) ; <nl> + MONGO_COMPILER_VARIABLE_UNUSED auto ignored = <nl> + stdx : : make_unique < SortKeyGenerator > ( BSON ( " a " < < BSON ( " $ meta " <nl> + < < " textScore " <nl> + < < " extra " <nl> + < < 1 ) ) , <nl> + nullptr ) ; <nl> } <nl> <nl> DEATH_TEST ( SortKeyGeneratorTest , <nl> SortPatternComponentWithNonMetaObjectSortIsFatal , <nl> " Invariant failure metaElem . fieldNameStringData ( ) = = \ " $ meta \ " _sd " ) { <nl> - stdx : : make_unique < SortKeyGenerator > ( BSON ( " a " < < BSON ( " $ unknown " <nl> - < < " textScore " ) ) , <nl> - nullptr ) ; <nl> + MONGO_COMPILER_VARIABLE_UNUSED auto ignored = <nl> + stdx : : make_unique < SortKeyGenerator > ( BSON ( " a " < < BSON ( " $ unknown " <nl> + < < " textScore " ) ) , <nl> + nullptr ) ; <nl> } <nl> <nl> DEATH_TEST ( SortKeyGeneratorTest , <nl> SortPatternComponentWithUnknownMetaKeywordIsFatal , <nl> " Invariant failure metaElem . valueStringData ( ) = = \ " randVal \ " _sd " ) { <nl> - stdx : : make_unique < SortKeyGenerator > ( BSON ( " a " < < BSON ( " $ meta " <nl> - < < " unknown " ) ) , <nl> - nullptr ) ; <nl> + MONGO_COMPILER_VARIABLE_UNUSED auto ignored = <nl> + stdx : : make_unique < SortKeyGenerator > ( BSON ( " a " < < BSON ( " $ meta " <nl> + < < " unknown " ) ) , <nl> + nullptr ) ; <nl> } <nl> <nl> DEATH_TEST ( SortKeyGeneratorTest , <nl> mmm a / src / mongo / db / update / push_node . cpp <nl> ppp b / src / mongo / db / update / push_node . cpp <nl> ModifierNode : : ModifyResult PushNode : : insertElementsWithPosition ( <nl> result = ModifyResult : : kNormalUpdate ; <nl> } <nl> <nl> - / / We insert all the rest of the elements after the one we just inserted . <nl> - std : : accumulate ( std : : next ( valuesToPush . begin ( ) ) , <nl> - valuesToPush . end ( ) , <nl> - firstElementToInsert , <nl> - [ & document ] ( auto & insertAfter , auto & valueToInsert ) { <nl> - auto nextElementToInsert = <nl> - document . makeElementWithNewFieldName ( StringData ( ) , valueToInsert ) ; <nl> - invariant ( insertAfter . addSiblingRight ( nextElementToInsert ) ) ; <nl> - return nextElementToInsert ; <nl> - } ) ; <nl> + / / We insert all the rest of the elements after the one we just <nl> + / / inserted . <nl> + / / <nl> + / / TODO : The use of std : : accumulate here is maybe questionable <nl> + / / given that we are ignoring the return value . MSVC flagged this , <nl> + / / and we worked around by tagging the result as unused . <nl> + MONGO_COMPILER_VARIABLE_UNUSED auto ignored = <nl> + std : : accumulate ( std : : next ( valuesToPush . begin ( ) ) , <nl> + valuesToPush . end ( ) , <nl> + firstElementToInsert , <nl> + [ & document ] ( auto & insertAfter , auto & valueToInsert ) { <nl> + auto nextElementToInsert = <nl> + document . makeElementWithNewFieldName ( StringData ( ) , valueToInsert ) ; <nl> + invariant ( insertAfter . addSiblingRight ( nextElementToInsert ) ) ; <nl> + return nextElementToInsert ; <nl> + } ) ; <nl> <nl> return result ; <nl> } <nl>
SERVER - 37607 SERVER - 37608 Require C + + 17 and make it the default
mongodb/mongo
01d84b2565fc9ea9626a55dcf1f3f817968088f2
2019-01-31T15:17:03Z
mmm a / test / sanitizer_suppressions / tsan <nl> ppp b / test / sanitizer_suppressions / tsan <nl> race : ProcessNewBlock <nl> race : ThreadImport <nl> race : LoadWallet <nl> race : WalletBatch : : WriteHDChain <nl> + race : BerkeleyBatch <nl> race : BerkeleyDatabase <nl> race : zmq : : * <nl> race : bitcoin - qt <nl>
Merge : ci : Add tsan suppression for race in BerkeleyBatch
bitcoin/bitcoin
f4301e9107924c101d7738de4123b8a5c888bad5
2020-07-05T23:06:03Z
mmm a / cocos2dx / cocoa / CCObject . cpp <nl> ppp b / cocos2dx / cocoa / CCObject . cpp <nl> CCObject : : CCObject ( void ) <nl> static unsigned int uObjectCount = 0 ; <nl> <nl> m_uID = + + uObjectCount ; <nl> - m_uLuaID = 0 ; <nl> + m_nLuaID = 0 ; <nl> <nl> / / when the object is created , the refrence count of it is 1 <nl> m_uReference = 1 ; <nl> CCObject : : ~ CCObject ( void ) <nl> <nl> # if CC_LUA_ENGINE_ENABLED <nl> / / if the object is referenced by Lua engine , remove it <nl> - if ( m_uLuaID ) <nl> + if ( m_nLuaID ) <nl> { <nl> - CCLuaEngine : : sharedEngine ( ) - > removeCCObjectByID ( m_uLuaID ) ; <nl> + CCLuaEngine : : sharedEngine ( ) - > removeCCObjectByID ( m_nLuaID ) ; <nl> } <nl> # endif <nl> } <nl> mmm a / cocos2dx / include / CCObject . h <nl> ppp b / cocos2dx / include / CCObject . h <nl> class CC_DLL CCObject : public CCCopying <nl> / / object id , CCLuaEngine need public m_uID <nl> unsigned int m_uID ; <nl> / / Lua reference id <nl> - unsigned int m_uLuaID ; <nl> + int m_nLuaID ; <nl> protected : <nl> / / count of refrence <nl> unsigned int m_uReference ; <nl> mmm a / lua / cocos2dx_support / LuaCocos2d . cpp . REMOVED . git - id <nl> ppp b / lua / cocos2dx_support / LuaCocos2d . cpp . REMOVED . git - id <nl> @ @ - 1 + 1 @ @ <nl> - ec9653c088757bb11c48b51be00863d103543e35 <nl> \ No newline at end of file <nl> + 5dfaf1c97c88973369134e7b3ffed9fecf115f44 <nl> \ No newline at end of file <nl> mmm a / lua / cocos2dx_support / tolua_fix . c <nl> ppp b / lua / cocos2dx_support / tolua_fix . c <nl> TOLUA_API void tolua_prepare_ccobject_table ( lua_State * L ) <nl> } <nl> <nl> TOLUA_API int tolua_pushusertype_ccobject ( lua_State * L , <nl> - unsigned int refid , <nl> - unsigned int * p_refid , <nl> + int refid , <nl> + int * p_refid , <nl> void * ptr , <nl> const char * type ) <nl> { <nl> mmm a / lua / cocos2dx_support / tolua_fix . h <nl> ppp b / lua / cocos2dx_support / tolua_fix . h <nl> extern " C " <nl> <nl> TOLUA_API void tolua_prepare_ccobject_table ( lua_State * L ) ; <nl> TOLUA_API int tolua_pushusertype_ccobject ( lua_State * L , <nl> - unsigned int uid , <nl> - unsigned int * p_refid , <nl> + int uid , <nl> + int * p_refid , <nl> void * ptr , <nl> const char * type ) ; <nl> TOLUA_API int tolua_remove_ccobject_by_refid ( lua_State * L , int refid ) ; <nl> - <nl> TOLUA_API int tolua_ref_function ( lua_State * L , int lo , int def ) ; <nl> TOLUA_API void tolua_remove_function_by_refid ( lua_State * L , int refid ) ; <nl> - <nl> TOLUA_API int tolua_isfunction ( lua_State * L , int lo , tolua_Error * err ) ; <nl> - <nl> TOLUA_API void tolua_stack_dump ( lua_State * L , const char * label ) ; <nl> <nl> # ifdef __cplusplus <nl> mmm a / tools / tolua + + / build . xml <nl> ppp b / tools / tolua + + / build . xml <nl> <nl> < replace file = " LuaCocos2d . cpp " > <nl> < replacetoken > < ! [ CDATA [ tolua_pushusertype_ccobject ( tolua_S , ( void * ) tolua_ret ] ] > < / replacetoken > <nl> < replacevalue > < ! [ CDATA [ int uID = ( tolua_ret ) ? tolua_ret - > m_uID : - 1 ; <nl> - unsigned int * pLuaID = ( tolua_ret ) ? & tolua_ret - > m_uLuaID : NULL ; <nl> + int * pLuaID = ( tolua_ret ) ? & tolua_ret - > m_nLuaID : NULL ; <nl> tolua_pushusertype_ccobject ( tolua_S , uID , pLuaID , ( void * ) tolua_ret ] ] > < / replacevalue > <nl> < / replace > <nl> <nl> mmm a / tools / tolua + + / build_macosx . xml <nl> ppp b / tools / tolua + + / build_macosx . xml <nl> <nl> < replace file = " LuaCocos2d . cpp " > <nl> < replacetoken > < ! [ CDATA [ tolua_pushusertype_ccobject ( tolua_S , ( void * ) tolua_ret ] ] > < / replacetoken > <nl> < replacevalue > < ! [ CDATA [ int uID = ( tolua_ret ) ? tolua_ret - > m_uID : - 1 ; <nl> - unsigned int * pLuaID = ( tolua_ret ) ? & tolua_ret - > m_uLuaID : NULL ; <nl> + int * pLuaID = ( tolua_ret ) ? & tolua_ret - > m_nLuaID : NULL ; <nl> tolua_pushusertype_ccobject ( tolua_S , uID , pLuaID , ( void * ) tolua_ret ] ] > < / replacevalue > <nl> < / replace > <nl> <nl>
* change unsigned int CCObject : : m_uLuaID - > int CCObject : : m_nLuaID , because LUA_INTEGER is int .
cocos2d/cocos2d-x
69a7e2a2e3c65ae0636b1edc20f87cc455abc28e
2012-02-04T03:34:17Z
mmm a / tensorflow / workspace . bzl <nl> ppp b / tensorflow / workspace . bzl <nl> def tf_workspace ( path_prefix = " " , tf_repo_name = " " ) : <nl> tf_http_archive ( <nl> name = " llvm " , <nl> build_file = clean_dep ( " / / third_party / llvm : llvm . autogenerated . BUILD " ) , <nl> - sha256 = " 2027c5043ea3458376fbf4263aaab3b257736b9e4a1e9e9984f15e245177979d " , <nl> - strip_prefix = " llvm - 82a2c96ee81a617918d9bcc0fbe9af860e437f5f " , <nl> + sha256 = " 986122dee6053db98d4cf8a60efedd6d94e20c557cc97299a0c7d33b9efae12d " , <nl> + strip_prefix = " llvm - 329f768b5fc380a4bfa327396f108a8d8f33e77b " , <nl> urls = [ <nl> - " https : / / mirror . bazel . build / github . com / llvm - mirror / llvm / archive / 82a2c96ee81a617918d9bcc0fbe9af860e437f5f . tar . gz " , <nl> - " https : / / github . com / llvm - mirror / llvm / archive / 82a2c96ee81a617918d9bcc0fbe9af860e437f5f . tar . gz " , <nl> + " https : / / mirror . bazel . build / github . com / llvm - mirror / llvm / archive / 329f768b5fc380a4bfa327396f108a8d8f33e77b . tar . gz " , <nl> + " https : / / github . com / llvm - mirror / llvm / archive / 329f768b5fc380a4bfa327396f108a8d8f33e77b . tar . gz " , <nl> ] , <nl> ) <nl> <nl>
[ TF : XLA ] Bump open source llvm revision to r351428
tensorflow/tensorflow
741fb41f3cafc5750b3d1f6ab3ba366b8cf93b34
2019-01-17T22:39:57Z
new file mode 100644 <nl> index 000000000000 . . 1600c91a92c1 <nl> mmm / dev / null <nl> ppp b / xbmc / android / jni / Cursor . cpp <nl> <nl> + / * <nl> + * Copyright ( C ) 2013 Team XBMC <nl> + * http : / / www . xbmc . org <nl> + * <nl> + * This Program is free software ; you can redistribute it and / or modify <nl> + * it under the terms of the GNU General Public License as published by <nl> + * the Free Software Foundation ; either version 2 , or ( at your option ) <nl> + * any later version . <nl> + * <nl> + * This Program is distributed in the hope that it will be useful , <nl> + * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> + * GNU General Public License for more details . <nl> + * <nl> + * You should have received a copy of the GNU General Public License <nl> + * along with XBMC ; see the file COPYING . If not , see <nl> + * < http : / / www . gnu . org / licenses / > . <nl> + * <nl> + * / <nl> + # include " Cursor . h " <nl> + # include " jutils / jutils - details . hpp " <nl> + # include " URI . h " <nl> + <nl> + using namespace jni ; <nl> + <nl> + int CJNICursor : : FIELD_TYPE_NULL ( 0 ) ; <nl> + int CJNICursor : : FIELD_TYPE_INTEGER ( 0 ) ; <nl> + int CJNICursor : : FIELD_TYPE_FLOAT ( 0 ) ; <nl> + int CJNICursor : : FIELD_TYPE_STRING ( 0 ) ; <nl> + int CJNICursor : : FIELD_TYPE_BLOB ( 0 ) ; <nl> + <nl> + CJNICursor : : CJNICursor ( const jni : : jhobject & object ) : CJNIBase ( object ) <nl> + { <nl> + FIELD_TYPE_NULL = ( get_static_field < int > ( m_object , " FIELD_TYPE_NULL " ) ) ; <nl> + FIELD_TYPE_INTEGER = ( get_static_field < int > ( m_object , " FIELD_TYPE_INTEGER " ) ) ; <nl> + FIELD_TYPE_FLOAT = ( get_static_field < int > ( m_object , " FIELD_TYPE_FLOAT " ) ) ; <nl> + FIELD_TYPE_STRING = ( get_static_field < int > ( m_object , " FIELD_TYPE_STRING " ) ) ; <nl> + FIELD_TYPE_BLOB = ( get_static_field < int > ( m_object , " FIELD_TYPE_BLOB " ) ) ; <nl> + } <nl> + <nl> + int CJNICursor : : getCount ( ) <nl> + { <nl> + return call_method < jint > ( m_object , " getCount " , " ( ) I " ) ; <nl> + } <nl> + <nl> + int CJNICursor : : getPosition ( ) <nl> + { <nl> + return call_method < jint > ( m_object , " getPosition " , " ( ) I " ) ; <nl> + } <nl> + <nl> + bool CJNICursor : : move ( int offset ) <nl> + { <nl> + return call_method < jboolean > ( m_object , " move " , " ( I ) Z " , offset ) ; <nl> + } <nl> + <nl> + bool CJNICursor : : moveToPosition ( int position ) <nl> + { <nl> + return call_method < jboolean > ( m_object , " moveToPosition " , " ( I ) Z " , position ) ; <nl> + } <nl> + <nl> + bool CJNICursor : : moveToFirst ( ) <nl> + { <nl> + return call_method < jboolean > ( m_object , " moveToFirst " , " ( ) Z " ) ; <nl> + } <nl> + <nl> + bool CJNICursor : : moveToLast ( ) <nl> + { <nl> + return call_method < jboolean > ( m_object , " moveToLast " , " ( ) Z " ) ; <nl> + } <nl> + <nl> + bool CJNICursor : : moveToNext ( ) <nl> + { <nl> + return call_method < jboolean > ( m_object , " moveToNext " , " ( ) Z " ) ; <nl> + } <nl> + <nl> + bool CJNICursor : : moveToPrevious ( ) <nl> + { <nl> + return call_method < jboolean > ( m_object , " moveToPrevious " , " ( ) Z " ) ; <nl> + } <nl> + <nl> + bool CJNICursor : : isFirst ( ) <nl> + { <nl> + return call_method < jboolean > ( m_object , " isFirst " , " ( ) Z " ) ; <nl> + } <nl> + <nl> + bool CJNICursor : : isLast ( ) <nl> + { <nl> + return call_method < jboolean > ( m_object , " isLast " , " ( ) Z " ) ; <nl> + } <nl> + <nl> + bool CJNICursor : : isBeforeFirst ( ) <nl> + { <nl> + return call_method < jboolean > ( m_object , " isBeforeFirst " , " ( ) Z " ) ; <nl> + } <nl> + <nl> + bool CJNICursor : : isAfterLast ( ) <nl> + { <nl> + return call_method < jboolean > ( m_object , " isAfterLast " , " ( ) Z " ) ; <nl> + } <nl> + <nl> + int CJNICursor : : getColumnIndex ( const std : : string & columnName ) <nl> + { <nl> + return call_method < jint > ( m_object , " getColumnIndex " , " ( Ljava / lang / String ; ) I " , jcast < jhstring > ( columnName ) ) ; <nl> + } <nl> + <nl> + std : : string CJNICursor : : getColumnName ( int columnIndex ) <nl> + { <nl> + return jcast < std : : string > ( call_method < jhstring > ( m_object , " getColumnName " , " ( I ) Ljava / lang / String ; " , columnIndex ) ) ; <nl> + } <nl> + <nl> + std : : vector < std : : string > CJNICursor : : getColumnNames ( ) <nl> + { <nl> + return jcast < std : : vector < std : : string > > ( call_method < jhobjectArray > ( m_object , " getColumnNames " , " ( ) [ Ljava / lang / String ; " ) ) ; <nl> + } <nl> + <nl> + int CJNICursor : : getColumnCount ( ) <nl> + { <nl> + return call_method < jint > ( m_object , " getColumnCount " , " ( ) I " ) ; <nl> + } <nl> + <nl> + std : : string CJNICursor : : getString ( int columnIndex ) <nl> + { <nl> + return jcast < std : : string > ( call_method < jhstring > ( m_object , " getString " , " ( I ) Ljava / lang / String ; " , columnIndex ) ) ; <nl> + } <nl> + <nl> + short CJNICursor : : getShort ( int columnIndex ) <nl> + { <nl> + return call_method < jshort > ( m_object , " getShort " , " ( ) S " , columnIndex ) ; <nl> + } <nl> + <nl> + int CJNICursor : : getInt ( int columnIndex ) <nl> + { <nl> + return call_method < jint > ( m_object , " getInt " , " ( ) I " , columnIndex ) ; <nl> + } <nl> + <nl> + long CJNICursor : : getLong ( int columnIndex ) <nl> + { <nl> + return call_method < jint > ( m_object , " getLong " , " ( ) J " , columnIndex ) ; <nl> + } <nl> + <nl> + float CJNICursor : : getFloat ( int columnIndex ) <nl> + { <nl> + return call_method < jfloat > ( m_object , " getFloat " , " ( ) F " , columnIndex ) ; <nl> + } <nl> + <nl> + double CJNICursor : : getDouble ( int columnIndex ) <nl> + { <nl> + return call_method < jdouble > ( m_object , " getDouble " , " ( ) D " , columnIndex ) ; <nl> + } <nl> + <nl> + int CJNICursor : : getType ( int columnIndex ) <nl> + { <nl> + return call_method < jint > ( m_object , " getType " , " ( I ) I " , columnIndex ) ; <nl> + } <nl> + <nl> + bool CJNICursor : : isNull ( int columnIndex ) <nl> + { <nl> + return call_method < jboolean > ( m_object , " isNull " , " ( I ) Z " , columnIndex ) ; <nl> + } <nl> + <nl> + void CJNICursor : : deactivate ( ) <nl> + { <nl> + call_method < void > ( m_object , " deactivate " , " ( ) V " ) ; <nl> + } <nl> + <nl> + bool CJNICursor : : requery ( ) <nl> + { <nl> + return call_method < jboolean > ( m_object , " requery " , " ( ) Z " ) ; <nl> + } <nl> + <nl> + void CJNICursor : : close ( ) <nl> + { <nl> + call_method < void > ( m_object , " close " , " ( ) V " ) ; <nl> + } <nl> + <nl> + bool CJNICursor : : isClosed ( ) <nl> + { <nl> + return call_method < jboolean > ( m_object , " isClosed " , " ( ) Z " ) ; <nl> + } <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 6587783f78e9 <nl> mmm / dev / null <nl> ppp b / xbmc / android / jni / Cursor . h <nl> <nl> + # pragma once <nl> + / * <nl> + * Copyright ( C ) 2013 Team XBMC <nl> + * http : / / www . xbmc . org <nl> + * <nl> + * This Program is free software ; you can redistribute it and / or modify <nl> + * it under the terms of the GNU General Public License as published by <nl> + * the Free Software Foundation ; either version 2 , or ( at your option ) <nl> + * any later version . <nl> + * <nl> + * This Program is distributed in the hope that it will be useful , <nl> + * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> + * GNU General Public License for more details . <nl> + * <nl> + * You should have received a copy of the GNU General Public License <nl> + * along with XBMC ; see the file COPYING . If not , see <nl> + * < http : / / www . gnu . org / licenses / > . <nl> + * <nl> + * / <nl> + # include " JNIBase . h " <nl> + # include " MediaStore . h " <nl> + class CJNIURI ; <nl> + class CJNICursor : public CJNIBase <nl> + { <nl> + public : <nl> + ~ CJNICursor ( ) { } ; <nl> + CJNICursor ( const jni : : jhobject & object ) ; <nl> + int getCount ( ) ; <nl> + int getPosition ( ) ; <nl> + bool move ( int offset ) ; <nl> + bool moveToPosition ( int position ) ; <nl> + bool moveToFirst ( ) ; <nl> + bool moveToLast ( ) ; <nl> + bool moveToNext ( ) ; <nl> + bool moveToPrevious ( ) ; <nl> + bool isFirst ( ) ; <nl> + bool isLast ( ) ; <nl> + bool isBeforeFirst ( ) ; <nl> + bool isAfterLast ( ) ; <nl> + int getColumnIndex ( const std : : string & columnName ) ; <nl> + std : : string getColumnName ( int columnIndex ) ; <nl> + std : : vector < std : : string > getColumnNames ( ) ; <nl> + int getColumnCount ( ) ; <nl> + std : : string getString ( int columnIndex ) ; <nl> + short getShort ( int columnIndex ) ; <nl> + int getInt ( int columnIndex ) ; <nl> + long getLong ( int columnIndex ) ; <nl> + float getFloat ( int columnIndex ) ; <nl> + double getDouble ( int columnIndex ) ; <nl> + int getType ( int columnIndex ) ; <nl> + bool isNull ( int columnIndex ) ; <nl> + void deactivate ( ) ; <nl> + bool requery ( ) ; <nl> + void close ( ) ; <nl> + bool isClosed ( ) ; <nl> + <nl> + static int FIELD_TYPE_NULL ; <nl> + static int FIELD_TYPE_INTEGER ; <nl> + static int FIELD_TYPE_FLOAT ; <nl> + static int FIELD_TYPE_STRING ; <nl> + static int FIELD_TYPE_BLOB ; <nl> + <nl> + private : <nl> + CJNICursor ( ) ; <nl> + } ; <nl>
jni : add Cursor class
xbmc/xbmc
b0592f0efcb6095ff27ab14e4d0a35cf94d08e3d
2013-06-07T21:47:51Z
mmm a / main / SCsub <nl> ppp b / main / SCsub <nl> def make_default_controller_mappings ( target , source , env ) : <nl> g . write ( " \ t \ " { } \ " , \ n " . format ( mapping ) ) <nl> g . write ( " # endif \ n " ) <nl> <nl> - g . write ( " } ; \ n " ) <nl> + g . write ( " \ tNULL \ n } ; \ n " ) <nl> g . close ( ) <nl> <nl> env . main_sources = [ ] <nl>
Fix segfault on x11
godotengine/godot
bdc64efcb3419e3ae33ac10426ae1a88a469759c
2018-04-05T02:23:38Z
mmm a / arangod / StorageEngine / TransactionState . h <nl> ppp b / arangod / StorageEngine / TransactionState . h <nl> <nl> # ifdef ARANGODB_ENABLE_MAINTAINER_MODE <nl> <nl> # define LOG_TRX ( trx , level ) \ <nl> - LOG_TOPIC ( TRACE , arangodb : : Logger : : FIXME ) < < " trx # " < < trx - > _id < < " . " < < level < < " ( " < < transaction : : statusString ( trx - > _status ) < < " ) : " <nl> + LOG_TOPIC ( TRACE , arangodb : : Logger : : FIXME ) < < " trx # " < < trx - > id ( ) < < " . " < < level < < " ( " < < transaction : : statusString ( trx - > _status ) < < " ) : " <nl> <nl> # else <nl> <nl> class TransactionState { <nl> bool isCoordinator ( ) const { return ServerState : : isCoordinator ( _serverRole ) ; } <nl> <nl> TRI_vocbase_t * vocbase ( ) const { return _vocbase ; } <nl> + TRI_voc_tid_t id ( ) const { return _id ; } <nl> <nl> double timeout ( ) const { return _timeout ; } <nl> void timeout ( double value ) { <nl> class TransactionState { <nl> <nl> public : <nl> TRI_vocbase_t * _vocbase ; / / vocbase <nl> + <nl> + protected : <nl> TRI_voc_tid_t _id ; / / local trx id <nl> + <nl> + public : <nl> AccessMode : : Type _type ; / / access type ( read | write ) <nl> transaction : : Status _status ; / / current status <nl> <nl> mmm a / arangod / Transaction / Methods . cpp <nl> ppp b / arangod / Transaction / Methods . cpp <nl> transaction : : Methods : : ~ Methods ( ) { <nl> <nl> / / free the state associated with the transaction <nl> TRI_ASSERT ( getStatus ( ) ! = transaction : : Status : : RUNNING ) ; <nl> - auto id = _state - > _id ; <nl> - bool hasFailedOperations = _state - > hasFailedOperations ( ) ; <nl> - delete _state ; <nl> - _state = nullptr ; <nl> - <nl> / / store result <nl> - _transactionContextPtr - > storeTransactionResult ( id , hasFailedOperations ) ; <nl> + _transactionContextPtr - > storeTransactionResult ( _state - > id ( ) , _state - > hasFailedOperations ( ) ) ; <nl> _transactionContextPtr - > unregisterTransaction ( ) ; <nl> + <nl> + delete _state ; <nl> + _state = nullptr ; <nl> } <nl> } <nl> <nl> mmm a / arangod / Utils / TransactionContext . cpp <nl> ppp b / arangod / Utils / TransactionContext . cpp <nl> CollectionNameResolver const * TransactionContext : : createResolver ( ) { <nl> <nl> / / / @ brief unregister the transaction <nl> / / / this will save the transaction ' s id and status locally <nl> - void TransactionContext : : storeTransactionResult ( TRI_voc_tid_t id , bool hasFailedOperations ) { <nl> + void TransactionContext : : storeTransactionResult ( TRI_voc_tid_t id , bool hasFailedOperations ) noexcept { <nl> TRI_ASSERT ( _transaction . id = = 0 ) ; <nl> <nl> _transaction . id = id ; <nl> mmm a / arangod / Utils / TransactionContext . h <nl> ppp b / arangod / Utils / TransactionContext . h <nl> class TransactionContext { <nl> <nl> / / / @ brief unregister the transaction <nl> / / / this will save the transaction ' s id and status locally <nl> - void storeTransactionResult ( TRI_voc_tid_t , bool ) ; <nl> + void storeTransactionResult ( TRI_voc_tid_t id , bool hasFailedOperations ) noexcept ; <nl> <nl> / / / @ brief get a custom type handler <nl> virtual std : : shared_ptr < VPackCustomTypeHandler > orderCustomTypeHandler ( ) = 0 ; <nl>
make property protected
arangodb/arangodb
b4027dc02ccaba4a523be60fd7ade2682c4518cb
2017-02-15T09:41:34Z
mmm a / Makefile <nl> ppp b / Makefile <nl> LDXX_opt = $ ( DEFAULT_CXX ) <nl> CPPFLAGS_opt = - O2 <nl> DEFINES_opt = NDEBUG <nl> <nl> + VALID_CONFIG_asan - trace - cmp = 1 <nl> + REQUIRE_CUSTOM_LIBRARIES_asan - trace - cmp = 1 <nl> + CC_asan - trace - cmp = clang <nl> + CXX_asan - trace - cmp = clang + + <nl> + LD_asan - trace - cmp = clang <nl> + LDXX_asan - trace - cmp = clang + + <nl> + CPPFLAGS_asan - trace - cmp = - O0 - fsanitize - coverage = edge - fsanitize - coverage = trace - cmp - fsanitize = address - fno - omit - frame - pointer - Wno - unused - command - line - argument - DGPR_NO_DIRECT_SYSCALLS <nl> + LDFLAGS_asan - trace - cmp = - fsanitize = address <nl> + <nl> + VALID_CONFIG_dbg = 1 <nl> + CC_dbg = $ ( DEFAULT_CC ) <nl> + CXX_dbg = $ ( DEFAULT_CXX ) <nl> + LD_dbg = $ ( DEFAULT_CC ) <nl> + LDXX_dbg = $ ( DEFAULT_CXX ) <nl> + CPPFLAGS_dbg = - O0 <nl> + DEFINES_dbg = _DEBUG DEBUG <nl> + <nl> + VALID_CONFIG_asan = 1 <nl> + REQUIRE_CUSTOM_LIBRARIES_asan = 1 <nl> + CC_asan = clang <nl> + CXX_asan = clang + + <nl> + LD_asan = clang <nl> + LDXX_asan = clang + + <nl> + CPPFLAGS_asan = - O0 - fsanitize - coverage = edge - fsanitize = address - fno - omit - frame - pointer - Wno - unused - command - line - argument - DGPR_NO_DIRECT_SYSCALLS <nl> + LDFLAGS_asan = - fsanitize = address <nl> + <nl> + VALID_CONFIG_msan = 1 <nl> + REQUIRE_CUSTOM_LIBRARIES_msan = 1 <nl> + CC_msan = clang <nl> + CXX_msan = clang + + <nl> + LD_msan = clang <nl> + LDXX_msan = clang + + <nl> + CPPFLAGS_msan = - O0 - fsanitize - coverage = edge - fsanitize = memory - fsanitize - memory - track - origins - fno - omit - frame - pointer - DGTEST_HAS_TR1_TUPLE = 0 - DGTEST_USE_OWN_TR1_TUPLE = 1 - Wno - unused - command - line - argument - fPIE - pie - DGPR_NO_DIRECT_SYSCALLS <nl> + LDFLAGS_msan = - fsanitize = memory - DGTEST_HAS_TR1_TUPLE = 0 - DGTEST_USE_OWN_TR1_TUPLE = 1 - fPIE - pie $ ( if $ ( JENKINS_BUILD ) , - Wl $ ( comma ) - Ttext - segment = 0x7e0000000000 , ) <nl> + DEFINES_msan = NDEBUG <nl> + <nl> VALID_CONFIG_basicprof = 1 <nl> CC_basicprof = $ ( DEFAULT_CC ) <nl> CXX_basicprof = $ ( DEFAULT_CXX ) <nl> LDXX_asan - noleaks = clang + + <nl> CPPFLAGS_asan - noleaks = - O0 - fsanitize - coverage = edge - fsanitize = address - fno - omit - frame - pointer - Wno - unused - command - line - argument - DGPR_NO_DIRECT_SYSCALLS <nl> LDFLAGS_asan - noleaks = - fsanitize = address <nl> <nl> - VALID_CONFIG_asan - trace - cmp = 1 <nl> - REQUIRE_CUSTOM_LIBRARIES_asan - trace - cmp = 1 <nl> - CC_asan - trace - cmp = clang <nl> - CXX_asan - trace - cmp = clang + + <nl> - LD_asan - trace - cmp = clang <nl> - LDXX_asan - trace - cmp = clang + + <nl> - CPPFLAGS_asan - trace - cmp = - O0 - fsanitize - coverage = edge - fsanitize - coverage = trace - cmp - fsanitize = address - fno - omit - frame - pointer - Wno - unused - command - line - argument - DGPR_NO_DIRECT_SYSCALLS <nl> - LDFLAGS_asan - trace - cmp = - fsanitize = address <nl> + VALID_CONFIG_ubsan = 1 <nl> + REQUIRE_CUSTOM_LIBRARIES_ubsan = 1 <nl> + CC_ubsan = clang <nl> + CXX_ubsan = clang + + <nl> + LD_ubsan = clang <nl> + LDXX_ubsan = clang + + <nl> + CPPFLAGS_ubsan = - O0 - fsanitize - coverage = edge - fsanitize = undefined - fno - omit - frame - pointer - Wno - unused - command - line - argument - Wvarargs <nl> + LDFLAGS_ubsan = - fsanitize = undefined , unsigned - integer - overflow <nl> + DEFINES_ubsan = NDEBUG <nl> <nl> - VALID_CONFIG_dbg = 1 <nl> - CC_dbg = $ ( DEFAULT_CC ) <nl> - CXX_dbg = $ ( DEFAULT_CXX ) <nl> - LD_dbg = $ ( DEFAULT_CC ) <nl> - LDXX_dbg = $ ( DEFAULT_CXX ) <nl> - CPPFLAGS_dbg = - O0 <nl> - DEFINES_dbg = _DEBUG DEBUG <nl> + VALID_CONFIG_tsan = 1 <nl> + REQUIRE_CUSTOM_LIBRARIES_tsan = 1 <nl> + CC_tsan = clang <nl> + CXX_tsan = clang + + <nl> + LD_tsan = clang <nl> + LDXX_tsan = clang + + <nl> + CPPFLAGS_tsan = - O0 - fsanitize = thread - fno - omit - frame - pointer - Wno - unused - command - line - argument - DGPR_NO_DIRECT_SYSCALLS <nl> + LDFLAGS_tsan = - fsanitize = thread <nl> + DEFINES_tsan = GRPC_TSAN <nl> <nl> VALID_CONFIG_stapprof = 1 <nl> CC_stapprof = $ ( DEFAULT_CC ) <nl> CPPFLAGS_memcheck = - O0 <nl> LDFLAGS_memcheck = - rdynamic <nl> DEFINES_memcheck = _DEBUG DEBUG <nl> <nl> - VALID_CONFIG_asan = 1 <nl> - REQUIRE_CUSTOM_LIBRARIES_asan = 1 <nl> - CC_asan = clang <nl> - CXX_asan = clang + + <nl> - LD_asan = clang <nl> - LDXX_asan = clang + + <nl> - CPPFLAGS_asan = - O0 - fsanitize - coverage = edge - fsanitize = address - fno - omit - frame - pointer - Wno - unused - command - line - argument - DGPR_NO_DIRECT_SYSCALLS <nl> - LDFLAGS_asan = - fsanitize = address <nl> - <nl> - VALID_CONFIG_tsan = 1 <nl> - REQUIRE_CUSTOM_LIBRARIES_tsan = 1 <nl> - CC_tsan = clang <nl> - CXX_tsan = clang + + <nl> - LD_tsan = clang <nl> - LDXX_tsan = clang + + <nl> - CPPFLAGS_tsan = - O0 - fsanitize = thread - fno - omit - frame - pointer - Wno - unused - command - line - argument - DGPR_NO_DIRECT_SYSCALLS <nl> - LDFLAGS_tsan = - fsanitize = thread <nl> - DEFINES_tsan = GRPC_TSAN <nl> - <nl> - VALID_CONFIG_ubsan = 1 <nl> - REQUIRE_CUSTOM_LIBRARIES_ubsan = 1 <nl> - CC_ubsan = clang <nl> - CXX_ubsan = clang + + <nl> - LD_ubsan = clang <nl> - LDXX_ubsan = clang + + <nl> - CPPFLAGS_ubsan = - O0 - fsanitize - coverage = edge - fsanitize = undefined - fno - omit - frame - pointer - Wno - unused - command - line - argument - Wvarargs <nl> - LDFLAGS_ubsan = - fsanitize = undefined , unsigned - integer - overflow <nl> - DEFINES_ubsan = NDEBUG <nl> - <nl> - VALID_CONFIG_msan = 1 <nl> - REQUIRE_CUSTOM_LIBRARIES_msan = 1 <nl> - CC_msan = clang <nl> - CXX_msan = clang + + <nl> - LD_msan = clang <nl> - LDXX_msan = clang + + <nl> - CPPFLAGS_msan = - O0 - fsanitize - coverage = edge - fsanitize = memory - fsanitize - memory - track - origins - fno - omit - frame - pointer - DGTEST_HAS_TR1_TUPLE = 0 - DGTEST_USE_OWN_TR1_TUPLE = 1 - Wno - unused - command - line - argument - fPIE - pie - DGPR_NO_DIRECT_SYSCALLS <nl> - LDFLAGS_msan = - fsanitize = memory - DGTEST_HAS_TR1_TUPLE = 0 - DGTEST_USE_OWN_TR1_TUPLE = 1 - fPIE - pie $ ( if $ ( JENKINS_BUILD ) , - Wl $ ( comma ) - Ttext - segment = 0x7e0000000000 , ) <nl> - DEFINES_msan = NDEBUG <nl> + VALID_CONFIG_lto = 1 <nl> + CC_lto = $ ( DEFAULT_CC ) <nl> + CXX_lto = $ ( DEFAULT_CXX ) <nl> + LD_lto = $ ( DEFAULT_CC ) <nl> + LDXX_lto = $ ( DEFAULT_CXX ) <nl> + CPPFLAGS_lto = - O2 <nl> + DEFINES_lto = NDEBUG <nl> <nl> VALID_CONFIG_mutrace = 1 <nl> CC_mutrace = $ ( DEFAULT_CC ) <nl> mmm a / build . yaml <nl> ppp b / build . yaml <nl> configs : <nl> DEFINES : _DEBUG DEBUG <nl> LDFLAGS : - rdynamic <nl> valgrind : - - tool = helgrind <nl> + lto : <nl> + CPPFLAGS : - O2 <nl> + DEFINES : NDEBUG <nl> memcheck : <nl> CPPFLAGS : - O0 <nl> DEFINES : _DEBUG DEBUG <nl> mmm a / tools / run_tests / generated / configs . json <nl> ppp b / tools / run_tests / generated / configs . json <nl> <nl> { <nl> " config " : " opt " <nl> } , <nl> + { <nl> + " config " : " asan - trace - cmp " , <nl> + " environ " : { <nl> + " ASAN_OPTIONS " : " detect_leaks = 1 : color = always " , <nl> + " LSAN_OPTIONS " : " suppressions = tools / lsan_suppressions . txt : report_objects = 1 " <nl> + } <nl> + } , <nl> + { <nl> + " config " : " dbg " <nl> + } , <nl> + { <nl> + " config " : " asan " , <nl> + " environ " : { <nl> + " ASAN_OPTIONS " : " detect_leaks = 1 : color = always " , <nl> + " LSAN_OPTIONS " : " suppressions = tools / lsan_suppressions . txt : report_objects = 1 " <nl> + } <nl> + } , <nl> + { <nl> + " config " : " msan " <nl> + } , <nl> { <nl> " config " : " basicprof " <nl> } , <nl> <nl> } <nl> } , <nl> { <nl> - " config " : " asan - trace - cmp " , <nl> + " config " : " ubsan " , <nl> " environ " : { <nl> - " ASAN_OPTIONS " : " detect_leaks = 1 : color = always " , <nl> - " LSAN_OPTIONS " : " suppressions = tools / lsan_suppressions . txt : report_objects = 1 " <nl> + " UBSAN_OPTIONS " : " halt_on_error = 1 : print_stacktrace = 1 : suppressions = tools / ubsan_suppressions . txt " <nl> } <nl> } , <nl> { <nl> - " config " : " dbg " <nl> + " config " : " tsan " , <nl> + " environ " : { <nl> + " TSAN_OPTIONS " : " suppressions = tools / tsan_suppressions . txt : halt_on_error = 1 : second_deadlock_stack = 1 " <nl> + } <nl> } , <nl> { <nl> " config " : " stapprof " <nl> <nl> ] <nl> } , <nl> { <nl> - " config " : " asan " , <nl> - " environ " : { <nl> - " ASAN_OPTIONS " : " detect_leaks = 1 : color = always " , <nl> - " LSAN_OPTIONS " : " suppressions = tools / lsan_suppressions . txt : report_objects = 1 " <nl> - } <nl> - } , <nl> - { <nl> - " config " : " tsan " , <nl> - " environ " : { <nl> - " TSAN_OPTIONS " : " suppressions = tools / tsan_suppressions . txt : halt_on_error = 1 : second_deadlock_stack = 1 " <nl> - } <nl> - } , <nl> - { <nl> - " config " : " ubsan " , <nl> - " environ " : { <nl> - " UBSAN_OPTIONS " : " halt_on_error = 1 : print_stacktrace = 1 : suppressions = tools / ubsan_suppressions . txt " <nl> - } <nl> - } , <nl> - { <nl> - " config " : " msan " <nl> + " config " : " lto " <nl> } , <nl> { <nl> " config " : " mutrace " <nl> mmm a / tools / run_tests / generated / tests . json <nl> ppp b / tools / run_tests / generated / tests . json <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl> <nl> " dbg " , <nl> " gcov " , <nl> " helgrind " , <nl> + " lto " , <nl> " memcheck " , <nl> " msan " , <nl> " mutrace " , <nl>
Merge pull request from ctiller / hehehe
grpc/grpc
24eab2a127531ce322027734839548aa4a0932b1
2017-03-31T00:49:49Z
mmm a / tensorflow / contrib / boosted_trees / python / training / functions / gbdt_batch . py <nl> ppp b / tensorflow / contrib / boosted_trees / python / training / functions / gbdt_batch . py <nl> def predict ( self , mode ) : <nl> if not input_deps : <nl> raise ValueError ( " No input tensors for prediction . " ) <nl> <nl> - if any ( i . device ! = input_deps [ 0 ] . device for i in input_deps ) : <nl> - raise ValueError ( " All input tensors should be on the same device . " ) <nl> - <nl> # Get most current model stamp . <nl> ensemble_stamp = model_ops . tree_ensemble_stamp_token ( self . _ensemble_handle ) <nl> <nl>
Adding an opportunity to skip the check for input tensor placements .
tensorflow/tensorflow
8688a251608b03bd0aead0b6275d6cf21144ea23
2018-07-25T19:07:49Z
mmm a / src / mongo / db / op_observer_impl . cpp <nl> ppp b / src / mongo / db / op_observer_impl . cpp <nl> <nl> # include " mongo / db / op_observer_impl . h " <nl> <nl> # include " mongo / bson / bsonobjbuilder . h " <nl> - # include " mongo / db / auth / authorization_manager_global . h " <nl> + # include " mongo / db / auth / authorization_manager . h " <nl> # include " mongo / db / catalog / collection_catalog_entry . h " <nl> # include " mongo / db / catalog / collection_options . h " <nl> # include " mongo / db / catalog / database . h " <nl> <nl> # include " mongo / db / namespace_string . h " <nl> # include " mongo / db / operation_context . h " <nl> # include " mongo / db / repl / oplog . h " <nl> - # include " mongo / db / repl / replication_coordinator_global . h " <nl> + # include " mongo / db / repl / replication_coordinator . h " <nl> # include " mongo / db / s / collection_sharding_state . h " <nl> # include " mongo / db / server_options . h " <nl> # include " mongo / db / session_catalog . h " <nl> <nl> namespace mongo { <nl> namespace { <nl> <nl> - / / Return whether we ' re a master using master - slave replication . <nl> - bool isMasterSlave ( ) { <nl> - return repl : : getGlobalReplicationCoordinator ( ) - > getReplicationMode ( ) = = <nl> + / * * <nl> + * Returns whether we ' re a master using master - slave replication . <nl> + * / <nl> + bool isMasterSlave ( OperationContext * opCtx ) { <nl> + return repl : : ReplicationCoordinator : : get ( opCtx ) - > getReplicationMode ( ) = = <nl> repl : : ReplicationCoordinator : : modeMasterSlave ; <nl> } <nl> <nl> bool isMasterSlave ( ) { <nl> * / <nl> void onWriteOpCompleted ( OperationContext * opCtx , <nl> const NamespaceString & nss , <nl> + Session * session , <nl> std : : vector < StmtId > stmtIdsWritten , <nl> const repl : : OpTime & lastStmtIdWriteOpTime ) { <nl> const auto lastStmtIdWriteTs = lastStmtIdWriteOpTime . getTimestamp ( ) ; <nl> void onWriteOpCompleted ( OperationContext * opCtx , <nl> < < " cannot be performed using a transaction or on a session . " , <nl> ! opCtx - > getLogicalSessionId ( ) ) ; <nl> SessionCatalog : : get ( opCtx ) - > resetSessions ( ) ; <nl> - } else if ( opCtx - > getTxnNumber ( ) ) { <nl> - OperationContextSession : : get ( opCtx ) - > onWriteOpCompletedOnPrimary ( <nl> + } else if ( session ) { <nl> + session - > onWriteOpCompletedOnPrimary ( <nl> opCtx , * opCtx - > getTxnNumber ( ) , std : : move ( stmtIdsWritten ) , lastStmtIdWriteTs ) ; <nl> } <nl> } <nl> <nl> + / * * <nl> + * Given a raw collMod command object and associated collection metadata , create and return the <nl> + * object for the ' o ' field of a collMod oplog entry . For TTL index updates , we make sure the oplog <nl> + * entry always stores the index name , instead of a key pattern . <nl> + * / <nl> + BSONObj makeCollModCmdObj ( const BSONObj & collModCmd , <nl> + const CollectionOptions & oldCollOptions , <nl> + boost : : optional < TTLCollModInfo > ttlInfo ) { <nl> + BSONObjBuilder cmdObjBuilder ; <nl> + std : : string ttlIndexFieldName = " index " ; <nl> + <nl> + / / Add all fields from the original collMod command . <nl> + for ( auto elem : collModCmd ) { <nl> + / / We normalize all TTL collMod oplog entry objects to use the index name , even if the <nl> + / / command used an index key pattern . <nl> + if ( elem . fieldNameStringData ( ) = = ttlIndexFieldName & & ttlInfo ) { <nl> + BSONObjBuilder ttlIndexObjBuilder ; <nl> + ttlIndexObjBuilder . append ( " name " , ttlInfo - > indexName ) ; <nl> + ttlIndexObjBuilder . append ( " expireAfterSeconds " , <nl> + durationCount < Seconds > ( ttlInfo - > expireAfterSeconds ) ) ; <nl> + <nl> + cmdObjBuilder . append ( ttlIndexFieldName , ttlIndexObjBuilder . obj ( ) ) ; <nl> + } else { <nl> + cmdObjBuilder . append ( elem ) ; <nl> + } <nl> + } <nl> + <nl> + return cmdObjBuilder . obj ( ) ; <nl> + } <nl> + <nl> / * * <nl> * Write oplog entry ( ies ) for the update operation . <nl> * / <nl> void OpObserverImpl : : onCreateIndex ( OperationContext * opCtx , <nl> OptionalCollectionUUID uuid , <nl> BSONObj indexDoc , <nl> bool fromMigrate ) { <nl> - NamespaceString systemIndexes { nss . getSystemIndexesCollection ( ) } ; <nl> - if ( uuid & & ! isMasterSlave ( ) ) { <nl> + const NamespaceString systemIndexes { nss . getSystemIndexesCollection ( ) } ; <nl> + <nl> + if ( uuid & & ! isMasterSlave ( opCtx ) ) { <nl> BSONObjBuilder builder ; <nl> builder . append ( " createIndexes " , nss . coll ( ) ) ; <nl> <nl> void OpObserverImpl : : onCreateIndex ( OperationContext * opCtx , <nl> if ( e . fieldNameStringData ( ) ! = " ns " _sd ) <nl> builder . append ( e ) ; <nl> } <nl> + <nl> repl : : logOp ( opCtx , <nl> " c " , <nl> nss . getCommandNS ( ) , <nl> void OpObserverImpl : : onCreateIndex ( OperationContext * opCtx , <nl> kUninitializedStmtId , <nl> { } ) ; <nl> } <nl> + <nl> AuthorizationManager : : get ( opCtx - > getServiceContext ( ) ) <nl> - > logOp ( opCtx , " i " , systemIndexes , indexDoc , nullptr ) ; <nl> <nl> void OpObserverImpl : : onInserts ( OperationContext * opCtx , <nl> return stmt . stmtId ; <nl> } ) ; <nl> <nl> - onWriteOpCompleted ( opCtx , nss , stmtIdsWritten , lastOpTime ) ; <nl> + onWriteOpCompleted ( opCtx , nss , session , stmtIdsWritten , lastOpTime ) ; <nl> } <nl> <nl> void OpObserverImpl : : onUpdate ( OperationContext * opCtx , const OplogUpdateEntryArgs & args ) { <nl> void OpObserverImpl : : onUpdate ( OperationContext * opCtx , const OplogUpdateEntryArg <nl> FeatureCompatibilityVersion : : onInsertOrUpdate ( opCtx , args . updatedDoc ) ; <nl> } <nl> <nl> - onWriteOpCompleted ( opCtx , args . nss , std : : vector < StmtId > { args . stmtId } , opTime ) ; <nl> + onWriteOpCompleted ( opCtx , args . nss , session , std : : vector < StmtId > { args . stmtId } , opTime ) ; <nl> } <nl> <nl> auto OpObserverImpl : : aboutToDelete ( OperationContext * opCtx , <nl> void OpObserverImpl : : onDelete ( OperationContext * opCtx , <nl> FeatureCompatibilityVersion : : onDelete ( opCtx , deleteState . documentKey ) ; <nl> } <nl> <nl> - onWriteOpCompleted ( opCtx , nss , std : : vector < StmtId > { stmtId } , opTime ) ; <nl> + onWriteOpCompleted ( opCtx , nss , session , std : : vector < StmtId > { stmtId } , opTime ) ; <nl> } <nl> <nl> void OpObserverImpl : : onInternalOpMessage ( OperationContext * opCtx , <nl> void OpObserverImpl : : onCreateCollection ( OperationContext * opCtx , <nl> const NamespaceString & collectionName , <nl> const CollectionOptions & options , <nl> const BSONObj & idIndex ) { <nl> - const NamespaceString dbName = collectionName . getCommandNS ( ) ; <nl> + const auto cmdNss = collectionName . getCommandNS ( ) ; <nl> + <nl> BSONObjBuilder b ; <nl> b . append ( " create " , collectionName . coll ( ) . toString ( ) ) ; <nl> { <nl> void OpObserverImpl : : onCreateCollection ( OperationContext * opCtx , <nl> } <nl> } <nl> <nl> - BSONObj cmdObj = b . obj ( ) ; <nl> + const auto cmdObj = b . done ( ) ; <nl> <nl> if ( ! collectionName . isSystemDotProfile ( ) ) { <nl> / / do not replicate system . profile modifications <nl> repl : : logOp ( <nl> - opCtx , " c " , dbName , options . uuid , cmdObj , nullptr , false , { } , kUninitializedStmtId , { } ) ; <nl> + opCtx , " c " , cmdNss , options . uuid , cmdObj , nullptr , false , { } , kUninitializedStmtId , { } ) ; <nl> } <nl> <nl> - getGlobalAuthorizationManager ( ) - > logOp ( opCtx , " c " , dbName , cmdObj , nullptr ) ; <nl> + AuthorizationManager : : get ( opCtx - > getServiceContext ( ) ) <nl> + - > logOp ( opCtx , " c " , cmdNss , cmdObj , nullptr ) ; <nl> <nl> if ( options . uuid ) { <nl> UUIDCatalog & catalog = UUIDCatalog : : get ( opCtx ) ; <nl> void OpObserverImpl : : onCreateCollection ( OperationContext * opCtx , <nl> } <nl> } <nl> <nl> - namespace { <nl> - / * * <nl> - * Given a raw collMod command object and associated collection metadata , create and return the <nl> - * object for the ' o ' field of a collMod oplog entry . For TTL index updates , we make sure the oplog <nl> - * entry always stores the index name , instead of a key pattern . <nl> - * / <nl> - BSONObj makeCollModCmdObj ( const BSONObj & collModCmd , <nl> - const CollectionOptions & oldCollOptions , <nl> - boost : : optional < TTLCollModInfo > ttlInfo ) { <nl> - BSONObjBuilder cmdObjBuilder ; <nl> - std : : string ttlIndexFieldName = " index " ; <nl> - <nl> - / / Add all fields from the original collMod command . <nl> - for ( auto elem : collModCmd ) { <nl> - / / We normalize all TTL collMod oplog entry objects to use the index name , even if the <nl> - / / command used an index key pattern . <nl> - if ( elem . fieldNameStringData ( ) = = ttlIndexFieldName & & ttlInfo ) { <nl> - BSONObjBuilder ttlIndexObjBuilder ; <nl> - ttlIndexObjBuilder . append ( " name " , ttlInfo - > indexName ) ; <nl> - ttlIndexObjBuilder . append ( " expireAfterSeconds " , <nl> - durationCount < Seconds > ( ttlInfo - > expireAfterSeconds ) ) ; <nl> - <nl> - cmdObjBuilder . append ( ttlIndexFieldName , ttlIndexObjBuilder . obj ( ) ) ; <nl> - } else { <nl> - cmdObjBuilder . append ( elem ) ; <nl> - } <nl> - } <nl> - <nl> - return cmdObjBuilder . obj ( ) ; <nl> - } <nl> - } <nl> - <nl> void OpObserverImpl : : onCollMod ( OperationContext * opCtx , <nl> const NamespaceString & nss , <nl> OptionalCollectionUUID uuid , <nl> const BSONObj & collModCmd , <nl> const CollectionOptions & oldCollOptions , <nl> boost : : optional < TTLCollModInfo > ttlInfo ) { <nl> - <nl> - const NamespaceString cmdNss = nss . getCommandNS ( ) ; <nl> + const auto cmdNss = nss . getCommandNS ( ) ; <nl> <nl> / / Create the ' o ' field object . <nl> - BSONObj cmdObj = makeCollModCmdObj ( collModCmd , oldCollOptions , ttlInfo ) ; <nl> + const auto cmdObj = makeCollModCmdObj ( collModCmd , oldCollOptions , ttlInfo ) ; <nl> <nl> / / Create the ' o2 ' field object . We save the old collection metadata and TTL expiration . <nl> BSONObjBuilder o2Builder ; <nl> void OpObserverImpl : : onCollMod ( OperationContext * opCtx , <nl> o2Builder . append ( " expireAfterSeconds_old " , oldExpireAfterSeconds ) ; <nl> } <nl> <nl> - const BSONObj o2Obj = o2Builder . obj ( ) ; <nl> + const auto o2Obj = o2Builder . done ( ) ; <nl> <nl> if ( ! nss . isSystemDotProfile ( ) ) { <nl> / / do not replicate system . profile modifications <nl> repl : : logOp ( opCtx , " c " , cmdNss , uuid , cmdObj , & o2Obj , false , { } , kUninitializedStmtId , { } ) ; <nl> } <nl> <nl> - getGlobalAuthorizationManager ( ) - > logOp ( opCtx , " c " , cmdNss , cmdObj , nullptr ) ; <nl> + AuthorizationManager : : get ( opCtx - > getServiceContext ( ) ) <nl> + - > logOp ( opCtx , " c " , cmdNss , cmdObj , nullptr ) ; <nl> <nl> - / / Make sure the UUID values in the Collection metadata , the Collection object , <nl> - / / and the UUID catalog are all present and equal if uuid exists and do not exist <nl> - / / if uuid does not exist . <nl> + / / Make sure the UUID values in the Collection metadata , the Collection object , and the UUID <nl> + / / catalog are all present and equal if uuid exists and do not exist if uuid does not exist . <nl> invariant ( opCtx - > lockState ( ) - > isDbLockedForMode ( nss . db ( ) , MODE_X ) ) ; <nl> Database * db = dbHolder ( ) . get ( opCtx , nss . db ( ) ) ; <nl> / / Some unit tests call the op observer on an unregistered Database . <nl> void OpObserverImpl : : onCollMod ( OperationContext * opCtx , <nl> } <nl> <nl> void OpObserverImpl : : onDropDatabase ( OperationContext * opCtx , const std : : string & dbName ) { <nl> - BSONObj cmdObj = BSON ( " dropDatabase " < < 1 ) ; <nl> const NamespaceString cmdNss { dbName , " $ cmd " } ; <nl> + const auto cmdObj = BSON ( " dropDatabase " < < 1 ) ; <nl> <nl> repl : : logOp ( opCtx , " c " , cmdNss , { } , cmdObj , nullptr , false , { } , kUninitializedStmtId , { } ) ; <nl> <nl> void OpObserverImpl : : onDropDatabase ( OperationContext * opCtx , const std : : string & <nl> <nl> NamespaceUUIDCache : : get ( opCtx ) . evictNamespacesInDatabase ( dbName ) ; <nl> <nl> - getGlobalAuthorizationManager ( ) - > logOp ( opCtx , " c " , cmdNss , cmdObj , nullptr ) ; <nl> + AuthorizationManager : : get ( opCtx - > getServiceContext ( ) ) <nl> + - > logOp ( opCtx , " c " , cmdNss , cmdObj , nullptr ) ; <nl> } <nl> <nl> repl : : OpTime OpObserverImpl : : onDropCollection ( OperationContext * opCtx , <nl> const NamespaceString & collectionName , <nl> OptionalCollectionUUID uuid ) { <nl> - const NamespaceString dbName = collectionName . getCommandNS ( ) ; <nl> - BSONObj cmdObj = BSON ( " drop " < < collectionName . coll ( ) . toString ( ) ) ; <nl> + const auto cmdNss = collectionName . getCommandNS ( ) ; <nl> + const auto cmdObj = BSON ( " drop " < < collectionName . coll ( ) ) ; <nl> <nl> repl : : OpTime dropOpTime ; <nl> if ( ! collectionName . isSystemDotProfile ( ) ) { <nl> - / / do not replicate system . profile modifications <nl> + / / Do not replicate system . profile modifications <nl> dropOpTime = repl : : logOp ( <nl> - opCtx , " c " , dbName , uuid , cmdObj , nullptr , false , { } , kUninitializedStmtId , { } ) ; <nl> + opCtx , " c " , cmdNss , uuid , cmdObj , nullptr , false , { } , kUninitializedStmtId , { } ) ; <nl> } <nl> <nl> if ( collectionName . coll ( ) = = DurableViewCatalog : : viewsCollectionName ( ) ) { <nl> repl : : OpTime OpObserverImpl : : onDropCollection ( OperationContext * opCtx , <nl> FeatureCompatibilityVersion : : onDropCollection ( opCtx ) ; <nl> } <nl> <nl> - getGlobalAuthorizationManager ( ) - > logOp ( opCtx , " c " , dbName , cmdObj , nullptr ) ; <nl> + AuthorizationManager : : get ( opCtx - > getServiceContext ( ) ) <nl> + - > logOp ( opCtx , " c " , cmdNss , cmdObj , nullptr ) ; <nl> <nl> auto css = CollectionShardingState : : get ( opCtx , collectionName ) ; <nl> css - > onDropCollection ( opCtx , collectionName ) ; <nl> void OpObserverImpl : : onDropIndex ( OperationContext * opCtx , <nl> OptionalCollectionUUID uuid , <nl> const std : : string & indexName , <nl> const BSONObj & indexInfo ) { <nl> - BSONObj cmdObj = BSON ( " dropIndexes " < < nss . coll ( ) < < " index " < < indexName ) ; <nl> - auto commandNS = nss . getCommandNS ( ) ; <nl> - repl : : logOp ( <nl> - opCtx , " c " , commandNS , uuid , cmdObj , & indexInfo , false , { } , kUninitializedStmtId , { } ) ; <nl> + const auto cmdNss = nss . getCommandNS ( ) ; <nl> + const auto cmdObj = BSON ( " dropIndexes " < < nss . coll ( ) < < " index " < < indexName ) ; <nl> + <nl> + repl : : logOp ( opCtx , " c " , cmdNss , uuid , cmdObj , & indexInfo , false , { } , kUninitializedStmtId , { } ) ; <nl> <nl> - getGlobalAuthorizationManager ( ) - > logOp ( opCtx , " c " , commandNS , cmdObj , & indexInfo ) ; <nl> + AuthorizationManager : : get ( opCtx - > getServiceContext ( ) ) <nl> + - > logOp ( opCtx , " c " , cmdNss , cmdObj , & indexInfo ) ; <nl> } <nl> <nl> repl : : OpTime OpObserverImpl : : onRenameCollection ( OperationContext * opCtx , <nl> repl : : OpTime OpObserverImpl : : onRenameCollection ( OperationContext * opCtx , <nl> bool dropTarget , <nl> OptionalCollectionUUID dropTargetUUID , <nl> bool stayTemp ) { <nl> - const NamespaceString cmdNss = fromCollection . getCommandNS ( ) ; <nl> + const auto cmdNss = fromCollection . getCommandNS ( ) ; <nl> + <nl> BSONObjBuilder builder ; <nl> builder . append ( " renameCollection " , fromCollection . ns ( ) ) ; <nl> builder . append ( " to " , toCollection . ns ( ) ) ; <nl> builder . append ( " stayTemp " , stayTemp ) ; <nl> - if ( dropTargetUUID & & enableCollectionUUIDs & & ! isMasterSlave ( ) ) { <nl> + if ( dropTargetUUID & & enableCollectionUUIDs & & ! isMasterSlave ( opCtx ) ) { <nl> dropTargetUUID - > appendToBuilder ( & builder , " dropTarget " ) ; <nl> } else { <nl> builder . append ( " dropTarget " , dropTarget ) ; <nl> } <nl> - BSONObj cmdObj = builder . done ( ) ; <nl> <nl> - auto renameOpTime = <nl> + const auto cmdObj = builder . done ( ) ; <nl> + <nl> + const auto renameOpTime = <nl> repl : : logOp ( opCtx , " c " , cmdNss , uuid , cmdObj , nullptr , false , { } , kUninitializedStmtId , { } ) ; <nl> <nl> if ( fromCollection . isSystemDotViews ( ) ) <nl> repl : : OpTime OpObserverImpl : : onRenameCollection ( OperationContext * opCtx , <nl> if ( toCollection . isSystemDotViews ( ) ) <nl> DurableViewCatalog : : onExternalChange ( opCtx , toCollection ) ; <nl> <nl> - getGlobalAuthorizationManager ( ) - > logOp ( opCtx , " c " , cmdNss , cmdObj , nullptr ) ; <nl> + AuthorizationManager : : get ( opCtx - > getServiceContext ( ) ) <nl> + - > logOp ( opCtx , " c " , cmdNss , cmdObj , nullptr ) ; <nl> <nl> / / Evict namespace entry from the namespace / uuid cache if it exists . <nl> NamespaceUUIDCache & cache = NamespaceUUIDCache : : get ( opCtx ) ; <nl> repl : : OpTime OpObserverImpl : : onRenameCollection ( OperationContext * opCtx , <nl> opCtx - > recoveryUnit ( ) - > onRollback ( <nl> [ & cache , toCollection ] ( ) { cache . evictNamespace ( toCollection ) ; } ) ; <nl> <nl> - <nl> / / Finally update the UUID Catalog . <nl> if ( uuid ) { <nl> auto getNewCollection = [ opCtx , toCollection ] { <nl> void OpObserverImpl : : onApplyOps ( OperationContext * opCtx , <nl> const NamespaceString cmdNss { dbName , " $ cmd " } ; <nl> repl : : logOp ( opCtx , " c " , cmdNss , { } , applyOpCmd , nullptr , false , { } , kUninitializedStmtId , { } ) ; <nl> <nl> - getGlobalAuthorizationManager ( ) - > logOp ( opCtx , " c " , cmdNss , applyOpCmd , nullptr ) ; <nl> + AuthorizationManager : : get ( opCtx - > getServiceContext ( ) ) <nl> + - > logOp ( opCtx , " c " , cmdNss , applyOpCmd , nullptr ) ; <nl> } <nl> <nl> void OpObserverImpl : : onEmptyCapped ( OperationContext * opCtx , <nl> const NamespaceString & collectionName , <nl> OptionalCollectionUUID uuid ) { <nl> - const NamespaceString cmdNss = collectionName . getCommandNS ( ) ; <nl> - BSONObj cmdObj = BSON ( " emptycapped " < < collectionName . coll ( ) ) ; <nl> + const auto cmdNss = collectionName . getCommandNS ( ) ; <nl> + const auto cmdObj = BSON ( " emptycapped " < < collectionName . coll ( ) ) ; <nl> <nl> if ( ! collectionName . isSystemDotProfile ( ) ) { <nl> - / / do not replicate system . profile modifications <nl> + / / Do not replicate system . profile modifications <nl> repl : : logOp ( opCtx , " c " , cmdNss , uuid , cmdObj , nullptr , false , { } , kUninitializedStmtId , { } ) ; <nl> } <nl> <nl> - getGlobalAuthorizationManager ( ) - > logOp ( opCtx , " c " , cmdNss , cmdObj , nullptr ) ; <nl> + AuthorizationManager : : get ( opCtx - > getServiceContext ( ) ) <nl> + - > logOp ( opCtx , " c " , cmdNss , cmdObj , nullptr ) ; <nl> } <nl> <nl> } / / namespace mongo <nl> mmm a / src / mongo / db / repl / oplog . cpp <nl> ppp b / src / mongo / db / repl / oplog . cpp <nl> OplogDocWriter _logOpWriter ( OperationContext * opCtx , <nl> b . append ( " op " , opstr ) ; <nl> b . append ( " ns " , nss . ns ( ) ) ; <nl> if ( uuid & & <nl> - repl : : getGlobalReplicationCoordinator ( ) - > getReplicationMode ( ) ! = <nl> - repl : : ReplicationCoordinator : : modeMasterSlave ) <nl> + ReplicationCoordinator : : get ( opCtx ) - > getReplicationMode ( ) ! = <nl> + ReplicationCoordinator : : modeMasterSlave ) <nl> uuid - > appendToBuilder ( & b , " ui " ) ; <nl> + <nl> if ( fromMigrate ) <nl> b . appendBool ( " fromMigrate " , true ) ; <nl> + <nl> if ( o2 ) <nl> b . append ( " o2 " , * o2 ) ; <nl> <nl> long long getNewOplogSizeBytes ( OperationContext * opCtx , const ReplSettings & repl <nl> return sz ; <nl> # endif <nl> } <nl> + <nl> } / / namespace <nl> <nl> void createOplog ( OperationContext * opCtx , const std : : string & oplogCollectionName , bool isReplSet ) { <nl> void createOplog ( OperationContext * opCtx , const std : : string & oplogCollectionName <nl> WriteUnitOfWork uow ( opCtx ) ; <nl> invariant ( ctx . db ( ) - > createCollection ( opCtx , oplogCollectionName , options ) ) ; <nl> acquireOplogCollectionForLogging ( opCtx ) ; <nl> - if ( ! isReplSet ) <nl> - getGlobalServiceContext ( ) - > getOpObserver ( ) - > onOpMessage ( opCtx , BSONObj ( ) ) ; <nl> + if ( ! isReplSet ) { <nl> + opCtx - > getServiceContext ( ) - > getOpObserver ( ) - > onOpMessage ( opCtx , BSONObj ( ) ) ; <nl> + } <nl> uow . commit ( ) ; <nl> } ) ; <nl> <nl> mmm a / src / mongo / db / repl / rs_rollback . cpp <nl> ppp b / src / mongo / db / repl / rs_rollback . cpp <nl> <nl> / * * <nl> - * @ file rs_rollback . cpp <nl> - * <nl> - * Copyright ( C ) 2008 - 2014 MongoDB Inc . <nl> - * <nl> - * This program is free software : you can redistribute it and / or modify <nl> - * it under the terms of the GNU Affero General Public License , version 3 , <nl> - * as published by the Free Software Foundation . <nl> - * <nl> - * This program is distributed in the hope that it will be useful , <nl> - * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> - * GNU Affero General Public License for more details . <nl> - * <nl> - * You should have received a copy of the GNU Affero General Public License <nl> - * along with this program . If not , see < http : / / www . gnu . org / licenses / > . <nl> - * <nl> - * As a special exception , the copyright holders give permission to link the <nl> - * code of portions of this program with the OpenSSL library under certain <nl> - * conditions as described in each individual source file and distribute <nl> - * linked combinations including the program with the OpenSSL library . You <nl> - * must comply with the GNU Affero General Public License in all respects for <nl> - * all of the code used other than as permitted herein . If you modify file ( s ) <nl> - * with this exception , you may extend this exception to your version of the <nl> - * file ( s ) , but you are not obligated to do so . If you do not wish to do so , <nl> - * delete this exception statement from your version . If you delete this <nl> - * exception statement from all source files in the program , then also delete <nl> - * it in the license file . <nl> - * / <nl> + * Copyright ( C ) 2008 - 2017 MongoDB , Inc . <nl> + * <nl> + * This program is free software : you can redistribute it and / or modify <nl> + * it under the terms of the GNU Affero General Public License , version 3 , <nl> + * as published by the Free Software Foundation . <nl> + * <nl> + * This program is distributed in the hope that it will be useful , <nl> + * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> + * GNU Affero General Public License for more details . <nl> + * <nl> + * You should have received a copy of the GNU Affero General Public License <nl> + * along with this program . If not , see < http : / / www . gnu . org / licenses / > . <nl> + * <nl> + * As a special exception , the copyright holders give permission to link the <nl> + * code of portions of this program with the OpenSSL library under certain <nl> + * conditions as described in each individual source file and distribute <nl> + * linked combinations including the program with the OpenSSL library . You <nl> + * must comply with the GNU Affero General Public License in all respects for <nl> + * all of the code used other than as permitted herein . If you modify file ( s ) <nl> + * with this exception , you may extend this exception to your version of the <nl> + * file ( s ) , but you are not obligated to do so . If you do not wish to do so , <nl> + * delete this exception statement from your version . If you delete this <nl> + * exception statement from all source files in the program , then also delete <nl> + * it in the license file . <nl> + * / <nl> <nl> # define MONGO_LOG_DEFAULT_COMPONENT : : mongo : : logger : : LogComponent : : kReplicationRollback <nl> <nl> namespace mongo { <nl> <nl> using std : : shared_ptr ; <nl> using std : : unique_ptr ; <nl> - using std : : endl ; <nl> using std : : list ; <nl> using std : : map ; <nl> - using std : : multimap ; <nl> using std : : set ; <nl> using std : : string ; <nl> using std : : pair ; <nl>
SERVER - 30325 Cleanup the logging / retryable writes glue code
mongodb/mongo
7a3c251a0d2a7774bf69f7c0df3c41bb29be0a15
2017-09-19T13:44:37Z
mmm a / fdbserver / Backup . actor . cpp <nl> ppp b / fdbserver / Backup . actor . cpp <nl> struct BackupData { <nl> const UID myId ; <nl> const Tag tag ; <nl> const Version startVersion ; <nl> + Version endVersion ; / / mutable in a new epoch , i . e . , end version for this epoch is known . <nl> + const LogEpoch epoch ; <nl> Version minKnownCommittedVersion ; <nl> AsyncVar < Reference < ILogSystem > > logSystem ; <nl> Database cx ; <nl> std : : vector < TagsAndMessage > messages ; <nl> std : : vector < Version > versions ; / / one for each of the " messages " <nl> NotifiedVersion version ; <nl> + AsyncTrigger backupDone ; <nl> <nl> explicit BackupData ( UID id , Reference < AsyncVar < ServerDBInfo > > db , const InitializeBackupRequest & req ) <nl> - : myId ( id ) , tag ( req . routerTag ) , startVersion ( req . startVersion ) , minKnownCommittedVersion ( invalidVersion ) , <nl> - version ( invalidVersion ) { <nl> + : myId ( id ) , tag ( req . routerTag ) , startVersion ( req . startVersion ) , <nl> + endVersion ( req . endVersion . present ( ) ? req . endVersion . get ( ) : std : : numeric_limits < Version > : : max ( ) ) , <nl> + epoch ( req . epoch ) , minKnownCommittedVersion ( invalidVersion ) , version ( invalidVersion ) { <nl> cx = openDBOnServer ( db , TaskDefaultEndpoint , true , true ) ; <nl> } <nl> } ; <nl> <nl> - ACTOR Future < Void > setProgress ( BackupData * self , int64_t recoveryCount , Version backupVersion ) { <nl> + ACTOR Future < Void > saveProgress ( BackupData * self , Version backupVersion ) { <nl> state Transaction tr ( self - > cx ) ; <nl> <nl> loop { <nl> ACTOR Future < Void > setProgress ( BackupData * self , int64_t recoveryCount , Version <nl> tr . setOption ( FDBTransactionOptions : : PRIORITY_SYSTEM_IMMEDIATE ) ; <nl> tr . setOption ( FDBTransactionOptions : : LOCK_AWARE ) ; <nl> <nl> - tr . set ( backupProgressKeyFor ( self - > myId ) , backupProgressValue ( recoveryCount , backupVersion ) ) ; <nl> + tr . set ( backupProgressKeyFor ( self - > myId ) , backupProgressValue ( self - > epoch , backupVersion ) ) ; <nl> wait ( tr . commit ( ) ) ; <nl> return Void ( ) ; <nl> } catch ( Error & e ) { <nl> ACTOR Future < Void > uploadData ( BackupData * self ) { <nl> self - > messages . erase ( self - > messages . begin ( ) ) ; <nl> self - > versions . erase ( self - > versions . begin ( ) ) ; <nl> } <nl> - Future < Void > saveProgress = Void ( ) ; <nl> + Future < Void > savedProgress = Void ( ) ; <nl> if ( self - > logSystem . get ( ) & & popVersion > lastPopVersion ) { <nl> const Tag popTag = self - > logSystem . get ( ) - > getPseudoPopTag ( self - > tag , ProcessClass : : BackupClass ) ; <nl> self - > logSystem . get ( ) - > pop ( popVersion , popTag ) ; <nl> lastPopVersion = popVersion ; <nl> TraceEvent ( " BackupWorkerPop " , self - > myId ) . detail ( " V " , popVersion ) . detail ( " Tag " , self - > tag . toString ( ) ) ; <nl> - saveProgress = setProgress ( self , 0 , popVersion ) ; <nl> + savedProgress = saveProgress ( self , popVersion ) ; <nl> } <nl> - wait ( delay ( 30 ) & & saveProgress ) ; <nl> + if ( lastPopVersion > = self - > endVersion ) { <nl> + self - > backupDone . trigger ( ) ; <nl> + } <nl> + wait ( delay ( 30 ) & & savedProgress ) ; / / TODO : knobify the delay of 30s <nl> } <nl> } <nl> <nl> ACTOR Future < Void > pullAsyncData ( BackupData * self ) { <nl> <nl> tagAt = std : : max ( r - > version ( ) . version , lastVersion ) ; <nl> TraceEvent ( " BackupWorkerGot " , self - > myId ) . detail ( " V " , tagAt ) ; <nl> + if ( tagAt > self - > endVersion ) return Void ( ) ; <nl> } <nl> } <nl> <nl> - ACTOR Future < Void > checkRemoved ( Reference < AsyncVar < ServerDBInfo > > db , uint64_t recoveryCount , <nl> - BackupInterface myInterface ) { <nl> + ACTOR Future < Void > checkRemoved ( Reference < AsyncVar < ServerDBInfo > > db , LogEpoch recoveryCount , <nl> + BackupData * self ) { <nl> + state UID lastMasterID ( 0 , 0 ) ; <nl> loop { <nl> bool isDisplaced = <nl> ( ( db - > get ( ) . recoveryCount > recoveryCount & & db - > get ( ) . recoveryState ! = RecoveryState : : UNINITIALIZED ) | | <nl> ( db - > get ( ) . recoveryCount = = recoveryCount & & db - > get ( ) . recoveryState = = RecoveryState : : FULLY_RECOVERED ) ) ; <nl> + isDisplaced = isDisplaced & & ! db - > get ( ) . logSystemConfig . hasBackupWorker ( self - > myId ) ; <nl> if ( isDisplaced ) { <nl> - for ( auto & log : db - > get ( ) . logSystemConfig . tLogs ) { <nl> - if ( std : : count ( log . backupWorkers . begin ( ) , log . backupWorkers . end ( ) , myInterface . id ( ) ) ) { <nl> - isDisplaced = false ; <nl> - break ; <nl> - } <nl> - } <nl> + TraceEvent ( " BackupWorkerDisplaced " , self - > myId ) <nl> + . detail ( " RecoveryCount " , recoveryCount ) <nl> + . detail ( " DBRecoveryCount " , db - > get ( ) . recoveryCount ) <nl> + . detail ( " RecoveryState " , ( int ) db - > get ( ) . recoveryState ) ; <nl> + throw worker_removed ( ) ; <nl> } <nl> - if ( isDisplaced ) { <nl> - for ( auto & old : db - > get ( ) . logSystemConfig . oldTLogs ) { <nl> - for ( auto & log : old . tLogs ) { <nl> - if ( std : : count ( log . backupWorkers . begin ( ) , log . backupWorkers . end ( ) , myInterface . id ( ) ) ) { <nl> - isDisplaced = false ; <nl> - break ; <nl> - } <nl> - } <nl> + if ( db - > get ( ) . master . id ( ) ! = lastMasterID ) { <nl> + lastMasterID = db - > get ( ) . master . id ( ) ; <nl> + const Version endVersion = db - > get ( ) . logSystemConfig . getEpochEndVersion ( recoveryCount ) ; <nl> + if ( endVersion ! = invalidVersion ) { <nl> + TraceEvent ( " BackupWorkerSet " , self - > myId ) <nl> + . detail ( " Before " , self - > endVersion ) <nl> + . detail ( " Now " , endVersion - 1 ) ; <nl> + self - > endVersion = endVersion - 1 ; <nl> } <nl> } <nl> - if ( isDisplaced ) { <nl> - throw worker_removed ( ) ; <nl> - } <nl> wait ( db - > onChange ( ) ) ; <nl> } <nl> } <nl> ACTOR Future < Void > backupWorker ( BackupInterface interf , InitializeBackupRequest <nl> state Future < Void > error = actorCollection ( addActor . getFuture ( ) ) ; <nl> state Future < Void > dbInfoChange = Void ( ) ; <nl> <nl> - TraceEvent ( " BackupWorkerStart " , interf . id ( ) ) ; <nl> + TraceEvent ( " BackupWorkerStart " , interf . id ( ) ) <nl> + . detail ( " Tag " , req . routerTag . toString ( ) ) <nl> + . detail ( " StartVersion " , req . startVersion ) <nl> + . detail ( " LogEpoch " , req . epoch ) ; <nl> try { <nl> addActor . send ( pullAsyncData ( & self ) ) ; <nl> addActor . send ( uploadData ( & self ) ) ; <nl> ACTOR Future < Void > backupWorker ( BackupInterface interf , InitializeBackupRequest <nl> TraceEvent ( " BackupWorkerHalted " , interf . id ( ) ) . detail ( " ReqID " , req . requesterID ) ; <nl> break ; <nl> } <nl> - when ( wait ( checkRemoved ( db , req . recoveryCount , interf ) ) ) { <nl> + when ( wait ( checkRemoved ( db , req . epoch , & self ) ) ) { <nl> TraceEvent ( " BackupWorkerRemoved " , interf . id ( ) ) ; <nl> break ; <nl> } <nl> + when ( wait ( self . backupDone . onTrigger ( ) ) ) { <nl> + TraceEvent ( " BackupWorkerDone " , interf . id ( ) ) ; <nl> + break ; <nl> + } <nl> when ( wait ( error ) ) { } <nl> } <nl> } catch ( Error & e ) { <nl> - if ( e . code ( ) = = error_code_actor_cancelled | | e . code ( ) = = error_code_worker_removed ) { <nl> - TraceEvent ( " BackupWorkerTerminated " , interf . id ( ) ) . error ( e , true ) ; <nl> - } else { <nl> + TraceEvent ( " BackupWorkerTerminated " , interf . id ( ) ) . error ( e , true ) ; <nl> + if ( e . code ( ) ! = error_code_actor_cancelled & & e . code ( ) ! = error_code_worker_removed ) { <nl> throw ; <nl> } <nl> } <nl> mmm a / fdbserver / ClusterRecruitmentInterface . h <nl> ppp b / fdbserver / ClusterRecruitmentInterface . h <nl> struct RegisterMasterRequest { <nl> <nl> ReplyPromise < Void > reply ; <nl> <nl> - RegisterMasterRequest ( ) { } <nl> + RegisterMasterRequest ( ) : logSystemConfig ( 0 ) { } <nl> <nl> template < class Ar > <nl> void serialize ( Ar & ar ) { <nl> mmm a / fdbserver / DBCoreState . h <nl> ppp b / fdbserver / DBCoreState . h <nl> struct OldLogData ; <nl> / / At the moment , transaction logs are replicated but not partitioned , so the topology is as simple as a list of <nl> / / transaction log replicas and the write quorum that was used to commit to them . The read quorum required to <nl> / / ensure durability of locking and recovery is therefore tLogWriteAntiQuorum + 1 . <nl> - <nl> struct CoreTLogSet { <nl> - std : : vector < UID > tLogs ; <nl> + std : : vector < UID > tLogs ; <nl> + std : : vector < UID > backupWorkers ; <nl> int32_t tLogWriteAntiQuorum ; / / The write anti quorum previously used to write to tLogs , which might be different from the anti quorum suggested by the current configuration going forward ! <nl> int32_t tLogReplicationFactor ; / / The replication factor previously used to write to tLogs , which might be different from the current configuration <nl> std : : vector < LocalityData > tLogLocalities ; / / Stores the localities of the log servers <nl> struct CoreTLogSet { <nl> CoreTLogSet ( ) : tLogWriteAntiQuorum ( 0 ) , tLogReplicationFactor ( 0 ) , isLocal ( true ) , locality ( tagLocalityUpgraded ) , startVersion ( invalidVersion ) { } <nl> explicit CoreTLogSet ( const LogSet & logset ) ; <nl> <nl> - bool operator = = ( CoreTLogSet const & rhs ) const { <nl> - return tLogs = = rhs . tLogs & & tLogWriteAntiQuorum = = rhs . tLogWriteAntiQuorum & & tLogReplicationFactor = = rhs . tLogReplicationFactor & & isLocal = = rhs . isLocal & & satelliteTagLocations = = rhs . satelliteTagLocations & & <nl> - locality = = rhs . locality & & startVersion = = rhs . startVersion & & ( ( ! tLogPolicy & & ! rhs . tLogPolicy ) | | ( tLogPolicy & & rhs . tLogPolicy & & ( tLogPolicy - > info ( ) = = rhs . tLogPolicy - > info ( ) ) ) ) ; <nl> + bool operator = = ( CoreTLogSet const & rhs ) const { <nl> + return tLogs = = rhs . tLogs & & backupWorkers = = rhs . backupWorkers & & <nl> + tLogWriteAntiQuorum = = rhs . tLogWriteAntiQuorum & & tLogReplicationFactor = = rhs . tLogReplicationFactor & & <nl> + isLocal = = rhs . isLocal & & satelliteTagLocations = = rhs . satelliteTagLocations & & <nl> + locality = = rhs . locality & & startVersion = = rhs . startVersion & & <nl> + ( ( ! tLogPolicy & & ! rhs . tLogPolicy ) | | <nl> + ( tLogPolicy & & rhs . tLogPolicy & & ( tLogPolicy - > info ( ) = = rhs . tLogPolicy - > info ( ) ) ) ) ; <nl> } <nl> <nl> template < class Archive > <nl> struct CoreTLogSet { <nl> } else { <nl> serializer ( ar , tLogVersion ) ; <nl> } <nl> + if ( ar . protocolVersion ( ) > 0x0FDB00B061070001LL ) { <nl> + serializer ( ar , backupWorkers ) ; <nl> + } <nl> } <nl> } ; <nl> <nl> struct OldTLogCoreData { <nl> int32_t txsTags ; <nl> Version epochEnd ; <nl> std : : set < int8_t > pseudoLocalities ; <nl> + LogEpoch epoch ; <nl> <nl> - OldTLogCoreData ( ) : epochEnd ( 0 ) , logRouterTags ( 0 ) , txsTags ( 0 ) { } <nl> + OldTLogCoreData ( ) : epochEnd ( 0 ) , logRouterTags ( 0 ) , txsTags ( 0 ) , epoch ( 0 ) { } <nl> explicit OldTLogCoreData ( const OldLogData & ) ; <nl> <nl> - bool operator = = ( OldTLogCoreData const & rhs ) const { <nl> - return tLogs = = rhs . tLogs & & logRouterTags = = rhs . logRouterTags & & txsTags = = rhs . txsTags & & epochEnd = = rhs . epochEnd & & pseudoLocalities = = rhs . pseudoLocalities ; <nl> + bool operator = = ( const OldTLogCoreData & rhs ) const { <nl> + return tLogs = = rhs . tLogs & & logRouterTags = = rhs . logRouterTags & & txsTags = = rhs . txsTags & & <nl> + epochEnd = = rhs . epochEnd & & pseudoLocalities = = rhs . pseudoLocalities & & epoch = = rhs . epoch ; <nl> } <nl> <nl> template < class Archive > <nl> struct OldTLogCoreData { <nl> if ( ar . protocolVersion ( ) . hasShardedTxsTags ( ) ) { <nl> serializer ( ar , txsTags ) ; <nl> } <nl> + if ( ar . protocolVersion ( ) . hasBackupWorker ( ) ) { <nl> + serializer ( ar , epoch ) ; <nl> + } <nl> } <nl> } ; <nl> <nl> struct DBCoreState { <nl> DBRecoveryCount recoveryCount ; / / Increases with sequential successful recoveries . <nl> LogSystemType logSystemType ; <nl> std : : set < int8_t > pseudoLocalities ; <nl> + LogEpoch epoch ; <nl> <nl> - DBCoreState ( ) : logRouterTags ( 0 ) , txsTags ( 0 ) , recoveryCount ( 0 ) , logSystemType ( LogSystemType : : empty ) { } <nl> + DBCoreState ( ) : logRouterTags ( 0 ) , txsTags ( 0 ) , recoveryCount ( 0 ) , logSystemType ( LogSystemType : : empty ) , epoch ( 0 ) { } <nl> <nl> vector < UID > getPriorCommittedLogServers ( ) { <nl> vector < UID > priorCommittedLogServers ; <nl> struct DBCoreState { <nl> return priorCommittedLogServers ; <nl> } <nl> <nl> - bool isEqual ( DBCoreState const & r ) const { <nl> - return logSystemType = = r . logSystemType & & recoveryCount = = r . recoveryCount & & tLogs = = r . tLogs & & oldTLogData = = r . oldTLogData & & logRouterTags = = r . logRouterTags & & txsTags = = r . txsTags & & pseudoLocalities = = r . pseudoLocalities ; <nl> + bool isEqual ( const DBCoreState & r ) const { <nl> + return logSystemType = = r . logSystemType & & recoveryCount = = r . recoveryCount & & tLogs = = r . tLogs & & <nl> + oldTLogData = = r . oldTLogData & & logRouterTags = = r . logRouterTags & & txsTags = = r . txsTags & & <nl> + pseudoLocalities = = r . pseudoLocalities & & epoch = = r . epoch ; <nl> } <nl> - bool operator = = ( const DBCoreState & rhs ) const { return isEqual ( rhs ) ; } <nl> + bool operator = = ( const DBCoreState & rhs ) const { return isEqual ( rhs ) ; } <nl> <nl> template < class Archive > <nl> void serialize ( Archive & ar ) { <nl> struct DBCoreState { <nl> if ( ar . protocolVersion ( ) . hasShardedTxsTags ( ) ) { <nl> serializer ( ar , txsTags ) ; <nl> } <nl> + if ( ar . protocolVersion ( ) . hasBackupWorker ( ) ) { <nl> + serializer ( ar , epoch ) ; / / TODO : serialize epoch in higher version ? <nl> + } <nl> } else if ( ar . isDeserializing ) { <nl> tLogs . push_back ( CoreTLogSet ( ) ) ; <nl> serializer ( ar , tLogs [ 0 ] . tLogs , tLogs [ 0 ] . tLogWriteAntiQuorum , recoveryCount , tLogs [ 0 ] . tLogReplicationFactor , logSystemType ) ; <nl> mmm a / fdbserver / LogSystemConfig . h <nl> ppp b / fdbserver / LogSystemConfig . h <nl> <nl> # define FDBSERVER_LOGSYSTEMCONFIG_H <nl> # pragma once <nl> <nl> + # include " fdbserver / BackupInterface . h " <nl> # include " fdbserver / TLogInterface . h " <nl> # include " fdbrpc / ReplicationPolicy . h " <nl> # include " fdbclient / DatabaseConfiguration . h " <nl> struct OldTLogConf { <nl> int32_t logRouterTags ; <nl> int32_t txsTags ; <nl> std : : set < int8_t > pseudoLocalities ; / / Tracking pseudo localities , e . g . , tagLocalityLogRouterMapped , used in the old epoch . <nl> + LogEpoch epoch ; <nl> <nl> - OldTLogConf ( ) : epochEnd ( 0 ) , logRouterTags ( 0 ) , txsTags ( 0 ) { } <nl> + OldTLogConf ( ) : epochEnd ( 0 ) , logRouterTags ( 0 ) , txsTags ( 0 ) , epoch ( 0 ) { } <nl> explicit OldTLogConf ( const OldLogData & ) ; <nl> <nl> std : : string toString ( ) const { <nl> struct OldTLogConf { <nl> } <nl> <nl> bool operator = = ( const OldTLogConf & rhs ) const { <nl> - return tLogs = = rhs . tLogs & & epochEnd = = rhs . epochEnd & & logRouterTags = = rhs . logRouterTags & & txsTags = = rhs . txsTags & & pseudoLocalities = = rhs . pseudoLocalities ; <nl> + return tLogs = = rhs . tLogs & & epochEnd = = rhs . epochEnd & & logRouterTags = = rhs . logRouterTags & & <nl> + txsTags = = rhs . txsTags & & pseudoLocalities = = rhs . pseudoLocalities & & epoch = = rhs . epoch ; <nl> } <nl> <nl> bool isEqualIds ( OldTLogConf const & r ) const { <nl> struct OldTLogConf { <nl> <nl> template < class Ar > <nl> void serialize ( Ar & ar ) { <nl> - serializer ( ar , tLogs , epochEnd , logRouterTags , pseudoLocalities , txsTags ) ; <nl> + serializer ( ar , tLogs , epochEnd , logRouterTags , pseudoLocalities , txsTags , epoch ) ; <nl> } <nl> } ; <nl> <nl> struct LogSystemConfig { <nl> bool stopped ; <nl> Optional < Version > recoveredAt ; <nl> std : : set < int8_t > pseudoLocalities ; <nl> + LogEpoch epoch ; <nl> <nl> - LogSystemConfig ( ) : logSystemType ( LogSystemType : : empty ) , logRouterTags ( 0 ) , txsTags ( 0 ) , expectedLogSets ( 0 ) , stopped ( false ) { } <nl> + LogSystemConfig ( LogEpoch e = 0 ) <nl> + : logSystemType ( LogSystemType : : empty ) , logRouterTags ( 0 ) , txsTags ( 0 ) , expectedLogSets ( 0 ) , stopped ( false ) , epoch ( e ) { } <nl> <nl> std : : string toString ( ) const { <nl> return format ( " type : % d oldGenerations : % d tags : % d % s " , logSystemType , oldTLogs . size ( ) , logRouterTags , describe ( tLogs ) . c_str ( ) ) ; <nl> struct LogSystemConfig { <nl> bool operator = = ( const LogSystemConfig & rhs ) const { return isEqual ( rhs ) ; } <nl> <nl> bool isEqual ( LogSystemConfig const & r ) const { <nl> - return logSystemType = = r . logSystemType & & tLogs = = r . tLogs & & oldTLogs = = r . oldTLogs & & expectedLogSets = = r . expectedLogSets & & logRouterTags = = r . logRouterTags & & txsTags = = r . txsTags & & recruitmentID = = r . recruitmentID & & stopped = = r . stopped & & recoveredAt = = r . recoveredAt & & pseudoLocalities = = r . pseudoLocalities ; <nl> + return logSystemType = = r . logSystemType & & tLogs = = r . tLogs & & oldTLogs = = r . oldTLogs & & <nl> + expectedLogSets = = r . expectedLogSets & & logRouterTags = = r . logRouterTags & & <nl> + txsTags = = r . txsTags & & recruitmentID = = r . recruitmentID & & stopped = = r . stopped & & <nl> + recoveredAt = = r . recoveredAt & & pseudoLocalities = = r . pseudoLocalities & & epoch = = r . epoch ; <nl> } <nl> <nl> bool isEqualIds ( LogSystemConfig const & r ) const { <nl> struct LogSystemConfig { <nl> return false ; <nl> } <nl> <nl> + Version getEpochEndVersion ( LogEpoch epoch ) const { <nl> + for ( const auto & old : oldTLogs ) { <nl> + if ( old . epoch = = epoch ) { <nl> + return old . epochEnd ; <nl> + } <nl> + } <nl> + return invalidVersion ; <nl> + } <nl> + <nl> template < class Ar > <nl> - void serialize ( Ar & ar ) { <nl> - serializer ( ar , logSystemType , tLogs , logRouterTags , oldTLogs , expectedLogSets , recruitmentID , stopped , recoveredAt , pseudoLocalities , txsTags ) ; <nl> + void serialize ( Ar & ar ) { <nl> + serializer ( ar , logSystemType , tLogs , logRouterTags , oldTLogs , expectedLogSets , recruitmentID , stopped , <nl> + recoveredAt , pseudoLocalities , txsTags , epoch ) ; <nl> } <nl> } ; <nl> <nl> mmm a / fdbserver / ServerDBInfo . h <nl> ppp b / fdbserver / ServerDBInfo . h <nl> struct ServerDBInfo { <nl> Optional < LatencyBandConfig > latencyBandConfig ; <nl> std : : vector < std : : pair < uint16_t , StorageServerInterface > > storageCaches ; <nl> <nl> - explicit ServerDBInfo ( ) : recoveryCount ( 0 ) , recoveryState ( RecoveryState : : UNINITIALIZED ) { } <nl> + explicit ServerDBInfo ( ) : recoveryCount ( 0 ) , recoveryState ( RecoveryState : : UNINITIALIZED ) , logSystemConfig ( 0 ) { } <nl> <nl> bool operator = = ( ServerDBInfo const & r ) const { return id = = r . id ; } <nl> bool operator ! = ( ServerDBInfo const & r ) const { return id ! = r . id ; } <nl> mmm a / fdbserver / TagPartitionedLogSystem . actor . cpp <nl> ppp b / fdbserver / TagPartitionedLogSystem . actor . cpp <nl> struct OldLogData { <nl> int32_t txsTags ; / / The number of txsTags , which may change across generations . <nl> Version epochEnd ; <nl> std : : set < int8_t > pseudoLocalities ; <nl> + LogEpoch epoch ; <nl> <nl> - OldLogData ( ) : epochEnd ( 0 ) , logRouterTags ( 0 ) , txsTags ( 0 ) { } <nl> + OldLogData ( ) : epochEnd ( 0 ) , logRouterTags ( 0 ) , txsTags ( 0 ) , epoch ( 0 ) { } <nl> <nl> / / Constructor for T of OldTLogConf and OldTLogCoreData <nl> - template < class T > <nl> + template < class T > <nl> explicit OldLogData ( const T & conf ) <nl> - : logRouterTags ( conf . logRouterTags ) , txsTags ( conf . txsTags ) , epochEnd ( conf . epochEnd ) , <nl> - pseudoLocalities ( conf . pseudoLocalities ) <nl> - { <nl> + : logRouterTags ( conf . logRouterTags ) , txsTags ( conf . txsTags ) , epochEnd ( conf . epochEnd ) , <nl> + pseudoLocalities ( conf . pseudoLocalities ) , epoch ( conf . epoch ) { <nl> tLogs . resize ( conf . tLogs . size ( ) ) ; <nl> for ( int j = 0 ; j < conf . tLogs . size ( ) ; j + + ) { <nl> Reference < LogSet > logSet ( new LogSet ( conf . tLogs [ j ] ) ) ; <nl> LogSet : : LogSet ( const CoreTLogSet & coreSet ) : <nl> locality ( coreSet . locality ) , startVersion ( coreSet . startVersion ) , <nl> satelliteTagLocations ( coreSet . satelliteTagLocations ) <nl> { <nl> - for ( const auto & log : coreSet . tLogs ) { <nl> + for ( const auto & log : coreSet . tLogs ) { <nl> logServers . emplace_back ( new AsyncVar < OptionalInterface < TLogInterface > > ( OptionalInterface < TLogInterface > ( log ) ) ) ; <nl> } <nl> + for ( const auto & worker : coreSet . backupWorkers ) { <nl> + backupWorkers . emplace_back ( <nl> + new AsyncVar < OptionalInterface < BackupInterface > > ( OptionalInterface < BackupInterface > ( worker ) ) ) ; <nl> + } <nl> filterLocalityDataForPolicy ( tLogPolicy , & tLogLocalities ) ; <nl> updateLocalitySet ( tLogLocalities ) ; <nl> } <nl> TLogSet : : TLogSet ( const LogSet & rhs ) : <nl> } <nl> } <nl> <nl> - OldTLogConf : : OldTLogConf ( const OldLogData & oldLogData ) : <nl> - logRouterTags ( oldLogData . logRouterTags ) , txsTags ( oldLogData . txsTags ) , epochEnd ( oldLogData . epochEnd ) , <nl> - pseudoLocalities ( oldLogData . pseudoLocalities ) <nl> - { <nl> + OldTLogConf : : OldTLogConf ( const OldLogData & oldLogData ) <nl> + : logRouterTags ( oldLogData . logRouterTags ) , txsTags ( oldLogData . txsTags ) , epochEnd ( oldLogData . epochEnd ) , <nl> + pseudoLocalities ( oldLogData . pseudoLocalities ) , epoch ( oldLogData . epoch ) { <nl> for ( const Reference < LogSet > & logSet : oldLogData . tLogs ) { <nl> tLogs . emplace_back ( * logSet ) ; <nl> } <nl> CoreTLogSet : : CoreTLogSet ( const LogSet & logset ) : <nl> for ( const auto & log : logset . logServers ) { <nl> tLogs . push_back ( log - > get ( ) . id ( ) ) ; <nl> } <nl> + for ( const auto & worker : logset . backupWorkers ) { <nl> + backupWorkers . push_back ( worker - > get ( ) . id ( ) ) ; <nl> + } <nl> } <nl> <nl> - OldTLogCoreData : : OldTLogCoreData ( const OldLogData & oldData ) : <nl> - logRouterTags ( oldData . logRouterTags ) , txsTags ( oldData . txsTags ) , epochEnd ( oldData . epochEnd ) , <nl> - pseudoLocalities ( oldData . pseudoLocalities ) <nl> - { <nl> + OldTLogCoreData : : OldTLogCoreData ( const OldLogData & oldData ) <nl> + : logRouterTags ( oldData . logRouterTags ) , txsTags ( oldData . txsTags ) , epochEnd ( oldData . epochEnd ) , <nl> + pseudoLocalities ( oldData . pseudoLocalities ) , epoch ( oldData . epoch ) { <nl> for ( const Reference < LogSet > & logSet : oldData . tLogs ) { <nl> if ( logSet - > logServers . size ( ) ) { <nl> tLogs . emplace_back ( * logSet ) ; <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> int repopulateRegionAntiQuorum ; <nl> bool stopped ; <nl> std : : set < int8_t > pseudoLocalities ; / / Represent special localities that will be mapped to tagLocalityLogRouter <nl> - std : : map < int8_t , Version > pseudoLocalityPopVersion ; <nl> + const LogEpoch epoch ; <nl> <nl> / / new members <nl> + std : : map < int8_t , Version > pseudoLocalityPopVersion ; <nl> Future < Void > rejoins ; <nl> Future < Void > recoveryComplete ; <nl> Future < Void > remoteRecovery ; <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> std : : vector < OldLogData > oldLogData ; <nl> AsyncTrigger logSystemConfigChanged ; <nl> <nl> - TagPartitionedLogSystem ( UID dbgid , LocalityData locality , Optional < PromiseStream < Future < Void > > > addActor = Optional < PromiseStream < Future < Void > > > ( ) ) : dbgid ( dbgid ) , locality ( locality ) , addActor ( addActor ) , popActors ( false ) , recoveryCompleteWrittenToCoreState ( false ) , remoteLogsWrittenToCoreState ( false ) , logSystemType ( LogSystemType : : empty ) , logRouterTags ( 0 ) , txsTags ( 0 ) , expectedLogSets ( 0 ) , hasRemoteServers ( false ) , stopped ( false ) , repopulateRegionAntiQuorum ( 0 ) { } <nl> + TagPartitionedLogSystem ( UID dbgid , LocalityData locality , LogEpoch e , <nl> + Optional < PromiseStream < Future < Void > > > addActor = Optional < PromiseStream < Future < Void > > > ( ) ) <nl> + : dbgid ( dbgid ) , logSystemType ( LogSystemType : : empty ) , expectedLogSets ( 0 ) , logRouterTags ( 0 ) , txsTags ( 0 ) , <nl> + repopulateRegionAntiQuorum ( 0 ) , epoch ( e ) , recoveryCompleteWrittenToCoreState ( false ) , locality ( locality ) , <nl> + remoteLogsWrittenToCoreState ( false ) , hasRemoteServers ( false ) , stopped ( false ) , addActor ( addActor ) , <nl> + popActors ( false ) { } <nl> <nl> virtual void stopRejoins ( ) { <nl> rejoins = Future < Void > ( ) ; <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> static Reference < ILogSystem > fromLogSystemConfig ( UID const & dbgid , LocalityData const & locality , LogSystemConfig const & lsConf , bool excludeRemote , bool useRecoveredAt , Optional < PromiseStream < Future < Void > > > addActor ) { <nl> ASSERT ( lsConf . logSystemType = = LogSystemType : : tagPartitioned | | ( lsConf . logSystemType = = LogSystemType : : empty & & ! lsConf . tLogs . size ( ) ) ) ; <nl> / / ASSERT ( lsConf . epoch = = epoch ) ; / / < FIXME <nl> - Reference < TagPartitionedLogSystem > logSystem ( new TagPartitionedLogSystem ( dbgid , locality , addActor ) ) ; <nl> + Reference < TagPartitionedLogSystem > logSystem ( <nl> + new TagPartitionedLogSystem ( dbgid , locality , lsConf . epoch , addActor ) ) ; <nl> <nl> logSystem - > tLogs . reserve ( lsConf . tLogs . size ( ) ) ; <nl> logSystem - > expectedLogSets = lsConf . expectedLogSets ; <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> static Reference < ILogSystem > fromOldLogSystemConfig ( UID const & dbgid , LocalityData const & locality , LogSystemConfig const & lsConf ) { <nl> ASSERT ( lsConf . logSystemType = = LogSystemType : : tagPartitioned | | ( lsConf . logSystemType = = LogSystemType : : empty & & ! lsConf . tLogs . size ( ) ) ) ; <nl> / / ASSERT ( lsConf . epoch = = epoch ) ; / / < FIXME <nl> - Reference < TagPartitionedLogSystem > logSystem ( new TagPartitionedLogSystem ( dbgid , locality ) ) ; <nl> + const LogEpoch e = lsConf . oldTLogs . size ( ) > 0 ? lsConf . oldTLogs [ 0 ] . epoch : 0 ; <nl> + Reference < TagPartitionedLogSystem > logSystem ( new TagPartitionedLogSystem ( dbgid , locality , e ) ) ; <nl> <nl> if ( lsConf . oldTLogs . size ( ) ) { <nl> for ( const TLogSet & tLogSet : lsConf . oldTLogs [ 0 ] . tLogs ) { <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> newState . logRouterTags = logRouterTags ; <nl> newState . txsTags = txsTags ; <nl> newState . pseudoLocalities = pseudoLocalities ; <nl> + newState . epoch = epoch ; <nl> for ( const auto & t : tLogs ) { <nl> if ( t - > logServers . size ( ) ) { <nl> newState . tLogs . emplace_back ( * t ) ; <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> } <nl> <nl> virtual LogSystemConfig getLogSystemConfig ( ) { <nl> - LogSystemConfig logSystemConfig ; <nl> + LogSystemConfig logSystemConfig ( epoch ) ; <nl> logSystemConfig . logSystemType = logSystemType ; <nl> logSystemConfig . expectedLogSets = expectedLogSets ; <nl> logSystemConfig . logRouterTags = logRouterTags ; <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> <nl> if ( ! prevState . tLogs . size ( ) ) { <nl> / / This is a brand new database <nl> - Reference < TagPartitionedLogSystem > logSystem ( new TagPartitionedLogSystem ( dbgid , locality ) ) ; <nl> + Reference < TagPartitionedLogSystem > logSystem ( new TagPartitionedLogSystem ( dbgid , locality , 0 ) ) ; <nl> logSystem - > logSystemType = prevState . logSystemType ; <nl> logSystem - > recoverAt = 0 ; <nl> logSystem - > knownCommittedVersion = 0 ; <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> if ( maxEnd > 0 & & ( ! lastEnd . present ( ) | | maxEnd < lastEnd . get ( ) ) ) { <nl> TEST ( lastEnd . present ( ) ) ; / / Restarting recovery at an earlier point <nl> <nl> - Reference < TagPartitionedLogSystem > logSystem ( new TagPartitionedLogSystem ( dbgid , locality ) ) ; <nl> + Reference < TagPartitionedLogSystem > logSystem ( <nl> + new TagPartitionedLogSystem ( dbgid , locality , prevState . epoch ) ) ; <nl> <nl> lastEnd = minEnd ; <nl> logSystem - > tLogs = logServers ; <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> return localTags ; <nl> } <nl> <nl> + ACTOR static Future < Void > loadBackupProgress ( ) { <nl> + / / get a map of UID - > recoveryCount , savedVersion <nl> + / / for each old epoch : <nl> + / / if savedVersion > = epochEnd - 1 = knownCommittedVersion <nl> + / / skip or remove this entry <nl> + / / else <nl> + / / recover / backup [ savedVersion + 1 , epochEnd - 1 ] <nl> + / / use the old recoveryCount and tag . Make sure old worker stopped . <nl> + return Void ( ) ; <nl> + } <nl> + <nl> ACTOR static Future < Void > recruitBackupWorkers ( Reference < TagPartitionedLogSystem > logSystem , <nl> RecruitFromConfigurationReply recruits , LogEpoch recoveryCount ) { <nl> if ( recruits . backupWorkers . size ( ) = = 0 ) return Void ( ) ; <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> for ( int i = 0 ; i < logSystem - > logRouterTags ; i + + ) { <nl> const auto & worker = recruits . backupWorkers [ i % recruits . backupWorkers . size ( ) ] ; <nl> InitializeBackupRequest req ( g_random - > randomUniqueID ( ) ) ; <nl> - req . recoveryCount = recoveryCount ; <nl> + req . epoch = recoveryCount ; <nl> req . routerTag = Tag ( tagLocalityLogRouter , i ) ; <nl> req . startVersion = logSystem - > tLogs [ 0 ] - > startVersion ; <nl> - TraceEvent ( " BackupRecruitment " ) . detail ( " WorkerID " , worker . id ( ) ) . detail ( " RecoveryCount " , recoveryCount ) <nl> - . detail ( " StartVersion " , req . startVersion ) ; <nl> + TraceEvent ( " BackupRecruitment " ) <nl> + . detail ( " WorkerID " , worker . id ( ) ) <nl> + . detail ( " Epoch " , recoveryCount ) <nl> + . detail ( " StartVersion " , req . startVersion ) ; <nl> initializationReplies . push_back ( transformErrors ( <nl> throwErrorOr ( worker . backup . getReplyUnlessFailedFor ( req , SERVER_KNOBS - > BACKUP_TIMEOUT , <nl> SERVER_KNOBS - > MASTER_FAILURE_SLOPE_DURING_RECOVERY ) ) , <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> ACTOR static Future < Reference < ILogSystem > > newEpoch ( Reference < TagPartitionedLogSystem > oldLogSystem , RecruitFromConfigurationReply recr , Future < RecruitRemoteFromConfigurationReply > fRemoteWorkers , DatabaseConfiguration configuration , LogEpoch recoveryCount , <nl> int8_t primaryLocality , int8_t remoteLocality , std : : vector < Tag > allTags , Reference < AsyncVar < bool > > recruitmentStalled ) { <nl> state double startTime = now ( ) ; <nl> - state Reference < TagPartitionedLogSystem > logSystem ( new TagPartitionedLogSystem ( oldLogSystem - > getDebugID ( ) , oldLogSystem - > locality ) ) ; <nl> + state Reference < TagPartitionedLogSystem > logSystem ( <nl> + new TagPartitionedLogSystem ( oldLogSystem - > getDebugID ( ) , oldLogSystem - > locality , recoveryCount ) ) ; <nl> logSystem - > logSystemType = LogSystemType : : tagPartitioned ; <nl> logSystem - > expectedLogSets = 1 ; <nl> logSystem - > recoveredAt = oldLogSystem - > recoverAt ; <nl> mmm a / fdbserver / WorkerInterface . actor . h <nl> ppp b / fdbserver / WorkerInterface . actor . h <nl> struct InitializeTLogRequest { <nl> <nl> ReplyPromise < struct TLogInterface > reply ; <nl> <nl> - InitializeTLogRequest ( ) { } <nl> + InitializeTLogRequest ( ) : recoverFrom ( 0 ) { } <nl> <nl> template < class Ar > <nl> void serialize ( Ar & ar ) { <nl> struct InitializeLogRouterRequest { <nl> struct InitializeBackupRequest { <nl> constexpr static FileIdentifier file_identifier = 68354279 ; <nl> UID reqId ; <nl> - uint64_t recoveryCount ; <nl> + LogEpoch epoch ; <nl> Tag routerTag ; <nl> Version startVersion ; <nl> + Optional < Version > endVersion ; <nl> ReplyPromise < struct BackupInterface > reply ; <nl> <nl> InitializeBackupRequest ( ) = default ; <nl> struct InitializeBackupRequest { <nl> <nl> template < class Ar > <nl> void serialize ( Ar & ar ) { <nl> - serializer ( ar , reqId , recoveryCount , routerTag , startVersion , reply ) ; <nl> + serializer ( ar , reqId , epoch , routerTag , startVersion , endVersion , reply ) ; <nl> } <nl> } ; <nl> <nl> mmm a / flow / ProtocolVersion . h <nl> ppp b / flow / ProtocolVersion . h <nl> class ProtocolVersion { <nl> PROTOCOL_VERSION_FEATURE ( 0x0FDB00B061070000LL , PseudoLocalities ) ; <nl> PROTOCOL_VERSION_FEATURE ( 0x0FDB00B061070000LL , ShardedTxsTags ) ; <nl> PROTOCOL_VERSION_FEATURE ( 0x0FDB00B063000000LL , UnifiedTLogSpilling ) ; <nl> + PROTOCOL_VERSION_FEATURE ( 0x0FDB00B063010000LL , BackupWorker ) ; <nl> } ; <nl> <nl> / / These impact both communications and the deserialization of certain database and IKeyValueStore keys . <nl>
Add epoch and backup workers to DBCoreState
apple/foundationdb
17002740bba122d93117518b331ffcb95875617e
2020-01-23T03:38:45Z
mmm a / src / compiler / analysis / analysis_result . cpp <nl> ppp b / src / compiler / analysis / analysis_result . cpp <nl> void AnalysisResult : : outputCPPDynamicTables ( CodeGenerator : : Output output ) { <nl> } <nl> <nl> cg_printf ( " \ n " ) ; <nl> - cg_indentBegin ( " Variant invoke_file ( CStrRef path , " <nl> + cg_indentBegin ( " Variant invoke_file ( CStrRef s , " <nl> " bool once / * = false * / , " <nl> " LVariableTable * variables / * = NULL * / , " <nl> " const char * currentDir / * = NULL * / ) { \ n " ) ; <nl> void AnalysisResult : : outputCPPDynamicTables ( CodeGenerator : : Output output ) { <nl> / / See if there ' s an eval ' d version <nl> cg_indentBegin ( " { \ n " ) ; <nl> cg_printf ( " Variant r ; \ n " ) ; <nl> - cg_printf ( " if ( eval_invoke_file_hook ( r , path , once , variables , " <nl> + cg_printf ( " if ( eval_invoke_file_hook ( r , s , once , variables , " <nl> " currentDir ) ) " <nl> " return r ; \ n " ) ; <nl> cg_indentEnd ( " } \ n " ) ; <nl> } <nl> <nl> string root ; <nl> - cg_printf ( " String s = canonicalize_path ( path , \ " % s \ " , % d ) ; \ n " , <nl> - root . c_str ( ) , root . size ( ) ) ; <nl> <nl> for ( JumpTable jt ( cg , entries , false , false , true ) ; jt . ready ( ) ; <nl> jt . next ( ) ) { <nl> void AnalysisResult : : outputCPPDynamicTables ( CodeGenerator : : Output output ) { <nl> Option : : PseudoMainPrefix , <nl> Option : : MangleFilename ( entries [ 0 ] , true ) . c_str ( ) ) ; <nl> } <nl> - cg_printf ( " raise_notice ( \ " Tried to invoke % % s but file not found . \ " , " <nl> - " s . data ( ) ) ; \ n " ) ; <nl> + <nl> cg_printf ( " return throw_missing_file ( s . data ( ) ) ; \ n " ) ; <nl> cg_indentEnd ( " } \ n " ) ; <nl> } <nl> mmm a / src / compiler / expression / include_expression . cpp <nl> ppp b / src / compiler / expression / include_expression . cpp <nl> void IncludeExpression : : outputCPPImpl ( CodeGenerator & cg , <nl> } <nl> <nl> / / include ( ) and require ( ) need containing file ' s directory <nl> - string currentDir = " NULL " ; <nl> + string currentDir = " \ " \ " " ; <nl> if ( m_loc & & m_loc - > file & & * m_loc - > file ) { <nl> string file = m_loc - > file ; <nl> size_t pos = file . rfind ( ' / ' ) ; <nl> mmm a / src / runtime / base / builtin_functions . cpp <nl> ppp b / src / runtime / base / builtin_functions . cpp <nl> String get_source_filename ( litstr path ) { <nl> return RuntimeOption : : SourceRoot + path ; <nl> } <nl> <nl> + Variant include_impl_invoke ( CStrRef file , bool once , <nl> + LVariableTable * variables , <nl> + const char * currentDir ) { <nl> + if ( file [ 0 ] = = ' / ' ) { <nl> + try { <nl> + return invoke_file ( file , once , variables , currentDir ) ; <nl> + } catch ( PhpFileDoesNotExistException & e ) { } <nl> + <nl> + string server_root = RuntimeOption : : SourceRoot ; <nl> + if ( server_root . empty ( ) ) { <nl> + server_root = string ( g_context - > getCwd ( ) - > data ( ) ) + " / " ; <nl> + } <nl> + <nl> + String rel_path ( Util : : relativePath ( server_root , string ( file . data ( ) ) ) ) ; <nl> + <nl> + / / Don ' t try / catch - We want the exception to be passed along <nl> + return invoke_file ( rel_path , once , variables , currentDir ) ; <nl> + } else { <nl> + / / Don ' t try / catch - We want the exception to be passed along <nl> + return invoke_file ( file , once , variables , currentDir ) ; <nl> + } <nl> + } <nl> + <nl> static Variant include_impl ( CStrRef file , bool once , <nl> LVariableTable * variables , <nl> const char * currentDir , bool required ) { <nl> - try { <nl> - return invoke_file ( file , once , variables , currentDir ) ; <nl> - } catch ( PhpFileDoesNotExistException & e ) { } <nl> <nl> - / / resolving relative path <nl> - if ( ! file . empty ( ) & & file [ 0 ] ! = ' / ' ) { <nl> - / / use containing file ' s location to resolve the file <nl> - if ( currentDir & & * currentDir ) { <nl> - String path = String ( currentDir ) + file ; <nl> - try { <nl> - return invoke_file ( path , once , variables , currentDir ) ; <nl> - } catch ( PhpFileDoesNotExistException & e ) { } <nl> - } <nl> + const char * c_file = file - > data ( ) ; <nl> + <nl> + if ( c_file [ 0 ] = = ' / ' ) { <nl> + String can_path ( Util : : canonicalize ( file . c_str ( ) , file . size ( ) ) ) ; <nl> + <nl> + try { <nl> + return include_impl_invoke ( can_path , once , variables , currentDir ) ; <nl> + } catch ( PhpFileDoesNotExistException & e ) { } <nl> + <nl> + } else if ( ( c_file [ 0 ] = = ' . ' & & ( c_file [ 1 ] = = ' / ' | | ( <nl> + c_file [ 1 ] = = ' . ' & & c_file [ 2 ] = = ' / ' ) ) ) ) { <nl> + <nl> + String path ( String ( g_context - > getCwd ( ) + " / " + file ) ) ; <nl> + String can_path ( Util : : canonicalize ( path . c_str ( ) , path . size ( ) ) ) ; <nl> <nl> - / / use current directory to resolve the file <nl> - String path = g_context - > getCwd ( ) + " / " + file ; <nl> try { <nl> - return invoke_file ( path , once , variables , currentDir ) ; <nl> + return include_impl_invoke ( can_path , once , variables , currentDir ) ; <nl> } catch ( PhpFileDoesNotExistException & e ) { } <nl> <nl> - / / use include paths to resolve the file <nl> - unsigned int i0 = 0 ; <nl> - if ( ! RuntimeOption : : IncludeSearchPaths . empty ( ) & & <nl> - RuntimeOption : : IncludeSearchPaths [ 0 ] = = " . " ) { <nl> - i0 = 1 ; / / skipping it <nl> + <nl> + } else { <nl> + <nl> + unsigned int path_count = RuntimeOption : : IncludeSearchPaths . size ( ) ; <nl> + <nl> + for ( unsigned int i = 0 ; i < path_count ; i + + ) { <nl> + String path ( " " ) ; <nl> + <nl> + if ( RuntimeOption : : IncludeSearchPaths [ i ] [ 0 ] ! = ' / ' ) { <nl> + path + = ( g_context - > getCwd ( ) + " / " ) ; <nl> + } <nl> + <nl> + if ( path [ path . size ( ) - 1 ] ! = ' / ' ) { <nl> + path + = " / " ; <nl> + } <nl> + <nl> + path + = file ; <nl> + String can_path ( Util : : canonicalize ( path . c_str ( ) , path . size ( ) ) ) ; <nl> + <nl> + try { <nl> + return include_impl_invoke ( can_path , once , variables , currentDir ) ; <nl> + } catch ( PhpFileDoesNotExistException & e ) { } <nl> } <nl> - for ( unsigned int i = i0 ; i < RuntimeOption : : IncludeSearchPaths . size ( ) ; <nl> - i + + ) { <nl> - String path ( RuntimeOption : : IncludeSearchPaths [ i ] ) ; <nl> + <nl> + if ( currentDir [ 0 ] = = ' / ' ) { <nl> + / / We are in hphpi , which passes an absolute path <nl> + String path ( currentDir ) ; <nl> + path + = " / " ; <nl> path + = file ; <nl> + String can_path ( Util : : canonicalize ( path . c_str ( ) , path . size ( ) ) ) ; <nl> + <nl> + try { <nl> + return include_impl_invoke ( can_path , once , variables , currentDir ) ; <nl> + } catch ( PhpFileDoesNotExistException & e ) { } <nl> + } else { <nl> + / / Regular hphp <nl> + String path ( g_context - > getCwd ( ) + " / " + currentDir + file ) ; <nl> + String can_path ( Util : : canonicalize ( path . c_str ( ) , path . size ( ) ) ) ; <nl> + <nl> try { <nl> - return invoke_file ( path , once , variables , currentDir ) ; <nl> + return include_impl_invoke ( can_path , once , variables , currentDir ) ; <nl> } catch ( PhpFileDoesNotExistException & e ) { } <nl> } <nl> } <nl> <nl> + / / Failure <nl> + raise_notice ( " Tried to invoke % s but file not found . " , file - > data ( ) ) ; <nl> if ( required ) { <nl> String ms = " Required file that does not exist : " ; <nl> ms + = file ; <nl> mmm a / src / runtime / base / builtin_functions . h <nl> ppp b / src / runtime / base / builtin_functions . h <nl> Variant f_unserialize ( CStrRef str ) ; <nl> class LVariableTable ; <nl> Variant include ( CStrRef file , bool once = false , <nl> LVariableTable * variables = NULL , <nl> - const char * currentDir = NULL ) ; <nl> + const char * currentDir = " " ) ; <nl> Variant require ( CStrRef file , bool once = false , <nl> LVariableTable * variables = NULL , <nl> - const char * currentDir = NULL ) ; <nl> + const char * currentDir = " " ) ; <nl> + Variant include_impl_invoke ( CStrRef file , bool once = false , <nl> + LVariableTable * variables = NULL , <nl> + const char * currentDir = " " ) ; <nl> <nl> / * * <nl> * For function interception or stubout support . <nl> mmm a / src / runtime / base / hphp_ffi . cpp <nl> ppp b / src / runtime / base / hphp_ffi . cpp <nl> int hphp_ffi_string_data ( StringData * sd , const char * * data ) { <nl> } <nl> <nl> void hphp_ffi_include_file ( const char * file ) { <nl> - invoke_file ( file ) ; <nl> + include_impl_invoke ( file ) ; <nl> } <nl> <nl> int hphp_ffi_invoke_function ( void * * ret , const char * func , ArrayData * args ) { <nl> mmm a / src / runtime / base / hphp_ffi . h <nl> ppp b / src / runtime / base / hphp_ffi . h <nl> <nl> # ifndef __HPHP_FFI_H__ <nl> # define __HPHP_FFI_H__ <nl> <nl> + # include < runtime / base / builtin_functions . h > <nl> + <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> namespace HPHP { <nl> class Variant ; <nl> mmm a / src / runtime / base / program_functions . cpp <nl> ppp b / src / runtime / base / program_functions . cpp <nl> static bool hphp_warmup ( ExecutionContext * context , <nl> if ( ! warmupDoc . empty ( ) ) { <nl> try { <nl> ServerStatsHelper ssh ( " warmup " ) ; <nl> - invoke_file ( warmupDoc , true , get_variable_table ( ) ) ; <nl> + include_impl_invoke ( warmupDoc , true , get_variable_table ( ) ) ; <nl> } catch ( . . . ) { <nl> ret = handle_exception ( context , errorMsg , WarmupDocException , <nl> error ) ; <nl> static bool hphp_warmup ( ExecutionContext * context , <nl> ServerStatsHelper ssh ( " reqinit " ) ; <nl> try { <nl> if ( ! reqInitDoc . empty ( ) ) { <nl> - invoke_file ( reqInitDoc , true , get_variable_table ( ) ) ; <nl> + include_impl_invoke ( reqInitDoc , true , get_variable_table ( ) ) ; <nl> } <nl> if ( ! reqInitFunc . empty ( ) ) { <nl> invoke ( reqInitFunc . c_str ( ) , Array ( ) ) ; <nl> bool hphp_invoke ( ExecutionContext * context , const std : : string & cmd , <nl> funcRet = invoke ( cmd . c_str ( ) , funcParams ) ; <nl> } else { <nl> if ( isServer ) hphp_chdir_file ( cmd ) ; <nl> - invoke_file ( cmd . c_str ( ) , true , get_variable_table ( ) ) ; <nl> + include_impl_invoke ( cmd . c_str ( ) , true , get_variable_table ( ) ) ; <nl> } <nl> } catch ( . . . ) { <nl> handle_invoke_exception ( ret , context , errorMsg , error ) ; <nl> mmm a / src / runtime / eval / runtime / file_repository . cpp <nl> ppp b / src / runtime / eval / runtime / file_repository . cpp <nl> PhpFile * FileRepository : : checkoutFile ( const std : : string & rname , const struct sta <nl> <nl> bool FileRepository : : findFile ( std : : string & path , struct stat & s , <nl> const char * currentDir ) { <nl> - / / Check working directory first since that ' s what php does <nl> - if ( fileStat ( path , s ) ) { <nl> - return true ; <nl> - } <nl> - for ( vector < string > : : const_iterator it = <nl> - RuntimeOption : : IncludeSearchPaths . begin ( ) ; <nl> - it ! = RuntimeOption : : IncludeSearchPaths . end ( ) ; + + it ) { <nl> - string p ; <nl> - if ( ( * it ) [ 0 ] = = ' . ' & & currentDir ) { <nl> - p = string ( currentDir ) + it - > substr ( 1 ) ; <nl> - } else { <nl> - p = * it ; <nl> - } <nl> - p + = path ; <nl> - if ( fileStat ( p , s ) ) { <nl> - path = p ; <nl> - return true ; <nl> - } <nl> - } <nl> - return false ; <nl> + return fileStat ( path , s ) ; <nl> } <nl> <nl> PhpFile * FileRepository : : readFile ( const std : : string & name , const struct stat & s ) { <nl> mmm a / src / util / util . cpp <nl> ppp b / src / util / util . cpp <nl> int Util : : roundUpToPowerOfTwo ( int value ) { <nl> return ( value ) ; <nl> } <nl> <nl> + std : : string Util : : relativePath ( const std : : string fromDir , <nl> + const std : : string toFile ) { <nl> + <nl> + size_t maxlen = ( fromDir . size ( ) + toFile . size ( ) ) * 3 ; <nl> + char * path = ( char * ) malloc ( maxlen ) ; <nl> + int path_len = 0 ; <nl> + <nl> + / / Sanity checks <nl> + if ( fromDir [ 0 ] ! = ' / ' | | toFile [ 0 ] ! = ' / ' | | <nl> + fromDir [ fromDir . size ( ) - 1 ] ! = ' / ' ) { <nl> + return " " ; <nl> + } <nl> + <nl> + / / Maybe we ' re lucky and this is an easy case <nl> + int from_len = fromDir . size ( ) ; <nl> + if ( strncmp ( toFile . c_str ( ) , fromDir . c_str ( ) , from_len ) = = 0 ) { <nl> + return toFile . substr ( from_len ) ; <nl> + } <nl> + <nl> + const char * from_dir = fromDir . c_str ( ) ; <nl> + const char * to_file = toFile . c_str ( ) ; <nl> + <nl> + const char * from_start = from_dir + 1 ; <nl> + const char * to_start = to_file + 1 ; <nl> + <nl> + while ( true ) { <nl> + int seg_len = 0 ; <nl> + char cur = from_start [ 0 ] ; <nl> + while ( cur & & cur ! = ' / ' ) { <nl> + + + seg_len ; <nl> + cur = from_start [ seg_len ] ; <nl> + } <nl> + <nl> + if ( memcmp ( from_start , to_start , seg_len + 1 ) ) { <nl> + break ; <nl> + } <nl> + from_start + = seg_len + 1 ; <nl> + to_start + = seg_len + 1 ; <nl> + } <nl> + <nl> + / / Now to build the path <nl> + char cur = * from_start ; <nl> + char * path_end = path ; <nl> + while ( cur ) { <nl> + if ( cur = = ' / ' ) { <nl> + strcpy ( path_end , " . . / " ) ; <nl> + path_len + = 3 ; <nl> + maxlen - = 3 ; <nl> + path_end + = 3 ; <nl> + } <nl> + + + from_start ; <nl> + cur = * from_start ; <nl> + } <nl> + <nl> + if ( from_start [ - 1 ] ! = ' / ' ) { <nl> + strcpy ( path_end , " . . / " ) ; <nl> + path_len + = 3 ; <nl> + maxlen - = 3 ; <nl> + path_end + = 3 ; <nl> + } <nl> + <nl> + strncpy ( path_end , to_start , maxlen - 1 ) ; <nl> + <nl> + string p ( path ) ; <nl> + free ( ( void * ) path ) ; <nl> + <nl> + return p ; <nl> + } <nl> + <nl> std : : string Util : : canonicalize ( const std : : string & path ) { <nl> const char * r = canonicalize ( path . c_str ( ) , path . size ( ) ) ; <nl> string res ( r ) ; <nl> mmm a / src / util / util . h <nl> ppp b / src / util / util . h <nl> int directRename ( const char * oldname , const char * newname ) ; <nl> * / <nl> int ssystem ( const char * command ) ; <nl> <nl> + / * * <nl> + * Find the relative path from a directory with trailing slash to the file <nl> + * / <nl> + std : : string relativePath ( const std : : string fromDir , const std : : string toFile ) ; <nl> + <nl> / * * <nl> * Canonicalize path to remove " . . " , " . " and " \ / " , etc . . <nl> * / <nl>
Change hphp includes to be more similar to php 5 . 2
facebook/hhvm
628e9ca980e56c1888806553264e0a3e1f0e83a4
2010-08-13T01:38:15Z
new file mode 100644 <nl> index 0000000000 . . 54d4665053 <nl> mmm / dev / null <nl> ppp b / code / online_challenges / src / codechef / STFOOD / Stfood . java <nl> <nl> + import java . util . * ; <nl> + import java . lang . * ; <nl> + import java . io . * ; <nl> + <nl> + class Stfood <nl> + { <nl> + public static void main ( String [ ] args ) throws java . lang . Exception <nl> + { <nl> + Scanner s = new Scanner ( System . in ) ; <nl> + int t = s . nextInt ( ) ; <nl> + while ( t - - > 0 ) { <nl> + int n = s . nextInt ( ) ; <nl> + int maxprofit = 0 ; <nl> + <nl> + for ( int i = 0 ; i < n ; i + + ) { <nl> + int stores = s . nextInt ( ) ; <nl> + int p = s . nextInt ( ) ; <nl> + int v = s . nextInt ( ) ; <nl> + int profit = ( p / ( stores + 1 ) ) * v ; <nl> + <nl> + / / updating maxprofit <nl> + if ( maxprofit < profit ) { <nl> + maxprofit = profit ; <nl> + } <nl> + } <nl> + <nl> + System . out . println ( maxprofit ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + / * <nl> + TEST CASES <nl> + <nl> + INPUT <nl> + 2 <nl> + 3 <nl> + 4 6 8 <nl> + 2 6 6 <nl> + 1 4 3 <nl> + 1 <nl> + 7 7 4 <nl> + <nl> + OUTPUT <nl> + 12 <nl> + 0 <nl> + * / <nl> + <nl>
updated and made changes
OpenGenus/cosmos
3b79e4fc5794ce4a1c281924e9d3e88c1dc25708
2020-03-22T13:35:04Z
mmm a / js / apps / aardvark / index . html <nl> ppp b / js / apps / aardvark / index . html <nl> <nl> < meta name = " author " content = " Heiko Kernbach " > <nl> <nl> < link href = ' http : / / fonts . googleapis . com / css ? family = Droid + Sans : 400 , 700 ' rel = ' stylesheet ' type = ' text / css ' / > <nl> - < link href = ' css / swagger / hightlight . default . css ' media = ' screen ' rel = ' stylesheet ' type = ' text / css ' / > <nl> - < link href = ' css / swagger / screen . css ' media = ' screen ' rel = ' stylesheet ' type = ' text / css ' / > <nl> - <nl> - < link href = " css / bootstrap . css " rel = " stylesheet " > <nl> - < link href = " css / jquery - ui - 1 . 9 . 2 . custom . css " rel = " stylesheet " > <nl> - < link href = " css / layout . css " rel = " stylesheet " > <nl> - < link href = " css / jquery . dataTables . css " rel = " stylesheet " > <nl> - < link href = " css / nv . d3 . css " rel = " stylesheet " > <nl> - < link href = " css / navigationView . css " rel = " stylesheet " > <nl> - < link href = " css / footerView . css " rel = " stylesheet " > <nl> - < link href = " css / shellView . css " rel = " stylesheet " > <nl> - < link href = " css / queryView . css " rel = " stylesheet " > <nl> - < link href = " css / dashboardView . css " rel = " stylesheet " > <nl> - < link href = " css / logsView . css " rel = " stylesheet " > <nl> - < link href = " css / collectionsView . css " rel = " stylesheet " > <nl> - < link href = " css / collectionsItemView . css " rel = " stylesheet " > <nl> - < link href = " css / collectionView . css " rel = " stylesheet " > <nl> - < link href = " css / documentsView . css " rel = " stylesheet " > <nl> - < link href = " css / documentView . css " rel = " stylesheet " > <nl> - < link href = " css / documentSourceView . css " rel = " stylesheet " > <nl> - < link href = " css / swaggerView . css " rel = " stylesheet " > <nl> - < link href = " css / foxxView . css " rel = " stylesheet " > <nl> - <nl> - < link href = " css / jquery . snippet . css " rel = " stylesheet " > <nl> - < link href = " css / jquery . gritter . css " rel = " stylesheet " > <nl> - < link href = " css / modal . css " rel = " stylesheet " > <nl> - < link href = " css / ansi . css " rel = " stylesheet " > <nl> + < link href = " css / style . css " rel = " stylesheet " > <nl> <nl> <nl> <nl> <nl> < / footer > <nl> <nl> < ! - - libs - - > <nl> - < script src = " js / lib / jquery - 1 . 8 . 3 . js " > < / script > <nl> - < script src = " js / lib / jquery - ui - 1 . 9 . 2 . custom . js " > < / script > <nl> - < script src = " js / lib / jquery . dataTables . js " > < / script > <nl> - < script src = " js / lib / jquery . autogrow . js " > < / script > <nl> - < script src = " js / lib / jquery . jeditable . js " > < / script > <nl> - < script src = " js / lib / jquery . jeditable . autogrow . js " > < / script > <nl> - < script src = " js / lib / jquery . snippet . js " > < / script > <nl> - < script src = " js / lib / jquery . gritter . js " > < / script > <nl> - < script src = ' js / lib / jquery . slideto . min . js ' type = ' text / javascript ' > < / script > <nl> - < script src = ' js / lib / jquery . wiggle . min . js ' type = ' text / javascript ' > < / script > <nl> - < script src = ' js / lib / jquery . ba - bbq . min . js ' type = ' text / javascript ' > < / script > <nl> - <nl> - < script src = ' js / lib / handlebars - 1 . 0 . rc . 1 . js ' type = ' text / javascript ' > < / script > <nl> - <nl> - < script src = " js / lib / underscore . js " > < / script > <nl> - <nl> - < script src = " js / lib / backbone - 1 . 0 . 0 . js " > < / script > <nl> - <nl> - < script src = " js / lib / d3 . v3 . js " > < / script > <nl> - < script src = " js / lib / nv . d3 . js " > < / script > <nl> - <nl> - <nl> - < script src = " js / lib / ColVis . js " > < / script > <nl> - < script src = " js / lib / ejs_fulljslint . js " > < / script > <nl> - < script src = " js / lib / ejs_0 . 9_alpha_1_production . js " > < / script > <nl> - < script src = " js / lib / bootstrap . js " > < / script > <nl> - < script src = " js / lib / bootstrap - pagination . js " > < / script > <nl> - < script src = " src / ace . js " > < / script > <nl> - < script src = " js / lib / jqconsole . min . js " > < / script > <nl> - < script src = " js / lib / splitter . js " > < / script > <nl> - <nl> - < script src = ' js / lib / swagger . js ' type = ' text / javascript ' > < / script > <nl> - < script src = ' js / lib / swagger - ui . js ' type = ' text / javascript ' > < / script > <nl> - < script src = ' js / lib / highlight . 7 . 3 . pack . js ' type = ' text / javascript ' > < / script > <nl> - <nl> - <nl> - < ! - - arango - - > <nl> - < script src = " js / arango / arango . js " > < / script > <nl> - <nl> - < ! - - arangodb js files - - > <nl> - < script src = " js / shell / browser . js " > < / script > <nl> - <nl> - < script src = " js / modules / org / arangodb / arango - collection - common . js " > < / script > <nl> - < script src = " js / modules / org / arangodb / arango - collection . js " > < / script > <nl> - < script src = " js / modules / org / arangodb / arango - database . js " > < / script > <nl> - < script src = " js / modules / org / arangodb / arango - query - cursor . js " > < / script > <nl> - < script src = " js / modules / org / arangodb / arango - statement - common . js " > < / script > <nl> - < script src = " js / modules / org / arangodb / arango - statement . js " > < / script > <nl> - < script src = " js / modules / org / arangodb / arangosh . js " > < / script > <nl> - < script src = " js / modules / org / arangodb / graph - common . js " > < / script > <nl> - < script src = " js / modules / org / arangodb / graph . js " > < / script > <nl> - < script src = " js / modules / org / arangodb / mimetypes . js " > < / script > <nl> - < script src = " js / modules / org / arangodb / simple - query - common . js " > < / script > <nl> - < script src = " js / modules / org / arangodb / simple - query . js " > < / script > <nl> - < script src = " js / modules / org / arangodb / graph / traversal . js " > < / script > <nl> - < script src = " js / modules / org / arangodb - common . js " > < / script > <nl> - < script src = " js / modules / org / arangodb . js " > < / script > <nl> - <nl> - < script src = " js / bootstrap / errors . js " > < / script > <nl> - < script src = " js / bootstrap / monkeypatches . js " > < / script > <nl> - < script src = " js / bootstrap / module - internal . js " > < / script > <nl> - < script src = " js / client / bootstrap / module - internal . js " > < / script > <nl> - <nl> - < script src = " js / shell / print . js " > < / script > <nl> - < script src = " js / client / client . js " > < / script > <nl> - <nl> - < ! - - models - - > <nl> - < script src = " js / models / arangoCollection . js " > < / script > <nl> - < script src = " js / models / arangoDocument . js " > < / script > <nl> - < script src = " js / models / arangoLog . js " > < / script > <nl> - < script src = " js / models / foxx . js " > < / script > <nl> - <nl> - < ! - - collections - - > <nl> - < script src = " js / collections / arangoCollections . js " > < / script > <nl> - < script src = " js / collections / arangoDocuments . js " > < / script > <nl> - < script src = " js / collections / arangoDocument . js " > < / script > <nl> - < script src = " js / collections / arangoLogs . js " > < / script > <nl> - < script src = " js / collections / foxxCollection . js " > < / script > <nl> - <nl> - < ! - - views - - > <nl> - < script src = " js / views / navigationView . js " > < / script > <nl> - < script src = " js / views / footerView . js " > < / script > <nl> - < script src = " js / views / queryView . js " > < / script > <nl> - < script src = " js / views / shellView . js " > < / script > <nl> - < script src = " js / views / aboutView . js " > < / script > <nl> - < script src = " js / views / dashboardView . js " > < / script > <nl> - < script src = " js / views / collectionsView . js " > < / script > <nl> - < script src = " js / views / collectionView . js " > < / script > <nl> - < script src = " js / views / newCollectionView . js " > < / script > <nl> - < script src = " js / views / collectionsItemView . js " > < / script > <nl> - < script src = " js / views / documentsView . js " > < / script > <nl> - < script src = " js / views / documentView . js " > < / script > <nl> - < script src = " js / views / documentSourceView . js " > < / script > <nl> - < script src = " js / views / logsView . js " > < / script > <nl> - < script src = " js / views / foxxActiveView . js " > < / script > <nl> - < script src = " js / views / foxxActiveListView . js " > < / script > <nl> - < script src = " js / views / foxxInstalledView . js " > < / script > <nl> - < script src = " js / views / foxxInstalledListView . js " > < / script > <nl> - < script src = " js / views / foxxEditView . js " > < / script > <nl> - < script src = " js / views / appDocumentationView . js " > < / script > <nl> - <nl> - < ! - - router - - > <nl> - < script src = " js / routers / router . js " > < / script > <nl> + < script src = " app . js " > < / script > <nl> <nl> < / body > <nl> <nl> mmm a / js / apps / aardvark / manifest . json <nl> ppp b / js / apps / aardvark / manifest . json <nl> <nl> " apps " : { <nl> " / " : " aardvark . js " <nl> } , <nl> + <nl> + " assets " : { <nl> + " index . html " : { <nl> + " files " : [ <nl> + " index . html " <nl> + ] <nl> + } , <nl> + <nl> + " app . js " : { <nl> + " files " : [ <nl> + " . . / . . / . . / html / admin / js / lib / jquery - 1 . 8 . 3 . js " , <nl> + " . . / . . / . . / html / admin / js / lib / jquery - ui - 1 . 9 . 2 . custom . js " , <nl> + " . . / . . / . . / html / admin / js / lib / jquery . dataTables . js " , <nl> + " . . / . . / . . / html / admin / js / lib / jquery . autogrow . js " , <nl> + " . . / . . / . . / html / admin / js / lib / jquery . jeditable . js " , <nl> + " . . / . . / . . / html / admin / js / lib / jquery . jeditable . autogrow . js " , <nl> + " . . / . . / . . / html / admin / js / lib / jquery . snippet . js " , <nl> + " . . / . . / . . / html / admin / js / lib / jquery . gritter . js " , <nl> + " . . / . . / . . / html / admin / js / lib / jquery . slideto . min . js " , <nl> + " . . / . . / . . / html / admin / js / lib / jquery . wiggle . min . js " , <nl> + " . . / . . / . . / html / admin / js / lib / jquery . ba - bbq . min . js " , <nl> + " . . / . . / . . / html / admin / js / lib / handlebars - 1 . 0 . rc . 1 . js " , <nl> + " . . / . . / . . / html / admin / js / lib / underscore . js " , <nl> + " . . / . . / . . / html / admin / js / lib / backbone - 1 . 0 . 0 . js " , <nl> + " . . / . . / . . / html / admin / js / lib / d3 . v3 . js " , <nl> + " . . / . . / . . / html / admin / js / lib / nv . d3 . js " , <nl> + " . . / . . / . . / html / admin / js / lib / ColVis . js " , <nl> + " . . / . . / . . / html / admin / js / lib / ejs_fulljslint . js " , <nl> + " . . / . . / . . / html / admin / js / lib / ejs_0 . 9_alpha_1_production . js " , <nl> + " . . / . . / . . / html / admin / js / lib / bootstrap . js " , <nl> + " . . / . . / . . / html / admin / js / lib / bootstrap - pagination . js " , <nl> + " . . / . . / . . / html / admin / src / ace . js " , <nl> + " . . / . . / . . / html / admin / js / lib / jqconsole . min . js " , <nl> + " . . / . . / . . / html / admin / js / lib / splitter . js " , <nl> + " . . / . . / . . / html / admin / js / lib / swagger . js " , <nl> + " . . / . . / . . / html / admin / js / lib / swagger - ui . js " , <nl> + " . . / . . / . . / html / admin / js / lib / highlight . 7 . 3 . pack . js " , <nl> + " . . / . . / . . / html / admin / js / arango / arango . js " , <nl> + " . . / . . / . . / html / admin / js / shell / browser . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb / arango - collection - common . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb / arango - collection . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb / arango - database . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb / arango - error - common . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb / arango - error . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb / arango - query - cursor . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb / arango - statement - common . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb / arango - statement . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb / arangosh . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb / graph - common . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb / graph . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb / mimetypes . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb / simple - query - common . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb / simple - query . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb / graph / traversal . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb - common . js " , <nl> + " . . / . . / . . / html / admin / js / modules / org / arangodb . js " , <nl> + " . . / . . / . . / html / admin / js / bootstrap / errors . js " , <nl> + " . . / . . / . . / html / admin / js / bootstrap / monkeypatches . js " , <nl> + " . . / . . / . . / html / admin / js / bootstrap / module - internal . js " , <nl> + " . . / . . / . . / html / admin / js / client / bootstrap / module - internal . js " , <nl> + " . . / . . / . . / html / admin / js / client / client . js " , <nl> + " . . / . . / . . / html / admin / js / models / * * " , <nl> + " . . / . . / . . / html / admin / js / collections / * * " , <nl> + " . . / . . / . . / html / admin / js / views / * * " , <nl> + " . . / . . / . . / html / admin / js / routers / * * " <nl> + ] <nl> + } , <nl> + <nl> + " css / style . css " : { <nl> + " files " : [ <nl> + " . . / . . / . . / html / admin / css / swagger / hightlight . default . css " , <nl> + " . . / . . / . . / html / admin / css / swagger / screen . css " , <nl> + " . . / . . / . . / html / admin / css / bootstrap . css " , <nl> + " . . / . . / . . / html / admin / css / jquery - ui - 1 . 9 . 2 . custom . css " , <nl> + " . . / . . / . . / html / admin / css / layout . css " , <nl> + " . . / . . / . . / html / admin / css / jquery . dataTables . css " , <nl> + " . . / . . / . . / html / admin / css / nv . d3 . css " , <nl> + " . . / . . / . . / html / admin / css / navigationView . css " , <nl> + " . . / . . / . . / html / admin / css / footerView . css " , <nl> + " . . / . . / . . / html / admin / css / shellView . css " , <nl> + " . . / . . / . . / html / admin / css / queryView . css " , <nl> + " . . / . . / . . / html / admin / css / dashboardView . css " , <nl> + " . . / . . / . . / html / admin / css / logsView . css " , <nl> + " . . / . . / . . / html / admin / css / collectionsView . css " , <nl> + " . . / . . / . . / html / admin / css / collectionsItemView . css " , <nl> + " . . / . . / . . / html / admin / css / collectionView . css " , <nl> + " . . / . . / . . / html / admin / css / documentsView . css " , <nl> + " . . / . . / . . / html / admin / css / documentView . css " , <nl> + " . . / . . / . . / html / admin / css / documentSourceView . css " , <nl> + " . . / . . / . . / html / admin / css / swaggerView . css " , <nl> + " . . / . . / . . / html / admin / css / foxxView . css " , <nl> + " . . / . . / . . / html / admin / css / jquery . snippet . css " , <nl> + " . . / . . / . . / html / admin / css / jquery . gritter . css " , <nl> + " . . / . . / . . / html / admin / css / modal . css " , <nl> + " . . / . . / . . / html / admin / css / ansi . css " <nl> + ] <nl> + } <nl> + } , <nl> + <nl> + " files " : { <nl> + " / img " : " . . / . . / . . / html / admin / img " , <nl> + " / js / templates " : " . . / . . / . . / html / admin / js / templates " <nl> + } , <nl> + <nl> " lib " : " . " <nl> } <nl> new file mode 100644 <nl> index 00000000000 . . 19b00132947 <nl> mmm / dev / null <nl> ppp b / js / apps / aardvark / manifest . json . minimal <nl> <nl> + { <nl> + " name " : " aardvark " , <nl> + " version " : " 1 . 0 " , <nl> + <nl> + " apps " : { <nl> + " / " : " aardvark . js " <nl> + } , <nl> + " lib " : " . " <nl> + } <nl> mmm a / js / apps / aardvark / repositories / swagger . js <nl> ppp b / js / apps / aardvark / repositories / swagger . js <nl> <nl> <nl> / / Define the Repository <nl> var Foxx = require ( " org / arangodb / foxx " ) , <nl> - db = require ( " internal " ) . db ; <nl> + db = require ( " internal " ) . db , <nl> + _routing = db . _collection ( " _routing " ) , <nl> + _aal = db . _collection ( " _aal " ) , <nl> + _ = require ( " underscore " ) , <nl> + foxx_manager = require ( " org / arangodb / foxx - manager " ) ; <nl> <nl> <nl> / / Define the functionality to receive the documentation . <nl> <nl> list : function ( basePath ) { <nl> var result = { } , <nl> apis = [ ] , <nl> - routes = db . _collection ( " _routing " ) , <nl> - res = db . _collection ( " _aal " ) . byExample ( { " type " : " mount " } ) ; <nl> + res = _aal . byExample ( { " type " : " mount " } ) ; <nl> result . swaggerVersion = " 1 . 1 " ; <nl> result . basePath = basePath ; <nl> result . apis = apis ; <nl> <nl> <nl> listOne : function ( basePath , key ) { <nl> var result = { } , <nl> - res = db . _collection ( " _aal " ) . document ( key ) ; <nl> + res = _aal . document ( key ) ; <nl> result . swaggerVersion = " 1 . 1 " ; <nl> result . basePath = basePath ; <nl> result . apis = [ <nl> <nl> <nl> / / Get details of one specific installed foxx . <nl> show : function ( appname ) { <nl> - require ( " console " ) . log ( appname ) ; <nl> var result = { } , <nl> apis = [ ] , <nl> pathes , <nl> <nl> url , <nl> api , <nl> ops , <nl> - routes = db . _collection ( " _routing " ) , <nl> - key = db . _collection ( " _aal " ) . firstExample ( { " mount " : appname } ) . _key , <nl> - app = routes . firstExample ( { " foxxMount " : key } ) ; <nl> + foxxApp = _aal . firstExample ( { " mount " : appname } ) , <nl> + app ; <nl> + if ( ! foxxApp . development ) { <nl> + app = _routing . firstExample ( { " foxxMount " : foxxApp . _key } ) ; <nl> + } else { <nl> + _ . each ( foxx_manager . developmentRoutes ( ) , function ( r ) { <nl> + var ac = r . appContext ; <nl> + if ( ac . appId = = = foxxApp . app & & ac . mount = = = foxxApp . mount ) { <nl> + app = r ; <nl> + return ; <nl> + } <nl> + } ) ; <nl> + } <nl> result . swaggerVersion = " 1 . 1 " ; <nl> result . basePath = app . urlPrefix ; <nl> result . apis = apis ; <nl>
Aardvark : Updated to be able to display Dev - Apps . Also the docu is now accessible via click on one App
arangodb/arangodb
214268df9aaa50067570b51bbc62832baf8747cc
2013-04-16T14:48:36Z
mmm a / hphp / runtime / vm / jit / vasm - dead . cpp <nl> ppp b / hphp / runtime / vm / jit / vasm - dead . cpp <nl> <nl> # include " hphp / runtime / vm / jit / vasm . h " <nl> <nl> # include " hphp / runtime / vm / jit / timer . h " <nl> + # include " hphp / runtime / vm / jit / vasm - info . h " <nl> # include " hphp / runtime / vm / jit / vasm - instr . h " <nl> # include " hphp / runtime / vm / jit / vasm - print . h " <nl> # include " hphp / runtime / vm / jit / vasm - reg . h " <nl> TRACE_SET_MOD ( vasm ) ; <nl> <nl> namespace HPHP { namespace jit { <nl> <nl> - namespace { <nl> - <nl> - bool effectful ( const Vinstr & inst ) { <nl> - switch ( inst . op ) { <nl> - case Vinstr : : absdbl : <nl> - case Vinstr : : addl : <nl> - case Vinstr : : addli : <nl> - case Vinstr : : addq : <nl> - case Vinstr : : addqi : <nl> - case Vinstr : : addsd : <nl> - case Vinstr : : andb : <nl> - case Vinstr : : andbi : <nl> - case Vinstr : : andl : <nl> - case Vinstr : : andli : <nl> - case Vinstr : : andq : <nl> - case Vinstr : : andqi : <nl> - case Vinstr : : andqi64 : <nl> - case Vinstr : : cloadq : <nl> - case Vinstr : : cmovb : <nl> - case Vinstr : : cmovw : <nl> - case Vinstr : : cmovl : <nl> - case Vinstr : : cmovq : <nl> - case Vinstr : : cmpb : <nl> - case Vinstr : : cmpbi : <nl> - case Vinstr : : cmpbim : <nl> - case Vinstr : : cmpbm : <nl> - case Vinstr : : cmpw : <nl> - case Vinstr : : cmpwi : <nl> - case Vinstr : : cmpl : <nl> - case Vinstr : : cmpli : <nl> - case Vinstr : : cmplim : <nl> - case Vinstr : : cmplm : <nl> - case Vinstr : : cmpq : <nl> - case Vinstr : : cmpqi : <nl> - case Vinstr : : cmpqim : <nl> - case Vinstr : : cmpqm : <nl> - case Vinstr : : cmpsd : <nl> - case Vinstr : : cmpwim : <nl> - case Vinstr : : cmpwm : <nl> - case Vinstr : : copy : <nl> - case Vinstr : : copy2 : <nl> - case Vinstr : : copyargs : <nl> - case Vinstr : : csincb : <nl> - case Vinstr : : csincw : <nl> - case Vinstr : : csincl : <nl> - case Vinstr : : csincq : <nl> - case Vinstr : : cvtsi2sd : <nl> - case Vinstr : : cvtsi2sdm : <nl> - case Vinstr : : cvttsd2siq : <nl> - case Vinstr : : decl : <nl> - case Vinstr : : decq : <nl> - case Vinstr : : defvmretdata : <nl> - case Vinstr : : defvmrettype : <nl> - case Vinstr : : defvmsp : <nl> - case Vinstr : : divint : <nl> - case Vinstr : : divsd : <nl> - case Vinstr : : fcmpo : <nl> - case Vinstr : : fcmpu : <nl> - case Vinstr : : fctidz : <nl> - case Vinstr : : fcvtzs : <nl> - case Vinstr : : imul : <nl> - case Vinstr : : incl : <nl> - case Vinstr : : incq : <nl> - case Vinstr : : incw : <nl> - case Vinstr : : ldimmb : <nl> - case Vinstr : : ldimml : <nl> - case Vinstr : : ldimmq : <nl> - case Vinstr : : ldimmw : <nl> - case Vinstr : : lea : <nl> - case Vinstr : : lead : <nl> - case Vinstr : : leap : <nl> - case Vinstr : : load : <nl> - case Vinstr : : loadb : <nl> - case Vinstr : : loadl : <nl> - case Vinstr : : loadqd : <nl> - case Vinstr : : loadqp : <nl> - case Vinstr : : loadsd : <nl> - case Vinstr : : loadtqb : <nl> - case Vinstr : : loadtql : <nl> - case Vinstr : : loadups : <nl> - case Vinstr : : loadw : <nl> - case Vinstr : : loadzbl : <nl> - case Vinstr : : loadzbq : <nl> - case Vinstr : : loadzlq : <nl> - case Vinstr : : loadsbl : <nl> - case Vinstr : : loadsbq : <nl> - case Vinstr : : mflr : <nl> - case Vinstr : : movb : <nl> - case Vinstr : : movl : <nl> - case Vinstr : : movsbl : <nl> - case Vinstr : : movswl : <nl> - case Vinstr : : movsbq : <nl> - case Vinstr : : movswq : <nl> - case Vinstr : : movslq : <nl> - case Vinstr : : movtqb : <nl> - case Vinstr : : movtdb : <nl> - case Vinstr : : movtdq : <nl> - case Vinstr : : movtql : <nl> - case Vinstr : : movtqw : <nl> - case Vinstr : : movw : <nl> - case Vinstr : : movzbw : <nl> - case Vinstr : : movzbl : <nl> - case Vinstr : : movzbq : <nl> - case Vinstr : : movzwl : <nl> - case Vinstr : : movzwq : <nl> - case Vinstr : : movzlq : <nl> - case Vinstr : : mrs : <nl> - case Vinstr : : mulsd : <nl> - case Vinstr : : neg : <nl> - case Vinstr : : nop : <nl> - case Vinstr : : not : <nl> - case Vinstr : : notb : <nl> - case Vinstr : : orq : <nl> - case Vinstr : : orqi : <nl> - case Vinstr : : roundsd : <nl> - case Vinstr : : sar : <nl> - case Vinstr : : sarq : <nl> - case Vinstr : : sarqi : <nl> - case Vinstr : : setcc : <nl> - case Vinstr : : shl : <nl> - case Vinstr : : shlli : <nl> - case Vinstr : : shlq : <nl> - case Vinstr : : shlqi : <nl> - case Vinstr : : shrli : <nl> - case Vinstr : : shrqi : <nl> - case Vinstr : : sqrtsd : <nl> - case Vinstr : : srem : <nl> - case Vinstr : : subl : <nl> - case Vinstr : : subli : <nl> - case Vinstr : : subq : <nl> - case Vinstr : : subqi : <nl> - case Vinstr : : subsd : <nl> - case Vinstr : : testb : <nl> - case Vinstr : : testbi : <nl> - case Vinstr : : testbim : <nl> - case Vinstr : : testbm : <nl> - case Vinstr : : testw : <nl> - case Vinstr : : testwi : <nl> - case Vinstr : : testwim : <nl> - case Vinstr : : testwm : <nl> - case Vinstr : : testl : <nl> - case Vinstr : : testli : <nl> - case Vinstr : : testlim : <nl> - case Vinstr : : testlm : <nl> - case Vinstr : : testq : <nl> - case Vinstr : : testqi : <nl> - case Vinstr : : testqim : <nl> - case Vinstr : : testqm : <nl> - case Vinstr : : ucomisd : <nl> - case Vinstr : : unpcklpd : <nl> - case Vinstr : : ubfmli : <nl> - case Vinstr : : xorb : <nl> - case Vinstr : : xorbi : <nl> - case Vinstr : : xorl : <nl> - case Vinstr : : xorq : <nl> - case Vinstr : : xorqi : <nl> - return false ; <nl> - <nl> - case Vinstr : : addwm : <nl> - case Vinstr : : addlm : <nl> - case Vinstr : : addlim : <nl> - case Vinstr : : addqmr : <nl> - case Vinstr : : addqrm : <nl> - case Vinstr : : addqim : <nl> - case Vinstr : : andbim : <nl> - case Vinstr : : bindaddr : <nl> - case Vinstr : : bindjcc : <nl> - case Vinstr : : bindjmp : <nl> - case Vinstr : : funcguard : <nl> - case Vinstr : : debugguardjmp : <nl> - case Vinstr : : inlinestart : <nl> - case Vinstr : : inlineend : <nl> - case Vinstr : : popframe : <nl> - case Vinstr : : pushframe : <nl> - case Vinstr : : recordstack : <nl> - case Vinstr : : call : <nl> - case Vinstr : : callunpack : <nl> - case Vinstr : : callfaststub : <nl> - case Vinstr : : callm : <nl> - case Vinstr : : callphp : <nl> - case Vinstr : : callr : <nl> - case Vinstr : : calls : <nl> - case Vinstr : : callstub : <nl> - case Vinstr : : calltc : <nl> - case Vinstr : : contenter : <nl> - case Vinstr : : cqo : <nl> - case Vinstr : : debugtrap : <nl> - case Vinstr : : declm : <nl> - case Vinstr : : decqm : <nl> - case Vinstr : : decqmlock : <nl> - case Vinstr : : fallback : <nl> - case Vinstr : : fallbackcc : <nl> - case Vinstr : : fallthru : <nl> - case Vinstr : : idiv : <nl> - case Vinstr : : inclm : <nl> - case Vinstr : : incqm : <nl> - case Vinstr : : incwm : <nl> - case Vinstr : : inittc : <nl> - case Vinstr : : jcc : <nl> - case Vinstr : : jcci : <nl> - case Vinstr : : jmp : <nl> - case Vinstr : : jmpi : <nl> - case Vinstr : : jmpm : <nl> - case Vinstr : : jmpr : <nl> - case Vinstr : : landingpad : <nl> - case Vinstr : : leavetc : <nl> - case Vinstr : : loadstubret : <nl> - case Vinstr : : mcprep : <nl> - case Vinstr : : msr : <nl> - case Vinstr : : mtlr : <nl> - case Vinstr : : nothrow : <nl> - case Vinstr : : orbim : <nl> - case Vinstr : : orlim : <nl> - case Vinstr : : orqim : <nl> - case Vinstr : : orwim : <nl> - case Vinstr : : phidef : <nl> - case Vinstr : : phijmp : <nl> - case Vinstr : : phplogue : <nl> - case Vinstr : : phpret : <nl> - case Vinstr : : pop : <nl> - case Vinstr : : popm : <nl> - case Vinstr : : popf : <nl> - case Vinstr : : popp : <nl> - case Vinstr : : poppm : <nl> - case Vinstr : : push : <nl> - case Vinstr : : pushm : <nl> - case Vinstr : : pushf : <nl> - case Vinstr : : pushp : <nl> - case Vinstr : : pushpm : <nl> - case Vinstr : : resumetc : <nl> - case Vinstr : : ret : <nl> - case Vinstr : : retransopt : <nl> - case Vinstr : : store : <nl> - case Vinstr : : storeb : <nl> - case Vinstr : : storebi : <nl> - case Vinstr : : storeups : <nl> - case Vinstr : : storel : <nl> - case Vinstr : : storeli : <nl> - case Vinstr : : storeqi : <nl> - case Vinstr : : storesd : <nl> - case Vinstr : : storew : <nl> - case Vinstr : : storewi : <nl> - case Vinstr : : stublogue : <nl> - case Vinstr : : stubret : <nl> - case Vinstr : : stubtophp : <nl> - case Vinstr : : stubunwind : <nl> - case Vinstr : : syncpoint : <nl> - case Vinstr : : syncvmret : <nl> - case Vinstr : : syncvmrettype : <nl> - case Vinstr : : syncvmsp : <nl> - case Vinstr : : tailcallphp : <nl> - case Vinstr : : tailcallstub : <nl> - case Vinstr : : trap : <nl> - case Vinstr : : unwind : <nl> - case Vinstr : : vcall : <nl> - case Vinstr : : vcallunpack : <nl> - case Vinstr : : vinvoke : <nl> - case Vinstr : : vregrestrict : <nl> - case Vinstr : : vregunrestrict : <nl> - case Vinstr : : conjure : <nl> - case Vinstr : : conjureuse : <nl> - return true ; <nl> - } <nl> - always_assert ( false ) ; <nl> - } <nl> - <nl> - } <nl> - <nl> / / Remove dead instructions by doing a traditional liveness analysis . <nl> / / instructions that mutate memory , physical registers , or status flags are <nl> / / considered useful . All branches are considered useful . We give copyargs and <nl> mmm a / hphp / runtime / vm / jit / vasm - info . cpp <nl> ppp b / hphp / runtime / vm / jit / vasm - info . cpp <nl> bool writesMemory ( const Vinstr & inst ) { <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> + namespace { <nl> + <nl> + bool effectsImpl ( const Vinstr & inst , bool pure ) { <nl> + switch ( inst . op ) { <nl> + / / Pure : <nl> + case Vinstr : : absdbl : <nl> + case Vinstr : : addl : <nl> + case Vinstr : : addli : <nl> + case Vinstr : : addq : <nl> + case Vinstr : : addqi : <nl> + case Vinstr : : addsd : <nl> + case Vinstr : : andb : <nl> + case Vinstr : : andbi : <nl> + case Vinstr : : andl : <nl> + case Vinstr : : andli : <nl> + case Vinstr : : andq : <nl> + case Vinstr : : andqi64 : <nl> + case Vinstr : : andqi : <nl> + case Vinstr : : cmovb : <nl> + case Vinstr : : cmovl : <nl> + case Vinstr : : cmovq : <nl> + case Vinstr : : cmovw : <nl> + case Vinstr : : cmpb : <nl> + case Vinstr : : cmpbi : <nl> + case Vinstr : : cmpl : <nl> + case Vinstr : : cmpli : <nl> + case Vinstr : : cmpq : <nl> + case Vinstr : : cmpqi : <nl> + case Vinstr : : cmpsd : <nl> + case Vinstr : : cmpw : <nl> + case Vinstr : : cmpwi : <nl> + case Vinstr : : copy2 : <nl> + case Vinstr : : copy : <nl> + case Vinstr : : copyargs : <nl> + case Vinstr : : csincb : <nl> + case Vinstr : : csincl : <nl> + case Vinstr : : csincq : <nl> + case Vinstr : : csincw : <nl> + case Vinstr : : cvtsi2sd : <nl> + case Vinstr : : cvttsd2siq : <nl> + case Vinstr : : decl : <nl> + case Vinstr : : decq : <nl> + case Vinstr : : divint : <nl> + case Vinstr : : divsd : <nl> + case Vinstr : : fcmpo : <nl> + case Vinstr : : fcmpu : <nl> + case Vinstr : : fctidz : <nl> + case Vinstr : : fcvtzs : <nl> + case Vinstr : : imul : <nl> + case Vinstr : : incl : <nl> + case Vinstr : : incq : <nl> + case Vinstr : : incw : <nl> + case Vinstr : : ldimmb : <nl> + case Vinstr : : ldimml : <nl> + case Vinstr : : ldimmq : <nl> + case Vinstr : : ldimmw : <nl> + case Vinstr : : lea : <nl> + case Vinstr : : lead : <nl> + case Vinstr : : movb : <nl> + case Vinstr : : movl : <nl> + case Vinstr : : movsbl : <nl> + case Vinstr : : movsbq : <nl> + case Vinstr : : movslq : <nl> + case Vinstr : : movswl : <nl> + case Vinstr : : movswq : <nl> + case Vinstr : : movtdb : <nl> + case Vinstr : : movtdq : <nl> + case Vinstr : : movtqb : <nl> + case Vinstr : : movtql : <nl> + case Vinstr : : movtqw : <nl> + case Vinstr : : movw : <nl> + case Vinstr : : movzbl : <nl> + case Vinstr : : movzbq : <nl> + case Vinstr : : movzbw : <nl> + case Vinstr : : movzlq : <nl> + case Vinstr : : movzwl : <nl> + case Vinstr : : movzwq : <nl> + case Vinstr : : mulsd : <nl> + case Vinstr : : neg : <nl> + case Vinstr : : nop : <nl> + case Vinstr : : not : <nl> + case Vinstr : : notb : <nl> + case Vinstr : : orq : <nl> + case Vinstr : : orqi : <nl> + case Vinstr : : roundsd : <nl> + case Vinstr : : sar : <nl> + case Vinstr : : sarq : <nl> + case Vinstr : : sarqi : <nl> + case Vinstr : : setcc : <nl> + case Vinstr : : shl : <nl> + case Vinstr : : shlli : <nl> + case Vinstr : : shlq : <nl> + case Vinstr : : shlqi : <nl> + case Vinstr : : shrli : <nl> + case Vinstr : : shrqi : <nl> + case Vinstr : : sqrtsd : <nl> + case Vinstr : : srem : <nl> + case Vinstr : : subl : <nl> + case Vinstr : : subli : <nl> + case Vinstr : : subq : <nl> + case Vinstr : : subqi : <nl> + case Vinstr : : subsd : <nl> + case Vinstr : : testb : <nl> + case Vinstr : : testbi : <nl> + case Vinstr : : testl : <nl> + case Vinstr : : testli : <nl> + case Vinstr : : testq : <nl> + case Vinstr : : testqi : <nl> + case Vinstr : : testw : <nl> + case Vinstr : : testwi : <nl> + case Vinstr : : ubfmli : <nl> + case Vinstr : : ucomisd : <nl> + case Vinstr : : unpcklpd : <nl> + case Vinstr : : xorb : <nl> + case Vinstr : : xorbi : <nl> + case Vinstr : : xorl : <nl> + case Vinstr : : xorq : <nl> + case Vinstr : : xorqi : <nl> + assertx ( ! touchesMemory ( inst ) ) ; <nl> + return pure ; <nl> + <nl> + / / Non - effectful but non - pure : <nl> + case Vinstr : : cloadq : <nl> + case Vinstr : : cmpbim : <nl> + case Vinstr : : cmpbm : <nl> + case Vinstr : : cmplim : <nl> + case Vinstr : : cmplm : <nl> + case Vinstr : : cmpqim : <nl> + case Vinstr : : cmpqm : <nl> + case Vinstr : : cmpwim : <nl> + case Vinstr : : cmpwm : <nl> + case Vinstr : : cvtsi2sdm : <nl> + case Vinstr : : defvmretdata : <nl> + case Vinstr : : defvmrettype : <nl> + case Vinstr : : defvmsp : <nl> + case Vinstr : : leap : <nl> + case Vinstr : : load : <nl> + case Vinstr : : loadb : <nl> + case Vinstr : : loadl : <nl> + case Vinstr : : loadqd : <nl> + case Vinstr : : loadqp : <nl> + case Vinstr : : loadsbl : <nl> + case Vinstr : : loadsbq : <nl> + case Vinstr : : loadsd : <nl> + case Vinstr : : loadtqb : <nl> + case Vinstr : : loadtql : <nl> + case Vinstr : : loadups : <nl> + case Vinstr : : loadw : <nl> + case Vinstr : : loadzbl : <nl> + case Vinstr : : loadzbq : <nl> + case Vinstr : : loadzlq : <nl> + case Vinstr : : mflr : <nl> + case Vinstr : : mrs : <nl> + case Vinstr : : testbim : <nl> + case Vinstr : : testbm : <nl> + case Vinstr : : testlim : <nl> + case Vinstr : : testlm : <nl> + case Vinstr : : testqim : <nl> + case Vinstr : : testqm : <nl> + case Vinstr : : testwim : <nl> + case Vinstr : : testwm : <nl> + assertx ( ! writesMemory ( inst ) ) ; <nl> + assertx ( ! isCall ( inst ) ) ; <nl> + return false ; <nl> + <nl> + / / Effectful : <nl> + case Vinstr : : addlim : <nl> + case Vinstr : : addlm : <nl> + case Vinstr : : addqim : <nl> + case Vinstr : : addqmr : <nl> + case Vinstr : : addqrm : <nl> + case Vinstr : : addwm : <nl> + case Vinstr : : andbim : <nl> + case Vinstr : : bindaddr : <nl> + case Vinstr : : bindjcc : <nl> + case Vinstr : : bindjmp : <nl> + case Vinstr : : call : <nl> + case Vinstr : : callfaststub : <nl> + case Vinstr : : callm : <nl> + case Vinstr : : callphp : <nl> + case Vinstr : : callr : <nl> + case Vinstr : : calls : <nl> + case Vinstr : : callstub : <nl> + case Vinstr : : calltc : <nl> + case Vinstr : : callunpack : <nl> + case Vinstr : : conjure : <nl> + case Vinstr : : conjureuse : <nl> + case Vinstr : : contenter : <nl> + case Vinstr : : cqo : <nl> + case Vinstr : : debugguardjmp : <nl> + case Vinstr : : debugtrap : <nl> + case Vinstr : : declm : <nl> + case Vinstr : : decqm : <nl> + case Vinstr : : decqmlock : <nl> + case Vinstr : : fallback : <nl> + case Vinstr : : fallbackcc : <nl> + case Vinstr : : fallthru : <nl> + case Vinstr : : funcguard : <nl> + case Vinstr : : idiv : <nl> + case Vinstr : : inclm : <nl> + case Vinstr : : incqm : <nl> + case Vinstr : : incwm : <nl> + case Vinstr : : inittc : <nl> + case Vinstr : : inlineend : <nl> + case Vinstr : : inlinestart : <nl> + case Vinstr : : jcc : <nl> + case Vinstr : : jcci : <nl> + case Vinstr : : jmp : <nl> + case Vinstr : : jmpi : <nl> + case Vinstr : : jmpm : <nl> + case Vinstr : : jmpr : <nl> + case Vinstr : : landingpad : <nl> + case Vinstr : : leavetc : <nl> + case Vinstr : : loadstubret : <nl> + case Vinstr : : mcprep : <nl> + case Vinstr : : msr : <nl> + case Vinstr : : mtlr : <nl> + case Vinstr : : nothrow : <nl> + case Vinstr : : orbim : <nl> + case Vinstr : : orlim : <nl> + case Vinstr : : orqim : <nl> + case Vinstr : : orwim : <nl> + case Vinstr : : phidef : <nl> + case Vinstr : : phijmp : <nl> + case Vinstr : : phplogue : <nl> + case Vinstr : : phpret : <nl> + case Vinstr : : pop : <nl> + case Vinstr : : popf : <nl> + case Vinstr : : popframe : <nl> + case Vinstr : : popm : <nl> + case Vinstr : : popp : <nl> + case Vinstr : : poppm : <nl> + case Vinstr : : push : <nl> + case Vinstr : : pushf : <nl> + case Vinstr : : pushframe : <nl> + case Vinstr : : pushm : <nl> + case Vinstr : : pushp : <nl> + case Vinstr : : pushpm : <nl> + case Vinstr : : recordstack : <nl> + case Vinstr : : resumetc : <nl> + case Vinstr : : ret : <nl> + case Vinstr : : retransopt : <nl> + case Vinstr : : store : <nl> + case Vinstr : : storeb : <nl> + case Vinstr : : storebi : <nl> + case Vinstr : : storel : <nl> + case Vinstr : : storeli : <nl> + case Vinstr : : storeqi : <nl> + case Vinstr : : storesd : <nl> + case Vinstr : : storeups : <nl> + case Vinstr : : storew : <nl> + case Vinstr : : storewi : <nl> + case Vinstr : : stublogue : <nl> + case Vinstr : : stubret : <nl> + case Vinstr : : stubtophp : <nl> + case Vinstr : : stubunwind : <nl> + case Vinstr : : syncpoint : <nl> + case Vinstr : : syncvmret : <nl> + case Vinstr : : syncvmrettype : <nl> + case Vinstr : : syncvmsp : <nl> + case Vinstr : : tailcallphp : <nl> + case Vinstr : : tailcallstub : <nl> + case Vinstr : : trap : <nl> + case Vinstr : : unwind : <nl> + case Vinstr : : vcall : <nl> + case Vinstr : : vcallunpack : <nl> + case Vinstr : : vinvoke : <nl> + case Vinstr : : vregrestrict : <nl> + case Vinstr : : vregunrestrict : <nl> + return ! pure ; <nl> + } <nl> + always_assert ( false ) ; <nl> + } <nl> + <nl> + } <nl> + <nl> + bool effectful ( const Vinstr & inst ) { <nl> + return effectsImpl ( inst , false ) ; <nl> + } <nl> + <nl> + bool isPure ( const Vinstr & inst ) { <nl> + return effectsImpl ( inst , true ) ; <nl> + } <nl> + <nl> } } <nl> mmm a / hphp / runtime / vm / jit / vasm - info . h <nl> ppp b / hphp / runtime / vm / jit / vasm - info . h <nl> bool touchesMemory ( Vinstr : : Opcode op ) ; <nl> * Returns true if the instruction writes memory . <nl> * / <nl> bool writesMemory ( Vinstr : : Opcode op ) ; <nl> + <nl> + / * <nl> + * Returns true if the instruction has some side - effect beyond writing to its <nl> + * declared outputs ( It may still read from memory , for example ) . <nl> + * / <nl> + bool effectful ( const Vinstr & inst ) ; <nl> + <nl> + / * <nl> + * Returns true if the instruction ' s behavior depends solely on its declared <nl> + * inputs and has no side - effects besides writing to its declared outputs . <nl> + * / <nl> + bool isPure ( const Vinstr & inst ) ; <nl> + <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> } } <nl>
Make effectful ( ) public , add isPure ( )
facebook/hhvm
49a8342d6fcb3fcab7e05132b04ffbec950b739b
2018-12-01T06:31:50Z
new file mode 100644 <nl> index 00000000000 . . 5e778e48541 <nl> mmm / dev / null <nl> ppp b / docs / specs / Navigation / PwrPak7_Installation_Guide . md <nl> <nl> + # # Installation Guide of NovAtel PwrPak7 <nl> + <nl> + NovAtel PwrPak7 is an integrated INS receiver , which has GNSS receiver and IMU included in the device . <nl> + <nl> + ! [ novatel_pp7 ] ( images / pp7_pic . jpg ) <nl> + <nl> + # # # Installing the GPS Receiver <nl> + <nl> + The overview of Novatel PwrPak7 is shown as below . <nl> + <nl> + ! [ pp7_poweron ] ( images / pp7_power . jpg ) <nl> + <nl> + To power on the receiver , connect + VIN_A and + VIN_B from power extension cable to power source ( i . e . , 12VDC ) positive side , and connect both - VIN to negative side . Refer to link below about PwrPak7 power cable . <nl> + <nl> + * [ NovAtel ProPak7 Power Cable ] ( https : / / docs . novatel . com / OEM7 / Content / Technical_Specs_Receiver / PwrPak7_Power_Cable . htm ) <nl> + <nl> + The PwrPak7 receiver supports dual antenna , ANT1 is the port on top and considered as primary antenna , which is required by Apollo system . ANT2 is the port on bottom and considered as secondary antenna , and this is optional . <nl> + <nl> + To send RTK correction and log data , similar as Novatel ProPak6 , we can use a USB cable and connect to the MicroUSB port on PwrPak7 , and the other side to the IPC on the vehicle . <nl> + <nl> + The COM2 port and PPS signal are required to connect to Lidar system , which needs an extension cable of the 26 - pin connector on PwrPak7 . For detail information about the extension cable , refer to Novatel PwrPak All I / O Cable website below . <nl> + <nl> + * [ NovAtel ProPak7 All I / O Cable ] ( https : / / docs . novatel . com / OEM7 / Content / Technical_Specs_Receiver / PwrPak7_All_IO_Cable . htm ? tocpath = Specifications % 7CPwrPak7 % 20Technical % 20Specifications % 7C_____11 ) <nl> + <nl> + You can place the PwrPak7 in most places in the vehicle , but it is suggested that you follow these recommendations : <nl> + <nl> + - Place and secure the PwrPak7 inside the trunk with the Y - axis pointing forward . <nl> + - Use a magnetic adapter to tightly attach the antenna to the trunk lid . <nl> + - Install the antenna cable in the trunk by opening the trunk and placing the cable in the space between the trunk lid and the body of the car . <nl> + <nl> + # # # # Taking the Lever Arm Measurement <nl> + <nl> + Follow these steps : <nl> + <nl> + * Before taking the measurement , turn on the IPC . <nl> + * When the PwrPak7 and the GPS Antenna are in position , the distance from the PwrPak7 to the GPS Antenna must be measured . The center of the PwrPak7 IMU and the center of the antenna are labeled on the exterior of the devices . <nl> + * The distance should be measured as : X offset , Y offset , and Z offset . The axis should be determined by the IMU . The error of offset must be within one centimeter to achieve high accuracy in positioning and localization . <nl> + <nl> + # # # Configuring the PwrPak7 <nl> + <nl> + Configure the GPS and IMU as shown below . This process can be done either by keying in the commands , or by loading batch configuraion file in NovAtel Connect . <nl> + <nl> + For PwrPak7 : <nl> + <nl> + ` ` ` <nl> + WIFICONFIG STATE OFF <nl> + UNLOGALL THISPORT <nl> + INSCOMMAND ENABLE <nl> + SETIMUORIENTATION 5 <nl> + ALIGNMENTMODE AUTOMATIC <nl> + VEHICLEBODYROTATION 0 0 0 <nl> + SERIALCONFIG COM1 9600 N 8 1 N OFF <nl> + SERIALCONFIG COM2 9600 N 8 1 N OFF <nl> + INTERFACEMODE COM1 NOVATEL NOVATEL ON <nl> + INTERFACEMODE USB2 RTCMV3 NONE OFF <nl> + PPSCONTROL ENABLE POSITIVE 1 . 0 10000 <nl> + MARKCONTROL MARK1 ENABLE POSITIVE <nl> + EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2 <nl> + RTKSOURCE AUTO ANY <nl> + PSRDIFFSOURCE AUTO ANY <nl> + SETINSTRANSLATION ANT1 0 . 00 1 . 10866 1 . 14165 0 . 05 0 . 05 0 . 08 <nl> + SETINSTRANSLATION ANT2 0 . 00 1 . 10866 1 . 14165 0 . 05 0 . 05 0 . 08 <nl> + SETINSTRANSLATION USER 0 0 0 <nl> + EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10 <nl> + EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000 <nl> + <nl> + LOG COM2 GPRMC ONTIME 1 . 0 0 . 25 <nl> + LOG USB1 GPGGA ONTIME 1 . 0 <nl> + LOG USB1 BESTGNSSPOSB ONTIME 1 <nl> + LOG USB1 BESTGNSSVELB ONTIME 1 <nl> + LOG USB1 BESTPOSB ONTIME 1 <nl> + LOG USB1 INSPVAXB ONTIME 1 <nl> + LOG USB1 INSPVASB ONTIME 0 . 01 <nl> + LOG USB1 CORRIMUDATASB ONTIME 0 . 01 <nl> + LOG USB1 RAWIMUSXB ONNEW 0 0 <nl> + LOG USB1 MARK1PVAB ONNEW <nl> + <nl> + LOG USB1 RANGEB ONTIME 1 <nl> + LOG USB1 BDSEPHEMERISB ONTIME 15 <nl> + LOG USB1 GPSEPHEMB ONTIME 15 <nl> + LOG USB1 GLOEPHEMERISB ONTIME 15 <nl> + <nl> + LOG USB1 INSCONFIGB ONCE <nl> + LOG USB1 VEHICLEBODYROTATIONB ONCHANGED <nl> + <nl> + SAVECONFIG <nl> + <nl> + ` ` ` <nl> + <nl> + * * ! [ warning_icon ] ( images / warning_icon . png ) WARNING : * * Modify the * * < u > SETINSTRANSLATION < / u > T * * line based on the actual measurement ( of the antenna and the IMU offset ) . ANT1 is for primary antenna which is required , and ANT2 is for secondary antenna and it is optional . <nl> + <nl> + For example : <nl> + <nl> + ` ` ` <nl> + SETINSTRANSLATION ANT1 - 0 . 05 0 . 5 0 . 8 0 . 05 0 . 05 0 . 08 <nl> + ` ` ` <nl> + <nl> + The first 3 numbers indicate the result of the lever arm distance measurement . The last 3 numbers are the uncertainty of the measurement . <nl> + <nl> + # # # References <nl> + <nl> + For more information about the NovAtel PwrPak7 , see : <nl> + * [ NovAtel PwrPak7 Installation & Operation User Manual ] ( https : / / docs . novatel . com / OEM7 / Content / PDFs / PwrPak7_Install_Ops_Manual . pdf ) <nl> + * [ NovAtel PwrPak7 Installation Overview ] ( https : / / docs . novatel . com / OEM7 / Content / PwrPak_Install / PwrPak7_Install_Overview . htm ? TocPath = Installation % 7CPwrPak7 % 20Installation % 7C_____4 ) <nl> + <nl> + # # Disclaimer <nl> + <nl> + This device is ` Apollo Platform Supported ` <nl> mmm a / docs / specs / Navigation / images / . gitattributes <nl> ppp b / docs / specs / Navigation / images / . gitattributes <nl> @ @ - 1 + 1 , 2 @ @ <nl> + * . jpg filter = lfs diff = lfs merge = lfs - text <nl> * . png filter = lfs diff = lfs merge = lfs - text <nl> \ No newline at end of file <nl> new file mode 100755 <nl> index 00000000000 . . 914c142059e <nl> Binary files / dev / null and b / docs / specs / Navigation / images / pp7_pic . jpg differ <nl> new file mode 100755 <nl> index 00000000000 . . b0d95b48ce7 <nl> Binary files / dev / null and b / docs / specs / Navigation / images / pp7_power . jpg differ <nl>
commit for adding pp7 installation guide
ApolloAuto/apollo
22f73e9c58eaa492f64bbca53257830aaa053909
2018-08-08T04:33:55Z
mmm a / cocos2dx / cocos2d . cpp <nl> ppp b / cocos2dx / cocos2d . cpp <nl> namespace cocos2d { <nl> <nl> const char * cocos2dVersion ( ) <nl> { <nl> - return " cocos2d - 1 . 0 . 1 - x - 0 . 12 . 0 " ; <nl> + return " cocos2d - 2 . 0 - rc0a - x - 0 . 1 . 0 " ; <nl> } <nl> <nl> } / / namespace cocos2d <nl> mmm a / cocos2dx / include / CCArray . h <nl> ppp b / cocos2dx / include / CCArray . h <nl> class CC_DLL CCArray : public CCObject <nl> static CCArray * array ( ) ; <nl> / * * Create an array with one object * / <nl> static CCArray * arrayWithObject ( CCObject * pObject ) ; <nl> + / * * Create an array with some objects * / <nl> + static CCArray * arrayWithObjects ( CCObject * pObject , . . . ) ; <nl> / * * Create an array with capacity * / <nl> static CCArray * arrayWithCapacity ( unsigned int capacity ) ; <nl> / * * Create an array with an existing array * / <nl> class CC_DLL CCArray : public CCObject <nl> bool init ( ) ; <nl> / * * Initializes an array with one object * / <nl> bool initWithObject ( CCObject * pObject ) ; <nl> + / * * Initializes an array with some objects * / <nl> + bool initWithObjects ( CCObject * pObject , . . . ) ; <nl> / * * Initializes an array with capacity * / <nl> bool initWithCapacity ( unsigned int capacity ) ; <nl> / * * Initializes an array with an existing array * / <nl> mmm a / cocos2dx / include / CCProgressTimer . h <nl> ppp b / cocos2dx / include / CCProgressTimer . h <nl> class CC_DLL CCProgressTimer : public CCNode , public CCRGBAProtocol <nl> * / <nl> CC_SYNTHESIZE ( CCPoint , m_tBarChangeRate , BarChangeRate ) ; <nl> <nl> - bool m_bReverseDirection ; <nl> + CC_SYNTHESIZE ( bool , m_bReverseDirection , IsReverseDirection ) ; <nl> <nl> private : <nl> CCProgressTimer ( ) ; <nl> mmm a / cocos2dx / include / CCTMXXMLParser . h <nl> ppp b / cocos2dx / include / CCTMXXMLParser . h <nl> THE SOFTWARE . <nl> <nl> NS_CC_BEGIN <nl> <nl> + class CCData ; <nl> class CCTMXObjectGroup ; <nl> <nl> / * * @ file <nl> class CC_DLL CCTMXMapInfo : public CCObject , public CCSAXDelegator <nl> / * initalises parsing of an XML string , either a tmx ( Map ) string or tsx ( Tileset ) string * / <nl> bool parseXMLString ( const char * xmlString ) ; <nl> / * handles the work of parsing for parseXMLFile : and parseXMLString : * / <nl> - bool parseXMLData ( const char * data ) ; <nl> + bool parseXMLData ( const CCData * data ) ; <nl> <nl> CCDictionary * getTileProperties ( ) ; <nl> void setTileProperties ( CCDictionary * tileProperties ) ; <nl> mmm a / cocos2dx / include / CCTransition . h <nl> ppp b / cocos2dx / include / CCTransition . h <nl> namespace cocos2d { <nl> # define DECLEAR_TRANSITIONWITHDURATION ( _Type ) \ <nl> static _Type * transitionWithDuration ( ccTime t , CCScene * scene ) ; <nl> <nl> + # define IMPLEMENT_TRANSITIONWITHDURATION ( _Type ) \ <nl> + _Type * _Type : : transitionWithDuration ( ccTime t , CCScene * scene ) \ <nl> + { \ <nl> + _Type * pScene = new _Type ( ) ; \ <nl> + if ( pScene & & pScene - > initWithDuration ( t , scene ) ) { \ <nl> + pScene - > autorelease ( ) ; \ <nl> + return pScene ; } \ <nl> + CC_SAFE_DELETE ( pScene ) ; \ <nl> + return NULL ; \ <nl> + } <nl> + <nl> + <nl> class CCActionInterval ; <nl> class CCNode ; <nl> <nl> new file mode 100644 <nl> index 000000000000 . . 38f5b277416c <nl> mmm / dev / null <nl> ppp b / cocos2dx / include / CCTransitionProgress . h <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> + Copyright ( c ) 2010 - 2011 cocos2d - x . org <nl> + Copyright ( c ) 2009 Lam Pham <nl> + Copyright ( c ) 2012 Ricardo Quesada <nl> + <nl> + http : / / www . cocos2d - x . org <nl> + <nl> + Permission is hereby granted , free of charge , to any person obtaining a copy <nl> + of this software and associated documentation files ( the " Software " ) , to deal <nl> + in the Software without restriction , including without limitation the rights <nl> + to use , copy , modify , merge , publish , distribute , sublicense , and / or sell <nl> + copies of the Software , and to permit persons to whom the Software is <nl> + furnished to do so , subject to the following conditions : <nl> + <nl> + The above copyright notice and this permission notice shall be included in <nl> + all copies or substantial portions of the Software . <nl> + <nl> + THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR <nl> + IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY , <nl> + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL THE <nl> + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER <nl> + LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM , <nl> + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> + THE SOFTWARE . <nl> + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> + # ifndef __CCTRANSITIONPROGRESS_H__ <nl> + # define __CCTRANSITIONPROGRESS_H__ <nl> + <nl> + # include " CCTransition . h " <nl> + <nl> + NS_CC_BEGIN <nl> + <nl> + class CCProgressTimer ; <nl> + class CCRenderTexture ; <nl> + <nl> + class CC_DLL CCTransitionProgress : public CCTransitionScene <nl> + { <nl> + public : <nl> + DECLEAR_TRANSITIONWITHDURATION ( CCTransitionProgress ) <nl> + <nl> + CCTransitionProgress ( ) ; <nl> + virtual void onEnter ( ) ; <nl> + virtual void onExit ( ) ; <nl> + protected : <nl> + virtual CCProgressTimer * progressTimerNodeWithRenderTexture ( CCRenderTexture * texture ) ; <nl> + virtual void setupTransition ( ) ; <nl> + virtual void sceneOrder ( ) ; <nl> + float to_ ; <nl> + float from_ ; <nl> + CCScene * sceneToBeModified_ ; <nl> + } ; <nl> + <nl> + <nl> + / * * CCTransitionRadialCCW transition . <nl> + A counter colock - wise radial transition to the next scene <nl> + * / <nl> + class CC_DLL CCTransitionProgressRadialCCW : public CCTransitionProgress <nl> + { <nl> + public : <nl> + DECLEAR_TRANSITIONWITHDURATION ( CCTransitionProgressRadialCCW ) <nl> + protected : <nl> + virtual CCProgressTimer * progressTimerNodeWithRenderTexture ( CCRenderTexture * texture ) ; <nl> + <nl> + } ; <nl> + <nl> + <nl> + / * * CCTransitionRadialCW transition . <nl> + A counter colock - wise radial transition to the next scene <nl> + * / <nl> + class CC_DLL CCTransitionProgressRadialCW : public CCTransitionProgress <nl> + { <nl> + public : <nl> + DECLEAR_TRANSITIONWITHDURATION ( CCTransitionProgressRadialCW ) <nl> + protected : <nl> + virtual CCProgressTimer * progressTimerNodeWithRenderTexture ( CCRenderTexture * texture ) ; <nl> + <nl> + } ; <nl> + <nl> + / * * CCTransitionProgressHorizontal transition . <nl> + A colock - wise radial transition to the next scene <nl> + * / <nl> + class CC_DLL CCTransitionProgressHorizontal : public CCTransitionProgress <nl> + { <nl> + public : <nl> + DECLEAR_TRANSITIONWITHDURATION ( CCTransitionProgressHorizontal ) <nl> + protected : <nl> + virtual CCProgressTimer * progressTimerNodeWithRenderTexture ( CCRenderTexture * texture ) ; <nl> + <nl> + } ; <nl> + <nl> + class CC_DLL CCTransitionProgressVertical : public CCTransitionProgress <nl> + { <nl> + public : <nl> + DECLEAR_TRANSITIONWITHDURATION ( CCTransitionProgressVertical ) <nl> + protected : <nl> + virtual CCProgressTimer * progressTimerNodeWithRenderTexture ( CCRenderTexture * texture ) ; <nl> + <nl> + } ; <nl> + <nl> + class CC_DLL CCTransitionProgressInOut : public CCTransitionProgress <nl> + { <nl> + public : <nl> + DECLEAR_TRANSITIONWITHDURATION ( CCTransitionProgressInOut ) <nl> + protected : <nl> + virtual CCProgressTimer * progressTimerNodeWithRenderTexture ( CCRenderTexture * texture ) ; <nl> + virtual void sceneOrder ( ) ; <nl> + virtual void setupTransition ( ) ; <nl> + } ; <nl> + <nl> + class CC_DLL CCTransitionProgressOutIn : public CCTransitionProgress <nl> + { <nl> + public : <nl> + DECLEAR_TRANSITIONWITHDURATION ( CCTransitionProgressOutIn ) <nl> + protected : <nl> + virtual CCProgressTimer * progressTimerNodeWithRenderTexture ( CCRenderTexture * texture ) ; <nl> + <nl> + } ; <nl> + <nl> + NS_CC_END <nl> + <nl> + # endif / * __CCTRANSITIONPROGRESS_H__ * / <nl> + <nl> mmm a / cocos2dx / include / cocos2d . h <nl> ppp b / cocos2dx / include / cocos2d . h <nl> THE SOFTWARE . <nl> # include " CCDrawingPrimitives . h " <nl> # include " CCScheduler . h " <nl> # include " CCProgressTimer . h " <nl> + # include " CCTransitionProgress . h " <nl> <nl> / / havn ' t implement on wophone <nl> # if ( CC_TARGET_PLATFORM ! = CC_PLATFORM_WOPHONE ) <nl> mmm a / cocos2dx / layers_scenes_transitions_nodes / CCTransition . cpp <nl> ppp b / cocos2dx / layers_scenes_transitions_nodes / CCTransition . cpp <nl> namespace cocos2d { <nl> <nl> const unsigned int kSceneFade = 0xFADEFADE ; <nl> <nl> - # define IMPLEMENT_TRANSITIONWITHDURATION ( _Type ) \ <nl> - _Type * _Type : : transitionWithDuration ( ccTime t , CCScene * scene ) \ <nl> - { \ <nl> - _Type * pScene = new _Type ( ) ; \ <nl> - if ( pScene & & pScene - > initWithDuration ( t , scene ) ) { \ <nl> - pScene - > autorelease ( ) ; \ <nl> - return pScene ; } \ <nl> - CC_SAFE_DELETE ( pScene ) ; \ <nl> - return NULL ; \ <nl> - } <nl> - <nl> - <nl> - <nl> CCTransitionScene : : CCTransitionScene ( ) <nl> { <nl> } <nl> new file mode 100644 <nl> index 000000000000 . . 03cb57a4c2bd <nl> mmm / dev / null <nl> ppp b / cocos2dx / layers_scenes_transitions_nodes / CCTransitionProgress . cpp <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> + Copyright ( c ) 2010 - 2011 cocos2d - x . org <nl> + Copyright ( c ) 2009 Lam Pham <nl> + Copyright ( c ) 2012 Ricardo Quesada <nl> + <nl> + http : / / www . cocos2d - x . org <nl> + <nl> + Permission is hereby granted , free of charge , to any person obtaining a copy <nl> + of this software and associated documentation files ( the " Software " ) , to deal <nl> + in the Software without restriction , including without limitation the rights <nl> + to use , copy , modify , merge , publish , distribute , sublicense , and / or sell <nl> + copies of the Software , and to permit persons to whom the Software is <nl> + furnished to do so , subject to the following conditions : <nl> + <nl> + The above copyright notice and this permission notice shall be included in <nl> + all copies or substantial portions of the Software . <nl> + <nl> + THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR <nl> + IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY , <nl> + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL THE <nl> + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER <nl> + LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM , <nl> + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN <nl> + THE SOFTWARE . <nl> + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> + <nl> + # include " CCTransitionProgress . h " <nl> + # include " CCDirector . h " <nl> + # include " CCRenderTexture . h " <nl> + # include " CCLayer . h " <nl> + # include " CCActionInstant . h " <nl> + # include " CCProgressTimer . h " <nl> + # include " CCActionProgressTimer . h " <nl> + # include " CCPointExtension . h " <nl> + <nl> + NS_CC_BEGIN <nl> + <nl> + enum { <nl> + kCCSceneRadial = 0xc001 , <nl> + } ; <nl> + <nl> + IMPLEMENT_TRANSITIONWITHDURATION ( CCTransitionProgress ) <nl> + <nl> + CCTransitionProgress : : CCTransitionProgress ( ) <nl> + : to_ ( 0 . 0f ) <nl> + , from_ ( 0 . 0f ) <nl> + , sceneToBeModified_ ( NULL ) <nl> + { <nl> + <nl> + } <nl> + <nl> + / / CCTransitionProgress <nl> + void CCTransitionProgress : : onEnter ( ) <nl> + { <nl> + CCTransitionScene : : onEnter ( ) ; <nl> + <nl> + setupTransition ( ) ; <nl> + <nl> + / / create a transparent color layer <nl> + / / in which we are going to add our rendertextures <nl> + CCSize size = CCDirector : : sharedDirector ( ) - > getWinSize ( ) ; <nl> + <nl> + / / create the second render texture for outScene <nl> + CCRenderTexture * texture = CCRenderTexture : : renderTextureWithWidthAndHeight ( size . width , size . height ) ; <nl> + texture - > getSprite ( ) - > setAnchorPoint ( ccp ( 0 . 5f , 0 . 5f ) ) ; <nl> + texture - > setPosition ( ccp ( size . width / 2 , size . height / 2 ) ) ; <nl> + texture - > setAnchorPoint ( ccp ( 0 . 5f , 0 . 5f ) ) ; <nl> + <nl> + / / render outScene to its texturebuffer <nl> + texture - > clear ( 0 , 0 , 0 , 1 ) ; <nl> + texture - > begin ( ) ; <nl> + sceneToBeModified_ - > visit ( ) ; <nl> + texture - > end ( ) ; <nl> + <nl> + <nl> + / / Since we ' ve passed the outScene to the texture we don ' t need it . <nl> + if ( sceneToBeModified_ = = m_pOutScene ) <nl> + { <nl> + hideOutShowIn ( ) ; <nl> + } <nl> + / / We need the texture in RenderTexture . <nl> + CCProgressTimer * pNode = progressTimerNodeWithRenderTexture ( texture ) ; <nl> + <nl> + / / create the blend action <nl> + CCActionInterval * layerAction = ( CCActionInterval * ) CCSequence : : actions ( <nl> + CCProgressFromTo : : actionWithDuration ( m_fDuration , from_ , to_ ) , <nl> + CCCallFunc : : actionWithTarget ( this , callfunc_selector ( CCTransitionProgress : : finish ) ) , <nl> + NULL ) ; <nl> + / / run the blend action <nl> + pNode - > runAction ( layerAction ) ; <nl> + <nl> + / / add the layer ( which contains our two rendertextures ) to the scene <nl> + addChild ( pNode , 2 , kCCSceneRadial ) ; <nl> + } <nl> + <nl> + / / clean up on exit <nl> + void CCTransitionProgress : : onExit ( ) <nl> + { <nl> + / / remove our layer and release all containing objects <nl> + removeChildByTag ( kCCSceneRadial , false ) ; <nl> + CCTransitionScene : : onExit ( ) ; <nl> + } <nl> + <nl> + void CCTransitionProgress : : sceneOrder ( ) <nl> + { <nl> + m_bIsInSceneOnTop = false ; <nl> + } <nl> + <nl> + void CCTransitionProgress : : setupTransition ( ) <nl> + { <nl> + sceneToBeModified_ = m_pOutScene ; <nl> + from_ = 100 ; <nl> + to_ = 0 ; <nl> + } <nl> + <nl> + CCProgressTimer * CCTransitionProgress : : progressTimerNodeWithRenderTexture ( CCRenderTexture * texture ) <nl> + { <nl> + CCAssert ( false , " override me - abstract class " ) ; <nl> + return NULL ; <nl> + } <nl> + <nl> + <nl> + / / CCTransitionProgressRadialCCW <nl> + IMPLEMENT_TRANSITIONWITHDURATION ( CCTransitionProgressRadialCCW ) <nl> + <nl> + CCProgressTimer * CCTransitionProgressRadialCCW : : progressTimerNodeWithRenderTexture ( CCRenderTexture * texture ) <nl> + { <nl> + CCSize size = CCDirector : : sharedDirector ( ) - > getWinSize ( ) ; <nl> + <nl> + CCProgressTimer * pNode = CCProgressTimer : : progressWithSprite ( texture - > getSprite ( ) ) ; <nl> + <nl> + / / but it is flipped upside down so we flip the sprite <nl> + pNode - > getSprite ( ) - > setFlipY ( true ) ; <nl> + pNode - > setType ( kCCProgressTimerTypeRadial ) ; <nl> + <nl> + / / Return the radial type that we want to use <nl> + pNode - > setIsReverseDirection ( false ) ; <nl> + pNode - > setPercentage ( 100 ) ; <nl> + pNode - > setPosition ( ccp ( size . width / 2 , size . height / 2 ) ) ; <nl> + pNode - > setAnchorPoint ( ccp ( 0 . 5f , 0 . 5f ) ) ; <nl> + <nl> + return pNode ; <nl> + } <nl> + <nl> + / / CCTransitionProgressRadialCW <nl> + <nl> + IMPLEMENT_TRANSITIONWITHDURATION ( CCTransitionProgressRadialCW ) <nl> + <nl> + CCProgressTimer * CCTransitionProgressRadialCW : : progressTimerNodeWithRenderTexture ( CCRenderTexture * texture ) <nl> + { <nl> + CCSize size = CCDirector : : sharedDirector ( ) - > getWinSize ( ) ; <nl> + <nl> + CCProgressTimer * pNode = CCProgressTimer : : progressWithSprite ( texture - > getSprite ( ) ) ; <nl> + <nl> + / / but it is flipped upside down so we flip the sprite <nl> + pNode - > getSprite ( ) - > setFlipY ( true ) ; <nl> + pNode - > setType ( kCCProgressTimerTypeRadial ) ; <nl> + <nl> + / / Return the radial type that we want to use <nl> + pNode - > setIsReverseDirection ( true ) ; <nl> + pNode - > setPercentage ( 100 ) ; <nl> + pNode - > setPosition ( ccp ( size . width / 2 , size . height / 2 ) ) ; <nl> + pNode - > setAnchorPoint ( ccp ( 0 . 5f , 0 . 5f ) ) ; <nl> + <nl> + return pNode ; <nl> + } <nl> + <nl> + / / CCTransitionProgressHorizontal <nl> + <nl> + IMPLEMENT_TRANSITIONWITHDURATION ( CCTransitionProgressHorizontal ) <nl> + <nl> + CCProgressTimer * CCTransitionProgressHorizontal : : progressTimerNodeWithRenderTexture ( CCRenderTexture * texture ) <nl> + { <nl> + CCSize size = CCDirector : : sharedDirector ( ) - > getWinSize ( ) ; <nl> + <nl> + CCProgressTimer * pNode = CCProgressTimer : : progressWithSprite ( texture - > getSprite ( ) ) ; <nl> + <nl> + / / but it is flipped upside down so we flip the sprite <nl> + pNode - > getSprite ( ) - > setFlipY ( true ) ; <nl> + pNode - > setType ( kCCProgressTimerTypeBar ) ; <nl> + <nl> + pNode - > setMidpoint ( ccp ( 1 , 0 ) ) ; <nl> + pNode - > setBarChangeRate ( ccp ( 1 , 0 ) ) ; <nl> + <nl> + pNode - > setPercentage ( 100 ) ; <nl> + pNode - > setPosition ( ccp ( size . width / 2 , size . height / 2 ) ) ; <nl> + pNode - > setAnchorPoint ( ccp ( 0 . 5f , 0 . 5f ) ) ; <nl> + <nl> + return pNode ; <nl> + } <nl> + <nl> + / / CCTransitionProgressVertical <nl> + <nl> + IMPLEMENT_TRANSITIONWITHDURATION ( CCTransitionProgressVertical ) <nl> + <nl> + CCProgressTimer * CCTransitionProgressVertical : : progressTimerNodeWithRenderTexture ( CCRenderTexture * texture ) <nl> + { <nl> + CCSize size = CCDirector : : sharedDirector ( ) - > getWinSize ( ) ; <nl> + <nl> + CCProgressTimer * pNode = CCProgressTimer : : progressWithSprite ( texture - > getSprite ( ) ) ; <nl> + <nl> + / / but it is flipped upside down so we flip the sprite <nl> + pNode - > getSprite ( ) - > setFlipY ( true ) ; <nl> + pNode - > setType ( kCCProgressTimerTypeBar ) ; <nl> + <nl> + pNode - > setMidpoint ( ccp ( 0 , 0 ) ) ; <nl> + pNode - > setBarChangeRate ( ccp ( 0 , 1 ) ) ; <nl> + <nl> + pNode - > setPercentage ( 100 ) ; <nl> + pNode - > setPosition ( ccp ( size . width / 2 , size . height / 2 ) ) ; <nl> + pNode - > setAnchorPoint ( ccp ( 0 . 5f , 0 . 5f ) ) ; <nl> + <nl> + return pNode ; <nl> + } <nl> + <nl> + <nl> + / / CCTransitionProgressInOut <nl> + <nl> + IMPLEMENT_TRANSITIONWITHDURATION ( CCTransitionProgressInOut ) <nl> + <nl> + void CCTransitionProgressInOut : : sceneOrder ( ) <nl> + { <nl> + m_bIsInSceneOnTop = false ; <nl> + } <nl> + <nl> + void CCTransitionProgressInOut : : setupTransition ( ) <nl> + { <nl> + sceneToBeModified_ = m_pInScene ; <nl> + from_ = 0 ; <nl> + to_ = 100 ; <nl> + } <nl> + <nl> + CCProgressTimer * CCTransitionProgressInOut : : progressTimerNodeWithRenderTexture ( CCRenderTexture * texture ) <nl> + { <nl> + CCSize size = CCDirector : : sharedDirector ( ) - > getWinSize ( ) ; <nl> + <nl> + CCProgressTimer * pNode = CCProgressTimer : : progressWithSprite ( texture - > getSprite ( ) ) ; <nl> + <nl> + / / but it is flipped upside down so we flip the sprite <nl> + pNode - > getSprite ( ) - > setFlipY ( true ) ; <nl> + pNode - > setType ( kCCProgressTimerTypeBar ) ; <nl> + <nl> + pNode - > setMidpoint ( ccp ( 0 . 5f , 0 . 5f ) ) ; <nl> + pNode - > setBarChangeRate ( ccp ( 1 , 1 ) ) ; <nl> + <nl> + pNode - > setPercentage ( 0 ) ; <nl> + pNode - > setPosition ( ccp ( size . width / 2 , size . height / 2 ) ) ; <nl> + pNode - > setAnchorPoint ( ccp ( 0 . 5f , 0 . 5f ) ) ; <nl> + <nl> + return pNode ; <nl> + } <nl> + <nl> + <nl> + / / CCTransitionProgressOutIn <nl> + <nl> + IMPLEMENT_TRANSITIONWITHDURATION ( CCTransitionProgressOutIn ) <nl> + <nl> + CCProgressTimer * CCTransitionProgressOutIn : : progressTimerNodeWithRenderTexture ( CCRenderTexture * texture ) <nl> + { <nl> + CCSize size = CCDirector : : sharedDirector ( ) - > getWinSize ( ) ; <nl> + <nl> + CCProgressTimer * pNode = CCProgressTimer : : progressWithSprite ( texture - > getSprite ( ) ) ; <nl> + <nl> + / / but it is flipped upside down so we flip the sprite <nl> + pNode - > getSprite ( ) - > setFlipY ( true ) ; <nl> + pNode - > setType ( kCCProgressTimerTypeBar ) ; <nl> + <nl> + pNode - > setMidpoint ( ccp ( 0 . 5f , 0 . 5f ) ) ; <nl> + pNode - > setBarChangeRate ( ccp ( 1 , 1 ) ) ; <nl> + <nl> + pNode - > setPercentage ( 100 ) ; <nl> + pNode - > setPosition ( ccp ( size . width / 2 , size . height / 2 ) ) ; <nl> + pNode - > setAnchorPoint ( ccp ( 0 . 5f , 0 . 5f ) ) ; <nl> + <nl> + return pNode ; <nl> + } <nl> + <nl> + NS_CC_END <nl> + <nl> mmm a / cocos2dx / particle_nodes / CCParticleSystemQuad . cpp <nl> ppp b / cocos2dx / particle_nodes / CCParticleSystemQuad . cpp <nl> void CCParticleSystemQuad : : draw ( ) <nl> / * FIXME : It will cause crash on some devices if the last parameter is zero . <nl> I ' m not familiar with opengles , but my change works . - - By James Chen . <nl> * / <nl> - glDrawElements ( GL_TRIANGLES , ( GLsizei ) m_uParticleIdx * 6 , GL_UNSIGNED_SHORT , m_pIndices / * 0 * / ) ; <nl> + glDrawElements ( GL_TRIANGLES , ( GLsizei ) m_uParticleIdx * 6 , GL_UNSIGNED_SHORT , 0 / * m_pIndices * / / * 0 * / ) ; <nl> <nl> glBindVertexArray ( 0 ) ; <nl> <nl> mmm a / cocos2dx / platform / CCSAXParser . cpp <nl> ppp b / cocos2dx / platform / CCSAXParser . cpp <nl> bool CCSAXParser : : init ( const char * pszEncoding ) <nl> return true ; <nl> } <nl> <nl> - bool CCSAXParser : : parse ( const char * pszFile ) <nl> + bool CCSAXParser : : parse ( const char * pXMLData , unsigned int uDataLength ) <nl> { <nl> - CCFileData data ( pszFile , " rt " ) ; <nl> - unsigned long size = data . getSize ( ) ; <nl> - char * pBuffer = ( char * ) data . getBuffer ( ) ; <nl> - <nl> - if ( ! pBuffer ) <nl> - { <nl> - return false ; <nl> - } <nl> - <nl> / * <nl> * this initialize the library and check potential ABI mismatches <nl> * between the version it was compiled for and the actual shared <nl> bool CCSAXParser : : parse ( const char * pszFile ) <nl> saxHandler . endElement = & CCSAXParser : : endElement ; <nl> saxHandler . characters = & CCSAXParser : : textHandler ; <nl> <nl> - int result = xmlSAXUserParseMemory ( & saxHandler , this , pBuffer , size ) ; <nl> + int result = xmlSAXUserParseMemory ( & saxHandler , this , pXMLData , uDataLength ) ; <nl> if ( result ! = 0 ) <nl> { <nl> return false ; <nl> bool CCSAXParser : : parse ( const char * pszFile ) <nl> return true ; <nl> } <nl> <nl> + bool CCSAXParser : : parse ( const char * pszFile ) <nl> + { <nl> + CCFileData data ( pszFile , " rt " ) ; <nl> + unsigned long size = data . getSize ( ) ; <nl> + char * pBuffer = ( char * ) data . getBuffer ( ) ; <nl> + <nl> + if ( ! pBuffer ) <nl> + { <nl> + return false ; <nl> + } <nl> + return parse ( pBuffer , size ) ; <nl> + } <nl> + <nl> void CCSAXParser : : startElement ( void * ctx , const CC_XML_CHAR * name , const CC_XML_CHAR * * atts ) <nl> { <nl> ( ( CCSAXParser * ) ( ctx ) ) - > m_pDelegator - > startElement ( ctx , ( char * ) name , ( const char * * ) atts ) ; <nl> mmm a / cocos2dx / platform / CCSAXParser . h <nl> ppp b / cocos2dx / platform / CCSAXParser . h <nl> <nl> # include " CCPlatformConfig . h " <nl> # include " CCCommon . h " <nl> <nl> - NS_CC_BEGIN ; <nl> - <nl> + NS_CC_BEGIN <nl> <nl> typedef unsigned char CC_XML_CHAR ; <nl> <nl> class CC_DLL CCSAXParser <nl> ~ CCSAXParser ( void ) ; <nl> <nl> bool init ( const char * pszEncoding ) ; <nl> + bool parse ( const char * pXMLData , unsigned int uDataLength ) ; <nl> bool parse ( const char * pszFile ) ; <nl> void setDelegator ( CCSAXDelegator * pDelegator ) ; <nl> <nl> class CC_DLL CCSAXParser <nl> static void endElement ( void * ctx , const CC_XML_CHAR * name ) ; <nl> static void textHandler ( void * ctx , const CC_XML_CHAR * name , int len ) ; <nl> } ; <nl> - NS_CC_END ; <nl> + <nl> + NS_CC_END <nl> <nl> # endif / / __CCSAXPARSER_H__ <nl> mmm a / cocos2dx / proj . win32 / cocos2d - win32 . vcproj <nl> ppp b / cocos2dx / proj . win32 / cocos2d - win32 . vcproj <nl> <nl> RelativePath = " . . \ include \ CCTransitionPageTurn . h " <nl> > <nl> < / File > <nl> + < File <nl> + RelativePath = " . . \ include \ CCTransitionProgress . h " <nl> + > <nl> + < / File > <nl> < File <nl> RelativePath = " . . \ include \ ccTypes . h " <nl> > <nl> <nl> RelativePath = " . . \ layers_scenes_transitions_nodes \ CCTransitionPageTurn . cpp " <nl> > <nl> < / File > <nl> + < File <nl> + RelativePath = " . . \ layers_scenes_transitions_nodes \ CCTransitionProgress . cpp " <nl> + > <nl> + < / File > <nl> < / Filter > <nl> < Filter <nl> Name = " menu_nodes " <nl> mmm a / cocos2dx / support / CCArray . cpp <nl> ppp b / cocos2dx / support / CCArray . cpp <nl> CCArray * CCArray : : arrayWithObject ( CCObject * pObject ) <nl> return pArray ; <nl> } <nl> <nl> + CCArray * CCArray : : arrayWithObjects ( CCObject * pObject , . . . ) <nl> + { <nl> + va_list args ; <nl> + va_start ( args , pObject ) ; <nl> + <nl> + CCArray * pArray = array ( ) ; <nl> + if ( pArray & & pObject ) <nl> + { <nl> + pArray - > addObject ( pObject ) ; <nl> + CCObject * i = va_arg ( args , CCObject * ) ; <nl> + while ( i ) <nl> + { <nl> + pArray - > addObject ( i ) ; <nl> + i = va_arg ( args , CCObject * ) ; <nl> + } <nl> + } <nl> + else <nl> + { <nl> + CC_SAFE_DELETE ( pArray ) ; <nl> + } <nl> + <nl> + va_end ( args ) ; <nl> + <nl> + return pArray ; <nl> + } <nl> + <nl> CCArray * CCArray : : arrayWithCapacity ( unsigned int capacity ) <nl> { <nl> CCArray * pArray = new CCArray ( ) ; <nl> bool CCArray : : initWithObject ( CCObject * pObject ) <nl> return bRet ; <nl> } <nl> <nl> + / * * Initializes an array with some objects * / <nl> + bool CCArray : : initWithObjects ( CCObject * pObject , . . . ) <nl> + { <nl> + bool bRet = false ; <nl> + do <nl> + { <nl> + CC_BREAK_IF ( pObject ! = NULL ) ; <nl> + <nl> + va_list args ; <nl> + va_start ( args , pObject ) ; <nl> + <nl> + CCArray * pArray = new CCArray ( ) ; <nl> + if ( pArray & & pObject ) <nl> + { <nl> + pArray - > addObject ( pObject ) ; <nl> + CCObject * i = va_arg ( args , CCObject * ) ; <nl> + while ( i ) <nl> + { <nl> + pArray - > addObject ( i ) ; <nl> + i = va_arg ( args , CCObject * ) ; <nl> + } <nl> + bRet = true ; <nl> + } <nl> + else <nl> + { <nl> + CC_SAFE_DELETE ( pArray ) ; <nl> + } <nl> + va_end ( args ) ; <nl> + <nl> + } while ( false ) ; <nl> + <nl> + return bRet ; <nl> + } <nl> + <nl> bool CCArray : : initWithCapacity ( unsigned int capacity ) <nl> { <nl> data = ccArrayNew ( capacity ) ; <nl> mmm a / cocos2dx / textures / CCTextureAtlas . cpp <nl> ppp b / cocos2dx / textures / CCTextureAtlas . cpp <nl> bool CCTextureAtlas : : initWithFile ( const char * file , unsigned int capacity ) <nl> <nl> bool CCTextureAtlas : : initWithTexture ( CCTexture2D * texture , unsigned int capacity ) <nl> { <nl> - CCAssert ( texture ! = NULL , " texture should not be null " ) ; <nl> + / / CCAssert ( texture ! = NULL , " texture should not be null " ) ; <nl> m_uCapacity = capacity ; <nl> m_uTotalQuads = 0 ; <nl> <nl> void CCTextureAtlas : : drawNumberOfQuads ( unsigned int n , unsigned int start ) <nl> # if CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP <nl> glDrawElements ( GL_TRIANGLE_STRIP , ( GLsizei ) n * 6 , GL_UNSIGNED_SHORT , ( GLvoid * ) ( m_pIndices ) / * ( start * 6 * sizeof ( m_pIndices [ 0 ] ) ) * / ) ; <nl> # else <nl> - glDrawElements ( GL_TRIANGLES , ( GLsizei ) n * 6 , GL_UNSIGNED_SHORT , ( GLvoid * ) ( m_pIndices ) / * ( start * 6 * sizeof ( m_pIndices [ 0 ] ) ) * / ) ; <nl> + glDrawElements ( GL_TRIANGLES , ( GLsizei ) n * 6 , GL_UNSIGNED_SHORT , ( GLvoid * ) 0 / * ( m_pIndices ) * / / * ( start * 6 * sizeof ( m_pIndices [ 0 ] ) ) * / ) ; <nl> # endif / / CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP <nl> <nl> <nl> mmm a / cocos2dx / tileMap_parallax_nodes / CCTMXXMLParser . cpp <nl> ppp b / cocos2dx / tileMap_parallax_nodes / CCTMXXMLParser . cpp <nl> THE SOFTWARE . <nl> # include < map > <nl> # include " CCTMXXMLParser . h " <nl> # include " CCTMXTiledMap . h " <nl> + # include " CCData . h " <nl> # include " ccMacros . h " <nl> # include " CCFileUtils . h " <nl> # include " support / zip_support / ZipUtils . h " <nl> void CCTMXMapInfo : : internalInit ( const char * tmxFileName , const char * resourcePat <nl> m_pLayers = CCArray : : array ( ) ; <nl> m_pLayers - > retain ( ) ; <nl> <nl> - m_sTMXFileName = CCFileUtils : : fullPathFromRelativePath ( tmxFileName ) ; <nl> - m_sResources = resourcePath ; <nl> - m_pObjectGroups = CCArray : : array ( ) ; <nl> + if ( tmxFileName ! = NULL ) <nl> + { <nl> + m_sTMXFileName = CCFileUtils : : fullPathFromRelativePath ( tmxFileName ) ; <nl> + } <nl> + <nl> + if ( resourcePath ! = NULL ) <nl> + { <nl> + m_sResources = resourcePath ; <nl> + } <nl> + <nl> + m_pObjectGroups = CCArray : : arrayWithCapacity ( 4 ) ; <nl> m_pObjectGroups - > retain ( ) ; <nl> <nl> m_pProperties = new CCDictionary ( ) ; <nl> void CCTMXMapInfo : : internalInit ( const char * tmxFileName , const char * resourcePat <nl> } <nl> bool CCTMXMapInfo : : initWithXML ( const char * tmxString , const char * resourcePath ) <nl> { <nl> - internalInit ( " " , resourcePath ) ; <nl> + internalInit ( NULL , resourcePath ) ; <nl> return parseXMLString ( tmxString ) ; <nl> } <nl> <nl> bool CCTMXMapInfo : : initWithTMXFile ( const char * tmxFile ) <nl> { <nl> - internalInit ( tmxFile , " " ) ; <nl> + internalInit ( tmxFile , NULL ) ; <nl> return parseXMLFile ( m_sTMXFileName . c_str ( ) ) ; <nl> } <nl> <nl> void CCTMXMapInfo : : setTileProperties ( CCDictionary * tileProperties ) <nl> <nl> bool CCTMXMapInfo : : parseXMLString ( const char * xmlString ) <nl> { <nl> - / / TODO : <nl> - return false ; <nl> + int len = strlen ( xmlString ) ; <nl> + if ( xmlString = = NULL | | len < = 0 ) <nl> + { <nl> + return false ; <nl> + } <nl> + <nl> + CCSAXParser parser ; <nl> + <nl> + if ( false = = parser . init ( " UTF - 8 " ) ) <nl> + { <nl> + return false ; <nl> + } <nl> + <nl> + parser . setDelegator ( this ) ; <nl> + <nl> + return parser . parse ( xmlString , len ) ; <nl> } <nl> <nl> - bool CCTMXMapInfo : : parseXMLData ( const char * data ) <nl> + bool CCTMXMapInfo : : parseXMLData ( const CCData * data ) <nl> { <nl> - / / TODO : <nl> - return false ; <nl> + / / TODO : implementation . <nl> + return false ; <nl> } <nl> <nl> bool CCTMXMapInfo : : parseXMLFile ( const char * xmlFilename ) <nl> bool CCTMXMapInfo : : parseXMLFile ( const char * xmlFilename ) <nl> <nl> parser . setDelegator ( this ) ; <nl> <nl> - return parser . parse ( xmlFilename ) ; ; <nl> + return parser . parse ( xmlFilename ) ; <nl> } <nl> <nl> <nl> void CCTMXMapInfo : : startElement ( void * ctx , const char * name , const char * * atts ) <nl> std : : string externalTilesetFilename = valueForKey ( " source " , attributeDict ) ; <nl> if ( externalTilesetFilename ! = " " ) <nl> { <nl> - externalTilesetFilename = CCFileUtils : : fullPathFromRelativeFile ( externalTilesetFilename . c_str ( ) , pTMXMapInfo - > getTMXFileName ( ) ) ; <nl> - pTMXMapInfo - > parseXMLFile ( externalTilesetFilename . c_str ( ) ) ; <nl> + if ( m_sTMXFileName . length ( ) = = 0 ) <nl> + { <nl> + string pszFullPath = CCFileUtils : : fullPathFromRelativePath ( m_sResources . c_str ( ) ) ; <nl> + if ( pszFullPath . find_last_of ( " / \ \ " ) ! = pszFullPath . length ( ) - 1 ) <nl> + { <nl> + pszFullPath . append ( " / " ) ; <nl> + } <nl> + <nl> + externalTilesetFilename = CCFileUtils : : fullPathFromRelativeFile ( externalTilesetFilename . c_str ( ) , pszFullPath . c_str ( ) ) ; <nl> + } <nl> + else <nl> + { <nl> + externalTilesetFilename = CCFileUtils : : fullPathFromRelativeFile ( externalTilesetFilename . c_str ( ) , pTMXMapInfo - > getTMXFileName ( ) ) ; <nl> + } <nl> + pTMXMapInfo - > parseXMLFile ( externalTilesetFilename . c_str ( ) ) ; <nl> } <nl> else <nl> { <nl> void CCTMXMapInfo : : startElement ( void * ctx , const char * name , const char * * atts ) <nl> CCTMXTilesetInfo * tileset = ( CCTMXTilesetInfo * ) pTMXMapInfo - > getTilesets ( ) - > lastObject ( ) ; <nl> <nl> / / build full path <nl> - std : : string imagename = valueForKey ( " source " , attributeDict ) ; <nl> - tileset - > m_sSourceImage = CCFileUtils : : fullPathFromRelativeFile ( imagename . c_str ( ) , pTMXMapInfo - > getTMXFileName ( ) ) ; <nl> - <nl> + std : : string imagename = valueForKey ( " source " , attributeDict ) ; <nl> + if ( m_sTMXFileName . length ( ) = = 0 ) <nl> + { <nl> + string pszFullPath = CCFileUtils : : fullPathFromRelativePath ( m_sResources . c_str ( ) ) ; <nl> + if ( pszFullPath . find_last_of ( " / \ \ " ) ! = pszFullPath . length ( ) - 1 ) <nl> + { <nl> + pszFullPath . append ( " / " ) ; <nl> + } <nl> + <nl> + tileset - > m_sSourceImage = CCFileUtils : : fullPathFromRelativeFile ( imagename . c_str ( ) , pszFullPath . c_str ( ) ) ; <nl> + } <nl> + else <nl> + { <nl> + tileset - > m_sSourceImage = CCFileUtils : : fullPathFromRelativeFile ( imagename . c_str ( ) , pTMXMapInfo - > getTMXFileName ( ) ) ; <nl> + } <nl> } <nl> else if ( elementName = = " data " ) <nl> { <nl> void CCTMXMapInfo : : startElement ( void * ctx , const char * name , const char * * atts ) <nl> / / The value for " type " was blank or not a valid class name <nl> / / Create an instance of TMXObjectInfo to store the object and its properties <nl> CCDictionary * dict = new CCDictionary ( ) ; <nl> - <nl> - / / Set the name of the object to the value for " name " <nl> - std : : string key = " name " ; <nl> - CCString * value = new CCString ( valueForKey ( " name " , attributeDict ) ) ; <nl> - dict - > setObject ( value , key . c_str ( ) ) ; <nl> - value - > release ( ) ; <nl> - <nl> - / / Assign all the attributes as key / name pairs in the properties dictionary <nl> - key = " type " ; <nl> - value = new CCString ( valueForKey ( " type " , attributeDict ) ) ; <nl> - dict - > setObject ( value , key . c_str ( ) ) ; <nl> - value - > release ( ) ; <nl> - <nl> - int x = atoi ( valueForKey ( " x " , attributeDict ) ) + ( int ) objectGroup - > getPositionOffset ( ) . x ; <nl> - key = " x " ; <nl> - sprintf ( buffer , " % d " , x ) ; <nl> - value = new CCString ( buffer ) ; <nl> - dict - > setObject ( value , key . c_str ( ) ) ; <nl> - value - > release ( ) ; <nl> - <nl> - int y = atoi ( valueForKey ( " y " , attributeDict ) ) + ( int ) objectGroup - > getPositionOffset ( ) . y ; <nl> - / / Correct y position . ( Tiled uses Flipped , cocos2d uses Standard ) <nl> - y = ( int ) ( pTMXMapInfo - > getMapSize ( ) . height * pTMXMapInfo - > getTileSize ( ) . height ) - y - atoi ( valueForKey ( " height " , attributeDict ) ) ; <nl> - key = " y " ; <nl> - sprintf ( buffer , " % d " , y ) ; <nl> - value = new CCString ( buffer ) ; <nl> - dict - > setObject ( value , key . c_str ( ) ) ; <nl> - value - > release ( ) ; <nl> - <nl> - key = " width " ; <nl> - value = new CCString ( valueForKey ( " width " , attributeDict ) ) ; <nl> - dict - > setObject ( value , key . c_str ( ) ) ; <nl> - value - > release ( ) ; <nl> - <nl> - key = " height " ; <nl> - value = new CCString ( valueForKey ( " height " , attributeDict ) ) ; <nl> - dict - > setObject ( value , key . c_str ( ) ) ; <nl> - value - > release ( ) ; <nl> - <nl> - / / Add the object to the objectGroup <nl> - objectGroup - > getObjects ( ) - > addObject ( dict ) ; <nl> - dict - > release ( ) ; <nl> - <nl> - / / The parent element is now " object " <nl> - pTMXMapInfo - > setParentElement ( TMXPropertyObject ) ; <nl> + / / Parse everything automatically <nl> + const char * pArray [ ] = { " name " , " type " , " width " , " height " , " gid " } ; <nl> + <nl> + for ( int i = 0 ; i < sizeof ( pArray ) / sizeof ( pArray [ 0 ] ) ; + + i ) <nl> + { <nl> + const char * key = pArray [ i ] ; <nl> + CCString * obj = new CCString ( valueForKey ( key , attributeDict ) ) ; <nl> + if ( obj ) <nl> + { <nl> + obj - > autorelease ( ) ; <nl> + dict - > setObject ( obj , key ) ; <nl> + } <nl> + } <nl> + <nl> + / / But X and Y since they need special treatment <nl> + / / X <nl> + <nl> + const char * value = valueForKey ( " x " , attributeDict ) ; <nl> + if ( value ) <nl> + { <nl> + int x = atoi ( value ) + ( int ) objectGroup - > getPositionOffset ( ) . x ; <nl> + sprintf ( buffer , " % d " , x ) ; <nl> + CCString * pStr = new CCString ( buffer ) ; <nl> + pStr - > autorelease ( ) ; <nl> + dict - > setObject ( pStr , " x " ) ; <nl> + } <nl> + <nl> + / / Y <nl> + value = valueForKey ( " y " , attributeDict ) ; <nl> + if ( value ) { <nl> + int y = atoi ( value ) + ( int ) objectGroup - > getPositionOffset ( ) . y ; <nl> + <nl> + / / Correct y position . ( Tiled uses Flipped , cocos2d uses Standard ) <nl> + y = ( int ) ( m_tMapSize . height * m_tTileSize . height ) - y - atoi ( valueForKey ( " height " , attributeDict ) ) ; <nl> + sprintf ( buffer , " % d " , y ) ; <nl> + CCString * pStr = new CCString ( buffer ) ; <nl> + pStr - > autorelease ( ) ; <nl> + dict - > setObject ( pStr , " y " ) ; <nl> + } <nl> + <nl> + / / Add the object to the objectGroup <nl> + objectGroup - > getObjects ( ) - > addObject ( dict ) ; <nl> + dict - > release ( ) ; <nl> + <nl> + / / The parent element is now " object " <nl> + pTMXMapInfo - > setParentElement ( TMXPropertyObject ) ; <nl> <nl> } <nl> else if ( elementName = = " property " ) <nl> void CCTMXMapInfo : : startElement ( void * ctx , const char * name , const char * * atts ) <nl> dict - > setObject ( propertyValue , propertyName ) ; <nl> propertyValue - > release ( ) ; <nl> } <nl> - } <nl> + } <nl> + else if ( elementName = = " polygon " ) <nl> + { <nl> + / / find parent object ' s dict and add polygon - points to it <nl> + CCTMXObjectGroup * objectGroup = ( CCTMXObjectGroup * ) m_pObjectGroups - > lastObject ( ) ; <nl> + CCDictionary * dict = ( CCDictionary * ) objectGroup - > getObjects ( ) - > lastObject ( ) ; <nl> + / / TODO : dict - > setObject ( attributeDict objectForKey : @ " points " ] forKey : @ " polygonPoints " ] ; <nl> + <nl> + } <nl> + else if ( elementName = = " polyline " ) <nl> + { <nl> + / / find parent object ' s dict and add polyline - points to it <nl> + CCTMXObjectGroup * objectGroup = ( CCTMXObjectGroup * ) m_pObjectGroups - > lastObject ( ) ; <nl> + CCDictionary * dict = ( CCDictionary * ) objectGroup - > getObjects ( ) - > lastObject ( ) ; <nl> + / / TODO : dict - > setObject : [ attributeDict objectForKey : @ " points " ] forKey : @ " polylinePoints " ] ; <nl> + } <nl> + <nl> if ( attributeDict ) <nl> { <nl> attributeDict - > clear ( ) ; <nl> mmm a / tests / tests / Texture2dTest / Texture2dTest . cpp <nl> ppp b / tests / tests / Texture2dTest / Texture2dTest . cpp <nl> enum { <nl> kTagSprite2 = 3 , <nl> } ; <nl> <nl> - # define TEST_CASE_COUNT 32 <nl> + # define TEST_CASE_COUNT 34 <nl> <nl> static int sceneIdx = - 1 ; <nl> CCLayer * createTextureTest ( int index ) <nl> CCLayer * createTextureTest ( int index ) <nl> case 7 : <nl> pLayer = new TexturePVR2BPP ( ) ; break ; <nl> case 8 : <nl> - pLayer = new TexturePVRRaw ( ) ; break ; <nl> - case 9 : <nl> pLayer = new TexturePVR ( ) ; break ; <nl> - case 10 : <nl> + case 9 : <nl> pLayer = new TexturePVR4BPP ( ) ; break ; <nl> - case 11 : <nl> + case 10 : <nl> pLayer = new TexturePVRRGBA8888 ( ) ; break ; <nl> - case 12 : <nl> + case 11 : <nl> pLayer = new TexturePVRBGRA8888 ( ) ; break ; <nl> - case 13 : <nl> + case 12 : <nl> pLayer = new TexturePVRRGBA4444 ( ) ; break ; <nl> - case 14 : <nl> + case 13 : <nl> pLayer = new TexturePVRRGBA4444GZ ( ) ; break ; <nl> - case 15 : <nl> + case 14 : <nl> pLayer = new TexturePVRRGBA4444CCZ ( ) ; break ; <nl> - case 16 : <nl> + case 15 : <nl> pLayer = new TexturePVRRGBA5551 ( ) ; break ; <nl> - case 17 : <nl> + case 16 : <nl> pLayer = new TexturePVRRGB565 ( ) ; break ; <nl> - case 18 : <nl> + case 17 : <nl> pLayer = new TexturePVRA8 ( ) ; break ; <nl> - case 19 : <nl> + case 18 : <nl> pLayer = new TexturePVRI8 ( ) ; break ; <nl> - case 20 : <nl> + case 19 : <nl> pLayer = new TexturePVRAI88 ( ) ; break ; <nl> - case 21 : <nl> + case 20 : <nl> pLayer = new TexturePVRBadEncoding ( ) ; break ; <nl> - case 22 : <nl> + case 21 : <nl> pLayer = new TexturePNG ( ) ; break ; <nl> - case 23 : <nl> + case 22 : <nl> pLayer = new TextureJPEG ( ) ; break ; <nl> - case 24 : <nl> + case 23 : <nl> pLayer = new TexturePixelFormat ( ) ; break ; <nl> - case 25 : <nl> + case 24 : <nl> pLayer = new TextureBlend ( ) ; break ; <nl> - case 26 : <nl> + case 25 : <nl> pLayer = new TextureGlClamp ( ) ; break ; <nl> - case 27 : <nl> + case 26 : <nl> pLayer = new TextureGlRepeat ( ) ; break ; <nl> - case 28 : <nl> + case 27 : <nl> pLayer = new TextureSizeTest ( ) ; break ; <nl> - case 29 : <nl> + case 28 : <nl> pLayer = new TextureCache1 ( ) ; break ; <nl> - case 30 : <nl> + case 29 : <nl> pLayer = new TexturePVRRGB888 ( ) ; break ; <nl> - case 31 : <nl> + case 30 : <nl> pLayer = new TextureAsync ( ) ; break ; <nl> + case 31 : <nl> + pLayer = new TextureDrawAtPoint ( ) ; break ; <nl> + case 32 : <nl> + pLayer = new TextureDrawInRect ( ) ; break ; <nl> + case 33 : <nl> + pLayer = new FileUtilsTest ( ) ; break ; <nl> default : <nl> break ; <nl> } <nl> std : : string TexturePVR2BPP : : title ( ) <nl> return " PVR TC 2bpp Test " ; <nl> } <nl> <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - / / <nl> - / / TexturePVRRaw <nl> - / / To generate PVR images read this article : <nl> - / / http : / / developer . apple . com / iphone / library / qa / qa2008 / qa1611 . html <nl> - / / <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - void TexturePVRRaw : : onEnter ( ) <nl> - { <nl> - TextureDemo : : onEnter ( ) ; <nl> - # ifdef CC_SUPPORT_PVRTC <nl> - CCSize s = CCDirector : : sharedDirector ( ) - > getWinSize ( ) ; <nl> - <nl> - CCTexture2D * tex = CCTextureCache : : sharedTextureCache ( ) - > addPVRTCImage ( " Images / test_image . pvrraw " , 4 , true , 128 ) ; <nl> - CCSprite * img = CCSprite : : spriteWithTexture ( tex ) ; <nl> - img - > setPosition ( ccp ( s . width / 2 . 0f , s . height / 2 . 0f ) ) ; <nl> - addChild ( img ) ; <nl> - # else <nl> - CCLog ( " Not support PVRTC ! " ) ; <nl> - # endif <nl> - <nl> - CCTextureCache : : sharedTextureCache ( ) - > dumpCachedTextureInfo ( ) ; <nl> - } <nl> - <nl> - std : : string TexturePVRRaw : : title ( ) <nl> - { <nl> - return " PVR TC 4bpp Test # 1 ( Raw ) " ; <nl> - } <nl> - <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / <nl> / / TexturePVR <nl> std : : string TextureCache1 : : subtitle ( ) <nl> return " 4 images should appear : alias , antialias , alias , antilias " ; <nl> } <nl> <nl> + / / TextureDrawAtPoint <nl> + void TextureDrawAtPoint : : onEnter ( ) <nl> + { <nl> + TextureDemo : : onEnter ( ) ; <nl> + <nl> + m_pTex1 = CCTextureCache : : sharedTextureCache ( ) - > addImage ( " Images / grossinis_sister1 . png " ) ; <nl> + m_pTex2 = CCTextureCache : : sharedTextureCache ( ) - > addImage ( " Images / grossinis_sister2 . png " ) ; <nl> + <nl> + m_pTex1 - > retain ( ) ; <nl> + m_pTex2 - > retain ( ) ; <nl> + } <nl> + <nl> + TextureDrawAtPoint : : ~ TextureDrawAtPoint ( ) <nl> + { <nl> + m_pTex1 - > release ( ) ; <nl> + m_pTex2 - > release ( ) ; <nl> + } <nl> + <nl> + std : : string TextureDrawAtPoint : : title ( ) <nl> + { <nl> + return " CCTexture2D : drawAtPoint " ; <nl> + } <nl> + <nl> + std : : string TextureDrawAtPoint : : subtitle ( ) <nl> + { <nl> + return " draws 2 textures using drawAtPoint " ; <nl> + } <nl> + <nl> + void TextureDrawAtPoint : : draw ( ) <nl> + { <nl> + TextureDemo : : draw ( ) ; <nl> + <nl> + CCSize s = CCDirector : : sharedDirector ( ) - > getWinSize ( ) ; <nl> + <nl> + m_pTex1 - > drawAtPoint ( ccp ( s . width / 2 - 50 , s . height / 2 - 50 ) ) ; <nl> + m_pTex2 - > drawAtPoint ( ccp ( s . width / 2 + 50 , s . height / 2 - 50 ) ) ; <nl> + <nl> + } <nl> + <nl> + / / TextureDrawInRect <nl> + <nl> + void TextureDrawInRect : : onEnter ( ) <nl> + { <nl> + TextureDemo : : onEnter ( ) ; <nl> + m_pTex1 = CCTextureCache : : sharedTextureCache ( ) - > addImage ( " Images / grossinis_sister1 . png " ) ; <nl> + m_pTex2 = CCTextureCache : : sharedTextureCache ( ) - > addImage ( " Images / grossinis_sister2 . png " ) ; <nl> + <nl> + m_pTex1 - > retain ( ) ; <nl> + m_pTex2 - > retain ( ) ; <nl> + } <nl> + <nl> + TextureDrawInRect : : ~ TextureDrawInRect ( ) <nl> + { <nl> + m_pTex1 - > release ( ) ; <nl> + m_pTex2 - > release ( ) ; <nl> + } <nl> + <nl> + void TextureDrawInRect : : draw ( ) <nl> + { <nl> + TextureDemo : : draw ( ) ; <nl> + <nl> + CCSize s = CCDirector : : sharedDirector ( ) - > getWinSize ( ) ; <nl> + <nl> + CCRect rect1 = CCRectMake ( s . width / 2 - 80 , 20 , m_pTex1 - > getContentSize ( ) . width * 0 . 5f , m_pTex1 - > getContentSize ( ) . height * 2 ) ; <nl> + CCRect rect2 = CCRectMake ( s . width / 2 + 80 , s . height / 2 , m_pTex1 - > getContentSize ( ) . width * 2 , m_pTex1 - > getContentSize ( ) . height * 0 . 5f ) ; <nl> + <nl> + m_pTex1 - > drawInRect ( rect1 ) ; <nl> + m_pTex2 - > drawInRect ( rect2 ) ; <nl> + <nl> + } <nl> + <nl> + std : : string TextureDrawInRect : : title ( ) <nl> + { <nl> + return " CCTexture2D : drawInRect " ; <nl> + } <nl> + <nl> + std : : string TextureDrawInRect : : subtitle ( ) <nl> + { <nl> + return " draws 2 textures using drawInRect " ; <nl> + } <nl> + <nl> + / / FileUtilsTest <nl> + void FileUtilsTest : : onEnter ( ) <nl> + { <nl> + TextureDemo : : onEnter ( ) ; <nl> + / / This test is only valid in Retinadisplay <nl> + <nl> + if ( CC_CONTENT_SCALE_FACTOR ( ) = = 2 ) { <nl> + <nl> + CCSprite * sprite = new CCSprite ( ) ; <nl> + sprite - > initWithFile ( " Images / bugs / test_issue_1179 . png " ) ; <nl> + if ( sprite ) <nl> + CCLog ( " Test # 1 issue 1179 : OK " ) ; <nl> + else <nl> + CCLog ( " Test # 1 issue 1179 : FAILED " ) ; <nl> + <nl> + sprite - > release ( ) ; <nl> + <nl> + sprite = new CCSprite ( ) ; <nl> + sprite - > initWithFile ( " only_in_hd . pvr . ccz " ) ; <nl> + if ( sprite ) <nl> + CCLog ( " Test # 2 issue 1179 : OK " ) ; <nl> + else <nl> + CCLog ( " Test # 2 issue 1179 : FAILED " ) ; <nl> + <nl> + sprite - > release ( ) ; <nl> + <nl> + } else { <nl> + CCLog ( " Test issue # 1179 failed . Needs to be tested with RetinaDispaly " ) ; <nl> + } <nl> + <nl> + <nl> + # if ( CC_TARGET_PLATFORM = = CC_PLATFORM_IOS ) <nl> + / / Testint CCFileUtils API <nl> + bool ret = false ; <nl> + ret = CCFileUtils : : iPhoneRetinaDisplayFileExistsAtPath ( " Images / bugs / test_issue_1179 . png " ) ; <nl> + if ( ret ) <nl> + CCLog ( " Test # 3 : retinaDisplayFileExistsAtPath : OK " ) ; <nl> + else <nl> + CCLog ( " Test # 3 : retinaDisplayFileExistsAtPath : FAILED " ) ; <nl> + <nl> + <nl> + ret = CCFileUtils : : iPhoneRetinaDisplayFileExistsAtPath ( " grossini - does_no_exist . png " ) ; <nl> + if ( ! ret ) <nl> + CCLog ( " Test # 4 : retinaDisplayFileExistsAtPath : OK " ) ; <nl> + else <nl> + CCLog ( " Test # 4 : retinaDisplayFileExistsAtPath : FAILED " ) ; <nl> + # endif <nl> + } <nl> + <nl> + std : : string FileUtilsTest : : title ( ) <nl> + { <nl> + return " CCFileUtils : See console " ; <nl> + } <nl> + <nl> + std : : string FileUtilsTest : : subtitle ( ) <nl> + { <nl> + return " See the console " ; <nl> + } <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / <nl> / / TextureTestScene <nl> mmm a / tests / tests / Texture2dTest / Texture2dTest . h <nl> ppp b / tests / tests / Texture2dTest / Texture2dTest . h <nl> <nl> <nl> # include " . . / testBasic . h " <nl> <nl> + <nl> class TextureDemo : public CCLayer <nl> { <nl> public : <nl> class TexturePVRNPOT8888 : public TextureDemo <nl> virtual void onEnter ( ) ; <nl> } ; <nl> <nl> - class TexturePVRRaw : public TextureDemo <nl> - { <nl> - public : <nl> - virtual std : : string title ( ) ; <nl> - <nl> - virtual void onEnter ( ) ; <nl> - } ; <nl> - <nl> class TextureAlias : public TextureDemo <nl> { <nl> public : <nl> class TextureCache1 : public TextureDemo <nl> virtual void onEnter ( ) ; <nl> } ; <nl> <nl> + class FileUtilsTest : public TextureDemo <nl> + { <nl> + public : <nl> + virtual std : : string title ( ) ; <nl> + virtual std : : string subtitle ( ) ; <nl> + virtual void onEnter ( ) ; <nl> + } ; <nl> + <nl> + class TextureDrawAtPoint : public TextureDemo <nl> + { <nl> + public : <nl> + ~ TextureDrawAtPoint ( ) ; <nl> + virtual std : : string title ( ) ; <nl> + virtual std : : string subtitle ( ) ; <nl> + virtual void onEnter ( ) ; <nl> + virtual void draw ( ) ; <nl> + private : <nl> + CCTexture2D * m_pTex1 , * m_pTex2 ; <nl> + } ; <nl> + <nl> + class TextureDrawInRect : public TextureDemo <nl> + { <nl> + public : <nl> + ~ TextureDrawInRect ( ) ; <nl> + virtual std : : string title ( ) ; <nl> + virtual std : : string subtitle ( ) ; <nl> + virtual void onEnter ( ) ; <nl> + virtual void draw ( ) ; <nl> + private : <nl> + CCTexture2D * m_pTex1 , * m_pTex2 ; <nl> + } ; <nl> + <nl> class TextureTestScene : public TestScene <nl> { <nl> public : <nl> mmm a / tests / tests / TileMapTest / TileMapTest . cpp <nl> ppp b / tests / tests / TileMapTest / TileMapTest . cpp <nl> void TMXReadWriteTest : : updateCol ( ccTime dt ) <nl> <nl> void TMXReadWriteTest : : repaintWithGID ( ccTime dt ) <nl> { <nl> - / / [ self unschedule : _cmd ) ; <nl> + / / unschedule : _cmd ) ; <nl> <nl> CCTMXTiledMap * map = ( CCTMXTiledMap * ) getChildByTag ( kTagTileMap ) ; <nl> CCTMXLayer * layer = ( CCTMXLayer * ) map - > getChildByTag ( 0 ) ; <nl> std : : string TMXOrthoMoveLayer : : subtitle ( ) <nl> return " Trees should be horizontally aligned " ; <nl> } <nl> <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> + / / <nl> + / / TMXTilePropertyTest <nl> + / / <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> + <nl> + TMXTilePropertyTest : : TMXTilePropertyTest ( ) <nl> + { <nl> + CCTMXTiledMap * map = CCTMXTiledMap : : tiledMapWithTMXFile ( " TileMaps / ortho - tile - property . tmx " ) ; <nl> + addChild ( map , 0 , kTagTileMap ) ; <nl> + <nl> + for ( int i = 1 ; i < = 20 ; i + + ) { <nl> + CCLog ( " GID : % i , Properties : % p " , i , map - > propertiesForGID ( i ) ) ; <nl> + } <nl> + } <nl> + <nl> + std : : string TMXTilePropertyTest : : title ( ) <nl> + { <nl> + return " TMX Tile Property Test " ; <nl> + } <nl> + <nl> + std : : string TMXTilePropertyTest : : subtitle ( ) <nl> + { <nl> + return " In the console you should see tile properties " ; <nl> + } <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> + / / <nl> + / / TMXOrthoFlipTest <nl> + / / <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> + <nl> + TMXOrthoFlipTest : : TMXOrthoFlipTest ( ) <nl> + { <nl> + CCTMXTiledMap * map = CCTMXTiledMap : : tiledMapWithTMXFile ( " TileMaps / ortho - rotation - test . tmx " ) ; <nl> + addChild ( map , 0 , kTagTileMap ) ; <nl> + <nl> + CCSize s = map - > getContentSize ( ) ; <nl> + CCLog ( " ContentSize : % f , % f " , s . width , s . height ) ; <nl> + <nl> + CCObject * pObj = NULL ; <nl> + CCARRAY_FOREACH ( map - > getChildren ( ) , pObj ) <nl> + { <nl> + CCSpriteBatchNode * child = ( CCSpriteBatchNode * ) pObj ; <nl> + child - > getTexture ( ) - > setAntiAliasTexParameters ( ) ; <nl> + } <nl> + <nl> + CCScaleBy * action = CCScaleBy : : actionWithDuration ( 2 , 0 . 5f ) ; <nl> + map - > runAction ( action ) ; <nl> + } <nl> + <nl> + std : : string TMXOrthoFlipTest : : title ( ) <nl> + { <nl> + return " TMX tile flip test " ; <nl> + } <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> + / / <nl> + / / TMXOrthoFlipRunTimeTest <nl> + / / <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> + <nl> + TMXOrthoFlipRunTimeTest : : TMXOrthoFlipRunTimeTest ( ) <nl> + { <nl> + CCTMXTiledMap * map = CCTMXTiledMap : : tiledMapWithTMXFile ( " TileMaps / ortho - rotation - test . tmx " ) ; <nl> + addChild ( map , 0 , kTagTileMap ) ; <nl> + <nl> + CCSize s = map - > getContentSize ( ) ; <nl> + CCLog ( " ContentSize : % f , % f " , s . width , s . height ) ; <nl> + <nl> + CCObject * pObj = NULL ; <nl> + CCARRAY_FOREACH ( map - > getChildren ( ) , pObj ) <nl> + { <nl> + CCSpriteBatchNode * child = ( CCSpriteBatchNode * ) pObj ; <nl> + child - > getTexture ( ) - > setAntiAliasTexParameters ( ) ; <nl> + } <nl> + <nl> + CCScaleBy * action = CCScaleBy : : actionWithDuration ( 2 , 0 . 5f ) ; <nl> + map - > runAction ( action ) ; <nl> + <nl> + schedule ( schedule_selector ( TMXOrthoFlipRunTimeTest : : flipIt ) , 1 . 0f ) ; <nl> + } <nl> + <nl> + std : : string TMXOrthoFlipRunTimeTest : : title ( ) <nl> + { <nl> + return " TMX tile flip run time test " ; <nl> + } <nl> + <nl> + std : : string TMXOrthoFlipRunTimeTest : : subtitle ( ) <nl> + { <nl> + return " in 2 sec bottom left tiles will flip " ; <nl> + } <nl> + <nl> + void TMXOrthoFlipRunTimeTest : : flipIt ( ccTime dt ) <nl> + { <nl> + CCTMXTiledMap * map = ( CCTMXTiledMap * ) getChildByTag ( kTagTileMap ) ; <nl> + CCTMXLayer * layer = map - > layerNamed ( " Layer 0 " ) ; <nl> + <nl> + / / blue diamond <nl> + CCPoint tileCoord = ccp ( 1 , 10 ) ; <nl> + int flags ; <nl> + unsigned int GID = layer - > tileGIDAt ( tileCoord , ( ccTMXTileFlags * ) & flags ) ; <nl> + / / Vertical <nl> + if ( flags & kCCTMXTileVerticalFlag ) <nl> + flags & = ~ kCCTMXTileVerticalFlag ; <nl> + else <nl> + flags | = kCCTMXTileVerticalFlag ; <nl> + layer - > setTileGID ( GID , tileCoord , ( ccTMXTileFlags ) flags ) ; <nl> + <nl> + <nl> + tileCoord = ccp ( 1 , 8 ) ; <nl> + GID = layer - > tileGIDAt ( tileCoord , ( ccTMXTileFlags * ) & flags ) ; <nl> + / / Vertical <nl> + if ( flags & kCCTMXTileVerticalFlag ) <nl> + flags & = ~ kCCTMXTileVerticalFlag ; <nl> + else <nl> + flags | = kCCTMXTileVerticalFlag ; <nl> + layer - > setTileGID ( GID , tileCoord , ( ccTMXTileFlags ) flags ) ; <nl> + <nl> + <nl> + tileCoord = ccp ( 2 , 8 ) ; <nl> + GID = layer - > tileGIDAt ( tileCoord , ( ccTMXTileFlags * ) & flags ) ; <nl> + / / Horizontal <nl> + if ( flags & kCCTMXTileHorizontalFlag ) <nl> + flags & = ~ kCCTMXTileHorizontalFlag ; <nl> + else <nl> + flags | = kCCTMXTileHorizontalFlag ; <nl> + layer - > setTileGID ( GID , tileCoord , ( ccTMXTileFlags ) flags ) ; <nl> + } <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> + / / <nl> + / / TMXOrthoFromXMLTest <nl> + / / <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> + <nl> + TMXOrthoFromXMLTest : : TMXOrthoFromXMLTest ( ) <nl> + { <nl> + string resources = " TileMaps " ; / / partial paths are OK as resource paths . <nl> + string file = resources + " / orthogonal - test1 . tmx " ; <nl> + <nl> + char * str = CCString : : stringWithContentsOfFile ( CCFileUtils : : fullPathFromRelativePath ( file . c_str ( ) ) ) ; <nl> + CCAssert ( str ! = NULL , " Unable to open file " ) ; <nl> + <nl> + CCTMXTiledMap * map = CCTMXTiledMap : : tiledMapWithXML ( str , resources . c_str ( ) ) ; <nl> + addChild ( map , 0 , kTagTileMap ) ; <nl> + <nl> + CCSize s = map - > getContentSize ( ) ; <nl> + CCLog ( " ContentSize : % f , % f " , s . width , s . height ) ; <nl> + <nl> + CCObject * pObj = NULL ; <nl> + CCARRAY_FOREACH ( map - > getChildren ( ) , pObj ) <nl> + { <nl> + CCSpriteBatchNode * child = ( CCSpriteBatchNode * ) pObj ; <nl> + child - > getTexture ( ) - > setAntiAliasTexParameters ( ) ; <nl> + } <nl> + <nl> + CCScaleBy * action = CCScaleBy : : actionWithDuration ( 2 , 0 . 5f ) ; <nl> + map - > runAction ( action ) ; <nl> + } <nl> + <nl> + std : : string TMXOrthoFromXMLTest : : title ( ) <nl> + { <nl> + return " TMX created from XML test " ; <nl> + } <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / <nl> / / TMXBug987 <nl> enum <nl> <nl> static int sceneIdx = - 1 ; <nl> <nl> - # define MAX_LAYER 25 <nl> + # define MAX_LAYER 28 <nl> <nl> CCLayer * createTileMapLayer ( int nIndex ) <nl> { <nl> CCLayer * createTileMapLayer ( int nIndex ) <nl> case 17 : return new TMXResizeTest ( ) ; <nl> case 18 : return new TMXIsoMoveLayer ( ) ; <nl> case 19 : return new TMXOrthoMoveLayer ( ) ; <nl> - case 20 : return new TileMapTest ( ) ; <nl> - case 21 : return new TileMapEditTest ( ) ; <nl> - case 22 : return new TMXBug987 ( ) ; <nl> - case 23 : return new TMXBug787 ( ) ; <nl> - case 24 : return new TMXGIDObjectsTest ( ) ; <nl> + case 20 : return new TMXOrthoFlipTest ( ) ; <nl> + case 21 : return new TMXOrthoFlipRunTimeTest ( ) ; <nl> + case 22 : return new TMXOrthoFromXMLTest ( ) ; <nl> + case 23 : return new TileMapTest ( ) ; <nl> + case 24 : return new TileMapEditTest ( ) ; <nl> + case 25 : return new TMXBug987 ( ) ; <nl> + case 26 : return new TMXBug787 ( ) ; <nl> + case 27 : return new TMXGIDObjectsTest ( ) ; <nl> } <nl> <nl> return NULL ; <nl> mmm a / tests / tests / TileMapTest / TileMapTest . h <nl> ppp b / tests / tests / TileMapTest / TileMapTest . h <nl> class TMXOrthoMoveLayer : public TileDemo <nl> virtual std : : string subtitle ( ) ; <nl> } ; <nl> <nl> + class TMXTilePropertyTest : public TileDemo <nl> + { <nl> + public : <nl> + TMXTilePropertyTest ( ) ; <nl> + virtual std : : string title ( ) ; <nl> + virtual std : : string subtitle ( ) ; <nl> + } ; <nl> + <nl> + class TMXOrthoFlipTest : public TileDemo <nl> + { <nl> + public : <nl> + TMXOrthoFlipTest ( ) ; <nl> + virtual std : : string title ( ) ; <nl> + } ; <nl> + <nl> + class TMXOrthoFlipRunTimeTest : public TileDemo <nl> + { <nl> + public : <nl> + TMXOrthoFlipRunTimeTest ( ) ; <nl> + virtual std : : string title ( ) ; <nl> + virtual std : : string subtitle ( ) ; <nl> + void flipIt ( ccTime dt ) ; <nl> + } ; <nl> + <nl> + class TMXOrthoFromXMLTest : public TileDemo <nl> + { <nl> + public : <nl> + TMXOrthoFromXMLTest ( ) ; <nl> + virtual std : : string title ( ) ; <nl> + } ; <nl> + <nl> class TMXBug987 : public TileDemo <nl> { <nl> public : <nl> mmm a / tests / tests / TransitionsTest / TransitionsTest . cpp <nl> ppp b / tests / tests / TransitionsTest / TransitionsTest . cpp <nl> class PageTransitionBackward : public CCTransitionPageTurn <nl> } <nl> } ; <nl> <nl> - # define MAX_LAYER 37 <nl> + # define MAX_LAYER 41 <nl> <nl> static std : : string transitions [ MAX_LAYER ] = { <nl> - " JumpZoomTransition " , <nl> - " FadeTransition " , <nl> + " CCTransitionJumpZoom " , <nl> + <nl> + " CCTransitionProgressRadialCCW " , <nl> + " CCTransitionProgressRadialCW " , <nl> + " CCTransitionProgressHorizontal " , <nl> + " CCTransitionProgressVertical " , <nl> + " CCTransitionProgressInOut " , <nl> + " CCTransitionProgressOutIn " , <nl> + <nl> + " CCTransitionCrossFade " , <nl> + " TransitionPageForward " , <nl> + " TransitionPageBackward " , <nl> + " CCTransitionFadeTR " , <nl> + " CCTransitionFadeBL " , <nl> + " CCTransitionFadeUp " , <nl> + " CCTransitionFadeDown " , <nl> + " CCTransitionTurnOffTiles " , <nl> + " CCTransitionSplitRows " , <nl> + " CCTransitionSplitCols " , <nl> + <nl> + " CCTransitionFade " , <nl> " FadeWhiteTransition " , <nl> + <nl> " FlipXLeftOver " , <nl> " FlipXRightOver " , <nl> " FlipYUpOver " , <nl> " FlipYDownOver " , <nl> " FlipAngularLeftOver " , <nl> " FlipAngularRightOver " , <nl> + <nl> " ZoomFlipXLeftOver " , <nl> " ZoomFlipXRightOver " , <nl> " ZoomFlipYUpOver " , <nl> " ZoomFlipYDownOver " , <nl> " ZoomFlipAngularLeftOver " , <nl> " ZoomFlipAngularRightOver " , <nl> - " ShrinkGrowTransition " , <nl> - " RotoZoomTransition " , <nl> - " MoveInLTransition " , <nl> - " MoveInRTransition " , <nl> - " MoveInTTransition " , <nl> - " MoveInBTransition " , <nl> - " SlideInLTransition " , <nl> - " SlideInRTransition " , <nl> - " SlideInTTransition " , <nl> - " SlideInBTransition " , <nl> <nl> - " CCTransitionCrossFade " , <nl> - " CCTransitionRadialCCW " , <nl> - " CCTransitionRadialCW " , <nl> - " PageTransitionForward " , <nl> - " PageTransitionBackward " , <nl> - " FadeTRTransition " , <nl> - " FadeBLTransition " , <nl> - " FadeUpTransition " , <nl> - " FadeDownTransition " , <nl> - " TurnOffTilesTransition " , <nl> - " SplitRowsTransition " , <nl> - " SplitColsTransition " , <nl> + " CCTransitionShrinkGrow " , <nl> + " CCTransitionRotoZoom " , <nl> + <nl> + " CCTransitionMoveInL " , <nl> + " CCTransitionMoveInR " , <nl> + " CCTransitionMoveInT " , <nl> + " CCTransitionMoveInB " , <nl> + " CCTransitionSlideInL " , <nl> + " CCTransitionSlideInR " , <nl> + " CCTransitionSlideInT " , <nl> + " CCTransitionSlideInB " , <nl> + <nl> + <nl> } ; <nl> static int s_nSceneIdx = 0 ; <nl> <nl> CCTransitionScene * createTransition ( int nIndex , ccTime t , CCScene * s ) <nl> switch ( nIndex ) <nl> { <nl> case 0 : return CCTransitionJumpZoom : : transitionWithDuration ( t , s ) ; <nl> - case 1 : return CCTransitionFade : : transitionWithDuration ( t , s ) ; <nl> - case 2 : return FadeWhiteTransition : : transitionWithDuration ( t , s ) ; <nl> - case 3 : return FlipXLeftOver : : transitionWithDuration ( t , s ) ; <nl> - case 4 : return FlipXRightOver : : transitionWithDuration ( t , s ) ; <nl> - case 5 : return FlipYUpOver : : transitionWithDuration ( t , s ) ; <nl> - case 6 : return FlipYDownOver : : transitionWithDuration ( t , s ) ; <nl> - case 7 : return FlipAngularLeftOver : : transitionWithDuration ( t , s ) ; <nl> - case 8 : return FlipAngularRightOver : : transitionWithDuration ( t , s ) ; <nl> - case 9 : return ZoomFlipXLeftOver : : transitionWithDuration ( t , s ) ; <nl> - case 10 : return ZoomFlipXRightOver : : transitionWithDuration ( t , s ) ; <nl> - case 11 : return ZoomFlipYUpOver : : transitionWithDuration ( t , s ) ; <nl> - case 12 : return ZoomFlipYDownOver : : transitionWithDuration ( t , s ) ; <nl> - case 13 : return ZoomFlipAngularLeftOver : : transitionWithDuration ( t , s ) ; <nl> - case 14 : return ZoomFlipAngularRightOver : : transitionWithDuration ( t , s ) ; <nl> - case 15 : return CCTransitionShrinkGrow : : transitionWithDuration ( t , s ) ; <nl> - case 16 : return CCTransitionRotoZoom : : transitionWithDuration ( t , s ) ; <nl> - case 17 : return CCTransitionMoveInL : : transitionWithDuration ( t , s ) ; <nl> - case 18 : return CCTransitionMoveInR : : transitionWithDuration ( t , s ) ; <nl> - case 19 : return CCTransitionMoveInT : : transitionWithDuration ( t , s ) ; <nl> - case 20 : return CCTransitionMoveInB : : transitionWithDuration ( t , s ) ; <nl> - case 21 : return CCTransitionSlideInL : : transitionWithDuration ( t , s ) ; <nl> - case 22 : return CCTransitionSlideInR : : transitionWithDuration ( t , s ) ; <nl> - case 23 : return CCTransitionSlideInT : : transitionWithDuration ( t , s ) ; <nl> - case 24 : return CCTransitionSlideInB : : transitionWithDuration ( t , s ) ; <nl> - case 25 : <nl> - { <nl> - if ( CCConfiguration : : sharedConfiguration ( ) - > getGlesVersion ( ) < GLES_VER_2_0 ) <nl> - { <nl> - CCMessageBox ( " The Opengl ES version is lower than 2 . 0 , and TransitionCrossFade may not run correctly , it is ignored . " , " Cocos2d - x Hint " ) ; <nl> - return NULL ; <nl> - } <nl> - else <nl> - { <nl> - return CCTransitionCrossFade : : transitionWithDuration ( t , s ) ; <nl> - } <nl> - } <nl> - break ; <nl> - case 26 : <nl> - { <nl> - if ( CCConfiguration : : sharedConfiguration ( ) - > getGlesVersion ( ) < GLES_VER_2_0 ) <nl> - { <nl> - CCMessageBox ( " The Opengl ES version is lower than 2 . 0 , and TransitionRadialCCW may not run correctly , it is ignored . " , " Cocos2d - x Hint " ) ; <nl> - return NULL ; <nl> - } <nl> - else <nl> - { <nl> - return NULL ; / / TODO : CCTransitionRadialCCW : : transitionWithDuration ( t , s ) ; <nl> - } <nl> - } <nl> - break ; <nl> - case 27 : <nl> - { <nl> - if ( CCConfiguration : : sharedConfiguration ( ) - > getGlesVersion ( ) < GLES_VER_2_0 ) <nl> - { <nl> - CCMessageBox ( " The Opengl ES version is lower than 2 . 0 , and TransitionRadialCW may not run correctly , it is ignored . " , " Cocos2d - x Hint " ) ; <nl> - return NULL ; <nl> - } <nl> - else <nl> - { <nl> - return NULL ; / / TODO : CCTransitionRadialCW : : transitionWithDuration ( t , s ) ; <nl> - } <nl> - } <nl> - break ; <nl> - case 28 : return PageTransitionForward : : transitionWithDuration ( t , s ) ; <nl> - case 29 : return PageTransitionBackward : : transitionWithDuration ( t , s ) ; <nl> - case 30 : return CCTransitionFadeTR : : transitionWithDuration ( t , s ) ; <nl> - case 31 : return CCTransitionFadeBL : : transitionWithDuration ( t , s ) ; <nl> - case 32 : return CCTransitionFadeUp : : transitionWithDuration ( t , s ) ; <nl> - case 33 : return CCTransitionFadeDown : : transitionWithDuration ( t , s ) ; <nl> - case 34 : return CCTransitionTurnOffTiles : : transitionWithDuration ( t , s ) ; <nl> - case 35 : return CCTransitionSplitRows : : transitionWithDuration ( t , s ) ; <nl> - case 36 : return CCTransitionSplitCols : : transitionWithDuration ( t , s ) ; <nl> + <nl> + case 1 : return CCTransitionProgressRadialCCW : : transitionWithDuration ( t , s ) ; <nl> + case 2 : return CCTransitionProgressRadialCW : : transitionWithDuration ( t , s ) ; <nl> + case 3 : return CCTransitionProgressHorizontal : : transitionWithDuration ( t , s ) ; <nl> + case 4 : return CCTransitionProgressVertical : : transitionWithDuration ( t , s ) ; <nl> + case 5 : return CCTransitionProgressInOut : : transitionWithDuration ( t , s ) ; <nl> + case 6 : return CCTransitionProgressOutIn : : transitionWithDuration ( t , s ) ; <nl> + <nl> + case 7 : return CCTransitionCrossFade : : transitionWithDuration ( t , s ) ; <nl> + <nl> + case 8 : return PageTransitionForward : : transitionWithDuration ( t , s ) ; <nl> + case 9 : return PageTransitionBackward : : transitionWithDuration ( t , s ) ; <nl> + case 10 : return CCTransitionFadeTR : : transitionWithDuration ( t , s ) ; <nl> + case 11 : return CCTransitionFadeBL : : transitionWithDuration ( t , s ) ; <nl> + case 12 : return CCTransitionFadeUp : : transitionWithDuration ( t , s ) ; <nl> + case 13 : return CCTransitionFadeDown : : transitionWithDuration ( t , s ) ; <nl> + <nl> + case 14 : return CCTransitionTurnOffTiles : : transitionWithDuration ( t , s ) ; <nl> + <nl> + case 15 : return CCTransitionSplitRows : : transitionWithDuration ( t , s ) ; <nl> + case 16 : return CCTransitionSplitCols : : transitionWithDuration ( t , s ) ; <nl> + <nl> + case 17 : return CCTransitionFade : : transitionWithDuration ( t , s ) ; <nl> + case 18 : return FadeWhiteTransition : : transitionWithDuration ( t , s ) ; <nl> + <nl> + case 19 : return FlipXLeftOver : : transitionWithDuration ( t , s ) ; <nl> + case 20 : return FlipXRightOver : : transitionWithDuration ( t , s ) ; <nl> + case 21 : return FlipYUpOver : : transitionWithDuration ( t , s ) ; <nl> + case 22 : return FlipYDownOver : : transitionWithDuration ( t , s ) ; <nl> + case 23 : return FlipAngularLeftOver : : transitionWithDuration ( t , s ) ; <nl> + case 24 : return FlipAngularRightOver : : transitionWithDuration ( t , s ) ; <nl> + <nl> + case 25 : return ZoomFlipXLeftOver : : transitionWithDuration ( t , s ) ; <nl> + case 26 : return ZoomFlipXRightOver : : transitionWithDuration ( t , s ) ; <nl> + case 27 : return ZoomFlipYUpOver : : transitionWithDuration ( t , s ) ; <nl> + case 28 : return ZoomFlipYDownOver : : transitionWithDuration ( t , s ) ; <nl> + case 29 : return ZoomFlipAngularLeftOver : : transitionWithDuration ( t , s ) ; <nl> + case 30 : return ZoomFlipAngularRightOver : : transitionWithDuration ( t , s ) ; <nl> + <nl> + case 31 : return CCTransitionShrinkGrow : : transitionWithDuration ( t , s ) ; <nl> + case 32 : return CCTransitionRotoZoom : : transitionWithDuration ( t , s ) ; <nl> + <nl> + case 33 : return CCTransitionMoveInL : : transitionWithDuration ( t , s ) ; <nl> + case 34 : return CCTransitionMoveInR : : transitionWithDuration ( t , s ) ; <nl> + case 35 : return CCTransitionMoveInT : : transitionWithDuration ( t , s ) ; <nl> + case 36 : return CCTransitionMoveInB : : transitionWithDuration ( t , s ) ; <nl> + <nl> + case 37 : return CCTransitionSlideInL : : transitionWithDuration ( t , s ) ; <nl> + case 38 : return CCTransitionSlideInR : : transitionWithDuration ( t , s ) ; <nl> + case 39 : return CCTransitionSlideInT : : transitionWithDuration ( t , s ) ; <nl> + case 40 : return CCTransitionSlideInB : : transitionWithDuration ( t , s ) ; <nl> + <nl> default : break ; <nl> } <nl> <nl> void TestLayer1 : : step ( ccTime dt ) <nl> <nl> } <nl> <nl> + void TestLayer1 : : onEnter ( ) <nl> + { <nl> + CCLayer : : onEnter ( ) ; <nl> + CCLog ( " Scene 1 onEnter " ) ; <nl> + } <nl> + <nl> + void TestLayer1 : : onEnterTransitionDidFinish ( ) <nl> + { <nl> + CCLayer : : onEnterTransitionDidFinish ( ) ; <nl> + CCLog ( " Scene 1 : onEnterTransitionDidFinish " ) ; <nl> + } <nl> + <nl> + void TestLayer1 : : onExitTransitionDidStart ( ) <nl> + { <nl> + CCLayer : : onExitTransitionDidStart ( ) ; <nl> + CCLog ( " Scene 1 : onExitTransitionDidStart " ) ; <nl> + } <nl> + <nl> + void TestLayer1 : : onExit ( ) <nl> + { <nl> + CCLayer : : onExit ( ) ; <nl> + CCLog ( " Scene 1 onExit " ) ; <nl> + } <nl> + <nl> TestLayer2 : : TestLayer2 ( ) <nl> { <nl> float x , y ; <nl> void TestLayer2 : : step ( ccTime dt ) <nl> { <nl> <nl> } <nl> + <nl> + void TestLayer2 : : onEnter ( ) <nl> + { <nl> + CCLayer : : onEnter ( ) ; <nl> + CCLog ( " Scene 2 onEnter " ) ; <nl> + } <nl> + <nl> + void TestLayer2 : : onEnterTransitionDidFinish ( ) <nl> + { <nl> + CCLayer : : onEnterTransitionDidFinish ( ) ; <nl> + CCLog ( " Scene 2 : onEnterTransitionDidFinish " ) ; <nl> + } <nl> + <nl> + void TestLayer2 : : onExitTransitionDidStart ( ) <nl> + { <nl> + CCLayer : : onExitTransitionDidStart ( ) ; <nl> + CCLog ( " Scene 2 : onExitTransitionDidStart " ) ; <nl> + } <nl> + <nl> + void TestLayer2 : : onExit ( ) <nl> + { <nl> + CCLayer : : onExit ( ) ; <nl> + CCLog ( " Scene 2 onExit " ) ; <nl> + } <nl> mmm a / tests / tests / TransitionsTest / TransitionsTest . h <nl> ppp b / tests / tests / TransitionsTest / TransitionsTest . h <nl> class TestLayer1 : public CCLayer <nl> void backCallback ( CCObject * pSender ) ; <nl> <nl> void step ( ccTime dt ) ; <nl> + <nl> + virtual void onEnter ( ) ; <nl> + virtual void onEnterTransitionDidFinish ( ) ; <nl> + virtual void onExitTransitionDidStart ( ) ; <nl> + virtual void onExit ( ) ; <nl> } ; <nl> <nl> class TestLayer2 : public CCLayer <nl> class TestLayer2 : public CCLayer <nl> void backCallback ( CCObject * pSender ) ; <nl> <nl> void step ( ccTime dt ) ; <nl> + <nl> + virtual void onEnter ( ) ; <nl> + virtual void onEnterTransitionDidFinish ( ) ; <nl> + virtual void onExitTransitionDidStart ( ) ; <nl> + virtual void onExit ( ) ; <nl> } ; <nl> <nl> # endif <nl>
issue : Added CCTransitionProgress class , Updated Texture2dTest , TileMapTest , TransitionsTest .
cocos2d/cocos2d-x
85c13998ee32fe29b309c0e999912f7ea04cd5b5
2012-03-26T08:46:23Z
mmm a / src / mongo / db / commands / write_commands / write_commands . cpp <nl> ppp b / src / mongo / db / commands / write_commands / write_commands . cpp <nl> BSONObj makeTimeseriesUpsertRequest ( const BSONObj & doc ) { <nl> / / TODO ( SERVER - 52523 ) : Obtain _id of bucket to update and name of time field from in - memory <nl> / / catalog . <nl> const auto timeField = " time " _sd ; <nl> - auto query = BSON ( <nl> - std : : string ( str : : stream ( ) < < " data . " < < timeField < < " . " < < ( kTimeseriesBucketMaxCount - 1 ) ) <nl> - < < BSON ( " $ exists " < < false ) ) ; <nl> - builder . append ( write_ops : : UpdateOpEntry : : kQFieldName , query ) ; <nl> + { <nl> + BSONObjBuilder queryBuilder ( builder . subobjStart ( write_ops : : UpdateOpEntry : : kQFieldName ) ) ; <nl> + BSONArrayBuilder andBuilder ( queryBuilder . subarrayStart ( " $ and " ) ) ; <nl> + / / Each bucket can hold up to ' kTimeseriesBucketMaxCount ' measurements . <nl> + andBuilder . append ( BSON ( std : : string ( str : : stream ( ) < < " data . " < < timeField < < " . " <nl> + < < ( kTimeseriesBucketMaxCount - 1 ) ) <nl> + < < BSON ( " $ exists " < < false ) ) ) ; <nl> + } <nl> builder . append ( write_ops : : UpdateOpEntry : : kMultiFieldName , false ) ; <nl> builder . append ( write_ops : : UpdateOpEntry : : kUpsertFieldName , true ) ; <nl> { <nl>
SERVER - 52526 enclose time - series upsert query in and query operator
mongodb/mongo
e1f12297b7951caf0a43e176620315622191547d
2020-11-18T16:46:31Z
mmm a / tensorflow / go / op / wrappers . go <nl> ppp b / tensorflow / go / op / wrappers . go <nl> func DepthwiseConv2dNativeBackpropFilterDataFormat ( value string ) DepthwiseConv2d <nl> / / element on that dimension . The dimension order is determined by the value of <nl> / / ` data_format ` , see above for details . Dilations in the batch and depth <nl> / / dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func DepthwiseConv2dNativeBackpropFilterDilations ( value [ ] int64 ) DepthwiseConv2dNativeBackpropFilterAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func SampleDistortedBoundingBoxV2Seed2 ( value int64 ) SampleDistortedBoundingBoxV2 <nl> / / <nl> / / value : The cropped area of the image must have an aspect ratio = <nl> / / width / height within this range . <nl> - / / If not specified , defaults to { f : 0 . 75 f : 1 . 33 } <nl> + / / If not specified , defaults to { f : 0 . 75 f : 1 . 33 } <nl> func SampleDistortedBoundingBoxV2AspectRatioRange ( value [ ] float32 ) SampleDistortedBoundingBoxV2Attr { <nl> return func ( m optionalAttr ) { <nl> m [ " aspect_ratio_range " ] = value <nl> func SampleDistortedBoundingBoxV2AspectRatioRange ( value [ ] float32 ) SampleDistort <nl> / / <nl> / / value : The cropped area of the image must contain a fraction of the <nl> / / supplied image within this range . <nl> - / / If not specified , defaults to { f : 0 . 05 f : 1 } <nl> + / / If not specified , defaults to { f : 0 . 05 f : 1 } <nl> func SampleDistortedBoundingBoxV2AreaRange ( value [ ] float32 ) SampleDistortedBoundingBoxV2Attr { <nl> return func ( m optionalAttr ) { <nl> m [ " area_range " ] = value <nl> func SampleDistortedBoundingBoxMinObjectCovered ( value float32 ) SampleDistortedBo <nl> / / <nl> / / value : The cropped area of the image must have an aspect ratio = <nl> / / width / height within this range . <nl> - / / If not specified , defaults to { f : 0 . 75 f : 1 . 33 } <nl> + / / If not specified , defaults to { f : 0 . 75 f : 1 . 33 } <nl> func SampleDistortedBoundingBoxAspectRatioRange ( value [ ] float32 ) SampleDistortedBoundingBoxAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " aspect_ratio_range " ] = value <nl> func SampleDistortedBoundingBoxAspectRatioRange ( value [ ] float32 ) SampleDistorted <nl> / / <nl> / / value : The cropped area of the image must contain a fraction of the <nl> / / supplied image within this range . <nl> - / / If not specified , defaults to { f : 0 . 05 f : 1 } <nl> + / / If not specified , defaults to { f : 0 . 05 f : 1 } <nl> func SampleDistortedBoundingBoxAreaRange ( value [ ] float32 ) SampleDistortedBoundingBoxAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " area_range " ] = value <nl> func ImageSummaryMaxImages ( value int64 ) ImageSummaryAttr { <nl> / / ImageSummaryBadColor sets the optional bad_color attribute to value . <nl> / / <nl> / / value : Color to use for pixels with non - finite values . <nl> - / / If not specified , defaults to { dtype : DT_UINT8 tensor_shape : { dim : { size : 4 } } int_val : 255 int_val : 0 int_val : 0 int_val : 255 } <nl> + / / If not specified , defaults to { dtype : DT_UINT8 tensor_shape : { dim : { size : 4 } } int_val : 255 int_val : 0 int_val : 0 int_val : 255 } <nl> func ImageSummaryBadColor ( value tf . Tensor ) ImageSummaryAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " bad_color " ] = value <nl> func Conv3DBackpropFilterV2DataFormat ( value string ) Conv3DBackpropFilterV2Attr { <nl> / / filter element on that dimension . The dimension order is determined by the <nl> / / value of ` data_format ` , see above for details . Dilations in the batch and <nl> / / depth dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> func Conv3DBackpropFilterV2Dilations ( value [ ] int64 ) Conv3DBackpropFilterV2Attr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func Conv2DBackpropInputDataFormat ( value string ) Conv2DBackpropInputAttr { <nl> / / element on that dimension . The dimension order is determined by the value of <nl> / / ` data_format ` , see above for details . Dilations in the batch and depth <nl> / / dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func Conv2DBackpropInputDilations ( value [ ] int64 ) Conv2DBackpropInputAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func Conv2DDataFormat ( value string ) Conv2DAttr { <nl> / / filter element on that dimension . The dimension order is determined by the <nl> / / value of ` data_format ` , see above for details . Dilations in the batch and <nl> / / depth dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func Conv2DDilations ( value [ ] int64 ) Conv2DAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedDepthwiseConv2DWithBiasAndReluAndRequantizeOutType ( value tf . DataTy <nl> / / QuantizedDepthwiseConv2DWithBiasAndReluAndRequantizeDilations sets the optional dilations attribute to value . <nl> / / <nl> / / value : List of dilation values . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedDepthwiseConv2DWithBiasAndReluAndRequantizeDilations ( value [ ] int64 ) QuantizedDepthwiseConv2DWithBiasAndReluAndRequantizeAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedDepthwiseConv2DWithBiasAndReluOutType ( value tf . DataType ) Quantized <nl> / / QuantizedDepthwiseConv2DWithBiasAndReluDilations sets the optional dilations attribute to value . <nl> / / <nl> / / value : List of dilation values . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedDepthwiseConv2DWithBiasAndReluDilations ( value [ ] int64 ) QuantizedDepthwiseConv2DWithBiasAndReluAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedDepthwiseConv2DWithBiasOutType ( value tf . DataType ) QuantizedDepthwi <nl> / / QuantizedDepthwiseConv2DWithBiasDilations sets the optional dilations attribute to value . <nl> / / <nl> / / value : List of dilation values . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedDepthwiseConv2DWithBiasDilations ( value [ ] int64 ) QuantizedDepthwiseConv2DWithBiasAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedDepthwiseConv2DOutType ( value tf . DataType ) QuantizedDepthwiseConv2D <nl> / / QuantizedDepthwiseConv2DDilations sets the optional dilations attribute to value . <nl> / / <nl> / / value : List of dilation values . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedDepthwiseConv2DDilations ( value [ ] int64 ) QuantizedDepthwiseConv2DAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedConv2DPerChannelOutType ( value tf . DataType ) QuantizedConv2DPerChann <nl> / / QuantizedConv2DPerChannelDilations sets the optional dilations attribute to value . <nl> / / <nl> / / value : list of dilation values . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedConv2DPerChannelDilations ( value [ ] int64 ) QuantizedConv2DPerChannelAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func Conv3DBackpropInputV2DataFormat ( value string ) Conv3DBackpropInputV2Attr { <nl> / / filter element on that dimension . The dimension order is determined by the <nl> / / value of ` data_format ` , see above for details . Dilations in the batch and <nl> / / depth dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> func Conv3DBackpropInputV2Dilations ( value [ ] int64 ) Conv3DBackpropInputV2Attr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func AvgPool3DGrad ( scope * Scope , orig_input_shape tf . Output , grad tf . Output , ksi <nl> type Conv3DBackpropFilterAttr func ( optionalAttr ) <nl> <nl> / / Conv3DBackpropFilterDilations sets the optional dilations attribute to value . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> func Conv3DBackpropFilterDilations ( value [ ] int64 ) Conv3DBackpropFilterAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func Conv3DDataFormat ( value string ) Conv3DAttr { <nl> / / filter element on that dimension . The dimension order is determined by the <nl> / / value of ` data_format ` , see above for details . Dilations in the batch and <nl> / / depth dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> func Conv3DDilations ( value [ ] int64 ) Conv3DAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func DepthwiseConv2dNativeBackpropInputDataFormat ( value string ) DepthwiseConv2dN <nl> / / element on that dimension . The dimension order is determined by the value of <nl> / / ` data_format ` , see above for details . Dilations in the batch and depth <nl> / / dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func DepthwiseConv2dNativeBackpropInputDilations ( value [ ] int64 ) DepthwiseConv2dNativeBackpropInputAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func DepthwiseConv2dNativeBackpropInput ( scope * Scope , input_sizes tf . Output , fil <nl> type Conv3DBackpropInputAttr func ( optionalAttr ) <nl> <nl> / / Conv3DBackpropInputDilations sets the optional dilations attribute to value . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> func Conv3DBackpropInputDilations ( value [ ] int64 ) Conv3DBackpropInputAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func DepthwiseConv2dNativeDataFormat ( value string ) DepthwiseConv2dNativeAttr { <nl> / / element on that dimension . The dimension order is determined by the value of <nl> / / ` data_format ` , see above for details . Dilations in the batch and depth <nl> / / dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func DepthwiseConv2dNativeDilations ( value [ ] int64 ) DepthwiseConv2dNativeAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedConv2DOutType ( value tf . DataType ) QuantizedConv2DAttr { <nl> / / filter element on that dimension . The dimension order is determined by the <nl> / / value of ` data_format ` , see above for details . Dilations in the batch and <nl> / / depth dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedConv2DDilations ( value [ ] int64 ) QuantizedConv2DAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func Conv2DBackpropFilterDataFormat ( value string ) Conv2DBackpropFilterAttr { <nl> / / element on that dimension . The dimension order is determined by the value of <nl> / / ` data_format ` , see above for details . Dilations in the batch and depth <nl> / / dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func Conv2DBackpropFilterDilations ( value [ ] int64 ) Conv2DBackpropFilterAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl>
Go : Update generated wrapper functions for TensorFlow ops .
tensorflow/tensorflow
2ec7a67766ab00dc35d1b16e5184df5b8cdbdf96
2020-03-16T10:50:32Z
mmm a / utils / build - script - impl <nl> ppp b / utils / build - script - impl <nl> for host in " $ { ALL_HOSTS [ @ ] } " ; do <nl> # Exclude shell scripts . <nl> ( cd " $ { INSTALL_SYMROOT } " & & <nl> find . / " $ { TOOLCHAIN_PREFIX } " - perm - 0111 - type f - print | \ <nl> - grep - v swift - stdlib - tool | \ <nl> grep - v crashlog . py | \ <nl> grep - v symbolication . py | \ <nl> xargs - n 1 - P $ { BUILD_JOBS } $ ( xcrun_find_tool dsymutil ) ) <nl>
swift - stdlib - tool is not a shell script and can be stripped
apple/swift
68525ce45042bf7316a507bf2fb6975e1be2333e
2017-04-29T23:45:34Z
mmm a / src / rdb_protocol / scope . hpp <nl> ppp b / src / rdb_protocol / scope . hpp <nl> inline void guarantee_T < boost : : shared_ptr < scoped_cJSON_t > > ( const boost : : shared_ <nl> guarantee ( j ) ; <nl> } <nl> <nl> - template < class T > <nl> - class variable_scope_t { <nl> - public : <nl> - void put_in_scope ( const std : : string & name , const T & t ) { <nl> - guarantee_T ( t ) ; <nl> - guarantee ( ! scopes . empty ( ) ) ; <nl> - scopes . front ( ) [ name ] = t ; <nl> - } <nl> - <nl> - T get ( const std : : string & name ) const { <nl> - for ( typename std : : list < std : : map < std : : string , T > > : : const_iterator it = scopes . begin ( ) ; <nl> - it ! = scopes . end ( ) ; <nl> - + + it ) { <nl> - typename std : : map < std : : string , T > : : const_iterator jt = it - > find ( name ) ; <nl> - if ( jt ! = it - > end ( ) ) { <nl> - return jt - > second ; <nl> - } <nl> - } <nl> - <nl> - unreachable ( " Variable not in scope , probably because the code fails to call is_in_scope ( ) . " ) ; <nl> - } <nl> - <nl> - / / Calling this only makes sense in the typechecker . All variables <nl> - / / are guranteed by the typechecker to be present at runtime . <nl> - bool is_in_scope ( const std : : string & name ) const { <nl> - for ( typename std : : list < std : : map < std : : string , T > > : : const_iterator it = scopes . begin ( ) ; it ! = scopes . end ( ) ; + + it ) { <nl> - typename std : : map < std : : string , T > : : const_iterator jt = it - > find ( name ) ; <nl> - if ( jt ! = it - > end ( ) ) { <nl> - return true ; <nl> - } <nl> - } <nl> - return false ; <nl> - } <nl> - <nl> - void push ( ) { <nl> - scopes . push_front ( std : : map < std : : string , T > ( ) ) ; <nl> - } <nl> - <nl> - void pop ( ) { <nl> - scopes . pop_front ( ) ; <nl> - } <nl> - <nl> - / / TODO ( rntz ) : find a better way to do this . <nl> - void dump ( std : : vector < std : : string > * argnames , std : : vector < T > * argvals ) const { <nl> - std : : set < std : : string > seen ; <nl> - <nl> - if ( argnames ) argnames - > clear ( ) ; <nl> - argvals - > clear ( ) ; <nl> - <nl> - / / Most recent scope is at front of deque , so we iterate in - order . <nl> - for ( typename std : : list < std : : map < std : : string , T > > : : const_iterator sit = scopes . begin ( ) ; sit ! = scopes . end ( ) ; + + sit ) { <nl> - for ( typename std : : map < std : : string , T > : : const_iterator it = sit - > begin ( ) ; it ! = sit - > end ( ) ; + + it ) { <nl> - / / Earlier bindings take precedence over later ones . <nl> - if ( seen . count ( it - > first ) ) continue ; <nl> - <nl> - seen . insert ( it - > first ) ; <nl> - if ( argnames ) argnames - > push_back ( it - > first ) ; <nl> - argvals - > push_back ( it - > second ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - struct new_scope_t { <nl> - explicit new_scope_t ( variable_scope_t < T > * _parent ) <nl> - : parent ( _parent ) <nl> - { <nl> - parent - > push ( ) ; <nl> - } <nl> - new_scope_t ( variable_scope_t < T > * _parent , const std : : string & name , const T & t ) <nl> - : parent ( _parent ) <nl> - { <nl> - parent - > push ( ) ; <nl> - parent - > put_in_scope ( name , t ) ; <nl> - } <nl> - ~ new_scope_t ( ) { <nl> - parent - > pop ( ) ; <nl> - } <nl> - <nl> - variable_scope_t < T > * parent ; <nl> - } ; <nl> - <nl> - RDB_MAKE_ME_SERIALIZABLE_1 ( scopes ) ; <nl> - <nl> - private : <nl> - std : : list < std : : map < std : : string , T > > scopes ; <nl> - } ; <nl> - <nl> / * an implicit_value_t allows for a specific implicit value to exist at certain <nl> * points in execution for example the argument to get attr is implicitly <nl> * defined to be the value of the row upon entering a filter , map etc . <nl>
Removed unused type variable_scope_t .
rethinkdb/rethinkdb
f08dad30ffa64fb5af906126ccbf3327c39e4ce8
2013-05-29T01:14:50Z
mmm a / modules / core / src / arithm . cpp <nl> ppp b / modules / core / src / arithm . cpp <nl> namespace cv <nl> <nl> static int actualScalarDepth ( const double * data , int len ) <nl> { <nl> - double minval = data [ 0 ] ; <nl> - double maxval = data [ 0 ] ; <nl> - for ( int i = 1 ; i < len ; + + i ) <nl> - { <nl> - minval = MIN ( minval , data [ i ] ) ; <nl> - maxval = MAX ( maxval , data [ i ] ) ; <nl> - } <nl> - <nl> - int depth = CV_64F ; <nl> - if ( minval > = 0 & & maxval < = UCHAR_MAX ) <nl> - depth = CV_8U ; <nl> - else if ( minval > = SCHAR_MIN & & maxval < = SCHAR_MAX ) <nl> - depth = CV_8S ; <nl> - else if ( minval > = 0 & & maxval < = USHRT_MAX ) <nl> - depth = CV_16U ; <nl> - else if ( minval > = SHRT_MIN & & maxval < = SHRT_MAX ) <nl> - depth = CV_16S ; <nl> - else if ( minval > = INT_MIN & & maxval < = INT_MAX ) <nl> - depth = CV_32S ; <nl> - else if ( minval > = - FLT_MAX & & maxval < = FLT_MAX ) <nl> - depth = CV_32F ; <nl> - return depth ; <nl> + int i = 0 , minval = INT_MAX , maxval = INT_MIN ; <nl> + for ( ; i < len ; + + i ) <nl> + { <nl> + int ival = cvRound ( data [ i ] ) ; <nl> + if ( ival ! = data [ i ] ) <nl> + break ; <nl> + minval = MIN ( minval , ival ) ; <nl> + maxval = MAX ( maxval , ival ) ; <nl> + } <nl> + return i < len ? CV_64F : <nl> + minval > = 0 & & maxval < = UCHAR_MAX ? CV_8U : <nl> + minval > = SCHAR_MIN & & maxval < = SCHAR_MAX ? CV_8S : <nl> + minval > = 0 & & maxval < = USHRT_MAX ? CV_16U : <nl> + minval > = SHRT_MIN & & maxval < = SHRT_MAX ? CV_16S : <nl> + CV_32S ; <nl> } <nl> <nl> static void arithm_op ( InputArray _src1 , InputArray _src2 , OutputArray _dst , <nl> static void arithm_op ( InputArray _src1 , InputArray _src2 , OutputArray _dst , <nl> <nl> bool haveScalar = false , swapped12 = false ; <nl> int depth2 = src2 . depth ( ) ; <nl> - if ( src1 . size ! = src2 . size | | src1 . channels ( ) ! = src2 . channels ( ) ) <nl> + if ( src1 . size ! = src2 . size | | src1 . channels ( ) ! = src2 . channels ( ) | | <nl> + ( ( kind1 = = _InputArray : : MATX | | kind2 = = _InputArray : : MATX ) & & <nl> + src1 . cols = = 1 & & src2 . rows = = 4 ) ) <nl> { <nl> if ( checkScalar ( src1 , src2 . type ( ) , kind1 , kind2 ) ) <nl> { <nl> static void arithm_op ( InputArray _src1 , InputArray _src2 , OutputArray _dst , <nl> haveScalar = true ; <nl> CV_Assert ( src2 . type ( ) = = CV_64F & & ( src2 . rows = = 4 | | src2 . rows = = 1 ) ) ; <nl> <nl> - if ( usrdata = = 0 ) / / hack to filter out multiply and divide <nl> + if ( ! muldiv ) <nl> + { <nl> depth2 = actualScalarDepth ( src2 . ptr < double > ( ) , src1 . channels ( ) ) ; <nl> + if ( depth2 = = CV_64F & & ( src1 . depth ( ) < CV_32S | | src1 . depth ( ) = = CV_32F ) ) <nl> + depth2 = CV_32F ; <nl> + } <nl> else <nl> - depth2 = CV_64F ; <nl> + depth2 = src1 . depth ( ) < CV_32S | | src1 . depth ( ) = = CV_32F ? CV_32F : CV_64F ; <nl> } <nl> <nl> int cn = src1 . channels ( ) , depth1 = src1 . depth ( ) , wtype ; <nl> mmm a / modules / core / test / test_operations . cpp <nl> ppp b / modules / core / test / test_operations . cpp <nl> class CV_OperationsTest : public cvtest : : BaseTest <nl> bool TestVec ( ) ; <nl> bool TestMatxMultiplication ( ) ; <nl> bool TestSubMatAccess ( ) ; <nl> + bool TestExp ( ) ; <nl> bool TestSVD ( ) ; <nl> bool operations1 ( ) ; <nl> <nl> bool CV_OperationsTest : : operations1 ( ) <nl> } <nl> <nl> <nl> + bool CV_OperationsTest : : TestExp ( ) <nl> + { <nl> + Mat1f tt = Mat1f : : ones ( 4 , 2 ) ; <nl> + Mat1f outs ; <nl> + exp ( - tt , outs ) ; <nl> + Mat1f tt2 = Mat1f : : ones ( 4 , 1 ) , outs2 ; <nl> + exp ( - tt2 , outs2 ) ; <nl> + return true ; <nl> + } <nl> + <nl> + <nl> bool CV_OperationsTest : : TestSVD ( ) <nl> { <nl> try <nl> void CV_OperationsTest : : run ( int / * start_from * / ) <nl> if ( ! TestSubMatAccess ( ) ) <nl> return ; <nl> <nl> + if ( ! TestExp ( ) ) <nl> + return ; <nl> + <nl> if ( ! TestSVD ( ) ) <nl> return ; <nl> <nl>
Merge pull request from vpisarev / bug_2447_2 . 4
opencv/opencv
634fedc3cb4f8dc18f7de1b45f63d53ee75f3e75
2012-10-18T09:28:01Z
mmm a / BUILD . gn <nl> ppp b / BUILD . gn <nl> action ( " js2c " ) { <nl> " src / js / macros . py " , <nl> " src / messages . h " , <nl> " src / js / prologue . js " , <nl> - " src / js / v8natives . js " , <nl> " src / js / array . js " , <nl> " src / js / typedarray . js " , <nl> " src / js / messages . js " , <nl> mmm a / src / ast / ast . h <nl> ppp b / src / ast / ast . h <nl> class CallNew final : public Expression { <nl> ZoneList < Expression * > * arguments_ ; <nl> } ; <nl> <nl> - <nl> / / The CallRuntime class does not represent any official JavaScript <nl> / / language construct . Instead it is used to call a C or JS function <nl> / / with a set of arguments . This is used from the builtins that are <nl> - / / implemented in JavaScript ( see " v8natives . js " ) . <nl> + / / implemented in JavaScript . <nl> class CallRuntime final : public Expression { <nl> public : <nl> ZoneList < Expression * > * arguments ( ) const { return arguments_ ; } <nl> mmm a / src / bootstrapper . cc <nl> ppp b / src / bootstrapper . cc <nl> void Genesis : : InitializeGlobal ( Handle < JSGlobalObject > global_object , <nl> true ) ; <nl> SimpleInstallFunction ( isolate - > initial_object_prototype ( ) , " hasOwnProperty " , <nl> Builtins : : kObjectPrototypeHasOwnProperty , 1 , true ) ; <nl> + SimpleInstallFunction ( isolate - > initial_object_prototype ( ) , " toLocaleString " , <nl> + Builtins : : kObjectPrototypeToLocaleString , 0 , true ) ; <nl> SimpleInstallFunction ( isolate - > initial_object_prototype ( ) , <nl> " __lookupGetter__ " , Builtins : : kObjectLookupGetter , 1 , <nl> true ) ; <nl> mmm a / src / builtins / builtins - definitions . h <nl> ppp b / src / builtins / builtins - definitions . h <nl> namespace internal { <nl> CPP ( ObjectPrototypePropertyIsEnumerable ) \ <nl> CPP ( ObjectPrototypeGetProto ) \ <nl> CPP ( ObjectPrototypeSetProto ) \ <nl> + / * ES # sec - object . prototype . tolocalestring * / \ <nl> + TFJ ( ObjectPrototypeToLocaleString , 0 ) \ <nl> CPP ( ObjectSeal ) \ <nl> CPP ( ObjectValues ) \ <nl> \ <nl> mmm a / src / builtins / builtins - object - gen . cc <nl> ppp b / src / builtins / builtins - object - gen . cc <nl> Node * ObjectBuiltinsAssembler : : ConstructDataDescriptor ( Node * context , <nl> return js_desc ; <nl> } <nl> <nl> + TF_BUILTIN ( ObjectPrototypeToLocaleString , CodeStubAssembler ) { <nl> + TNode < Context > context = CAST ( Parameter ( Descriptor : : kContext ) ) ; <nl> + TNode < Object > receiver = CAST ( Parameter ( Descriptor : : kReceiver ) ) ; <nl> + <nl> + Label if_null_or_undefined ( this , Label : : kDeferred ) ; <nl> + GotoIf ( IsNullOrUndefined ( receiver ) , & if_null_or_undefined ) ; <nl> + <nl> + TNode < Object > method = <nl> + CAST ( GetProperty ( context , receiver , factory ( ) - > toString_string ( ) ) ) ; <nl> + Return ( CallJS ( CodeFactory : : Call ( isolate ( ) ) , context , method , receiver ) ) ; <nl> + <nl> + BIND ( & if_null_or_undefined ) ; <nl> + ThrowTypeError ( context , MessageTemplate : : kCalledOnNullOrUndefined , <nl> + " Object . prototype . toLocaleString " ) ; <nl> + } <nl> + <nl> TF_BUILTIN ( ObjectPrototypeHasOwnProperty , ObjectBuiltinsAssembler ) { <nl> Node * object = Parameter ( Descriptor : : kReceiver ) ; <nl> Node * key = Parameter ( Descriptor : : kKey ) ; <nl> mmm a / src / js / prologue . js <nl> ppp b / src / js / prologue . js <nl> function PostNatives ( utils ) { <nl> utils . PostNatives = UNDEFINED ; <nl> } <nl> <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Object <nl> + <nl> + var iteratorSymbol = ImportNow ( " iterator_symbol " ) ; <nl> + <nl> + / / ES6 7 . 3 . 9 <nl> + function GetMethod ( obj , p ) { <nl> + var func = obj [ p ] ; <nl> + if ( IS_NULL_OR_UNDEFINED ( func ) ) return UNDEFINED ; <nl> + if ( IS_CALLABLE ( func ) ) return func ; <nl> + throw % make_type_error ( kCalledNonCallable , typeof func ) ; <nl> + } <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + / / Iterator related spec functions . <nl> + <nl> + / / ES6 7 . 4 . 1 GetIterator ( obj , method ) <nl> + function GetIterator ( obj , method ) { <nl> + if ( IS_UNDEFINED ( method ) ) { <nl> + method = obj [ iteratorSymbol ] ; <nl> + } <nl> + if ( ! IS_CALLABLE ( method ) ) { <nl> + throw % make_type_error ( kNotIterable , obj ) ; <nl> + } <nl> + var iterator = % _Call ( method , obj ) ; <nl> + if ( ! IS_RECEIVER ( iterator ) ) { <nl> + throw % make_type_error ( kNotAnIterator , iterator ) ; <nl> + } <nl> + return iterator ; <nl> + } <nl> + <nl> + <nl> + exports_container . GetIterator = GetIterator ; <nl> + exports_container . GetMethod = GetMethod ; <nl> + <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> <nl> % OptimizeObjectForAddingMultipleProperties ( utils , 14 ) ; <nl> deleted file mode 100644 <nl> index 26dada3759b . . 00000000000 <nl> mmm a / src / js / v8natives . js <nl> ppp / dev / null <nl> <nl> - / / Copyright 2012 the V8 project authors . All rights reserved . <nl> - / / Use of this source code is governed by a BSD - style license that can be <nl> - / / found in the LICENSE file . <nl> - <nl> - ( function ( global , utils ) { <nl> - <nl> - " use strict " ; <nl> - <nl> - % CheckIsBootstrapping ( ) ; <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Imports <nl> - <nl> - var GlobalObject = global . Object ; <nl> - var iteratorSymbol = utils . ImportNow ( " iterator_symbol " ) ; <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Object <nl> - <nl> - / / Set up non - enumerable functions on the Object . prototype object . <nl> - DEFINE_METHOD ( <nl> - GlobalObject . prototype , <nl> - / / ES6 19 . 1 . 3 . 5 Object . prototype . toLocaleString ( [ reserved1 [ , reserved2 ] ] ) <nl> - toLocaleString ( ) { <nl> - REQUIRE_OBJECT_COERCIBLE ( this , " Object . prototype . toLocaleString " ) ; <nl> - return this . toString ( ) ; <nl> - } <nl> - ) ; <nl> - <nl> - / / ES6 7 . 3 . 9 <nl> - function GetMethod ( obj , p ) { <nl> - var func = obj [ p ] ; <nl> - if ( IS_NULL_OR_UNDEFINED ( func ) ) return UNDEFINED ; <nl> - if ( IS_CALLABLE ( func ) ) return func ; <nl> - throw % make_type_error ( kCalledNonCallable , typeof func ) ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Iterator related spec functions . <nl> - <nl> - / / ES6 7 . 4 . 1 GetIterator ( obj , method ) <nl> - function GetIterator ( obj , method ) { <nl> - if ( IS_UNDEFINED ( method ) ) { <nl> - method = obj [ iteratorSymbol ] ; <nl> - } <nl> - if ( ! IS_CALLABLE ( method ) ) { <nl> - throw % make_type_error ( kNotIterable , obj ) ; <nl> - } <nl> - var iterator = % _Call ( method , obj ) ; <nl> - if ( ! IS_RECEIVER ( iterator ) ) { <nl> - throw % make_type_error ( kNotAnIterator , iterator ) ; <nl> - } <nl> - return iterator ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Exports <nl> - <nl> - utils . Export ( function ( to ) { <nl> - to . GetIterator = GetIterator ; <nl> - to . GetMethod = GetMethod ; <nl> - } ) ; <nl> - <nl> - } ) <nl> mmm a / src / v8 . gyp <nl> ppp b / src / v8 . gyp <nl> <nl> ' js / macros . py ' , <nl> ' messages . h ' , <nl> ' js / prologue . js ' , <nl> - ' js / v8natives . js ' , <nl> ' js / array . js ' , <nl> ' js / typedarray . js ' , <nl> ' js / messages . js ' , <nl> mmm a / test / cctest / test - serialize . cc <nl> ppp b / test / cctest / test - serialize . cc <nl> struct StartupBlobs { <nl> <nl> static StartupBlobs Serialize ( v8 : : Isolate * isolate ) { <nl> / / We have to create one context . One reason for this is so that the builtins <nl> - / / can be loaded from v8natives . js and their addresses can be processed . This <nl> - / / will clear the pending fixups array , which would otherwise contain GC roots <nl> - / / that would confuse the serialization / deserialization process . <nl> + / / can be loaded from self hosted JS builtins and their addresses can be <nl> + / / processed . This will clear the pending fixups array , which would otherwise <nl> + / / contain GC roots that would confuse the serialization / deserialization <nl> + / / process . <nl> v8 : : Isolate : : Scope isolate_scope ( isolate ) ; <nl> { <nl> v8 : : HandleScope scope ( isolate ) ; <nl>
[ builtins ] Port Object . p . toLocaleString to CSA from JS
v8/v8
ab38b03d1b330678577f9d6abbc14726db34c7f3
2017-12-15T06:18:19Z
mmm a / CMakeLists . txt <nl> ppp b / CMakeLists . txt <nl> if ( XCODE ) <nl> swift_common_xcode_cxx_config ( ) <nl> endif ( ) <nl> <nl> - function ( check_working_std_regex result_var_name ) <nl> - if ( " $ { CMAKE_SYSTEM_NAME } " STREQUAL " Darwin " ) <nl> - # Apple operating systems use libc + + , which has a working std : : regex . <nl> - set ( " $ { result_var_name } " TRUE PARENT_SCOPE ) <nl> - else ( ) <nl> - if ( CMAKE_CROSSCOMPILING ) <nl> - # Can ' t run C source when cross - compiling ; assume false until we have a static check . <nl> - set ( " $ { result_var_name } " FALSE PARENT_SCOPE ) <nl> - else ( ) <nl> - # libstdc + + 4 . 8 has an incomplete std : : regex implementation , and crashes <nl> - # on many regexes . <nl> - # libstdc + + 4 . 9 works . <nl> - set ( std_regex_test_source <nl> - " <nl> - # include < regex > <nl> - const std : : regex broken_regex { <nl> - \ " ( [ a ] + ) \ " , <nl> - std : : regex : : ECMAScript | std : : regex : : nosubs } ; <nl> - <nl> - int main ( ) { } <nl> - " ) <nl> - <nl> - check_cxx_source_runs ( " $ { std_regex_test_source } " " $ { result_var_name } _TEST " ) <nl> - if ( " $ { $ { result_var_name } _TEST } " ) <nl> - set ( " $ { result_var_name } " TRUE PARENT_SCOPE ) <nl> - else ( ) <nl> - set ( " $ { result_var_name } " FALSE PARENT_SCOPE ) <nl> - endif ( ) <nl> - endif ( ) <nl> - endif ( ) <nl> - endfunction ( ) <nl> - check_working_std_regex ( SWIFT_HAVE_WORKING_STD_REGEX ) <nl> + include ( SwiftCheckCXXNativeRegex ) <nl> + check_cxx_native_regex ( SWIFT_HAVE_WORKING_STD_REGEX ) <nl> <nl> # If SWIFT_HOST_VARIANT_SDK not given , try to detect from the CMAKE_SYSTEM_NAME . <nl> if ( SWIFT_HOST_VARIANT_SDK ) <nl> new file mode 100644 <nl> index 000000000000 . . 2e320bd8f9fb <nl> mmm / dev / null <nl> ppp b / cmake / modules / SwiftCheckCXXNativeRegex . cmake <nl> <nl> + function ( check_cxx_native_regex result_var_name ) <nl> + if ( " $ { CMAKE_SYSTEM_NAME } " STREQUAL " Darwin " ) <nl> + # Apple operating systems use libc + + , which has a working std : : regex . <nl> + set ( " $ { result_var_name } " TRUE PARENT_SCOPE ) <nl> + else ( ) <nl> + if ( CMAKE_CROSSCOMPILING ) <nl> + # Can ' t run C source when cross - compiling ; assume false until we have a static check . <nl> + set ( " $ { result_var_name } " FALSE PARENT_SCOPE ) <nl> + else ( ) <nl> + # libstdc + + 4 . 8 has an incomplete std : : regex implementation , and crashes <nl> + # on many regexes . <nl> + # libstdc + + 4 . 9 works . <nl> + set ( std_regex_test_source <nl> + " <nl> + # include < regex > <nl> + const std : : regex broken_regex { <nl> + \ " ( [ a ] + ) \ " , <nl> + std : : regex : : ECMAScript | std : : regex : : nosubs } ; <nl> + <nl> + int main ( ) { } <nl> + " ) <nl> + <nl> + check_cxx_source_runs ( " $ { std_regex_test_source } " " $ { result_var_name } _TEST " ) <nl> + if ( " $ { $ { result_var_name } _TEST } " ) <nl> + set ( " $ { result_var_name } " TRUE PARENT_SCOPE ) <nl> + else ( ) <nl> + set ( " $ { result_var_name } " FALSE PARENT_SCOPE ) <nl> + endif ( ) <nl> + endif ( ) <nl> + endif ( ) <nl> + endfunction ( ) <nl> + <nl>
Merge pull request from gottesmm / small_cmake_refactoring
apple/swift
1e2d192b61c9003d8b8a8593c2ef0fa6a524b8c0
2016-07-05T04:33:39Z
mmm a / fdbserver / TagPartitionedLogSystem . actor . cpp <nl> ppp b / fdbserver / TagPartitionedLogSystem . actor . cpp <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> } <nl> } <nl> <nl> - ACTOR static Future < Void > newRemoteEpoch ( TagPartitionedLogSystem * self , Reference < TagPartitionedLogSystem > oldLogSystem , Future < RecruitRemoteFromConfigurationReply > fRemoteWorkers , DatabaseConfiguration configuration , LogEpoch recoveryCount , uint16_t minTag , int8_t remoteLocality ) <nl> + ACTOR static Future < Void > newRemoteEpoch ( TagPartitionedLogSystem * self , Reference < TagPartitionedLogSystem > oldLogSystem , Future < RecruitRemoteFromConfigurationReply > fRemoteWorkers , DatabaseConfiguration configuration , LogEpoch recoveryCount , int8_t remoteLocality ) <nl> { <nl> TraceEvent ( " RemoteLogRecruitment_WaitingForWorkers " ) ; <nl> state RecruitRemoteFromConfigurationReply remoteWorkers = wait ( fRemoteWorkers ) ; <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> logSet - > hasBestPolicy = HasBestPolicyId ; <nl> logSet - > locality = remoteLocality ; <nl> <nl> - / / recruit temporary log routers and update registration with them <nl> - state int tempLogRouters = std : : max < int > ( remoteWorkers . logRouters . size ( ) , minTag + 1 ) ; <nl> state vector < Future < TLogInterface > > logRouterInitializationReplies ; <nl> - for ( int i = 0 ; i < tempLogRouters ; i + + ) { <nl> + for ( int i = 0 ; i < remoteWorkers . logRouters . size ( ) ; i + + ) { <nl> InitializeLogRouterRequest req ; <nl> req . recoveryCount = recoveryCount ; <nl> req . routerTag = Tag ( tagLocalityLogRouter , i ) ; <nl> req . logSet = self - > tLogs . size ( ) ; <nl> - logRouterInitializationReplies . push_back ( transformErrors ( throwErrorOr ( remoteWorkers . logRouters [ i % remoteWorkers . logRouters . size ( ) ] . logRouter . getReplyUnlessFailedFor ( req , SERVER_KNOBS - > TLOG_TIMEOUT , SERVER_KNOBS - > MASTER_FAILURE_SLOPE_DURING_RECOVERY ) ) , master_recovery_failed ( ) ) ) ; <nl> + logRouterInitializationReplies . push_back ( transformErrors ( throwErrorOr ( remoteWorkers . logRouters [ i ] . logRouter . getReplyUnlessFailedFor ( req , SERVER_KNOBS - > TLOG_TIMEOUT , SERVER_KNOBS - > MASTER_FAILURE_SLOPE_DURING_RECOVERY ) ) , master_recovery_failed ( ) ) ) ; <nl> } <nl> <nl> TraceEvent ( " RemoteLogRecruitment_RecruitingLogRouters " ) ; <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> filterLocalityDataForPolicy ( logSystem - > tLogs [ 0 ] - > tLogPolicy , & logSystem - > tLogs [ 0 ] - > tLogLocalities ) ; <nl> <nl> std : : vector < int > locations ; <nl> - state uint16_t minTag = 0 ; <nl> + state std : : vector < Tag > oldRouterTags ; <nl> for ( Tag tag : oldLogSystem - > getEpochEndTags ( ) ) { <nl> - minTag = std : : min ( minTag , tag . id ) ; <nl> - locations . clear ( ) ; <nl> - logSystem - > tLogs [ 0 ] - > getPushLocations ( vector < Tag > ( 1 , tag ) , locations , 0 ) ; <nl> - for ( int loc : locations ) <nl> - reqs [ loc ] . recoverTags . push_back ( tag ) ; <nl> + if ( tag . locality = = tagLocalityLogRouter ) { <nl> + oldRouterTags . push_back ( tag ) ; <nl> + } else { <nl> + locations . clear ( ) ; <nl> + logSystem - > tLogs [ 0 ] - > getPushLocations ( vector < Tag > ( 1 , tag ) , locations , 0 ) ; <nl> + for ( int loc : locations ) <nl> + reqs [ loc ] . recoverTags . push_back ( tag ) ; <nl> + } <nl> } <nl> <nl> for ( int i = 0 ; i < recr . tLogs . size ( ) ; i + + ) <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> filterLocalityDataForPolicy ( logSystem - > tLogs [ 1 ] - > tLogPolicy , & logSystem - > tLogs [ 1 ] - > tLogLocalities ) ; <nl> <nl> for ( Tag tag : oldLogSystem - > getEpochEndTags ( ) ) { <nl> - minTag = std : : min ( minTag , tag . id ) ; <nl> - locations . clear ( ) ; <nl> - logSystem - > tLogs [ 1 ] - > getPushLocations ( vector < Tag > ( 1 , tag ) , locations , 0 ) ; <nl> - for ( int loc : locations ) <nl> - sreqs [ loc ] . recoverTags . push_back ( tag ) ; <nl> + if ( tag . locality ! = tagLocalityLogRouter ) { <nl> + locations . clear ( ) ; <nl> + logSystem - > tLogs [ 1 ] - > getPushLocations ( vector < Tag > ( 1 , tag ) , locations , 0 ) ; <nl> + for ( int loc : locations ) <nl> + sreqs [ loc ] . recoverTags . push_back ( tag ) ; <nl> + } <nl> } <nl> <nl> for ( int i = 0 ; i < recr . satelliteTLogs . size ( ) ; i + + ) <nl> struct TagPartitionedLogSystem : ILogSystem , ReferenceCounted < TagPartitionedLogS <nl> <nl> if ( configuration . remoteTLogReplicationFactor > 0 ) { <nl> logSystem - > hasRemoteServers = true ; <nl> - logSystem - > remoteRecovery = TagPartitionedLogSystem : : newRemoteEpoch ( logSystem . getPtr ( ) , oldLogSystem , fRemoteWorkers , configuration , recoveryCount , minTag , remoteLocality ) ; <nl> + logSystem - > remoteRecovery = TagPartitionedLogSystem : : newRemoteEpoch ( logSystem . getPtr ( ) , oldLogSystem , fRemoteWorkers , configuration , recoveryCount , remoteLocality ) ; <nl> } else { <nl> logSystem - > hasRemoteServers = false ; <nl> logSystem - > remoteRecovery = logSystem - > recoveryComplete ; <nl> logSystem - > remoteRecoveryComplete = logSystem - > recoveryComplete ; <nl> } <nl> <nl> + for ( auto tag : oldRouterTags ) { <nl> + logSystem - > pop ( oldLogSystem - > epochEndVersion . get ( ) + 1 , tag ) ; <nl> + } <nl> + <nl> return logSystem ; <nl> } <nl> <nl> mmm a / fdbserver / masterserver . actor . cpp <nl> ppp b / fdbserver / masterserver . actor . cpp <nl> ACTOR Future < Void > trackTlogRecovery ( Reference < MasterData > self , Reference < Asyn <nl> state DBCoreState newState ; <nl> self - > logSystem - > toCoreState ( newState ) ; <nl> newState . recoveryCount = recoverCount ; <nl> - <nl> + state Future < Void > changed = self - > logSystem - > onCoreStateChanged ( ) ; <nl> ASSERT ( newState . tLogs [ 0 ] . tLogWriteAntiQuorum = = self - > configuration . tLogWriteAntiQuorum & & newState . tLogs [ 0 ] . tLogReplicationFactor = = self - > configuration . tLogReplicationFactor ) ; <nl> <nl> state bool finalUpdate = ! newState . oldTLogData . size ( ) & & newState . tLogs . size ( ) = = self - > configuration . expectedLogSets ( ) ; <nl> ACTOR Future < Void > trackTlogRecovery ( Reference < MasterData > self , Reference < Asyn <nl> return Void ( ) ; <nl> } <nl> <nl> - Void _ = wait ( self - > logSystem - > onCoreStateChanged ( ) ) ; <nl> + Void _ = wait ( changed ) ; <nl> } <nl> } <nl> <nl> mmm a / fdbserver / workloads / ConfigureDatabase . actor . cpp <nl> ppp b / fdbserver / workloads / ConfigureDatabase . actor . cpp <nl> struct ConfigureDatabaseWorkload : TestWorkload { <nl> / / TraceEvent ( " ConfigureTestConfigureBegin " ) . detail ( " newConfig " , newConfig ) ; <nl> int redundancy = g_random - > randomInt ( 0 , sizeof ( redundancies ) / sizeof ( redundancies [ 0 ] ) ) ; <nl> std : : string config = redundancies [ redundancy ] ; <nl> - if ( config = = " triple " & & g_simulator . physicalDatacenters > 2 ) { <nl> + if ( config = = " triple " & & g_simulator . physicalDatacenters = = 3 ) { <nl> config = " three_data_hall " ; <nl> } <nl> <nl>
fix : the master did not detect core state changes if it changed while writing
apple/foundationdb
9ea963ddd6452a1cc54613a3c96e446b2851bf20
2018-02-20T00:49:57Z
mmm a / Docker / config . ini <nl> ppp b / Docker / config . ini <nl> contracts - console = false <nl> https - client - validate - peers = 1 <nl> <nl> # The local IP and port to listen for incoming http connections ; set blank to disable . ( eosio : : http_plugin ) <nl> - http - server - address = 127 . 0 . 0 . 1 : 8888 <nl> + http - server - address = 0 . 0 . 0 . 0 : 8888 <nl> <nl> # The local IP and port to listen for incoming https connections ; leave blank to disable . ( eosio : : http_plugin ) <nl> # https - server - address = <nl>
Merge pull request from EOSIO / docker - config - fix
EOSIO/eos
7c5e6116a41eae8117ed193bd9935b8f447e6e1a
2018-06-02T18:40:34Z
mmm a / src / Makefile . am <nl> ppp b / src / Makefile . am <nl> nodist_libbitcoin_util_a_SOURCES = $ ( srcdir ) / obj / build . h <nl> # <nl> <nl> # bitcoind binary # <nl> + bitcoind_SOURCES = bitcoind . cpp <nl> + bitcoind_CPPFLAGS = $ ( BITCOIN_INCLUDES ) <nl> + bitcoind_LDFLAGS = $ ( RELDFLAGS ) $ ( AM_LDFLAGS ) $ ( LIBTOOL_APP_LDFLAGS ) <nl> + <nl> + if TARGET_WINDOWS <nl> + bitcoind_SOURCES + = bitcoind - res . rc <nl> + endif <nl> + <nl> bitcoind_LDADD = \ <nl> $ ( LIBBITCOIN_SERVER ) \ <nl> $ ( LIBBITCOIN_COMMON ) \ <nl> bitcoind_LDADD = \ <nl> if ENABLE_WALLET <nl> bitcoind_LDADD + = libbitcoin_wallet . a <nl> endif <nl> - bitcoind_SOURCES = bitcoind . cpp <nl> + <nl> + bitcoind_LDADD + = $ ( BOOST_LIBS ) $ ( BDB_LIBS ) $ ( SSL_LIBS ) $ ( CRYPTO_LIBS ) $ ( MINIUPNPC_LIBS ) <nl> # <nl> <nl> + # bitcoin - cli binary # <nl> + bitcoin_cli_SOURCES = bitcoin - cli . cpp <nl> + bitcoin_cli_CPPFLAGS = $ ( BITCOIN_INCLUDES ) <nl> + bitcoin_cli_LDFLAGS = $ ( RELDFLAGS ) $ ( AM_LDFLAGS ) $ ( LIBTOOL_APP_LDFLAGS ) <nl> + <nl> if TARGET_WINDOWS <nl> - bitcoind_SOURCES + = bitcoind - res . rc <nl> + bitcoin_cli_SOURCES + = bitcoin - cli - res . rc <nl> endif <nl> <nl> - bitcoind_LDADD + = $ ( BOOST_LIBS ) $ ( BDB_LIBS ) $ ( SSL_LIBS ) $ ( CRYPTO_LIBS ) $ ( MINIUPNPC_LIBS ) <nl> - bitcoind_CPPFLAGS = $ ( BITCOIN_INCLUDES ) <nl> - bitcoind_LDFLAGS = $ ( RELDFLAGS ) $ ( AM_LDFLAGS ) $ ( LIBTOOL_APP_LDFLAGS ) <nl> - <nl> - # bitcoin - cli binary # <nl> bitcoin_cli_LDADD = \ <nl> $ ( LIBBITCOIN_CLI ) \ <nl> $ ( LIBBITCOIN_UTIL ) \ <nl> - $ ( BOOST_LIBS ) \ <nl> - $ ( SSL_LIBS ) \ <nl> - $ ( CRYPTO_LIBS ) <nl> - <nl> - bitcoin_cli_SOURCES = \ <nl> - bitcoin - cli . cpp <nl> + $ ( LIBSECP256K1 ) <nl> <nl> - bitcoin_cli_CPPFLAGS = $ ( BITCOIN_INCLUDES ) <nl> + bitcoin_cli_LDADD + = $ ( BOOST_LIBS ) $ ( SSL_LIBS ) $ ( CRYPTO_LIBS ) <nl> # <nl> <nl> # bitcoin - tx binary # <nl> + bitcoin_tx_SOURCES = bitcoin - tx . cpp <nl> + bitcoin_tx_CPPFLAGS = $ ( BITCOIN_INCLUDES ) <nl> + bitcoin_tx_LDFLAGS = $ ( RELDFLAGS ) $ ( AM_LDFLAGS ) $ ( LIBTOOL_APP_LDFLAGS ) <nl> + <nl> bitcoin_tx_LDADD = \ <nl> $ ( LIBBITCOIN_UNIVALUE ) \ <nl> $ ( LIBBITCOIN_COMMON ) \ <nl> $ ( LIBBITCOIN_UTIL ) \ <nl> $ ( LIBBITCOIN_CRYPTO ) \ <nl> - $ ( LIBSECP256K1 ) \ <nl> - $ ( BOOST_LIBS ) \ <nl> - $ ( CRYPTO_LIBS ) <nl> + $ ( LIBSECP256K1 ) <nl> <nl> - bitcoin_tx_SOURCES = bitcoin - tx . cpp <nl> - bitcoin_tx_CPPFLAGS = $ ( BITCOIN_INCLUDES ) <nl> + bitcoin_tx_LDADD + = $ ( BOOST_LIBS ) $ ( CRYPTO_LIBS ) <nl> # <nl> - bitcoin_tx_LDFLAGS = $ ( RELDFLAGS ) $ ( AM_LDFLAGS ) $ ( LIBTOOL_APP_LDFLAGS ) <nl> - <nl> - if TARGET_WINDOWS <nl> - bitcoin_cli_SOURCES + = bitcoin - cli - res . rc <nl> - endif <nl> - bitcoin_cli_LDFLAGS = $ ( RELDFLAGS ) $ ( AM_LDFLAGS ) $ ( LIBTOOL_APP_LDFLAGS ) <nl> <nl> + # bitcoinconsensus library # <nl> if BUILD_BITCOIN_LIBS <nl> include_HEADERS = script / bitcoinconsensus . h <nl> libbitcoinconsensus_la_SOURCES = \ <nl> endif <nl> libbitcoinconsensus_la_LDFLAGS = - no - undefined $ ( RELDFLAGS ) <nl> libbitcoinconsensus_la_LIBADD = $ ( CRYPTO_LIBS ) <nl> libbitcoinconsensus_la_CPPFLAGS = $ ( CRYPTO_CFLAGS ) - I $ ( builddir ) / obj - DBUILD_BITCOIN_INTERNAL <nl> + <nl> if USE_LIBSECP256K1 <nl> libbitcoinconsensus_la_LIBADD + = secp256k1 / libsecp256k1 . la <nl> endif <nl> endif <nl> + # <nl> <nl> CLEANFILES = leveldb / libleveldb . a leveldb / libmemenv . a * . gcda * . gcno <nl> <nl>
Format build flags in src / Makefile . am .
bitcoin/bitcoin
72ac792b4a544048261f35af859c7bb6d8bdb7a0
2015-01-29T21:43:30Z
mmm a / xbmc / filesystem / DirectoryFactory . cpp <nl> ppp b / xbmc / filesystem / DirectoryFactory . cpp <nl> IDirectory * CDirectoryFactory : : Create ( const CURL & url ) <nl> if ( CWinLibraryDirectory : : IsValid ( url ) ) return new CWinLibraryDirectory ( ) ; <nl> # endif <nl> <nl> - bool networkAvailable = CServiceBroker : : GetNetwork ( ) . IsAvailable ( ) ; <nl> - if ( networkAvailable ) <nl> - { <nl> - if ( url . IsProtocol ( " ftp " ) | | url . IsProtocol ( " ftps " ) ) return new CFTPDirectory ( ) ; <nl> - if ( url . IsProtocol ( " http " ) | | url . IsProtocol ( " https " ) ) return new CHTTPDirectory ( ) ; <nl> - if ( url . IsProtocol ( " dav " ) | | url . IsProtocol ( " davs " ) ) return new CDAVDirectory ( ) ; <nl> + if ( url . IsProtocol ( " ftp " ) | | url . IsProtocol ( " ftps " ) ) return new CFTPDirectory ( ) ; <nl> + if ( url . IsProtocol ( " http " ) | | url . IsProtocol ( " https " ) ) return new CHTTPDirectory ( ) ; <nl> + if ( url . IsProtocol ( " dav " ) | | url . IsProtocol ( " davs " ) ) return new CDAVDirectory ( ) ; <nl> # ifdef HAS_FILESYSTEM_SMB <nl> # ifdef TARGET_WINDOWS <nl> - if ( url . IsProtocol ( " smb " ) ) return new CWin32SMBDirectory ( ) ; <nl> + if ( url . IsProtocol ( " smb " ) ) return new CWin32SMBDirectory ( ) ; <nl> # else <nl> - if ( url . IsProtocol ( " smb " ) ) return new CSMBDirectory ( ) ; <nl> + if ( url . IsProtocol ( " smb " ) ) return new CSMBDirectory ( ) ; <nl> # endif <nl> # endif <nl> # ifdef HAS_UPNP <nl> - if ( url . IsProtocol ( " upnp " ) ) return new CUPnPDirectory ( ) ; <nl> + if ( url . IsProtocol ( " upnp " ) ) return new CUPnPDirectory ( ) ; <nl> # endif <nl> - if ( url . IsProtocol ( " rss " ) | | url . IsProtocol ( " rsss " ) ) return new CRSSDirectory ( ) ; <nl> + if ( url . IsProtocol ( " rss " ) | | url . IsProtocol ( " rsss " ) ) return new CRSSDirectory ( ) ; <nl> # ifdef HAS_ZEROCONF <nl> - if ( url . IsProtocol ( " zeroconf " ) ) return new CZeroconfDirectory ( ) ; <nl> + if ( url . IsProtocol ( " zeroconf " ) ) return new CZeroconfDirectory ( ) ; <nl> # endif <nl> # ifdef HAS_FILESYSTEM_NFS <nl> - if ( url . IsProtocol ( " nfs " ) ) return new CNFSDirectory ( ) ; <nl> + if ( url . IsProtocol ( " nfs " ) ) return new CNFSDirectory ( ) ; <nl> # endif <nl> - } <nl> <nl> if ( url . IsProtocol ( " pvr " ) ) <nl> return new CPVRDirectory ( ) ; <nl> IDirectory * CDirectoryFactory : : Create ( const CURL & url ) <nl> } <nl> } <nl> <nl> - CLog : : Log ( LOGWARNING , " % s - % sunsupported protocol ( % s ) in % s " , __FUNCTION__ , networkAvailable ? " " : " Network down or " , url . GetProtocol ( ) . c_str ( ) , url . GetRedacted ( ) . c_str ( ) ) ; <nl> + CLog : : Log ( LOGWARNING , " % s - unsupported protocol ( % s ) in % s " , __FUNCTION__ , url . GetProtocol ( ) . c_str ( ) , url . GetRedacted ( ) . c_str ( ) ) ; <nl> return NULL ; <nl> } <nl> <nl> mmm a / xbmc / filesystem / FileFactory . cpp <nl> ppp b / xbmc / filesystem / FileFactory . cpp <nl> IFile * CFileFactory : : CreateLoader ( const CURL & url ) <nl> else if ( CWinLibraryFile : : IsValid ( url ) ) return new CWinLibraryFile ( ) ; <nl> # endif <nl> <nl> - bool networkAvailable = CServiceBroker : : GetNetwork ( ) . IsAvailable ( ) ; <nl> - if ( networkAvailable ) <nl> - { <nl> - if ( url . IsProtocol ( " ftp " ) <nl> - | | url . IsProtocol ( " ftps " ) <nl> - | | url . IsProtocol ( " rss " ) <nl> - | | url . IsProtocol ( " rsss " ) <nl> - | | url . IsProtocol ( " http " ) <nl> - | | url . IsProtocol ( " https " ) ) return new CCurlFile ( ) ; <nl> - else if ( url . IsProtocol ( " dav " ) | | url . IsProtocol ( " davs " ) ) return new CDAVFile ( ) ; <nl> - else if ( url . IsProtocol ( " shout " ) ) return new CShoutcastFile ( ) ; <nl> + if ( url . IsProtocol ( " ftp " ) <nl> + | | url . IsProtocol ( " ftps " ) <nl> + | | url . IsProtocol ( " rss " ) <nl> + | | url . IsProtocol ( " rsss " ) <nl> + | | url . IsProtocol ( " http " ) <nl> + | | url . IsProtocol ( " https " ) ) return new CCurlFile ( ) ; <nl> + else if ( url . IsProtocol ( " dav " ) | | url . IsProtocol ( " davs " ) ) return new CDAVFile ( ) ; <nl> + else if ( url . IsProtocol ( " shout " ) ) return new CShoutcastFile ( ) ; <nl> # ifdef HAS_FILESYSTEM_SMB <nl> # ifdef TARGET_WINDOWS <nl> - else if ( url . IsProtocol ( " smb " ) ) return new CWin32SMBFile ( ) ; <nl> + else if ( url . IsProtocol ( " smb " ) ) return new CWin32SMBFile ( ) ; <nl> # else <nl> - else if ( url . IsProtocol ( " smb " ) ) return new CSMBFile ( ) ; <nl> + else if ( url . IsProtocol ( " smb " ) ) return new CSMBFile ( ) ; <nl> # endif <nl> # endif <nl> # ifdef HAS_FILESYSTEM_NFS <nl> - else if ( url . IsProtocol ( " nfs " ) ) return new CNFSFile ( ) ; <nl> + else if ( url . IsProtocol ( " nfs " ) ) return new CNFSFile ( ) ; <nl> # endif <nl> # ifdef HAS_UPNP <nl> - else if ( url . IsProtocol ( " upnp " ) ) return new CUPnPFile ( ) ; <nl> + else if ( url . IsProtocol ( " upnp " ) ) return new CUPnPFile ( ) ; <nl> # endif <nl> - } <nl> <nl> - CLog : : Log ( LOGWARNING , " % s - % sunsupported protocol ( % s ) in % s " , __FUNCTION__ , networkAvailable ? " " : " Network down or " , url . GetProtocol ( ) . c_str ( ) , url . GetRedacted ( ) . c_str ( ) ) ; <nl> + CLog : : Log ( LOGWARNING , " % s - unsupported protocol ( % s ) in % s " , __FUNCTION__ , url . GetProtocol ( ) . c_str ( ) , url . GetRedacted ( ) . c_str ( ) ) ; <nl> return NULL ; <nl> } <nl>
Merge pull request from Rechi / fix / fsFactory
xbmc/xbmc
101e80619a294481dfe301baf7f7c306771b0313
2018-11-26T16:50:21Z
mmm a / plugins / chain_plugin / include / eos / chain_plugin / chain_plugin . hpp <nl> ppp b / plugins / chain_plugin / include / eos / chain_plugin / chain_plugin . hpp <nl> class read_only { <nl> : signed_block ( b ) , <nl> id ( b . id ( ) ) , <nl> block_num ( b . block_num ( ) ) , <nl> - refBlockPrefix ( id . _hash [ 1 ] ) <nl> + ref_block_prefix ( id . _hash [ 1 ] ) <nl> { } <nl> <nl> chain : : block_id_type id ; <nl> uint32_t block_num = 0 ; <nl> - uint32_t refBlockPrefix = 0 ; <nl> + uint32_t ref_block_prefix = 0 ; <nl> } ; <nl> <nl> get_block_results get_block ( const get_block_params & params ) const ; <nl> FC_REFLECT ( eosio : : chain_apis : : read_only : : get_info_results , <nl> ( recent_slots ) ( participation_rate ) ) <nl> FC_REFLECT ( eosio : : chain_apis : : read_only : : get_block_params , ( block_num_or_id ) ) <nl> <nl> - FC_REFLECT_DERIVED ( eosio : : chain_apis : : read_only : : get_block_results , ( eosio : : chain : : signed_block ) , ( id ) ( block_num ) ( refBlockPrefix ) ) ; <nl> + FC_REFLECT_DERIVED ( eosio : : chain_apis : : read_only : : get_block_results , ( eosio : : chain : : signed_block ) , ( id ) ( block_num ) ( ref_block_prefix ) ) ; <nl> FC_REFLECT ( eosio : : chain_apis : : read_write : : push_transaction_results , ( transaction_id ) ( processed ) ) <nl> <nl> FC_REFLECT ( eosio : : chain_apis : : read_only : : get_table_rows_params , ( json ) ( table_key ) ( scope ) ( code ) ( table ) ( lower_bound ) ( upper_bound ) ( limit ) ) <nl>
Merge pull request from EOSIO / ref - block - prefix - 728
EOSIO/eos
e5b65f791c747ecf5da49b93fc33bd5eb8e5516d
2017-11-18T00:28:51Z
mmm a / tensorflow / python / ops / embedding_ops . py <nl> ppp b / tensorflow / python / ops / embedding_ops . py <nl> <nl> from tensorflow . python . ops import variables <nl> from tensorflow . python . ops . ragged import ragged_functional_ops <nl> from tensorflow . python . ops . ragged import ragged_tensor <nl> - from tensorflow . python . platform import tf_logging as logging <nl> from tensorflow . python . util . tf_export import tf_export <nl> <nl> <nl> def embedding_lookup ( <nl> name = None , <nl> validate_indices = True , # pylint : disable = unused - argument <nl> max_norm = None ) : <nl> - " " " Looks up ` ids ` in a list of embedding tensors . <nl> + " " " Looks up embeddings for the given ` ids ` from a list of tensors . <nl> <nl> This function is used to perform parallel lookups on the list of tensors in <nl> ` params ` . It is a generalization of ` tf . gather ` , where ` params ` is <nl> def embedding_lookup ( <nl> <nl> @ tf_export ( " nn . embedding_lookup " , v1 = [ ] ) <nl> def embedding_lookup_v2 ( params , ids , max_norm = None , name = None ) : <nl> - " " " Looks up ` ids ` in a list of embedding tensors . <nl> + " " " Looks up embeddings for the given ` ids ` from a list of tensors . <nl> <nl> - This function is used to perform parallel lookups on the list of <nl> - tensors in ` params ` . It is a generalization of <nl> - ` tf . gather ` , where ` params ` is <nl> - interpreted as a partitioning of a large embedding tensor . ` params ` may be <nl> - a ` PartitionedVariable ` as returned by using ` tf . compat . v1 . get_variable ( ) ` <nl> - with a <nl> - partitioner . <nl> - <nl> - If ` len ( params ) > 1 ` , each element ` id ` of ` ids ` is partitioned between <nl> - the elements of ` params ` according to the ` partition_strategy ` . <nl> - In all strategies , if the id space does not evenly divide the number of <nl> - partitions , each of the first ` ( max_id + 1 ) % len ( params ) ` partitions will <nl> - be assigned one more id . <nl> + This function is used to perform parallel lookups on the list of tensors in <nl> + ` params ` . It is a generalization of ` tf . gather ` , where ` params ` is <nl> + interpreted as a partitioning of a large embedding tensor . <nl> <nl> - The ` partition_strategy ` is always ` " div " ` currently . This means that we <nl> + If ` len ( params ) > 1 ` , each element ` id ` of ` ids ` is partitioned between the <nl> + elements of ` params ` according to the " div " partition strategy , which means we <nl> assign ids to partitions in a contiguous manner . For instance , 13 ids are <nl> split across 5 partitions as : <nl> - ` [ [ 0 , 1 , 2 ] , [ 3 , 4 , 5 ] , [ 6 , 7 , 8 ] , [ 9 , 10 ] , [ 11 , 12 ] ] ` <nl> + ` [ [ 0 , 1 , 2 ] , [ 3 , 4 , 5 ] , [ 6 , 7 , 8 ] , [ 9 , 10 ] , [ 11 , 12 ] ] ` . <nl> + <nl> + If the id space does not evenly divide the number of partitions , each of the <nl> + first ` ( max_id + 1 ) % len ( params ) ` partitions will be assigned one more id . <nl> <nl> The results of the lookup are concatenated into a dense <nl> tensor . The returned tensor has shape ` shape ( ids ) + shape ( params ) [ 1 : ] ` . <nl> <nl> Args : <nl> params : A single tensor representing the complete embedding tensor , or a <nl> - list of P tensors all of same shape except for the first dimension , <nl> - representing sharded embedding tensors . Alternatively , a <nl> - ` PartitionedVariable ` , created by partitioning along dimension 0 . Each <nl> - element must be appropriately sized for the ' div ' ` partition_strategy ` . <nl> + list of tensors all of same shape except for the first dimension , <nl> + representing sharded embedding tensors following " div " partition strategy . <nl> ids : A ` Tensor ` with type ` int32 ` or ` int64 ` containing the ids to be looked <nl> up in ` params ` . <nl> max_norm : If not ` None ` , each embedding is clipped if its l2 - norm is larger <nl> def embedding_lookup_v2 ( params , ids , max_norm = None , name = None ) : <nl> Returns : <nl> A ` Tensor ` with the same type as the tensors in ` params ` . <nl> <nl> + For instance , if ` params ` is a 5x2 matrix : <nl> + <nl> + ` ` ` python <nl> + [ [ 1 , 2 ] , [ 3 , 4 ] , [ 5 , 6 ] , [ 7 , 8 ] , [ 9 , 10 ] ] <nl> + ` ` ` <nl> + <nl> + or a list of matrices : <nl> + <nl> + ` ` ` python <nl> + params [ 0 ] : [ [ 1 , 2 ] , [ 3 , 4 ] ] <nl> + params [ 1 ] : [ [ 5 , 6 ] , [ 7 , 8 ] ] <nl> + params [ 2 ] : [ [ 9 , 10 ] ] <nl> + ` ` ` <nl> + <nl> + and ` ids ` is : <nl> + <nl> + ` ` ` python <nl> + [ 0 , 3 , 4 ] <nl> + ` ` ` <nl> + <nl> + The output will be a 3x2 matrix : <nl> + <nl> + ` ` ` python <nl> + [ [ 1 , 2 ] , [ 7 , 8 ] , [ 9 , 10 ] ] <nl> + ` ` ` <nl> + <nl> Raises : <nl> ValueError : If ` params ` is empty . <nl> " " " <nl> def embedding_lookup_sparse ( params , <nl> name = None , <nl> combiner = None , <nl> max_norm = None ) : <nl> - " " " Computes embeddings for the given ids and weights . <nl> + " " " Looks up embeddings for the given ids and weights from a list of tensors . <nl> <nl> This op assumes that there is at least one id for each row in the dense tensor <nl> represented by sp_ids ( i . e . there are no rows with empty features ) , and that <nl> all the indices of sp_ids are in canonical row - major order . <nl> <nl> + ` sp_ids ` and ` sp_weights ` ( if not None ) are ` SparseTensor ` s with rank of 2 . <nl> + Embeddings are always aggregated along the last dimension . <nl> + <nl> It also assumes that all id values lie in the range [ 0 , p0 ) , where p0 <nl> is the sum of the size of params along dimension 0 . <nl> <nl> Args : <nl> params : A single tensor representing the complete embedding tensor , or a <nl> - list of P tensors all of same shape except for the first dimension , <nl> - representing sharded embedding tensors . Alternatively , a <nl> + list tensors all of same shape except for the first dimension , <nl> + representing sharded embedding tensors . Alternatively , a <nl> ` PartitionedVariable ` , created by partitioning along dimension 0 . Each <nl> element must be appropriately sized for the given ` partition_strategy ` . <nl> sp_ids : N x M ` SparseTensor ` of int64 ids where N is typically batch size <nl> def embedding_lookup_sparse ( params , <nl> and " sum " are supported . " sum " computes the weighted sum of the embedding <nl> results for each row . " mean " is the weighted sum divided by the total <nl> weight . " sqrtn " is the weighted sum divided by the square root of the sum <nl> - of the squares of the weights . <nl> + of the squares of the weights . Defaults to ` mean ` . <nl> max_norm : If not ` None ` , each embedding is clipped if its l2 - norm is larger <nl> than this value , before combining . <nl> <nl> def embedding_lookup_sparse ( params , <nl> <nl> and <nl> <nl> - ` shape ( sp_ids ) = shape ( sp_weights ) = [ d0 , d1 , . . . , dn ] ` <nl> + ` shape ( sp_ids ) = shape ( sp_weights ) = [ d0 , d1 ] ` <nl> <nl> then <nl> <nl> - ` shape ( output ) = [ d0 , d1 , . . . , dn - 1 , p1 , . . . , pm ] ` . <nl> + ` shape ( output ) = [ d0 , p1 , . . . , pm ] ` . <nl> <nl> For instance , if params is a 10x20 matrix , and sp_ids / sp_weights are <nl> <nl> def embedding_lookup_sparse ( params , <nl> ValueError : If ` combiner ` is not one of { " mean " , " sqrtn " , " sum " } . <nl> " " " <nl> if combiner is None : <nl> - logging . warn ( " The default value of combiner will change from \ " mean \ " " <nl> - " to \ " sqrtn \ " after 2016 / 11 / 01 . " ) <nl> combiner = " mean " <nl> if combiner not in ( " mean " , " sqrtn " , " sum " ) : <nl> raise ValueError ( " combiner must be one of ' mean ' , ' sqrtn ' or ' sum ' " ) <nl> def embedding_lookup_sparse_v2 ( params , <nl> combiner = None , <nl> max_norm = None , <nl> name = None ) : <nl> - " " " Computes embeddings for the given ids and weights . <nl> + " " " Looks up embeddings for the given ids and weights from a list of tensors . <nl> <nl> This op assumes that there is at least one id for each row in the dense tensor <nl> represented by sp_ids ( i . e . there are no rows with empty features ) , and that <nl> all the indices of sp_ids are in canonical row - major order . <nl> <nl> + ` sp_ids ` and ` sp_weights ` ( if not None ) are ` SparseTensor ` s with rank of 2 . <nl> + Embeddings are always aggregated along the last dimension . <nl> + <nl> It also assumes that all id values lie in the range [ 0 , p0 ) , where p0 <nl> is the sum of the size of params along dimension 0 . <nl> <nl> + If ` len ( params ) > 1 ` , each element of ` sp_ids ` is partitioned between the <nl> + elements of ` params ` according to the " div " partition strategy , which means we <nl> + assign ids to partitions in a contiguous manner . For instance , 13 ids are <nl> + split across 5 partitions as : <nl> + ` [ [ 0 , 1 , 2 ] , [ 3 , 4 , 5 ] , [ 6 , 7 , 8 ] , [ 9 , 10 ] , [ 11 , 12 ] ] ` . <nl> + <nl> + If the id space does not evenly divide the number of partitions , each of the <nl> + first ` ( max_id + 1 ) % len ( params ) ` partitions will be assigned one more id . <nl> + <nl> Args : <nl> params : A single tensor representing the complete embedding tensor , or a <nl> - list of P tensors all of same shape except for the first dimension , <nl> - representing sharded embedding tensors . Alternatively , a <nl> - ` PartitionedVariable ` , created by partitioning along dimension 0 . Each <nl> - element must be appropriately sized for ` ` " div " ` ` ` partition_strategy ` . <nl> + list of tensors all of same shape except for the first dimension , <nl> + representing sharded embedding tensors following " div " partition strategy . <nl> sp_ids : N x M ` SparseTensor ` of int64 ids where N is typically batch size <nl> and M is arbitrary . <nl> sp_weights : either a ` SparseTensor ` of float / double weights , or ` None ` to <nl> def embedding_lookup_sparse_v2 ( params , <nl> and " sum " are supported . " sum " computes the weighted sum of the embedding <nl> results for each row . " mean " is the weighted sum divided by the total <nl> weight . " sqrtn " is the weighted sum divided by the square root of the sum <nl> - of the squares of the weights . <nl> + of the squares of the weights . Defaults to ` mean ` . <nl> max_norm : If not ` None ` , each embedding is clipped if its l2 - norm is larger <nl> than this value , before combining . <nl> name : Optional name for the op . <nl> def embedding_lookup_sparse_v2 ( params , <nl> <nl> and <nl> <nl> - ` shape ( sp_ids ) = shape ( sp_weights ) = [ d0 , d1 , . . . , dn ] ` <nl> + ` shape ( sp_ids ) = shape ( sp_weights ) = [ d0 , d1 ] ` <nl> <nl> then <nl> <nl> - ` shape ( output ) = [ d0 , d1 , . . . , dn - 1 , p1 , . . . , pm ] ` . <nl> + ` shape ( output ) = [ d0 , p1 , . . . , pm ] ` . <nl> <nl> For instance , if params is a 10x20 matrix , and sp_ids / sp_weights are <nl> <nl> def safe_embedding_lookup_sparse_v2 ( embedding_weights , <nl> <nl> The partitioned embedding in ` embedding_weights ` must all be the same shape <nl> except for the first dimension . The first dimension is allowed to vary as the <nl> - vocabulary size is not necessarily a multiple of ` P ` . ` embedding_weights ` <nl> - may be a ` PartitionedVariable ` as returned by using <nl> - ` tf . compat . v1 . get_variable ( ) ` with a <nl> - partitioner . <nl> + vocabulary size is not necessarily a multiple of num of shards . <nl> <nl> Invalid IDs ( < 0 ) are pruned from input IDs and weights , as well as any IDs <nl> with non - positive weight . For an entry with no features , the embedding vector <nl> def safe_embedding_lookup_sparse_v2 ( embedding_weights , <nl> The ids and weights may be multi - dimensional . Embeddings are always aggregated <nl> along the last dimension . <nl> <nl> - Note : when doing embedding lookup on ` embedding_weights ` , " div " partition <nl> - strategy will be used . Support for other partition strategy will be added <nl> - later . <nl> + If ` len ( embedding_weights ) > 1 ` , each element ` id ` of ` ids ` is partitioned <nl> + between the elements of ` embedding_weights ` according to the " div " partition <nl> + strategy , which means we assign ids to partitions in a contiguous manner . For <nl> + instance , 13 ids are split across 5 partitions as : <nl> + ` [ [ 0 , 1 , 2 ] , [ 3 , 4 , 5 ] , [ 6 , 7 , 8 ] , [ 9 , 10 ] , [ 11 , 12 ] ] ` . <nl> + <nl> + If the id space does not evenly divide the number of partitions , each of the <nl> + first ` ( max_id + 1 ) % len ( embedding_weights ) ` partitions will be assigned one <nl> + more id . <nl> <nl> Args : <nl> - embedding_weights : A list of ` P ` float ` Tensor ` s or values representing <nl> - partitioned embedding ` Tensor ` s . Alternatively , a ` PartitionedVariable ` <nl> - created by partitioning along dimension 0 . The total unpartitioned shape <nl> - should be ` [ e_0 , e_1 , . . . , e_m ] ` , where ` e_0 ` represents the vocab size <nl> - and ` e_1 , . . . , e_m ` are the embedding dimensions . <nl> + embedding_weights : A single tensor representing the complete embedding <nl> + tensor , or a list of tensors all of same shape except for the first <nl> + dimension , representing sharded embedding tensors following " div " <nl> + partition strategy . <nl> sparse_ids : ` SparseTensor ` of shape ` [ d_0 , d_1 , . . . , d_n ] ` containing the <nl> ids . ` d_0 ` is typically batch size . <nl> sparse_weights : ` SparseTensor ` of same shape as ` sparse_ids ` , containing <nl> def safe_embedding_lookup_sparse_v2 ( embedding_weights , <nl> combiner : A string specifying how to combine embedding results for each <nl> entry . Currently " mean " , " sqrtn " and " sum " are supported , with " mean " the <nl> default . <nl> - default_id : The id to use for an entry with no features . <nl> + default_id : The id to use for an entry with no features . Defaults to <nl> + 0 - vector . <nl> max_norm : If not ` None ` , all embeddings are l2 - normalized to max_norm before <nl> combining . <nl> name : A name for this operation ( optional ) . <nl> <nl> Returns : <nl> - Dense ` Tensor ` of shape ` [ d_0 , d_1 , . . . , d_ { n - 1 } , e_1 , . . . , e_m ] ` . <nl> + A dense tensor representing the combined embeddings for the <nl> + sparse ids . For each row in the dense tensor represented by ` sparse_ids ` , <nl> + the op looks up the embeddings for all ids in that row , multiplies them by <nl> + the corresponding weight , and combines these embeddings as specified . <nl> + <nl> + In other words , if <nl> + <nl> + ` shape ( combined embedding_weights ) = [ p0 , p1 , . . . , pm ] ` <nl> + <nl> + and <nl> + <nl> + ` shape ( sparse_ids ) = shape ( sparse_weights ) = [ d0 , d1 , . . . , dn ] ` <nl> + <nl> + then <nl> + <nl> + ` shape ( output ) = [ d0 , d1 , . . . dn - 1 , p1 , . . . , pm ] ` . <nl> + <nl> + For instance , if params is a 10x20 matrix , and sp_ids / sp_weights are <nl> + <nl> + ` ` ` python <nl> + [ 0 , 0 ] : id 1 , weight 2 . 0 <nl> + [ 0 , 1 ] : id 3 , weight 0 . 5 <nl> + [ 1 , 0 ] : id - 1 , weight 1 . 0 <nl> + [ 2 , 3 ] : id 1 , weight 3 . 0 <nl> + ` ` ` <nl> + <nl> + ` default_id ` is 0 . <nl> + <nl> + with ` combiner ` = " mean " , then the output will be a 3x20 matrix where <nl> + <nl> + ` ` ` python <nl> + output [ 0 , : ] = ( params [ 1 , : ] * 2 . 0 + params [ 3 , : ] * 0 . 5 ) / ( 2 . 0 + 0 . 5 ) <nl> + output [ 1 , : ] = ( params [ 0 , : ] * 1 . 0 ) / 1 . 0 <nl> + output [ 2 , : ] = ( params [ 1 , : ] * 3 . 0 ) / 3 . 0 <nl> + ` ` ` <nl> <nl> Raises : <nl> ValueError : if ` embedding_weights ` is empty . <nl> def safe_embedding_lookup_sparse ( embedding_weights , <nl> along the last dimension . <nl> <nl> Args : <nl> - embedding_weights : A list of ` P ` float ` Tensor ` s or values representing <nl> - partitioned embedding ` Tensor ` s . Alternatively , a ` PartitionedVariable ` <nl> - created by partitioning along dimension 0 . The total unpartitioned shape <nl> - should be ` [ e_0 , e_1 , . . . , e_m ] ` , where ` e_0 ` represents the vocab size <nl> - and ` e_1 , . . . , e_m ` are the embedding dimensions . <nl> + embedding_weights : A single tensor representing the complete embedding <nl> + tensor , or a list tensors all of same shape except for the first <nl> + dimension , representing sharded embedding tensors . Alternatively , a <nl> + ` PartitionedVariable ` , created by partitioning along dimension 0 . Each <nl> + element must be appropriately sized for the given ` partition_strategy ` . <nl> sparse_ids : ` SparseTensor ` of shape ` [ d_0 , d_1 , . . . , d_n ] ` containing the <nl> ids . ` d_0 ` is typically batch size . <nl> sparse_weights : ` SparseTensor ` of same shape as ` sparse_ids ` , containing <nl> def safe_embedding_lookup_sparse ( embedding_weights , <nl> combining . <nl> <nl> Returns : <nl> - Dense ` Tensor ` of shape ` [ d_0 , d_1 , . . . , d_ { n - 1 } , e_1 , . . . , e_m ] ` . <nl> + A dense tensor representing the combined embeddings for the <nl> + sparse ids . For each row in the dense tensor represented by ` sp_ids ` , the op <nl> + looks up the embeddings for all ids in that row , multiplies them by the <nl> + corresponding weight , and combines these embeddings as specified . <nl> + <nl> + In other words , if <nl> + <nl> + ` shape ( combined embedding_weights ) = [ p0 , p1 , . . . , pm ] ` <nl> + <nl> + and <nl> + <nl> + ` shape ( sparse_ids ) = shape ( sparse_weights ) = [ d0 , d1 , . . . , dn ] ` <nl> + <nl> + then <nl> + <nl> + ` shape ( output ) = [ d0 , d1 , . . . dn - 1 , p1 , . . . , pm ] ` . <nl> + <nl> + For instance , if params is a 10x20 matrix , and sp_ids / sp_weights are <nl> + <nl> + ` ` ` python <nl> + [ 0 , 0 ] : id 1 , weight 2 . 0 <nl> + [ 0 , 1 ] : id 3 , weight 0 . 5 <nl> + [ 1 , 0 ] : id - 1 , weight 1 . 0 <nl> + [ 2 , 3 ] : id 1 , weight 3 . 0 <nl> + ` ` ` <nl> + <nl> + ` default_id ` is 0 . <nl> + <nl> + with ` combiner ` = " mean " , then the output will be a 3x20 matrix where <nl> + <nl> + ` ` ` python <nl> + output [ 0 , : ] = ( params [ 1 , : ] * 2 . 0 + params [ 3 , : ] * 0 . 5 ) / ( 2 . 0 + 0 . 5 ) <nl> + output [ 1 , : ] = ( params [ 0 , : ] * 1 . 0 ) / 1 . 0 <nl> + output [ 2 , : ] = ( params [ 1 , : ] * 3 . 0 ) / 3 . 0 <nl> + ` ` ` <nl> <nl> Raises : <nl> ValueError : if ` embedding_weights ` is empty . <nl>
Update embedding_ops doc :
tensorflow/tensorflow
e53453908e1339265d7f31c9b8a92f54d3309de7
2020-04-29T21:19:30Z
mmm a / third_party / onnx <nl> ppp b / third_party / onnx <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 85133e9849f1875329f7f19423b15cda82b97fd5 <nl> + Subproject commit 5f69c37628002efa8c03d70d652db03c9d5ffca7 <nl>
[ auto ] Update onnx to 5f69c37 - Remove the only use of EnforceConsumed ( )
pytorch/pytorch
81a29967c54cb445a615be8ac12204f79da928d4
2018-03-23T03:23:28Z
mmm a / tensorflow / python / compiler / tensorrt / trt_convert . py <nl> ppp b / tensorflow / python / compiler / tensorrt / trt_convert . py <nl> def _check_trt_version_compatibility ( ) : <nl> Raises : <nl> RuntimeError : if the TensorRT library version is incompatible . <nl> " " " <nl> - compiled_version = wrap_py_utils . get_linked_tensorrt_version ( ) <nl> + linked_version = wrap_py_utils . get_linked_tensorrt_version ( ) <nl> loaded_version = wrap_py_utils . get_loaded_tensorrt_version ( ) <nl> - tf_logging . info ( " Linked TensorRT version : % s " % str ( compiled_version ) ) <nl> + assert isinstance ( linked_version , tuple ) <nl> + assert isinstance ( loaded_version , tuple ) <nl> + assert len ( linked_version ) = = 3 <nl> + assert len ( loaded_version ) = = 3 <nl> + tf_logging . info ( " Linked TensorRT version : % s " % str ( linked_version ) ) <nl> tf_logging . info ( " Loaded TensorRT version : % s " % str ( loaded_version ) ) <nl> - version_mismatch = False <nl> - if loaded_version [ 0 ] < compiled_version [ 0 ] : <nl> + if loaded_version < linked_version : <nl> tf_logging . error ( <nl> - " TensorRT version mismatch . Tensorflow was compiled against " + <nl> - " TensorRT % s but library loaded from environment is TensorRT % s " % <nl> - ( " . " . join ( [ str ( x ) for x in compiled_version ] ) , <nl> - " . " . join ( [ str ( x ) for x in loaded_version ] ) ) + <nl> - " . Please make sure that correct version of TensorRT " + <nl> - " is available in the system and added to ldconfig or LD_LIBRARY_PATH " ) <nl> - raise RuntimeError ( " Incompatible TensorRT library version " ) <nl> - for i in zip ( loaded_version , compiled_version ) : <nl> - if i [ 0 ] ! = i [ 1 ] : <nl> - tf_logging . warn ( " TensorRT mismatch . Compiled against version " + <nl> - " % s , but loaded % s . Things may not work " % <nl> - ( " . " . join ( [ str ( x ) for x in compiled_version ] ) , <nl> - " . " . join ( [ str ( x ) for x in loaded_version ] ) ) ) <nl> - version_mismatch = True <nl> - break <nl> - if not version_mismatch : <nl> - tf_logging . info ( " Running against TensorRT version % s " % <nl> - " . " . join ( [ str ( x ) for x in loaded_version ] ) ) <nl> + " Loaded TensorRT % s but linked TensorFlow against TensorRT % s . " % <nl> + ( " . " . join ( [ str ( x ) for x in loaded_version ] ) , <nl> + " . " . join ( [ str ( x ) for x in linked_version ] ) ) + <nl> + " TensorRT does not support forward compatibility . " + <nl> + " It is also required to use the same major version of TensorRT " + <nl> + " during compilation and runtime . " ) <nl> + raise RuntimeError ( " Incompatible TensorRT versions " ) <nl> + if loaded_version [ 0 ] > linked_version [ 0 ] : <nl> + tf_logging . error ( <nl> + " Loaded TensorRT % s but linked TensorFlow against TensorRT % s . " % <nl> + ( " . " . join ( [ str ( x ) for x in loaded_version ] ) , <nl> + " . " . join ( [ str ( x ) for x in linked_version ] ) ) + <nl> + " It is required to use the same major version " + <nl> + " of TensorRT during compilation and runtime . " ) <nl> + raise RuntimeError ( " Incompatible TensorRT major version " ) <nl> + if loaded_version ! = linked_version : <nl> + tf_logging . info ( <nl> + " Loaded TensorRT % s and linked TensorFlow against TensorRT % s . " % <nl> + ( " . " . join ( [ str ( x ) for x in loaded_version ] ) , <nl> + " . " . join ( [ str ( x ) for x in linked_version ] ) ) + <nl> + " This is supported because TensorRT " + <nl> + " minor / patch upgrades are backward compatible " ) <nl> <nl> <nl> def get_tensorrt_rewriter_config ( conversion_params , is_v2 = False ) : <nl>
Merge pull request from pooyadavoodi : trt_version_check
tensorflow/tensorflow
4083d8d7d22d467c0b80f0fac8b2c2827fc7659a
2019-09-13T05:33:49Z
deleted file mode 100644 <nl> index 22d570b7bca . . 00000000000 <nl> mmm a / dbms / tests / integration / test_custom_http / configs / custom_http . xml <nl> ppp / dev / null <nl> <nl> - < yandex > <nl> - < http_port > 8123 < / http_port > <nl> - < CustomHTTP > <nl> - < HTTPMatch > <nl> - < URL > / $ { database } / a / $ { id } / $ { table } < / URL > <nl> - < QUERY > INSERT INTO $ { database : ASTIdentifier } . $ { table : ASTIdentifier } ( id ) VALUES < / QUERY > <nl> - < QUERY > SELECT * FROM $ { database : ASTIdenfier } . t < / QUERY > <nl> - < QUERY > SELECT * FROM a . $ { table : ASTIdenfier } WHERE id = { id : UInt8 } < / QUERY > <nl> - < / HTTPMatch > <nl> - < / CustomHTTP > <nl> - < / yandex > <nl> new file mode 100644 <nl> index 00000000000 . . f91e196abab <nl> mmm / dev / null <nl> ppp b / dbms / tests / integration / test_custom_http / configs / custom_http_config . xml <nl> <nl> + < yandex > <nl> + < http_port > 8123 < / http_port > <nl> + <nl> + < custom_http > <nl> + < test_for_single_insert > <nl> + < URL > / test_for_single_insert < / URL > <nl> + < query > INSERT INTO test . test VALUES < / query > <nl> + < / test_for_single_insert > <nl> + <nl> + < test_for_single_select > <nl> + < URL > / test_for_single_select < / URL > <nl> + < query > SELECT * FROM test . test ORDER BY id < / query > <nl> + < / test_for_single_select > <nl> + <nl> + < test_for_multiple_select > <nl> + < URL > / test_for_multiple_select < / URL > <nl> + < query > SELECT * FROM test . test ORDER BY id < / query > <nl> + < query > SELECT * FROM test . test ORDER BY id < / query > <nl> + < / test_for_multiple_select > <nl> + <nl> + < test_for_hybrid_insert_and_select_with_one_insert > <nl> + < URL > / test_for_multiple_select < / URL > <nl> + < query > INSERT INTO test . test VALUES < / query > <nl> + < query > SELECT ' test_for_hybrid_insert_and_select_with_one_insert first ' < / query > <nl> + < query > SELECT ' test_for_hybrid_insert_and_select_with_one_insert second ' < / query > <nl> + < / test_for_hybrid_insert_and_select_with_one_insert > <nl> + <nl> + < ! - - ErrorCode test <nl> + < test_for_hybrid_insert_and_select_with_multiple_insert > <nl> + < / test_for_hybrid_insert_and_select_with_multiple_insert > <nl> + <nl> + < test_for_multiple_insert > <nl> + < URL > / test_for_multiple_insert < / URL > <nl> + < query > SELECT * FROM test . test ORDER BY id < / query > <nl> + < / test_for_multiple_insert > <nl> + - - > <nl> + <nl> + < test_for_url_match > <nl> + < URL > / test_for_url_match < / URL > <nl> + < query > SELECT ' Matched test_for_url_match ' < / query > <nl> + < / test_for_url_match > <nl> + <nl> + < test_for_method_match > <nl> + < URL > PUT < / URL > <nl> + < query > SELECT ' Matched test_for_method_match ' < / query > <nl> + < / test_for_method_match > <nl> + <nl> + < test_for_multiple_match > <nl> + < URL > / test_for_multiple_match < / URL > <nl> + < method > GET < / method > <nl> + < query > SELECT ' Matched test_for_multiple_match ' < / query > <nl> + < / test_for_multiple_match > <nl> + < / custom_http > <nl> + < / yandex > <nl> mmm a / dbms / tests / integration / test_custom_http / test . py <nl> ppp b / dbms / tests / integration / test_custom_http / test . py <nl> <nl> import pytest <nl> - import requests <nl> <nl> from helpers . cluster import ClickHouseCluster <nl> - from helpers . test_tools import assert_eq_with_retry <nl> <nl> cluster = ClickHouseCluster ( __file__ ) <nl> - node = cluster . add_instance ( ' node ' , main_configs = [ ' configs / custom_http . xml ' ] ) <nl> + test_instance = cluster . add_instance ( ' node ' , main_configs = [ ' configs / custom_http_config . xml ' ] ) <nl> + <nl> <nl> @ pytest . fixture ( scope = " module " ) <nl> def start_cluster ( ) : <nl> try : <nl> cluster . start ( ) <nl> - node . query ( ' ' ' <nl> - CREATE DATABASE ` test ` ; <nl> - <nl> - CREATE TABLE ` test ` . ` test_custom_http ` ( ` id ` UInt8 ) Engine = Memory ; <nl> - ' ' ' ) <nl> - <nl> + test_instance . query ( ' CREATE DATABASE ` test ` ' ) <nl> + test_instance . query ( ' CREATE TABLE ` test ` . ` test ` ( ` id ` UInt8 ) Engine = Memory ' ) <nl> yield cluster <nl> finally : <nl> cluster . shutdown ( ) <nl> <nl> - def test ( started_cluster ) : <nl> - node_ip = cluster . get_instance_ip ( node ) <nl> - url = ' http : / / % s : 8123 / test / a / 1 / test_custom_http ' % node_ip <nl> - data = " ( 1 ) " <nl> - params = { ' id ' : 1 } <nl> - response = requests . post ( url , params = params , data = data ) <nl> <nl> - assert response . text = = ' \ n1 \ n1 \ n ' <nl> + def test_for_single_insert ( started_cluster ) : <nl> + assert test_instance . http_query ( ' / test_for_single_insert ' , data = ' ( 1 ) ( 2 ) ( 3 ) ' ) = = ' \ n ' <nl>
ISSUES - 5436 add integration test for custom http
ClickHouse/ClickHouse
07ed4ba4f4ff44d5985803f720d6965f22524d28
2020-04-19T18:25:12Z
mmm a / tools / grift / grpc_plugins_generator . patch <nl> ppp b / tools / grift / grpc_plugins_generator . patch <nl> 2 . 8 . 0 . rc3 . 226 . g39d4020 <nl> <nl> <nl> - From e724d3abf096278615085bd58217321e32b43fd8 Mon Sep 17 00 : 00 : 00 2001 <nl> + From 387e4300bc9d98176a92a7c010621443a538e7f2 Mon Sep 17 00 : 00 : 00 2001 <nl> From : chedeti < chedeti @ google . com > <nl> Date : Sun , 31 Jul 2016 16 : 16 : 40 - 0700 <nl> Subject : [ PATCH 2 / 3 ] grpc cpp plugins generator with example <nl> <nl> mmm <nl> - compiler / cpp / src / generate / t_cpp_generator . cc | 478 ppppppppppppppppppppp + + mmm - <nl> + compiler / cpp / src / generate / t_cpp_generator . cc | 489 ppppppppppppppppppppp + + mmm - <nl> tutorial / cpp / CMakeLists . txt | 53 mmm <nl> tutorial / cpp / CppClient . cpp | 80 mmm - - <nl> tutorial / cpp / CppServer . cpp | 181 mmmmmmmmm - <nl> - tutorial / cpp / GriftClient . cpp | 93 pppppp <nl> - tutorial / cpp / GriftServer . cpp | 93 pppppp <nl> + tutorial / cpp / GriftClient . cpp | 93 ppp + + <nl> + tutorial / cpp / GriftServer . cpp | 93 ppp + + <nl> tutorial / cpp / Makefile . am | 66 + + - - <nl> tutorial / cpp / test . thrift | 13 + <nl> - 8 files changed , 641 insertions ( + ) , 416 deletions ( - ) <nl> + 8 files changed , 652 insertions ( + ) , 416 deletions ( - ) <nl> delete mode 100644 tutorial / cpp / CMakeLists . txt <nl> delete mode 100644 tutorial / cpp / CppClient . cpp <nl> delete mode 100644 tutorial / cpp / CppServer . cpp <nl> Subject : [ PATCH 2 / 3 ] grpc cpp plugins generator with example <nl> create mode 100644 tutorial / cpp / test . thrift <nl> <nl> - + mmm a / compiler / cpp / src / generate / t_cpp_generator . cc <nl> ppp b / compiler / cpp / src / generate / t_cpp_generator . cc <nl> public : <nl> < < endl ; <nl> <nl> f_service_tcc_ < < " # ifndef " < < svcname < < " _TCC " < < endl < < " # define " < < svcname < < " _TCC " <nl> - void t_cpp_generator : : generate_service ( t_service * tservice ) { <nl> + void t_cpp_generator : : generate_service ( t_service * tservice ) { <nl> } <nl> } <nl> <nl> + indent ( ) < < " \ " / " < < ns < < " . " < < service_name_ < < " / " < < ( * f_iter ) - > get_name ( ) < < " \ " , " < < endl ; <nl> + } <nl> + <nl> - + if ( extends_service ) { <nl> - + vector < t_function * > functions = extends_service - > get_functions ( ) ; <nl> + + <nl> + + t_service * service_iter = extends_service ; <nl> + + while ( service_iter ) { <nl> + + vector < t_function * > functions = service_iter - > get_functions ( ) ; <nl> + vector < t_function * > : : iterator f_iter ; <nl> + <nl> + for ( f_iter = functions . begin ( ) ; f_iter ! = functions . end ( ) ; + + f_iter ) { <nl> + f_service_ < < <nl> - + indent ( ) < < " \ " / " < < extends_service - > get_program ( ) - > get_namespace ( " cpp " ) < < <nl> - + " . " < < extends_service - > get_name ( ) < < " / " < < ( * f_iter ) - > get_name ( ) < < " \ " , " < < endl ; <nl> + + indent ( ) < < " \ " / " < < service_iter - > get_program ( ) - > get_namespace ( " cpp " ) < < <nl> + + " . " < < service_iter - > get_name ( ) < < " / " < < ( * f_iter ) - > get_name ( ) < < " \ " , " < < endl ; <nl> + } <nl> + + service_iter = service_iter - > get_extends ( ) ; <nl> + } <nl> + <nl> + indent_down ( ) ; <nl> <nl> / / Generate all the cob components <nl> if ( gen_cob_style_ ) { <nl> - void t_cpp_generator : : generate_service ( t_service * tservice ) { <nl> + void t_cpp_generator : : generate_service ( t_service * tservice ) { <nl> generate_service_async_skeleton ( tservice ) ; <nl> } <nl> <nl> / / Close the namespace <nl> f_service_ < < ns_close_ < < endl < < endl ; <nl> f_service_tcc_ < < ns_close_ < < endl < < endl ; <nl> - void t_cpp_generator : : generate_service_helpers ( t_service * tservice ) { <nl> + void t_cpp_generator : : generate_service_helpers ( t_service * tservice ) { <nl> string name_orig = ts - > get_name ( ) ; <nl> <nl> / / TODO ( dreiss ) : Why is this stuff not in generate_function_helpers ? <nl> ts - > set_name ( name_orig ) ; <nl> <nl> generate_function_helpers ( tservice , * f_iter ) ; <nl> - void t_cpp_generator : : generate_service_helpers ( t_service * tservice ) { <nl> + void t_cpp_generator : : generate_service_helpers ( t_service * tservice ) { <nl> } <nl> <nl> / * * <nl> + } <nl> + <nl> + t_service * extends_service = tservice - > get_extends ( ) ; <nl> - + if ( extends_service ) { <nl> + + t_service * service_iter = extends_service ; <nl> + + while ( service_iter ) { <nl> + / / generate inherited methods <nl> - + vector < t_function * > functions = extends_service - > get_functions ( ) ; <nl> + + vector < t_function * > functions = service_iter - > get_functions ( ) ; <nl> + vector < t_function * > : : iterator f_iter ; <nl> + for ( f_iter = functions . begin ( ) ; f_iter ! = functions . end ( ) ; + + f_iter ) { <nl> + string function_name = ( * f_iter ) - > get_name ( ) ; <nl> + " ( : : grpc : : ClientContext * context , const " < < function_name < < <nl> + " Req & request , " < < function_name < < " Resp * response ) override ; " < < endl ; <nl> + } <nl> + + service_iter = service_iter - > get_extends ( ) ; <nl> + } <nl> + <nl> + f_header_ < < <nl> + indent ( ) < < " const : : grpc : : RpcMethod rpcmethod_ " < < ( * f_iter ) - > get_name ( ) < < " _ ; " < < endl ; <nl> + } <nl> + <nl> - + if ( extends_service ) { <nl> + + service_iter = extends_service ; <nl> + + while ( service_iter ) { <nl> + / / generate inherited methods <nl> - + vector < t_function * > functions = extends_service - > get_functions ( ) ; <nl> + + vector < t_function * > functions = service_iter - > get_functions ( ) ; <nl> + vector < t_function * > : : iterator f_iter ; <nl> + for ( f_iter = functions . begin ( ) ; f_iter ! = functions . end ( ) ; + + f_iter ) { <nl> + f_header_ < < <nl> + indent ( ) < < " const : : grpc : : RpcMethod rpcmethod_ " < < ( * f_iter ) - > get_name ( ) < < " _ ; " < < endl ; <nl> + } <nl> + + service_iter = service_iter - > get_extends ( ) ; <nl> + } <nl> + <nl> + indent_down ( ) ; <nl> + service_name_ < < " _method_names [ " < < i < < " ] , : : grpc : : RpcMethod : : NORMAL_RPC , channel ) " < < endl ; <nl> + } <nl> + <nl> - + if ( extends_service ) { <nl> + + service_iter = extends_service ; <nl> + + while ( service_iter ) { <nl> + / / generate inherited methods <nl> - + vector < t_function * > functions = extends_service - > get_functions ( ) ; <nl> + + vector < t_function * > functions = service_iter - > get_functions ( ) ; <nl> + vector < t_function * > : : iterator f_iter ; <nl> + for ( f_iter = functions . begin ( ) ; f_iter ! = functions . end ( ) ; + + f_iter , + + i ) { <nl> + f_service_ < < <nl> + " , rpcmethod_ " < < ( * f_iter ) - > get_name ( ) < < " _ ( " < < <nl> + service_name_ < < " _method_names [ " < < i < < " ] , : : grpc : : RpcMethod : : NORMAL_RPC , channel ) " < < endl ; <nl> + } <nl> + + service_iter = service_iter - > get_extends ( ) ; <nl> + } <nl> + f_service_ < < <nl> + indent ( ) < < " { } " < < endl ; <nl> + <nl> + } <nl> + <nl> - + if ( extends_service ) { <nl> - + vector < t_function * > functions = extends_service - > get_functions ( ) ; <nl> + + service_iter = extends_service ; <nl> + + while ( service_iter ) { <nl> + + vector < t_function * > functions = service_iter - > get_functions ( ) ; <nl> + vector < t_function * > : : iterator f_iter ; <nl> + for ( f_iter = functions . begin ( ) ; f_iter ! = functions . end ( ) ; + + f_iter ) { <nl> + string function_name = ( * f_iter ) - > get_name ( ) ; <nl> + " } " < < endl ; <nl> + <nl> + } <nl> + + service_iter = service_iter - > get_extends ( ) ; <nl> + } <nl> + <nl> + } <nl> if ( style = = " CobCl " ) { <nl> / / Forward declare the client . <nl> string client_name = service_name_ + " CobClient " ; <nl> - void t_cpp_generator : : generate_service_interface ( t_service * tservice , string sty <nl> + void t_cpp_generator : : generate_service_interface ( t_service * tservice , string sty <nl> } <nl> <nl> string extends = " " ; <nl> } <nl> <nl> if ( style = = " CobCl " & & gen_templates_ ) { <nl> - void t_cpp_generator : : generate_service_interface ( t_service * tservice , string sty <nl> + void t_cpp_generator : : generate_service_interface ( t_service * tservice , string sty <nl> } <nl> f_header_ < < " class " < < service_if_name < < extends < < " { " < < endl < < " public : " < < endl ; <nl> indent_up ( ) ; <nl> <nl> vector < t_function * > functions = tservice - > get_functions ( ) ; <nl> vector < t_function * > : : iterator f_iter ; <nl> - void t_cpp_generator : : generate_service_interface ( t_service * tservice , string sty <nl> + void t_cpp_generator : : generate_service_interface ( t_service * tservice , string sty <nl> if ( ( * f_iter ) - > has_doc ( ) ) <nl> f_header_ < < endl ; <nl> generate_java_doc ( f_header_ , * f_iter ) ; <nl> } <nl> indent_down ( ) ; <nl> f_header_ < < " } ; " < < endl < < endl ; <nl> - void t_cpp_generator : : generate_service_interface ( t_service * tservice , string sty <nl> + void t_cpp_generator : : generate_service_interface ( t_service * tservice , string sty <nl> f_header_ < < " typedef " < < service_if_name < < " < : : apache : : thrift : : protocol : : TProtocol > " <nl> < < service_name_ < < style < < " If ; " < < endl < < endl ; <nl> } <nl> } <nl> <nl> / * * <nl> - void t_cpp_generator : : generate_function_helpers ( t_service * tservice , t_function * <nl> + void t_cpp_generator : : generate_function_helpers ( t_service * tservice , t_function * <nl> <nl> std : : ofstream & out = ( gen_templates_ ? f_service_tcc_ : f_service_ ) ; <nl> <nl> t_field success ( tfunction - > get_returntype ( ) , " success " , 0 ) ; <nl> if ( ! tfunction - > get_returntype ( ) - > is_void ( ) ) { <nl> result . append ( & success ) ; <nl> - void t_cpp_generator : : generate_function_helpers ( t_service * tservice , t_function * <nl> + void t_cpp_generator : : generate_function_helpers ( t_service * tservice , t_function * <nl> } <nl> <nl> generate_struct_declaration ( f_header_ , & result , false ) ; <nl> } <nl> <nl> / * * <nl> - void t_cpp_generator : : generate_process_function ( t_service * tservice , <nl> + void t_cpp_generator : : generate_process_function ( t_service * tservice , <nl> < < endl ; <nl> scope_up ( out ) ; <nl> <nl> <nl> if ( tfunction - > is_oneway ( ) & & ! unnamed_oprot_seqid ) { <nl> out < < indent ( ) < < " ( void ) seqid ; " < < endl < < indent ( ) < < " ( void ) oprot ; " < < endl ; <nl> - void t_cpp_generator : : generate_process_function ( t_service * tservice , <nl> + void t_cpp_generator : : generate_process_function ( t_service * tservice , <nl> out < < indent ( ) < < " ( void ) seqid ; " < < endl < < indent ( ) < < " ( void ) oprot ; " < < endl ; <nl> } <nl> <nl> < < indent ( ) < < " void * ctx = NULL ; " < < endl < < indent ( ) <nl> < < " if ( this - > eventHandler_ . get ( ) ! = NULL ) { " < < endl < < indent ( ) <nl> < < " ctx = this - > eventHandler_ - > getContext ( " < < service_func_name < < " , NULL ) ; " < < endl <nl> - void t_cpp_generator : : generate_process_function ( t_service * tservice , <nl> + void t_cpp_generator : : generate_process_function ( t_service * tservice , <nl> < < " this - > eventHandler_ . get ( ) , ctx , " < < service_func_name < < " ) ; " < < endl < < endl ; <nl> <nl> / / Throw the TDelayedException , and catch the result <nl> index 0000000 . . de3c9a4 <nl> 2 . 8 . 0 . rc3 . 226 . g39d4020 <nl> <nl> <nl> - From f991f33dd6461eae197b6ad0e7088b571f2a7b22 Mon Sep 17 00 : 00 : 00 2001 <nl> + From 3e4d75a2e2c474ee7700e7c9acaf89fdb768bedc Mon Sep 17 00 : 00 : 00 2001 <nl> From : chedeti < chedeti @ google . com > <nl> Date : Sun , 31 Jul 2016 16 : 23 : 53 - 0700 <nl> Subject : [ PATCH 3 / 3 ] grpc java plugins generator <nl>
fix multilevel inheritence codegen
grpc/grpc
7e024be839687470bd1343f70f08ec1e703eb9ec
2016-08-05T18:15:37Z
mmm a / Makefile . nacl <nl> ppp b / Makefile . nacl <nl> NACL_BUILDS = $ ( foreach mode , $ ( MODES ) , \ <nl> $ ( addsuffix . $ ( mode ) , $ ( NACL_ARCHES ) ) ) <nl> <nl> HOST_OS = $ ( shell uname - s | sed - e ' s / Linux / linux / ; s / Darwin / mac / ' ) <nl> - ifeq ( $ ( HOST_OS ) , linux ) <nl> - TOOLCHAIN_DIR = linux_x86_glibc <nl> - else <nl> - ifeq ( $ ( HOST_OS ) , mac ) <nl> - TOOLCHAIN_DIR = mac_x86_glibc <nl> - else <nl> - $ ( error Host platform " $ { HOST_OS } " is not supported ) <nl> - endif <nl> - endif <nl> - <nl> TOOLCHAIN_PATH = $ ( realpath $ { NACL_SDK_ROOT } / toolchain ) <nl> - NACL_TOOLCHAIN ? = $ { TOOLCHAIN_PATH } / $ { TOOLCHAIN_DIR } <nl> + NACL_TOOLCHAIN ? = $ { TOOLCHAIN_PATH } / linux_pnacl <nl> + <nl> + ifeq ( $ ( wildcard $ ( NACL_TOOLCHAIN ) ) , ) <nl> + $ ( error Cannot find Native Client toolchain in " $ { NACL_TOOLCHAIN } " ) <nl> + endif <nl> <nl> ifeq ( $ ( ARCH ) , nacl_ia32 ) <nl> GYPENV = nacl_target_arch = nacl_ia32 v8_target_arch = arm v8_host_arch = ia32 <nl> - TOOLCHAIN_ARCH = x86 - 4 . 4 <nl> - NACL_CC = " $ ( NACL_TOOLCHAIN ) / bin / i686 - nacl - gcc " <nl> - NACL_CXX = " $ ( NACL_TOOLCHAIN ) / bin / i686 - nacl - g + + " <nl> - NACL_LINK = " $ ( NACL_TOOLCHAIN ) / bin / i686 - nacl - g + + " <nl> + NACL_CC = " $ ( NACL_TOOLCHAIN ) / bin / pnacl - clang " <nl> + NACL_CXX = " $ ( NACL_TOOLCHAIN ) / bin / pnacl - clang + + " <nl> + NACL_LINK = " $ ( NACL_TOOLCHAIN ) / bin / pnacl - clang + + - - pnacl - allow - native - arch x86 - 32 " <nl> else <nl> ifeq ( $ ( ARCH ) , nacl_x64 ) <nl> GYPENV = nacl_target_arch = nacl_x64 v8_target_arch = arm v8_host_arch = ia32 <nl> - TOOLCHAIN_ARCH = x86 - 4 . 4 <nl> - NACL_CC = " $ ( NACL_TOOLCHAIN ) / bin / x86_64 - nacl - gcc " <nl> - NACL_CXX = " $ ( NACL_TOOLCHAIN ) / bin / x86_64 - nacl - g + + " <nl> - NACL_LINK = " $ ( NACL_TOOLCHAIN ) / bin / x86_64 - nacl - g + + " <nl> + NACL_CC = " $ ( NACL_TOOLCHAIN ) / bin / pnacl - clang " <nl> + NACL_CXX = " $ ( NACL_TOOLCHAIN ) / bin / pnacl - clang + + " <nl> + NACL_LINK = " $ ( NACL_TOOLCHAIN ) / bin / pnacl - clang + + - - pnacl - allow - native - arch x86 - 64 " <nl> else <nl> $ ( error Target architecture " $ { ARCH } " is not supported ) <nl> endif <nl> endif <nl> <nl> - ifeq ( $ ( wildcard $ ( NACL_TOOLCHAIN ) ) , ) <nl> - $ ( error Cannot find Native Client toolchain in " $ { NACL_TOOLCHAIN } " ) <nl> - endif <nl> - <nl> # For mksnapshot host generation . <nl> GYPENV + = host_os = $ { HOST_OS } <nl> <nl> NACL_MAKEFILES = $ ( addprefix $ ( OUTDIR ) / Makefile . , $ ( NACL_BUILDS ) ) <nl> # For some reason the $ $ ( basename $ $ @ ) expansion didn ' t work here . . . <nl> $ ( NACL_BUILDS ) : $ ( NACL_MAKEFILES ) <nl> @ $ ( MAKE ) - C " $ ( OUTDIR ) " - f Makefile . $ @ \ <nl> + CC = $ { NACL_CC } \ <nl> CXX = $ { NACL_CXX } \ <nl> + AR = " $ ( NACL_TOOLCHAIN ) / bin / pnacl - ar " \ <nl> + RANLIB = " $ ( NACL_TOOLCHAIN ) / bin / pnacl - ranlib " \ <nl> + LD = " $ ( NACL_TOOLCHAIN ) / bin / pnacl - ld " \ <nl> LINK = $ { NACL_LINK } \ <nl> BUILDTYPE = $ ( shell echo $ ( subst . , , $ ( suffix $ @ ) ) | \ <nl> python - c " print raw_input ( ) . capitalize ( ) " ) \ <nl> $ ( NACL_MAKEFILES ) : <nl> GYP_DEFINES = " $ { GYPENV } " \ <nl> CC = $ { NACL_CC } \ <nl> CXX = $ { NACL_CXX } \ <nl> + LINK = $ { NACL_LINK } \ <nl> PYTHONPATH = " $ ( shell pwd ) / tools / generate_shim_headers : $ ( shell pwd ) / build : $ ( PYTHONPATH ) " \ <nl> build / gyp / gyp - - generator - output = " $ { OUTDIR } " build / all . gyp \ <nl> - Ibuild / standalone . gypi - - depth = . \ <nl> mmm a / src / base / atomicops . h <nl> ppp b / src / base / atomicops . h <nl> namespace base { <nl> <nl> typedef char Atomic8 ; <nl> typedef int32_t Atomic32 ; <nl> - # ifdef V8_HOST_ARCH_64_BIT <nl> + # if defined ( __native_client__ ) <nl> + typedef int64_t Atomic64 ; <nl> + # elif defined ( V8_HOST_ARCH_64_BIT ) <nl> / / We need to be able to go between Atomic64 and AtomicWord implicitly . This <nl> / / means Atomic64 and AtomicWord should be the same type on 64 - bit . <nl> # if defined ( __ILP32__ ) <nl> typedef int64_t Atomic64 ; <nl> # else <nl> typedef intptr_t Atomic64 ; <nl> - # endif <nl> - # endif <nl> + # endif / / defined ( V8_HOST_ARCH_64_BIT ) <nl> + # endif / / defined ( __native_client__ ) <nl> <nl> / / Use AtomicWord for a machine - sized pointer . It will use the Atomic32 or <nl> / / Atomic64 routines below , depending on your architecture . <nl> Atomic64 Release_Load ( volatile const Atomic64 * ptr ) ; <nl> # include " src / base / atomicops_internals_x86_msvc . h " <nl> # elif defined ( __APPLE__ ) <nl> # include " src / base / atomicops_internals_mac . h " <nl> + # elif defined ( __native_client__ ) <nl> + # include " src / base / atomicops_internals_portable . h " <nl> # elif defined ( __GNUC__ ) & & V8_HOST_ARCH_ARM64 <nl> # include " src / base / atomicops_internals_arm64_gcc . h " <nl> # elif defined ( __GNUC__ ) & & V8_HOST_ARCH_ARM <nl> mmm a / src / base / build_config . h <nl> ppp b / src / base / build_config . h <nl> <nl> # define V8_HOST_ARCH_64_BIT 1 <nl> # endif <nl> # endif / / __native_client__ <nl> + # elif defined ( __pnacl__ ) <nl> + / / PNaCl is also ILP - 32 . <nl> + # define V8_HOST_ARCH_IA32 1 <nl> + # define V8_HOST_ARCH_32_BIT 1 <nl> # elif defined ( _M_IX86 ) | | defined ( __i386__ ) <nl> # define V8_HOST_ARCH_IA32 1 <nl> # define V8_HOST_ARCH_32_BIT 1 <nl> mmm a / src / base / cpu . cc <nl> ppp b / src / base / cpu . cc <nl> <nl> namespace v8 { <nl> namespace base { <nl> <nl> - # if V8_HOST_ARCH_IA32 | | V8_HOST_ARCH_X64 <nl> + # if defined ( __pnacl__ ) <nl> + / / Portable host shouldn ' t do feature detection . <nl> + # elif V8_HOST_ARCH_IA32 | | V8_HOST_ARCH_X64 <nl> <nl> / / Define __cpuid ( ) for non - MSVC libraries . <nl> # if ! V8_LIBC_MSVCRT <nl> CPU : : CPU ( ) : stepping_ ( 0 ) , <nl> has_vfp3_d32_ ( false ) , <nl> is_fp64_mode_ ( false ) { <nl> memcpy ( vendor_ , " Unknown " , 8 ) ; <nl> - # if V8_HOST_ARCH_IA32 | | V8_HOST_ARCH_X64 <nl> + # if defined ( __pnacl__ ) <nl> + / / Portable host shouldn ' t do feature detection . <nl> + / / TODO ( jfb ) : Remove the hardcoded ARM simulator flags in the build , and <nl> + / / hardcode them here instead . <nl> + # elif V8_HOST_ARCH_IA32 | | V8_HOST_ARCH_X64 <nl> int cpu_info [ 4 ] ; <nl> <nl> / / __cpuid with an InfoType argument of 0 returns the number of <nl> mmm a / tools / gyp / v8 . gyp <nl> ppp b / tools / gyp / v8 . gyp <nl> <nl> ' toolsets ' : [ ' target ' ] , <nl> } ] , <nl> [ ' OS = = " linux " ' , { <nl> - ' link_settings ' : { <nl> - ' libraries ' : [ <nl> - ' - lrt ' <nl> - ] <nl> - } , <nl> + ' conditions ' : [ <nl> + [ ' nacl_target_arch = = " none " ' , { <nl> + ' link_settings ' : { <nl> + ' libraries ' : [ <nl> + ' - lrt ' <nl> + ] , <nl> + } , <nl> + } , { <nl> + ' defines ' : [ <nl> + ' V8_LIBRT_NOT_AVAILABLE = 1 ' , <nl> + ] , <nl> + } ] , <nl> + ] , <nl> ' sources ' : [ <nl> ' . . / . . / src / base / platform / platform - linux . cc ' , <nl> ' . . / . . / src / base / platform / platform - posix . cc ' <nl> mmm a / tools / nacl - run . py <nl> ppp b / tools / nacl - run . py <nl> <nl> <nl> import os <nl> from os . path import join , dirname , abspath <nl> + import re <nl> import subprocess <nl> import sys <nl> import tempfile <nl> def GetNaClArchFromNexe ( nexe ) : <nl> try : <nl> p = subprocess . Popen ( [ ' file ' , nexe ] , stdout = subprocess . PIPE ) <nl> out , err = p . communicate ( ) <nl> - lines = out . split ( ' \ n ' ) <nl> + lines = [ re . sub ( " \ s + " , " " , line ) for line in out . split ( ' \ n ' ) ] <nl> if lines [ 0 ] . find ( " : ELF 32 - bit LSB executable , Intel 80386 " ) > 0 : <nl> return " x86_32 " <nl> if lines [ 0 ] . find ( " : ELF 64 - bit LSB executable , x86 - 64 " ) > 0 : <nl> def GetNaClResources ( nexe ) : <nl> print ( " NaCl V8 ARM support is not ready yet . " ) <nl> sys . exit ( 1 ) <nl> else : <nl> - print ( " Invalid nexe % s " % nexe ) <nl> + print ( " Invalid nexe % s with NaCl arch % s " % ( nexe , nacl_arch ) ) <nl> sys . exit ( 1 ) <nl> <nl> nacl_sel_ldr = os . path . join ( nacl_sdk_dir , " tools " , sel_ldr ) <nl> nacl_irt = os . path . join ( nacl_sdk_dir , " tools " , irt ) <nl> - nacl_ld_so = os . path . join ( nacl_sdk_dir , " toolchain " , toolchain , <nl> - " x86_64 - nacl " , libdir , " runnable - ld . so " ) <nl> - nacl_lib_path = os . path . join ( nacl_sdk_dir , " toolchain " , toolchain , <nl> - " x86_64 - nacl " , libdir ) <nl> <nl> - return ( nacl_sdk_dir , nacl_sel_ldr , nacl_irt , nacl_ld_so , nacl_lib_path ) <nl> + return ( nacl_sdk_dir , nacl_sel_ldr , nacl_irt ) <nl> <nl> def Main ( ) : <nl> if ( len ( sys . argv ) = = 1 ) : <nl> def Main ( ) : <nl> <nl> args = [ Escape ( arg ) for arg in sys . argv [ 1 : ] ] <nl> <nl> - ( nacl_sdk_dir , nacl_sel_ldr , nacl_irt , nacl_ld_so , <nl> - nacl_lib_path ) = GetNaClResources ( sys . argv [ 1 ] ) <nl> + ( nacl_sdk_dir , nacl_sel_ldr , nacl_irt ) = GetNaClResources ( sys . argv [ 1 ] ) <nl> <nl> # sel_ldr Options : <nl> # - c - c : disable validation ( for performance ) <nl> # - a : allow file access <nl> # - B < irt > : load the IRT <nl> - command = ' ' . join ( [ nacl_sel_ldr , ' - c ' , ' - c ' , ' - a ' , ' - B ' , nacl_irt , ' - - ' , <nl> - nacl_ld_so , ' - - library - path ' , nacl_lib_path ] + args ) <nl> + command = ' ' . join ( [ nacl_sel_ldr , ' - c ' , ' - c ' , ' - a ' , ' - B ' , nacl_irt , ' - - ' ] + <nl> + args ) <nl> error_code = Execute ( command ) <nl> return error_code <nl> <nl>
Use the pnacl - clang toolchain for ( P ) NaCL builds
v8/v8
955876b5f3ec68e82f0a886d73126206dbf158a8
2014-10-06T08:10:50Z
mmm a / src / peerlistwidget . cpp <nl> ppp b / src / peerlistwidget . cpp <nl> void PeerListWidget : : showPeerListMenu ( QPoint ) { <nl> QAction * dlLimitAct = 0 ; <nl> QAction * banAct = 0 ; <nl> if ( ! selectedPeerIPs . isEmpty ( ) ) { <nl> - upLimitAct = menu . addAction ( QIcon ( " : / Icons / skin / seeding . png " ) , tr ( " Limit upload rate " ) ) ; <nl> dlLimitAct = menu . addAction ( QIcon ( " : / Icons / skin / download . png " ) , tr ( " Limit download rate " ) ) ; <nl> + upLimitAct = menu . addAction ( QIcon ( " : / Icons / skin / seeding . png " ) , tr ( " Limit upload rate " ) ) ; <nl> banAct = menu . addAction ( QIcon ( " : / Icons / oxygen / user - group - delete . png " ) , tr ( " Ban peer permanently " ) ) ; <nl> empty_menu = false ; <nl> } <nl> mmm a / src / webui / index . html <nl> ppp b / src / webui / index . html <nl> < h1 class = " applicationTitle " > qBittorrent Web User Interface < span class = " version <nl> < li > < a href = " # Pause " class = " pause " > _ ( Pause ) < / a > < / li > <nl> < li class = " separator " > < a href = " # Delete " class = " delete " > _ ( Delete ) < / a > < / li > <nl> < li > < a href = " # DeleteHD " class = " deleteHD " > _ ( Delete from HD ) < / a > < / li > <nl> - < li class = " separator " > < a href = " # UploadLimit " class = " uploadLimit " > _ ( Limit upload rate ) < / a > < / li > <nl> - < li > < a href = " # DownloadLimit " class = " downloadLimit " > _ ( Limit download rate ) < / a > < / li > <nl> + < li class = " separator " > < a href = " # DownloadLimit " class = " downloadLimit " > _ ( Limit download rate ) < / a > < / li > <nl> + < li > < a href = " # UploadLimit " class = " uploadLimit " > _ ( Limit upload rate ) < / a > < / li > <nl> < li class = " separator " > < a href = " # ForceRecheck " class = " recheck " > _ ( Force recheck ) < / a > < / li > <nl> < / ul > <nl> < / body > <nl>
- Fix upload / download rate order in two menus
qbittorrent/qBittorrent
6b04005d083401066090db2a7cb36d7476763a9f
2009-11-27T16:02:24Z
mmm a / samples / python2 / common . py <nl> ppp b / samples / python2 / common . py <nl> def nothing ( * arg , * * kw ) : <nl> pass <nl> <nl> def clock ( ) : <nl> - return cv2 . getTickCount ( ) / cv2 . getTickFrequency ( ) <nl> \ No newline at end of file <nl> + return cv2 . getTickCount ( ) / cv2 . getTickFrequency ( ) <nl> + <nl> + class RectSelector : <nl> + def __init__ ( self , win , callback ) : <nl> + self . win = win <nl> + self . callback = callback <nl> + cv2 . setMouseCallback ( win , self . onmouse ) <nl> + self . drag_start = None <nl> + self . drag_rect = None <nl> + def onmouse ( self , event , x , y , flags , param ) : <nl> + x , y = np . int16 ( [ x , y ] ) # BUG <nl> + if event = = cv2 . EVENT_LBUTTONDOWN : <nl> + self . drag_start = ( x , y ) <nl> + if self . drag_start : <nl> + if flags & cv2 . EVENT_FLAG_LBUTTON : <nl> + # h , w = self . frame . shape [ : 2 ] <nl> + xo , yo = self . drag_start <nl> + x0 , y0 = np . minimum ( [ xo , yo ] , [ x , y ] ) <nl> + x1 , y1 = np . maximum ( [ xo , yo ] , [ x , y ] ) <nl> + # x0 , y0 = np . maximum ( 0 , np . minimum ( [ xo , yo ] , [ x , y ] ) ) <nl> + # x1 , y1 = np . minimum ( [ w , h ] , np . maximum ( [ xo , yo ] , [ x , y ] ) ) <nl> + self . drag_rect = None <nl> + if x1 - x0 > 0 and y1 - y0 > 0 : <nl> + self . drag_rect = ( x0 , y0 , x1 , y1 ) <nl> + else : <nl> + if self . drag_rect : <nl> + self . callback ( self . drag_rect ) <nl> + self . drag_start = None <nl> + self . drag_rect = None <nl> + def draw ( self , vis ) : <nl> + if not self . drag_rect : <nl> + return <nl> + x0 , y0 , x1 , y1 = self . drag_rect <nl> + cv2 . rectangle ( vis , ( x0 , y0 ) , ( x1 , y1 ) , ( 0 , 255 , 0 ) , 2 ) <nl>
RectSelector in common . py
opencv/opencv
a8698388079f46dcb92278e3f4874bf80320dced
2011-09-19T06:28:39Z
mmm a / folly / experimental / symbolizer / Elf . cpp <nl> ppp b / folly / experimental / symbolizer / Elf . cpp <nl> <nl> # include < folly / Exception . h > <nl> # include < folly / ScopeGuard . h > <nl> <nl> + # ifndef STT_GNU_IFUNC <nl> + # define STT_GNU_IFUNC 10 <nl> + # endif <nl> + <nl> namespace folly { <nl> namespace symbolizer { <nl> <nl> ElfFile : : Symbol ElfFile : : getDefinitionByAddress ( uintptr_t address ) const { <nl> } ; <nl> <nl> return iterateSymbolsWithTypes ( <nl> - section , { STT_OBJECT , STT_FUNC } , findSymbols ) ; <nl> + section , { STT_OBJECT , STT_FUNC , STT_GNU_IFUNC } , findSymbols ) ; <nl> } ; <nl> <nl> / / Try the . dynsym section first if it exists , it ' s smaller . <nl> ElfFile : : Symbol ElfFile : : getSymbolByName ( const char * name ) const { <nl> } ; <nl> <nl> return iterateSymbolsWithTypes ( <nl> - section , { STT_OBJECT , STT_FUNC } , findSymbols ) ; <nl> + section , { STT_OBJECT , STT_FUNC , STT_GNU_IFUNC } , findSymbols ) ; <nl> } ; <nl> <nl> / / Try the . dynsym section first if it exists , it ' s smaller . <nl>
Add parsing for indirect functions
facebook/folly
bb8d886a25225b1811f2fc890c8f77b59c1d1578
2017-11-09T06:21:40Z
mmm a / README . md <nl> ppp b / README . md <nl> Supported operating systems and hardware : <nl> <nl> # # History <nl> <nl> + * v1 . 0 , 2015 - 01 - 25 , hotfix [ # 151 ] ( https : / / github . com / winlinvip / simple - rtmp - server / issues / 151 ) , refine pcr = dts - 800ms and use dts / pts directly . 1 . 0 . 24 <nl> * v1 . 0 , 2015 - 01 - 23 , hotfix [ # 151 ] ( https : / / github . com / winlinvip / simple - rtmp - server / issues / 151 ) , use absolutely overflow to make jwplayer happy . 1 . 0 . 23 <nl> * v1 . 0 , 2015 - 01 - 17 , hotfix [ # 290 ] ( https : / / github . com / winlinvip / simple - rtmp - server / issues / 290 ) , use iformat only for rtmp input . 1 . 0 . 22 <nl> * < strong > v1 . 0 , 2015 - 01 - 15 , [ 1 . 0r1 release ( 1 . 0 . 21 ) ] ( https : / / github . com / winlinvip / simple - rtmp - server / releases / tag / 1 . 0r1 ) released . 59472 lines . < / strong > <nl> mmm a / trunk / src / app / srs_app_hls . cpp <nl> ppp b / trunk / src / app / srs_app_hls . cpp <nl> using namespace std ; <nl> <nl> / / @ see : NGX_RTMP_HLS_DELAY , <nl> / / 63000 : 700ms , ts_tbn = 90000 <nl> - # define SRS_AUTO_HLS_DELAY 63000 <nl> + / / 72000 : 800ms , ts_tbn = 90000 <nl> + / / @ see https : / / github . com / winlinvip / simple - rtmp - server / issues / 151 # issuecomment - 71352511 <nl> + # define SRS_AUTO_HLS_DELAY 72000 <nl> <nl> / / the mpegts header specifed the video / audio pid . <nl> # define TS_VIDEO_PID 256 <nl> class SrsMpegtsWriter <nl> p [ - 1 ] | = 0x20 ; / / Both Adaption and Payload <nl> * p + + = 7 ; / / size <nl> * p + + = 0x50 ; / / random access + PCR <nl> + / / about the pcr , read https : / / github . com / winlinvip / simple - rtmp - server / issues / 151 # issuecomment - 71352511 <nl> p = write_pcr ( p , frame - > dts - SRS_AUTO_HLS_DELAY ) ; <nl> } <nl> <nl> class SrsMpegtsWriter <nl> * p + + = header_size ; <nl> <nl> / / pts ; / / 33bits <nl> - p = write_pts ( p , flags > > 6 , frame - > pts + SRS_AUTO_HLS_DELAY ) ; <nl> + p = write_pts ( p , flags > > 6 , frame - > pts ) ; <nl> <nl> / / dts ; / / 33bits <nl> if ( frame - > dts ! = frame - > pts ) { <nl> - p = write_pts ( p , 1 , frame - > dts + SRS_AUTO_HLS_DELAY ) ; <nl> + p = write_pts ( p , 1 , frame - > dts ) ; <nl> } <nl> } <nl> <nl>
for , refine pcr = dts - 800ms and use dts / pts directly . 1 . 0 . 24
ossrs/srs
1835957a2b09b4dc7f393649f7e7b295c90e5b64
2015-01-25T05:04:12Z
mmm a / ports / dimcli / CONTROL <nl> ppp b / ports / dimcli / CONTROL <nl> <nl> Source : dimcli <nl> - Version : 4 . 1 . 0 - 1 <nl> + Version : 5 . 0 . 0 <nl> Homepage : https : / / github . com / gknowles / dimcli <nl> Description : C + + command line parser toolkit <nl> mmm a / ports / dimcli / portfile . cmake <nl> ppp b / ports / dimcli / portfile . cmake <nl> include ( vcpkg_common_functions ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO gknowles / dimcli <nl> - REF v4 . 1 . 0 <nl> - SHA512 5de010b5abfda9e6996bba8c621e03ae0cf81dbc2f69cd859e2ebf7b1706c451f7f8e142299784646d89ca3c3e5803e8711215680b8bdb8eb663158bff3b4f3d <nl> + REF v5 . 0 . 0 <nl> + SHA512 504e6f53e83ce17e8e4b59ecf1a610c2249c2bf48a308b1ee5db0e0e85d3cb08178d24534b5dee8bfaac83fd44c68cbbe8d300283d0023467b724a9340b56e4c <nl> HEAD_REF master <nl> PATCHES <nl> fix - NameBoolean . patch <nl>
[ dimcli ] Update library to 5 . 0 . 0 ( )
microsoft/vcpkg
573bebe6b76d6efc88bf3652ca9b1e62f0f3f85b
2019-08-20T17:24:28Z