diff
stringlengths 41
2.03M
| msg
stringlengths 1
1.5k
⌀ | repo
stringlengths 5
40
| sha
stringlengths 40
40
| time
stringlengths 20
20
|
---|---|---|---|---|
mmm a / include / swift / AST / DiagnosticsSema . def <nl> ppp b / include / swift / AST / DiagnosticsSema . def <nl> ERROR ( value_type_comparison_with_nil_illegal , none , <nl> ERROR ( cannot_match_expr_pattern_with_value , none , <nl> " expression pattern of type % 0 cannot match values of type % 1 " , <nl> ( Type , Type ) ) <nl> + ERROR ( cannot_match_expr_tuple_pattern_with_nontuple_value , none , <nl> + " tuple pattern cannot match values of non - tuple type % 0 " , <nl> + ( Type ) ) <nl> ERROR ( cannot_match_unresolved_expr_pattern_with_value , none , <nl> " pattern cannot match values of type % 0 " , <nl> ( Type ) ) <nl> mmm a / lib / Sema / CSDiagnostics . cpp <nl> ppp b / lib / Sema / CSDiagnostics . cpp <nl> bool CollectionElementContextualFailure : : diagnoseAsError ( ) { <nl> } <nl> <nl> if ( locator - > isForSequenceElementType ( ) ) { <nl> - diagnostic . emplace ( <nl> - emitDiagnostic ( anchor - > getLoc ( ) , <nl> - contextualType - > isExistentialType ( ) <nl> - ? diag : : cannot_convert_sequence_element_protocol <nl> - : diag : : cannot_convert_sequence_element_value , <nl> - eltType , contextualType ) ) ; <nl> + auto & cs = getConstraintSystem ( ) ; <nl> + / / If this is a conversion failure related to binding of ` for - each ` <nl> + / / statement it has to be diagnosed as pattern match if there are <nl> + / / holes present in the contextual type . <nl> + if ( cs . getContextualTypePurpose ( anchor ) = = <nl> + ContextualTypePurpose : : CTP_ForEachStmt & & <nl> + contextualType - > hasHole ( ) ) { <nl> + diagnostic . emplace ( emitDiagnostic ( <nl> + anchor - > getLoc ( ) , <nl> + ( contextualType - > is < TupleType > ( ) & & ! eltType - > is < TupleType > ( ) ) <nl> + ? diag : : cannot_match_expr_tuple_pattern_with_nontuple_value <nl> + : diag : : cannot_match_unresolved_expr_pattern_with_value , <nl> + eltType ) ) ; <nl> + } else { <nl> + diagnostic . emplace ( <nl> + emitDiagnostic ( anchor - > getLoc ( ) , <nl> + contextualType - > isExistentialType ( ) <nl> + ? diag : : cannot_convert_sequence_element_protocol <nl> + : diag : : cannot_convert_sequence_element_value , <nl> + eltType , contextualType ) ) ; <nl> + } <nl> } <nl> <nl> if ( ! diagnostic ) <nl> mmm a / lib / Sema / CSSimplify . cpp <nl> ppp b / lib / Sema / CSSimplify . cpp <nl> bool ConstraintSystem : : repairFailures ( <nl> if ( rhs - > isExistentialType ( ) ) <nl> break ; <nl> <nl> + / / If the types didn ' t line up , let ' s allow right - hand side <nl> + / / of the conversion ( or pattern match ) to have holes . This <nl> + / / helps when conversion if between a type and a tuple e . g . <nl> + / / ` Int ` vs . ` ( _ , _ ) ` . <nl> + rhs . visit ( [ & ] ( Type type ) { <nl> + if ( auto * typeVar = type - > getAs < TypeVariableType > ( ) ) <nl> + recordPotentialHole ( typeVar ) ; <nl> + } ) ; <nl> + <nl> conversionsOrFixes . push_back ( CollectionElementContextualMismatch : : create ( <nl> * this , lhs , rhs , getConstraintLocator ( locator ) ) ) ; <nl> break ; <nl> mmm a / test / stmt / foreach . swift <nl> ppp b / test / stmt / foreach . swift <nl> extension Int : P { } <nl> func testRepeated ( ri : RepeatedSequence < Int > ) { <nl> for x in ri { _ = x } <nl> } <nl> + <nl> + / / SR - 12398 : Poor pattern matching diagnostic : " for - in loop requires ' [ Int ] ' to conform to ' Sequence ' " <nl> + func sr_12398 ( arr1 : [ Int ] , arr2 : [ ( a : Int , b : String ) ] ) { <nl> + for ( x , y ) in arr1 { } <nl> + / / expected - error @ - 1 { { tuple pattern cannot match values of non - tuple type ' Int ' } } <nl> + <nl> + for ( x , y , _ ) in arr2 { } <nl> + / / expected - error @ - 1 { { pattern cannot match values of type ' ( a : Int , b : String ) ' } } <nl> + } <nl> | Merge pull request from xedin / rdar - 60832876 | apple/swift | 68b3965f277fdeb5bbbf2526acba2433510806ed | 2020-03-31T16:46:14Z |
mmm a / src / buffer_cache / alt / page . cc <nl> ppp b / src / buffer_cache / alt / page . cc <nl> void page_txn_t : : set_account ( alt_cache_account_t * cache_account ) { <nl> / / have a page_txn_t kept around , you see . Generally speaking , snapshotted <nl> / / operations don ' t have a particular page_txn_t associated with them , and , <nl> / / generally speaking , the account we want to use to unevict a page would be the <nl> - / / maximum ( or " sum " ? ) of the accounts currently waiting on the page . So , right <nl> - / / now , backfilling operations don ' t get to read with a higher priority than <nl> - / / other things . It would be interesting to reexamine whether this is a bad <nl> + / / maximum ( or " sum " ? ) of the accounts currently waiting on the page ( but it <nl> + / / would probably be fine to use whatever txn wants to unevict the page first ) . <nl> + / / So , right now , backfilling operations don ' t get to read with a higher priority <nl> + / / than other things . It would be interesting to reexamine whether this is a bad <nl> / / thing . <nl> } <nl> <nl> | Updated comment in set_account . | rethinkdb/rethinkdb | 817ebb0dfcf29bb4ee63cf2ff595e4cf51ef222c | 2014-02-07T06:38:52Z |
mmm a / tensorflow / python / autograph / pyct / static_analysis / live_values . py <nl> ppp b / tensorflow / python / autograph / pyct / static_analysis / live_values . py <nl> <nl> from tensorflow . python . autograph . pyct import transformer <nl> from tensorflow . python . autograph . pyct . static_analysis . annos import NodeAnno <nl> <nl> + <nl> # TODO ( aqj ) : Do we need this ? Do other builtins fail in similar ways <nl> # See b / 114389775 for a related bug in pyct <nl> # These symbols are legal in Python , but don ' t appear in the namespace . <nl> - _special_symbols = { ' range ' : range } <nl> + _SPECIAL_SYMBOLS = { ' range ' : range , ' print ' : print } <nl> <nl> <nl> class LiveValueResolver ( transformer . Base ) : <nl> def visit_Name ( self , node ) : <nl> # If the symbol value is for example a primitive , then it will not <nl> # have a name . <nl> pass <nl> - elif node . id in _special_symbols : <nl> - anno . setanno ( node , ' live_val ' , _special_symbols [ node . id ] ) <nl> + elif node . id in _SPECIAL_SYMBOLS : <nl> + # Note : if the user redefined any of these symbols , then they would <nl> + # be visible in the namespace and we would never reach this branch . <nl> + anno . setanno ( node , ' live_val ' , _SPECIAL_SYMBOLS [ node . id ] ) <nl> else : <nl> pass <nl> # TODO ( mdan ) : Should we raise an error here ? <nl> | Include the print function in the list of special functions - its name is not found in the namespace in Python 3 . | tensorflow/tensorflow | c07dc66e441c66a7cb1b136b4239e4dfdf84d221 | 2018-09-20T21:16:11Z |
mmm a / xbmc / Application . cpp <nl> ppp b / xbmc / Application . cpp <nl> bool CApplication : : PlayMedia ( const CFileItem & item , const std : : string & player , i <nl> } <nl> else if ( item . IsPVR ( ) ) <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . PlayMedia ( CFileItemPtr ( new CFileItem ( item ) ) ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > PlayMedia ( CFileItemPtr ( new CFileItem ( item ) ) ) ; <nl> } <nl> <nl> CURL path ( item . GetPath ( ) ) ; <nl> void CApplication : : ActivateScreenSaver ( bool forceType / * = false * / ) <nl> / / set to Dim in the case of a dialog on screen or playing video <nl> if ( g_windowManager . HasModalDialog ( ) | | <nl> ( m_pPlayer - > IsPlayingVideo ( ) & & m_ServiceManager - > GetSettings ( ) . GetBool ( CSettings : : SETTING_SCREENSAVER_USEDIMONPAUSE ) ) | | <nl> - CPVRGUIActions : : GetInstance ( ) . IsRunningChannelScan ( ) ) <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > IsRunningChannelScan ( ) ) <nl> { <nl> if ( ! CAddonMgr : : GetInstance ( ) . GetAddon ( " screensaver . xbmc . builtin . dim " , m_screenSaver ) ) <nl> m_screenSaver . reset ( new CScreenSaver ( " " ) ) ; <nl> mmm a / xbmc / GUIInfoManager . cpp <nl> ppp b / xbmc / GUIInfoManager . cpp <nl> std : : string CGUIInfoManager : : GetLabel ( int info , int contextWindow , std : : string * <nl> CServiceBroker : : GetPVRManager ( ) . TranslateCharInfo ( info , strLabel ) ; <nl> break ; <nl> case PVR_CHANNEL_NUMBER_INPUT : <nl> - strLabel = CPVRGUIActions : : GetInstance ( ) . GetChannelNumberInputHandler ( ) . GetChannelNumberAsString ( ) ; <nl> + strLabel = CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > GetChannelNumberInputHandler ( ) . GetChannelNumberAsString ( ) ; <nl> break ; <nl> case ADSP_ACTIVE_STREAM_TYPE : <nl> case ADSP_DETECTED_STREAM_TYPE : <nl> mmm a / xbmc / interfaces / json - rpc / PVROperations . cpp <nl> ppp b / xbmc / interfaces / json - rpc / PVROperations . cpp <nl> JSONRPC_STATUS CPVROperations : : Record ( const std : : string & method , ITransportLayer <nl> <nl> if ( toggle ) <nl> { <nl> - if ( ! CPVRGUIActions : : GetInstance ( ) . SetRecordingOnChannel ( pChannel , pChannel - > IsRecording ( ) ) ) <nl> + if ( ! CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > SetRecordingOnChannel ( pChannel , pChannel - > IsRecording ( ) ) ) <nl> return FailedToExecute ; <nl> } <nl> <nl> JSONRPC_STATUS CPVROperations : : Scan ( const std : : string & method , ITransportLayer * <nl> if ( ! CServiceBroker : : GetPVRManager ( ) . IsStarted ( ) ) <nl> return FailedToExecute ; <nl> <nl> - CPVRGUIActions : : GetInstance ( ) . StartChannelScan ( ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > StartChannelScan ( ) ; <nl> return ACK ; <nl> } <nl> <nl> JSONRPC_STATUS CPVROperations : : GetPropertyValue ( const std : : string & property , CVa <nl> else if ( property = = " scanning " ) <nl> { <nl> if ( started ) <nl> - result = CPVRGUIActions : : GetInstance ( ) . IsRunningChannelScan ( ) ; <nl> + result = CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > IsRunningChannelScan ( ) ; <nl> else <nl> result = false ; <nl> } <nl> JSONRPC_STATUS CPVROperations : : AddTimer ( const std : : string & method , ITransportLay <nl> CPVRTimerInfoTagPtr newTimer = CPVRTimerInfoTag : : CreateFromEpg ( epgTag , parameterObject [ " timerrule " ] . asBoolean ( false ) ) ; <nl> if ( newTimer ) <nl> { <nl> - if ( CPVRGUIActions : : GetInstance ( ) . AddTimer ( newTimer ) ) <nl> + if ( CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > AddTimer ( newTimer ) ) <nl> return ACK ; <nl> } <nl> return FailedToExecute ; <nl> JSONRPC_STATUS CPVROperations : : ToggleTimer ( const std : : string & method , ITransport <nl> if ( ! timer ) <nl> return InvalidParams ; <nl> <nl> - sentOkay = CPVRGUIActions : : GetInstance ( ) . AddTimer ( timer ) ; <nl> + sentOkay = CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > AddTimer ( timer ) ; <nl> } <nl> <nl> if ( sentOkay ) <nl> mmm a / xbmc / pvr / PVRActionListener . cpp <nl> ppp b / xbmc / pvr / PVRActionListener . cpp <nl> <nl> namespace PVR <nl> { <nl> <nl> - CPVRActionListener & CPVRActionListener : : GetInstance ( ) <nl> + CPVRActionListener : : CPVRActionListener ( ) <nl> { <nl> - static CPVRActionListener instance ; <nl> - return instance ; <nl> + g_application . RegisterActionListener ( this ) ; <nl> + CServiceBroker : : GetSettings ( ) . RegisterCallback ( this , { <nl> + CSettings : : SETTING_PVRPARENTAL_ENABLED , <nl> + CSettings : : SETTING_PVRMANAGER_RESETDB , <nl> + CSettings : : SETTING_EPG_RESETEPG , <nl> + CSettings : : SETTING_PVRMANAGER_CHANNELMANAGER , <nl> + CSettings : : SETTING_PVRMANAGER_GROUPMANAGER , <nl> + CSettings : : SETTING_PVRMANAGER_CHANNELSCAN , <nl> + CSettings : : SETTING_PVRMENU_SEARCHICONS , <nl> + CSettings : : SETTING_PVRCLIENT_MENUHOOK , <nl> + } ) ; <nl> } <nl> <nl> - void CPVRActionListener : : Init ( ) <nl> - { <nl> - std : : set < std : : string > settingSet ; <nl> - settingSet . insert ( CSettings : : SETTING_PVRPARENTAL_ENABLED ) ; <nl> - settingSet . insert ( CSettings : : SETTING_PVRMANAGER_RESETDB ) ; <nl> - settingSet . insert ( CSettings : : SETTING_EPG_RESETEPG ) ; <nl> - settingSet . insert ( CSettings : : SETTING_PVRMANAGER_CHANNELMANAGER ) ; <nl> - settingSet . insert ( CSettings : : SETTING_PVRMANAGER_GROUPMANAGER ) ; <nl> - settingSet . insert ( CSettings : : SETTING_PVRMANAGER_CHANNELSCAN ) ; <nl> - settingSet . insert ( CSettings : : SETTING_PVRMENU_SEARCHICONS ) ; <nl> - settingSet . insert ( CSettings : : SETTING_PVRCLIENT_MENUHOOK ) ; <nl> - CServiceBroker : : GetSettings ( ) . RegisterCallback ( this , settingSet ) ; <nl> - } <nl> - <nl> - void CPVRActionListener : : Deinit ( ) <nl> + CPVRActionListener : : ~ CPVRActionListener ( ) <nl> { <nl> CServiceBroker : : GetSettings ( ) . UnregisterCallback ( this ) ; <nl> + g_application . UnregisterActionListener ( this ) ; <nl> } <nl> <nl> bool CPVRActionListener : : OnAction ( const CAction & action ) <nl> bool CPVRActionListener : : OnAction ( const CAction & action ) <nl> { <nl> case ACTION_PVR_PLAY : <nl> if ( ! isPlayingPvr ) <nl> - CPVRGUIActions : : GetInstance ( ) . SwitchToChannel ( PlaybackTypeAny ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > SwitchToChannel ( PlaybackTypeAny ) ; <nl> break ; <nl> case ACTION_PVR_PLAY_TV : <nl> if ( ! isPlayingPvr | | g_application . CurrentFileItem ( ) . GetPVRChannelInfoTag ( ) - > IsRadio ( ) ) <nl> - CPVRGUIActions : : GetInstance ( ) . SwitchToChannel ( PlaybackTypeTV ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > SwitchToChannel ( PlaybackTypeTV ) ; <nl> break ; <nl> case ACTION_PVR_PLAY_RADIO : <nl> if ( ! isPlayingPvr | | ! g_application . CurrentFileItem ( ) . GetPVRChannelInfoTag ( ) - > IsRadio ( ) ) <nl> - CPVRGUIActions : : GetInstance ( ) . SwitchToChannel ( PlaybackTypeRadio ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > SwitchToChannel ( PlaybackTypeRadio ) ; <nl> break ; <nl> } <nl> return true ; <nl> bool CPVRActionListener : : OnAction ( const CAction & action ) <nl> return false ; <nl> <nl> int iRemote = bIsJumpSMS ? action . GetID ( ) - ( ACTION_JUMP_SMS2 - REMOTE_2 ) : action . GetID ( ) ; <nl> - CPVRGUIActions : : GetInstance ( ) . GetChannelNumberInputHandler ( ) . AppendChannelNumberDigit ( iRemote - REMOTE_0 ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > GetChannelNumberInputHandler ( ) . AppendChannelNumberDigit ( iRemote - REMOTE_0 ) ; <nl> } <nl> return true ; <nl> } <nl> void CPVRActionListener : : OnSettingAction ( const CSetting * setting ) <nl> const std : : string & settingId = setting - > GetId ( ) ; <nl> if ( settingId = = CSettings : : SETTING_PVRMANAGER_RESETDB ) <nl> { <nl> - CPVRGUIActions : : GetInstance ( ) . ResetPVRDatabase ( false ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ResetPVRDatabase ( false ) ; <nl> } <nl> else if ( settingId = = CSettings : : SETTING_EPG_RESETEPG ) <nl> { <nl> - CPVRGUIActions : : GetInstance ( ) . ResetPVRDatabase ( true ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ResetPVRDatabase ( true ) ; <nl> } <nl> else if ( settingId = = CSettings : : SETTING_PVRMANAGER_CHANNELMANAGER ) <nl> { <nl> void CPVRActionListener : : OnSettingAction ( const CSetting * setting ) <nl> } <nl> else if ( settingId = = CSettings : : SETTING_PVRMANAGER_CHANNELSCAN ) <nl> { <nl> - CPVRGUIActions : : GetInstance ( ) . StartChannelScan ( ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > StartChannelScan ( ) ; <nl> } <nl> else if ( settingId = = CSettings : : SETTING_PVRMENU_SEARCHICONS ) <nl> { <nl> void CPVRActionListener : : OnSettingAction ( const CSetting * setting ) <nl> } <nl> else if ( settingId = = CSettings : : SETTING_PVRCLIENT_MENUHOOK ) <nl> { <nl> - CPVRGUIActions : : GetInstance ( ) . ProcessMenuHooks ( CFileItemPtr ( ) ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ProcessMenuHooks ( CFileItemPtr ( ) ) ; <nl> } <nl> } <nl> <nl> mmm a / xbmc / pvr / PVRActionListener . h <nl> ppp b / xbmc / pvr / PVRActionListener . h <nl> namespace PVR <nl> class CPVRActionListener : public IActionListener , public ISettingCallback <nl> { <nl> public : <nl> - <nl> - void Init ( ) ; <nl> - void Deinit ( ) ; <nl> - <nl> - static CPVRActionListener & GetInstance ( ) ; <nl> + CPVRActionListener ( ) ; <nl> + virtual ~ CPVRActionListener ( ) ; <nl> <nl> / / IActionListener implementation <nl> bool OnAction ( const CAction & action ) override ; <nl> class CPVRActionListener : public IActionListener , public ISettingCallback <nl> void OnSettingAction ( const CSetting * setting ) override ; <nl> <nl> private : <nl> - CPVRActionListener ( ) = default ; <nl> - ~ CPVRActionListener ( ) = default ; <nl> CPVRActionListener ( const CPVRActionListener & ) = delete ; <nl> CPVRActionListener & operator = ( const CPVRActionListener & ) = delete ; <nl> } ; <nl> mmm a / xbmc / pvr / PVRContextMenus . cpp <nl> ppp b / xbmc / pvr / PVRContextMenus . cpp <nl> namespace PVR <nl> bool ShowInformation : : Execute ( const CFileItemPtr & item ) const <nl> { <nl> if ( item - > GetPVRRecordingInfoTag ( ) ) <nl> - return CPVRGUIActions : : GetInstance ( ) . ShowRecordingInfo ( item ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ShowRecordingInfo ( item ) ; <nl> <nl> - return CPVRGUIActions : : GetInstance ( ) . ShowEPGInfo ( item ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ShowEPGInfo ( item ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> namespace PVR <nl> <nl> bool FindSimilar : : Execute ( const CFileItemPtr & item ) const <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . FindSimilar ( item ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > FindSimilar ( item ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> namespace PVR <nl> <nl> bool PlayRecording : : Execute ( const CFileItemPtr & item ) const <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . PlayRecording ( item , true / * bCheckResume * / ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > PlayRecording ( item , true / * bCheckResume * / ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> namespace PVR <nl> <nl> bool StartRecording : : Execute ( const CFileItemPtr & item ) const <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . AddTimer ( item , false ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > AddTimer ( item , false ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> namespace PVR <nl> <nl> bool StopRecording : : Execute ( const CFileItemPtr & item ) const <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . StopRecording ( item ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > StopRecording ( item ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> namespace PVR <nl> <nl> bool RenameRecording : : Execute ( const CFileItemPtr & item ) const <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . RenameRecording ( item ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > RenameRecording ( item ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> namespace PVR <nl> <nl> bool DeleteRecording : : Execute ( const CFileItemPtr & item ) const <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . DeleteRecording ( item ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > DeleteRecording ( item ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> namespace PVR <nl> <nl> bool UndeleteRecording : : Execute ( const CFileItemPtr & item ) const <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . UndeleteRecording ( item ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > UndeleteRecording ( item ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> namespace PVR <nl> <nl> bool ToggleTimerState : : Execute ( const CFileItemPtr & item ) const <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . ToggleTimerState ( item ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ToggleTimerState ( item ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> namespace PVR <nl> <nl> bool AddTimerRule : : Execute ( const CFileItemPtr & item ) const <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . AddTimerRule ( item , true ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > AddTimerRule ( item , true ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> namespace PVR <nl> <nl> bool EditTimerRule : : Execute ( const CFileItemPtr & item ) const <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . EditTimerRule ( item ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > EditTimerRule ( item ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> namespace PVR <nl> { <nl> const CFileItemPtr parentTimer ( CServiceBroker : : GetPVRManager ( ) . Timers ( ) - > GetTimerRule ( item ) ) ; <nl> if ( parentTimer ) <nl> - return CPVRGUIActions : : GetInstance ( ) . DeleteTimerRule ( parentTimer ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > DeleteTimerRule ( parentTimer ) ; <nl> <nl> return false ; <nl> } <nl> namespace PVR <nl> <nl> bool EditTimer : : Execute ( const CFileItemPtr & item ) const <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . EditTimer ( item ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > EditTimer ( item ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> namespace PVR <nl> <nl> bool RenameTimer : : Execute ( const CFileItemPtr & item ) const <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . RenameTimer ( item ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > RenameTimer ( item ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> namespace PVR <nl> <nl> bool DeleteTimer : : Execute ( const CFileItemPtr & item ) const <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . DeleteTimer ( item ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > DeleteTimer ( item ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> namespace PVR <nl> <nl> bool PVRClientMenuHook : : Execute ( const CFileItemPtr & item ) const <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . ProcessMenuHooks ( item ) ; ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ProcessMenuHooks ( item ) ; ; <nl> } <nl> <nl> } / / namespace CONEXTMENUITEM <nl> mmm a / xbmc / pvr / PVRGUIActions . cpp <nl> ppp b / xbmc / pvr / PVRGUIActions . cpp <nl> namespace PVR <nl> bool DoRun ( const CFileItemPtr & item ) override { return CServiceBroker : : GetPVRManager ( ) . Recordings ( ) - > Undelete ( * item ) ; } <nl> } ; <nl> <nl> - CPVRGUIActions & CPVRGUIActions : : GetInstance ( ) <nl> - { <nl> - static CPVRGUIActions instance ; <nl> - return instance ; <nl> - } <nl> - <nl> CPVRGUIActions : : CPVRGUIActions ( ) <nl> : m_bChannelScanRunning ( false ) <nl> { <nl> mmm a / xbmc / pvr / PVRGUIActions . h <nl> ppp b / xbmc / pvr / PVRGUIActions . h <nl> namespace PVR <nl> class CPVRGUIActions <nl> { <nl> public : <nl> - / * ! <nl> - * @ brief Request an instance of class CPVRGUIActions . <nl> - * @ return the instance . <nl> - * / <nl> - static CPVRGUIActions & GetInstance ( ) ; <nl> + CPVRGUIActions ( ) ; <nl> + virtual ~ CPVRGUIActions ( ) = default ; <nl> <nl> / * ! <nl> * @ brief Open a dialog with epg information for a given item . <nl> namespace PVR <nl> CPVRChannelNumberInputHandler & GetChannelNumberInputHandler ( ) ; <nl> <nl> private : <nl> - CPVRGUIActions ( ) ; <nl> CPVRGUIActions ( const CPVRGUIActions & ) = delete ; <nl> CPVRGUIActions const & operator = ( CPVRGUIActions const & ) = delete ; <nl> - virtual ~ CPVRGUIActions ( ) { } <nl> <nl> / * ! <nl> * @ brief Open the timer settings dialog . <nl> mmm a / xbmc / pvr / PVRJobs . cpp <nl> ppp b / xbmc / pvr / PVRJobs . cpp <nl> namespace PVR <nl> <nl> bool CPVRSetRecordingOnChannelJob : : DoWork ( ) <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . SetRecordingOnChannel ( m_channel , m_bOnOff ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > SetRecordingOnChannel ( m_channel , m_bOnOff ) ; <nl> } <nl> <nl> bool CPVRContinueLastChannelJob : : DoWork ( ) <nl> { <nl> - return CPVRGUIActions : : GetInstance ( ) . ContinueLastPlayedChannel ( ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ContinueLastPlayedChannel ( ) ; <nl> } <nl> <nl> CPVREventlogJob : : CPVREventlogJob ( bool bNotifyUser , bool bError , const std : : string & label , const std : : string & msg , const std : : string & icon ) <nl> mmm a / xbmc / pvr / PVRManager . cpp <nl> ppp b / xbmc / pvr / PVRManager . cpp <nl> <nl> # include " pvr / channels / PVRChannel . h " <nl> # include " pvr / channels / PVRChannelGroupInternal . h " <nl> # include " pvr / channels / PVRChannelGroupsContainer . h " <nl> - # include " pvr / PVRActionListener . h " <nl> # include " pvr / PVRDatabase . h " <nl> + # include " pvr / PVRGUIActions . h " <nl> # include " pvr / PVRGUIInfo . h " <nl> # include " pvr / PVRJobs . h " <nl> # include " pvr / recordings / PVRRecordings . h " <nl> using KODI : : MESSAGING : : HELPERS : : DialogResponse ; <nl> <nl> CPVRManagerJobQueue : : CPVRManagerJobQueue ( ) <nl> : m_triggerEvent ( false ) , <nl> - m_bStopped ( true ) <nl> + m_bStopped ( true ) <nl> { <nl> } <nl> <nl> bool CPVRManagerJobQueue : : WaitForJobs ( unsigned int milliSeconds ) <nl> CPVRManager : : CPVRManager ( void ) : <nl> CThread ( " PVRManager " ) , <nl> m_addons ( new CPVRClients ) , <nl> + m_guiActions ( new CPVRGUIActions ) , <nl> m_bFirstStart ( true ) , <nl> m_bIsSwitchingChannels ( false ) , <nl> m_bEpgsCreated ( false ) , <nl> void CPVRManager : : OnSettingChanged ( const CSetting * setting ) <nl> } <nl> } <nl> <nl> - void CPVRManager : : Clear ( void ) <nl> + CPVRGUIActionsPtr CPVRManager : : GUIActions ( void ) const <nl> { <nl> - g_application . UnregisterActionListener ( & CPVRActionListener : : GetInstance ( ) ) ; <nl> + / / note : m_guiActions is const ( only set / reset in ctor / dtor ) . no need for a lock here . <nl> + return m_guiActions ; <nl> + } <nl> <nl> + void CPVRManager : : Clear ( void ) <nl> + { <nl> m_pendingUpdates . Clear ( ) ; <nl> <nl> CSingleLock lock ( m_critSection ) ; <nl> void CPVRManager : : Init ( ) <nl> settingSet . insert ( CSettings : : SETTING_PVRPOWERMANAGEMENT_SETWAKEUPCMD ) ; <nl> CServiceBroker : : GetSettings ( ) . RegisterCallback ( this , settingSet ) ; <nl> <nl> - / / Create and init action listener <nl> - CPVRActionListener : : GetInstance ( ) . Init ( ) ; <nl> - <nl> / / Note : we ' re holding the progress bar dialog instance pointer in a member because it is needed by pvr core <nl> / / components . The latter might run in a different thread than the gui and g_windowManager . GetWindow ( ) <nl> / / locks the global graphics mutex , which easily can lead to deadlocks . <nl> void CPVRManager : : Deinit ( ) <nl> <nl> / / release addons <nl> m_addons . reset ( ) ; <nl> - <nl> - / / deinit action listener <nl> - CPVRActionListener : : GetInstance ( ) . Deinit ( ) ; <nl> } <nl> <nl> CPVRManager : : ManagerState CPVRManager : : GetState ( void ) const <nl> void CPVRManager : : PublishEvent ( PVREvent event ) <nl> <nl> void CPVRManager : : Process ( void ) <nl> { <nl> - / * register application action listener * / <nl> - { <nl> - CSingleExit exit ( m_critSection ) ; <nl> - g_application . RegisterActionListener ( & CPVRActionListener : : GetInstance ( ) ) ; <nl> - } <nl> - <nl> g_EpgContainer . Stop ( ) ; <nl> <nl> / * load the pvr data from the db and clients if it ' s not already loaded * / <nl> mmm a / xbmc / pvr / PVRManager . h <nl> ppp b / xbmc / pvr / PVRManager . h <nl> <nl> # include " utils / JobManager . h " <nl> # include " utils / Observer . h " <nl> <nl> + # include " pvr / PVRActionListener . h " <nl> # include " pvr / PVREvent . h " <nl> # include " pvr / PVRTypes . h " <nl> # include " pvr / recordings / PVRRecording . h " <nl> namespace PVR <nl> * / <nl> CPVRClientsPtr Clients ( void ) const ; <nl> <nl> + / * ! <nl> + * @ brief Get access to the pvr gui actions . <nl> + * @ return The gui actions . <nl> + * / <nl> + CPVRGUIActionsPtr GUIActions ( void ) const ; <nl> + <nl> / * ! <nl> * @ brief Init PVRManager . <nl> * / <nl> namespace PVR <nl> CPVRTimersPtr m_timers ; / * ! < pointer to the timers container * / <nl> CPVRClientsPtr m_addons ; / * ! < pointer to the pvr addon container * / <nl> std : : unique_ptr < CPVRGUIInfo > m_guiInfo ; / * ! < pointer to the guiinfo data * / <nl> + CPVRGUIActionsPtr m_guiActions ; / * ! < pointer to the pvr gui actions * / <nl> / / @ } <nl> <nl> CPVRManagerJobQueue m_pendingUpdates ; / * ! < vector of pending pvr updates * / <nl> namespace PVR <nl> / / settings cache <nl> bool m_bSettingPowerManagementEnabled ; / / SETTING_PVRPOWERMANAGEMENT_ENABLED <nl> std : : string m_strSettingWakeupCommand ; / / SETTING_PVRPOWERMANAGEMENT_SETWAKEUPCMD <nl> + CPVRActionListener m_actionListener ; <nl> } ; <nl> } <nl> mmm a / xbmc / pvr / PVRTypes . h <nl> ppp b / xbmc / pvr / PVRTypes . h <nl> namespace PVR <nl> class CPVRTimers ; <nl> typedef std : : shared_ptr < CPVRTimers > CPVRTimersPtr ; <nl> <nl> + class CPVRGUIActions ; <nl> + typedef std : : shared_ptr < CPVRGUIActions > CPVRGUIActionsPtr ; <nl> + <nl> } / / namespace PVR <nl> <nl> mmm a / xbmc / pvr / dialogs / GUIDialogPVRChannelGuide . cpp <nl> ppp b / xbmc / pvr / dialogs / GUIDialogPVRChannelGuide . cpp <nl> void CGUIDialogPVRChannelGuide : : ShowInfo ( int item ) <nl> if ( item < 0 | | item > = ( int ) m_vecItems - > Size ( ) ) <nl> return ; <nl> <nl> - CPVRGUIActions : : GetInstance ( ) . ShowEPGInfo ( m_vecItems - > Get ( item ) ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ShowEPGInfo ( m_vecItems - > Get ( item ) ) ; <nl> } <nl> <nl> void CGUIDialogPVRChannelGuide : : OnWindowLoaded ( ) <nl> mmm a / xbmc / pvr / dialogs / GUIDialogPVRChannelManager . cpp <nl> ppp b / xbmc / pvr / dialogs / GUIDialogPVRChannelManager . cpp <nl> bool CGUIDialogPVRChannelManager : : OnClickButtonRadioParentalLocked ( CGUIMessage & <nl> bool selected ( msg . GetParam1 ( ) = = 1 ) ; <nl> <nl> / / ask for PIN first <nl> - if ( ! CPVRGUIActions : : GetInstance ( ) . CheckParentalPIN ( ) ) <nl> + if ( ! CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > CheckParentalPIN ( ) ) <nl> { / / failed - reset to previous <nl> SET_CONTROL_SELECTED ( GetID ( ) , RADIOBUTTON_PARENTAL_LOCK , ! selected ) ; <nl> return false ; <nl> mmm a / xbmc / pvr / dialogs / GUIDialogPVRChannelsOSD . cpp <nl> ppp b / xbmc / pvr / dialogs / GUIDialogPVRChannelsOSD . cpp <nl> void CGUIDialogPVRChannelsOSD : : GotoChannel ( int item ) <nl> return ; <nl> <nl> Close ( ) ; <nl> - CPVRGUIActions : : GetInstance ( ) . SwitchToChannel ( m_vecItems - > Get ( item ) , true / * bCheckResume * / ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > SwitchToChannel ( m_vecItems - > Get ( item ) , true / * bCheckResume * / ) ; <nl> m_group = GetPlayingGroup ( ) ; <nl> } <nl> <nl> void CGUIDialogPVRChannelsOSD : : ShowInfo ( int item ) <nl> if ( item < 0 | | item > = ( int ) m_vecItems - > Size ( ) ) <nl> return ; <nl> <nl> - CPVRGUIActions : : GetInstance ( ) . ShowEPGInfo ( m_vecItems - > Get ( item ) ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ShowEPGInfo ( m_vecItems - > Get ( item ) ) ; <nl> } <nl> <nl> void CGUIDialogPVRChannelsOSD : : OnWindowLoaded ( ) <nl> mmm a / xbmc / pvr / dialogs / GUIDialogPVRGuideInfo . cpp <nl> ppp b / xbmc / pvr / dialogs / GUIDialogPVRGuideInfo . cpp <nl> bool CGUIDialogPVRGuideInfo : : OnClickButtonChannelGuide ( CGUIMessage & message ) <nl> return bReturn ; <nl> } <nl> <nl> - bReturn = CPVRGUIActions : : GetInstance ( ) . ShowChannelEPG ( CFileItemPtr ( new CFileItem ( m_progItem ) ) ) ; <nl> + bReturn = CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ShowChannelEPG ( CFileItemPtr ( new CFileItem ( m_progItem ) ) ) ; <nl> } <nl> <nl> return bReturn ; <nl> bool CGUIDialogPVRGuideInfo : : OnClickButtonRecord ( CGUIMessage & message ) <nl> { <nl> const CFileItemPtr item ( new CFileItem ( timerTag ) ) ; <nl> if ( timerTag - > IsRecording ( ) ) <nl> - bReturn = CPVRGUIActions : : GetInstance ( ) . StopRecording ( item ) ; <nl> + bReturn = CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > StopRecording ( item ) ; <nl> else <nl> - bReturn = CPVRGUIActions : : GetInstance ( ) . DeleteTimer ( item ) ; <nl> + bReturn = CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > DeleteTimer ( item ) ; <nl> } <nl> else <nl> { <nl> const CFileItemPtr item ( new CFileItem ( m_progItem ) ) ; <nl> - bReturn = CPVRGUIActions : : GetInstance ( ) . AddTimer ( item , false ) ; <nl> + bReturn = CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > AddTimer ( item , false ) ; <nl> } <nl> } <nl> <nl> bool CGUIDialogPVRGuideInfo : : OnClickButtonAddTimer ( CGUIMessage & message ) <nl> if ( m_progItem & & ! m_progItem - > Timer ( ) ) <nl> { <nl> const CFileItemPtr item ( new CFileItem ( m_progItem ) ) ; <nl> - bReturn = CPVRGUIActions : : GetInstance ( ) . AddTimerRule ( item , true ) ; <nl> + bReturn = CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > AddTimerRule ( item , true ) ; <nl> } <nl> } <nl> <nl> bool CGUIDialogPVRGuideInfo : : OnClickButtonPlay ( CGUIMessage & message ) <nl> <nl> const CFileItemPtr item ( new CFileItem ( m_progItem ) ) ; <nl> if ( message . GetSenderId ( ) = = CONTROL_BTN_PLAY_RECORDING ) <nl> - CPVRGUIActions : : GetInstance ( ) . PlayRecording ( item , true / * bCheckResume * / ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > PlayRecording ( item , true / * bCheckResume * / ) ; <nl> else <nl> - CPVRGUIActions : : GetInstance ( ) . SwitchToChannel ( item , true / * bCheckResume * / ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > SwitchToChannel ( item , true / * bCheckResume * / ) ; <nl> <nl> bReturn = true ; <nl> } <nl> bool CGUIDialogPVRGuideInfo : : OnClickButtonFind ( CGUIMessage & message ) <nl> bool bReturn = false ; <nl> <nl> if ( message . GetSenderId ( ) = = CONTROL_BTN_FIND ) <nl> - return CPVRGUIActions : : GetInstance ( ) . FindSimilar ( CFileItemPtr ( new CFileItem ( m_progItem ) ) , this ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > FindSimilar ( CFileItemPtr ( new CFileItem ( m_progItem ) ) , this ) ; <nl> <nl> return bReturn ; <nl> } <nl> mmm a / xbmc / pvr / dialogs / GUIDialogPVRRecordingInfo . cpp <nl> ppp b / xbmc / pvr / dialogs / GUIDialogPVRRecordingInfo . cpp <nl> <nl> * / <nl> <nl> # include " FileItem . h " <nl> + # include " ServiceBroker . h " <nl> # include " pvr / PVRGUIActions . h " <nl> + # include " pvr / PVRManager . h " <nl> <nl> # include " GUIDialogPVRRecordingInfo . h " <nl> <nl> bool CGUIDialogPVRRecordingInfo : : OnClickButtonPlay ( CGUIMessage & message ) <nl> Close ( ) ; <nl> <nl> if ( m_recordItem ) <nl> - CPVRGUIActions : : GetInstance ( ) . PlayRecording ( m_recordItem , true / * check resume * / ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > PlayRecording ( m_recordItem , true / * check resume * / ) ; <nl> <nl> bReturn = true ; <nl> } <nl> CFileItemPtr CGUIDialogPVRRecordingInfo : : GetCurrentListItem ( int offset ) <nl> <nl> void CGUIDialogPVRRecordingInfo : : ShowFor ( const CFileItemPtr & item ) <nl> { <nl> - CPVRGUIActions : : GetInstance ( ) . ShowRecordingInfo ( item ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ShowRecordingInfo ( item ) ; <nl> } <nl> <nl> mmm a / xbmc / pvr / windows / GUIWindowPVRChannels . cpp <nl> ppp b / xbmc / pvr / windows / GUIWindowPVRChannels . cpp <nl> bool CGUIWindowPVRChannels : : OnMessage ( CGUIMessage & message ) <nl> case ACTION_SELECT_ITEM : <nl> case ACTION_MOUSE_LEFT_CLICK : <nl> case ACTION_PLAY : <nl> - CPVRGUIActions : : GetInstance ( ) . SwitchToChannel ( m_vecItems - > Get ( iItem ) , true ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > SwitchToChannel ( m_vecItems - > Get ( iItem ) , true ) ; <nl> break ; <nl> case ACTION_SHOW_INFO : <nl> - CPVRGUIActions : : GetInstance ( ) . ShowEPGInfo ( m_vecItems - > Get ( iItem ) ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ShowEPGInfo ( m_vecItems - > Get ( iItem ) ) ; <nl> break ; <nl> case ACTION_DELETE_ITEM : <nl> - CPVRGUIActions : : GetInstance ( ) . HideChannel ( m_vecItems - > Get ( iItem ) ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > HideChannel ( m_vecItems - > Get ( iItem ) ) ; <nl> break ; <nl> case ACTION_CONTEXT_MENU : <nl> case ACTION_MOUSE_RIGHT_CLICK : <nl> mmm a / xbmc / pvr / windows / GUIWindowPVRGuide . cpp <nl> ppp b / xbmc / pvr / windows / GUIWindowPVRGuide . cpp <nl> bool CGUIWindowPVRGuide : : OnMessage ( CGUIMessage & message ) <nl> bReturn = true ; <nl> break ; <nl> case EPG_SELECT_ACTION_SWITCH : <nl> - CPVRGUIActions : : GetInstance ( ) . SwitchToChannel ( pItem , true ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > SwitchToChannel ( pItem , true ) ; <nl> bReturn = true ; <nl> break ; <nl> case EPG_SELECT_ACTION_PLAY_RECORDING : <nl> - CPVRGUIActions : : GetInstance ( ) . PlayRecording ( pItem , true ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > PlayRecording ( pItem , true ) ; <nl> bReturn = true ; <nl> break ; <nl> case EPG_SELECT_ACTION_INFO : <nl> - CPVRGUIActions : : GetInstance ( ) . ShowEPGInfo ( pItem ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ShowEPGInfo ( pItem ) ; <nl> bReturn = true ; <nl> break ; <nl> case EPG_SELECT_ACTION_RECORD : <nl> - CPVRGUIActions : : GetInstance ( ) . ToggleTimer ( pItem ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ToggleTimer ( pItem ) ; <nl> bReturn = true ; <nl> break ; <nl> case EPG_SELECT_ACTION_SMART_SELECT : <nl> bool CGUIWindowPVRGuide : : OnMessage ( CGUIMessage & message ) <nl> if ( start < = now & & now < = end ) <nl> { <nl> / / current event <nl> - CPVRGUIActions : : GetInstance ( ) . SwitchToChannel ( pItem , true ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > SwitchToChannel ( pItem , true ) ; <nl> } <nl> else if ( now < start ) <nl> { <nl> / / future event <nl> if ( tag - > HasTimer ( ) ) <nl> - CPVRGUIActions : : GetInstance ( ) . EditTimer ( pItem ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > EditTimer ( pItem ) ; <nl> else <nl> - CPVRGUIActions : : GetInstance ( ) . AddTimer ( pItem , false ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > AddTimer ( pItem , false ) ; <nl> } <nl> else <nl> { <nl> / / past event <nl> if ( tag - > HasRecording ( ) ) <nl> - CPVRGUIActions : : GetInstance ( ) . PlayRecording ( pItem , true ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > PlayRecording ( pItem , true ) ; <nl> else <nl> - CPVRGUIActions : : GetInstance ( ) . ShowEPGInfo ( pItem ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ShowEPGInfo ( pItem ) ; <nl> } <nl> bReturn = true ; <nl> } <nl> bool CGUIWindowPVRGuide : : OnMessage ( CGUIMessage & message ) <nl> } <nl> break ; <nl> case ACTION_SHOW_INFO : <nl> - CPVRGUIActions : : GetInstance ( ) . ShowEPGInfo ( pItem ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ShowEPGInfo ( pItem ) ; <nl> bReturn = true ; <nl> break ; <nl> case ACTION_PLAY : <nl> - CPVRGUIActions : : GetInstance ( ) . PlayRecording ( pItem , true ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > PlayRecording ( pItem , true ) ; <nl> bReturn = true ; <nl> break ; <nl> case ACTION_RECORD : <nl> - CPVRGUIActions : : GetInstance ( ) . ToggleTimer ( pItem ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ToggleTimer ( pItem ) ; <nl> bReturn = true ; <nl> break ; <nl> case ACTION_PVR_SHOW_TIMER_RULE : <nl> - CPVRGUIActions : : GetInstance ( ) . AddTimerRule ( pItem , true ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > AddTimerRule ( pItem , true ) ; <nl> bReturn = true ; <nl> break ; <nl> case ACTION_CONTEXT_MENU : <nl> bool CGUIWindowPVRGuide : : OnMessage ( CGUIMessage & message ) <nl> const CFileItemPtr item ( epgGridContainer - > GetSelectedChannelItem ( ) ) ; <nl> if ( item ) <nl> { <nl> - CPVRGUIActions : : GetInstance ( ) . SwitchToChannel ( item , true ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > SwitchToChannel ( item , true ) ; <nl> bReturn = true ; <nl> } <nl> } <nl> mmm a / xbmc / pvr / windows / GUIWindowPVRRecordings . cpp <nl> ppp b / xbmc / pvr / windows / GUIWindowPVRRecordings . cpp <nl> bool CGUIWindowPVRRecordings : : OnMessage ( CGUIMessage & message ) <nl> <nl> if ( message . GetParam1 ( ) = = ACTION_PLAY ) <nl> { <nl> - CPVRGUIActions : : GetInstance ( ) . PlayRecording ( item , true / * check resume * / ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > PlayRecording ( item , true / * check resume * / ) ; <nl> bReturn = true ; <nl> } <nl> else <nl> bool CGUIWindowPVRRecordings : : OnMessage ( CGUIMessage & message ) <nl> bReturn = true ; <nl> break ; <nl> case SELECT_ACTION_PLAY_OR_RESUME : <nl> - CPVRGUIActions : : GetInstance ( ) . PlayRecording ( item , true / * check resume * / ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > PlayRecording ( item , true / * check resume * / ) ; <nl> bReturn = true ; <nl> break ; <nl> case SELECT_ACTION_RESUME : <nl> - CPVRGUIActions : : GetInstance ( ) . ResumePlayRecording ( item , true / * fall back to play if no resume possible * / ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ResumePlayRecording ( item , true / * fall back to play if no resume possible * / ) ; <nl> bReturn = true ; <nl> break ; <nl> case SELECT_ACTION_INFO : <nl> - CPVRGUIActions : : GetInstance ( ) . ShowRecordingInfo ( item ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ShowRecordingInfo ( item ) ; <nl> bReturn = true ; <nl> break ; <nl> default : <nl> bool CGUIWindowPVRRecordings : : OnMessage ( CGUIMessage & message ) <nl> bReturn = true ; <nl> break ; <nl> case ACTION_SHOW_INFO : <nl> - CPVRGUIActions : : GetInstance ( ) . ShowRecordingInfo ( item ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ShowRecordingInfo ( item ) ; <nl> bReturn = true ; <nl> break ; <nl> case ACTION_DELETE_ITEM : <nl> - CPVRGUIActions : : GetInstance ( ) . DeleteRecording ( item ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > DeleteRecording ( item ) ; <nl> bReturn = true ; <nl> break ; <nl> default : <nl> bool CGUIWindowPVRRecordings : : OnContextButtonDeleteAll ( CFileItem * item , CONTEXT_ <nl> { <nl> if ( button = = CONTEXT_BUTTON_DELETE_ALL ) <nl> { <nl> - CPVRGUIActions : : GetInstance ( ) . DeleteAllRecordingsFromTrash ( ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > DeleteAllRecordingsFromTrash ( ) ; <nl> return true ; <nl> } <nl> <nl> mmm a / xbmc / pvr / windows / GUIWindowPVRSearch . cpp <nl> ppp b / xbmc / pvr / windows / GUIWindowPVRSearch . cpp <nl> <nl> * <nl> * / <nl> <nl> + # include " ServiceBroker . h " <nl> # include " dialogs / GUIDialogOK . h " <nl> # include " dialogs / GUIDialogProgress . h " <nl> # include " epg / EpgContainer . h " <nl> bool CGUIWindowPVRSearch : : OnMessage ( CGUIMessage & message ) <nl> if ( URIUtils : : PathEquals ( pItem - > GetPath ( ) , " pvr : / / guide / searchresults / search / " ) ) <nl> OpenDialogSearch ( ) ; <nl> else <nl> - CPVRGUIActions : : GetInstance ( ) . ShowEPGInfo ( pItem ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ShowEPGInfo ( pItem ) ; <nl> return true ; <nl> } <nl> <nl> bool CGUIWindowPVRSearch : : OnMessage ( CGUIMessage & message ) <nl> return true ; <nl> <nl> case ACTION_RECORD : <nl> - CPVRGUIActions : : GetInstance ( ) . ToggleTimer ( pItem ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > ToggleTimer ( pItem ) ; <nl> return true ; <nl> } <nl> } <nl> mmm a / xbmc / pvr / windows / GUIWindowPVRTimersBase . cpp <nl> ppp b / xbmc / pvr / windows / GUIWindowPVRTimersBase . cpp <nl> bool CGUIWindowPVRTimersBase : : OnMessage ( CGUIMessage & message ) <nl> OnPopupMenu ( iItem ) ; <nl> break ; <nl> case ACTION_DELETE_ITEM : <nl> - CPVRGUIActions : : GetInstance ( ) . DeleteTimer ( m_vecItems - > Get ( iItem ) ) ; <nl> + CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > DeleteTimer ( m_vecItems - > Get ( iItem ) ) ; <nl> break ; <nl> default : <nl> bReturn = false ; <nl> bool CGUIWindowPVRTimersBase : : ActionShowTimer ( const CFileItemPtr & item ) <nl> create a new timer and open settings dialog , otherwise <nl> open settings for selected timer entry * / <nl> if ( URIUtils : : PathEquals ( item - > GetPath ( ) , CPVRTimersPath : : PATH_ADDTIMER ) ) <nl> - bReturn = CPVRGUIActions : : GetInstance ( ) . AddTimer ( m_bRadio ) ; <nl> + bReturn = CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > AddTimer ( m_bRadio ) ; <nl> else <nl> - bReturn = CPVRGUIActions : : GetInstance ( ) . EditTimer ( item ) ; <nl> + bReturn = CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > EditTimer ( item ) ; <nl> <nl> return bReturn ; <nl> } <nl> mmm a / xbmc / settings / SettingConditions . cpp <nl> ppp b / xbmc / settings / SettingConditions . cpp <nl> <nl> # include " peripherals / Peripherals . h " <nl> # include " profiles / ProfilesManager . h " <nl> # include " pvr / PVRGUIActions . h " <nl> + # include " pvr / PVRManager . h " <nl> # include " settings / SettingAddon . h " <nl> # if defined ( HAS_LIBAMCODEC ) <nl> # include " utils / AMLUtils . h " <nl> bool CheckMasterLock ( const std : : string & condition , const std : : string & value , con <nl> <nl> bool CheckPVRParentalPin ( const std : : string & condition , const std : : string & value , const CSetting * setting , void * data ) <nl> { <nl> - return PVR : : CPVRGUIActions : : GetInstance ( ) . CheckParentalPIN ( ) ; <nl> + return CServiceBroker : : GetPVRManager ( ) . GUIActions ( ) - > CheckParentalPIN ( ) ; <nl> } <nl> <nl> bool HasPeripherals ( const std : : string & condition , const std : : string & value , const CSetting * setting , void * data ) <nl> | [ PVR ] Rework CPVRActionListener and CPVRGUIActions lifecycle ( no more static instances ) . | xbmc/xbmc | 9a2b9c12cefc0b951177572e3bd46a1ea02e7e5a | 2017-03-29T18:46:24Z |
mmm a / tensorflow / go / op / wrappers . go <nl> ppp b / tensorflow / go / op / wrappers . go <nl> func Abs ( scope * Scope , x tf . Output ) ( y tf . Output ) { <nl> type RandomPoissonAttr func ( optionalAttr ) <nl> <nl> / / RandomPoissonSeed sets the optional seed attribute to value . <nl> - / / <nl> - / / value : If either ` seed ` or ` seed2 ` are set to be non - zero , the random number <nl> - / / generator is seeded by the given seed . Otherwise , it is seeded by a <nl> - / / random seed . <nl> / / If not specified , defaults to 0 <nl> func RandomPoissonSeed ( value int64 ) RandomPoissonAttr { <nl> return func ( m optionalAttr ) { <nl> func RandomPoissonSeed ( value int64 ) RandomPoissonAttr { <nl> } <nl> <nl> / / RandomPoissonSeed2 sets the optional seed2 attribute to value . <nl> - / / <nl> - / / value : A second seed to avoid seed collision . <nl> / / If not specified , defaults to 0 <nl> func RandomPoissonSeed2 ( value int64 ) RandomPoissonAttr { <nl> return func ( m optionalAttr ) { <nl> func RandomPoissonSeed2 ( value int64 ) RandomPoissonAttr { <nl> } <nl> } <nl> <nl> - / / Outputs random values from the Poisson distribution ( s ) described by rate . <nl> - / / <nl> - / / This op uses two algorithms , depending on rate . If rate > = 10 , then <nl> - / / the algorithm by Hormann is used to acquire samples via <nl> - / / transformation - rejection . <nl> - / / See http : / / www . sciencedirect . com / science / article / pii / 0167668793909974 . <nl> - / / <nl> - / / Otherwise , Knuth ' s algorithm is used to acquire samples via multiplying uniform <nl> - / / random variables . <nl> - / / See Donald E . Knuth ( 1969 ) . Seminumerical Algorithms . The Art of Computer <nl> - / / Programming , Volume 2 . Addison Wesley <nl> + / / Use RandomPoissonV2 instead . <nl> / / <nl> - / / Arguments : <nl> - / / shape : 1 - D integer tensor . Shape of independent samples to draw from each <nl> - / / distribution described by the shape parameters given in rate . <nl> - / / rate : A tensor in which each scalar is a " rate " parameter describing the <nl> - / / associated poisson distribution . <nl> - / / <nl> - / / Returns A tensor with shape ` shape + shape ( rate ) ` . Each slice <nl> - / / ` [ : , . . . , : , i0 , i1 , . . . iN ] ` contains the samples drawn for <nl> - / / ` rate [ i0 , i1 , . . . iN ] ` . The dtype of the output matches the dtype of <nl> - / / rate . <nl> + / / DEPRECATED at GraphDef version 25 : Replaced by RandomPoissonV2 <nl> func RandomPoisson ( scope * Scope , shape tf . Output , rate tf . Output , optional . . . RandomPoissonAttr ) ( output tf . Output ) { <nl> if scope . Err ( ) ! = nil { <nl> return <nl> | Go : Update generated wrapper functions for TensorFlow ops . | tensorflow/tensorflow | 0cddb9bcafed09bae45dc951e799724f80ecf5f0 | 2017-10-31T19:36:46Z |
diff - - git a / doc / tutorials / core / mat - the basic image container / mat - the basic image container . rst b / doc / tutorials / core / mat - the basic image container / mat - the basic image container . rst <nl> mmm a / doc / tutorials / core / mat - the basic image container / mat - the basic image container . rst <nl> ppp b / doc / tutorials / core / mat - the basic image container / mat - the basic image container . rst <nl> However , they are many color systems each with their own advantages : <nl> * YCrCb is used by the popular JPEG image format . <nl> * CIE L * a * b * is a perceptually uniform color space , which comes handy if you need to measure the * distance * of a given color to another color . <nl> <nl> - Now each of the building components has their own valid domains . This leads to the data type used . How we store a component defines just how fine control we have over its domain . The smallest data type possible is * char * , which means one byte or 8 bits . This may be signed ( so can store values from 0 to 255 ) or unsigned ( values from - 127 to + 127 ) . Although in case of three components this already gives 16 million possible colors to represent ( like in case of RGB ) we may acquire an even finer control by using the float ( 4 byte = 32 bit ) or double ( 8 byte = 64 bit ) data types for each component . Nevertheless , remember that increasing the size of a component also increases the size of the whole picture in the memory . <nl> + Now each of the building components has their own valid domains . This leads to the data type used . How we store a component defines just how fine control we have over its domain . The smallest data type possible is * char * , which means one byte or 8 bits . This may be unsigned ( so can store values from 0 to 255 ) or signed ( values from - 127 to + 127 ) . Although in case of three components this already gives 16 million possible colors to represent ( like in case of RGB ) we may acquire an even finer control by using the float ( 4 byte = 32 bit ) or double ( 8 byte = 64 bit ) data types for each component . Nevertheless , remember that increasing the size of a component also increases the size of the whole picture in the memory . <nl> <nl> Creating explicitly a * Mat * object <nl> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> | # fixed 1644 | opencv/opencv | 042a834d9dda2a8449c1932da8bc5862b2005101 | 2012-03-02T18:24:46Z |
mmm a / bada1 . 2_copy_libs . bat <nl> ppp b / bada1 . 2_copy_libs . bat <nl> copy CocosDenshion \ proj . bada \ sdk1 . 2 \ . Simulator - Debug \ * . a HelloWorld \ bada \ sdk1 . 2 \ <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ libjpeg \ sdk1 . 2 \ . Simulator - Debug \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Simulator - Debug <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ png \ sdk1 . 2 \ . Simulator - Debug \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Simulator - Debug <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ zlib \ sdk1 . 2 \ . Simulator - Debug \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Simulator - Debug <nl> - copy cocos2dx \ proj . bada \ sdk1 . 2 \ . Simulator - Debug \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Simulator - Debug <nl> + : : copy cocos2dx \ proj . bada \ sdk1 . 2 \ . Simulator - Debug \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Simulator - Debug <nl> <nl> copy Box2D \ proj . bada \ sdk1 . 2 \ . Target - Debug \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Target - Debug <nl> copy chipmunk \ proj . bada \ sdk1 . 2 \ . Target - Debug \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Target - Debug <nl> copy CocosDenshion \ proj . bada \ sdk1 . 2 \ . Target - Debug \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ libjpeg \ sdk1 . 2 \ . Target - Debug \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Target - Debug <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ png \ sdk1 . 2 \ . Target - Debug \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Target - Debug <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ zlib \ sdk1 . 2 \ . Target - Debug \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Target - Debug <nl> - copy cocos2dx \ proj . bada \ sdk1 . 2 \ . Target - Debug \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Target - Debug <nl> + : : copy cocos2dx \ proj . bada \ sdk1 . 2 \ . Target - Debug \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Target - Debug <nl> <nl> copy Box2D \ proj . bada \ sdk1 . 2 \ . Target - Release \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Target - Release <nl> copy chipmunk \ proj . bada \ sdk1 . 2 \ . Target - Release \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Target - Release <nl> copy CocosDenshion \ proj . bada \ sdk1 . 2 \ . Target - Release \ * . a HelloWorld \ bada \ sdk1 . 2 \ l <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ libjpeg \ sdk1 . 2 \ . Target - Release \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Target - Release <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ png \ sdk1 . 2 \ . Target - Release \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Target - Release <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ zlib \ sdk1 . 2 \ . Target - Release \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Target - Release <nl> - copy cocos2dx \ proj . bada \ sdk1 . 2 \ . Target - Release \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Target - Release <nl> + : : copy cocos2dx \ proj . bada \ sdk1 . 2 \ . Target - Release \ * . a HelloWorld \ bada \ sdk1 . 2 \ lib \ Target - Release <nl> <nl> : : copy libs to tests project <nl> <nl> copy CocosDenshion \ proj . bada \ sdk1 . 2 \ . Simulator - Debug \ * . a tests \ test . bada \ sdk1 . 2 \ <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ libjpeg \ sdk1 . 2 \ . Simulator - Debug \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Simulator - Debug <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ png \ sdk1 . 2 \ . Simulator - Debug \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Simulator - Debug <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ zlib \ sdk1 . 2 \ . Simulator - Debug \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Simulator - Debug <nl> - copy cocos2dx \ proj . bada \ sdk1 . 2 \ . Simulator - Debug \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Simulator - Debug <nl> + : : copy cocos2dx \ proj . bada \ sdk1 . 2 \ . Simulator - Debug \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Simulator - Debug <nl> <nl> copy Box2D \ proj . bada \ sdk1 . 2 \ . Target - Debug \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Target - Debug <nl> copy chipmunk \ proj . bada \ sdk1 . 2 \ . Target - Debug \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Target - Debug <nl> copy CocosDenshion \ proj . bada \ sdk1 . 2 \ . Target - Debug \ * . a tests \ test . bada \ sdk1 . 2 \ lib <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ libjpeg \ sdk1 . 2 \ . Target - Debug \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Target - Debug <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ png \ sdk1 . 2 \ . Target - Debug \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Target - Debug <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ zlib \ sdk1 . 2 \ . Target - Debug \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Target - Debug <nl> - copy cocos2dx \ proj . bada \ sdk1 . 2 \ . Target - Debug \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Target - Debug <nl> + : : copy cocos2dx \ proj . bada \ sdk1 . 2 \ . Target - Debug \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Target - Debug <nl> <nl> copy Box2D \ proj . bada \ sdk1 . 2 \ . Target - Release \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Target - Release <nl> copy chipmunk \ proj . bada \ sdk1 . 2 \ . Target - Release \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Target - Release <nl> copy CocosDenshion \ proj . bada \ sdk1 . 2 \ . Target - Release \ * . a tests \ test . bada \ sdk1 . 2 \ l <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ libjpeg \ sdk1 . 2 \ . Target - Release \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Target - Release <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ png \ sdk1 . 2 \ . Target - Release \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Target - Release <nl> copy cocos2dx \ platform \ third_party \ bada \ src \ zlib \ sdk1 . 2 \ . Target - Release \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Target - Release <nl> - copy cocos2dx \ proj . bada \ sdk1 . 2 \ . Target - Release \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Target - Release <nl> + : : copy cocos2dx \ proj . bada \ sdk1 . 2 \ . Target - Release \ * . a tests \ test . bada \ sdk1 . 2 \ lib \ Target - Release <nl> <nl> pause <nl> \ No newline at end of file <nl> mmm a / cocos2dx / cocoa / CCNS . cpp <nl> ppp b / cocos2dx / cocoa / CCNS . cpp <nl> THE SOFTWARE . <nl> # include < vector > <nl> # include < string . h > <nl> # include < stdlib . h > <nl> - # include < string . h > <nl> + <nl> <nl> typedef std : : vector < std : : string > strArray ; <nl> <nl> mmm a / cocos2dx / platform / bada / CCEGLView_bada . cpp <nl> ppp b / cocos2dx / platform / bada / CCEGLView_bada . cpp <nl> static int badaOrientation [ 4 ] = { <nl> <nl> int CCEGLView : : setDeviceOrientation ( int eOritation ) <nl> { <nl> - / / m_nowOrientation = ( Orientation ) badaOrientation [ eOritation ] ; <nl> - / / SetOrientation ( m_nowOrientation ) ; <nl> - / / <nl> - / / if ( m_nowOrientation = = ORIENTATION_PORTRAIT | | m_nowOrientation = = ORIENTATION_PORTRAIT_REVERSE ) <nl> - / / { <nl> - / / resize ( MIN ( m_sSizeInPixel . width , m_sSizeInPixel . height ) , MAX ( m_sSizeInPixel . width , m_sSizeInPixel . height ) ) ; <nl> - / / } <nl> - / / else <nl> - / / { <nl> - / / resize ( MAX ( m_sSizeInPixel . width , m_sSizeInPixel . height ) , MIN ( m_sSizeInPixel . width , m_sSizeInPixel . height ) ) ; <nl> - / / } <nl> + m_nowOrientation = ( Orientation ) badaOrientation [ eOritation ] ; <nl> + SetOrientation ( m_nowOrientation ) ; <nl> + <nl> + if ( m_nowOrientation = = ORIENTATION_PORTRAIT | | m_nowOrientation = = ORIENTATION_PORTRAIT_REVERSE ) <nl> + { <nl> + int width = MIN ( m_sSizeInPixel . width , m_sSizeInPixel . height ) ; <nl> + m_sSizeInPixel . height = MAX ( m_sSizeInPixel . width , m_sSizeInPixel . height ) ; <nl> + m_sSizeInPixel . width = width ; <nl> + width = MIN ( m_sSizeInPoint . width , m_sSizeInPoint . height ) ; <nl> + m_sSizeInPoint . height = MAX ( m_sSizeInPoint . width , m_sSizeInPoint . height ) ; <nl> + m_sSizeInPoint . width = width ; <nl> + resize ( m_sSizeInPoint . width , m_sSizeInPoint . height ) ; <nl> + } <nl> + else <nl> + { <nl> + int width = MAX ( m_sSizeInPixel . width , m_sSizeInPixel . height ) ; <nl> + m_sSizeInPixel . height = MIN ( m_sSizeInPixel . width , m_sSizeInPixel . height ) ; <nl> + m_sSizeInPixel . width = width ; <nl> + width = MAX ( m_sSizeInPoint . width , m_sSizeInPoint . height ) ; <nl> + m_sSizeInPoint . height = MIN ( m_sSizeInPoint . width , m_sSizeInPoint . height ) ; <nl> + m_sSizeInPoint . width = width ; <nl> + resize ( m_sSizeInPoint . width , m_sSizeInPoint . height ) ; <nl> + } <nl> <nl> - return eOritation ; <nl> + return m_eInitOrientation ; <nl> + / / return eOritation ; <nl> } <nl> <nl> void CCEGLView : : setViewPortInPoints ( float x , float y , float w , float h ) <nl> mmm a / cocos2dx / proj . bada / sdk1 . 2 / . cproject . REMOVED . git - id <nl> ppp b / cocos2dx / proj . bada / sdk1 . 2 / . cproject . REMOVED . git - id <nl> @ @ - 1 + 1 @ @ <nl> - fedbeda9110ec88b0efda923907e5a6c5d083091 <nl> \ No newline at end of file <nl> + d7923662aecbb2e0d1f9e847ba9f1e680739ef8e <nl> \ No newline at end of file <nl> mmm a / cocos2dx / proj . bada / sdk2 . 0 / . cproject <nl> ppp b / cocos2dx / proj . bada / sdk2 . 0 / . cproject <nl> <nl> < tool id = " cdt . managedbuild . tool . osp . gnu . target . cpp . linker . so . debug . 151715746 " name = " bada C + + Linker " superClass = " cdt . managedbuild . tool . osp . gnu . target . cpp . linker . so . debug " > <nl> < option id = " osp . gnu . target . cpp . link . debug . so . option . userobjs . 126345237 " name = " Other objects " superClass = " osp . gnu . target . cpp . link . debug . so . option . userobjs " valueType = " userObjs " > <nl> < listOptionValue builtIn = " false " value = " & quot ; $ { TARGET_LIB_PATH } / osp_rt0 . a & quot ; " / > <nl> - < listOptionValue builtIn = " false " value = " & quot ; $ { workspace_loc : / $ { ProjName } / platform / third_party / bada / src / libjpeg / sdk2 . 0 / . Target - Debug / libjpeg . a } & quot ; " / > <nl> - < listOptionValue builtIn = " false " value = " & quot ; $ { workspace_loc : / $ { ProjName } / platform / third_party / bada / src / png / sdk2 . 0 / . Target - Debug / libpng . a } & quot ; " / > <nl> - < listOptionValue builtIn = " false " value = " & quot ; $ { workspace_loc : / $ { ProjName } / platform / third_party / bada / src / zlib / sdk2 . 0 / . Target - Debug / libzlib . a } & quot ; " / > <nl> + < listOptionValue builtIn = " false " value = " . . / . . / . . / platform / third_party / bada / src / libjpeg / sdk2 . 0 / . Target - Debug / libjpeg . a " / > <nl> + < listOptionValue builtIn = " false " value = " . . / . . / . . / platform / third_party / bada / src / png / sdk2 . 0 / . Target - Debug / libpng . a " / > <nl> + < listOptionValue builtIn = " false " value = " . . / . . / . . / platform / third_party / bada / src / zlib / sdk2 . 0 / . Target - Debug / libzlib . a " / > <nl> < listOptionValue builtIn = " false " value = " & quot ; $ { TARGET_LIB_PATH } / FOsp . so & quot ; " / > <nl> < listOptionValue builtIn = " false " value = " & quot ; $ { TARGET_LIB_PATH } / FGraphicsOpengl . so & quot ; " / > <nl> < listOptionValue builtIn = " false " value = " & quot ; $ { TARGET_LIB_PATH } / FGraphicsEgl . so & quot ; " / > <nl> <nl> < / profile > <nl> < / scannerConfigBuildInfo > <nl> < / storageModule > <nl> + < storageModule moduleId = " org . eclipse . cdt . core . language . mapping " / > <nl> < / cconfiguration > <nl> < cconfiguration id = " cdt . managedbuild . config . osp . gnu . target . so . release . 562326387 " > <nl> < storageModule buildSystemId = " org . eclipse . cdt . managedbuilder . core . configurationDataProvider " id = " cdt . managedbuild . config . osp . gnu . target . so . release . 562326387 " moduleId = " org . eclipse . cdt . core . settings " name = " Target - Release " > <nl> <nl> < tool id = " cdt . managedbuild . tool . osp . gnu . target . cpp . linker . so . release . 896785834 " name = " bada C + + Linker " superClass = " cdt . managedbuild . tool . osp . gnu . target . cpp . linker . so . release " > <nl> < option id = " osp . gnu . target . cpp . link . release . so . option . userobjs . 1737890791 " name = " Other objects " superClass = " osp . gnu . target . cpp . link . release . so . option . userobjs " valueType = " userObjs " > <nl> < listOptionValue builtIn = " false " value = " & quot ; $ { TARGET_LIB_PATH } / osp_rt0 . a & quot ; " / > <nl> - < listOptionValue builtIn = " false " value = " & quot ; $ { workspace_loc : / $ { ProjName } / platform / third_party / bada / src / libjpeg / sdk2 . 0 / . Target - Release / libjpeg . a } & quot ; " / > <nl> - < listOptionValue builtIn = " false " value = " & quot ; $ { workspace_loc : / $ { ProjName } / platform / third_party / bada / src / png / sdk2 . 0 / . Target - Release / libpng . a } & quot ; " / > <nl> - < listOptionValue builtIn = " false " value = " & quot ; $ { workspace_loc : / $ { ProjName } / platform / third_party / bada / src / zlib / sdk2 . 0 / . Target - Release / libzlib . a } & quot ; " / > <nl> + < listOptionValue builtIn = " false " value = " . . / . . / . . / platform / third_party / bada / src / libjpeg / sdk2 . 0 / . Target - Release / libjpeg . a " / > <nl> + < listOptionValue builtIn = " false " value = " . . / . . / . . / platform / third_party / bada / src / png / sdk2 . 0 / . Target - Release / libpng . a " / > <nl> + < listOptionValue builtIn = " false " value = " . . / . . / . . / platform / third_party / bada / src / zlib / sdk2 . 0 / . Target - Release / libzlib . a " / > <nl> < listOptionValue builtIn = " false " value = " & quot ; $ { TARGET_LIB_PATH } / FOsp . so & quot ; " / > <nl> < listOptionValue builtIn = " false " value = " & quot ; $ { TARGET_LIB_PATH } / FGraphicsOpengl . so & quot ; " / > <nl> < listOptionValue builtIn = " false " value = " & quot ; $ { TARGET_LIB_PATH } / FGraphicsEgl . so & quot ; " / > <nl> < listOptionValue builtIn = " false " value = " & quot ; $ { TARGET_LIB_PATH } / StubDynCast . so & quot ; " / > <nl> < / option > <nl> - < option id = " osp . gnu . target . cpp . link . release . so . option . libs . paths . 255541031 " superClass = " osp . gnu . target . cpp . link . release . so . option . libs . paths " valueType = " libPaths " > <nl> + < option id = " osp . gnu . target . cpp . link . release . so . option . libs . paths . 255541031 " name = " Library search path ( - L ) " superClass = " osp . gnu . target . cpp . link . release . so . option . libs . paths " valueType = " libPaths " > <nl> < listOptionValue builtIn = " false " value = " & quot ; $ { TARGET_LIB_PATH } & quot ; " / > <nl> < listOptionValue builtIn = " false " value = " & quot ; $ { PROJECT_ROOT } / lib & quot ; " / > <nl> < / option > <nl> <nl> < / profile > <nl> < / scannerConfigBuildInfo > <nl> < / storageModule > <nl> + < storageModule moduleId = " org . eclipse . cdt . core . language . mapping " / > <nl> < / cconfiguration > <nl> < / storageModule > <nl> < storageModule moduleId = " cdtBuildSystem " version = " 4 . 0 . 0 " > <nl> | use system orientation | cocos2d/cocos2d-x | fd3f496b76fc7992526c6208875e660d745029fb | 2011-10-13T03:55:48Z |
mmm a / shell / common / extensions / api / _permission_features . json <nl> ppp b / shell / common / extensions / api / _permission_features . json <nl> <nl> ] , <nl> " location " : " component " <nl> } , <nl> - " management " : [ <nl> - { <nl> - " channel " : " stable " , <nl> - " extension_types " : [ <nl> - " extension " , <nl> - " legacy_packaged_app " <nl> - ] <nl> - } , <nl> - { <nl> - " channel " : " stable " , <nl> - " extension_types " : [ <nl> - " platform_app " <nl> - ] , <nl> - " whitelist " : [ <nl> - " AE27D69DBE571F4B1694F05C89B710C646792231 " , / / Published ADT <nl> - / / TODO ( grv ) : clean up once Apps developer tool is published . <nl> - " 5107DE9024C329EEA9C9A72D94C16723790C6422 " , / / Apps Developer Tool . <nl> - " 8C0B1873FFFB65E4D0F4D772879F7304CEF125C2 " , / / Apps Editor old . <nl> - " FA0501B579070BB9CBD4FCAEC8CB0EDF22BA2F04 " , / / Apps Editor published . <nl> - " EE17C698905F7F2E6DDC87C9C30F11E164C829F4 " , / / Watchdog ( Activity Log ) <nl> - " 90113DA9516526D24DAF156C629CC41C049E8882 " , / / Watchdog Test Version <nl> - " 4A4EA121622FCA3D78ED2AB534197F43D7189EE0 " , / / Spark nightly build . <nl> - " 9FDE6E7F06FCFA11D9A05041C7FF6D8AE662F5D1 " , / / Spark release . <nl> - " 50B4A905D522C06E27CA6D099E3E54BDA1F152C5 " , / / Spark Beta channel . <nl> - " BA0C8BB92084C9741312D90D3EA882526853455F " , / / Spark dev channel . <nl> - " 5F57A9AE8DFF5D6BB09DF8606270402612E871E5 " , / / http : / / crbug . com / 422624 <nl> - " 46578A13607D38F1DC8E280C4F499FB0A2F9565C " , / / http : / / crbug . com / 819404 <nl> - " 898FB5A39687D210766B8998BA4530B99C9E6586 " , / / http : / / crbug . com / 819404 <nl> - " 82F30B65397BC3E4ADE627BBD857AB8A58210648 " , / / http : / / crbug . com / 819404 <nl> - " C74B2AF138F9EDECD04D0965AB36CA66C8290466 " / / http : / / crbug . com / 957772 <nl> - ] <nl> - } , <nl> - { <nl> - " channel " : " stable " , <nl> - " extension_types " : [ <nl> - " hosted_app " <nl> - ] , <nl> - " whitelist " : [ <nl> - " B44D08FD98F1523ED5837D78D0A606EA9D6206E5 " / / Web Store <nl> - ] <nl> - } , <nl> - { <nl> - " channel " : " stable " , <nl> - " extension_types " : [ <nl> - " platform_app " <nl> - ] , <nl> - " session_types " : [ <nl> - " kiosk " <nl> - ] <nl> - } , <nl> - { <nl> - " channel " : " stable " , <nl> - " dependencies " : [ <nl> - " behavior : imprivata_login_screen_extension " <nl> - ] , <nl> - " extension_types " : [ <nl> - " login_screen_extension " <nl> - ] <nl> - } <nl> - ] <nl> + " management " : { <nl> + " channel " : " stable " , <nl> + " extension_types " : [ <nl> + " extension " <nl> + ] <nl> + } <nl> } <nl> \ No newline at end of file <nl> | chore ( extensions ) : remove unused features json ( ) | electron/electron | 462de5f97a302987dc5fa5c222781ceed040f390 | 2020-09-30T03:03:35Z |
mmm a / src / app / ui / context_bar . cpp <nl> ppp b / src / app / ui / context_bar . cpp <nl> bool ContextBar : : onProcessMessage ( Message * msg ) <nl> return Box : : onProcessMessage ( msg ) ; <nl> } <nl> <nl> + void ContextBar : : onPreferredSize ( PreferredSizeEvent & ev ) <nl> + { <nl> + ev . setPreferredSize ( gfx : : Size ( 0 , 18 * jguiscale ( ) ) ) ; / / TODO calculate height <nl> + } <nl> + <nl> void ContextBar : : onSetOpacity ( int newOpacity ) <nl> { <nl> m_inkOpacity - > setTextf ( " % d " , newOpacity ) ; <nl> mmm a / src / app / ui / context_bar . h <nl> ppp b / src / app / ui / context_bar . h <nl> namespace app { <nl> <nl> protected : <nl> bool onProcessMessage ( ui : : Message * msg ) OVERRIDE ; <nl> + void onPreferredSize ( ui : : PreferredSizeEvent & ev ) OVERRIDE ; <nl> <nl> / / ToolSettingsObserver impl <nl> void onSetOpacity ( int newOpacity ) OVERRIDE ; <nl> | Fix bug where ContextBar was completely hidden | aseprite/aseprite | 44c6a9d91ac862c572c7301284ab4d09cb40a709 | 2014-02-03T00:07:12Z |
mmm a / docs / api / breaking - changes . md <nl> ppp b / docs / api / breaking - changes . md <nl> Deprecated : https : / / atom . io / download / atom - shell <nl> <nl> Replace with : https : / / atom . io / download / electron <nl> <nl> + <nl> + # Breaking API Changes ( 2 . 0 ) <nl> + <nl> + # # ` BrowserWindow ` <nl> + <nl> + ` ` ` js <nl> + / / Deprecated <nl> + let optionsA = { titleBarStyle : ' hidden - inset ' } <nl> + let windowA = new BrowserWindow ( optionsA ) <nl> + / / Replace with <nl> + let optionsB = { titleBarStyle : ' hiddenInset ' } <nl> + let windowB = new BrowserWindow ( optionsB ) <nl> + ` ` ` <nl> + <nl> + # # ` menu ` <nl> + <nl> + ` ` ` js <nl> + / / Deprecated <nl> + menu . popup ( browserWindow , 100 , 200 , 2 ) <nl> + / / Replace with <nl> + menu . popup ( browserWindow , { x : 100 , y : 200 , positioningItem : 2 } ) <nl> + ` ` ` <nl> + <nl> + <nl> + ` ` ` js <nl> + / / Deprecated <nl> + nativeImage . toPng ( ) <nl> + / / Replace with <nl> + nativeImage . toPNG ( ) <nl> + <nl> + / / Deprecated <nl> + nativeImage . toJpeg ( ) <nl> + / / Replace with <nl> + nativeImage . toJPEG ( ) <nl> + ` ` ` <nl> + <nl> + # # ` process ` <nl> + <nl> + * ` process . versions . electron ` and ` process . version . chrome ` will be made <nl> + read - only properties for consistency with the other ` process . versions ` <nl> + properties set by Node . <nl> + <nl> + # # ` webContents ` <nl> + <nl> + ` ` ` js <nl> + / / Deprecated <nl> + webContents . setZoomLevelLimits ( 1 , 2 ) <nl> + / / Replace with <nl> + webContents . setVisualZoomLevelLimits ( 1 , 2 ) <nl> + ` ` ` <nl> + <nl> + # # ` webFrame ` <nl> + <nl> + ` ` ` js <nl> + / / Deprecated <nl> + webFrame . setZoomLevelLimits ( 1 , 2 ) <nl> + / / Replace with <nl> + webFrame . setVisualZoomLevelLimits ( 1 , 2 ) <nl> + ` ` ` <nl> + <nl> + # # ` < webview > ` <nl> + <nl> + ` ` ` js <nl> + / / Deprecated <nl> + webview . setZoomLevelLimits ( 1 , 2 ) <nl> + / / Replace with <nl> + webview . setVisualZoomLevelLimits ( 1 , 2 ) <nl> + ` ` ` <nl> + <nl> + # # Duplicate ARM Assets <nl> + <nl> + Each Electron release includes two identical ARM builds with slightly different <nl> + filenames , like ` electron - v1 . 7 . 3 - linux - arm . zip ` and <nl> + ` electron - v1 . 7 . 3 - linux - armv7l . zip ` . The asset with the ` v7l ` prefix was added <nl> + to clarify to users which ARM version it supports , and to disambiguate it from <nl> + future armv6l and arm64 assets that may be produced . <nl> + <nl> + The file _without the prefix_ is still being published to avoid breaking any <nl> + setups that may be consuming it . Starting at 2 . 0 , the un - prefixed file will <nl> + no longer be published . <nl> + <nl> + For details , see <nl> + [ 6986 ] ( https : / / github . com / electron / electron / pull / 6986 ) <nl> + and <nl> + [ 7189 ] ( https : / / github . com / electron / electron / pull / 7189 ) . <nl> | docs : re - document the 2 . 0 breaking API changes | electron/electron | 066b92c7cd768b6bad2664d54baa8174c05055be | 2018-05-29T09:23:28Z |
mmm a / doc / reference . rst <nl> ppp b / doc / reference . rst <nl> Progmem <nl> <nl> The Program memory features work much the same way as on a regular <nl> Arduino ; placing read only data and strings in read only memory and <nl> - freeing heap for your application . The important difference is that on <nl> - the ESP8266 the literal strings are not pooled . This means that the same <nl> - literal string defined inside a ` ` F ( " " ) ` ` and / or ` ` PSTR ( " " ) ` ` will take <nl> - up space for each instance in the code . So you will need to manage the <nl> + freeing heap for your application . <nl> + <nl> + In core versions prior to 2 . 7 , the important difference is that on the <nl> + ESP8266 the literal strings are not pooled . This means that the same <nl> + literal string defined inside a ` ` F ( " " ) ` ` and / or ` ` PSTR ( " " ) ` ` will take up <nl> + space for each instance in the code . So you will need to manage the <nl> duplicate strings yourself . <nl> <nl> + Starting from v2 . 7 , this is no longer true : duplicate literal strings within <nl> + r / o memory are now handled . <nl> + <nl> There is one additional helper macro to make it easier to pass <nl> ` ` const PROGMEM ` ` strings to methods that take a ` ` __FlashStringHelper ` ` <nl> called ` ` FPSTR ( ) ` ` . The use of this will help make it easier to pool <nl> | doc : gcc handles duplicate literal strings ( ) | esp8266/Arduino | f42327da349f5cf958f01b8ec35ffa05c80d6a05 | 2020-08-17T00:43:15Z |
mmm a / src / concurrency / watchable . tcc <nl> ppp b / src / concurrency / watchable . tcc <nl> public : <nl> * current_out = inner ( input ) ; <nl> return old_value ! = * current_out ; * / <nl> / / 2 . Without comparison : <nl> - current_out = inner ( input ) ; <nl> + * current_out = inner ( input ) ; <nl> return true ; <nl> } <nl> private : <nl> | Missing asterisk | rethinkdb/rethinkdb | 8c6908141cae3558debadec07315055c5f2cd4bc | 2013-11-18T19:24:01Z |
mmm a / js / common / tests / shell - foxx . js <nl> ppp b / js / common / tests / shell - foxx . js <nl> function SetRoutesFoxxApplicationSpec ( ) { <nl> routes = app . routingInfo . routes ; <nl> <nl> app . head ( ' / simple / route ' , myFunc ) ; <nl> + assertEqual ( routes [ 0 ] . docs . httpMethod , ' HEAD ' ) ; <nl> assertEqual ( routes [ 0 ] . url . methods , [ " head " ] ) ; <nl> } , <nl> <nl> function SetRoutesFoxxApplicationSpec ( ) { <nl> routes = app . routingInfo . routes ; <nl> <nl> app . get ( ' / simple / route ' , myFunc ) ; <nl> + assertEqual ( routes [ 0 ] . docs . httpMethod , ' GET ' ) ; <nl> assertEqual ( routes [ 0 ] . url . methods , [ " get " ] ) ; <nl> } , <nl> <nl> function SetRoutesFoxxApplicationSpec ( ) { <nl> routes = app . routingInfo . routes ; <nl> <nl> app . post ( ' / simple / route ' , myFunc ) ; <nl> + assertEqual ( routes [ 0 ] . docs . httpMethod , ' POST ' ) ; <nl> assertEqual ( routes [ 0 ] . url . methods , [ " post " ] ) ; <nl> } , <nl> <nl> function SetRoutesFoxxApplicationSpec ( ) { <nl> routes = app . routingInfo . routes ; <nl> <nl> app . put ( ' / simple / route ' , myFunc ) ; <nl> + assertEqual ( routes [ 0 ] . docs . httpMethod , ' PUT ' ) ; <nl> assertEqual ( routes [ 0 ] . url . methods , [ " put " ] ) ; <nl> } , <nl> <nl> function SetRoutesFoxxApplicationSpec ( ) { <nl> routes = app . routingInfo . routes ; <nl> <nl> app . patch ( ' / simple / route ' , myFunc ) ; <nl> + assertEqual ( routes [ 0 ] . docs . httpMethod , ' PATCH ' ) ; <nl> assertEqual ( routes [ 0 ] . url . methods , [ " patch " ] ) ; <nl> } , <nl> <nl> function SetRoutesFoxxApplicationSpec ( ) { <nl> routes = app . routingInfo . routes ; <nl> <nl> app [ ' delete ' ] ( ' / simple / route ' , myFunc ) ; <nl> + assertEqual ( routes [ 0 ] . docs . httpMethod , ' DELETE ' ) ; <nl> assertEqual ( routes [ 0 ] . url . methods , [ " delete " ] ) ; <nl> } , <nl> <nl> function SetRoutesFoxxApplicationSpec ( ) { <nl> routes = app . routingInfo . routes ; <nl> <nl> app . del ( ' / simple / route ' , myFunc ) ; <nl> + assertEqual ( routes [ 0 ] . docs . httpMethod , ' DELETE ' ) ; <nl> assertEqual ( routes [ 0 ] . url . methods , [ " delete " ] ) ; <nl> } , <nl> <nl> mmm a / js / server / modules / org / arangodb / foxx . js <nl> ppp b / js / server / modules / org / arangodb / foxx . js <nl> _ . extend ( FoxxApplication . prototype , { <nl> callback : String ( callback ) <nl> } , <nl> docs : { <nl> - parameters : { } <nl> + parameters : { } , <nl> + httpMethod : method . toUpperCase ( ) <nl> } <nl> } ; <nl> <nl> | Foxx : Automatically add the httpMethod to the documentation | arangodb/arangodb | 30f23c22e66695699d3c2a8816ac4163d3c0fccb | 2013-03-27T12:19:41Z |
mmm a / core / math / plane . cpp <nl> ppp b / core / math / plane . cpp <nl> bool Plane : : intersects_ray ( const Vector3 & p_from , const Vector3 & p_dir , Vector3 <nl> return false ; <nl> } <nl> <nl> - real_t dist = ( normal . dot ( p_from ) - d ) / den ; <nl> + real_t dist = ( - normal . dot ( p_from ) - d ) / den ; <nl> / / printf ( " dist is % i \ n " , dist ) ; <nl> <nl> - if ( dist > CMP_EPSILON ) { / / this is a ray , before the emitting pos ( p_from ) doesn ' t exist <nl> + if ( dist < - CMP_EPSILON ) { / / this is a ray , before the emitting pos ( p_from ) doesn ' t exist <nl> <nl> return false ; <nl> } <nl> <nl> - dist = - dist ; <nl> * p_intersection = p_from + segment * dist ; <nl> <nl> return true ; <nl> bool Plane : : intersects_segment ( const Vector3 & p_begin , const Vector3 & p_end , Vec <nl> return false ; <nl> } <nl> <nl> - real_t dist = ( normal . dot ( p_begin ) - d ) / den ; <nl> + real_t dist = ( - normal . dot ( p_begin ) - d ) / den ; <nl> / / printf ( " dist is % i \ n " , dist ) ; <nl> <nl> if ( dist < - CMP_EPSILON | | dist > ( 1 . 0 + CMP_EPSILON ) ) { <nl> bool Plane : : intersects_segment ( const Vector3 & p_begin , const Vector3 & p_end , Vec <nl> return false ; <nl> } <nl> <nl> - dist = - dist ; <nl> * p_intersection = p_begin + segment * dist ; <nl> <nl> return true ; <nl> | fixed invalid implementations of Plane : : intersects_segment and Plane : : intersects_ray | godotengine/godot | 2c36078be43f5008c1baa05ea507bb24809055d4 | 2019-01-11T21:38:16Z |
mmm a / docs / source / distributed . rst <nl> ppp b / docs / source / distributed . rst <nl> The package needs to be initialized using the : func : ` torch . distributed . init_proc <nl> function before calling any other methods . This blocks until all processes have <nl> joined . <nl> <nl> + . . autofunction : : is_available <nl> + <nl> . . autofunction : : init_process_group <nl> <nl> . . autoclass : : Backend <nl> mmm a / torch / distributed / __init__ . py <nl> ppp b / torch / distributed / __init__ . py <nl> <nl> <nl> <nl> def is_available ( ) : <nl> + " " " <nl> + Returns ` ` True ` ` if the distributed package is available . Otherwise , <nl> + ` ` torch . distributed ` ` does not expose any other APIs . Currently , <nl> + ` ` torch . distributed ` ` is available on Linux and MacOS . Set <nl> + ` ` USE_DISTRIBUTED = 1 ` ` to enable it when building PyTorch from source . <nl> + Currently , the default value is ` ` USE_DISTRIBUTED = 1 ` ` for Linux and <nl> + ` ` USE_DISTRIBUTED = 0 ` ` for MacOS . <nl> + " " " <nl> return hasattr ( torch . _C , " _c10d_init " ) <nl> <nl> <nl> | Expose torch . distributed . is_available ( ) API ( ) | pytorch/pytorch | b982a6a24724d76bf5a63cc1ccf2f06050c49bb8 | 2020-04-22T01:38:46Z |
mmm a / python / mxnet / symbol . py <nl> ppp b / python / mxnet / symbol . py <nl> def Group ( symbols ) : <nl> return Symbol ( handle ) <nl> <nl> <nl> - def _make_atomic_symbol_function ( handle , func_name ) : <nl> + def _make_atomic_symbol_function ( handle ) : <nl> " " " Create an atomic symbol function by handle and funciton name . " " " <nl> + name = ctypes . c_char_p ( ) <nl> + docs = ctypes . c_char_p ( ) <nl> + check_call ( _LIB . MXSymbolGetAtomicSymbolName ( handle , ctypes . byref ( name ) ) ) <nl> + check_call ( _LIB . MXSymbolGetAtomicSymbolDoc ( handle , ctypes . byref ( docs ) ) ) <nl> + func_name = name . value ; <nl> + <nl> def creator ( * args , * * kwargs ) : <nl> " " " Activation Operator of Neural Net . <nl> The parameters listed below can be passed in as keyword arguments . <nl> def creator ( * args , * * kwargs ) : <nl> s . _compose ( * args , name = name , * * symbol_kwargs ) <nl> return s <nl> creator . __name__ = func_name <nl> + creator . __doc__ = docs . value <nl> + print creator . __doc__ <nl> return creator <nl> <nl> <nl> def _init_module_functions ( ) : <nl> module_obj = sys . modules [ __name__ ] <nl> for i in range ( size . value ) : <nl> hdl = ctypes . c_void_p ( plist [ i ] ) <nl> - name = ctypes . c_char_p ( ) <nl> - check_call ( _LIB . MXSymbolGetAtomicSymbolName ( hdl , ctypes . byref ( name ) ) ) <nl> - function = _make_atomic_symbol_function ( hdl , name . value ) <nl> + function = _make_atomic_symbol_function ( hdl ) <nl> setattr ( module_obj , function . __name__ , function ) <nl> <nl> # Initialize the atomic symbo in startups <nl> | add pythondoc | apache/incubator-mxnet | 225fabd9ae7a6397256abfc4e1347009a713bb50 | 2015-08-22T05:42:14Z |
mmm a / build - aux / m4 / ax_boost_base . m4 <nl> ppp b / build - aux / m4 / ax_boost_base . m4 <nl> <nl> # and this notice are preserved . This file is offered as - is , without any <nl> # warranty . <nl> <nl> - # serial 45 <nl> + # serial 47 <nl> <nl> # example boost program ( need to pass version ) <nl> m4_define ( [ _AX_BOOST_BASE_PROGRAM ] , <nl> AC_DEFUN ( [ _AX_BOOST_BASE_RUNDETECT ] , [ <nl> dnl are found , e . g . when only header - only libraries are installed ! <nl> AS_CASE ( [ $ { host_cpu } ] , <nl> [ x86_64 ] , [ libsubdirs = " lib64 libx32 lib lib64 " ] , <nl> + [ mips * 64 * ] , [ libsubdirs = " lib64 lib32 lib lib64 " ] , <nl> [ ppc64 | powerpc64 | s390x | sparc64 | aarch64 | ppc64le | powerpc64le | riscv64 ] , [ libsubdirs = " lib64 lib lib64 " ] , <nl> [ libsubdirs = " lib " ] <nl> ) <nl> mmm a / build - aux / m4 / ax_boost_chrono . m4 <nl> ppp b / build - aux / m4 / ax_boost_chrono . m4 <nl> <nl> # and this notice are preserved . This file is offered as - is , without any <nl> # warranty . <nl> <nl> - # serial 4 <nl> + # serial 5 <nl> <nl> AC_DEFUN ( [ AX_BOOST_CHRONO ] , <nl> [ <nl> AC_DEFUN ( [ AX_BOOST_CHRONO ] , <nl> <nl> fi <nl> if test " x $ ax_lib " = " x " ; then <nl> - AC_MSG_ERROR ( Could not find a version of the library ! ) <nl> + AC_MSG_ERROR ( Could not find a version of the Boost : : Chrono library ! ) <nl> fi <nl> if test " x $ link_chrono " = " xno " ; then <nl> AC_MSG_ERROR ( Could not link against $ ax_lib ! ) <nl> mmm a / build - aux / m4 / ax_boost_filesystem . m4 <nl> ppp b / build - aux / m4 / ax_boost_filesystem . m4 <nl> <nl> # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - # http : / / www . gnu . org / software / autoconf - archive / ax_boost_filesystem . html <nl> + # https : / / www . gnu . org / software / autoconf - archive / ax_boost_filesystem . html <nl> # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> # <nl> # SYNOPSIS <nl> <nl> # and this notice are preserved . This file is offered as - is , without any <nl> # warranty . <nl> <nl> - # serial 26 <nl> + # serial 28 <nl> <nl> AC_DEFUN ( [ AX_BOOST_FILESYSTEM ] , <nl> [ <nl> AC_DEFUN ( [ AX_BOOST_FILESYSTEM ] , <nl> if test " x $ ax_cv_boost_filesystem " = " xyes " ; then <nl> AC_DEFINE ( HAVE_BOOST_FILESYSTEM , , [ define if the Boost : : Filesystem library is available ] ) <nl> BOOSTLIBDIR = ` echo $ BOOST_LDFLAGS | sed - e ' s / @ < : @ ^ \ / @ : > @ * / / ' ` <nl> - ax_lib = <nl> if test " x $ ax_boost_user_filesystem_lib " = " x " ; then <nl> for libextension in ` ls - r $ BOOSTLIBDIR / libboost_filesystem * 2 > / dev / null | sed ' s , . * / lib , , ' | sed ' s , \ . . * , , ' ` ; do <nl> ax_lib = $ { libextension } <nl> AC_DEFUN ( [ AX_BOOST_FILESYSTEM ] , <nl> <nl> fi <nl> if test " x $ ax_lib " = " x " ; then <nl> - AC_MSG_ERROR ( Could not find a version of the boost_filesystem library ! ) <nl> + AC_MSG_ERROR ( Could not find a version of the Boost : : Filesystem library ! ) <nl> fi <nl> if test " x $ link_filesystem " ! = " xyes " ; then <nl> AC_MSG_ERROR ( Could not link against $ ax_lib ! ) <nl> mmm a / build - aux / m4 / ax_boost_system . m4 <nl> ppp b / build - aux / m4 / ax_boost_system . m4 <nl> <nl> # and this notice are preserved . This file is offered as - is , without any <nl> # warranty . <nl> <nl> - # serial 19 <nl> + # serial 20 <nl> <nl> AC_DEFUN ( [ AX_BOOST_SYSTEM ] , <nl> [ <nl> AC_DEFUN ( [ AX_BOOST_SYSTEM ] , <nl> <nl> fi <nl> if test " x $ ax_lib " = " x " ; then <nl> - AC_MSG_ERROR ( Could not find a version of the library ! ) <nl> + AC_MSG_ERROR ( Could not find a version of the Boost : : System library ! ) <nl> fi <nl> if test " x $ link_system " = " xno " ; then <nl> AC_MSG_ERROR ( Could not link against $ ax_lib ! ) <nl> mmm a / build - aux / m4 / ax_boost_thread . m4 <nl> ppp b / build - aux / m4 / ax_boost_thread . m4 <nl> <nl> # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - # http : / / www . gnu . org / software / autoconf - archive / ax_boost_thread . html <nl> + # https : / / www . gnu . org / software / autoconf - archive / ax_boost_thread . html <nl> # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> # <nl> # SYNOPSIS <nl> <nl> # and this notice are preserved . This file is offered as - is , without any <nl> # warranty . <nl> <nl> - # serial 27 <nl> + # serial 32 <nl> <nl> AC_DEFUN ( [ AX_BOOST_THREAD ] , <nl> [ <nl> - AC_ARG_WITH ( [ boost - thread ] , <nl> - AS_HELP_STRING ( [ - - with - boost - thread @ < : @ = special - lib @ : > @ ] , <nl> - [ use the Thread library from boost - it is possible to specify a certain library for the linker <nl> - e . g . - - with - boost - thread = boost_thread - gcc - mt ] ) , <nl> + AC_ARG_WITH ( [ boost - thread ] , <nl> + AS_HELP_STRING ( [ - - with - boost - thread @ < : @ = special - lib @ : > @ ] , <nl> + [ use the Thread library from boost - <nl> + it is possible to specify a certain library for the linker <nl> + e . g . - - with - boost - thread = boost_thread - gcc - mt ] ) , <nl> [ <nl> - if test " $ withval " = " no " ; then <nl> - want_boost = " no " <nl> - elif test " $ withval " = " yes " ; then <nl> + if test " $ withval " = " yes " ; then <nl> want_boost = " yes " <nl> ax_boost_user_thread_lib = " " <nl> else <nl> - want_boost = " yes " <nl> - ax_boost_user_thread_lib = " $ withval " <nl> - fi <nl> + want_boost = " yes " <nl> + ax_boost_user_thread_lib = " $ withval " <nl> + fi <nl> ] , <nl> [ want_boost = " yes " ] <nl> - ) <nl> + ) <nl> <nl> - if test " x $ want_boost " = " xyes " ; then <nl> + if test " x $ want_boost " = " xyes " ; then <nl> AC_REQUIRE ( [ AC_PROG_CC ] ) <nl> AC_REQUIRE ( [ AC_CANONICAL_BUILD ] ) <nl> - CPPFLAGS_SAVED = " $ CPPFLAGS " <nl> - CPPFLAGS = " $ CPPFLAGS $ BOOST_CPPFLAGS " <nl> - export CPPFLAGS <nl> + CPPFLAGS_SAVED = " $ CPPFLAGS " <nl> + CPPFLAGS = " $ CPPFLAGS $ BOOST_CPPFLAGS " <nl> + export CPPFLAGS <nl> <nl> - LDFLAGS_SAVED = " $ LDFLAGS " <nl> - LDFLAGS = " $ LDFLAGS $ BOOST_LDFLAGS " <nl> - export LDFLAGS <nl> + LDFLAGS_SAVED = " $ LDFLAGS " <nl> + LDFLAGS = " $ LDFLAGS $ BOOST_LDFLAGS " <nl> + export LDFLAGS <nl> <nl> AC_CACHE_CHECK ( whether the Boost : : Thread library is available , <nl> - ax_cv_boost_thread , <nl> + ax_cv_boost_thread , <nl> [ AC_LANG_PUSH ( [ C + + ] ) <nl> - CXXFLAGS_SAVE = $ CXXFLAGS <nl> + CXXFLAGS_SAVE = $ CXXFLAGS <nl> <nl> - if test " x $ host_os " = " xsolaris " ; then <nl> - CXXFLAGS = " - pthreads $ CXXFLAGS " <nl> - elif test " x $ host_os " = " xmingw32 " ; then <nl> - CXXFLAGS = " - mthreads $ CXXFLAGS " <nl> - else <nl> - CXXFLAGS = " - pthread $ CXXFLAGS " <nl> - fi <nl> - AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [ @ % : @ include < boost / thread / thread . hpp > ] ] , <nl> - [ [ boost : : thread_group thrds ; <nl> - return 0 ; ] ] ) ] , <nl> - ax_cv_boost_thread = yes , ax_cv_boost_thread = no ) <nl> - CXXFLAGS = $ CXXFLAGS_SAVE <nl> + if test " x $ host_os " = " xsolaris " ; then <nl> + CXXFLAGS = " - pthreads $ CXXFLAGS " <nl> + elif test " x $ host_os " = " xmingw32 " ; then <nl> + CXXFLAGS = " - mthreads $ CXXFLAGS " <nl> + else <nl> + CXXFLAGS = " - pthread $ CXXFLAGS " <nl> + fi <nl> + AC_COMPILE_IFELSE ( [ <nl> + AC_LANG_PROGRAM ( <nl> + [ [ @ % : @ include < boost / thread / thread . hpp > ] ] , <nl> + [ [ boost : : thread_group thrds ; <nl> + return 0 ; ] ] ) ] , <nl> + ax_cv_boost_thread = yes , ax_cv_boost_thread = no ) <nl> + CXXFLAGS = $ CXXFLAGS_SAVE <nl> AC_LANG_POP ( [ C + + ] ) <nl> - ] ) <nl> - if test " x $ ax_cv_boost_thread " = " xyes " ; then <nl> + ] ) <nl> + if test " x $ ax_cv_boost_thread " = " xyes " ; then <nl> if test " x $ host_os " = " xsolaris " ; then <nl> - BOOST_CPPFLAGS = " - pthreads $ BOOST_CPPFLAGS " <nl> - elif test " x $ host_os " = " xmingw32 " ; then <nl> - BOOST_CPPFLAGS = " - mthreads $ BOOST_CPPFLAGS " <nl> - else <nl> - BOOST_CPPFLAGS = " - pthread $ BOOST_CPPFLAGS " <nl> - fi <nl> + BOOST_CPPFLAGS = " - pthreads $ BOOST_CPPFLAGS " <nl> + elif test " x $ host_os " = " xmingw32 " ; then <nl> + BOOST_CPPFLAGS = " - mthreads $ BOOST_CPPFLAGS " <nl> + else <nl> + BOOST_CPPFLAGS = " - pthread $ BOOST_CPPFLAGS " <nl> + fi <nl> <nl> - AC_SUBST ( BOOST_CPPFLAGS ) <nl> + AC_SUBST ( BOOST_CPPFLAGS ) <nl> <nl> - AC_DEFINE ( HAVE_BOOST_THREAD , , [ define if the Boost : : Thread library is available ] ) <nl> + AC_DEFINE ( HAVE_BOOST_THREAD , , <nl> + [ define if the Boost : : Thread library is available ] ) <nl> BOOSTLIBDIR = ` echo $ BOOST_LDFLAGS | sed - e ' s / @ < : @ ^ \ / @ : > @ * / / ' ` <nl> <nl> - LDFLAGS_SAVE = $ LDFLAGS <nl> + LDFLAGS_SAVE = $ LDFLAGS <nl> case " x $ host_os " in <nl> * bsd * ) <nl> LDFLAGS = " - pthread $ LDFLAGS " <nl> AC_DEFUN ( [ AX_BOOST_THREAD ] , <nl> ; ; <nl> esac <nl> if test " x $ ax_boost_user_thread_lib " = " x " ; then <nl> - ax_lib = <nl> for libextension in ` ls - r $ BOOSTLIBDIR / libboost_thread * 2 > / dev / null | sed ' s , . * / lib , , ' | sed ' s , \ . . * , , ' ` ; do <nl> ax_lib = $ { libextension } <nl> - AC_CHECK_LIB ( $ ax_lib , exit , <nl> - [ BOOST_THREAD_LIB = " - l $ ax_lib " ; AC_SUBST ( BOOST_THREAD_LIB ) link_thread = " yes " ; break ] , <nl> + AC_CHECK_LIB ( $ ax_lib , exit , <nl> + [ link_thread = " yes " ; break ] , <nl> [ link_thread = " no " ] ) <nl> - done <nl> + done <nl> if test " x $ link_thread " ! = " xyes " ; then <nl> for libextension in ` ls - r $ BOOSTLIBDIR / boost_thread * 2 > / dev / null | sed ' s , . * / , , ' | sed ' s , \ . . * , , ' ` ; do <nl> ax_lib = $ { libextension } <nl> - AC_CHECK_LIB ( $ ax_lib , exit , <nl> - [ BOOST_THREAD_LIB = " - l $ ax_lib " ; AC_SUBST ( BOOST_THREAD_LIB ) link_thread = " yes " ; break ] , <nl> + AC_CHECK_LIB ( $ ax_lib , exit , <nl> + [ link_thread = " yes " ; break ] , <nl> [ link_thread = " no " ] ) <nl> - done <nl> + done <nl> fi <nl> <nl> else <nl> for ax_lib in $ ax_boost_user_thread_lib boost_thread - $ ax_boost_user_thread_lib ; do <nl> - AC_CHECK_LIB ( $ ax_lib , exit , <nl> - [ BOOST_THREAD_LIB = " - l $ ax_lib " ; AC_SUBST ( BOOST_THREAD_LIB ) link_thread = " yes " ; break ] , <nl> + AC_CHECK_LIB ( $ ax_lib , exit , <nl> + [ link_thread = " yes " ; break ] , <nl> [ link_thread = " no " ] ) <nl> done <nl> <nl> fi <nl> if test " x $ ax_lib " = " x " ; then <nl> - AC_MSG_ERROR ( Could not find a version of the boost_thread library ! ) <nl> + AC_MSG_ERROR ( Could not find a version of the Boost : : Thread library ! ) <nl> fi <nl> - if test " x $ link_thread " = " xno " ; then <nl> - AC_MSG_ERROR ( Could not link against $ ax_lib ! ) <nl> - else <nl> - case " x $ host_os " in <nl> - * bsd * ) <nl> - BOOST_LDFLAGS = " - pthread $ BOOST_LDFLAGS " <nl> - break ; <nl> - ; ; <nl> - esac <nl> - <nl> - fi <nl> - fi <nl> + if test " x $ link_thread " = " xno " ; then <nl> + AC_MSG_ERROR ( Could not link against $ ax_lib ! ) <nl> + else <nl> + BOOST_THREAD_LIB = " - l $ ax_lib " <nl> + case " x $ host_os " in <nl> + * bsd * ) <nl> + BOOST_LDFLAGS = " - pthread $ BOOST_LDFLAGS " <nl> + break ; <nl> + ; ; <nl> + xsolaris ) <nl> + BOOST_THREAD_LIB = " $ BOOST_THREAD_LIB - lpthread " <nl> + break ; <nl> + ; ; <nl> + xmingw32 ) <nl> + break ; <nl> + ; ; <nl> + * ) <nl> + BOOST_THREAD_LIB = " $ BOOST_THREAD_LIB - lpthread " <nl> + break ; <nl> + ; ; <nl> + esac <nl> + AC_SUBST ( BOOST_THREAD_LIB ) <nl> + fi <nl> + fi <nl> <nl> - CPPFLAGS = " $ CPPFLAGS_SAVED " <nl> - LDFLAGS = " $ LDFLAGS_SAVED " <nl> - fi <nl> + CPPFLAGS = " $ CPPFLAGS_SAVED " <nl> + LDFLAGS = " $ LDFLAGS_SAVED " <nl> + fi <nl> ] ) <nl> mmm a / build - aux / m4 / ax_boost_unit_test_framework . m4 <nl> ppp b / build - aux / m4 / ax_boost_unit_test_framework . m4 <nl> <nl> # and this notice are preserved . This file is offered as - is , without any <nl> # warranty . <nl> <nl> - # serial 21 <nl> + # serial 22 <nl> <nl> AC_DEFUN ( [ AX_BOOST_UNIT_TEST_FRAMEWORK ] , <nl> [ <nl> AC_DEFUN ( [ AX_BOOST_UNIT_TEST_FRAMEWORK ] , <nl> done <nl> fi <nl> if test " x $ ax_lib " = " x " ; then <nl> - AC_MSG_ERROR ( Could not find a version of the library ! ) <nl> + AC_MSG_ERROR ( Could not find a version of the Boost : : Unit_Test_Framework library ! ) <nl> fi <nl> if test " x $ link_unit_test_framework " ! = " xyes " ; then <nl> AC_MSG_ERROR ( Could not link against $ ax_lib ! ) <nl> | build : update boost macros to latest upstream | bitcoin/bitcoin | bb99c4e684bbd3053ecf7a789049b11b29260189 | 2019-09-13T23:32:25Z |
mmm a / tools / jenkins - scripts / pull - request - builder . py <nl> ppp b / tools / jenkins - scripts / pull - request - builder . py <nl> def main ( ) : <nl> save_build_stats ( db , pr_num , ' libcpp_empty_test ' , filesize / 1024 ) <nl> ret = os . system ( " python build / android - build . py - p 10 - b release lua - empty - test " ) <nl> if ( ret = = 0 ) : <nl> - _path = ' tests / lua - empty - test / proj . android / libs / armeabi / liblua_empty_test . so ' <nl> + _path = ' tests / lua - empty - test / project / proj . android / libs / armeabi / liblua_empty_test . so ' <nl> filesize = os . path . getsize ( _path ) <nl> pr_desc = pr_desc + ' < h3 > size of liblua_empty_test . so is : ' + str ( filesize / 1024 ) + ' kb < / h3 > ' <nl> set_description ( pr_desc , target_url ) <nl> | Merge pull request from darkdukey / fixJenkins | cocos2d/cocos2d-x | ace0e3d9892c6fffc2ff046169cc5c43a7855ef9 | 2014-08-08T01:43:07Z |
mmm a / atom / common / api / atom_api_clipboard . cc <nl> ppp b / atom / common / api / atom_api_clipboard . cc <nl> <nl> # include < string > <nl> # include < vector > <nl> <nl> - # include " native_mate / object_template_builder . h " <nl> + # include " native_mate / dictionary . h " <nl> # include " ui / base / clipboard / clipboard . h " <nl> <nl> # include " atom / common / v8 / node_common . h " <nl> void Clear ( ) { <nl> } <nl> <nl> void Initialize ( v8 : : Handle < v8 : : Object > exports ) { <nl> - mate : : ObjectTemplateBuilder builder ( v8 : : Isolate : : GetCurrent ( ) ) ; <nl> - builder . SetMethod ( " has " , & Has ) <nl> - . SetMethod ( " read " , & Read ) <nl> - . SetMethod ( " readText " , & ReadText ) <nl> - . SetMethod ( " writeText " , & WriteText ) <nl> - . SetMethod ( " clear " , & Clear ) ; <nl> - exports - > SetPrototype ( builder . Build ( ) - > NewInstance ( ) ) ; <nl> + mate : : Dictionary dict ( v8 : : Isolate : : GetCurrent ( ) , exports ) ; <nl> + dict . SetMethod ( " has " , & Has ) ; <nl> + dict . SetMethod ( " read " , & Read ) ; <nl> + dict . SetMethod ( " readText " , & ReadText ) ; <nl> + dict . SetMethod ( " writeText " , & WriteText ) ; <nl> + dict . SetMethod ( " clear " , & Clear ) ; <nl> } <nl> <nl> } / / namespace <nl> mmm a / atom / common / api / atom_api_crash_reporter . cc <nl> ppp b / atom / common / api / atom_api_crash_reporter . cc <nl> <nl> <nl> # include " atom / common / crash_reporter / crash_reporter . h " <nl> # include " base / bind . h " <nl> - # include " native_mate / object_template_builder . h " <nl> + # include " native_mate / dictionary . h " <nl> <nl> # include " atom / common / v8 / node_common . h " <nl> <nl> namespace { <nl> <nl> void Initialize ( v8 : : Handle < v8 : : Object > exports ) { <nl> using crash_reporter : : CrashReporter ; <nl> - mate : : ObjectTemplateBuilder builder ( v8 : : Isolate : : GetCurrent ( ) ) ; <nl> - builder . SetMethod ( " start " , <nl> - base : : Bind ( & CrashReporter : : Start , <nl> - base : : Unretained ( CrashReporter : : GetInstance ( ) ) ) ) ; <nl> - exports - > SetPrototype ( builder . Build ( ) - > NewInstance ( ) ) ; <nl> + mate : : Dictionary dict ( v8 : : Isolate : : GetCurrent ( ) , exports ) ; <nl> + dict . SetMethod ( " start " , <nl> + base : : Bind ( & CrashReporter : : Start , <nl> + base : : Unretained ( CrashReporter : : GetInstance ( ) ) ) ) ; <nl> } <nl> <nl> } / / namespace <nl> mmm a / atom / common / api / atom_api_screen . cc <nl> ppp b / atom / common / api / atom_api_screen . cc <nl> <nl> / / Use of this source code is governed by a BSD - style license that can be <nl> / / found in the LICENSE file . <nl> <nl> - # include " native_mate / object_template_builder . h " <nl> + # include " native_mate / dictionary . h " <nl> # include " ui / gfx / screen . h " <nl> <nl> # include " atom / common / v8 / node_common . h " <nl> void Initialize ( v8 : : Handle < v8 : : Object > exports ) { <nl> # endif <nl> <nl> gfx : : Screen * screen = gfx : : Screen : : GetNativeScreen ( ) ; <nl> - <nl> - mate : : ObjectTemplateBuilder builder ( v8 : : Isolate : : GetCurrent ( ) ) ; <nl> - builder . SetMethod ( " getCursorScreenPoint " , <nl> - base : : Bind ( & gfx : : Screen : : GetCursorScreenPoint , <nl> - base : : Unretained ( screen ) ) ) <nl> - . SetMethod ( " getPrimaryDisplay " , <nl> - base : : Bind ( & gfx : : Screen : : GetPrimaryDisplay , <nl> - base : : Unretained ( screen ) ) ) ; <nl> - exports - > SetPrototype ( builder . Build ( ) - > NewInstance ( ) ) ; <nl> + mate : : Dictionary dict ( v8 : : Isolate : : GetCurrent ( ) , exports ) ; <nl> + dict . SetMethod ( " getCursorScreenPoint " , <nl> + base : : Bind ( & gfx : : Screen : : GetCursorScreenPoint , <nl> + base : : Unretained ( screen ) ) ) ; <nl> + dict . SetMethod ( " getPrimaryDisplay " , <nl> + base : : Bind ( & gfx : : Screen : : GetPrimaryDisplay , <nl> + base : : Unretained ( screen ) ) ) ; <nl> } <nl> <nl> } / / namespace <nl> mmm a / atom / common / api / atom_api_shell . cc <nl> ppp b / atom / common / api / atom_api_shell . cc <nl> <nl> <nl> # include " atom / common / platform_util . h " <nl> # include " atom / common / v8_converters / file_path_converter . h " <nl> - # include " native_mate / object_template_builder . h " <nl> + # include " native_mate / dictionary . h " <nl> # include " url / gurl . h " <nl> <nl> # include " atom / common / v8 / node_common . h " <nl> struct Converter < GURL > { <nl> namespace { <nl> <nl> void Initialize ( v8 : : Handle < v8 : : Object > exports ) { <nl> - mate : : ObjectTemplateBuilder builder ( v8 : : Isolate : : GetCurrent ( ) ) ; <nl> - builder . SetMethod ( " showItemInFolder " , & platform_util : : ShowItemInFolder ) <nl> - . SetMethod ( " openItem " , & platform_util : : OpenItem ) <nl> - . SetMethod ( " openExternal " , & platform_util : : OpenExternal ) <nl> - . SetMethod ( " moveItemToTrash " , & platform_util : : MoveItemToTrash ) <nl> - . SetMethod ( " beep " , & platform_util : : Beep ) ; <nl> - exports - > SetPrototype ( builder . Build ( ) - > NewInstance ( ) ) ; <nl> + mate : : Dictionary dict ( v8 : : Isolate : : GetCurrent ( ) , exports ) ; <nl> + dict . SetMethod ( " showItemInFolder " , & platform_util : : ShowItemInFolder ) ; <nl> + dict . SetMethod ( " openItem " , & platform_util : : OpenItem ) ; <nl> + dict . SetMethod ( " openExternal " , & platform_util : : OpenExternal ) ; <nl> + dict . SetMethod ( " moveItemToTrash " , & platform_util : : MoveItemToTrash ) ; <nl> + dict . SetMethod ( " beep " , & platform_util : : Beep ) ; <nl> } <nl> <nl> } / / namespace <nl> mmm a / atom / common / api / atom_api_v8_util . cc <nl> ppp b / atom / common / api / atom_api_v8_util . cc <nl> <nl> / / found in the LICENSE file . <nl> <nl> # include " atom / common / api / object_life_monitor . h " <nl> + # include " native_mate / dictionary . h " <nl> # include " v8 / include / v8 - profiler . h " <nl> <nl> # include " atom / common / v8 / node_common . h " <nl> <nl> - namespace atom { <nl> - <nl> - namespace api { <nl> - <nl> namespace { <nl> <nl> - void CreateObjectWithName ( const v8 : : FunctionCallbackInfo < v8 : : Value > & args ) { <nl> + v8 : : Handle < v8 : : Object > CreateObjectWithName ( v8 : : Handle < v8 : : String > name ) { <nl> v8 : : Local < v8 : : FunctionTemplate > t = v8 : : FunctionTemplate : : New ( ) ; <nl> - t - > SetClassName ( args [ 0 ] - > ToString ( ) ) ; <nl> - args . GetReturnValue ( ) . Set ( t - > GetFunction ( ) - > NewInstance ( ) ) ; <nl> + t - > SetClassName ( name ) ; <nl> + return t - > GetFunction ( ) - > NewInstance ( ) ; <nl> } <nl> <nl> - void GetHiddenValue ( const v8 : : FunctionCallbackInfo < v8 : : Value > & args ) { <nl> - args . GetReturnValue ( ) . Set ( <nl> - args [ 0 ] - > ToObject ( ) - > GetHiddenValue ( args [ 1 ] - > ToString ( ) ) ) ; <nl> + v8 : : Handle < v8 : : Value > GetHiddenValue ( v8 : : Handle < v8 : : Object > object , <nl> + v8 : : Handle < v8 : : String > key ) { <nl> + return object - > GetHiddenValue ( key ) ; <nl> } <nl> <nl> - void SetHiddenValue ( const v8 : : FunctionCallbackInfo < v8 : : Value > & args ) { <nl> - args [ 0 ] - > ToObject ( ) - > SetHiddenValue ( args [ 1 ] - > ToString ( ) , args [ 2 ] ) ; <nl> + void SetHiddenValue ( v8 : : Handle < v8 : : Object > object , <nl> + v8 : : Handle < v8 : : String > key , <nl> + v8 : : Handle < v8 : : Value > value ) { <nl> + object - > SetHiddenValue ( key , value ) ; <nl> } <nl> <nl> - void GetObjectHash ( const v8 : : FunctionCallbackInfo < v8 : : Value > & args ) { <nl> - args . GetReturnValue ( ) . Set ( args [ 0 ] - > ToObject ( ) - > GetIdentityHash ( ) ) ; <nl> + int32_t GetObjectHash ( v8 : : Handle < v8 : : Object > object ) { <nl> + return object - > GetIdentityHash ( ) ; <nl> } <nl> <nl> - void SetDestructor ( const v8 : : FunctionCallbackInfo < v8 : : Value > & args ) { <nl> - ObjectLifeMonitor : : BindTo ( args [ 0 ] - > ToObject ( ) , args [ 1 ] ) ; <nl> + void SetDestructor ( v8 : : Handle < v8 : : Object > object , <nl> + v8 : : Handle < v8 : : Function > callback ) { <nl> + atom : : ObjectLifeMonitor : : BindTo ( object , callback ) ; <nl> } <nl> <nl> - void TakeHeapSnapshot ( const v8 : : FunctionCallbackInfo < v8 : : Value > & args ) { <nl> + void TakeHeapSnapshot ( ) { <nl> node : : node_isolate - > GetHeapProfiler ( ) - > TakeHeapSnapshot ( <nl> v8 : : String : : New ( " test " ) ) ; <nl> } <nl> <nl> - } / / namespace <nl> - <nl> - void InitializeV8Util ( v8 : : Handle < v8 : : Object > target ) { <nl> - NODE_SET_METHOD ( target , " createObjectWithName " , CreateObjectWithName ) ; <nl> - NODE_SET_METHOD ( target , " getHiddenValue " , GetHiddenValue ) ; <nl> - NODE_SET_METHOD ( target , " setHiddenValue " , SetHiddenValue ) ; <nl> - NODE_SET_METHOD ( target , " getObjectHash " , GetObjectHash ) ; <nl> - NODE_SET_METHOD ( target , " setDestructor " , SetDestructor ) ; <nl> - NODE_SET_METHOD ( target , " takeHeapSnapshot " , TakeHeapSnapshot ) ; <nl> + void Initialize ( v8 : : Handle < v8 : : Object > exports ) { <nl> + mate : : Dictionary dict ( v8 : : Isolate : : GetCurrent ( ) , exports ) ; <nl> + dict . SetMethod ( " createObjectWithName " , & CreateObjectWithName ) ; <nl> + dict . SetMethod ( " getHiddenValue " , & GetHiddenValue ) ; <nl> + dict . SetMethod ( " setHiddenValue " , & SetHiddenValue ) ; <nl> + dict . SetMethod ( " getObjectHash " , & GetObjectHash ) ; <nl> + dict . SetMethod ( " setDestructor " , & SetDestructor ) ; <nl> + dict . SetMethod ( " takeHeapSnapshot " , & TakeHeapSnapshot ) ; <nl> } <nl> <nl> - } / / namespace api <nl> - <nl> - } / / namespace atom <nl> + } / / namespace <nl> <nl> - NODE_MODULE ( atom_common_v8_util , atom : : api : : InitializeV8Util ) <nl> + NODE_MODULE ( atom_common_v8_util , Initialize ) <nl> mmm a / atom / renderer / api / atom_api_renderer_ipc . cc <nl> ppp b / atom / renderer / api / atom_api_renderer_ipc . cc <nl> <nl> # include " atom / common / v8 / v8_value_converter . h " <nl> # include " atom / common / v8_converters / string16_converter . h " <nl> # include " content / public / renderer / render_view . h " <nl> - # include " native_mate / object_template_builder . h " <nl> + # include " native_mate / dictionary . h " <nl> # include " third_party / WebKit / public / web / WebFrame . h " <nl> # include " third_party / WebKit / public / web / WebView . h " <nl> <nl> string16 SendSync ( const string16 & channel , const base : : ListValue & arguments ) { <nl> } <nl> <nl> void Initialize ( v8 : : Handle < v8 : : Object > exports ) { <nl> - mate : : ObjectTemplateBuilder builder ( v8 : : Isolate : : GetCurrent ( ) ) ; <nl> - builder . SetMethod ( " send " , & Send ) <nl> - . SetMethod ( " sendSync " , & SendSync ) ; <nl> - exports - > SetPrototype ( builder . Build ( ) - > NewInstance ( ) ) ; <nl> + mate : : Dictionary dict ( v8 : : Isolate : : GetCurrent ( ) , exports ) ; <nl> + dict . SetMethod ( " send " , & Send ) ; <nl> + dict . SetMethod ( " sendSync " , & SendSync ) ; <nl> } <nl> <nl> } / / namespace <nl> mmm a / vendor / native_mate <nl> ppp b / vendor / native_mate <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit c9fa29ef640e8d3d2edf6b48c2311b16ce314464 <nl> + Subproject commit 94dec0ff85c9337d33cae01638897bc1059b7dca <nl> | Use Dictionary to set module . exports . | electron/electron | a2407c6b0231ded40e5db475cb280706dbdf27e3 | 2014-04-16T07:43:06Z |
mmm a / atom / renderer / atom_sandboxed_renderer_client . cc <nl> ppp b / atom / renderer / atom_sandboxed_renderer_client . cc <nl> void InitializeBindings ( v8 : : Local < v8 : : Object > binding , <nl> b . SetMethod ( " getHeapStatistics " , & AtomBindings : : GetHeapStatistics ) ; <nl> b . SetMethod ( " getProcessMemoryInfo " , & AtomBindings : : GetProcessMemoryInfo ) ; <nl> b . SetMethod ( " getSystemMemoryInfo " , & AtomBindings : : GetSystemMemoryInfo ) ; <nl> + <nl> + / / Pass in CLI flags needed to setup the renderer <nl> + base : : CommandLine * command_line = base : : CommandLine : : ForCurrentProcess ( ) ; <nl> + if ( command_line - > HasSwitch ( switches : : kGuestInstanceID ) ) <nl> + b . Set ( options : : kGuestInstanceID , <nl> + command_line - > GetSwitchValueASCII ( switches : : kGuestInstanceID ) ) ; <nl> } <nl> <nl> class AtomSandboxedRenderFrameObserver : public AtomRenderFrameObserver { <nl> mmm a / lib / browser / guest - view - manager . js <nl> ppp b / lib / browser / guest - view - manager . js <nl> const attachGuest = function ( event , elementInstanceId , guestInstanceId , params ) <nl> webPreferences . disablePopups = true <nl> } <nl> <nl> + / / Security options that guest will always inherit from embedder <nl> + const inheritedWebPreferences = new Map ( [ <nl> + [ ' contextIsolation ' , true ] , <nl> + [ ' javascript ' , false ] , <nl> + [ ' nativeWindowOpen ' , true ] , <nl> + [ ' nodeIntegration ' , false ] , <nl> + [ ' sandbox ' , true ] <nl> + ] ) <nl> + <nl> + / / Inherit certain option values from embedder <nl> + const lastWebPreferences = embedder . getLastWebPreferences ( ) <nl> + for ( const [ name , value ] of inheritedWebPreferences ) { <nl> + if ( lastWebPreferences [ name ] = = = value ) { <nl> + webPreferences [ name ] = value <nl> + } <nl> + } <nl> + <nl> embedder . emit ( ' will - attach - webview ' , event , webPreferences , params ) <nl> if ( event . defaultPrevented ) { <nl> if ( guest . viewInstanceId = = null ) guest . viewInstanceId = params . instanceId <nl> mmm a / lib / sandboxed_renderer / init . js <nl> ppp b / lib / sandboxed_renderer / init . js <nl> if ( window . location . protocol = = = ' chrome - devtools : ' ) { <nl> require ( ' . . / renderer / inspector ' ) <nl> } <nl> <nl> + if ( binding . guestInstanceId ) { <nl> + process . guestInstanceId = parseInt ( binding . guestInstanceId ) <nl> + } <nl> + <nl> + if ( ! process . guestInstanceId & & preloadProcess . argv . indexOf ( ' - - webview - tag = true ' ) ! = = - 1 ) { <nl> + / / don ' t allow recursive ` < webview > ` <nl> + require ( ' . . / renderer / web - view / web - view ' ) <nl> + require ( ' . . / renderer / web - view / web - view - attributes ' ) <nl> + } <nl> + <nl> / / Wrap the script into a function executed in global scope . It won ' t have <nl> / / access to the current scope , so we ' ll expose a few objects as arguments : <nl> / / <nl> mmm a / spec / api - browser - window - spec . js <nl> ppp b / spec / api - browser - window - spec . js <nl> const os = require ( ' os ' ) <nl> const qs = require ( ' querystring ' ) <nl> const http = require ( ' http ' ) <nl> const { closeWindow } = require ( ' . / window - helpers ' ) <nl> - <nl> + const { emittedOnce } = require ( ' . / events - helpers ' ) <nl> const { ipcRenderer , remote , screen } = require ( ' electron ' ) <nl> const { app , ipcMain , BrowserWindow , BrowserView , protocol , session , webContents } = remote <nl> <nl> describe ( ' BrowserWindow module ' , ( ) = > { <nl> } ) <nl> w . loadURL ( ' file : / / ' + path . join ( fixtures , ' api ' , ' preload . html ' ) ) <nl> } ) <nl> + <nl> + it ( ' webview in sandbox renderer ' , async ( ) = > { <nl> + w . destroy ( ) <nl> + w = new BrowserWindow ( { <nl> + show : false , <nl> + webPreferences : { <nl> + sandbox : true , <nl> + preload : preload , <nl> + webviewTag : true <nl> + } <nl> + } ) <nl> + w . loadURL ( ` file : / / $ { fixtures } / pages / webview - did - attach - event . html ` ) <nl> + <nl> + const [ , webContents ] = await emittedOnce ( w . webContents , ' did - attach - webview ' ) <nl> + const [ , id ] = await emittedOnce ( ipcMain , ' webview - dom - ready ' ) <nl> + expect ( webContents . id ) . to . equal ( id ) <nl> + } ) <nl> } ) <nl> <nl> describe ( ' nativeWindowOpen option ' , ( ) = > { <nl> | Enable webview in sandbox renderer ( ) | electron/electron | eb223f8bc3bb131775b1b19881e0438be065bf17 | 2018-07-02T16:06:26Z |
mmm a / modules / control / controller / lat_controller . cc <nl> ppp b / modules / control / controller / lat_controller . cc <nl> Status LatController : : ComputeControlCommand ( <nl> ( VehicleState : : instance ( ) - > linear_velocity ( ) * <nl> VehicleState : : instance ( ) - > linear_velocity ( ) ) ) * <nl> steer_transmission_ratio_ * 180 / M_PI / <nl> - steer_single_direction_max_degree_ ; <nl> + steer_single_direction_max_degree_ * 100 ; <nl> <nl> / / Clamp the steer angle <nl> double steer_angle_limited = <nl> | Fix steering limit from - 1 to 1 to - 100 to 100 ( ) | ApolloAuto/apollo | 07635b537cb5cd67ff19b9e5f8da7bf93cf4db0d | 2017-08-03T21:47:47Z |
mmm a / ios / samples / README . md <nl> ppp b / ios / samples / README . md <nl> When building for the simulator , the sample will then link against the libraries <nl> # # Xcode <nl> <nl> Open up one of the Xcode projects : <nl> - - hello - ar / hello - ar . xcodeproj <nl> - - hello - gltf / hello - gltf . xcodeproj <nl> - - hello - pbr / hello - pbr . xcodeproj <nl> - - hello - triangle / hello - triangle . xcodeproj <nl> - - transparent - rendering / transparent - rendering . xcodeproj <nl> + <nl> + - hello - ar / hello - ar . xcodeproj <nl> + - hello - gltf / hello - gltf . xcodeproj <nl> + - hello - pbr / hello - pbr . xcodeproj <nl> + - hello - triangle / hello - triangle . xcodeproj <nl> + - transparent - rendering / transparent - rendering . xcodeproj <nl> <nl> Each project contains two schemes , ` < sample > Metal ` and ` < sample > OpenGL ` , which use the Metal and <nl> OpenGL backends respectively . Before building you will need to select one of the schemes , sign in to <nl> | Fix iOS README formatting | google/filament | 326a67acdb3ebe89baf96fb47077081c79280616 | 2019-05-30T17:01:56Z |
mmm a / googletest / include / gtest / internal / gtest - internal . h <nl> ppp b / googletest / include / gtest / internal / gtest - internal . h <nl> <nl> # include < map > <nl> # include < set > <nl> # include < string > <nl> + # include < type_traits > <nl> # include < vector > <nl> <nl> # include " gtest / gtest - message . h " <nl> GTEST_API_ extern const char kStackTraceMarker [ ] ; <nl> <nl> / / An IgnoredValue object can be implicitly constructed from ANY value . <nl> class IgnoredValue { <nl> + struct Sink { } ; <nl> public : <nl> / / This constructor template allows any value to be implicitly <nl> / / converted to IgnoredValue . The object has no data member and <nl> / / doesn ' t try to remember anything about the argument . We <nl> / / deliberately omit the ' explicit ' keyword in order to allow the <nl> / / conversion to be implicit . <nl> - template < typename T > <nl> + / / Disable the conversion if T already has a magical conversion operator . <nl> + / / Otherwise we get ambiguity . <nl> + template < typename T , <nl> + typename std : : enable_if < ! std : : is_convertible < T , Sink > : : value , <nl> + int > : : type = 0 > <nl> IgnoredValue ( const T & / * ignored * / ) { } / / NOLINT ( runtime / explicit ) <nl> } ; <nl> <nl> + / / The only type that should be convertible to Secret * is nullptr . <nl> + / / The other null pointer constants are not of a type that is convertible to <nl> + / / Secret * . Only the literal with the right value is . <nl> + template < typename T > <nl> + using TypeIsValidNullptrConstant = std : : integral_constant < <nl> + bool , std : : is_same < typename std : : decay < T > : : type , std : : nullptr_t > : : value | | <nl> + ! std : : is_convertible < T , Secret * > : : value > ; <nl> + <nl> / / Two overloaded helpers for checking at compile time whether an <nl> / / expression is a null pointer literal ( i . e . NULL or any 0 - valued <nl> / / compile - time integral constant ) . These helpers have no <nl> class IgnoredValue { <nl> / / a null pointer literal . Therefore , we know that x is a null <nl> / / pointer literal if and only if the first version is picked by the <nl> / / compiler . <nl> - std : : true_type IsNullLiteralHelper ( Secret * ) ; <nl> - std : : false_type IsNullLiteralHelper ( IgnoredValue ) ; <nl> + std : : true_type IsNullLiteralHelper ( Secret * , std : : true_type ) ; <nl> + std : : false_type IsNullLiteralHelper ( IgnoredValue , std : : false_type ) ; <nl> + std : : false_type IsNullLiteralHelper ( IgnoredValue , std : : true_type ) ; <nl> <nl> / / A compile - time bool constant that is true if and only if x is a null pointer <nl> / / literal ( i . e . nullptr , NULL or any 0 - valued compile - time integral constant ) . <nl> - # define GTEST_IS_NULL_LITERAL_ ( x ) \ <nl> - decltype ( : : testing : : internal : : IsNullLiteralHelper ( x ) ) : : value <nl> + # define GTEST_IS_NULL_LITERAL_ ( x ) \ <nl> + decltype ( : : testing : : internal : : IsNullLiteralHelper ( \ <nl> + x , \ <nl> + : : testing : : internal : : TypeIsValidNullptrConstant < decltype ( x ) > ( ) ) ) : : value <nl> <nl> / / Appends the user - supplied message to the Google - Test - generated message . <nl> GTEST_API_ std : : string AppendUserMessage ( <nl> mmm a / googletest / test / gtest_unittest . cc <nl> ppp b / googletest / test / gtest_unittest . cc <nl> TEST_F ( FormatEpochTimeInMillisAsIso8601Test , PrintsEpochStart ) { <nl> / / Tests that GTEST_IS_NULL_LITERAL_ ( x ) is true when x is a null <nl> / / pointer literal . <nl> TEST ( NullLiteralTest , IsTrueForNullLiterals ) { <nl> - EXPECT_TRUE ( GTEST_IS_NULL_LITERAL_ ( nullptr ) ) ; <nl> - EXPECT_TRUE ( GTEST_IS_NULL_LITERAL_ ( nullptr ) ) ; <nl> - EXPECT_TRUE ( GTEST_IS_NULL_LITERAL_ ( nullptr ) ) ; <nl> + EXPECT_TRUE ( GTEST_IS_NULL_LITERAL_ ( NULL ) ) ; / / NOLINT <nl> + EXPECT_TRUE ( GTEST_IS_NULL_LITERAL_ ( 0 ) ) ; / / NOLINT <nl> + EXPECT_TRUE ( GTEST_IS_NULL_LITERAL_ ( 0u ) ) ; / / NOLINT <nl> EXPECT_TRUE ( GTEST_IS_NULL_LITERAL_ ( nullptr ) ) ; <nl> } <nl> <nl> TEST ( NullLiteralTest , IsFalseForNonNullLiterals ) { <nl> EXPECT_FALSE ( GTEST_IS_NULL_LITERAL_ ( static_cast < void * > ( nullptr ) ) ) ; <nl> } <nl> <nl> + struct ConvertToAll { <nl> + template < typename T > <nl> + operator T ( ) const { / / NOLINT <nl> + return T ( ) ; <nl> + } <nl> + } ; <nl> + <nl> + struct ConvertToAllButNoPointers { <nl> + template < typename T , <nl> + typename std : : enable_if < ! std : : is_pointer < T > : : value , int > : : type = 0 > <nl> + operator T ( ) const { / / NOLINT <nl> + return T ( ) ; <nl> + } <nl> + } ; <nl> + <nl> + TEST ( NullLiteralTest , ImplicitConversion ) { <nl> + EXPECT_FALSE ( GTEST_IS_NULL_LITERAL_ ( ConvertToAll { } ) ) ; <nl> + EXPECT_FALSE ( GTEST_IS_NULL_LITERAL_ ( ConvertToAllButNoPointers { } ) ) ; <nl> + } <nl> + <nl> # ifdef __BORLANDC__ <nl> / / Restores warnings after previous " # pragma option push " suppressed them . <nl> # pragma option pop <nl> | Googletest export | google/googletest | b6cd405286ed8635ece71c72f118e659f4ade3fb | 2019-01-07T17:09:25Z |
mmm a / README . md <nl> ppp b / README . md <nl> LeetCode <nl> | 123 | [ Best Time to Buy and Sell Stock III ] ( https : / / oj . leetcode . com / problems / best - time - to - buy - and - sell - stock - iii / ) | [ C + + ] ( . / algorithms / bestTimeToBuyAndSellStock / bestTimeToBuyAndSellStock . III . cpp ) | Hard | <nl> | 122 | [ Best Time to Buy and Sell Stock II ] ( https : / / oj . leetcode . com / problems / best - time - to - buy - and - sell - stock - ii / ) | [ C + + ] ( . / algorithms / bestTimeToBuyAndSellStock / bestTimeToBuyAndSellStock . II . cpp ) | Medium | <nl> | 121 | [ Best Time to Buy and Sell Stock ] ( https : / / oj . leetcode . com / problems / best - time - to - buy - and - sell - stock / ) | [ C + + ] ( . / algorithms / bestTimeToBuyAndSellStock / bestTimeToBuyAndSellStock . cpp ) | Medium | <nl> - | 120 | [ Triangle ] ( https : / / oj . leetcode . com / problems / triangle / ) | [ C + + ] ( . / algorithms / triangle / triangle . cpp ) | Medium | <nl> + | 120 | [ Triangle ] ( https : / / oj . leetcode . com / problems / triangle / ) | [ C + + ] ( . / algorithms / triangle / triangle . cpp ) , [ C + + ] ( . / algorithms - java / src / dynamicProgramming / triangle / triangle . java ) | Medium | <nl> | 119 | [ Pascal ' s Triangle II ] ( https : / / oj . leetcode . com / problems / pascals - triangle - ii / ) | [ C + + ] ( . / algorithms / pascalTriangle / pascalTriangle . II . cpp ) | Easy | <nl> | 118 | [ Pascal ' s Triangle ] ( https : / / oj . leetcode . com / problems / pascals - triangle / ) | [ C + + ] ( . / algorithms / pascalTriangle / pascalTriangle . cpp ) | Easy | <nl> | 117 | [ Populating Next Right Pointers in Each Node II ] ( https : / / oj . leetcode . com / problems / populating - next - right - pointers - in - each - node - ii / ) | [ C + + ] ( . / algorithms / populatingNextRightPointersInEachNode / populatingNextRightPointersInEachNode . II . cpp ) | Hard | <nl> new file mode 100644 <nl> index 00000000 . . ed40d39b <nl> mmm / dev / null <nl> ppp b / algorithms - java / src / dynamicProgramming / triangle / triangle . java <nl> <nl> + / / Source : https : / / oj . leetcode . com / problems / triangle / <nl> + / / Inspired by : http : / / www . jiuzhang . com / solutions / triangle / <nl> + / / Author : Lei Cao <nl> + / / Date : 2015 - 10 - 12 <nl> + <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> + * <nl> + * Given a triangle , find the minimum path sum from top to bottom . <nl> + * Each step you may move to adjacent numbers on the row below . <nl> + * <nl> + * For example , given the following triangle <nl> + * <nl> + * [ <nl> + * [ 2 ] , <nl> + * [ 3 , 4 ] , <nl> + * [ 6 , 5 , 7 ] , <nl> + * [ 4 , 1 , 8 , 3 ] <nl> + * ] <nl> + * <nl> + * The minimum path sum from top to bottom is 11 ( i . e . , 2 + 3 + 5 + 1 = 11 ) . <nl> + * <nl> + * Note : <nl> + * Bonus point if you are able to do this using only O ( n ) extra space , where n is the total number of rows in the triangle . <nl> + * <nl> + * <nl> + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> + package dynamicProgramming . triangle ; <nl> + <nl> + import java . util . List ; <nl> + <nl> + / * * <nl> + * Created by leicao on 12 / 10 / 15 . <nl> + * / <nl> + public class triangle { <nl> + / * * <nl> + * @ param triangle : a list of lists of integers . <nl> + * @ return : An integer , minimum path sum . <nl> + * / <nl> + public int minimumTotal1 ( List < List < Integer > > triangle ) { <nl> + if ( triangle = = null ) { <nl> + return 0 ; <nl> + } <nl> + int rows = triangle . size ( ) ; <nl> + int [ ] [ ] matrix = new int [ rows ] [ rows ] ; <nl> + matrix [ 0 ] [ 0 ] = triangle . get ( 0 ) . get ( 0 ) ; <nl> + for ( int i = 1 ; i < rows ; i + + ) { <nl> + matrix [ i ] [ 0 ] = triangle . get ( i ) . get ( 0 ) + matrix [ i - 1 ] [ 0 ] ; <nl> + } <nl> + <nl> + for ( int i = 1 ; i < rows ; i + + ) { <nl> + matrix [ i ] [ i ] = triangle . get ( i ) . get ( i ) + matrix [ i - 1 ] [ i - 1 ] ; <nl> + } <nl> + <nl> + for ( int i = 1 ; i < rows ; i + + ) { <nl> + for ( int j = 1 ; j < i ; j + + ) { <nl> + matrix [ i ] [ j ] = Math . min ( matrix [ i - 1 ] [ j - 1 ] , matrix [ i - 1 ] [ j ] ) + triangle . get ( i ) . get ( j ) ; <nl> + } <nl> + } <nl> + int minimum = matrix [ rows - 1 ] [ 0 ] ; <nl> + for ( int i = 1 ; i < rows ; i + + ) { <nl> + if ( matrix [ rows - 1 ] [ i ] < minimum ) { <nl> + minimum = matrix [ rows - 1 ] [ i ] ; <nl> + } <nl> + } <nl> + return minimum ; <nl> + } <nl> + <nl> + public int minimumTotal2 ( int [ ] [ ] triangle ) { <nl> + if ( triangle = = null ) { <nl> + return 0 ; <nl> + } <nl> + int rows = triangle . length ; <nl> + int [ ] [ ] matrix = new int [ rows ] [ rows ] ; <nl> + matrix [ 0 ] [ 0 ] = triangle [ 0 ] [ 0 ] ; <nl> + for ( int i = 1 ; i < rows ; i + + ) { <nl> + matrix [ i ] [ 0 ] = triangle [ i ] [ 0 ] + matrix [ i - 1 ] [ 0 ] ; <nl> + } <nl> + <nl> + for ( int i = 1 ; i < rows ; i + + ) { <nl> + matrix [ i ] [ i ] = triangle [ i ] [ i ] + matrix [ i - 1 ] [ i - 1 ] ; <nl> + } <nl> + <nl> + for ( int i = 1 ; i < rows ; i + + ) { <nl> + for ( int j = 1 ; j < i ; j + + ) { <nl> + matrix [ i ] [ j ] = Math . min ( matrix [ i - 1 ] [ j - 1 ] , matrix [ i - 1 ] [ j ] ) + triangle [ i ] [ j ] ; <nl> + } <nl> + } <nl> + int minimum = matrix [ rows - 1 ] [ 0 ] ; <nl> + for ( int i = 1 ; i < rows ; i + + ) { <nl> + if ( matrix [ rows - 1 ] [ i ] < minimum ) { <nl> + minimum = matrix [ rows - 1 ] [ i ] ; <nl> + } <nl> + } <nl> + return minimum ; <nl> + } <nl> + } <nl> new file mode 100644 <nl> index 00000000 . . fe7974ab <nl> mmm / dev / null <nl> ppp b / algorithms - java / src / dynamicProgramming / triangle / triangleTest . java <nl> <nl> + package dynamicProgramming . triangle ; <nl> + <nl> + import org . junit . Test ; <nl> + <nl> + import static org . junit . Assert . * ; <nl> + <nl> + / * * <nl> + * Created by leicao on 15 / 10 / 15 . <nl> + * / <nl> + public class triangleTest { <nl> + <nl> + @ Test <nl> + public void testMinimumTotal ( ) throws Exception { <nl> + int [ ] [ ] [ ] inputes = { <nl> + { <nl> + { 2 } , <nl> + { 3 , 4 } , <nl> + { 6 , 5 , 7 } , <nl> + { 4 , 1 , 8 , 3 } , <nl> + } <nl> + } ; <nl> + <nl> + int [ ] results = { 11 } ; <nl> + <nl> + for ( int i = 0 ; i < results . length ; i + + ) { <nl> + triangle t = new triangle ( ) ; <nl> + int r = t . minimumTotal2 ( inputes [ i ] ) ; <nl> + assertEquals ( results [ i ] , r ) ; <nl> + } <nl> + <nl> + } <nl> + } <nl> \ No newline at end of file <nl> | 120 triangle | haoel/leetcode | d9e4efd67d197b0b7e76573189e1828b3895b0df | 2015-10-15T16:10:46Z |
mmm a / xbmc / addons / InputStream . cpp <nl> ppp b / xbmc / addons / InputStream . cpp <nl> bool CInputStream : : Supports ( CFileItem & fileitem ) <nl> return false ; <nl> <nl> if ( ! m_pStruct ) <nl> - return false ; <nl> + return true ; <nl> <nl> std : : string pathList ; <nl> try <nl> | Support has to return true if extension check was successfull and addon not loaded | xbmc/xbmc | a1dc5bd764b5fc1d7e9a0423c877bc07f3e316bf | 2016-03-05T22:24:54Z |
mmm a / src / mongo / client / mongo_uri . cpp <nl> ppp b / src / mongo / client / mongo_uri . cpp <nl> <nl> <nl> # include " mongo / client / mongo_uri . h " <nl> <nl> - # include < regex > <nl> + # include < tuple > <nl> <nl> # include " mongo / base / status_with . h " <nl> # include " mongo / bson / bsonobjbuilder . h " <nl> # include " mongo / client / dbclientinterface . h " <nl> # include " mongo / client / sasl_client_authenticate . h " <nl> + # include " mongo / db / namespace_string . h " <nl> + # include " mongo / util / hex . h " <nl> # include " mongo / util / mongoutils / str . h " <nl> - # include " mongo / util / password_digest . h " <nl> <nl> # include < boost / algorithm / string / case_conv . hpp > <nl> # include < boost / algorithm / string / classification . hpp > <nl> + # include < boost / algorithm / string / find_iterator . hpp > <nl> # include < boost / algorithm / string / predicate . hpp > <nl> - # include < boost / algorithm / string / split . hpp > <nl> <nl> namespace mongo { <nl> <nl> namespace { <nl> - const char kMongoDBURL [ ] = <nl> - / / scheme : non - capturing <nl> - " mongodb : / / " <nl> <nl> - / / credentials : two inner captures for user and password <nl> - " ( ? : ( [ ^ : ] + ) ( ? : : ( [ ^ @ ] + ) ) ? @ ) ? " <nl> + / / Helper Method for MongoURI : : parse ( ) to urlDecode the components of the URI <nl> + StatusWith < std : : string > urlDecode ( StringData toDecode ) { <nl> + std : : ostringstream out ; <nl> + for ( size_t i = 0 ; i < toDecode . size ( ) ; + + i ) { <nl> + if ( toDecode . substr ( i , 1 ) = = " % " ) { <nl> + if ( i + 2 > toDecode . size ( ) ) { <nl> + return Status ( ErrorCodes : : FailedToParse , " " ) ; <nl> + } <nl> + out < < mongo : : fromHex ( toDecode . substr ( i + 1 , 2 ) ) ; <nl> + i + = 2 ; <nl> + } else { <nl> + out < < toDecode . substr ( i , 1 ) ; <nl> + } <nl> + } <nl> + return out . str ( ) ; <nl> + } <nl> + <nl> + / * Helper Method for MongoURI : : parse ( ) to split a string into exactly 2 pieces by a char delimeter <nl> + * / <nl> <nl> - / / servers : grabs all host : port or UNIX socket names <nl> - " ( ( ? : [ ^ \ \ / ] + | / . + \ \ . sock ) ( ? : , ( ? : [ ^ \ \ / ] + | / . + \ \ . sock ) ) * ) " <nl> + / * partitionForward ( ) splits a string by the first occurance of the character delimeter <nl> <nl> - / / database and options are grouped together <nl> - " ( ? : / " <nl> + Params : <nl> + str : The string to be split <nl> + c : The char delimeter <nl> <nl> - / / database : matches anything but the chars that cannot be part of a MongoDB database name which <nl> - / / are ( in order ) - forward slash , back slash , dot , space , double - quote , dollar sign , asterisk , <nl> - / / less than , greater than , colon , pipe , question mark . <nl> - " ( [ ^ / \ \ \ \ \ \ . \ \ \ " \ \ $ * < > : \ \ | \ \ ? ] * ) ? " <nl> + Returns : <nl> + std : : tuple < StringData , StringData > <nl> + * / <nl> + std : : tuple < StringData , StringData > partitionForward ( const StringData str , const char c ) { <nl> + std : : size_t delim = str . find ( c ) ; <nl> + if ( delim = = std : : string : : npos ) { <nl> + return std : : make_tuple ( str , StringData ( ) ) ; <nl> + } <nl> + return std : : make_tuple ( str . substr ( 0 , delim ) , str . substr ( delim + 1 ) ) ; <nl> + } <nl> <nl> - / / options <nl> - " ( ? : \ \ ? ( [ ^ & = ? ] + = [ ^ & = ? ] + ( ? : & [ ^ & = ? ] + = [ ^ & = ? ] + ) * ) ) ? " <nl> + / * partitionBackward ( ) splits a string by the last occurance of the character delimeter <nl> <nl> - / / close db / options group <nl> - " ) ? " ; <nl> + Params : <nl> + str : The string to be split <nl> + c : The char delimeter <nl> <nl> - } / / namespace <nl> + Returns : <nl> + std : : tuple < StringData , StringData > <nl> + * / <nl> + std : : tuple < StringData , StringData > partitionBackward ( const StringData str , const char c ) { <nl> + std : : size_t delim = str . rfind ( c ) ; <nl> + if ( delim = = std : : string : : npos ) { <nl> + return std : : make_tuple ( StringData ( ) , str ) ; <nl> + } <nl> + return std : : make_tuple ( str . substr ( 0 , delim ) , str . substr ( delim + 1 ) ) ; <nl> + } <nl> <nl> <nl> + } / / namespace <nl> + <nl> StatusWith < MongoURI > MongoURI : : parse ( const std : : string & url ) { <nl> - if ( ! boost : : algorithm : : starts_with ( url , " mongodb : / / " ) ) { <nl> + StringData urlSD = StringData ( url ) ; <nl> + StringData prefix ( " mongodb : / / " ) ; <nl> + if ( ! urlSD . startsWith ( prefix ) ) { <nl> auto cs_status = ConnectionString : : parse ( url ) ; <nl> if ( ! cs_status . isOK ( ) ) { <nl> return cs_status . getStatus ( ) ; <nl> } <nl> - <nl> return MongoURI ( cs_status . getValue ( ) ) ; <nl> } <nl> - const std : : regex mongoUrlRe ( kMongoDBURL ) ; <nl> - std : : smatch matches ; <nl> - if ( ! std : : regex_match ( url , matches , mongoUrlRe ) ) { <nl> - return Status ( ErrorCodes : : FailedToParse , <nl> - str : : stream ( ) < < " Failed to parse mongodb : / / URL : " < < url ) ; <nl> + <nl> + / / 1 . Validate and remove the scheme prefix mongodb : / / <nl> + StringData uriWithoutPrefix = urlSD . substr ( prefix . size ( ) ) ; <nl> + <nl> + / / 2 . Split the string by the first , unescaped / ( if any ) , yielding : <nl> + / / split [ 0 ] : User information and host identifers <nl> + / / split [ 1 ] : Auth database and connection options <nl> + auto t1 = partitionForward ( uriWithoutPrefix , ' / ' ) ; <nl> + StringData userAndHostInfo = std : : get < 0 > ( t1 ) ; <nl> + StringData databaseAndOptions = std : : get < 1 > ( t1 ) ; <nl> + <nl> + / / 2 . b Make sure that there are no question marks in the left side of the / <nl> + / / as any options after the ? must still have the / delimeter <nl> + if ( databaseAndOptions . empty ( ) & & <nl> + userAndHostInfo . toString ( ) . find_first_of ( " ? " ) ! = std : : string : : npos ) { <nl> + return Status ( <nl> + ErrorCodes : : FailedToParse , <nl> + str : : stream ( ) <nl> + < < " URI must contain slash delimeter between hosts and options for mongodb : / / URL : " <nl> + < < url ) ; <nl> } <nl> <nl> - / / We have the whole input plus 5 top level captures ( user , password , host , db , options ) . <nl> - invariant ( matches . size ( ) = = 6 ) ; <nl> + / / 3 . Split the user information and host identifiers string by the last , unescaped @ , yielding : <nl> + / / split [ 0 ] : User information <nl> + / / split [ 1 ] : Host identifiers ; <nl> + auto t2 = partitionBackward ( userAndHostInfo , ' @ ' ) ; <nl> + StringData userInfo = std : : get < 0 > ( t2 ) ; <nl> + StringData hostIdentifiers = std : : get < 1 > ( t2 ) ; <nl> + <nl> + / / 4 . Validate , split ( if applicable ) , and URL decode the user information , yielding : <nl> + / / split [ 0 ] = username <nl> + / / split [ 1 ] = password <nl> + auto t3 = partitionForward ( userInfo , ' : ' ) ; <nl> + StringData usernameSD = std : : get < 0 > ( t3 ) ; <nl> + StringData passwordSD = std : : get < 1 > ( t3 ) ; <nl> + std : : size_t found = usernameSD . toString ( ) . find_first_of ( " : @ " ) ; <nl> + if ( found ! = std : : string : : npos ) { <nl> + return Status ( ErrorCodes : : FailedToParse , <nl> + str : : stream ( ) < < " Username must be URL Encoded for mongodb : / / URL : " < < url ) ; <nl> + } <nl> + found = passwordSD . toString ( ) . find_first_of ( " : @ " ) ; <nl> + if ( found ! = std : : string : : npos ) { <nl> + return Status ( ErrorCodes : : FailedToParse , <nl> + str : : stream ( ) < < " Password must be URL Encoded for mongodb : / / URL : " < < url ) ; <nl> + } <nl> <nl> - if ( ! matches [ 3 ] . matched ) { <nl> + / / Get the username and make sure it did not fail to decode <nl> + auto usernameWithStatus = urlDecode ( usernameSD ) ; <nl> + if ( ! usernameWithStatus . isOK ( ) ) <nl> + return Status ( <nl> + ErrorCodes : : FailedToParse , <nl> + str : : stream ( ) < < " Username cannot properly be URL decoded for mongodb : / / URL : " < < url ) ; <nl> + std : : string username = usernameWithStatus . getValue ( ) ; <nl> + <nl> + / / Get the password and make sure it did not fail to decode <nl> + auto passwordWithStatus = urlDecode ( passwordSD ) ; <nl> + if ( ! passwordWithStatus . isOK ( ) ) <nl> + return Status ( <nl> + ErrorCodes : : FailedToParse , <nl> + str : : stream ( ) < < " Password cannot properly be URL decoded for mongodb : / / URL : " < < url ) ; <nl> + std : : string password = passwordWithStatus . getValue ( ) ; <nl> + <nl> + / / 5 . Validate , split , and URL decode the host identifiers . <nl> + if ( hostIdentifiers . empty ( ) ) { <nl> return Status ( ErrorCodes : : FailedToParse , " No server ( s ) specified " ) ; <nl> } <nl> + std : : string hostIdentifiersStr = hostIdentifiers . toString ( ) ; <nl> + std : : vector < HostAndPort > servers ; <nl> + for ( auto i = boost : : make_split_iterator ( hostIdentifiersStr , <nl> + boost : : first_finder ( " , " , boost : : is_iequal ( ) ) ) ; <nl> + i ! = std : : remove_reference < decltype ( ( i ) ) > : : type { } ; <nl> + + + i ) { <nl> + auto hostWithStatus = urlDecode ( boost : : copy_range < std : : string > ( * i ) ) ; <nl> + if ( ! hostWithStatus . isOK ( ) ) { <nl> + return Status ( <nl> + ErrorCodes : : FailedToParse , <nl> + str : : stream ( ) < < " Host cannot properly be URL decoded for mongodb : / / URL : " < < url ) ; <nl> + } <nl> <nl> - std : : map < std : : string , std : : string > options ; <nl> - <nl> - if ( matches [ 5 ] . matched ) { <nl> - const std : : string optionsMatch = matches [ 5 ] . str ( ) ; <nl> + auto statusHostAndPort = HostAndPort : : parse ( hostWithStatus . getValue ( ) ) ; <nl> + if ( ! statusHostAndPort . isOK ( ) ) { <nl> + return statusHostAndPort . getStatus ( ) ; <nl> + } <nl> + servers . push_back ( statusHostAndPort . getValue ( ) ) ; <nl> + } <nl> <nl> - std : : vector < boost : : iterator_range < std : : string : : const_iterator > > optionsTokens ; <nl> - boost : : algorithm : : split ( optionsTokens , optionsMatch , boost : : algorithm : : is_any_of ( " = & " ) ) ; <nl> + / / 6 . Split the auth database and connection options string by the first , unescaped ? , yielding : <nl> + / / split [ 0 ] = auth database <nl> + / / split [ 1 ] = connection options <nl> + auto t4 = partitionForward ( databaseAndOptions , ' ? ' ) ; <nl> + StringData databaseSD = std : : get < 0 > ( t4 ) ; <nl> + StringData connectionOptions = std : : get < 1 > ( t4 ) ; <nl> + auto databaseWithStatus = urlDecode ( databaseSD ) ; <nl> + if ( ! databaseWithStatus . isOK ( ) ) { <nl> + return Status ( ErrorCodes : : FailedToParse , <nl> + str : : stream ( ) <nl> + < < " Database name cannot properly be URL decoded for mongodb : / / URL : " <nl> + < < url ) ; <nl> + } <nl> + std : : string database = databaseWithStatus . getValue ( ) ; <nl> + <nl> + / / 7 . Validate the database contains no prohibited characters <nl> + / / Prohibited characters : <nl> + / / slash ( " / " ) , backslash ( " \ " ) , space ( " " ) , double - quote ( " " " ) , or dollar sign ( " $ " ) <nl> + / / period ( " . " ) is also prohibited , but drivers MAY allow periods <nl> + if ( ! database . empty ( ) & & <nl> + ! NamespaceString : : validDBName ( database , <nl> + NamespaceString : : DollarInDbNameBehavior : : Disallow ) ) { <nl> + return Status ( ErrorCodes : : FailedToParse , <nl> + str : : stream ( ) <nl> + < < " Database name cannot have reserved characters for mongodb : / / URL : " <nl> + < < url ) ; <nl> + } <nl> <nl> - if ( optionsTokens . size ( ) % 2 ! = 0 ) { <nl> + / / 8 . Validate , split , and URL decode the connection options <nl> + std : : map < std : : string , std : : string > options ; <nl> + if ( ! connectionOptions . empty ( ) ) { <nl> + std : : string connectionOptionsStr = connectionOptions . toString ( ) ; <nl> + std : : size_t foundQ = connectionOptionsStr . find_first_of ( " ? " ) ; <nl> + if ( foundQ ! = std : : string : : npos ) { <nl> return Status ( ErrorCodes : : FailedToParse , <nl> str : : stream ( ) <nl> - < < " Missing a key or value in the options for mongodb : / / URL : " <nl> + < < " URI Cannot Contain multiple questions marks for mongodb : / / URL : " <nl> < < url ) ; <nl> - ; <nl> } <nl> + for ( auto i = boost : : make_split_iterator ( connectionOptionsStr , <nl> + boost : : first_finder ( " & " , boost : : is_iequal ( ) ) ) ; <nl> + i ! = std : : remove_reference < decltype ( ( i ) ) > : : type { } ; <nl> + + + i ) { <nl> + std : : string opt = boost : : copy_range < std : : string > ( * i ) ; <nl> + if ( opt . empty ( ) ) { <nl> + return Status ( ErrorCodes : : FailedToParse , <nl> + str : : stream ( ) <nl> + < < " Missing a key / value pair in the options for mongodb : / / URL : " <nl> + < < url ) ; <nl> + } <nl> + auto t5 = partitionForward ( opt , ' = ' ) ; <nl> + StringData key = std : : get < 0 > ( t5 ) ; <nl> + StringData value = std : : get < 1 > ( t5 ) ; <nl> + if ( key . empty ( ) ) { <nl> + return Status ( <nl> + ErrorCodes : : FailedToParse , <nl> + str : : stream ( ) <nl> + < < " Missing a key for key / value pair in the options for mongodb : / / URL : " <nl> + < < url ) ; <nl> + } <nl> + if ( value . empty ( ) ) { <nl> + return Status ( <nl> + ErrorCodes : : FailedToParse , <nl> + str : : stream ( ) <nl> + < < " Missing a value for key / value pair in the options for mongodb : / / URL : " <nl> + < < url ) ; <nl> + } <nl> + auto keyWithStatus = urlDecode ( key ) ; <nl> + if ( ! keyWithStatus . isOK ( ) ) { <nl> + return Status ( <nl> + ErrorCodes : : FailedToParse , <nl> + str : : stream ( ) <nl> + < < " Key in options cannot properly be URL decoded for mongodb : / / URL : " <nl> + < < url ) ; <nl> + } <nl> + auto valueWithStatus = urlDecode ( value ) ; <nl> + if ( ! valueWithStatus . isOK ( ) ) { <nl> + return Status ( <nl> + ErrorCodes : : FailedToParse , <nl> + str : : stream ( ) <nl> + < < " Value in options cannot properly be URL decoded for mongodb : / / URL : " <nl> + < < url ) ; <nl> + } <nl> + <nl> <nl> - for ( size_t i = 0 ; i ! = optionsTokens . size ( ) ; i = i + 2 ) <nl> - options [ std : : string ( optionsTokens [ i ] . begin ( ) , optionsTokens [ i ] . end ( ) ) ] = <nl> - std : : string ( optionsTokens [ i + 1 ] . begin ( ) , optionsTokens [ i + 1 ] . end ( ) ) ; <nl> + options [ keyWithStatus . getValue ( ) ] = valueWithStatus . getValue ( ) ; <nl> + } <nl> } <nl> <nl> OptionsMap : : const_iterator optIter ; <nl> StatusWith < MongoURI > MongoURI : : parse ( const std : : string & url ) { <nl> setName = optIter - > second ; <nl> } <nl> <nl> - std : : vector < HostAndPort > servers ; <nl> - <nl> - { <nl> - std : : vector < std : : string > servers_split ; <nl> - const std : : string serversStr = matches [ 3 ] . str ( ) ; <nl> - boost : : algorithm : : split ( servers_split , serversStr , boost : : is_any_of ( " , " ) ) ; <nl> - for ( auto & & s : servers_split ) { <nl> - auto statusHostAndPort = HostAndPort : : parse ( s ) ; <nl> - if ( ! statusHostAndPort . isOK ( ) ) { <nl> - return statusHostAndPort . getStatus ( ) ; <nl> - } <nl> - <nl> - servers . push_back ( statusHostAndPort . getValue ( ) ) ; <nl> - } <nl> - } <nl> - <nl> const bool direct = ! haveSetName & & ( servers . size ( ) = = 1 ) ; <nl> <nl> if ( ! direct & & setName . empty ( ) ) { <nl> return Status ( ErrorCodes : : FailedToParse , <nl> " Cannot list multiple servers in URL without ' replicaSet ' option " ) ; <nl> } <nl> - <nl> ConnectionString cs ( <nl> direct ? ConnectionString : : MASTER : ConnectionString : : SET , servers , setName ) ; <nl> - return MongoURI ( <nl> - std : : move ( cs ) , matches [ 1 ] . str ( ) , matches [ 2 ] . str ( ) , matches [ 4 ] . str ( ) , std : : move ( options ) ) ; <nl> + return MongoURI ( std : : move ( cs ) , username , password , database , std : : move ( options ) ) ; <nl> } <nl> <nl> } / / namespace mongo <nl> mmm a / src / mongo / client / mongo_uri_test . cpp <nl> ppp b / src / mongo / client / mongo_uri_test . cpp <nl> <nl> <nl> # include " mongo / platform / basic . h " <nl> <nl> - # include " mongo / client / mongo_uri . h " <nl> + # include < fstream > <nl> <nl> # include " mongo / base / string_data . h " <nl> + # include " mongo / bson / bsonobj . h " <nl> + # include " mongo / bson / bsontypes . h " <nl> + # include " mongo / bson / json . h " <nl> + # include " mongo / client / mongo_uri . h " <nl> # include " mongo / unittest / unittest . h " <nl> <nl> + # include < boost / filesystem / operations . hpp > <nl> + <nl> namespace { <nl> using mongo : : MongoURI ; <nl> <nl> const URITestCase validCases [ ] = { <nl> <nl> { " mongodb : / / user @ 127 . 0 . 0 . 1 " , " user " , " " , kMaster , " " , 1 , 0 , " " } , <nl> <nl> - { " mongodb : / / 127 . 0 . 0 . 1 / dbName ? foo = a & c = b " , " " , " " , kMaster , " " , 1 , 2 , " dbName " } , <nl> - <nl> { " mongodb : / / localhost / ? foo = bar " , " " , " " , kMaster , " " , 1 , 1 , " " } , <nl> <nl> { " mongodb : / / user : pwd @ 127 . 0 . 0 . 1 : 1234 " , " user " , " pwd " , kMaster , " " , 1 , 0 , " " } , <nl> const URITestCase validCases [ ] = { <nl> <nl> { " mongodb : / / 127 . 0 . 0 . 1 : 1234 / dbName ? foo = a & c = b " , " " , " " , kMaster , " " , 1 , 2 , " dbName " } , <nl> <nl> + { " mongodb : / / 127 . 0 . 0 . 1 / dbName ? foo = a & c = b " , " " , " " , kMaster , " " , 1 , 2 , " dbName " } , <nl> + <nl> + { " mongodb : / / user : pwd @ 127 . 0 . 0 . 1 , 127 . 0 . 0 . 2 / dbname ? a = b & replicaSet = replName " , <nl> + " user " , <nl> + " pwd " , <nl> + kSet , <nl> + " replName " , <nl> + 2 , <nl> + 2 , <nl> + " dbname " } , <nl> + <nl> + { " mongodb : / / needs % 20encoding % 25 % 23 ! % 3C % 3E : pwd @ 127 . 0 . 0 . 1 , 127 . 0 . 0 . 2 / " <nl> + " dbname ? a = b & replicaSet = replName " , <nl> + " needs encoding % # ! < > " , <nl> + " pwd " , <nl> + kSet , <nl> + " replName " , <nl> + 2 , <nl> + 2 , <nl> + " dbname " } , <nl> + <nl> + { " mongodb : / / needs % 20encoding % 25 % 23 ! % 3C % 3E : pwd @ 127 . 0 . 0 . 1 , 127 . 0 . 0 . 2 / " <nl> + " db @ name ? a = b & replicaSet = replName " , <nl> + " needs encoding % # ! < > " , <nl> + " pwd " , <nl> + kSet , <nl> + " replName " , <nl> + 2 , <nl> + 2 , <nl> + " db @ name " } , <nl> + <nl> + { " mongodb : / / user : needs % 20encoding % 25 % 23 ! % 3C % 3E @ 127 . 0 . 0 . 1 , 127 . 0 . 0 . 2 / " <nl> + " dbname ? a = b & replicaSet = replName " , <nl> + " user " , <nl> + " needs encoding % # ! < > " , <nl> + kSet , <nl> + " replName " , <nl> + 2 , <nl> + 2 , <nl> + " dbname " } , <nl> + <nl> + { " mongodb : / / user : pwd @ 127 . 0 . 0 . 1 , 127 . 0 . 0 . 2 / dbname ? a = b & replicaSet = needs % 20encoding % 25 % 23 ! % 3C % 3E " , <nl> + " user " , <nl> + " pwd " , <nl> + kSet , <nl> + " needs encoding % # ! < > " , <nl> + 2 , <nl> + 2 , <nl> + " dbname " } , <nl> + <nl> + { " mongodb : / / user : pwd @ 127 . 0 . 0 . 1 , 127 . 0 . 0 . 2 / needsencoding % 40hello ? a = b & replicaSet = replName " , <nl> + " user " , <nl> + " pwd " , <nl> + kSet , <nl> + " replName " , <nl> + 2 , <nl> + 2 , <nl> + " needsencoding @ hello " } , <nl> + <nl> { " mongodb : / / user : pwd @ 127 . 0 . 0 . 1 , 127 . 0 . 0 . 2 / ? replicaSet = replName " , <nl> " user " , <nl> " pwd " , <nl> const URITestCase validCases [ ] = { <nl> 1 , <nl> 2 , <nl> " " } , <nl> - { " mongodb : / / / tmp / mongodb - 27017 . sock " , " " , " " , kMaster , " " , 1 , 0 , " " } , <nl> <nl> - { " mongodb : / / / tmp / mongodb - 27017 . sock , / tmp / mongodb - 27018 . sock / ? replicaSet = replName " , <nl> + { " mongodb : / / % 2Ftmp % 2Fmongodb - 27017 . sock " , " " , " " , kMaster , " " , 1 , 0 , " " } , <nl> + <nl> + { " mongodb : / / % 2Ftmp % 2Fmongodb - 27017 . sock , % 2Ftmp % 2Fmongodb - 27018 . sock / ? replicaSet = replName " , <nl> " " , <nl> " " , <nl> kSet , <nl> " replName " , <nl> 2 , <nl> 1 , <nl> - " " } } ; <nl> + " " } , <nl> + } ; <nl> <nl> const InvalidURITestCase invalidCases [ ] = { <nl> <nl> / / No host . <nl> { " mongodb : / / " } , <nl> + { " mongodb : / / usr : pwd @ / dbname ? a = b " } , <nl> + <nl> + / / Username and password must be encoded ( cannot have ' : ' or ' @ ' ) <nl> + { " mongodb : / / usr : pwd : @ 127 . 0 . 0 . 1 / dbName ? foo = a & c = b " } , <nl> <nl> / / Needs a " / " after the hosts and before the options . <nl> { " mongodb : / / localhost : 27017 , localhost : 27018 ? replicaSet = missingSlash " } , <nl> const InvalidURITestCase invalidCases [ ] = { <nl> / / Domain sockets have to end in " . sock " . <nl> { " mongodb : / / / notareal / domainsock " } , <nl> <nl> + / / Database name cannot contain slash ( " / " ) , backslash ( " \ " ) , space ( " " ) , double - quote ( " " " ) , <nl> + / / or dollar sign ( " $ " ) <nl> + { " mongodb : / / usr : pwd @ localhost : 27017 / db $ name ? a = b " } , <nl> + { " mongodb : / / usr : pwd @ localhost : 27017 / db / name ? a = b " } , <nl> + { " mongodb : / / usr : pwd @ localhost : 27017 / db \ \ name ? a = b " } , <nl> + { " mongodb : / / usr : pwd @ localhost : 27017 / db name ? a = b " } , <nl> + { " mongodb : / / usr : pwd @ localhost : 27017 / db \ " name ? a = b " } , <nl> + <nl> + / / Options must have a key <nl> + { " mongodb : / / usr : pwd @ localhost : 27017 / dbname ? = b " } , <nl> + <nl> + / / Cannot skip a key value pair <nl> + { " mongodb : / / usr : pwd @ localhost : 27017 / dbname ? a = b & & b = c " } , <nl> + <nl> + / / Multiple Unix domain sockets and auth DB resembling a socket ( relative path ) <nl> + { " mongodb : / / rel % 2Fmongodb - 27017 . sock , rel % 2Fmongodb - 27018 . sock / admin . sock ? replicaSet = replName " } , <nl> + <nl> + / / Multiple Unix domain sockets with auth DB resembling a path ( relative path ) <nl> + { " mongodb : / / rel % 2Fmongodb - 27017 . sock , rel % 2Fmongodb - 27018 . sock / admin . shoe ? replicaSet = replName " } , <nl> + <nl> + / / Multiple Unix domain sockets and auth DB resembling a socket ( absolute path ) <nl> + { " mongodb : / / % 2Ftmp % 2Fmongodb - 27017 . sock , % 2Ftmp % 2Fmongodb - 27018 . sock / " <nl> + " admin . sock ? replicaSet = replName " } , <nl> + <nl> + / / Multiple Unix domain sockets with auth DB resembling a path ( absolute path ) <nl> + { " mongodb : / / % 2Ftmp % 2Fmongodb - 27017 . sock , % 2Ftmp % 2Fmongodb - 27018 . sock / " <nl> + " admin . shoe ? replicaSet = replName " } , <nl> + <nl> + / / Missing value in key value pair for options <nl> + { " mongodb : / / 127 . 0 . 0 . 1 : 1234 / dbName ? foo = a & c = b & d " } , <nl> + { " mongodb : / / 127 . 0 . 0 . 1 : 1234 / dbName ? foo = a & c = b & d = " } , <nl> + { " mongodb : / / 127 . 0 . 0 . 1 : 1234 / dbName ? foo = a & h = & c = b & d = 6 " } , <nl> + { " mongodb : / / 127 . 0 . 0 . 1 : 1234 / dbName ? foo = a & h & c = b & d = 6 " } , <nl> + <nl> / / Options can ' t have multiple question marks . Only one . <nl> { " mongodb : / / localhost : 27017 / ? foo = a ? c = b & d = e ? asdf = foo " } , <nl> + <nl> + / / Missing a key in key value pair for options <nl> + { " mongodb : / / 127 . 0 . 0 . 1 : 1234 / dbName ? foo = a & = d & c = b " } , <nl> + <nl> + / / Missing an entire key - value pair <nl> + { " mongodb : / / 127 . 0 . 0 . 1 : 1234 / dbName ? foo = a & & c = b " } , <nl> } ; <nl> <nl> + / / Helper Method to take a filename for a json file and return the array of tests inside of it <nl> + mongo : : BSONObj getBsonFromJsonFile ( std : : string fileName ) { <nl> + boost : : filesystem : : path directoryPath = boost : : filesystem : : current_path ( ) ; <nl> + boost : : filesystem : : path filePath ( directoryPath / " src " / " mongo " / " client " / <nl> + " mongo_uri_tests " / fileName ) ; <nl> + std : : string filename ( filePath . string ( ) ) ; <nl> + std : : ifstream infile ( filename . c_str ( ) ) ; <nl> + std : : string data ( ( std : : istreambuf_iterator < char > ( infile ) ) , std : : istreambuf_iterator < char > ( ) ) ; <nl> + mongo : : BSONObj obj = mongo : : fromjson ( data ) ; <nl> + ASSERT ( obj . valid ( mongo : : BSONVersion : : kLatest ) ) ; <nl> + ASSERT ( obj . hasField ( " tests " ) ) ; <nl> + mongo : : BSONObj arr = obj . getField ( " tests " ) . embeddedObject ( ) . getOwned ( ) ; <nl> + ASSERT ( arr . couldBeArray ( ) ) ; <nl> + return arr ; <nl> + } <nl> + <nl> + / / Helper method to take a BSONElement and either extract its string or return an empty string <nl> + std : : string returnStringFromElementOrNull ( mongo : : BSONElement element ) { <nl> + ASSERT ( ! element . eoo ( ) ) ; <nl> + if ( element . type ( ) = = mongo : : jstNULL ) { <nl> + return std : : string ( ) ; <nl> + } <nl> + ASSERT ( element . type ( ) = = mongo : : String ) ; <nl> + return element . String ( ) ; <nl> + } <nl> + <nl> + / / Helper method to take a valid test case , parse ( ) it , and assure the output is correct <nl> + void testValidURIFormat ( URITestCase testCase ) { <nl> + mongo : : unittest : : log ( ) < < " Testing URI : " < < testCase . URI < < ' \ n ' ; <nl> + std : : string errMsg ; <nl> + auto cs_status = MongoURI : : parse ( testCase . URI ) ; <nl> + if ( ! cs_status . getStatus ( ) . toString ( ) . empty ( ) ) { <nl> + if ( ! cs_status . getStatus ( ) . isOK ( ) ) <nl> + mongo : : unittest : : log ( ) < < " ERROR : error with uri : " < < cs_status . getStatus ( ) . toString ( ) ; <nl> + } <nl> + ASSERT_TRUE ( cs_status . isOK ( ) ) ; <nl> + auto result = cs_status . getValue ( ) ; <nl> + ASSERT_EQ ( testCase . uname , result . getUser ( ) ) ; <nl> + ASSERT_EQ ( testCase . password , result . getPassword ( ) ) ; <nl> + ASSERT_EQ ( testCase . type , result . type ( ) ) ; <nl> + ASSERT_EQ ( testCase . setname , result . getSetName ( ) ) ; <nl> + ASSERT_EQ ( testCase . numservers , result . getServers ( ) . size ( ) ) ; <nl> + ASSERT_EQ ( testCase . numOptions , result . getOptions ( ) . size ( ) ) ; <nl> + ASSERT_EQ ( testCase . database , result . getDatabase ( ) ) ; <nl> + } <nl> + <nl> + / / Helper method to parse a BSON array / object and extract the individual tests <nl> + / / Method creates a URITestCase from every element in the array and then verifies that parse ( ) has <nl> + / / the proper output <nl> + void runTests ( mongo : : BSONObj tests ) { <nl> + mongo : : BSONObjIterator testsIter ( tests ) ; <nl> + while ( testsIter . more ( ) ) { <nl> + mongo : : BSONElement testElement = testsIter . next ( ) ; <nl> + if ( testElement . eoo ( ) ) <nl> + break ; <nl> + mongo : : BSONObj test = testElement . embeddedObject ( ) ; <nl> + <nl> + / / First extract the valid field and the uri field <nl> + mongo : : BSONElement validDoc = test . getField ( " valid " ) ; <nl> + ASSERT ( ! validDoc . eoo ( ) ) ; <nl> + ASSERT ( validDoc . isBoolean ( ) ) ; <nl> + bool valid = validDoc . Bool ( ) ; <nl> + <nl> + mongo : : BSONElement uriDoc = test . getField ( " uri " ) ; <nl> + ASSERT ( ! uriDoc . eoo ( ) ) ; <nl> + ASSERT ( uriDoc . type ( ) = = mongo : : String ) ; <nl> + std : : string uri = uriDoc . String ( ) ; <nl> + <nl> + if ( ! valid ) { <nl> + / / This uri string is invalid - - > parse the uri and ensure it fails <nl> + const InvalidURITestCase testCase = { uri } ; <nl> + mongo : : unittest : : log ( ) < < " Testing URI : " < < testCase . URI < < ' \ n ' ; <nl> + auto cs_status = MongoURI : : parse ( testCase . URI ) ; <nl> + ASSERT_FALSE ( cs_status . isOK ( ) ) ; <nl> + } else { <nl> + / / This uri is valid - - > parse the remaining necessary fields <nl> + <nl> + / / parse the auth options <nl> + std : : string database = std : : string ( ) ; <nl> + std : : string username = std : : string ( ) ; <nl> + std : : string password = std : : string ( ) ; <nl> + <nl> + mongo : : BSONElement auth = test . getField ( " auth " ) ; <nl> + ASSERT ( ! auth . eoo ( ) ) ; <nl> + if ( auth . type ( ) ! = mongo : : jstNULL ) { <nl> + ASSERT ( auth . type ( ) = = mongo : : Object ) ; <nl> + mongo : : BSONObj authObj = auth . embeddedObject ( ) ; <nl> + <nl> + mongo : : BSONElement dbObj = authObj . getField ( " db " ) ; <nl> + database = returnStringFromElementOrNull ( dbObj ) ; <nl> + <nl> + mongo : : BSONElement usernameObj = authObj . getField ( " username " ) ; <nl> + username = returnStringFromElementOrNull ( usernameObj ) ; <nl> + <nl> + mongo : : BSONElement passwordObj = authObj . getField ( " password " ) ; <nl> + password = returnStringFromElementOrNull ( passwordObj ) ; <nl> + } <nl> + <nl> + / / parse the hosts <nl> + size_t numHosts = 0 ; <nl> + mongo : : BSONElement hosts = test . getField ( " hosts " ) ; <nl> + ASSERT ( ! hosts . eoo ( ) ) ; <nl> + ASSERT ( hosts . type ( ) = = mongo : : Array ) ; <nl> + mongo : : BSONObjIterator hostsIter ( hosts . embeddedObject ( ) ) ; <nl> + while ( hostsIter . more ( ) ) { <nl> + mongo : : BSONElement cHost = hostsIter . next ( ) ; <nl> + if ( cHost . eoo ( ) ) <nl> + break ; <nl> + numHosts + + ; <nl> + } <nl> + <nl> + / / parse the options <nl> + mongo : : ConnectionString : : ConnectionType connectionType = kMaster ; <nl> + size_t numOptions = 0 ; <nl> + std : : string setName = std : : string ( ) ; <nl> + mongo : : BSONElement optionsElement = test . getField ( " options " ) ; <nl> + ASSERT ( ! optionsElement . eoo ( ) ) ; <nl> + if ( optionsElement . type ( ) ! = mongo : : jstNULL ) { <nl> + ASSERT ( optionsElement . type ( ) = = mongo : : Object ) ; <nl> + mongo : : BSONObj optionsObj = optionsElement . embeddedObject ( ) ; <nl> + numOptions = optionsObj . nFields ( ) ; <nl> + mongo : : BSONElement replsetElement = optionsObj . getField ( " replicaSet " ) ; <nl> + if ( ! replsetElement . eoo ( ) ) { <nl> + ASSERT ( replsetElement . type ( ) = = mongo : : String ) ; <nl> + setName = replsetElement . String ( ) ; <nl> + connectionType = kSet ; <nl> + } <nl> + } <nl> + <nl> + / / Create the URITestCase abnd <nl> + const URITestCase testCase = { <nl> + uri , username , password , connectionType , setName , numHosts , numOptions , database } ; <nl> + testValidURIFormat ( testCase ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> TEST ( MongoURI , GoodTrickyURIs ) { <nl> const size_t numCases = sizeof ( validCases ) / sizeof ( validCases [ 0 ] ) ; <nl> <nl> for ( size_t i = 0 ; i ! = numCases ; + + i ) { <nl> const URITestCase testCase = validCases [ i ] ; <nl> - mongo : : unittest : : log ( ) < < " Testing URI : " < < testCase . URI < < ' \ n ' ; <nl> - std : : string errMsg ; <nl> - auto cs_status = MongoURI : : parse ( testCase . URI ) ; <nl> - if ( ! cs_status . getStatus ( ) . toString ( ) . empty ( ) ) { <nl> - mongo : : unittest : : log ( ) < < " error with uri : " < < cs_status . getStatus ( ) . toString ( ) ; <nl> - } <nl> - ASSERT_TRUE ( cs_status . isOK ( ) ) ; <nl> - auto result = cs_status . getValue ( ) ; <nl> - ASSERT_EQ ( testCase . uname , result . getUser ( ) ) ; <nl> - ASSERT_EQ ( testCase . password , result . getPassword ( ) ) ; <nl> - ASSERT_EQ ( testCase . type , result . type ( ) ) ; <nl> - ASSERT_EQ ( testCase . setname , result . getSetName ( ) ) ; <nl> - ASSERT_EQ ( testCase . numservers , result . getServers ( ) . size ( ) ) ; <nl> - ASSERT_EQ ( testCase . numOptions , result . getOptions ( ) . size ( ) ) ; <nl> - ASSERT_EQ ( testCase . database , result . getDatabase ( ) ) ; <nl> + testValidURIFormat ( testCase ) ; <nl> } <nl> } <nl> <nl> TEST ( MongoURI , CloneURIForServer ) { <nl> ASSERT_EQ ( clonedURIOptions . at ( " ssl " ) , " true " ) ; <nl> } <nl> <nl> + / * These tests come from the Mongo Uri Specifications for the drivers found at : <nl> + https : / / github . com / mongodb / specifications / tree / master / source / connection - string / tests <nl> + They have been slighly altered as the Drivers specification is slighly different from the server <nl> + specification <nl> + * / <nl> + TEST ( MongoURI , ValidAuth ) { <nl> + std : : string fileName = " mongo - uri - valid - auth . json " ; <nl> + mongo : : BSONObj tests = getBsonFromJsonFile ( fileName ) ; <nl> + runTests ( tests ) ; <nl> + } <nl> + <nl> + TEST ( MongoURI , Options ) { <nl> + std : : string fileName = " mongo - uri - options . json " ; <nl> + mongo : : BSONObj tests = getBsonFromJsonFile ( fileName ) ; <nl> + runTests ( tests ) ; <nl> + } <nl> + <nl> + TEST ( MongoURI , UnixSocketsAbsolute ) { <nl> + std : : string fileName = " mongo - uri - unix - sockets - absolute . json " ; <nl> + mongo : : BSONObj tests = getBsonFromJsonFile ( fileName ) ; <nl> + runTests ( tests ) ; <nl> + } <nl> + <nl> + TEST ( MongoURI , UnixSocketsRelative ) { <nl> + std : : string fileName = " mongo - uri - unix - sockets - relative . json " ; <nl> + mongo : : BSONObj tests = getBsonFromJsonFile ( fileName ) ; <nl> + runTests ( tests ) ; <nl> + } <nl> + <nl> + TEST ( MongoURI , Warnings ) { <nl> + std : : string fileName = " mongo - uri - warnings . json " ; <nl> + mongo : : BSONObj tests = getBsonFromJsonFile ( fileName ) ; <nl> + runTests ( tests ) ; <nl> + } <nl> + <nl> + TEST ( MongoURI , HostIdentifiers ) { <nl> + std : : string fileName = " mongo - uri - host - identifiers . json " ; <nl> + mongo : : BSONObj tests = getBsonFromJsonFile ( fileName ) ; <nl> + runTests ( tests ) ; <nl> + } <nl> + <nl> + TEST ( MongoURI , Invalid ) { <nl> + std : : string fileName = " mongo - uri - invalid . json " ; <nl> + mongo : : BSONObj tests = getBsonFromJsonFile ( fileName ) ; <nl> + runTests ( tests ) ; <nl> + } <nl> + <nl> } / / namespace <nl> new file mode 100644 <nl> index 000000000000 . . 8a1fda580a80 <nl> mmm / dev / null <nl> ppp b / src / mongo / client / mongo_uri_tests / mongo - uri - host - identifiers . json <nl> <nl> + { <nl> + " tests " : [ <nl> + { <nl> + " description " : " Single IPv4 host without port " , <nl> + " uri " : " mongodb : / / 127 . 0 . 0 . 1 " , <nl> + " valid " : true , <nl> + " warning " : false , <nl> + " hosts " : [ <nl> + { <nl> + " type " : " ipv4 " , <nl> + " host " : " 127 . 0 . 0 . 1 " , <nl> + " port " : null <nl> + } <nl> + ] , <nl> + " auth " : null , <nl> + " options " : null <nl> + } , <nl> + { <nl> + " description " : " Single IPv4 host with port " , <nl> + " uri " : " mongodb : / / 127 . 0 . 0 . 1 : 27018 " , <nl> + " valid " : true , <nl> + " warning " : false , <nl> + " hosts " : [ <nl> + { <nl> + " type " : " ipv4 " , <nl> + " host " : " 127 . 0 . 0 . 1 " , <nl> + " port " : 27018 <nl> + } <nl> + ] , <nl> + " auth " : null , <nl> + " options " : null <nl> + } , <nl> + { <nl> + " description " : " Single IP literal host without port " , <nl> + " uri " : " mongodb : / / [ : : 1 ] " , <nl> + " valid " : true , <nl> + " warning " : false , <nl> + " hosts " : [ <nl> + { <nl> + " type " : " ip_literal " , <nl> + " host " : " : : 1 " , <nl> + " port " : null <nl> + } <nl> + ] , <nl> + " auth " : null , <nl> + " options " : null <nl> + } , <nl> + { <nl> + " description " : " Single IP literal host with port " , <nl> + " uri " : " mongodb : / / [ : : 1 ] : 27019 " , <nl> + " valid " : true , <nl> + " warning " : false , <nl> + " hosts " : [ <nl> + { <nl> + " type " : " ip_literal " , <nl> + " host " : " : : 1 " , <nl> + " port " : 27019 <nl> + } <nl> + ] , <nl> + " auth " : null , <nl> + " options " : null <nl> + } , <nl> + { <nl> + " description " : " Single hostname without port " , <nl> + " uri " : " mongodb : / / example . com " , <nl> + " valid " : true , <nl> + " warning " : false , <nl> + " hosts " : [ <nl> + { <nl> + " type " : " hostname " , <nl> + " host " : " example . com " , <nl> + " port " : null <nl> + } <nl> + ] , <nl> + " auth " : null , <nl> + " options " : null <nl> + } , <nl> + { <nl> + " description " : " Single hostname with port " , <nl> + " uri " : " mongodb : / / example . com : 27020 " , <nl> + " valid " : true , <nl> + " warning " : false , <nl> + " hosts " : [ <nl> + { <nl> + " type " : " hostname " , <nl> + " host " : " example . com " , <nl> + " port " : 27020 <nl> + } <nl> + ] , <nl> + " auth " : null , <nl> + " options " : null <nl> + } , <nl> + { <nl> + " description " : " Single hostname ( resembling IPv4 ) without port " , <nl> + " uri " : " mongodb : / / 256 . 0 . 0 . 1 " , <nl> + " valid " : true , <nl> + " warning " : false , <nl> + " hosts " : [ <nl> + { <nl> + " type " : " hostname " , <nl> + " host " : " 256 . 0 . 0 . 1 " , <nl> + " port " : null <nl> + } <nl> + ] , <nl> + " auth " : null , <nl> + " options " : null <nl> + } , <nl> + { <nl> + " description " : " Multiple hosts ( mixed formats ) " , <nl> + " uri " : " mongodb : / / 127 . 0 . 0 . 1 , [ : : 1 ] : 27018 , example . com : 27019 " , <nl> + " valid " : false , <nl> + " warning " : false , <nl> + " hosts " : [ <nl> + { <nl> + " type " : " ipv4 " , <nl> + " host " : " 127 . 0 . 0 . 1 " , <nl> + " port " : null <nl> + } , <nl> + { <nl> + " type " : " ip_literal " , <nl> + " host " : " : : 1 " , <nl> + " port " : 27018 <nl> + } , <nl> + { <nl> + " type " : " hostname " , <nl> + " host " : " example . com " , <nl> + " port " : 27019 <nl> + } <nl> + ] , <nl> + " auth " : null , <nl> + " options " : null <nl> + } , <nl> + { <nl> + " description " : " Multiple hosts ( mixed formats ) " , <nl> + " uri " : " mongodb : / / 127 . 0 . 0 . 1 , [ : : 1 ] : 27018 , example . com : 27019 / ? replicaSet = replset " , <nl> + " valid " : true , <nl> + " warning " : false , <nl> + " hosts " : [ <nl> + { <nl> + " type " : " ipv4 " , <nl> + " host " : " 127 . 0 . 0 . 1 " , <nl> + " port " : null <nl> + } , <nl> + { <nl> + " type " : " ip_literal " , <nl> + " host " : " : : 1 " , <nl> + " port " : 27018 <nl> + } , <nl> + { <nl> + " type " : " hostname " , <nl> + " host " : " example . com " , <nl> + " port " : 27019 <nl> + } <nl> + ] , <nl> + " auth " : null , <nl> + " options " : { <nl> + " replicaSet " : " replset " <nl> + } <nl> + } , <nl> + { <nl> + " description " : " UTF - 8 hosts " , <nl> + " uri " : " mongodb : / / bücher . example . com , umläut . example . com / " , <nl> + " valid " : false , <nl> + " warning " : false , <nl> + " hosts " : [ <nl> + { <nl> + " type " : " hostname " , <nl> + " host " : " bücher . example . com " , <nl> + " port " : null <nl> + } , <nl> + { <nl> + " type " : " hostname " , <nl> + " host " : " umläut . example . com " , <nl> + " port " : null <nl> + } <nl> + ] , <nl> + " auth " : null , <nl> + " options " : null <nl> + } , <nl> + { <nl> + " description " : " UTF - 8 hosts " , <nl> + " uri " : " mongodb : / / bücher . example . com , umläut . example . com / ? replicaSet = replset " , <nl> + " valid " : true , <nl> + " warning " : false , <nl> + " hosts " : [ <nl> + { <nl> + " type " : " hostname " , <nl> + " host " : " bücher . example . com " , <nl> + " port " : null <nl> + } , <nl> + { <nl> + " type " : " hostname " , <nl> + " host " : " umläut . example . com " , <nl> + " port " : null <nl> + } <nl> + ] , <nl> + " auth " : null , <nl> + " options " : { <nl> + " replicaSet " : " replset " <nl> + } <nl> + } <nl> + ] <nl> + } <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 000000000000 . . 3ee82bd535e5 <nl> mmm / dev / null <nl> ppp b / src / mongo / client / mongo_uri_tests / mongo - uri - invalid . json <nl> <nl> + { <nl> + " tests " : [ <nl> + { <nl> + " auth " : null , <nl> + " description " : " Empty string " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Missing host " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Double colon in host identifier " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / localhost : : 27017 " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Double colon in host identifier and trailing slash " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / localhost : : 27017 / " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Double colon in host identifier with missing host and port " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / : : " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Double colon in host identifier with missing port " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / localhost , localhost : : " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Double colon in host identifier and second host " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / localhost : : 27017 , abc " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Invalid port ( negative number ) with hostname " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / localhost : - 1 " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Invalid port ( zero ) with hostname " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / localhost : 0 / " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Invalid port ( positive number ) with hostname " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / localhost : 65536 " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Invalid port ( positive number ) with hostname and trailing slash " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / localhost : 65536 / " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Invalid port ( non - numeric string ) with hostname " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / localhost : foo " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Invalid port ( negative number ) with IP literal " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / [ : : 1 ] : - 1 " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Invalid port ( zero ) with IP literal " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / [ : : 1 ] : 0 / " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Invalid port ( positive number ) with IP literal " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / [ : : 1 ] : 65536 " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Invalid port ( positive number ) with IP literal and trailing slash " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / [ : : 1 ] : 65536 / " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Invalid port ( non - numeric string ) with IP literal " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / [ : : 1 ] : foo " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Missing delimiting slash between hosts and options " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / example . com ? w = 1 " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Incomplete key value pair for option " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / example . com / ? w " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Username with password containing an unescaped colon " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / alice : foo : bar @ 127 . 0 . 0 . 1 " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Username with password containing an unescaped colon " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / alice : foo : bar @ 127 . 0 . 0 . 1 " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Username containing an unescaped at - sign " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / alice @ @ 127 . 0 . 0 . 1 " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Username with password containing an unescaped at - sign " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / alice @ foo : bar @ 127 . 0 . 0 . 1 " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Username containing an unescaped slash " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / alice / @ localhost / db " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Username containing unescaped slash with password " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / alice / bob : foo @ localhost / db " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Username with password containing an unescaped slash " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / alice : foo / bar @ localhost / db " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Host with unescaped slash " , <nl> + " hosts " : null , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / / tmp / mongodb - 27017 . sock / " , <nl> + " valid " : false , <nl> + " warning " : null <nl> + } <nl> + ] <nl> + } <nl> new file mode 100644 <nl> index 000000000000 . . 4c2bded9e72d <nl> mmm / dev / null <nl> ppp b / src / mongo / client / mongo_uri_tests / mongo - uri - options . json <nl> <nl> + { <nl> + " tests " : [ <nl> + { <nl> + " description " : " Option names are normalized to lowercase " , <nl> + " uri " : " mongodb : / / alice : secret @ example . com / admin ? AUTHMechanism = MONGODB - CR " , <nl> + " valid " : true , <nl> + " warning " : false , <nl> + " hosts " : [ <nl> + { <nl> + " type " : " hostname " , <nl> + " host " : " example . com " , <nl> + " port " : null <nl> + } <nl> + ] , <nl> + " auth " : { <nl> + " username " : " alice " , <nl> + " password " : " secret " , <nl> + " db " : " admin " <nl> + } , <nl> + " options " : { <nl> + " authmechanism " : " MONGODB - CR " <nl> + } <nl> + } <nl> + ] <nl> + } <nl> new file mode 100644 <nl> index 000000000000 . . d167c315bbc6 <nl> mmm / dev / null <nl> ppp b / src / mongo / client / mongo_uri_tests / mongo - uri - unix - sockets - absolute . json <nl> <nl> + { <nl> + " tests " : [ <nl> + { <nl> + " auth " : null , <nl> + " description " : " Unix domain socket ( absolute path with trailing slash ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " / tmp / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / % 2Ftmp % 2Fmongodb - 27017 . sock / " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Unix domain socket ( absolute path without trailing slash ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " / tmp / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / % 2Ftmp % 2Fmongodb - 27017 . sock " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Unix domain socket ( absolute path with spaces in path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " / tmp / / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / % 2Ftmp % 2F % 2Fmongodb - 27017 . sock " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Multiple Unix domain sockets ( absolute paths ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " / tmp / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " / tmp / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / % 2Ftmp % 2Fmongodb - 27017 . sock , % 2Ftmp % 2Fmongodb - 27018 . sock " , <nl> + " valid " : false , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Multiple hosts ( absolute path and ipv4 ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " 127 . 0 . 0 . 1 " , <nl> + " port " : 27017 , <nl> + " type " : " ipv4 " <nl> + } , <nl> + { <nl> + " host " : " / tmp / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / 127 . 0 . 0 . 1 : 27017 , % 2Ftmp % 2Fmongodb - 27017 . sock " , <nl> + " valid " : false , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Multiple hosts ( absolute path and hostname resembling relative path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " hostname " <nl> + } , <nl> + { <nl> + " host " : " / tmp / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / mongodb - 27017 . sock , % 2Ftmp % 2Fmongodb - 27018 . sock " , <nl> + " valid " : false , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Multiple Unix domain sockets ( absolute paths ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " / tmp / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " / tmp / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " replicaSet " : " replset " <nl> + } , <nl> + " uri " : " mongodb : / / % 2Ftmp % 2Fmongodb - 27017 . sock , % 2Ftmp % 2Fmongodb - 27018 . sock / ? replicaSet = replset " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Multiple hosts ( absolute path and ipv4 ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " 127 . 0 . 0 . 1 " , <nl> + " port " : 27017 , <nl> + " type " : " ipv4 " <nl> + } , <nl> + { <nl> + " host " : " / tmp / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " replicaSet " : " replset " <nl> + } , <nl> + " uri " : " mongodb : / / 127 . 0 . 0 . 1 : 27017 , % 2Ftmp % 2Fmongodb - 27017 . sock / ? replicaSet = replset " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Multiple hosts ( absolute path and hostname resembling relative path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " hostname " <nl> + } , <nl> + { <nl> + " host " : " / tmp / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " replicaSet " : " replset " <nl> + } , <nl> + " uri " : " mongodb : / / mongodb - 27017 . sock , % 2Ftmp % 2Fmongodb - 27018 . sock / ? replicaSet = replset " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : " foo " , <nl> + " username " : " alice " <nl> + } , <nl> + " description " : " Unix domain socket with auth database ( absolute path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " / tmp / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / alice : foo @ % 2Ftmp % 2Fmongodb - 27017 . sock / admin " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Unix domain socket with path resembling socket file ( absolute path with trailing slash ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " / tmp / path . to . sock / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / % 2Ftmp % 2Fpath . to . sock % 2Fmongodb - 27017 . sock / " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Unix domain socket with path resembling socket file ( absolute path without trailing slash ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " / tmp / path . to . sock / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / % 2Ftmp % 2Fpath . to . sock % 2Fmongodb - 27017 . sock " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : " bar " , <nl> + " username " : " bob " <nl> + } , <nl> + " description " : " Unix domain socket with path resembling socket file and auth ( absolute path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " / tmp / path . to . sock / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / bob : bar @ % 2Ftmp % 2Fpath . to . sock % 2Fmongodb - 27017 . sock / admin " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : null , <nl> + " username " : null <nl> + } , <nl> + " description " : " Multiple Unix domain sockets and auth DB ( absolute path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " / tmp / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " / tmp / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / % 2Ftmp % 2Fmongodb - 27017 . sock , % 2Ftmp % 2Fmongodb - 27018 . sock / admin " , <nl> + " valid " : false , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : null , <nl> + " username " : null <nl> + } , <nl> + " description " : " Multiple Unix domain sockets and auth DB ( absolute path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " / tmp / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " / tmp / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " replicaSet " : " replset " <nl> + } , <nl> + " uri " : " mongodb : / / % 2Ftmp % 2Fmongodb - 27017 . sock , % 2Ftmp % 2Fmongodb - 27018 . sock / admin ? replicaSet = replset " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : " bar " , <nl> + " username " : " bob " <nl> + } , <nl> + " description " : " Multiple Unix domain sockets with auth and query string ( absolute path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " / tmp / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " / tmp / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " w " : 1 <nl> + } , <nl> + " uri " : " mongodb : / / bob : bar @ % 2Ftmp % 2Fmongodb - 27017 . sock , % 2Ftmp % 2Fmongodb - 27018 . sock / admin ? w = 1 " , <nl> + " valid " : false , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : " bar " , <nl> + " username " : " bob " <nl> + } , <nl> + " description " : " Multiple Unix domain sockets with auth and query string ( absolute path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " / tmp / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " / tmp / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " w " : 1 , <nl> + " replicaSet " : " replset " <nl> + } , <nl> + " uri " : " mongodb : / / bob : bar @ % 2Ftmp % 2Fmongodb - 27017 . sock , % 2Ftmp % 2Fmongodb - 27018 . sock / admin ? w = 1 & replicaSet = replset " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : " bar " , <nl> + " username " : " bob " <nl> + } , <nl> + " description " : " Multiple Unix domain sockets with auth and query string ( absolute path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " / tmp / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " / tmp / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " w " : 1 , <nl> + " replicaSet " : " replset " <nl> + } , <nl> + " uri " : " mongodb : / / bob : bar @ % 2Ftmp % 2Fmongodb - 27017 . sock , % 2Ftmp % 2Fmongodb - 27018 . sock / admin ? replicaSet = replset & w = 1 " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } <nl> + ] <nl> + } <nl> new file mode 100644 <nl> index 000000000000 . . 8da45c4e1b9c <nl> mmm / dev / null <nl> ppp b / src / mongo / client / mongo_uri_tests / mongo - uri - unix - sockets - relative . json <nl> <nl> + { <nl> + " tests " : [ <nl> + { <nl> + " auth " : null , <nl> + " description " : " Unix domain socket ( relative path with trailing slash ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / rel % 2Fmongodb - 27017 . sock / " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Unix domain socket ( relative path without trailing slash ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / rel % 2Fmongodb - 27017 . sock " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Unix domain socket ( relative path with spaces ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / rel % 2F % 2Fmongodb - 27017 . sock " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Multiple Unix domain sockets ( relative paths ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " rel / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / rel % 2Fmongodb - 27017 . sock , rel % 2Fmongodb - 27018 . sock " , <nl> + " valid " : false , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Multiple Unix domain sockets ( relative paths ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " rel / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " replicaSet " : " replset " <nl> + } , <nl> + " uri " : " mongodb : / / rel % 2Fmongodb - 27017 . sock , rel % 2Fmongodb - 27018 . sock / ? replicaSet = replset " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Multiple Unix domain sockets ( relative and absolute paths ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " / tmp / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / rel % 2Fmongodb - 27017 . sock , % 2Ftmp % 2Fmongodb - 27018 . sock " , <nl> + " valid " : false , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Multiple Unix domain sockets ( relative and absolute paths ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " / tmp / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " replicaSet " : " replset " <nl> + } , <nl> + " uri " : " mongodb : / / rel % 2Fmongodb - 27017 . sock , % 2Ftmp % 2Fmongodb - 27018 . sock / ? replicaSet = replset " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Multiple hosts ( relative path and ipv4 ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " 127 . 0 . 0 . 1 " , <nl> + " port " : 27017 , <nl> + " type " : " ipv4 " <nl> + } , <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / 127 . 0 . 0 . 1 : 27017 , rel % 2Fmongodb - 27017 . sock " , <nl> + " valid " : false , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Multiple hosts ( relative path and ipv4 ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " 127 . 0 . 0 . 1 " , <nl> + " port " : 27017 , <nl> + " type " : " ipv4 " <nl> + } , <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " replicaSet " : " replset " <nl> + } , <nl> + " uri " : " mongodb : / / 127 . 0 . 0 . 1 : 27017 , rel % 2Fmongodb - 27017 . sock / ? replicaSet = replset " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Multiple hosts ( relative path and hostname resembling relative path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " hostname " <nl> + } , <nl> + { <nl> + " host " : " rel / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / mongodb - 27017 . sock , rel % 2Fmongodb - 27018 . sock " , <nl> + " valid " : false , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Multiple hosts ( relative path and hostname resembling relative path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " hostname " <nl> + } , <nl> + { <nl> + " host " : " rel / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " replicaSet " : " replset " <nl> + } , <nl> + " uri " : " mongodb : / / mongodb - 27017 . sock , rel % 2Fmongodb - 27018 . sock / ? replicaSet = replset " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : " foo " , <nl> + " username " : " alice " <nl> + } , <nl> + " description " : " Unix domain socket with auth database ( relative path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / alice : foo @ rel % 2Fmongodb - 27017 . sock / admin " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Unix domain socket with path resembling socket file ( relative path with trailing slash ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / path . to . sock / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / rel % 2Fpath . to . sock % 2Fmongodb - 27017 . sock / " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : null , <nl> + " description " : " Unix domain socket with path resembling socket file ( relative path without trailing slash ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / path . to . sock / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / rel % 2Fpath . to . sock % 2Fmongodb - 27017 . sock " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : " bar " , <nl> + " username " : " bob " <nl> + } , <nl> + " description " : " Unix domain socket with path resembling socket file and auth ( relative path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / path . to . sock / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / bob : bar @ rel % 2Fpath . to . sock % 2Fmongodb - 27017 . sock / admin " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : null , <nl> + " username " : null <nl> + } , <nl> + " description " : " Multiple Unix domain sockets and auth DB resembling a socket ( relative path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " rel / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / rel % 2Fmongodb - 27017 . sock , rel % 2Fmongodb - 27018 . sock / admin " , <nl> + " valid " : false , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : null , <nl> + " username " : null <nl> + } , <nl> + " description " : " Multiple Unix domain sockets and auth DB resembling a socket ( relative path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " rel / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " replicaSet " : " replset " <nl> + } , <nl> + " uri " : " mongodb : / / rel % 2Fmongodb - 27017 . sock , rel % 2Fmongodb - 27018 . sock / admin ? replicaSet = replset " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : null , <nl> + " username " : null <nl> + } , <nl> + " description " : " Multiple Unix domain sockets with auth DB resembling a path ( relative path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " rel / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / rel % 2Fmongodb - 27017 . sock , rel % 2Fmongodb - 27018 . sock / admin " , <nl> + " valid " : false , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : null , <nl> + " username " : null <nl> + } , <nl> + " description " : " Multiple Unix domain sockets with auth DB resembling a path ( relative path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " rel / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " replicaSet " : " replset " <nl> + } , <nl> + " uri " : " mongodb : / / rel % 2Fmongodb - 27017 . sock , rel % 2Fmongodb - 27018 . sock / admin ? replicaSet = replset " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : " bar " , <nl> + " username " : " bob " <nl> + } , <nl> + " description " : " Multiple Unix domain sockets with auth and query string ( relative path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " rel / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " w " : 1 <nl> + } , <nl> + " uri " : " mongodb : / / bob : bar @ rel % 2Fmongodb - 27017 . sock , rel % 2Fmongodb - 27018 . sock / admin ? w = 1 " , <nl> + " valid " : false , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : " bar " , <nl> + " username " : " bob " <nl> + } , <nl> + " description " : " Multiple Unix domain sockets with auth and query string ( relative path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " rel / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " w " : 1 , <nl> + " replicaSet " : " replset " <nl> + } , <nl> + " uri " : " mongodb : / / bob : bar @ rel % 2Fmongodb - 27017 . sock , rel % 2Fmongodb - 27018 . sock / admin ? w = 1 & replicaSet = replset " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : " bar " , <nl> + " username " : " bob " <nl> + } , <nl> + " description " : " Multiple Unix domain sockets with auth and query string ( relative path ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " rel / mongodb - 27017 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } , <nl> + { <nl> + " host " : " rel / mongodb - 27018 . sock " , <nl> + " port " : null , <nl> + " type " : " unix " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " w " : 1 , <nl> + " replicaSet " : " replset " , <nl> + " b " : 4 <nl> + } , <nl> + " uri " : " mongodb : / / bob : bar @ rel % 2Fmongodb - 27017 . sock , rel % 2Fmongodb - 27018 . sock / admin ? w = 1 & replicaSet = replset & b = 4 " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } <nl> + ] <nl> + } <nl> new file mode 100644 <nl> index 000000000000 . . a44236e7b629 <nl> mmm / dev / null <nl> ppp b / src / mongo / client / mongo_uri_tests / mongo - uri - valid - auth . json <nl> <nl> + { <nl> + " tests " : [ <nl> + { <nl> + " auth " : { <nl> + " db " : null , <nl> + " password " : " foo " , <nl> + " username " : " alice " <nl> + } , <nl> + " description " : " User info for single IPv4 host without database " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " 127 . 0 . 0 . 1 " , <nl> + " port " : null , <nl> + " type " : " ipv4 " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / alice : foo @ 127 . 0 . 0 . 1 " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " test " , <nl> + " password " : " foo " , <nl> + " username " : " alice " <nl> + } , <nl> + " description " : " User info for single IPv4 host with database " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " 127 . 0 . 0 . 1 " , <nl> + " port " : null , <nl> + " type " : " ipv4 " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / alice : foo @ 127 . 0 . 0 . 1 / test " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : null , <nl> + " password " : " bar " , <nl> + " username " : " bob " <nl> + } , <nl> + " description " : " User info for single IP literal host without database " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " : : 1 " , <nl> + " port " : 27018 , <nl> + " type " : " ip_literal " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / bob : bar @ [ : : 1 ] : 27018 " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : " bar " , <nl> + " username " : " bob " <nl> + } , <nl> + " description " : " User info for single IP literal host with database " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " : : 1 " , <nl> + " port " : 27018 , <nl> + " type " : " ip_literal " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / bob : bar @ [ : : 1 ] : 27018 / admin " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : null , <nl> + " password " : " baz " , <nl> + " username " : " eve " <nl> + } , <nl> + " description " : " User info for single hostname without database " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " example . com " , <nl> + " port " : null , <nl> + " type " : " hostname " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / eve : baz @ example . com " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " db2 " , <nl> + " password " : " baz " , <nl> + " username " : " eve " <nl> + } , <nl> + " description " : " User info for single hostname with database " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " example . com " , <nl> + " port " : null , <nl> + " type " : " hostname " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / eve : baz @ example . com / db2 " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : null , <nl> + " password " : " secret " , <nl> + " username " : " alice " <nl> + } , <nl> + " description " : " User info for multiple hosts without database " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " 127 . 0 . 0 . 1 " , <nl> + " port " : null , <nl> + " type " : " ipv4 " <nl> + } , <nl> + { <nl> + " host " : " example . com " , <nl> + " port " : 27018 , <nl> + " type " : " hostname " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / alice : secret @ 127 . 0 . 0 . 1 , example . com : 27018 " , <nl> + " valid " : false , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : " secret " , <nl> + " username " : " alice " <nl> + } , <nl> + " description " : " User info for multiple hosts with database " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " example . com " , <nl> + " port " : null , <nl> + " type " : " hostname " <nl> + } , <nl> + { <nl> + " host " : " : : 1 " , <nl> + " port " : 27019 , <nl> + " type " : " ip_literal " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / alice : secret @ example . com , [ : : 1 ] : 27019 / admin " , <nl> + " valid " : false , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : null , <nl> + " password " : null , <nl> + " username " : " alice " <nl> + } , <nl> + " description " : " Username without password " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " 127 . 0 . 0 . 1 " , <nl> + " port " : null , <nl> + " type " : " ipv4 " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / alice @ 127 . 0 . 0 . 1 " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : null , <nl> + " password " : " " , <nl> + " username " : " alice " <nl> + } , <nl> + " description " : " Username with empty password " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " 127 . 0 . 0 . 1 " , <nl> + " port " : null , <nl> + " type " : " ipv4 " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / alice : @ 127 . 0 . 0 . 1 " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " my = db " , <nl> + " password " : null , <nl> + " username " : " @ l : ce / = " <nl> + } , <nl> + " description " : " Escaped username and database without password " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " example . com " , <nl> + " port " : null , <nl> + " type " : " hostname " <nl> + } <nl> + ] , <nl> + " options " : null , <nl> + " uri " : " mongodb : / / % 40l % 3Ace % 2F % 3D @ example . com / my % 3Ddb " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin = " , <nl> + " password " : " fizzb @ zz = " , <nl> + " username " : " $ am " <nl> + } , <nl> + " description " : " Escaped user info and database ( MONGODB - CR ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " 127 . 0 . 0 . 1 " , <nl> + " port " : null , <nl> + " type " : " ipv4 " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " authmechanism " : " MONGODB - CR " <nl> + } , <nl> + " uri " : " mongodb : / / % 24am : fizzb % 40zz % 3D @ 127 . 0 . 0 . 1 / admin % 3D ? authMechanism = MONGODB - CR " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : null , <nl> + " password " : null , <nl> + " username " : " CN = myName , OU = myOrgUnit , O = myOrg , L = myLocality , ST = myState , C = myCountry " <nl> + } , <nl> + " description " : " Escaped username ( MONGODB - X509 ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " localhost " , <nl> + " port " : null , <nl> + " type " : " hostname " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " authmechanism " : " MONGODB - X509 " <nl> + } , <nl> + " uri " : " mongodb : / / CN % 3DmyName % 2COU % 3DmyOrgUnit % 2CO % 3DmyOrg % 2CL % 3DmyLocality % 2CST % 3DmyState % 2CC % 3DmyCountry @ localhost / ? authMechanism = MONGODB - X509 " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : null , <nl> + " password " : " secret " , <nl> + " username " : " user @ EXAMPLE . COM " <nl> + } , <nl> + " description " : " Escaped username ( GSSAPI ) " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " localhost " , <nl> + " port " : null , <nl> + " type " : " hostname " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " authmechanism " : " GSSAPI " , <nl> + " authmechanismproperties " : { <nl> + " CANONICALIZE_HOST_NAME " : true , <nl> + " SERVICE_NAME " : " other " <nl> + } <nl> + } , <nl> + " uri " : " mongodb : / / user % 40EXAMPLE . COM : secret @ localhost / ? authMechanismProperties = SERVICE_NAME : other , CANONICALIZE_HOST_NAME : true & authMechanism = GSSAPI " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } , <nl> + { <nl> + " auth " : { <nl> + " db " : " admin " , <nl> + " password " : " secret " , <nl> + " username " : " alice " <nl> + } , <nl> + " description " : " At - signs in options aren ' t part of the userinfo " , <nl> + " hosts " : [ <nl> + { <nl> + " host " : " example . com " , <nl> + " port " : null , <nl> + " type " : " hostname " <nl> + } <nl> + ] , <nl> + " options " : { <nl> + " replicaSet " : " my @ replicaset " <nl> + } , <nl> + " uri " : " mongodb : / / alice : secret @ example . com / admin ? replicaSet = my @ replicaset " , <nl> + " valid " : true , <nl> + " warning " : false <nl> + } <nl> + ] <nl> + } <nl> new file mode 100644 <nl> index 000000000000 . . a04246847abe <nl> mmm / dev / null <nl> ppp b / src / mongo / client / mongo_uri_tests / mongo - uri - warnings . json <nl> <nl> + { <nl> + " tests " : [ <nl> + { <nl> + " description " : " Unrecognized option keys are ignored " , <nl> + " uri " : " mongodb : / / example . com / ? foo = bar " , <nl> + " valid " : true , <nl> + " warning " : true , <nl> + " hosts " : [ <nl> + { <nl> + " type " : " hostname " , <nl> + " host " : " example . com " , <nl> + " port " : null <nl> + } <nl> + ] , <nl> + " auth " : null , <nl> + " options " : { <nl> + " foo " : " bar " <nl> + } <nl> + } , <nl> + { <nl> + " description " : " Unsupported option values are ignored " , <nl> + " uri " : " mongodb : / / example . com / ? fsync = ifPossible " , <nl> + " valid " : true , <nl> + " warning " : true , <nl> + " hosts " : [ <nl> + { <nl> + " type " : " hostname " , <nl> + " host " : " example . com " , <nl> + " port " : null <nl> + } <nl> + ] , <nl> + " auth " : null , <nl> + " options " : { <nl> + " fsync " : " ifPossible " <nl> + } <nl> + } , <nl> + { <nl> + " description " : " Deprecated ( or unknown ) options are ignored if replacement exists " , <nl> + " uri " : " mongodb : / / example . com / ? wtimeout = 5 & wtimeoutMS = 10 " , <nl> + " valid " : true , <nl> + " warning " : true , <nl> + " hosts " : [ <nl> + { <nl> + " type " : " hostname " , <nl> + " host " : " example . com " , <nl> + " port " : null <nl> + } <nl> + ] , <nl> + " auth " : null , <nl> + " options " : { <nl> + " wtimeoutMS " : 10 , <nl> + " wtimeout " : 5 <nl> + } <nl> + } <nl> + ] <nl> + } <nl> \ No newline at end of file <nl> | SERVER - 29923 Re - write the Mongo Server ' s URI parser and Testing Suite | mongodb/mongo | 880e3c102363611ef09b451737276c0ad9400d11 | 2017-08-10T17:55:46Z |
new file mode 100644 <nl> index 0000000000 . . 6d4b053980 <nl> mmm / dev / null <nl> ppp b / . arcconfig <nl> <nl> + { <nl> + " project_id " : " leveldb " , <nl> + " conduit_uri " : " https : / / reviews . facebook . net / " , <nl> + " copyright_holder " : " " <nl> + } <nl> + <nl> mmm a / db / db_bench . cc <nl> ppp b / db / db_bench . cc <nl> static int FLAGS_write_buffer_size = 0 ; <nl> <nl> / / Number of bytes to use as a cache of uncompressed data . <nl> / / Negative means use default settings . <nl> - static int FLAGS_cache_size = - 1 ; <nl> + static long FLAGS_cache_size = - 1 ; <nl> <nl> / / Maximum number of files to keep open at the same time ( use default if = = 0 ) <nl> static int FLAGS_open_files = 0 ; <nl> class Stats { <nl> extra = rate ; <nl> } <nl> AppendWithSpace ( & extra , message_ ) ; <nl> + double throughput = ( double ) done_ / seconds_ ; <nl> <nl> - fprintf ( stdout , " % - 12s : % 11 . 3f micros / op ; % s % s \ n " , <nl> + fprintf ( stdout , " % - 12s : % 11 . 3f micros / op % ld ops / sec ; % s % s \ n " , <nl> name . ToString ( ) . c_str ( ) , <nl> seconds_ * 1e6 / done_ , <nl> + ( long ) throughput , <nl> ( extra . empty ( ) ? " " : " " ) , <nl> extra . c_str ( ) ) ; <nl> if ( FLAGS_histogram ) { <nl> int main ( int argc , char * * argv ) { <nl> FLAGS_value_size = n ; <nl> } else if ( sscanf ( argv [ i ] , " - - write_buffer_size = % d % c " , & n , & junk ) = = 1 ) { <nl> FLAGS_write_buffer_size = n ; <nl> - } else if ( sscanf ( argv [ i ] , " - - cache_size = % d % c " , & n , & junk ) = = 1 ) { <nl> + } else if ( sscanf ( argv [ i ] , " - - cache_size = % ld % c " , & n , & junk ) = = 1 ) { <nl> FLAGS_cache_size = n ; <nl> } else if ( sscanf ( argv [ i ] , " - - bloom_bits = % d % c " , & n , & junk ) = = 1 ) { <nl> FLAGS_bloom_bits = n ; <nl> | Support arcdiff . | facebook/rocksdb | cc6c32535aec596036c56fe742a39182539f76fa | 2012-05-10T06:35:05Z |
mmm a / core / color . cpp <nl> ppp b / core / color . cpp <nl> Color Color : : inverted ( ) const { <nl> Color Color : : contrasted ( ) const { <nl> <nl> Color c = * this ; <nl> - c . contrasted ( ) ; <nl> + c . contrast ( ) ; <nl> return c ; <nl> } <nl> <nl> | Merge pull request from adolson / color - contrasted - fix | godotengine/godot | 0c2222188e7d9b9c2bcae8186c7a164b50000dc3 | 2015-01-09T00:59:39Z |
mmm a / xbmc / cores / VideoRenderers / RenderCapture . cpp <nl> ppp b / xbmc / cores / VideoRenderers / RenderCapture . cpp <nl> CRenderCaptureIMX : : ~ CRenderCaptureIMX ( ) <nl> <nl> int CRenderCaptureIMX : : GetCaptureFormat ( ) <nl> { <nl> - return CAPTUREFORMAT_RGBA ; <nl> + return CAPTUREFORMAT_BGRA ; <nl> } <nl> <nl> void CRenderCaptureIMX : : BeginRender ( ) <nl> mmm a / xbmc / cores / dvdplayer / DVDCodecs / Video / DVDVideoCodecIMX . cpp <nl> ppp b / xbmc / cores / dvdplayer / DVDCodecs / Video / DVDVideoCodecIMX . cpp <nl> void CIMXContext : : PrepareTask ( IPUTask & ipu , CIMXBuffer * source_p , CIMXBuffer * so <nl> <nl> bool CIMXContext : : DoTask ( IPUTask & ipu , int targetPage ) <nl> { <nl> + bool swapColors = false ; <nl> + <nl> / / Clear page if cropping changes <nl> CRectInt dstRect ( ipu . task . output . crop . pos . x , ipu . task . output . crop . pos . y , <nl> ipu . task . output . crop . pos . x + ipu . task . output . crop . w , <nl> bool CIMXContext : : DoTask ( IPUTask & ipu , int targetPage ) <nl> CLog : : Log ( LOGERROR , " iMX : Error allocating capture buffer \ n " ) ; <nl> } <nl> ipu . task . output . paddr = m_bufferCapture - > buf_paddr ; <nl> + swapColors = true ; <nl> } <nl> <nl> if ( ( ipu . task . input . crop . w < = 0 ) | | ( ipu . task . input . crop . h < = 0 ) <nl> bool CIMXContext : : DoTask ( IPUTask & ipu , int targetPage ) <nl> dst . width = ipu . task . output . width ; <nl> dst . height = ipu . task . output . height ; <nl> dst . rot = G2D_ROTATION_0 ; <nl> - dst . format = G2D_RGBA8888 ; <nl> + dst . format = swapColors ? G2D_BGRA8888 : G2D_RGBA8888 ; <nl> / * printf ( " dst planes : % x - % x - % x \ n " , dst . planes [ 0 ] , dst . planes [ 1 ] , dst . planes [ 2 ] ) ; <nl> printf ( " dst left % d right % d top % d bottom % d stride % d w : % d h % d rot : % d format % d \ n " , <nl> dst . left , dst . right , dst . top , dst . bottom , dst . stride , dst . width , dst . height , dst . rot , dst . format ) ; * / <nl> | Merge pull request from smallint / imx - rendercapture | xbmc/xbmc | 54711fa9fe185244dacbc404619deb57626956aa | 2015-05-12T16:47:02Z |
mmm a / lib / Sema / CodeSynthesis . cpp <nl> ppp b / lib / Sema / CodeSynthesis . cpp <nl> static void convertNSManagedStoredVarToComputed ( VarDecl * VD , TypeChecker & TC ) { <nl> / / Okay , we have both the getter and setter . Set them in VD . <nl> VD - > makeComputed ( VD - > getLoc ( ) , Get , Set , nullptr , VD - > getLoc ( ) ) ; <nl> <nl> + TC . validateDecl ( Get ) ; <nl> + TC . validateDecl ( Set ) ; <nl> + <nl> / / We ' ve added some members to our containing class / extension , add them to <nl> / / the members list . <nl> addMemberToContextIfNeeded ( Get , VD - > getDeclContext ( ) ) ; <nl> void swift : : maybeAddAccessorsToVariable ( VarDecl * var , TypeChecker & TC ) { <nl> var - > makeComputed ( var - > getLoc ( ) , getter , setter , nullptr , <nl> var - > getLoc ( ) ) ; <nl> var - > setIsBeingTypeChecked ( false ) ; <nl> - TC . computeAccessibility ( setter ) ; <nl> + <nl> + TC . validateDecl ( getter ) ; <nl> + TC . validateDecl ( setter ) ; <nl> <nl> addMemberToContextIfNeeded ( getter , var - > getDeclContext ( ) ) ; <nl> addMemberToContextIfNeeded ( setter , var - > getDeclContext ( ) ) ; <nl> mmm a / test / ClangModules / Inputs / objc_nsmanaged_other . swift <nl> ppp b / test / ClangModules / Inputs / objc_nsmanaged_other . swift <nl> class OtherManagedObject : NSManagedObject { <nl> func getMyManagedObject ( ) - > MyManagedObject { <nl> return MyManagedObject ( ) <nl> } <nl> + <nl> + extension MyManagedObject { <nl> + @ NSManaged var anotherManaged : String <nl> + } <nl> mmm a / test / ClangModules / objc_nsmanagedobject . swift <nl> ppp b / test / ClangModules / objc_nsmanagedobject . swift <nl> <nl> / / RUN : % target - swift - frontend ( mock - sdk : % clang - importer - sdk ) - I % S / Inputs / custom - modules - parse - parse - as - library - verify % s % S / Inputs / objc_nsmanaged_other . swift <nl> + / / RUN : % target - swift - frontend ( mock - sdk : % clang - importer - sdk ) - I % S / Inputs / custom - modules - parse - parse - as - library - verify - primary - file % s % S / Inputs / objc_nsmanaged_other . swift <nl> + <nl> + / / RUN : % target - swift - frontend ( mock - sdk : % clang - importer - sdk ) - I % S / Inputs / custom - modules - emit - silgen - parse - as - library - o / dev / null - DNO_ERROR % s % S / Inputs / objc_nsmanaged_other . swift <nl> + / / RUN : % target - swift - frontend ( mock - sdk : % clang - importer - sdk ) - I % S / Inputs / custom - modules - emit - silgen - parse - as - library - o / dev / null - DNO_ERROR - primary - file % s % S / Inputs / objc_nsmanaged_other . swift <nl> <nl> / / REQUIRES : objc_interop <nl> <nl> + import Foundation <nl> import CoreData <nl> <nl> func markUsed < T > ( t : T ) { } <nl> <nl> / / Inferred @ requires_stored_property_inits . <nl> class MyManagedObject : NSManagedObject { <nl> + # if ! NO_ERROR <nl> var foo : String / / expected - error { { stored property ' foo ' requires an initial value } } <nl> var bar : String / / expected - error { { stored property ' bar ' requires an initial value } } <nl> - <nl> + # endif <nl> + <nl> @ NSManaged var managed : String <nl> <nl> override init ( ) { <nl> + # if ! NO_ERROR <nl> foo = " 1 " <nl> bar = " 2 " <nl> + # endif <nl> super . init ( ) <nl> } <nl> <nl> class MyManagedObject : NSManagedObject { <nl> return " hello " <nl> } <nl> <nl> + # if ! NO_ERROR <nl> var wobble : String { / / expected - error { { stored property ' wobble ' requires an initial value } } <nl> willSet ( value ) { <nl> markUsed ( value ) <nl> } <nl> } <nl> + # endif <nl> } <nl> <nl> func getOtherManagedObject ( ) - > OtherManagedObject { <nl> func getOtherManagedObject ( ) - > OtherManagedObject { <nl> func accessOther ( om : OtherManagedObject ) - > String { <nl> return om . managed <nl> } <nl> + <nl> + / / rdar : / / problem / 20821582 <nl> + func accessMine ( obj : MyManagedObject ) - > String { <nl> + return obj . anotherManaged <nl> + } <nl> | Make sure we validate the synthesized accessors for NSManaged properties . | apple/swift | 88c9ab591f56b0f0e8930aa8bded2f43029e4507 | 2015-05-05T20:02:12Z |
mmm a / src / arm / lithium - arm . cc <nl> ppp b / src / arm / lithium - arm . cc <nl> LInstruction * LChunkBuilder : : DoBlockEntry ( HBlockEntry * instr ) { <nl> } <nl> <nl> <nl> + LInstruction * LChunkBuilder : : DoDummyUse ( HDummyUse * instr ) { <nl> + return DefineAsRegister ( new ( zone ( ) ) LDummyUse ( UseAny ( instr - > value ( ) ) ) ) ; <nl> + } <nl> + <nl> + <nl> LInstruction * LChunkBuilder : : DoSoftDeoptimize ( HSoftDeoptimize * instr ) { <nl> return AssignEnvironment ( new ( zone ( ) ) LDeoptimize ) ; <nl> } <nl> mmm a / src / arm / lithium - arm . h <nl> ppp b / src / arm / lithium - arm . h <nl> class LCodeGen ; <nl> V ( Deoptimize ) \ <nl> V ( DivI ) \ <nl> V ( DoubleToI ) \ <nl> + V ( DummyUse ) \ <nl> V ( ElementsKind ) \ <nl> V ( FastLiteral ) \ <nl> V ( FixedArrayBaseLength ) \ <nl> class LLazyBailout : public LTemplateInstruction < 0 , 0 , 0 > { <nl> } ; <nl> <nl> <nl> + class LDummyUse : public LTemplateInstruction < 1 , 1 , 0 > { <nl> + public : <nl> + explicit LDummyUse ( LOperand * value ) { <nl> + inputs_ [ 0 ] = value ; <nl> + } <nl> + DECLARE_CONCRETE_INSTRUCTION ( DummyUse , " dummy - use " ) <nl> + } ; <nl> + <nl> + <nl> class LDeoptimize : public LTemplateInstruction < 0 , 0 , 0 > { <nl> public : <nl> DECLARE_CONCRETE_INSTRUCTION ( Deoptimize , " deoptimize " ) <nl> mmm a / src / arm / lithium - codegen - arm . cc <nl> ppp b / src / arm / lithium - codegen - arm . cc <nl> void LCodeGen : : DoDeoptimize ( LDeoptimize * instr ) { <nl> } <nl> <nl> <nl> + void LCodeGen : : DoDummyUse ( LDummyUse * instr ) { <nl> + / / Nothing to see here , move on ! <nl> + } <nl> + <nl> + <nl> void LCodeGen : : DoDeleteProperty ( LDeleteProperty * instr ) { <nl> Register object = ToRegister ( instr - > object ( ) ) ; <nl> Register key = ToRegister ( instr - > key ( ) ) ; <nl> mmm a / src / hydrogen - instructions . cc <nl> ppp b / src / hydrogen - instructions . cc <nl> void HInstruction : : Verify ( ) { <nl> # endif <nl> <nl> <nl> + void HDummyUse : : PrintDataTo ( StringStream * stream ) { <nl> + value ( ) - > PrintNameTo ( stream ) ; <nl> + } <nl> + <nl> + <nl> void HUnaryCall : : PrintDataTo ( StringStream * stream ) { <nl> value ( ) - > PrintNameTo ( stream ) ; <nl> stream - > Add ( " " ) ; <nl> mmm a / src / hydrogen - instructions . h <nl> ppp b / src / hydrogen - instructions . h <nl> class LChunkBuilder ; <nl> V ( DeleteProperty ) \ <nl> V ( Deoptimize ) \ <nl> V ( Div ) \ <nl> + V ( DummyUse ) \ <nl> V ( ElementsKind ) \ <nl> V ( EnterInlined ) \ <nl> V ( FastLiteral ) \ <nl> class HBlockEntry : public HTemplateInstruction < 0 > { <nl> } ; <nl> <nl> <nl> + class HDummyUse : public HTemplateInstruction < 1 > { <nl> + public : <nl> + explicit HDummyUse ( HValue * value ) { <nl> + SetOperandAt ( 0 , value ) ; <nl> + / / Pretend to be a Smi so that the HChange instructions inserted <nl> + / / before any use generate as little code as possible . <nl> + set_representation ( Representation : : Tagged ( ) ) ; <nl> + set_type ( HType : : Smi ( ) ) ; <nl> + } <nl> + <nl> + HValue * value ( ) { return OperandAt ( 0 ) ; } <nl> + <nl> + virtual Representation RequiredInputRepresentation ( int index ) { <nl> + return Representation : : None ( ) ; <nl> + } <nl> + <nl> + virtual void PrintDataTo ( StringStream * stream ) ; <nl> + <nl> + DECLARE_CONCRETE_INSTRUCTION ( DummyUse ) ; <nl> + } ; <nl> + <nl> + <nl> / / We insert soft - deoptimize when we hit code with unknown typefeedback , <nl> / / so that we get a chance of re - optimizing with useful typefeedback . <nl> / / HSoftDeoptimize does not end a basic block as opposed to HDeoptimize . <nl> mmm a / src / hydrogen . cc <nl> ppp b / src / hydrogen . cc <nl> HGraph : : HGraph ( CompilationInfo * info ) <nl> zone_ ( info - > zone ( ) ) , <nl> is_recursive_ ( false ) , <nl> use_optimistic_licm_ ( false ) , <nl> + has_soft_deoptimize_ ( false ) , <nl> type_change_checksum_ ( 0 ) { <nl> if ( info - > IsStub ( ) ) { <nl> start_environment_ = <nl> void HGraph : : AssignDominators ( ) { <nl> } <nl> } <nl> <nl> + <nl> / / Mark all blocks that are dominated by an unconditional soft deoptimize to <nl> / / prevent code motion across those blocks . <nl> void HGraph : : PropagateDeoptimizingMark ( ) { <nl> HPhase phase ( " H_Propagate deoptimizing mark " , this ) ; <nl> + / / Skip this phase if there is nothing to be done anyway . <nl> + if ( ! has_soft_deoptimize ( ) ) return ; <nl> MarkAsDeoptimizingRecursively ( entry_block ( ) ) ; <nl> + NullifyUnreachableInstructions ( ) ; <nl> } <nl> <nl> + <nl> void HGraph : : MarkAsDeoptimizingRecursively ( HBasicBlock * block ) { <nl> for ( int i = 0 ; i < block - > dominated_blocks ( ) - > length ( ) ; + + i ) { <nl> HBasicBlock * dominated = block - > dominated_blocks ( ) - > at ( i ) ; <nl> void HGraph : : MarkAsDeoptimizingRecursively ( HBasicBlock * block ) { <nl> } <nl> } <nl> <nl> + <nl> + void HGraph : : NullifyUnreachableInstructions ( ) { <nl> + int block_count = blocks_ . length ( ) ; <nl> + for ( int i = 0 ; i < block_count ; + + i ) { <nl> + HBasicBlock * block = blocks_ . at ( i ) ; <nl> + bool nullify = false ; <nl> + const ZoneList < HBasicBlock * > * predecessors = block - > predecessors ( ) ; <nl> + int predecessors_length = predecessors - > length ( ) ; <nl> + bool all_predecessors_deoptimizing = ( predecessors_length > 0 ) ; <nl> + for ( int j = 0 ; j < predecessors_length ; + + j ) { <nl> + if ( ! predecessors - > at ( j ) - > IsDeoptimizing ( ) ) { <nl> + all_predecessors_deoptimizing = false ; <nl> + break ; <nl> + } <nl> + } <nl> + if ( all_predecessors_deoptimizing ) nullify = true ; <nl> + for ( HInstruction * instr = block - > first ( ) ; instr ! = NULL ; <nl> + instr = instr - > next ( ) ) { <nl> + / / Leave the basic structure of the graph intact . <nl> + if ( instr - > IsBlockEntry ( ) ) continue ; <nl> + if ( instr - > IsControlInstruction ( ) ) continue ; <nl> + if ( instr - > IsSimulate ( ) ) continue ; <nl> + if ( instr - > IsEnterInlined ( ) ) continue ; <nl> + if ( instr - > IsLeaveInlined ( ) ) continue ; <nl> + if ( nullify ) { <nl> + HInstruction * last_dummy = NULL ; <nl> + for ( int j = 0 ; j < instr - > OperandCount ( ) ; + + j ) { <nl> + HValue * operand = instr - > OperandAt ( j ) ; <nl> + / / Insert an HDummyUse for each operand , unless the operand <nl> + / / is an HDummyUse itself . If it ' s even from the same block , <nl> + / / remember it as a potential replacement for the instruction . <nl> + if ( operand - > IsDummyUse ( ) ) { <nl> + if ( operand - > block ( ) = = instr - > block ( ) & & <nl> + last_dummy = = NULL ) { <nl> + last_dummy = HInstruction : : cast ( operand ) ; <nl> + } <nl> + continue ; <nl> + } <nl> + HDummyUse * dummy = new ( zone ( ) ) HDummyUse ( operand ) ; <nl> + dummy - > InsertBefore ( instr ) ; <nl> + last_dummy = dummy ; <nl> + } <nl> + if ( last_dummy = = NULL ) last_dummy = GetConstant1 ( ) ; <nl> + instr - > DeleteAndReplaceWith ( last_dummy ) ; <nl> + continue ; <nl> + } <nl> + if ( instr - > IsSoftDeoptimize ( ) ) { <nl> + ASSERT ( block - > IsDeoptimizing ( ) ) ; <nl> + nullify = true ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + <nl> + <nl> void HGraph : : EliminateRedundantPhis ( ) { <nl> HPhase phase ( " H_Redundant phi elimination " , this ) ; <nl> <nl> void HOptimizedGraphBuilder : : PushAndAdd ( HInstruction * instr ) { <nl> } <nl> <nl> <nl> + void HOptimizedGraphBuilder : : AddSoftDeoptimize ( ) { <nl> + if ( FLAG_always_opt ) return ; <nl> + if ( current_block ( ) - > IsDeoptimizing ( ) ) return ; <nl> + AddInstruction ( new ( zone ( ) ) HSoftDeoptimize ( ) ) ; <nl> + current_block ( ) - > MarkAsDeoptimizing ( ) ; <nl> + graph ( ) - > set_has_soft_deoptimize ( true ) ; <nl> + } <nl> + <nl> + <nl> template < class Instruction > <nl> HInstruction * HOptimizedGraphBuilder : : PreProcessCall ( Instruction * call ) { <nl> int count = call - > argument_count ( ) ; <nl> HInstruction * HOptimizedGraphBuilder : : BuildLoadNamedGeneric ( <nl> HValue * object , <nl> Handle < String > name , <nl> Property * expr ) { <nl> - if ( expr - > IsUninitialized ( ) & & ! FLAG_always_opt ) { <nl> - AddInstruction ( new ( zone ( ) ) HSoftDeoptimize ) ; <nl> - current_block ( ) - > MarkAsDeoptimizing ( ) ; <nl> + if ( expr - > IsUninitialized ( ) ) { <nl> + AddSoftDeoptimize ( ) ; <nl> } <nl> HValue * context = environment ( ) - > LookupContext ( ) ; <nl> return new ( zone ( ) ) HLoadNamedGeneric ( context , object , name ) ; <nl> void HOptimizedGraphBuilder : : VisitSub ( UnaryOperation * expr ) { <nl> TypeInfo info = oracle ( ) - > UnaryType ( expr ) ; <nl> Representation rep = ToRepresentation ( info ) ; <nl> if ( info . IsUninitialized ( ) ) { <nl> - AddInstruction ( new ( zone ( ) ) HSoftDeoptimize ) ; <nl> - current_block ( ) - > MarkAsDeoptimizing ( ) ; <nl> + AddSoftDeoptimize ( ) ; <nl> info = TypeInfo : : Unknown ( ) ; <nl> } <nl> HBinaryOperation : : cast ( instr ) - > set_observed_input_representation ( rep , rep ) ; <nl> void HOptimizedGraphBuilder : : VisitBitNot ( UnaryOperation * expr ) { <nl> HValue * value = Pop ( ) ; <nl> TypeInfo info = oracle ( ) - > UnaryType ( expr ) ; <nl> if ( info . IsUninitialized ( ) ) { <nl> - AddInstruction ( new ( zone ( ) ) HSoftDeoptimize ) ; <nl> - current_block ( ) - > MarkAsDeoptimizing ( ) ; <nl> + AddSoftDeoptimize ( ) ; <nl> } <nl> HInstruction * instr = new ( zone ( ) ) HBitNot ( value ) ; <nl> return ast_context ( ) - > ReturnInstruction ( instr , expr - > id ( ) ) ; <nl> HInstruction * HOptimizedGraphBuilder : : BuildBinaryOperation ( <nl> if ( left_info . IsUninitialized ( ) ) { <nl> / / Can ' t have initialized one but not the other . <nl> ASSERT ( right_info . IsUninitialized ( ) ) ; <nl> - AddInstruction ( new ( zone ( ) ) HSoftDeoptimize ) ; <nl> - current_block ( ) - > MarkAsDeoptimizing ( ) ; <nl> + AddSoftDeoptimize ( ) ; <nl> left_info = right_info = TypeInfo : : Unknown ( ) ; <nl> } <nl> HInstruction * instr = NULL ; <nl> void HOptimizedGraphBuilder : : VisitCompareOperation ( CompareOperation * expr ) { <nl> / / Check if this expression was ever executed according to type feedback . <nl> / / Note that for the special typeof / null / undefined cases we get unknown here . <nl> if ( overall_type_info . IsUninitialized ( ) ) { <nl> - AddInstruction ( new ( zone ( ) ) HSoftDeoptimize ) ; <nl> - current_block ( ) - > MarkAsDeoptimizing ( ) ; <nl> + AddSoftDeoptimize ( ) ; <nl> overall_type_info = left_type = right_type = TypeInfo : : Unknown ( ) ; <nl> } <nl> <nl> mmm a / src / hydrogen . h <nl> ppp b / src / hydrogen . h <nl> class HGraph : public ZoneObject { <nl> use_optimistic_licm_ = value ; <nl> } <nl> <nl> + bool has_soft_deoptimize ( ) { <nl> + return has_soft_deoptimize_ ; <nl> + } <nl> + <nl> + void set_has_soft_deoptimize ( bool value ) { <nl> + has_soft_deoptimize_ = value ; <nl> + } <nl> + <nl> void MarkRecursive ( ) { <nl> is_recursive_ = true ; <nl> } <nl> class HGraph : public ZoneObject { <nl> int32_t integer_value ) ; <nl> <nl> void MarkAsDeoptimizingRecursively ( HBasicBlock * block ) ; <nl> + void NullifyUnreachableInstructions ( ) ; <nl> void InsertTypeConversions ( HInstruction * instr ) ; <nl> void PropagateMinusZeroChecks ( HValue * value , BitVector * visited ) ; <nl> void RecursivelyMarkPhiDeoptimizeOnUndefined ( HPhi * phi ) ; <nl> class HGraph : public ZoneObject { <nl> <nl> bool is_recursive_ ; <nl> bool use_optimistic_licm_ ; <nl> + bool has_soft_deoptimize_ ; <nl> int type_change_checksum_ ; <nl> <nl> DISALLOW_COPY_AND_ASSIGN ( HGraph ) ; <nl> class HOptimizedGraphBuilder : public HGraphBuilder , public AstVisitor { <nl> <nl> bool inline_bailout ( ) { return inline_bailout_ ; } <nl> <nl> + void AddSoftDeoptimize ( ) ; <nl> + <nl> / / Bailout environment manipulation . <nl> void Push ( HValue * value ) { environment ( ) - > Push ( value ) ; } <nl> HValue * Pop ( ) { return environment ( ) - > Pop ( ) ; } <nl> mmm a / src / ia32 / lithium - codegen - ia32 . cc <nl> ppp b / src / ia32 / lithium - codegen - ia32 . cc <nl> void LCodeGen : : DoDeoptimize ( LDeoptimize * instr ) { <nl> } <nl> <nl> <nl> + void LCodeGen : : DoDummyUse ( LDummyUse * instr ) { <nl> + / / Nothing to see here , move on ! <nl> + } <nl> + <nl> + <nl> void LCodeGen : : DoDeleteProperty ( LDeleteProperty * instr ) { <nl> LOperand * obj = instr - > object ( ) ; <nl> LOperand * key = instr - > key ( ) ; <nl> mmm a / src / ia32 / lithium - ia32 . cc <nl> ppp b / src / ia32 / lithium - ia32 . cc <nl> LInstruction * LChunkBuilder : : DoBlockEntry ( HBlockEntry * instr ) { <nl> } <nl> <nl> <nl> + LInstruction * LChunkBuilder : : DoDummyUse ( HDummyUse * instr ) { <nl> + return DefineAsRegister ( new ( zone ( ) ) LDummyUse ( UseAny ( instr - > value ( ) ) ) ) ; <nl> + } <nl> + <nl> + <nl> LInstruction * LChunkBuilder : : DoSoftDeoptimize ( HSoftDeoptimize * instr ) { <nl> return AssignEnvironment ( new ( zone ( ) ) LDeoptimize ) ; <nl> } <nl> mmm a / src / ia32 / lithium - ia32 . h <nl> ppp b / src / ia32 / lithium - ia32 . h <nl> class LCodeGen ; <nl> V ( Deoptimize ) \ <nl> V ( DivI ) \ <nl> V ( DoubleToI ) \ <nl> + V ( DummyUse ) \ <nl> V ( ElementsKind ) \ <nl> V ( FastLiteral ) \ <nl> V ( FixedArrayBaseLength ) \ <nl> class LLazyBailout : public LTemplateInstruction < 0 , 0 , 0 > { <nl> } ; <nl> <nl> <nl> + class LDummyUse : public LTemplateInstruction < 1 , 1 , 0 > { <nl> + public : <nl> + explicit LDummyUse ( LOperand * value ) { <nl> + inputs_ [ 0 ] = value ; <nl> + } <nl> + DECLARE_CONCRETE_INSTRUCTION ( DummyUse , " dummy - use " ) <nl> + } ; <nl> + <nl> + <nl> class LDeoptimize : public LTemplateInstruction < 0 , 0 , 0 > { <nl> public : <nl> DECLARE_CONCRETE_INSTRUCTION ( Deoptimize , " deoptimize " ) <nl> mmm a / src / x64 / lithium - codegen - x64 . cc <nl> ppp b / src / x64 / lithium - codegen - x64 . cc <nl> void LCodeGen : : DoDeoptimize ( LDeoptimize * instr ) { <nl> } <nl> <nl> <nl> + void LCodeGen : : DoDummyUse ( LDummyUse * instr ) { <nl> + / / Nothing to see here , move on ! <nl> + } <nl> + <nl> + <nl> void LCodeGen : : DoDeleteProperty ( LDeleteProperty * instr ) { <nl> LOperand * obj = instr - > object ( ) ; <nl> LOperand * key = instr - > key ( ) ; <nl> mmm a / src / x64 / lithium - x64 . cc <nl> ppp b / src / x64 / lithium - x64 . cc <nl> LInstruction * LChunkBuilder : : DoBlockEntry ( HBlockEntry * instr ) { <nl> } <nl> <nl> <nl> + LInstruction * LChunkBuilder : : DoDummyUse ( HDummyUse * instr ) { <nl> + return DefineAsRegister ( new ( zone ( ) ) LDummyUse ( UseAny ( instr - > value ( ) ) ) ) ; <nl> + } <nl> + <nl> + <nl> LInstruction * LChunkBuilder : : DoSoftDeoptimize ( HSoftDeoptimize * instr ) { <nl> return AssignEnvironment ( new ( zone ( ) ) LDeoptimize ) ; <nl> } <nl> mmm a / src / x64 / lithium - x64 . h <nl> ppp b / src / x64 / lithium - x64 . h <nl> class LCodeGen ; <nl> V ( Deoptimize ) \ <nl> V ( DivI ) \ <nl> V ( DoubleToI ) \ <nl> + V ( DummyUse ) \ <nl> V ( ElementsKind ) \ <nl> V ( FastLiteral ) \ <nl> V ( FixedArrayBaseLength ) \ <nl> class LLazyBailout : public LTemplateInstruction < 0 , 0 , 0 > { <nl> } ; <nl> <nl> <nl> + class LDummyUse : public LTemplateInstruction < 1 , 1 , 0 > { <nl> + public : <nl> + explicit LDummyUse ( LOperand * value ) { <nl> + inputs_ [ 0 ] = value ; <nl> + } <nl> + DECLARE_CONCRETE_INSTRUCTION ( DummyUse , " dummy - use " ) <nl> + } ; <nl> + <nl> + <nl> class LDeoptimize : public LTemplateInstruction < 0 , 0 , 0 > { <nl> public : <nl> DECLARE_CONCRETE_INSTRUCTION ( Deoptimize , " deoptimize " ) <nl> | Don ' t emit code for instructions that are hiding behind an HSoftDeoptimize | v8/v8 | a496e0d06a6ce7bb3b7986bf7a30274a507d46a1 | 2013-01-17T14:07:47Z |
mmm a / src / compiler / js - native - context - specialization . cc <nl> ppp b / src / compiler / js - native - context - specialization . cc <nl> JSNativeContextSpecialization : : BuildElementAccess ( <nl> buffer_or_receiver = buffer ; <nl> } <nl> <nl> + enum Situation { kBoundsCheckDone , kHandleOOB_SmiCheckDone } ; <nl> + Situation situation ; <nl> if ( ( keyed_mode . IsLoad ( ) & & <nl> keyed_mode . load_mode ( ) = = LOAD_IGNORE_OUT_OF_BOUNDS ) | | <nl> ( keyed_mode . IsStore ( ) & & <nl> JSNativeContextSpecialization : : BuildElementAccess ( <nl> / / below are performed on unsigned values , which means that all the <nl> / / Negative32 values are treated as out - of - bounds . <nl> index = graph ( ) - > NewNode ( simplified ( ) - > NumberToUint32 ( ) , index ) ; <nl> + situation = kHandleOOB_SmiCheckDone ; <nl> } else { <nl> / / Check that the { index } is in the valid range for the { receiver } . <nl> index = effect = <nl> graph ( ) - > NewNode ( simplified ( ) - > CheckBounds ( FeedbackSource ( ) ) , index , <nl> length , effect , control ) ; <nl> + situation = kBoundsCheckDone ; <nl> } <nl> <nl> / / Access the actual element . <nl> JSNativeContextSpecialization : : BuildElementAccess ( <nl> switch ( keyed_mode . access_mode ( ) ) { <nl> case AccessMode : : kLoad : { <nl> / / Check if we can return undefined for out - of - bounds loads . <nl> - if ( keyed_mode . load_mode ( ) = = LOAD_IGNORE_OUT_OF_BOUNDS ) { <nl> + if ( situation = = kHandleOOB_SmiCheckDone ) { <nl> Node * check = <nl> graph ( ) - > NewNode ( simplified ( ) - > NumberLessThan ( ) , index , length ) ; <nl> Node * branch = graph ( ) - > NewNode ( <nl> JSNativeContextSpecialization : : BuildElementAccess ( <nl> vtrue , vfalse , control ) ; <nl> } else { <nl> / / Perform the actual load . <nl> + DCHECK_EQ ( kBoundsCheckDone , situation ) ; <nl> value = effect = graph ( ) - > NewNode ( <nl> simplified ( ) - > LoadTypedElement ( external_array_type ) , <nl> buffer_or_receiver , base_pointer , external_pointer , index , effect , <nl> JSNativeContextSpecialization : : BuildElementAccess ( <nl> value = graph ( ) - > NewNode ( simplified ( ) - > NumberToUint8Clamped ( ) , value ) ; <nl> } <nl> <nl> - / / Check if we can skip the out - of - bounds store . <nl> - if ( keyed_mode . store_mode ( ) = = STORE_IGNORE_OUT_OF_BOUNDS ) { <nl> + if ( situation = = kHandleOOB_SmiCheckDone ) { <nl> + / / We have to detect OOB stores and handle them without deopt ( by <nl> + / / simply not performing them ) . <nl> Node * check = <nl> graph ( ) - > NewNode ( simplified ( ) - > NumberLessThan ( ) , index , length ) ; <nl> Node * branch = graph ( ) - > NewNode ( common ( ) - > Branch ( BranchHint : : kTrue ) , <nl> JSNativeContextSpecialization : : BuildElementAccess ( <nl> graph ( ) - > NewNode ( common ( ) - > EffectPhi ( 2 ) , etrue , efalse , control ) ; <nl> } else { <nl> / / Perform the actual store <nl> + DCHECK_EQ ( kBoundsCheckDone , situation ) ; <nl> effect = graph ( ) - > NewNode ( <nl> simplified ( ) - > StoreTypedElement ( external_array_type ) , <nl> buffer_or_receiver , base_pointer , external_pointer , index , value , <nl> JSNativeContextSpecialization : : BuildElementAccess ( <nl> break ; <nl> } <nl> case AccessMode : : kHas : <nl> - / / For has property on a typed array , all we need is a bounds check . <nl> - value = effect = <nl> - graph ( ) - > NewNode ( simplified ( ) - > SpeculativeNumberLessThan ( <nl> - NumberOperationHint : : kSignedSmall ) , <nl> - index , length , effect , control ) ; <nl> + if ( situation = = kHandleOOB_SmiCheckDone ) { <nl> + value = effect = <nl> + graph ( ) - > NewNode ( simplified ( ) - > SpeculativeNumberLessThan ( <nl> + NumberOperationHint : : kSignedSmall ) , <nl> + index , length , effect , control ) ; <nl> + } else { <nl> + DCHECK_EQ ( kBoundsCheckDone , situation ) ; <nl> + / / For has - property on a typed array , all we need is a bounds check . <nl> + value = jsgraph ( ) - > TrueConstant ( ) ; <nl> + } <nl> break ; <nl> } <nl> } else { <nl> | [ turbofan ] Repair ' index in typedarray ' regression | v8/v8 | a35214a0c5556feeece4e8826d427c3136d2dd3e | 2020-01-29T16:42:20Z |
mmm a / src / core / hle / service / nvdrv / devices / nvdisp_disp0 . cpp <nl> ppp b / src / core / hle / service / nvdrv / devices / nvdisp_disp0 . cpp <nl> u32 nvdisp_disp0 : : ioctl ( Ioctl command , const std : : vector < u8 > & input , std : : vector <nl> } <nl> <nl> void nvdisp_disp0 : : flip ( u32 buffer_handle , u32 offset , u32 format , u32 width , u32 height , <nl> - u32 stride , NVFlinger : : BufferQueue : : BufferTransformFlags transform ) { <nl> + u32 stride , NVFlinger : : BufferQueue : : BufferTransformFlags transform , <nl> + const MathUtil : : Rectangle < int > & crop_rect ) { <nl> VAddr addr = nvmap_dev - > GetObjectAddress ( buffer_handle ) ; <nl> LOG_WARNING ( Service , <nl> " Drawing from address { : X } offset { : 08X } Width { } Height { } Stride { } Format { } " , <nl> void nvdisp_disp0 : : flip ( u32 buffer_handle , u32 offset , u32 format , u32 width , u3 <nl> <nl> using PixelFormat = Tegra : : FramebufferConfig : : PixelFormat ; <nl> const Tegra : : FramebufferConfig framebuffer { <nl> - addr , offset , width , height , stride , static_cast < PixelFormat > ( format ) , transform } ; <nl> + addr , offset , width , height , stride , static_cast < PixelFormat > ( format ) , <nl> + transform , crop_rect } ; <nl> <nl> Core : : System : : GetInstance ( ) . perf_stats . EndGameFrame ( ) ; <nl> <nl> mmm a / src / core / hle / service / nvdrv / devices / nvdisp_disp0 . h <nl> ppp b / src / core / hle / service / nvdrv / devices / nvdisp_disp0 . h <nl> <nl> # include < memory > <nl> # include < vector > <nl> # include " common / common_types . h " <nl> + # include " common / math_util . h " <nl> # include " core / hle / service / nvdrv / devices / nvdevice . h " <nl> # include " core / hle / service / nvflinger / buffer_queue . h " <nl> <nl> class nvdisp_disp0 final : public nvdevice { <nl> <nl> / / / Performs a screen flip , drawing the buffer pointed to by the handle . <nl> void flip ( u32 buffer_handle , u32 offset , u32 format , u32 width , u32 height , u32 stride , <nl> - NVFlinger : : BufferQueue : : BufferTransformFlags transform ) ; <nl> + NVFlinger : : BufferQueue : : BufferTransformFlags transform , <nl> + const MathUtil : : Rectangle < int > & crop_rect ) ; <nl> <nl> private : <nl> std : : shared_ptr < nvmap > nvmap_dev ; <nl> mmm a / src / core / hle / service / nvflinger / buffer_queue . cpp <nl> ppp b / src / core / hle / service / nvflinger / buffer_queue . cpp <nl> const IGBPBuffer & BufferQueue : : RequestBuffer ( u32 slot ) const { <nl> return itr - > igbp_buffer ; <nl> } <nl> <nl> - void BufferQueue : : QueueBuffer ( u32 slot , BufferTransformFlags transform ) { <nl> + void BufferQueue : : QueueBuffer ( u32 slot , BufferTransformFlags transform , <nl> + const MathUtil : : Rectangle < int > & crop_rect ) { <nl> auto itr = std : : find_if ( queue . begin ( ) , queue . end ( ) , <nl> [ & ] ( const Buffer & buffer ) { return buffer . slot = = slot ; } ) ; <nl> ASSERT ( itr ! = queue . end ( ) ) ; <nl> ASSERT ( itr - > status = = Buffer : : Status : : Dequeued ) ; <nl> itr - > status = Buffer : : Status : : Queued ; <nl> itr - > transform = transform ; <nl> + itr - > crop_rect = crop_rect ; <nl> } <nl> <nl> boost : : optional < const BufferQueue : : Buffer & > BufferQueue : : AcquireBuffer ( ) { <nl> mmm a / src / core / hle / service / nvflinger / buffer_queue . h <nl> ppp b / src / core / hle / service / nvflinger / buffer_queue . h <nl> <nl> <nl> # include < vector > <nl> # include < boost / optional . hpp > <nl> + # include " common / math_util . h " <nl> # include " common / swap . h " <nl> # include " core / hle / kernel / event . h " <nl> <nl> class BufferQueue final { <nl> Status status = Status : : Free ; <nl> IGBPBuffer igbp_buffer ; <nl> BufferTransformFlags transform ; <nl> + MathUtil : : Rectangle < int > crop_rect ; <nl> } ; <nl> <nl> void SetPreallocatedBuffer ( u32 slot , IGBPBuffer & buffer ) ; <nl> boost : : optional < u32 > DequeueBuffer ( u32 width , u32 height ) ; <nl> const IGBPBuffer & RequestBuffer ( u32 slot ) const ; <nl> - void QueueBuffer ( u32 slot , BufferTransformFlags transform ) ; <nl> + void QueueBuffer ( u32 slot , BufferTransformFlags transform , <nl> + const MathUtil : : Rectangle < int > & crop_rect ) ; <nl> boost : : optional < const Buffer & > AcquireBuffer ( ) ; <nl> void ReleaseBuffer ( u32 slot ) ; <nl> u32 Query ( QueryType type ) ; <nl> mmm a / src / core / hle / service / nvflinger / nvflinger . cpp <nl> ppp b / src / core / hle / service / nvflinger / nvflinger . cpp <nl> void NVFlinger : : Compose ( ) { <nl> ASSERT ( nvdisp ) ; <nl> <nl> nvdisp - > flip ( igbp_buffer . gpu_buffer_id , igbp_buffer . offset , igbp_buffer . format , <nl> - igbp_buffer . width , igbp_buffer . height , igbp_buffer . stride , buffer - > transform ) ; <nl> + igbp_buffer . width , igbp_buffer . height , igbp_buffer . stride , buffer - > transform , <nl> + buffer - > crop_rect ) ; <nl> <nl> buffer_queue - > ReleaseBuffer ( buffer - > slot ) ; <nl> } <nl> mmm a / src / core / hle / service / vi / vi . cpp <nl> ppp b / src / core / hle / service / vi / vi . cpp <nl> <nl> # include < memory > <nl> # include < boost / optional . hpp > <nl> # include " common / alignment . h " <nl> + # include " common / math_util . h " <nl> # include " common / scope_exit . h " <nl> # include " core / core_timing . h " <nl> # include " core / hle / ipc_helpers . h " <nl> struct DisplayInfo { <nl> char display_name [ 0x40 ] { " Default " } ; <nl> u64 unknown_1 { 1 } ; <nl> u64 unknown_2 { 1 } ; <nl> - u64 width { 1920 } ; <nl> - u64 height { 1080 } ; <nl> + u64 width { 1280 } ; <nl> + u64 height { 720 } ; <nl> } ; <nl> static_assert ( sizeof ( DisplayInfo ) = = 0x60 , " DisplayInfo has wrong size " ) ; <nl> <nl> class IGBPRequestBufferResponseParcel : public Parcel { <nl> <nl> protected : <nl> void SerializeData ( ) override { <nl> - / / TODO ( Subv ) : Figure out what this value means , writing non - zero here will make libnx try <nl> - / / to read an IGBPBuffer object from the parcel . <nl> + / / TODO ( Subv ) : Figure out what this value means , writing non - zero here will make libnx <nl> + / / try to read an IGBPBuffer object from the parcel . <nl> Write < u32_le > ( 1 ) ; <nl> WriteObject ( buffer ) ; <nl> Write < u32_le > ( 0 ) ; <nl> class IGBPQueueBufferRequestParcel : public Parcel { <nl> INSERT_PADDING_WORDS ( 3 ) ; <nl> u32_le timestamp ; <nl> s32_le is_auto_timestamp ; <nl> - s32_le crop_left ; <nl> s32_le crop_top ; <nl> + s32_le crop_left ; <nl> s32_le crop_right ; <nl> s32_le crop_bottom ; <nl> s32_le scaling_mode ; <nl> class IGBPQueueBufferRequestParcel : public Parcel { <nl> INSERT_PADDING_WORDS ( 2 ) ; <nl> u32_le fence_is_valid ; <nl> std : : array < Fence , 2 > fences ; <nl> + <nl> + MathUtil : : Rectangle < int > GetCropRect ( ) const { <nl> + return { crop_left , crop_top , crop_right , crop_bottom } ; <nl> + } <nl> } ; <nl> static_assert ( sizeof ( Data ) = = 80 , " ParcelData has wrong size " ) ; <nl> <nl> class IHOSBinderDriver final : public ServiceFramework < IHOSBinderDriver > { <nl> } else if ( transaction = = TransactionId : : QueueBuffer ) { <nl> IGBPQueueBufferRequestParcel request { ctx . ReadBuffer ( ) } ; <nl> <nl> - buffer_queue - > QueueBuffer ( request . data . slot , request . data . transform ) ; <nl> + buffer_queue - > QueueBuffer ( request . data . slot , request . data . transform , <nl> + request . data . GetCropRect ( ) ) ; <nl> <nl> IGBPQueueBufferResponseParcel response { 1280 , 720 } ; <nl> ctx . WriteBuffer ( response . Serialize ( ) ) ; <nl> class IHOSBinderDriver final : public ServiceFramework < IHOSBinderDriver > { <nl> IGBPQueryResponseParcel response { value } ; <nl> ctx . WriteBuffer ( response . Serialize ( ) ) ; <nl> } else if ( transaction = = TransactionId : : CancelBuffer ) { <nl> - LOG_WARNING ( Service_VI , " ( STUBBED ) called , transaction = CancelBuffer " ) ; <nl> + LOG_CRITICAL ( Service_VI , " ( STUBBED ) called , transaction = CancelBuffer " ) ; <nl> } else { <nl> ASSERT_MSG ( false , " Unimplemented " ) ; <nl> } <nl> mmm a / src / video_core / gpu . h <nl> ppp b / src / video_core / gpu . h <nl> struct FramebufferConfig { <nl> <nl> using TransformFlags = Service : : NVFlinger : : BufferQueue : : BufferTransformFlags ; <nl> TransformFlags transform_flags ; <nl> + MathUtil : : Rectangle < int > crop_rect ; <nl> } ; <nl> <nl> namespace Engines { <nl> mmm a / src / video_core / renderer_opengl / renderer_opengl . cpp <nl> ppp b / src / video_core / renderer_opengl / renderer_opengl . cpp <nl> void RendererOpenGL : : LoadFBToScreenInfo ( const Tegra : : FramebufferConfig & framebuf <nl> <nl> / / Framebuffer orientation handling <nl> framebuffer_transform_flags = framebuffer . transform_flags ; <nl> + framebuffer_crop_rect = framebuffer . crop_rect ; <nl> <nl> / / Ensure no bad interactions with GL_UNPACK_ALIGNMENT , which by default <nl> / / only allows rows to have a memory alignement of 4 . <nl> void RendererOpenGL : : DrawScreenTriangles ( const ScreenInfo & screen_info , float x , <nl> } <nl> } <nl> <nl> + ASSERT_MSG ( framebuffer_crop_rect . top = = 0 , " Unimplemented " ) ; <nl> + ASSERT_MSG ( framebuffer_crop_rect . left = = 0 , " Unimplemented " ) ; <nl> + <nl> + / / Scale the output by the crop width / height . This is commonly used with 1280x720 rendering <nl> + / / ( e . g . handheld mode ) on a 1920x1080 framebuffer . <nl> + f32 scale_u = 1 . f , scale_v = 1 . f ; <nl> + if ( framebuffer_crop_rect . GetWidth ( ) > 0 ) { <nl> + scale_u = static_cast < f32 > ( framebuffer_crop_rect . GetWidth ( ) ) / screen_info . texture . width ; <nl> + } <nl> + if ( framebuffer_crop_rect . GetHeight ( ) > 0 ) { <nl> + scale_v = static_cast < f32 > ( framebuffer_crop_rect . GetHeight ( ) ) / screen_info . texture . height ; <nl> + } <nl> + <nl> std : : array < ScreenRectVertex , 4 > vertices = { { <nl> - ScreenRectVertex ( x , y , texcoords . top , left ) , <nl> - ScreenRectVertex ( x + w , y , texcoords . bottom , left ) , <nl> - ScreenRectVertex ( x , y + h , texcoords . top , right ) , <nl> - ScreenRectVertex ( x + w , y + h , texcoords . bottom , right ) , <nl> + ScreenRectVertex ( x , y , texcoords . top * scale_u , left * scale_v ) , <nl> + ScreenRectVertex ( x + w , y , texcoords . bottom * scale_u , left * scale_v ) , <nl> + ScreenRectVertex ( x , y + h , texcoords . top * scale_u , right * scale_v ) , <nl> + ScreenRectVertex ( x + w , y + h , texcoords . bottom * scale_u , right * scale_v ) , <nl> } } ; <nl> <nl> state . texture_units [ 0 ] . texture_2d = screen_info . display_texture ; <nl> mmm a / src / video_core / renderer_opengl / renderer_opengl . h <nl> ppp b / src / video_core / renderer_opengl / renderer_opengl . h <nl> class RendererOpenGL : public RendererBase { <nl> <nl> / / / Used for transforming the framebuffer orientation <nl> Tegra : : FramebufferConfig : : TransformFlags framebuffer_transform_flags ; <nl> + MathUtil : : Rectangle < int > framebuffer_crop_rect ; <nl> } ; <nl> mmm a / src / yuzu / configuration / config . cpp <nl> ppp b / src / yuzu / configuration / config . cpp <nl> void Config : : ReadValues ( ) { <nl> qt_config - > endGroup ( ) ; <nl> <nl> qt_config - > beginGroup ( " System " ) ; <nl> - Settings : : values . use_docked_mode = qt_config - > value ( " use_docked_mode " , true ) . toBool ( ) ; <nl> + Settings : : values . use_docked_mode = qt_config - > value ( " use_docked_mode " , false ) . toBool ( ) ; <nl> qt_config - > endGroup ( ) ; <nl> <nl> qt_config - > beginGroup ( " Miscellaneous " ) ; <nl> mmm a / src / yuzu_cmd / config . cpp <nl> ppp b / src / yuzu_cmd / config . cpp <nl> void Config : : ReadValues ( ) { <nl> sdl2_config - > GetBoolean ( " Data Storage " , " use_virtual_sd " , true ) ; <nl> <nl> / / System <nl> - Settings : : values . use_docked_mode = sdl2_config - > GetBoolean ( " System " , " use_docked_mode " , true ) ; <nl> + Settings : : values . use_docked_mode = sdl2_config - > GetBoolean ( " System " , " use_docked_mode " , false ) ; <nl> <nl> / / Miscellaneous <nl> Settings : : values . log_filter = sdl2_config - > Get ( " Miscellaneous " , " log_filter " , " * : Trace " ) ; <nl> mmm a / src / yuzu_cmd / default_ini . h <nl> ppp b / src / yuzu_cmd / default_ini . h <nl> use_virtual_sd = <nl> <nl> [ System ] <nl> # Whether the system is docked <nl> - # 1 ( default ) : Yes , 0 : No <nl> + # 1 : Yes , 0 ( default ) : No <nl> use_docked_mode = <nl> <nl> # The system region that yuzu will use during emulation <nl> | Merge pull request from bunnei / crop - fb | yuzu-emu/yuzu | 7c3cc0895791fff03122386d25cce8d3cfdecd91 | 2018-07-18T04:26:35Z |
mmm a / xbmc / cores / dvdplayer / DVDCodecs / Overlay / DVDOverlayCodecFFmpeg . cpp <nl> ppp b / xbmc / cores / dvdplayer / DVDCodecs / Overlay / DVDOverlayCodecFFmpeg . cpp <nl> bool CDVDOverlayCodecFFmpeg : : Open ( CDVDStreamInfo & hints , CDVDCodecOptions & optio <nl> m_pCodecContext - > workaround_bugs = FF_BUG_AUTODETECT ; <nl> m_pCodecContext - > dsp_mask = FF_MM_FORCE | FF_MM_MMX | FF_MM_MMXEXT | FF_MM_SSE ; <nl> m_pCodecContext - > sub_id = hints . identifier ; <nl> + m_pCodecContext - > codec_tag = hints . codec_tag ; <nl> <nl> if ( hints . extradata & & hints . extrasize > 0 ) <nl> { <nl> mmm a / xbmc / cores / dvdplayer / DVDCodecs / Video / DVDVideoCodecFFmpeg . cpp <nl> ppp b / xbmc / cores / dvdplayer / DVDCodecs / Video / DVDVideoCodecFFmpeg . cpp <nl> bool CDVDVideoCodecFFmpeg : : Open ( CDVDStreamInfo & hints , CDVDCodecOptions & options <nl> m_pCodecContext - > debug = 0 ; <nl> m_pCodecContext - > workaround_bugs = FF_BUG_AUTODETECT ; <nl> m_pCodecContext - > get_format = GetFormat ; <nl> + m_pCodecContext - > codec_tag = hints . codec_tag ; <nl> <nl> if ( pCodec - > id ! = CODEC_ID_H264 & & pCodec - > id ! = CODEC_ID_VP8 & & pCodec - > capabilities & CODEC_CAP_DR1 ) <nl> m_pCodecContext - > flags | = CODEC_FLAG_EMU_EDGE ; <nl> mmm a / xbmc / cores / dvdplayer / DVDStreamInfo . cpp <nl> ppp b / xbmc / cores / dvdplayer / DVDStreamInfo . cpp <nl> void CDVDStreamInfo : : Clear ( ) <nl> codec = CODEC_ID_NONE ; <nl> type = STREAM_NONE ; <nl> software = false ; <nl> + codec_tag = 0 ; <nl> <nl> if ( extradata & & extrasize ) free ( extradata ) ; <nl> <nl> void CDVDStreamInfo : : Clear ( ) <nl> <nl> bool CDVDStreamInfo : : Equal ( const CDVDStreamInfo & right , bool withextradata ) <nl> { <nl> - if ( codec ! = right . codec <nl> - | | type ! = right . type ) return false ; <nl> + if ( codec ! = right . codec <nl> + | | type ! = right . type <nl> + | | codec_tag ! = right . codec_tag ) <nl> + return false ; <nl> <nl> if ( withextradata ) <nl> { <nl> void CDVDStreamInfo : : Assign ( const CDVDStreamInfo & right , bool withextradata ) <nl> { <nl> codec = right . codec ; <nl> type = right . type ; <nl> + codec_tag = right . codec_tag ; <nl> <nl> if ( extradata & & extrasize ) free ( extradata ) ; <nl> <nl> void CDVDStreamInfo : : Assign ( const CDemuxStream & right , bool withextradata ) <nl> <nl> codec = right . codec ; <nl> type = right . type ; <nl> + codec_tag = right . codec_fourcc ; <nl> <nl> if ( withextradata & & right . ExtraSize ) <nl> { <nl> mmm a / xbmc / cores / dvdplayer / DVDStreamInfo . h <nl> ppp b / xbmc / cores / dvdplayer / DVDStreamInfo . h <nl> class CDVDStreamInfo <nl> / / CODEC EXTRADATA <nl> void * extradata ; / / extra data for codec to use <nl> unsigned int extrasize ; / / size of extra data <nl> + unsigned int codec_tag ; / / extra identifier hints for decoding <nl> <nl> bool operator = = ( const CDVDStreamInfo & right ) { return Equal ( right , true ) ; } <nl> bool operator ! = ( const CDVDStreamInfo & right ) { return ! Equal ( right , true ) ; } <nl> | changed : added codec_tag must be passed along from demuxer to decoder , lavc uses it to enable certain codec workarounds | xbmc/xbmc | eefc9db1fedb970b81efcacfd63a537eee595acb | 2010-07-13T19:54:21Z |
mmm a / taichi / codegen / codegen_llvm . h <nl> ppp b / taichi / codegen / codegen_llvm . h <nl> class CodeGenLLVM : public IRVisitor , public ModuleBuilder { <nl> } else { <nl> std : : vector < Value * > args ; <nl> args . emplace_back ( get_runtime ( ) ) ; <nl> + args . emplace_back ( stmt - > cond - > value ) ; <nl> args . emplace_back ( builder - > CreateGlobalStringPtr ( stmt - > text ) ) ; <nl> for ( auto arg : stmt - > args ) { <nl> TI_ASSERT ( arg - > value ) ; <nl> mmm a / taichi / runtime / llvm / runtime . cpp <nl> ppp b / taichi / runtime / llvm / runtime . cpp <nl> void taichi_assert ( Context * context , i32 test , const char * msg ) { <nl> <nl> const std : : size_t ASSERT_MSG_BUFFER_SIZE = 2048 ; <nl> char assert_msg_buffer [ ASSERT_MSG_BUFFER_SIZE ] ; <nl> - char * get_assert_msg ( LLVMRuntime * runtime , const char * format , . . . ) { <nl> + const char * get_assert_msg ( LLVMRuntime * runtime , int cond , const char * format , . . . ) { <nl> + if ( cond ) <nl> + return " " ; <nl> std : : va_list args ; <nl> va_start ( args , format ) ; <nl> runtime - > host_vsnprintf ( assert_msg_buffer , ASSERT_MSG_BUFFER_SIZE , format , args ) ; <nl> | Avoid error message formatting for valid accesses ( ) | taichi-dev/taichi | 3a4229c68e16d6022cc2b7582ab1afa6d52251aa | 2020-03-11T04:18:27Z |
mmm a / PowerEditor / installer / nppSetup . nsi <nl> ppp b / PowerEditor / installer / nppSetup . nsi <nl> <nl> <nl> ; Define the application name <nl> ! define APPNAME " Notepad + + " <nl> - ! define APPVERSION " 5 . 5 " <nl> - ! define APPNAMEANDVERSION " Notepad + + v5 . 5 . 1 " <nl> + ! define APPVERSION " 5 . 5 . 2 " <nl> + ! define APPNAMEANDVERSION " Notepad + + v5 . 5 . 2 " <nl> ! define APPWEBSITE " http : / / notepad - plus . sourceforge . net / " <nl> <nl> ! define VERSION_MAJOR 5 <nl> - ! define VERSION_MINOR 51 <nl> + ! define VERSION_MINOR 52 <nl> <nl> ; Main Install settings <nl> Name " $ { APPNAMEANDVERSION } " <nl> InstallDir " $ PROGRAMFILES \ Notepad + + " <nl> InstallDirRegKey HKLM " Software \ $ { APPNAME } " " " <nl> - OutFile " . . \ bin \ npp . 5 . 5 . 1 . Installer . exe " <nl> + OutFile " . . \ bin \ npp . 5 . 5 . 2 . Installer . exe " <nl> <nl> ; GetWindowsVersion <nl> ; <nl> mmm a / PowerEditor / src / ScitillaComponent / ScintillaEditView . cpp <nl> ppp b / PowerEditor / src / ScitillaComponent / ScintillaEditView . cpp <nl> void ScintillaEditView : : setCppLexer ( LangType langType ) <nl> const TCHAR * lexerName = ScintillaEditView : : langNames [ langType ] . lexerName ; <nl> <nl> execute ( SCI_SETLEXER , SCLEX_CPP ) ; <nl> - / * <nl> - if ( isCJK ( ) ) <nl> - { <nl> - int charSet = codepage2CharSet ( ) ; <nl> - if ( charSet ) <nl> - execute ( SCI_STYLESETCHARACTERSET , SCE_C_STRING , charSet ) ; <nl> - } <nl> - * / <nl> <nl> if ( ( langType ! = L_RC ) & & ( langType ! = L_JS ) ) <nl> { <nl> mmm a / PowerEditor / src / langs . model . xml <nl> ppp b / PowerEditor / src / langs . model . xml <nl> <nl> < Keywords name = " instre1 " > add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_subdirectory add_test aux_source_directory build_command build_name cmake_minimum_required configure_file create_test_sourcelist else elseif enable_language enable_testing endforeach endif endmacro endwhile exec_program execute_process export_library_dependencies file find_file find_library find_package find_path find_program fltk_wrap_ui foreach get_cmake_property get_directory_property get_filename_component get_source_file_property get_target_property get_test_property if include include_directories include_external_msproject include_regular_expression install install_files install_programs install_targets link_directories link_libraries list load_cache load_command macro make_directory mark_as_advanced math message option output_required_files project qt_wrap_cpp qt_wrap_ui remove remove_definitions separate_arguments set set_directory_properties set_source_files_properties set_target_properties set_tests_properties site_name source_group string subdir_depends subdirs target_link_libraries try_compile try_run use_mangled_mesa utility_source variable_requires vtk_make_instantiator vtk_wrap_java vtk_wrap_python vtk_wrap_tcl while write_file < / Keywords > <nl> < Keywords name = " type1 " > ABSOLUTE ABSTRACT ADDITIONAL_MAKE_CLEAN_FILES ALL AND APPEND ARGS ASCII BEFORE CACHE CACHE_VARIABLES CLEAR COMMAND COMMANDS COMMAND_NAME COMMENT COMPARE COMPILE_FLAGS COPYONLY DEFINED DEFINE_SYMBOL DEPENDS DOC EQUAL ESCAPE_QUOTES EXCLUDE EXCLUDE_FROM_ALL EXISTS EXPORT_MACRO EXT EXTRA_INCLUDE FATAL_ERROR FILE FILES FORCE FUNCTION GENERATED GLOB GLOB_RECURSE GREATER GROUP_SIZE HEADER_FILE_ONLY HEADER_LOCATION IMMEDIATE INCLUDES INCLUDE_DIRECTORIES INCLUDE_INTERNALS INCLUDE_REGULAR_EXPRESSION LESS LINK_DIRECTORIES LINK_FLAGS LOCATION MACOSX_BUNDLE MACROS MAIN_DEPENDENCY MAKE_DIRECTORY MATCH MATCHALL MATCHES MODULE NAME NAME_WE NOT NOTEQUAL NO_SYSTEM_PATH OBJECT_DEPENDS OPTIONAL OR OUTPUT OUTPUT_VARIABLE PATH PATHS POST_BUILD POST_INSTALL_SCRIPT PREFIX PREORDER PRE_BUILD PRE_INSTALL_SCRIPT PRE_LINK PROGRAM PROGRAM_ARGS PROPERTIES QUIET RANGE READ REGEX REGULAR_EXPRESSION REPLACE REQUIRED RETURN_VALUE RUNTIME_DIRECTORY SEND_ERROR SHARED SOURCES STATIC STATUS STREQUAL STRGREATER STRLESS SUFFIX TARGET TOLOWER TOUPPER VAR VARIABLES VERSION WIN32 WRAP_EXCLUDE WRITE APPLE MINGW MSYS CYGWIN BORLAND WATCOM MSVC MSVC_IDE MSVC60 MSVC70 MSVC71 MSVC80 CMAKE_COMPILER_2005 OFF ON < / Keywords > <nl> < Keywords name = " type2 " > < / Keywords > <nl> + < / Language > <nl> + < Language name = " cobol " ext = " cbl cbd cdb cdc cob " commentLine = " * " > <nl> + < Keywords name = " instre1 " > configuration data declaratives division environment environment - division file file - control function i - o i - o - control identification input input - output linkage local - storage output procedure program program - id section special - names working - storage < / Keywords > <nl> + < Keywords name = " instre2 " > accept add alter apply assign call chain close compute continue control convert count delete display divide draw drop eject else enable end - accept end - add end - call end - chain end - compute end - delete end - display end - divide end - evaluate end - if end - invoke end - multiply end - perform end - read end - receive end - return end - rewrite end - search end - start end - string end - subtract end - unstring end - write erase evaluate examine exec execute exit go goback generate if ignore initialize initiate insert inspect invoke leave merge move multiply open otherwise perform print read receive release reload replace report reread rerun reserve reset return rewind rewrite rollback run search seek select send set sort start stop store string subtract sum suppress terminate then transform unlock unstring update use wait when wrap write < / Keywords > <nl> + < Keywords name = " type1 " > access acquire actual address advancing after all allowing alphabet alphabetic alphabetic - lower alphabetic - upper alphanumeric alphanumeric - edited also alternate and any are area areas as ascending at attribute author auto auto - hyphen - skip auto - skip automatic autoterminate background - color background - colour backward basis beep before beginning bell binary blank blink blinking block bold bottom box boxed by c01 c02 c03 c04 c05 c06 c07 c08 c09 c10 c11 c12 cancel cbl cd centered cf ch chaining changed character characters chart class clock - units cobol code code - set col collating color colour column com - reg comma command - line commit commitment common communication comp comp - 0 comp - 1 comp - 2 comp - 3 comp - 4 comp - 5 comp - 6 comp - x compression computational computational - 1 computational - 2 computational - 3 computational - 4 computational - 5 computational - 6 computational - x computational console contains content control - area controls conversion converting core - index corr corresponding crt crt - under csp currency current - date cursor cycle cyl - index cyl - overflow date date - compiled date - written day day - of - week dbcs de debug debug - contents debug - item debug - line debug - name debug - sub - 1 debug - sub - 2 debug - sub - 3 debugging decimal - point default delimited delimiter depending descending destination detail disable disk disp display - 1 display - st down duplicates dynamic echo egcs egi emi empty - check encryption end end - of - page ending enter entry eol eop eos equal equals error escape esi every exceeds exception excess - 3 exclusive exhibit extend extended - search external externally - described - key factory false fd fh - - fcd fh - - keydef file - id file - limit file - limits file - prefix filler final first fixed footing for foreground - color foreground - colour footing format from full giving global greater grid group heading high high - value high - values highlight id in index indexed indic indicate indicator indicators inheriting initial installation into invalid invoked is japanese just justified kanji kept key keyboard label last leading left left - justify leftline length length - check less limit limits lin linage linage - counter line line - counter lines lock lock - holding locking low low - value low - values lower lowlight manual mass - update master - index memory message method mode modified modules more - labels multiple name named national national - edited native nchar negative next no no - echo nominal not note nstd - reels null nulls number numeric numeric - edited numeric - fill o - fill object object - computer object - storage occurs of off omitted on oostackptr optional or order organization other others overflow overline packed - decimal padding page page - counter packed - decimal paragraph password pf ph pic picture plus pointer pop - up pos position positioning positive previous print - control print - switch printer printer - 1 printing prior private procedure - pointer procedures proceed process processing prompt protected public purge queue quote quotes random range rd readers ready record record - overflow recording records redefines reel reference references relative remainder remarks removal renames reorg - criteria repeated replacing reporting reports required resident return - code returning reverse reverse - video reversed rf rh right right - justify rolling rounded s01 s02 s03 s04 s05 same screen scroll sd secure security segment segment - limit selective self selfclass sentence separate sequence sequential service setshadow shift - in shift - out sign size skip1 skip2 skip3 sort - control sort - core - size sort - file - size sort - merge sort - message sort - mode - size sort - option sort - return source source - computer space spaces space - fill spaces standard standard - 1 standard - 2 starting status sub - queue - 1 sub - queue - 2 sub - queue - 3 subfile super symbolic sync synchronized sysin sysipt syslst sysout syspch syspunch system - info tab tallying tape terminal terminal - info test text than through thru time time - of - day time - out timeout times title to top totaled totaling trace track - area track - limit tracks trailing trailing - sign transaction true type typedef underline underlined unequal unit until up updaters upon upper upsi - 0 upsi - 1 upsi - 2 upsi - 3 upsi - 4 upsi - 5 upsi - 6 upsi - 7 usage user using value values variable varying when - compiled window with words write - only write - verify writerszero zero zero - fill zeros zeroes < / Keywords > <nl> < / Language > <nl> < Language name = " cpp " ext = " h hpp hxx cpp cxx cc " commentLine = " / / " commentStart = " / * " commentEnd = " * / " > <nl> < Keywords name = " instre1 " > if else switch case default break goto return for while do continue typedef sizeof NULL new delete throw try catch namespace operator this const_cast static_cast dynamic_cast reinterpret_cast true false using typeid and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq < / Keywords > <nl> <nl> < Language name = " css " ext = " css " commentStart = " / * " commentEnd = " * / " > <nl> < Keywords name = " instre1 " > azimuth background background - attachment background - color background - image background - position background - repeat border border - bottom border - bottom - color border - bottom - style border - bottom - width border - collapse border - color border - left border - left - color border - left - style border - left - width border - right border - right - color border - right - style border - right - width border - spacing border - style border - top border - top - color border - top - style border - top - width border - width bottom caption - side clear clip color content counter - increment counter - reset cue cue - after cue - before cursor direction display elevation empty - cells float font font - family font - size font - size - adjust font - stretch font - style font - variant font - weight height left letter - spacing line - height list - style list - style - image list - style - position list - style - type margin margin - bottom margin - left margin - right margin - top marker - offset marks max - height max - width min - height min - width orphans outline outline - color outline - style outline - width overflow padding padding - bottom padding - left padding - right padding - top page page - break - after page - break - before page - break - inside pause pause - after pause - before pitch pitch - range play - during position quotes richness right size speak speak - header speak - numeral speak - ponctuation speech - rate stress table - layout text - align text - decoration text - indent text - shadow text - transform top unicode - bidi vertical - align visibility voice - family volume white - space widows width word - spacing z - index < / Keywords > <nl> < Keywords name = " instre2 " > active after before first first - child first - letter first - line focus hover lang left link right visited < / Keywords > <nl> + < / Language > <nl> + < Language name = " d " ext = " d " commentLine = " / / " commentStart = " / * " commentEnd = " * / " > <nl> + < Keywords name = " instre1 " > abstract alias align asm assert auto body bool break byte case cast catch cdouble cent cfloat char class const continue creal dchar debug default delegate delete deprecated do double else enum export extern false final finally float for foreach foreach_reverse function goto idouble if ifloat import in inout int interface invariant ireal is lazy long mixin module new null out override package pragma private protected public real return scope short static struct super switch synchronized template this throw true try typedef typeid typeof ubyte ucent uint ulong union unittest ushort version void volatile wchar while with < / Keywords > <nl> + < Keywords name = " instre2 " > < / Keywords > <nl> < / Language > <nl> < Language name = " diff " ext = " diff patch " > <nl> < / Language > <nl> <nl> < Keywords name = " type1 " > cliprestore clipsave composefont currentsmoothness findcolorrendering setsmoothness shfill < / Keywords > <nl> < Keywords name = " type2 " > . begintransparencygroup . begintransparencymask . bytestring . charboxpath . currentaccuratecurves . currentblendmode . currentcurvejoin . currentdashadapt . currentdotlength . currentfilladjust2 . currentlimitclamp . currentopacityalpha . currentoverprintmode . currentrasterop . currentshapealpha . currentsourcetransparent . currenttextknockout . currenttexturetransparent . dashpath . dicttomark . discardtransparencygroup . discardtransparencymask . endtransparencygroup . endtransparencymask . execn . filename . filename . fileposition . forceput . forceundef . forgetsave . getbitsrect . getdevice . inittransparencymask . knownget . locksafe . makeoperator . namestring . oserrno . oserrorstring . peekstring . rectappend . runandhide . setaccuratecurves . setblendmode . setcurvejoin . setdashadapt . setdebug . setdefaultmatrix . setdotlength . setfilladjust2 . setlimitclamp . setmaxlength . setopacityalpha . setoverprintmode . setrasterop . setsafe . setshapealpha . setsourcetransparent . settextknockout . settexturetransparent . stringbreak . stringmatch . tempfile . type1decrypt . type1encrypt . type1execchar . unread arccos arcsin copydevice copyscanlines currentdevice finddevice findlibfile findprotodevice flushpage getdeviceprops getenv makeimagedevice makewordimagedevice max min putdeviceprops setdevice < / Keywords > <nl> < / Language > <nl> + < Language name = " powershell " ext = " ps1 " commentLine = " # " > <nl> + < Keywords name = " instre1 " > break continue do else elseif filter for foreach function if in return switch until where while < / Keywords > <nl> + < Keywords name = " instre2 " > add - content add - history add - member add - pssnapin clear - content clear - item clear - itemproperty clear - variable compare - object convertfrom - securestring convert - path convertto - html convertto - securestring copy - item copy - itemproperty export - alias export - clixml export - console export - csv foreach - object format - custom format - list format - table format - wide get - acl get - alias get - authenticodesignature get - childitem get - command get - content get - credential get - culture get - date get - eventlog get - executionpolicy get - help get - history get - host get - item get - itemproperty get - location get - member get - pfxcertificate get - process get - psdrive get - psprovider get - pssnapin get - service get - tracesource get - uiculture get - unique get - variable get - wmiobject group - object import - alias import - clixml import - csv invoke - expression invoke - history invoke - item join - path measure - command measure - object move - item move - itemproperty new - alias new - item new - itemproperty new - object new - psdrive new - service new - timespan new - variable out - default out - file out - host out - null out - printer out - string pop - location push - location read - host remove - item remove - itemproperty remove - psdrive remove - pssnapin remove - variable rename - item rename - itemproperty resolve - path restart - service resume - service select - object select - string set - acl set - alias set - authenticodesignature set - content set - date set - executionpolicy set - item set - itemproperty set - location set - psdebug set - service set - tracesource set - variable sort - object split - path start - service start - sleep start - transcript stop - process stop - service stop - transcript suspend - service tee - object test - path trace - command update - formatdata update - typedata where - object write - debug write - error write - host write - output write - progress write - verbose write - warning < / Keywords > <nl> + < Keywords name = " type1 " > ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl foreach ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp spps spsv sv tee where write cat cd clear cp h history kill lp ls mount mv popd ps pushd pwd r rm rmdir echo cls chdir copy del dir erase move rd ren set type < / Keywords > <nl> + < / Language > <nl> < Language name = " props " ext = " properties " commentLine = " ; " > <nl> < / Language > <nl> < Language name = " python " ext = " py pyw " commentLine = " # " > <nl> < Keywords name = " instre1 " > and as assert break class continue def del elif else except exec finally for from global if import in is lambda None not or pass print raise return triple try while with yield < / Keywords > <nl> < / Language > <nl> + < Language name = " r " ext = " r " commentLine = " # " > <nl> + < Keywords name = " instre1 " > if else repeat while function for in next break TRUE FALSE NULL NA Inf NaN < / Keywords > <nl> + < Keywords name = " instre2 " > abbreviate abline abs acf acos acosh addmargins aggregate agrep alarm alias alist all anova any aov aperm append apply approx approxfun apropos ar args arima array arrows asin asinh assign assocplot atan atanh attach attr attributes autoload autoloader ave axis backsolve barplot basename beta bindtextdomain binomial biplot bitmap bmp body box boxplot bquote break browser builtins bxp by bzfile c call cancor capabilities casefold cat category cbind ccf ceiling character charmatch chartr chol choose chull citation class close cm cmdscale codes coef coefficients col colnames colors colorspaces colours comment complex confint conflicts contour contrasts contributors convolve cophenetic coplot cor cos cosh cov covratio cpgram crossprod cummax cummin cumprod cumsum curve cut cutree cycle data dataentry date dbeta dbinom dcauchy dchisq de debug debugger decompose delay deltat demo dendrapply density deparse deriv det detach determinant deviance dexp df dfbeta dfbetas dffits dgamma dgeom dget dhyper diag diff diffinv difftime digamma dim dimnames dir dirname dist dlnorm dlogis dmultinom dnbinom dnorm dotchart double dpois dput drop dsignrank dt dump dunif duplicated dweibull dwilcox eapply ecdf edit effects eigen emacs embed end environment eval evalq example exists exp expression factanal factor factorial family fft fifo file filter find fitted fivenum fix floor flush for force formals format formula forwardsolve fourfoldplot frame frequency ftable function gamma gaussian gc gcinfo gctorture get getenv geterrmessage gettext gettextf getwd gl glm globalenv gray grep grey grid gsub gzcon gzfile hat hatvalues hcl hclust head heatmap help hist history hsv httpclient iconv iconvlist identical identify if ifelse image influence inherits integer integrate interaction interactive intersect invisible isoreg jitter jpeg julian kappa kernapply kernel kmeans knots kronecker ksmooth labels lag lapply layout lbeta lchoose lcm legend length letters levels lfactorial lgamma library licence license line lines list lm load loadhistory loadings local locator loess log logb logical loglin lowess ls lsfit machine mad mahalanobis makepredictcall manova mapply match matlines matplot matpoints matrix max mean median medpolish menu merge message methods mget min missing mode monthplot months mosaicplot mtext mvfft names napredict naprint naresid nargs nchar ncol next nextn ngettext nlevels nlm nls noquote nrow numeric objects offset open optim optimise optimize options order ordered outer pacf page pairlist pairs palette par parse paste pbeta pbinom pbirthday pcauchy pchisq pdf pentagamma person persp pexp pf pgamma pgeom phyper pi pico pictex pie piechart pipe plclust plnorm plogis plot pmatch pmax pmin pnbinom png pnorm points poisson poly polygon polym polyroot postscript power ppoints ppois ppr prcomp predict preplot pretty princomp print prmatrix prod profile profiler proj promax prompt provide psigamma psignrank pt ptukey punif pweibull pwilcox q qbeta qbinom qbirthday qcauchy qchisq qexp qf qgamma qgeom qhyper qlnorm qlogis qnbinom qnorm qpois qqline qqnorm qqplot qr qsignrank qt qtukey quantile quarters quasi quasibinomial quasipoisson quit qunif quote qweibull qwilcox rainbow range rank raw rbeta rbind rbinom rcauchy rchisq readline real recover rect reformulate regexpr relevel remove reorder rep repeat replace replicate replications require reshape resid residuals restart return rev rexp rf rgamma rgb rgeom rhyper rle rlnorm rlogis rm rmultinom rnbinom rnorm round row rownames rowsum rpois rsignrank rstandard rstudent rt rug runif runmed rweibull rwilcox sample sapply save savehistory scale scan screen screeplot sd search searchpaths seek segments seq sequence serialize setdiff setequal setwd shell sign signif sin single sinh sink smooth solve sort source spectrum spline splinefun split sprintf sqrt stack stars start stderr stdin stdout stem step stepfun stl stop stopifnot str strftime strheight stripchart strptime strsplit strtrim structure strwidth strwrap sub subset substitute substr substring sum summary sunflowerplot supsmu svd sweep switch symbols symnum system t table tabulate tail tan tanh tapply tempdir tempfile termplot terms tetragamma text time title toeplitz tolower topenv toupper trace traceback transform trigamma trunc truncate try ts tsdiag tsp typeof unclass undebug union unique uniroot unix unlink unlist unname unserialize unsplit unstack untrace unz update upgrade url var varimax vcov vector version vi vignette warning warnings weekdays weights which while window windows with write wsbrowser xedit xemacs xfig xinch xor xtabs xyinch yinch zapsmall < / Keywords > <nl> + < Keywords name = " type1 " > acme aids aircondit amis aml banking barchart barley beaver bigcity boot brambles breslow bs bwplot calcium cane capability cav censboot channing city claridge cloth cloud coal condense contourplot control corr darwin densityplot dogs dotplot ducks empinf envelope environmental ethanol fir frets gpar grav gravity grob hirose histogram islay knn larrows levelplot llines logit lpoints lsegments lset ltext lvqinit lvqtest manaus melanoma melanoma motor multiedit neuro nitrofen nodal ns nuclear oneway parallel paulsen poisons polar qq qqmath remission rfs saddle salinity shingle simplex singer somgrid splom stripplot survival tau tmd tsboot tuna unit urine viewport wireframe wool xyplot < / Keywords > <nl> + < / Language > <nl> < Language name = " rc " ext = " rc " commentLine = " / / " commentStart = " / * " commentEnd = " * / " > <nl> < Keywords name = " instre1 " > ACCELERATORS ALT AUTO3STATE AUTOCHECKBOX AUTORADIOBUTTON BEGIN BITMAP BLOCK BUTTON CAPTION CHARACTERISTICS CHECKBOX CLASS COMBOBOX CONTROL CTEXT CURSOR DEFPUSHBUTTON DIALOG DIALOGEX DISCARDABLE EDITTEXT END EXSTYLE FONT GROUPBOX ICON LANGUAGE LISTBOX LTEXT MENU MENUEX MENUITEM MESSAGETABLE POPUP PUSHBUTTON RADIOBUTTON RCDATA RTEXT SCROLLBAR SEPARATOR SHIFT STATE3 STRINGTABLE STYLE TEXTINCLUDE VALUE VERSION VERSIONINFO VIRTKEY < / Keywords > <nl> < / Language > <nl> mmm a / PowerEditor / src / resource . h <nl> ppp b / PowerEditor / src / resource . h <nl> <nl> # ifndef RESOURCE_H <nl> # define RESOURCE_H <nl> <nl> - # define NOTEPAD_PLUS_VERSION TEXT ( " Notepad + + v5 . 5 . 1 " ) <nl> - # define VERSION_VALUE TEXT ( " 5 . 5 . 1 \ 0 " ) / / should be X . Y : ie . if VERSION_DIGITALVALUE = = 4 , 7 , 1 , 0 , then X = 4 , Y = 71 <nl> - # define VERSION_DIGITALVALUE 5 , 5 , 1 , 0 <nl> + # define NOTEPAD_PLUS_VERSION TEXT ( " Notepad + + v5 . 5 . 2 " ) <nl> + # define VERSION_VALUE TEXT ( " 5 . 5 . 2 \ 0 " ) / / should be X . Y : ie . if VERSION_DIGITALVALUE = = 4 , 7 , 1 , 0 , then X = 4 , Y = 71 <nl> + # define VERSION_DIGITALVALUE 5 , 5 , 2 , 0 <nl> <nl> # ifdef UNICODE <nl> # define UNICODE_ANSI_MODE TEXT ( " ( UNICODE ) " ) <nl> mmm a / PowerEditor / src / stylers . model . xml <nl> ppp b / PowerEditor / src / stylers . model . xml <nl> <nl> < WordsStyle name = " NUMBER " styleID = " 3 " fgColor = " FF8000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " DELIMITER " styleID = " 4 " fgColor = " FF8080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> < WordsStyle name = " CHARACTER " styleID = " 5 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> - < WordsStyle name = " CHARACTER EOL " styleID = " 6 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " STRING " styleID = " 7 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> - < WordsStyle name = " STRING EOL " styleID = " 8 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " LABEL " styleID = " 9 " fgColor = " 804000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> < WordsStyle name = " COMMENT LINE " styleID = " 10 " fgColor = " 008000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " ILLEGAL " styleID = " 11 " fgColor = " FF0000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> <nl> < WordsStyle name = " NUMBER " styleID = " 83 " fgColor = " FF0000 " bgColor = " C4F9FD " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " WORD " styleID = " 84 " fgColor = " 000080 " bgColor = " C4F9FD " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " instre1 " / > <nl> < WordsStyle name = " STRING " styleID = " 85 " fgColor = " 808080 " bgColor = " C4F9FD " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> - < WordsStyle name = " STRINGEOL " styleID = " 87 " fgColor = " 808080 " bgColor = " C4F9FD " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " IDENTIFIER " styleID = " 86 " fgColor = " 000000 " bgColor = " C4F9FD " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " ASPSYBOL " styleID = " 15 " fgColor = " 000000 " bgColor = " FFFF00 " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> < WordsStyle name = " SCRIPTTYPE " styleID = " 16 " fgColor = " 000000 " bgColor = " FFC000 " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> <nl> < WordsStyle name = " DIRECTIVE OPERAND " styleID = " 10 " fgColor = " 000080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " type3 " / > <nl> < WordsStyle name = " COMMENT BLOCK " styleID = " 11 " fgColor = " 008000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " CHARACTER " styleID = " 12 " fgColor = " 808000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> - < WordsStyle name = " STRINGEOL " styleID = " 13 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " EXT INSTRUCTION " styleID = " 14 " fgColor = " 804000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " type4 " / > <nl> < / LexerType > <nl> < LexerType name = " autoit " desc = " autoIt " ext = " " > <nl> <nl> < WordsStyle name = " ID " styleID = " 10 " fgColor = " 0080FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> < WordsStyle name = " IMPORTANT " styleID = " 11 " fgColor = " FF0000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> < WordsStyle name = " DIRECTIVE " styleID = " 12 " fgColor = " 0080FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < / LexerType > <nl> + < LexerType name = " cobol " desc = " COBOL " ext = " " > <nl> + < WordsStyle name = " PREPROCESSOR " styleID = " 9 " fgColor = " 804000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " DEFAULT " styleID = " 11 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " DECLARATION " styleID = " 5 " fgColor = " 8000FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " instre1 " / > <nl> + < WordsStyle name = " INSTRUCTION WORD " styleID = " 16 " fgColor = " 0000FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " instre2 " / > <nl> + < WordsStyle name = " KEYWORD " styleID = " 8 " fgColor = " 0080FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " keywordClass = " type1 " / > <nl> + < WordsStyle name = " NUMBER " styleID = " 4 " fgColor = " FF8000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " STRING " styleID = " 6 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " CHARACTER " styleID = " 7 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " OPERATOR " styleID = " 10 " fgColor = " 000080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> + < WordsStyle name = " COMMENT " styleID = " 1 " fgColor = " 008000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " COMMENT LINE " styleID = " 2 " fgColor = " 008000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " COMMENT DOC " styleID = " 3 " fgColor = " 008080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " COMMENT LINE DOC " styleID = " 15 " fgColor = " 008080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " COMMENT DOC KEYWORD " styleID = " 17 " fgColor = " 008080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> + < WordsStyle name = " COMMENT DOC KEYWORD ERROR " styleID = " 18 " fgColor = " 008080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < / LexerType > <nl> + < LexerType name = " d " desc = " D " ext = " " > <nl> + < WordsStyle name = " DEFAULT " styleID = " 0 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " IDENTIFIER " styleID = " 14 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " INSTRUCTION WORD " styleID = " 6 " fgColor = " 0000FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " instre1 " / > <nl> + < WordsStyle name = " KEWORD1 " styleID = " 7 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " keywordClass = " instre2 " / > <nl> + < WordsStyle name = " KEWORD2 " styleID = " 8 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " keywordClass = " type1 " / > <nl> + < WordsStyle name = " KEWORD3 " styleID = " 9 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " keywordClass = " type2 " / > <nl> + < WordsStyle name = " KEWORD4 " styleID = " 20 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " keywordClass = " type3 " / > <nl> + < WordsStyle name = " KEWORD5 " styleID = " 21 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " keywordClass = " type4 " / > <nl> + < WordsStyle name = " KEWORD6 " styleID = " 22 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " keywordClass = " type5 " / > <nl> + < WordsStyle name = " NUMBER " styleID = " 5 " fgColor = " FF8000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " STRING " styleID = " 10 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " CHARACTER " styleID = " 12 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " OPERATOR " styleID = " 13 " fgColor = " 000080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> + < WordsStyle name = " COMMENT " styleID = " 1 " fgColor = " 008000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " COMMENT LINE " styleID = " 2 " fgColor = " 008000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " COMMENT DOC " styleID = " 3 " fgColor = " 008080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " COMMENT NESTED " styleID = " 4 " fgColor = " 008080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " COMMENT LINE DOC " styleID = " 15 " fgColor = " 008080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " COMMENT DOC KEYWORD " styleID = " 16 " fgColor = " 008080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> + < WordsStyle name = " COMMENT DOC KEYWORD ERROR " styleID = " 17 " fgColor = " 008080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < / LexerType > <nl> < LexerType name = " diff " desc = " DIFF " ext = " " > <nl> < WordsStyle name = " DEFAULT " styleID = " 0 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> <nl> < WordsStyle name = " NUMBER " styleID = " 2 " fgColor = " FF8000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " STRING " styleID = " 3 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " STRING2 " styleID = " 4 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> - < WordsStyle name = " STRINGEOL " styleID = " 5 " fgColor = " 808040 " bgColor = " FFFFFF " fontName = " " fontStyle = " 2 " fontSize = " " / > <nl> < WordsStyle name = " OPERATOR " styleID = " 6 " fgColor = " 000080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> < WordsStyle name = " IDENTIFIER " styleID = " 7 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " INSTRUCTION WORD " styleID = " 8 " fgColor = " 0000FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " instre1 " / > <nl> <nl> < WordsStyle name = " DOUBLESTRING " styleID = " 48 " fgColor = " 808080 " bgColor = " F2F4FF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " SINGLESTRING " styleID = " 49 " fgColor = " 808080 " bgColor = " F2F4FF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " SYMBOLS " styleID = " 50 " fgColor = " 000000 " bgColor = " F2F4FF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> - < WordsStyle name = " STRINGEOL " styleID = " 51 " fgColor = " 808080 " bgColor = " F2F4FF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> < WordsStyle name = " REGEX " styleID = " 52 " fgColor = " 8000FF " bgColor = " F2F4FF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " COMMENT " styleID = " 42 " fgColor = " 008000 " bgColor = " F2F4FF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " COMMENTLINE " styleID = " 43 " fgColor = " 008000 " bgColor = " F2F4FF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " COMMENTDOC " styleID = " 44 " fgColor = " 008080 " bgColor = " F2F4FF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < / LexerType > <nl> < LexerType name = " kix " desc = " KiXtart " ext = " " > <nl> - < ! - - <nl> - < WordsStyle name = " " styleID = " 0 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> - - - > <nl> < WordsStyle name = " DEFAULT " styleID = " 31 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " COMMENT " styleID = " 1 " fgColor = " 008000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " STRING " styleID = " 2 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> <nl> < WordsStyle name = " FUNCTION WORD " styleID = " 3 " fgColor = " 0000FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " instre1 " / > <nl> < WordsStyle name = " SYMBOL " styleID = " 5 " fgColor = " 000080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> < WordsStyle name = " STRING " styleID = " 6 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> - < WordsStyle name = " STRINGEOL " styleID = " 8 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 2 " fontSize = " " / > <nl> < WordsStyle name = " IDENTIFIER " styleID = " 9 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " OPERATOR " styleID = " 10 " fgColor = " 0080C0 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " type1 " / > <nl> < WordsStyle name = " SPECIAL " styleID = " 11 " fgColor = " 800000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> <nl> < WordsStyle name = " HEX NUMBER " styleID = " 8 " fgColor = " FF8000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " INSTRUCTION WORD " styleID = " 9 " fgColor = " 0000FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " instre1 " / > <nl> < WordsStyle name = " STRING " styleID = " 10 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> - < WordsStyle name = " STRING EOL " styleID = " 10 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " CHARACTER " styleID = " 12 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " OPERATOR " styleID = " 13 " fgColor = " 000080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> < WordsStyle name = " ASM " styleID = " 14 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> <nl> < WordsStyle name = " HEX STRING " styleID = " 13 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " BASE85 STRING " styleID = " 14 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " BAD STRING CHAR " styleID = " 15 " fgColor = " 804000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> + < / LexerType > <nl> + < LexerType name = " powershell " desc = " PowerShell " ext = " " > <nl> + < WordsStyle name = " DEFAULT " styleID = " 0 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " COMMENT " styleID = " 1 " fgColor = " 008000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " STRING " styleID = " 2 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " CHARACTER " styleID = " 3 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " NUMBER " styleID = " 4 " fgColor = " FF8000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " VARIABLE " styleID = " 5 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> + < WordsStyle name = " OPERATOR " styleID = " 6 " fgColor = " 000080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> + < WordsStyle name = " INSTRUCTION WORD " styleID = " 8 " fgColor = " 0000FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " instre1 " / > <nl> + < WordsStyle name = " CMDLET " styleID = " 9 " fgColor = " 8000FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " keywordClass = " instre2 " / > <nl> + < WordsStyle name = " ALIAS " styleID = " 10 " fgColor = " 0080FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " keywordClass = " type1 " / > <nl> < / LexerType > <nl> < LexerType name = " props " desc = " Properties file " ext = " " > <nl> < WordsStyle name = " DEFAULT " styleID = " 0 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> <nl> < WordsStyle name = " OPERATOR " styleID = " 10 " fgColor = " 000080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> < WordsStyle name = " IDENTIFIER " styleID = " 11 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " COMMENTBLOCK " styleID = " 12 " fgColor = " 008000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> - < WordsStyle name = " STRINGEOL " styleID = " 12 " fgColor = " FFFF00 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < / LexerType > <nl> + < LexerType name = " r " desc = " R " ext = " " > <nl> + < WordsStyle name = " DEFAULT " styleID = " 0 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " COMMENT " styleID = " 1 " fgColor = " 008000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " INSTRUCTION WORD " styleID = " 2 " fgColor = " 0000FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " instre1 " / > <nl> + < WordsStyle name = " BASE WORD " styleID = " 3 " fgColor = " 8000FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " keywordClass = " instre2 " / > <nl> + < WordsStyle name = " KEYWORD " styleID = " 4 " fgColor = " 0080FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " keywordClass = " type1 " / > <nl> + < WordsStyle name = " NUMBER " styleID = " 5 " fgColor = " FF8000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " STRING " styleID = " 6 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " STRING2 " styleID = " 7 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> + < WordsStyle name = " OPERATOR " styleID = " 8 " fgColor = " 000080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> + < WordsStyle name = " INFIX " styleID = " 10 " fgColor = " 804000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < / LexerType > <nl> < LexerType name = " rc " desc = " RC " ext = " " > <nl> < WordsStyle name = " PREPROCESSOR " styleID = " 9 " fgColor = " 804000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> <nl> < WordsStyle name = " FUNCTION WORD " styleID = " 3 " fgColor = " 0000FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " instre1 " / > <nl> < WordsStyle name = " SYMBOL " styleID = " 5 " fgColor = " 000080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> < WordsStyle name = " STRING " styleID = " 6 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> - < WordsStyle name = " STRINGEOL " styleID = " 8 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 2 " fontSize = " " / > <nl> < WordsStyle name = " IDENTIFIER " styleID = " 9 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " OPERATOR " styleID = " 10 " fgColor = " 0080C0 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " type1 " / > <nl> < WordsStyle name = " SPECIAL " styleID = " 11 " fgColor = " 800000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> <nl> < WordsStyle name = " COMMENT " styleID = " 1 " fgColor = " 008000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " COMMENT LINE " styleID = " 2 " fgColor = " 008000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " COMMENT LINE BANG " styleID = " 3 " fgColor = " 008080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> - < WordsStyle name = " STRING EOL " styleID = " 12 " fgColor = " 808080 " bgColor = " F2F4FF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> < WordsStyle name = " USER " styleID = " 19 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < / LexerType > <nl> < LexerType name = " vhdl " desc = " VHDL " ext = " " > <nl> <nl> < WordsStyle name = " STRING " styleID = " 4 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " OPERATOR " styleID = " 5 " fgColor = " 000080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " / > <nl> < WordsStyle name = " IDENTIFIER " styleID = " 6 " fgColor = " 000000 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> - < WordsStyle name = " STRING EOL " styleID = " 7 " fgColor = " 808080 " bgColor = " FFFFFF " fontName = " " fontStyle = " 0 " fontSize = " " / > <nl> < WordsStyle name = " INSTRUCTION " styleID = " 8 " fgColor = " 0000FF " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " instre1 " / > <nl> < WordsStyle name = " STD OPERATOR " styleID = " 9 " fgColor = " 0080C0 " bgColor = " FFFFFF " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " instre2 " / > <nl> < WordsStyle name = " ATTRIBUTE " styleID = " 10 " fgColor = " 8080FF " bgColor = " FFFFCC " fontName = " " fontStyle = " 1 " fontSize = " " keywordClass = " type1 " / > <nl> | [ NEW ] Add D , R , PowerShell and COBOL keywords and colour settings . | notepad-plus-plus/notepad-plus-plus | 7060444031d46938714269c4317d342b80cafd1b | 2009-11-03T00:22:08Z |
mmm a / src / heap / objects - visiting . h <nl> ppp b / src / heap / objects - visiting . h <nl> class JSWeakCollection ; <nl> V ( JSArrayBuffer ) \ <nl> V ( JSFunction ) \ <nl> V ( JSObject ) \ <nl> - V ( JSRegExp ) \ <nl> V ( JSWeakCollection ) \ <nl> V ( Map ) \ <nl> V ( Oddball ) \ <nl> mmm a / src / objects . cc <nl> ppp b / src / objects . cc <nl> VisitorId Map : : GetVisitorId ( Map * map ) { <nl> case JS_WEAK_SET_TYPE : <nl> return kVisitJSWeakCollection ; <nl> <nl> - case JS_REGEXP_TYPE : <nl> - return kVisitJSRegExp ; <nl> <nl> case SHARED_FUNCTION_INFO_TYPE : <nl> return kVisitSharedFunctionInfo ; <nl> VisitorId Map : : GetVisitorId ( Map * map ) { <nl> case JS_MAP_VALUE_ITERATOR_TYPE : <nl> case JS_STRING_ITERATOR_TYPE : <nl> case JS_PROMISE_TYPE : <nl> + case JS_REGEXP_TYPE : <nl> case WASM_MEMORY_TYPE : <nl> case WASM_MODULE_TYPE : <nl> case WASM_TABLE_TYPE : <nl> mmm a / src / objects / map . h <nl> ppp b / src / objects / map . h <nl> namespace internal { <nl> V ( JSFunction ) \ <nl> V ( JSObject ) \ <nl> V ( JSObjectFast ) \ <nl> - V ( JSRegExp ) \ <nl> V ( JSWeakCollection ) \ <nl> V ( Map ) \ <nl> V ( NativeContext ) \ <nl> | [ heap ] Remove custom visitor for JSRegex . | v8/v8 | 1d2496319eb31d52de16cfef55c84c2e27d691f3 | 2018-03-26T17:03:42Z |
mmm a / modules / videoio / src / cap_msmf . cpp <nl> ppp b / modules / videoio / src / cap_msmf . cpp <nl> CvResult CV_API_CALL cv_writer_open ( const char * filename , int fourcc , double fps <nl> { <nl> wrt = new WriterT ( ) ; <nl> Size sz ( width , height ) ; <nl> - if ( wrt & & wrt - > open ( filename , fourcc , fps , sz , isColor ) ) <nl> + if ( wrt & & wrt - > open ( filename , fourcc , fps , sz , isColor ! = 0 ) ) <nl> { <nl> * handle = ( CvPluginWriter ) wrt ; <nl> return CV_ERROR_OK ; <nl> | videoio ( msmf ) : fix build warning | opencv/opencv | 10d2bcc8a2d1854b1df35d71d72ef05f2896210f | 2020-04-19T19:47:32Z |
mmm a / . github / ISSUE_TEMPLATE / bug_report . md <nl> ppp b / . github / ISSUE_TEMPLATE / bug_report . md <nl> <nl> name : Report a bug <nl> about : Create a report to help us improve <nl> labels : kind / bug , priority / P2 <nl> - assignees : yashykt <nl> + assignees : veblush <nl> <nl> mmm <nl> <nl> mmm a / . github / ISSUE_TEMPLATE / cleanup_request . md <nl> ppp b / . github / ISSUE_TEMPLATE / cleanup_request . md <nl> <nl> name : Request a cleanup <nl> about : Suggest a cleanup in our repository <nl> labels : kind / internal cleanup , priority / P2 <nl> - assignees : yashykt <nl> + assignees : veblush <nl> <nl> mmm <nl> <nl> mmm a / . github / ISSUE_TEMPLATE / feature_request . md <nl> ppp b / . github / ISSUE_TEMPLATE / feature_request . md <nl> <nl> name : Request a feature <nl> about : Suggest an idea for this project <nl> labels : kind / enhancement , priority / P2 <nl> - assignees : yashykt <nl> + assignees : veblush <nl> <nl> mmm <nl> <nl> mmm a / . github / ISSUE_TEMPLATE / question . md <nl> ppp b / . github / ISSUE_TEMPLATE / question . md <nl> <nl> name : Ask a question <nl> about : Ask a question <nl> labels : kind / question , priority / P3 <nl> - assignees : yashykt <nl> + assignees : veblush <nl> <nl> mmm <nl> <nl> mmm a / . github / pull_request_template . md <nl> ppp b / . github / pull_request_template . md <nl> If you know who should review your pull request , please remove the mentioning be <nl> <nl> - - > <nl> <nl> - @ yashykt <nl> + @ veblush <nl> | Merge pull request from yashykt / repomanageresun | grpc/grpc | d18f076b9f7b9322203d96b42dbe6d1dd646540b | 2020-09-29T16:35:54Z |
mmm a / lib / AST / LookupVisibleDecls . cpp <nl> ppp b / lib / AST / LookupVisibleDecls . cpp <nl> static void lookupVisibleMemberDeclsImpl ( <nl> / / The metatype represents an arbitrary named type : dig through to the <nl> / / declared type to see what we ' re dealing with . <nl> Type Ty = MTT - > getInstanceType ( ) ; <nl> + if ( Ty - > is < AnyMetatypeType > ( ) ) <nl> + return ; <nl> <nl> LookupState subLS = LookupState : : makeQualified ( ) . withOnMetatype ( ) ; <nl> if ( LS . isIncludingInstanceMembers ( ) ) { <nl> mmm a / test / IDE / complete_value_expr . swift <nl> ppp b / test / IDE / complete_value_expr . swift <nl> <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = FOO_OBJECT_NO_DOT_2 | % FileCheck % s - check - prefix = FOO_OBJECT_NO_DOT <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = FOO_STRUCT_DOT_1 | % FileCheck % s - check - prefix = FOO_STRUCT_DOT <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = FOO_STRUCT_NO_DOT_1 | % FileCheck % s - check - prefix = FOO_STRUCT_NO_DOT <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = FOO_STRUCT_META_1 | % FileCheck % s - check - prefix = FOO_STRUCT_META <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = FOO_STRUCT_META_2 | % FileCheck % s - check - prefix = FOO_STRUCT_META <nl> <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = IMPLICITLY_CURRIED_FUNC_0 | % FileCheck % s - check - prefix = IMPLICITLY_CURRIED_FUNC_0 <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = IMPLICITLY_CURRIED_FUNC_1 | % FileCheck % s - check - prefix = IMPLICITLY_CURRIED_FUNC_1 <nl> func testMetatypeExprWithoutDot ( ) { <nl> FooStruct # ^ FOO_STRUCT_NO_DOT_1 ^ # <nl> } <nl> <nl> + struct NoMetaCompletions { <nl> + static var foo : Int = 0 <nl> + class func bar ( ) { } <nl> + typealias Foo = Int <nl> + } <nl> + func testMetatypeCompletions ( ) { <nl> + NoMetaCompletions . Type # ^ FOO_STRUCT_META_1 ^ # <nl> + } <nl> + func testMetatypeCompletionsWithoutDot ( ) { <nl> + NoMetaCompletions . Type . # ^ FOO_STRUCT_META_2 ^ # <nl> + } <nl> + / / FOO_STRUCT_META - NOT : Decl [ StaticVar ] / CurrNominal : . foo [ # Int # ] ; name = foo <nl> + / / FOO_STRUCT_META - NOT : Decl [ StaticMethod ] / CurrNominal : . bar ( ) [ # Void # ] ; name = bar ( ) <nl> + / / FOO_STRUCT_META - NOT : Decl [ TypeAlias ] / CurrNominal : . Foo [ # Int # ] ; name = Foo <nl> + / / FOO_STRUCT_META - NOT : Decl [ Constructor ] / CurrNominal : ( ) [ # NoMetaCompletions # ] ; name = ( ) <nl> + / / FOO_STRUCT_META - NOT : Decl [ StaticVar ] / CurrNominal : foo [ # Int # ] ; name = foo <nl> + / / FOO_STRUCT_META - NOT : Decl [ StaticMethod ] / CurrNominal : bar ( ) [ # Void # ] ; name = bar ( ) <nl> + / / FOO_STRUCT_META - NOT : Decl [ TypeAlias ] / CurrNominal : Foo [ # Int # ] ; name = Foo <nl> + / / FOO_STRUCT_META - NOT : Decl [ Constructor ] / CurrNominal : init ( ) [ # NoMetaCompletions # ] ; name = init ( ) <nl> + <nl> func testImplicitlyCurriedFunc ( _ fs : inout FooStruct ) { <nl> FooStruct . instanceFunc0 ( & fs ) # ^ IMPLICITLY_CURRIED_FUNC_0 ^ # <nl> / / IMPLICITLY_CURRIED_FUNC_0 : Begin completions <nl> | [ CodeCompletion ] Remove static member completions from metatypes | apple/swift | 079aec35ba56d6fd5171027e8013e1db6e338bc4 | 2018-05-25T00:18:57Z |
mmm a / java / rocksjni / rocksjni . cc <nl> ppp b / java / rocksjni / rocksjni . cc <nl> void Java_org_rocksdb_RocksDB_ingestExternalFile ( <nl> rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , s ) ; <nl> } <nl> } <nl> + <nl> + / * <nl> + * Class : org_rocksdb_RocksDB <nl> + * Method : destroyDB <nl> + * Signature : ( Ljava / lang / String ; J ) V <nl> + * / <nl> + void Java_org_rocksdb_RocksDB_destroyDB ( <nl> + JNIEnv * env , jclass jcls , jstring jdb_path , jlong joptions_handle ) { <nl> + const char * db_path = env - > GetStringUTFChars ( jdb_path , nullptr ) ; <nl> + if ( db_path = = nullptr ) { <nl> + / / exception thrown : OutOfMemoryError <nl> + return ; <nl> + } <nl> + <nl> + auto * options = reinterpret_cast < rocksdb : : Options * > ( joptions_handle ) ; <nl> + if ( options = = nullptr ) { <nl> + rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , <nl> + rocksdb : : Status : : InvalidArgument ( " Invalid Options . " ) ) ; <nl> + } <nl> + <nl> + rocksdb : : Status s = rocksdb : : DestroyDB ( db_path , * options ) ; <nl> + env - > ReleaseStringUTFChars ( jdb_path , db_path ) ; <nl> + <nl> + if ( ! s . ok ( ) ) { <nl> + rocksdb : : RocksDBExceptionJni : : ThrowNew ( env , s ) ; <nl> + } <nl> + } <nl> mmm a / java / src / main / java / org / rocksdb / RocksDB . java <nl> ppp b / java / src / main / java / org / rocksdb / RocksDB . java <nl> public void ingestExternalFile ( final ColumnFamilyHandle columnFamilyHandle , <nl> filePathList . size ( ) , ingestExternalFileOptions . nativeHandle_ ) ; <nl> } <nl> <nl> + / * * <nl> + * Static method to destroy the contents of the specified database . <nl> + * Be very careful using this method . <nl> + * <nl> + * @ param path the path to the Rocksdb database . <nl> + * @ param options { @ link org . rocksdb . Options } instance . <nl> + * <nl> + * @ throws RocksDBException thrown if error happens in underlying <nl> + * native library . <nl> + * / <nl> + public static void destroyDB ( final String path , final Options options ) <nl> + throws RocksDBException { <nl> + destroyDB ( path , options . nativeHandle_ ) ; <nl> + } <nl> + <nl> / * * <nl> * Private constructor . <nl> * <nl> private native void setOptions ( long handle , long cfHandle , String [ ] keys , <nl> private native void ingestExternalFile ( long handle , long cfHandle , <nl> String [ ] filePathList , int filePathListLen , <nl> long ingest_external_file_options_handle ) throws RocksDBException ; <nl> + private native static void destroyDB ( final String path , <nl> + final long optionsHandle ) throws RocksDBException ; <nl> protected DBOptionsInterface options_ ; <nl> } <nl> mmm a / java / src / test / java / org / rocksdb / RocksDBTest . java <nl> ppp b / java / src / test / java / org / rocksdb / RocksDBTest . java <nl> public void setOptions ( ) throws RocksDBException { <nl> } <nl> } <nl> } <nl> + <nl> + @ Test <nl> + public void destroyDB ( ) throws RocksDBException { <nl> + try ( final Options options = new Options ( ) . setCreateIfMissing ( true ) ) { <nl> + String dbPath = dbFolder . getRoot ( ) . getAbsolutePath ( ) ; <nl> + try ( final RocksDB db = RocksDB . open ( options , dbPath ) ) { <nl> + db . put ( " key1 " . getBytes ( ) , " value " . getBytes ( ) ) ; <nl> + } <nl> + assertThat ( dbFolder . getRoot ( ) . exists ( ) ) . isTrue ( ) ; <nl> + RocksDB . destroyDB ( dbPath , options ) ; <nl> + assertThat ( dbFolder . getRoot ( ) . exists ( ) ) . isFalse ( ) ; <nl> + } <nl> + } <nl> + <nl> + @ Test ( expected = RocksDBException . class ) <nl> + public void destroyDBFailIfOpen ( ) throws RocksDBException { <nl> + try ( final Options options = new Options ( ) . setCreateIfMissing ( true ) ) { <nl> + String dbPath = dbFolder . getRoot ( ) . getAbsolutePath ( ) ; <nl> + try ( final RocksDB db = RocksDB . open ( options , dbPath ) ) { <nl> + / / Fails as the db is open and locked . <nl> + RocksDB . destroyDB ( dbPath , options ) ; <nl> + } <nl> + } <nl> + } <nl> } <nl> | DestroyDB API | facebook/rocksdb | 0806801dc848a219dba3ea21ed1442348abf12fd | 2017-09-26T23:42:11Z |
mmm a / . cicd / submodule - regression - check . sh <nl> ppp b / . cicd / submodule - regression - check . sh <nl> declare - A BASE_MAP <nl> if $ { TRAVIS : - false } ; then <nl> BASE_BRANCH = $ TRAVIS_BRANCH <nl> CURRENT_BRANCH = $ { TRAVIS_PULL_REQUEST_BRANCH : - $ TRAVIS_BRANCH } # We default to TRAVIS_BRANCH if it ' s not a PR so it passes on non PR runs <nl> + [ [ ! - z $ TRAVIS_PULL_REQUEST_SLUG ] ] & & CURRENT_BRANCH = $ TRAVIS_COMMIT # Support git log & echo output <nl> else <nl> BASE_BRANCH = $ { BUILDKITE_PULL_REQUEST_BASE_BRANCH : - $ BUILDKITE_BRANCH } <nl> CURRENT_BRANCH = $ BUILDKITE_BRANCH <nl> fi <nl> + [ [ $ BASE_BRANCH = = $ CURRENT_BRANCH ] ] & & echo ' BASE_BRANCH and CURRENT_BRANCH are the same ' & & exit 0 <nl> + <nl> echo " getting submodule info for $ CURRENT_BRANCH " <nl> while read - r a b ; do <nl> PR_MAP [ $ a ] = $ b <nl> done < < ( git submodule - - quiet foreach - - recursive ' echo $ path ` git log - 1 - - format = % ct ` ' ) <nl> + <nl> echo " getting submodule info for $ BASE_BRANCH " <nl> git checkout $ BASE_BRANCH & > / dev / null <nl> git submodule update - - init & > / dev / null <nl> while read - r a b ; do <nl> BASE_MAP [ $ a ] = $ b <nl> done < < ( git submodule - - quiet foreach - - recursive ' echo $ path ` git log - 1 - - format = % ct ` ' ) <nl> + <nl> for k in " $ { ! BASE_MAP [ @ ] } " ; do <nl> base_ts = $ { BASE_MAP [ $ k ] } <nl> pr_ts = $ { PR_MAP [ $ k ] } <nl> for k in " $ { ! BASE_MAP [ @ ] } " ; do <nl> echo " timestamp on $ BASE_BRANCH : $ base_ts " <nl> if ( ( $ pr_ts < $ base_ts ) ) ; then <nl> echo " $ k is older on $ CURRENT_BRANCH than $ BASE_BRANCH ; investigating . . . " <nl> - if for c in ` git log $ CURRENT_BRANCH ^ $ BASE_BRANCH - - pretty = format : " % H " ` ; do git show - - pretty = " " - - name - only $ c ; done | grep - q " ^ $ k $ " ; then <nl> + if [ [ $ TRAVIS = = true & & ! - z $ TRAVIS_PULL_REQUEST_SLUG ] ] ; then # IF it ' s a forked PR , we need to switch back to the PR ref / head so we can git log properly <nl> + echo " git fetch origin + refs / pull / $ TRAVIS_PULL_REQUEST / merge : " <nl> + git fetch origin + refs / pull / $ TRAVIS_PULL_REQUEST / merge : & > / dev / null <nl> + echo " switching back to $ TRAVIS_PULL_REQUEST_SLUG : $ TRAVIS_PULL_REQUEST_BRANCH ( $ TRAVIS_COMMIT ) " <nl> + echo ' git checkout - qf FETCH_HEAD ' <nl> + git checkout - qf FETCH_HEAD & > / dev / null <nl> + elif [ [ $ BUILDKITE = = true ] ] ; then <nl> + echo " switching back to $ CURRENT_BRANCH " <nl> + git checkout - f $ CURRENT_BRANCH & > / dev / null <nl> + fi <nl> + if [ [ ! - z $ ( for c in $ ( git - - no - pager log $ CURRENT_BRANCH ^ $ BASE_BRANCH - - pretty = format : " % H " ) ; do git show - - pretty = " " - - name - only $ c ; done | grep " ^ $ k $ " ) ] ] ; then <nl> echo " ERROR : $ k has regressed " <nl> exit 1 <nl> else <nl> mmm a / . travis . yml <nl> ppp b / . travis . yml <nl> matrix : <nl> - ccache <nl> env : <nl> - PATH = " / usr / local / opt / ccache / libexec : $ PATH " <nl> - script : " ccache - - max - size = 1G & & . / . cicd / build . sh & & . / . cicd / test . sh scripts / parallel - test . sh & & . / . cicd / test . sh scripts / serial - test . sh " <nl> + script : " ccache - - max - size = 1G & & . / . cicd / build . sh & & . / . cicd / test . sh scripts / parallel - test . sh & & . / . cicd / test . sh scripts / serial - test . sh & & [ [ $ ( uname ) ! = ' Darwin ' ] ] & & . / . cicd / submodule - regression - check . sh " <nl> notifications : <nl> webhooks : <nl> secure : gmqODqoFAil2cR7v + + ibqRNECBOSD / VJX + 2qPa7XptkVWmVMzbII5CNgBQAscjFsp9arHPMXCCzkBi847PCSiHdsnYFQ4T273FLRWr3cDbLjfmR + BJ7dGKvQnlpSi2Ze2TtAPJyRl + iv + cxDj7cWE5zw2c4xbgh1a / cNO + / ayUfFkyMEIfVWRsHkdkra4gOLywou0XRLHr4CX1V60uU7uuqATnIMMi7gQYwiKKtZqjkbf8wcBvZirDhjQ6lDPN5tnZo6L4QHmqjtzNJg / UrD4h + zES53dLVI4uxlXRAwwpw + mJOFA3QE / 3FT + bMQjLCffUz4gZaWcdgebPYzrwSWUbJoFdWAOwcTqivQY0FIQzcz / r6uGWcwWTavzkPEbg68BVM2BZId / 0110J6feeTkpJ3MPV + UsIoGTvbg50vi / I06icftuZ / cLqDj3 + Emifm7Jlr1sRTSdqtYAJj / 2ImUfsb46cwgjAVhFOTvc + KuPgJQgvOXV7bZkxEr5qDWo8Al2sV8BWb83j1rMlZ4LfERokImDVqxu2kkcunchzvhtYFTesSpmwegVpwceCtOtO0rEUgATnfTEHzk2rm8nuz4UtidsQnluUKqmKD0QCqHXFfn + 3ZRJsDqr + iCYdxv1BAeAVc9q1L7bgrKDMGiJgkxuhZ2v3J2SflWLvjZjFDduuc = <nl> | Added new script + travis execution | EOSIO/eos | 7ddd84a511ffe0bf90ae1c7e17bf39b48c728321 | 2019-09-17T14:49:24Z |
mmm a / src / compiler / js - typed - lowering . cc <nl> ppp b / src / compiler / js - typed - lowering . cc <nl> Reduction JSTypedLowering : : ReduceJSAdd ( Node * node ) { <nl> return r . ChangeToPureOperator ( simplified ( ) - > NumberAdd ( ) , Type : : Number ( ) ) ; <nl> } <nl> if ( r . OneInputIs ( Type : : String ( ) ) ) { <nl> + / / We know that ( at least ) one input is already a String , <nl> + / / so try to strength - reduce the non - String input . <nl> + if ( r . LeftInputIs ( Type : : String ( ) ) ) { <nl> + Reduction const reduction = ReduceJSToStringInput ( r . right ( ) ) ; <nl> + if ( reduction . Changed ( ) ) { <nl> + NodeProperties : : ReplaceValueInput ( node , reduction . replacement ( ) , 1 ) ; <nl> + } <nl> + } else if ( r . RightInputIs ( Type : : String ( ) ) ) { <nl> + Reduction const reduction = ReduceJSToStringInput ( r . left ( ) ) ; <nl> + if ( reduction . Changed ( ) ) { <nl> + NodeProperties : : ReplaceValueInput ( node , reduction . replacement ( ) , 0 ) ; <nl> + } <nl> + } <nl> + / / We might be able to constant - fold the String concatenation now . <nl> + if ( r . BothInputsAre ( Type : : String ( ) ) ) { <nl> + HeapObjectBinopMatcher m ( node ) ; <nl> + if ( m . IsFoldable ( ) ) { <nl> + Handle < String > left = Handle < String > : : cast ( m . left ( ) . Value ( ) ) ; <nl> + Handle < String > right = Handle < String > : : cast ( m . right ( ) . Value ( ) ) ; <nl> + if ( left - > length ( ) + right - > length ( ) > String : : kMaxLength ) { <nl> + / / No point in trying to optimize this , as it will just throw . <nl> + return NoChange ( ) ; <nl> + } <nl> + Node * value = jsgraph ( ) - > HeapConstant ( <nl> + factory ( ) - > NewConsString ( left , right ) . ToHandleChecked ( ) ) ; <nl> + ReplaceWithValue ( node , value ) ; <nl> + return Replace ( value ) ; <nl> + } <nl> + } <nl> + / / We might know for sure that we ' re creating a ConsString here . <nl> if ( r . ShouldCreateConsString ( ) ) { <nl> return ReduceCreateConsString ( node ) ; <nl> } <nl> | [ turbofan ] Constant - fold string concatenation during typed lowering . | v8/v8 | faea50313f2e768db362c710298e69f7c0691e99 | 2017-09-12T13:48:38Z |
mmm a / tensorflow / compiler / xla / array4d . h <nl> ppp b / tensorflow / compiler / xla / array4d . h <nl> class Array4D { <nl> } <nl> } <nl> <nl> + / / Invokes a callback with the ( indices , value ) for each cell in the 4D array . <nl> + void Each ( <nl> + std : : function < void ( tensorflow : : gtl : : ArraySlice < int64 > , T ) > f ) const { <nl> + / / We const_cast to be able to use the common non - const implementation , <nl> + / / but prevent modification of the data by passing it by - value to the <nl> + / / caller . <nl> + const_cast < Array4D * > ( this ) - > Each ( <nl> + [ & f ] ( tensorflow : : gtl : : ArraySlice < int64 > indices , T * value ) { <nl> + f ( indices , * value ) ; <nl> + } ) ; <nl> + } <nl> + <nl> / / Fills all of the { p , z } with the array provided , which specifies { y , x } . <nl> void FillWithYX ( const Array2D < T > & value ) { <nl> CHECK_EQ ( value . height ( ) , height ( ) ) ; <nl> mmm a / tensorflow / compiler / xla / reference_util . cc <nl> ppp b / tensorflow / compiler / xla / reference_util . cc <nl> ReferenceUtil : : ConvArray4DGeneralDimensionsDilated ( <nl> } <nl> } <nl> } <nl> + if ( samples = = 0 | | kx = = 0 | | ky = = 0 | | ox = = 0 | | oy = = 0 | | oz = = 0 | | <nl> + iz = = 0 ) { <nl> + LOG ( INFO ) < < " Output will be trivially empty because one of these " <nl> + " dimensions is 0 : samples : " <nl> + < < samples < < " kx : " < < kx < < " ky : " < < ky < < " ox : " < < ox <nl> + < < " oy : " < < oy < < " oz : " < < oz < < " iz : " < < iz ; <nl> + return result ; <nl> + } <nl> + bool trivial = true ; <nl> + auto check_trivial = [ & trivial ] ( tensorflow : : gtl : : ArraySlice < int64 > indices , <nl> + float value ) { <nl> + if ( value ! = 0 . 0 ) { <nl> + trivial = false ; <nl> + } <nl> + } ; <nl> + lhs . Each ( check_trivial ) ; <nl> + LOG_IF ( FATAL , trivial ) < < " LHS is all 0 . 0 . " ; <nl> + trivial = true ; <nl> + rhs . Each ( check_trivial ) ; <nl> + LOG_IF ( FATAL , trivial ) < < " RHS is all 0 . 0 . " ; <nl> return result ; <nl> } <nl> <nl> | Make sure all convolution tests are testing non - trivial cases , i . e . where not all inputs are 0 , leading to an all - 0 output , which masks most possible bugs . | tensorflow/tensorflow | 1c57e8864aeb8093f12e8f390571fb8cd9f376a4 | 2017-06-27T15:00:10Z |
mmm a / project / VS2010Express / XBMC . vcxproj <nl> ppp b / project / VS2010Express / XBMC . vcxproj <nl> <nl> < ClCompile Include = " . . \ . . \ xbmc \ filesystem \ VideoDatabaseDirectory \ DirectoryNodeGrouped . cpp " / > <nl> < ClCompile Include = " . . \ . . \ xbmc \ filesystem \ win32 \ Win32Directory . cpp " / > <nl> < ClCompile Include = " . . \ . . \ xbmc \ filesystem \ win32 \ Win32SMBDirectory . cpp " / > <nl> + < ClCompile Include = " . . \ . . \ xbmc \ filesystem \ win32 \ Win32File . cpp " / > <nl> < ClCompile Include = " . . \ . . \ xbmc \ filesystem \ windows \ WINFileSMB . cpp " / > <nl> < ClCompile Include = " . . \ . . \ xbmc \ filesystem \ windows \ WINSMBDirectory . cpp " / > <nl> < ClCompile Include = " . . \ . . \ xbmc \ filesystem \ VirtualDirectory . cpp " / > <nl> <nl> < ClInclude Include = " . . \ . . \ xbmc \ filesystem \ VideoDatabaseDirectory \ DirectoryNodeGrouped . h " / > <nl> < ClInclude Include = " . . \ . . \ xbmc \ filesystem \ win32 \ Win32Directory . h " / > <nl> < ClInclude Include = " . . \ . . \ xbmc \ filesystem \ win32 \ Win32SMBDirectory . h " / > <nl> + < ClInclude Include = " . . \ . . \ xbmc \ filesystem \ win32 \ Win32File . h " / > <nl> < ClInclude Include = " . . \ . . \ xbmc \ filesystem \ windows \ WINFileSMB . h " / > <nl> < ClInclude Include = " . . \ . . \ xbmc \ filesystem \ windows \ WINSMBDirectory . h " / > <nl> < ClInclude Include = " . . \ . . \ xbmc \ guilib \ cximage . h " / > <nl> mmm a / project / VS2010Express / XBMC . vcxproj . filters <nl> ppp b / project / VS2010Express / XBMC . vcxproj . filters <nl> <nl> < ClCompile Include = " . . \ . . \ xbmc \ utils \ win32 \ Win32Log . cpp " > <nl> < Filter > utils \ win32 < / Filter > <nl> < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ xbmc \ filesystem \ win32 \ Win32File . cpp " > <nl> + < Filter > filesystem \ win32 < / Filter > <nl> + < / ClCompile > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < ClInclude Include = " . . \ . . \ xbmc \ win32 \ pch . h " > <nl> <nl> < ClInclude Include = " . . \ . . \ xbmc \ utils \ win32 \ Win32Log . h " > <nl> < Filter > utils \ win32 < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ xbmc \ filesystem \ win32 \ Win32File . h " > <nl> + < Filter > filesystem \ win32 < / Filter > <nl> + < / ClInclude > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < ResourceCompile Include = " . . \ . . \ xbmc \ win32 \ XBMC_PC . rc " > <nl> new file mode 100644 <nl> index 000000000000 . . 607ef1098e9c <nl> mmm / dev / null <nl> ppp b / xbmc / filesystem / win32 / Win32File . cpp <nl> <nl> + / * <nl> + * Copyright ( C ) 2014 Team XBMC <nl> + * http : / / 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> + <nl> + # ifdef TARGET_WINDOWS <nl> + # include " Win32File . h " <nl> + # include " win32 / WIN32Util . h " <nl> + # include " utils / win32 / Win32Log . h " <nl> + # include " utils / SystemInfo . h " <nl> + # include " utils / auto_buffer . h " <nl> + # include " utils / StringUtils . h " <nl> + <nl> + # ifndef WIN32_LEAN_AND_MEAN <nl> + # define WIN32_LEAN_AND_MEAN 1 <nl> + # endif / / WIN32_LEAN_AND_MEAN <nl> + # include < Windows . h > <nl> + <nl> + # include < sys / types . h > <nl> + # include < sys / stat . h > <nl> + <nl> + # include < intsafe . h > <nl> + # include < wchar . h > <nl> + # include < limits . h > <nl> + <nl> + <nl> + using namespace XFILE ; <nl> + <nl> + <nl> + CWin32File : : CWin32File ( ) <nl> + { <nl> + m_hFile = INVALID_HANDLE_VALUE ; <nl> + m_filePos = - 1 ; <nl> + m_allowWrite = false ; <nl> + } <nl> + <nl> + CWin32File : : ~ CWin32File ( ) <nl> + { <nl> + if ( m_hFile ! = INVALID_HANDLE_VALUE ) <nl> + CloseHandle ( m_hFile ) ; <nl> + } <nl> + <nl> + bool CWin32File : : Open ( const CURL & url ) <nl> + { <nl> + assert ( url . GetProtocol ( ) . empty ( ) ) ; / / function suitable only for local files <nl> + if ( m_hFile ! = INVALID_HANDLE_VALUE ) <nl> + { <nl> + CLog : : LogF ( LOGERROR , " Attempt to open file without closing opened file object first " ) ; <nl> + return false ; <nl> + } <nl> + <nl> + std : : wstring pathnameW ( CWIN32Util : : ConvertPathToWin32Form ( url ) ) ; <nl> + if ( pathnameW . empty ( ) ) <nl> + return false ; <nl> + <nl> + m_filepathnameW = pathnameW ; <nl> + m_hFile = CreateFileW ( pathnameW . c_str ( ) , GENERIC_READ , FILE_SHARE_READ | FILE_SHARE_WRITE , <nl> + NULL , OPEN_EXISTING , FILE_ATTRIBUTE_NORMAL , NULL ) ; <nl> + <nl> + return m_hFile ! = INVALID_HANDLE_VALUE ; <nl> + } <nl> + <nl> + bool CWin32File : : OpenForWrite ( const CURL & url , bool bOverWrite / * = false * / ) <nl> + { <nl> + assert ( url . GetProtocol ( ) . empty ( ) ) ; / / function suitable only for local files <nl> + if ( m_hFile ! = INVALID_HANDLE_VALUE ) <nl> + return false ; <nl> + <nl> + std : : wstring pathnameW ( CWIN32Util : : ConvertPathToWin32Form ( url ) ) ; <nl> + if ( pathnameW . empty ( ) ) <nl> + return false ; <nl> + <nl> + m_hFile = CreateFileW ( pathnameW . c_str ( ) , GENERIC_READ | GENERIC_WRITE , FILE_SHARE_READ , <nl> + NULL , bOverWrite ? CREATE_ALWAYS : OPEN_ALWAYS , FILE_ATTRIBUTE_NORMAL , NULL ) ; <nl> + <nl> + if ( m_hFile = = INVALID_HANDLE_VALUE ) <nl> + return false ; <nl> + <nl> + const bool newlyCreated = ( GetLastError ( ) ! = ERROR_ALREADY_EXISTS ) ; <nl> + m_filepathnameW = pathnameW ; <nl> + <nl> + if ( ! newlyCreated ) <nl> + { <nl> + if ( Seek ( 0 , SEEK_SET ) ! = 0 ) <nl> + { <nl> + CLog : : LogF ( LOGERROR , " Can ' t move i / o pointer " ) ; <nl> + Close ( ) ; <nl> + return false ; <nl> + } <nl> + } <nl> + else <nl> + { / / newly created file <nl> + / * set " hidden " attribute if filename starts with a period * / <nl> + size_t lastSlash = pathnameW . rfind ( L ' \ \ ' ) ; <nl> + if ( lastSlash < pathnameW . length ( ) - 1 / / is two checks in one : lastSlash ! = std : : string : : npos & & lastSlash + 1 < pathnameW . length ( ) <nl> + & & pathnameW [ lastSlash + 1 ] = = L ' . ' ) <nl> + { <nl> + FILE_BASIC_INFO basicInfo ; <nl> + bool hiddenSet = false ; <nl> + if ( GetFileInformationByHandleEx ( m_hFile , FileBasicInfo , & basicInfo , sizeof ( basicInfo ) ) ! = 0 ) <nl> + { <nl> + if ( ( basicInfo . FileAttributes & FILE_ATTRIBUTE_HIDDEN ) ! = 0 ) <nl> + hiddenSet = true ; <nl> + else <nl> + { <nl> + basicInfo . FileAttributes | = FILE_ATTRIBUTE_HIDDEN ; <nl> + hiddenSet = SetFileInformationByHandle ( m_hFile , FileBasicInfo , & basicInfo , sizeof ( basicInfo ) ) ! = 0 ; <nl> + } <nl> + } <nl> + if ( ! hiddenSet ) <nl> + CLog : : LogFW ( LOGWARNING , L " Can ' t set hidden attribute for file \ " % ls \ " " , pathnameW . c_str ( ) ) ; <nl> + } <nl> + } <nl> + <nl> + m_allowWrite = true ; <nl> + <nl> + return true ; <nl> + } <nl> + <nl> + void CWin32File : : Close ( ) <nl> + { <nl> + if ( m_hFile ! = INVALID_HANDLE_VALUE ) <nl> + CloseHandle ( m_hFile ) ; <nl> + <nl> + m_hFile = INVALID_HANDLE_VALUE ; <nl> + m_filePos = - 1 ; <nl> + m_allowWrite = false ; <nl> + m_filepathnameW . clear ( ) ; <nl> + } <nl> + <nl> + unsigned int CWin32File : : Read ( void * lpBuf , int64_t uiBufSize ) <nl> + { <nl> + assert ( lpBuf ! = NULL ) ; <nl> + if ( m_hFile = = INVALID_HANDLE_VALUE | | ! lpBuf ) <nl> + return 0 ; / / TODO : return - 1 <nl> + <nl> + / / TODO : Reduce uiBufSize if required / oversized <nl> + unsigned int read = 0 ; <nl> + <nl> + / / if uiBufSize is larger than ReadFile ( ) can read at one time ( larger than DWORD_MAX ) <nl> + / / repeat ReadFile until buffer is filled <nl> + while ( uiBufSize > 0 ) <nl> + { <nl> + DWORD lastRead = 0 ; <nl> + if ( ! ReadFile ( m_hFile , ( ( BYTE * ) lpBuf ) + read , ( uiBufSize > DWORD_MAX ) ? DWORD_MAX : ( DWORD ) uiBufSize , & lastRead , NULL ) ) <nl> + return 0 ; / / TODO : return - 1 <nl> + read + = lastRead ; <nl> + / / if m_filePos is set - update it <nl> + if ( m_filePos > = 0 ) <nl> + m_filePos + = read ; <nl> + <nl> + / / If buffer can be filled with one ReadFile ( ) call and ReadFile ( ) return smaller <nl> + / / number of bytes than requested , just return number of read bytes ( work as <nl> + / / transparent wrapper for ReadFile ( ) ) . <nl> + / / If ReadFile ( ) can ' t read any more bytes than don ' t try to fill buffer . <nl> + if ( uiBufSize < = DWORD_MAX | | lastRead = = 0 ) <nl> + return read ; <nl> + assert ( lastRead < = uiBufSize ) ; <nl> + uiBufSize - = lastRead ; <nl> + } <nl> + return read ; <nl> + } <nl> + <nl> + int CWin32File : : Write ( const void * lpBuf , int64_t uiBufSize ) <nl> + { <nl> + assert ( lpBuf ! = NULL ) ; <nl> + if ( m_hFile = = INVALID_HANDLE_VALUE | | ! lpBuf ) <nl> + return - 1 ; <nl> + <nl> + if ( ! m_allowWrite ) <nl> + { <nl> + CLog : : LogF ( LOGERROR , " Attempt to write file opened for reading " ) ; <nl> + return - 1 ; <nl> + } <nl> + <nl> + / / TODO : fail on oversized uiBufSize <nl> + int written = 0 ; <nl> + while ( uiBufSize > 0 ) <nl> + { <nl> + DWORD lastWritten = 0 ; <nl> + const DWORD toWrite = uiBufSize > DWORD_MAX ? DWORD_MAX : ( DWORD ) uiBufSize ; <nl> + if ( ! WriteFile ( m_hFile , ( ( const BYTE * ) lpBuf ) + written , toWrite , & lastWritten , NULL ) ) <nl> + return - 1 ; <nl> + written + = lastWritten ; <nl> + uiBufSize - = lastWritten ; <nl> + / / if m_filePos is set - update it <nl> + if ( m_filePos > = 0 ) <nl> + m_filePos + = lastWritten ; <nl> + <nl> + if ( lastWritten ! = toWrite ) <nl> + break ; <nl> + } <nl> + return written ; <nl> + } <nl> + <nl> + int64_t CWin32File : : Seek ( int64_t iFilePosition , int iWhence / * = SEEK_SET * / ) <nl> + { <nl> + if ( m_hFile = = INVALID_HANDLE_VALUE ) <nl> + return - 1 ; <nl> + <nl> + LARGE_INTEGER distance , newPos = { } ; <nl> + distance . QuadPart = iFilePosition ; <nl> + DWORD moveMethod ; <nl> + if ( iWhence = = SEEK_SET ) <nl> + moveMethod = FILE_BEGIN ; <nl> + else if ( iWhence = = SEEK_CUR ) <nl> + moveMethod = FILE_CURRENT ; <nl> + else if ( iWhence = = SEEK_END ) <nl> + moveMethod = FILE_END ; <nl> + else <nl> + return - 1 ; <nl> + <nl> + if ( ! SetFilePointerEx ( m_hFile , distance , & newPos , moveMethod ) ) <nl> + m_filePos = - 1 ; / / Seek failed , invalidate position <nl> + else <nl> + m_filePos = newPos . QuadPart ; <nl> + <nl> + return m_filePos ; <nl> + } <nl> + <nl> + int CWin32File : : Truncate ( int64_t toSize ) <nl> + { <nl> + if ( m_hFile = = INVALID_HANDLE_VALUE ) <nl> + return - 1 ; <nl> + <nl> + int64_t prevPos = GetPosition ( ) ; <nl> + if ( prevPos < 0 ) <nl> + return - 1 ; <nl> + <nl> + if ( Seek ( toSize ) ! = toSize ) <nl> + { <nl> + Seek ( prevPos ) ; <nl> + return - 1 ; <nl> + } <nl> + const int ret = ( SetEndOfFile ( m_hFile ) ! = 0 ) ? 0 : - 1 ; <nl> + Seek ( prevPos ) ; <nl> + <nl> + return ret ; <nl> + } <nl> + <nl> + int64_t CWin32File : : GetPosition ( ) <nl> + { <nl> + if ( m_hFile = = INVALID_HANDLE_VALUE ) <nl> + return - 1 ; <nl> + <nl> + if ( m_filePos < 0 ) <nl> + { <nl> + LARGE_INTEGER zeroDist , curPos = { } ; <nl> + zeroDist . QuadPart = 0 ; <nl> + if ( ! SetFilePointerEx ( m_hFile , zeroDist , & curPos , FILE_CURRENT ) ) <nl> + m_filePos = - 1 ; <nl> + else <nl> + m_filePos = curPos . QuadPart ; <nl> + } <nl> + <nl> + return m_filePos ; <nl> + } <nl> + <nl> + int64_t CWin32File : : GetLength ( ) <nl> + { <nl> + if ( m_hFile = = INVALID_HANDLE_VALUE ) <nl> + return - 1 ; <nl> + <nl> + LARGE_INTEGER fileSize = { } ; <nl> + / / always request current size from filesystem , as file can be changed externally <nl> + if ( ! GetFileSizeEx ( m_hFile , & fileSize ) ) <nl> + return - 1 ; <nl> + else <nl> + return fileSize . QuadPart ; <nl> + } <nl> + <nl> + void CWin32File : : Flush ( ) <nl> + { <nl> + if ( m_hFile = = INVALID_HANDLE_VALUE ) <nl> + return ; <nl> + <nl> + if ( ! m_allowWrite ) <nl> + { <nl> + CLog : : LogF ( LOGERROR , " Attempt to flush file opened for reading " ) ; <nl> + return ; <nl> + } <nl> + <nl> + FlushFileBuffers ( m_hFile ) ; <nl> + } <nl> + <nl> + bool CWin32File : : Delete ( const CURL & url ) <nl> + { <nl> + std : : wstring pathnameW ( CWIN32Util : : ConvertPathToWin32Form ( url ) ) ; <nl> + if ( pathnameW . empty ( ) ) <nl> + return false ; <nl> + <nl> + return DeleteFileW ( pathnameW . c_str ( ) ) ! = 0 ; <nl> + } <nl> + <nl> + bool CWin32File : : Rename ( const CURL & urlCurrentName , const CURL & urlNewName ) <nl> + { <nl> + assert ( urlCurrentName . GetProtocol ( ) . empty ( ) ) ; / / function suitable only for local files <nl> + assert ( urlNewName . GetProtocol ( ) . empty ( ) ) ; / / function suitable only for local files <nl> + <nl> + / / TODO : check whether it ' s file or directory <nl> + std : : wstring curNameW ( CWIN32Util : : ConvertPathToWin32Form ( urlCurrentName ) ) ; <nl> + if ( curNameW . empty ( ) ) <nl> + return false ; <nl> + <nl> + std : : wstring newNameW ( CWIN32Util : : ConvertPathToWin32Form ( urlNewName ) ) ; <nl> + if ( newNameW . empty ( ) ) <nl> + return false ; <nl> + <nl> + return MoveFileExW ( curNameW . c_str ( ) , newNameW . c_str ( ) , MOVEFILE_COPY_ALLOWED ) ! = 0 ; <nl> + } <nl> + <nl> + bool CWin32File : : SetHidden ( const CURL & url , bool hidden ) <nl> + { <nl> + assert ( url . GetProtocol ( ) . empty ( ) ) ; / / function suitable only for local files <nl> + std : : wstring pathnameW ( CWIN32Util : : ConvertPathToWin32Form ( url ) ) ; <nl> + if ( pathnameW . empty ( ) ) <nl> + return false ; <nl> + <nl> + const DWORD attrs = GetFileAttributesW ( pathnameW . c_str ( ) ) ; <nl> + if ( attrs = = INVALID_FILE_ATTRIBUTES | | ( attrs & FILE_ATTRIBUTE_DIRECTORY ) ! = 0 ) <nl> + return false ; <nl> + <nl> + / / check whether attribute is already set / cleared <nl> + if ( ( ( attrs & FILE_ATTRIBUTE_HIDDEN ) ! = 0 ) = = hidden ) <nl> + return true ; <nl> + <nl> + if ( hidden ) <nl> + return SetFileAttributesW ( pathnameW . c_str ( ) , attrs | FILE_ATTRIBUTE_HIDDEN ) ! = 0 ; <nl> + return SetFileAttributesW ( pathnameW . c_str ( ) , attrs & ~ FILE_ATTRIBUTE_HIDDEN ) ! = 0 ; <nl> + } <nl> + <nl> + bool CWin32File : : Exists ( const CURL & url ) <nl> + { <nl> + assert ( url . GetProtocol ( ) . empty ( ) ) ; / / function suitable only for local files <nl> + std : : wstring pathnameW ( CWIN32Util : : ConvertPathToWin32Form ( url ) ) ; <nl> + if ( pathnameW . empty ( ) ) <nl> + return false ; <nl> + <nl> + const DWORD attrs = GetFileAttributesW ( pathnameW . c_str ( ) ) ; <nl> + return attrs ! = INVALID_FILE_ATTRIBUTES & & ( attrs & FILE_ATTRIBUTE_DIRECTORY ) = = 0 ; <nl> + } <nl> + <nl> + int CWin32File : : Stat ( const CURL & url , struct __stat64 * statData ) <nl> + { <nl> + assert ( url . GetProtocol ( ) . empty ( ) ) ; / / function suitable only for local files <nl> + if ( ! statData ) <nl> + return - 1 ; <nl> + <nl> + std : : wstring pathnameW ( CWIN32Util : : ConvertPathToWin32Form ( url ) ) ; <nl> + if ( pathnameW . empty ( ) ) <nl> + return - 1 ; <nl> + <nl> + / / get maximum information about file from search function <nl> + HANDLE hSearch ; <nl> + WIN32_FIND_DATAW findData ; <nl> + if ( CSysInfo : : IsWindowsVersionAtLeast ( CSysInfo : : WindowsVersionWin7 ) ) <nl> + hSearch = FindFirstFileExW ( pathnameW . c_str ( ) , FindExInfoBasic , & findData , FindExSearchNameMatch , NULL , 0 ) ; <nl> + else <nl> + hSearch = FindFirstFileExW ( pathnameW . c_str ( ) , FindExInfoStandard , & findData , FindExSearchNameMatch , NULL , 0 ) ; <nl> + <nl> + if ( hSearch = = INVALID_HANDLE_VALUE ) <nl> + return - 1 ; <nl> + <nl> + FindClose ( hSearch ) ; <nl> + <nl> + / * set st_gid * / <nl> + statData - > st_gid = 0 ; / / UNIX group ID is always zero on Win32 <nl> + <nl> + / * set st_uid * / <nl> + statData - > st_uid = 0 ; / / UNIX user ID is always zero on Win32 <nl> + <nl> + / * set st_ino * / <nl> + statData - > st_ino = 0 ; / / inode number is not implemented on Win32 <nl> + <nl> + / * set st_size * / <nl> + statData - > st_size = ( __int64 ( findData . nFileSizeHigh ) < < 32 ) + __int64 ( findData . nFileSizeLow ) ; <nl> + <nl> + / * set st_dev and st_rdev * / <nl> + assert ( pathnameW . compare ( 0 , 4 , L " \ \ \ \ ? \ \ " , 4 ) = = 0 ) ; <nl> + assert ( pathnameW . length ( ) > = 7 ) ; / / ' 7 ' is the minimal length of " \ \ ? \ x : \ " <nl> + assert ( pathnameW [ 5 ] = = L ' : ' ) ; <nl> + const wchar_t driveLetter = pathnameW [ 4 ] ; <nl> + assert ( ( driveLetter > = L ' A ' & & driveLetter < = L ' Z ' ) | | ( driveLetter > = L ' a ' & & driveLetter < = L ' z ' ) ) ; <nl> + statData - > st_dev = ( driveLetter > = L ' a ' ) ? driveLetter - L ' a ' : driveLetter - L ' A ' ; <nl> + statData - > st_rdev = statData - > st_dev ; <nl> + <nl> + const HANDLE hFile = CreateFileW ( pathnameW . c_str ( ) , FILE_READ_ATTRIBUTES , FILE_SHARE_READ | FILE_SHARE_WRITE , NULL , OPEN_EXISTING , FILE_ATTRIBUTE_NORMAL , NULL ) ; <nl> + / * set st_nlink * / <nl> + statData - > st_nlink = 1 ; / / fallback value <nl> + if ( hFile ! = INVALID_HANDLE_VALUE ) <nl> + { <nl> + _FILE_STANDARD_INFO stdInfo ; <nl> + if ( GetFileInformationByHandleEx ( hFile , FileStandardInfo , & stdInfo , sizeof ( stdInfo ) ) ! = 0 ) <nl> + statData - > st_nlink = ( stdInfo . NumberOfLinks > SHORT_MAX ) ? SHORT_MAX : short ( stdInfo . NumberOfLinks ) ; <nl> + } <nl> + <nl> + / * set st_mtime , st_atime , st_ctime * / <nl> + statData - > st_mtime = 0 ; <nl> + statData - > st_atime = 0 ; <nl> + statData - > st_ctime = 0 ; <nl> + if ( hFile ! = INVALID_HANDLE_VALUE ) <nl> + { <nl> + FILE_BASIC_INFO basicInfo ; <nl> + if ( GetFileInformationByHandleEx ( hFile , FileBasicInfo , & basicInfo , sizeof ( basicInfo ) ) ! = 0 ) <nl> + { <nl> + statData - > st_mtime = CWIN32Util : : fileTimeToTimeT ( basicInfo . ChangeTime ) ; / / most accurate value <nl> + if ( statData - > st_mtime = = 0 ) <nl> + statData - > st_mtime = CWIN32Util : : fileTimeToTimeT ( basicInfo . LastWriteTime ) ; / / less accurate value <nl> + statData - > st_atime = CWIN32Util : : fileTimeToTimeT ( basicInfo . LastAccessTime ) ; <nl> + statData - > st_ctime = CWIN32Util : : fileTimeToTimeT ( basicInfo . CreationTime ) ; <nl> + } <nl> + CloseHandle ( hFile ) ; <nl> + } <nl> + if ( statData - > st_mtime = = 0 ) <nl> + statData - > st_mtime = CWIN32Util : : fileTimeToTimeT ( findData . ftLastWriteTime ) ; <nl> + <nl> + if ( statData - > st_atime = = 0 ) <nl> + statData - > st_atime = CWIN32Util : : fileTimeToTimeT ( findData . ftLastAccessTime ) ; <nl> + if ( statData - > st_atime = = 0 ) <nl> + statData - > st_atime = statData - > st_mtime ; <nl> + <nl> + if ( statData - > st_ctime = = 0 ) <nl> + statData - > st_ctime = CWIN32Util : : fileTimeToTimeT ( findData . ftCreationTime ) ; <nl> + if ( statData - > st_ctime = = 0 ) <nl> + statData - > st_ctime = statData - > st_mtime ; <nl> + <nl> + / * set st_mode * / <nl> + statData - > st_mode = _S_IREAD ; / / Always assume Read permission for file owner <nl> + if ( ( findData . dwFileAttributes & FILE_READ_ONLY ) = = 0 ) <nl> + statData - > st_mode | = _S_IWRITE ; / / Write possible <nl> + if ( ( findData . dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) ! = 0 ) <nl> + statData - > st_mode | = _S_IFDIR | _S_IEXEC ; / / directory <nl> + else <nl> + { <nl> + statData - > st_mode | = _S_IFREG ; / / file <nl> + / / following large piece of code is disabled <nl> + / / as it intended only to set _S_IEXEC flag <nl> + / / which is not used by callers <nl> + # ifdef WIN32_USE_FILE_STAT_MAX_INFO <nl> + / / set _S_IEXEC if file has executable extension <nl> + const size_t lastDot = pathnameW . rfind ( L ' . ' ) ; <nl> + if ( lastDot ! = std : : wstring : : npos & & pathnameW . rfind ( L ' \ \ ' ) < lastDot ) <nl> + { / / file has some extension <nl> + const std : : wstring fileExt ( pathnameW , lastDot ) ; <nl> + XUTILS : : auto_buffer buf ( 32767 * sizeof ( wchar_t ) ) ; / / maximum possible size <nl> + const DWORD envRes = GetEnvironmentVariableW ( L " PATHEXT " , ( wchar_t * ) buf . get ( ) , buf . size ( ) / sizeof ( wchar_t ) ) ; <nl> + std : : vector < std : : wstring > listExts ; <nl> + if ( envRes = = 0 | | envRes > ( buf . size ( ) / sizeof ( wchar_t ) ) ) <nl> + { <nl> + buf . clear ( ) ; <nl> + static const wchar_t * extArr [ ] = { L " . exe " , L " . bat " , L " . cmd " , L " . com " } ; <nl> + listExts . assign ( extArr , extArr + ( sizeof ( extArr ) / sizeof ( extArr [ 0 ] ) ) ) ; <nl> + } <nl> + else <nl> + { <nl> + std : : wstring envPathextW ( ( wchar_t * ) buf . get ( ) , envRes ) ; <nl> + buf . clear ( ) ; <nl> + size_t posExt = envPathextW . find_first_not_of ( L ' ; ' ) ; / / skip ' ; ' at the start <nl> + while ( posExt ! = std : : wstring : : npos ) <nl> + { <nl> + const size_t posSemicol = envPathextW . find ( L ' ; ' , posExt ) ; <nl> + listExts . push_back ( envPathextW . substr ( posExt , posSemicol - posExt ) ) ; <nl> + posExt = envPathextW . find_first_not_of ( L " ; " , posSemicol ) ; <nl> + } <nl> + } <nl> + const wchar_t * const fileExtC = fileExt . c_str ( ) ; <nl> + for ( std : : vector < std : : wstring > : : const_iterator it = listExts . cbegin ( ) ; it ! = listExts . cend ( ) ; + + it ) <nl> + { <nl> + if ( _wcsicmp ( fileExtC , it - > c_str ( ) ) = = 0 ) <nl> + { <nl> + statData - > st_mode | = _S_IEXEC ; / / file can be executed <nl> + break ; <nl> + } <nl> + } <nl> + } <nl> + # endif / / WIN32_USE_FILE_STAT_MAX_INFO <nl> + } <nl> + / / copy user RWX rights to group rights <nl> + statData - > st_mode | = ( statData - > st_mode & ( _S_IREAD | _S_IWRITE | _S_IEXEC ) ) > > 3 ; <nl> + / / copy user RWX rights to other rights <nl> + statData - > st_mode | = ( statData - > st_mode & ( _S_IREAD | _S_IWRITE | _S_IEXEC ) ) > > 6 ; <nl> + <nl> + return 0 ; <nl> + } <nl> + <nl> + int CWin32File : : Stat ( struct __stat64 * statData ) <nl> + { <nl> + if ( ! statData ) <nl> + return - 1 ; <nl> + <nl> + if ( m_hFile = = INVALID_HANDLE_VALUE ) <nl> + return - 1 ; <nl> + <nl> + / * set st_gid * / <nl> + statData - > st_gid = 0 ; / / UNIX group ID is always zero on Win32 <nl> + <nl> + / * set st_uid * / <nl> + statData - > st_uid = 0 ; / / UNIX user ID is always zero on Win32 <nl> + <nl> + / * set st_ino * / <nl> + statData - > st_ino = 0 ; / / inode number is not implemented on Win32 <nl> + <nl> + / * set st_mtime , st_atime , st_ctime * / <nl> + statData - > st_mtime = 0 ; <nl> + statData - > st_atime = 0 ; <nl> + statData - > st_ctime = 0 ; <nl> + FILE_BASIC_INFO basicInfo ; <nl> + if ( GetFileInformationByHandleEx ( m_hFile , FileBasicInfo , & basicInfo , sizeof ( basicInfo ) ) = = 0 ) <nl> + return - 1 ; / / can ' t get basic file information <nl> + <nl> + statData - > st_mtime = CWIN32Util : : fileTimeToTimeT ( basicInfo . ChangeTime ) ; / / most accurate value <nl> + if ( statData - > st_mtime = = 0 ) <nl> + statData - > st_mtime = CWIN32Util : : fileTimeToTimeT ( basicInfo . LastWriteTime ) ; / / less accurate value <nl> + <nl> + statData - > st_atime = CWIN32Util : : fileTimeToTimeT ( basicInfo . LastAccessTime ) ; <nl> + if ( statData - > st_atime = = 0 ) <nl> + statData - > st_atime = statData - > st_mtime ; <nl> + <nl> + statData - > st_ctime = CWIN32Util : : fileTimeToTimeT ( basicInfo . CreationTime ) ; <nl> + if ( statData - > st_ctime = = 0 ) <nl> + statData - > st_ctime = statData - > st_mtime ; <nl> + <nl> + / * set st_size and st_nlink * / <nl> + FILE_STANDARD_INFO stdInfo ; <nl> + if ( GetFileInformationByHandleEx ( m_hFile , FileStandardInfo , & stdInfo , sizeof ( stdInfo ) ) ! = 0 ) <nl> + { <nl> + statData - > st_size = __int64 ( stdInfo . EndOfFile . QuadPart ) ; <nl> + statData - > st_nlink = ( stdInfo . NumberOfLinks > SHORT_MAX ) ? SHORT_MAX : short ( stdInfo . NumberOfLinks ) ; <nl> + } <nl> + else <nl> + { <nl> + statData - > st_size = GetLength ( ) ; <nl> + if ( statData - > st_size < 0 ) <nl> + return - 1 ; / / can ' t get file size <nl> + statData - > st_nlink = 1 ; / / fallback value <nl> + } <nl> + <nl> + / * set st_dev and st_rdev * / <nl> + assert ( m_filepathnameW . compare ( 0 , 4 , L " \ \ \ \ ? \ \ " , 4 ) = = 0 ) ; <nl> + assert ( m_filepathnameW . length ( ) > = 7 ) ; / / ' 7 ' is the minimal length of " \ \ ? \ x : \ " <nl> + assert ( m_filepathnameW [ 5 ] = = L ' : ' ) ; <nl> + const wchar_t driveLetter = m_filepathnameW [ 4 ] ; <nl> + assert ( ( driveLetter > = L ' A ' & & driveLetter < = L ' Z ' ) | | ( driveLetter > = L ' a ' & & driveLetter < = L ' z ' ) ) ; <nl> + statData - > st_dev = ( driveLetter > = L ' a ' ) ? driveLetter - L ' a ' : driveLetter - L ' A ' ; <nl> + statData - > st_rdev = statData - > st_dev ; <nl> + <nl> + / * set st_mode * / <nl> + statData - > st_mode = _S_IREAD ; / / Always assume Read permission for file owner <nl> + if ( ( basicInfo . FileAttributes & FILE_READ_ONLY ) = = 0 ) <nl> + statData - > st_mode | = _S_IWRITE ; / / Write possible <nl> + if ( ( basicInfo . FileAttributes & FILE_ATTRIBUTE_DIRECTORY ) ! = 0 ) <nl> + statData - > st_mode | = _S_IFDIR | _S_IEXEC ; / / directory <nl> + else <nl> + { <nl> + statData - > st_mode | = _S_IFREG ; / / file <nl> + / / following large piece of code is disabled <nl> + / / as it intended only to set _S_IEXEC flag <nl> + / / which is not used by callers <nl> + # ifdef WIN32_USE_FILE_STAT_MAX_INFO <nl> + / / set _S_IEXEC if file has executable extension <nl> + std : : wstring pathnameW ; <nl> + XUTILS : : auto_buffer nameInfoBuf ( sizeof ( FILE_NAME_INFO ) + sizeof ( wchar_t ) * MAX_PATH * 2 ) ; <nl> + if ( GetFileInformationByHandleEx ( m_hFile , FileNameInfo , nameInfoBuf . get ( ) , nameInfoBuf . size ( ) ) ! = 0 ) <nl> + { <nl> + / / real path and name without drive <nl> + const PFILE_NAME_INFO pNameInfo = PFILE_NAME_INFO ( nameInfoBuf . get ( ) ) ; <nl> + pathnameW . assign ( pNameInfo - > FileName , pNameInfo - > FileNameLength / sizeof ( wchar_t ) ) ; <nl> + nameInfoBuf . clear ( ) ; <nl> + } <nl> + else <nl> + pathnameW = m_filepathnameW ; <nl> + <nl> + const size_t lastDot = pathnameW . rfind ( L ' . ' ) ; <nl> + const size_t lastSlash = pathnameW . rfind ( L ' \ \ ' ) ; <nl> + if ( lastDot ! = std : : wstring : : npos & & <nl> + ( lastSlash = = std : : wstring : : npos | | lastSlash < lastDot ) ) <nl> + { / / file has some extension <nl> + const std : : wstring fileExt ( pathnameW , lastDot ) ; <nl> + XUTILS : : auto_buffer buf ( 32767 * sizeof ( wchar_t ) ) ; / / maximum possible size <nl> + const DWORD envRes = GetEnvironmentVariableW ( L " PATHEXT " , ( wchar_t * ) buf . get ( ) , buf . size ( ) / sizeof ( wchar_t ) ) ; <nl> + std : : vector < std : : wstring > listExts ; <nl> + if ( envRes = = 0 | | envRes > ( buf . size ( ) / sizeof ( wchar_t ) ) ) <nl> + { <nl> + buf . clear ( ) ; <nl> + static const wchar_t * extArr [ ] = { L " . exe " , L " . bat " , L " . cmd " , L " . com " } ; <nl> + listExts . assign ( extArr , extArr + ( sizeof ( extArr ) / sizeof ( extArr [ 0 ] ) ) ) ; <nl> + } <nl> + else <nl> + { <nl> + std : : wstring envPathextW ( ( wchar_t * ) buf . get ( ) , envRes ) ; <nl> + buf . clear ( ) ; <nl> + size_t posExt = envPathextW . find_first_not_of ( L ' ; ' ) ; / / skip ' ; ' at the start <nl> + while ( posExt ! = std : : wstring : : npos ) <nl> + { <nl> + const size_t posSemicol = envPathextW . find ( L ' ; ' , posExt ) ; <nl> + listExts . push_back ( envPathextW . substr ( posExt , posSemicol - posExt ) ) ; <nl> + posExt = envPathextW . find_first_not_of ( L " ; " , posSemicol ) ; <nl> + } <nl> + } <nl> + const wchar_t * const fileExtC = fileExt . c_str ( ) ; <nl> + for ( std : : vector < std : : wstring > : : const_iterator it = listExts . cbegin ( ) ; it ! = listExts . cend ( ) ; + + it ) <nl> + { <nl> + if ( _wcsicmp ( fileExtC , it - > c_str ( ) ) = = 0 ) <nl> + { <nl> + statData - > st_mode | = _S_IEXEC ; / / file can be executed <nl> + break ; <nl> + } <nl> + } <nl> + } <nl> + # endif / / WIN32_USE_FILE_STAT_MAX_INFO <nl> + } <nl> + / / copy user RWX rights to group rights <nl> + statData - > st_mode | = ( statData - > st_mode & ( _S_IREAD | _S_IWRITE | _S_IEXEC ) ) > > 3 ; <nl> + / / copy user RWX rights to other rights <nl> + statData - > st_mode | = ( statData - > st_mode & ( _S_IREAD | _S_IWRITE | _S_IEXEC ) ) > > 6 ; <nl> + <nl> + return 0 ; <nl> + } <nl> + <nl> + # endif / / TARGET_WINDOWS <nl> new file mode 100644 <nl> index 000000000000 . . c44091cbc8f5 <nl> mmm / dev / null <nl> ppp b / xbmc / filesystem / win32 / Win32File . h <nl> <nl> + # pragma once <nl> + / * <nl> + * Copyright ( C ) 2014 Team XBMC <nl> + * http : / / 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> + <nl> + # include " filesystem / IFile . h " <nl> + # include < string > <nl> + <nl> + typedef void * HANDLE ; / / forward declaration <nl> + <nl> + namespace XFILE <nl> + { <nl> + class CWin32File : public IFile <nl> + { <nl> + public : <nl> + CWin32File ( ) ; <nl> + virtual ~ CWin32File ( ) ; <nl> + <nl> + virtual bool Open ( const CURL & url ) ; <nl> + virtual bool OpenForWrite ( const CURL & url , bool bOverWrite = false ) ; <nl> + virtual void Close ( ) ; <nl> + <nl> + virtual unsigned int Read ( void * lpBuf , int64_t uiBufSize ) ; <nl> + virtual int Write ( const void * lpBuf , int64_t uiBufSize ) ; <nl> + virtual int64_t Seek ( int64_t iFilePosition , int iWhence = SEEK_SET ) ; <nl> + virtual int Truncate ( int64_t toSize ) ; <nl> + virtual int64_t GetPosition ( ) ; <nl> + virtual int64_t GetLength ( ) ; <nl> + virtual void Flush ( ) ; <nl> + <nl> + virtual bool Delete ( const CURL & url ) ; <nl> + virtual bool Rename ( const CURL & urlCurrentName , const CURL & urlNewName ) ; <nl> + virtual bool SetHidden ( const CURL & url , bool hidden ) ; <nl> + virtual bool Exists ( const CURL & url ) ; <nl> + virtual int Stat ( const CURL & url , struct __stat64 * statData ) ; <nl> + virtual int Stat ( struct __stat64 * statData ) ; <nl> + <nl> + protected : <nl> + HANDLE m_hFile ; <nl> + int64_t m_filePos ; <nl> + bool m_allowWrite ; <nl> + / / file path and name in win32 long form " \ \ ? \ D : \ path \ to \ file . ext " <nl> + std : : wstring m_filepathnameW ; <nl> + } ; <nl> + <nl> + } <nl> | [ win32 ] [ vfs ] Implement new CWin32File class for local files on win32 platforms | xbmc/xbmc | ff02a20444604a849f8f6542ba1fd428b492cc04 | 2014-09-01T09:43:26Z |
mmm a / depends / packages / qt . mk <nl> ppp b / depends / packages / qt . mk <nl> $ ( package ) _config_opts + = - no - feature - dial <nl> $ ( package ) _config_opts + = - no - feature - filesystemwatcher <nl> $ ( package ) _config_opts + = - no - feature - fontcombobox <nl> $ ( package ) _config_opts + = - no - feature - ftp <nl> + $ ( package ) _config_opts + = - no - feature - http <nl> $ ( package ) _config_opts + = - no - feature - image_heuristic_mask <nl> $ ( package ) _config_opts + = - no - feature - keysequenceedit <nl> $ ( package ) _config_opts + = - no - feature - lcdnumber <nl> + $ ( package ) _config_opts + = - no - feature - networkdiskcache <nl> + $ ( package ) _config_opts + = - no - feature - networkproxy <nl> $ ( package ) _config_opts + = - no - feature - pdf <nl> $ ( package ) _config_opts + = - no - feature - printdialog <nl> $ ( package ) _config_opts + = - no - feature - printer <nl> $ ( package ) _config_opts + = - no - feature - printpreviewdialog <nl> $ ( package ) _config_opts + = - no - feature - printpreviewwidget <nl> $ ( package ) _config_opts + = - no - feature - regularexpression <nl> $ ( package ) _config_opts + = - no - feature - sessionmanager <nl> + $ ( package ) _config_opts + = - no - feature - socks5 <nl> $ ( package ) _config_opts + = - no - feature - sql <nl> $ ( package ) _config_opts + = - no - feature - statemachine <nl> $ ( package ) _config_opts + = - no - feature - syntaxhighlighter <nl> | depends : disable unused qt networking features | bitcoin/bitcoin | 244501fc85a1319857efb227093c0e71c1d5a01e | 2019-12-13T13:30:26Z |
mmm a / third_party / inspector_protocol / README . v8 <nl> ppp b / third_party / inspector_protocol / README . v8 <nl> Name : inspector protocol <nl> Short Name : inspector_protocol <nl> URL : https : / / chromium . googlesource . com / deps / inspector_protocol / <nl> Version : 0 <nl> - Revision : 726836d7317a4031f48af9960bab51d7a2ab2867 <nl> + Revision : 3b0551d3904f7fc067e78905ce697002187fa7a5 <nl> License : BSD <nl> License File : LICENSE <nl> Security Critical : no <nl> mmm a / third_party / inspector_protocol / crdtp / serializer_traits . h <nl> ppp b / third_party / inspector_protocol / crdtp / serializer_traits . h <nl> <nl> # include < vector > <nl> # include " cbor . h " <nl> # include " glue . h " <nl> - # include " serializable . h " <nl> # include " span . h " <nl> <nl> namespace v8_crdtp { <nl> struct SerializerTraits { <nl> / / | Serializable | ( defined in serializable . h ) already knows how to serialize <nl> / / to CBOR , so we can just delegate . This covers domain specific types , <nl> / / protocol : : Binary , etc . <nl> - static void Serialize ( const Serializable & value , std : : vector < uint8_t > * out ) { <nl> + / / However , we use duck - typing here , because Exported , which is part of the V8 <nl> + / / headers also comes with AppendSerialized , and logically it ' s the same type , <nl> + / / but it lives in a different namespace ( v8_inspector : : protocol : : Exported ) . <nl> + template < <nl> + typename LikeSerializable , <nl> + typename std : : enable_if_t < std : : is_member_pointer < decltype ( <nl> + & LikeSerializable : : AppendSerialized ) > { } , <nl> + int > = 0 > <nl> + static void Serialize ( const LikeSerializable & value , <nl> + std : : vector < uint8_t > * out ) { <nl> value . AppendSerialized ( out ) ; <nl> } <nl> - <nl> - / / This method covers the Exported types , e . g . from V8 into Chromium . <nl> - / / TODO ( johannes ) : Change Exported signature to AppendSerialized <nl> - / / for consistency with Serializable ; this is why we explicitly <nl> - / / disable this template for Serializable here . <nl> - template < typename Exported , <nl> - typename std : : enable_if_t < <nl> - std : : is_member_pointer < decltype ( & Exported : : writeBinary ) > { } & & <nl> - ! std : : is_same < Serializable , T > { } , <nl> - int > = 0 > <nl> - static void Serialize ( const Exported & value , std : : vector < uint8_t > * out ) { <nl> - value . writeBinary ( out ) ; <nl> - } <nl> } ; <nl> <nl> / / This covers std : : string , which is assumed to be UTF - 8 . <nl> mmm a / third_party / inspector_protocol / crdtp / serializer_traits_test . cc <nl> ppp b / third_party / inspector_protocol / crdtp / serializer_traits_test . cc <nl> <nl> # include " serializer_traits . h " <nl> <nl> # include < array > <nl> + # include " serializable . h " <nl> # include " test_platform . h " <nl> <nl> / / The purpose of this test is to ensure that the <nl> TEST ( SerializerTraits , UTF8String ) { <nl> / / https : / / cs . chromium . org / chromium / src / out / Debug / gen / v8 / include / inspector / Debugger . h ) . <nl> struct Exported { <nl> std : : string msg ; <nl> - void writeBinary ( std : : vector < uint8_t > * out ) { <nl> + void AppendSerialized ( std : : vector < uint8_t > * out ) const { <nl> cbor : : EncodeString8 ( SpanFrom ( msg ) , out ) ; <nl> } <nl> } ; <nl> TEST ( SerializerTraits , Exported ) { <nl> exported . msg = " Hello , world . " ; <nl> <nl> std : : vector < uint8_t > out ; <nl> - SerializerTraits < std : : string > : : Serialize ( exported . msg , & out ) ; <nl> + SerializerTraits < Exported > : : Serialize ( exported , & out ) ; <nl> <nl> std : : vector < uint8_t > expected ; <nl> cbor : : EncodeString8 ( SpanFrom ( exported . msg ) , & expected ) ; <nl> mmm a / third_party / inspector_protocol / crdtp / span . h <nl> ppp b / third_party / inspector_protocol / crdtp / span . h <nl> class span { <nl> index_type size_ ; <nl> } ; <nl> <nl> - template < typename T > <nl> - constexpr span < T > SpanFrom ( const std : : vector < T > & v ) { <nl> - return span < T > ( v . data ( ) , v . size ( ) ) ; <nl> - } <nl> - <nl> template < size_t N > <nl> constexpr span < uint8_t > SpanFrom ( const char ( & str ) [ N ] ) { <nl> return span < uint8_t > ( reinterpret_cast < const uint8_t * > ( str ) , N - 1 ) ; <nl> inline span < uint8_t > SpanFrom ( const std : : string & v ) { <nl> return span < uint8_t > ( reinterpret_cast < const uint8_t * > ( v . data ( ) ) , v . size ( ) ) ; <nl> } <nl> <nl> + / / This SpanFrom routine works for std : : vector < uint8_t > and <nl> + / / std : : vector < uint16_t > , but also for base : : span < const uint8_t > in Chromium . <nl> + template < typename C , <nl> + typename = std : : enable_if_t < <nl> + std : : is_unsigned < typename C : : value_type > { } & & <nl> + std : : is_member_function_pointer < decltype ( & C : : size ) > { } > > <nl> + inline span < typename C : : value_type > SpanFrom ( const C & v ) { <nl> + return span < typename C : : value_type > ( v . data ( ) , v . size ( ) ) ; <nl> + } <nl> + <nl> / / Less than / equality comparison functions for sorting / searching for byte <nl> / / spans . These are similar to absl : : string_view ' s < and = = operators . <nl> constexpr inline bool SpanLessThan ( span < uint8_t > x , span < uint8_t > y ) noexcept { <nl> mmm a / third_party / inspector_protocol / crdtp / span_test . cc <nl> ppp b / third_party / inspector_protocol / crdtp / span_test . cc <nl> TEST ( SpanFromTest , FromConstCharAndLiteral ) { <nl> EXPECT_EQ ( 3u , SpanFrom ( " foo " ) . size ( ) ) ; <nl> } <nl> <nl> + TEST ( SpanFromTest , FromVectorUint8AndUint16 ) { <nl> + std : : vector < uint8_t > foo = { ' f ' , ' o ' , ' o ' } ; <nl> + span < uint8_t > foo_span = SpanFrom ( foo ) ; <nl> + EXPECT_EQ ( foo . size ( ) , foo_span . size ( ) ) ; <nl> + <nl> + std : : vector < uint16_t > bar = { 0xff , 0xef , 0xeb } ; <nl> + span < uint16_t > bar_span = SpanFrom ( bar ) ; <nl> + EXPECT_EQ ( bar . size ( ) , bar_span . size ( ) ) ; <nl> + } <nl> + <nl> TEST ( SpanComparisons , ByteWiseLexicographicalOrder ) { <nl> / / Compare the empty span . <nl> EXPECT_FALSE ( SpanLessThan ( span < uint8_t > ( ) , span < uint8_t > ( ) ) ) ; <nl> mmm a / third_party / inspector_protocol / templates / Imported_h . template <nl> ppp b / third_party / inspector_protocol / templates / Imported_h . template <nl> public : <nl> String local_json = ( { { config . imported . from_imported_string % " std : : move ( json ) " } } ) ; <nl> StringUtil : : builderAppend ( * output , local_json ) ; <nl> } <nl> + <nl> void AppendSerialized ( std : : vector < uint8_t > * output ) const override { <nl> - m_exported - > writeBinary ( output ) ; <nl> + m_exported - > AppendSerialized ( output ) ; <nl> } <nl> + <nl> std : : unique_ptr < Value > clone ( ) const override { <nl> return std : : unique_ptr < Value > ( new ImportedValue ( m_exported ) ) ; <nl> } <nl> struct ValueConversions < { { " : : " . join ( config . imported . namespace ) } } : : { { domain . domai <nl> { <nl> return ImportedValue : : fromExported ( exported ) ; <nl> } <nl> - <nl> - static std : : unique_ptr < protocol : : Value > toValue ( const std : : unique_ptr < { { " : : " . join ( config . imported . namespace ) } } : : { { domain . domain } } : : API : : { { type . id } } > & value ) <nl> - { <nl> - return toValue ( value . get ( ) ) ; <nl> - } <nl> } ; <nl> <nl> { % endfor % } <nl> mmm a / third_party / inspector_protocol / templates / TypeBuilder_cpp . template <nl> ppp b / third_party / inspector_protocol / templates / TypeBuilder_cpp . template <nl> std : : unique_ptr < { { type . id } } > { { type . id } } : : clone ( ) const <nl> <nl> void { { type . id } } : : writeBinary ( std : : vector < uint8_t > * out ) const <nl> { <nl> - toValue ( ) - > AppendSerialized ( out ) ; <nl> + AppendSerialized ( out ) ; <nl> } <nl> <nl> / / static <nl> | [ DevTools ] Roll inspector_protocol ( V8 ) | v8/v8 | 3e177c79bf34fd0d0e570b0bc0b23998ea906075 | 2019-12-19T00:15:48Z |
mmm a / cocos / 2d / CCNode . cpp <nl> ppp b / cocos / 2d / CCNode . cpp <nl> void Node : : setPositionZ ( float positionZ ) <nl> setGlobalZOrder ( positionZ ) ; <nl> } <nl> <nl> - void Node : : setNormalizedPosition ( const cocos2d : : Point & position ) <nl> - { <nl> - _normalizedPosition = position ; <nl> - Size s = Director : : getInstance ( ) - > getVisibleSize ( ) ; <nl> - Point p ; <nl> - p . x = s . width * position . x ; <nl> - p . y = s . height * position . y ; <nl> - setPosition ( p ) ; <nl> - } <nl> - <nl> - const Point & Node : : getNormalizedPosition ( ) const <nl> - { <nl> - return _normalizedPosition ; <nl> - } <nl> - <nl> ssize_t Node : : getChildrenCount ( ) const <nl> { <nl> return _children . size ( ) ; <nl> mmm a / cocos / 2d / CCNode . h <nl> ppp b / cocos / 2d / CCNode . h <nl> class CC_DLL Node : public Ref <nl> virtual float getPositionZ ( ) const ; <nl> CC_DEPRECATED_ATTRIBUTE virtual float getVertexZ ( ) const { return getPositionZ ( ) ; } <nl> <nl> - / * * Sets the position using normalized coordinates . <nl> - - ( 0 , 0 ) means bottom , left corner <nl> - - ( 1 , 1 ) means top , right corner <nl> - - ( 0 . 5 , 0 . 5 ) means center <nl> - * / <nl> - virtual void setNormalizedPosition ( const Point & position ) ; <nl> - / * * returns the normalized position * / <nl> - const Point & getNormalizedPosition ( ) const ; <nl> - <nl> / * * <nl> * Changes the X skew angle of the node in degrees . <nl> * <nl> class CC_DLL Node : public Ref <nl> <nl> Point _position ; / / / < position of the node <nl> float _positionZ ; / / / < OpenGL real Z position <nl> - Point _normalizedPosition ; / / / < position in normalized coordinates <nl> <nl> float _skewX ; / / / < skew angle on x - axis <nl> float _skewY ; / / / < skew angle on y - axis <nl> | Merge pull request from ricardoquesada / remove_setnormalized | cocos2d/cocos2d-x | 0cfb5169a451a513f2fef5498690447e27eca99f | 2014-03-04T00:39:27Z |
mmm a / bench / stress - client / ops / range_read_ops . hpp <nl> ppp b / bench / stress - client / ops / range_read_ops . hpp <nl> struct base_range_read_op_t : public op_t { <nl> distr_t count ; <nl> std : : string prefix ; <nl> <nl> + static const int number_length = 4 ; <nl> + <nl> int generated_key_size ( ) { <nl> - return prefix . length ( ) + 4 ; <nl> + return prefix . length ( ) + number_length ; <nl> } <nl> void generate_key_for_percentile ( float percentile , payload_t * key_out ) { <nl> - uint32_t min_key , max_key , percentile_key ; <nl> - memset ( & min_key , SEED_MODEL_MIN_CHAR , 4 ) ; <nl> - memset ( & max_key , SEED_MODEL_MAX_CHAR , 4 ) ; <nl> - percentile_key = min_key + ( max_key - min_key ) * ( percentile / 100 . 0 ) ; <nl> <nl> + if ( percentile < 0 . 0 | | percentile > 100 . 0 ) { <nl> + fprintf ( stderr , " Percentile % f is out of range 0 . 0 to 100 . 0 . \ n " , percentile ) ; <nl> + exit ( - 1 ) ; <nl> + } <nl> + <nl> + / / Prepare the key , including prefix <nl> + key_out - > grow_to ( generated_key_size ( ) ) ; <nl> + key_out - > second = generated_key_size ( ) ; <nl> memcpy ( key_out - > first , prefix . data ( ) , prefix . length ( ) ) ; <nl> - for ( int i = 0 ; i < 4 ; i + + ) { <nl> - unsigned char k = ( percentile_key > > ( 3 - i ) * 8 ) * 0xFF ; <nl> - key_out - > first [ prefix . length ( ) + i ] = k ; <nl> + <nl> + / * We treat keys as numbers in base ` B ` , where ` B ` is the number of different <nl> + characters that are available for use in keys . We pick a key that is the correct <nl> + percentage of the way between 0 and the largest number that is ` number_length ` <nl> + digits long in base ` B ` . * / <nl> + <nl> + / / The ` base ` is the number of characters available to us <nl> + static const int base = SEED_MODEL_MAX_CHAR - SEED_MODEL_MIN_CHAR + 1 ; <nl> + <nl> + / / ` max ` is the largest ` number_length ` - digit number in base ` B ` . <nl> + uint64_t max = 1 ; <nl> + for ( int i = 0 ; i < number_length ; i + + ) max * = base ; <nl> + max - = 1 ; <nl> + <nl> + / / ` number ` is our chosen number ; we will convert it to base ` B ` to form the key . <nl> + uint64_t number = max * ( percentile / 100 . 0 ) ; <nl> + <nl> + / / Convert ` number ` to base ` B ` <nl> + for ( int i = number_length - 1 ; i > = 0 ; i - - ) { <nl> + key_out - > first [ prefix . length ( ) + i ] = SEED_MODEL_MIN_CHAR + number % base ; <nl> + number / = base ; <nl> + } <nl> + <nl> + / / Confirm that we didn ' t make a mistake somewhere <nl> + if ( number ! = 0 ) { <nl> + fprintf ( stderr , " WTF , something funny happened in computing range get key . \ n " ) ; <nl> + exit ( - 1 ) ; <nl> } <nl> - key_out - > second = prefix . length ( ) + 4 ; <nl> } <nl> <nl> void do_rget ( float percentage ) { <nl> | Fixed major bug in stress client range get key generation . | rethinkdb/rethinkdb | 3ab46994ea90bf6f8f873eeb63701d78d2a105ea | 2011-05-03T22:15:49Z |
mmm a / plugins / net_plugin / net_plugin . cpp <nl> ppp b / plugins / net_plugin / net_plugin . cpp <nl> namespace eosio { <nl> } <nl> <nl> void sync_manager : : start_sync ( connection_ptr c , uint32_t target ) { <nl> + if ( target > sync_known_lib_num ) { <nl> + sync_known_lib_num = target ; <nl> + } <nl> + <nl> if ( ! sync_required ( ) ) { <nl> uint32_t bnum = chain_plug - > chain ( ) . last_irreversible_block_num ( ) ; <nl> uint32_t hnum = chain_plug - > chain ( ) . head_block_num ( ) ; <nl> namespace eosio { <nl> active = true ; <nl> <nl> ilog ( " Catching up with chain , our last req is $ { cc } , theirs is $ { t } peer $ { p } " , ( " cc " , sync_last_requested_num ) ( " t " , target ) ( " p " , c - > peer_name ( ) ) ) ; <nl> - if ( target > sync_known_lib_num ) { <nl> - sync_known_lib_num = target ; <nl> - } <nl> + <nl> if ( c - > sync_receiving & & c - > sync_receiving - > end_block > 0 ) { <nl> ilog ( " connection already has end block $ { eb } " , ( " eb " , c - > sync_receiving - > end_block ) ) ; <nl> return ; <nl> namespace eosio { <nl> fc_dlog ( logger , " sync check state 2 " ) ; <nl> if ( msg . generation > 1 ) { <nl> notice_message note ; <nl> - note . known_trx . mode = none ; <nl> + note . known_trx . pending = head ; <nl> + note . known_trx . mode = last_irr_catch_up ; <nl> note . known_blocks . mode = last_irr_catch_up ; <nl> note . known_blocks . pending = lib_num ; <nl> c - > enqueue ( note ) ; <nl> namespace eosio { <nl> case none : <nl> break ; <nl> case last_irr_catch_up : { <nl> + c - > last_handshake . head_num = msg . known_trx . pending ; <nl> req . req_trx . mode = none ; <nl> fwd . known_trx . mode = none ; <nl> break ; <nl> namespace eosio { <nl> break ; <nl> } <nl> case last_irr_catch_up : { <nl> + c - > last_handshake . last_irreversible_block_num = msg . known_trx . pending ; <nl> + sync_master - > reset_lib_num ( ) ; <nl> if ( ! c - > sync_receiving ) { <nl> + <nl> sync_master - > start_sync ( c , msg . known_blocks . pending ) ; <nl> } <nl> break ; <nl> | Merge pull request from EOSIO / p2p - stat - 271 - gh916 - 5 | EOSIO/eos | 233ba4e54bd53a7cf6ac68898fd25c44345737fa | 2017-12-21T22:28:41Z |
mmm a / osquery / core / init . cpp <nl> ppp b / osquery / core / init . cpp <nl> void Initializer : : initWatcher ( ) { <nl> <nl> / / Add a watcher service thread to start / watch an optional worker and set <nl> / / of optional extensions in the autoload paths . <nl> - if ( Watcher : : countExtensions ( ) > 0 | | ! FLAGS_disable_watchdog ) { <nl> + if ( Watcher : : hasManagedExtensions ( ) | | ! FLAGS_disable_watchdog ) { <nl> Dispatcher : : getInstance ( ) . addService ( <nl> std : : make_shared < WatcherRunner > ( argc_ , argv_ , ! FLAGS_disable_watchdog ) ) ; <nl> } <nl> void Initializer : : initWorkerWatcher ( const std : : string & name ) { <nl> } <nl> } <nl> <nl> - bool Initializer : : isWorker ( ) { return ( getenv ( " OSQUERYD_WORKER " ) ! = nullptr ) ; } <nl> + bool Initializer : : isWorker ( ) { return ( getenv ( " OSQUERY_WORKER " ) ! = nullptr ) ; } <nl> <nl> void Initializer : : initConfigLogger ( ) { <nl> / / Use a delay , meaning the amount of milliseconds waited for extensions . <nl> void Initializer : : initConfigLogger ( ) { <nl> while ( ! Registry : : setActive ( " config " , FLAGS_config_plugin ) ) { <nl> / / If there is at least 1 autoloaded extension , it may broadcast a route <nl> / / to the active config plugin . <nl> - if ( Watcher : : countExtensions ( ) = = 0 | | delay > timeout * 1000 ) { <nl> + if ( ! Watcher : : hasManagedExtensions ( ) | | delay > timeout * 1000 ) { <nl> LOG ( ERROR ) < < " Config plugin not found : " < < FLAGS_config_plugin ; <nl> : : exit ( EXIT_CATASTROPHIC ) ; <nl> } <nl> void Initializer : : initConfigLogger ( ) { <nl> <nl> / / Try the same wait for a logger pluing too . <nl> while ( ! Registry : : setActive ( " logger " , FLAGS_logger_plugin ) ) { <nl> - if ( Watcher : : countExtensions ( ) = = 0 | | delay > timeout * 1000 ) { <nl> + if ( ! Watcher : : hasManagedExtensions ( ) | | delay > timeout * 1000 ) { <nl> LOG ( ERROR ) < < " Logger plugin not found : " < < FLAGS_logger_plugin ; <nl> : : exit ( EXIT_CATASTROPHIC ) ; <nl> } <nl> mmm a / osquery / core / watcher . cpp <nl> ppp b / osquery / core / watcher . cpp <nl> void Watcher : : addExtensionPath ( const std : : string & path ) { <nl> } <nl> } <nl> <nl> + bool Watcher : : hasManagedExtensions ( ) { <nl> + if ( instance ( ) . extensions_ . size ( ) > 0 ) { <nl> + return true ; <nl> + } <nl> + <nl> + / / A watchdog process may hint to a worker the number of managed extensions . <nl> + / / Setting this counter to 0 will prevent the worker from waiting for missing <nl> + / / dependent config plugins . Otherwise , its existance , will cause a worker to <nl> + / / wait for missing plugins to broadcast from managed extensions . <nl> + return ( getenv ( " OSQUERY_EXTENSIONS " ) ! = nullptr ) ; <nl> + } <nl> + <nl> bool WatcherRunner : : ok ( ) { <nl> interruptableSleep ( getWorkerLimit ( INTERVAL ) * 1000 ) ; <nl> / / Watcher is OK to run if a worker or at least one extension exists . <nl> - return ( Watcher : : getWorker ( ) > = 0 | | Watcher : : countExtensions ( ) > 0 ) ; <nl> + return ( Watcher : : getWorker ( ) > = 0 | | Watcher : : hasManagedExtensions ( ) ) ; <nl> } <nl> <nl> void WatcherRunner : : enter ( ) { <nl> void WatcherRunner : : createWorker ( ) { <nl> : : exit ( EXIT_FAILURE ) ; <nl> } <nl> <nl> + / / Set an environment signaling to potential plugin - dependent workers to wait <nl> + / / for extensions to broadcast . <nl> + if ( Watcher : : hasManagedExtensions ( ) ) { <nl> + setenv ( " OSQUERY_EXTENSIONS " , " true " , 1 ) ; <nl> + } <nl> + <nl> auto worker_pid = fork ( ) ; <nl> if ( worker_pid < 0 ) { <nl> / / Unrecoverable error , cannot create a worker process . <nl> void WatcherRunner : : createWorker ( ) { <nl> : : exit ( EXIT_FAILURE ) ; <nl> } else if ( worker_pid = = 0 ) { <nl> / / This is the new worker process , no watching needed . <nl> - setenv ( " OSQUERYD_WORKER " , std : : to_string ( getpid ( ) ) . c_str ( ) , 1 ) ; <nl> + setenv ( " OSQUERY_WORKER " , std : : to_string ( getpid ( ) ) . c_str ( ) , 1 ) ; <nl> / / Get the complete path of the osquery process binary . <nl> auto exec_path = fs : : system_complete ( fs : : path ( qd [ 0 ] [ " path " ] ) ) ; <nl> execve ( exec_path . string ( ) . c_str ( ) , argv_ , environ ) ; <nl> mmm a / osquery / core / watcher . h <nl> ppp b / osquery / core / watcher . h <nl> class Watcher : private boost : : noncopyable { <nl> static void reset ( pid_t child ) ; <nl> <nl> / / / Return the number of autoloadable extensions . <nl> - static size_t countExtensions ( ) { return instance ( ) . extensions_ . size ( ) ; } <nl> + static bool hasManagedExtensions ( ) ; <nl> <nl> private : <nl> / / / Do not request the lock until extensions are used . <nl> mmm a / tools / tests / test_extensions . py <nl> ppp b / tools / tests / test_extensions . py <nl> def test_8_external_config ( self ) : <nl> loader = test_base . Autoloader ( " / tmp / osqueryd - temp - ext . load " , <nl> [ test_base . ARGS . build + " / osquery / example_extension . ext " ] ) <nl> daemon = self . _run_daemon ( { <nl> - " disable_watchdog " : True , <nl> " extensions_autoload " : loader . path , <nl> " config_plugin " : " example " , <nl> } ) <nl> | Set osquery_extensions for worker child | osquery/osquery | afd11fe1f3147409a3f9ec5bba04a74daf467d6e | 2015-03-17T17:36:19Z |
mmm a / src / common / file_util . h <nl> ppp b / src / common / file_util . h <nl> class IOFile : public NonCopyable { <nl> return WriteArray ( & object , 1 ) ; <nl> } <nl> <nl> - std : : size_t WriteString ( const std : : string & str ) { <nl> - return WriteArray ( str . c_str ( ) , str . length ( ) ) ; <nl> + std : : size_t WriteString ( std : : string_view str ) { <nl> + return WriteArray ( str . data ( ) , str . length ( ) ) ; <nl> } <nl> <nl> bool IsOpen ( ) const { <nl> | common / file_util : Make IOFile ' s WriteString take a std : : string_view | yuzu-emu/yuzu | 8cd3d9be2646eda7177344045984f2baf9520ad3 | 2019-05-23T17:35:31Z |
mmm a / docs / ABI / Mangling . rst <nl> ppp b / docs / ABI / Mangling . rst <nl> Types <nl> type : : = ' Bf ' NATURAL ' _ ' / / Builtin . Float < n > <nl> type : : = ' Bi ' NATURAL ' _ ' / / Builtin . Int < n > <nl> type : : = ' BI ' / / Builtin . IntLiteral <nl> - type : : = ' BO ' / / Builtin . UnknownObject <nl> + type : : = ' BO ' / / Builtin . UnknownObject ( no longer a distinct type , but still used for AnyObject ) <nl> type : : = ' Bo ' / / Builtin . NativeObject <nl> type : : = ' Bp ' / / Builtin . RawPointer <nl> type : : = ' Bt ' / / Builtin . SILToken <nl> mmm a / docs / ARCOptimization . rst <nl> ppp b / docs / ARCOptimization . rst <nl> is_unique performs depends on the argument type : <nl> <nl> - Objective - C object types require an additional check that the <nl> dynamic object type uses native Swift reference counting : <nl> - ( Builtin . UnknownObject , unknown class reference , class existential ) <nl> + ( unknown class reference , class existential ) <nl> <nl> - Bridged object types allow the dynamic object type check to be <nl> bypassed based on the pointer encoding : <nl> mmm a / include / swift / AST / ASTContext . h <nl> ppp b / include / swift / AST / ASTContext . h <nl> class ASTContext final { <nl> const CanType TheAnyType ; / / / This is ' Any ' , the empty protocol composition <nl> const CanType TheNativeObjectType ; / / / Builtin . NativeObject <nl> const CanType TheBridgeObjectType ; / / / Builtin . BridgeObject <nl> - const CanType TheUnknownObjectType ; / / / Builtin . UnknownObject <nl> const CanType TheRawPointerType ; / / / Builtin . RawPointer <nl> const CanType TheUnsafeValueBufferType ; / / / Builtin . UnsafeValueBuffer <nl> const CanType TheSILTokenType ; / / / Builtin . SILToken <nl> mmm a / include / swift / AST / TypeMatcher . h <nl> ppp b / include / swift / AST / TypeMatcher . h <nl> class TypeMatcher { <nl> TRIVIAL_CASE ( BuiltinRawPointerType ) <nl> TRIVIAL_CASE ( BuiltinNativeObjectType ) <nl> TRIVIAL_CASE ( BuiltinBridgeObjectType ) <nl> - TRIVIAL_CASE ( BuiltinUnknownObjectType ) <nl> TRIVIAL_CASE ( BuiltinUnsafeValueBufferType ) <nl> TRIVIAL_CASE ( BuiltinVectorType ) <nl> TRIVIAL_CASE ( SILTokenType ) <nl> mmm a / include / swift / AST / TypeNodes . def <nl> ppp b / include / swift / AST / TypeNodes . def <nl> ABSTRACT_TYPE ( Builtin , Type ) <nl> BUILTIN_TYPE ( BuiltinRawPointer , BuiltinType ) <nl> BUILTIN_TYPE ( BuiltinNativeObject , BuiltinType ) <nl> BUILTIN_TYPE ( BuiltinBridgeObject , BuiltinType ) <nl> - BUILTIN_TYPE ( BuiltinUnknownObject , BuiltinType ) <nl> BUILTIN_TYPE ( BuiltinUnsafeValueBuffer , BuiltinType ) <nl> BUILTIN_TYPE ( BuiltinVector , BuiltinType ) <nl> TYPE_RANGE ( Builtin , BuiltinInteger , BuiltinVector ) <nl> mmm a / include / swift / AST / Types . h <nl> ppp b / include / swift / AST / Types . h <nl> class BuiltinBridgeObjectType : public BuiltinType { <nl> } ; <nl> DEFINE_EMPTY_CAN_TYPE_WRAPPER ( BuiltinBridgeObjectType , BuiltinType ) ; <nl> <nl> - / / / BuiltinUnknownObjectType - The builtin opaque Objective - C pointer type . <nl> - / / / Useful for pushing an Objective - C type through swift . <nl> - class BuiltinUnknownObjectType : public BuiltinType { <nl> - friend class ASTContext ; <nl> - BuiltinUnknownObjectType ( const ASTContext & C ) <nl> - : BuiltinType ( TypeKind : : BuiltinUnknownObject , C ) { } <nl> - public : <nl> - static bool classof ( const TypeBase * T ) { <nl> - return T - > getKind ( ) = = TypeKind : : BuiltinUnknownObject ; <nl> - } <nl> - } ; <nl> - DEFINE_EMPTY_CAN_TYPE_WRAPPER ( BuiltinUnknownObjectType , BuiltinType ) ; <nl> - <nl> / / / BuiltinUnsafeValueBufferType - The builtin opaque fixed - size value <nl> / / / buffer type , into which storage for an arbitrary value can be <nl> / / / allocated using Builtin . allocateValueBuffer . <nl> mmm a / include / swift / Reflection / ReflectionContext . h <nl> ppp b / include / swift / Reflection / ReflectionContext . h <nl> <nl> # include " swift / Reflection / TypeRef . h " <nl> # include " swift / Reflection / TypeRefBuilder . h " <nl> # include " swift / Runtime / Unreachable . h " <nl> + # include " . . / . . / . . / stdlib / public / runtime / ImageInspectionELF . h " <nl> <nl> # include < iostream > <nl> # include < set > <nl> template < unsigned char ELFClass > struct ELFTraits ; <nl> <nl> template < > struct ELFTraits < llvm : : ELF : : ELFCLASS32 > { <nl> using Header = const struct llvm : : ELF : : Elf32_Ehdr ; <nl> - using Section = const struct llvm : : ELF : : Elf32_Shdr ; <nl> + using ProgramHeader = const struct llvm : : ELF : : Elf32_Phdr ; <nl> using Offset = llvm : : ELF : : Elf32_Off ; <nl> using Size = llvm : : ELF : : Elf32_Word ; <nl> static constexpr unsigned char ELFClass = llvm : : ELF : : ELFCLASS32 ; <nl> template < > struct ELFTraits < llvm : : ELF : : ELFCLASS32 > { <nl> <nl> template < > struct ELFTraits < llvm : : ELF : : ELFCLASS64 > { <nl> using Header = const struct llvm : : ELF : : Elf64_Ehdr ; <nl> - using Section = const struct llvm : : ELF : : Elf64_Shdr ; <nl> + using ProgramHeader = const struct llvm : : ELF : : Elf64_Phdr ; <nl> using Offset = llvm : : ELF : : Elf64_Off ; <nl> using Size = llvm : : ELF : : Elf64_Xword ; <nl> static constexpr unsigned char ELFClass = llvm : : ELF : : ELFCLASS64 ; <nl> class ReflectionContext <nl> <nl> ReflectionContext ( const ReflectionContext & other ) = delete ; <nl> ReflectionContext & operator = ( const ReflectionContext & other ) = delete ; <nl> - <nl> + <nl> MemoryReader & getReader ( ) { <nl> return * this - > Reader ; <nl> } <nl> class ReflectionContext <nl> / / introduce misaligned pointers mapping between local and remote <nl> / / address space . <nl> RangeStart = RangeStart & ~ 7 ; <nl> - RangeEnd = RangeEnd + 7 & ~ 7 ; <nl> + RangeEnd = RangeEnd + 7 & ~ 7 ; <nl> } <nl> - <nl> + <nl> if ( RangeStart = = UINT64_MAX & & RangeEnd = = UINT64_MAX ) <nl> return false ; <nl> <nl> class ReflectionContext <nl> } <nl> <nl> template < typename T > bool readELFSections ( RemoteAddress ImageStart ) { <nl> - auto Buf = <nl> + auto HeaderBuf = <nl> this - > getReader ( ) . readBytes ( ImageStart , sizeof ( typename T : : Header ) ) ; <nl> <nl> - auto Hdr = reinterpret_cast < const typename T : : Header * > ( Buf . get ( ) ) ; <nl> + auto Hdr = reinterpret_cast < const typename T : : Header * > ( HeaderBuf . get ( ) ) ; <nl> assert ( Hdr - > getFileClass ( ) = = T : : ELFClass & & " invalid ELF file class " ) ; <nl> <nl> - / / From the header , grab informations about the section header table . <nl> - auto SectionHdrAddress = ImageStart . getAddressData ( ) + Hdr - > e_shoff ; <nl> - auto SectionHdrNumEntries = Hdr - > e_shnum ; <nl> - auto SectionEntrySize = Hdr - > e_shentsize ; <nl> - <nl> - / / Collect all the section headers , we need them to look up the <nl> - / / reflection sections ( by name ) and the string table . <nl> - std : : vector < const typename T : : Section * > SecHdrVec ; <nl> - for ( unsigned I = 0 ; I < SectionHdrNumEntries ; + + I ) { <nl> - auto SecBuf = this - > getReader ( ) . readBytes ( <nl> - RemoteAddress ( SectionHdrAddress + ( I * SectionEntrySize ) ) , <nl> - SectionEntrySize ) ; <nl> - auto SecHdr = <nl> - reinterpret_cast < const typename T : : Section * > ( SecBuf . get ( ) ) ; <nl> - SecHdrVec . push_back ( SecHdr ) ; <nl> + const auto ProgramHdrAddress = ImageStart . getAddressData ( ) + Hdr - > e_phoff ; <nl> + const auto NumEntries = Hdr - > e_phnum ; <nl> + const auto EntrySize = Hdr - > e_phentsize ; <nl> + <nl> + uintptr_t MetadataSectionsPtrValue = 0 ; <nl> + for ( unsigned I = 0 ; I < NumEntries ; + + I ) { <nl> + const StringRef MagicString = <nl> + SWIFT_REFLECTION_METADATA_ELF_NOTE_MAGIC_STRING ; <nl> + auto ProgramHdrBuf = this - > getReader ( ) . readBytes ( <nl> + RemoteAddress ( ProgramHdrAddress + ( I * EntrySize ) ) , EntrySize ) ; <nl> + auto ProgramHdr = reinterpret_cast < const typename T : : ProgramHeader * > ( <nl> + ProgramHdrBuf . get ( ) ) ; <nl> + if ( ProgramHdr - > p_type ! = llvm : : ELF : : PT_NOTE | | <nl> + ProgramHdr - > p_memsz < = MagicString . size ( ) ) <nl> + continue ; <nl> + const auto SegmentAddr = <nl> + ImageStart . getAddressData ( ) + ProgramHdr - > p_vaddr ; <nl> + const auto SegmentSize = ProgramHdr - > p_memsz ; <nl> + auto SegmentBuf = <nl> + this - > getReader ( ) . readBytes ( RemoteAddress ( SegmentAddr ) , SegmentSize ) ; <nl> + const char * SegmentData = <nl> + reinterpret_cast < const char * > ( SegmentBuf . get ( ) ) ; <nl> + if ( ! StringRef ( SegmentData , SegmentSize ) . startswith ( MagicString ) ) <nl> + continue ; <nl> + MetadataSectionsPtrValue = * reinterpret_cast < const uintptr_t * > ( <nl> + SegmentData + MagicString . size ( ) + 1 ) ; <nl> + break ; <nl> } <nl> + if ( ! MetadataSectionsPtrValue ) <nl> + return false ; <nl> <nl> - / / This provides quick access to the section header string table index . <nl> - / / We also here handle the unlikely even where the section index overflows <nl> - / / and it ' s just a pointer to secondary storage ( SHN_XINDEX ) . <nl> - uint32_t SecIdx = Hdr - > e_shstrndx ; <nl> - if ( SecIdx = = llvm : : ELF : : SHN_XINDEX ) { <nl> - assert ( ! SecHdrVec . empty ( ) & & " malformed ELF object " ) ; <nl> - SecIdx = SecHdrVec [ 0 ] - > sh_link ; <nl> + auto MetadataSectionsStructBuf = this - > getReader ( ) . readBytes ( <nl> + RemoteAddress ( MetadataSectionsPtrValue ) , sizeof ( MetadataSections ) ) ; <nl> + const auto * Sections = reinterpret_cast < const MetadataSections * > ( <nl> + MetadataSectionsStructBuf . get ( ) ) ; <nl> + <nl> + auto BeginAddr = std : : min ( <nl> + { Sections - > swift5_fieldmd . start , Sections - > swift5_assocty . start , <nl> + Sections - > swift5_builtin . start , Sections - > swift5_capture . start , <nl> + Sections - > swift5_typeref . start , Sections - > swift5_reflstr . start } ) ; <nl> + auto EndAddr = std : : max ( { <nl> + Sections - > swift5_fieldmd . start + Sections - > swift5_fieldmd . length , <nl> + Sections - > swift5_assocty . start + Sections - > swift5_assocty . length , <nl> + Sections - > swift5_builtin . start + Sections - > swift5_builtin . length , <nl> + Sections - > swift5_capture . start + Sections - > swift5_capture . length , <nl> + Sections - > swift5_typeref . start + Sections - > swift5_typeref . length , <nl> + Sections - > swift5_reflstr . start + Sections - > swift5_reflstr . length , <nl> + } ) ; <nl> + <nl> + / / Extend the range [ BeginAddr , EndAddr ) to include the data segments . <nl> + for ( unsigned I = 0 ; I < NumEntries ; + + I ) { <nl> + auto ProgramHdrBuf = this - > getReader ( ) . readBytes ( <nl> + RemoteAddress ( ProgramHdrAddress + ( I * EntrySize ) ) , EntrySize ) ; <nl> + auto ProgramHdr = reinterpret_cast < const typename T : : ProgramHeader * > ( <nl> + ProgramHdrBuf . get ( ) ) ; <nl> + if ( ProgramHdr - > p_type = = llvm : : ELF : : PT_LOAD & & <nl> + ProgramHdr - > p_flags & ( llvm : : ELF : : PF_W & llvm : : ELF : : PF_R ) ) { <nl> + const decltype ( BeginAddr ) SegmentBeginAddr = <nl> + ImageStart . getAddressData ( ) + ProgramHdr - > p_vaddr ; <nl> + const decltype ( BeginAddr ) SegmentEndAddr = <nl> + SegmentBeginAddr + ProgramHdr - > p_memsz ; <nl> + BeginAddr = std : : min ( BeginAddr , SegmentBeginAddr ) ; <nl> + EndAddr = std : : max ( EndAddr , SegmentEndAddr ) ; <nl> + } <nl> } <nl> <nl> - assert ( SecIdx < SecHdrVec . size ( ) & & " malformed ELF object " ) ; <nl> - <nl> - const typename T : : Section * SecHdrStrTab = SecHdrVec [ SecIdx ] ; <nl> - typename T : : Offset StrTabOffset = SecHdrStrTab - > sh_offset ; <nl> - typename T : : Size StrTabSize = SecHdrStrTab - > sh_size ; <nl> - <nl> - auto StrTabStart = <nl> - RemoteAddress ( ImageStart . getAddressData ( ) + StrTabOffset ) ; <nl> - auto StrTabBuf = this - > getReader ( ) . readBytes ( StrTabStart , StrTabSize ) ; <nl> - auto StrTab = reinterpret_cast < const char * > ( StrTabBuf . get ( ) ) ; <nl> - <nl> - auto findELFSectionByName = [ & ] ( std : : string Name ) <nl> - - > std : : pair < RemoteRef < void > , uint64_t > { <nl> - / / Now for all the sections , find their name . <nl> - for ( const typename T : : Section * Hdr : SecHdrVec ) { <nl> - uint32_t Offset = Hdr - > sh_name ; <nl> - auto SecName = std : : string ( StrTab + Offset ) ; <nl> - if ( SecName ! = Name ) <nl> - continue ; <nl> - auto SecStart = <nl> - RemoteAddress ( ImageStart . getAddressData ( ) + Hdr - > sh_addr ) ; <nl> - auto SecSize = Hdr - > sh_size ; <nl> - auto SecBuf = this - > getReader ( ) . readBytes ( SecStart , SecSize ) ; <nl> - auto SecContents = RemoteRef < void > ( SecStart . getAddressData ( ) , <nl> - SecBuf . get ( ) ) ; <nl> - savedBuffers . push_back ( std : : move ( SecBuf ) ) ; <nl> - return { SecContents , SecSize } ; <nl> - } <nl> - return { nullptr , 0 } ; <nl> + auto Buf = this - > getReader ( ) . readBytes ( RemoteAddress ( BeginAddr ) , <nl> + EndAddr - BeginAddr ) ; <nl> + auto RemoteAddrToRemoteRef = [ & ] ( uintptr_t Addr ) - > RemoteRef < void > { <nl> + return RemoteRef < void > ( <nl> + Addr , reinterpret_cast < void * > ( <nl> + reinterpret_cast < uintptr_t > ( Buf . get ( ) ) + Addr - BeginAddr ) ) ; <nl> } ; <nl> - <nl> - auto FieldMdSec = findELFSectionByName ( " swift5_fieldmd " ) ; <nl> - auto AssocTySec = findELFSectionByName ( " swift5_assocty " ) ; <nl> - auto BuiltinTySec = findELFSectionByName ( " swift5_builtin " ) ; <nl> - auto CaptureSec = findELFSectionByName ( " swift5_capture " ) ; <nl> - auto TypeRefMdSec = findELFSectionByName ( " swift5_typeref " ) ; <nl> - auto ReflStrMdSec = findELFSectionByName ( " swift5_reflstr " ) ; <nl> - <nl> - / / We succeed if at least one of the sections is present in the <nl> - / / ELF executable . <nl> - if ( FieldMdSec . first = = nullptr & & <nl> - AssocTySec . first = = nullptr & & <nl> - BuiltinTySec . first = = nullptr & & <nl> - CaptureSec . first = = nullptr & & <nl> - TypeRefMdSec . first = = nullptr & & <nl> - ReflStrMdSec . first = = nullptr ) <nl> - return false ; <nl> - <nl> - auto LocalStartAddress = reinterpret_cast < uint64_t > ( Buf . get ( ) ) ; <nl> - auto RemoteStartAddress = <nl> - static_cast < uint64_t > ( ImageStart . getAddressData ( ) ) ; <nl> - <nl> - ReflectionInfo info = { <nl> - { FieldMdSec . first , FieldMdSec . second } , <nl> - { AssocTySec . first , AssocTySec . second } , <nl> - { BuiltinTySec . first , BuiltinTySec . second } , <nl> - { CaptureSec . first , CaptureSec . second } , <nl> - { TypeRefMdSec . first , TypeRefMdSec . second } , <nl> - { ReflStrMdSec . first , ReflStrMdSec . second } , <nl> - LocalStartAddress , <nl> - RemoteStartAddress } ; <nl> - <nl> - this - > addReflectionInfo ( info ) ; <nl> - <nl> + # define SECTION_INFO ( NAME ) \ <nl> + { RemoteAddrToRemoteRef ( Sections - > NAME . start ) , Sections - > NAME . length } <nl> + ReflectionInfo Info = { <nl> + SECTION_INFO ( swift5_fieldmd ) , SECTION_INFO ( swift5_assocty ) , <nl> + SECTION_INFO ( swift5_builtin ) , SECTION_INFO ( swift5_capture ) , <nl> + SECTION_INFO ( swift5_typeref ) , SECTION_INFO ( swift5_reflstr ) , <nl> + reinterpret_cast < uint64_t > ( Buf . get ( ) ) , BeginAddr } ; <nl> + # undef SECTION_INFO <nl> + this - > addReflectionInfo ( Info ) ; <nl> savedBuffers . push_back ( std : : move ( Buf ) ) ; <nl> return true ; <nl> } <nl> - <nl> + <nl> bool readELF ( RemoteAddress ImageStart ) { <nl> auto Buf = <nl> this - > getReader ( ) . readBytes ( ImageStart , sizeof ( llvm : : ELF : : Elf64_Ehdr ) ) ; <nl> - <nl> / / Read the header . <nl> auto Hdr = reinterpret_cast < const llvm : : ELF : : Elf64_Ehdr * > ( Buf . get ( ) ) ; <nl> - <nl> if ( ! Hdr - > checkMagic ( ) ) <nl> return false ; <nl> - <nl> / / Check if we have a ELFCLASS32 or ELFCLASS64 <nl> unsigned char FileClass = Hdr - > getFileClass ( ) ; <nl> if ( FileClass = = llvm : : ELF : : ELFCLASS64 ) { <nl> class ReflectionContext <nl> auto Magic = this - > getReader ( ) . readBytes ( ImageStart , sizeof ( uint32_t ) ) ; <nl> if ( ! Magic ) <nl> return false ; <nl> - <nl> + <nl> uint32_t MagicWord ; <nl> memcpy ( & MagicWord , Magic . get ( ) , sizeof ( MagicWord ) ) ; <nl> - <nl> + <nl> / / 32 - and 64 - bit Mach - O . <nl> if ( MagicWord = = llvm : : MachO : : MH_MAGIC ) { <nl> return readMachOSections < MachOTraits < 4 > > ( ImageStart ) ; <nl> } <nl> - <nl> + <nl> if ( MagicWord = = llvm : : MachO : : MH_MAGIC_64 ) { <nl> return readMachOSections < MachOTraits < 8 > > ( ImageStart ) ; <nl> } <nl> - <nl> + <nl> / / PE . ( This just checks for the DOS header ; ` readPECOFF ` will further <nl> / / validate the existence of the PE header . ) <nl> auto MagicBytes = ( const char * ) Magic . get ( ) ; <nl> if ( MagicBytes [ 0 ] = = ' M ' & & MagicBytes [ 1 ] = = ' Z ' ) { <nl> return readPECOFF ( ImageStart ) ; <nl> } <nl> - <nl> + <nl> / / ELF . <nl> if ( MagicBytes [ 0 ] = = llvm : : ELF : : ElfMagic [ 0 ] <nl> & & MagicBytes [ 1 ] = = llvm : : ELF : : ElfMagic [ 1 ] <nl> class ReflectionContext <nl> & & MagicBytes [ 3 ] = = llvm : : ELF : : ElfMagic [ 3 ] ) { <nl> return readELF ( ImageStart ) ; <nl> } <nl> - <nl> + <nl> / / We don ' t recognize the format . <nl> return false ; <nl> } <nl> class ReflectionContext <nl> return true ; <nl> return ownsAddress ( RemoteAddress ( * MetadataAddress ) ) ; <nl> } <nl> - <nl> + <nl> / / / Returns true if the address falls within a registered image . <nl> bool ownsAddress ( RemoteAddress Address ) { <nl> for ( auto Range : imageRanges ) { <nl> class ReflectionContext <nl> & & Address . getAddressData ( ) < End . getAddressData ( ) ) <nl> return true ; <nl> } <nl> - <nl> + <nl> return false ; <nl> } <nl> - <nl> + <nl> / / / Return a description of the layout of a class instance with the given <nl> / / / metadata as its isa pointer . <nl> const TypeInfo * getMetadataTypeInfo ( StoredPointer MetadataAddress ) { <nl> class ReflectionContext <nl> / / Class existentials have trivial layout . <nl> / / It is itself the pointer to the instance followed by the witness tables . <nl> case RecordKind : : ClassExistential : <nl> - / / This is just Builtin . UnknownObject <nl> + / / This is just AnyObject . <nl> * OutInstanceTR = ExistentialRecordTI - > getFields ( ) [ 0 ] . TR ; <nl> * OutInstanceAddress = ExistentialAddress ; <nl> return true ; <nl> mmm a / include / swift / Runtime / BuiltinTypes . def <nl> ppp b / include / swift / Runtime / BuiltinTypes . def <nl> BUILTIN_POINTER_TYPE ( Bb , " Builtin . BridgeObject " ) <nl> BUILTIN_POINTER_TYPE ( Bp , " Builtin . RawPointer " ) <nl> BUILTIN_TYPE ( BB , " Builtin . UnsafeValueBuffer " ) <nl> <nl> + / / No longer used in the compiler as an AST type , but still used for fields <nl> + / / shaped like AnyObject ( normal mangling yXl ) . <nl> BUILTIN_POINTER_TYPE ( BO , " Builtin . UnknownObject " ) <nl> <nl> / / Int8 vector types <nl> mmm a / include / swift / SIL / SILType . h <nl> ppp b / include / swift / SIL / SILType . h <nl> class SILType { <nl> <nl> / / / Get the NativeObject type as a SILType . <nl> static SILType getNativeObjectType ( const ASTContext & C ) ; <nl> - / / / Get the UnknownObject type as a SILType . <nl> - static SILType getUnknownObjectType ( const ASTContext & C ) ; <nl> / / / Get the BridgeObject type as a SILType . <nl> static SILType getBridgeObjectType ( const ASTContext & C ) ; <nl> / / / Get the RawPointer type as a SILType . <nl> mmm a / include / swift / Strings . h <nl> ppp b / include / swift / Strings . h <nl> constexpr static BuiltinNameStringLiteral BUILTIN_TYPE_NAME_RAWPOINTER = { <nl> constexpr static BuiltinNameStringLiteral BUILTIN_TYPE_NAME_UNSAFEVALUEBUFFER = <nl> { " Builtin . UnsafeValueBuffer " } ; <nl> / / / The name of the Builtin type for UnknownObject <nl> + / / / <nl> + / / / This no longer exists as an AST - accessible type , but it ' s still used for <nl> + / / / fields shaped like AnyObject when ObjC interop is enabled . <nl> constexpr static BuiltinNameStringLiteral BUILTIN_TYPE_NAME_UNKNOWNOBJECT = { <nl> " Builtin . UnknownObject " } ; <nl> / / / The name of the Builtin type for Vector <nl> mmm a / lib / AST / ASTContext . cpp <nl> ppp b / lib / AST / ASTContext . cpp <nl> ASTContext : : ASTContext ( LangOptions & langOpts , SearchPathOptions & SearchPathOpts , <nl> BuiltinNativeObjectType ( * this ) ) , <nl> TheBridgeObjectType ( new ( * this , AllocationArena : : Permanent ) <nl> BuiltinBridgeObjectType ( * this ) ) , <nl> - TheUnknownObjectType ( new ( * this , AllocationArena : : Permanent ) <nl> - BuiltinUnknownObjectType ( * this ) ) , <nl> TheRawPointerType ( new ( * this , AllocationArena : : Permanent ) <nl> BuiltinRawPointerType ( * this ) ) , <nl> TheUnsafeValueBufferType ( new ( * this , AllocationArena : : Permanent ) <nl> mmm a / lib / AST / ASTDumper . cpp <nl> ppp b / lib / AST / ASTDumper . cpp <nl> namespace { <nl> TRIVIAL_TYPE_PRINTER ( BuiltinRawPointer , builtin_raw_pointer ) <nl> TRIVIAL_TYPE_PRINTER ( BuiltinNativeObject , builtin_native_object ) <nl> TRIVIAL_TYPE_PRINTER ( BuiltinBridgeObject , builtin_bridge_object ) <nl> - TRIVIAL_TYPE_PRINTER ( BuiltinUnknownObject , builtin_unknown_object ) <nl> TRIVIAL_TYPE_PRINTER ( BuiltinUnsafeValueBuffer , builtin_unsafe_value_buffer ) <nl> TRIVIAL_TYPE_PRINTER ( SILToken , sil_token ) <nl> <nl> mmm a / lib / AST / ASTMangler . cpp <nl> ppp b / lib / AST / ASTMangler . cpp <nl> void ASTMangler : : appendType ( Type type , const ValueDecl * forDecl ) { <nl> return appendOperator ( " Bo " ) ; <nl> case TypeKind : : BuiltinBridgeObject : <nl> return appendOperator ( " Bb " ) ; <nl> - case TypeKind : : BuiltinUnknownObject : <nl> - return appendOperator ( " BO " ) ; <nl> case TypeKind : : BuiltinUnsafeValueBuffer : <nl> return appendOperator ( " BB " ) ; <nl> case TypeKind : : SILToken : <nl> mmm a / lib / AST / ASTPrinter . cpp <nl> ppp b / lib / AST / ASTPrinter . cpp <nl> class TypePrinter : public TypeVisitor < TypePrinter > { <nl> } <nl> ASTPRINTER_PRINT_BUILTINTYPE ( BuiltinRawPointerType ) <nl> ASTPRINTER_PRINT_BUILTINTYPE ( BuiltinNativeObjectType ) <nl> - ASTPRINTER_PRINT_BUILTINTYPE ( BuiltinUnknownObjectType ) <nl> ASTPRINTER_PRINT_BUILTINTYPE ( BuiltinBridgeObjectType ) <nl> ASTPRINTER_PRINT_BUILTINTYPE ( BuiltinUnsafeValueBufferType ) <nl> ASTPRINTER_PRINT_BUILTINTYPE ( BuiltinIntegerLiteralType ) <nl> mmm a / lib / AST / Builtins . cpp <nl> ppp b / lib / AST / Builtins . cpp <nl> Type swift : : getBuiltinType ( ASTContext & Context , StringRef Name ) { <nl> return Context . TheRawPointerType ; <nl> if ( Name = = " NativeObject " ) <nl> return Context . TheNativeObjectType ; <nl> - if ( Name = = " UnknownObject " ) <nl> - return Context . TheUnknownObjectType ; <nl> if ( Name = = " BridgeObject " ) <nl> return Context . TheBridgeObjectType ; <nl> if ( Name = = " SILToken " ) <nl> StringRef BuiltinType : : getTypeName ( SmallVectorImpl < char > & result , <nl> case BuiltinTypeKind : : BuiltinNativeObject : <nl> printer < < MAYBE_GET_NAMESPACED_BUILTIN ( BUILTIN_TYPE_NAME_NATIVEOBJECT ) ; <nl> break ; <nl> - case BuiltinTypeKind : : BuiltinUnknownObject : <nl> - printer < < MAYBE_GET_NAMESPACED_BUILTIN ( BUILTIN_TYPE_NAME_UNKNOWNOBJECT ) ; <nl> - break ; <nl> case BuiltinTypeKind : : BuiltinBridgeObject : <nl> printer < < MAYBE_GET_NAMESPACED_BUILTIN ( BUILTIN_TYPE_NAME_BRIDGEOBJECT ) ; <nl> break ; <nl> mmm a / lib / AST / Type . cpp <nl> ppp b / lib / AST / Type . cpp <nl> bool CanType : : isReferenceTypeImpl ( CanType type , GenericSignature * sig , <nl> llvm_unreachable ( " sugared canonical type ? " ) ; <nl> <nl> / / These types are always class references . <nl> - case TypeKind : : BuiltinUnknownObject : <nl> case TypeKind : : BuiltinNativeObject : <nl> case TypeKind : : BuiltinBridgeObject : <nl> case TypeKind : : Class : <nl> ReferenceCounting TypeBase : : getReferenceCounting ( ) { <nl> case TypeKind : : BuiltinBridgeObject : <nl> return ReferenceCounting : : Bridge ; <nl> <nl> - case TypeKind : : BuiltinUnknownObject : <nl> - return ReferenceCounting : : Unknown ; <nl> - <nl> case TypeKind : : Class : <nl> return getClassReferenceCounting ( cast < ClassType > ( type ) - > getDecl ( ) ) ; <nl> case TypeKind : : BoundGenericClass : <nl> mmm a / lib / IRGen / GenClangType . cpp <nl> ppp b / lib / IRGen / GenClangType . cpp <nl> class GenClangType : public CanTypeVisitor < GenClangType , clang : : CanQualType > { <nl> clang : : CanQualType visitBuiltinRawPointerType ( CanBuiltinRawPointerType type ) ; <nl> clang : : CanQualType visitBuiltinIntegerType ( CanBuiltinIntegerType type ) ; <nl> clang : : CanQualType visitBuiltinFloatType ( CanBuiltinFloatType type ) ; <nl> - clang : : CanQualType visitBuiltinUnknownObjectType ( <nl> - CanBuiltinUnknownObjectType type ) ; <nl> clang : : CanQualType visitArchetypeType ( CanArchetypeType type ) ; <nl> clang : : CanQualType visitSILFunctionType ( CanSILFunctionType type ) ; <nl> clang : : CanQualType visitGenericTypeParamType ( CanGenericTypeParamType type ) ; <nl> clang : : CanQualType GenClangType : : visitBuiltinFloatType ( <nl> llvm_unreachable ( " cannot translate floating - point format to C " ) ; <nl> } <nl> <nl> - clang : : CanQualType GenClangType : : visitBuiltinUnknownObjectType ( <nl> - CanBuiltinUnknownObjectType type ) { <nl> - / / Builtin . UnknownObject = = AnyObject , so it is also translated to ' id ' . <nl> - return getClangIdType ( getClangASTContext ( ) ) ; <nl> - } <nl> - <nl> clang : : CanQualType GenClangType : : visitArchetypeType ( CanArchetypeType type ) { <nl> / / We see these in the case where we invoke an @ objc function <nl> / / through a protocol . <nl> mmm a / lib / IRGen / GenMeta . cpp <nl> ppp b / lib / IRGen / GenMeta . cpp <nl> namespace { <nl> case ClassMetadataStrategy : : Fixed : { <nl> / / FIXME : Should this check HasImported instead ? <nl> auto type = ( Target - > checkAncestry ( AncestryFlags : : ObjC ) <nl> - ? IGM . Context . TheUnknownObjectType <nl> + ? IGM . Context . getAnyObjectType ( ) <nl> : IGM . Context . TheNativeObjectType ) ; <nl> auto wtable = IGM . getAddrOfValueWitnessTable ( type ) ; <nl> B . add ( wtable ) ; <nl> namespace { <nl> / / Without Objective - C interop , foreign classes must still use <nl> / / Swift native reference counting . <nl> auto type = ( IGM . ObjCInterop <nl> - ? IGM . Context . TheUnknownObjectType <nl> + ? IGM . Context . getAnyObjectType ( ) <nl> : IGM . Context . TheNativeObjectType ) ; <nl> auto wtable = IGM . getAddrOfValueWitnessTable ( type ) ; <nl> B . add ( wtable ) ; <nl> mmm a / lib / IRGen / GenObjC . cpp <nl> ppp b / lib / IRGen / GenObjC . cpp <nl> llvm : : Value * irgen : : emitObjCAutoreleaseReturnValue ( IRGenFunction & IGF , <nl> } <nl> <nl> namespace { <nl> - / / / A type - info implementation suitable for Builtin . UnknownObject . <nl> + / / / A type - info implementation suitable for AnyObject on platforms with ObjC <nl> + / / / interop . <nl> class UnknownTypeInfo : public HeapTypeInfo < UnknownTypeInfo > { <nl> public : <nl> UnknownTypeInfo ( llvm : : PointerType * storageType , Size size , <nl> namespace { <nl> : HeapTypeInfo ( storageType , size , spareBits , align ) { <nl> } <nl> <nl> - / / / Builtin . UnknownObject requires ObjC reference - counting . <nl> + / / / AnyObject requires ObjC reference - counting . <nl> ReferenceCounting getReferenceCounting ( ) const { <nl> return ReferenceCounting : : Unknown ; <nl> } <nl> mmm a / lib / IRGen / GenReflection . cpp <nl> ppp b / lib / IRGen / GenReflection . cpp <nl> class FixedTypeMetadataBuilder : public ReflectionMetadataBuilder { <nl> } <nl> <nl> void layout ( ) override { <nl> - addTypeRef ( type , CanGenericSignature ( ) ) ; <nl> + if ( type - > isAnyObject ( ) ) { <nl> + / / AnyObject isn ' t actually a builtin type ; we ' re emitting it as the old <nl> + / / Builtin . UnknownObject type for ABI compatibility . <nl> + B . addRelativeAddress ( <nl> + IGM . getAddrOfStringForTypeRef ( " BO " , MangledTypeRefRole : : Reflection ) ) ; <nl> + } else { <nl> + addTypeRef ( type , CanGenericSignature ( ) ) ; <nl> + } <nl> <nl> B . addInt32 ( ti - > getFixedSize ( ) . getValue ( ) ) ; <nl> <nl> emitAssociatedTypeMetadataRecord ( const RootProtocolConformance * conformance ) { <nl> void IRGenModule : : emitBuiltinReflectionMetadata ( ) { <nl> if ( getSwiftModule ( ) - > isStdlibModule ( ) ) { <nl> BuiltinTypes . insert ( Context . TheNativeObjectType ) ; <nl> - BuiltinTypes . insert ( Context . TheUnknownObjectType ) ; <nl> + BuiltinTypes . insert ( Context . getAnyObjectType ( ) ) ; <nl> BuiltinTypes . insert ( Context . TheBridgeObjectType ) ; <nl> BuiltinTypes . insert ( Context . TheRawPointerType ) ; <nl> BuiltinTypes . insert ( Context . TheUnsafeValueBufferType ) ; <nl> mmm a / lib / IRGen / GenType . cpp <nl> ppp b / lib / IRGen / GenType . cpp <nl> const TypeInfo * TypeConverter : : convertType ( CanType ty ) { <nl> } <nl> case TypeKind : : BuiltinNativeObject : <nl> return & getNativeObjectTypeInfo ( ) ; <nl> - case TypeKind : : BuiltinUnknownObject : <nl> - return & getUnknownObjectTypeInfo ( ) ; <nl> case TypeKind : : BuiltinBridgeObject : <nl> return & getBridgeObjectTypeInfo ( ) ; <nl> case TypeKind : : BuiltinUnsafeValueBuffer : <nl> mmm a / lib / IRGen / GenValueWitness . cpp <nl> ppp b / lib / IRGen / GenValueWitness . cpp <nl> getAddrOfKnownValueWitnessTable ( IRGenModule & IGM , CanType type , <nl> case ReferenceCounting : : ObjC : <nl> case ReferenceCounting : : Block : <nl> case ReferenceCounting : : Unknown : <nl> - witnessSurrogate = C . TheUnknownObjectType ; <nl> + witnessSurrogate = C . getAnyObjectType ( ) ; <nl> break ; <nl> case ReferenceCounting : : Bridge : <nl> witnessSurrogate = C . TheBridgeObjectType ; <nl> mmm a / lib / IRGen / IRGenDebugInfo . cpp <nl> ppp b / lib / IRGen / IRGenDebugInfo . cpp <nl> class IRGenDebugInfoImpl : public IRGenDebugInfo { <nl> break ; <nl> } <nl> <nl> - case TypeKind : : BuiltinUnknownObject : { <nl> - / / The builtin opaque Objective - C pointer type . Useful for pushing <nl> - / / an Objective - C type through swift . <nl> - unsigned PtrSize = CI . getTargetInfo ( ) . getPointerWidth ( 0 ) ; <nl> - auto IdTy = DBuilder . createForwardDecl ( llvm : : dwarf : : DW_TAG_structure_type , <nl> - MangledName , Scope , File , 0 , <nl> - llvm : : dwarf : : DW_LANG_ObjC , 0 , 0 ) ; <nl> - return DBuilder . createPointerType ( IdTy , PtrSize , 0 , <nl> - / * DWARFAddressSpace * / None , <nl> - MangledName ) ; <nl> - } <nl> - <nl> case TypeKind : : BuiltinNativeObject : { <nl> unsigned PtrSize = CI . getTargetInfo ( ) . getPointerWidth ( 0 ) ; <nl> auto PTy = <nl> mmm a / lib / IRGen / IRGenMangler . h <nl> ppp b / lib / IRGen / IRGenMangler . h <nl> class IRGenMangler : public Mangle : : ASTMangler { <nl> std : : string mangleValueWitness ( Type type , ValueWitness witness ) ; <nl> <nl> std : : string mangleValueWitnessTable ( Type type ) { <nl> - return mangleTypeSymbol ( type , " WV " ) ; <nl> + const char * const witnessTableOp = " WV " ; <nl> + if ( type - > isAnyObject ( ) ) { <nl> + / / Special - case for AnyObject , whose witness table is under the old name <nl> + / / Builtin . UnknownObject , even though we don ' t use that as a Type anymore . <nl> + beginMangling ( ) ; <nl> + appendOperator ( " BO " ) ; <nl> + appendOperator ( witnessTableOp ) ; <nl> + return finalize ( ) ; <nl> + } <nl> + return mangleTypeSymbol ( type , witnessTableOp ) ; <nl> } <nl> <nl> std : : string mangleTypeMetadataAccessFunction ( Type type ) { <nl> class IRGenMangler : public Mangle : : ASTMangler { <nl> } <nl> <nl> std : : string mangleReflectionBuiltinDescriptor ( Type type ) { <nl> - return mangleTypeSymbol ( type , " MB " ) ; <nl> + const char * const reflectionDescriptorOp = " MB " ; <nl> + if ( type - > isAnyObject ( ) ) { <nl> + / / Special - case for AnyObject , whose reflection descriptor is under the <nl> + / / old name Builtin . UnknownObject , even though we don ' t use that as a Type <nl> + / / anymore . <nl> + beginMangling ( ) ; <nl> + appendOperator ( " BO " ) ; <nl> + appendOperator ( reflectionDescriptorOp ) ; <nl> + return finalize ( ) ; <nl> + } <nl> + return mangleTypeSymbol ( type , reflectionDescriptorOp ) ; <nl> } <nl> <nl> std : : string mangleReflectionFieldDescriptor ( Type type ) { <nl> mmm a / lib / IRGen / IRGenSIL . cpp <nl> ppp b / lib / IRGen / IRGenSIL . cpp <nl> static bool hasReferenceSemantics ( IRGenSILFunction & IGF , <nl> return ( objType - > mayHaveSuperclass ( ) <nl> | | objType - > isClassExistentialType ( ) <nl> | | objType - > is < BuiltinNativeObjectType > ( ) <nl> - | | objType - > is < BuiltinBridgeObjectType > ( ) <nl> - | | objType - > is < BuiltinUnknownObjectType > ( ) ) ; <nl> + | | objType - > is < BuiltinBridgeObjectType > ( ) ) ; <nl> } <nl> <nl> static llvm : : Value * emitIsUnique ( IRGenSILFunction & IGF , SILValue operand , <nl> mmm a / lib / IRGen / MetadataRequest . cpp <nl> ppp b / lib / IRGen / MetadataRequest . cpp <nl> namespace { <nl> return emitDirectMetadataRef ( type ) ; <nl> } <nl> <nl> - MetadataResponse <nl> - visitBuiltinUnknownObjectType ( CanBuiltinUnknownObjectType type , <nl> - DynamicMetadataRequest request ) { <nl> - return emitDirectMetadataRef ( type ) ; <nl> - } <nl> - <nl> MetadataResponse <nl> visitBuiltinUnsafeValueBufferType ( CanBuiltinUnsafeValueBufferType type , <nl> DynamicMetadataRequest request ) { <nl> namespace { <nl> DynamicMetadataRequest request ) { <nl> / / All function types have the same layout regardless of arguments or <nl> / / abstraction level . Use the metadata for ( ) - > ( ) for thick functions , <nl> - / / or Builtin . UnknownObject for block functions . <nl> + / / or AnyObject for block functions . <nl> auto & C = type - > getASTContext ( ) ; <nl> switch ( type - > getRepresentation ( ) ) { <nl> case SILFunctionType : : Representation : : Thin : <nl> namespace { <nl> CanFunctionType : : get ( { } , C . TheEmptyTupleType ) , <nl> request ) . getMetadata ( ) ; <nl> case SILFunctionType : : Representation : : Block : <nl> - / / All block types look like Builtin . UnknownObject . <nl> - return emitDirectMetadataRef ( C . TheUnknownObjectType , request ) ; <nl> + / / All block types look like AnyObject . <nl> + return emitDirectMetadataRef ( C . getAnyObjectType ( ) , request ) ; <nl> } <nl> <nl> llvm_unreachable ( " Not a valid SILFunctionType . " ) ; <nl> namespace { <nl> auto & C = IGF . IGM . Context ; <nl> if ( t = = C . TheEmptyTupleType <nl> | | t = = C . TheNativeObjectType <nl> - | | t = = C . TheUnknownObjectType <nl> | | t = = C . TheBridgeObjectType <nl> - | | t = = C . TheRawPointerType ) <nl> + | | t = = C . TheRawPointerType <nl> + | | t = = C . getAnyObjectType ( ) ) <nl> return true ; <nl> if ( auto intTy = dyn_cast < BuiltinIntegerType > ( t ) ) { <nl> auto width = intTy - > getWidth ( ) ; <nl> namespace { <nl> return emitFromValueWitnessTable ( <nl> CanFunctionType : : get ( { } , C . TheEmptyTupleType ) ) ; <nl> case SILFunctionType : : Representation : : Block : <nl> - / / All block types look like Builtin . UnknownObject . <nl> - return emitFromValueWitnessTable ( C . TheUnknownObjectType ) ; <nl> + / / All block types look like AnyObject . <nl> + return emitFromValueWitnessTable ( C . getAnyObjectType ( ) ) ; <nl> } <nl> <nl> llvm_unreachable ( " Not a valid SILFunctionType . " ) ; <nl> namespace { <nl> case ReferenceCounting : : ObjC : <nl> case ReferenceCounting : : Block : <nl> case ReferenceCounting : : Unknown : <nl> - return emitFromValueWitnessTable ( IGF . IGM . Context . TheUnknownObjectType ) ; <nl> + return emitFromValueWitnessTable ( IGF . IGM . Context . getAnyObjectType ( ) ) ; <nl> <nl> case ReferenceCounting : : Bridge : <nl> case ReferenceCounting : : Error : <nl> mmm a / lib / IRGen / TypeVisitor . h <nl> ppp b / lib / IRGen / TypeVisitor . h <nl> class ReferenceTypeVisitor : public CanTypeVisitor < ImplClass , RetTy , Args . . . > { <nl> <nl> / / BuiltinNativeObject <nl> / / BuiltinBridgeObject <nl> - / / BuiltinUnknownObject <nl> / / Class <nl> / / BoundGenericClass <nl> / / Protocol <nl> mmm a / lib / SIL / SILType . cpp <nl> ppp b / lib / SIL / SILType . cpp <nl> SILType SILType : : getBridgeObjectType ( const ASTContext & C ) { <nl> return SILType ( C . TheBridgeObjectType , SILValueCategory : : Object ) ; <nl> } <nl> <nl> - SILType SILType : : getUnknownObjectType ( const ASTContext & C ) { <nl> - return getPrimitiveObjectType ( C . TheUnknownObjectType ) ; <nl> - } <nl> - <nl> SILType SILType : : getRawPointerType ( const ASTContext & C ) { <nl> return getPrimitiveObjectType ( C . TheRawPointerType ) ; <nl> } <nl> bool SILType : : isHeapObjectReferenceType ( ) const { <nl> return true ; <nl> if ( Ty - > isEqual ( C . TheBridgeObjectType ) ) <nl> return true ; <nl> - if ( Ty - > isEqual ( C . TheUnknownObjectType ) ) <nl> - return true ; <nl> if ( is < SILBoxType > ( ) ) <nl> return true ; <nl> return false ; <nl> mmm a / lib / SIL / TypeLowering . cpp <nl> ppp b / lib / SIL / TypeLowering . cpp <nl> namespace { <nl> IMPL ( BuiltinRawPointer , Trivial ) <nl> IMPL ( BuiltinNativeObject , Reference ) <nl> IMPL ( BuiltinBridgeObject , Reference ) <nl> - IMPL ( BuiltinUnknownObject , Reference ) <nl> IMPL ( BuiltinVector , Trivial ) <nl> IMPL ( SILToken , Trivial ) <nl> IMPL ( Class , Reference ) <nl> namespace { <nl> return getConcreteReferenceStorageReferent ( bound - > getCanonicalType ( ) ) ; <nl> } <nl> <nl> - return TC . Context . TheUnknownObjectType ; <nl> + return TC . Context . getAnyObjectType ( ) ; <nl> } <nl> <nl> return type ; <nl> mmm a / lib / SILOptimizer / Analysis / AliasAnalysis . cpp <nl> ppp b / lib / SILOptimizer / Analysis / AliasAnalysis . cpp <nl> static bool typedAccessTBAAMayAlias ( SILType LTy , SILType RTy , <nl> <nl> / / The Builtin reference types can alias any class instance . <nl> if ( LTyClass ) { <nl> - if ( RTy . is < BuiltinUnknownObjectType > ( ) | | <nl> - RTy . is < BuiltinNativeObjectType > ( ) | | <nl> + if ( RTy . is < BuiltinNativeObjectType > ( ) | | <nl> RTy . is < BuiltinBridgeObjectType > ( ) ) { <nl> return true ; <nl> } <nl> mmm a / stdlib / public / runtime / Enum . cpp <nl> ppp b / stdlib / public / runtime / Enum . cpp <nl> swift : : swift_initEnumMetadataSinglePayload ( EnumMetadata * self , <nl> / / a single empty case , then we can borrow the witnesses of the single <nl> / / refcounted pointer type , since swift_retain and objc_retain are both <nl> / / nil - aware . Most single - refcounted types will use the standard <nl> - / / value witness tables for NativeObject or UnknownObject . This isn ' t <nl> + / / value witness tables for NativeObject or AnyObject . This isn ' t <nl> / / foolproof but should catch the common case of optional class types . <nl> # if OPTIONAL_OBJECT_OPTIMIZATION <nl> auto payloadVWT = payload - > getValueWitnesses ( ) ; <nl> mmm a / stdlib / public / runtime / ImageInspectionELF . h <nl> ppp b / stdlib / public / runtime / ImageInspectionELF . h <nl> <nl> <nl> # define SWIFT_REFLECTION_METADATA_ELF_NOTE_MAGIC_STRING " swift_reflection_metadata_magic_string " <nl> <nl> - # if defined ( __ELF__ ) <nl> - <nl> # include " . . / SwiftShims / Visibility . h " <nl> # include < cstdint > <nl> # include < cstddef > <nl> struct MetadataSections { <nl> } ; <nl> } / / namespace swift <nl> <nl> + # if defined ( __ELF__ ) <nl> / / Called by injected constructors when a dynamic library is loaded . <nl> SWIFT_RUNTIME_EXPORT <nl> void swift_addNewDSOImage ( const void * addr ) ; <nl> - <nl> # endif / / defined ( __ELF__ ) <nl> <nl> # endif / / SWIFT_RUNTIME_IMAGE_INSPECTION_ELF_H <nl> mmm a / stdlib / public / runtime / Metadata . cpp <nl> ppp b / stdlib / public / runtime / Metadata . cpp <nl> FunctionCacheEntry : : FunctionCacheEntry ( const Key & key ) { <nl> <nl> case FunctionMetadataConvention : : Block : <nl> # if SWIFT_OBJC_INTEROP <nl> - / / Blocks are ObjC objects , so can share the Builtin . UnknownObject value <nl> - / / witnesses . <nl> + / / Blocks are ObjC objects , so can share the AnyObject value <nl> + / / witnesses ( stored as " BO " rather than " yXl " for ABI compat ) . <nl> Data . ValueWitnesses = & VALUE_WITNESS_SYM ( BO ) ; <nl> # else <nl> assert ( false & & " objc block without objc interop ? " ) ; <nl> mmm a / stdlib / public / runtime / ReflectionMirror . mm <nl> ppp b / stdlib / public / runtime / ReflectionMirror . mm <nl> auto call ( OpaqueValue * passedValue , const Metadata * T , const Metadata * passedTyp <nl> <nl> case MetadataKind : : Opaque : { <nl> # if SWIFT_OBJC_INTEROP <nl> - / / If this is the Builtin . UnknownObject type , use the dynamic type of the <nl> + / / If this is the AnyObject type , use the dynamic type of the <nl> / / object reference . <nl> if ( type = = & METADATA_SYM ( BO ) . base ) { <nl> return callClass ( ) ; <nl> mmm a / test / IRGen / builtins . swift <nl> ppp b / test / IRGen / builtins . swift <nl> func isUnique ( _ ref : inout Builtin . NativeObject ) - > Bool { <nl> return Builtin . isUnique ( & ref ) <nl> } <nl> <nl> - / / CHECK : define hidden { { . * } } void @ " $ s8builtins27acceptsBuiltinUnknownObjectyyBOSgzF " ( [ [ BUILTIN_UNKNOWN_OBJECT_TY : % . * ] ] * nocapture dereferenceable ( { { . * } } ) % 0 ) { { . * } } { <nl> - func acceptsBuiltinUnknownObject ( _ ref : inout Builtin . UnknownObject ? ) { } <nl> + / / CHECK : define hidden { { . * } } void @ " $ s8builtins16acceptsAnyObjectyyyXlSgzF " ( [ [ OPTIONAL_ANYOBJECT_TY : % . * ] ] * nocapture dereferenceable ( { { . * } } ) % 0 ) { { . * } } { <nl> + func acceptsAnyObject ( _ ref : inout Builtin . AnyObject ? ) { } <nl> <nl> / / ObjC <nl> - / / CHECK - LABEL : define hidden { { . * } } i1 @ " $ s8builtins8isUniqueyBi1_BOSgzF " ( { { % . * } } * nocapture dereferenceable ( { { . * } } ) % 0 ) { { . * } } { <nl> + / / CHECK - LABEL : define hidden { { . * } } i1 @ " $ s8builtins8isUniqueyBi1_yXlSgzF " ( { { % . * } } * nocapture dereferenceable ( { { . * } } ) % 0 ) { { . * } } { <nl> / / CHECK - NEXT : entry : <nl> - / / CHECK - NEXT : bitcast [ [ BUILTIN_UNKNOWN_OBJECT_TY ] ] * % 0 to [ [ UNKNOWN_OBJECT : % objc_object | % swift \ . refcounted ] ] * * <nl> - / / CHECK - NEXT : load [ [ UNKNOWN_OBJECT ] ] * , [ [ UNKNOWN_OBJECT ] ] * * % 1 <nl> - / / CHECK - objc - NEXT : call i1 @ swift_isUniquelyReferencedNonObjC ( [ [ UNKNOWN_OBJECT ] ] * % 2 ) <nl> - / / CHECK - native - NEXT : call i1 @ swift_isUniquelyReferenced_native ( [ [ UNKNOWN_OBJECT ] ] * % 2 ) <nl> - / / CHECK - NEXT : ret i1 % 3 <nl> - func isUnique ( _ ref : inout Builtin . UnknownObject ? ) - > Bool { <nl> + / / CHECK - NEXT : [ [ ADDR : % . + ] ] = getelementptr inbounds [ [ OPTIONAL_ANYOBJECT_TY ] ] , [ [ OPTIONAL_ANYOBJECT_TY ] ] * % 0 , i32 0 , i32 0 <nl> + / / CHECK - NEXT : [ [ CASTED : % . + ] ] = bitcast { { . + } } * [ [ ADDR ] ] to [ [ UNKNOWN_OBJECT : % objc_object | % swift \ . refcounted ] ] * * <nl> + / / CHECK - NEXT : [ [ REF : % . + ] ] = load [ [ UNKNOWN_OBJECT ] ] * , [ [ UNKNOWN_OBJECT ] ] * * [ [ CASTED ] ] <nl> + / / CHECK - objc - NEXT : [ [ RESULT : % . + ] ] = call i1 @ swift_isUniquelyReferencedNonObjC ( [ [ UNKNOWN_OBJECT ] ] * [ [ REF ] ] ) <nl> + / / CHECK - native - NEXT : [ [ RESULT : % . + ] ] = call i1 @ swift_isUniquelyReferenced_native ( [ [ UNKNOWN_OBJECT ] ] * [ [ REF ] ] ) <nl> + / / CHECK - NEXT : ret i1 [ [ RESULT ] ] <nl> + func isUnique ( _ ref : inout Builtin . AnyObject ? ) - > Bool { <nl> return Builtin . isUnique ( & ref ) <nl> } <nl> <nl> / / ObjC nonNull <nl> - / / CHECK - LABEL : define hidden { { . * } } i1 @ " $ s8builtins8isUniqueyBi1_BOzF " <nl> - / / CHECK - SAME : ( [ [ UNKNOWN_OBJECT ] ] * * nocapture dereferenceable ( { { . * } } ) % 0 ) { { . * } } { <nl> + / / CHECK - LABEL : define hidden { { . * } } i1 @ " $ s8builtins8isUniqueyBi1_yXlzF " <nl> + / / CHECK - SAME : ( % AnyObject * nocapture dereferenceable ( { { . * } } ) % 0 ) { { . * } } { <nl> / / CHECK - NEXT : entry : <nl> - / / CHECK - NEXT : load [ [ UNKNOWN_OBJECT ] ] * , [ [ UNKNOWN_OBJECT ] ] * * % 0 <nl> - / / CHECK - objc - NEXT : call i1 @ swift_isUniquelyReferencedNonObjC_nonNull ( [ [ UNKNOWN_OBJECT ] ] * % 1 ) <nl> - / / CHECK - native - NEXT : call i1 @ swift_isUniquelyReferenced_nonNull_native ( [ [ UNKNOWN_OBJECT ] ] * % 1 ) <nl> - / / CHECK - NEXT : ret i1 % 2 <nl> - func isUnique ( _ ref : inout Builtin . UnknownObject ) - > Bool { <nl> + / / CHECK - NEXT : [ [ ADDR : % . + ] ] = getelementptr inbounds % AnyObject , % AnyObject * % 0 , i32 0 , i32 0 <nl> + / / CHECK - NEXT : [ [ REF : % . + ] ] = load [ [ UNKNOWN_OBJECT ] ] * , [ [ UNKNOWN_OBJECT ] ] * * [ [ ADDR ] ] <nl> + / / CHECK - objc - NEXT : [ [ RESULT : % . + ] ] = call i1 @ swift_isUniquelyReferencedNonObjC_nonNull ( [ [ UNKNOWN_OBJECT ] ] * [ [ REF ] ] ) <nl> + / / CHECK - native - NEXT : [ [ RESULT : % . + ] ] = call i1 @ swift_isUniquelyReferenced_nonNull_native ( [ [ UNKNOWN_OBJECT ] ] * [ [ REF ] ] ) <nl> + / / CHECK - NEXT : ret i1 [ [ RESULT ] ] <nl> + func isUnique ( _ ref : inout Builtin . AnyObject ) - > Bool { <nl> return Builtin . isUnique ( & ref ) <nl> } <nl> <nl> mmm a / test / IRGen / class . sil <nl> ppp b / test / IRGen / class . sil <nl> entry ( % c : $ C ) : <nl> <nl> / / CHECK : define { { ( dllexport ) ? } } { { ( protected ) ? } } swiftcc [ [ OBJCOBJ ] ] * @ ref_to_objc_pointer_cast ( [ [ C_CLASS ] ] * % 0 ) <nl> / / CHECK : bitcast [ [ C_CLASS ] ] * % 0 to [ [ OBJCOBJ ] ] * <nl> - sil @ ref_to_objc_pointer_cast : $ @ convention ( thin ) ( C ) - > Builtin . UnknownObject { <nl> + sil @ ref_to_objc_pointer_cast : $ @ convention ( thin ) ( C ) - > Builtin . AnyObject { <nl> entry ( % c : $ C ) : <nl> - % r = unchecked_ref_cast % c : $ C to $ Builtin . UnknownObject <nl> - return % r : $ Builtin . UnknownObject <nl> + % r = unchecked_ref_cast % c : $ C to $ Builtin . AnyObject <nl> + return % r : $ Builtin . AnyObject <nl> } <nl> <nl> / / CHECK - LABEL : define { { ( dllexport ) ? } } { { ( protected ) ? } } swiftcc % T5class1CC * @ alloc_ref_dynamic ( % swift . type * % 0 ) <nl> mmm a / test / IRGen / dynamic_lookup . sil <nl> ppp b / test / IRGen / dynamic_lookup . sil <nl> bb0 ( % 0 : $ AnyObject ) : <nl> % 4 = load % 1a : $ * AnyObject <nl> strong_retain % 4 : $ AnyObject <nl> % 6 = open_existential_ref % 4 : $ AnyObject to $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 000000000000 " ) AnyObject <nl> - % 7 = unchecked_ref_cast % 6 : $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 000000000000 " ) AnyObject to $ Builtin . UnknownObject <nl> <nl> / / CHECK : [ [ SEL : % [ 0 - 9 ] + ] ] = load i8 * , i8 * * @ " \ 01L_selector ( f ) " <nl> / / CHECK : [ [ RESPONDS : % [ 0 - 9 ] + ] ] = load i8 * , i8 * * @ " \ 01L_selector ( respondsToSelector : ) " <nl> / / CHECK : [ [ HAS_SEL : % [ 0 - 9 ] ] ] = call i1 { { . * } } @ objc_msgSend { { . * } } ( % objc_object * [ [ OBJECT : % [ 0 - 9 ] + ] ] , i8 * [ [ RESPONDS ] ] , i8 * [ [ SEL ] ] ) <nl> / / CHECK : br i1 [ [ HAS_SEL ] ] <nl> - dynamic_method_br % 7 : $ Builtin . UnknownObject , # X . f ! 1 . foreign , bb1 , bb2 <nl> + dynamic_method_br % 6 : $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 000000000000 " ) AnyObject , # X . f ! 1 . foreign , bb1 , bb2 <nl> <nl> - bb1 ( % 8 : $ @ convention ( objc_method ) ( Builtin . UnknownObject ) - > ( ) ) : <nl> + bb1 ( % 8 : $ @ convention ( objc_method ) ( @ opened ( " 01234567 - 89ab - cdef - 0123 - 000000000000 " ) AnyObject ) - > ( ) ) : <nl> br bb3 <nl> <nl> bb2 : <nl> sil @ _T1t23dynamic_lookup_propertyFT1xPSo13AnyObject__T_ : $ @ convention ( thin ) ( A <nl> % 6 = load % 1a : $ * AnyObject / / users : % 24 , % 8 , % 7 <nl> strong_retain % 6 : $ AnyObject <nl> % 8 = open_existential_ref % 6 : $ AnyObject to $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 111111111111 " ) AnyObject / / users : % 11 , % 9 <nl> - % 9 = unchecked_ref_cast % 8 : $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 111111111111 " ) AnyObject to $ Builtin . UnknownObject <nl> - dynamic_method_br % 9 : $ Builtin . UnknownObject , # X . value ! getter . 1 . foreign , bb1 , bb2 <nl> + dynamic_method_br % 8 : $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 111111111111 " ) AnyObject , # X . value ! getter . 1 . foreign , bb1 , bb2 <nl> <nl> - bb1 ( % 10 : $ @ convention ( objc_method ) ( Builtin . UnknownObject ) - > Int ) : <nl> + bb1 ( % 10 : $ @ convention ( objc_method ) ( @ opened ( " 01234567 - 89ab - cdef - 0123 - 111111111111 " ) AnyObject ) - > Int ) : <nl> br bb3 <nl> <nl> bb2 : <nl> bb0 ( % 0 : $ AnyObject , % 1 : $ Int ) : <nl> % 8 = load % 2a : $ * AnyObject <nl> strong_retain % 8 : $ AnyObject <nl> % 10 = open_existential_ref % 8 : $ AnyObject to $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 111111111111 " ) AnyObject <nl> - % 11 = unchecked_ref_cast % 10 : $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 111111111111 " ) AnyObject to $ Builtin . UnknownObject <nl> / / CHECK : [ [ SEL : % [ 0 - 9 ] + ] ] = load i8 * , i8 * * @ " \ 01L_selector ( objectAtIndexedSubscript : ) " , align { { ( 4 | 8 ) } } <nl> / / CHECK : [ [ RESPONDS : % [ 0 - 9 ] + ] ] = load i8 * , i8 * * @ " \ 01L_selector ( respondsToSelector : ) " <nl> / / CHECK - NEXT : [ [ HAS_SEL : % [ 0 - 9 ] ] ] = call i1 { { . * } } @ objc_msgSend { { . * } } ( % objc_object * [ [ OBJECT : % [ 0 - 9 ] + ] ] , i8 * [ [ RESPONDS ] ] , i8 * [ [ SEL ] ] ) <nl> / / CHECK - NEXT : br i1 [ [ HAS_SEL ] ] , label [ [ HAS_METHOD : % [ 0 - 9 ] + ] ] , label [ [ HAS_METHOD : % [ 0 - 9 ] + ] ] <nl> <nl> - dynamic_method_br % 11 : $ Builtin . UnknownObject , # X . subscript ! getter . 1 . foreign , bb1 , bb2 <nl> + dynamic_method_br % 10 : $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 111111111111 " ) AnyObject , # X . subscript ! getter . 1 . foreign , bb1 , bb2 <nl> <nl> - bb1 ( % 13 : $ @ convention ( objc_method ) ( Int , Builtin . UnknownObject ) - > Int ) : / / Preds : bb0 <nl> - % 14 = partial_apply % 13 ( % 11 ) : $ @ convention ( objc_method ) ( Int , Builtin . UnknownObject ) - > Int <nl> + bb1 ( % 13 : $ @ convention ( objc_method ) ( Int , @ opened ( " 01234567 - 89ab - cdef - 0123 - 111111111111 " ) AnyObject ) - > Int ) : / / Preds : bb0 <nl> + % 14 = partial_apply % 13 ( % 10 ) : $ @ convention ( objc_method ) ( Int , @ opened ( " 01234567 - 89ab - cdef - 0123 - 111111111111 " ) AnyObject ) - > Int <nl> % 15 = load % 3a : $ * Int <nl> % 16 = apply % 14 ( % 15 ) : $ @ callee_owned ( Int ) - > Int <nl> br bb3 <nl> mmm a / test / IRGen / enum_value_semantics . sil <nl> ppp b / test / IRGen / enum_value_semantics . sil <nl> enum MultiPayloadEmptyPayload { <nl> enum MultiPayloadNontrivial { <nl> case payload1 ( Builtin . NativeObject ) <nl> case payload2 ( Builtin . Int64 ) <nl> - case payload3 ( Builtin . Int64 , Builtin . UnknownObject ) <nl> + case payload3 ( Builtin . Int64 , Builtin . NativeObject ) <nl> case payload4 ( Builtin . Int64 , Builtin . Int64 ) <nl> case a <nl> case b <nl> enum MultiPayloadGeneric < T > { <nl> enum MultiPayloadNontrivialSpareBits { <nl> case payload1 ( Builtin . NativeObject ) <nl> case payload2 ( Builtin . Int64 ) <nl> - case payload3 ( Builtin . Int64 , Builtin . UnknownObject ) <nl> + case payload3 ( Builtin . Int64 , Builtin . NativeObject ) <nl> case a <nl> case b <nl> case c <nl> mmm a / test / IRGen / enum_value_semantics_special_cases_objc . sil <nl> ppp b / test / IRGen / enum_value_semantics_special_cases_objc . sil <nl> import Builtin <nl> <nl> / / ObjC payloads can be nullable too . <nl> enum NullableObjCRefcounted { <nl> - case Ref ( Builtin . UnknownObject ) <nl> + case Ref ( Builtin . AnyObject ) <nl> case None <nl> } <nl> / / CHECK - LABEL : define internal void @ " $ s39enum_value_semantics_special_cases_objc22NullableObjCRefcountedOwxx " ( % swift . opaque * noalias % object , % swift . type * % NullableObjCRefcounted ) { { . * } } { <nl> enum NullableObjCRefcounted { <nl> / / CHECK : call void @ swift_unknownObjectRelease ( % objc_object * % 2 ) { { # [ 0 - 9 ] + } } <nl> / / CHECK : ret void <nl> / / CHECK : } <nl> - <nl> - class C { } <nl> - sil_vtable C { } <nl> - <nl> - sil @ $ s39enum_value_semantics_special_cases_objc1CCfD : $ @ convention ( method ) ( C ) - > ( ) <nl> - <nl> - enum AllMixedRefcounted { <nl> - case Ref ( Builtin . NativeObject ) <nl> - case CRef ( C ) <nl> - case ORef ( Builtin . UnknownObject ) <nl> - case None <nl> - } <nl> - <nl> - / / CHECK - LABEL : define internal void @ " $ s39enum_value_semantics_special_cases_objc18AllMixedRefcountedOwxx " ( % swift . opaque * noalias % object , % swift . type * % AllMixedRefcounted ) { { . * } } { <nl> - / / CHECK : entry : <nl> - / / CHECK : % 0 = bitcast % swift . opaque * % object to % T39enum_value_semantics_special_cases_objc18AllMixedRefcountedO * <nl> - / / CHECK : % 1 = bitcast % T39enum_value_semantics_special_cases_objc18AllMixedRefcountedO * % 0 to i64 * <nl> - / / CHECK : % 2 = load i64 , i64 * % 1 , align 8 <nl> - / / CHECK : % 3 = lshr i64 % 2 , 62 <nl> - / / CHECK : % 4 = trunc i64 % 3 to i8 <nl> - / / CHECK : % 5 = and i8 % 4 , 3 <nl> - / / CHECK : call void @ " $ s39enum_value_semantics_special_cases_objc18AllMixedRefcountedOWOe " ( i64 % 2 ) <nl> - / / CHECK : ret void <nl> - / / CHECK : } <nl> - <nl> - enum AllMixedRefcountedTwoSimple { <nl> - case Ref ( Builtin . NativeObject ) <nl> - case CRef ( C ) <nl> - case ORef ( Builtin . UnknownObject ) <nl> - case None <nl> - case Nothing <nl> - } <nl> - <nl> - / / CHECK - LABEL : define internal void @ " $ s39enum_value_semantics_special_cases_objc27AllMixedRefcountedTwoSimpleOwxx " <nl> - / / CHECK : call void @ " $ s39enum_value_semantics_special_cases_objc27AllMixedRefcountedTwoSimpleOWOy " <nl> - <nl> - struct Val { <nl> - } <nl> - <nl> - / / Currently , swift_unknownObjectRelease does not support the indirect heap object . <nl> - <nl> - enum MixedRefcountedWithIndirect { <nl> - indirect case Indirect ( Builtin . Int64 ) <nl> - case Ref ( Builtin . UnknownObject ) <nl> - case None <nl> - } <nl> - <nl> - / / CHECK - LABEL : define internal void @ " $ s39enum_value_semantics_special_cases_objc27MixedRefcountedWithIndirectOwxx " ( % swift . opaque * noalias % object , % swift . type * % MixedRefcountedWithIndirect ) <nl> - / / CHECK : entry : <nl> - / / CHECK : % 0 = bitcast % swift . opaque * % object to % T39enum_value_semantics_special_cases_objc27MixedRefcountedWithIndirectO * <nl> - / / CHECK : % 1 = bitcast % T39enum_value_semantics_special_cases_objc27MixedRefcountedWithIndirectO * % 0 to i64 * <nl> - / / CHECK : % 2 = load i64 , i64 * % 1 , align 8 <nl> - / / CHECK : % 3 = lshr i64 % 2 , 62 <nl> - / / CHECK : % 4 = trunc i64 % 3 to i8 <nl> - / / CHECK : % 5 = and i8 % 4 , 3 <nl> - / / CHECK : call void @ " $ s39enum_value_semantics_special_cases_objc27MixedRefcountedWithIndirectOWOe " ( i64 % 2 ) <nl> - / / CHECK : ret void <nl> - / / CHECK : } <nl> - <nl> - <nl> - / / CHECK - LABEL : define linkonce_odr hidden void @ " $ s39enum_value_semantics_special_cases_objc27MixedRefcountedWithIndirectOWOe " ( i64 % 0 ) <nl> - / / CHECK : entry : <nl> - / / CHECK : % 1 = lshr i64 % 0 , 62 <nl> - / / CHECK : % 2 = trunc i64 % 1 to i8 <nl> - / / CHECK : % 3 = and i8 % 2 , 3 <nl> - / / CHECK : switch i8 % 3 , label % 9 [ <nl> - / / CHECK : i8 0 , label % 4 <nl> - / / CHECK : i8 1 , label % 6 <nl> - / / CHECK : ] <nl> - <nl> - / / CHECK : 4 : <nl> - / / CHECK : % 5 = inttoptr i64 % 0 to % swift . refcounted * <nl> - / / CHECK : call void @ swift_release ( % swift . refcounted * % 5 ) # 1 <nl> - / / CHECK : br label % 9 <nl> - <nl> - / / CHECK : 6 : <nl> - / / CHECK : % 7 = and i64 % 0 , 4611686018427387903 <nl> - / / CHECK : % 8 = inttoptr i64 % 7 to % objc_object * <nl> - / / CHECK : call void @ swift_unknownObjectRelease ( % objc_object * % 8 ) # 1 <nl> - / / CHECK : br label % 9 <nl> - <nl> - / / CHECK : 9 : <nl> - / / CHECK : ret void <nl> mmm a / test / IRGen / partial_apply_objc . sil <nl> ppp b / test / IRGen / partial_apply_objc . sil <nl> entry ( % x : $ Int ) : <nl> / / CHECK : define internal swiftcc void [ [ DYNAMIC_LOOKUP_BR_PARTIAL_APPLY_STUB ] ] ( i64 % 0 , % swift . refcounted * swiftself % 1 ) { { . * } } { <nl> / / CHECK : load i8 * , i8 * * @ " \ 01L_selector ( methodWithX : ) " , align 8 <nl> <nl> - sil @ dynamic_lookup_br_partial_apply : $ @ convention ( thin ) ( Builtin . UnknownObject ) - > @ callee_owned ( Int ) - > ( ) { <nl> - entry ( % o : $ Builtin . UnknownObject ) : <nl> - dynamic_method_br % o : $ Builtin . UnknownObject , # ObjCClass . method ! 1 . foreign , yes , no <nl> + sil @ dynamic_lookup_br_partial_apply : $ @ convention ( thin ) ( Builtin . AnyObject ) - > @ callee_owned ( Int ) - > ( ) { <nl> + entry ( % o : $ Builtin . AnyObject ) : <nl> + dynamic_method_br % o : $ Builtin . AnyObject , # ObjCClass . method ! 1 . foreign , yes , no <nl> <nl> - yes ( % m : $ @ convention ( objc_method ) ( Int , Builtin . UnknownObject ) - > ( ) ) : <nl> - % p = partial_apply % m ( % o ) : $ @ convention ( objc_method ) ( Int , Builtin . UnknownObject ) - > ( ) <nl> + yes ( % m : $ @ convention ( objc_method ) ( Int , Builtin . AnyObject ) - > ( ) ) : <nl> + % p = partial_apply % m ( % o ) : $ @ convention ( objc_method ) ( Int , Builtin . AnyObject ) - > ( ) <nl> br done ( % p : $ @ callee_owned ( Int ) - > ( ) ) <nl> <nl> no : <nl> mmm a / test / IRGen / typed_boxes . sil <nl> ppp b / test / IRGen / typed_boxes . sil <nl> sil @ unknown_rc_box : $ @ convention ( thin ) ( ) - > ( ) { <nl> entry : <nl> / / CHECK - 32 : [ [ BOX : % . * ] ] = call noalias % swift . refcounted * @ swift_allocObject ( % swift . type * { { . * } } [ [ UNKNOWN_RC_METADATA : @ metadata [ 0 - 9 . ] * ] ] , { { . * } } [ [ WORD ] ] 12 , [ [ WORD ] ] 3 ) <nl> / / CHECK - 64 : [ [ BOX : % . * ] ] = call noalias % swift . refcounted * @ swift_allocObject ( % swift . type * { { . * } } [ [ UNKNOWN_RC_METADATA : @ metadata [ 0 - 9 . ] * ] ] , { { . * } } [ [ WORD ] ] 24 , [ [ WORD ] ] 7 ) <nl> - % a = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > <nl> - % b = project_box % a : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> - dealloc_box % a : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > <nl> + % a = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . AnyObject > <nl> + % b = project_box % a : $ < τ_0_0 > { var τ_0_0 } < Builtin . AnyObject > , 0 <nl> + dealloc_box % a : $ < τ_0_0 > { var τ_0_0 } < Builtin . AnyObject > <nl> return undef : $ ( ) <nl> } <nl> <nl> mmm a / test / IRGen / unknown_object . sil <nl> ppp b / test / IRGen / unknown_object . sil <nl> sil_stage canonical <nl> import Builtin <nl> <nl> / / CHECK - LABEL : @ retain_release_unknown_object <nl> - sil [ ossa ] @ retain_release_unknown_object : $ @ convention ( thin ) ( @ guaranteed Builtin . UnknownObject ) - > ( ) { <nl> - entry ( % x : @ guaranteed $ Builtin . UnknownObject ) : <nl> + sil [ ossa ] @ retain_release_unknown_object : $ @ convention ( thin ) ( @ guaranteed Builtin . AnyObject ) - > ( ) { <nl> + entry ( % x : @ guaranteed $ Builtin . AnyObject ) : <nl> / / CHECK - native : swift_retain <nl> / / CHECK - objc : swift_unknownObjectRetain <nl> - % y = copy_value % x : $ Builtin . UnknownObject <nl> + % y = copy_value % x : $ Builtin . AnyObject <nl> / / CHECK - native : swift_release <nl> / / CHECK - objc : swift_unknownObjectRelease <nl> - destroy_value % y : $ Builtin . UnknownObject <nl> + destroy_value % y : $ Builtin . AnyObject <nl> return undef : $ ( ) <nl> } <nl> mmm a / test / SIL / Parser / basic . sil <nl> ppp b / test / SIL / Parser / basic . sil <nl> bb0 : <nl> % C = alloc_ref $ C <nl> / / CHECK : unchecked_ref_cast % 0 : $ C to $ Builtin . NativeObject <nl> % 1 = unchecked_ref_cast % C : $ C to $ Builtin . NativeObject <nl> - / / CHECK : unchecked_ref_cast % 0 : $ C to $ Builtin . UnknownObject <nl> - % O = unchecked_ref_cast % C : $ C to $ Builtin . UnknownObject <nl> + / / CHECK : unchecked_ref_cast % 0 : $ C to $ AnyObject <nl> + % O = unchecked_ref_cast % C : $ C to $ Builtin . AnyObject <nl> <nl> / / CHECK : class_method { { . * } } : $ C , # C . doIt ! 1 <nl> % 2 = class_method % C : $ C , # C . doIt ! 1 : ( C ) - > ( ) - > ( ) , $ @ convention ( method ) ( @ guaranteed C ) - > ( ) <nl> bb0 ( % 0 : $ AnyObject ) : <nl> % 4 = load % 1a : $ * AnyObject <nl> strong_retain % 4 : $ AnyObject <nl> % 6 = open_existential_ref % 4 : $ AnyObject to $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 222222222222 " ) AnyObject <nl> - % 7 = unchecked_ref_cast % 6 : $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 222222222222 " ) AnyObject to $ Builtin . UnknownObject <nl> - dynamic_method_br % 7 : $ Builtin . UnknownObject , # X . f ! 1 . foreign , bb1 , bb2 <nl> - bb1 ( % z : $ @ convention ( objc_method ) ( Builtin . UnknownObject ) - > ( ) ) : <nl> + dynamic_method_br % 6 : $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 222222222222 " ) AnyObject , # X . f ! 1 . foreign , bb1 , bb2 <nl> + bb1 ( % z : $ @ convention ( objc_method ) ( @ opened ( " 01234567 - 89ab - cdef - 0123 - 222222222222 " ) AnyObject ) - > ( ) ) : <nl> br bb3 <nl> <nl> bb2 : <nl> mmm a / test / SIL / ownership - verifier / use_verifier . sil <nl> ppp b / test / SIL / ownership - verifier / use_verifier . sil <nl> bb9 : <nl> sil [ ossa ] @ dynamic_method_br_test : $ @ convention ( thin ) ( @ owned AnyObject , @ thick AnyObject . Type ) - > ( ) { <nl> bb0 ( % 0 : @ owned $ AnyObject , % 1 : $ @ thick AnyObject . Type ) : <nl> % 2 = open_existential_ref % 0 : $ AnyObject to $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 000000000000 " ) AnyObject <nl> - % 3 = unchecked_ref_cast % 2 : $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 000000000000 " ) AnyObject to $ Builtin . UnknownObject <nl> - dynamic_method_br % 3 : $ Builtin . UnknownObject , # X . f ! 1 . foreign , bb1 , bb2 <nl> + dynamic_method_br % 2 : $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 000000000000 " ) AnyObject , # X . f ! 1 . foreign , bb1 , bb2 <nl> <nl> - bb1 ( % 4 : $ @ convention ( objc_method ) ( Builtin . UnknownObject ) - > ( ) ) : <nl> + bb1 ( % 4 : $ @ convention ( objc_method ) ( @ opened ( " 01234567 - 89ab - cdef - 0123 - 000000000000 " ) AnyObject ) - > ( ) ) : <nl> br bb3 <nl> <nl> bb2 : <nl> br bb3 <nl> <nl> bb3 : <nl> - destroy_value % 3 : $ Builtin . UnknownObject <nl> + destroy_value % 2 : $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 000000000000 " ) AnyObject <nl> % 5 = open_existential_metatype % 1 : $ @ thick AnyObject . Type to $ @ thick ( @ opened ( " 01234567 - 89ab - cdef - 0123 - 000000000001 " ) AnyObject ) . Type <nl> dynamic_method_br % 5 : $ @ thick ( @ opened ( " 01234567 - 89ab - cdef - 0123 - 000000000001 " ) AnyObject ) . Type , # X . g ! 1 . foreign , bb4 , bb5 <nl> <nl> mmm a / test / SILGen / builtins . swift <nl> ppp b / test / SILGen / builtins . swift <nl> func isUnique ( _ ref : inout Builtin . NativeObject ) - > Bool { <nl> return Bool ( _builtinBooleanLiteral : Builtin . isUnique ( & ref ) ) <nl> } <nl> <nl> - / / UnknownObject ( ObjC ) <nl> + / / AnyObject ( ObjC ) <nl> / / CHECK - LABEL : sil hidden [ ossa ] @ $ s8builtins8isUnique { { [ _0 - 9a - zA - Z ] * } } F <nl> - / / CHECK : bb0 ( % 0 : $ * Optional < Builtin . UnknownObject > ) : <nl> + / / CHECK : bb0 ( % 0 : $ * Optional < AnyObject > ) : <nl> / / CHECK : [ [ WRITE : % . * ] ] = begin_access [ modify ] [ unknown ] % 0 <nl> - / / CHECK : [ [ BUILTIN : % . * ] ] = is_unique [ [ WRITE ] ] : $ * Optional < Builtin . UnknownObject > <nl> + / / CHECK : [ [ BUILTIN : % . * ] ] = is_unique [ [ WRITE ] ] : $ * Optional < AnyObject > <nl> / / CHECK : return <nl> - func isUnique ( _ ref : inout Builtin . UnknownObject ? ) - > Bool { <nl> + func isUnique ( _ ref : inout Builtin . AnyObject ? ) - > Bool { <nl> return Bool ( _builtinBooleanLiteral : Builtin . isUnique ( & ref ) ) <nl> } <nl> <nl> - / / UnknownObject ( ObjC ) nonNull <nl> + / / AnyObject ( ObjC ) nonNull <nl> / / CHECK - LABEL : sil hidden [ ossa ] @ $ s8builtins8isUnique { { [ _0 - 9a - zA - Z ] * } } F <nl> - / / CHECK : bb0 ( % 0 : $ * Builtin . UnknownObject ) : <nl> + / / CHECK : bb0 ( % 0 : $ * AnyObject ) : <nl> / / CHECK : [ [ WRITE : % . * ] ] = begin_access [ modify ] [ unknown ] % 0 <nl> - / / CHECK : [ [ BUILTIN : % . * ] ] = is_unique [ [ WRITE ] ] : $ * Builtin . UnknownObject <nl> + / / CHECK : [ [ BUILTIN : % . * ] ] = is_unique [ [ WRITE ] ] : $ * AnyObject <nl> / / CHECK : return <nl> - func isUnique ( _ ref : inout Builtin . UnknownObject ) - > Bool { <nl> + func isUnique ( _ ref : inout Builtin . AnyObject ) - > Bool { <nl> return Bool ( _builtinBooleanLiteral : Builtin . isUnique ( & ref ) ) <nl> } <nl> <nl> mmm a / test / SILOptimizer / ownership_model_eliminator . sil <nl> ppp b / test / SILOptimizer / ownership_model_eliminator . sil <nl> bb0 ( % 0 : @ guaranteed $ Builtin . NativeObject ) : <nl> return % 1 : $ Builtin . NativeObject <nl> } <nl> <nl> - / / CHECK - LABEL : sil @ switch_enum_default_case : $ @ convention ( thin ) ( @ owned Either < Builtin . NativeObject , Builtin . UnknownObject > ) - > ( ) { <nl> - / / CHECK : bb0 ( [ [ ARG : % . * ] ] : $ Either < Builtin . NativeObject , Builtin . UnknownObject > ) : <nl> - / / CHECK : switch_enum [ [ ARG ] ] : $ Either < Builtin . NativeObject , Builtin . UnknownObject > , case # Either . left ! enumelt . 1 : [ [ SUCC_BB : bb [ 0 - 9 ] + ] ] , default [ [ DEFAULT_BB : bb [ 0 - 9 ] + ] ] <nl> + / / CHECK - LABEL : sil @ switch_enum_default_case : $ @ convention ( thin ) ( @ owned Either < Builtin . NativeObject , AnyObject > ) - > ( ) { <nl> + / / CHECK : bb0 ( [ [ ARG : % . * ] ] : $ Either < Builtin . NativeObject , AnyObject > ) : <nl> + / / CHECK : switch_enum [ [ ARG ] ] : $ Either < Builtin . NativeObject , AnyObject > , case # Either . left ! enumelt . 1 : [ [ SUCC_BB : bb [ 0 - 9 ] + ] ] , default [ [ DEFAULT_BB : bb [ 0 - 9 ] + ] ] <nl> / / <nl> / / CHECK : [ [ SUCC_BB ] ] ( [ [ LHS : % . * ] ] : $ Builtin . NativeObject <nl> / / CHECK : strong_release [ [ LHS ] ] <nl> bb0 ( % 0 : @ guaranteed $ Builtin . NativeObject ) : <nl> / / CHECK : [ [ EPILOG_BB ] ] : <nl> / / CHECK : return <nl> / / CHECK : } / / end sil function ' switch_enum_default_case ' <nl> - sil [ ossa ] @ switch_enum_default_case : $ @ convention ( thin ) ( @ owned Either < Builtin . NativeObject , Builtin . UnknownObject > ) - > ( ) { <nl> - bb0 ( % 0 : @ owned $ Either < Builtin . NativeObject , Builtin . UnknownObject > ) : <nl> - switch_enum % 0 : $ Either < Builtin . NativeObject , Builtin . UnknownObject > , case # Either . left ! enumelt . 1 : bb1 , default bb2 <nl> + sil [ ossa ] @ switch_enum_default_case : $ @ convention ( thin ) ( @ owned Either < Builtin . NativeObject , Builtin . AnyObject > ) - > ( ) { <nl> + bb0 ( % 0 : @ owned $ Either < Builtin . NativeObject , Builtin . AnyObject > ) : <nl> + switch_enum % 0 : $ Either < Builtin . NativeObject , Builtin . AnyObject > , case # Either . left ! enumelt . 1 : bb1 , default bb2 <nl> <nl> bb1 ( % 1 : @ owned $ Builtin . NativeObject ) : <nl> destroy_value % 1 : $ Builtin . NativeObject <nl> br bb3 <nl> <nl> - bb2 ( % 2 : @ owned $ Either < Builtin . NativeObject , Builtin . UnknownObject > ) : <nl> - destroy_value % 2 : $ Either < Builtin . NativeObject , Builtin . UnknownObject > <nl> + bb2 ( % 2 : @ owned $ Either < Builtin . NativeObject , Builtin . AnyObject > ) : <nl> + destroy_value % 2 : $ Either < Builtin . NativeObject , Builtin . AnyObject > <nl> br bb3 <nl> <nl> bb3 : <nl> mmm a / test / SILOptimizer / simplify_cfg . sil <nl> ppp b / test / SILOptimizer / simplify_cfg . sil <nl> sil @ external_g : $ @ convention ( thin ) ( ) - > ( ) <nl> / / CHECK : dynamic_method_br <nl> / / CHECK - NOT : dynamic_method_br <nl> / / CHECK : return <nl> - sil @ dont_tail_duplicate_dynamic_method_br : $ @ convention ( thin ) ( @ owned Builtin . UnknownObject , Builtin . Int1 ) - > ( ) { <nl> - bb0 ( % x : $ Builtin . UnknownObject , % b : $ Builtin . Int1 ) : <nl> + sil @ dont_tail_duplicate_dynamic_method_br : $ @ convention ( thin ) ( @ owned Builtin . AnyObject , Builtin . Int1 ) - > ( ) { <nl> + bb0 ( % x : $ Builtin . AnyObject , % b : $ Builtin . Int1 ) : <nl> cond_br % b , bb1 , bb2 <nl> <nl> bb1 : <nl> % f = function_ref @ external_f : $ @ convention ( thin ) ( ) - > ( ) <nl> apply % f ( ) : $ @ convention ( thin ) ( ) - > ( ) <nl> - strong_retain % x : $ Builtin . UnknownObject <nl> - br bb3 ( % x : $ Builtin . UnknownObject ) <nl> + strong_retain % x : $ Builtin . AnyObject <nl> + br bb3 ( % x : $ Builtin . AnyObject ) <nl> <nl> bb2 : <nl> % g = function_ref @ external_g : $ @ convention ( thin ) ( ) - > ( ) <nl> apply % g ( ) : $ @ convention ( thin ) ( ) - > ( ) <nl> - strong_retain % x : $ Builtin . UnknownObject <nl> - br bb3 ( % x : $ Builtin . UnknownObject ) <nl> + strong_retain % x : $ Builtin . AnyObject <nl> + br bb3 ( % x : $ Builtin . AnyObject ) <nl> <nl> - bb3 ( % y : $ Builtin . UnknownObject ) : <nl> - strong_release % y : $ Builtin . UnknownObject <nl> - dynamic_method_br % x : $ Builtin . UnknownObject , # X . f ! 1 . foreign , bb4 , bb5 <nl> + bb3 ( % y : $ Builtin . AnyObject ) : <nl> + strong_release % y : $ Builtin . AnyObject <nl> + dynamic_method_br % x : $ Builtin . AnyObject , # X . f ! 1 . foreign , bb4 , bb5 <nl> <nl> - bb4 ( % m : $ @ convention ( objc_method ) ( Builtin . UnknownObject ) - > ( ) ) : <nl> + bb4 ( % m : $ @ convention ( objc_method ) ( Builtin . AnyObject ) - > ( ) ) : <nl> br bb6 <nl> <nl> bb5 : <nl> mmm a / test / SILOptimizer / split_critical_edges . sil <nl> ppp b / test / SILOptimizer / split_critical_edges . sil <nl> class X { <nl> / / CHECK : bb0 ( <nl> / / CHECK : cond_br % 1 , bb1 , bb2 <nl> / / CHECK : bb1 : <nl> - / / CHECK : dynamic_method_br { { . * } } : $ Builtin . UnknownObject , # X . f ! 1 . foreign , bb3 , bb4 <nl> + / / CHECK : dynamic_method_br { { . * } } : $ AnyObject , # X . f ! 1 . foreign , bb3 , bb4 <nl> / / CHECK : bb2 : <nl> - / / CHECK : dynamic_method_br { { . * } } : $ Builtin . UnknownObject , # X . f ! 1 . foreign , bb5 , bb6 <nl> - / / CHECK : bb3 ( { { . * } } : $ @ convention ( objc_method ) ( Builtin . UnknownObject ) - > ( ) ) <nl> + / / CHECK : dynamic_method_br { { . * } } : $ AnyObject , # X . f ! 1 . foreign , bb5 , bb6 <nl> + / / CHECK : bb3 ( { { . * } } : $ @ convention ( objc_method ) ( AnyObject ) - > ( ) ) <nl> / / CHECK : br bb7 <nl> / / CHECK : bb4 : <nl> / / CHECK : br bb7 <nl> - / / CHECK : bb5 ( { { . * } } : $ @ convention ( objc_method ) ( Builtin . UnknownObject ) - > ( ) ) : <nl> + / / CHECK : bb5 ( { { . * } } : $ @ convention ( objc_method ) ( AnyObject ) - > ( ) ) : <nl> / / CHECK : br bb7 <nl> / / CHECK : bb6 : <nl> / / CHECK : br bb7 <nl> lookup1 : <nl> % 3 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Optional < ( ) - > ( ) > > <nl> % 4 = load % 1a : $ * AnyObject <nl> strong_retain % 4 : $ AnyObject <nl> - % 6 = open_existential_ref % 4 : $ AnyObject to $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 000000000000 " ) AnyObject <nl> - % 7 = unchecked_ref_cast % 6 : $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 000000000000 " ) AnyObject to $ Builtin . UnknownObject <nl> - dynamic_method_br % 7 : $ Builtin . UnknownObject , # X . f ! 1 . foreign , bb1 , bb2 <nl> + dynamic_method_br % 4 : $ AnyObject , # X . f ! 1 . foreign , bb1 , bb2 <nl> <nl> lookup2 : <nl> % 21 = alloc_box $ < τ_0_0 > { var τ_0_0 } < AnyObject > <nl> lookup2 : <nl> % 23 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Optional < ( ) - > ( ) > > <nl> % 24 = load % 21a : $ * AnyObject <nl> strong_retain % 24 : $ AnyObject <nl> - % 26 = open_existential_ref % 24 : $ AnyObject to $ @ opened ( " 12345678 - 89ab - cdef - 0123 - 000000000000 " ) AnyObject <nl> - % 27 = unchecked_ref_cast % 26 : $ @ opened ( " 12345678 - 89ab - cdef - 0123 - 000000000000 " ) AnyObject to $ Builtin . UnknownObject <nl> - dynamic_method_br % 27 : $ Builtin . UnknownObject , # X . f ! 1 . foreign , bb3 , bb4 <nl> + dynamic_method_br % 24 : $ AnyObject , # X . f ! 1 . foreign , bb3 , bb4 <nl> <nl> - bb1 ( % 8 : $ @ convention ( objc_method ) ( Builtin . UnknownObject ) - > ( ) ) : <nl> + bb1 ( % 8 : $ @ convention ( objc_method ) ( AnyObject ) - > ( ) ) : <nl> br bb5 <nl> <nl> bb2 : <nl> br bb5 <nl> <nl> - bb3 ( % 9 : $ @ convention ( objc_method ) ( Builtin . UnknownObject ) - > ( ) ) : <nl> + bb3 ( % 9 : $ @ convention ( objc_method ) ( AnyObject ) - > ( ) ) : <nl> br bb5 <nl> <nl> bb4 : <nl> mmm a / test / SILOptimizer / typed - access - tb - aa . sil <nl> ppp b / test / SILOptimizer / typed - access - tb - aa . sil <nl> bb0 : <nl> / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 135 . <nl> / / CHECK - NEXT : % 7 = project_box % 0 : $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > , 0 <nl> - / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 136 . <nl> / / CHECK - NEXT : % 7 = project_box % 0 : $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > , 0 <nl> bb0 : <nl> / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 142 . <nl> / / CHECK - NEXT : % 7 = project_box % 0 : $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > , 0 <nl> - / / CHECK - NEXT : % 16 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 16 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 143 . <nl> / / CHECK - NEXT : % 7 = project_box % 0 : $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > , 0 <nl> bb0 : <nl> / / Now check that a native object address may : <nl> / / <nl> / / 1 . May alias raw pointer addresses . <nl> - / / 2 . Not alias an unknown object . Objective - C objects are allocated differently <nl> - / / than Swift objects and may not alias . <nl> + / / 2 . May alias an unknown object . <nl> / / 3 . Does not alias scalar addresses . This can only occur via inttoptr and the <nl> / / like . Since we are using type oracles we are allowed to make the assumption <nl> / / that this type of type punning can be ignored . <nl> bb0 : <nl> <nl> / / CHECK : PAIR # 149 . <nl> / / CHECK - NEXT : % 8 = project_box % 1 : $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > , 0 <nl> - / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 150 . <nl> / / CHECK - NEXT : % 8 = project_box % 1 : $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > , 0 <nl> / / CHECK - NEXT : % 10 = project_box % 3 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > , 0 <nl> bb0 : <nl> / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 156 . <nl> / / CHECK - NEXT : % 8 = project_box % 1 : $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > , 0 <nl> - / / CHECK - NEXT : % 16 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : % 16 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 157 . <nl> / / CHECK - NEXT : % 8 = project_box % 1 : $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > , 0 <nl> / / CHECK - NEXT : % 17 = project_box % 3 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > , 0 <nl> bb0 : <nl> / / CHECK - NEXT : % 20 = project_box % 6 : $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE64 > , 0 <nl> / / CHECK - NEXT : NoAlias <nl> <nl> - / / Check that unknown object addresses may only alias raw pointer addresses and <nl> - / / other unknown object addresses . Anything else should be no alias . <nl> + / / Check that AnyObject addresses can alias pretty much any object or untyped <nl> + / / pointer . <nl> + / / FIXME : We could do better here ; AnyObject is a particularly easy existential . <nl> / / CHECK : PAIR # 163 . <nl> - / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : % 10 = project_box % 3 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 164 . <nl> - / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : % 11 = project_box % 4 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int32 > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 165 . <nl> - / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : % 12 = project_box % 5 : $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE32 > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 166 . <nl> - / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : % 13 = project_box % 6 : $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE64 > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 167 . <nl> - / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : % 14 = project_box % 0 : $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > , 0 <nl> / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 168 . <nl> - / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : % 15 = project_box % 1 : $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 169 . <nl> - / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> - / / CHECK - NEXT : % 16 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> + / / CHECK - NEXT : % 16 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 170 . <nl> - / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : % 17 = project_box % 3 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 171 . <nl> - / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : % 18 = project_box % 4 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int32 > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 172 . <nl> - / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : % 19 = project_box % 5 : $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE32 > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 173 . <nl> - / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : % 20 = project_box % 6 : $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE64 > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : MayAlias <nl> <nl> / / Next check that Int8 addresses can only alias Int8 addresses and raw <nl> / / pointers . This includes ensuring that Int8 cannot alias Int32 addresses . <nl> bb0 : <nl> / / CHECK - NEXT : NoAlias <nl> / / CHECK : PAIR # 181 . <nl> / / CHECK - NEXT : % 10 = project_box % 3 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > , 0 <nl> - / / CHECK - NEXT : % 16 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : % 16 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 182 . <nl> / / CHECK - NEXT : % 10 = project_box % 3 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > , 0 <nl> / / CHECK - NEXT : % 17 = project_box % 3 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > , 0 <nl> bb0 : <nl> / / CHECK - NEXT : NoAlias <nl> / / CHECK : PAIR # 202 . <nl> / / CHECK - NEXT : % 12 = project_box % 5 : $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE32 > , 0 <nl> - / / CHECK - NEXT : % 16 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : % 16 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 203 . <nl> / / CHECK - NEXT : % 12 = project_box % 5 : $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE32 > , 0 <nl> / / CHECK - NEXT : % 17 = project_box % 3 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > , 0 <nl> sil @ builtin_test : $ @ convention ( thin ) ( ) - > ( ) { <nl> bb0 : <nl> % 0 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > <nl> % 1 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > <nl> - % 2 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > <nl> + % 2 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . AnyObject > <nl> % 3 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > <nl> % 4 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . Int32 > <nl> % 5 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE32 > <nl> bb0 : <nl> <nl> % 7 = project_box % 0 : $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > , 0 <nl> % 8 = project_box % 1 : $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > , 0 <nl> - % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + % 9 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . AnyObject > , 0 <nl> % 10 = project_box % 3 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > , 0 <nl> % 11 = project_box % 4 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int32 > , 0 <nl> % 12 = project_box % 5 : $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE32 > , 0 <nl> bb0 : <nl> / / makes it simpler to write these tests . <nl> % 14 = project_box % 0 : $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > , 0 <nl> % 15 = project_box % 1 : $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > , 0 <nl> - % 16 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + % 16 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < Builtin . AnyObject > , 0 <nl> % 17 = project_box % 3 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > , 0 <nl> % 18 = project_box % 4 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int32 > , 0 <nl> % 19 = project_box % 5 : $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE32 > , 0 <nl> bb0 : <nl> / / CHECK - NEXT : NoAlias <nl> / / CHECK : PAIR # 353 . <nl> / / CHECK - NEXT : % 13 = project_box % 6 : $ < τ_0_0 > { var τ_0_0 } < STest_S3 > , 0 <nl> - / / CHECK - NEXT : % 28 = project_box % 23 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : % 28 = project_box % 23 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 354 . <nl> / / CHECK - NEXT : % 13 = project_box % 6 : $ < τ_0_0 > { var τ_0_0 } < STest_S3 > , 0 <nl> / / CHECK - NEXT : % 29 = project_box % 24 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int32 > , 0 <nl> sil @ struct_tests : $ @ convention ( thin ) ( ) - > ( ) { <nl> <nl> % 21 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > <nl> % 22 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > <nl> - % 23 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > <nl> + % 23 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . AnyObject > <nl> % 24 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . Int32 > <nl> % 25 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE32 > <nl> <nl> % 26 = project_box % 21 : $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > , 0 <nl> % 27 = project_box % 22 : $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > , 0 <nl> - % 28 = project_box % 23 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + % 28 = project_box % 23 : $ < τ_0_0 > { var τ_0_0 } < Builtin . AnyObject > , 0 <nl> % 29 = project_box % 24 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int32 > , 0 <nl> % 30 = project_box % 25 : $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE32 > , 0 <nl> <nl> sil @ struct_tests : $ @ convention ( thin ) ( ) - > ( ) { <nl> / / CHECK - NEXT : NoAlias <nl> / / CHECK : PAIR # 353 . <nl> / / CHECK - NEXT : % 13 = project_box % 6 : $ < τ_0_0 > { var τ_0_0 } < ETest_E3 > , 0 <nl> - / / CHECK - NEXT : % 28 = project_box % 23 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : % 28 = project_box % 23 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 354 . <nl> / / CHECK - NEXT : % 13 = project_box % 6 : $ < τ_0_0 > { var τ_0_0 } < ETest_E3 > , 0 <nl> / / CHECK - NEXT : % 29 = project_box % 24 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int32 > , 0 <nl> sil @ enum_tests : $ @ convention ( thin ) ( ) - > ( ) { <nl> <nl> % 21 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > <nl> % 22 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > <nl> - % 23 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > <nl> + % 23 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . AnyObject > <nl> % 24 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . Int32 > <nl> % 25 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE32 > <nl> <nl> % 26 = project_box % 21 : $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > , 0 <nl> % 27 = project_box % 22 : $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > , 0 <nl> - % 28 = project_box % 23 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + % 28 = project_box % 23 : $ < τ_0_0 > { var τ_0_0 } < Builtin . AnyObject > , 0 <nl> % 29 = project_box % 24 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int32 > , 0 <nl> % 30 = project_box % 25 : $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE32 > , 0 <nl> <nl> sil @ enum_tests : $ @ convention ( thin ) ( ) - > ( ) { <nl> / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 85 . <nl> / / CHECK - NEXT : % 3 = project_box % 0 : $ < τ_0_0 > { var τ_0_0 } < CTest_C1 > , 0 <nl> - / / CHECK - NEXT : % 19 = project_box % 12 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 19 = project_box % 12 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 86 . <nl> / / CHECK - NEXT : % 3 = project_box % 0 : $ < τ_0_0 > { var τ_0_0 } < CTest_C1 > , 0 <nl> sil @ enum_tests : $ @ convention ( thin ) ( ) - > ( ) { <nl> / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 105 . <nl> / / CHECK - NEXT : % 4 = project_box % 1 : $ < τ_0_0 > { var τ_0_0 } < CTest_C2 > , 0 <nl> - / / CHECK - NEXT : % 19 = project_box % 12 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 19 = project_box % 12 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 106 . <nl> / / CHECK - NEXT : % 4 = project_box % 1 : $ < τ_0_0 > { var τ_0_0 } < CTest_C2 > , 0 <nl> sil @ enum_tests : $ @ convention ( thin ) ( ) - > ( ) { <nl> / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 124 . <nl> / / CHECK - NEXT : % 5 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < CTest_C3 > , 0 <nl> - / / CHECK - NEXT : % 19 = project_box % 12 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + / / CHECK - NEXT : % 19 = project_box % 12 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 125 . <nl> / / CHECK - NEXT : % 5 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < CTest_C3 > , 0 <nl> sil @ class_tests : $ @ convention ( thin ) ( ) - > ( ) { <nl> % 9 = alloc_box $ < τ_0_0 > { var τ_0_0 } < AnyObject > <nl> % 10 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > <nl> % 11 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > <nl> - % 12 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > <nl> + % 12 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . AnyObject > <nl> % 13 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > <nl> % 14 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . Int32 > <nl> % 15 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE32 > <nl> sil @ class_tests : $ @ convention ( thin ) ( ) - > ( ) { <nl> % 16 = project_box % 9 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> % 17 = project_box % 10 : $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > , 0 <nl> % 18 = project_box % 11 : $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > , 0 <nl> - % 19 = project_box % 12 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + % 19 = project_box % 12 : $ < τ_0_0 > { var τ_0_0 } < Builtin . AnyObject > , 0 <nl> % 20 = project_box % 13 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > , 0 <nl> % 21 = project_box % 14 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int32 > , 0 <nl> % 22 = project_box % 15 : $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE32 > , 0 <nl> sil @ class_tests : $ @ convention ( thin ) ( ) - > ( ) { <nl> / / CHECK - NEXT : NoAlias <nl> / / CHECK : PAIR # 77 . <nl> / / CHECK - NEXT : % 3 = project_box % 0 : $ < τ_0_0 > { var τ_0_0 } < ( Builtin . RawPointer , Builtin . Int64 ) > , 0 <nl> - / / CHECK - NEXT : % 17 = project_box % 11 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : % 17 = project_box % 11 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 78 . <nl> / / CHECK - NEXT : % 3 = project_box % 0 : $ < τ_0_0 > { var τ_0_0 } < ( Builtin . RawPointer , Builtin . Int64 ) > , 0 <nl> / / CHECK - NEXT : % 18 = project_box % 12 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > , 0 <nl> sil @ class_tests : $ @ convention ( thin ) ( ) - > ( ) { <nl> / / CHECK - NEXT : NoAlias <nl> / / CHECK : PAIR # 95 . <nl> / / CHECK - NEXT : % 4 = project_box % 1 : $ < τ_0_0 > { var τ_0_0 } < ( TTest_S1 , Builtin . Int64 ) > , 0 <nl> - / / CHECK - NEXT : % 17 = project_box % 11 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : % 17 = project_box % 11 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 96 . <nl> / / CHECK - NEXT : % 4 = project_box % 1 : $ < τ_0_0 > { var τ_0_0 } < ( TTest_S1 , Builtin . Int64 ) > , 0 <nl> / / CHECK - NEXT : % 18 = project_box % 12 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > , 0 <nl> sil @ class_tests : $ @ convention ( thin ) ( ) - > ( ) { <nl> / / CHECK - NEXT : NoAlias <nl> / / CHECK : PAIR # 112 . <nl> / / CHECK - NEXT : % 5 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < ( TTest_E1 , Builtin . Int64 ) > , 0 <nl> - / / CHECK - NEXT : % 17 = project_box % 11 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> - / / CHECK - NEXT : NoAlias <nl> + / / CHECK - NEXT : % 17 = project_box % 11 : $ < τ_0_0 > { var τ_0_0 } < AnyObject > , 0 <nl> + / / CHECK - NEXT : MayAlias <nl> / / CHECK : PAIR # 113 . <nl> / / CHECK - NEXT : % 5 = project_box % 2 : $ < τ_0_0 > { var τ_0_0 } < ( TTest_E1 , Builtin . Int64 ) > , 0 <nl> / / CHECK - NEXT : % 18 = project_box % 12 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > , 0 <nl> sil @ tuple_tests : $ @ convention ( thin ) ( ) - > ( ) { <nl> <nl> % 9 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > <nl> % 10 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > <nl> - % 11 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > <nl> + % 11 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . AnyObject > <nl> % 12 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > <nl> % 13 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . Int32 > <nl> % 14 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE32 > <nl> <nl> % 15 = project_box % 9 : $ < τ_0_0 > { var τ_0_0 } < Builtin . RawPointer > , 0 <nl> % 16 = project_box % 10 : $ < τ_0_0 > { var τ_0_0 } < Builtin . NativeObject > , 0 <nl> - % 17 = project_box % 11 : $ < τ_0_0 > { var τ_0_0 } < Builtin . UnknownObject > , 0 <nl> + % 17 = project_box % 11 : $ < τ_0_0 > { var τ_0_0 } < Builtin . AnyObject > , 0 <nl> % 18 = project_box % 12 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int8 > , 0 <nl> % 19 = project_box % 13 : $ < τ_0_0 > { var τ_0_0 } < Builtin . Int32 > , 0 <nl> % 20 = project_box % 14 : $ < τ_0_0 > { var τ_0_0 } < Builtin . FPIEEE32 > , 0 <nl> mmm a / test / Serialization / Inputs / def_basic . sil <nl> ppp b / test / Serialization / Inputs / def_basic . sil <nl> bb0 : <nl> % C = alloc_ref $ C <nl> / / CHECK : unchecked_ref_cast % 0 : $ C to $ Builtin . NativeObject <nl> % 1 = unchecked_ref_cast % C : $ C to $ Builtin . NativeObject <nl> - / / CHECK : unchecked_ref_cast % 0 : $ C to $ Builtin . UnknownObject <nl> - % O = unchecked_ref_cast % C : $ C to $ Builtin . UnknownObject <nl> + / / CHECK : unchecked_ref_cast % 0 : $ C to $ AnyObject <nl> + % O = unchecked_ref_cast % C : $ C to $ Builtin . AnyObject <nl> <nl> / / CHECK : class_method { { . * } } : $ C , # C . doIt ! 1 <nl> % 2 = class_method % C : $ C , # C . doIt ! 1 : ( C ) - > ( ) - > ( ) , $ @ convention ( method ) ( @ guaranteed C ) - > ( ) <nl> bb0 ( % 0 : $ AnyObject ) : <nl> % 3 = alloc_box $ < τ_0_0 > { var τ_0_0 } < Optional < ( ) - > ( ) > > <nl> % 4 = load % 1a : $ * AnyObject <nl> strong_retain % 4 : $ AnyObject <nl> - / / CHECK : open_existential_ref % { { . * } } : $ AnyObject to $ @ opened ( { { . * } } ) AnyObject <nl> + / / CHECK : open_existential_ref % { { . * } } : $ AnyObject to $ @ opened ( [ [ EXISTENTIAL_UUID : . * ] ] ) AnyObject <nl> % 6 = open_existential_ref % 4 : $ AnyObject to $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 222222222222 " ) AnyObject <nl> - % 7 = unchecked_ref_cast % 6 : $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 222222222222 " ) AnyObject to $ Builtin . UnknownObject <nl> - / / CHECK : dynamic_method_br % { { . * } } : $ Builtin . UnknownObject , # X . f ! 1 . foreign , bb { { . * } } , bb { { . * } } <nl> - dynamic_method_br % 7 : $ Builtin . UnknownObject , # X . f ! 1 . foreign , bb1 , bb2 <nl> - bb1 ( % z : $ @ convention ( objc_method ) ( Builtin . UnknownObject ) - > ( ) ) : <nl> + / / CHECK : dynamic_method_br % { { . * } } : $ @ opened ( [ [ EXISTENTIAL_UUID ] ] ) AnyObject , # X . f ! 1 . foreign , bb { { . * } } , bb { { . * } } <nl> + dynamic_method_br % 6 : $ @ opened ( " 01234567 - 89ab - cdef - 0123 - 222222222222 " ) AnyObject , # X . f ! 1 . foreign , bb1 , bb2 <nl> + bb1 ( % z : $ @ convention ( objc_method ) ( @ opened ( " 01234567 - 89ab - cdef - 0123 - 222222222222 " ) AnyObject ) - > ( ) ) : <nl> br bb3 <nl> <nl> bb2 : <nl> mmm a / tools / swift - reflection - dump / swift - reflection - dump . cpp <nl> ppp b / tools / swift - reflection - dump / swift - reflection - dump . cpp <nl> <nl> / / binaries . <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> <nl> + # include " . . / . . / stdlib / public / runtime / ImageInspectionELF . h " <nl> # include " swift / ABI / MetadataValues . h " <nl> # include " swift / Basic / LLVMInitialize . h " <nl> # include " swift / Demangling / Demangle . h " <nl> # include " swift / Reflection / ReflectionContext . h " <nl> # include " swift / Reflection / TypeRef . h " <nl> # include " swift / Reflection / TypeRefBuilder . h " <nl> + <nl> # include " llvm / ADT / StringSet . h " <nl> # include " llvm / Object / Archive . h " <nl> # include " llvm / Object / COFF . h " <nl> template < typename T > static T unwrap ( llvm : : Expected < T > value ) { <nl> exit ( EXIT_FAILURE ) ; <nl> } <nl> <nl> + static void reportError ( StringRef Message ) { <nl> + llvm : : errs ( ) < < " swift - reflection - test error : " < < Message < < " . \ n " ; <nl> + exit ( EXIT_FAILURE ) ; <nl> + } <nl> + <nl> static void reportError ( std : : error_code EC ) { <nl> assert ( EC ) ; <nl> - llvm : : errs ( ) < < " swift - reflection - test error : " < < EC . message ( ) < < " . \ n " ; <nl> - exit ( EXIT_FAILURE ) ; <nl> + reportError ( EC . message ( ) ) ; <nl> } <nl> <nl> - using NativeReflectionContext = <nl> - swift : : reflection : : ReflectionContext < External < RuntimeTarget < sizeof ( uintptr_t ) > > > ; <nl> + using NativeReflectionContext = swift : : reflection : : ReflectionContext < <nl> + External < RuntimeTarget < sizeof ( uintptr_t ) > > > ; <nl> <nl> using ReadBytesResult = swift : : remote : : MemoryReader : : ReadBytesResult ; <nl> <nl> static uint64_t getSectionAddress ( SectionRef S ) { <nl> - / / See COFFObjectFile . cpp for the implementation of <nl> + / / See COFFObjectFile . cpp for the implementation of <nl> / / COFFObjectFile : : getSectionAddress . The image base address is added <nl> - / / to all the addresses of the sections , thus the behavior is slightly different from <nl> - / / the other platforms . <nl> + / / to all the addresses of the sections , thus the behavior is slightly <nl> + / / different from the other platforms . <nl> if ( auto C = dyn_cast < COFFObjectFile > ( S . getObject ( ) ) ) <nl> return S . getAddress ( ) - C - > getImageBase ( ) ; <nl> return S . getAddress ( ) ; <nl> static bool needToRelocate ( SectionRef S ) { <nl> <nl> if ( auto EO = dyn_cast < ELFObjectFileBase > ( S . getObject ( ) ) ) { <nl> static const llvm : : StringSet < > ELFSectionsList = { <nl> - " . data " , " . rodata " , " swift5_protocols " , " swift5_protocol_conformances " , <nl> - " swift5_typeref " , " swift5_reflstr " , " swift5_assocty " , " swift5_replace " , <nl> - " swift5_type_metadata " , " swift5_fieldmd " , " swift5_capture " , " swift5_builtin " <nl> + " . data " , <nl> + " . rodata " , <nl> + " . note . swift_reflection_metadata " , <nl> + " swift5_protocols " , <nl> + " swift5_protocol_conformances " , <nl> + " swift5_typeref " , <nl> + " swift5_reflstr " , <nl> + " swift5_assocty " , <nl> + " swift5_replace " , <nl> + " swift5_type_metadata " , <nl> + " swift5_fieldmd " , <nl> + " swift5_capture " , <nl> + " swift5_builtin " , <nl> } ; <nl> llvm : : Expected < llvm : : StringRef > NameOrErr = S . getName ( ) ; <nl> if ( ! NameOrErr ) { <nl> static bool needToRelocate ( SectionRef S ) { <nl> return true ; <nl> } <nl> <nl> + static section_iterator findSectionByName ( StringRef Name , const ObjectFile & O ) { <nl> + auto Sections = O . sections ( ) ; <nl> + SmallVector < section_iterator , 1 > FoundSections ; <nl> + std : : copy_if ( Sections . begin ( ) , Sections . end ( ) , <nl> + std : : back_inserter ( FoundSections ) , [ Name ] ( SectionRef S ) { <nl> + StringRef N ; <nl> + if ( auto EC = S . getName ( N ) ) <nl> + reportError ( EC ) ; <nl> + return N = = Name ; <nl> + } ) ; <nl> + if ( FoundSections . size ( ) ! = 1 ) <nl> + return Sections . end ( ) ; <nl> + return FoundSections . front ( ) ; <nl> + } <nl> + <nl> + template < class ELFObj , <nl> + typename std : : enable_if < <nl> + std : : is_base_of < ELFObjectFileBase , ELFObj > : : value , int > : : type = 0 > <nl> + const typename ELFObj : : Elf_Rela * findRelaForOffset ( uint64_t Offset , <nl> + const ELFObj & O ) { <nl> + for ( const SectionRef & S : <nl> + static_cast < const ObjectFile * > ( & O ) - > dynamic_relocation_sections ( ) ) { <nl> + const auto * Sec = O . getSection ( S . getRawDataRefImpl ( ) ) ; <nl> + if ( Sec - > sh_type ! = llvm : : ELF : : SHT_RELA ) <nl> + continue ; <nl> + for ( const RelocationRef & R : S . relocations ( ) ) { <nl> + const auto * Rela = O . getRela ( R . getRawDataRefImpl ( ) ) ; <nl> + if ( Rela - > r_offset = = Offset & & <nl> + Rela - > getType ( false / * isMips64EL * / ) = = llvm : : ELF : : R_X86_64_RELATIVE ) <nl> + return Rela ; <nl> + } <nl> + } <nl> + return nullptr ; <nl> + } <nl> + <nl> + static void updateReflectionMetdataNote ( const ObjectFile & O , char * Memory ) { <nl> + auto EO = dyn_cast < const ELFObjectFileBase > ( & O ) ; <nl> + if ( ! EO ) <nl> + return ; <nl> + auto Note = findSectionByName ( " . note . swift_reflection_metadata " , O ) ; <nl> + if ( Note = = O . sections ( ) . end ( ) ) <nl> + return ; <nl> + const StringRef MagicString = SWIFT_REFLECTION_METADATA_ELF_NOTE_MAGIC_STRING ; <nl> + if ( StringRef ( Memory + Note - > getAddress ( ) , MagicString . size ( ) ) ! = MagicString ) <nl> + reportError ( " . note . swift_reflection_metadata is invalid " ) ; <nl> + <nl> + const uint64_t Offset = Note - > getAddress ( ) + MagicString . size ( ) + 1 ; <nl> + uint64_t Addend = 0 ; <nl> + if ( auto * ELF32LEObj = dyn_cast < ELF32LEObjectFile > ( EO ) ) <nl> + if ( auto * Rela = findRelaForOffset ( Offset , * ELF32LEObj ) ) <nl> + Addend = static_cast < uint64_t > ( Rela - > r_addend ) ; <nl> + if ( auto * ELF64LEObj = dyn_cast < ELF64LEObjectFile > ( EO ) ) <nl> + if ( auto * Rela = findRelaForOffset ( Offset , * ELF64LEObj ) ) <nl> + Addend = static_cast < uint64_t > ( Rela - > r_addend ) ; <nl> + if ( ! Addend ) <nl> + reportError ( " No supported relocations found " ) ; <nl> + uintptr_t PtrValue = reinterpret_cast < uintptr_t > ( Memory ) + Addend ; <nl> + * reinterpret_cast < uintptr_t * > ( Memory + Note - > getAddress ( ) + <nl> + MagicString . size ( ) + 1 ) = PtrValue ; <nl> + auto S = reinterpret_cast < MetadataSections * > ( PtrValue ) ; <nl> + <nl> + # define STRINGIFY ( s ) # s <nl> + # define UPDATE_SECTION_RANGE ( Name ) \ <nl> + [ & ] ( ) { \ <nl> + auto It = findSectionByName ( STRINGIFY ( Name ) , O ) ; \ <nl> + if ( It = = O . sections ( ) . end ( ) ) \ <nl> + return ; \ <nl> + uintptr_t Addr = reinterpret_cast < uintptr_t > ( Memory ) + It - > getAddress ( ) ; \ <nl> + S - > Name = { Addr , It - > getSize ( ) } ; \ <nl> + } ( ) ; <nl> + <nl> + UPDATE_SECTION_RANGE ( swift5_protocols ) <nl> + UPDATE_SECTION_RANGE ( swift5_protocol_conformances ) <nl> + UPDATE_SECTION_RANGE ( swift5_type_metadata ) <nl> + UPDATE_SECTION_RANGE ( swift5_typeref ) <nl> + UPDATE_SECTION_RANGE ( swift5_reflstr ) <nl> + UPDATE_SECTION_RANGE ( swift5_fieldmd ) <nl> + UPDATE_SECTION_RANGE ( swift5_assocty ) <nl> + UPDATE_SECTION_RANGE ( swift5_replace ) <nl> + UPDATE_SECTION_RANGE ( swift5_replac2 ) <nl> + UPDATE_SECTION_RANGE ( swift5_builtin ) <nl> + UPDATE_SECTION_RANGE ( swift5_capture ) <nl> + # undef STRINGIFY <nl> + # undef UPDATE_SECTION_RANGE <nl> + } <nl> <nl> class Image { <nl> std : : vector < char > Memory ; <nl> class Image { <nl> std : : memcpy ( & Memory [ getSectionAddress ( S ) ] , Content - > data ( ) , <nl> Content - > size ( ) ) ; <nl> } <nl> + updateReflectionMetdataNote ( * O , Memory . data ( ) ) ; <nl> } <nl> <nl> RemoteAddress getStartAddress ( ) const { <nl> | Merge pull request from harlanhaskins / master - next - merge - master - 09 - 26 - 2019 | apple/swift | 3a29e99de6156635926ce75b0cc317b8b2b12973 | 2019-09-27T19:37:10Z |
mmm a / qa / rpc - tests / httpbasics . py <nl> ppp b / qa / rpc - tests / httpbasics . py <nl> <nl> except ImportError : <nl> import urlparse <nl> <nl> - class HTTPBasicsTest ( BitcoinTestFramework ) : <nl> + class HTTPBasicsTest ( BitcoinTestFramework ) : <nl> def setup_nodes ( self ) : <nl> return start_nodes ( 4 , self . options . tmpdir , extra_args = [ [ ' - rpckeepalive = 1 ' ] , [ ' - rpckeepalive = 0 ' ] , [ ] , [ ] ] ) <nl> <nl> - def run_test ( self ) : <nl> - <nl> + def run_test ( self ) : <nl> + <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # lowlevel check for http persistent connection # <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> url = urlparse . urlparse ( self . nodes [ 0 ] . url ) <nl> authpair = url . username + ' : ' + url . password <nl> headers = { " Authorization " : " Basic " + base64 . b64encode ( authpair ) } <nl> - <nl> + <nl> conn = httplib . HTTPConnection ( url . hostname , url . port ) <nl> conn . connect ( ) <nl> conn . request ( ' POST ' , ' / ' , ' { " method " : " getbestblockhash " } ' , headers ) <nl> out1 = conn . getresponse ( ) . read ( ) ; <nl> assert_equal ( ' " error " : null ' in out1 , True ) <nl> assert_equal ( conn . sock ! = None , True ) # according to http / 1 . 1 connection must still be open ! <nl> - <nl> + <nl> # send 2nd request without closing connection <nl> conn . request ( ' POST ' , ' / ' , ' { " method " : " getchaintips " } ' , headers ) <nl> out2 = conn . getresponse ( ) . read ( ) ; <nl> assert_equal ( ' " error " : null ' in out1 , True ) # must also response with a correct json - rpc message <nl> assert_equal ( conn . sock ! = None , True ) # according to http / 1 . 1 connection must still be open ! <nl> conn . close ( ) <nl> - <nl> + <nl> # same should be if we add keep - alive because this should be the std . behaviour <nl> headers = { " Authorization " : " Basic " + base64 . b64encode ( authpair ) , " Connection " : " keep - alive " } <nl> - <nl> + <nl> conn = httplib . HTTPConnection ( url . hostname , url . port ) <nl> conn . connect ( ) <nl> conn . request ( ' POST ' , ' / ' , ' { " method " : " getbestblockhash " } ' , headers ) <nl> out1 = conn . getresponse ( ) . read ( ) ; <nl> assert_equal ( ' " error " : null ' in out1 , True ) <nl> assert_equal ( conn . sock ! = None , True ) # according to http / 1 . 1 connection must still be open ! <nl> - <nl> + <nl> # send 2nd request without closing connection <nl> conn . request ( ' POST ' , ' / ' , ' { " method " : " getchaintips " } ' , headers ) <nl> out2 = conn . getresponse ( ) . read ( ) ; <nl> assert_equal ( ' " error " : null ' in out1 , True ) # must also response with a correct json - rpc message <nl> assert_equal ( conn . sock ! = None , True ) # according to http / 1 . 1 connection must still be open ! <nl> conn . close ( ) <nl> - <nl> + <nl> # now do the same with " Connection : close " <nl> headers = { " Authorization " : " Basic " + base64 . b64encode ( authpair ) , " Connection " : " close " } <nl> - <nl> + <nl> conn = httplib . HTTPConnection ( url . hostname , url . port ) <nl> conn . connect ( ) <nl> conn . request ( ' POST ' , ' / ' , ' { " method " : " getbestblockhash " } ' , headers ) <nl> out1 = conn . getresponse ( ) . read ( ) ; <nl> assert_equal ( ' " error " : null ' in out1 , True ) <nl> - assert_equal ( conn . sock ! = None , False ) # now the connection must be closed after the response <nl> - <nl> + assert_equal ( conn . sock ! = None , False ) # now the connection must be closed after the response <nl> + <nl> # node1 ( 2nd node ) is running with disabled keep - alive option <nl> urlNode1 = urlparse . urlparse ( self . nodes [ 1 ] . url ) <nl> authpair = urlNode1 . username + ' : ' + urlNode1 . password <nl> headers = { " Authorization " : " Basic " + base64 . b64encode ( authpair ) } <nl> - <nl> + <nl> conn = httplib . HTTPConnection ( urlNode1 . hostname , urlNode1 . port ) <nl> conn . connect ( ) <nl> conn . request ( ' POST ' , ' / ' , ' { " method " : " getbestblockhash " } ' , headers ) <nl> out1 = conn . getresponse ( ) . read ( ) ; <nl> assert_equal ( ' " error " : null ' in out1 , True ) <nl> assert_equal ( conn . sock ! = None , False ) # connection must be closed because keep - alive was set to false <nl> - <nl> + <nl> # node2 ( third node ) is running with standard keep - alive parameters which means keep - alive is off <nl> urlNode2 = urlparse . urlparse ( self . nodes [ 2 ] . url ) <nl> authpair = urlNode2 . username + ' : ' + urlNode2 . password <nl> headers = { " Authorization " : " Basic " + base64 . b64encode ( authpair ) } <nl> - <nl> + <nl> conn = httplib . HTTPConnection ( urlNode2 . hostname , urlNode2 . port ) <nl> conn . connect ( ) <nl> conn . request ( ' POST ' , ' / ' , ' { " method " : " getbestblockhash " } ' , headers ) <nl> out1 = conn . getresponse ( ) . read ( ) ; <nl> assert_equal ( ' " error " : null ' in out1 , True ) <nl> assert_equal ( conn . sock ! = None , True ) # connection must be closed because bitcoind should use keep - alive by default <nl> - <nl> + <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + # setban / listbanned tests # <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + assert_equal ( len ( self . nodes [ 2 ] . getpeerinfo ( ) ) , 4 ) ; # we should have 4 nodes at this point <nl> + self . nodes [ 2 ] . setban ( " 127 . 0 . 0 . 1 " , " add " ) <nl> + time . sleep ( 3 ) # wait till the nodes are disconected <nl> + assert_equal ( len ( self . nodes [ 2 ] . getpeerinfo ( ) ) , 0 ) ; # all nodes must be disconnected at this point <nl> + assert_equal ( len ( self . nodes [ 2 ] . listbanned ( ) ) , 1 ) ; <nl> + self . nodes [ 2 ] . clearbanned ( ) <nl> + assert_equal ( len ( self . nodes [ 2 ] . listbanned ( ) ) , 0 ) ; <nl> + <nl> if __name__ = = ' __main__ ' : <nl> HTTPBasicsTest ( ) . main ( ) <nl> mmm a / src / test / rpc_tests . cpp <nl> ppp b / src / test / rpc_tests . cpp <nl> BOOST_AUTO_TEST_CASE ( rpc_boostasiotocnetaddr ) <nl> BOOST_CHECK_EQUAL ( BoostAsioToCNetAddr ( boost : : asio : : ip : : address : : from_string ( " : : ffff : 127 . 0 . 0 . 1 " ) ) . ToString ( ) , " 127 . 0 . 0 . 1 " ) ; <nl> } <nl> <nl> + BOOST_AUTO_TEST_CASE ( rpc_ban ) <nl> + { <nl> + BOOST_CHECK_NO_THROW ( CallRPC ( string ( " setban 127 . 0 . 0 . 1 add " ) ) ) ; <nl> + BOOST_CHECK_THROW ( CallRPC ( string ( " setban 127 . 0 . 0 . 1 : 8334 " ) ) , runtime_error ) ; / / portnumber for setban not allowed <nl> + BOOST_CHECK_NO_THROW ( CallRPC ( string ( " listbanned " ) ) ) ; <nl> + BOOST_CHECK_NO_THROW ( CallRPC ( string ( " setban 127 . 0 . 0 . 1 remove " ) ) ) ; <nl> + BOOST_CHECK_NO_THROW ( CallRPC ( string ( " clearbanned " ) ) ) ; <nl> + } <nl> + <nl> BOOST_AUTO_TEST_SUITE_END ( ) <nl> | [ QA ] add setban / listbanned / clearbanned tests | bitcoin/bitcoin | 1086ffba2639098558422935eba1cae9983dd913 | 2015-06-17T19:40:55Z |
mmm a / folly / ExceptionWrapper . h <nl> ppp b / folly / ExceptionWrapper . h <nl> class exception_wrapper { <nl> <nl> template < class Ex , class F > <nl> bool with_exception ( F f ) { <nl> - if ( item_ ) { <nl> - if ( auto ex = dynamic_cast < Ex * > ( getCopied ( ) ) ) { <nl> - f ( * ex ) ; <nl> - return true ; <nl> - } <nl> - } else if ( eptr_ ) { <nl> - try { <nl> - std : : rethrow_exception ( eptr_ ) ; <nl> - } catch ( std : : exception & e ) { <nl> - if ( auto ex = dynamic_cast < Ex * > ( & e ) ) { <nl> - f ( * ex ) ; <nl> - return true ; <nl> - } <nl> - } catch ( . . . ) { <nl> - / / fall through <nl> - } <nl> - } <nl> - return false ; <nl> + return with_exception1 < Ex > ( f , this ) ; <nl> } <nl> <nl> template < class Ex , class F > <nl> bool with_exception ( F f ) const { <nl> - return with_exception < const Ex > ( f ) ; <nl> + return with_exception1 < const Ex > ( f , this ) ; <nl> } <nl> <nl> std : : exception_ptr getExceptionPtr ( ) const { <nl> class exception_wrapper { <nl> return std : : exception_ptr ( ) ; <nl> } <nl> <nl> - protected : <nl> + protected : <nl> / / Optimized case : if we know what type the exception is , we can <nl> / / store a copy of the concrete type , and a helper function so we <nl> / / can rethrow it . <nl> class exception_wrapper { <nl> <nl> template < class T , class . . . Args > <nl> friend exception_wrapper make_exception_wrapper ( Args & & . . . args ) ; <nl> + <nl> + private : <nl> + / / What makes this useful is that T can be exception_wrapper * or <nl> + / / const exception_wrapper * , and the compiler will use the <nl> + / / instantiation which works with F . <nl> + template < class Ex , class F , class T > <nl> + static bool with_exception1 ( F f , T * that ) { <nl> + if ( that - > item_ ) { <nl> + if ( auto ex = dynamic_cast < Ex * > ( that - > getCopied ( ) ) ) { <nl> + f ( * ex ) ; <nl> + return true ; <nl> + } <nl> + } else if ( that - > eptr_ ) { <nl> + try { <nl> + std : : rethrow_exception ( that - > eptr_ ) ; <nl> + } catch ( std : : exception & e ) { <nl> + if ( auto ex = dynamic_cast < Ex * > ( & e ) ) { <nl> + f ( * ex ) ; <nl> + return true ; <nl> + } <nl> + } catch ( . . . ) { <nl> + / / fall through <nl> + } <nl> + } <nl> + return false ; <nl> + } <nl> } ; <nl> <nl> template < class T , class . . . Args > <nl> mmm a / folly / test / ExceptionWrapperTest . cpp <nl> ppp b / folly / test / ExceptionWrapperTest . cpp <nl> TEST ( ExceptionWrapper , with_exception_test ) { <nl> EXPECT_EQ ( ie . getInt ( ) , expected ) ; <nl> EXPECT_EQ ( typeid ( ie ) , typeid ( IntException ) ) ; <nl> } ) ; <nl> + <nl> + / / Test with const this . If this compiles and does not crash due to <nl> + / / infinite loop when it runs , it succeeds . <nl> + const exception_wrapper & cew = ew ; <nl> + cew . with_exception < IntException > ( [ & ] ( const IntException & ie ) { <nl> + SUCCEED ( ) ; <nl> + } ) ; <nl> + <nl> + / / This won ' t even compile . You can ' t use a function which takes a <nl> + / / non - const reference with a const exception_wrapper . <nl> + / * <nl> + cew . with_exception < IntException > ( [ & ] ( IntException & ie ) { <nl> + SUCCEED ( ) ; <nl> + } ) ; <nl> + * / <nl> } <nl> <nl> TEST ( ExceptionWrapper , non_std_exception_test ) { <nl> | make with_exception ( ) const work in all cases | facebook/folly | 9d4d4b000cc218ee0c9c430257222dd63ad766ff | 2014-09-17T18:23:45Z |
mmm a / README . md <nl> ppp b / README . md <nl> <nl> # CNTK <nl> <nl> # # Latest news <nl> + * 2016 - 06 - 23 . * New License Terms for CNTK 1bit - SGD and related components . <nl> + Effective immediately the License Terms for CNTK 1bit - SGD and related components have changed . The new Terms provide more flexibility and enable new usage scenarios , especially in commercial environments . Read the new Terms at the [ standard location ] ( https : / / cntk1bitsgd . codeplex . com / license ) . Please note , that while the new Terms are significantly more flexible comparing to the previous ones , they are still * * more restrictive * * than the main CNTK License . Consequently everything described in [ Enabling 1bit - SGD ] ( https : / / github . com / Microsoft / CNTK / wiki / Enabling - 1bit - SGD ) section of the Wiki remains valid . <nl> + <nl> * 2016 - 06 - 20 . * A [ post ] ( http : / / itpeernetwork . intel . com / accelerating - the - computational - network - tool - kit - with - intel - mkl / ) on Intel MKL and CNTK is published in the [ Intel IT Peer Network ] ( http : / / itpeernetwork . intel . com / accelerating - the - computational - network - tool - kit - with - intel - mkl / ) <nl> <nl> - * 2016 - 06 - 16 . * V 1 . 5 Binary release . NuGet Package with CNTK Model Evaluation Libraries . <nl> + * 2016 - 06 - 16 . * V 1 . 5 Binary release . NuGet Package with CNTK Model Evaluation Libraries . <nl> NuGet Package is added to CNTK v . 1 . 5 binaries . See [ CNTK Releases page ] ( https : / / github . com / Microsoft / CNTK / releases ) and [ NuGet Package description ] ( https : / / github . com / Microsoft / CNTK / wiki / Nuget - Package - for - Evaluation ) . <nl> <nl> * 2016 - 06 - 15 . * CNTK now supports building against a custom Intel ® Math Kernel Library ( MKL ) . <nl> See [ setup instructions ] ( https : / / github . com / Microsoft / CNTK / wiki / Setup - CNTK - on - yo <nl> <nl> * 2016 - 06 - 10 . * See CNTK v . 1 . 5 binary release announcement in the official [ Microsoft Research Blog ] ( https : / / blogs . msdn . microsoft . com / msr_er / 2016 / 06 / 10 / microsoft - improves - programming - flexibility - of - its - ai - toolkit / ) <nl> <nl> - * 2016 - 06 - 08 . * V 1 . 5 Binary release <nl> - CNTK v . 1 . 5 binaries are on the [ CNTK Releases page ] ( https : / / github . com / Microsoft / CNTK / releases ) <nl> - <nl> See [ all news ] ( https : / / github . com / Microsoft / CNTK / wiki / News ) . <nl> <nl> # # What is CNTK <nl> | ReadMe News , Jun 23 , 2016 | microsoft/CNTK | 58b8efd73f98f65b4787189b40c3d9a62d400ac2 | 2016-06-23T09:17:57Z |
mmm a / src / core / CMakeLists . txt <nl> ppp b / src / core / CMakeLists . txt <nl> <nl> set ( SRCS <nl> arm / disassembler / arm_disasm . cpp <nl> arm / disassembler / load_symbol_map . cpp <nl> + arm / dynarmic / arm_dynarmic . cpp <nl> arm / dyncom / arm_dyncom . cpp <nl> arm / dyncom / arm_dyncom_dec . cpp <nl> arm / dyncom / arm_dyncom_interpreter . cpp <nl> set ( HEADERS <nl> arm / arm_interface . h <nl> arm / disassembler / arm_disasm . h <nl> arm / disassembler / load_symbol_map . h <nl> + arm / dynarmic / arm_dynarmic . h <nl> arm / dyncom / arm_dyncom . h <nl> arm / dyncom / arm_dyncom_dec . h <nl> arm / dyncom / arm_dyncom_interpreter . h <nl> set ( HEADERS <nl> system . h <nl> ) <nl> <nl> + include_directories ( . . / . . / externals / dynarmic / include ) <nl> + <nl> create_directory_groups ( $ { SRCS } $ { HEADERS } ) <nl> <nl> add_library ( core STATIC $ { SRCS } $ { HEADERS } ) <nl> + <nl> + target_link_libraries ( core dynarmic ) <nl> new file mode 100644 <nl> index 00000000000 . . 46b4d610324 <nl> mmm / dev / null <nl> ppp b / src / core / arm / dynarmic / arm_dynarmic . cpp <nl> <nl> + / / Copyright 2016 Citra Emulator Project <nl> + / / Licensed under GPLv2 or any later version <nl> + / / Refer to the license . txt file included . <nl> + <nl> + # include " common / assert . h " <nl> + # include " common / microprofile . h " <nl> + <nl> + # include < dynarmic / dynarmic . h > <nl> + <nl> + # include " core / arm / dynarmic / arm_dynarmic . h " <nl> + # include " core / arm / dyncom / arm_dyncom_interpreter . h " <nl> + # include " core / core . h " <nl> + # include " core / core_timing . h " <nl> + # include " core / hle / svc . h " <nl> + # include " core / memory . h " <nl> + <nl> + static void InterpreterFallback ( u32 pc , Dynarmic : : Jit * jit , void * user_arg ) { <nl> + ARMul_State * state = static_cast < ARMul_State * > ( user_arg ) ; <nl> + <nl> + state - > Reg = jit - > Regs ( ) ; <nl> + state - > Cpsr = jit - > Cpsr ( ) ; <nl> + state - > Reg [ 15 ] = pc ; <nl> + state - > ExtReg = jit - > ExtRegs ( ) ; <nl> + state - > VFP [ VFP_FPSCR ] = jit - > Fpscr ( ) ; <nl> + state - > NumInstrsToExecute = 1 ; <nl> + <nl> + InterpreterMainLoop ( state ) ; <nl> + <nl> + bool is_thumb = ( state - > Cpsr & ( 1 < < 5 ) ) ! = 0 ; <nl> + state - > Reg [ 15 ] & = ( is_thumb ? 0xFFFFFFFE : 0xFFFFFFFC ) ; <nl> + <nl> + jit - > Regs ( ) = state - > Reg ; <nl> + jit - > Cpsr ( ) = state - > Cpsr ; <nl> + jit - > ExtRegs ( ) = state - > ExtReg ; <nl> + jit - > SetFpscr ( state - > VFP [ VFP_FPSCR ] ) ; <nl> + } <nl> + <nl> + static bool IsReadOnlyMemory ( u32 vaddr ) { <nl> + / / TODO ( bunnei ) : ImplementMe <nl> + return false ; <nl> + } <nl> + <nl> + static Dynarmic : : UserCallbacks GetUserCallbacks ( ARMul_State * interpeter_state ) { <nl> + Dynarmic : : UserCallbacks user_callbacks { } ; <nl> + user_callbacks . InterpreterFallback = & InterpreterFallback ; <nl> + user_callbacks . user_arg = static_cast < void * > ( interpeter_state ) ; <nl> + user_callbacks . CallSVC = & SVC : : CallSVC ; <nl> + user_callbacks . IsReadOnlyMemory = & IsReadOnlyMemory ; <nl> + user_callbacks . MemoryRead8 = & Memory : : Read8 ; <nl> + user_callbacks . MemoryRead16 = & Memory : : Read16 ; <nl> + user_callbacks . MemoryRead32 = & Memory : : Read32 ; <nl> + user_callbacks . MemoryRead64 = & Memory : : Read64 ; <nl> + user_callbacks . MemoryWrite8 = & Memory : : Write8 ; <nl> + user_callbacks . MemoryWrite16 = & Memory : : Write16 ; <nl> + user_callbacks . MemoryWrite32 = & Memory : : Write32 ; <nl> + user_callbacks . MemoryWrite64 = & Memory : : Write64 ; <nl> + return user_callbacks ; <nl> + } <nl> + <nl> + ARM_Dynarmic : : ARM_Dynarmic ( PrivilegeMode initial_mode ) { <nl> + interpreter_state = std : : make_unique < ARMul_State > ( initial_mode ) ; <nl> + jit = std : : make_unique < Dynarmic : : Jit > ( GetUserCallbacks ( interpreter_state . get ( ) ) ) ; <nl> + } <nl> + <nl> + void ARM_Dynarmic : : SetPC ( u32 pc ) { <nl> + jit - > Regs ( ) [ 15 ] = pc ; <nl> + } <nl> + <nl> + u32 ARM_Dynarmic : : GetPC ( ) const { <nl> + return jit - > Regs ( ) [ 15 ] ; <nl> + } <nl> + <nl> + u32 ARM_Dynarmic : : GetReg ( int index ) const { <nl> + return jit - > Regs ( ) [ index ] ; <nl> + } <nl> + <nl> + void ARM_Dynarmic : : SetReg ( int index , u32 value ) { <nl> + jit - > Regs ( ) [ index ] = value ; <nl> + } <nl> + <nl> + u32 ARM_Dynarmic : : GetVFPReg ( int index ) const { <nl> + return jit - > ExtRegs ( ) [ index ] ; <nl> + } <nl> + <nl> + void ARM_Dynarmic : : SetVFPReg ( int index , u32 value ) { <nl> + jit - > ExtRegs ( ) [ index ] = value ; <nl> + } <nl> + <nl> + u32 ARM_Dynarmic : : GetVFPSystemReg ( VFPSystemRegister reg ) const { <nl> + / / TODO ( bunnei ) : ImplementMe <nl> + UNIMPLEMENTED ( ) ; <nl> + return 0 ; <nl> + } <nl> + <nl> + void ARM_Dynarmic : : SetVFPSystemReg ( VFPSystemRegister reg , u32 value ) { <nl> + / / TODO ( bunnei ) : ImplementMe <nl> + UNIMPLEMENTED ( ) ; <nl> + } <nl> + <nl> + u32 ARM_Dynarmic : : GetCPSR ( ) const { <nl> + return jit - > Cpsr ( ) ; <nl> + } <nl> + <nl> + void ARM_Dynarmic : : SetCPSR ( u32 cpsr ) { <nl> + jit - > Cpsr ( ) = cpsr ; <nl> + } <nl> + <nl> + u32 ARM_Dynarmic : : GetCP15Register ( CP15Register reg ) { <nl> + return interpreter_state - > CP15 [ reg ] ; <nl> + } <nl> + <nl> + void ARM_Dynarmic : : SetCP15Register ( CP15Register reg , u32 value ) { <nl> + interpreter_state - > CP15 [ reg ] = value ; <nl> + } <nl> + <nl> + void ARM_Dynarmic : : AddTicks ( u64 ticks ) { <nl> + down_count - = ticks ; <nl> + if ( down_count < 0 ) { <nl> + CoreTiming : : Advance ( ) ; <nl> + } <nl> + } <nl> + <nl> + MICROPROFILE_DEFINE ( ARM_Jit , " ARM JIT " , " ARM JIT " , MP_RGB ( 255 , 64 , 64 ) ) ; <nl> + <nl> + void ARM_Dynarmic : : ExecuteInstructions ( int num_instructions ) { <nl> + MICROPROFILE_SCOPE ( ARM_Jit ) ; <nl> + <nl> + jit - > Run ( static_cast < unsigned > ( num_instructions ) ) ; <nl> + <nl> + AddTicks ( num_instructions ) ; <nl> + } <nl> + <nl> + void ARM_Dynarmic : : ResetContext ( Core : : ThreadContext & context , u32 stack_top , u32 entry_point , u32 arg ) { <nl> + memset ( & context , 0 , sizeof ( Core : : ThreadContext ) ) ; <nl> + <nl> + context . cpu_registers [ 0 ] = arg ; <nl> + context . pc = entry_point ; <nl> + context . sp = stack_top ; <nl> + context . cpsr = USER32MODE | ( ( entry_point & 1 ) < < 5 ) ; / / Usermode and THUMB mode <nl> + } <nl> + <nl> + void ARM_Dynarmic : : SaveContext ( Core : : ThreadContext & ctx ) { <nl> + memcpy ( ctx . cpu_registers , jit - > Regs ( ) . data ( ) , sizeof ( ctx . cpu_registers ) ) ; <nl> + memcpy ( ctx . fpu_registers , jit - > ExtRegs ( ) . data ( ) , sizeof ( ctx . fpu_registers ) ) ; <nl> + <nl> + ctx . sp = jit - > Regs ( ) [ 13 ] ; <nl> + ctx . lr = jit - > Regs ( ) [ 14 ] ; <nl> + ctx . pc = jit - > Regs ( ) [ 15 ] ; <nl> + ctx . cpsr = jit - > Cpsr ( ) ; <nl> + <nl> + ctx . fpscr = jit - > Fpscr ( ) ; <nl> + ctx . fpexc = interpreter_state - > VFP [ VFP_FPEXC ] ; <nl> + } <nl> + <nl> + void ARM_Dynarmic : : LoadContext ( const Core : : ThreadContext & ctx ) { <nl> + memcpy ( jit - > Regs ( ) . data ( ) , ctx . cpu_registers , sizeof ( ctx . cpu_registers ) ) ; <nl> + memcpy ( jit - > ExtRegs ( ) . data ( ) , ctx . fpu_registers , sizeof ( ctx . fpu_registers ) ) ; <nl> + <nl> + jit - > Regs ( ) [ 13 ] = ctx . sp ; <nl> + jit - > Regs ( ) [ 14 ] = ctx . lr ; <nl> + jit - > Regs ( ) [ 15 ] = ctx . pc ; <nl> + jit - > Cpsr ( ) = ctx . cpsr ; <nl> + <nl> + jit - > SetFpscr ( ctx . fpscr ) ; <nl> + interpreter_state - > VFP [ VFP_FPEXC ] = ctx . fpexc ; <nl> + } <nl> + <nl> + void ARM_Dynarmic : : PrepareReschedule ( ) { <nl> + if ( jit - > IsExecuting ( ) ) { <nl> + jit - > HaltExecution ( ) ; <nl> + } <nl> + } <nl> + <nl> + void ARM_Dynarmic : : ClearInstructionCache ( ) { <nl> + jit - > ClearCache ( ) ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 6cae56737c0 <nl> mmm / dev / null <nl> ppp b / src / core / arm / dynarmic / arm_dynarmic . h <nl> <nl> + / / Copyright 2016 Citra Emulator Project <nl> + / / Licensed under GPLv2 or any later version <nl> + / / Refer to the license . txt file included . <nl> + <nl> + # pragma once <nl> + <nl> + # include < memory > <nl> + <nl> + # include < dynarmic / dynarmic . h > <nl> + <nl> + # include " common / common_types . h " <nl> + <nl> + # include " core / arm / arm_interface . h " <nl> + # include " core / arm / skyeye_common / armstate . h " <nl> + <nl> + namespace Core { <nl> + struct ThreadContext ; <nl> + } <nl> + <nl> + class ARM_Dynarmic final : virtual public ARM_Interface { <nl> + public : <nl> + ARM_Dynarmic ( PrivilegeMode initial_mode ) ; <nl> + <nl> + void SetPC ( u32 pc ) override ; <nl> + u32 GetPC ( ) const override ; <nl> + u32 GetReg ( int index ) const override ; <nl> + void SetReg ( int index , u32 value ) override ; <nl> + u32 GetVFPReg ( int index ) const override ; <nl> + void SetVFPReg ( int index , u32 value ) override ; <nl> + u32 GetVFPSystemReg ( VFPSystemRegister reg ) const override ; <nl> + void SetVFPSystemReg ( VFPSystemRegister reg , u32 value ) override ; <nl> + u32 GetCPSR ( ) const override ; <nl> + void SetCPSR ( u32 cpsr ) override ; <nl> + u32 GetCP15Register ( CP15Register reg ) override ; <nl> + void SetCP15Register ( CP15Register reg , u32 value ) override ; <nl> + <nl> + void AddTicks ( u64 ticks ) override ; <nl> + <nl> + void ResetContext ( Core : : ThreadContext & context , u32 stack_top , u32 entry_point , u32 arg ) override ; <nl> + void SaveContext ( Core : : ThreadContext & ctx ) override ; <nl> + void LoadContext ( const Core : : ThreadContext & ctx ) override ; <nl> + <nl> + void PrepareReschedule ( ) override ; <nl> + void ExecuteInstructions ( int num_instructions ) override ; <nl> + <nl> + void ClearInstructionCache ( ) override ; <nl> + <nl> + private : <nl> + std : : unique_ptr < Dynarmic : : Jit > jit ; <nl> + std : : unique_ptr < ARMul_State > interpreter_state ; <nl> + } ; <nl> | dynarmic : Implement ARM CPU interface . | yuzu-emu/yuzu | 1976a2d77374fa3465c02ccab08031ff67a743df | 2016-09-15T21:49:26Z |
mmm a / . gitignore <nl> ppp b / . gitignore <nl> var / lib / node_ * <nl> . idea / <nl> * . iws <nl> . DS_Store <nl> + <nl> + ! * . swagger . * <nl> new file mode 100644 <nl> index 0000000000 . . 4bba46ef39 <nl> mmm / dev / null <nl> ppp b / plugins / net_api_plugin / net . swagger . yaml <nl> <nl> + openapi : 3 . 0 . 0 <nl> + info : <nl> + title : Net API <nl> + version : 1 . 0 . 0 <nl> + license : <nl> + name : MIT <nl> + url : https : / / opensource . org / licenses / MIT <nl> + contact : <nl> + url : https : / / eos . io <nl> + servers : <nl> + - url : ' { protocol } : / / { host } : { port } / v1 / ' <nl> + variables : <nl> + protocol : <nl> + enum : <nl> + - http <nl> + - https <nl> + default : http <nl> + host : <nl> + default : localhost <nl> + port : <nl> + default : " 8080 " <nl> + components : <nl> + schemas : { } <nl> + paths : <nl> + / net / connections : <nl> + post : <nl> + summary : connections <nl> + description : Returns an array of all peer connection statuses . <nl> + operationId : connections <nl> + parameters : [ ] <nl> + requestBody : <nl> + content : <nl> + application / json : <nl> + schema : <nl> + type : object <nl> + properties : { } <nl> + responses : <nl> + ' 200 ' : <nl> + description : OK <nl> + content : <nl> + application / json : <nl> + schema : <nl> + type : array <nl> + items : <nl> + type : object <nl> + properties : <nl> + peer : <nl> + description : The IP address or URL of the peer <nl> + type : string <nl> + connecting : <nl> + description : True if the peer is connecting , otherwise false <nl> + type : boolean <nl> + syncing : <nl> + description : True if the peer is syncing , otherwise false <nl> + type : boolean <nl> + last_handshake : <nl> + description : Structure holding detailed information about the connection <nl> + type : object <nl> + properties : <nl> + network_version : <nl> + description : Incremental value above a computed base <nl> + type : integer <nl> + chain_id : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / Sha256 . yaml ' <nl> + node_id : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / Sha256 . yaml ' <nl> + key : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / PublicKey . yaml ' <nl> + time : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / DateTimeSeconds . yaml ' <nl> + token : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / Sha256 . yaml ' <nl> + sig : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / Signature . yaml ' <nl> + p2p_address : <nl> + description : IP address or URL of the peer <nl> + type : string <nl> + last_irreversible_block_num : <nl> + description : Last irreversible block number <nl> + type : integer <nl> + last_irreversible_block_id : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / Sha256 . yaml ' <nl> + head_num : <nl> + description : Head number <nl> + type : integer <nl> + head_id : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / Sha256 . yaml ' <nl> + os : <nl> + description : Operating system name <nl> + type : string <nl> + agent : <nl> + description : Agent name <nl> + type : string <nl> + generation : <nl> + description : Generation number <nl> + type : integer <nl> + <nl> + / net / connect : <nl> + post : <nl> + summary : connect <nl> + description : Initiate a connection to a specified peer . <nl> + operationId : connect <nl> + parameters : [ ] <nl> + requestBody : <nl> + content : <nl> + application / json : <nl> + schema : <nl> + type : object <nl> + required : <nl> + - endpoint <nl> + properties : <nl> + endpoint : <nl> + type : string <nl> + description : the endpoint to connect to expressed as either IP address or URL <nl> + <nl> + responses : <nl> + ' 200 ' : <nl> + description : OK <nl> + content : <nl> + application / json : <nl> + schema : <nl> + type : string <nl> + description : ' " already connected " or " added connection " ' <nl> + / net / disconnect : <nl> + post : <nl> + summary : disconnect <nl> + description : Initiate disconnection from a specified peer . <nl> + operationId : disconnect <nl> + parameters : [ ] <nl> + requestBody : <nl> + content : <nl> + application / json : <nl> + schema : <nl> + type : object <nl> + required : <nl> + - endpoint <nl> + properties : <nl> + endpoint : <nl> + type : string <nl> + description : the endpoint to disconnect from , expressed as either IP address or URL <nl> + <nl> + responses : <nl> + ' 200 ' : <nl> + description : OK <nl> + content : <nl> + application / json : <nl> + schema : <nl> + type : string <nl> + description : ' " connection removed " or " no known connection for host " ' <nl> + / net / status : <nl> + post : <nl> + summary : status <nl> + description : Retrieves the connection status for a specified peer . <nl> + operationId : status <nl> + parameters : [ ] <nl> + requestBody : <nl> + content : <nl> + application / json : <nl> + schema : <nl> + type : object <nl> + required : <nl> + - endpoint <nl> + properties : <nl> + endpoint : <nl> + type : string <nl> + description : the endpoint to get the status for , to expressed as either IP address or URL <nl> + <nl> + responses : <nl> + ' 200 ' : <nl> + description : OK <nl> + content : <nl> + application / json : <nl> + schema : <nl> + type : object <nl> + properties : <nl> + peer : <nl> + description : The IP address or URL of the peer <nl> + type : string <nl> + connecting : <nl> + description : True if the peer is connecting , otherwise false <nl> + type : boolean <nl> + syncing : <nl> + description : True if the peer is syncing , otherwise false <nl> + type : boolean <nl> + last_handshake : <nl> + description : Structure holding detailed information about the connection <nl> + type : object <nl> + properties : <nl> + network_version : <nl> + description : Incremental value above a computed base <nl> + type : integer <nl> + chain_id : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / Sha256 . yaml ' <nl> + node_id : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / Sha256 . yaml ' <nl> + key : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / PublicKey . yaml ' <nl> + time : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / DateTimeSeconds . yaml ' <nl> + token : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / Sha256 . yaml ' <nl> + sig : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / Signature . yaml ' <nl> + p2p_address : <nl> + description : IP address or URL of the peer <nl> + type : string <nl> + last_irreversible_block_num : <nl> + description : Last irreversible block number <nl> + type : integer <nl> + last_irreversible_block_id : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / Sha256 . yaml ' <nl> + head_num : <nl> + description : Head number <nl> + type : integer <nl> + head_id : <nl> + $ ref : ' https : / / eosio . github . io / schemata / v2 . 0 / oas / Sha256 . yaml ' <nl> + os : <nl> + description : Operating system name <nl> + type : string <nl> + agent : <nl> + description : Agent name <nl> + type : string <nl> + generation : <nl> + description : Generation number <nl> + type : integer <nl> | Update . gitignore to be less greedy and add net swaggerr | EOSIO/eos | 06c5f4608764f48bdebbab665e84808d171b10a3 | 2020-02-06T20:01:00Z |
deleted file mode 100755 <nl> index 2f68124c204 . . 00000000000 <nl> mmm a / scripts / generate_ssl_keys . sh <nl> ppp / dev / null <nl> <nl> - # ! / usr / bin / env bash <nl> - <nl> - Domain = apollo . car <nl> - IP = 127 . 0 . 0 . 1 <nl> - KEYS_DIR = " $ ( dirname $ 0 ) " / . . / modules / common / data / ssl_keys <nl> - <nl> - # Clear KEYS_DIR and cd into it . <nl> - rm - fr " $ { KEYS_DIR } " <nl> - mkdir - p " $ { KEYS_DIR } " <nl> - cd " $ { KEYS_DIR } " <nl> - <nl> - function GenerateCAKeys ( ) { <nl> - echo " Generate CA keys . . . " <nl> - openssl genpkey - algorithm RSA - pkeyopt rsa_keygen_bits : 2048 - out ca . key <nl> - openssl req - new - x509 - sha256 - days 3650 - key ca . key \ <nl> - - subj " / O = Apollo / CN = apollo . ca " - out ca . crt <nl> - } <nl> - <nl> - function GenerateServerKeys ( ) { <nl> - echo " Generate server keys . . . " <nl> - openssl genpkey - algorithm RSA - pkeyopt rsa_keygen_bits : 2048 - out server . key <nl> - openssl req - new - sha256 - key server . key \ <nl> - - subj " / O = Apollo / OU = HMI / CN = $ { Domain } " - out server . csr <nl> - <nl> - OPENSSL_CONF_FILE = " . / openssl . conf " <nl> - echo " [ req ] req_extensions = v3_req <nl> - [ v3_req ] <nl> - subjectAltName = @ alt_names <nl> - [ alt_names ] <nl> - IP . 1 = $ { IP } <nl> - DNS . 1 = $ { Domain } " > $ { OPENSSL_CONF_FILE } <nl> - openssl x509 - sha256 - days 3650 - req \ <nl> - - extfile $ { OPENSSL_CONF_FILE } - extensions v3_req \ <nl> - - in server . csr - CAcreateserial - CA ca . crt - CAkey ca . key - out server . crt <nl> - <nl> - openssl verify - verbose - CAfile ca . crt server . crt <nl> - <nl> - cat server . crt > > server . pem <nl> - cat server . key > > server . pem <nl> - sed - i - e ' s / BEGIN PRIVATE KEY / BEGIN RSA PRIVATE KEY / g ' server . pem <nl> - sed - i - e ' s / END PRIVATE KEY / END RSA PRIVATE KEY / g ' server . pem <nl> - } <nl> - <nl> - function PrepareHost ( ) { <nl> - sudo cp ca . crt / usr / local / share / ca - certificates / apollo_ca . crt <nl> - sudo update - ca - certificates <nl> - <nl> - HOST_CONF = " $ { IP } $ { Domain } " <nl> - if ! grep - Fxq " $ HOST_CONF " / etc / hosts ; then <nl> - echo $ { HOST_CONF } | sudo tee - a / etc / hosts <nl> - fi <nl> - } <nl> - <nl> - GenerateCAKeys <nl> - GenerateServerKeys <nl> - PrepareHost <nl> - <nl> - echo " Generated keys : " <nl> - ls - al <nl> | Scripts : Retire unused ssl script . | ApolloAuto/apollo | 1fe2d8f07a830dbd6f7c7592f32980ca967bf8ad | 2020-10-06T05:26:51Z |
mmm a / src / mongo / dbtests / jstests . cpp <nl> ppp b / src / mongo / dbtests / jstests . cpp <nl> namespace JSTests { <nl> } <nl> } ; <nl> <nl> - class DBRefTest { <nl> - public : <nl> - DBRefTest ( ) { <nl> - _a = " unittest . dbref . a " ; <nl> - _b = " unittest . dbref . b " ; <nl> - reset ( ) ; <nl> - } <nl> - ~ DBRefTest ( ) { <nl> - / / reset ( ) ; <nl> - } <nl> + namespace RoundTripTests { <nl> <nl> - void run ( ) { <nl> + / / Inherit from this class to test round tripping of JSON objects <nl> + class TestRoundTrip { <nl> + public : <nl> + virtual ~ TestRoundTrip ( ) { } <nl> + void run ( ) { <nl> <nl> - client . insert ( _a , BSON ( " a " < < " 17 " ) ) ; <nl> + / / Insert in Javascript - > Find using DBDirectClient <nl> <nl> - { <nl> - BSONObj fromA = client . findOne ( _a , BSONObj ( ) ) ; <nl> - verify ( fromA . valid ( ) ) ; <nl> - / / cout < < " Froma : " < < fromA < < endl ; <nl> + / / Drop the collection <nl> + client . dropCollection ( " unittest . testroundtrip " ) ; <nl> + <nl> + / / Insert in Javascript <nl> + stringstream jsInsert ; <nl> + jsInsert < < " db . testroundtrip . insert ( " < < jsonIn ( ) < < " ) " ; <nl> + ASSERT_TRUE ( client . eval ( " unittest " , jsInsert . str ( ) ) ) ; <nl> + <nl> + / / Find using DBDirectClient <nl> + BSONObj excludeIdProjection = BSON ( " _id " < < 0 ) ; <nl> + BSONObj directFind = client . findOne ( " unittest . testroundtrip " , <nl> + " " , <nl> + & excludeIdProjection ) ; <nl> + bsonEquals ( bson ( ) , directFind ) ; <nl> + <nl> + <nl> + / / Insert using DBDirectClient - > Find in Javascript <nl> + <nl> + / / Drop the collection <nl> + client . dropCollection ( " unittest . testroundtrip " ) ; <nl> + <nl> + / / Insert using DBDirectClient <nl> + client . insert ( " unittest . testroundtrip " , bson ( ) ) ; <nl> + <nl> + / / Find in Javascript <nl> + stringstream jsFind ; <nl> + jsFind < < " dbref = db . testroundtrip . findOne ( { } , { _id : 0 } ) \ n " <nl> + < < " assert . eq ( dbref , " < < jsonOut ( ) < < " ) " ; <nl> + ASSERT_TRUE ( client . eval ( " unittest " , jsFind . str ( ) ) ) ; <nl> + } <nl> + protected : <nl> + <nl> + / / Methods that must be defined by child classes <nl> + virtual BSONObj bson ( ) const = 0 ; <nl> + virtual string json ( ) const = 0 ; <nl> + <nl> + / / This can be overriden if a different meaning of equality besides woCompare is needed <nl> + virtual void bsonEquals ( const BSONObj & expected , const BSONObj & actual ) { <nl> + if ( expected . woCompare ( actual ) ) { <nl> + out ( ) < < " want : " < < expected . jsonString ( ) < < " size : " < < expected . objsize ( ) < < endl ; <nl> + out ( ) < < " got : " < < actual . jsonString ( ) < < " size : " < < actual . objsize ( ) < < endl ; <nl> + out ( ) < < expected . hexDump ( ) < < endl ; <nl> + out ( ) < < actual . hexDump ( ) < < endl ; <nl> + } <nl> + ASSERT ( ! expected . woCompare ( actual ) ) ; <nl> + } <nl> + <nl> + / / This can be overriden if the JSON representation is altered on the round trip <nl> + virtual string jsonIn ( ) const { <nl> + return json ( ) ; <nl> + } <nl> + virtual string jsonOut ( ) const { <nl> + return json ( ) ; <nl> + } <nl> + } ; <nl> + <nl> + class DBRefTest : public TestRoundTrip { <nl> + virtual BSONObj bson ( ) const { <nl> BSONObjBuilder b ; <nl> - b . append ( " b " , 18 ) ; <nl> - b . appendDBRef ( " c " , " dbref . a " , fromA [ " _id " ] . __oid ( ) ) ; <nl> - client . insert ( _b , b . obj ( ) ) ; <nl> + OID o ; <nl> + memset ( & o , 0 , 12 ) ; <nl> + BSONObjBuilder subBuilder ( b . subobjStart ( " a " ) ) ; <nl> + subBuilder . append ( " $ ref " , " ns " ) ; <nl> + subBuilder . append ( " $ id " , o ) ; <nl> + subBuilder . done ( ) ; <nl> + return b . obj ( ) ; <nl> + } <nl> + virtual string json ( ) const { <nl> + return " { \ " a \ " : DBRef ( \ " ns \ " , ObjectId ( \ " 000000000000000000000000 \ " ) ) } " ; <nl> } <nl> <nl> - ASSERT ( client . eval ( " unittest " , " x = db . dbref . b . findOne ( ) ; assert . eq ( 17 , x . c . fetch ( ) . a , ' ref working ' ) ; " ) ) ; <nl> + / / A " fetch " function is added to the DBRef object when it is inserted using the <nl> + / / constructor , so we need to compare the fields individually <nl> + virtual void bsonEquals ( const BSONObj & expected , const BSONObj & actual ) { <nl> + ASSERT_EQUALS ( expected [ " a " ] . type ( ) , actual [ " a " ] . type ( ) ) ; <nl> + ASSERT_EQUALS ( expected [ " a " ] [ " $ id " ] . OID ( ) , actual [ " a " ] [ " $ id " ] . OID ( ) ) ; <nl> + ASSERT_EQUALS ( expected [ " a " ] [ " $ ref " ] . String ( ) , actual [ " a " ] [ " $ ref " ] . String ( ) ) ; <nl> + } <nl> + } ; <nl> <nl> - / / BSON DBRef < = > JS DBPointer <nl> - ASSERT ( client . eval ( " unittest " , " x = db . dbref . b . findOne ( ) ; db . dbref . b . drop ( ) ; x . c = new DBPointer ( x . c . ns , x . c . id ) ; db . dbref . b . insert ( x ) ; " ) ) ; <nl> - ASSERT_EQUALS ( DBRef , client . findOne ( " unittest . dbref . b " , " " ) [ " c " ] . type ( ) ) ; <nl> + class DBPointerTest : public TestRoundTrip { <nl> + virtual BSONObj bson ( ) const { <nl> + BSONObjBuilder b ; <nl> + OID o ; <nl> + memset ( & o , 0 , 12 ) ; <nl> + b . appendDBRef ( " a " , " ns " , o ) ; <nl> + return b . obj ( ) ; <nl> + } <nl> + virtual string json ( ) const { <nl> + return " { \ " a \ " : DBPointer ( \ " ns \ " , ObjectId ( \ " 000000000000000000000000 \ " ) ) } " ; <nl> + } <nl> + } ; <nl> <nl> - / / BSON Object < = > JS DBRef <nl> - ASSERT ( client . eval ( " unittest " , " x = db . dbref . b . findOne ( ) ; db . dbref . b . drop ( ) ; x . c = new DBRef ( x . c . ns , x . c . id ) ; db . dbref . b . insert ( x ) ; " ) ) ; <nl> - ASSERT_EQUALS ( Object , client . findOne ( " unittest . dbref . b " , " " ) [ " c " ] . type ( ) ) ; <nl> - ASSERT_EQUALS ( string ( " dbref . a " ) , client . findOne ( " unittest . dbref . b " , " " ) [ " c " ] . embeddedObject ( ) . getStringField ( " $ ref " ) ) ; <nl> - } <nl> + class InformalDBRefTest : public TestRoundTrip { <nl> + virtual BSONObj bson ( ) const { <nl> + BSONObjBuilder b ; <nl> + OID o ; <nl> + memset ( & o , 0 , 12 ) ; <nl> + BSONObjBuilder subBuilder ( b . subobjStart ( " a " ) ) ; <nl> + subBuilder . append ( " $ ref " , " ns " ) ; <nl> + subBuilder . append ( " $ id " , o ) ; <nl> + subBuilder . done ( ) ; <nl> + return b . obj ( ) ; <nl> + } <nl> <nl> - void reset ( ) { <nl> - client . dropCollection ( _a ) ; <nl> - client . dropCollection ( _b ) ; <nl> - } <nl> + / / Don ' t need to return anything because we are overriding both jsonOut and jsonIn <nl> + virtual string json ( ) const { return " " ; } <nl> <nl> - const char * _a ; <nl> - const char * _b ; <nl> - } ; <nl> + / / Need to override these because the JSON doesn ' t actually round trip . <nl> + / / An object with " $ ref " and " $ id " fields is handled specially and different on the way out . <nl> + virtual string jsonOut ( ) const { <nl> + return " { \ " a \ " : DBRef ( \ " ns \ " , ObjectId ( \ " 000000000000000000000000 \ " ) ) } " ; <nl> + } <nl> + virtual string jsonIn ( ) const { <nl> + stringstream ss ; <nl> + ss < < " { \ " a \ " : { \ " $ ref \ " : \ " ns \ " , " < < <nl> + " \ " $ id \ " : ObjectId ( \ " 000000000000000000000000 \ " ) } } " ; <nl> + return ss . str ( ) ; <nl> + } <nl> + } ; <nl> <nl> - class InformalDBRef { <nl> - public : <nl> - void run ( ) { <nl> - client . insert ( ns ( ) , BSON ( " i " < < 1 ) ) ; <nl> - BSONObj obj = client . findOne ( ns ( ) , BSONObj ( ) ) ; <nl> - client . remove ( ns ( ) , BSONObj ( ) ) ; <nl> - client . insert ( ns ( ) , BSON ( " r " < < BSON ( " $ ref " < < " jstests . informaldbref " < < " $ id " < < obj [ " _id " ] . __oid ( ) < < " foo " < < " bar " ) ) ) ; <nl> - obj = client . findOne ( ns ( ) , BSONObj ( ) ) ; <nl> - ASSERT_EQUALS ( " bar " , obj [ " r " ] . embeddedObject ( ) [ " foo " ] . str ( ) ) ; <nl> - <nl> - ASSERT ( client . eval ( " unittest " , " x = db . jstests . informaldbref . findOne ( ) ; y = { r : x . r } ; db . jstests . informaldbref . drop ( ) ; y . r [ \ " a \ " ] = \ " b \ " ; db . jstests . informaldbref . save ( y ) ; " ) ) ; <nl> - obj = client . findOne ( ns ( ) , BSONObj ( ) ) ; <nl> - ASSERT_EQUALS ( " bar " , obj [ " r " ] . embeddedObject ( ) [ " foo " ] . str ( ) ) ; <nl> - ASSERT_EQUALS ( " b " , obj [ " r " ] . embeddedObject ( ) [ " a " ] . str ( ) ) ; <nl> - } <nl> - private : <nl> - static const char * ns ( ) { return " unittest . jstests . informaldbref " ; } <nl> - } ; <nl> + class InformalDBRefExtraFieldTest : public TestRoundTrip { <nl> + virtual BSONObj bson ( ) const { <nl> + BSONObjBuilder b ; <nl> + OID o ; <nl> + memset ( & o , 0 , 12 ) ; <nl> + BSONObjBuilder subBuilder ( b . subobjStart ( " a " ) ) ; <nl> + subBuilder . append ( " $ ref " , " ns " ) ; <nl> + subBuilder . append ( " $ id " , o ) ; <nl> + subBuilder . append ( " otherfield " , " value " ) ; <nl> + subBuilder . done ( ) ; <nl> + return b . obj ( ) ; <nl> + } <nl> + <nl> + / / Don ' t need to return anything because we are overriding both jsonOut and jsonIn <nl> + virtual string json ( ) const { return " " ; } <nl> + <nl> + / / Need to override these because the JSON doesn ' t actually round trip . <nl> + / / An object with " $ ref " and " $ id " fields is handled specially and different on the way out . <nl> + virtual string jsonOut ( ) const { <nl> + return " { \ " a \ " : DBRef ( \ " ns \ " , ObjectId ( \ " 000000000000000000000000 \ " ) ) } " ; <nl> + } <nl> + virtual string jsonIn ( ) const { <nl> + stringstream ss ; <nl> + ss < < " { \ " a \ " : { \ " $ ref \ " : \ " ns \ " , " < < <nl> + " \ " $ id \ " : ObjectId ( \ " 000000000000000000000000 \ " ) , " < < <nl> + " \ " otherfield \ " : \ " value \ " } } " ; <nl> + return ss . str ( ) ; <nl> + } <nl> + } ; <nl> + <nl> + } / / namespace RoundTripTests <nl> <nl> class BinDataType { <nl> public : <nl> namespace JSTests { <nl> <nl> add < WeirdObjects > ( ) ; <nl> add < CodeTests > ( ) ; <nl> - add < DBRefTest > ( ) ; <nl> - add < InformalDBRef > ( ) ; <nl> add < BinDataType > ( ) ; <nl> <nl> add < VarTests > ( ) ; <nl> namespace JSTests { <nl> <nl> add < ScopeOut > ( ) ; <nl> add < InvalidStoredJS > ( ) ; <nl> + <nl> + add < RoundTripTests : : DBRefTest > ( ) ; <nl> + add < RoundTripTests : : DBPointerTest > ( ) ; <nl> + add < RoundTripTests : : InformalDBRefTest > ( ) ; <nl> + add < RoundTripTests : : InformalDBRefExtraFieldTest > ( ) ; <nl> } <nl> } myall ; <nl> <nl> | SERVER - 8819 Framework for testing round trip and test roundtrip of DBRef and DBPointer | mongodb/mongo | 211191443212b35e71a41ea4a5c669f4de3c5a2e | 2013-03-11T21:00:52Z |
mmm a / emcc . py <nl> ppp b / emcc . py <nl> <nl> STATICLIB_ENDINGS = ( ' . a ' , ) <nl> ASSEMBLY_ENDINGS = ( ' . ll ' , ) <nl> HEADER_ENDINGS = ( ' . h ' , ' . hxx ' , ' . hpp ' , ' . hh ' , ' . H ' , ' . HXX ' , ' . HPP ' , ' . HH ' ) <nl> + WASM_ENDINGS = ( ' . wasm ' , ' . wast ' ) <nl> + <nl> SUPPORTED_LINKER_FLAGS = ( ' - - start - group ' , ' - ( ' , ' - - end - group ' , ' - ) ' ) <nl> <nl> LIB_PREFIXES = ( ' ' , ' lib ' ) <nl> def uniquename ( name ) : <nl> sys . argv = sys . argv [ : i ] + sys . argv [ i + 2 : ] <nl> break <nl> <nl> + if target and target . endswith ( WASM_ENDINGS ) : <nl> + logging . warning ( ' output file " % s " has a wasm suffix , but we cannot emit wasm by itself . specify an output file with suffix . js or . html , and a wasm file will be created on the side ' % target ) <nl> + sys . exit ( 1 ) <nl> + <nl> specified_target = target <nl> target = specified_target if specified_target is not None else ' a . out . js ' # specified_target is the user - specified one , target is what we will generate <nl> target_basename = unsuffixed_basename ( target ) <nl> mmm a / tests / test_other . py <nl> ppp b / tests / test_other . py <nl> def test_binaryen_names ( self ) : <nl> print sizes <nl> assert sizes [ " [ ' - O2 ' ] " ] < sizes [ " [ ' - O2 ' , ' - - profiling - funcs ' ] " ] , ' when - profiling - funcs , the size increases due to function names ' <nl> <nl> + def test_wasm_targets ( self ) : <nl> + for f in [ ' a . wasm ' , ' a . wast ' ] : <nl> + process = Popen ( [ PYTHON , EMCC , path_from_root ( ' tests ' , ' hello_world . cpp ' ) , ' - o ' , f ] , stdout = PIPE , stderr = PIPE ) <nl> + out , err = process . communicate ( ) <nl> + print err <nl> + assert process . returncode is not 0 , ' wasm suffix is an error ' <nl> + self . assertContained ( ' ' ' output file " % s " has a wasm suffix , but we cannot emit wasm by itself ' ' ' % f , err ) <nl> + <nl> | error on - o * . wasm or * . wast , as they are not valid output formats for us - we cannot emit a standalone wasm file ( ) | emscripten-core/emscripten | aaa16517e1e691ad2236e9de895ab1136e7bb054 | 2016-10-14T21:33:04Z |
mmm a / build / standalone . gypi <nl> ppp b / build / standalone . gypi <nl> <nl> ] , <nl> } , <nl> ' conditions ' : [ <nl> + [ ' clang = = 0 ' , { <nl> + ' cflags + ' : [ ' - Wno - sign - compare ' , ] , <nl> + } ] , <nl> [ ' ( clang = = 1 or host_clang = = 1 ) and OS ! = " win " ' , { <nl> # This is here so that all files get recompiled after a clang roll and <nl> # when turning clang on or off . <nl> | Add - Wno - sign - compare flag to gcc builds . | v8/v8 | 8e54a667b2c812f8a0f2f506af6c644a952d8569 | 2015-11-27T11:43:10Z |
mmm a / modules / flann / include / opencv2 / flann / autotuned_index . h <nl> ppp b / modules / flann / include / opencv2 / flann / autotuned_index . h <nl> class AutotunedIndex : public NNIndex < Distance > <nl> * / <nl> virtual void buildIndex ( ) <nl> { <nl> + std : : ostringstream stream ; <nl> bestParams_ = estimateBuildParams ( ) ; <nl> + print_params ( bestParams_ , stream ) ; <nl> Logger : : info ( " mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - \ n " ) ; <nl> Logger : : info ( " Autotuned parameters : \ n " ) ; <nl> - print_params ( bestParams_ ) ; <nl> + Logger : : info ( " % s " , stream . str ( ) . c_str ( ) ) ; <nl> Logger : : info ( " mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - \ n " ) ; <nl> <nl> bestIndex_ = create_index_by_type ( dataset_ , bestParams_ , distance_ ) ; <nl> bestIndex_ - > buildIndex ( ) ; <nl> speedup_ = estimateSearchParams ( bestSearchParams_ ) ; <nl> + stream . str ( std : : string ( ) ) ; <nl> + print_params ( bestSearchParams_ , stream ) ; <nl> Logger : : info ( " mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - \ n " ) ; <nl> Logger : : info ( " Search parameters : \ n " ) ; <nl> - print_params ( bestSearchParams_ ) ; <nl> + Logger : : info ( " % s " , stream . str ( ) . c_str ( ) ) ; <nl> Logger : : info ( " mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - \ n " ) ; <nl> } <nl> <nl> mmm a / modules / flann / include / opencv2 / flann / params . h <nl> ppp b / modules / flann / include / opencv2 / flann / params . h <nl> T get_param ( const IndexParams & params , std : : string name ) <nl> } <nl> } <nl> <nl> - inline void print_params ( const IndexParams & params ) <nl> + inline void print_params ( const IndexParams & params , std : : ostream & stream ) <nl> { <nl> IndexParams : : const_iterator it ; <nl> <nl> for ( it = params . begin ( ) ; it ! = params . end ( ) ; + + it ) { <nl> - std : : cout < < it - > first < < " : " < < it - > second < < std : : endl ; <nl> + stream < < it - > first < < " : " < < it - > second < < std : : endl ; <nl> } <nl> } <nl> <nl> - <nl> + inline void print_params ( const IndexParams & params ) <nl> + { <nl> + print_params ( params , std : : cout ) ; <nl> + } <nl> <nl> } <nl> <nl> | Merge pull request from 1Hyena : 2 . 4 | opencv/opencv | bc7b21609a77fa72abf86f8f86e4e027a26325ac | 2014-05-13T07:56:12Z |
mmm a / etc / arangodb / arangod . conf . in <nl> ppp b / etc / arangodb / arangod . conf . in <nl> threads = 3 <nl> [ javascript ] <nl> startup - directory = @ PKGDATADIR @ / js <nl> action - directory = @ PKGDATADIR @ / js / actions <nl> - modules - path = @ PKGDATADIR @ / js / server / modules ; @ PKGDATADIR @ / js / common / modules <nl> + modules - path = @ PKGDATADIR @ / js / server / modules ; @ PKGDATADIR @ / js / common / modules ; @ PKGDATADIR @ / js / node - 0 . 11 . 0 <nl> app - path = @ PKGDATADIR @ / js / apps <nl> <nl> [ ruby ] <nl> mmm a / etc / arangodb / arangosh . conf . in <nl> ppp b / etc / arangodb / arangosh . conf . in <nl> endpoint = tcp : / / localhost : 8529 <nl> <nl> [ javascript ] <nl> startup - directory = @ PKGDATADIR @ / js <nl> - modules - path = @ PKGDATADIR @ / js / client / modules ; @ PKGDATADIR @ / js / common / modules <nl> + modules - path = @ PKGDATADIR @ / js / client / modules ; @ PKGDATADIR @ / js / common / modules ; ; @ PKGDATADIR @ / js / node - 0 . 11 . 0 <nl> mmm a / etc / relative / arangod . conf <nl> ppp b / etc / relative / arangod . conf <nl> threads = 3 <nl> [ javascript ] <nl> startup - directory = . / js <nl> action - directory = . / js / actions <nl> - modules - path = . / js / server / modules ; . / js / common / modules <nl> + modules - path = . / js / server / modules ; . / js / common / modules ; . js / node - 0 . 11 . 0 <nl> app - path = . / js / apps <nl> <nl> [ ruby ] <nl> mmm a / etc / relative / arangosh . conf <nl> ppp b / etc / relative / arangosh . conf <nl> <nl> [ javascript ] <nl> startup - directory = . / js <nl> - modules - path = . / js / client / modules ; . / js / common / modules ; . / js / node - 0 . 8 . 21 / modules <nl> + modules - path = . / js / client / modules ; . / js / common / modules ; . / js / node - 0 . 11 . 0 <nl> | added node path | arangodb/arangodb | 4c9400a687591518babb5bd7f6b7a15607da77dc | 2013-03-30T23:10:47Z |
mmm a / include / swift / SILAnalysis / EscapeAnalysis . h <nl> ppp b / include / swift / SILAnalysis / EscapeAnalysis . h <nl> <nl> - / / = = = mmmmmm SideEffectAnalysis . h - SIL Side Effect Analysis - * - C + + - * mmm - - = = = / / <nl> + / / = = = mmmmmmmmm - - EscapeAnalysis . h - SIL Escape Analysis - * - C + + - * mmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> class EscapeAnalysis : public SILAnalysis { <nl> / / / value , an object reference or any value - type ( struct , enum , etc . ) which <nl> / / / contains a reference . If a value - type ( e . g . a struct ) contains multiple <nl> / / / references , it is treated as a single " pointer " which may point to any <nl> - / / of the referenced objects . <nl> + / / / of the referenced objects . <nl> Value , <nl> <nl> / / / Represents the " memory content " to which a pointer points to . <nl> mmm a / lib / SILAnalysis / EscapeAnalysis . cpp <nl> ppp b / lib / SILAnalysis / EscapeAnalysis . cpp <nl> <nl> - <nl> - / / = = = mmmmmmmmm - SideEffectAnalysis . cpp - SIL Side Effect Analysis mmmmmmmmm = = = / / <nl> + / / = = = mmmmmmmmmmmm - - EscapeAnalysis . cpp - SIL Escape Analysis mmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILPasses / UtilityPasses / UpdateSideEffects . cpp <nl> ppp b / lib / SILPasses / UtilityPasses / UpdateSideEffects . cpp <nl> <nl> - / / = = = mmm SideEffectOpt . cpp - Test the side effect analysis mmmmmmmmmmmmmmm - = = = / / <nl> + / / = = = - - UpdateSideEffects . cpp - Computes side effect and escape analysis - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> | Update file header comments . | apple/swift | 01a8fe33695046833b257d5ee87a83d60506784c | 2015-10-19T19:51:55Z |
mmm a / src / AppInstallerCLI . sln <nl> ppp b / src / AppInstallerCLI . sln <nl> Project ( " { 9A19103F - 16F7 - 4668 - BE54 - 9A1E7A4F7556 } " ) = " IndexCreationTool " , " IndexC <nl> EndProject <nl> Project ( " { 8BC9CEB8 - 8B4A - 11D0 - 8D11 - 00A0C91BC942 } " ) = " JsonCppLib " , " JsonCppLib \ JsonCppLib . vcxproj " , " { 82B39FDA - E86B - 4713 - A873 - 9D56DE00247A } " <nl> EndProject <nl> + Project ( " { 2150E333 - 8FDC - 42A3 - 9474 - 1A3956D46DE8 } " ) = " Fuzzing " , " Fuzzing " , " { 6D7776A8 - 42FE - 46DD - B0F8 - 712F35EA0C79 } " <nl> + EndProject <nl> + Project ( " { 8BC9CEB8 - 8B4A - 11D0 - 8D11 - 00A0C91BC942 } " ) = " WinGetYamlFuzzing " , " WinGetYamlFuzzing \ WinGetYamlFuzzing . vcxproj " , " { 1622DA16 - 914F - 4F57 - A259 - D5169003CC8C } " <nl> + EndProject <nl> Global <nl> GlobalSection ( SharedMSBuildProjectFiles ) = preSolution <nl> catch2 \ catch2 . vcxitems * { 5295e21e - 9868 - 4de2 - a177 - fbb97b36579b } * SharedItemsImports = 9 <nl> Global <nl> Debug | ARM64 = Debug | ARM64 <nl> Debug | x64 = Debug | x64 <nl> Debug | x86 = Debug | x86 <nl> + Fuzzing | ARM = Fuzzing | ARM <nl> + Fuzzing | ARM64 = Fuzzing | ARM64 <nl> + Fuzzing | x64 = Fuzzing | x64 <nl> + Fuzzing | x86 = Fuzzing | x86 <nl> Release | ARM = Release | ARM <nl> Release | ARM64 = Release | ARM64 <nl> Release | x64 = Release | x64 <nl> Global <nl> { 6AA3791A - 0713 - 4548 - A357 - 87A323E7AC3A } . Debug | x86 . ActiveCfg = Debug | x86 <nl> { 6AA3791A - 0713 - 4548 - A357 - 87A323E7AC3A } . Debug | x86 . Build . 0 = Debug | x86 <nl> { 6AA3791A - 0713 - 4548 - A357 - 87A323E7AC3A } . Debug | x86 . Deploy . 0 = Debug | x86 <nl> + { 6AA3791A - 0713 - 4548 - A357 - 87A323E7AC3A } . Fuzzing | ARM . ActiveCfg = Release | ARM <nl> + { 6AA3791A - 0713 - 4548 - A357 - 87A323E7AC3A } . Fuzzing | ARM64 . ActiveCfg = Release | ARM64 <nl> + { 6AA3791A - 0713 - 4548 - A357 - 87A323E7AC3A } . Fuzzing | x64 . ActiveCfg = Release | x64 <nl> + { 6AA3791A - 0713 - 4548 - A357 - 87A323E7AC3A } . Fuzzing | x86 . ActiveCfg = Release | x86 <nl> { 6AA3791A - 0713 - 4548 - A357 - 87A323E7AC3A } . Release | ARM . ActiveCfg = Release | ARM <nl> { 6AA3791A - 0713 - 4548 - A357 - 87A323E7AC3A } . Release | ARM . Build . 0 = Release | ARM <nl> { 6AA3791A - 0713 - 4548 - A357 - 87A323E7AC3A } . Release | ARM . Deploy . 0 = Release | ARM <nl> Global <nl> { 5B6F90DF - FD19 - 4BAE - 83D9 - 24DAD128E777 } . Debug | x64 . Build . 0 = Debug | x64 <nl> { 5B6F90DF - FD19 - 4BAE - 83D9 - 24DAD128E777 } . Debug | x86 . ActiveCfg = Debug | Win32 <nl> { 5B6F90DF - FD19 - 4BAE - 83D9 - 24DAD128E777 } . Debug | x86 . Build . 0 = Debug | Win32 <nl> + { 5B6F90DF - FD19 - 4BAE - 83D9 - 24DAD128E777 } . Fuzzing | ARM . ActiveCfg = Release | ARM <nl> + { 5B6F90DF - FD19 - 4BAE - 83D9 - 24DAD128E777 } . Fuzzing | ARM64 . ActiveCfg = Release | ARM64 <nl> + { 5B6F90DF - FD19 - 4BAE - 83D9 - 24DAD128E777 } . Fuzzing | x64 . ActiveCfg = Release | x64 <nl> + { 5B6F90DF - FD19 - 4BAE - 83D9 - 24DAD128E777 } . Fuzzing | x86 . ActiveCfg = Release | Win32 <nl> { 5B6F90DF - FD19 - 4BAE - 83D9 - 24DAD128E777 } . Release | ARM . ActiveCfg = Release | ARM <nl> { 5B6F90DF - FD19 - 4BAE - 83D9 - 24DAD128E777 } . Release | ARM . Build . 0 = Release | ARM <nl> { 5B6F90DF - FD19 - 4BAE - 83D9 - 24DAD128E777 } . Release | ARM64 . ActiveCfg = Release | ARM64 <nl> Global <nl> { 1C6E0108 - 2860 - 4B17 - 9F7E - FA5C6C1F3D3D } . Debug | x64 . Build . 0 = Debug | x64 <nl> { 1C6E0108 - 2860 - 4B17 - 9F7E - FA5C6C1F3D3D } . Debug | x86 . ActiveCfg = Debug | Win32 <nl> { 1C6E0108 - 2860 - 4B17 - 9F7E - FA5C6C1F3D3D } . Debug | x86 . Build . 0 = Debug | Win32 <nl> + { 1C6E0108 - 2860 - 4B17 - 9F7E - FA5C6C1F3D3D } . Fuzzing | ARM . ActiveCfg = Release | ARM <nl> + { 1C6E0108 - 2860 - 4B17 - 9F7E - FA5C6C1F3D3D } . Fuzzing | ARM64 . ActiveCfg = Release | ARM64 <nl> + { 1C6E0108 - 2860 - 4B17 - 9F7E - FA5C6C1F3D3D } . Fuzzing | x64 . ActiveCfg = Release | x64 <nl> + { 1C6E0108 - 2860 - 4B17 - 9F7E - FA5C6C1F3D3D } . Fuzzing | x86 . ActiveCfg = Release | Win32 <nl> { 1C6E0108 - 2860 - 4B17 - 9F7E - FA5C6C1F3D3D } . Release | ARM . ActiveCfg = Release | ARM <nl> { 1C6E0108 - 2860 - 4B17 - 9F7E - FA5C6C1F3D3D } . Release | ARM . Build . 0 = Release | ARM <nl> { 1C6E0108 - 2860 - 4B17 - 9F7E - FA5C6C1F3D3D } . Release | ARM64 . ActiveCfg = Release | ARM64 <nl> Global <nl> { 5EB88068 - 5FB9 - 4E69 - 89B2 - 72DBC5E068F9 } . Debug | x64 . Build . 0 = Debug | x64 <nl> { 5EB88068 - 5FB9 - 4E69 - 89B2 - 72DBC5E068F9 } . Debug | x86 . ActiveCfg = Debug | Win32 <nl> { 5EB88068 - 5FB9 - 4E69 - 89B2 - 72DBC5E068F9 } . Debug | x86 . Build . 0 = Debug | Win32 <nl> + { 5EB88068 - 5FB9 - 4E69 - 89B2 - 72DBC5E068F9 } . Fuzzing | ARM . ActiveCfg = Release | ARM <nl> + { 5EB88068 - 5FB9 - 4E69 - 89B2 - 72DBC5E068F9 } . Fuzzing | ARM64 . ActiveCfg = Release | ARM64 <nl> + { 5EB88068 - 5FB9 - 4E69 - 89B2 - 72DBC5E068F9 } . Fuzzing | x64 . ActiveCfg = Release | x64 <nl> + { 5EB88068 - 5FB9 - 4E69 - 89B2 - 72DBC5E068F9 } . Fuzzing | x86 . ActiveCfg = Release | Win32 <nl> { 5EB88068 - 5FB9 - 4E69 - 89B2 - 72DBC5E068F9 } . Release | ARM . ActiveCfg = Release | ARM <nl> { 5EB88068 - 5FB9 - 4E69 - 89B2 - 72DBC5E068F9 } . Release | ARM . Build . 0 = Release | ARM <nl> { 5EB88068 - 5FB9 - 4E69 - 89B2 - 72DBC5E068F9 } . Release | ARM64 . ActiveCfg = Release | ARM64 <nl> Global <nl> { 89B1AAB4 - 2BBC - 4B65 - 9ED7 - A01D5CF88230 } . Debug | x64 . Build . 0 = Debug | x64 <nl> { 89B1AAB4 - 2BBC - 4B65 - 9ED7 - A01D5CF88230 } . Debug | x86 . ActiveCfg = Debug | Win32 <nl> { 89B1AAB4 - 2BBC - 4B65 - 9ED7 - A01D5CF88230 } . Debug | x86 . Build . 0 = Debug | Win32 <nl> + { 89B1AAB4 - 2BBC - 4B65 - 9ED7 - A01D5CF88230 } . Fuzzing | ARM . ActiveCfg = Release | Win32 <nl> + { 89B1AAB4 - 2BBC - 4B65 - 9ED7 - A01D5CF88230 } . Fuzzing | ARM64 . ActiveCfg = Release | Win32 <nl> + { 89B1AAB4 - 2BBC - 4B65 - 9ED7 - A01D5CF88230 } . Fuzzing | x64 . ActiveCfg = Release | x64 <nl> + { 89B1AAB4 - 2BBC - 4B65 - 9ED7 - A01D5CF88230 } . Fuzzing | x86 . ActiveCfg = Release | Win32 <nl> { 89B1AAB4 - 2BBC - 4B65 - 9ED7 - A01D5CF88230 } . Release | ARM . ActiveCfg = Release | Win32 <nl> { 89B1AAB4 - 2BBC - 4B65 - 9ED7 - A01D5CF88230 } . Release | ARM64 . ActiveCfg = Release | Win32 <nl> { 89B1AAB4 - 2BBC - 4B65 - 9ED7 - A01D5CF88230 } . Release | x64 . ActiveCfg = Release | x64 <nl> Global <nl> { 8BB94BB8 - 374F - 4294 - BCA1 - C7811514A6B7 } . Debug | x64 . Build . 0 = Debug | x64 <nl> { 8BB94BB8 - 374F - 4294 - BCA1 - C7811514A6B7 } . Debug | x86 . ActiveCfg = Debug | Win32 <nl> { 8BB94BB8 - 374F - 4294 - BCA1 - C7811514A6B7 } . Debug | x86 . Build . 0 = Debug | Win32 <nl> + { 8BB94BB8 - 374F - 4294 - BCA1 - C7811514A6B7 } . Fuzzing | ARM . ActiveCfg = Release | ARM <nl> + { 8BB94BB8 - 374F - 4294 - BCA1 - C7811514A6B7 } . Fuzzing | ARM64 . ActiveCfg = Release | ARM64 <nl> + { 8BB94BB8 - 374F - 4294 - BCA1 - C7811514A6B7 } . Fuzzing | x64 . ActiveCfg = Fuzzing | x64 <nl> + { 8BB94BB8 - 374F - 4294 - BCA1 - C7811514A6B7 } . Fuzzing | x64 . Build . 0 = Fuzzing | x64 <nl> + { 8BB94BB8 - 374F - 4294 - BCA1 - C7811514A6B7 } . Fuzzing | x86 . ActiveCfg = Release | Win32 <nl> { 8BB94BB8 - 374F - 4294 - BCA1 - C7811514A6B7 } . Release | ARM . ActiveCfg = Release | ARM <nl> { 8BB94BB8 - 374F - 4294 - BCA1 - C7811514A6B7 } . Release | ARM . Build . 0 = Release | ARM <nl> { 8BB94BB8 - 374F - 4294 - BCA1 - C7811514A6B7 } . Release | ARM64 . ActiveCfg = Release | ARM64 <nl> Global <nl> { 5890D6ED - 7C3B - 40F3 - B436 - B54F640D9E65 } . Debug | x64 . Build . 0 = Debug | x64 <nl> { 5890D6ED - 7C3B - 40F3 - B436 - B54F640D9E65 } . Debug | x86 . ActiveCfg = Debug | Win32 <nl> { 5890D6ED - 7C3B - 40F3 - B436 - B54F640D9E65 } . Debug | x86 . Build . 0 = Debug | Win32 <nl> + { 5890D6ED - 7C3B - 40F3 - B436 - B54F640D9E65 } . Fuzzing | ARM . ActiveCfg = Release | ARM <nl> + { 5890D6ED - 7C3B - 40F3 - B436 - B54F640D9E65 } . Fuzzing | ARM64 . ActiveCfg = Release | ARM64 <nl> + { 5890D6ED - 7C3B - 40F3 - B436 - B54F640D9E65 } . Fuzzing | x64 . ActiveCfg = Fuzzing | x64 <nl> + { 5890D6ED - 7C3B - 40F3 - B436 - B54F640D9E65 } . Fuzzing | x64 . Build . 0 = Fuzzing | x64 <nl> + { 5890D6ED - 7C3B - 40F3 - B436 - B54F640D9E65 } . Fuzzing | x86 . ActiveCfg = Release | Win32 <nl> { 5890D6ED - 7C3B - 40F3 - B436 - B54F640D9E65 } . Release | ARM . ActiveCfg = Release | ARM <nl> { 5890D6ED - 7C3B - 40F3 - B436 - B54F640D9E65 } . Release | ARM . Build . 0 = Release | ARM <nl> { 5890D6ED - 7C3B - 40F3 - B436 - B54F640D9E65 } . Release | ARM64 . ActiveCfg = Release | ARM64 <nl> Global <nl> { FB313532 - 38B0 - 4676 - 9303 - AB200AA13576 } . Debug | x64 . Build . 0 = Debug | x64 <nl> { FB313532 - 38B0 - 4676 - 9303 - AB200AA13576 } . Debug | x86 . ActiveCfg = Debug | Win32 <nl> { FB313532 - 38B0 - 4676 - 9303 - AB200AA13576 } . Debug | x86 . Build . 0 = Debug | Win32 <nl> + { FB313532 - 38B0 - 4676 - 9303 - AB200AA13576 } . Fuzzing | ARM . ActiveCfg = Release | ARM <nl> + { FB313532 - 38B0 - 4676 - 9303 - AB200AA13576 } . Fuzzing | ARM64 . ActiveCfg = Release | ARM64 <nl> + { FB313532 - 38B0 - 4676 - 9303 - AB200AA13576 } . Fuzzing | x64 . ActiveCfg = Release | x64 <nl> + { FB313532 - 38B0 - 4676 - 9303 - AB200AA13576 } . Fuzzing | x86 . ActiveCfg = Release | Win32 <nl> { FB313532 - 38B0 - 4676 - 9303 - AB200AA13576 } . Release | ARM . ActiveCfg = Release | ARM <nl> { FB313532 - 38B0 - 4676 - 9303 - AB200AA13576 } . Release | ARM . Build . 0 = Release | ARM <nl> { FB313532 - 38B0 - 4676 - 9303 - AB200AA13576 } . Release | ARM64 . ActiveCfg = Release | ARM64 <nl> Global <nl> { 6CB84692 - 5994 - 407D - B9BD - 9216AF77FE83 } . Debug | x64 . Build . 0 = Debug | x64 <nl> { 6CB84692 - 5994 - 407D - B9BD - 9216AF77FE83 } . Debug | x86 . ActiveCfg = Debug | Win32 <nl> { 6CB84692 - 5994 - 407D - B9BD - 9216AF77FE83 } . Debug | x86 . Build . 0 = Debug | Win32 <nl> + { 6CB84692 - 5994 - 407D - B9BD - 9216AF77FE83 } . Fuzzing | ARM . ActiveCfg = Release | ARM <nl> + { 6CB84692 - 5994 - 407D - B9BD - 9216AF77FE83 } . Fuzzing | ARM64 . ActiveCfg = Release | ARM64 <nl> + { 6CB84692 - 5994 - 407D - B9BD - 9216AF77FE83 } . Fuzzing | x64 . ActiveCfg = Release | x64 <nl> + { 6CB84692 - 5994 - 407D - B9BD - 9216AF77FE83 } . Fuzzing | x86 . ActiveCfg = Release | Win32 <nl> { 6CB84692 - 5994 - 407D - B9BD - 9216AF77FE83 } . Release | ARM . ActiveCfg = Release | ARM <nl> { 6CB84692 - 5994 - 407D - B9BD - 9216AF77FE83 } . Release | ARM . Build . 0 = Release | ARM <nl> { 6CB84692 - 5994 - 407D - B9BD - 9216AF77FE83 } . Release | ARM64 . ActiveCfg = Release | ARM64 <nl> Global <nl> { 3C0269FA - E582 - 4CA7 - 9E33 - 3881A005CA0C } . Debug | x64 . Build . 0 = Debug | x64 <nl> { 3C0269FA - E582 - 4CA7 - 9E33 - 3881A005CA0C } . Debug | x86 . ActiveCfg = Debug | x86 <nl> { 3C0269FA - E582 - 4CA7 - 9E33 - 3881A005CA0C } . Debug | x86 . Build . 0 = Debug | x86 <nl> + { 3C0269FA - E582 - 4CA7 - 9E33 - 3881A005CA0C } . Fuzzing | ARM . ActiveCfg = Release | x86 <nl> + { 3C0269FA - E582 - 4CA7 - 9E33 - 3881A005CA0C } . Fuzzing | ARM64 . ActiveCfg = Release | x86 <nl> + { 3C0269FA - E582 - 4CA7 - 9E33 - 3881A005CA0C } . Fuzzing | x64 . ActiveCfg = Release | x64 <nl> + { 3C0269FA - E582 - 4CA7 - 9E33 - 3881A005CA0C } . Fuzzing | x86 . ActiveCfg = Release | x86 <nl> { 3C0269FA - E582 - 4CA7 - 9E33 - 3881A005CA0C } . Release | ARM . ActiveCfg = Release | x86 <nl> { 3C0269FA - E582 - 4CA7 - 9E33 - 3881A005CA0C } . Release | ARM64 . ActiveCfg = Release | x86 <nl> { 3C0269FA - E582 - 4CA7 - 9E33 - 3881A005CA0C } . Release | x64 . ActiveCfg = Release | x64 <nl> Global <nl> { 3E2CBA31 - CEBA - 4D63 - BF52 - 49C0718E19EA } . Debug | x86 . ActiveCfg = Debug | x86 <nl> { 3E2CBA31 - CEBA - 4D63 - BF52 - 49C0718E19EA } . Debug | x86 . Build . 0 = Debug | x86 <nl> { 3E2CBA31 - CEBA - 4D63 - BF52 - 49C0718E19EA } . Debug | x86 . Deploy . 0 = Debug | x86 <nl> + { 3E2CBA31 - CEBA - 4D63 - BF52 - 49C0718E19EA } . Fuzzing | ARM . ActiveCfg = Release | ARM <nl> + { 3E2CBA31 - CEBA - 4D63 - BF52 - 49C0718E19EA } . Fuzzing | ARM64 . ActiveCfg = Release | ARM64 <nl> + { 3E2CBA31 - CEBA - 4D63 - BF52 - 49C0718E19EA } . Fuzzing | x64 . ActiveCfg = Release | x64 <nl> + { 3E2CBA31 - CEBA - 4D63 - BF52 - 49C0718E19EA } . Fuzzing | x86 . ActiveCfg = Release | x86 <nl> { 3E2CBA31 - CEBA - 4D63 - BF52 - 49C0718E19EA } . Release | ARM . ActiveCfg = Release | ARM <nl> { 3E2CBA31 - CEBA - 4D63 - BF52 - 49C0718E19EA } . Release | ARM . Build . 0 = Release | ARM <nl> { 3E2CBA31 - CEBA - 4D63 - BF52 - 49C0718E19EA } . Release | ARM . Deploy . 0 = Release | ARM <nl> Global <nl> { C1624B2F - 2BF6 - 4E28 - 92FA - 1BF85C6B62A8 } . Debug | ARM64 . ActiveCfg = Debug <nl> { C1624B2F - 2BF6 - 4E28 - 92FA - 1BF85C6B62A8 } . Debug | x64 . ActiveCfg = Debug <nl> { C1624B2F - 2BF6 - 4E28 - 92FA - 1BF85C6B62A8 } . Debug | x86 . ActiveCfg = Debug <nl> + { C1624B2F - 2BF6 - 4E28 - 92FA - 1BF85C6B62A8 } . Fuzzing | ARM . ActiveCfg = Release <nl> + { C1624B2F - 2BF6 - 4E28 - 92FA - 1BF85C6B62A8 } . Fuzzing | ARM64 . ActiveCfg = Release <nl> + { C1624B2F - 2BF6 - 4E28 - 92FA - 1BF85C6B62A8 } . Fuzzing | x64 . ActiveCfg = Release <nl> + { C1624B2F - 2BF6 - 4E28 - 92FA - 1BF85C6B62A8 } . Fuzzing | x86 . ActiveCfg = Release <nl> { C1624B2F - 2BF6 - 4E28 - 92FA - 1BF85C6B62A8 } . Release | ARM . ActiveCfg = Release <nl> { C1624B2F - 2BF6 - 4E28 - 92FA - 1BF85C6B62A8 } . Release | ARM64 . ActiveCfg = Release <nl> { C1624B2F - 2BF6 - 4E28 - 92FA - 1BF85C6B62A8 } . Release | x64 . ActiveCfg = Release <nl> Global <nl> { 3B8466CF - 4FDD - 4329 - 9C80 - 91321C4AAC99 } . Debug | x64 . Build . 0 = Debug | x64 <nl> { 3B8466CF - 4FDD - 4329 - 9C80 - 91321C4AAC99 } . Debug | x86 . ActiveCfg = Debug | x86 <nl> { 3B8466CF - 4FDD - 4329 - 9C80 - 91321C4AAC99 } . Debug | x86 . Build . 0 = Debug | x86 <nl> + { 3B8466CF - 4FDD - 4329 - 9C80 - 91321C4AAC99 } . Fuzzing | ARM . ActiveCfg = Release | x86 <nl> + { 3B8466CF - 4FDD - 4329 - 9C80 - 91321C4AAC99 } . Fuzzing | ARM64 . ActiveCfg = Release | x86 <nl> + { 3B8466CF - 4FDD - 4329 - 9C80 - 91321C4AAC99 } . Fuzzing | x64 . ActiveCfg = Release | x64 <nl> + { 3B8466CF - 4FDD - 4329 - 9C80 - 91321C4AAC99 } . Fuzzing | x86 . ActiveCfg = Release | x86 <nl> { 3B8466CF - 4FDD - 4329 - 9C80 - 91321C4AAC99 } . Release | ARM . ActiveCfg = Release | x86 <nl> { 3B8466CF - 4FDD - 4329 - 9C80 - 91321C4AAC99 } . Release | ARM64 . ActiveCfg = Release | x86 <nl> { 3B8466CF - 4FDD - 4329 - 9C80 - 91321C4AAC99 } . Release | x64 . ActiveCfg = Release | x64 <nl> Global <nl> { 82B39FDA - E86B - 4713 - A873 - 9D56DE00247A } . Debug | x64 . Build . 0 = Debug | x64 <nl> { 82B39FDA - E86B - 4713 - A873 - 9D56DE00247A } . Debug | x86 . ActiveCfg = Debug | Win32 <nl> { 82B39FDA - E86B - 4713 - A873 - 9D56DE00247A } . Debug | x86 . Build . 0 = Debug | Win32 <nl> + { 82B39FDA - E86B - 4713 - A873 - 9D56DE00247A } . Fuzzing | ARM . ActiveCfg = Release | ARM <nl> + { 82B39FDA - E86B - 4713 - A873 - 9D56DE00247A } . Fuzzing | ARM64 . ActiveCfg = Release | ARM64 <nl> + { 82B39FDA - E86B - 4713 - A873 - 9D56DE00247A } . Fuzzing | x64 . ActiveCfg = Release | x64 <nl> + { 82B39FDA - E86B - 4713 - A873 - 9D56DE00247A } . Fuzzing | x86 . ActiveCfg = Release | Win32 <nl> { 82B39FDA - E86B - 4713 - A873 - 9D56DE00247A } . Release | ARM . ActiveCfg = Release | ARM <nl> { 82B39FDA - E86B - 4713 - A873 - 9D56DE00247A } . Release | ARM . Build . 0 = Release | ARM <nl> { 82B39FDA - E86B - 4713 - A873 - 9D56DE00247A } . Release | ARM64 . ActiveCfg = Release | ARM64 <nl> Global <nl> { 82B39FDA - E86B - 4713 - A873 - 9D56DE00247A } . Release | x64 . Build . 0 = Release | x64 <nl> { 82B39FDA - E86B - 4713 - A873 - 9D56DE00247A } . Release | x86 . ActiveCfg = Release | Win32 <nl> { 82B39FDA - E86B - 4713 - A873 - 9D56DE00247A } . Release | x86 . Build . 0 = Release | Win32 <nl> + { 1622DA16 - 914F - 4F57 - A259 - D5169003CC8C } . Debug | ARM . ActiveCfg = Fuzzing | x64 <nl> + { 1622DA16 - 914F - 4F57 - A259 - D5169003CC8C } . Debug | ARM64 . ActiveCfg = Fuzzing | x64 <nl> + { 1622DA16 - 914F - 4F57 - A259 - D5169003CC8C } . Debug | x64 . ActiveCfg = Fuzzing | x64 <nl> + { 1622DA16 - 914F - 4F57 - A259 - D5169003CC8C } . Debug | x86 . ActiveCfg = Fuzzing | x64 <nl> + { 1622DA16 - 914F - 4F57 - A259 - D5169003CC8C } . Fuzzing | ARM . ActiveCfg = Fuzzing | x64 <nl> + { 1622DA16 - 914F - 4F57 - A259 - D5169003CC8C } . Fuzzing | ARM64 . ActiveCfg = Fuzzing | x64 <nl> + { 1622DA16 - 914F - 4F57 - A259 - D5169003CC8C } . Fuzzing | x64 . ActiveCfg = Fuzzing | x64 <nl> + { 1622DA16 - 914F - 4F57 - A259 - D5169003CC8C } . Fuzzing | x64 . Build . 0 = Fuzzing | x64 <nl> + { 1622DA16 - 914F - 4F57 - A259 - D5169003CC8C } . Fuzzing | x86 . ActiveCfg = Fuzzing | x64 <nl> + { 1622DA16 - 914F - 4F57 - A259 - D5169003CC8C } . Release | ARM . ActiveCfg = Fuzzing | x64 <nl> + { 1622DA16 - 914F - 4F57 - A259 - D5169003CC8C } . Release | ARM64 . ActiveCfg = Fuzzing | x64 <nl> + { 1622DA16 - 914F - 4F57 - A259 - D5169003CC8C } . Release | x64 . ActiveCfg = Fuzzing | x64 <nl> + { 1622DA16 - 914F - 4F57 - A259 - D5169003CC8C } . Release | x86 . ActiveCfg = Fuzzing | x64 <nl> EndGlobalSection <nl> GlobalSection ( SolutionProperties ) = preSolution <nl> HideSolutionNode = FALSE <nl> Global <nl> { 6E36DDD7 - 1602 - 474E - B1D7 - D0A7E1D5AD86 } = { 8D53D749 - D51C - 46F8 - A162 - 9371AAA6C2E7 } <nl> { 3B8466CF - 4FDD - 4329 - 9C80 - 91321C4AAC99 } = { EA8CD934 - 0702 - 4911 - A2C5 - A40600E616DE } <nl> { 82B39FDA - E86B - 4713 - A873 - 9D56DE00247A } = { 60618CAC - 2995 - 4DF9 - 9914 - 45C6FC02C995 } <nl> + { 1622DA16 - 914F - 4F57 - A259 - D5169003CC8C } = { 6D7776A8 - 42FE - 46DD - B0F8 - 712F35EA0C79 } <nl> EndGlobalSection <nl> GlobalSection ( ExtensibilityGlobals ) = postSolution <nl> SolutionGuid = { B6FDB70C - A751 - 422C - ACD1 - E35419495857 } <nl> mmm a / src / AppInstallerCLI / AppInstallerCLI . vcxproj <nl> ppp b / src / AppInstallerCLI / AppInstallerCLI . vcxproj <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < Project DefaultTargets = " Build " ToolsVersion = " 15 . 0 " xmlns = " http : / / schemas . microsoft . com / developer / msbuild / 2003 " > <nl> - < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " / > <nl> < PropertyGroup Label = " Globals " > <nl> < CppWinRTOptimized > true < / CppWinRTOptimized > <nl> < CppWinRTRootNamespaceAutoMerge > true < / CppWinRTRootNamespaceAutoMerge > <nl> <nl> < ControlFlowGuard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | ARM ' " > false < / ControlFlowGuard > <nl> < ControlFlowGuard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | ARM64 ' " > false < / ControlFlowGuard > <nl> < ControlFlowGuard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | x64 ' " > false < / ControlFlowGuard > <nl> + < LanguageStandard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | ARM ' " > stdcpp17 < / LanguageStandard > <nl> + < LanguageStandard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | ARM64 ' " > stdcpp17 < / LanguageStandard > <nl> + < LanguageStandard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | x64 ' " > stdcpp17 < / LanguageStandard > <nl> < / ClCompile > <nl> < Link > <nl> < SubSystem > Console < / SubSystem > <nl> <nl> < AdditionalIncludeDirectories Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( ProjectDir ) ; . . \ AppInstallerCLICore \ Public \ ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> < TreatWarningAsError Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > true < / TreatWarningAsError > <nl> < ControlFlowGuard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > false < / ControlFlowGuard > <nl> + < LanguageStandard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > stdcpp17 < / LanguageStandard > <nl> < / ClCompile > <nl> < Manifest > <nl> < AdditionalManifestFiles Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > $ ( ProjectDir ) . . \ manifest \ shared . manifest % ( AdditionalManifestFiles ) < / AdditionalManifestFiles > <nl> <nl> < ControlFlowGuard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | ARM64 ' " > Guard < / ControlFlowGuard > <nl> < ControlFlowGuard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > Guard < / ControlFlowGuard > <nl> < ControlFlowGuard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | x64 ' " > Guard < / ControlFlowGuard > <nl> + < LanguageStandard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | ARM ' " > stdcpp17 < / LanguageStandard > <nl> + < LanguageStandard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | ARM64 ' " > stdcpp17 < / LanguageStandard > <nl> + < LanguageStandard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | Win32 ' " > stdcpp17 < / LanguageStandard > <nl> + < LanguageStandard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | x64 ' " > stdcpp17 < / LanguageStandard > <nl> < / ClCompile > <nl> < Link > <nl> < SubSystem > Console < / SubSystem > <nl> <nl> < ClCompile Include = " main . cpp " / > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> + < None Include = " packages . config " / > <nl> < None Include = " PropertySheet . props " / > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> <nl> < / ItemGroup > <nl> < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . targets " / > <nl> < ImportGroup Label = " ExtensionTargets " > <nl> - < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " / > <nl> < / ImportGroup > <nl> < Target Name = " EnsureNuGetPackageBuildImports " BeforeTargets = " PrepareForBuild " > <nl> < PropertyGroup > <nl> < ErrorText > This project references NuGet package ( s ) that are missing on this computer . Use NuGet Package Restore to download them . For more information , see http : / / go . microsoft . com / fwlink / ? LinkID = 322105 . The missing file is { 0 } . < / ErrorText > <nl> < / PropertyGroup > <nl> - < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) ) " / > <nl> - < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) ) " / > <nl> < / Target > <nl> < / Project > <nl> \ No newline at end of file <nl> mmm a / src / AppInstallerCLI / AppInstallerCLI . vcxproj . filters <nl> ppp b / src / AppInstallerCLI / AppInstallerCLI . vcxproj . filters <nl> <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < None Include = " PropertySheet . props " / > <nl> + < None Include = " packages . config " / > <nl> < / ItemGroup > <nl> < / Project > <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 00000000 . . 938a92d6 <nl> mmm / dev / null <nl> ppp b / src / AppInstallerCLI / packages . config <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> + < packages > <nl> + < package id = " Microsoft . Windows . CppWinRT " version = " 2 . 0 . 200729 . 8 " targetFramework = " native " / > <nl> + < / packages > <nl> \ No newline at end of file <nl> mmm a / src / AppInstallerCLICore / AppInstallerCLICore . vcxproj <nl> ppp b / src / AppInstallerCLICore / AppInstallerCLICore . vcxproj <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < Project DefaultTargets = " Build " ToolsVersion = " 15 . 0 " xmlns = " http : / / schemas . microsoft . com / developer / msbuild / 2003 " > <nl> - < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " / > <nl> < PropertyGroup Label = " Globals " > <nl> < CppWinRTOptimized > true < / CppWinRTOptimized > <nl> < CppWinRTRootNamespaceAutoMerge > true < / CppWinRTRootNamespaceAutoMerge > <nl> <nl> < / ItemGroup > <nl> < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . targets " / > <nl> < ImportGroup Label = " ExtensionTargets " > <nl> - < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " / > <nl> - < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " / > <nl> < / ImportGroup > <nl> < Target Name = " EnsureNuGetPackageBuildImports " BeforeTargets = " PrepareForBuild " > <nl> < PropertyGroup > <nl> < ErrorText > This project references NuGet package ( s ) that are missing on this computer . Use NuGet Package Restore to download them . For more information , see http : / / go . microsoft . com / fwlink / ? LinkID = 322105 . The missing file is { 0 } . < / ErrorText > <nl> < / PropertyGroup > <nl> - < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) ) " / > <nl> - < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) ) " / > <nl> - < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) ) " / > <nl> < / Target > <nl> < / Project > <nl> \ No newline at end of file <nl> mmm a / src / AppInstallerCLICore / ExecutionContext . h <nl> ppp b / src / AppInstallerCLICore / ExecutionContext . h <nl> <nl> # include < AppInstallerLogging . h > <nl> # include < AppInstallerRepositorySearch . h > <nl> # include < AppInstallerRepositorySource . h > <nl> - # include < Manifest / Manifest . h > <nl> + # include < winget / Manifest . h > <nl> # include " ExecutionReporter . h " <nl> # include " ExecutionArgs . h " <nl> # include " CompletionData . h " <nl> mmm a / src / AppInstallerCLICore / Workflows / ManifestComparator . h <nl> ppp b / src / AppInstallerCLICore / Workflows / ManifestComparator . h <nl> <nl> / / Licensed under the MIT License . <nl> # pragma once <nl> # include " ExecutionArgs . h " <nl> - # include < Manifest / Manifest . h > <nl> + # include < winget / Manifest . h > <nl> <nl> # include < optional > <nl> <nl> mmm a / src / AppInstallerCLICore / Workflows / WorkflowBase . cpp <nl> ppp b / src / AppInstallerCLICore / Workflows / WorkflowBase . cpp <nl> <nl> # include " ExecutionContext . h " <nl> # include " ManifestComparator . h " <nl> # include " TableOutput . h " <nl> - # include " Manifest / YamlParser . h " <nl> + # include < winget / ManifestYamlParser . h > <nl> <nl> <nl> namespace AppInstaller : : CLI : : Workflow <nl> mmm a / src / AppInstallerCLICore / packages . config <nl> ppp b / src / AppInstallerCLICore / packages . config <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < packages > <nl> - < package id = " Microsoft . Windows . CppWinRT " version = " 2 . 0 . 191111 . 2 " targetFramework = " native " / > <nl> - < package id = " Microsoft . Windows . ImplementationLibrary " version = " 1 . 0 . 191107 . 2 " targetFramework = " native " / > <nl> + < package id = " Microsoft . Windows . CppWinRT " version = " 2 . 0 . 200729 . 8 " targetFramework = " native " / > <nl> + < package id = " Microsoft . Windows . ImplementationLibrary " version = " 1 . 0 . 200519 . 2 " targetFramework = " native " / > <nl> < / packages > <nl> \ No newline at end of file <nl> mmm a / src / AppInstallerCLICore / pch . h <nl> ppp b / src / AppInstallerCLICore / pch . h <nl> <nl> # include < AppInstallerSHA256 . h > <nl> # include < AppInstallerStrings . h > <nl> # include < AppInstallerTelemetry . h > <nl> - # include < Manifest / YamlParser . h > <nl> - # include < winget / LocIndependent . h > <nl> # include < winget / ExperimentalFeature . h > <nl> + # include < winget / LocIndependent . h > <nl> + # include < winget / ManifestYamlParser . h > <nl> mmm a / src / AppInstallerCLITests / AppInstallerCLITests . vcxproj <nl> ppp b / src / AppInstallerCLITests / AppInstallerCLITests . vcxproj <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < Project DefaultTargets = " Build " ToolsVersion = " 15 . 0 " xmlns = " http : / / schemas . microsoft . com / developer / msbuild / 2003 " > <nl> - < Import Project = " . . \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191202 . 6 \ build \ native \ Microsoft . Windows . CppWinRT . props " Condition = " Exists ( ' . . \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191202 . 6 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " / > <nl> < PropertyGroup Label = " Globals " > <nl> < CppWinRTOptimized > true < / CppWinRTOptimized > <nl> < CppWinRTRootNamespaceAutoMerge > true < / CppWinRTRootNamespaceAutoMerge > <nl> <nl> < / ItemGroup > <nl> < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . targets " / > <nl> < ImportGroup Label = " ExtensionTargets " > <nl> - < Import Project = " . . \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191202 . 6 \ build \ native \ Microsoft . Windows . CppWinRT . targets " Condition = " Exists ( ' . . \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191202 . 6 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " / > <nl> - < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " / > <nl> < / ImportGroup > <nl> < Target Name = " EnsureNuGetPackageBuildImports " BeforeTargets = " PrepareForBuild " > <nl> < PropertyGroup > <nl> < ErrorText > This project references NuGet package ( s ) that are missing on this computer . Use NuGet Package Restore to download them . For more information , see http : / / go . microsoft . com / fwlink / ? LinkID = 322105 . The missing file is { 0 } . < / ErrorText > <nl> < / PropertyGroup > <nl> - < Error Condition = " ! Exists ( ' . . \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191202 . 6 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' . . \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191202 . 6 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) ) " / > <nl> - < Error Condition = " ! Exists ( ' . . \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191202 . 6 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' . . \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191202 . 6 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) ) " / > <nl> - < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) ) " / > <nl> < / Target > <nl> < / Project > <nl> \ No newline at end of file <nl> mmm a / src / AppInstallerCLITests / SQLiteIndex . cpp <nl> ppp b / src / AppInstallerCLITests / SQLiteIndex . cpp <nl> <nl> # include " pch . h " <nl> # include " TestCommon . h " <nl> # include < SQLiteWrapper . h > <nl> - # include < Manifest / Manifest . h > <nl> # include < Microsoft / SQLiteIndex . h > <nl> + # include < winget / Manifest . h > <nl> <nl> # include < Microsoft / Schema / 1_0 / IdTable . h > <nl> # include < Microsoft / Schema / 1_0 / NameTable . h > <nl> mmm a / src / AppInstallerCLITests / SQLiteIndexSource . cpp <nl> ppp b / src / AppInstallerCLITests / SQLiteIndexSource . cpp <nl> <nl> / / Licensed under the MIT License . <nl> # include " pch . h " <nl> # include " TestCommon . h " <nl> - # include < Manifest / YamlParser . h > <nl> # include < Microsoft / SQLiteIndexSource . h > <nl> + # include < winget / ManifestYamlParser . h > <nl> <nl> using namespace std : : string_literals ; <nl> using namespace TestCommon ; <nl> mmm a / src / AppInstallerCLITests / WorkFlow . cpp <nl> ppp b / src / AppInstallerCLITests / WorkFlow . cpp <nl> <nl> # include " pch . h " <nl> # include " TestCommon . h " <nl> # include < AppInstallerLogging . h > <nl> - # include < Manifest / YamlParser . h > <nl> # include < AppInstallerDownloader . h > <nl> # include < AppInstallerStrings . h > <nl> # include < Workflows / InstallFlow . h > <nl> <nl> # include < Commands / InstallCommand . h > <nl> # include < Commands / ShowCommand . h > <nl> # include < winget / LocIndependent . h > <nl> + # include < winget / ManifestYamlParser . h > <nl> # include < Resources . h > <nl> <nl> using namespace winrt : : Windows : : Foundation ; <nl> mmm a / src / AppInstallerCLITests / YamlManifest . cpp <nl> ppp b / src / AppInstallerCLITests / YamlManifest . cpp <nl> <nl> / / Licensed under the MIT License . <nl> # include " pch . h " <nl> # include " TestCommon . h " <nl> - # include " Manifest / YamlParser . h " <nl> - # include " AppInstallerSHA256 . h " <nl> + # include < AppInstallerSHA256 . h > <nl> + # include < winget / ManifestYamlParser . h > <nl> <nl> using namespace TestCommon ; <nl> using namespace AppInstaller : : Manifest ; <nl> mmm a / src / AppInstallerCLITests / packages . config <nl> ppp b / src / AppInstallerCLITests / packages . config <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < packages > <nl> - < package id = " Microsoft . Windows . CppWinRT " version = " 2 . 0 . 191202 . 6 " targetFramework = " native " / > <nl> - < package id = " Microsoft . Windows . ImplementationLibrary " version = " 1 . 0 . 191107 . 2 " targetFramework = " native " / > <nl> + < package id = " Microsoft . Windows . CppWinRT " version = " 2 . 0 . 200729 . 8 " targetFramework = " native " / > <nl> + < package id = " Microsoft . Windows . ImplementationLibrary " version = " 1 . 0 . 200519 . 2 " targetFramework = " native " / > <nl> < / packages > <nl> \ No newline at end of file <nl> mmm a / src / AppInstallerCommonCore / AppInstallerCommonCore . vcxproj <nl> ppp b / src / AppInstallerCommonCore / AppInstallerCommonCore . vcxproj <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < Project DefaultTargets = " Build " ToolsVersion = " 15 . 0 " xmlns = " http : / / schemas . microsoft . com / developer / msbuild / 2003 " > <nl> - < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props " Condition = " ' $ ( Configuration ) ' ! = ' Fuzzing ' And Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " / > <nl> < PropertyGroup Label = " Globals " > <nl> < CppWinRTOptimized > true < / CppWinRTOptimized > <nl> < CppWinRTRootNamespaceAutoMerge > true < / CppWinRTRootNamespaceAutoMerge > <nl> <nl> < Configuration > Debug < / Configuration > <nl> < Platform > Win32 < / Platform > <nl> < / ProjectConfiguration > <nl> + < ProjectConfiguration Include = " Fuzzing | ARM " > <nl> + < Configuration > Fuzzing < / Configuration > <nl> + < Platform > ARM < / Platform > <nl> + < / ProjectConfiguration > <nl> + < ProjectConfiguration Include = " Fuzzing | ARM64 " > <nl> + < Configuration > Fuzzing < / Configuration > <nl> + < Platform > ARM64 < / Platform > <nl> + < / ProjectConfiguration > <nl> + < ProjectConfiguration Include = " Fuzzing | Win32 " > <nl> + < Configuration > Fuzzing < / Configuration > <nl> + < Platform > Win32 < / Platform > <nl> + < / ProjectConfiguration > <nl> + < ProjectConfiguration Include = " Fuzzing | x64 " > <nl> + < Configuration > Fuzzing < / Configuration > <nl> + < Platform > x64 < / Platform > <nl> + < / ProjectConfiguration > <nl> < ProjectConfiguration Include = " Release | ARM " > <nl> < Configuration > Release < / Configuration > <nl> < Platform > ARM < / Platform > <nl> <nl> < ConfigurationType > StaticLibrary < / ConfigurationType > <nl> < PlatformToolset > v140 < / PlatformToolset > <nl> < PlatformToolset Condition = " ' $ ( VisualStudioVersion ) ' = = ' 15 . 0 ' " > v141 < / PlatformToolset > <nl> - < PlatformToolset Condition = " ' $ ( VisualStudioVersion ) ' = = ' 16 . 0 ' " > v142 < / PlatformToolset > <nl> + < PlatformToolset Condition = " ' $ ( VisualStudioVersion ) ' = = ' 16 . 0 ' And ' $ ( Configuration ) ' ! = ' Fuzzing ' " > v142 < / PlatformToolset > <nl> + < PlatformToolset Condition = " ' $ ( VisualStudioVersion ) ' = = ' 16 . 0 ' And ' $ ( Configuration ) ' = = ' Fuzzing ' " > ClangCL < / PlatformToolset > <nl> < CharacterSet > Unicode < / CharacterSet > <nl> < / PropertyGroup > <nl> < PropertyGroup Condition = " ' $ ( Configuration ) ' = = ' Debug ' " Label = " Configuration " > <nl> <nl> < WholeProgramOptimization > true < / WholeProgramOptimization > <nl> < LinkIncremental > false < / LinkIncremental > <nl> < / PropertyGroup > <nl> + < PropertyGroup Condition = " ' $ ( Configuration ) ' = = ' Fuzzing ' " Label = " Configuration " > <nl> + < UseDebugLibraries > false < / UseDebugLibraries > <nl> + < WholeProgramOptimization > false < / WholeProgramOptimization > <nl> + < LinkIncremental > false < / LinkIncremental > <nl> + < / PropertyGroup > <nl> < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . props " / > <nl> < ImportGroup Label = " ExtensionSettings " > <nl> < / ImportGroup > <nl> <nl> < LinkIncremental > false < / LinkIncremental > <nl> < OutDir > $ ( SolutionDir ) x86 \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> < / PropertyGroup > <nl> + < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | Win32 ' " > <nl> + < LinkIncremental > false < / LinkIncremental > <nl> + < OutDir > $ ( SolutionDir ) x86 \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> + < / PropertyGroup > <nl> < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | x64 ' " > <nl> < LinkIncremental > false < / LinkIncremental > <nl> < OutDir > $ ( SolutionDir ) $ ( Platform ) \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> < / PropertyGroup > <nl> + < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | x64 ' " > <nl> + < LinkIncremental > false < / LinkIncremental > <nl> + < OutDir > $ ( SolutionDir ) $ ( Platform ) \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> + < / PropertyGroup > <nl> < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | ARM ' " > <nl> < LinkIncremental > false < / LinkIncremental > <nl> < OutDir > $ ( SolutionDir ) $ ( Platform ) \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> < / PropertyGroup > <nl> + < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | ARM ' " > <nl> + < LinkIncremental > false < / LinkIncremental > <nl> + < OutDir > $ ( SolutionDir ) $ ( Platform ) \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> + < / PropertyGroup > <nl> < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | ARM64 ' " > <nl> < LinkIncremental > false < / LinkIncremental > <nl> < OutDir > $ ( SolutionDir ) $ ( Platform ) \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> < / PropertyGroup > <nl> + < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | ARM64 ' " > <nl> + < LinkIncremental > false < / LinkIncremental > <nl> + < OutDir > $ ( SolutionDir ) $ ( Platform ) \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> + < / PropertyGroup > <nl> < ItemDefinitionGroup > <nl> < ClCompile > <nl> < PrecompiledHeader > Use < / PrecompiledHeader > <nl> <nl> < SubSystem Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | x64 ' " > Windows < / SubSystem > <nl> < / Link > <nl> < / ItemDefinitionGroup > <nl> + < ItemDefinitionGroup Condition = " ' $ ( Configuration ) ' = = ' Fuzzing ' " > <nl> + < ClCompile > <nl> + < Optimization > MaxSpeed < / Optimization > <nl> + < FunctionLevelLinking > true < / FunctionLevelLinking > <nl> + < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> + < PreprocessorDefinitions > NDEBUG ; % ( PreprocessorDefinitions ) ; CLICOREDLLBUILD ; WINGET_DISABLE_FOR_FUZZING < / PreprocessorDefinitions > <nl> + < AdditionalIncludeDirectories Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | ARM ' " > $ ( ProjectDir ) ; $ ( ProjectDir ) Public ; $ ( ProjectDir ) Telemetry ; $ ( ProjectDir ) . . \ binver ; $ ( ProjectDir ) . . \ YamlCppLib \ libyaml \ include ; $ ( ProjectDir ) . . \ JsonCppLib \ json ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | ARM64 ' " > $ ( ProjectDir ) ; $ ( ProjectDir ) Public ; $ ( ProjectDir ) Telemetry ; $ ( ProjectDir ) . . \ binver ; $ ( ProjectDir ) . . \ YamlCppLib \ libyaml \ include ; $ ( ProjectDir ) . . \ JsonCppLib \ json ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | Win32 ' " > $ ( ProjectDir ) ; $ ( ProjectDir ) Public ; $ ( ProjectDir ) Telemetry ; $ ( ProjectDir ) . . \ binver ; $ ( ProjectDir ) . . \ YamlCppLib \ libyaml \ include ; $ ( ProjectDir ) . . \ JsonCppLib \ json ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < AdditionalIncludeDirectories Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | x64 ' " > $ ( ProjectDir ) ; $ ( ProjectDir ) Public ; $ ( ProjectDir ) Telemetry ; $ ( ProjectDir ) . . \ binver ; $ ( ProjectDir ) . . \ YamlCppLib \ libyaml \ include ; $ ( ProjectDir ) . . \ JsonCppLib \ json ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < TreatWarningAsError Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | ARM ' " > true < / TreatWarningAsError > <nl> + < TreatWarningAsError Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | ARM64 ' " > true < / TreatWarningAsError > <nl> + < TreatWarningAsError Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | Win32 ' " > true < / TreatWarningAsError > <nl> + < TreatWarningAsError Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | x64 ' " > true < / TreatWarningAsError > <nl> + < LanguageStandard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | x64 ' " > stdcpp17 < / LanguageStandard > <nl> + < LanguageStandard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | ARM ' " > stdcpp17 < / LanguageStandard > <nl> + < LanguageStandard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | ARM64 ' " > stdcpp17 < / LanguageStandard > <nl> + < LanguageStandard Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | Win32 ' " > stdcpp17 < / LanguageStandard > <nl> + < RuntimeLibrary Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | x64 ' " > MultiThreaded < / RuntimeLibrary > <nl> + < AdditionalOptions > % ( AdditionalOptions ) - fsanitize = fuzzer , address < / AdditionalOptions > <nl> + < / ClCompile > <nl> + < Link > <nl> + < EnableCOMDATFolding > true < / EnableCOMDATFolding > <nl> + < OptimizeReferences > true < / OptimizeReferences > <nl> + < GenerateWindowsMetadata > false < / GenerateWindowsMetadata > <nl> + < SubSystem Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | ARM ' " > Windows < / SubSystem > <nl> + < SubSystem Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | ARM64 ' " > Windows < / SubSystem > <nl> + < SubSystem Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | Win32 ' " > Windows < / SubSystem > <nl> + < SubSystem Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | x64 ' " > Windows < / SubSystem > <nl> + < / Link > <nl> + < / ItemDefinitionGroup > <nl> < ItemGroup > <nl> < ClInclude Include = " HttpStream \ HttpClientWrapper . h " / > <nl> < ClInclude Include = " HttpStream \ HttpLocalCache . h " / > <nl> <nl> < ClInclude Include = " Public \ winget \ ExperimentalFeature . h " / > <nl> < ClInclude Include = " Public \ winget \ ExtensionCatalog . h " / > <nl> < ClInclude Include = " Public \ winget \ LocIndependent . h " / > <nl> + < ClInclude Include = " Public \ winget \ Manifest . h " / > <nl> + < ClInclude Include = " Public \ winget \ ManifestInstaller . h " / > <nl> + < ClInclude Include = " Public \ winget \ ManifestLocalization . h " / > <nl> + < ClInclude Include = " Public \ winget \ ManifestValidation . h " / > <nl> + < ClInclude Include = " Public \ winget \ ManifestYamlParser . h " / > <nl> < ClInclude Include = " Public \ winget \ Settings . h " / > <nl> < ClInclude Include = " Public \ winget \ UserSettings . h " / > <nl> < ClInclude Include = " Public \ winget \ Yaml . h " / > <nl> <nl> < ClCompile Include = " AppInstallerLogging . cpp " / > <nl> < ClCompile Include = " AppInstallerStrings . cpp " / > <nl> < ClCompile Include = " DateTime . cpp " / > <nl> - < ClCompile Include = " Deployment . cpp " / > <nl> + < ClCompile Include = " Deployment . cpp " > <nl> + < ExcludedFromBuild Condition = " ' $ ( Configuration ) ' = = ' Fuzzing ' " > true < / ExcludedFromBuild > <nl> + < / ClCompile > <nl> < ClCompile Include = " Downloader . cpp " / > <nl> < ClCompile Include = " Errors . cpp " / > <nl> < ClCompile Include = " ExperimentalFeature . cpp " / > <nl> - < ClCompile Include = " ExtensionCatalog . cpp " / > <nl> + < ClCompile Include = " ExtensionCatalog . cpp " > <nl> + < ExcludedFromBuild Condition = " ' $ ( Configuration ) ' = = ' Fuzzing ' " > true < / ExcludedFromBuild > <nl> + < / ClCompile > <nl> < ClCompile Include = " FileLogger . cpp " / > <nl> - < ClCompile Include = " HttpStream \ HttpClientWrapper . cpp " / > <nl> - < ClCompile Include = " HttpStream \ HttpLocalCache . cpp " / > <nl> - < ClCompile Include = " HttpStream \ HttpRandomAccessStream . cpp " / > <nl> + < ClCompile Include = " HttpStream \ HttpClientWrapper . cpp " > <nl> + < ExcludedFromBuild Condition = " ' $ ( Configuration ) ' = = ' Fuzzing ' " > true < / ExcludedFromBuild > <nl> + < / ClCompile > <nl> + < ClCompile Include = " HttpStream \ HttpLocalCache . cpp " > <nl> + < ExcludedFromBuild Condition = " ' $ ( Configuration ) ' = = ' Fuzzing ' " > true < / ExcludedFromBuild > <nl> + < / ClCompile > <nl> + < ClCompile Include = " HttpStream \ HttpRandomAccessStream . cpp " > <nl> + < ExcludedFromBuild Condition = " ' $ ( Configuration ) ' = = ' Fuzzing ' " > true < / ExcludedFromBuild > <nl> + < / ClCompile > <nl> < ClCompile Include = " JsonUtil . cpp " / > <nl> - < ClCompile Include = " MsixInfo . cpp " / > <nl> + < ClCompile Include = " Manifest \ Manifest . cpp " / > <nl> + < ClCompile Include = " Manifest \ ManifestInstaller . cpp " / > <nl> + < ClCompile Include = " Manifest \ ManifestValidation . cpp " / > <nl> + < ClCompile Include = " Manifest \ YamlParser . cpp " / > <nl> + < ClCompile Include = " MsixInfo . cpp " > <nl> + < ExcludedFromBuild Condition = " ' $ ( Configuration ) ' = = ' Fuzzing ' " > true < / ExcludedFromBuild > <nl> + < / ClCompile > <nl> < ClCompile Include = " Runtime . cpp " / > <nl> < ClCompile Include = " pch . cpp " > <nl> < PrecompiledHeader > Create < / PrecompiledHeader > <nl> <nl> < / ItemGroup > <nl> < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . targets " / > <nl> < ImportGroup Label = " ExtensionTargets " > <nl> - < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " / > <nl> - < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets " Condition = " ' $ ( Configuration ) ' ! = ' Fuzzing ' And Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " / > <nl> < / ImportGroup > <nl> < Target Name = " EnsureNuGetPackageBuildImports " BeforeTargets = " PrepareForBuild " > <nl> < PropertyGroup > <nl> < ErrorText > This project references NuGet package ( s ) that are missing on this computer . Use NuGet Package Restore to download them . For more information , see http : / / go . microsoft . com / fwlink / ? LinkID = 322105 . The missing file is { 0 } . < / ErrorText > <nl> < / PropertyGroup > <nl> - < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) ) " / > <nl> - < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) ) " / > <nl> - < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) ) " / > <nl> < / Target > <nl> < / Project > <nl> \ No newline at end of file <nl> mmm a / src / AppInstallerCommonCore / AppInstallerCommonCore . vcxproj . filters <nl> ppp b / src / AppInstallerCommonCore / AppInstallerCommonCore . vcxproj . filters <nl> <nl> < Filter Include = " Public \ winget " > <nl> < UniqueIdentifier > { 41035fd6 - dc74 - 4464 - b9b1 - 4ffe95d6789c } < / UniqueIdentifier > <nl> < / Filter > <nl> + < Filter Include = " Manifest " > <nl> + < UniqueIdentifier > { 9b8e2682 - 3eb7 - 4530 - bc9a - a57fafc44177 } < / UniqueIdentifier > <nl> + < / Filter > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < ClInclude Include = " pch . h " > <nl> <nl> < ClInclude Include = " Public \ winget \ Yaml . h " > <nl> < Filter > Public \ winget < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " Public \ winget \ Manifest . h " > <nl> + < Filter > Public \ winget < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " Public \ winget \ ManifestInstaller . h " > <nl> + < Filter > Public \ winget < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " Public \ winget \ ManifestLocalization . h " > <nl> + < Filter > Public \ winget < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " Public \ winget \ ManifestValidation . h " > <nl> + < Filter > Public \ winget < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " Public \ winget \ ManifestYamlParser . h " > <nl> + < Filter > Public \ winget < / Filter > <nl> + < / ClInclude > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < ClCompile Include = " pch . cpp " > <nl> <nl> < ClCompile Include = " Yaml . cpp " > <nl> < Filter > Source Files < / Filter > <nl> < / ClCompile > <nl> + < ClCompile Include = " Manifest \ Manifest . cpp " > <nl> + < Filter > Manifest < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " Manifest \ ManifestInstaller . cpp " > <nl> + < Filter > Manifest < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " Manifest \ ManifestValidation . cpp " > <nl> + < Filter > Manifest < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " Manifest \ YamlParser . cpp " > <nl> + < Filter > Manifest < / Filter > <nl> + < / ClCompile > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> < None Include = " PropertySheet . props " / > <nl> mmm a / src / AppInstallerCommonCore / AppInstallerLogging . cpp <nl> ppp b / src / AppInstallerCommonCore / AppInstallerLogging . cpp <nl> namespace AppInstaller : : Logging <nl> } <nl> } <nl> <nl> - char const * const GetChannelName ( Channel channel ) <nl> + char const * GetChannelName ( Channel channel ) <nl> { <nl> switch ( channel ) <nl> { <nl> mmm a / src / AppInstallerCommonCore / Errors . cpp <nl> ppp b / src / AppInstallerCommonCore / Errors . cpp <nl> namespace AppInstaller <nl> { <nl> namespace <nl> { <nl> - const char * const GetMessageForAppInstallerHR ( HRESULT hr ) <nl> + const char * GetMessageForAppInstallerHR ( HRESULT hr ) <nl> { <nl> switch ( hr ) <nl> { <nl> namespace AppInstaller <nl> return strstr . str ( ) ; <nl> } <nl> <nl> - std : : string GetUserPresentableMessage ( const winrt : : hresult_error & hre ) <nl> + std : : string GetUserPresentableMessage ( const std : : exception & e ) <nl> { <nl> - return Utility : : ConvertToUTF8 ( hre . message ( ) ) ; <nl> + return e . what ( ) ; <nl> } <nl> <nl> - std : : string GetUserPresentableMessage ( const std : : exception & e ) <nl> + # ifndef WINGET_DISABLE_FOR_FUZZING <nl> + std : : string GetUserPresentableMessage ( const winrt : : hresult_error & hre ) <nl> { <nl> - return e . what ( ) ; <nl> + return Utility : : ConvertToUTF8 ( hre . message ( ) ) ; <nl> } <nl> + # endif <nl> } <nl> similarity index 90 % <nl> rename from src / AppInstallerRepositoryCore / Manifest / Manifest . cpp <nl> rename to src / AppInstallerCommonCore / Manifest / Manifest . cpp <nl> mmm a / src / AppInstallerRepositoryCore / Manifest / Manifest . cpp <nl> ppp b / src / AppInstallerCommonCore / Manifest / Manifest . cpp <nl> <nl> / / Copyright ( c ) Microsoft Corporation . <nl> / / Licensed under the MIT License . <nl> # include " pch . h " <nl> - # include " Manifest . h " <nl> - # include " ManifestValidation . h " <nl> + # include " winget / Manifest . h " <nl> + # include " winget / ManifestValidation . h " <nl> <nl> namespace AppInstaller : : Manifest <nl> { <nl> similarity index 93 % <nl> rename from src / AppInstallerRepositoryCore / Manifest / ManifestInstaller . cpp <nl> rename to src / AppInstallerCommonCore / Manifest / ManifestInstaller . cpp <nl> mmm a / src / AppInstallerRepositoryCore / Manifest / ManifestInstaller . cpp <nl> ppp b / src / AppInstallerCommonCore / Manifest / ManifestInstaller . cpp <nl> <nl> / / Copyright ( c ) Microsoft Corporation . <nl> / / Licensed under the MIT License . <nl> - <nl> # include " pch . h " <nl> - # include " ManifestInstaller . h " <nl> + # include " winget / ManifestInstaller . h " <nl> <nl> namespace AppInstaller : : Manifest <nl> { <nl> namespace AppInstaller : : Manifest <nl> case ManifestInstaller : : InstallerTypeEnum : : MSStore : <nl> result = " MSStore " ; <nl> break ; <nl> + default : <nl> + break ; <nl> } <nl> <nl> return result ; <nl> similarity index 96 % <nl> rename from src / AppInstallerRepositoryCore / Manifest / ManifestValidation . cpp <nl> rename to src / AppInstallerCommonCore / Manifest / ManifestValidation . cpp <nl> mmm a / src / AppInstallerRepositoryCore / Manifest / ManifestValidation . cpp <nl> ppp b / src / AppInstallerCommonCore / Manifest / ManifestValidation . cpp <nl> <nl> / / Copyright ( c ) Microsoft Corporation . <nl> / / Licensed under the MIT License . <nl> # include " pch . h " <nl> - # include " ManifestValidation . h " <nl> + # include " winget / ManifestValidation . h " <nl> <nl> namespace AppInstaller : : Manifest <nl> { <nl> similarity index 96 % <nl> rename from src / AppInstallerRepositoryCore / Manifest / YamlParser . cpp <nl> rename to src / AppInstallerCommonCore / Manifest / YamlParser . cpp <nl> mmm a / src / AppInstallerRepositoryCore / Manifest / YamlParser . cpp <nl> ppp b / src / AppInstallerCommonCore / Manifest / YamlParser . cpp <nl> <nl> / / Copyright ( c ) Microsoft Corporation . <nl> / / Licensed under the MIT License . <nl> # include " pch . h " <nl> - # include " YamlParser . h " <nl> + # include " AppInstallerSHA256 . h " <nl> + # include " winget / Yaml . h " <nl> + # include " winget / ManifestYamlParser . h " <nl> <nl> namespace AppInstaller : : Manifest <nl> { <nl> namespace AppInstaller : : Manifest <nl> { <nl> RootFieldInfos = <nl> { <nl> - { " ManifestVersion " , PreviewManifestVersion , [ this ] ( const YAML : : Node & ) { / * ManifestVersion already processed * / } , false , <nl> + { " ManifestVersion " , PreviewManifestVersion , [ ] ( const YAML : : Node & ) { / * ManifestVersion already processed * / } , false , <nl> / / Regex here is to prevent leading 0s in the version , this also keeps consistent with other versions in the manifest <nl> " ^ ( 0 | [ 1 - 9 ] [ 0 - 9 ] { 0 , 3 } | [ 1 - 5 ] [ 0 - 9 ] { 4 } | 6 [ 0 - 4 ] [ 0 - 9 ] { 3 } | 65 [ 0 - 4 ] [ 0 - 9 ] { 2 } | 655 [ 0 - 2 ] [ 0 - 9 ] | 6553 [ 0 - 5 ] ) ( \ \ . ( 0 | [ 1 - 9 ] [ 0 - 9 ] { 0 , 3 } | [ 1 - 5 ] [ 0 - 9 ] { 4 } | 6 [ 0 - 4 ] [ 0 - 9 ] { 3 } | 65 [ 0 - 4 ] [ 0 - 9 ] { 2 } | 655 [ 0 - 2 ] [ 0 - 9 ] | 6553 [ 0 - 5 ] ) ) { 2 } $ " } , <nl> { " Id " , PreviewManifestVersion , [ this ] ( const YAML : : Node & value ) { m_p_manifest - > Id = value . as < std : : string > ( ) ; Utility : : Trim ( m_p_manifest - > Id ) ; } , true , " ^ [ \ \ S ] + \ \ . [ \ \ S ] + $ " } , <nl> namespace AppInstaller : : Manifest <nl> <nl> if ( fieldIter ! = fieldInfos . end ( ) ) <nl> { <nl> - ManifestFieldInfo fieldInfo = * fieldIter ; <nl> + const ManifestFieldInfo & fieldInfo = * fieldIter ; <nl> <nl> / / Make sure the found key is in Pascal Case <nl> if ( key ! = fieldInfo . Name ) <nl> namespace AppInstaller : : Manifest <nl> { ManifestInstaller : : InstallerSwitchType : : Log , ManifestInstaller : : string_t ( " / LOG = \ " " + std : : string ( ARG_TOKEN_LOGPATH ) + " \ " " ) } , <nl> { ManifestInstaller : : InstallerSwitchType : : InstallLocation , ManifestInstaller : : string_t ( " / DIR = \ " " + std : : string ( ARG_TOKEN_INSTALLPATH ) + " \ " " ) } <nl> } ; <nl> + default : <nl> + return { } ; <nl> } <nl> - return { } ; <nl> } <nl> } <nl> \ No newline at end of file <nl> mmm a / src / AppInstallerCommonCore / Public / AppInstallerErrors . h <nl> ppp b / src / AppInstallerCommonCore / Public / AppInstallerErrors . h <nl> <nl> / / Licensed under the MIT License . <nl> # pragma once <nl> # include < wil / result_macros . h > <nl> + <nl> + # ifndef WINGET_DISABLE_FOR_FUZZING <nl> # include < winrt / base . h > <nl> + # endif <nl> <nl> # include < exception > <nl> # include < string > <nl> namespace AppInstaller <nl> { <nl> / / Gets error messages that are presentable to the user . <nl> std : : string GetUserPresentableMessage ( const wil : : ResultException & re ) ; <nl> - std : : string GetUserPresentableMessage ( const winrt : : hresult_error & hre ) ; <nl> std : : string GetUserPresentableMessage ( const std : : exception & e ) ; <nl> + <nl> + # ifndef WINGET_DISABLE_FOR_FUZZING <nl> + std : : string GetUserPresentableMessage ( const winrt : : hresult_error & hre ) ; <nl> + # endif <nl> } <nl> mmm a / src / AppInstallerCommonCore / Public / AppInstallerLogging . h <nl> ppp b / src / AppInstallerCommonCore / Public / AppInstallerLogging . h <nl> <nl> <nl> # define AICLI_LOG ( _channel_ , _level_ , _outstream_ ) \ <nl> do { \ <nl> - auto _aicli_log_channel = AppInstaller : : Logging : : Channel : : # # _channel_ ; \ <nl> - auto _aicli_log_level = AppInstaller : : Logging : : Level : : # # _level_ ; \ <nl> + auto _aicli_log_channel = AppInstaller : : Logging : : Channel : : _channel_ ; \ <nl> + auto _aicli_log_level = AppInstaller : : Logging : : Level : : _level_ ; \ <nl> auto & _aicli_log_log = AppInstaller : : Logging : : Log ( ) ; \ <nl> if ( _aicli_log_log . IsEnabled ( _aicli_log_channel , _aicli_log_level ) ) \ <nl> { \ <nl> namespace AppInstaller : : Logging <nl> } ; <nl> <nl> / / Gets the channel ' s name as a string . <nl> - char const * const GetChannelName ( Channel channel ) ; <nl> + char const * GetChannelName ( Channel channel ) ; <nl> <nl> / / Gets the maximum channel name length in characters . <nl> size_t GetMaxChannelNameLength ( ) ; <nl> similarity index 92 % <nl> rename from src / AppInstallerRepositoryCore / Manifest / Manifest . h <nl> rename to src / AppInstallerCommonCore / Public / winget / Manifest . h <nl> mmm a / src / AppInstallerRepositoryCore / Manifest / Manifest . h <nl> ppp b / src / AppInstallerCommonCore / Public / winget / Manifest . h <nl> <nl> / / Copyright ( c ) Microsoft Corporation . <nl> / / Licensed under the MIT License . <nl> # pragma once <nl> - # include " ManifestInstaller . h " <nl> - # include " ManifestLocalization . h " <nl> # include < AppInstallerStrings . h > <nl> # include < AppInstallerVersions . h > <nl> + # include < winget / ManifestInstaller . h > <nl> + # include < winget / ManifestLocalization . h > <nl> + <nl> # include < vector > <nl> <nl> namespace AppInstaller : : Manifest <nl> similarity index 96 % <nl> rename from src / AppInstallerRepositoryCore / Manifest / ManifestInstaller . h <nl> rename to src / AppInstallerCommonCore / Public / winget / ManifestInstaller . h <nl> mmm a / src / AppInstallerRepositoryCore / Manifest / ManifestInstaller . h <nl> ppp b / src / AppInstallerCommonCore / Public / winget / ManifestInstaller . h <nl> <nl> # include < AppInstallerArchitecture . h > <nl> # include < AppInstallerStrings . h > <nl> <nl> - # include < string > <nl> # include < map > <nl> + # include < string > <nl> <nl> namespace AppInstaller : : Manifest <nl> { <nl> similarity index 100 % <nl> rename from src / AppInstallerRepositoryCore / Manifest / ManifestLocalization . h <nl> rename to src / AppInstallerCommonCore / Public / winget / ManifestLocalization . h <nl> similarity index 94 % <nl> rename from src / AppInstallerRepositoryCore / Manifest / ManifestValidation . h <nl> rename to src / AppInstallerCommonCore / Public / winget / ManifestValidation . h <nl> mmm a / src / AppInstallerRepositoryCore / Manifest / ManifestValidation . h <nl> ppp b / src / AppInstallerCommonCore / Public / winget / ManifestValidation . h <nl> <nl> / / Copyright ( c ) Microsoft Corporation . <nl> / / Licensed under the MIT License . <nl> # pragma once <nl> + # include < AppInstallerErrors . h > <nl> + # include < winget / Manifest . h > <nl> <nl> - # include < string > <nl> - # include < functional > <nl> # include < wil / result . h > <nl> - # include < AppInstallerErrors . h > <nl> - # include " Manifest . h " <nl> + <nl> + # include < functional > <nl> + # include < string > <nl> <nl> namespace YAML { class Node ; } <nl> <nl> namespace AppInstaller : : Manifest <nl> struct ManifestException : public wil : : ResultException <nl> { <nl> ManifestException ( std : : vector < ValidationError > & & errors = { } , HRESULT hr = APPINSTALLER_CLI_ERROR_MANIFEST_FAILED ) : <nl> - m_errors ( std : : move ( errors ) ) , wil : : ResultException ( hr ) <nl> + wil : : ResultException ( hr ) , m_errors ( std : : move ( errors ) ) <nl> { <nl> auto p = [ & ] ( ValidationError const & e ) { <nl> return e . ErrorLevel = = ValidationError : : Level : : Error ; <nl> namespace AppInstaller : : Manifest <nl> return m_whatMessage . c_str ( ) ; <nl> } <nl> <nl> + const std : : vector < ValidationError > & Errors ( ) const { return m_errors ; } <nl> + <nl> private : <nl> std : : vector < ValidationError > m_errors ; <nl> mutable std : : string m_whatMessage ; <nl> similarity index 96 % <nl> rename from src / AppInstallerRepositoryCore / Manifest / YamlParser . h <nl> rename to src / AppInstallerCommonCore / Public / winget / ManifestYamlParser . h <nl> mmm a / src / AppInstallerRepositoryCore / Manifest / YamlParser . h <nl> ppp b / src / AppInstallerCommonCore / Public / winget / ManifestYamlParser . h <nl> <nl> / / Copyright ( c ) Microsoft Corporation . <nl> / / Licensed under the MIT License . <nl> # pragma once <nl> - # include " ManifestValidation . h " <nl> - # include " Manifest . h " <nl> + # include < winget / ManifestValidation . h > <nl> + # include < winget / Manifest . h > <nl> <nl> # include < filesystem > <nl> <nl> mmm a / src / AppInstallerCommonCore / Public / winget / UserSettings . h <nl> ppp b / src / AppInstallerCommonCore / Public / winget / UserSettings . h <nl> <nl> # include " AppInstallerStrings . h " <nl> <nl> # include < filesystem > <nl> - # include < vector > <nl> + # include < map > <nl> + # include < optional > <nl> # include < string > <nl> # include < variant > <nl> + # include < vector > <nl> <nl> namespace AppInstaller : : Settings <nl> { <nl> namespace AppInstaller : : Settings <nl> <nl> / / Used to deduce the SettingVariant type ; making a variant that includes std : : monostate and all SettingMapping types . <nl> template < size_t . . . I > <nl> - inline auto Deduce ( std : : index_sequence < I . . . > ) { return std : : variant < std : : monostate , SettingMapping < static_cast < Setting > ( I ) > : : value_t . . . > { } ; } <nl> + inline auto Deduce ( std : : index_sequence < I . . . > ) { return std : : variant < std : : monostate , typename SettingMapping < static_cast < Setting > ( I ) > : : value_t . . . > { } ; } <nl> <nl> / / Holds data of any type listed in a SettingMapping . <nl> using SettingVariant = decltype ( Deduce ( std : : make_index_sequence < static_cast < size_t > ( Setting : : Max ) > ( ) ) ) ; <nl> mmm a / src / AppInstallerCommonCore / Public / winget / Yaml . h <nl> ppp b / src / AppInstallerCommonCore / Public / winget / Yaml . h <nl> namespace AppInstaller : : YAML <nl> T as ( ) const <nl> { <nl> Require ( Type : : Scalar ) ; <nl> - return as_dispatch ( reinterpret_cast < T * > ( nullptr ) ) ; <nl> + T * t = nullptr ; <nl> + return as_dispatch ( t ) ; <nl> } <nl> <nl> bool operator < ( const Node & other ) const ; <nl> mmm a / src / AppInstallerCommonCore / Runtime . cpp <nl> ppp b / src / AppInstallerCommonCore / Runtime . cpp <nl> namespace AppInstaller : : Runtime <nl> constexpr std : : string_view s_AppDataDir_State = " State " sv ; <nl> constexpr std : : string_view s_SecureSettings_Base = " Microsoft / WinGet " sv ; <nl> constexpr std : : string_view s_SecureSettings_UserRelative = " settings " sv ; <nl> - constexpr std : : string_view s_SecureSettings_Relative_Packaged = " pkg " sv ; <nl> constexpr std : : string_view s_SecureSettings_Relative_Unpackaged = " win " sv ; <nl> + # ifndef WINGET_DISABLE_FOR_FUZZING <nl> + constexpr std : : string_view s_SecureSettings_Relative_Packaged = " pkg " sv ; <nl> + # endif <nl> <nl> / / Gets a boolean indicating whether the current process has identity . <nl> bool DoesCurrentProcessHaveIdentity ( ) <nl> namespace AppInstaller : : Runtime <nl> } <nl> } <nl> <nl> + # ifndef WINGET_DISABLE_FOR_FUZZING <nl> LocIndString GetOSVersion ( ) <nl> { <nl> winrt : : Windows : : System : : Profile : : AnalyticsInfo analyticsInfo { } ; <nl> namespace AppInstaller : : Runtime <nl> <nl> return LocIndString { strstr . str ( ) } ; <nl> } <nl> + # endif <nl> <nl> std : : filesystem : : path GetPathTo ( PathName path ) <nl> { <nl> std : : filesystem : : path result ; <nl> bool create = true ; <nl> <nl> + # ifndef WINGET_DISABLE_FOR_FUZZING <nl> if ( IsRunningInPackagedContext ( ) ) <nl> { <nl> auto appStorage = winrt : : Windows : : Storage : : ApplicationData : : Current ( ) ; <nl> namespace AppInstaller : : Runtime <nl> } <nl> } <nl> else <nl> + # endif <nl> { <nl> switch ( path ) <nl> { <nl> mmm a / src / AppInstallerCommonCore / Settings . cpp <nl> ppp b / src / AppInstallerCommonCore / Settings . cpp <nl> namespace AppInstaller : : Settings <nl> virtual std : : filesystem : : path PathTo ( const std : : filesystem : : path & name ) = 0 ; <nl> } ; <nl> <nl> + # ifndef WINGET_DISABLE_FOR_FUZZING <nl> / / A settings container backed by the ApplicationDataContainer functionality . <nl> struct ApplicationDataSettingsContainer : public ISettingsContainer <nl> { <nl> namespace AppInstaller : : Settings <nl> private : <nl> Container m_root ; <nl> } ; <nl> + # endif <nl> <nl> / / A settings container backed by the filesystem . <nl> struct FileSettingsContainer : public ISettingsContainer <nl> namespace AppInstaller : : Settings <nl> return std : : make_unique < SecureSettingsContainer > ( GetSettingsContainer ( Type : : Standard ) ) ; <nl> } <nl> <nl> + # ifndef WINGET_DISABLE_FOR_FUZZING <nl> if ( IsRunningInPackagedContext ( ) ) <nl> { <nl> switch ( type ) <nl> namespace AppInstaller : : Settings <nl> } <nl> } <nl> else <nl> + # endif <nl> { <nl> switch ( type ) <nl> { <nl> mmm a / src / AppInstallerCommonCore / UserSettings . cpp <nl> ppp b / src / AppInstallerCommonCore / UserSettings . cpp <nl> namespace AppInstaller : : Settings <nl> Json : : Value result = jsonPath . resolve ( root ) ; <nl> if ( ! result . isNull ( ) ) <nl> { <nl> - auto jsonValue = GetValue < details : : SettingMapping < S > : : json_t > ( result ) ; <nl> + auto jsonValue = GetValue < typename details : : SettingMapping < S > : : json_t > ( result ) ; <nl> <nl> if ( jsonValue . has_value ( ) ) <nl> { <nl> namespace AppInstaller : : Settings <nl> std : : vector < std : : string > & warnings , <nl> std : : index_sequence < S . . . > ) <nl> { <nl> + # ifdef WINGET_DISABLE_FOR_FUZZING <nl> + # pragma clang diagnostic push <nl> + # pragma clang diagnostic ignored " - Wunused - value " <nl> + # endif <nl> / / Use folding to call each setting validate function . <nl> ( FoldHelper { } , . . . , Validate < static_cast < Setting > ( S ) > ( root , settings , warnings ) ) ; <nl> + # ifdef WINGET_DISABLE_FOR_FUZZING <nl> + # pragma clang diagnostic pop <nl> + # endif <nl> } <nl> } <nl> <nl> mmm a / src / AppInstallerCommonCore / Versions . cpp <nl> ppp b / src / AppInstallerCommonCore / Versions . cpp <nl> namespace AppInstaller : : Utility <nl> <nl> Version : : Part : : Part ( const std : : string & part ) <nl> { <nl> - size_t end = 0 ; <nl> - try <nl> + const char * begin = part . c_str ( ) ; <nl> + char * end = nullptr ; <nl> + errno = 0 ; <nl> + Integer = strtoull ( begin , & end , 10 ) ; <nl> + <nl> + if ( errno = = ERANGE ) <nl> { <nl> - Integer = std : : stoull ( part , & end ) ; <nl> + Integer = 0 ; <nl> + Other = part ; <nl> } <nl> - CATCH_LOG ( ) ; <nl> - if ( end ! = part . length ( ) ) <nl> + else if ( static_cast < size_t > ( end - begin ) ! = part . length ( ) ) <nl> { <nl> - Other = part . substr ( end ) ; <nl> + Other = end ; <nl> } <nl> } <nl> <nl> mmm a / src / AppInstallerCommonCore / packages . config <nl> ppp b / src / AppInstallerCommonCore / packages . config <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < packages > <nl> - < package id = " Microsoft . Windows . CppWinRT " version = " 2 . 0 . 191111 . 2 " targetFramework = " native " / > <nl> - < package id = " Microsoft . Windows . ImplementationLibrary " version = " 1 . 0 . 191107 . 2 " targetFramework = " native " / > <nl> + < package id = " Microsoft . Windows . CppWinRT " version = " 2 . 0 . 200729 . 8 " targetFramework = " native " / > <nl> + < package id = " Microsoft . Windows . ImplementationLibrary " version = " 1 . 0 . 200519 . 2 " targetFramework = " native " / > <nl> < / packages > <nl> \ No newline at end of file <nl> mmm a / src / AppInstallerCommonCore / pch . h <nl> ppp b / src / AppInstallerCommonCore / pch . h <nl> <nl> # include < limits > <nl> # include < memory > <nl> # include < ostream > <nl> + # include < regex > <nl> + # include < set > <nl> # include < string > <nl> # include < sstream > <nl> # include < stack > <nl> <nl> # include < type_traits > <nl> # include < vector > <nl> <nl> - / / wil / cppwinrt . h should always be included before any C + + / WinRT or WIL header file when both are in use <nl> - # include < wil / cppwinrt . h > <nl> # include < wil / result_macros . h > <nl> # include < wil / safecast . h > <nl> # include < wil / resource . h > <nl> # include < wil / token_helpers . h > <nl> <nl> + # ifndef WINGET_DISABLE_FOR_FUZZING <nl> + # include < wil / cppwinrt . h > <nl> + <nl> # include < winrt / Windows . ApplicationModel . h > <nl> # include < winrt / Windows . ApplicationModel . AppExtensions . h > <nl> # include < winrt / Windows . Foundation . h > <nl> <nl> # include < winrt / Windows . Web . Http . h > <nl> # include < winrt / Windows . Web . Http . Headers . h > <nl> # include < winrt / Windows . Web . Http . Filters . h > <nl> + # endif <nl> <nl> # include < wrl / client . h > <nl> <nl> mmm a / src / AppInstallerRepositoryCore / AppInstallerRepositoryCore . vcxproj <nl> ppp b / src / AppInstallerRepositoryCore / AppInstallerRepositoryCore . vcxproj <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < Project DefaultTargets = " Build " ToolsVersion = " 15 . 0 " xmlns = " http : / / schemas . microsoft . com / developer / msbuild / 2003 " > <nl> - < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " / > <nl> < PropertyGroup Label = " Globals " > <nl> < CppWinRTOptimized > true < / CppWinRTOptimized > <nl> < CppWinRTRootNamespaceAutoMerge > true < / CppWinRTRootNamespaceAutoMerge > <nl> <nl> < ItemGroup > <nl> < ClInclude Include = " AggregatedSource . h " / > <nl> < ClInclude Include = " ICU \ SQLiteICU . h " / > <nl> - < ClInclude Include = " Manifest \ Manifest . h " / > <nl> - < ClInclude Include = " Manifest \ ManifestInstaller . h " / > <nl> - < ClInclude Include = " Manifest \ ManifestLocalization . h " / > <nl> - < ClInclude Include = " Manifest \ YamlParser . h " / > <nl> - < ClInclude Include = " Manifest \ ManifestValidation . h " / > <nl> < ClInclude Include = " Microsoft \ PreIndexedPackageSourceFactory . h " / > <nl> < ClInclude Include = " Microsoft \ Schema \ 1_0 \ ChannelTable . h " / > <nl> < ClInclude Include = " Microsoft \ Schema \ 1_0 \ CommandsTable . h " / > <nl> <nl> < PrecompiledHeader Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | x64 ' " > NotUsing < / PrecompiledHeader > <nl> < PrecompiledHeader Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | x64 ' " > NotUsing < / PrecompiledHeader > <nl> < / ClCompile > <nl> - < ClCompile Include = " Manifest \ Manifest . cpp " / > <nl> - < ClCompile Include = " Manifest \ ManifestInstaller . cpp " / > <nl> - < ClCompile Include = " Manifest \ YamlParser . cpp " / > <nl> - < ClCompile Include = " Manifest \ ManifestValidation . cpp " / > <nl> < ClCompile Include = " Microsoft \ PreIndexedPackageSourceFactory . cpp " / > <nl> < ClCompile Include = " Microsoft \ Schema \ 1_0 \ Interface . cpp " / > <nl> < ClCompile Include = " Microsoft \ Schema \ 1_0 \ ManifestTable . cpp " / > <nl> <nl> < / ItemGroup > <nl> < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . targets " / > <nl> < ImportGroup Label = " ExtensionTargets " > <nl> - < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " / > <nl> - < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " / > <nl> < / ImportGroup > <nl> < Target Name = " EnsureNuGetPackageBuildImports " BeforeTargets = " PrepareForBuild " > <nl> < PropertyGroup > <nl> < ErrorText > This project references NuGet package ( s ) that are missing on this computer . Use NuGet Package Restore to download them . For more information , see http : / / go . microsoft . com / fwlink / ? LinkID = 322105 . The missing file is { 0 } . < / ErrorText > <nl> < / PropertyGroup > <nl> - < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) ) " / > <nl> - < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) ) " / > <nl> - < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) ) " / > <nl> < / Target > <nl> < / Project > <nl> \ No newline at end of file <nl> mmm a / src / AppInstallerRepositoryCore / AppInstallerRepositoryCore . vcxproj . filters <nl> ppp b / src / AppInstallerRepositoryCore / AppInstallerRepositoryCore . vcxproj . filters <nl> <nl> < Filter Include = " Microsoft \ Schema \ 1_0 " > <nl> < UniqueIdentifier > { cff561cd - 211b - 4cab - 87f5 - 39359eef1e8d } < / UniqueIdentifier > <nl> < / Filter > <nl> - < Filter Include = " Manifest " > <nl> - < UniqueIdentifier > { 052eaac1 - ec6e - 4879 - 8388 - aff5a30401f0 } < / UniqueIdentifier > <nl> - < / Filter > <nl> < Filter Include = " Public " > <nl> < UniqueIdentifier > { 69ce2e35 - fe7f - 41af - bd47 - 91a70131d167 } < / UniqueIdentifier > <nl> < / Filter > <nl> <nl> < ClInclude Include = " Microsoft \ Schema \ 1_0 \ Interface . h " > <nl> < Filter > Microsoft \ Schema \ 1_0 < / Filter > <nl> < / ClInclude > <nl> - < ClInclude Include = " Manifest \ Manifest . h " > <nl> - < Filter > Manifest < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " Manifest \ ManifestInstaller . h " > <nl> - < Filter > Manifest < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " Manifest \ ManifestLocalization . h " > <nl> - < Filter > Manifest < / Filter > <nl> - < / ClInclude > <nl> < ClInclude Include = " Microsoft \ Schema \ 1_0 \ OneToOneTable . h " > <nl> < Filter > Microsoft \ Schema \ 1_0 < / Filter > <nl> < / ClInclude > <nl> <nl> < ClInclude Include = " ICU \ SQLiteICU . h " > <nl> < Filter > ICU < / Filter > <nl> < / ClInclude > <nl> - < ClInclude Include = " Manifest \ ManifestValidation . h " > <nl> - < Filter > Manifest < / Filter > <nl> - < / ClInclude > <nl> - < ClInclude Include = " Manifest \ YamlParser . h " > <nl> - < Filter > Header Files < / Filter > <nl> - < / ClInclude > <nl> < ClInclude Include = " AggregatedSource . h " > <nl> < Filter > Header Files < / Filter > <nl> < / ClInclude > <nl> <nl> < ClCompile Include = " Microsoft \ Schema \ 1_0 \ Interface . cpp " > <nl> < Filter > Microsoft \ Schema \ 1_0 < / Filter > <nl> < / ClCompile > <nl> - < ClCompile Include = " Manifest \ Manifest . cpp " > <nl> - < Filter > Manifest < / Filter > <nl> - < / ClCompile > <nl> - < ClCompile Include = " Manifest \ ManifestInstaller . cpp " > <nl> - < Filter > Manifest < / Filter > <nl> - < / ClCompile > <nl> < ClCompile Include = " Microsoft \ Schema \ 1_0 \ OneToOneTable . cpp " > <nl> < Filter > Microsoft \ Schema \ 1_0 < / Filter > <nl> < / ClCompile > <nl> <nl> < ClCompile Include = " ICU \ SQLiteICU . c " > <nl> < Filter > ICU < / Filter > <nl> < / ClCompile > <nl> - < ClCompile Include = " Manifest \ ManifestValidation . cpp " > <nl> - < Filter > Manifest < / Filter > <nl> - < / ClCompile > <nl> - < ClCompile Include = " Manifest \ YamlParser . cpp " > <nl> - < Filter > Source Files < / Filter > <nl> - < / ClCompile > <nl> < ClCompile Include = " AggregatedSource . cpp " > <nl> < Filter > Source Files < / Filter > <nl> < / ClCompile > <nl> mmm a / src / AppInstallerRepositoryCore / Microsoft / SQLiteIndex . cpp <nl> ppp b / src / AppInstallerRepositoryCore / Microsoft / SQLiteIndex . cpp <nl> <nl> # include " pch . h " <nl> # include " SQLiteIndex . h " <nl> # include " Schema / MetadataTable . h " <nl> - # include " Manifest / YamlParser . h " <nl> + # include < winget / ManifestYamlParser . h > <nl> <nl> namespace AppInstaller : : Repository : : Microsoft <nl> { <nl> mmm a / src / AppInstallerRepositoryCore / Microsoft / SQLiteIndex . h <nl> ppp b / src / AppInstallerRepositoryCore / Microsoft / SQLiteIndex . h <nl> <nl> / / Licensed under the MIT License . <nl> # pragma once <nl> # include " SQLiteWrapper . h " <nl> - # include " Manifest / Manifest . h " <nl> # include " Microsoft / Schema / ISQLiteIndex . h " <nl> # include " Microsoft / Schema / Version . h " <nl> # include " Public / AppInstallerRepositorySearch . h " <nl> # include < AppInstallerLanguageUtilities . h > <nl> # include < AppInstallerVersions . h > <nl> + # include < winget / Manifest . h > <nl> <nl> # include < chrono > <nl> # include < filesystem > <nl> mmm a / src / AppInstallerRepositoryCore / Microsoft / SQLiteIndexSource . cpp <nl> ppp b / src / AppInstallerRepositoryCore / Microsoft / SQLiteIndexSource . cpp <nl> <nl> # include " pch . h " <nl> # include " Microsoft / SQLiteIndexSource . h " <nl> # include " Microsoft / PreIndexedPackageSourceFactory . h " <nl> - # include " Manifest / YamlParser . h " <nl> + # include < winget / ManifestYamlParser . h > <nl> <nl> <nl> namespace AppInstaller : : Repository : : Microsoft <nl> mmm a / src / AppInstallerRepositoryCore / Microsoft / Schema / ISQLiteIndex . h <nl> ppp b / src / AppInstallerRepositoryCore / Microsoft / Schema / ISQLiteIndex . h <nl> <nl> / / Licensed under the MIT License . <nl> # pragma once <nl> # include " SQLiteWrapper . h " <nl> - # include " Manifest / Manifest . h " <nl> # include " Microsoft / Schema / Version . h " <nl> # include " Public / AppInstallerRepositorySearch . h " <nl> # include < AppInstallerVersions . h > <nl> + # include < winget / Manifest . h > <nl> <nl> # include < filesystem > <nl> <nl> mmm a / src / AppInstallerRepositoryCore / Public / AppInstallerRepositorySearch . h <nl> ppp b / src / AppInstallerRepositoryCore / Public / AppInstallerRepositorySearch . h <nl> <nl> / / Copyright ( c ) Microsoft Corporation . <nl> / / Licensed under the MIT License . <nl> # pragma once <nl> - # include < Manifest / Manifest . h > <nl> # include < AppInstallerStrings . h > <nl> # include < AppInstallerVersions . h > <nl> # include < winget / LocIndependent . h > <nl> + # include < winget / Manifest . h > <nl> <nl> # include < memory > <nl> # include < optional > <nl> mmm a / src / AppInstallerRepositoryCore / packages . config <nl> ppp b / src / AppInstallerRepositoryCore / packages . config <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < packages > <nl> - < package id = " Microsoft . Windows . CppWinRT " version = " 2 . 0 . 191111 . 2 " targetFramework = " native " / > <nl> - < package id = " Microsoft . Windows . ImplementationLibrary " version = " 1 . 0 . 191107 . 2 " targetFramework = " native " / > <nl> + < package id = " Microsoft . Windows . CppWinRT " version = " 2 . 0 . 200729 . 8 " targetFramework = " native " / > <nl> + < package id = " Microsoft . Windows . ImplementationLibrary " version = " 1 . 0 . 200519 . 2 " targetFramework = " native " / > <nl> < / packages > <nl> \ No newline at end of file <nl> mmm a / src / AppInstallerRepositoryCore / pch . h <nl> ppp b / src / AppInstallerRepositoryCore / pch . h <nl> <nl> # include < initializer_list > <nl> # include < iomanip > <nl> # include < optional > <nl> - # include < regex > <nl> - # include < set > <nl> # include < string > <nl> # include < string_view > <nl> # include < sstream > <nl> mmm a / src / WinGetUtil / Exports . cpp <nl> ppp b / src / WinGetUtil / Exports . cpp <nl> <nl> # include < AppInstallerLogging . h > <nl> # include < AppInstallerStrings . h > <nl> # include < AppInstallerTelemetry . h > <nl> - # include < Manifest / YamlParser . h > <nl> # include < Microsoft / SQLiteIndex . h > <nl> + # include < winget / ManifestYamlParser . h > <nl> <nl> using namespace AppInstaller : : Utility ; <nl> using namespace AppInstaller : : Manifest ; <nl> mmm a / src / WinGetUtil / WinGetUtil . vcxproj <nl> ppp b / src / WinGetUtil / WinGetUtil . vcxproj <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < Project DefaultTargets = " Build " ToolsVersion = " 15 . 0 " xmlns = " http : / / schemas . microsoft . com / developer / msbuild / 2003 " > <nl> - < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " / > <nl> < PropertyGroup Label = " Globals " > <nl> < CppWinRTOptimized > true < / CppWinRTOptimized > <nl> < CppWinRTRootNamespaceAutoMerge > true < / CppWinRTRootNamespaceAutoMerge > <nl> <nl> < / ItemGroup > <nl> < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . targets " / > <nl> < ImportGroup Label = " ExtensionTargets " > <nl> - < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " / > <nl> - < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " / > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " / > <nl> < / ImportGroup > <nl> < Target Name = " EnsureNuGetPackageBuildImports " BeforeTargets = " PrepareForBuild " > <nl> < PropertyGroup > <nl> < ErrorText > This project references NuGet package ( s ) that are missing on this computer . Use NuGet Package Restore to download them . For more information , see http : / / go . microsoft . com / fwlink / ? LinkID = 322105 . The missing file is { 0 } . < / ErrorText > <nl> < / PropertyGroup > <nl> - < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) ) " / > <nl> - < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 191111 . 2 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) ) " / > <nl> - < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 191107 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . props ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . CppWinRT . 2 . 0 . 200729 . 8 \ build \ native \ Microsoft . Windows . CppWinRT . targets ' ) ) " / > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) ) " / > <nl> < / Target > <nl> < / Project > <nl> \ No newline at end of file <nl> mmm a / src / WinGetUtil / packages . config <nl> ppp b / src / WinGetUtil / packages . config <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < packages > <nl> - < package id = " Microsoft . Windows . CppWinRT " version = " 2 . 0 . 191111 . 2 " targetFramework = " native " / > <nl> - < package id = " Microsoft . Windows . ImplementationLibrary " version = " 1 . 0 . 191107 . 2 " targetFramework = " native " / > <nl> + < package id = " Microsoft . Windows . CppWinRT " version = " 2 . 0 . 200729 . 8 " targetFramework = " native " / > <nl> + < package id = " Microsoft . Windows . ImplementationLibrary " version = " 1 . 0 . 200519 . 2 " targetFramework = " native " / > <nl> < / packages > <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 00000000 . . 98074f9c <nl> mmm / dev / null <nl> ppp b / src / WinGetYamlFuzzing / README . md <nl> <nl> + # WinGetYamlFuzzing <nl> + The goal of this project is to create a [ libFuzzer ] ( http : / / llvm . org / docs / LibFuzzer . html ) based fuzzer for our YAML manifest loading . <nl> + <nl> + # # Issues <nl> + Currently the fuzzer crashes when exceptions are thrown ( built using the VS clang 10 package ) . This is suspected to be caused by the issue mentioned [ here ] ( https : / / github . com / google / oss - fuzz / issues / 2328 ) , <nl> + which while fixed , was also regressed . While investigation continues , the fuzzer is of little value . <nl> + <nl> + # # Running <nl> + A script will be added when the issues are resolved and the fuzzer functions . In order to run it I have been doing the following : <nl> + 1 . Copy the CLITests TestData YAML files to a new corpus directory . <nl> + 2 . Run the following command : ` WinGetYamlFuzzing . exe - dict = < full path to dictionary . txt in project > < path to corpus directory > ` <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 00000000 . . 18983533 <nl> mmm / dev / null <nl> ppp b / src / WinGetYamlFuzzing / WinGetYamlFuzzing . cpp <nl> <nl> + / / Copyright ( c ) Microsoft Corporation . <nl> + / / Licensed under the MIT License . <nl> + # include < cstdint > <nl> + # include < string > <nl> + # include < winget / ManifestYamlParser . h > <nl> + <nl> + extern " C " int LLVMFuzzerTestOneInput ( const uint8_t * data , size_t size ) <nl> + { <nl> + std : : string input { reinterpret_cast < const char * > ( data ) , size } ; <nl> + <nl> + try <nl> + { <nl> + AppInstaller : : Manifest : : Manifest manifest = AppInstaller : : Manifest : : YamlParser : : Create ( input , true ) ; <nl> + } <nl> + catch ( . . . ) { } <nl> + <nl> + return 0 ; <nl> + } <nl> new file mode 100644 <nl> index 00000000 . . c7a2e474 <nl> mmm / dev / null <nl> ppp b / src / WinGetYamlFuzzing / WinGetYamlFuzzing . vcxproj <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> + < Project DefaultTargets = " Build " xmlns = " http : / / schemas . microsoft . com / developer / msbuild / 2003 " > <nl> + < ItemGroup Label = " ProjectConfigurations " > <nl> + < ProjectConfiguration Include = " Fuzzing | x64 " > <nl> + < Configuration > Fuzzing < / Configuration > <nl> + < Platform > x64 < / Platform > <nl> + < / ProjectConfiguration > <nl> + < / ItemGroup > <nl> + < PropertyGroup Label = " Globals " > <nl> + < VCProjectVersion > 16 . 0 < / VCProjectVersion > <nl> + < Keyword > Win32Proj < / Keyword > <nl> + < ProjectGuid > { 1622da16 - 914f - 4f57 - a259 - d5169003cc8c } < / ProjectGuid > <nl> + < RootNamespace > WinGetYamlFuzzing < / RootNamespace > <nl> + < WindowsTargetPlatformVersion > 10 . 0 < / WindowsTargetPlatformVersion > <nl> + < / PropertyGroup > <nl> + < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . Default . props " / > <nl> + < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | x64 ' " Label = " Configuration " > <nl> + < ConfigurationType > Application < / ConfigurationType > <nl> + < UseDebugLibraries > false < / UseDebugLibraries > <nl> + < PlatformToolset > ClangCL < / PlatformToolset > <nl> + < WholeProgramOptimization > false < / WholeProgramOptimization > <nl> + < CharacterSet > Unicode < / CharacterSet > <nl> + < / PropertyGroup > <nl> + < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . props " / > <nl> + < ImportGroup Label = " ExtensionSettings " > <nl> + < / ImportGroup > <nl> + < ImportGroup Label = " Shared " > <nl> + < / ImportGroup > <nl> + < ImportGroup Label = " PropertySheets " Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | x64 ' " > <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 ) ' = = ' Fuzzing | x64 ' " > <nl> + < LinkIncremental > false < / LinkIncremental > <nl> + < / PropertyGroup > <nl> + < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | x64 ' " > <nl> + < ClCompile > <nl> + < WarningLevel > Level3 < / WarningLevel > <nl> + < FunctionLevelLinking > true < / FunctionLevelLinking > <nl> + < IntrinsicFunctions > true < / IntrinsicFunctions > <nl> + < SDLCheck > true < / SDLCheck > <nl> + < PreprocessorDefinitions > NDEBUG ; _CONSOLE ; WINGET_DISABLE_FOR_FUZZING ; % ( PreprocessorDefinitions ) < / PreprocessorDefinitions > <nl> + < ConformanceMode > true < / ConformanceMode > <nl> + < LanguageStandard > stdcpp17 < / LanguageStandard > <nl> + < AdditionalIncludeDirectories > $ ( ProjectDir ) . . \ AppInstallerCommonCore \ Public ; % ( AdditionalIncludeDirectories ) < / AdditionalIncludeDirectories > <nl> + < RuntimeLibrary > MultiThreaded < / RuntimeLibrary > <nl> + < AdditionalOptions > - fsanitize = fuzzer , address % ( AdditionalOptions ) < / AdditionalOptions > <nl> + < / ClCompile > <nl> + < Link > <nl> + < SubSystem > Console < / SubSystem > <nl> + < EnableCOMDATFolding > true < / EnableCOMDATFolding > <nl> + < OptimizeReferences > true < / OptimizeReferences > <nl> + < GenerateDebugInformation > true < / GenerateDebugInformation > <nl> + < AdditionalDependencies > $ ( LLVMInstallDir ) \ lib \ clang \ 10 . 0 . 0 \ lib \ windows \ clang_rt . asan - preinit - x86_64 . lib ; $ ( LLVMInstallDir ) \ lib \ clang \ 10 . 0 . 0 \ lib \ windows \ clang_rt . asan - x86_64 . lib ; $ ( LLVMInstallDir ) \ lib \ clang \ 10 . 0 . 0 \ lib \ windows \ clang_rt . asan_cxx - x86_64 . lib ; $ ( LLVMInstallDir ) \ lib \ clang \ 10 . 0 . 0 \ lib \ windows \ clang_rt . fuzzer - x86_64 . lib ; icuuc . lib ; icuin . lib ; urlmon . lib ; Bcrypt . lib ; % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> + < / Link > <nl> + < / ItemDefinitionGroup > <nl> + < ItemGroup > <nl> + < ClCompile Include = " WinGetYamlFuzzing . cpp " / > <nl> + < / ItemGroup > <nl> + < ItemGroup > <nl> + < ProjectReference Include = " . . \ AppInstallerCommonCore \ AppInstallerCommonCore . vcxproj " > <nl> + < Project > { 5890d6ed - 7c3b - 40f3 - b436 - b54f640d9e65 } < / Project > <nl> + < / ProjectReference > <nl> + < ProjectReference Include = " . . \ YamlCppLib \ YamlCppLib . vcxproj " > <nl> + < Project > { 8bb94bb8 - 374f - 4294 - bca1 - c7811514a6b7 } < / Project > <nl> + < / ProjectReference > <nl> + < / ItemGroup > <nl> + < ItemGroup > <nl> + < None Include = " packages . config " / > <nl> + < None Include = " README . md " / > <nl> + < / ItemGroup > <nl> + < ItemGroup > <nl> + < Text Include = " dictionary . txt " / > <nl> + < / ItemGroup > <nl> + < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . targets " / > <nl> + < ImportGroup Label = " ExtensionTargets " > <nl> + < Import Project = " $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets " Condition = " Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " / > <nl> + < / ImportGroup > <nl> + < Target Name = " EnsureNuGetPackageBuildImports " BeforeTargets = " PrepareForBuild " > <nl> + < PropertyGroup > <nl> + < ErrorText > This project references NuGet package ( s ) that are missing on this computer . Use NuGet Package Restore to download them . For more information , see http : / / go . microsoft . com / fwlink / ? LinkID = 322105 . The missing file is { 0 } . < / ErrorText > <nl> + < / PropertyGroup > <nl> + < Error Condition = " ! Exists ( ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) " Text = " $ ( [ System . String ] : : Format ( ' $ ( ErrorText ) ' , ' $ ( SolutionDir ) \ packages \ Microsoft . Windows . ImplementationLibrary . 1 . 0 . 200519 . 2 \ build \ native \ Microsoft . Windows . ImplementationLibrary . targets ' ) ) " / > <nl> + < / Target > <nl> + < / Project > <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 00000000 . . 46b38fc0 <nl> mmm / dev / null <nl> ppp b / src / WinGetYamlFuzzing / WinGetYamlFuzzing . vcxproj . filters <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 ; c + + ; cppm ; ixx ; 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 ; h + + ; hm ; inl ; inc ; ipp ; xsd < / Extensions > <nl> + < / Filter > <nl> + < Filter Include = " Resource Files " > <nl> + < UniqueIdentifier > { 67DA6AB6 - F800 - 4c08 - 8B7A - 83BB121AAD01 } < / UniqueIdentifier > <nl> + < Extensions > rc ; ico ; cur ; bmp ; dlg ; rc2 ; rct ; bin ; rgs ; gif ; jpg ; jpeg ; jpe ; resx ; tiff ; tif ; png ; wav ; mfcribbon - ms < / Extensions > <nl> + < / Filter > <nl> + < / ItemGroup > <nl> + < ItemGroup > <nl> + < ClCompile Include = " WinGetYamlFuzzing . cpp " > <nl> + < Filter > Source Files < / Filter > <nl> + < / ClCompile > <nl> + < / ItemGroup > <nl> + < ItemGroup > <nl> + < None Include = " packages . config " / > <nl> + < None Include = " README . md " / > <nl> + < / ItemGroup > <nl> + < ItemGroup > <nl> + < Text Include = " dictionary . txt " / > <nl> + < / ItemGroup > <nl> + < / Project > <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 00000000 . . 2957aea3 <nl> mmm / dev / null <nl> ppp b / src / WinGetYamlFuzzing / dictionary . txt <nl> <nl> + " [ " <nl> + " ] " <nl> + " { " <nl> + " } " <nl> + " - " <nl> + " , " <nl> + " & " <nl> + " < < " <nl> + " : " <nl> + " | " <nl> + " ! ! " <nl> + " > " <nl> + " \ " " <nl> + " ' " <nl> + <nl> + integer = " 123 " <nl> + float = " 12 . 5 " <nl> + mantissa = " 1 . 3e + 9 " <nl> new file mode 100644 <nl> index 00000000 . . 14fb1216 <nl> mmm / dev / null <nl> ppp b / src / WinGetYamlFuzzing / packages . config <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> + < packages > <nl> + < package id = " Microsoft . Windows . ImplementationLibrary " version = " 1 . 0 . 200519 . 2 " targetFramework = " native " / > <nl> + < / packages > <nl> \ No newline at end of file <nl> mmm a / src / YamlCppLib / YamlCppLib . vcxproj <nl> ppp b / src / YamlCppLib / YamlCppLib . vcxproj <nl> <nl> < Keyword > Win32Proj < / Keyword > <nl> < WindowsSDKDesktopARMSupport > true < / WindowsSDKDesktopARMSupport > <nl> < WindowsSDKDesktopARM64Support > true < / WindowsSDKDesktopARM64Support > <nl> + < WindowsTargetPlatformVersion > 10 . 0 < / WindowsTargetPlatformVersion > <nl> < / PropertyGroup > <nl> < ItemGroup Label = " ProjectConfigurations " > <nl> < ProjectConfiguration Include = " Debug | ARM " > <nl> <nl> < Configuration > Debug < / Configuration > <nl> < Platform > Win32 < / Platform > <nl> < / ProjectConfiguration > <nl> + < ProjectConfiguration Include = " Fuzzing | ARM " > <nl> + < Configuration > Fuzzing < / Configuration > <nl> + < Platform > ARM < / Platform > <nl> + < / ProjectConfiguration > <nl> + < ProjectConfiguration Include = " Fuzzing | ARM64 " > <nl> + < Configuration > Fuzzing < / Configuration > <nl> + < Platform > ARM64 < / Platform > <nl> + < / ProjectConfiguration > <nl> + < ProjectConfiguration Include = " Fuzzing | Win32 " > <nl> + < Configuration > Fuzzing < / Configuration > <nl> + < Platform > Win32 < / Platform > <nl> + < / ProjectConfiguration > <nl> + < ProjectConfiguration Include = " Fuzzing | x64 " > <nl> + < Configuration > Fuzzing < / Configuration > <nl> + < Platform > x64 < / Platform > <nl> + < / ProjectConfiguration > <nl> < ProjectConfiguration Include = " Release | ARM " > <nl> < Configuration > Release < / Configuration > <nl> < Platform > ARM < / Platform > <nl> <nl> < ConfigurationType > StaticLibrary < / ConfigurationType > <nl> < PlatformToolset > v140 < / PlatformToolset > <nl> < PlatformToolset Condition = " ' $ ( VisualStudioVersion ) ' = = ' 15 . 0 ' " > v141 < / PlatformToolset > <nl> - < PlatformToolset Condition = " ' $ ( VisualStudioVersion ) ' = = ' 16 . 0 ' " > v142 < / PlatformToolset > <nl> + < PlatformToolset Condition = " ' $ ( VisualStudioVersion ) ' = = ' 16 . 0 ' And ' $ ( Configuration ) ' ! = ' Fuzzing ' " > v142 < / PlatformToolset > <nl> + < PlatformToolset Condition = " ' $ ( VisualStudioVersion ) ' = = ' 16 . 0 ' And ' $ ( Configuration ) ' = = ' Fuzzing ' " > ClangCL < / PlatformToolset > <nl> < CharacterSet > Unicode < / CharacterSet > <nl> < / PropertyGroup > <nl> < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . props " / > <nl> <nl> < WholeProgramOptimization > true < / WholeProgramOptimization > <nl> < LinkIncremental > false < / LinkIncremental > <nl> < / PropertyGroup > <nl> + < PropertyGroup Condition = " ' $ ( Configuration ) ' = = ' Fuzzing ' " Label = " Configuration " > <nl> + < UseDebugLibraries > false < / UseDebugLibraries > <nl> + < WholeProgramOptimization > false < / WholeProgramOptimization > <nl> + < LinkIncremental > false < / LinkIncremental > <nl> + < / PropertyGroup > <nl> < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | x64 ' " > <nl> < LinkIncremental > true < / LinkIncremental > <nl> < OutDir > $ ( SolutionDir ) $ ( Platform ) \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> <nl> < LinkIncremental > false < / LinkIncremental > <nl> < OutDir > $ ( SolutionDir ) x86 \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> < / PropertyGroup > <nl> + < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | Win32 ' " > <nl> + < LinkIncremental > false < / LinkIncremental > <nl> + < OutDir > $ ( SolutionDir ) x86 \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> + < / PropertyGroup > <nl> < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | x64 ' " > <nl> < LinkIncremental > false < / LinkIncremental > <nl> < OutDir > $ ( SolutionDir ) $ ( Platform ) \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> < / PropertyGroup > <nl> + < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | x64 ' " > <nl> + < LinkIncremental > false < / LinkIncremental > <nl> + < OutDir > $ ( SolutionDir ) $ ( Platform ) \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> + < / PropertyGroup > <nl> < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | ARM ' " > <nl> < LinkIncremental > false < / LinkIncremental > <nl> < OutDir > $ ( SolutionDir ) $ ( Platform ) \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> < / PropertyGroup > <nl> + < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | ARM ' " > <nl> + < LinkIncremental > false < / LinkIncremental > <nl> + < OutDir > $ ( SolutionDir ) $ ( Platform ) \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> + < / PropertyGroup > <nl> < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release | ARM64 ' " > <nl> < LinkIncremental > false < / LinkIncremental > <nl> < OutDir > $ ( SolutionDir ) $ ( Platform ) \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> < / PropertyGroup > <nl> + < PropertyGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | ARM64 ' " > <nl> + < LinkIncremental > false < / LinkIncremental > <nl> + < OutDir > $ ( SolutionDir ) $ ( Platform ) \ $ ( Configuration ) \ $ ( ProjectName ) \ < / OutDir > <nl> + < / PropertyGroup > <nl> < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | ARM ' " > <nl> < ClCompile > <nl> < AdditionalIncludeDirectories > libyaml \ include ; $ ( ProjectDir ) < / AdditionalIncludeDirectories > <nl> <nl> < AdditionalOptions > / D YAML_DECLARE_STATIC / D HAVE_CONFIG_H % ( AdditionalOptions ) < / AdditionalOptions > <nl> < / ClCompile > <nl> < / ItemDefinitionGroup > <nl> + < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | ARM ' " > <nl> + < ClCompile > <nl> + < AdditionalIncludeDirectories > libyaml \ include ; $ ( ProjectDir ) < / AdditionalIncludeDirectories > <nl> + < LanguageStandard > stdcpp17 < / LanguageStandard > <nl> + < WarningLevel > Level3 < / WarningLevel > <nl> + < AdditionalOptions > / D YAML_DECLARE_STATIC / D HAVE_CONFIG_H % ( AdditionalOptions ) < / AdditionalOptions > <nl> + < / ClCompile > <nl> + < / ItemDefinitionGroup > <nl> < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | ARM64 ' " > <nl> < ClCompile > <nl> < AdditionalIncludeDirectories > libyaml \ include ; $ ( ProjectDir ) < / AdditionalIncludeDirectories > <nl> <nl> < AdditionalOptions > / D YAML_DECLARE_STATIC / D HAVE_CONFIG_H % ( AdditionalOptions ) < / AdditionalOptions > <nl> < / ClCompile > <nl> < / ItemDefinitionGroup > <nl> + < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | ARM64 ' " > <nl> + < ClCompile > <nl> + < AdditionalIncludeDirectories > libyaml \ include ; $ ( ProjectDir ) < / AdditionalIncludeDirectories > <nl> + < LanguageStandard > stdcpp17 < / LanguageStandard > <nl> + < WarningLevel > Level3 < / WarningLevel > <nl> + < AdditionalOptions > / D YAML_DECLARE_STATIC / D HAVE_CONFIG_H % ( AdditionalOptions ) < / AdditionalOptions > <nl> + < / ClCompile > <nl> + < / ItemDefinitionGroup > <nl> < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | Win32 ' " > <nl> < ClCompile > <nl> < AdditionalIncludeDirectories > libyaml \ include ; $ ( ProjectDir ) < / AdditionalIncludeDirectories > <nl> <nl> < AdditionalOptions > / D YAML_DECLARE_STATIC / D HAVE_CONFIG_H % ( AdditionalOptions ) < / AdditionalOptions > <nl> < / ClCompile > <nl> < / ItemDefinitionGroup > <nl> + < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | Win32 ' " > <nl> + < ClCompile > <nl> + < AdditionalIncludeDirectories > libyaml \ include ; $ ( ProjectDir ) < / AdditionalIncludeDirectories > <nl> + < LanguageStandard > stdcpp17 < / LanguageStandard > <nl> + < WarningLevel > Level3 < / WarningLevel > <nl> + < AdditionalOptions > / D YAML_DECLARE_STATIC / D HAVE_CONFIG_H % ( AdditionalOptions ) < / AdditionalOptions > <nl> + < / ClCompile > <nl> + < / ItemDefinitionGroup > <nl> < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug | x64 ' " > <nl> < ClCompile > <nl> < AdditionalIncludeDirectories > libyaml \ include ; $ ( ProjectDir ) < / AdditionalIncludeDirectories > <nl> <nl> < AdditionalOptions > / D YAML_DECLARE_STATIC / D HAVE_CONFIG_H % ( AdditionalOptions ) < / AdditionalOptions > <nl> < / ClCompile > <nl> < / ItemDefinitionGroup > <nl> + < ItemDefinitionGroup Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Fuzzing | x64 ' " > <nl> + < ClCompile > <nl> + < AdditionalIncludeDirectories > libyaml \ include ; $ ( ProjectDir ) < / AdditionalIncludeDirectories > <nl> + < LanguageStandard > Default < / LanguageStandard > <nl> + < WarningLevel > Level3 < / WarningLevel > <nl> + < AdditionalOptions > / D YAML_DECLARE_STATIC / D HAVE_CONFIG_H - fsanitize = fuzzer , address % ( AdditionalOptions ) < / AdditionalOptions > <nl> + < RuntimeLibrary > MultiThreaded < / RuntimeLibrary > <nl> + < / ClCompile > <nl> + < / ItemDefinitionGroup > <nl> < Import Project = " $ ( VCTargetsPath ) \ Microsoft . Cpp . targets " / > <nl> < ImportGroup Label = " ExtensionTargets " > <nl> < / ImportGroup > <nl> | Add fuzzing project for YAML manifest loading ( ) | microsoft/winget-cli | f3b159574719f07d45f4e93a640d138767cda4ec | 2020-08-24T18:14:00Z |
mmm a / samples / HelloLua / Resources / hello . lua <nl> ppp b / samples / HelloLua / Resources / hello . lua <nl> local function creatDog ( ) <nl> - - create dog animate <nl> local textureDog = CCTextureCache : sharedTextureCache ( ) : addImage ( " dog . png " ) <nl> local rect = CCRectMake ( 0 , 0 , frameWidth , frameHeight ) <nl> - local frame0 = CCSpriteFrame : create ( textureDog , rect ) <nl> + local frame0 = CCSpriteFrame : createWithTexture ( textureDog , rect ) <nl> rect = CCRectMake ( frameWidth , 0 , frameWidth , frameHeight ) <nl> - local frame1 = CCSpriteFrame : create ( textureDog , rect ) <nl> + local frame1 = CCSpriteFrame : createWithTexture ( textureDog , rect ) <nl> <nl> - local spriteDog = CCSprite : create ( frame0 ) <nl> + local spriteDog = CCSprite : createWithSpriteFrame ( frame0 ) <nl> spriteDog . isPaused = false <nl> spriteDog : setPosition ( 0 , winSize . height / 4 * 3 ) <nl> <nl> mmm a / tools / tolua + + / CCAction . pkg <nl> ppp b / tools / tolua + + / CCAction . pkg <nl> enum { <nl> <nl> class CCAction : public CCObject <nl> { <nl> - / / bool isDone ( void ) ; <nl> - / / CCNode * getTarget ( void ) ; <nl> + bool isDone ( void ) ; <nl> + CCNode * getTarget ( void ) ; <nl> / / void setTarget ( CCNode * pTarget ) ; <nl> - / / CCNode * getOriginalTarget ( void ) ; <nl> + CCNode * getOriginalTarget ( void ) ; <nl> / / void setOriginalTarget ( CCNode * pOriginalTarget ) ; <nl> - / / int getTag ( void ) ; <nl> - / / void setTag ( int nTag ) ; <nl> - <nl> - / / static CCAction * create ( ) ; <nl> + / / static CCAction * create ( ) ; <nl> + int getTag ( void ) ; <nl> + void setTag ( int nTag ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> } ; <nl> <nl> class CCActionInterval : public CCAction <nl> { <nl> - / / float getElapsed ( void ) ; <nl> - / / void setAmplitudeRate ( CGFloat amp ) ; <nl> - / / CGFloat getAmplitudeRate ( void ) ; <nl> + float getElapsed ( void ) ; <nl> + bool isDone ( void ) ; <nl> + void setAmplitudeRate ( float amp ) ; <nl> + float getAmplitudeRate ( void ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + CCActionInterval * create ( float d ) ; <nl> } ; <nl> <nl> class CCFiniteTimeAction : public CCActionInterval <nl> { <nl> - / / float getDuration ( void ) ; <nl> - / / void setDuration ( float duration ) ; <nl> - / / CCFiniteTimeAction * reverse ( void ) ; <nl> + float getDuration ( void ) ; <nl> + void setDuration ( float duration ) ; <nl> + CCFiniteTimeAction * reverse ( void ) ; <nl> } ; <nl> <nl> / / CCActionInterval <nl> class CCSpeed : public CCAction <nl> { <nl> float getSpeed ( void ) ; <nl> void setSpeed ( float fSpeed ) ; <nl> - CCAction * reverse ( void ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + bool isDone ( void ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> <nl> static CCSpeed * create ( CCActionInterval * pAction , float fRate ) ; <nl> } ; <nl> class CCFollow : public CCAction <nl> { <nl> bool isBoundarySet ( void ) ; <nl> void setBoudarySet ( bool bValue ) ; <nl> + bool isDone ( void ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> <nl> static CCFollow * create ( CCNode * pFollowedNode ) ; <nl> static CCFollow * create ( CCNode * pFollowedNode , CCRect rect ) ; <nl> class CCFollow : public CCAction <nl> <nl> class CCSequence : public CCActionInterval <nl> { <nl> - static CCFiniteTimeAction * create ( CCFiniteTimeAction * pActionOne , CCFiniteTimeAction * pActionTwo ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCFiniteTimeAction * createWithTwoActions ( CCFiniteTimeAction * pActionOne , CCFiniteTimeAction * pActionTwo ) ; <nl> static CCFiniteTimeAction * create ( CCArray * actions ) ; <nl> } ; <nl> <nl> class CCRepeat : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + bool isDone ( void ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> static CCRepeat * create ( CCActionInterval * pAction , unsigned int times ) ; <nl> } ; <nl> <nl> class CCRepeatForever : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + bool isDone ( void ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> static CCRepeatForever * create ( CCActionInterval * pAction ) ; <nl> } ; <nl> <nl> class CCSpawn : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> static CCFiniteTimeAction * create ( CCArray * actions ) ; <nl> - static CCSpawn * create ( CCFiniteTimeAction * pAction1 , CCFiniteTimeAction * pAction2 ) ; <nl> + static CCFiniteTimeAction * create ( CCFiniteTimeAction * pAction1 , CCFiniteTimeAction * pAction2 ) ; <nl> } ; <nl> <nl> class CCRotateTo : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCRotateTo * create ( float duration , float fDeltaAngle ) ; <nl> } ; <nl> <nl> class CCRotateBy : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> static CCRotateBy * create ( float duration , float fDeltaAngle ) ; <nl> } ; <nl> <nl> class CCMoveTo : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCMoveTo * create ( float duration , CCPoint position ) ; <nl> } ; <nl> <nl> class CCMoveBy : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> static CCMoveBy * create ( float duration , CCPoint position ) ; <nl> } ; <nl> <nl> class CCSkewTo : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCSkewTo * create ( float t , float sx , float sy ) ; <nl> } ; <nl> <nl> class CCSkewBy : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> static CCSkewBy * create ( float t , float deltaSkewX , float deltaSkewY ) ; <nl> } ; <nl> <nl> class CCJumpBy : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> static CCJumpBy * create ( float duration , CCPoint position , float height , int jumps ) ; <nl> } ; <nl> <nl> class CCJumpTo : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCJumpTo * create ( float duration , CCPoint position , float height , int jumps ) ; <nl> } ; <nl> <nl> typedef struct _ccBezierConfig { <nl> <nl> class CCBezierBy : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> static CCBezierBy * create ( float t , ccBezierConfig c ) ; <nl> } ; <nl> <nl> class CCBezierTo : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCBezierTo * create ( float t , ccBezierConfig c ) ; <nl> } ; <nl> <nl> class CCScaleTo : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCScaleTo * create ( float duration , float s ) ; <nl> static CCScaleTo * create ( float duration , float sx , float sy ) ; <nl> } ; <nl> <nl> class CCScaleBy : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> static CCScaleBy * create ( float duration , float s ) ; <nl> static CCScaleBy * create ( float duration , float sx , float sy ) ; <nl> } ; <nl> <nl> class CCBlink : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> static CCBlink * create ( float duration , unsigned int uBlinks ) ; <nl> } ; <nl> <nl> class CCFadeIn : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> static CCFadeIn * create ( float d ) ; <nl> } ; <nl> <nl> class CCFadeOut : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> static CCFadeOut * create ( float d ) ; <nl> } ; <nl> <nl> class CCFadeTo : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCFadeTo * create ( float duration , GLubyte opacity ) ; <nl> } ; <nl> <nl> class CCTintTo : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCTintTo * create ( float duration , GLubyte red , GLubyte green , GLubyte blue ) ; <nl> } ; <nl> <nl> class CCTintBy : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> static CCTintBy * create ( float duration , GLshort deltaRed , GLshort deltaGreen , GLshort deltaBlue ) ; <nl> } ; <nl> <nl> class CCDelayTime : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> static CCDelayTime * create ( float d ) ; <nl> } ; <nl> <nl> class CCReverseTime : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> static CCReverseTime * create ( CCFiniteTimeAction * pAction ) ; <nl> } ; <nl> <nl> class CCAnimate : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> CCAnimation * getAnimation ( void ) ; <nl> void setAnimation ( CCAnimation * pAnimation ) ; <nl> <nl> - static CCAction * create ( CCAnimation * pAnimation ) ; <nl> + static CCAnimate * create ( CCAnimation * pAnimation ) ; <nl> } ; <nl> <nl> - class CCProgressTo : public CCAction <nl> + class CCTargetedAction : public CCActionInterval <nl> { <nl> - static CCAction * create ( float duration , float fPercent ) ; <nl> - } ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCNode * getForcedTarget ( void ) ; <nl> + void setForcedTarget ( CCNode * target ) ; <nl> <nl> - class CCProgressFromTo : public CCAction <nl> - { <nl> - static CCAction * create ( float duration , float fFromPercentage , float fToPercentage ) ; <nl> + static CCTargetedAction * create ( CCNode * pTarget , CCFiniteTimeAction * pAction ) ; <nl> } ; <nl> <nl> <nl> / / CCActionInstant <nl> - class CCShow : public CCAction <nl> + class CCActionInstant : public CCFiniteTimeAction <nl> { <nl> - static CCAction * create ( ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCFiniteTimeAction * reverse ( void ) ; <nl> + bool isDone ( void ) ; <nl> } ; <nl> <nl> - class CCHide : public CCAction <nl> + class CCShow : public CCActionInstant <nl> { <nl> - static CCAction * create ( ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCFiniteTimeAction * reverse ( void ) ; <nl> + <nl> + static CCShow * create ( ) ; <nl> } ; <nl> <nl> - class CCToggleVisibility : public CCAction <nl> + class CCHide : public CCActionInstant <nl> { <nl> - static CCAction * create ( ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCFiniteTimeAction * reverse ( void ) ; <nl> + <nl> + static CCHide * create ( ) ; <nl> } ; <nl> <nl> - class CCFlipX : public CCAction <nl> + class CCToggleVisibility : public CCActionInstant <nl> { <nl> - static CCAction * create ( bool x ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> + static CCToggleVisibility * create ( ) ; <nl> } ; <nl> <nl> - class CCFlipY : public CCAction <nl> + class CCFlipX : public CCActionInstant <nl> { <nl> - static CCAction * create ( bool y ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCFiniteTimeAction * reverse ( void ) ; <nl> + <nl> + static CCFlipX * create ( bool x ) ; <nl> } ; <nl> <nl> - class CCPlace : public CCAction / / < NSCopying > <nl> + class CCFlipY : public CCActionInstant <nl> { <nl> - static CCAction * create ( CCPoint pos ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCFiniteTimeAction * reverse ( void ) ; <nl> + <nl> + static CCFlipY * create ( bool y ) ; <nl> + } ; <nl> + <nl> + class CCPlace : public CCActionInstant / / < NSCopying > <nl> + { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> + static CCPlace * create ( CCPoint pos ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCActionCamera . pkg <nl> ppp b / tools / tolua + + / CCActionCamera . pkg <nl> <nl> class CCActionCamera : public CCActionInterval <nl> { <nl> void startWithTarget ( CCNode * pTarget ) ; <nl> + CCActionInterval * reverse ( ) ; <nl> } ; <nl> <nl> class CCOrbitCamera : public CCActionCamera <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> void sphericalRadius ( float * r , float * zenith , float * azimuth ) ; <nl> <nl> static CCOrbitCamera * create ( float t , float radius , float deltaRadius , float angleZ , float deltaAngleZ , float angleX , float deltaAngleX ) ; <nl> new file mode 100644 <nl> index 000000000000 . . a8756d0a3b4f <nl> mmm / dev / null <nl> ppp b / tools / tolua + + / CCActionCatmullRom . pkg <nl> <nl> + <nl> + class CCPointArray : public CCNode <nl> + { <nl> + bool initWithCapacity ( unsigned int capacity ) ; <nl> + void addControlPoint ( CCPoint controlPoint ) ; <nl> + void insertControlPoint ( CCPoint & controlPoint , unsigned int index ) ; <nl> + void replaceControlPoint ( CCPoint & controlPoint , unsigned int index ) ; <nl> + CCPoint getControlPointAtIndex ( unsigned int index ) ; <nl> + void removeControlPointAtIndex ( unsigned int index ) ; <nl> + unsigned int count ( ) ; <nl> + CCPointArray * reverse ( ) ; <nl> + void reverseInline ( ) ; <nl> + CCObject * copyWithZone ( CCZone * zone ) ; <nl> + CCArray * getControlPoints ( ) ; <nl> + void setControlPoints ( CCArray * controlPoints ) ; <nl> + <nl> + static CCPointArray * create ( unsigned int capacity ) ; <nl> + } ; <nl> + <nl> + class CCCardinalSplineTo : public CCActionInterval <nl> + { <nl> + CCCardinalSplineTo * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( ) ; <nl> + CCPointArray * getPoints ( ) ; <nl> + void setPoints ( CCPointArray * points ) ; <nl> + <nl> + static CCCardinalSplineTo * create ( float duration , CCPointArray * points , float tension ) ; <nl> + } ; <nl> + <nl> + <nl> + class CCCardinalSplineBy : public CCCardinalSplineTo <nl> + { <nl> + CCActionInterval * reverse ( ) ; <nl> + <nl> + static CCCardinalSplineBy * create ( float duration , CCPointArray * points , float tension ) ; <nl> + } ; <nl> + <nl> + class CCCatmullRomTo : public CCCardinalSplineTo <nl> + { <nl> + static CCCatmullRomTo * create ( float dt , CCPointArray * points ) ; <nl> + } ; <nl> + <nl> + class CCCatmullRomBy : public CCCardinalSplineBy <nl> + { <nl> + static CCCatmullRomBy * create ( float dt , CCPointArray * points ) ; <nl> + } ; <nl> mmm a / tools / tolua + + / CCActionEase . pkg <nl> ppp b / tools / tolua + + / CCActionEase . pkg <nl> <nl> <nl> class CCActionEase : public CCActionInterval <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCActionEase * create ( CCActionInterval * pAction ) ; <nl> } ; <nl> <nl> - class CCEaseRateAction : public CCActionInterval <nl> + class CCEaseRateAction : public CCActionEase <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction , float fRate ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseRateAction * create ( CCActionInterval * pAction , float fRate ) ; <nl> } ; <nl> <nl> - class CCEaseIn : public CCActionInterval <nl> + class CCEaseIn : public CCEaseRateAction <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction , float fRate ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseIn * create ( CCActionInterval * pAction , float fRate ) ; <nl> } ; <nl> <nl> - class CCEaseOut : public CCActionInterval <nl> + class CCEaseOut : public CCEaseRateAction <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction , float fRate ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseOut * create ( CCActionInterval * pAction , float fRate ) ; <nl> } ; <nl> <nl> - class CCEaseInOut : public CCActionInterval <nl> + class CCEaseInOut : public CCEaseRateAction <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction , float fRate ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseInOut * create ( CCActionInterval * pAction , float fRate ) ; <nl> } ; <nl> <nl> - class CCEaseExponentialIn : public CCActionInterval <nl> + class CCEaseExponentialIn : public CCActionEase <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseExponentialIn * create ( CCActionInterval * pAction ) ; <nl> } ; <nl> <nl> - class CCEaseExponentialOut : public CCActionInterval <nl> + class CCEaseExponentialOut : public CCActionEase <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseExponentialOut * create ( CCActionInterval * pAction ) ; <nl> } ; <nl> <nl> - class CCEaseExponentialInOut : public CCActionInterval <nl> + class CCEaseExponentialInOut : public CCActionEase <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseExponentialInOut * create ( CCActionInterval * pAction ) ; <nl> } ; <nl> <nl> - class CCEaseSineIn : public CCActionInterval <nl> + class CCEaseSineIn : public CCActionEase <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseSineIn * create ( CCActionInterval * pAction ) ; <nl> } ; <nl> <nl> - class CCEaseSineOut : public CCActionInterval <nl> + class CCEaseSineOut : public CCActionEase <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseSineOut * create ( CCActionInterval * pAction ) ; <nl> } ; <nl> <nl> - class CCEaseSineInOut : public CCActionInterval <nl> + class CCEaseSineInOut : public CCActionEase <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseSineInOut * create ( CCActionInterval * pAction ) ; <nl> } ; <nl> <nl> - class CCEaseElastic : public CCActionInterval <nl> + class CCEaseElastic : public CCActionEase <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> - static CCActionInterval * create ( CCActionInterval * pAction , float fPeriod ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + float getPeriod ( void ) ; <nl> + void setPeriod ( float fPeriod ) ; <nl> + <nl> + static CCEaseElastic * create ( CCActionInterval * pAction ) ; <nl> + static CCEaseElastic * create ( CCActionInterval * pAction , float fPeriod ) ; <nl> } ; <nl> <nl> - class CCEaseElasticIn : public CCActionInterval <nl> + class CCEaseElasticIn : public CCEaseElastic <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> - static CCActionInterval * create ( CCActionInterval * pAction , float fPeriod ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseElasticIn * create ( CCActionInterval * pAction ) ; <nl> + static CCEaseElasticIn * create ( CCActionInterval * pAction , float fPeriod ) ; <nl> } ; <nl> <nl> - class CCEaseElasticOut : public CCActionInterval <nl> + class CCEaseElasticOut : public CCEaseElastic <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> - static CCActionInterval * create ( CCActionInterval * pAction , float fPeriod ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseElasticOut * create ( CCActionInterval * pAction ) ; <nl> + static CCEaseElasticOut * create ( CCActionInterval * pAction , float fPeriod ) ; <nl> } ; <nl> <nl> - class CCEaseElasticInOut : public CCActionInterval <nl> + class CCEaseElasticInOut : public CCEaseElastic <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> - static CCActionInterval * create ( CCActionInterval * pAction , float fPeriod ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseElasticInOut * create ( CCActionInterval * pAction ) ; <nl> + static CCEaseElasticInOut * create ( CCActionInterval * pAction , float fPeriod ) ; <nl> } ; <nl> <nl> - class CCEaseBounce : public CCActionInterval <nl> + class CCEaseBounce : public CCActionEase <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseBounce * create ( CCActionInterval * pAction ) ; <nl> } ; <nl> <nl> - class CCEaseBounceIn : public CCActionInterval <nl> + class CCEaseBounceIn : public CCEaseBounce <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseBounceIn * create ( CCActionInterval * pAction ) ; <nl> } ; <nl> <nl> - class CCEaseBounceOut : public CCActionInterval <nl> + class CCEaseBounceOut : public CCEaseBounce <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseBounceOut * create ( CCActionInterval * pAction ) ; <nl> } ; <nl> <nl> - class CCEaseBounceInOut : public CCActionInterval <nl> + class CCEaseBounceInOut : public CCEaseBounce <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseBounceInOut * create ( CCActionInterval * pAction ) ; <nl> } ; <nl> <nl> - class CCEaseBackIn : public CCActionInterval <nl> + class CCEaseBackIn : public CCActionEase <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseBackIn * create ( CCActionInterval * pAction ) ; <nl> } ; <nl> <nl> - class CCEaseBackOut : public CCActionInterval <nl> + class CCEaseBackOut : public CCActionEase <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseBackOut * create ( CCActionInterval * pAction ) ; <nl> } ; <nl> <nl> - class CCEaseBackInOut : public CCActionInterval <nl> + class CCEaseBackInOut : public CCActionEase <nl> { <nl> - static CCActionInterval * create ( CCActionInterval * pAction ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> + static CCEaseBackInOut * create ( CCActionInterval * pAction ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCActionGrid . pkg <nl> ppp b / tools / tolua + + / CCActionGrid . pkg <nl> <nl> <nl> class CCGridAction : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> CCGridBase * getGrid ( void ) ; <nl> <nl> static CCGridAction * create ( ccGridSize gridSize , float duration ) ; <nl> class CCGridAction : public CCActionInterval <nl> <nl> class CCAccelDeccelAmplitude : public CCActionInterval <nl> { <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> float getRate ( void ) ; <nl> void setRate ( float fRate ) ; <nl> <nl> static CCAccelDeccelAmplitude * create ( CCAction * pAction , float duration ) ; <nl> } ; <nl> <nl> + class CCGrid3DAction : public CCGridAction <nl> + { <nl> + virtual CCGridBase * getGrid ( void ) ; <nl> + ccVertex3F vertex ( const ccGridSize & pos ) ; <nl> + ccVertex3F originalVertex ( const ccGridSize & pos ) ; <nl> + void setVertex ( const ccGridSize & pos , const ccVertex3F & vertex ) ; <nl> + <nl> + / / static CCGrid3DAction * create ( const ccGridSize & gridSize , float duration ) ; <nl> + } ; <nl> + <nl> + class CCTiledGrid3DAction : public CCGridAction <nl> + { <nl> + ccQuad3 tile ( ccGridSize pos ) ; <nl> + ccQuad3 originalTile ( ccGridSize pos ) ; <nl> + void setTile ( ccGridSize pos , ccQuad3 coords ) ; <nl> + CCGridBase * getGrid ( void ) ; <nl> + <nl> + / / static CCTiledGrid3DAction * create ( ccGridSize gridSize , float duration ) ; <nl> + } ; <nl> + <nl> class CCAccelAmplitude : public CCActionInterval <nl> { <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> float getRate ( void ) ; <nl> void setRate ( float fRate ) ; <nl> <nl> class CCAccelAmplitude : public CCActionInterval <nl> <nl> class CCDeccelAmplitude : public CCActionInterval <nl> { <nl> + CCActionInterval * reverse ( void ) ; <nl> + <nl> float getRate ( void ) ; <nl> void setRate ( float fRate ) ; <nl> <nl> mmm a / tools / tolua + + / CCActionGrid3D . pkg <nl> ppp b / tools / tolua + + / CCActionGrid3D . pkg <nl> <nl> <nl> class CCWaves3D : public CCGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> float getAmplitude ( void ) ; <nl> void setAmplitude ( float fAmplitude ) ; <nl> float getAmplitudeRate ( void ) ; <nl> class CCWaves3D : public CCGrid3DAction <nl> <nl> class CCFlipX3D : public CCGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCFlipX3D * create ( float duration ) ; <nl> } ; <nl> <nl> class CCFlipY3D : public CCFlipX3D <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCFlipY3D * create ( float duration ) ; <nl> } ; <nl> <nl> class CCLens3D : public CCGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> float getLensEffect ( void ) ; <nl> void setLensEffect ( float fLensEffect ) ; <nl> CCPoint getPosition ( void ) ; <nl> class CCLens3D : public CCGrid3DAction <nl> <nl> class CCRipple3D : public CCGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> CCPoint getPosition ( void ) ; <nl> void setPosition ( CCPoint position ) ; <nl> float getAmplitude ( void ) ; <nl> class CCRipple3D : public CCGrid3DAction <nl> <nl> class CCShaky3D : public CCGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCShaky3D * create ( int range , bool shakeZ , ccGridSize gridSize , float duration ) ; <nl> } ; <nl> <nl> class CCLiquid : public CCGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> float getAmplitude ( void ) ; <nl> void setAmplitude ( float fAmplitude ) ; <nl> float getAmplitudeRate ( void ) ; <nl> class CCLiquid : public CCGrid3DAction <nl> <nl> class CCWaves : public CCGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> float getAmplitude ( void ) ; <nl> void setAmplitude ( float fAmplitude ) ; <nl> float getAmplitudeRate ( void ) ; <nl> class CCWaves : public CCGrid3DAction <nl> <nl> class CCTwirl : public CCGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> CCPoint getPosition ( void ) ; <nl> void setPosition ( CCPoint position ) ; <nl> float getAmplitude ( void ) ; <nl> mmm a / tools / tolua + + / CCActionManager . pkg <nl> ppp b / tools / tolua + + / CCActionManager . pkg <nl> class CCActionManager : public CCObject <nl> void pauseTarget ( CCObject * pTarget ) ; <nl> <nl> void resumeTarget ( CCObject * pTarget ) ; <nl> + <nl> + CCSet * pauseAllRunningActions ( ) ; <nl> + <nl> + void resumeTargets ( CCSet * targetsToResume ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCActionProgressTimer . pkg <nl> ppp b / tools / tolua + + / CCActionProgressTimer . pkg <nl> <nl> <nl> class CCProgressTo : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCProgressTo * create ( float duration , float fPercent ) ; <nl> } ; <nl> <nl> class CCProgressFromTo : public CCActionInterval <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCProgressFromTo * create ( float duration , float fFromPercentage , float fToPercentage ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCActionTiledGrid . pkg <nl> ppp b / tools / tolua + + / CCActionTiledGrid . pkg <nl> <nl> <nl> class CCShakyTiles3D : public CCTiledGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCShakyTiles3D * create ( int nRange , bool bShakeZ , ccGridSize gridSize , float duration ) ; <nl> } ; <nl> <nl> class CCShatteredTiles3D : public CCTiledGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCShatteredTiles3D * create ( int nRange , bool bShatterZ , ccGridSize gridSize , float duration ) ; <nl> } ; <nl> <nl> class CCShuffleTiles : public CCTiledGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> void shuffle ( int * pArray , int nLen ) ; <nl> ccGridSize getDelta ( ccGridSize pos ) ; <nl> void placeTile ( ccGridSize pos , Tile * t ) ; <nl> class CCFadeOutBLTiles : public CCFadeOutTRTiles <nl> <nl> class CCFadeOutUpTiles : public CCFadeOutTRTiles <nl> { <nl> + void transformTile ( ccGridSize pos , float distance ) ; <nl> + <nl> static CCFadeOutUpTiles * create ( ccGridSize gridSize , float time ) ; <nl> } ; <nl> <nl> class CCFadeOutDownTiles : public CCFadeOutUpTiles <nl> <nl> class CCTurnOffTiles : public CCTiledGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> void shuffle ( int * pArray , int nLen ) ; <nl> void turnOnTile ( ccGridSize pos ) ; <nl> void turnOffTile ( ccGridSize pos ) ; <nl> class CCTurnOffTiles : public CCTiledGrid3DAction <nl> <nl> class CCWavesTiles3D : public CCTiledGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> float getAmplitude ( void ) ; <nl> void setAmplitude ( float fAmplitude ) ; <nl> float getAmplitudeRate ( void ) ; <nl> class CCWavesTiles3D : public CCTiledGrid3DAction <nl> <nl> class CCJumpTiles3D : public CCTiledGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> float getAmplitude ( void ) ; <nl> void setAmplitude ( float fAmplitude ) ; <nl> float getAmplitudeRate ( void ) ; <nl> class CCJumpTiles3D : public CCTiledGrid3DAction <nl> <nl> class CCSplitRows : public CCTiledGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCSplitRows * create ( int nRows , float duration ) ; <nl> } ; <nl> <nl> class CCSplitCols : public CCTiledGrid3DAction <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCSplitCols * create ( int nCols , float duration ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCAffineTransform . pkg <nl> ppp b / tools / tolua + + / CCAffineTransform . pkg <nl> <nl> <nl> struct CCAffineTransform { <nl> - CCFloat a , b , c , d ; <nl> - CCFloat tx , ty ; <nl> + float a , b , c , d ; <nl> + float tx , ty ; <nl> } ; <nl> <nl> - CCAffineTransform __CCAffineTransformMake ( CCFloat a , CCFloat b , CCFloat c , CCFloat d , CCFloat tx , CCFloat ty ) ; <nl> - CCAffineTransform CCAffineTransformMake ( CCFloat a , CCFloat b , CCFloat c , CCFloat d , CCFloat tx , CCFloat ty ) ; <nl> + CCAffineTransform __CCAffineTransformMake ( float a , float b , float c , float d , float tx , float ty ) ; <nl> + CCAffineTransform CCAffineTransformMake ( float a , float b , float c , float d , float tx , float ty ) ; <nl> <nl> CCPoint __CCPointApplyAffineTransform ( CCPoint point , CCAffineTransform t ) ; <nl> CCPoint CCPointApplyAffineTransform ( CCPoint point , CCAffineTransform t ) ; <nl> CCAffineTransform CCAffineTransformMakeIdentity ( ) ; <nl> CCRect CCRectApplyAffineTransform ( CCRect rect , CCAffineTransform anAffineTransform ) ; <nl> <nl> CCAffineTransform CCAffineTransformTranslate ( CCAffineTransform t , float tx , float ty ) ; <nl> - CCAffineTransform CCAffineTransformRotate ( CCAffineTransform aTransform , CCFloat anAngle ) ; <nl> - CCAffineTransform CCAffineTransformScale ( CCAffineTransform t , CCFloat sx , CCFloat sy ) ; <nl> + CCAffineTransform CCAffineTransformRotate ( CCAffineTransform aTransform , float anAngle ) ; <nl> + CCAffineTransform CCAffineTransformScale ( CCAffineTransform t , float sx , float sy ) ; <nl> CCAffineTransform CCAffineTransformConcat ( CCAffineTransform t1 , CCAffineTransform t2 ) ; <nl> bool CCAffineTransformEqualToTransform ( CCAffineTransform t1 , CCAffineTransform t2 ) ; <nl> CCAffineTransform CCAffineTransformInvert ( CCAffineTransform t ) ; <nl> mmm a / tools / tolua + + / CCAnimation . pkg <nl> ppp b / tools / tolua + + / CCAnimation . pkg <nl> class CCAnimationFrame : public CCObject <nl> { <nl> CCAnimationFrame ( ) ; <nl> ~ CCAnimationFrame ( ) ; <nl> - <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> bool initWithSpriteFrame ( CCSpriteFrame * spriteFrame , float delayUnits , CCDictionary * userInfo ) ; <nl> - <nl> + <nl> CCSpriteFrame * getSpriteFrame ( ) ; <nl> void setSpriteFrame ( CCSpriteFrame * pSpFrame ) ; <nl> <nl> class CCAnimation : public CCObject <nl> { <nl> CCAnimation ( ) ; <nl> ~ CCAnimation ( void ) ; <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> <nl> static CCAnimation * create ( void ) ; <nl> - static CCAnimation * create ( CCArray * arrayOfSpriteFrameNames ) ; <nl> - static CCAnimation * create ( CCArray * arrayOfSpriteFrameNames , float delay ) ; <nl> + static CCAnimation * createWithSpriteFrames ( CCArray * arrayOfSpriteFrameNames ) ; <nl> + static CCAnimation * createWithSpriteFrames ( CCArray * arrayOfSpriteFrameNames , float delay ) ; <nl> static CCAnimation * create ( CCArray * arrayOfAnimationFrameNames , float delayPerUnit , unsigned int loops ) ; <nl> <nl> void addSpriteFrame ( CCSpriteFrame * pFrame ) ; <nl> mmm a / tools / tolua + + / CCAnimationCache . pkg <nl> ppp b / tools / tolua + + / CCAnimationCache . pkg <nl> class CCAnimationCache : public CCObject <nl> <nl> static CCAnimationCache * sharedAnimationCache ( void ) ; <nl> static void purgeSharedAnimationCache ( void ) ; <nl> + <nl> + void addAnimationsWithDictionary ( CCDictionary * dictionary ) ; <nl> + void addAnimationsWithFile ( const char * plist ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCArray . pkg <nl> ppp b / tools / tolua + + / CCArray . pkg <nl> <nl> class CCArray : public CCObject <nl> { <nl> + CCObject * copyWithZone ( CCZone * pZone ) ; <nl> + <nl> static CCArray * create ( ) ; <nl> - static CCArray * createWithObject ( CCObject * pObject ) ; <nl> - static CCArray * create ( const char * pFileName ) ; <nl> - static CCArray * create ( unsigned int capacity ) ; <nl> - static CCArray * create ( CCArray * otherArray ) ; <nl> + <nl> + static CCArray * createWithObject ( CCObject * pObject ) ; <nl> + static CCArray * createWithArray ( CCArray * otherArray ) ; <nl> + static CCArray * createWithCapacity ( unsigned int capacity ) ; <nl> + static CCArray * createWithContentsOfFile ( const char * pFileName ) ; <nl> <nl> unsigned int count ( ) ; <nl> <nl> class CCArray : public CCObject <nl> <nl> CCObject * randomObject ( ) ; <nl> <nl> + bool isEqualToArray ( CCArray * pOtherArray ) ; <nl> + <nl> bool containsObject ( CCObject * object ) ; <nl> <nl> void addObject ( CCObject * object ) ; <nl> mmm a / tools / tolua + + / CCAtlasNode . pkg <nl> ppp b / tools / tolua + + / CCAtlasNode . pkg <nl> <nl> <nl> class CCAtlasNode : public CCNode <nl> { <nl> - void updateAtlasValues ( ) ; <nl> - CCTexture2D * getTexture ( void ) ; <nl> + CCTextureAtlas * getTextureAtlas ( ) ; <nl> + void setTextureAtlas ( CCTextureAtlas * atlas ) ; <nl> + <nl> + CCTexture2D * getTexture ( void ) ; <nl> void setTexture ( CCTexture2D * texture ) ; <nl> <nl> - static CCAtlasNode * create ( const char * tile , unsigned int tileWidth , unsigned int tileHeight , unsigned int itemsToRender ) ; <nl> + ccColor3B getColor ( ) ; <nl> + void setColor ( ccColor3B color ) ; <nl> + <nl> + unsigned int getQuadsToDraw ( ) ; <nl> + void setQuadsToDraw ( unsigned int quadsToDraw ) ; <nl> + <nl> + GLubyte getOpacity ( ) ; <nl> + void setOpacity ( GLubyte opacity ) ; <nl> + <nl> + void updateAtlasValues ( ) ; <nl> + bool isOpacityModifyRGB ( ) ; <nl> + void setOpacityModifyRGB ( bool isOpacityModifyRGB ) ; <nl> + <nl> + static CCAtlasNode * create ( const char * tile , unsigned int tileWidth , unsigned int tileHeight , unsigned int itemsToRender ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCCommon . pkg <nl> ppp b / tools / tolua + + / CCCommon . pkg <nl> <nl> + typedef enum LanguageType <nl> + { <nl> + kLanguageEnglish = 0 , <nl> + kLanguageChinese , <nl> + kLanguageFrench , <nl> + kLanguageItalian , <nl> + kLanguageGerman , <nl> + kLanguageSpanish , <nl> + kLanguageRussian <nl> + } ccLanguageType ; <nl> <nl> void CCLuaLog ( const char * pszFormat ) ; <nl> void CCMessageBox ( const char * pszMsg , const char * pszTitle ) ; <nl> mmm a / tools / tolua + + / CCDictionary . pkg <nl> ppp b / tools / tolua + + / CCDictionary . pkg <nl> class CCDictionary : public CCObject <nl> void removeAllObjects ( ) ; <nl> <nl> static CCDictionary * create ( ) ; <nl> - static CCDictionary * create ( CCDictionary * srcDict ) ; <nl> - static CCDictionary * create ( const char * pFileName ) ; <nl> + static CCDictionary * createWithDictionary ( CCDictionary * srcDict ) ; <nl> + static CCDictionary * createWithContentsOfFile ( const char * pFileName ) ; <nl> <nl> } ; <nl> <nl> mmm a / tools / tolua + + / CCDirector . pkg <nl> ppp b / tools / tolua + + / CCDirector . pkg <nl> class CCDirector : public CCObject <nl> bool isPaused ( void ) ; <nl> unsigned int getTotalFrames ( void ) ; <nl> <nl> + CCEGLView * getOpenGLView ( void ) ; <nl> + bool enableRetinaDisplay ( bool bEnableRetina ) ; <nl> + <nl> CCSize getWinSize ( void ) ; <nl> CCSize getWinSizeInPixels ( void ) ; <nl> <nl> CCPoint convertToGL ( CCPoint obPoint ) ; <nl> CCPoint convertToUI ( CCPoint obPoint ) ; <nl> <nl> + void pause ( ) ; <nl> + void resume ( ) ; <nl> + void purgeCachedData ( void ) ; <nl> + <nl> void runWithScene ( CCScene * pScene ) ; <nl> void pushScene ( CCScene * pScene ) ; <nl> void popScene ( void ) ; <nl> void replaceScene ( CCScene * pScene ) ; <nl> + void endToLua ( ) ; <nl> <nl> - CCFloat getContentScaleFactor ( void ) ; <nl> + float getContentScaleFactor ( void ) ; <nl> <nl> CCScheduler * getScheduler ( ) ; <nl> CCActionManager * getActionManager ( ) ; <nl> mmm a / tools / tolua + + / CCDrawingPrimitives . pkg <nl> ppp b / tools / tolua + + / CCDrawingPrimitives . pkg <nl> <nl> void ccDrawPoint ( CCPoint point ) ; <nl> void ccDrawPoints ( const CCPoint * points , unsigned int numberOfPoints ) ; <nl> void ccDrawLine ( CCPoint origin , CCPoint destination ) ; <nl> - void ccDrawPoly ( const CCPoint * vertices , int numOfVertices , bool closePolygon ) ; <nl> + void ccDrawRect ( CCPoint origin , CCPoint destination ) ; <nl> + void ccDrawSolidRect ( CCPoint origin , CCPoint destination , ccColor4F color ) ; <nl> + void ccDrawPoly ( const CCPoint * vertices , unsigned int numOfVertices , bool closePolygon ) ; <nl> + void ccDrawSolidPoly ( const CCPoint * poli , unsigned int numberOfPoints , ccColor4F color ) ; <nl> void ccDrawCircle ( CCPoint center , float radius , float angle , unsigned int segments , bool drawLineToCenter ) ; <nl> void ccDrawQuadBezier ( CCPoint origin , CCPoint control , CCPoint destination , unsigned int segments ) ; <nl> void ccDrawCubicBezier ( CCPoint origin , CCPoint control1 , CCPoint control2 , CCPoint destination , unsigned int segments ) ; <nl> + void ccDrawCatmullRom ( CCPointArray * arrayOfControlPoints , unsigned int segments ) ; <nl> + void ccDrawCardinalSpline ( CCPointArray * config , float tension , unsigned int segments ) ; <nl> + void ccDrawColor4B ( GLubyte r , GLubyte g , GLubyte b , GLubyte a ) ; <nl> + void ccDrawColor4F ( GLubyte r , GLubyte g , GLubyte b , GLubyte a ) ; <nl> + void ccPointSize ( GLfloat pointSize ) ; <nl> mmm a / tools / tolua + + / CCFileUtils . pkg <nl> ppp b / tools / tolua + + / CCFileUtils . pkg <nl> class CCFileUtils <nl> { <nl> static CCFileUtils * sharedFileUtils ( ) ; <nl> std : : string getWriteablePath ( ) ; <nl> + const char * fullPathFromRelativePath ( const char * pszRelativePath ) ; <nl> + const char * fullPathFromRelativeFile ( const char * pszFilename , const char * pszRelativeFile ) ; <nl> + const char * fullPathFromRelativeFile ( const char * pszFilename , const char * pszRelativeFile ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCGeometry . pkg <nl> ppp b / tools / tolua + + / CCGeometry . pkg <nl> class CCPoint <nl> CCPoint ( ) ; <nl> CCPoint ( float x , float y ) ; <nl> <nl> - static bool CCPointEqualToPoint ( const CCPoint & point1 , const CCPoint & point2 ) ; <nl> + bool equals ( const CCPoint & target ) const ; <nl> } ; <nl> <nl> class CCSize <nl> class CCSize <nl> CCSize ( ) ; <nl> CCSize ( float width , float height ) ; <nl> <nl> - static bool CCSizeEqualToSize ( const CCSize & size1 , const CCSize & size2 ) ; <nl> + bool equals ( const CCSize & target ) const ; <nl> } ; <nl> <nl> class CCRect <nl> class CCRect <nl> CCRect ( ) ; <nl> CCRect ( float x , float y , float width , float height ) ; <nl> <nl> - static CGFloat CCRectGetMinX ( const CCRect & rect ) ; <nl> - static CGFloat CCRectGetMaxX ( const CCRect & rect ) ; <nl> - static CGFloat CCRectGetMidX ( const CCRect & rect ) ; <nl> - static CGFloat CCRectGetMinY ( const CCRect & rect ) ; <nl> - static CGFloat CCRectGetMaxY ( const CCRect & rect ) ; <nl> - static CGFloat CCRectGetMidY ( const CCRect & rect ) ; <nl> - static bool CCRectEqualToRect ( const CCRect & rect1 , const CCRect & rect2 ) ; <nl> - static bool CCRectContainsPoint ( const CCRect & rect , const CCPoint & point ) ; <nl> - static bool CCRectIntersectsRect ( const CCRect & rectA , const CCRect & rectB ) ; <nl> + float getMinX ( ) ; <nl> + float getMidX ( ) ; <nl> + float getMaxX ( ) ; <nl> + float getMinY ( ) ; <nl> + float getMidY ( ) ; <nl> + float getMaxY ( ) ; <nl> + bool equals ( const CCRect & rect ) const ; <nl> + bool containsPoint ( const CCPoint & point ) const ; <nl> + bool intersectsRect ( const CCRect & rect ) const ; <nl> } ; <nl> <nl> CCPoint CCPointMake ( float x , float y ) ; <nl> mmm a / tools / tolua + + / CCLabelBMFont . pkg <nl> ppp b / tools / tolua + + / CCLabelBMFont . pkg <nl> <nl> class CCLabelBMFont : public CCNode <nl> { <nl> void setString ( const char * label ) ; <nl> - const char * getString ( void ) ; <nl> + void setString ( const char * label , bool fromUpdate ) ; <nl> + void setCString ( const char * label ) ; <nl> + const char * getString ( void ) ; <nl> + void updateString ( bool fromUpdate ) ; <nl> + <nl> + void setAnchorPoint ( const CCPoint & var ) ; <nl> + void setAlignment ( CCTextAlignment alignment ) ; <nl> + void setWidth ( float width ) ; <nl> + void setLineBreakWithoutSpace ( bool breakWithoutSpace ) ; <nl> + void setScale ( float scale ) ; <nl> + void setScaleX ( float scaleX ) ; <nl> + void setScaleY ( float scaleY ) ; <nl> + <nl> + void setFntFile ( const char * fntFile ) ; <nl> + const char * getFntFile ( ) ; <nl> <nl> void setColor ( const ccColor3B & color ) ; <nl> const ccColor3B & getColor ( void ) ; <nl> class CCLabelBMFont : public CCNode <nl> GLubyte getOpacity ( void ) ; <nl> void setOpacity ( GLubyte opacity ) ; <nl> <nl> + bool isOpacityModifyRGB ( ) ; <nl> + void setOpacityModifyRGB ( bool isOpacityModifyRGB ) ; <nl> + <nl> tolua_property__CCOpacity GLubyte opacity ; <nl> <nl> static void purgeCachedData ( ) ; <nl> - static CCLabelBMFont * create ( const char * str , const char * fntFile ) ; <nl> + static CCLabelBMFont * create ( ) ; <nl> + static CCLabelBMFont * create ( const char * str , const char * fntFile , float width = kCCLabelAutomaticWidth , CCTextAlignment alignment = kCCTextAlignmentLeft , CCPoint imageOffset = CCPointMake ( 0 , 0 ) ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCLabelTTF . pkg <nl> ppp b / tools / tolua + + / CCLabelTTF . pkg <nl> class CCLabelTTF : public CCSprite <nl> void setString ( const char * label ) ; <nl> const char * getString ( void ) ; <nl> <nl> - static CCLabelTTF * create ( const char * label , CCSize dimensions , CCTextAlignment hAlignment , CCVerticalTextAlignment vAlignment , const char * fontName , float fontSize ) ; <nl> - static CCLabelTTF * create ( const char * label , CCSize dimensions , CCTextAlignment alignment , const char * fontName , float fontSize ) ; <nl> - static CCLabelTTF * create ( const char * label , const char * fontName , float fontSize ) ; <nl> + CCTextAlignment getHorizontalAlignment ( ) ; <nl> + void setHorizontalAlignment ( CCTextAlignment alignment ) ; <nl> + <nl> + CCVerticalTextAlignment getVerticalAlignment ( ) ; <nl> + void setVerticalAlignment ( CCVerticalTextAlignment verticalAlignment ) ; <nl> + <nl> + CCSize getDimensions ( ) ; <nl> + void setDimensions ( CCSize & dim ) ; <nl> + <nl> + float getFontSize ( ) ; <nl> + void setFontSize ( float fontSize ) ; <nl> + <nl> + const char * getFontName ( ) ; <nl> + void setFontName ( const char * fontName ) ; <nl> + <nl> + static CCLabelTTF * create ( ) ; <nl> + static CCLabelTTF * create ( const char * str , const char * fontName , float fontSize ) ; <nl> + static CCLabelTTF * create ( const char * str , const char * fontName , float fontSize , const CCSize & dimensions , CCTextAlignment hAlignment ) ; <nl> + static CCLabelTTF * create ( const char * str , const char * fontName , float fontSize , const CCSize & dimensions , CCTextAlignment hAlignment , CCVerticalTextAlignment vAlignment ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCLayer . pkg <nl> ppp b / tools / tolua + + / CCLayer . pkg <nl> class CCLayerColor : public CCLayer <nl> void changeHeight ( GLfloat h ) ; <nl> void changeWidthAndHeight ( GLfloat w , GLfloat h ) ; <nl> <nl> + void setContentSize ( const CCSize & var ) ; <nl> + <nl> void setOpacity ( GLubyte var ) ; <nl> GLubyte getOpacity ( void ) ; <nl> void setColor ( ccColor3B Value ) ; <nl> class CCLayerColor : public CCLayer <nl> void setBlendFunc ( ccBlendFunc Value ) ; <nl> ccBlendFunc getBlendFunc ( void ) ; <nl> <nl> + void setOpacityModifyRGB ( bool bValue ) ; <nl> + bool isOpacityModifyRGB ( void ) ; <nl> + <nl> static CCLayerColor * create ( ccColor4B color , GLfloat width , GLfloat height ) ; <nl> static CCLayerColor * create ( ccColor4B color ) ; <nl> } ; <nl> class CCLayerMultiplex : public CCLayer <nl> void switchTo ( unsigned int n ) ; <nl> void switchToAndReleaseMe ( unsigned int n ) ; <nl> <nl> + static CCLayerMultiplex * create ( CCLayer * layer ) ; <nl> static CCLayerMultiplex * createWithLayer ( CCLayer * layer ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCMenu . pkg <nl> ppp b / tools / tolua + + / CCMenu . pkg <nl> <nl> / * <nl> - typedef enum <nl> + typedef enum <nl> { <nl> kCCMenuStateWaiting , <nl> kCCMenuStateTrackingTouch <nl> class CCMenu : public CCLayer <nl> void alignItemsInColumns ( unsigned int columns , va_list args ) ; <nl> void alignItemsInRows ( unsigned int rows , va_list args ) ; <nl> <nl> + setHandlerPriority ( int newPriority ) ; <nl> + <nl> void addChild ( CCMenuItem * child , int zOrder = 0 , int tag = - 1 ) ; <nl> <nl> void setOpacity ( GLubyte opacity ) ; <nl> class CCMenu : public CCLayer <nl> void setColor ( ccColor3B color ) ; <nl> ccColor3B getColor ( void ) ; <nl> <nl> + void setOpacityModifyRGB ( bool bValue ) ; <nl> + bool isOpacityModifyRGB ( void ) ; <nl> + <nl> + bool isEnabled ( ) ; <nl> + void setEnabled ( bool value ) ; <nl> + <nl> static CCMenu * create ( ) ; <nl> static CCMenu * createWithItem ( CCMenuItem * item ) ; <nl> + static CCMenu * createWithArray ( CCArray * pArrayOfItems ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCMenuItem . pkg <nl> ppp b / tools / tolua + + / CCMenuItem . pkg <nl> class CCMenuItemLabel : public CCMenuItem <nl> GLubyte getOpacity ( ) ; <nl> void setColor ( ccColor3B color ) ; <nl> ccColor3B getColor ( ) ; <nl> + void setDisabledColor ( const ccColor3B & color ) ; <nl> + const ccColor3B & getDisabledColor ( ) ; <nl> + void setLabel ( CCNode * pLabel ) ; <nl> + CCNode * getLabel ( ) ; <nl> + <nl> + void activate ( ) ; <nl> + void selected ( ) ; <nl> + void unselected ( ) ; <nl> + void setEnabled ( bool enabled ) ; <nl> + <nl> + void setOpacityModifyRGB ( bool bValue ) ; <nl> + bool isOpacityModifyRGB ( void ) ; <nl> <nl> static CCMenuItemLabel * create ( CCNode * label ) ; <nl> } ; <nl> class CCMenuItemAtlasFont : public CCMenuItem <nl> class CCMenuItemFont : public CCMenuItem <nl> { <nl> static void setFontSize ( int s ) ; <nl> - static int fontSize ( ) ; <nl> + static unsigned int fontSize ( ) ; <nl> static void setFontName ( const char * name ) ; <nl> static const char * fontName ( ) ; <nl> + void setFontSizeObj ( unsigned int s ) ; <nl> + unsigned int fontSizeObj ( ) ; <nl> + void setFontNameObj ( const char * name ) ; <nl> + const char * fontNameObj ( ) ; <nl> + <nl> static CCMenuItemFont * create ( const char * value ) ; <nl> } ; <nl> <nl> class CCMenuItemSprite : public CCMenuItem <nl> void setOpacity ( GLubyte opacity ) ; <nl> GLubyte getOpacity ( ) ; <nl> <nl> + void setNormalImage ( CCNode * pImage ) ; <nl> + CCNode * getNormalImage ( ) ; <nl> + void setSelectedImage ( CCNode * pImage ) ; <nl> + CCNode * getSelectedImage ( ) ; <nl> + void setDisabledImage ( CCNode * pImage ) ; <nl> + CCNode * getDisabledImage ( ) ; <nl> + <nl> + void selected ( ) ; <nl> + void unselected ( ) ; <nl> + void setEnabled ( bool bEnabled ) ; <nl> + <nl> + void setOpacityModifyRGB ( bool bValue ) ; <nl> + bool isOpacityModifyRGB ( void ) ; <nl> + <nl> static CCMenuItemSprite * create ( CCNode * normalSprite , <nl> CCNode * selectedSprite ) ; <nl> static CCMenuItemSprite * create ( CCNode * normalSprite , <nl> class CCMenuItemImage : public CCMenuItem <nl> void setOpacity ( GLubyte opacity ) ; <nl> GLubyte getOpacity ( ) ; <nl> <nl> + void setNormalSpriteFrame ( CCSpriteFrame * frame ) ; <nl> + void setSelectedSpriteFrame ( CCSpriteFrame * frame ) ; <nl> + void setDisabledSpriteFrame ( CCSpriteFrame * frame ) ; <nl> + <nl> + static CCMenuItemImage * create ( ) ; <nl> static CCMenuItemImage * create ( const char * normalImage , <nl> const char * selectedImage ) ; <nl> static CCMenuItemImage * create ( const char * normalImage , <nl> class CCMenuItemImage : public CCMenuItem <nl> <nl> class CCMenuItemToggle : public CCMenuItem <nl> { <nl> - void addSubItem ( CCMenuItem * item ) ; <nl> + void setColor ( ccColor3B color ) ; <nl> + ccColor3B getColor ( ) ; <nl> + void setOpacity ( GLubyte opacity ) ; <nl> + GLubyte getOpacity ( ) ; <nl> + void setSelectedIndex ( unsigned int index ) ; <nl> + unsigned int getSelectedIndex ( ) ; <nl> + void setSubItems ( CCArray * pArrayOfItems ) ; <nl> + CCArray * getSubItems ( ) ; <nl> + <nl> + void addSubItem ( CCMenuItem * item ) ; <nl> CCMenuItem * selectedItem ( ) ; <nl> <nl> + void activate ( ) ; <nl> + void selected ( ) ; <nl> + void unselected ( ) ; <nl> + void setEnabled ( bool var ) ; <nl> + <nl> + void setOpacityModifyRGB ( bool bValue ) ; <nl> + bool isOpacityModifyRGB ( void ) ; <nl> + <nl> static CCMenuItemToggle * create ( CCMenuItem * item ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCNode . pkg <nl> ppp b / tools / tolua + + / CCNode . pkg <nl> <nl> + enum { <nl> + kCCNodeTagInvalid = - 1 , <nl> + } ; <nl> <nl> enum { <nl> kCCNodeOnEnter , <nl> class CCNode : public CCObject <nl> float getPositionX ( ) ; <nl> float getPositionY ( ) ; <nl> void setPosition ( float x , float y ) ; <nl> + void setPosition ( CCPoint pos ) ; <nl> void setPositionX ( float x ) ; <nl> void setPositionY ( float y ) ; <nl> float getSkewX ( ) ; <nl> class CCNode : public CCObject <nl> CCPoint getAnchorPoint ( ) ; <nl> void setAnchorPoint ( CCPoint point ) ; <nl> CCSize getContentSize ( ) ; <nl> - void setContentSize ( CCSize size ) ; <nl> + void setContentSize ( const CCSize & size ) ; <nl> int getTag ( ) ; <nl> void setTag ( int var ) ; <nl> <nl> class CCNode : public CCObject <nl> / / CCPoint getAnchorPointInPixels ( ) ; <nl> / / CCSize getContentSizeInPixels ( ) ; <nl> / / void setContentSizeInPixels ( CCSize sz ) ; <nl> + CCPoint getAnchorPointInPoints ( ) ; <nl> bool isRunning ( ) ; <nl> CCNode * getParent ( ) ; <nl> void setParent ( CCNode * var ) ; <nl> class CCNode : public CCObject <nl> void ignoreAnchorPointForPosition ( bool newValue ) ; <nl> void * getUserData ( ) ; <nl> void setUserData ( void * var ) ; <nl> + CCObject * getUserObject ( ) ; <nl> + void setUserObject ( CCObject * pObject ) ; <nl> + CCGLProgram * getShaderProgram ( ) ; <nl> + void setShaderProgram ( CCGLProgram * pShaderProgram ) ; <nl> + int getOrderOfArrival ( ) ; <nl> + void setOrderOfArrival ( int order ) ; <nl> + ccGLServerState getGLServerState ( ) ; <nl> + void setGLServerState ( ccGLServerState state ) ; <nl> + CCActionManager * getActionManager ( ) ; <nl> + void setActionManager ( CCActionManager * pActionMgr ) ; <nl> + CCScheduler * getScheduler ( ) ; <nl> + void setScheduler ( CCScheduler * pScheduler ) ; <nl> void addChild ( CCNode * child ) ; <nl> void addChild ( CCNode * child , int zOrder ) ; <nl> void addChild ( CCNode * child , int zOrder , int tag ) ; <nl> mmm a / tools / tolua + + / CCObject . pkg <nl> ppp b / tools / tolua + + / CCObject . pkg <nl> class CCObject <nl> bool isSingleReference ( void ) ; <nl> unsigned int retainCount ( void ) ; <nl> bool isEqual ( const CCObject * pObject ) ; <nl> + CCObject * copy ( ) ; <nl> + CCObject * autorelease ( ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCParticleBatchNode . pkg <nl> ppp b / tools / tolua + + / CCParticleBatchNode . pkg <nl> <nl> class CCParticleBatchNode : public CCNode , public CCTextureProtocol <nl> { <nl> public : <nl> - static CCParticleBatchNode * create ( CCTexture2D * tex , unsigned int capacity = kCCParticleDefaultCapacity ) ; <nl> + static CCParticleBatchNode * createWithTexture ( CCTexture2D * tex , unsigned int capacity = kCCParticleDefaultCapacity ) ; <nl> static CCParticleBatchNode * create ( const char * fileImage , unsigned int capacity = kCCParticleDefaultCapacity ) ; <nl> <nl> virtual void addChild ( CCNode * child ) ; <nl> mmm a / tools / tolua + + / CCParticleSystem . pkg <nl> ppp b / tools / tolua + + / CCParticleSystem . pkg <nl> <nl> + enum { <nl> + kCCParticleDurationInfinity = - 1 , <nl> + kCCParticleStartSizeEqualToEndSize = - 1 , <nl> + kCCParticleStartRadiusEqualToEndRadius = - 1 , <nl> + kParticleStartSizeEqualToEndSize = kCCParticleStartSizeEqualToEndSize , <nl> + kParticleDurationInfinity = kCCParticleDurationInfinity , <nl> + } ; <nl> + <nl> + enum { <nl> + kCCParticleModeGravity , <nl> + kCCParticleModeRadius , <nl> + } ; <nl> + <nl> + typedef enum { <nl> + kCCPositionTypeFree , <nl> + kCCPositionTypeRelative , <nl> + kCCPositionTypeGrouped , <nl> + } tCCPositionType ; <nl> + <nl> + enum { <nl> + kPositionTypeFree = kCCPositionTypeFree , <nl> + kPositionTypeGrouped = kCCPositionTypeGrouped , <nl> + } ; <nl> <nl> class CCParticleSystem : public CCNode <nl> { <nl> / / mode A <nl> const CCPoint & getGravity ( ) ; <nl> - <nl> void setGravity ( const CCPoint & g ) ; <nl> float getSpeed ( ) ; <nl> void setSpeed ( float speed ) ; <nl> class CCParticleSystem : public CCNode <nl> void updateQuadWithParticle ( tCCParticle * particle , const CCPoint & newPosition ) ; <nl> void postStep ( ) ; <nl> <nl> + float getStartSize ( ) ; <nl> + float getStartSizeVar ( ) ; <nl> + float getEndSize ( ) ; <nl> + float getEndSizeVar ( ) ; <nl> + const ccColor4F & getStartColor ( ) ; <nl> + const ccColor4F & getStartColorVar ( ) ; <nl> + const ccColor4F & getEndColor ( ) ; <nl> + const ccColor4F & getEndColorVar ( ) ; <nl> + float getStartSpin ( ) ; <nl> + float getStartSpinVar ( ) ; <nl> + float getEndSpin ( ) ; <nl> + float getEndSpinVar ( ) ; <nl> + float getEmissionRate ( ) ; <nl> + unsigned int getTotalParticles ( ) ; <nl> + <nl> + bool isAutoRemoveOnFinish ( ) ; <nl> + void setAutoRemoveOnFinish ( bool var ) ; <nl> + int getEmitterMode ( ) ; <nl> + void setEmitterMode ( int mode ) ; <nl> + <nl> CCTexture2D * getTexture ( void ) ; <nl> void setTexture ( CCTexture2D * var ) ; <nl> <nl> class CCParticleSystem : public CCNode <nl> void setRotation ( float newRotation ) ; <nl> void setScaleX ( float newScaleX ) ; <nl> void setScaleY ( float newScaleY ) ; <nl> - <nl> + <nl> bool isActive ( ) ; <nl> bool isBlendAdditive ( ) ; <nl> void setBlendAdditive ( bool value ) ; <nl> class CCParticleSystem : public CCNode <nl> static CCParticleSystem * create ( const char * plistFile ) ; <nl> } ; <nl> <nl> - class CCParticleSystemQuad : public CCParticleSystem { <nl> + class CCParticleSystemQuad : public CCParticleSystem <nl> + { <nl> + void postStep ( ) ; <nl> + void setDisplayFrame ( CCSpriteFrame * spriteFrame ) ; <nl> + void setTexture ( CCTexture2D * texture ) ; <nl> + void setTextureWithRect ( CCTexture2D * texture , const CCRect & rect ) ; <nl> + void setBatchNode ( CCParticleBatchNode * batchNode ) ; <nl> + void setTotalParticles ( unsigned int tp ) ; <nl> + <nl> + void updateQuadWithParticle ( tCCParticle * particle , const CCPoint & newPosition ) ; <nl> + void postStep ( ) ; <nl> + void setTotalParticles ( unsigned int tp ) ; <nl> + <nl> + static CCParticleSystemQuad * create ( ) ; <nl> static CCParticleSystemQuad * create ( const char * plistFile ) ; <nl> } ; <nl> <nl> mmm a / tools / tolua + + / CCPointExtension . pkg <nl> ppp b / tools / tolua + + / CCPointExtension . pkg <nl> static CCPoint ccpProject ( const CCPoint & v1 , const CCPoint & v2 ) ; <nl> static CCPoint ccpRotate ( const CCPoint & v1 , const CCPoint & v2 ) ; <nl> static CCPoint ccpUnrotate ( const CCPoint & v1 , const CCPoint & v2 ) ; <nl> static CGFloat ccpLengthSQ ( const CCPoint & v ) ; <nl> + static CGFloat ccpDistanceSQ ( const CCPoint p1 , const CCPoint p2 ) ; <nl> CGFloat ccpLength ( const CCPoint & v ) ; <nl> CGFloat ccpDistance ( const CCPoint & v1 , const CCPoint & v2 ) ; <nl> CCPoint ccpNormalize ( const CCPoint & v ) ; <nl> mmm a / tools / tolua + + / CCScheduler . pkg <nl> ppp b / tools / tolua + + / CCScheduler . pkg <nl> class CCTimer : public CCObject <nl> float getInterval ( void ) ; <nl> void setInterval ( float fInterval ) ; <nl> void update ( float dt ) ; <nl> + <nl> + static CCTimer * timerWithScriptHandler ( LUA_FUNCTION funcID , float fSeconds ) ; <nl> } ; <nl> <nl> class CCScheduler : public CCObject <nl> class CCScheduler : public CCObject <nl> void unscheduleAllSelectorsForTarget ( CCObject * pTarget ) ; <nl> void unscheduleAllSelectors ( void ) ; <nl> <nl> + void unscheduleAllSelectorsWithMinPriority ( int nMinPriority ) ; <nl> + <nl> void pauseTarget ( CCObject * pTarget ) ; <nl> void resumeTarget ( CCObject * pTarget ) ; <nl> bool isTargetPaused ( CCObject * pTarget ) ; <nl> mmm a / tools / tolua + + / CCSprite . pkg <nl> ppp b / tools / tolua + + / CCSprite . pkg <nl> class CCSprite : public CCNode <nl> void setBlendFunc ( ccBlendFunc blendFunc ) ; <nl> ccBlendFunc getBlendFunc ( void ) ; <nl> <nl> - / / CCPoint getOffsetPositionInPixels ( void ) ; <nl> + CCPoint getOffsetPosition ( void ) ; <nl> <nl> void setDirtyRecursively ( bool bValue ) ; <nl> void ignoreAnchorPointForPosition ( bool newValue ) ; <nl> class CCSprite : public CCNode <nl> bool isFlipY ( void ) ; <nl> void updateColor ( void ) ; <nl> <nl> + void removeChild ( CCNode * pChild , bool bCleanUp ) ; <nl> + void removeAllChildrenWithCleanup ( bool bCleanup ) ; <nl> + void reorderChild ( CCNode * pChild , int zOrder ) ; <nl> + void addChild ( CCNode * pChild ) ; <nl> + void addChild ( CCNode * pChild , int zOrder ) ; <nl> + void addChild ( CCNode * pChild , int zOrder , int tag ) ; <nl> + void sortAllChildren ( ) ; <nl> + / / void setPosition ( CCPoint pos ) ; <nl> + void setRotation ( float rotation ) ; <nl> + void setSkewX ( float sx ) ; <nl> + void setSkewY ( float sy ) ; <nl> + void setScale ( float fScale ) ; <nl> + void setScaleX ( float fScaleX ) ; <nl> + void setScaleY ( float fScaleY ) ; <nl> + void setVertexZ ( float fVertexZ ) ; <nl> + void setAnchorPoint ( const CCPoint & anchor ) ; <nl> + void setVisible ( bool bVisible ) ; <nl> + <nl> void setOpacity ( GLubyte opacity ) ; <nl> GLubyte getOpacity ( void ) ; <nl> <nl> class CCSprite : public CCNode <nl> <nl> void updateTransform ( void ) ; <nl> / / void useSelfRender ( void ) ; <nl> - void setTextureRect ( CCRect rect ) ; <nl> - / / void setTextureRectInPixels ( CCRect rect , bool rotated , CCSize size ) ; <nl> + void setTextureRect ( CCRect rect ) ; <nl> + void setTextureRect ( CCRect rect , bool rotated , CCSize size ) ; <nl> + void setVertexRect ( CCRect rect ) ; <nl> / / void useBatchNode ( CCSpriteBatchNode * batchNode ) ; <nl> void setDisplayFrame ( CCSpriteFrame * pNewFrame ) ; <nl> bool isFrameDisplayed ( CCSpriteFrame * pFrame ) ; <nl> - / / CCSpriteFrame * displayedFrame ( void ) ; <nl> + CCSpriteFrame * displayFrame ( void ) ; <nl> + void setBatchNode ( CCSpriteBatchNode * pBatchNode ) ; <nl> + CCSpriteBatchNode * getBatchNode ( ) ; <nl> void setDisplayFrameWithAnimationName ( const char * animationName , int frameIndex ) ; <nl> <nl> - static CCSprite * create ( CCTexture2D * pTexture ) ; <nl> - static CCSprite * create ( CCTexture2D * pTexture , CCRect rect ) ; <nl> - / / static CCSprite * spriteWithTexture ( CCTexture2D * pTexture , CCRect rect , CCPoint offset ) ; <nl> - static CCSprite * create ( CCSpriteFrame * pSpriteFrame ) ; <nl> + static CCSprite * createWithTexture ( CCTexture2D * pTexture ) ; <nl> + static CCSprite * createWithTexture ( CCTexture2D * pTexture , CCRect rect ) ; <nl> + static CCSprite * createWithSpriteFrame ( CCSpriteFrame * pSpriteFrame ) ; <nl> static CCSprite * createWithSpriteFrameName ( const char * pszSpriteFrameName ) ; <nl> - static CCSprite * create ( const char * pszFileName ) ; <nl> + static CCSprite * create ( ) ; <nl> + static CCSprite * create ( const char * pszFileName ) ; <nl> static CCSprite * create ( const char * pszFileName , CCRect rect ) ; <nl> - / / static CCSprite * spriteWithBatchNode ( CCSpriteBatchNode * batchNode , CCRect rect ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCSpriteBatchNode . pkg <nl> ppp b / tools / tolua + + / CCSpriteBatchNode . pkg <nl> class CCSpriteBatchNode : public CCNode <nl> void increaseAtlasCapacity ( ) ; <nl> void removeChildAtIndex ( unsigned int index , bool doCleanup ) ; <nl> void insertChild ( CCSprite * child , unsigned int index ) ; <nl> + void appendChild ( CCSprite * child ) ; <nl> void removeSpriteFromAtlas ( CCSprite * sprite ) ; <nl> <nl> unsigned int rebuildIndexInOrder ( CCSprite * parent , unsigned int index ) ; <nl> class CCSpriteBatchNode : public CCNode <nl> unsigned int lowestAtlasIndexInChild ( CCSprite * sprite ) ; <nl> unsigned int atlasIndexForChild ( CCSprite * sprite , int z ) ; <nl> <nl> + void reorderBatch ( bool reorder ) ; <nl> void setTexture ( CCTexture2D * texture ) ; <nl> CCTexture2D * getTexture ( void ) ; <nl> void setBlendFunc ( ccBlendFunc blendFunc ) ; <nl> ccBlendFunc getBlendFunc ( void ) ; <nl> <nl> - static CCSpriteBatchNode * create ( CCTexture2D * tex ) ; <nl> - static CCSpriteBatchNode * create ( CCTexture2D * tex , unsigned int capacity ) ; <nl> + void addChild ( CCNode * child ) ; <nl> + void addChild ( CCNode * child , int zOrder ) ; <nl> + void addChild ( CCNode * child , int zOrder , int tag ) ; <nl> + void reorderChild ( CCNode * child , int zOrder ) ; <nl> + <nl> + void removeChild ( CCNode * child , bool cleanup ) ; <nl> + void removeAllChildrenWithCleanup ( bool cleanup ) ; <nl> + void sortAllChildren ( ) ; <nl> + <nl> + static CCSpriteBatchNode * createWithTexture ( CCTexture2D * tex ) ; <nl> + static CCSpriteBatchNode * createWithTexture ( CCTexture2D * tex , unsigned int capacity ) ; <nl> static CCSpriteBatchNode * create ( const char * fileImage ) ; <nl> static CCSpriteBatchNode * create ( const char * fileImage , unsigned int capacity ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCSpriteFrame . pkg <nl> ppp b / tools / tolua + + / CCSpriteFrame . pkg <nl> class CCSpriteFrame : public CCObject <nl> CCSize getOriginalSizeInPixels ( void ) ; <nl> void setOriginalSizeInPixels ( CCSize sizeInPixels ) ; <nl> <nl> - CCTexture2D * getTexture ( void ) ; <nl> + const CCSize & getOriginalSize ( ) ; <nl> + void setOriginalSize ( const CCSize & size ) ; <nl> + <nl> + CCTexture2D * getTexture ( void ) ; <nl> void setTexture ( CCTexture2D * pobTexture ) ; <nl> <nl> - static CCSpriteFrame * create ( CCTexture2D * pobTexture , CCRect rect ) ; <nl> - static CCSpriteFrame * create ( CCTexture2D * pobTexture , CCRect rect , bool rotated , CCPoint offset , CCSize originalSize ) ; <nl> - static CCSpriteFrame * create ( const char * filename , CCRect rect ) ; <nl> + const CCPoint & getOffset ( ) ; <nl> + void setOffset ( const CCPoint & offsets ) ; <nl> + <nl> + static CCSpriteFrame * create ( const char * filename , CCRect rect ) ; <nl> static CCSpriteFrame * create ( const char * filename , CCRect rect , bool rotated , CCPoint offset , CCSize originalSize ) ; <nl> + static CCSpriteFrame * createWithTexture ( CCTexture2D * pobTexture , CCRect rect ) ; <nl> + static CCSpriteFrame * createWithTexture ( CCTexture2D * pobTexture , CCRect rect , bool rotated , CCPoint offset , CCSize originalSize ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCString . pkg <nl> ppp b / tools / tolua + + / CCString . pkg <nl> class CCString : public CCObject <nl> const char * getCString ( ) const ; <nl> unsigned int length ( ) const ; <nl> <nl> + int compare ( const char * str ) const ; <nl> bool isEqual ( const CCObject * pObject ) ; <nl> <nl> static CCString * create ( const char * pStr ) ; <nl> - static CCString * create ( unsigned char * pData , unsigned long nLen ) ; <nl> + static CCString * createWithData ( unsigned char * pData , unsigned long nLen ) ; <nl> static CCString * createWithContentsOfFile ( const char * pszFileName ) ; <nl> } ; <nl> <nl> mmm a / tools / tolua + + / CCTMXLayer . pkg <nl> ppp b / tools / tolua + + / CCTMXLayer . pkg <nl> class CCTMXLayer : public CCSpriteBatchNode <nl> void releaseMap ( ) ; <nl> <nl> CCSprite * tileAt ( CCPoint tileCoordinate ) ; <nl> - unsigned int tileGIDAt ( CCPoint tileCoordinate ) ; <nl> - unsigned int tileGIDAt ( CCPoint tileCoordinate , ccTMXTileFlags * flags ) ; <nl> - void setTileGID ( unsigned int gid , CCPoint tileCoordinate ) ; <nl> - void setTileGID ( unsigned int gid , CCPoint tileCoordinate , ccTMXTileFlags flags ) ; <nl> + unsigned int tileGIDAt ( const CCPoint & tileCoordinate ) ; <nl> + void setTileGID ( unsigned int gid , const CCPoint & tileCoordinate ) ; <nl> + void setTileGID ( unsigned int gid , const CCPoint & tileCoordinate , ccTMXTileFlags flags ) ; <nl> void removeTileAt ( CCPoint tileCoordinate ) ; <nl> CCPoint positionAt ( CCPoint tileCoordinate ) ; <nl> CCString * propertyNamed ( const char * propertyName ) ; <nl> mmm a / tools / tolua + + / CCTMXTiledMap . pkg <nl> ppp b / tools / tolua + + / CCTMXTiledMap . pkg <nl> class CCTMXTiledMap : public CCNode <nl> CCDictionary * propertiesForGID ( int GID ) ; <nl> <nl> static CCTMXTiledMap * create ( const char * tmxFile ) ; <nl> + static CCTMXTiledMap * createWithXML ( const char * tmxString , const char * resourcePath ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCTMXXMLParser . pkg <nl> ppp b / tools / tolua + + / CCTMXXMLParser . pkg <nl> enum { <nl> TMXPropertyTile <nl> } ; <nl> <nl> + typedef enum ccTMXTileFlags_ { <nl> + kCCTMXTileHorizontalFlag = 0x80000000 , <nl> + kCCTMXTileVerticalFlag = 0x40000000 , <nl> + kCCTMXTileDiagonalFlag = 0x20000000 , <nl> + kCCFlipedAll = ( kCCTMXTileHorizontalFlag | kCCTMXTileVerticalFlag | kCCTMXTileDiagonalFlag ) , <nl> + kCCFlippedMask = ~ ( kCCFlipedAll ) <nl> + } ccTMXTileFlags ; <nl> + <nl> class CCTMXLayerInfo : public CCObject <nl> { <nl> CCDictionary * getProperties ( ) ; <nl> class CCTMXMapInfo : public CCObject <nl> void endElement ( void * ctx , const char * name ) ; <nl> void textHandler ( void * ctx , const char * ch , int len ) ; <nl> bool parseXMLFile ( const char * xmlFilename ) ; <nl> + bool parseXMLString ( const char * xmlString ) ; <nl> <nl> static CCTMXMapInfo * formatWithTMXFile ( const char * tmxFile ) ; <nl> + static CCTMXMapInfo * formatWithXML ( const char * tmxString , const char * resourcePath ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCTexture2D . pkg <nl> ppp b / tools / tolua + + / CCTexture2D . pkg <nl> typedef enum { <nl> <nl> class CCTexture2D : public CCObject <nl> { <nl> + void releaseData ( void * data ) ; <nl> + void * keepData ( void * data , unsigned int length ) ; <nl> + <nl> CCTexture2DPixelFormat getPixelFormat ( ) ; <nl> <nl> unsigned int getPixelsWide ( ) ; <nl> class CCTexture2D : public CCObject <nl> void setAliasTexParameters ( ) ; <nl> void generateMipmap ( ) ; <nl> <nl> - int bitsPerPixelForFormat ( ) ; <nl> + const char * stringForFormat ( ) ; <nl> + unsigned int bitsPerPixelForFormat ( ) ; <nl> + unsigned int bitsPerPixelForFormat ( CCTexture2DPixelFormat format ) ; <nl> <nl> static void setDefaultAlphaPixelFormat ( CCTexture2DPixelFormat format ) ; <nl> static CCTexture2DPixelFormat defaultAlphaPixelFormat ( ) ; <nl> mmm a / tools / tolua + + / CCTextureAtlas . pkg <nl> ppp b / tools / tolua + + / CCTextureAtlas . pkg <nl> class CCTextureAtlas : public CCObject <nl> void drawNumberOfQuads ( unsigned int n ) ; <nl> void drawNumberOfQuads ( unsigned int n , unsigned int start ) ; <nl> <nl> + void increaseTotalQuadsWith ( unsigned int amount ) ; <nl> + void moveQuadsFromIndex ( unsigned int oldIndex , unsigned int amount , unsigned int newIndex ) ; <nl> + void moveQuadsFromIndex ( unsigned int index , unsigned int newIndex ) ; <nl> + void fillWithEmptyQuadsFromIndex ( unsigned int index , unsigned int amount ) ; <nl> void drawQuads ( ) ; <nl> <nl> static CCTextureAtlas * create ( const char * file , unsigned int capacity ) ; <nl> - static CCTextureAtlas * create ( CCTexture2D * texture , unsigned int capacity ) ; <nl> + static CCTextureAtlas * createWithTexture ( CCTexture2D * texture , unsigned int capacity ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCTextureCache . pkg <nl> ppp b / tools / tolua + + / CCTextureCache . pkg <nl> class CCTextureCache : public CCObject <nl> CCTexture2D * addUIImage ( CCImage * image , const char * key ) ; <nl> CCTexture2D * textureForKey ( const char * key ) ; <nl> <nl> + CCTexture2D * addPVRImage ( const char * filename ) ; <nl> + <nl> void removeAllTextures ( ) ; <nl> void removeUnusedTextures ( ) ; <nl> void removeTexture ( CCTexture2D * texture ) ; <nl> mmm a / tools / tolua + + / CCTileMapAtlas . pkg <nl> ppp b / tools / tolua + + / CCTileMapAtlas . pkg <nl> class CCTileMapAtlas : public CCAtlasNode <nl> void setTile ( ccColor3B tile , ccGridSize position ) ; <nl> void releaseMap ( ) ; <nl> <nl> + ccColor3B tileAt ( const ccGridSize & pos ) ; <nl> + <nl> static CCTileMapAtlas * create ( const char * tile , const char * mapFile , int tileWidth , int tileHeight ) ; <nl> } ; <nl> mmm a / tools / tolua + + / CCTouch . pkg <nl> ppp b / tools / tolua + + / CCTouch . pkg <nl> enum { <nl> <nl> class CCTouch : public CCObject <nl> { <nl> - CCPoint locationInView ( ) ; <nl> - CCPoint previousLocationInView ( ) ; <nl> + CCPoint getLocation ( ) const ; <nl> + CCPoint getPreviousLocation ( ) const ; <nl> + CCPoint getDelta ( ) const ; <nl> + CCPoint getLocationInView ( ) const ; <nl> + CCPoint getPreviousLocationInView ( ) const ; <nl> + <nl> + void setTouchInfo ( int id , float x , float y ) ; <nl> int getID ( ) ; <nl> } ; <nl> <nl> mmm a / tools / tolua + + / CCUserDefault . pkg <nl> ppp b / tools / tolua + + / CCUserDefault . pkg <nl> class CCUserDefault <nl> void setDoubleForKey ( const char * pKey , double value ) ; <nl> void setStringForKey ( const char * pKey , std : : string value ) ; <nl> <nl> + void flush ( ) ; <nl> + <nl> static CCUserDefault * sharedUserDefault ( ) ; <nl> static void purgeSharedUserDefault ( ) ; <nl> const static std : : string & getXMLFilePath ( ) ; <nl> mmm a / tools / tolua + + / Cocos2d . pkg <nl> ppp b / tools / tolua + + / Cocos2d . pkg <nl> $ # include " LuaCocos2d . h " <nl> <nl> $ pfile " CCAction . pkg " <nl> $ pfile " CCActionCamera . pkg " <nl> + $ pfile " CCActionCatmullRom . pkg " <nl> $ pfile " CCActionEase . pkg " <nl> $ pfile " CCActionGrid . pkg " <nl> $ pfile " CCActionGrid3D . pkg " <nl> mmm a / tools / tolua + + / basic . lua <nl> ppp b / tools / tolua + + / basic . lua <nl> local CCObjectTypes = { <nl> " CCAccelDeccelAmplitude " , <nl> " CCActionCamera " , <nl> " CCOrbitCamera " , <nl> + " CCCardinalSplineTo " , <nl> + " CCCardinalSplineBy " , <nl> + " CCCatmullRomTo " , <nl> + " CCCatmullRomBy " , <nl> " CCActionEase " , <nl> " CCEaseBackIn " , <nl> " CCEaseBackInOut " , <nl> mmm a / tools / tolua + + / ccTypes . pkg <nl> ppp b / tools / tolua + + / ccTypes . pkg <nl> typedef float GLfloat ; <nl> <nl> typedef struct _ccColor3B <nl> { <nl> - GLubyte r ; <nl> - GLubyte g ; <nl> + GLubyte r ; <nl> + GLubyte g ; <nl> GLubyte b ; <nl> } ccColor3B ; <nl> <nl> static ccColor3B ccc3 ( const GLubyte r , const GLubyte g , const GLubyte b ) ; <nl> <nl> - / / static const ccColor3B ccWHITE ; <nl> + / / ! White color ( 255 , 255 , 255 ) <nl> + / / static const ccColor3B ccWHITE = { 255 , 255 , 255 } ; <nl> / / ! Yellow color ( 255 , 255 , 0 ) <nl> - / / static const ccColor3B ccYELLOW ; <nl> + / / static const ccColor3B ccYELLOW = { 255 , 255 , 0 } ; <nl> / / ! Blue color ( 0 , 0 , 255 ) <nl> - / / static const ccColor3B ccBLUE ; <nl> + / / static const ccColor3B ccBLUE = { 0 , 0 , 255 } ; <nl> / / ! Green Color ( 0 , 255 , 0 ) <nl> - / / static const ccColor3B ccGREEN ; <nl> + / / static const ccColor3B ccGREEN = { 0 , 255 , 0 } ; <nl> / / ! Red Color ( 255 , 0 , 0 , ) <nl> - / / static const ccColor3B ccRED ; <nl> + / / static const ccColor3B ccRED = { 255 , 0 , 0 } ; <nl> / / ! Magenta Color ( 255 , 0 , 255 ) <nl> - / / static const ccColor3B ccMAGENTA ; <nl> + / / static const ccColor3B ccMAGENTA = { 255 , 0 , 255 } ; <nl> / / ! Black Color ( 0 , 0 , 0 ) <nl> - / / static const ccColor3B ccBLACK ; <nl> + / / static const ccColor3B ccBLACK = { 0 , 0 , 0 } ; <nl> / / ! Orange Color ( 255 , 127 , 0 ) <nl> - / / static const ccColor3B ccORANGE ; <nl> + / / static const ccColor3B ccORANGE = { 255 , 127 , 0 } ; <nl> / / ! Gray Color ( 166 , 166 , 166 ) <nl> - / / static const ccColor3B ccGRAY ; <nl> + / / static const ccColor3B ccGRAY = { 166 , 166 , 166 } ; <nl> <nl> / * * RGBA color composed of 4 bytes <nl> @ since v0 . 8 <nl> typedef struct _ccColor4B <nl> GLubyte a ; <nl> } ccColor4B ; <nl> / / ! helper macro that creates an ccColor4B type <nl> - static ccColor4B ccc4 ( const GLubyte r , const GLubyte g , const GLubyte b , const GLubyte o ) ; <nl> + static ccColor4B ccc4 ( const GLubyte r , const GLubyte g , const GLubyte b , const GLubyte o ) ; <nl> <nl> <nl> / * * RGBA color composed of 4 floats <nl> typedef struct _ccColor4F { <nl> GLfloat a ; <nl> } ccColor4F ; <nl> <nl> + <nl> / * * Returns a ccColor4F from a ccColor3B . Alpha will be 1 . <nl> @ since v0 . 99 . 1 <nl> * / <nl> - static ccColor4F ccc4FFromccc3B ( ccColor3B c ) ; <nl> + static ccColor4F ccc4FFromccc3B ( ccColor3B c ) ; <nl> + <nl> + / / ! helper that creates a ccColor4f type <nl> + static ccColor4F ccc4f ( const GLfloat r , const GLfloat g , const GLfloat b , const GLfloat a ) ; <nl> + <nl> / * * Returns a ccColor4F from a ccColor4B . <nl> @ since v0 . 99 . 1 <nl> * / <nl> typedef struct _ccVertex2F <nl> GLfloat y ; <nl> } ccVertex2F ; <nl> <nl> - static ccVertex2F vertex2 ( const float x , const float y ) ; <nl> + static ccVertex2F vertex2 ( const float x , const float y ) ; <nl> <nl> <nl> / * * A vertex composed of 2 floats : x , y <nl> typedef struct _ccVertex3F <nl> GLfloat z ; <nl> } ccVertex3F ; <nl> <nl> - static ccVertex3F vertex3 ( const float x , const float y , const float z ) ; <nl> + static ccVertex3F vertex3 ( const float x , const float y , const float z ) ; <nl> <nl> / * * A texcoord composed of 2 floats : u , y <nl> @ since v0 . 8 <nl> * / <nl> typedef struct _ccTex2F { <nl> - GLfloat u ; <nl> - GLfloat v ; <nl> + GLfloat u ; <nl> + GLfloat v ; <nl> } ccTex2F ; <nl> <nl> - static ccTex2F tex2 ( const float u , const float v ) ; <nl> - <nl> + static ccTex2F tex2 ( const float u , const float v ) ; <nl> <nl> <nl> / / ! Point Sprite component <nl> typedef struct _ccPointSprite <nl> { <nl> - ccVertex2F pos ; / / 8 bytes <nl> - ccColor4B color ; / / 4 bytes <nl> - GLfloat size ; / / 4 bytes <nl> + ccVertex2F pos ; / / 8 bytes <nl> + ccColor4B color ; / / 4 bytes <nl> + GLfloat size ; / / 4 bytes <nl> } ccPointSprite ; <nl> <nl> - / / ! A 2D Quad . 4 * 2 floats <nl> + / / ! A 2D Quad . 4 * 2 floats <nl> typedef struct _ccQuad2 { <nl> - ccVertex2F tl ; <nl> - ccVertex2F tr ; <nl> - ccVertex2F bl ; <nl> - ccVertex2F br ; <nl> + ccVertex2F tl ; <nl> + ccVertex2F tr ; <nl> + ccVertex2F bl ; <nl> + ccVertex2F br ; <nl> } ccQuad2 ; <nl> <nl> <nl> - / / ! A 3D Quad . 4 * 3 floats <nl> + / / ! A 3D Quad . 4 * 3 floats <nl> typedef struct _ccQuad3 { <nl> - ccVertex3F bl ; <nl> - ccVertex3F br ; <nl> - ccVertex3F tl ; <nl> - ccVertex3F tr ; <nl> + ccVertex3F bl ; <nl> + ccVertex3F br ; <nl> + ccVertex3F tl ; <nl> + ccVertex3F tr ; <nl> } ccQuad3 ; <nl> <nl> / / ! A 2D grid size <nl> typedef struct _ccGridSize <nl> { <nl> - int x ; <nl> - int y ; <nl> + int x ; <nl> + int y ; <nl> } ccGridSize ; <nl> <nl> / / ! helper function to create a ccGridSize <nl> - static ccGridSize ccg ( const int x , const int y ) ; <nl> + static ccGridSize ccg ( const int x , const int y ) ; <nl> <nl> / / ! a Point with a vertex point , a tex coord point and a color 4B <nl> typedef struct _ccV2F_C4B_T2F <nl> { <nl> / / ! vertices ( 2F ) <nl> - ccVertex2F vertices ; <nl> + ccVertex2F vertices ; <nl> / / ! colors ( 4B ) <nl> - ccColor4B colors ; <nl> + ccColor4B colors ; <nl> / / ! tex coords ( 2F ) <nl> - ccTex2F texCoords ; <nl> + ccTex2F texCoords ; <nl> } ccV2F_C4B_T2F ; <nl> <nl> / / ! a Point with a vertex point , a tex coord point and a color 4F <nl> typedef struct _ccV2F_C4F_T2F <nl> { <nl> / / ! vertices ( 2F ) <nl> - ccVertex2F vertices ; <nl> + ccVertex2F vertices ; <nl> / / ! colors ( 4F ) <nl> - ccColor4F colors ; <nl> + ccColor4F colors ; <nl> / / ! tex coords ( 2F ) <nl> - ccTex2F texCoords ; <nl> + ccTex2F texCoords ; <nl> } ccV2F_C4F_T2F ; <nl> <nl> / / ! a Point with a vertex point , a tex coord point and a color 4B <nl> typedef struct _ccV3F_C4B_T2F <nl> { <nl> / / ! vertices ( 3F ) <nl> - ccVertex3F vertices ; / / 12 bytes <nl> - / / char __padding__ [ 4 ] ; <nl> + ccVertex3F vertices ; / / 12 bytes <nl> + / / char __padding__ [ 4 ] ; <nl> <nl> / / ! colors ( 4B ) <nl> - ccColor4B colors ; / / 4 bytes <nl> - / / char __padding2__ [ 4 ] ; <nl> + ccColor4B colors ; / / 4 bytes <nl> + / / char __padding2__ [ 4 ] ; <nl> <nl> / / tex coords ( 2F ) <nl> - ccTex2F texCoords ; / / 8 byts <nl> + ccTex2F texCoords ; / / 8 byts <nl> } ccV3F_C4B_T2F ; <nl> <nl> / / ! 4 ccVertex2FTex2FColor4B Quad <nl> typedef struct _ccV2F_C4B_T2F_Quad <nl> { <nl> / / ! bottom left <nl> - ccV2F_C4B_T2F bl ; <nl> + ccV2F_C4B_T2F bl ; <nl> / / ! bottom right <nl> - ccV2F_C4B_T2F br ; <nl> + ccV2F_C4B_T2F br ; <nl> / / ! top left <nl> - ccV2F_C4B_T2F tl ; <nl> + ccV2F_C4B_T2F tl ; <nl> / / ! top right <nl> - ccV2F_C4B_T2F tr ; <nl> + ccV2F_C4B_T2F tr ; <nl> } ccV2F_C4B_T2F_Quad ; <nl> <nl> / / ! 4 ccVertex3FTex2FColor4B <nl> typedef struct _ccV3F_C4B_T2F_Quad <nl> { <nl> / / ! top left <nl> - ccV3F_C4B_T2F tl ; <nl> + ccV3F_C4B_T2F tl ; <nl> / / ! bottom left <nl> - ccV3F_C4B_T2F bl ; <nl> + ccV3F_C4B_T2F bl ; <nl> / / ! top right <nl> - ccV3F_C4B_T2F tr ; <nl> + ccV3F_C4B_T2F tr ; <nl> / / ! bottom right <nl> - ccV3F_C4B_T2F br ; <nl> + ccV3F_C4B_T2F br ; <nl> } ccV3F_C4B_T2F_Quad ; <nl> <nl> / / ! 4 ccVertex2FTex2FColor4F Quad <nl> typedef struct _ccV2F_C4F_T2F_Quad <nl> { <nl> / / ! bottom left <nl> - ccV2F_C4F_T2F bl ; <nl> + ccV2F_C4F_T2F bl ; <nl> / / ! bottom right <nl> - ccV2F_C4F_T2F br ; <nl> + ccV2F_C4F_T2F br ; <nl> / / ! top left <nl> - ccV2F_C4F_T2F tl ; <nl> + ccV2F_C4F_T2F tl ; <nl> / / ! top right <nl> - ccV2F_C4F_T2F tr ; <nl> + ccV2F_C4F_T2F tr ; <nl> } ccV2F_C4F_T2F_Quad ; <nl> <nl> / / ! Blend Function used for textures <nl> typedef struct _ccBlendFunc <nl> GLenum dst ; <nl> } ccBlendFunc ; <nl> <nl> - / / ! delta time type <nl> - / / ! if you want more resolution redefine it as a double <nl> - <nl> - / / typedef double float ; <nl> - <nl> + / / XXX : If any of these enums are edited and / or reordered , udpate CCTexture2D . m <nl> + / / ! Vertical text alignment type <nl> typedef enum <nl> { <nl> kCCVerticalTextAlignmentTop , <nl> typedef enum <nl> kCCTextAlignmentRight , <nl> } CCTextAlignment ; <nl> <nl> + / / types for animation in particle systems <nl> + <nl> + / / texture coordinates for a quad <nl> + typedef struct _ccT2F_Quad <nl> + { <nl> + / / ! bottom left <nl> + ccTex2F bl ; <nl> + / / ! bottom right <nl> + ccTex2F br ; <nl> + / / ! top left <nl> + ccTex2F tl ; <nl> + / / ! top right <nl> + ccTex2F tr ; <nl> + } ccT2F_Quad ; <nl> + <nl> + / / struct that holds the size in pixels , texture coordinates and delays for animated CCParticleSystemQuad <nl> + typedef struct <nl> + { <nl> + ccT2F_Quad texCoords ; <nl> + float delay ; <nl> + CCSize size ; <nl> + } ccAnimationFrameData ; <nl> | Merge pull request from mustime / testlua | cocos2d/cocos2d-x | 333533082dec4cb6ccba0ed8f9eb658356dd52b3 | 2012-08-10T12:18:02Z |
mmm a / contracts / bancor / bancor . hpp <nl> ppp b / contracts / bancor / bancor . hpp <nl> <nl> * / <nl> # pragma once <nl> <nl> - # include < eosiolib / eos . hpp > <nl> + # include < eosiolib / eosio . hpp > <nl> # include < eosiolib / token . hpp > <nl> # include < eosiolib / reflect . hpp > <nl> # include < eosiolib / generic_currency . hpp > <nl> | Merge pull request from LeonBCK / master | EOSIO/eos | 2ca45172d853e53eabcedd1f96ff7e268e53017c | 2018-05-23T19:30:58Z |
mmm a / torch / csrc / jit / ir . cpp <nl> ppp b / torch / csrc / jit / ir . cpp <nl> <nl> <nl> # include < c10 / util / Exception . h > <nl> # include < torch / csrc / jit / constants . h > <nl> + # include < torch / csrc / jit / function . h > <nl> # include < torch / csrc / jit / operator . h > <nl> # include < torch / csrc / jit / passes / python_print . h > <nl> # include < torch / csrc / jit / script / schema_matching . h > <nl> Node * Graph : : createLoad ( const std : : string & name , const TypePtr & type ) { <nl> Value * Graph : : insertFunctionCall ( <nl> Function * callee , <nl> script : : MatchedSchema & matched ) { <nl> + std : : string func_name = callee - > name ( ) ; <nl> Value * fn_constant = insertNode ( create ( prim : : Constant ) ) <nl> + - > s_ ( attr : : name , func_name ) <nl> - > output ( ) <nl> - > setType ( FunctionType : : create ( std : : move ( callee ) ) ) ; <nl> std : : vector < Value * > inputs = { fn_constant } ; <nl> | Record function name as an attribute of CallFunction nodes . | pytorch/pytorch | 85564c1456bbe8ea3191ee23923d8471563b9336 | 2019-08-18T22:36:30Z |
mmm a / include / swift / SIL / SILFunction . h <nl> ppp b / include / swift / SIL / SILFunction . h <nl> <nl> # include " llvm / ADT / StringMap . h " <nl> <nl> / / / The symbol name used for the program entry point function . <nl> - / / / FIXME : Hardcoding this is lame . <nl> # define SWIFT_ENTRY_POINT_FUNCTION " main " <nl> <nl> namespace swift { <nl> enum IsDynamicallyReplaceable_t { <nl> IsNotDynamic , <nl> IsDynamic <nl> } ; <nl> + enum IsExactSelfClass_t { <nl> + IsNotExactSelfClass , <nl> + IsExactSelfClass , <nl> + } ; <nl> <nl> class SILSpecializeAttr final { <nl> friend SILFunction ; <nl> class SILFunction <nl> <nl> / / / Whether the implementation can be dynamically replaced . <nl> unsigned IsDynamicReplaceable : 1 ; <nl> + <nl> + / / / If true , this indicates that a class method implementation will always be <nl> + / / / invoked with a ` self ` argument of the exact base class type . <nl> + unsigned ExactSelfClass : 1 ; <nl> <nl> / / / If ! = OptimizationMode : : NotSet , the optimization mode specified with an <nl> / / / function attribute . <nl> class SILFunction <nl> SubclassScope classSubclassScope , Inline_t inlineStrategy , <nl> EffectsKind E , SILFunction * insertBefore , <nl> const SILDebugScope * debugScope , <nl> - IsDynamicallyReplaceable_t isDynamic ) ; <nl> + IsDynamicallyReplaceable_t isDynamic , <nl> + IsExactSelfClass_t isExactSelfClass ) ; <nl> <nl> static SILFunction * <nl> create ( SILModule & M , SILLinkage linkage , StringRef name , <nl> class SILFunction <nl> Optional < SILLocation > loc , IsBare_t isBareSILFunction , <nl> IsTransparent_t isTrans , IsSerialized_t isSerialized , <nl> ProfileCounter entryCount , IsDynamicallyReplaceable_t isDynamic , <nl> + IsExactSelfClass_t isExactSelfClass , <nl> IsThunk_t isThunk = IsNotThunk , <nl> SubclassScope classSubclassScope = SubclassScope : : NotApplicable , <nl> Inline_t inlineStrategy = InlineDefault , <nl> class SILFunction <nl> IsWeakLinked = value ; <nl> } <nl> <nl> - / / / Returs whether this function implementation can be dynamically replaced . <nl> + / / / Returns whether this function implementation can be dynamically replaced . <nl> IsDynamicallyReplaceable_t isDynamicallyReplaceable ( ) const { <nl> return IsDynamicallyReplaceable_t ( IsDynamicReplaceable ) ; <nl> } <nl> class SILFunction <nl> IsDynamicReplaceable = value ; <nl> assert ( ! Transparent | | ! IsDynamicReplaceable ) ; <nl> } <nl> + <nl> + IsExactSelfClass_t isExactSelfClass ( ) const { <nl> + return IsExactSelfClass_t ( ExactSelfClass ) ; <nl> + } <nl> + void setIsExactSelfClass ( IsExactSelfClass_t t ) { <nl> + ExactSelfClass = t ; <nl> + } <nl> <nl> / / / Get the DeclContext of this function . ( Debug info only ) . <nl> DeclContext * getDeclContext ( ) const { <nl> mmm a / include / swift / Serialization / ModuleFormat . h <nl> ppp b / include / swift / Serialization / ModuleFormat . h <nl> const uint16_t SWIFTMODULE_VERSION_MAJOR = 0 ; <nl> / / / describe what change you made . The content of this comment isn ' t important ; <nl> / / / it just ensures a conflict if two people change the module format . <nl> / / / Don ' t worry about adhering to the 80 - column limit for this line . <nl> - const uint16_t SWIFTMODULE_VERSION_MINOR = 506 ; / / transparent accessor bit <nl> + const uint16_t SWIFTMODULE_VERSION_MINOR = 507 ; / / exact_self_class sil attr <nl> <nl> using DeclIDField = BCFixed < 31 > ; <nl> <nl> mmm a / lib / IRGen / GenHeap . cpp <nl> ppp b / lib / IRGen / GenHeap . cpp <nl> llvm : : Value * IRGenFunction : : getLocalSelfMetadata ( ) { <nl> break ; <nl> case ObjectReference : <nl> LocalSelf = emitDynamicTypeOfOpaqueHeapObject ( * this , LocalSelf , <nl> - MetatypeRepresentation : : Thick ) ; <nl> + MetatypeRepresentation : : Thick ) ; <nl> SelfKind = SwiftMetatype ; <nl> break ; <nl> } <nl> mmm a / lib / IRGen / GenType . cpp <nl> ppp b / lib / IRGen / GenType . cpp <nl> unsigned IRGenModule : : getBuiltinIntegerWidth ( BuiltinIntegerWidth w ) { <nl> llvm_unreachable ( " impossible width value " ) ; <nl> } <nl> <nl> - void IRGenFunction : : setLocalSelfMetadata ( CanType selfBaseTy , <nl> + void IRGenFunction : : setLocalSelfMetadata ( CanType exactSelfClass , <nl> llvm : : Value * value , <nl> IRGenFunction : : LocalSelfKind kind ) { <nl> assert ( ! LocalSelf & & " already have local self metadata " ) ; <nl> LocalSelf = value ; <nl> - assert ( selfBaseTy - > getClassOrBoundGenericClass ( ) <nl> + assert ( ( ! exactSelfClass | | exactSelfClass - > getClassOrBoundGenericClass ( ) ) <nl> & & " self type not a class ? " ) ; <nl> - LocalSelfType = selfBaseTy ; <nl> + ExactSelfType = exactSelfClass ; <nl> SelfKind = kind ; <nl> } <nl> <nl> mmm a / lib / IRGen / IRGenFunction . h <nl> ppp b / lib / IRGen / IRGenFunction . h <nl> class IRGenFunction { <nl> <nl> / / / The value that satisfies metadata lookups for dynamic Self . <nl> llvm : : Value * LocalSelf = nullptr ; <nl> - CanType LocalSelfType ; <nl> + / / / If set , the dynamic Self type is assumed to be equivalent to this exact class . <nl> + CanType ExactSelfType ; <nl> LocalSelfKind SelfKind ; <nl> } ; <nl> <nl> mmm a / lib / IRGen / IRGenSIL . cpp <nl> ppp b / lib / IRGen / IRGenSIL . cpp <nl> static void emitLocalSelfMetadata ( IRGenSILFunction & IGF ) { <nl> llvm : : Value * value = IGF . getLoweredExplosion ( selfArg ) . claimNext ( ) ; <nl> if ( auto dynSelfTy = dyn_cast < DynamicSelfType > ( selfTy ) ) <nl> selfTy = dynSelfTy . getSelfType ( ) ; <nl> - IGF . setLocalSelfMetadata ( selfTy , value , selfKind ) ; <nl> + <nl> + / / Specify the exact Self type if we know it , either because the class <nl> + / / is final , or because the function we ' re emitting is a method with the <nl> + / / [ exact_self_class ] attribute set on it during the SIL pipeline . <nl> + CanType exactSelfTy ; <nl> + if ( selfTy - > getClassOrBoundGenericClass ( ) - > isFinal ( ) <nl> + | | IGF . CurSILFn - > isExactSelfClass ( ) ) <nl> + exactSelfTy = selfTy ; <nl> + <nl> + IGF . setLocalSelfMetadata ( exactSelfTy , value , selfKind ) ; <nl> } <nl> <nl> / / / Emit the definition for the given SIL constant . <nl> mmm a / lib / IRGen / MetadataRequest . cpp <nl> ppp b / lib / IRGen / MetadataRequest . cpp <nl> IRGenFunction : : emitTypeMetadataRef ( CanType type , <nl> / / Look through any opaque types we ' re allowed to . <nl> type = IGM . substOpaqueTypesWithUnderlyingTypes ( type ) ; <nl> <nl> - / / If we ' re asking for the metadata of the base Self type , and the class <nl> - / / is final , we can use the local self metadata . <nl> - if ( LocalSelfType = = type <nl> - & & LocalSelfType . getClassOrBoundGenericClass ( ) - > isFinal ( ) ) { <nl> + / / If we ' re asking for the metadata of the type that dynamic Self is known <nl> + / / to be equal to , we can just use the self metadata . <nl> + if ( ExactSelfType = = type ) { <nl> return MetadataResponse : : forComplete ( getLocalSelfMetadata ( ) ) ; <nl> } <nl> <nl> mmm a / lib / ParseSIL / ParseSIL . cpp <nl> ppp b / lib / ParseSIL / ParseSIL . cpp <nl> static bool parseDeclSILOptional ( bool * isTransparent , <nl> bool * hasOwnershipSSA , <nl> IsThunk_t * isThunk , <nl> IsDynamicallyReplaceable_t * isDynamic , <nl> + IsExactSelfClass_t * isExactSelfClass , <nl> SILFunction * * dynamicallyReplacedFunction , <nl> Identifier * objCReplacementFor , <nl> bool * isGlobalInit , <nl> static bool parseDeclSILOptional ( bool * isTransparent , <nl> * isSerialized = IsSerialized ; <nl> else if ( isDynamic & & SP . P . Tok . getText ( ) = = " dynamically_replacable " ) <nl> * isDynamic = IsDynamic ; <nl> + else if ( isExactSelfClass & & SP . P . Tok . getText ( ) = = " exact_self_class " ) <nl> + * isExactSelfClass = IsExactSelfClass ; <nl> else if ( isSerialized & & SP . P . Tok . getText ( ) = = " serializable " ) <nl> * isSerialized = IsSerializable ; <nl> else if ( isCanonical & & SP . P . Tok . getText ( ) = = " canonical " ) <nl> bool SILParserTUState : : parseDeclSIL ( Parser & P ) { <nl> IsSerialized_t isSerialized = IsNotSerialized ; <nl> bool isCanonical = false ; <nl> IsDynamicallyReplaceable_t isDynamic = IsNotDynamic ; <nl> + IsExactSelfClass_t isExactSelfClass = IsNotExactSelfClass ; <nl> bool hasOwnershipSSA = false ; <nl> IsThunk_t isThunk = IsNotThunk ; <nl> bool isGlobalInit = false , isWeakLinked = false ; <nl> bool SILParserTUState : : parseDeclSIL ( Parser & P ) { <nl> if ( parseSILLinkage ( FnLinkage , P ) | | <nl> parseDeclSILOptional ( <nl> & isTransparent , & isSerialized , & isCanonical , & hasOwnershipSSA , <nl> - & isThunk , & isDynamic , & DynamicallyReplacedFunction , <nl> + & isThunk , & isDynamic , & isExactSelfClass , & DynamicallyReplacedFunction , <nl> & objCReplacementFor , & isGlobalInit , & inlineStrategy , & optimizationMode , nullptr , <nl> & isWeakLinked , & isWithoutActuallyEscapingThunk , & Semantics , <nl> & SpecAttrs , & ClangDecl , & MRK , FunctionState , M ) | | <nl> bool SILParserTUState : : parseDeclSIL ( Parser & P ) { <nl> FunctionState . F - > setOwnershipEliminated ( ) ; <nl> FunctionState . F - > setThunk ( IsThunk_t ( isThunk ) ) ; <nl> FunctionState . F - > setIsDynamic ( isDynamic ) ; <nl> + FunctionState . F - > setIsExactSelfClass ( isExactSelfClass ) ; <nl> FunctionState . F - > setDynamicallyReplacedFunction ( <nl> DynamicallyReplacedFunction ) ; <nl> if ( ! objCReplacementFor . empty ( ) ) <nl> bool SILParserTUState : : parseSILGlobal ( Parser & P ) { <nl> SILParser State ( P ) ; <nl> if ( parseSILLinkage ( GlobalLinkage , P ) | | <nl> parseDeclSILOptional ( nullptr , & isSerialized , nullptr , nullptr , nullptr , <nl> - nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , <nl> - & isLet , nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , State , M ) | | <nl> + nullptr , nullptr , nullptr , nullptr , nullptr , <nl> + nullptr , nullptr , <nl> + & isLet , nullptr , nullptr , nullptr , nullptr , nullptr , <nl> + nullptr , State , M ) | | <nl> P . parseToken ( tok : : at_sign , diag : : expected_sil_value_name ) | | <nl> P . parseIdentifier ( GlobalName , NameLoc , diag : : expected_sil_value_name ) | | <nl> P . parseToken ( tok : : colon , diag : : expected_sil_type ) ) <nl> bool SILParserTUState : : parseSILProperty ( Parser & P ) { <nl> IsSerialized_t Serialized = IsNotSerialized ; <nl> if ( parseDeclSILOptional ( nullptr , & Serialized , nullptr , nullptr , nullptr , <nl> nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , <nl> - nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , SP , M ) ) <nl> + nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , <nl> + nullptr , nullptr , SP , M ) ) <nl> return true ; <nl> <nl> ValueDecl * VD ; <nl> bool SILParserTUState : : parseSILVTable ( Parser & P ) { <nl> IsSerialized_t Serialized = IsNotSerialized ; <nl> if ( parseDeclSILOptional ( nullptr , & Serialized , nullptr , nullptr , nullptr , <nl> nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , <nl> - nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , <nl> + nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , <nl> + nullptr , nullptr , <nl> VTableState , M ) ) <nl> return true ; <nl> <nl> bool SILParserTUState : : parseSILWitnessTable ( Parser & P ) { <nl> IsSerialized_t isSerialized = IsNotSerialized ; <nl> if ( parseDeclSILOptional ( nullptr , & isSerialized , nullptr , nullptr , nullptr , <nl> nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , <nl> - nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , <nl> + nullptr , nullptr , nullptr , nullptr , nullptr , nullptr , <nl> + nullptr , nullptr , <nl> WitnessState , M ) ) <nl> return true ; <nl> <nl> mmm a / lib / SIL / SILFunction . cpp <nl> ppp b / lib / SIL / SILFunction . cpp <nl> SILFunction : : create ( SILModule & M , SILLinkage linkage , StringRef name , <nl> GenericEnvironment * genericEnv , Optional < SILLocation > loc , <nl> IsBare_t isBareSILFunction , IsTransparent_t isTrans , <nl> IsSerialized_t isSerialized , ProfileCounter entryCount , <nl> - IsDynamicallyReplaceable_t isDynamic , IsThunk_t isThunk , <nl> + IsDynamicallyReplaceable_t isDynamic , <nl> + IsExactSelfClass_t isExactSelfClass , <nl> + IsThunk_t isThunk , <nl> SubclassScope classSubclassScope , Inline_t inlineStrategy , <nl> EffectsKind E , SILFunction * insertBefore , <nl> const SILDebugScope * debugScope ) { <nl> SILFunction : : create ( SILModule & M , SILLinkage linkage , StringRef name , <nl> auto fn = new ( M ) SILFunction ( M , linkage , name , loweredType , genericEnv , loc , <nl> isBareSILFunction , isTrans , isSerialized , <nl> entryCount , isThunk , classSubclassScope , <nl> - inlineStrategy , E , insertBefore , debugScope , isDynamic ) ; <nl> + inlineStrategy , E , insertBefore , debugScope , <nl> + isDynamic , isExactSelfClass ) ; <nl> <nl> if ( entry ) entry - > setValue ( fn ) ; <nl> return fn ; <nl> SILFunction : : SILFunction ( SILModule & Module , SILLinkage Linkage , StringRef Name , <nl> Inline_t inlineStrategy , EffectsKind E , <nl> SILFunction * InsertBefore , <nl> const SILDebugScope * DebugScope , <nl> - IsDynamicallyReplaceable_t isDynamic ) <nl> + IsDynamicallyReplaceable_t isDynamic , <nl> + IsExactSelfClass_t isExactSelfClass ) <nl> : Module ( Module ) , Name ( Name ) , LoweredType ( LoweredType ) , <nl> GenericEnv ( genericEnv ) , SpecializationInfo ( nullptr ) , <nl> DebugScope ( DebugScope ) , Bare ( isBareSILFunction ) , Transparent ( isTrans ) , <nl> SILFunction : : SILFunction ( SILModule & Module , SILLinkage Linkage , StringRef Name , <nl> ClassSubclassScope ( unsigned ( classSubclassScope ) ) , GlobalInitFlag ( false ) , <nl> InlineStrategy ( inlineStrategy ) , Linkage ( unsigned ( Linkage ) ) , <nl> HasCReferences ( false ) , IsWeakLinked ( false ) , <nl> - IsDynamicReplaceable ( isDynamic ) , OptMode ( OptimizationMode : : NotSet ) , <nl> + IsDynamicReplaceable ( isDynamic ) , <nl> + ExactSelfClass ( isExactSelfClass ) , <nl> + OptMode ( OptimizationMode : : NotSet ) , <nl> EffectsKindAttr ( E ) , EntryCount ( entryCount ) { <nl> assert ( ! Transparent | | ! IsDynamicReplaceable ) ; <nl> validateSubclassScope ( classSubclassScope , isThunk , nullptr ) ; <nl> mmm a / lib / SIL / SILFunctionBuilder . cpp <nl> ppp b / lib / SIL / SILFunctionBuilder . cpp <nl> SILFunction * SILFunctionBuilder : : getOrCreateFunction ( <nl> <nl> auto fn = SILFunction : : create ( mod , linkage , name , type , nullptr , loc , <nl> isBareSILFunction , isTransparent , isSerialized , <nl> - entryCount , isDynamic , isThunk , subclassScope ) ; <nl> + entryCount , isDynamic , IsNotExactSelfClass , <nl> + isThunk , subclassScope ) ; <nl> fn - > setDebugScope ( new ( mod ) SILDebugScope ( loc , fn ) ) ; <nl> return fn ; <nl> } <nl> SILFunctionBuilder : : getOrCreateFunction ( SILLocation loc , SILDeclRef constant , <nl> <nl> auto * F = SILFunction : : create ( mod , linkage , name , constantType , nullptr , None , <nl> IsNotBare , IsTrans , IsSer , entryCount , IsDyn , <nl> + IsNotExactSelfClass , <nl> IsNotThunk , constant . getSubclassScope ( ) , <nl> inlineStrategy , EK ) ; <nl> F - > setDebugScope ( new ( mod ) SILDebugScope ( loc , F ) ) ; <nl> SILFunction * SILFunctionBuilder : : createFunction ( <nl> const SILDebugScope * DebugScope ) { <nl> return SILFunction : : create ( mod , linkage , name , loweredType , genericEnv , loc , <nl> isBareSILFunction , isTrans , isSerialized , <nl> - entryCount , isDynamic , isThunk , subclassScope , <nl> + entryCount , isDynamic , IsNotExactSelfClass , <nl> + isThunk , subclassScope , <nl> inlineStrategy , EK , InsertBefore , DebugScope ) ; <nl> } <nl> mmm a / lib / SIL / SILPrinter . cpp <nl> ppp b / lib / SIL / SILPrinter . cpp <nl> void SILFunction : : print ( SILPrintContext & PrintCtx ) const { <nl> if ( isDynamicallyReplaceable ( ) ) { <nl> OS < < " [ dynamically_replacable ] " ; <nl> } <nl> + if ( isExactSelfClass ( ) ) { <nl> + OS < < " [ exact_self_class ] " ; <nl> + } <nl> if ( isWithoutActuallyEscapingThunk ( ) ) <nl> OS < < " [ without_actually_escaping ] " ; <nl> <nl> mmm a / lib / SILGen / SILGenConstructor . cpp <nl> ppp b / lib / SILGen / SILGenConstructor . cpp <nl> void SILGenFunction : : emitClassConstructorAllocator ( ConstructorDecl * ctor ) { <nl> / / For a designated initializer , we know that the static type being <nl> / / allocated is the type of the class that defines the designated <nl> / / initializer . <nl> + F . setIsExactSelfClass ( IsExactSelfClass ) ; <nl> selfValue = B . createAllocRef ( Loc , selfTy , useObjCAllocation , false , <nl> ArrayRef < SILType > ( ) , ArrayRef < SILValue > ( ) ) ; <nl> } <nl> mmm a / lib / Serialization / DeserializeSIL . cpp <nl> ppp b / lib / Serialization / DeserializeSIL . cpp <nl> SILDeserializer : : readSILFunctionChecked ( DeclID FID , SILFunction * existingFn , <nl> unsigned rawLinkage , isTransparent , isSerialized , isThunk , <nl> isWithoutactuallyEscapingThunk , isGlobal , inlineStrategy , <nl> optimizationMode , effect , numSpecAttrs , hasQualifiedOwnership , <nl> - isWeakLinked , isDynamic ; <nl> + isWeakLinked , isDynamic , isExactSelfClass ; <nl> ArrayRef < uint64_t > SemanticsIDs ; <nl> SILFunctionLayout : : readRecord ( <nl> scratch , rawLinkage , isTransparent , isSerialized , isThunk , <nl> isWithoutactuallyEscapingThunk , isGlobal , inlineStrategy , <nl> optimizationMode , effect , numSpecAttrs , hasQualifiedOwnership , <nl> - isWeakLinked , isDynamic , funcTyID , replacedFunctionID , genericEnvID , <nl> + isWeakLinked , isDynamic , isExactSelfClass , <nl> + funcTyID , replacedFunctionID , genericEnvID , <nl> clangNodeOwnerID , SemanticsIDs ) ; <nl> <nl> if ( funcTyID = = 0 ) { <nl> SILDeserializer : : readSILFunctionChecked ( DeclID FID , SILFunction * existingFn , <nl> fn - > setOptimizationMode ( OptimizationMode ( optimizationMode ) ) ; <nl> fn - > setWeakLinked ( isWeakLinked ) ; <nl> fn - > setIsDynamic ( IsDynamicallyReplaceable_t ( isDynamic ) ) ; <nl> + fn - > setIsExactSelfClass ( IsExactSelfClass_t ( isExactSelfClass ) ) ; <nl> if ( replacedFunction ) <nl> fn - > setDynamicallyReplacedFunction ( replacedFunction ) ; <nl> if ( ! replacedObjectiveCFunc . empty ( ) ) <nl> bool SILDeserializer : : hasSILFunction ( StringRef Name , <nl> unsigned rawLinkage , isTransparent , isSerialized , isThunk , <nl> isWithoutactuallyEscapingThunk , isGlobal , inlineStrategy , <nl> optimizationMode , effect , numSpecAttrs , hasQualifiedOwnership , <nl> - isWeakLinked , isDynamic ; <nl> + isWeakLinked , isDynamic , isExactSelfClass ; <nl> ArrayRef < uint64_t > SemanticsIDs ; <nl> SILFunctionLayout : : readRecord ( <nl> scratch , rawLinkage , isTransparent , isSerialized , isThunk , <nl> isWithoutactuallyEscapingThunk , isGlobal , inlineStrategy , <nl> optimizationMode , effect , numSpecAttrs , hasQualifiedOwnership , <nl> - isWeakLinked , isDynamic , funcTyID , replacedFunctionID , genericEnvID , <nl> + isWeakLinked , isDynamic , isExactSelfClass , <nl> + funcTyID , replacedFunctionID , genericEnvID , <nl> clangOwnerID , SemanticsIDs ) ; <nl> auto linkage = fromStableSILLinkage ( rawLinkage ) ; <nl> if ( ! linkage ) { <nl> mmm a / lib / Serialization / SILFormat . h <nl> ppp b / lib / Serialization / SILFormat . h <nl> namespace sil_block { <nl> BCFixed < 1 > , / / has qualified ownership <nl> BCFixed < 1 > , / / must be weakly referenced <nl> BCFixed < 1 > , / / is dynamically replacable <nl> + BCFixed < 1 > , / / exact self class <nl> TypeIDField , / / SILFunctionType <nl> DeclIDField , / / SILFunction name or 0 ( replaced function ) <nl> GenericEnvironmentIDField , <nl> mmm a / lib / Serialization / SerializeSIL . cpp <nl> ppp b / lib / Serialization / SerializeSIL . cpp <nl> void SILSerializer : : writeSILFunction ( const SILFunction & F , bool DeclOnly ) { <nl> ( unsigned ) F . isGlobalInit ( ) , ( unsigned ) F . getInlineStrategy ( ) , <nl> ( unsigned ) F . getOptimizationMode ( ) , ( unsigned ) F . getEffectsKind ( ) , <nl> ( unsigned ) numSpecAttrs , ( unsigned ) F . hasOwnership ( ) , <nl> - F . isWeakLinked ( ) , ( unsigned ) F . isDynamicallyReplaceable ( ) , FnID , <nl> - replacedFunctionID , genericEnvID , clangNodeOwnerID , SemanticsIDs ) ; <nl> + F . isWeakLinked ( ) , ( unsigned ) F . isDynamicallyReplaceable ( ) , <nl> + ( unsigned ) F . isExactSelfClass ( ) , <nl> + FnID , replacedFunctionID , genericEnvID , clangNodeOwnerID , SemanticsIDs ) ; <nl> <nl> if ( NoBody ) <nl> return ; <nl> mmm a / test / IRGen / class_resilience . swift <nl> ppp b / test / IRGen / class_resilience . swift <nl> public class ClassWithResilientThenEmpty { <nl> / / CHECK - NEXT : [ [ FIELD_VALUE : % . * ] ] = load i32 , i32 * [ [ FIELD_PAYLOAD ] ] <nl> / / CHECK : ret i32 [ [ FIELD_VALUE ] ] <nl> <nl> - / / ClassWithResilientProperty metadata accessor <nl> - <nl> - / / CHECK - LABEL : define { { ( dllexport ) ? } } { { ( protected ) ? } } swiftcc % swift . metadata_response @ " $ s16class_resilience26ClassWithResilientPropertyCMa " ( <nl> - / / CHECK : [ [ CACHE : % . * ] ] = load % swift . type * , % swift . type * * getelementptr inbounds ( { % swift . type * , i8 * } , { % swift . type * , i8 * } * @ " $ s16class_resilience26ClassWithResilientPropertyCMl " , i32 0 , i32 0 ) <nl> - / / CHECK - NEXT : [ [ COND : % . * ] ] = icmp eq % swift . type * [ [ CACHE ] ] , null <nl> - / / CHECK - NEXT : br i1 [ [ COND ] ] , label % cacheIsNull , label % cont <nl> - <nl> - / / CHECK : cacheIsNull : <nl> - / / CHECK - NEXT : [ [ RESPONSE : % . * ] ] = call swiftcc % swift . metadata_response @ swift_getSingletonMetadata ( [ [ INT ] ] % 0 , % swift . type_descriptor * bitcast ( { { . * } } @ " $ s16class_resilience26ClassWithResilientPropertyCMn " to % swift . type_descriptor * ) ) <nl> - / / CHECK - NEXT : [ [ METADATA : % . * ] ] = extractvalue % swift . metadata_response [ [ RESPONSE ] ] , 0 <nl> - / / CHECK - NEXT : [ [ STATUS : % . * ] ] = extractvalue % swift . metadata_response [ [ RESPONSE ] ] , 1 <nl> - / / CHECK - NEXT : br label % cont <nl> - <nl> - / / CHECK : cont : <nl> - / / CHECK - NEXT : [ [ NEW_METADATA : % . * ] ] = phi % swift . type * [ [ [ CACHE ] ] , % entry ] , [ [ [ METADATA ] ] , % cacheIsNull ] <nl> - / / CHECK - NEXT : [ [ NEW_STATUS : % . * ] ] = phi [ [ INT ] ] [ 0 , % entry ] , [ [ [ STATUS ] ] , % cacheIsNull ] <nl> - / / CHECK - NEXT : [ [ T0 : % . * ] ] = insertvalue % swift . metadata_response undef , % swift . type * [ [ NEW_METADATA ] ] , 0 <nl> - / / CHECK - NEXT : [ [ T1 : % . * ] ] = insertvalue % swift . metadata_response [ [ T0 ] ] , [ [ INT ] ] [ [ NEW_STATUS ] ] , 1 <nl> - / / CHECK - NEXT : ret % swift . metadata_response [ [ T1 ] ] <nl> - <nl> - <nl> / / ClassWithResilientlySizedProperty . color getter <nl> <nl> / / CHECK - LABEL : define { { ( dllexport ) ? } } { { ( protected ) ? } } swiftcc i32 @ " $ s16class_resilience33ClassWithResilientlySizedPropertyC5colors5Int32Vvg " ( % T16class_resilience33ClassWithResilientlySizedPropertyC * swiftself ) <nl> public class ClassWithResilientThenEmpty { <nl> / / CHECK - NEXT : [ [ FIELD_VALUE : % . * ] ] = load i32 , i32 * [ [ FIELD_PAYLOAD ] ] <nl> / / CHECK : ret i32 [ [ FIELD_VALUE ] ] <nl> <nl> - / / ClassWithResilientlySizedProperty metadata accessor <nl> - <nl> - / / CHECK - LABEL : define { { ( dllexport ) ? } } { { ( protected ) ? } } swiftcc % swift . metadata_response @ " $ s16class_resilience33ClassWithResilientlySizedPropertyCMa " ( <nl> - / / CHECK : [ [ CACHE : % . * ] ] = load % swift . type * , % swift . type * * getelementptr inbounds ( { % swift . type * , i8 * } , { % swift . type * , i8 * } * @ " $ s16class_resilience33ClassWithResilientlySizedPropertyCMl " , i32 0 , i32 0 ) <nl> - / / CHECK - NEXT : [ [ COND : % . * ] ] = icmp eq % swift . type * [ [ CACHE ] ] , null <nl> - / / CHECK - NEXT : br i1 [ [ COND ] ] , label % cacheIsNull , label % cont <nl> - <nl> - / / CHECK : cacheIsNull : <nl> - / / CHECK - NEXT : [ [ RESPONSE : % . * ] ] = call swiftcc % swift . metadata_response @ swift_getSingletonMetadata ( [ [ INT ] ] % 0 , % swift . type_descriptor * bitcast ( { { . * } } @ " $ s16class_resilience33ClassWithResilientlySizedPropertyCMn " to % swift . type_descriptor * ) ) <nl> - / / CHECK - NEXT : [ [ METADATA : % . * ] ] = extractvalue % swift . metadata_response [ [ RESPONSE ] ] , 0 <nl> - / / CHECK - NEXT : [ [ STATUS : % . * ] ] = extractvalue % swift . metadata_response [ [ RESPONSE ] ] , 1 <nl> - / / CHECK - NEXT : br label % cont <nl> - <nl> - / / CHECK : cont : <nl> - / / CHECK - NEXT : [ [ NEW_METADATA : % . * ] ] = phi % swift . type * [ [ [ CACHE ] ] , % entry ] , [ [ [ METADATA ] ] , % cacheIsNull ] <nl> - / / CHECK - NEXT : [ [ NEW_STATUS : % . * ] ] = phi [ [ INT ] ] [ 0 , % entry ] , [ [ [ STATUS ] ] , % cacheIsNull ] <nl> - / / CHECK - NEXT : [ [ T0 : % . * ] ] = insertvalue % swift . metadata_response undef , % swift . type * [ [ NEW_METADATA ] ] , 0 <nl> - / / CHECK - NEXT : [ [ T1 : % . * ] ] = insertvalue % swift . metadata_response [ [ T0 ] ] , [ [ INT ] ] [ [ NEW_STATUS ] ] , 1 <nl> - / / CHECK - NEXT : ret % swift . metadata_response [ [ T1 ] ] <nl> - <nl> <nl> / / ClassWithIndirectResilientEnum . color getter <nl> <nl> public class ClassWithResilientThenEmpty { <nl> / / CHECK : ret % swift . type * [ [ GENERIC_PARAM ] ] <nl> <nl> <nl> + / / ClassWithResilientProperty metadata accessor <nl> + <nl> + / / CHECK - LABEL : define { { ( dllexport ) ? } } { { ( protected ) ? } } swiftcc % swift . metadata_response @ " $ s16class_resilience26ClassWithResilientPropertyCMa " ( <nl> + / / CHECK : [ [ CACHE : % . * ] ] = load % swift . type * , % swift . type * * getelementptr inbounds ( { % swift . type * , i8 * } , { % swift . type * , i8 * } * @ " $ s16class_resilience26ClassWithResilientPropertyCMl " , i32 0 , i32 0 ) <nl> + / / CHECK - NEXT : [ [ COND : % . * ] ] = icmp eq % swift . type * [ [ CACHE ] ] , null <nl> + / / CHECK - NEXT : br i1 [ [ COND ] ] , label % cacheIsNull , label % cont <nl> + <nl> + / / CHECK : cacheIsNull : <nl> + / / CHECK - NEXT : [ [ RESPONSE : % . * ] ] = call swiftcc % swift . metadata_response @ swift_getSingletonMetadata ( [ [ INT ] ] % 0 , % swift . type_descriptor * bitcast ( { { . * } } @ " $ s16class_resilience26ClassWithResilientPropertyCMn " to % swift . type_descriptor * ) ) <nl> + / / CHECK - NEXT : [ [ METADATA : % . * ] ] = extractvalue % swift . metadata_response [ [ RESPONSE ] ] , 0 <nl> + / / CHECK - NEXT : [ [ STATUS : % . * ] ] = extractvalue % swift . metadata_response [ [ RESPONSE ] ] , 1 <nl> + / / CHECK - NEXT : br label % cont <nl> + <nl> + / / CHECK : cont : <nl> + / / CHECK - NEXT : [ [ NEW_METADATA : % . * ] ] = phi % swift . type * [ [ [ CACHE ] ] , % entry ] , [ [ [ METADATA ] ] , % cacheIsNull ] <nl> + / / CHECK - NEXT : [ [ NEW_STATUS : % . * ] ] = phi [ [ INT ] ] [ 0 , % entry ] , [ [ [ STATUS ] ] , % cacheIsNull ] <nl> + / / CHECK - NEXT : [ [ T0 : % . * ] ] = insertvalue % swift . metadata_response undef , % swift . type * [ [ NEW_METADATA ] ] , 0 <nl> + / / CHECK - NEXT : [ [ T1 : % . * ] ] = insertvalue % swift . metadata_response [ [ T0 ] ] , [ [ INT ] ] [ [ NEW_STATUS ] ] , 1 <nl> + / / CHECK - NEXT : ret % swift . metadata_response [ [ T1 ] ] <nl> + <nl> + <nl> / / ClassWithResilientProperty metadata initialization function <nl> <nl> / / CHECK - LABEL : define internal swiftcc % swift . metadata_response @ " $ s16class_resilience26ClassWithResilientPropertyCMr " ( % swift . type * , i8 * , i8 * * ) <nl> public class ClassWithResilientThenEmpty { <nl> / / CHECK - NEXT : } <nl> <nl> <nl> + / / ClassWithResilientlySizedProperty metadata accessor <nl> + <nl> + / / CHECK - LABEL : define { { ( dllexport ) ? } } { { ( protected ) ? } } swiftcc % swift . metadata_response @ " $ s16class_resilience33ClassWithResilientlySizedPropertyCMa " ( <nl> + / / CHECK : [ [ CACHE : % . * ] ] = load % swift . type * , % swift . type * * getelementptr inbounds ( { % swift . type * , i8 * } , { % swift . type * , i8 * } * @ " $ s16class_resilience33ClassWithResilientlySizedPropertyCMl " , i32 0 , i32 0 ) <nl> + / / CHECK - NEXT : [ [ COND : % . * ] ] = icmp eq % swift . type * [ [ CACHE ] ] , null <nl> + / / CHECK - NEXT : br i1 [ [ COND ] ] , label % cacheIsNull , label % cont <nl> + <nl> + / / CHECK : cacheIsNull : <nl> + / / CHECK - NEXT : [ [ RESPONSE : % . * ] ] = call swiftcc % swift . metadata_response @ swift_getSingletonMetadata ( [ [ INT ] ] % 0 , % swift . type_descriptor * bitcast ( { { . * } } @ " $ s16class_resilience33ClassWithResilientlySizedPropertyCMn " to % swift . type_descriptor * ) ) <nl> + / / CHECK - NEXT : [ [ METADATA : % . * ] ] = extractvalue % swift . metadata_response [ [ RESPONSE ] ] , 0 <nl> + / / CHECK - NEXT : [ [ STATUS : % . * ] ] = extractvalue % swift . metadata_response [ [ RESPONSE ] ] , 1 <nl> + / / CHECK - NEXT : br label % cont <nl> + <nl> + / / CHECK : cont : <nl> + / / CHECK - NEXT : [ [ NEW_METADATA : % . * ] ] = phi % swift . type * [ [ [ CACHE ] ] , % entry ] , [ [ [ METADATA ] ] , % cacheIsNull ] <nl> + / / CHECK - NEXT : [ [ NEW_STATUS : % . * ] ] = phi [ [ INT ] ] [ 0 , % entry ] , [ [ [ STATUS ] ] , % cacheIsNull ] <nl> + / / CHECK - NEXT : [ [ T0 : % . * ] ] = insertvalue % swift . metadata_response undef , % swift . type * [ [ NEW_METADATA ] ] , 0 <nl> + / / CHECK - NEXT : [ [ T1 : % . * ] ] = insertvalue % swift . metadata_response [ [ T0 ] ] , [ [ INT ] ] [ [ NEW_STATUS ] ] , 1 <nl> + / / CHECK - NEXT : ret % swift . metadata_response [ [ T1 ] ] <nl> + <nl> + <nl> + <nl> / / ClassWithResilientlySizedProperty metadata initialization function <nl> <nl> / / CHECK - LABEL : define internal swiftcc % swift . metadata_response @ " $ s16class_resilience33ClassWithResilientlySizedPropertyCMr " ( % swift . type * , i8 * , i8 * * ) <nl> mmm a / test / IRGen / exact_self_class_metadata_peephole . swift <nl> ppp b / test / IRGen / exact_self_class_metadata_peephole . swift <nl> <nl> / / RUN : % target - swift - frontend - emit - ir % s | % FileCheck % s - - check - prefix = CHECK - - check - prefix = ONONE <nl> + / / R / UN : % target - swift - frontend - O - disable - llvm - optzns - emit - ir % s | % FileCheck % s - - check - prefix = CHECK - - check - prefix = ONONE <nl> <nl> @ _silgen_name ( " useMetadata " ) <nl> func useMetadata < T > ( _ : T . Type ) <nl> private class PrivateEffectivelyFinal < T , U , V > { <nl> useMetadata ( PrivateEffectivelyFinal < T , U , V > . self ) <nl> useMetadata ( PrivateEffectivelyFinal < Int , String , V > . self ) <nl> } <nl> + <nl> + / / CHECK - LABEL : define { { . * } } PrivateEffectivelyFinal { { . * } } cfC <nl> + / / CHECK : call { { . * } } @ swift_allocObject ( % swift . type * % 0 <nl> } <nl> <nl> / / The class is not final and has subclasses , so we can only peephole <nl> / / metadata requests in limited circumstances . <nl> private class PrivateNonfinal < T , U , V > { <nl> - / / TODO : The designated init allocating entry point is always overridden <nl> + / / The designated init allocating entry point is always overridden <nl> / / by subclasses , so it can use the self metadata it was passed . <nl> <nl> / / Methods in general on nonfinal classes cannot use the self metadata as <nl> / / is . <nl> - / / CHECK - LABEL : define { { . * } } PrivateNonfinal { { . * } } butts <nl> + / / CHECK - LABEL : define { { . * } } 15PrivateNonfinal { { . * } } buttsyyF " <nl> @ inline ( never ) <nl> final func butts ( ) { <nl> - / / CHECK : [ [ INSTANTIATED_TYPE_RESPONSE : % . * ] ] = call { { . * } } @ { { . * } } PrivateNonfinal { { . * } } Ma <nl> - / / CHECK : [ [ INSTANTIATED_TYPE : % . * ] ] = extractvalue { { . * } } [ [ INSTANTIATED_TYPE_RESPONSE ] ] <nl> - / / CHECK : call { { . * } } @ useMetadata ( % swift . type * [ [ INSTANTIATED_TYPE ] ] , % swift . type * [ [ INSTANTIATED_TYPE ] ] ) <nl> + / / CHECK : [ [ INSTANTIATED_TYPE_RESPONSE : % . * ] ] = call { { . * } } @ { { . * } } 15PrivateNonfinal { { . * } } Ma <nl> + / / CHECK - NEXT : [ [ INSTANTIATED_TYPE : % . * ] ] = extractvalue { { . * } } [ [ INSTANTIATED_TYPE_RESPONSE ] ] <nl> + / / CHECK - NEXT : call { { . * } } @ useMetadata ( % swift . type * [ [ INSTANTIATED_TYPE ] ] , % swift . type * [ [ INSTANTIATED_TYPE ] ] ) <nl> useMetadata ( PrivateNonfinal < T , U , V > . self ) <nl> - / / CHECK : [ [ INSTANTIATED_TYPE_RESPONSE : % . * ] ] = call { { . * } } @ { { . * } } PrivateNonfinal { { . * } } Ma <nl> - / / CHECK : [ [ INSTANTIATED_TYPE : % . * ] ] = extractvalue { { . * } } [ [ INSTANTIATED_TYPE_RESPONSE ] ] <nl> - / / CHECK : call { { . * } } @ useMetadata ( % swift . type * [ [ INSTANTIATED_TYPE ] ] , % swift . type * [ [ INSTANTIATED_TYPE ] ] ) <nl> + / / CHECK : [ [ INSTANTIATED_TYPE_RESPONSE : % . * ] ] = call { { . * } } @ { { . * } } 15PrivateNonfinal { { . * } } Ma <nl> + / / CHECK - NEXT : [ [ INSTANTIATED_TYPE : % . * ] ] = extractvalue { { . * } } [ [ INSTANTIATED_TYPE_RESPONSE ] ] <nl> + / / CHECK - NEXT : call { { . * } } @ useMetadata ( % swift . type * [ [ INSTANTIATED_TYPE ] ] , % swift . type * [ [ INSTANTIATED_TYPE ] ] ) <nl> useMetadata ( PrivateNonfinal < Int , String , V > . self ) <nl> } <nl> + <nl> + / / CHECK - LABEL : define { { . * } } 15PrivateNonfinal { { . * } } cfC <nl> + / / CHECK : call { { . * } } @ swift_allocObject ( % swift . type * % 0 <nl> } <nl> <nl> / / TODO : Although this is not explicitly final , class hierarchy analysis <nl> private class PrivateNonfinalSubclass : PrivateNonfinal < Int , String , Float > { <nl> final func borts ( ) { <nl> useMetadata ( PrivateNonfinalSubclass . self ) <nl> } <nl> + <nl> + / / CHECK - LABEL : define { { . * } } PrivateNonfinalSubclass { { . * } } cfC <nl> + / / CHECK : call { { . * } } @ swift_allocObject ( % swift . type * % 0 <nl> } <nl> <nl> final private class FinalPrivateNonfinalSubclass < U > : PrivateNonfinal < U , String , Float > { <nl> mmm a / test / ParseableInterface / ModuleCache / SerializedSIL . swiftinterface <nl> ppp b / test / ParseableInterface / ModuleCache / SerializedSIL . swiftinterface <nl> public var readOnlyVar : Int { get } <nl> public var readWriteVar : Int { get set } <nl> public func verySimpleFunction ( ) <nl> <nl> - / / CHECK : sil [ serialized ] [ canonical ] @ $ s13SerializedSIL9TestClassCACycfC : $ @ convention ( method ) ( @ thick TestClass . Type ) - > @ owned TestClass { <nl> + / / CHECK : sil [ serialized ] [ exact_self_class ] [ canonical ] @ $ s13SerializedSIL9TestClassCACycfC : $ @ convention ( method ) ( @ thick TestClass . Type ) - > @ owned TestClass { <nl> <nl> / / NEGATIVE - NOT : { { sil . * @ . + storedProp } } <nl> <nl> mmm a / test / SILGen / constrained_extensions . swift <nl> ppp b / test / SILGen / constrained_extensions . swift <nl> extension Array where Element = = AnyObject { <nl> / / CHECK - LABEL : sil hidden [ ossa ] @ $ sSa22constrained_extensionsyXlRszlE11NestedClassCfD : $ @ convention ( method ) ( @ owned Array < AnyObject > . NestedClass ) - > ( ) <nl> deinit { } <nl> <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ sSa22constrained_extensionsyXlRszlE11NestedClassCACyyXl_GycfC : $ @ convention ( method ) ( @ thick Array < AnyObject > . NestedClass . Type ) - > @ owned Array < AnyObject > . NestedClass <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ sSa22constrained_extensionsyXlRszlE11NestedClassCACyyXl_GycfC : $ @ convention ( method ) ( @ thick Array < AnyObject > . NestedClass . Type ) - > @ owned Array < AnyObject > . NestedClass <nl> / / CHECK - LABEL : sil hidden [ ossa ] @ $ sSa22constrained_extensionsyXlRszlE11NestedClassCACyyXl_Gycfc : $ @ convention ( method ) ( @ owned Array < AnyObject > . NestedClass ) - > @ owned Array < AnyObject > . NestedClass <nl> } <nl> <nl> mmm a / test / SILGen / convenience_init_peer_delegation . swift <nl> ppp b / test / SILGen / convenience_init_peer_delegation . swift <nl> class X { <nl> self . init ( convenience : ( ) ) <nl> } <nl> <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ s32convenience_init_peer_delegation1XC8requiredACyt_tcfC <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ s32convenience_init_peer_delegation1XC8requiredACyt_tcfC <nl> required init ( required : ( ) ) { <nl> } <nl> <nl> mmm a / test / SILGen / dynamic . swift <nl> ppp b / test / SILGen / dynamic . swift <nl> protocol Proto { <nl> / / ObjC entry points for @ objc and dynamic entry points <nl> <nl> / / normal and @ objc initializing ctors can be statically dispatched <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ s7dynamic3FooC { { . * } } tcfC <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ s7dynamic3FooC { { . * } } tcfC <nl> / / CHECK : function_ref @ $ s7dynamic3FooC { { . * } } tcfc <nl> <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ s7dynamic3FooC { { . * } } tcfC <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ s7dynamic3FooC { { . * } } tcfC <nl> / / CHECK : function_ref @ $ s7dynamic3FooC { { . * } } tcfc <nl> <nl> / / CHECK - LABEL : sil hidden [ thunk ] [ ossa ] @ $ s7dynamic3 { { [ _0 - 9a - zA - Z ] * } } fcTo <nl> class Subclass : Foo { <nl> override init ( native : Int ) { <nl> super . init ( native : native ) <nl> } <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ s7dynamic8SubclassC { { [ _0 - 9a - zA - Z ] * } } fC <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ s7dynamic8SubclassC { { [ _0 - 9a - zA - Z ] * } } fC <nl> / / CHECK : function_ref @ $ s7dynamic8SubclassC { { [ _0 - 9a - zA - Z ] * } } fc <nl> <nl> override func nativeMethod ( ) { <nl> mmm a / test / SILGen / errors . swift <nl> ppp b / test / SILGen / errors . swift <nl> class HasThrowingInit { <nl> } <nl> } <nl> <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ s6errors15HasThrowingInit { { . * } } : $ @ convention ( method ) ( Int , @ thick HasThrowingInit . Type ) - > ( @ owned HasThrowingInit , @ error Error ) <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ s6errors15HasThrowingInit { { . * } } : $ @ convention ( method ) ( Int , @ thick HasThrowingInit . Type ) - > ( @ owned HasThrowingInit , @ error Error ) <nl> / / CHECK : [ [ SELF : % . * ] ] = alloc_ref $ HasThrowingInit <nl> / / CHECK : [ [ T0 : % . * ] ] = function_ref @ $ s6errors15HasThrowingInit { { . * } } c : $ @ convention ( method ) ( Int , @ owned HasThrowingInit ) - > ( @ owned HasThrowingInit , @ error Error ) <nl> / / CHECK - NEXT : try_apply [ [ T0 ] ] ( % 0 , [ [ SELF ] ] ) : $ @ convention ( method ) ( Int , @ owned HasThrowingInit ) - > ( @ owned HasThrowingInit , @ error Error ) , normal bb1 , error bb2 <nl> mmm a / test / SILGen / functions . swift <nl> ppp b / test / SILGen / functions . swift <nl> class SomeClass { <nl> / / - - Constructors and methods are uncurried in ' self ' <nl> / / - - Instance methods use ' method ' cc <nl> <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ s9functions9SomeClassC { { [ _0 - 9a - zA - Z ] * } } fC : $ @ convention ( method ) ( Builtin . Int64 , Builtin . Int64 , @ thick SomeClass . Type ) - > @ owned SomeClass <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ s9functions9SomeClassC { { [ _0 - 9a - zA - Z ] * } } fC : $ @ convention ( method ) ( Builtin . Int64 , Builtin . Int64 , @ thick SomeClass . Type ) - > @ owned SomeClass <nl> / / CHECK : bb0 ( % 0 : $ Builtin . Int64 , % 1 : $ Builtin . Int64 , % 2 : $ @ thick SomeClass . Type ) : <nl> <nl> / / CHECK - LABEL : sil hidden [ ossa ] @ $ s9functions9SomeClassC { { [ _0 - 9a - zA - Z ] * } } fc : $ @ convention ( method ) ( Builtin . Int64 , Builtin . Int64 , @ owned SomeClass ) - > @ owned SomeClass <nl> mmm a / test / SILGen / guaranteed_normal_args . swift <nl> ppp b / test / SILGen / guaranteed_normal_args . swift <nl> class KlassWithBuffer { <nl> var buffer : Buffer <nl> <nl> / / Make sure that the allocating init forwards into the initializing init at + 1 . <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ ss15KlassWithBufferC3inKABs0A0C_tcfC : $ @ convention ( method ) ( @ owned Klass , @ thick KlassWithBuffer . Type ) - > @ owned KlassWithBuffer { <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ ss15KlassWithBufferC3inKABs0A0C_tcfC : $ @ convention ( method ) ( @ owned Klass , @ thick KlassWithBuffer . Type ) - > @ owned KlassWithBuffer { <nl> / / CHECK : bb0 ( [ [ ARG : % . * ] ] : @ owned $ Klass , <nl> / / CHECK : [ [ INITIALIZING_INIT : % . * ] ] = function_ref @ $ ss15KlassWithBufferC3inKABs0A0C_tcfc : $ @ convention ( method ) ( @ owned Klass , @ owned KlassWithBuffer ) - > @ owned KlassWithBuffer <nl> / / CHECK : apply [ [ INITIALIZING_INIT ] ] ( [ [ ARG ] ] , <nl> mmm a / test / SILGen / guaranteed_self . swift <nl> ppp b / test / SILGen / guaranteed_self . swift <nl> struct AO < T > : Fooable { <nl> <nl> class C : Fooable , Barrable { <nl> / / Allocating initializer <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ s15guaranteed_self1CC { { [ _0 - 9a - zA - Z ] * } } fC : $ @ convention ( method ) ( @ thick C . Type ) - > @ owned C <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ s15guaranteed_self1CC { { [ _0 - 9a - zA - Z ] * } } fC : $ @ convention ( method ) ( @ thick C . Type ) - > @ owned C <nl> / / CHECK : [ [ SELF1 : % . * ] ] = alloc_ref $ C <nl> / / CHECK - NOT : [ [ SELF1 ] ] <nl> / / CHECK : [ [ SELF2 : % . * ] ] = apply { { . * } } ( [ [ SELF1 ] ] ) <nl> class C : Fooable , Barrable { <nl> } <nl> <nl> class D : C { <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ s15guaranteed_self1DC { { [ _0 - 9a - zA - Z ] * } } fC : $ @ convention ( method ) ( @ thick D . Type ) - > @ owned D <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ s15guaranteed_self1DC { { [ _0 - 9a - zA - Z ] * } } fC : $ @ convention ( method ) ( @ thick D . Type ) - > @ owned D <nl> / / CHECK : [ [ SELF1 : % . * ] ] = alloc_ref $ D <nl> / / CHECK - NOT : [ [ SELF1 ] ] <nl> / / CHECK : [ [ SELF2 : % . * ] ] = apply { { . * } } ( [ [ SELF1 ] ] ) <nl> mmm a / test / SILGen / init_ref_delegation . swift <nl> ppp b / test / SILGen / init_ref_delegation . swift <nl> class C1 { <nl> / / CHECK - NOT : sil hidden [ ossa ] @ $ s19init_ref_delegation2C2C { { [ _0 - 9a - zA - Z ] * } } fcTo : $ @ convention ( objc_method ) ( X , @ owned C2 ) - > @ owned C2 { <nl> } <nl> <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ s19init_ref_delegation2C2C { { [ _0 - 9a - zA - Z ] * } } fC : $ @ convention ( method ) ( X , X , @ thick C2 . Type ) - > @ owned C2 { <nl> - / / CHECK - NOT : sil [ ossa ] @ $ s19init_ref_delegation2C2C { { [ _0 - 9a - zA - Z ] * } } fcTo : $ @ convention ( objc_method ) ( X , X , @ owned C2 ) - > @ owned C2 { <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ s19init_ref_delegation2C2C { { [ _0 - 9a - zA - Z ] * } } fC : $ @ convention ( method ) ( X , X , @ thick C2 . Type ) - > @ owned C2 { <nl> + / / CHECK - NOT : sil { { . * } } @ $ s19init_ref_delegation2C2C { { [ _0 - 9a - zA - Z ] * } } fcTo : $ @ convention ( objc_method ) ( X , X , @ owned C2 ) - > @ owned C2 { <nl> init ( x1 : X , x2 : X ) { ivar = x1 } <nl> } <nl> <nl> mmm a / test / SILGen / initializers . swift <nl> ppp b / test / SILGen / initializers . swift <nl> struct DynamicTypeStruct { <nl> } <nl> <nl> class InOutInitializer { <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ s21failable_initializers16InOutInitializerC1xACSiz_tcfC : $ @ convention ( method ) ( @ inout Int , @ thick InOutInitializer . Type ) - > @ owned InOutInitializer { <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ s21failable_initializers16InOutInitializerC1xACSiz_tcfC : $ @ convention ( method ) ( @ inout Int , @ thick InOutInitializer . Type ) - > @ owned InOutInitializer { <nl> / / CHECK : bb0 ( % 0 : $ * Int , % 1 : $ @ thick InOutInitializer . Type ) : <nl> init ( x : inout Int ) { } <nl> } <nl> mmm a / test / SILGen / inlinable_attribute . swift <nl> ppp b / test / SILGen / inlinable_attribute . swift <nl> public class MyCls { <nl> <nl> / / Allocating entry point is [ serialized ] <nl> <nl> - / / CHECK - LABEL : sil [ serialized ] [ ossa ] @ $ s19inlinable_attribute5MyClsC14designatedInitACyt_tcfC : $ @ convention ( method ) ( @ thick MyCls . Type ) - > @ owned MyCls <nl> + / / CHECK - LABEL : sil [ serialized ] [ exact_self_class ] [ ossa ] @ $ s19inlinable_attribute5MyClsC14designatedInitACyt_tcfC : $ @ convention ( method ) ( @ thick MyCls . Type ) - > @ owned MyCls <nl> public init ( designatedInit : ( ) ) { } <nl> <nl> / / Note - - convenience init is intentionally not [ serialized ] <nl> mmm a / test / SILGen / lifetime . swift <nl> ppp b / test / SILGen / lifetime . swift <nl> struct Daleth { <nl> class He { <nl> <nl> / / - - default allocator : <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ s8lifetime2HeC { { [ _0 - 9a - zA - Z ] * } } fC : $ @ convention ( method ) ( @ thick He . Type ) - > @ owned He { <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ s8lifetime2HeC { { [ _0 - 9a - zA - Z ] * } } fC : $ @ convention ( method ) ( @ thick He . Type ) - > @ owned He { <nl> / / CHECK : bb0 ( { { % . * } } : $ @ thick He . Type ) : <nl> / / CHECK - NEXT : [ [ THIS : % . * ] ] = alloc_ref $ He <nl> / / CHECK - NEXT : / / function_ref lifetime . He . init <nl> class Foo < T > { <nl> / / Class initializer <nl> init ( ) { <nl> / / - - allocating entry point <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ s8lifetime3FooC { { [ _0 - 9a - zA - Z ] * } } fC : <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ s8lifetime3FooC { { [ _0 - 9a - zA - Z ] * } } fC : <nl> / / CHECK : bb0 ( [ [ METATYPE : % [ 0 - 9 ] + ] ] : $ @ thick Foo < T > . Type ) : <nl> / / CHECK : [ [ THIS : % [ 0 - 9 ] + ] ] = alloc_ref $ Foo < T > <nl> / / CHECK : [ [ INIT_METHOD : % [ 0 - 9 ] + ] ] = function_ref @ $ s8lifetime3FooC { { [ _0 - 9a - zA - Z ] * } } fc <nl> class Foo < T > { <nl> z = Foo < T > . makeT ( ) <nl> <nl> / / - - allocating entry point <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ s8lifetime3FooC { { [ _0 - 9a - zA - Z ] * } } fC : <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ s8lifetime3FooC { { [ _0 - 9a - zA - Z ] * } } fC : <nl> / / CHECK : bb0 ( [ [ CHI : % [ 0 - 9 ] + ] ] : $ Int , [ [ METATYPE : % [ 0 - 9 ] + ] ] : $ @ thick Foo < T > . Type ) : <nl> / / CHECK : [ [ THIS : % [ 0 - 9 ] + ] ] = alloc_ref $ Foo < T > <nl> / / CHECK : [ [ INIT_METHOD : % [ 0 - 9 ] + ] ] = function_ref @ $ s8lifetime3FooC { { [ _0 - 9a - zA - Z ] * } } fc <nl> class Foo < T > { <nl> } <nl> <nl> / / - - allocating entry point <nl> - / / CHECK - LABEL : sil hidden [ ossa ] @ $ s8lifetime3FooC { { [ _0 - 9a - zA - Z ] * } } fC : <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ ossa ] @ $ s8lifetime3FooC { { [ _0 - 9a - zA - Z ] * } } fC : <nl> / / CHECK : [ [ INIT_METHOD : % [ 0 - 9 ] + ] ] = function_ref @ $ s8lifetime3FooC { { [ _0 - 9a - zA - Z ] * } } fc <nl> <nl> / / - - initializing entry point <nl> mmm a / test / SILGen / sil_locations_top_level . swift <nl> ppp b / test / SILGen / sil_locations_top_level . swift <nl> var topLevelObject2 : TopLevelObjectTyWithoutDestructor <nl> <nl> / / Check allocating initializer <nl> / / CHECK - LABEL : sil_locations_top_level . TopLevelObjectTy . __allocating_init <nl> - / / CHECK : sil hidden [ ossa ] @ $ s23sil_locations_top_level16TopLevelObjectTyC { { [ _0 - 9a - zA - Z ] * } } fC <nl> + / / CHECK : sil hidden [ exact_self_class ] [ ossa ] @ $ s23sil_locations_top_level16TopLevelObjectTyC { { [ _0 - 9a - zA - Z ] * } } fC <nl> / / CHECK : alloc_ref { { . * } } line : 5 : 3 : auto_gen <nl> / / CHECK : function_ref <nl> <nl> mmm a / test / SILGen / synthesized_conformance_class . swift <nl> ppp b / test / SILGen / synthesized_conformance_class . swift <nl> extension Final : Encodable where T : Encodable { } <nl> <nl> extension Final : Decodable where T : Decodable { } <nl> / / CHECK - LABEL : / / Final < A > . init ( from : ) <nl> - / / CHECK - NEXT : sil hidden [ ossa ] @ $ s29synthesized_conformance_class5FinalCAASeRzlE4fromACyxGs7Decoder_p_tKcfC : $ @ convention ( method ) < T where T : Decodable > ( @ in Decoder , @ thick Final < T > . Type ) - > ( @ owned Final < T > , @ error Error ) { <nl> + / / CHECK - NEXT : sil hidden [ exact_self_class ] [ ossa ] @ $ s29synthesized_conformance_class5FinalCAASeRzlE4fromACyxGs7Decoder_p_tKcfC : $ @ convention ( method ) < T where T : Decodable > ( @ in Decoder , @ thick Final < T > . Type ) - > ( @ owned Final < T > , @ error Error ) { <nl> <nl> extension Nonfinal : Encodable where T : Encodable { } <nl> / / CHECK - LABEL : / / Nonfinal < A > . encode ( to : ) <nl> mmm a / test / SILOptimizer / definite_init_failable_initializers_objc . swift <nl> ppp b / test / SILOptimizer / definite_init_failable_initializers_objc . swift <nl> class FakeNSObject { <nl> class Cat : FakeNSObject { <nl> let x : LifetimeTracked <nl> <nl> - / / CHECK - LABEL : sil hidden @ $ s40definite_init_failable_initializers_objc3CatC1n5afterACSgSi_SbtcfC <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] @ $ s40definite_init_failable_initializers_objc3CatC1n5afterACSgSi_SbtcfC <nl> / / CHECK : function_ref @ $ s40definite_init_failable_initializers_objc3CatC1n5afterACSgSi_Sbtcfc : <nl> / / CHECK : end sil function ' $ s40definite_init_failable_initializers_objc3CatC1n5afterACSgSi_SbtcfC ' <nl> <nl> mmm a / test / SILOptimizer / super_init . swift <nl> ppp b / test / SILOptimizer / super_init . swift <nl> <nl> / / RUN : % target - swift - frontend - emit - sil % s | % FileCheck % s <nl> <nl> - / / CHECK - LABEL : sil hidden [ noinline ] @ $ s10super_init3FooCyACSicfC : $ @ convention ( method ) ( Int , @ thick Foo . Type ) - > @ owned Foo <nl> + / / CHECK - LABEL : sil hidden [ exact_self_class ] [ noinline ] @ $ s10super_init3FooCyACSicfC : $ @ convention ( method ) ( Int , @ thick Foo . Type ) - > @ owned Foo <nl> / / CHECK - NOT : class_method <nl> / / CHECK - NOT : super_method <nl> / / CHECK : [ [ SUPER_INIT : % . * ] ] = function_ref @ $ s10super_init3FooCyACSicfc <nl> | SIL : Add an [ exact_self_class ] function attribute . | apple/swift | 77b012af1da31f1679fe8f0f9e9d90a785d6df83 | 2019-08-08T21:03:07Z |
mmm a / src / tests / struct . cpp <nl> ppp b / src / tests / struct . cpp <nl> TC_TEST ( " 2d_blocked_array " ) { <nl> <nl> for ( auto arch : { Arch : : x86_64 , Arch : : gpu } ) <nl> for ( auto blocked : { false , true } ) { <nl> - Program prog ( Arch : : gpu ) ; <nl> + Program prog ( arch ) ; <nl> <nl> Global ( a , i32 ) ; <nl> Global ( b , i32 ) ; <nl> | Fixed 2d_blocked_array test | taichi-dev/taichi | 215bf62e845a02d0d5a0e2a835eabd2affd99f27 | 2019-03-28T04:41:46Z |
mmm a / src / gbm / gbtree . cc <nl> ppp b / src / gbm / gbtree . cc <nl> void GBTree : : PerformTreeMethodHeuristic ( DMatrix * fmat ) { <nl> } <nl> <nl> if ( rabit : : IsDistributed ( ) ) { <nl> - LOG ( WARNING ) < < <nl> - " Tree method is automatically selected to be ' approx ' " <nl> - " for distributed training . " ; <nl> + LOG ( INFO ) < < " Tree method is automatically selected to be ' approx ' " <nl> + " for distributed training . " ; <nl> tparam_ . tree_method = TreeMethod : : kApprox ; <nl> } else if ( ! fmat - > SingleColBlock ( ) ) { <nl> - LOG ( WARNING ) < < " Tree method is automatically set to ' approx ' " <nl> - " since external - memory data matrix is used . " ; <nl> + LOG ( INFO ) < < " Tree method is automatically set to ' approx ' " <nl> + " since external - memory data matrix is used . " ; <nl> tparam_ . tree_method = TreeMethod : : kApprox ; <nl> } else if ( fmat - > Info ( ) . num_row_ > = ( 4UL < < 20UL ) ) { <nl> / * Choose tree_method = ' approx ' automatically for large data matrix * / <nl> - LOG ( WARNING ) < < " Tree method is automatically selected to be " <nl> - " ' approx ' for faster speed . To use old behavior " <nl> - " ( exact greedy algorithm on single machine ) , " <nl> - " set tree_method to ' exact ' . " ; <nl> + LOG ( INFO ) < < " Tree method is automatically selected to be " <nl> + " ' approx ' for faster speed . To use old behavior " <nl> + " ( exact greedy algorithm on single machine ) , " <nl> + " set tree_method to ' exact ' . " ; <nl> tparam_ . tree_method = TreeMethod : : kApprox ; <nl> } else { <nl> tparam_ . tree_method = TreeMethod : : kExact ; <nl> | Reduce warning . ( ) | dmlc/xgboost | cc767247628e0c81956515292ba824b89432e9e8 | 2020-10-27T19:24:19Z |
new file mode 100644 <nl> index 000000000000 . . a4885d22d352 <nl> mmm / dev / null <nl> ppp b / validation - test / IDE / crashers / 045 - swift - protocoldecl - requiresclassslow . swift <nl> <nl> + / / RUN : not - - crash % target - swift - ide - test - code - completion - code - completion - token = A - source - filename = % s <nl> + / / REQUIRES : asserts <nl> + protocol A { <nl> + extension { protocol c { <nl> + func a <nl> + protocol e { protocol A { typealias e : a extension { protocol P { # ^ A ^ # <nl> + func b <nl> + < H : o <nl> \ No newline at end of file <nl> | Merge pull request from practicalswift / sourcekit - 045 - swift - protocoldecl - requiresclassslow | apple/swift | a28d2e914c0c27c0c0710feb9b7feaae7b64ed64 | 2015-12-19T12:55:55Z |
mmm a / hphp / runtime / base / runtime - option . cpp <nl> ppp b / hphp / runtime / base / runtime - option . cpp <nl> uint64_t RuntimeOption : : UndefinedConstFallback = 0 ; <nl> uint64_t RuntimeOption : : DisableAssert = 0 ; <nl> bool RuntimeOption : : DisableReservedVariables = false ; <nl> bool RuntimeOption : : DisallowExecutionOperator = false ; <nl> - bool RuntimeOption : : DisableVariableVariables = false ; <nl> + bool RuntimeOption : : DisableVariableVariables = true ; <nl> uint64_t RuntimeOption : : DisableConstant = 0 ; <nl> bool RuntimeOption : : EnableConcurrent = false ; <nl> bool RuntimeOption : : EnableAwaitAsAnExpression = false ; <nl> mmm a / hphp / test / quick / ClsCases . php <nl> ppp b / hphp / test / quick / ClsCases . php <nl> function clsFact ( ) { <nl> <nl> / / Any way to coerce the [ Obj ] - > [ Class ] variety ? <nl> $ foo = new MyClass ( ) ; <nl> - $ varname = ' foo ' ; <nl> - $ { $ varname } : : $ x = 1 ; <nl> + $ foo : : $ x = 1 ; <nl> <nl> / / ClsH <nl> $ refs [ ] = clsFact ( ) ; <nl> mmm a / hphp / test / quick / Empty . php <nl> ppp b / hphp / test / quick / Empty . php <nl> <nl> < ? hh <nl> <nl> function f ( ) { <nl> - $ n = " x " ; <nl> - $ g = " y " ; <nl> - global $ $ g ; <nl> + global $ y ; <nl> <nl> $ x = 0 ; <nl> - $ $ g = 0 ; <nl> + $ y = 0 ; <nl> print " : " . empty ( $ x ) . " : \ n " ; <nl> - print " : " . empty ( $ $ n ) . " : \ n " ; <nl> - print " : " . empty ( $ $ g ) . " : \ n " ; <nl> + print " : " . empty ( $ y ) . " : \ n " ; <nl> <nl> $ x = 1 ; <nl> - $ $ g = 1 ; <nl> + $ y = 1 ; <nl> print " : " . empty ( $ x ) . " : \ n " ; <nl> - print " : " . empty ( $ $ n ) . " : \ n " ; <nl> - print " : " . empty ( $ $ g ) . " : \ n " ; <nl> + print " : " . empty ( $ y ) . " : \ n " ; <nl> } <nl> f ( ) ; <nl> mmm a / hphp / test / quick / Empty . php . expect <nl> ppp b / hphp / test / quick / Empty . php . expect <nl> <nl> : 1 : <nl> : 1 : <nl> - : 1 : <nl> - : : <nl> : : <nl> : : <nl> deleted file mode 100644 <nl> index 498f3df7e79 . . 00000000000 <nl> mmm a / hphp / test / quick / GetVar . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - <nl> - $ x = 42 ; <nl> - $ s = " x " ; <nl> - $ y = & $ $ s + 1 ; <nl> - var_dump ( $ y ) ; <nl> deleted file mode 100644 <nl> index 2d8be4e5e37 . . 00000000000 <nl> mmm a / hphp / test / quick / GetVar . php . expect <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - int ( 42 ) <nl> mmm a / hphp / test / quick / Isset . php <nl> ppp b / hphp / test / quick / Isset . php <nl> <nl> < ? hh <nl> <nl> function f ( ) { <nl> - $ n = " x " ; <nl> - $ g = " y " ; <nl> - global $ $ g ; <nl> + global $ y ; <nl> <nl> print " : " . isset ( $ x ) . " : \ n " ; <nl> - print " : " . isset ( $ $ n ) . " : \ n " ; <nl> - print " : " . isset ( $ $ g ) . " : \ n " ; <nl> + print " : " . isset ( $ y ) . " : \ n " ; <nl> <nl> $ x = 0 ; <nl> - $ $ g = 0 ; <nl> + $ y = 0 ; <nl> print " : " . isset ( $ x ) . " : \ n " ; <nl> - print " : " . isset ( $ $ n ) . " : \ n " ; <nl> - print " : " . isset ( $ $ g ) . " : \ n " ; <nl> + print " : " . isset ( $ y ) . " : \ n " ; <nl> <nl> unset ( $ x ) ; <nl> - unset ( $ $ g ) ; <nl> + unset ( $ y ) ; <nl> print " : " . isset ( $ x ) . " : \ n " ; <nl> - print " : " . isset ( $ $ n ) . " : \ n " ; <nl> - print " : " . isset ( $ $ g ) . " : \ n " ; <nl> + print " : " . isset ( $ y ) . " : \ n " ; <nl> <nl> $ a = array ( ) ; <nl> $ a [ " foo " ] = null ; <nl> mmm a / hphp / test / quick / Isset . php . expect <nl> ppp b / hphp / test / quick / Isset . php . expect <nl> <nl> : : <nl> : : <nl> - : : <nl> - : 1 : <nl> : 1 : <nl> : 1 : <nl> : : <nl> : : <nl> - : : <nl> bool ( false ) <nl> bool ( false ) <nl> bool ( false ) <nl> deleted file mode 100644 <nl> index 97583cb5168 . . 00000000000 <nl> mmm a / hphp / test / quick / ReadVar . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - <nl> - $ x = 42 ; <nl> - $ s = " x " ; <nl> - $ y = $ $ s + 1 ; <nl> - var_dump ( $ y ) ; <nl> deleted file mode 100644 <nl> index f740430fd2c . . 00000000000 <nl> mmm a / hphp / test / quick / ReadVar . php . expect <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - int ( 43 ) <nl> mmm a / hphp / test / quick / SetOp . php <nl> ppp b / hphp / test / quick / SetOp . php <nl> function main ( ) { <nl> $ y = 20 ; <nl> var_dump ( $ y + = 10 ) ; <nl> <nl> - $ var = ' x ' ; <nl> - $ x = 20 ; <nl> - var_dump ( $ $ var + = 10 ) ; <nl> - <nl> $ _SERVER = 20 ; <nl> var_dump ( $ _SERVER + = 10 ) ; <nl> <nl> mmm a / hphp / test / quick / SetOp . php . expect <nl> ppp b / hphp / test / quick / SetOp . php . expect <nl> <nl> int ( 30 ) <nl> int ( 30 ) <nl> int ( 30 ) <nl> - int ( 30 ) <nl> mmm a / hphp / test / quick / Unset . php <nl> ppp b / hphp / test / quick / Unset . php <nl> <nl> < ? hh <nl> <nl> function f ( ) { <nl> - $ n = " y " ; <nl> - $ g = " z " ; <nl> - global $ $ g ; <nl> + global $ y ; <nl> <nl> print " : " . isset ( $ x ) . " : \ n " ; <nl> - print " : " . isset ( $ $ n ) . " : \ n " ; <nl> - print " : " . isset ( $ $ g ) . " : \ n " ; <nl> + print " : " . isset ( $ y ) . " : \ n " ; <nl> <nl> unset ( $ x ) ; <nl> - unset ( $ $ n ) ; <nl> - unset ( $ $ g ) ; <nl> + unset ( $ y ) ; <nl> print " : " . isset ( $ x ) . " : \ n " ; <nl> - print " : " . isset ( $ $ n ) . " : \ n " ; <nl> - print " : " . isset ( $ $ g ) . " : \ n " ; <nl> + print " : " . isset ( $ y ) . " : \ n " ; <nl> <nl> $ x = 0 ; <nl> - $ $ n = 0 ; <nl> - $ $ g = 0 ; <nl> + $ y = 0 ; <nl> print " : " . isset ( $ x ) . " : \ n " ; <nl> - print " : " . isset ( $ $ n ) . " : \ n " ; <nl> - print " : " . isset ( $ $ g ) . " : \ n " ; <nl> + print " : " . isset ( $ y ) . " : \ n " ; <nl> <nl> unset ( $ x ) ; <nl> - unset ( $ $ n ) ; <nl> - unset ( $ $ g ) ; <nl> + unset ( $ y ) ; <nl> print " : " . isset ( $ x ) . " : \ n " ; <nl> - print " : " . isset ( $ $ n ) . " : \ n " ; <nl> - print " : " . isset ( $ $ g ) . " : \ n " ; <nl> + print " : " . isset ( $ y ) . " : \ n " ; <nl> } <nl> f ( ) ; <nl> <nl> mmm a / hphp / test / quick / Unset . php . expect <nl> ppp b / hphp / test / quick / Unset . php . expect <nl> <nl> : : <nl> : : <nl> : : <nl> - : : <nl> - : : <nl> : 1 : <nl> : 1 : <nl> - : 1 : <nl> - : : <nl> : : <nl> : : <nl> mmm a / hphp / test / quick / args - test . php <nl> ppp b / hphp / test / quick / args - test . php <nl> function f ( $ a0 , $ a1 , $ a2 , $ a3 , $ a4 , $ a5 , $ a6 , $ a7 , $ a8 , <nl> $ a57 , $ a58 , $ a59 , $ a60 , $ a61 , $ a62 , $ a63 , $ a64 , <nl> $ a65 , $ a66 , $ a67 , $ a68 , $ a69 , $ a70 , $ a71 , $ a72 , <nl> $ a73 , $ a74 , $ a75 , $ a76 ) { <nl> - for ( $ i = 0 ; $ i < 77 ; $ i + + ) { <nl> - echo $ { " a " . $ i } , " \ n " ; <nl> - } <nl> + echo $ a0 , " \ n " ; <nl> + echo $ a1 , " \ n " ; <nl> + echo $ a2 , " \ n " ; <nl> + echo $ a3 , " \ n " ; <nl> + echo $ a4 , " \ n " ; <nl> + echo $ a5 , " \ n " ; <nl> + echo $ a6 , " \ n " ; <nl> + echo $ a7 , " \ n " ; <nl> + echo $ a8 , " \ n " ; <nl> + echo $ a9 , " \ n " ; <nl> + echo $ a10 , " \ n " ; <nl> + echo $ a11 , " \ n " ; <nl> + echo $ a12 , " \ n " ; <nl> + echo $ a13 , " \ n " ; <nl> + echo $ a14 , " \ n " ; <nl> + echo $ a15 , " \ n " ; <nl> + echo $ a16 , " \ n " ; <nl> + echo $ a17 , " \ n " ; <nl> + echo $ a18 , " \ n " ; <nl> + echo $ a19 , " \ n " ; <nl> + echo $ a20 , " \ n " ; <nl> + echo $ a21 , " \ n " ; <nl> + echo $ a22 , " \ n " ; <nl> + echo $ a23 , " \ n " ; <nl> + echo $ a24 , " \ n " ; <nl> + echo $ a25 , " \ n " ; <nl> + echo $ a26 , " \ n " ; <nl> + echo $ a27 , " \ n " ; <nl> + echo $ a28 , " \ n " ; <nl> + echo $ a29 , " \ n " ; <nl> + echo $ a30 , " \ n " ; <nl> + echo $ a31 , " \ n " ; <nl> + echo $ a32 , " \ n " ; <nl> + echo $ a33 , " \ n " ; <nl> + echo $ a34 , " \ n " ; <nl> + echo $ a35 , " \ n " ; <nl> + echo $ a36 , " \ n " ; <nl> + echo $ a37 , " \ n " ; <nl> + echo $ a38 , " \ n " ; <nl> + echo $ a39 , " \ n " ; <nl> + echo $ a40 , " \ n " ; <nl> + echo $ a41 , " \ n " ; <nl> + echo $ a42 , " \ n " ; <nl> + echo $ a43 , " \ n " ; <nl> + echo $ a44 , " \ n " ; <nl> + echo $ a45 , " \ n " ; <nl> + echo $ a46 , " \ n " ; <nl> + echo $ a47 , " \ n " ; <nl> + echo $ a48 , " \ n " ; <nl> + echo $ a49 , " \ n " ; <nl> + echo $ a50 , " \ n " ; <nl> + echo $ a51 , " \ n " ; <nl> + echo $ a52 , " \ n " ; <nl> + echo $ a53 , " \ n " ; <nl> + echo $ a54 , " \ n " ; <nl> + echo $ a55 , " \ n " ; <nl> + echo $ a56 , " \ n " ; <nl> + echo $ a57 , " \ n " ; <nl> + echo $ a58 , " \ n " ; <nl> + echo $ a59 , " \ n " ; <nl> + echo $ a60 , " \ n " ; <nl> + echo $ a61 , " \ n " ; <nl> + echo $ a62 , " \ n " ; <nl> + echo $ a63 , " \ n " ; <nl> + echo $ a64 , " \ n " ; <nl> + echo $ a65 , " \ n " ; <nl> + echo $ a66 , " \ n " ; <nl> + echo $ a67 , " \ n " ; <nl> + echo $ a68 , " \ n " ; <nl> + echo $ a69 , " \ n " ; <nl> + echo $ a70 , " \ n " ; <nl> + echo $ a71 , " \ n " ; <nl> + echo $ a72 , " \ n " ; <nl> + echo $ a73 , " \ n " ; <nl> + echo $ a74 , " \ n " ; <nl> + echo $ a75 , " \ n " ; <nl> + echo $ a76 , " \ n " ; <nl> } <nl> <nl> function g ( $ a0 , $ a1 , $ a2 , $ a3 , $ a4 , $ a5 , $ a6 , $ a7 , $ a8 , <nl> function g ( $ a0 , $ a1 , $ a2 , $ a3 , $ a4 , $ a5 , $ a6 , $ a7 , $ a8 , <nl> $ a129 , $ a130 , $ a131 , $ a132 , $ a133 , $ a134 , $ a135 , $ a136 , <nl> $ a137 , $ a138 , $ a139 , $ a140 <nl> ) { <nl> - for ( $ i = 0 ; $ i < 141 ; $ i + + ) { <nl> - echo $ { " a " . $ i } , " \ n " ; <nl> - } <nl> + echo $ a0 , " \ n " ; <nl> + echo $ a1 , " \ n " ; <nl> + echo $ a2 , " \ n " ; <nl> + echo $ a3 , " \ n " ; <nl> + echo $ a4 , " \ n " ; <nl> + echo $ a5 , " \ n " ; <nl> + echo $ a6 , " \ n " ; <nl> + echo $ a7 , " \ n " ; <nl> + echo $ a8 , " \ n " ; <nl> + echo $ a9 , " \ n " ; <nl> + echo $ a10 , " \ n " ; <nl> + echo $ a11 , " \ n " ; <nl> + echo $ a12 , " \ n " ; <nl> + echo $ a13 , " \ n " ; <nl> + echo $ a14 , " \ n " ; <nl> + echo $ a15 , " \ n " ; <nl> + echo $ a16 , " \ n " ; <nl> + echo $ a17 , " \ n " ; <nl> + echo $ a18 , " \ n " ; <nl> + echo $ a19 , " \ n " ; <nl> + echo $ a20 , " \ n " ; <nl> + echo $ a21 , " \ n " ; <nl> + echo $ a22 , " \ n " ; <nl> + echo $ a23 , " \ n " ; <nl> + echo $ a24 , " \ n " ; <nl> + echo $ a25 , " \ n " ; <nl> + echo $ a26 , " \ n " ; <nl> + echo $ a27 , " \ n " ; <nl> + echo $ a28 , " \ n " ; <nl> + echo $ a29 , " \ n " ; <nl> + echo $ a30 , " \ n " ; <nl> + echo $ a31 , " \ n " ; <nl> + echo $ a32 , " \ n " ; <nl> + echo $ a33 , " \ n " ; <nl> + echo $ a34 , " \ n " ; <nl> + echo $ a35 , " \ n " ; <nl> + echo $ a36 , " \ n " ; <nl> + echo $ a37 , " \ n " ; <nl> + echo $ a38 , " \ n " ; <nl> + echo $ a39 , " \ n " ; <nl> + echo $ a40 , " \ n " ; <nl> + echo $ a41 , " \ n " ; <nl> + echo $ a42 , " \ n " ; <nl> + echo $ a43 , " \ n " ; <nl> + echo $ a44 , " \ n " ; <nl> + echo $ a45 , " \ n " ; <nl> + echo $ a46 , " \ n " ; <nl> + echo $ a47 , " \ n " ; <nl> + echo $ a48 , " \ n " ; <nl> + echo $ a49 , " \ n " ; <nl> + echo $ a50 , " \ n " ; <nl> + echo $ a51 , " \ n " ; <nl> + echo $ a52 , " \ n " ; <nl> + echo $ a53 , " \ n " ; <nl> + echo $ a54 , " \ n " ; <nl> + echo $ a55 , " \ n " ; <nl> + echo $ a56 , " \ n " ; <nl> + echo $ a57 , " \ n " ; <nl> + echo $ a58 , " \ n " ; <nl> + echo $ a59 , " \ n " ; <nl> + echo $ a60 , " \ n " ; <nl> + echo $ a61 , " \ n " ; <nl> + echo $ a62 , " \ n " ; <nl> + echo $ a63 , " \ n " ; <nl> + echo $ a64 , " \ n " ; <nl> + echo $ a65 , " \ n " ; <nl> + echo $ a66 , " \ n " ; <nl> + echo $ a67 , " \ n " ; <nl> + echo $ a68 , " \ n " ; <nl> + echo $ a69 , " \ n " ; <nl> + echo $ a70 , " \ n " ; <nl> + echo $ a71 , " \ n " ; <nl> + echo $ a72 , " \ n " ; <nl> + echo $ a73 , " \ n " ; <nl> + echo $ a74 , " \ n " ; <nl> + echo $ a75 , " \ n " ; <nl> + echo $ a76 , " \ n " ; <nl> + echo $ a77 , " \ n " ; <nl> + echo $ a78 , " \ n " ; <nl> + echo $ a79 , " \ n " ; <nl> + echo $ a80 , " \ n " ; <nl> + echo $ a81 , " \ n " ; <nl> + echo $ a82 , " \ n " ; <nl> + echo $ a83 , " \ n " ; <nl> + echo $ a84 , " \ n " ; <nl> + echo $ a85 , " \ n " ; <nl> + echo $ a86 , " \ n " ; <nl> + echo $ a87 , " \ n " ; <nl> + echo $ a88 , " \ n " ; <nl> + echo $ a89 , " \ n " ; <nl> + echo $ a90 , " \ n " ; <nl> + echo $ a91 , " \ n " ; <nl> + echo $ a92 , " \ n " ; <nl> + echo $ a93 , " \ n " ; <nl> + echo $ a94 , " \ n " ; <nl> + echo $ a95 , " \ n " ; <nl> + echo $ a96 , " \ n " ; <nl> + echo $ a97 , " \ n " ; <nl> + echo $ a98 , " \ n " ; <nl> + echo $ a99 , " \ n " ; <nl> + echo $ a100 , " \ n " ; <nl> + echo $ a101 , " \ n " ; <nl> + echo $ a102 , " \ n " ; <nl> + echo $ a103 , " \ n " ; <nl> + echo $ a104 , " \ n " ; <nl> + echo $ a105 , " \ n " ; <nl> + echo $ a106 , " \ n " ; <nl> + echo $ a107 , " \ n " ; <nl> + echo $ a108 , " \ n " ; <nl> + echo $ a109 , " \ n " ; <nl> + echo $ a110 , " \ n " ; <nl> + echo $ a111 , " \ n " ; <nl> + echo $ a112 , " \ n " ; <nl> + echo $ a113 , " \ n " ; <nl> + echo $ a114 , " \ n " ; <nl> + echo $ a115 , " \ n " ; <nl> + echo $ a116 , " \ n " ; <nl> + echo $ a117 , " \ n " ; <nl> + echo $ a118 , " \ n " ; <nl> + echo $ a119 , " \ n " ; <nl> + echo $ a120 , " \ n " ; <nl> + echo $ a121 , " \ n " ; <nl> + echo $ a122 , " \ n " ; <nl> + echo $ a123 , " \ n " ; <nl> + echo $ a124 , " \ n " ; <nl> + echo $ a125 , " \ n " ; <nl> + echo $ a126 , " \ n " ; <nl> + echo $ a127 , " \ n " ; <nl> + echo $ a128 , " \ n " ; <nl> + echo $ a129 , " \ n " ; <nl> + echo $ a130 , " \ n " ; <nl> + echo $ a131 , " \ n " ; <nl> + echo $ a132 , " \ n " ; <nl> + echo $ a133 , " \ n " ; <nl> + echo $ a134 , " \ n " ; <nl> + echo $ a135 , " \ n " ; <nl> + echo $ a136 , " \ n " ; <nl> + echo $ a137 , " \ n " ; <nl> + echo $ a138 , " \ n " ; <nl> + echo $ a139 , " \ n " ; <nl> + echo $ a140 , " \ n " ; <nl> } <nl> <nl> function gr ( $ a0 , $ a1 , $ a2 , $ a3 , $ a4 , $ a5 , $ a6 , $ a7 , $ a8 , <nl> function gr ( $ a0 , $ a1 , $ a2 , $ a3 , $ a4 , $ a5 , $ a6 , $ a7 , $ a8 , <nl> $ a129 , $ a130 , $ a131 , $ a132 , $ a133 , $ a134 , $ a135 , $ a136 , <nl> $ a137 , $ a138 , $ a139 , $ a140 <nl> ) { <nl> - for ( $ i = 0 ; $ i < 141 ; $ i + + ) { <nl> - $ { " a " . $ i } + + ; <nl> - } <nl> + echo $ a0 , " \ n " ; <nl> + echo $ a1 , " \ n " ; <nl> + echo $ a2 , " \ n " ; <nl> + echo $ a3 , " \ n " ; <nl> + echo $ a4 , " \ n " ; <nl> + echo $ a5 , " \ n " ; <nl> + echo $ a6 , " \ n " ; <nl> + echo $ a7 , " \ n " ; <nl> + echo $ a8 , " \ n " ; <nl> + echo $ a9 , " \ n " ; <nl> + echo $ a10 , " \ n " ; <nl> + echo $ a11 , " \ n " ; <nl> + echo $ a12 , " \ n " ; <nl> + echo $ a13 , " \ n " ; <nl> + echo $ a14 , " \ n " ; <nl> + echo $ a15 , " \ n " ; <nl> + echo $ a16 , " \ n " ; <nl> + echo $ a17 , " \ n " ; <nl> + echo $ a18 , " \ n " ; <nl> + echo $ a19 , " \ n " ; <nl> + echo $ a20 , " \ n " ; <nl> + echo $ a21 , " \ n " ; <nl> + echo $ a22 , " \ n " ; <nl> + echo $ a23 , " \ n " ; <nl> + echo $ a24 , " \ n " ; <nl> + echo $ a25 , " \ n " ; <nl> + echo $ a26 , " \ n " ; <nl> + echo $ a27 , " \ n " ; <nl> + echo $ a28 , " \ n " ; <nl> + echo $ a29 , " \ n " ; <nl> + echo $ a30 , " \ n " ; <nl> + echo $ a31 , " \ n " ; <nl> + echo $ a32 , " \ n " ; <nl> + echo $ a33 , " \ n " ; <nl> + echo $ a34 , " \ n " ; <nl> + echo $ a35 , " \ n " ; <nl> + echo $ a36 , " \ n " ; <nl> + echo $ a37 , " \ n " ; <nl> + echo $ a38 , " \ n " ; <nl> + echo $ a39 , " \ n " ; <nl> + echo $ a40 , " \ n " ; <nl> + echo $ a41 , " \ n " ; <nl> + echo $ a42 , " \ n " ; <nl> + echo $ a43 , " \ n " ; <nl> + echo $ a44 , " \ n " ; <nl> + echo $ a45 , " \ n " ; <nl> + echo $ a46 , " \ n " ; <nl> + echo $ a47 , " \ n " ; <nl> + echo $ a48 , " \ n " ; <nl> + echo $ a49 , " \ n " ; <nl> + echo $ a50 , " \ n " ; <nl> + echo $ a51 , " \ n " ; <nl> + echo $ a52 , " \ n " ; <nl> + echo $ a53 , " \ n " ; <nl> + echo $ a54 , " \ n " ; <nl> + echo $ a55 , " \ n " ; <nl> + echo $ a56 , " \ n " ; <nl> + echo $ a57 , " \ n " ; <nl> + echo $ a58 , " \ n " ; <nl> + echo $ a59 , " \ n " ; <nl> + echo $ a60 , " \ n " ; <nl> + echo $ a61 , " \ n " ; <nl> + echo $ a62 , " \ n " ; <nl> + echo $ a63 , " \ n " ; <nl> + echo $ a64 , " \ n " ; <nl> + echo $ a65 , " \ n " ; <nl> + echo $ a66 , " \ n " ; <nl> + echo $ a67 , " \ n " ; <nl> + echo $ a68 , " \ n " ; <nl> + echo $ a69 , " \ n " ; <nl> + echo $ a70 , " \ n " ; <nl> + echo $ a71 , " \ n " ; <nl> + echo $ a72 , " \ n " ; <nl> + echo $ a73 , " \ n " ; <nl> + echo $ a74 , " \ n " ; <nl> + echo $ a75 , " \ n " ; <nl> + echo $ a76 , " \ n " ; <nl> + echo $ a77 , " \ n " ; <nl> + echo $ a78 , " \ n " ; <nl> + echo $ a79 , " \ n " ; <nl> + echo $ a80 , " \ n " ; <nl> + echo $ a81 , " \ n " ; <nl> + echo $ a82 , " \ n " ; <nl> + echo $ a83 , " \ n " ; <nl> + echo $ a84 , " \ n " ; <nl> + echo $ a85 , " \ n " ; <nl> + echo $ a86 , " \ n " ; <nl> + echo $ a87 , " \ n " ; <nl> + echo $ a88 , " \ n " ; <nl> + echo $ a89 , " \ n " ; <nl> + echo $ a90 , " \ n " ; <nl> + echo $ a91 , " \ n " ; <nl> + echo $ a92 , " \ n " ; <nl> + echo $ a93 , " \ n " ; <nl> + echo $ a94 , " \ n " ; <nl> + echo $ a95 , " \ n " ; <nl> + echo $ a96 , " \ n " ; <nl> + echo $ a97 , " \ n " ; <nl> + echo $ a98 , " \ n " ; <nl> + echo $ a99 , " \ n " ; <nl> + echo $ a100 , " \ n " ; <nl> + echo $ a101 , " \ n " ; <nl> + echo $ a102 , " \ n " ; <nl> + echo $ a103 , " \ n " ; <nl> + echo $ a104 , " \ n " ; <nl> + echo $ a105 , " \ n " ; <nl> + echo $ a106 , " \ n " ; <nl> + echo $ a107 , " \ n " ; <nl> + echo $ a108 , " \ n " ; <nl> + echo $ a109 , " \ n " ; <nl> + echo $ a110 , " \ n " ; <nl> + echo $ a111 , " \ n " ; <nl> + echo $ a112 , " \ n " ; <nl> + echo $ a113 , " \ n " ; <nl> + echo $ a114 , " \ n " ; <nl> + echo $ a115 , " \ n " ; <nl> + echo $ a116 , " \ n " ; <nl> + echo $ a117 , " \ n " ; <nl> + echo $ a118 , " \ n " ; <nl> + echo $ a119 , " \ n " ; <nl> + echo $ a120 , " \ n " ; <nl> + echo $ a121 , " \ n " ; <nl> + echo $ a122 , " \ n " ; <nl> + echo $ a123 , " \ n " ; <nl> + echo $ a124 , " \ n " ; <nl> + echo $ a125 , " \ n " ; <nl> + echo $ a126 , " \ n " ; <nl> + echo $ a127 , " \ n " ; <nl> + echo $ a128 , " \ n " ; <nl> + echo $ a129 , " \ n " ; <nl> + echo $ a130 , " \ n " ; <nl> + echo $ a131 , " \ n " ; <nl> + echo $ a132 , " \ n " ; <nl> + echo $ a133 , " \ n " ; <nl> + echo $ a134 , " \ n " ; <nl> + echo $ a135 , " \ n " ; <nl> + echo $ a136 , " \ n " ; <nl> + echo $ a137 , " \ n " ; <nl> + echo $ a138 , " \ n " ; <nl> + echo $ a139 , " \ n " ; <nl> + echo $ a140 , " \ n " ; <nl> } <nl> <nl> function test ( $ f , $ a ) { <nl> deleted file mode 100644 <nl> index 59fff95f01a . . 00000000000 <nl> mmm a / hphp / test / quick / cgetm_ne . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - <nl> - function main ( ) { <nl> - $ asd = array ( " asd " , array ( " bar " , " baz " ) ) ; <nl> - $ bsd = " asd " ; <nl> - echo ( $ $ bsd ) [ 1 ] [ 1 ] . " \ n " ; <nl> - <nl> - $ bsd = " unknown " ; <nl> - echo ( $ $ bsd ) [ 1 ] [ 1 ] . " \ n " ; <nl> - } <nl> - main ( ) ; <nl> deleted file mode 100644 <nl> index fc9502e02e1 . . 00000000000 <nl> mmm a / hphp / test / quick / cgetm_ne . php . expectf <nl> ppp / dev / null <nl> <nl> - baz <nl> - <nl> - Notice : Undefined variable : unknown in % s on line 9 <nl> - <nl> mmm a / hphp / test / quick / function_varargs . php <nl> ppp b / hphp / test / quick / function_varargs . php <nl> function func_get_arg_arg ( $ arg , $ idx ) { <nl> return func_get_arg ( $ idx ) ; <nl> } <nl> <nl> - function func_num_args_varenv ( $ dst , $ src ) { <nl> - $ $ dst = $ src ; <nl> - return func_num_args ( ) ; <nl> - } <nl> - <nl> - function func_get_args_varenv ( $ dst , $ src ) { <nl> - $ $ dst = $ src ; <nl> - return func_get_args ( ) ; <nl> - } <nl> - <nl> - function func_get_arg_varenv ( $ dst , $ src , $ idx ) { <nl> - $ $ dst = $ src ; <nl> - return func_get_arg ( $ idx ) ; <nl> - } <nl> - <nl> function test ( string $ generator , array $ args ) { <nl> var_dump ( call_user_func_array ( $ generator , $ args ) ) ; <nl> } <nl> function test_get_arg ( string $ type , array $ extra_args ) { <nl> test_num_args ( ' arg ' , $ extra_args , ' defined_arg ' ) ; <nl> test_get_args ( ' arg ' , $ extra_args , ' defined_arg ' ) ; <nl> test_get_arg ( ' arg ' , $ extra_args , ' defined_arg ' ) ; <nl> - <nl> - foreach ( array ( ' dst ' , ' src ' , ' idx ' , ' undef ' ) as $ dst ) { <nl> - test_num_args ( ' varenv ' , $ extra_args , $ dst , ' replacement ' ) ; <nl> - test_get_args ( ' varenv ' , $ extra_args , $ dst , ' replacement ' ) ; <nl> - test_get_arg ( ' varenv ' , $ extra_args , $ dst , ' replacement ' ) ; <nl> - } <nl> } <nl> mmm a / hphp / test / quick / function_varargs . php . expectf <nl> ppp b / hphp / test / quick / function_varargs . php . expectf <nl> int ( 1 ) <nl> <nl> Warning : func_get_arg ( ) : Argument 2 not passed to function in % s on line % d <nl> bool ( false ) <nl> - int ( 2 ) <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s on line % d <nl> - bool ( false ) <nl> - string ( 11 ) " replacement " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - <nl> - Warning : func_get_arg ( ) : Argument 3 not passed to function in % s on line % d <nl> - bool ( false ) <nl> - int ( 2 ) <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - string ( 3 ) " src " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s on line % d <nl> - bool ( false ) <nl> - string ( 3 ) " src " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - <nl> - Warning : func_get_arg ( ) : Argument 3 not passed to function in % s on line % d <nl> - bool ( false ) <nl> - int ( 2 ) <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - string ( 3 ) " idx " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - int ( 2 ) <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - string ( 5 ) " undef " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s on line % d <nl> - bool ( false ) <nl> - string ( 5 ) " undef " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - <nl> - Warning : func_get_arg ( ) : Argument 3 not passed to function in % s on line % d <nl> - bool ( false ) <nl> int ( 1 ) <nl> array ( 1 ) { <nl> [ 0 ] = > <nl> string ( 5 ) " hello " <nl> <nl> Warning : func_get_arg ( ) : Argument 3 not passed to function in % s on line % d <nl> bool ( false ) <nl> - int ( 3 ) <nl> - array ( 3 ) { <nl> - [ 0 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s on line % d <nl> - bool ( false ) <nl> - string ( 11 ) " replacement " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - string ( 5 ) " hello " <nl> - <nl> - Warning : func_get_arg ( ) : Argument 4 not passed to function in % s on line % d <nl> - bool ( false ) <nl> - int ( 3 ) <nl> - array ( 3 ) { <nl> - [ 0 ] = > <nl> - string ( 3 ) " src " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s on line % d <nl> - bool ( false ) <nl> - string ( 3 ) " src " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - string ( 5 ) " hello " <nl> - <nl> - Warning : func_get_arg ( ) : Argument 4 not passed to function in % s on line % d <nl> - bool ( false ) <nl> - int ( 3 ) <nl> - array ( 3 ) { <nl> - [ 0 ] = > <nl> - string ( 3 ) " idx " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - int ( 3 ) <nl> - array ( 3 ) { <nl> - [ 0 ] = > <nl> - string ( 5 ) " undef " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s on line % d <nl> - bool ( false ) <nl> - string ( 5 ) " undef " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - string ( 5 ) " hello " <nl> - <nl> - Warning : func_get_arg ( ) : Argument 4 not passed to function in % s on line % d <nl> - bool ( false ) <nl> int ( 2 ) <nl> array ( 2 ) { <nl> [ 0 ] = > <nl> int ( 47 ) <nl> <nl> Warning : func_get_arg ( ) : Argument 4 not passed to function in % s on line % d <nl> bool ( false ) <nl> - int ( 4 ) <nl> - array ( 4 ) { <nl> - [ 0 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - [ 3 ] = > <nl> - int ( 47 ) <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s on line % d <nl> - bool ( false ) <nl> - string ( 11 ) " replacement " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - string ( 5 ) " hello " <nl> - int ( 47 ) <nl> - <nl> - Warning : func_get_arg ( ) : Argument 5 not passed to function in % s on line % d <nl> - bool ( false ) <nl> - int ( 4 ) <nl> - array ( 4 ) { <nl> - [ 0 ] = > <nl> - string ( 3 ) " src " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - [ 3 ] = > <nl> - int ( 47 ) <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s on line % d <nl> - bool ( false ) <nl> - string ( 3 ) " src " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - string ( 5 ) " hello " <nl> - int ( 47 ) <nl> - <nl> - Warning : func_get_arg ( ) : Argument 5 not passed to function in % s on line % d <nl> - bool ( false ) <nl> - int ( 4 ) <nl> - array ( 4 ) { <nl> - [ 0 ] = > <nl> - string ( 3 ) " idx " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - [ 3 ] = > <nl> - int ( 47 ) <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - int ( 4 ) <nl> - array ( 4 ) { <nl> - [ 0 ] = > <nl> - string ( 5 ) " undef " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - [ 3 ] = > <nl> - int ( 47 ) <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s on line % d <nl> - bool ( false ) <nl> - string ( 5 ) " undef " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - string ( 5 ) " hello " <nl> - int ( 47 ) <nl> - <nl> - Warning : func_get_arg ( ) : Argument 5 not passed to function in % s on line % d <nl> - bool ( false ) <nl> mmm a / hphp / test / quick / generator_varargs . php <nl> ppp b / hphp / test / quick / generator_varargs . php <nl> function gen_func_get_arg_arg ( $ arg , $ idx ) { <nl> yield func_get_arg ( $ idx ) ; <nl> } <nl> <nl> - function gen_func_num_args_varenv ( $ dst , $ src ) { <nl> - $ $ dst = $ src ; <nl> - yield func_num_args ( ) ; <nl> - } <nl> - <nl> - function gen_func_get_args_varenv ( $ dst , $ src ) { <nl> - $ $ dst = $ src ; <nl> - yield func_get_args ( ) ; <nl> - } <nl> - <nl> - function gen_func_get_arg_varenv ( $ dst , $ src , $ idx ) { <nl> - $ $ dst = $ src ; <nl> - yield func_get_arg ( $ idx ) ; <nl> - } <nl> - <nl> function test ( string $ generator , array $ args ) { <nl> $ gen = call_user_func_array ( $ generator , $ args ) ; <nl> foreach ( $ gen as $ val ) { <nl> function test_get_arg ( string $ type , array $ extra_args ) { <nl> test_num_args ( ' arg ' , $ extra_args , ' defined_arg ' ) ; <nl> test_get_args ( ' arg ' , $ extra_args , ' defined_arg ' ) ; <nl> test_get_arg ( ' arg ' , $ extra_args , ' defined_arg ' ) ; <nl> - <nl> - foreach ( array ( ' dst ' , ' src ' , ' idx ' , ' undef ' ) as $ dst ) { <nl> - test_num_args ( ' varenv ' , $ extra_args , $ dst , ' replacement ' ) ; <nl> - test_get_args ( ' varenv ' , $ extra_args , $ dst , ' replacement ' ) ; <nl> - test_get_arg ( ' varenv ' , $ extra_args , $ dst , ' replacement ' ) ; <nl> - } <nl> } <nl> mmm a / hphp / test / quick / generator_varargs . php . expectf <nl> ppp b / hphp / test / quick / generator_varargs . php . expectf <nl> int ( 1 ) <nl> <nl> Warning : func_get_arg ( ) : Argument 2 not passed to function in % s / generator_varargs . php on line 24 <nl> bool ( false ) <nl> - int ( 2 ) <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> - string ( 11 ) " replacement " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - <nl> - Warning : func_get_arg ( ) : Argument 3 not passed to function in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> - int ( 2 ) <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - string ( 3 ) " src " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> - string ( 3 ) " src " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - <nl> - Warning : func_get_arg ( ) : Argument 3 not passed to function in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> - int ( 2 ) <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - string ( 3 ) " idx " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - int ( 2 ) <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - string ( 5 ) " undef " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> - string ( 5 ) " undef " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - <nl> - Warning : func_get_arg ( ) : Argument 3 not passed to function in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> int ( 1 ) <nl> array ( 1 ) { <nl> [ 0 ] = > <nl> string ( 5 ) " hello " <nl> <nl> Warning : func_get_arg ( ) : Argument 3 not passed to function in % s / generator_varargs . php on line 24 <nl> bool ( false ) <nl> - int ( 3 ) <nl> - array ( 3 ) { <nl> - [ 0 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> - string ( 11 ) " replacement " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - string ( 5 ) " hello " <nl> - <nl> - Warning : func_get_arg ( ) : Argument 4 not passed to function in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> - int ( 3 ) <nl> - array ( 3 ) { <nl> - [ 0 ] = > <nl> - string ( 3 ) " src " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> - string ( 3 ) " src " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - string ( 5 ) " hello " <nl> - <nl> - Warning : func_get_arg ( ) : Argument 4 not passed to function in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> - int ( 3 ) <nl> - array ( 3 ) { <nl> - [ 0 ] = > <nl> - string ( 3 ) " idx " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - int ( 3 ) <nl> - array ( 3 ) { <nl> - [ 0 ] = > <nl> - string ( 5 ) " undef " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> - string ( 5 ) " undef " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - string ( 5 ) " hello " <nl> - <nl> - Warning : func_get_arg ( ) : Argument 4 not passed to function in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> int ( 2 ) <nl> array ( 2 ) { <nl> [ 0 ] = > <nl> int ( 47 ) <nl> <nl> Warning : func_get_arg ( ) : Argument 4 not passed to function in % s / generator_varargs . php on line 24 <nl> bool ( false ) <nl> - int ( 4 ) <nl> - array ( 4 ) { <nl> - [ 0 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - [ 3 ] = > <nl> - int ( 47 ) <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> - string ( 11 ) " replacement " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - string ( 5 ) " hello " <nl> - int ( 47 ) <nl> - <nl> - Warning : func_get_arg ( ) : Argument 5 not passed to function in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> - int ( 4 ) <nl> - array ( 4 ) { <nl> - [ 0 ] = > <nl> - string ( 3 ) " src " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - [ 3 ] = > <nl> - int ( 47 ) <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> - string ( 3 ) " src " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - string ( 5 ) " hello " <nl> - int ( 47 ) <nl> - <nl> - Warning : func_get_arg ( ) : Argument 5 not passed to function in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> - int ( 4 ) <nl> - array ( 4 ) { <nl> - [ 0 ] = > <nl> - string ( 3 ) " idx " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - [ 3 ] = > <nl> - int ( 47 ) <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - <nl> - Warning : func_get_arg ( ) expects parameter 1 to be integer , string given in % s on line % d <nl> - NULL <nl> - int ( 4 ) <nl> - array ( 4 ) { <nl> - [ 0 ] = > <nl> - string ( 5 ) " undef " <nl> - [ 1 ] = > <nl> - string ( 11 ) " replacement " <nl> - [ 2 ] = > <nl> - string ( 5 ) " hello " <nl> - [ 3 ] = > <nl> - int ( 47 ) <nl> - } <nl> - <nl> - Warning : func_get_arg ( ) : The argument number should be > = 0 in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> - string ( 5 ) " undef " <nl> - string ( 11 ) " replacement " <nl> - int ( 2 ) <nl> - string ( 5 ) " hello " <nl> - int ( 47 ) <nl> - <nl> - Warning : func_get_arg ( ) : Argument 5 not passed to function in % s / generator_varargs . php on line 39 <nl> - bool ( false ) <nl> mmm a / hphp / test / quick / generator_vars . php <nl> ppp b / hphp / test / quick / generator_vars . php <nl> function create ( ) { <nl> yield $ x ; <nl> $ s = ' foo ' ; <nl> yield $ s ; <nl> - $ $ s = 1234 ; <nl> - $ z = $ $ s ; <nl> + $ foo = 1234 ; <nl> + $ z = $ foo ; <nl> yield $ z ; <nl> - yield $ $ s ; <nl> + yield $ foo ; <nl> } <nl> <nl> function unusedarg ( $ x , $ y ) { <nl> function unusedarg ( $ x , $ y ) { <nl> yield compact ( ' x ' , ' z ' ) ; <nl> $ s = ' foo ' ; <nl> yield ' almost there ' ; <nl> - $ $ s = ' inside foo ' ; <nl> + $ foo = ' inside foo ' ; <nl> yield compact ( ' foo ' , ' s ' ) ; <nl> yield compact ( ' x ' , ' y ' , ' foo ' , ' z ' ) ; <nl> } <nl> deleted file mode 100644 <nl> index 4071adbcf12 . . 00000000000 <nl> mmm a / hphp / test / quick / hopt_varenv . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - / / Copyright 2004 - 2015 Facebook . All Rights Reserved . <nl> - <nl> - function foo ( $ x ) { <nl> - $ a = 1 ; <nl> - $ b = 2 ; <nl> - $ c = 3 ; <nl> - return $ $ x ; <nl> - } <nl> - <nl> - $ s = foo ( " a " ) ; <nl> - echo $ s ; <nl> - $ s = foo ( " b " ) ; <nl> - echo $ s ; <nl> - $ s = foo ( " c " ) ; <nl> - echo $ s ; <nl> - echo " \ n " ; <nl> - $ s = foo ( " d " ) ; <nl> - echo $ s ; <nl> - <nl> deleted file mode 100644 <nl> index 3bbcdcf7a7c . . 00000000000 <nl> mmm a / hphp / test / quick / hopt_varenv . php . expectf <nl> ppp / dev / null <nl> <nl> - 123 <nl> - <nl> - Notice : Undefined variable : d in % s on line 8 <nl> mmm a / hphp / test / quick / sp . php <nl> ppp b / hphp / test / quick / sp . php <nl> function b ( ) { <nl> print $ b . " \ n " ; <nl> } <nl> <nl> - function c ( ) { <nl> - $ yoo = ' goo ' ; <nl> - $ c = A : : $ $ yoo ; <nl> - A : : $ $ yoo = ' coo ' ; <nl> - print $ c . " \ n " ; <nl> - } <nl> - <nl> - function d ( ) { <nl> - $ zoo = ' A ' ; <nl> - $ yoo = ' goo ' ; <nl> - $ d = $ zoo : : $ $ yoo ; <nl> - $ zoo : : $ $ yoo = ' doo ' ; <nl> - print $ d . " \ n " ; <nl> - } <nl> - <nl> if ( 1 ) { <nl> class B { <nl> public static $ goo = ' bozo ' ; <nl> class B { <nl> p ( ) ; <nl> b ( ) ; <nl> p ( ) ; <nl> - c ( ) ; <nl> - p ( ) ; <nl> - d ( ) ; <nl> - p ( ) ; <nl> print " round 2 \ n " ; <nl> a ( ) ; <nl> p ( ) ; <nl> class B { <nl> b ( ) ; <nl> p ( ) ; <nl> A : : $ goo = ' foo ' ; <nl> - c ( ) ; <nl> p ( ) ; <nl> A : : $ goo = ' foo ' ; <nl> - d ( ) ; <nl> p ( ) ; <nl> mmm a / hphp / test / quick / sp . php . expect <nl> ppp b / hphp / test / quick / sp . php . expect <nl> foo <nl> aoo <nl> aoo <nl> boo <nl> - boo <nl> - coo <nl> - coo <nl> - doo <nl> round 2 <nl> - doo <nl> + boo <nl> aoo <nl> foo <nl> boo <nl> foo <nl> - coo <nl> foo <nl> - doo <nl> mmm a / hphp / test / quick / undefined - bases . php <nl> ppp b / hphp / test / quick / undefined - bases . php <nl> function main ( ) { <nl> <nl> $ x = $ GLOBALS [ $ name ] [ ' foo ' ] ; <nl> $ x = $ GLOBALS [ id ( $ name ) ] [ ' foo ' ] ; <nl> - <nl> - $ x = ( $ $ name ) [ ' foo ' ] ; <nl> - $ x = ( $ { id ( ' varname ' ) } ) [ ' foo ' ] ; <nl> } <nl> main ( ) ; <nl> mmm a / hphp / test / quick / undefined - bases . php . expectf <nl> ppp b / hphp / test / quick / undefined - bases . php . expectf <nl> Notice : Undefined variable : undef in % s / test / quick / undefined - bases . php on line 1 <nl> Notice : Undefined variable : varname in % s / test / quick / undefined - bases . php on line 13 <nl> <nl> Notice : Undefined variable : varname in % s / test / quick / undefined - bases . php on line 14 <nl> - <nl> - Notice : Undefined variable : varname in % s / test / quick / undefined - bases . php on line 16 <nl> - <nl> - Notice : Undefined variable : varname in % s / test / quick / undefined - bases . php on line 17 <nl> deleted file mode 100644 <nl> index e1134412c67 . . 00000000000 <nl> mmm a / hphp / test / quick / unset_varenv . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - <nl> - function foo ( ) { <nl> - $ x = ' c ' ; <nl> - $ $ x = " haha " ; <nl> - echo " value : " , $ $ x . " \ n " ; <nl> - unset ( $ $ x ) ; <nl> - echo " value : " , $ $ x . " \ n " ; <nl> - } <nl> - <nl> - foo ( ) ; <nl> deleted file mode 100644 <nl> index 35ba68d623f . . 00000000000 <nl> mmm a / hphp / test / quick / unset_varenv . php . expectf <nl> ppp / dev / null <nl> <nl> - value : haha <nl> - value : <nl> - Notice : Undefined variable : c in % s on line 8 <nl> deleted file mode 100644 <nl> index f1d7d472137 . . 00000000000 <nl> mmm a / hphp / test / quick / varenv_extra_args . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - <nl> - function foo ( $ asd ) { <nl> - $ y = " a " ; <nl> - $ $ y = 12 ; <nl> - var_dump ( func_get_args ( ) ) ; <nl> - var_dump ( func_get_arg ( 2 ) ) ; <nl> - } <nl> - foo ( 2 , " foo " , " bar " ) ; <nl> deleted file mode 100644 <nl> index 5689f945e8e . . 00000000000 <nl> mmm a / hphp / test / quick / varenv_extra_args . php . expect <nl> ppp / dev / null <nl> <nl> - array ( 3 ) { <nl> - [ 0 ] = > <nl> - int ( 2 ) <nl> - [ 1 ] = > <nl> - string ( 3 ) " foo " <nl> - [ 2 ] = > <nl> - string ( 3 ) " bar " <nl> - } <nl> - string ( 3 ) " bar " <nl> mmm a / hphp / test / slow / array_iterator / 439 . php <nl> ppp b / hphp / test / slow / array_iterator / 439 . php <nl> function main_439 ( ) { <nl> print " $ a : $ b <nl> " ; <nl> } <nl> - $ itp = " it " ; <nl> - foreach ( $ $ itp as $ a = > $ b ) { <nl> - print " $ a : $ b <nl> - " ; <nl> - } <nl> foreach ( getIter ( ) as $ a = > $ b ) { <nl> print " $ a : $ b <nl> " ; <nl> mmm a / hphp / test / slow / array_iterator / 439 . php . expect <nl> ppp b / hphp / test / slow / array_iterator / 439 . php . expect <nl> key : 2 <nl> next : <nl> current : <nl> valid : <nl> - rewinding <nl> - current : 1 <nl> - valid : 1 <nl> - current : 1 <nl> - key : 0 <nl> - 0 : 1 <nl> - next : 2 <nl> - current : 2 <nl> - valid : 1 <nl> - current : 2 <nl> - key : 1 <nl> - 1 : 2 <nl> - next : 3 <nl> - current : 3 <nl> - valid : 1 <nl> - current : 3 <nl> - key : 2 <nl> - 2 : 3 <nl> - next : <nl> - current : <nl> - valid : <nl> constructing <nl> rewinding <nl> current : 1 <nl> mmm a / hphp / test / slow / collection_classes / imm - iteration - bug . php <nl> ppp b / hphp / test / slow / collection_classes / imm - iteration - bug . php <nl> <nl> / / such that the second foreach loop ' s IterInit instruction gets jitted <nl> / / but its IterNext instruction gets interpreted . <nl> function main ( ) { <nl> - $ y = ' z ' ; <nl> $ z = 1 ; <nl> $ x = Vector { 1 , 2 , 3 } ; <nl> $ x [ ] = 4 ; <nl> - foreach ( $ x as $ v ) { $ $ y = 1 ; } <nl> + foreach ( $ x as $ v ) { $ z = 1 ; } <nl> $ x = ImmVector { 1 , 2 , 3 } ; <nl> - foreach ( $ x as $ v ) { $ $ y = 1 ; } <nl> + foreach ( $ x as $ v ) { $ z = 1 ; } <nl> echo " Done \ n " ; <nl> } <nl> <nl> deleted file mode 100644 <nl> index 08f29c2b7ed . . 00000000000 <nl> mmm a / hphp / test / slow / compilation / dynamic_sprop . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - <nl> - class Base { <nl> - static $ x = ' asd ' ; <nl> - } <nl> - <nl> - class Derived extends Base { <nl> - } <nl> - <nl> - function getstr ( ) { return ' x ' ; } <nl> - <nl> - function heh ( ) { <nl> - $ foo = getstr ( ) ; <nl> - Derived : : $ { $ foo } = 2 ; <nl> - var_dump ( Base : : $ x ) ; <nl> - } <nl> - <nl> - <nl> - < < __EntryPoint > > <nl> - function main_dynamic_sprop ( ) { <nl> - heh ( ) ; <nl> - } <nl> deleted file mode 100644 <nl> index c4f25cd82af . . 00000000000 <nl> mmm a / hphp / test / slow / compilation / dynamic_sprop . php . expect <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - int ( 2 ) <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index fb497046bdf . . 00000000000 <nl> mmm a / hphp / test / slow / debug_backtrace / metadata_varenv . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - <nl> - function bar ( $ options ) { <nl> - var_dump ( debug_backtrace ( $ options ) ) ; <nl> - } <nl> - <nl> - function foo ( $ local , $ options ) { <nl> - $ $ local = ' I am foo ' ; <nl> - bar ( $ options ) ; <nl> - } <nl> - <nl> - foo ( ' __not_metadata ' , 0 ) ; <nl> - foo ( ' __not_metadata ' , DEBUG_BACKTRACE_PROVIDE_METADATA ) ; <nl> - foo ( ' 86metadata ' , 0 ) ; <nl> - foo ( ' 86metadata ' , DEBUG_BACKTRACE_PROVIDE_METADATA ) ; <nl> deleted file mode 100644 <nl> index 4329ea12778 . . 00000000000 <nl> mmm a / hphp / test / slow / debug_backtrace / metadata_varenv . php . expectf <nl> ppp / dev / null <nl> <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - array ( 4 ) { <nl> - [ " file " ] = > <nl> - string ( % d ) " % s " <nl> - [ " line " ] = > <nl> - int ( 9 ) <nl> - [ " function " ] = > <nl> - string ( 3 ) " bar " <nl> - [ " args " ] = > <nl> - array ( 1 ) { <nl> - [ 0 ] = > <nl> - int ( 0 ) <nl> - } <nl> - } <nl> - [ 1 ] = > <nl> - array ( 4 ) { <nl> - [ " file " ] = > <nl> - string ( % d ) " % s " <nl> - [ " line " ] = > <nl> - int ( 12 ) <nl> - [ " function " ] = > <nl> - string ( 3 ) " foo " <nl> - [ " args " ] = > <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - string ( 14 ) " __not_metadata " <nl> - [ 1 ] = > <nl> - int ( 0 ) <nl> - } <nl> - } <nl> - } <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - array ( 4 ) { <nl> - [ " file " ] = > <nl> - string ( % d ) " % s " <nl> - [ " line " ] = > <nl> - int ( 9 ) <nl> - [ " function " ] = > <nl> - string ( 3 ) " bar " <nl> - [ " args " ] = > <nl> - array ( 1 ) { <nl> - [ 0 ] = > <nl> - int ( 65536 ) <nl> - } <nl> - } <nl> - [ 1 ] = > <nl> - array ( 4 ) { <nl> - [ " file " ] = > <nl> - string ( % d ) " % s " <nl> - [ " line " ] = > <nl> - int ( 13 ) <nl> - [ " function " ] = > <nl> - string ( 3 ) " foo " <nl> - [ " args " ] = > <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - string ( 14 ) " __not_metadata " <nl> - [ 1 ] = > <nl> - int ( 65536 ) <nl> - } <nl> - } <nl> - } <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - array ( 4 ) { <nl> - [ " file " ] = > <nl> - string ( % d ) " % s " <nl> - [ " line " ] = > <nl> - int ( 9 ) <nl> - [ " function " ] = > <nl> - string ( 3 ) " bar " <nl> - [ " args " ] = > <nl> - array ( 1 ) { <nl> - [ 0 ] = > <nl> - int ( 0 ) <nl> - } <nl> - } <nl> - [ 1 ] = > <nl> - array ( 4 ) { <nl> - [ " file " ] = > <nl> - string ( % d ) " % s " <nl> - [ " line " ] = > <nl> - int ( 14 ) <nl> - [ " function " ] = > <nl> - string ( 3 ) " foo " <nl> - [ " args " ] = > <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - string ( 10 ) " 86metadata " <nl> - [ 1 ] = > <nl> - int ( 0 ) <nl> - } <nl> - } <nl> - } <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - array ( 4 ) { <nl> - [ " file " ] = > <nl> - string ( % d ) " % s " <nl> - [ " line " ] = > <nl> - int ( 9 ) <nl> - [ " function " ] = > <nl> - string ( 3 ) " bar " <nl> - [ " args " ] = > <nl> - array ( 1 ) { <nl> - [ 0 ] = > <nl> - int ( 65536 ) <nl> - } <nl> - } <nl> - [ 1 ] = > <nl> - array ( 5 ) { <nl> - [ " file " ] = > <nl> - string ( % d ) " % s " <nl> - [ " line " ] = > <nl> - int ( 15 ) <nl> - [ " function " ] = > <nl> - string ( 3 ) " foo " <nl> - [ " args " ] = > <nl> - array ( 2 ) { <nl> - [ 0 ] = > <nl> - string ( 10 ) " 86metadata " <nl> - [ 1 ] = > <nl> - int ( 65536 ) <nl> - } <nl> - [ " metadata " ] = > <nl> - string ( 8 ) " I am foo " <nl> - } <nl> - } <nl> mmm a / hphp / test / slow / disallow_varenv_dyncalls - fatal . php . expectf <nl> ppp b / hphp / test / slow / disallow_varenv_dyncalls - fatal . php . expectf <nl> Fatal error : ( hhvm . hack . disallow_dynamic_var_env_funcs = error ) compact should not <nl> Running test_compact_errors ( ) # 2 . . . . <nl> <nl> Fatal error : ( hhvm . hack . disallow_dynamic_var_env_funcs = error ) compact should not be called dynamically in % s / disallow_varenv_dyncalls . inc on line % d <nl> - Running test_framemeta_dyncall ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - <nl> - Fatal error : ( hhvm . hack . disallow_dynamic_var_env_funcs = error ) HH \ set_frame_metadata should not be called dynamically in % s / disallow_varenv_dyncalls . inc on line % d <nl> - Running test_framemeta_dyncall ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - <nl> - Fatal error : ( hhvm . hack . disallow_dynamic_var_env_funcs = error ) HH \ set_frame_metadata should not be called dynamically in % s / disallow_varenv_dyncalls . inc on line % d <nl> - Running test_framemeta_cuf ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - <nl> - Fatal error : ( hhvm . hack . disallow_dynamic_var_env_funcs = error ) HH \ set_frame_metadata should not be called dynamically in % s / disallow_varenv_dyncalls . inc on line % d <nl> - Running test_framemeta_cuf ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - <nl> - Fatal error : ( hhvm . hack . disallow_dynamic_var_env_funcs = error ) HH \ set_frame_metadata should not be called dynamically in % s / disallow_varenv_dyncalls . inc on line % d <nl> - Running test_framemeta_cuf_array ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - <nl> - Fatal error : ( hhvm . hack . disallow_dynamic_var_env_funcs = error ) HH \ set_frame_metadata should not be called dynamically in % s / disallow_varenv_dyncalls . inc on line % d <nl> - Running test_framemeta_cuf_array ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - <nl> - Fatal error : ( hhvm . hack . disallow_dynamic_var_env_funcs = error ) HH \ set_frame_metadata should not be called dynamically in % s / disallow_varenv_dyncalls . inc on line % d <nl> - Running test_framemeta_map ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - <nl> - Fatal error : ( hhvm . hack . disallow_dynamic_var_env_funcs = error ) HH \ set_frame_metadata should not be called dynamically in % s / disallow_varenv_dyncalls . inc on line % d <nl> - Running test_framemeta_map ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - <nl> - Fatal error : ( hhvm . hack . disallow_dynamic_var_env_funcs = error ) HH \ set_frame_metadata should not be called dynamically in % s / disallow_varenv_dyncalls . inc on line % d <nl> - Running test_framemeta_errors ( ) # 1 . . . . <nl> - <nl> - Fatal error : ( hhvm . hack . disallow_dynamic_var_env_funcs = error ) HH \ set_frame_metadata should not be called dynamically in % s / disallow_varenv_dyncalls . inc on line % d <nl> - Running test_framemeta_errors ( ) # 2 . . . . <nl> - <nl> - Fatal error : ( hhvm . hack . disallow_dynamic_var_env_funcs = error ) HH \ set_frame_metadata should not be called dynamically in % s / disallow_varenv_dyncalls . inc on line % d <nl> Running test_getargs_dyncall ( ) # 1 . . . . <nl> <nl> Fatal error : ( hhvm . hack . disallow_dynamic_var_env_funcs = error ) func_get_args should not be called dynamically in % s / disallow_varenv_dyncalls . inc on line % d <nl> mmm a / hphp / test / slow / disallow_varenv_dyncalls - quiet . php . expectf <nl> ppp b / hphp / test / slow / disallow_varenv_dyncalls - quiet . php . expectf <nl> compact ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc a <nl> compact ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc at line % d <nl> compact ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc at line % d <nl> test_compact_errors ( ) done <nl> - Running test_framemeta_dyncall ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_dyncall ( ) done <nl> - Running test_framemeta_dyncall ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_dyncall ( ) done <nl> - Running test_framemeta_cuf ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf ( ) done <nl> - Running test_framemeta_cuf ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf ( ) done <nl> - Running test_framemeta_cuf_array ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf_array ( ) done <nl> - Running test_framemeta_cuf_array ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf_array ( ) done <nl> - Running test_framemeta_map ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_map ( ) done <nl> - Running test_framemeta_map ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_map ( ) done <nl> - Running test_framemeta_errors ( ) # 1 . . . . <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc at line % d <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 3 given in disallow_varenv_dyncalls . inc at line % d <nl> - test_framemeta_errors ( ) done <nl> - Running test_framemeta_errors ( ) # 2 . . . . <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc at line % d <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 3 given in disallow_varenv_dyncalls . inc at line % d <nl> - test_framemeta_errors ( ) done <nl> Running test_getargs_dyncall ( ) # 1 . . . . <nl> array ( 3 ) { <nl> [ 0 ] = > <nl> mmm a / hphp / test / slow / disallow_varenv_dyncalls - quiet . php . expectf - repo <nl> ppp b / hphp / test / slow / disallow_varenv_dyncalls - quiet . php . expectf - repo <nl> compact ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc a <nl> compact ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc at line % d <nl> compact ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc at line % d <nl> test_compact_errors ( ) done <nl> - Running test_framemeta_dyncall ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_dyncall ( ) done <nl> - Running test_framemeta_dyncall ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_dyncall ( ) done <nl> - Running test_framemeta_cuf ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf ( ) done <nl> - Running test_framemeta_cuf ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf ( ) done <nl> - Running test_framemeta_cuf_array ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf_array ( ) done <nl> - Running test_framemeta_cuf_array ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf_array ( ) done <nl> - Running test_framemeta_map ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_map ( ) done <nl> - Running test_framemeta_map ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_map ( ) done <nl> - Running test_framemeta_errors ( ) # 1 . . . . <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc at line % d <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 3 given in disallow_varenv_dyncalls . inc at line % d <nl> - test_framemeta_errors ( ) done <nl> - Running test_framemeta_errors ( ) # 2 . . . . <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc at line % d <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 3 given in disallow_varenv_dyncalls . inc at line % d <nl> - test_framemeta_errors ( ) done <nl> Running test_getargs_dyncall ( ) # 1 . . . . <nl> array ( 3 ) { <nl> [ 0 ] = > <nl> mmm a / hphp / test / slow / disallow_varenv_dyncalls - warn . php . expectf <nl> ppp b / hphp / test / slow / disallow_varenv_dyncalls - warn . php . expectf <nl> compact ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc a <nl> ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) compact should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> compact ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc at line % d <nl> test_compact_errors ( ) done <nl> - Running test_framemeta_dyncall ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_dyncall ( ) done <nl> - Running test_framemeta_dyncall ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_dyncall ( ) done <nl> - Running test_framemeta_cuf ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf ( ) done <nl> - Running test_framemeta_cuf ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf ( ) done <nl> - Running test_framemeta_cuf_array ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf_array ( ) done <nl> - Running test_framemeta_cuf_array ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf_array ( ) done <nl> - Running test_framemeta_map ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_map ( ) done <nl> - Running test_framemeta_map ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_map ( ) done <nl> - Running test_framemeta_errors ( ) # 1 . . . . <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc at line % d <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 3 given in disallow_varenv_dyncalls . inc at line % d <nl> - test_framemeta_errors ( ) done <nl> - Running test_framemeta_errors ( ) # 2 . . . . <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc at line % d <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 3 given in disallow_varenv_dyncalls . inc at line % d <nl> - test_framemeta_errors ( ) done <nl> Running test_getargs_dyncall ( ) # 1 . . . . <nl> ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) func_get_args should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> array ( 3 ) { <nl> mmm a / hphp / test / slow / disallow_varenv_dyncalls - warn . php . expectf - repo <nl> ppp b / hphp / test / slow / disallow_varenv_dyncalls - warn . php . expectf - repo <nl> compact ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc a <nl> ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) compact should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> compact ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc at line % d <nl> test_compact_errors ( ) done <nl> - Running test_framemeta_dyncall ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_dyncall ( ) done <nl> - Running test_framemeta_dyncall ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_dyncall ( ) done <nl> - Running test_framemeta_cuf ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf ( ) done <nl> - Running test_framemeta_cuf ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf ( ) done <nl> - Running test_framemeta_cuf_array ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf_array ( ) done <nl> - Running test_framemeta_cuf_array ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_cuf_array ( ) done <nl> - Running test_framemeta_map ( ) # 1 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_map ( ) done <nl> - Running test_framemeta_map ( ) # 2 . . . . <nl> - int ( 100 ) <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - string ( 8 ) " metadata " <nl> - test_framemeta_map ( ) done <nl> - Running test_framemeta_errors ( ) # 1 . . . . <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc at line % d <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 3 given in disallow_varenv_dyncalls . inc at line % d <nl> - test_framemeta_errors ( ) done <nl> - Running test_framemeta_errors ( ) # 2 . . . . <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 0 given in disallow_varenv_dyncalls . inc at line % d <nl> - ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) HH \ set_frame_metadata should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> - HH \ set_frame_metadata ( ) expects exactly 1 parameter , 3 given in disallow_varenv_dyncalls . inc at line % d <nl> - test_framemeta_errors ( ) done <nl> Running test_getargs_dyncall ( ) # 1 . . . . <nl> ( hhvm . hack . disallow_dynamic_var_env_funcs = warn ) func_get_args should not be called dynamically in disallow_varenv_dyncalls . inc at line % d <nl> array ( 3 ) { <nl> mmm a / hphp / test / slow / disallow_varenv_dyncalls . inc <nl> ppp b / hphp / test / slow / disallow_varenv_dyncalls . inc <nl> function test_compact_errors ( ) { <nl> call_user_func_array ( $ f , [ ] ) ; <nl> } <nl> <nl> - function test_framemeta_dyncall ( ) { <nl> - $ v = ' 86metadata ' ; <nl> - $ $ v = 100 ; <nl> - var_dump ( $ $ v ) ; <nl> - $ f = ' HH \ set_frame_metadata ' ; <nl> - $ f ( ' metadata ' ) ; <nl> - var_dump ( $ $ v ) ; <nl> - } <nl> - <nl> - function test_framemeta_cuf ( ) { <nl> - $ v = ' 86metadata ' ; <nl> - $ $ v = 100 ; <nl> - var_dump ( $ $ v ) ; <nl> - $ f = ' HH \ set_frame_metadata ' ; <nl> - call_user_func ( $ f , ' metadata ' ) ; <nl> - var_dump ( $ $ v ) ; <nl> - } <nl> - <nl> - function test_framemeta_cuf_array ( ) { <nl> - $ v = ' 86metadata ' ; <nl> - $ $ v = 100 ; <nl> - var_dump ( $ $ v ) ; <nl> - $ f = ' HH \ set_frame_metadata ' ; <nl> - call_user_func_array ( $ f , [ ' metadata ' ] ) ; <nl> - var_dump ( $ $ v ) ; <nl> - } <nl> - <nl> - function test_framemeta_map ( ) { <nl> - $ v = ' 86metadata ' ; <nl> - $ $ v = 100 ; <nl> - var_dump ( $ $ v ) ; <nl> - $ f = ' HH \ set_frame_metadata ' ; <nl> - array_map ( $ f , [ ' metadata ' ] ) ; <nl> - var_dump ( $ $ v ) ; <nl> - } <nl> - <nl> - function test_framemeta_errors ( ) { <nl> - $ f = ' HH \ set_frame_metadata ' ; <nl> - $ f ( ) ; <nl> - $ f ( ' abc ' , ' def ' , ' ghi ' ) ; <nl> - } <nl> - <nl> function test_getargs_dyncall_impl ( $ a , $ b , $ c ) { <nl> $ f = ' func_get_args ' ; <nl> var_dump ( $ f ( ) ) ; <nl> function run_tests ( ) { <nl> ' test_compact_map ' , <nl> ' test_compact_errors ' , <nl> <nl> - ' test_framemeta_dyncall ' , <nl> - ' test_framemeta_cuf ' , <nl> - ' test_framemeta_cuf_array ' , <nl> - ' test_framemeta_map ' , <nl> - ' test_framemeta_errors ' , <nl> - <nl> ' test_getargs_dyncall ' , <nl> ' test_getargs_cuf ' , <nl> ' test_getargs_cuf_array ' , <nl> deleted file mode 100644 <nl> index eec4798c0f9 . . 00000000000 <nl> mmm a / hphp / test / slow / hhbbc / private_props_021 . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - <nl> - class B { } <nl> - <nl> - class Foo { <nl> - private $ x ; <nl> - <nl> - public function __construct ( ) { <nl> - $ this - > x = new B ( ) ; <nl> - } <nl> - <nl> - public function getX ( ) { return $ this - > x ; } <nl> - <nl> - public function weird_dynamic ( array $ a , array $ b , string $ c ) { <nl> - $ { $ c } [ 0 ] = 2 ; <nl> - return $ { $ c } [ 0 ] ; <nl> - } <nl> - } <nl> - <nl> - function main ( ) { <nl> - $ f = new Foo ( ) ; <nl> - var_dump ( $ f - > getX ( ) ) ; <nl> - var_dump ( $ f - > weird_dynamic ( array ( 1 , 2 , 3 ) , array ( ' one ' , ' two ' , ' three ' ) , ' b ' ) ) ; <nl> - var_dump ( $ f - > weird_dynamic ( array ( 1 , 2 , 3 ) , array ( ' one ' , ' two ' , ' three ' ) , ' a ' ) ) ; <nl> - var_dump ( $ f - > getX ( ) ) ; <nl> - } <nl> - <nl> - <nl> - < < __EntryPoint > > <nl> - function main_private_props_021 ( ) { <nl> - main ( ) ; <nl> - } <nl> deleted file mode 100644 <nl> index 0828960013b . . 00000000000 <nl> mmm a / hphp / test / slow / hhbbc / private_props_021 . php . expect <nl> ppp / dev / null <nl> <nl> - object ( B ) # 2 ( 0 ) { <nl> - } <nl> - int ( 2 ) <nl> - int ( 2 ) <nl> - object ( B ) # 2 ( 0 ) { <nl> - } <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index 24c64343408 . . 00000000000 <nl> mmm a / hphp / test / slow / hhbbc / static_props_001 . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - <nl> - class Obj { } <nl> - <nl> - class Foob { <nl> - private static $ x ; <nl> - <nl> - public function heh ( ) { <nl> - if ( ! self : : $ x ) { <nl> - self : : $ x = new Obj ( ) ; <nl> - } <nl> - return self : : $ x ; <nl> - } <nl> - <nl> - public function why ( $ z ) { <nl> - self : : $ { $ z } = 2 ; <nl> - } <nl> - } <nl> - <nl> - function main ( ) { <nl> - Foob : : heh ( ) ; <nl> - Foob : : why ( ' x ' ) ; <nl> - Foob : : heh ( ) ; <nl> - } <nl> - <nl> - <nl> - <nl> - < < __EntryPoint > > <nl> - function main_static_props_001 ( ) { <nl> - main ( ) ; <nl> - } <nl> deleted file mode 100644 <nl> index e69de29bb2d . . 00000000000 <nl> deleted file mode 100644 <nl> index 5241337006d . . 00000000000 <nl> mmm a / hphp / test / slow / hhbbc / static_props_007 . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - <nl> - class Foob { <nl> - private static $ heh = 0 ; <nl> - private static $ ok = " string " ; <nl> - <nl> - public static function asd ( string $ x ) { <nl> - self : : $ heh = & $ x ; <nl> - return self : : $ heh ; <nl> - } <nl> - public static function ok ( ) { return self : : $ ok ; } <nl> - <nl> - public static function breaker ( $ x ) { <nl> - self : : $ { $ x } = & $ x ; <nl> - } <nl> - } <nl> - <nl> - function heh ( ) { <nl> - return Foob : : ok ( ) ; <nl> - } <nl> - <nl> - <nl> - < < __EntryPoint > > <nl> - function main_static_props_007 ( ) { <nl> - var_dump ( Foob : : asd ( ' asd ' ) ) ; <nl> - var_dump ( Foob : : asd ( ' asd ' ) ) ; <nl> - var_dump ( Foob : : asd ( ' asd ' ) ) ; <nl> - var_dump ( heh ( ) ) ; <nl> - var_dump ( Foob : : ok ( ) ) ; <nl> - var_dump ( Foob : : breaker ( ' ok ' ) ) ; <nl> - var_dump ( Foob : : ok ( ) ) ; <nl> - var_dump ( heh ( ) ) ; <nl> - } <nl> deleted file mode 100644 <nl> index fc282cc2f31 . . 00000000000 <nl> mmm a / hphp / test / slow / hhbbc / static_props_007 . php . expect <nl> ppp / dev / null <nl> <nl> - string ( 3 ) " asd " <nl> - string ( 3 ) " asd " <nl> - string ( 3 ) " asd " <nl> - string ( 6 ) " string " <nl> - string ( 6 ) " string " <nl> - NULL <nl> - string ( 2 ) " ok " <nl> - string ( 2 ) " ok " <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index f3b22096700 . . 00000000000 <nl> mmm a / hphp / test / slow / hhbbc / static_props_011 . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - <nl> - class monomorphic_dynamic { <nl> - private static $ x = 0 ; <nl> - private static $ y = 1 ; <nl> - private static $ z = 2 ; <nl> - <nl> - public static function heh ( int $ val , string $ name ) { <nl> - self : : $ { $ name } = $ val ; <nl> - } <nl> - <nl> - public static function get ( ) { <nl> - var_dump ( is_int ( self : : $ x ) ) ; <nl> - var_dump ( is_int ( self : : $ y ) ) ; <nl> - var_dump ( is_int ( self : : $ z ) ) ; <nl> - return self : : $ x ; <nl> - } <nl> - } <nl> - <nl> - function main ( ) { <nl> - monomorphic_dynamic : : get ( ) ; <nl> - monomorphic_dynamic : : heh ( 3 , ' x ' ) ; <nl> - monomorphic_dynamic : : heh ( 3 , ' z ' ) ; <nl> - monomorphic_dynamic : : heh ( 3 , ' y ' ) ; <nl> - monomorphic_dynamic : : get ( ) ; <nl> - } <nl> - <nl> - <nl> - < < __EntryPoint > > <nl> - function main_static_props_011 ( ) { <nl> - main ( ) ; <nl> - } <nl> deleted file mode 100644 <nl> index f497ae5422a . . 00000000000 <nl> mmm a / hphp / test / slow / hhbbc / static_props_011 . php . expect <nl> ppp / dev / null <nl> <nl> - bool ( true ) <nl> - bool ( true ) <nl> - bool ( true ) <nl> - bool ( true ) <nl> - bool ( true ) <nl> - bool ( true ) <nl> \ No newline at end of file <nl> mmm a / hphp / test / slow / late - init / basic . php <nl> ppp b / hphp / test / slow / late - init / basic . php <nl> private static function prop ( $ i ) { <nl> public function set ( ) { <nl> $ this - > { B : : prop ( 1 ) } = 123 ; <nl> $ this - > { B : : prop ( 2 ) } = 123 ; <nl> - B : : $ { B : : prop ( 3 ) } = 123 ; <nl> - B : : $ { B : : prop ( 4 ) } = 123 ; <nl> - B : : $ { B : : prop ( 5 ) } = new B ( ) ; <nl> - B : : $ { B : : prop ( 6 ) } = new B ( ) ; <nl> - B : : $ { B : : prop ( 7 ) } = new B ( ) ; <nl> - B : : $ { B : : prop ( 7 ) } - > { B : : prop ( 9 ) } = new B ( ) ; <nl> - B : : $ { B : : prop ( 7 ) } - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } = 123 ; <nl> - B : : $ { B : : prop ( 8 ) } = new B ( ) ; <nl> - B : : $ { B : : prop ( 8 ) } - > { B : : prop ( 9 ) } = new B ( ) ; <nl> - B : : $ { B : : prop ( 8 ) } - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } = 123 ; <nl> + B : : $ p3 = 123 ; <nl> + B : : $ p4 = 123 ; <nl> + B : : $ p5 = new B ( ) ; <nl> + B : : $ p6 = new B ( ) ; <nl> + B : : $ p7 = new B ( ) ; <nl> + B : : $ p7 - > { B : : prop ( 9 ) } = new B ( ) ; <nl> + B : : $ p7 - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } = 123 ; <nl> + B : : $ p8 = new B ( ) ; <nl> + B : : $ p8 - > { B : : prop ( 9 ) } = new B ( ) ; <nl> + B : : $ p8 - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } = 123 ; <nl> } <nl> <nl> public function unset ( ) { <nl> unset ( $ this - > { B : : prop ( 1 ) } ) ; <nl> unset ( $ this - > { B : : prop ( 2 ) } ) ; <nl> - unset ( B : : $ { B : : prop ( 7 ) } - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } ) ; <nl> - unset ( B : : $ { B : : prop ( 8 ) } - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } ) ; <nl> + unset ( B : : $ p7 - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } ) ; <nl> + unset ( B : : $ p8 - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } ) ; <nl> } <nl> <nl> public function get1 ( ) { return $ this - > { B : : prop ( 1 ) } ; } <nl> public function vget2 ( ) { <nl> return $ x ; <nl> } <nl> <nl> - public function get3 ( ) { return B : : $ { B : : prop ( 3 ) } ; } <nl> - public function isset3 ( ) { return isset ( B : : $ { B : : prop ( 3 ) } ) ; } <nl> - public function empty3 ( ) { return empty ( B : : $ { B : : prop ( 3 ) } ) ; } <nl> - public function incdec3 ( ) { return + + B : : $ { B : : prop ( 3 ) } ; } <nl> - public function setop3 ( ) { return B : : $ { B : : prop ( 3 ) } + = 1000 ; } <nl> + public function get3 ( ) { return B : : $ p3 ; } <nl> + public function isset3 ( ) { return isset ( B : : $ p3 ) ; } <nl> + public function empty3 ( ) { return empty ( B : : $ p3 ) ; } <nl> + public function incdec3 ( ) { return + + B : : $ p3 ; } <nl> + public function setop3 ( ) { return B : : $ p3 + = 1000 ; } <nl> public function bind3 ( ) { <nl> $ b = 123 ; <nl> - B : : $ { B : : prop ( 3 ) } = & $ b ; <nl> - return B : : $ { B : : prop ( 3 ) } ; <nl> + B : : $ p3 = & $ b ; <nl> + return B : : $ p3 ; <nl> } <nl> public function vget3 ( ) { <nl> - $ x = & B : : $ { B : : prop ( 3 ) } ; <nl> + $ x = & B : : $ p3 ; <nl> return $ x ; <nl> } <nl> <nl> - public function get4 ( ) { return B : : $ { B : : prop ( 4 ) } ; } <nl> - public function isset4 ( ) { return isset ( B : : $ { B : : prop ( 4 ) } ) ; } <nl> - public function empty4 ( ) { return empty ( B : : $ { B : : prop ( 4 ) } ) ; } <nl> - public function incdec4 ( ) { return + + B : : $ { B : : prop ( 4 ) } ; } <nl> - public function setop4 ( ) { return B : : $ { B : : prop ( 4 ) } + = 1000 ; } <nl> + public function get4 ( ) { return B : : $ p4 ; } <nl> + public function isset4 ( ) { return isset ( B : : $ p4 ) ; } <nl> + public function empty4 ( ) { return empty ( B : : $ p4 ) ; } <nl> + public function incdec4 ( ) { return + + B : : $ p4 ; } <nl> + public function setop4 ( ) { return B : : $ p4 + = 1000 ; } <nl> public function bind4 ( ) { <nl> $ b = 123 ; <nl> - B : : $ { B : : prop ( 4 ) } = & $ b ; <nl> - return B : : $ { B : : prop ( 4 ) } ; <nl> + B : : $ p4 = & $ b ; <nl> + return B : : $ p4 ; <nl> } <nl> public function vget4 ( ) { <nl> - $ x = & B : : $ { B : : prop ( 4 ) } ; <nl> + $ x = & B : : $ p4 ; <nl> return $ x ; <nl> } <nl> <nl> - public function get5 ( ) { return B : : $ { B : : prop ( 5 ) } - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } ; } <nl> - public function get6 ( ) { return B : : $ { B : : prop ( 6 ) } - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } ; } <nl> - public function get7 ( ) { return B : : $ { B : : prop ( 7 ) } - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } ; } <nl> - public function get8 ( ) { return B : : $ { B : : prop ( 8 ) } - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } ; } <nl> + public function get5 ( ) { return B : : $ p5 - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } ; } <nl> + public function get6 ( ) { return B : : $ p6 - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } ; } <nl> + public function get7 ( ) { return B : : $ p7 - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } ; } <nl> + public function get8 ( ) { return B : : $ p8 - > { B : : prop ( 9 ) } - > { B : : prop ( 10 ) } ; } <nl> <nl> public function get9 ( ) { return $ this - > { B : : prop ( 11 ) } ; } <nl> public function get10 ( ) { return $ this - > { B : : prop ( 12 ) } ; } <nl> - public function get11 ( ) { return B : : $ { B : : prop ( 13 ) } ; } <nl> - public function get12 ( ) { return B : : $ { B : : prop ( 14 ) } ; } <nl> + public function get11 ( ) { return B : : $ p13 ; } <nl> + public function get12 ( ) { return B : : $ p14 ; } <nl> <nl> public function isset5 ( ) { return isset ( $ this - > { B : : prop ( 11 ) } ) ; } <nl> public function isset6 ( ) { return isset ( $ this - > { B : : prop ( 12 ) } ) ; } <nl> - public function isset7 ( ) { return isset ( B : : $ { B : : prop ( 13 ) } ) ; } <nl> - public function isset8 ( ) { return isset ( B : : $ { B : : prop ( 14 ) } ) ; } <nl> + public function isset7 ( ) { return isset ( B : : $ p13 ) ; } <nl> + public function isset8 ( ) { return isset ( B : : $ p14 ) ; } <nl> <nl> public function empty5 ( ) { return empty ( $ this - > { B : : prop ( 11 ) } ) ; } <nl> public function empty6 ( ) { return empty ( $ this - > { B : : prop ( 12 ) } ) ; } <nl> - public function empty7 ( ) { return empty ( B : : $ { B : : prop ( 13 ) } ) ; } <nl> - public function empty8 ( ) { return empty ( B : : $ { B : : prop ( 14 ) } ) ; } <nl> + public function empty7 ( ) { return empty ( B : : $ p13 ) ; } <nl> + public function empty8 ( ) { return empty ( B : : $ p14 ) ; } <nl> } <nl> <nl> const TESTS = vec [ <nl> deleted file mode 100644 <nl> index 0ae536b8e03 . . 00000000000 <nl> mmm a / hphp / test / slow / non - string - sprop . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - / / Copyright 2004 - present Facebook . All Rights Reserved . <nl> - <nl> - function test ( $ x ) { var_dump ( ( stdclass : : $ $ x ) [ 0 ] ) ; } <nl> - <nl> - < < __EntryPoint > > <nl> - function main_non_string_sprop ( ) { <nl> - test ( 42 ) ; <nl> - } <nl> deleted file mode 100644 <nl> index 1913837137d . . 00000000000 <nl> mmm a / hphp / test / slow / non - string - sprop . php . expectf <nl> ppp / dev / null <nl> <nl> - <nl> - Fatal error : Invalid static property access : stdClass : : 42 in % s on line % d <nl> \ No newline at end of file <nl> mmm a / hphp / test / slow / null_coalesce_assignment / null_coalesce_assignment . php <nl> ppp b / hphp / test / slow / null_coalesce_assignment / null_coalesce_assignment . php <nl> function test_basic ( ) : void { <nl> VS ( $ x_string ? ? = 73 , " forty_seven " ) ; <nl> VS ( $ x_string , " forty_seven " ) ; <nl> <nl> - VS ( $ $ x_string ? ? = 48 , 48 ) ; <nl> + VS ( $ forty_seven ? ? = 48 , 48 ) ; <nl> VS ( $ forty_seven , 48 ) ; <nl> } <nl> <nl> mmm a / hphp / test / slow / nullsafe / nullsafe - prop - 1 . php <nl> ppp b / hphp / test / slow / nullsafe / nullsafe - prop - 1 . php <nl> function nonLocalBase ( ) { <nl> echo " \ n " ; <nl> } <nl> <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / 5 . Var name of the base var . <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - function varNameBase ( ) { <nl> - echo " = " . __FUNCTION__ . " : \ n \ n " ; <nl> - $ x = null ; <nl> - $ xName = ' x ' ; <nl> - var_dump ( $ $ xName ? - > y ? - > z ( sideEffect ( __FUNCTION__ ) ) ) ; <nl> - echo " \ n " ; <nl> - } <nl> - <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> / / 6 . XHP attribute <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> function main_nullsafe_prop_1 ( ) { <nl> nested ( ) ; <nl> notNull ( ) ; <nl> nonLocalBase ( ) ; <nl> - varNameBase ( ) ; <nl> xhpAttr ( ) ; <nl> issetProp ( ) ; <nl> emptyProp ( ) ; <nl> mmm a / hphp / test / slow / nullsafe / nullsafe - prop - 1 . php . expectf <nl> ppp b / hphp / test / slow / nullsafe / nullsafe - prop - 1 . php . expectf <nl> NULL <nl> sideEffect is called from ' nonLocalBase ' <nl> string ( 1 ) " z " <nl> <nl> - = varNameBase : <nl> - <nl> - sideEffect is called from ' varNameBase ' <nl> - NULL <nl> - <nl> = xhpAttr : <nl> <nl> NULL <nl> mmm a / hphp / test / slow / nullsafe / nullsafe - prop - 14 . php <nl> ppp b / hphp / test / slow / nullsafe / nullsafe - prop - 14 . php <nl> <nl> $ x = null ; <nl> $ foo = ' foo ' ; <nl> if ( false ) { <nl> - $ x ? - > $ { foo } ; / / parse error <nl> + $ x ? - > $ foo ; / / parse error <nl> } <nl> deleted file mode 100644 <nl> index cdc69b8fca2 . . 00000000000 <nl> mmm a / hphp / test / slow / nullsafe / nullsafe - prop - 15 . php <nl> ppp / dev / null <nl> <nl> - < ? hh / / strict <nl> - <nl> - $ x = null ; <nl> - $ foo = ' foo ' ; <nl> - if ( false ) { <nl> - $ x ? - > $ { $ foo . " bar " } ; / / parse error <nl> - } <nl> deleted file mode 100644 <nl> index f9135f77af8 . . 00000000000 <nl> mmm a / hphp / test / slow / nullsafe / nullsafe - prop - 15 . php . expectf <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - Fatal error : ? - > can only be used with scalar property names in % s on line 6 <nl> mmm a / hphp / test / slow / object / 654 . php <nl> ppp b / hphp / test / slow / object / 654 . php <nl> <nl> class A { <nl> public function t ( ) { <nl> global $ a ; <nl> - $ b = ' a ' ; <nl> - var_dump ( $ $ b ) ; <nl> + var_dump ( $ a ) ; <nl> } <nl> } <nl> $ obj = new A ( ) ; <nl> deleted file mode 100644 <nl> index 7bfee3875d6 . . 00000000000 <nl> mmm a / hphp / test / slow / phpism / variable_variables . php . hphp_opts <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - - vRuntime . Hack . Lang . Phpism . DisableVariableVariables = true <nl> deleted file mode 100644 <nl> index 55dc2a0539a . . 00000000000 <nl> mmm a / hphp / test / slow / phpism / variable_variables . php . opts <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - - vHack . Lang . Phpism . DisableVariableVariables = true <nl> deleted file mode 100644 <nl> index 1232b03a9e6 . . 00000000000 <nl> mmm a / hphp / test / slow / phpism / variable_variables2 . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - $ a = ' hello ' ; <nl> - $ $ a = ' world ' ; <nl> - echo $ hello ; <nl> deleted file mode 100644 <nl> index cc628ccd107 . . 00000000000 <nl> mmm a / hphp / test / slow / phpism / variable_variables2 . php . expectf <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - world <nl> deleted file mode 100644 <nl> index 72424f7125b . . 00000000000 <nl> mmm a / hphp / test / slow / phpism / variable_variables2 . php . hphp_opts <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - - vRuntime . Hack . Lang . Phpism . DisableVariableVariables = false <nl> deleted file mode 100644 <nl> index 2617c2c4669 . . 00000000000 <nl> mmm a / hphp / test / slow / phpism / variable_variables2 . php . opts <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - - vHack . Lang . Phpism . DisableVariableVariables = false <nl> mmm a / hphp / test / slow / pipe_expr / bad - pipevar - 1 . php . expectf <nl> ppp b / hphp / test / slow / pipe_expr / bad - pipevar - 1 . php . expectf <nl> <nl> <nl> - Fatal error : Cannot take indirect reference to a pipe variable in % s / bad - pipevar - 1 . php on line 4 <nl> + Fatal error : Variable Variables are not legal in % s / bad - pipevar - 1 . php on line 4 <nl> deleted file mode 100644 <nl> index cfbf534600c . . 00000000000 <nl> mmm a / hphp / test / slow / prop - type - hints / dynamic - static . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - / / Copyright 2004 - present Facebook . All Rights Reserved . <nl> - <nl> - class A { <nl> - public static int $ s1 = 123 ; <nl> - public static string $ s2 = ' abc ' ; <nl> - public static string $ s3 = ' 123 ' ; <nl> - public static int $ s4 = 123 ; <nl> - public static int $ s5 = 123 ; <nl> - public static int $ s6 = 123 ; <nl> - } <nl> - <nl> - function test ( ) { <nl> - $ cls = __hhvm_intrinsics \ launder_value ( ' A ' ) ; <nl> - $ p1 = __hhvm_intrinsics \ launder_value ( ' s1 ' ) ; <nl> - $ p2 = __hhvm_intrinsics \ launder_value ( ' s2 ' ) ; <nl> - $ p3 = __hhvm_intrinsics \ launder_value ( ' s3 ' ) ; <nl> - $ p4 = __hhvm_intrinsics \ launder_value ( ' s4 ' ) ; <nl> - $ p5 = __hhvm_intrinsics \ launder_value ( ' s5 ' ) ; <nl> - $ p6 = __hhvm_intrinsics \ launder_value ( ' s6 ' ) ; <nl> - $ cls : : $ $ p1 = ' abc ' ; <nl> - $ cls : : $ $ p2 + = 123 ; <nl> - $ cls : : $ $ p3 + + ; <nl> - $ cls : : $ $ p4 + = 123 ; <nl> - <nl> - $ v1 = 456 ; <nl> - $ cls : : $ $ p5 = & $ v1 ; <nl> - $ v2 = & $ cls : : $ $ p6 ; <nl> - } <nl> - <nl> - test ( ) ; <nl> deleted file mode 100644 <nl> index 092bf6e5e3a . . 00000000000 <nl> mmm a / hphp / test / slow / prop - type - hints / dynamic - static . php . expectf <nl> ppp / dev / null <nl> <nl> - Warning : Static property ' A : : s1 ' declared as type int , string assigned in % s / dynamic - static . php on line 21 <nl> - <nl> - Warning : Static property ' A : : s2 ' declared as type string , int assigned in % s / dynamic - static . php on line 22 <nl> - <nl> - Warning : Static property ' A : : s3 ' declared as type string , int assigned in % s / dynamic - static . php on line 23 <nl> - <nl> - Warning : Static property ' A : : s5 ' with type annotation binding to ref in % s / dynamic - static . php on line 27 <nl> - <nl> - Warning : Static property ' A : : s6 ' with type annotation binding to ref in % s / dynamic - static . php on line 28 <nl> deleted file mode 100644 <nl> index a5f52bbdfd1 . . 00000000000 <nl> mmm a / hphp / test / slow / prop - type - hints / dynamic - static . php . hphp_opts <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - - vCheckPropTypeHints = 1 <nl> deleted file mode 100644 <nl> index 405a11a51f7 . . 00000000000 <nl> mmm a / hphp / test / slow / prop - type - hints / dynamic - static . php . opts <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - - vEval . CheckPropTypeHints = 1 <nl> mmm a / hphp / test / slow / rx / body / class - statics . php <nl> ppp b / hphp / test / slow / rx / body / class - statics . php <nl> function test ( ) { <nl> C : : $ p * = 2 ; / / SetOpS <nl> C : : $ p + + ; / / IncDecS <nl> / / UnsetS does not exist <nl> - <nl> - C : : $ p = array ( ' a ' = > ' b ' ) ; <nl> - $ x = C : : $ { __hhvm_intrinsics \ launder_value ( ' p ' ) } [ ' a ' ] ; / / BaseSC <nl> - $ l = ' p ' ; <nl> - $ x = ( C : : $ $ l ) [ ' a ' ] ; / / BaseSL <nl> } <nl> <nl> < < __EntryPoint > > <nl> mmm a / hphp / test / slow / rx / body / class - statics . php . expectf <nl> ppp b / hphp / test / slow / rx / body / class - statics . php . expectf <nl> Verification Error ( unit % s / test / slow / rx / body / class - statics . php func test ) : stat <nl> <nl> Verification Error ( unit % s / test / slow / rx / body / class - statics . php func test ) : statics are forbidden in Rx functions : IncDecS <nl> <nl> - Verification Error ( unit % s / test / slow / rx / body / class - statics . php func test ) : statics are forbidden in Rx functions : SetS <nl> - <nl> - Verification Error ( unit % s / test / slow / rx / body / class - statics . php func test ) : statics are forbidden in Rx functions : BaseSC <nl> - <nl> - Verification Error ( unit % s / test / slow / rx / body / class - statics . php func test ) : statics are forbidden in Rx functions : BaseSL <nl> - <nl> Done <nl> mmm a / hphp / test / slow / rx / body / ref - non - local . php <nl> ppp b / hphp / test / slow / rx / body / ref - non - local . php <nl> class C { public static $ p ; public static $ q ; } <nl> <nl> < < __Rx > > <nl> function test ( ) { <nl> - $ x = ' foo ' ; <nl> - $ y = ' bar ' ; <nl> - $ $ x = & $ $ y ; / / VGetN , BindN <nl> - <nl> $ _GET = & $ _POST ; / / VGetG , BindG ( superglobals ) <nl> <nl> C : : $ p = & C : : $ q ; / / VGetS , BindS <nl> mmm a / hphp / test / slow / rx / body / ref - non - local . php . expectf <nl> ppp b / hphp / test / slow / rx / body / ref - non - local . php . expectf <nl> <nl> - Verification Error ( unit % s / test / slow / rx / body / ref - non - local . php func test ) : references are forbidden in Rx functions : VGetN <nl> - <nl> - Verification Error ( unit % s / test / slow / rx / body / ref - non - local . php func test ) : references are forbidden in Rx functions : BindN <nl> - <nl> - Verification Error ( unit % s / test / slow / rx / body / ref - non - local . php func test ) : references are forbidden in Rx functions : PopV <nl> - <nl> Verification Error ( unit % s / test / slow / rx / body / ref - non - local . php func test ) : references are forbidden in Rx functions : VGetG <nl> <nl> Verification Error ( unit % s / test / slow / rx / body / ref - non - local . php func test ) : references are forbidden in Rx functions : BindG <nl> deleted file mode 100644 <nl> index 85a3ce460cb . . 00000000000 <nl> mmm a / hphp / test / slow / rx / body / variable - variables . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - <nl> - < < __Rx > > <nl> - function test ( ) { <nl> - $ ll = true ; <nl> - $ v = __hhvm_intrinsics \ launder_value ( ' ll ' ) ; <nl> - $ x = $ $ v ; / / CGetN <nl> - $ x = $ $ v ? ? false ; / / CGetQuietN <nl> - $ x = isset ( $ $ v ) ; / / IssetN <nl> - $ x = empty ( $ $ v ) ; / / EmptyN <nl> - <nl> - $ $ v = 1 ; / / SetN <nl> - $ $ v * = 2 ; / / SetOpN <nl> - $ $ v + + ; / / IncDecN <nl> - unset ( $ $ v ) ; / / UnsetN <nl> - <nl> - $ ll = array ( ' a ' = > ' b ' ) ; <nl> - $ x = $ { __hhvm_intrinsics \ launder_value ( ' ll ' ) } [ ' a ' ] ; / / BaseNC <nl> - $ x = ( $ $ v ) [ ' a ' ] ; / / BaseNL <nl> - } <nl> - <nl> - < < __EntryPoint > > <nl> - function main ( ) { <nl> - test ( ) ; <nl> - echo " Done \ n " ; <nl> - } <nl> deleted file mode 100644 <nl> index 49e51a9f679 . . 00000000000 <nl> mmm a / hphp / test / slow / rx / body / variable - variables . php . expectf <nl> ppp / dev / null <nl> <nl> - Verification Error ( unit % s / test / slow / rx / body / variable - variables . php func test ) : variable variables are forbidden in Rx functions : CGetN <nl> - <nl> - Verification Error ( unit % s / test / slow / rx / body / variable - variables . php func test ) : variable variables are forbidden in Rx functions : CGetQuietN <nl> - <nl> - Verification Error ( unit % s / test / slow / rx / body / variable - variables . php func test ) : variable variables are forbidden in Rx functions : IssetN <nl> - <nl> - Verification Error ( unit % s / test / slow / rx / body / variable - variables . php func test ) : variable variables are forbidden in Rx functions : EmptyN <nl> - <nl> - Verification Error ( unit % s / test / slow / rx / body / variable - variables . php func test ) : variable variables are forbidden in Rx functions : SetN <nl> - <nl> - Verification Error ( unit % s / test / slow / rx / body / variable - variables . php func test ) : variable variables are forbidden in Rx functions : SetOpN <nl> - <nl> - Verification Error ( unit % s / test / slow / rx / body / variable - variables . php func test ) : variable variables are forbidden in Rx functions : IncDecN <nl> - <nl> - Verification Error ( unit % s / test / slow / rx / body / variable - variables . php func test ) : variable variables are forbidden in Rx functions : UnsetN <nl> - <nl> - Verification Error ( unit % s / test / slow / rx / body / variable - variables . php func test ) : variable variables are forbidden in Rx functions : BaseNC <nl> - <nl> - Verification Error ( unit % s / test / slow / rx / body / variable - variables . php func test ) : variable variables are forbidden in Rx functions : BaseNL <nl> - <nl> - Done <nl> deleted file mode 100644 <nl> index de7e03e7e70 . . 00000000000 <nl> mmm a / hphp / test / slow / static - prop - dynamic - incdec . php <nl> ppp / dev / null <nl> <nl> - < ? hh <nl> - <nl> - class A { <nl> - public static $ x = 123 ; <nl> - } <nl> - <nl> - function test ( ) { <nl> - $ c = __hhvm_intrinsics \ launder_value ( ' A ' ) ; <nl> - $ p = __hhvm_intrinsics \ launder_value ( ' x ' ) ; <nl> - $ c : : $ $ p + + ; <nl> - var_dump ( $ c : : $ $ p ) ; <nl> - } <nl> - <nl> - <nl> - < < __EntryPoint > > <nl> - function main_static_prop_dynamic_incdec ( ) { <nl> - test ( ) ; <nl> - } <nl> deleted file mode 100644 <nl> index f21f7c7fa47 . . 00000000000 <nl> mmm a / hphp / test / slow / static - prop - dynamic - incdec . php . expect <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - int ( 124 ) <nl> deleted file mode 100644 <nl> index 0543b4a730c . . 00000000000 <nl> mmm a / hphp / test / slow / traits / 2070 . php <nl> ppp / dev / null <nl> <nl> - < ? php <nl> - <nl> - trait T { <nl> - function foo ( $ t ) { <nl> - $ $ t = 5 ; <nl> - yield $ this ; <nl> - } <nl> - } <nl> - class X { <nl> - use T ; <nl> - } <nl> - <nl> - < < __EntryPoint > > <nl> - function main_2070 ( ) { <nl> - $ x = new X ; <nl> - foreach ( $ x - > foo ( ' this ' ) as $ v ) { <nl> - var_dump ( $ v ) ; <nl> - } <nl> - } <nl> deleted file mode 100644 <nl> index a3b03157e09 . . 00000000000 <nl> mmm a / hphp / test / slow / traits / 2070 . php . expect <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - int ( 5 ) <nl> deleted file mode 100644 <nl> index 4510f4a0583 . . 00000000000 <nl> mmm a / hphp / test / slow / traits / 2070 . php . hphp_opts <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - - vEnableHipHopSyntax = 1 - d hhvm . php7 . all = 0 - d hhvm . php7 . all = 0 <nl> deleted file mode 120000 <nl> index 192ba8eb2b5 . . 00000000000 <nl> mmm a / hphp / test / slow / traits / 2070 . php . opts <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - . . / hiphop . opts <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index b4aa78df9d0 . . 00000000000 <nl> mmm a / hphp / test / slow / yield / 2167 . php <nl> ppp / dev / null <nl> <nl> - < ? php <nl> - <nl> - class X { <nl> - function foo ( $ t ) { <nl> - $ $ t = 5 ; <nl> - yield $ this ; <nl> - } <nl> - } <nl> - <nl> - < < __EntryPoint > > <nl> - function main_2167 ( ) { <nl> - $ x = new X ; <nl> - foreach ( $ x - > foo ( ' this ' ) as $ v ) { <nl> - var_dump ( $ v ) ; <nl> - } <nl> - } <nl> deleted file mode 100644 <nl> index a3b03157e09 . . 00000000000 <nl> mmm a / hphp / test / slow / yield / 2167 . php . expect <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - int ( 5 ) <nl> deleted file mode 100644 <nl> index 4510f4a0583 . . 00000000000 <nl> mmm a / hphp / test / slow / yield / 2167 . php . hphp_opts <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - - vEnableHipHopSyntax = 1 - d hhvm . php7 . all = 0 - d hhvm . php7 . all = 0 <nl> deleted file mode 120000 <nl> index 192ba8eb2b5 . . 00000000000 <nl> mmm a / hphp / test / slow / yield / 2167 . php . opts <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - . . / hiphop . opts <nl> \ No newline at end of file <nl> | Disable variable variables in runtime by default | facebook/hhvm | 39a1b840dace68bde80273bc2e4d0b926da60f6b | 2019-01-26T07:19:23Z |
mmm a / tensorflow / python / kernel_tests / check_ops_test . py <nl> ppp b / tensorflow / python / kernel_tests / check_ops_test . py <nl> def test_returns_none_with_eager ( self ) : <nl> x = check_ops . assert_near ( t1 , t2 ) <nl> assert x is None <nl> <nl> + @ test_util . run_in_graph_and_eager_modes <nl> + def test_doesnt_raise_complex ( self ) : <nl> + x = constant_op . constant ( 1 . + 0 . 1j , name = " x " ) <nl> + y = constant_op . constant ( 1 . 1 + 0 . 1j , name = " y " ) <nl> + with ops . control_dependencies ( <nl> + [ check_ops . assert_near ( x , y , atol = 0 . , rtol = 0 . 5 , <nl> + message = " failure message " ) ] ) : <nl> + out = array_ops . identity ( x ) <nl> + self . evaluate ( out ) <nl> + <nl> <nl> class AssertLessTest ( test . TestCase ) : <nl> <nl> mmm a / tensorflow / python / ops / check_ops . py <nl> ppp b / tensorflow / python / ops / check_ops . py <nl> def assert_near ( <nl> x = ops . convert_to_tensor ( x , name = ' x ' ) <nl> y = ops . convert_to_tensor ( y , name = ' y ' , dtype = x . dtype ) <nl> <nl> - eps = np . finfo ( x . dtype . as_numpy_dtype ) . eps <nl> + dtype = x . dtype <nl> + if dtype . is_complex : <nl> + dtype = dtype . real_dtype <nl> + eps = np . finfo ( dtype . as_numpy_dtype ) . eps <nl> rtol = 10 * eps if rtol is None else rtol <nl> atol = 10 * eps if atol is None else atol <nl> <nl> - rtol = ops . convert_to_tensor ( rtol , name = ' rtol ' , dtype = x . dtype ) <nl> - atol = ops . convert_to_tensor ( atol , name = ' atol ' , dtype = x . dtype ) <nl> + rtol = ops . convert_to_tensor ( rtol , name = ' rtol ' , dtype = dtype ) <nl> + atol = ops . convert_to_tensor ( atol , name = ' atol ' , dtype = dtype ) <nl> <nl> if context . executing_eagerly ( ) : <nl> x_name = _shape_and_dtype_str ( x ) <nl> | Add complex tensor support for tf . debugging . assert_near | tensorflow/tensorflow | 7738aca0dcf9f2d2d27b7c3bb1b17c0fb41bbb10 | 2020-05-23T22:56:38Z |
mmm a / tensorflow / compiler / mlir / lite / transforms / optimize_patterns . td <nl> ppp b / tensorflow / compiler / mlir / lite / transforms / optimize_patterns . td <nl> class HasRankAtMost < int n > : Constraint < <nl> / / Multi - pattern consisting of matching stand - alone convolution op followed by <nl> / / activation op . <nl> multiclass FuseActFnIntoConvOpPat < dag ActFnOp , dag ActFnAttr > { <nl> - def : Pat < ( ActFnOp ( TFL_Conv2DOp : $ conv_out $ input , $ filter , $ bias , <nl> - $ h_factor , $ w_factor , TFL_AF_None , <nl> - $ padding , $ stride_h , $ stride_w ) ) , <nl> - ( TFL_Conv2DOp $ input , $ filter , $ bias , <nl> - $ h_factor , $ w_factor , ActFnAttr , <nl> - $ padding , $ stride_h , $ stride_w ) , <nl> - [ ( HasOneUse $ conv_out ) ] > ; <nl> - def : Pat < ( ActFnOp ( TFL_DepthwiseConv2DOp : $ conv_out $ input , $ filter , $ bias , <nl> - $ h_factor , $ w_factor , TFL_AF_None , <nl> - $ padding , $ stride_h , $ stride_w , <nl> - $ multiplier ) ) , <nl> - ( TFL_DepthwiseConv2DOp $ input , $ filter , $ bias , <nl> - $ h_factor , $ w_factor , ActFnAttr , <nl> - $ padding , $ stride_h , $ stride_w , <nl> - $ multiplier ) , <nl> - [ ( HasOneUse $ conv_out ) ] > ; <nl> + def FuseActivationFuncWithConv # ActFnOp # ActFnAttr : Pat < <nl> + ( ActFnOp ( TFL_Conv2DOp : $ conv_out $ input , $ filter , $ bias , $ h_factor , <nl> + $ w_factor , TFL_AF_None , $ padding , $ stride_h , $ stride_w ) ) , <nl> + ( TFL_Conv2DOp $ input , $ filter , $ bias , $ h_factor , $ w_factor , ActFnAttr , <nl> + $ padding , $ stride_h , $ stride_w ) , <nl> + [ ( HasOneUse $ conv_out ) ] > ; <nl> + def FuseActivationFuncWithDepthwiseConv # ActFnOp # ActFnAttr : Pat < <nl> + ( ActFnOp ( TFL_DepthwiseConv2DOp : $ conv_out $ input , $ filter , $ bias , $ h_factor , <nl> + $ w_factor , TFL_AF_None , $ padding , $ stride_h , $ stride_w , <nl> + $ multiplier ) ) , <nl> + ( TFL_DepthwiseConv2DOp $ input , $ filter , $ bias , $ h_factor , $ w_factor , <nl> + ActFnAttr , $ padding , $ stride_h , $ stride_w , $ multiplier ) , <nl> + [ ( HasOneUse $ conv_out ) ] > ; <nl> } <nl> <nl> / / TODO ( hinsu ) : Also fuse ops corresponding to SIGN_BIT fused <nl> class CanFuseConvOrDepthwiseConv < string is_depthwise > : Constraint < <nl> / / constant folding the bias and the binary op ' s constant operand . The following <nl> / / pattern restricts to float constant values for now . <nl> multiclass FuseBinaryOpToPrecedingAffine < dag binaryOp > { <nl> - def : Pat < ( binaryOp ( TFL_Conv2DOp : $ output $ input , $ filter , <nl> - ( ConstantOp F32ElementsAttr : $ bias ) , <nl> - $ h_factor , $ w_factor , TFL_AF_None , <nl> - $ padding , $ stride_h , $ stride_w ) , <nl> - ( ConstantOp F32ElementsAttr : $ value ) , $ act_fn ) , <nl> - ( TFL_Conv2DOp $ input , $ filter , <nl> - ( binaryOp ( ConstantOp $ bias ) , <nl> - ( ConstantOp $ value ) , TFL_AF_None ) , <nl> - $ h_factor , $ w_factor , $ act_fn , <nl> - $ padding , $ stride_h , $ stride_w ) , <nl> - [ ( CanFuseConvOrDepthwiseConv < " false " > $ filter , $ value ) , <nl> - ( HasOneUse $ output ) ] > ; <nl> - def : Pat < ( binaryOp ( TFL_DepthwiseConv2DOp : $ output $ input , $ filter , <nl> - ( ConstantOp F32ElementsAttr : $ bias ) , <nl> - $ h_factor , $ w_factor , TFL_AF_None , <nl> - $ padding , $ stride_h , $ stride_w , <nl> - $ multiplier ) , <nl> - ( ConstantOp F32ElementsAttr : $ value ) , $ act_fn ) , <nl> - ( TFL_DepthwiseConv2DOp $ input , $ filter , <nl> - ( binaryOp ( ConstantOp $ bias ) , <nl> - ( ConstantOp $ value ) , <nl> - TFL_AF_None ) , <nl> - $ h_factor , $ w_factor , $ act_fn , <nl> - $ padding , $ stride_h , $ stride_w , <nl> - $ multiplier ) , <nl> - [ ( CanFuseConvOrDepthwiseConv < " true " > $ filter , $ value ) , <nl> - ( HasOneUse $ output ) ] > ; <nl> + def FuseBinaryOpWithConv # binaryOp : Pat < <nl> + ( binaryOp ( TFL_Conv2DOp : $ output $ input , $ filter , <nl> + ( ConstantOp F32ElementsAttr : $ bias ) , $ h_factor , $ w_factor , <nl> + TFL_AF_None , $ padding , $ stride_h , $ stride_w ) , <nl> + ( ConstantOp F32ElementsAttr : $ value ) , $ act_fn ) , <nl> + ( TFL_Conv2DOp $ input , $ filter , <nl> + ( binaryOp ( ConstantOp $ bias ) , <nl> + ( ConstantOp $ value ) , TFL_AF_None ) , <nl> + $ h_factor , $ w_factor , $ act_fn , $ padding , $ stride_h , $ stride_w ) , <nl> + [ ( CanFuseConvOrDepthwiseConv < " false " > $ filter , $ value ) , <nl> + ( HasOneUse $ output ) ] > ; <nl> + def FuseBinaryOpWithDepthwiseConv # binaryOp : Pat < <nl> + ( binaryOp ( TFL_DepthwiseConv2DOp : $ output $ input , $ filter , <nl> + ( ConstantOp F32ElementsAttr : $ bias ) , <nl> + $ h_factor , $ w_factor , TFL_AF_None , $ padding , $ stride_h , <nl> + $ stride_w , $ multiplier ) , <nl> + ( ConstantOp F32ElementsAttr : $ value ) , $ act_fn ) , <nl> + ( TFL_DepthwiseConv2DOp $ input , $ filter , <nl> + ( binaryOp ( ConstantOp $ bias ) , ( ConstantOp $ value ) , TFL_AF_None ) , <nl> + $ h_factor , $ w_factor , $ act_fn , $ padding , $ stride_h , $ stride_w , <nl> + $ multiplier ) , <nl> + [ ( CanFuseConvOrDepthwiseConv < " true " > $ filter , $ value ) , <nl> + ( HasOneUse $ output ) ] > ; <nl> } <nl> foreach binaryOp = [ TFL_AddOp , TFL_SubOp ] in <nl> defm : FuseBinaryOpToPrecedingAffine < binaryOp > ; <nl> def ExpandTo4DForDepthwiseConv : NativeCodeCall < <nl> / / The following pattern restricts to float constant values for now . <nl> <nl> multiclass FuseMulOrDivWithConv2dOrDepthwiseConv2d < dag BinaryOp > { <nl> - def : Pat < ( BinaryOp ( TFL_DepthwiseConv2DOp : $ output $ input , <nl> - ( ConstantOp F32ElementsAttr : $ filter ) , <nl> - ( ConstantOp F32ElementsAttr : $ bias ) , <nl> - $ h_factor , $ w_factor , TFL_AF_None , <nl> - $ padding , $ stride_h , $ stride_w , <nl> - $ multiplier ) , <nl> - ( ConstantOp F32ElementsAttr : $ value ) , $ act_fn ) , <nl> - ( TFL_DepthwiseConv2DOp $ input , <nl> - ( BinaryOp ( ConstantOp $ filter ) , <nl> - ( ConstantOp <nl> - ( ExpandTo4DForDepthwiseConv $ value ) ) , <nl> - TFL_AF_None ) , <nl> - ( BinaryOp ( ConstantOp $ bias ) , <nl> - ( ConstantOp $ value ) , <nl> - TFL_AF_None ) , <nl> - $ h_factor , $ w_factor , $ act_fn , <nl> - $ padding , $ stride_h , $ stride_w , <nl> - $ multiplier ) , <nl> - [ ( CanFuseConvOrDepthwiseConv < " true " > $ filter , $ value ) , <nl> - ( HasOneUse $ output ) ] > ; <nl> - def : Pat < ( BinaryOp ( TFL_Conv2DOp : $ conv_output $ input , <nl> - ( ConstantOp F32ElementsAttr : $ filter ) , <nl> - ( ConstantOp F32ElementsAttr : $ bias ) , <nl> - $ h_factor , $ w_factor , TFL_AF_None , <nl> - $ padding , $ stride_h , $ stride_w ) , <nl> - ( ConstantOp F32ElementsAttr : $ value ) , $ act_fn ) , <nl> - ( TFL_Conv2DOp $ input , <nl> - ( BinaryOp ( ConstantOp $ filter ) , <nl> - ( ConstantOp ( ExpandTo4DForConv $ value ) ) , <nl> - TFL_AF_None ) , <nl> - ( BinaryOp ( ConstantOp $ bias ) , <nl> - ( ConstantOp $ value ) , <nl> - TFL_AF_None ) , <nl> - $ h_factor , $ w_factor , $ act_fn , <nl> - $ padding , $ stride_h , $ stride_w ) , <nl> - [ ( CanFuseConvOrDepthwiseConv < " false " > $ filter , $ value ) , <nl> - ( HasOneUse $ conv_output ) ] > ; <nl> + def FuseMulOrDivWithDepthwiseConv # BinaryOp : Pat < <nl> + ( BinaryOp ( TFL_DepthwiseConv2DOp : $ output $ input , <nl> + ( ConstantOp F32ElementsAttr : $ filter ) , <nl> + ( ConstantOp F32ElementsAttr : $ bias ) , <nl> + $ h_factor , $ w_factor , TFL_AF_None , $ padding , $ stride_h , <nl> + $ stride_w , $ multiplier ) , <nl> + ( ConstantOp F32ElementsAttr : $ value ) , $ act_fn ) , <nl> + ( TFL_DepthwiseConv2DOp $ input , <nl> + ( BinaryOp <nl> + ( ConstantOp $ filter ) , <nl> + ( ConstantOp ( ExpandTo4DForDepthwiseConv $ value ) ) , <nl> + TFL_AF_None ) , <nl> + ( BinaryOp <nl> + ( ConstantOp $ bias ) , <nl> + ( ConstantOp $ value ) , <nl> + TFL_AF_None ) , <nl> + $ h_factor , $ w_factor , $ act_fn , $ padding , $ stride_h , <nl> + $ stride_w , $ multiplier ) , <nl> + [ ( CanFuseConvOrDepthwiseConv < " true " > $ filter , $ value ) , <nl> + ( HasOneUse $ output ) ] > ; <nl> + def FuseMulOrDivWithConv # BinaryOp : Pat < <nl> + ( BinaryOp ( TFL_Conv2DOp : $ conv_output $ input , <nl> + ( ConstantOp F32ElementsAttr : $ filter ) , <nl> + ( ConstantOp F32ElementsAttr : $ bias ) , <nl> + $ h_factor , $ w_factor , TFL_AF_None , <nl> + $ padding , $ stride_h , $ stride_w ) , <nl> + ( ConstantOp F32ElementsAttr : $ value ) , $ act_fn ) , <nl> + ( TFL_Conv2DOp $ input , <nl> + ( BinaryOp ( ConstantOp $ filter ) , <nl> + ( ConstantOp ( ExpandTo4DForConv $ value ) ) , <nl> + TFL_AF_None ) , <nl> + ( BinaryOp ( ConstantOp $ bias ) , <nl> + ( ConstantOp $ value ) , <nl> + TFL_AF_None ) , <nl> + $ h_factor , $ w_factor , $ act_fn , $ padding , $ stride_h , $ stride_w ) , <nl> + [ ( CanFuseConvOrDepthwiseConv < " false " > $ filter , $ value ) , <nl> + ( HasOneUse $ conv_output ) ] > ; <nl> } <nl> <nl> foreach BinaryOp = [ TFL_DivOp , TFL_MulOp ] in <nl> class OperandHasRank < int n > : Constraint < <nl> CPred < " $ 0 . getType ( ) . cast < ShapedType > ( ) . getRank ( ) = = " # n > > ; <nl> <nl> / / Matching HardSwish <nl> - def : Pat < <nl> + def MatchHardSwishPattern1 : Pat < <nl> ( TFL_MulOp <nl> ( TFL_MulOp <nl> $ x , ( TFL_AddOp <nl> def : Pat < <nl> ( TFL_HardSwishOp $ x ) , <nl> [ ( EqualOperands $ x , $ y ) ] > ; <nl> <nl> - def : Pat < <nl> + def MatchHardSwishPattern2 : Pat < <nl> ( TFL_MulOp <nl> $ x , <nl> ( TFL_MulOp <nl> def : Pat < <nl> / / Matching HardSwish with extra FakeQuant . These FakeQuant ops were due to <nl> / / incorrect placement in the quantization aware training . <nl> / / TODO ( b / 149735743 ) : We should make the placement automatically . <nl> - def : Pat < <nl> + def MatchHardSwishQuantized : Pat < <nl> ( TFL_MulOp ( TFL_DequantizeOp ( TFL_QuantizeOp <nl> ( TFL_MulOp <nl> $ x , ( TFL_DequantizeOp ( TFL_QuantizeOp ( TFL_AddOp <nl> multiclass L2NormalizePatterns < dag FirstOp , dag SecondOp > { <nl> / / This pattern constructs L2NormalizationOp from <nl> / / Mul - > Rsqrt - > Sum - > Square Or <nl> / / Div - > sqrt - > Sum - > Square <nl> - def : Pat < ( FirstOp $ operand1 , <nl> + def L2NormalizePattern1 # FirstOp # SecondOp : Pat < <nl> + ( FirstOp $ operand1 , <nl> ( SecondOp <nl> ( TFL_SumOp <nl> ( TFL_SquareOp : $ sq_op $ square_operand ) , <nl> multiclass L2NormalizePatterns < dag FirstOp , dag SecondOp > { <nl> <nl> / / Below patterns for L2Normalize when there is an Add or Maximum <nl> / / adding or clamping to a small constant scalar . <nl> - def : Pat < ( FirstOp $ operand1 , <nl> + def L2NormalizePattern2 # FirstOp # SecondOp : Pat < <nl> + ( FirstOp $ operand1 , <nl> ( SecondOp <nl> ( TFL_AddOp <nl> ( TFL_SumOp <nl> multiclass L2NormalizePatterns < dag FirstOp , dag SecondOp > { <nl> ( L2NormValidReduceIndex $ sq_op , $ axis ) , <nl> ( ConstDoubleValueLessThan < " 1e - 3 " > $ epsilon ) ] > ; <nl> <nl> - def : Pat < ( FirstOp $ operand1 , <nl> + def L2NormalizePattern3 # FirstOp # SecondOp : Pat < <nl> + ( FirstOp $ operand1 , <nl> ( SecondOp <nl> ( TFL_MaximumOp <nl> ( TFL_SumOp <nl> def HaveSameType : Constraint < CPred < " $ 0 . getType ( ) , $ 1 . getType ( ) " > > ; <nl> / / Pattern for skipping Tile if it is mainly for broadcasting and the <nl> / / Op is already supporting broadcasting . <nl> multiclass FuseTileBroadcastIntoFollowingBinary < dag BinaryOp > { <nl> - def : Pat < ( BinaryOp : $ result ( TFL_TileOp $ input , ( ConstantOp $ tile ) ) , <nl> - $ operand , $ act_func ) , <nl> - ( BinaryOp $ input , $ operand , $ act_func ) , <nl> + def FuseTileBroadcastToBinaryOp1 # BinaryOp : Pat < <nl> + ( BinaryOp : $ result ( TFL_TileOp $ input , ( ConstantOp $ tile ) ) , <nl> + $ operand , $ act_func ) , <nl> + ( BinaryOp $ input , $ operand , $ act_func ) , <nl> [ ( OperandsBroadcastToOutputType $ input , $ operand , $ result ) ] > ; <nl> <nl> - def : Pat < ( BinaryOp : $ result $ operand , <nl> - ( TFL_TileOp $ input , ( ConstantOp $ tile ) ) , $ act_func ) , <nl> - ( BinaryOp $ operand , $ input , $ act_func ) , <nl> + def FuseTileBroadcastToBinaryOp2 # BinaryOp : Pat < <nl> + ( BinaryOp : $ result $ operand , <nl> + ( TFL_TileOp $ input , ( ConstantOp $ tile ) ) , $ act_func ) , <nl> + ( BinaryOp $ operand , $ input , $ act_func ) , <nl> [ ( OperandsBroadcastToOutputType $ operand , $ input , $ result ) ] > ; <nl> } <nl> <nl> multiclass FusedBinaryActivationFuncOpPat < dag BinaryOp > { <nl> foreach actFnPair = [ [ TFL_ReluOp , TFL_AF_Relu ] , <nl> [ TFL_Relu6Op , TFL_AF_Relu6 ] , <nl> [ TFL_Relu1Op , TFL_AF_Relu1 ] ] in { <nl> - def : Pat < ( actFnPair [ 0 ] ( BinaryOp : $ binary_out $ lhs , $ rhs , TFL_AF_None ) ) , <nl> - ( BinaryOp $ lhs , $ rhs , actFnPair [ 1 ] ) , <nl> - [ ( HasOneUse $ binary_out ) ] > ; <nl> + def FuseBinaryWithActivation # BinaryOp # actFnPair [ 0 ] : Pat < <nl> + ( actFnPair [ 0 ] ( BinaryOp : $ binary_out $ lhs , $ rhs , TFL_AF_None ) ) , <nl> + ( BinaryOp $ lhs , $ rhs , actFnPair [ 1 ] ) , <nl> + [ ( HasOneUse $ binary_out ) ] > ; <nl> } <nl> } <nl> <nl> foreach BinaryOp = [ TFL_AddOp , TFL_SubOp , TFL_DivOp , TFL_MulOp ] in { <nl> / / transformation , the shape of the binary op result is [ 40x1600 ] , which <nl> / / couldn ' t be reshaped to [ 1 , 40 , 40 ] . ` IsTailOfShape ` constraint is added to <nl> / / make sure $ rhs is the tail shape of $ lhs . <nl> - def : Pat < ( BinaryOp ( TFL_ReshapeOp : $ lhs $ input , ( ConstantOp : $ shape $ s ) ) , <nl> - ( ConstantOp : $ rhs $ a ) , TFL_AF_None ) , <nl> - ( TFL_ReshapeOp ( BinaryOp $ input , $ rhs , TFL_AF_None ) , $ shape ) , <nl> - / / The broadcasting of " BinaryOp " only happens in the lower <nl> - / / dimensions , and the higher dimensions are same , so we know the <nl> - / / result and input of the " BinaryOp " in the source pattern have <nl> - / / the same shape , which is defined by ` shape ` . <nl> - [ ( IsTailOfShape $ rhs , $ lhs ) , <nl> - ( HasOneUse $ lhs ) , <nl> - / / The result of the new " BinaryOp " will have the same shape as <nl> - / / ` input ` . In other words , the shape of the ` Reshape ` op are not <nl> - / / changed after the transformation . <nl> - ( IsTailOfShape $ rhs , $ input ) , <nl> - ( HasRankAtMost < 5 > $ input ) , <nl> - ( HasRankAtMost < 5 > $ rhs ) ] > ; <nl> + def MoveBinaryOpBeforeReshape # BinaryOp : Pat < <nl> + ( BinaryOp ( TFL_ReshapeOp : $ lhs $ input , ( ConstantOp : $ shape $ s ) ) , <nl> + ( ConstantOp : $ rhs $ a ) , TFL_AF_None ) , <nl> + ( TFL_ReshapeOp ( BinaryOp $ input , $ rhs , TFL_AF_None ) , $ shape ) , <nl> + / / The broadcasting of " BinaryOp " only happens in the lower <nl> + / / dimensions , and the higher dimensions are same , so we know the <nl> + / / result and input of the " BinaryOp " in the source pattern have <nl> + / / the same shape , which is defined by ` shape ` . <nl> + [ ( IsTailOfShape $ rhs , $ lhs ) , <nl> + ( HasOneUse $ lhs ) , <nl> + / / The result of the new " BinaryOp " will have the same shape as <nl> + / / ` input ` . In other words , the shape of the ` Reshape ` op are not <nl> + / / changed after the transformation . <nl> + ( IsTailOfShape $ rhs , $ input ) , <nl> + ( HasRankAtMost < 5 > $ input ) , <nl> + ( HasRankAtMost < 5 > $ rhs ) ] > ; <nl> } <nl> <nl> foreach BinaryOp = [ TFL_FloorDivOp , TFL_FloorModOp , TFL_MinimumOp , <nl> foreach BinaryOp = [ TFL_FloorDivOp , TFL_FloorModOp , TFL_MinimumOp , <nl> / / transformation , the shape of the binary op result is [ 40x1600 ] , which <nl> / / couldn ' t be reshaped to [ 1 , 40 , 40 ] . ` IsTailOfShape ` constraint is added to <nl> / / make sure $ rhs is the tail shape of $ lhs . <nl> - def : Pat < ( BinaryOp ( TFL_ReshapeOp : $ lhs $ input , ( ConstantOp : $ shape $ s ) ) , <nl> - ( ConstantOp : $ rhs $ a ) ) , <nl> - ( TFL_ReshapeOp ( BinaryOp $ input , $ rhs ) , $ shape ) , <nl> - / / The broadcasting of " BinaryOp " only happens in the lower <nl> - / / dimensions , and the higher dimensions are same , so we know the <nl> - / / result and input of the " BinaryOp " in the source pattern have <nl> - / / the same shape , which is defined by ` shape ` . <nl> - [ ( IsTailOfShape $ rhs , $ lhs ) , <nl> - ( HasOneUse $ lhs ) , <nl> - / / The result of the new " BinaryOp " will have the same shape as <nl> - / / ` input ` . In other words , the shape of the ` Reshape ` op are not <nl> - / / changed after the transformation . <nl> - ( IsTailOfShape $ rhs , $ input ) ] > ; <nl> + def MoveBinaryOpBeforeReshape # BinaryOp : Pat < <nl> + ( BinaryOp ( TFL_ReshapeOp : $ lhs $ input , ( ConstantOp : $ shape $ s ) ) , <nl> + ( ConstantOp : $ rhs $ a ) ) , <nl> + ( TFL_ReshapeOp ( BinaryOp $ input , $ rhs ) , $ shape ) , <nl> + / / The broadcasting of " BinaryOp " only happens in the lower <nl> + / / dimensions , and the higher dimensions are same , so we know the <nl> + / / result and input of the " BinaryOp " in the source pattern have <nl> + / / the same shape , which is defined by ` shape ` . <nl> + [ ( IsTailOfShape $ rhs , $ lhs ) , <nl> + ( HasOneUse $ lhs ) , <nl> + / / The result of the new " BinaryOp " will have the same shape as <nl> + / / ` input ` . In other words , the shape of the ` Reshape ` op are not <nl> + / / changed after the transformation . <nl> + ( IsTailOfShape $ rhs , $ input ) ] > ; <nl> } <nl> <nl> / / Reorder the element - wise value operations and the element move operations , <nl> foreach ValueOp = [ TFL_CeilOp , TFL_ExpOp , TFL_FloorOp , TFL_NegOp , <nl> TFL_TanhOp , TFL_SqrtOp , TFL_SquareOp ] in { <nl> foreach MoveOp = [ TFL_DepthToSpaceOp , TFL_ExpandDimsOp , TFL_SqueezeOp , <nl> TFL_ReshapeOp , TFL_TransposeOp ] in { <nl> - def : Pat < ( ValueOp : $ value ( MoveOp : $ move $ input , $ move_def ) ) , <nl> - ( MoveOp ( ValueOp $ input ) , $ move_def ) , <nl> - [ ( HasOneUse $ move ) ] > ; <nl> + def ReorderElementwiseAndMoveOperations # ValueOp # MoveOp : Pat < <nl> + ( ValueOp : $ value ( MoveOp : $ move $ input , $ move_def ) ) , <nl> + ( MoveOp ( ValueOp $ input ) , $ move_def ) , <nl> + [ ( HasOneUse $ move ) ] > ; <nl> } <nl> } <nl> <nl> foreach ValueOp = [ TFL_CeilOp , TFL_ExpOp , TFL_FloorOp , TFL_NegOp , <nl> def GetShape : NativeCodeCall < " GetShape ( $ 0 ) " > ; <nl> <nl> / / Convert squeeze to reshape if possible . <nl> - def : Pat < ( TFL_SqueezeOp : $ squeeze_op $ input , $ squeeze_dims ) , <nl> - ( TFL_ReshapeOp $ input , <nl> - ( ConstantOp ( GetShape $ squeeze_op ) ) ) , <nl> - [ ( AnyStaticShapeTensor $ squeeze_op ) ] > ; <nl> + def ConvertSqueezeToReshape : Pat < <nl> + ( TFL_SqueezeOp : $ squeeze_op $ input , $ squeeze_dims ) , <nl> + ( TFL_ReshapeOp $ input , ( ConstantOp ( GetShape $ squeeze_op ) ) ) , <nl> + [ ( AnyStaticShapeTensor $ squeeze_op ) ] > ; <nl> <nl> / / Convert expand_dims to reshape if possible . <nl> - def : Pat < ( TFL_ExpandDimsOp : $ expand_dims_op $ input , $ dim ) , <nl> - ( TFL_ReshapeOp $ input , <nl> - ( ConstantOp ( GetShape $ expand_dims_op ) ) ) , <nl> - [ ( AnyStaticShapeTensor $ expand_dims_op ) ] > ; <nl> + def ConvertExpandDimsToReshape : Pat < <nl> + ( TFL_ExpandDimsOp : $ expand_dims_op $ input , $ dim ) , <nl> + ( TFL_ReshapeOp $ input , ( ConstantOp ( GetShape $ expand_dims_op ) ) ) , <nl> + [ ( AnyStaticShapeTensor $ expand_dims_op ) ] > ; <nl> <nl> class FloatValueEquals < string val > : Constraint < CPred < <nl> " $ 0 . cast < DenseElementsAttr > ( ) . getNumElements ( ) = = 1 & & " <nl> class FloatValueEquals < string val > : Constraint < CPred < <nl> " * $ 0 . cast < DenseElementsAttr > ( ) . getValues < float > ( ) . begin ( ) = = " # val > > ; <nl> <nl> / / ReLU patterns <nl> - def : Pat < ( TFL_MinimumOp ( TFL_MaximumOp $ input , <nl> - ( ConstantOp $ NegOne ) ) , <nl> - ( ConstantOp $ One ) ) , <nl> - ( TFL_Relu1Op $ input ) , <nl> - [ ( FloatValueEquals < " - 1 " > $ NegOne ) , ( FloatValueEquals < " 1 " > $ One ) ] > ; <nl> - <nl> - def : Pat < ( TFL_MaximumOp ( TFL_MinimumOp $ input , <nl> - ( ConstantOp $ One ) ) , <nl> - ( ConstantOp $ NegOne ) ) , <nl> - ( TFL_Relu1Op $ input ) , <nl> - [ ( FloatValueEquals < " - 1 " > $ NegOne ) , ( FloatValueEquals < " 1 " > $ One ) ] > ; <nl> - <nl> - def : Pat < ( TFL_MaximumOp ( TFL_MulOp : $ mul_out $ input1 , <nl> - ( ConstantOp F32ElementsAttr : $ alpha ) , TFL_AF_None ) , <nl> - $ input2 ) , <nl> - ( TFL_LeakyReluOp $ input1 , ExtractSingleElementAsFloat : $ alpha ) , <nl> - [ ( ConstDoubleValueLessThan < " 1 " > $ alpha ) , <nl> - ( EqualOperands $ input1 , $ input2 ) , <nl> - ( HasOneUse $ mul_out ) ] > ; <nl> + def MatchRelu1Pattern1 : Pat < <nl> + ( TFL_MinimumOp ( TFL_MaximumOp $ input , ( ConstantOp $ NegOne ) ) , <nl> + ( ConstantOp $ One ) ) , <nl> + ( TFL_Relu1Op $ input ) , <nl> + [ ( FloatValueEquals < " - 1 " > $ NegOne ) , ( FloatValueEquals < " 1 " > $ One ) ] > ; <nl> + <nl> + def MatchRelu1Pattern2 : Pat < <nl> + ( TFL_MaximumOp ( TFL_MinimumOp $ input , ( ConstantOp $ One ) ) , <nl> + ( ConstantOp $ NegOne ) ) , <nl> + ( TFL_Relu1Op $ input ) , <nl> + [ ( FloatValueEquals < " - 1 " > $ NegOne ) , ( FloatValueEquals < " 1 " > $ One ) ] > ; <nl> + <nl> + def MatchLeakyRelu : Pat < <nl> + ( TFL_MaximumOp <nl> + ( TFL_MulOp : $ mul_out $ input1 , <nl> + ( ConstantOp F32ElementsAttr : $ alpha ) , TFL_AF_None ) , <nl> + $ input2 ) , <nl> + ( TFL_LeakyReluOp $ input1 , ExtractSingleElementAsFloat : $ alpha ) , <nl> + [ ( ConstDoubleValueLessThan < " 1 " > $ alpha ) , <nl> + ( EqualOperands $ input1 , $ input2 ) , <nl> + ( HasOneUse $ mul_out ) ] > ; <nl> <nl> def RemoveTrivialCast : Pat < ( TFL_CastOp : $ output $ input ) , <nl> ( replaceWithValue $ input ) , <nl> def PReluAlphaRankCheck : Constraint < <nl> <nl> / / PReLU pattern from Keras : <nl> / / f ( x ) = Relu ( x ) + ( - alpha * Relu ( - x ) ) <nl> - def : Pat < ( TFL_AddOp <nl> - ( TFL_ReluOp : $ relu_out $ input1 ) , <nl> - ( TFL_MulOp : $ mul_out <nl> - ( TFL_ReluOp ( TFL_NegOp : $ input_neg_out $ input2 ) ) , <nl> - $ neg_alpha , <nl> - TFL_AF_None ) , <nl> - TFL_AF_None ) , <nl> - ( TFL_PReluOp $ input1 , ( TFL_NegOp $ neg_alpha ) ) , <nl> - [ ( EqualOperands $ input1 , $ input2 ) , <nl> - ( PReluAlphaRankCheck $ neg_alpha , $ input1 ) , <nl> - ( HasOneUse $ relu_out ) , <nl> - ( HasOneUse $ mul_out ) , <nl> - ( HasOneUse $ input_neg_out ) ] > ; <nl> + def MatchPRelu : Pat < <nl> + ( TFL_AddOp <nl> + ( TFL_ReluOp : $ relu_out $ input1 ) , <nl> + ( TFL_MulOp : $ mul_out <nl> + ( TFL_ReluOp ( TFL_NegOp : $ input_neg_out $ input2 ) ) , <nl> + $ neg_alpha , <nl> + TFL_AF_None ) , <nl> + TFL_AF_None ) , <nl> + ( TFL_PReluOp $ input1 , ( TFL_NegOp $ neg_alpha ) ) , <nl> + [ ( EqualOperands $ input1 , $ input2 ) , <nl> + ( PReluAlphaRankCheck $ neg_alpha , $ input1 ) , <nl> + ( HasOneUse $ relu_out ) , <nl> + ( HasOneUse $ mul_out ) , <nl> + ( HasOneUse $ input_neg_out ) ] > ; <nl> <nl> / / The constant folding in this pass might produce constant in the tf dialect . <nl> / / This rule is to legalize these constant to the tfl dialect . <nl> - def : Pat < ( TF_ConstOp ElementsAttr : $ value ) , ( TFL_ConstOp $ value ) > ; <nl> + def LegalizeConstOp : Pat < <nl> + ( TF_ConstOp ElementsAttr : $ value ) , ( TFL_ConstOp $ value ) > ; <nl> <nl> / / Reorders adds to allow constant folding . <nl> / / Add - - > Add $ input , $ constantA <nl> def : Pat < ( TF_ConstOp ElementsAttr : $ value ) , ( TFL_ConstOp $ value ) > ; <nl> / / Add - - > $ input <nl> / / \ - - > Add ( $ constantA , $ constantB ) <nl> foreach ActFun = [ TFL_AF_Relu , TFL_AF_Relu6 , TFL_AF_Relu1 , TFL_AF_None ] in { <nl> - def : Pat < ( TFL_AddOp <nl> - ( TFL_AddOp : $ first_output $ input , ( ConstantOp $ a ) , TFL_AF_None ) , <nl> - ( ConstantOp $ b ) , ActFun ) , <nl> - ( TFL_AddOp $ input , <nl> - ( TFL_AddOp ( ConstantOp $ a ) , ( ConstantOp $ b ) , TFL_AF_None ) , <nl> - ActFun ) , <nl> - [ ( HasOneUse $ first_output ) ] > ; <nl> + def ReorderAddToAllowConstFold_ActFunc_ # ActFun : Pat < <nl> + ( TFL_AddOp <nl> + ( TFL_AddOp : $ first_output $ input , ( ConstantOp $ a ) , TFL_AF_None ) , <nl> + ( ConstantOp $ b ) , ActFun ) , <nl> + ( TFL_AddOp $ input , <nl> + ( TFL_AddOp ( ConstantOp $ a ) , ( ConstantOp $ b ) , TFL_AF_None ) , <nl> + ActFun ) , <nl> + [ ( HasOneUse $ first_output ) ] > ; <nl> } <nl> <nl> / / We can eliminate Relu from Relu ( SquaredDifference ( x , y ) ) , <nl> | NFC : Name patterns in optimize pass in TFL . | tensorflow/tensorflow | de6c391468d031cc40f6a1bc2421a1f76ce99bbb | 2020-07-20T22:41:33Z |
new file mode 100644 <nl> index 000000000000 . . fee552b585a9 <nl> mmm / dev / null <nl> ppp b / include / swift / Basic / Semantics . def <nl> <nl> + / / = = = mmm Semantics . def - Semantics Attribute Definitions mmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / <nl> + / / This source file is part of the Swift . org open source project <nl> + / / <nl> + / / Copyright ( c ) 2014 - 2017 Apple Inc . and the Swift project authors <nl> + / / Licensed under Apache License v2 . 0 with Runtime Library Exception <nl> + / / <nl> + / / See https : / / swift . org / LICENSE . txt for license information <nl> + / / See https : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> + / / <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / <nl> + / / SEMA_ATTR ( NAME , C_STR ) <nl> + / / <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + SEMA_ATTR ( STRING_EQUALS , " string . equals " ) <nl> + SEMA_ATTR ( STRING_MAKE_UTF8 , " string . makeUTF8 " ) <nl> + SEMA_ATTR ( STRING_ESCAPE_PERCENT_GET , " string . escapePercent . get " ) <nl> + SEMA_ATTR ( STRING_CONCAT , " string . concat " ) <nl> + SEMA_ATTR ( STRING_APPEND , " string . append " ) <nl> + SEMA_ATTR ( STRING_INIT_EMPTY , " string . init_empty " ) <nl> + SEMA_ATTR ( STRING_PLUS_EQUALS , " string . plusequals " ) <nl> + SEMA_ATTR ( FIND_STRING_SWITCH_CASE , " findStringSwitchCase " ) <nl> + SEMA_ATTR ( FIND_STRING_SWITCH_CASE_WITH_CACHE , " findStringSwitchCaseWithCache " ) <nl> + <nl> + SEMA_ATTR ( SWIFT_CONCURRENT_ASYNC , " swift . concurrent . async " ) <nl> + SEMA_ATTR ( SWIFT_CONCURRENT_SAFE , " swift . concurrent . safe " ) <nl> + SEMA_ATTR ( SWIFT_CONCURRENT , " swift . concurrent " ) <nl> + <nl> + SEMA_ATTR ( ARRAY_APPEND_CONTENTS_OF , " array . append_contentsOf " ) <nl> + SEMA_ATTR ( ARRAY_APPEND_ELEMENT , " array . append_element " ) <nl> + SEMA_ATTR ( ARRAY_CHECK_INDEX , " array . check_index " ) <nl> + SEMA_ATTR ( ARRAY_CHECK_SUBSCRIPT , " array . check_subscript " ) <nl> + SEMA_ATTR ( ARRAY_GET_CAPACITY , " array . get_capacity " ) <nl> + SEMA_ATTR ( ARRAY_GET_COUNT , " array . get_count " ) <nl> + SEMA_ATTR ( ARRAY_GET_ELEMENT , " array . get_element " ) <nl> + SEMA_ATTR ( ARRAY_GET_ELEMENT_ADDRESS , " array . get_element_address " ) <nl> + SEMA_ATTR ( ARRAY_INIT , " array . init " ) <nl> + SEMA_ATTR ( ARRAY_INIT_EMPTY , " array . init . empty " ) <nl> + SEMA_ATTR ( ARRAY_MAKE_MUTABLE , " array . make_mutable " ) <nl> + SEMA_ATTR ( ARRAY_MUTATE_UNKNOWN , " array . mutate_unknown " ) <nl> + SEMA_ATTR ( ARRAY_PROPS_IS_NATIVE_TYPE_CHECKED , " array . props . isNativeTypeChecked " ) <nl> + SEMA_ATTR ( ARRAY_RESERVE_CAPACITY_FOR_APPEND , " array . reserve_capacity_for_append " ) <nl> + SEMA_ATTR ( ARRAY_UNINITIALIZED , " array . uninitialized " ) <nl> + SEMA_ATTR ( ARRAY_WITH_UNSAFE_MUTABLE_BUFFER_POINTER , " array . withUnsafeMutableBufferPointer " ) <nl> + SEMA_ATTR ( ARRAY_COUNT , " array . count " ) <nl> + SEMA_ATTR ( ARRAY_DEALLOC_UNINITIALIZED , " array . dealloc_uninitialized " ) <nl> + SEMA_ATTR ( ARRAY_UNINITIALIZED_INTRINSIC , " array . uninitialized_intrinsic " ) <nl> + <nl> + SEMA_ATTR ( OPTIMIZE_SIL_SPECIALIZE_GENERIC_NEVER , " optimize . sil . specialize . generic . never " ) <nl> + SEMA_ATTR ( OPTIMIZE_SIL_SPECIALIZE_GENERIC_PARTIAL_NEVER , <nl> + " optimize . sil . specialize . generic . partial . never " ) <nl> + SEMA_ATTR ( OPTIMIZE_SIL_SPECIALIZE_GENERIC_SIZE_NEVER , " optimize . sil . specialize . generic . size . never " ) <nl> + <nl> + SEMA_ATTR ( OSLOG_INTERPOLATION_INIT , " oslog . interpolation . init " ) <nl> + SEMA_ATTR ( OSLOG_MESSAGE_INIT_INTERPOLATION , " oslog . message . init_interpolation " ) <nl> + SEMA_ATTR ( OSLOG_MESSAGE_INIT_STRING_LITERAL , " oslog . message . init_stringliteral " ) <nl> + <nl> + SEMA_ATTR ( TYPE_CHECKER_OPEN_EXISTENTIAL , " typechecker . _openExistential ( _ : do : ) " ) <nl> + SEMA_ATTR ( TYPE_CHECKER_TYPE , " typechecker . type ( of : ) " ) <nl> + SEMA_ATTR ( TYPE_CHECKER_WITHOUT_ACTUALLY_ESCAPING , " typechecker . withoutActuallyEscaping ( _ : do : ) " ) <nl> + <nl> + SEMA_ATTR ( AVAILABILITY_OSVERSION , " availability . osversion " ) <nl> + <nl> + SEMA_ATTR ( CONSTANT_EVALUABLE , " constant_evaluable " ) <nl> + SEMA_ATTR ( EXIT , " exit " ) <nl> + SEMA_ATTR ( FASTPATH , " fastpath " ) <nl> + SEMA_ATTR ( SLOWPATH , " slowpath " ) <nl> + SEMA_ATTR ( PROGRAMTERMINATION_POINT , " programtermination_point " ) <nl> + SEMA_ATTR ( CONVERT_TO_OBJECTIVE_C , " convertToObjectiveC " ) <nl> + <nl> + / / SEMA_ATTR ( , " 456 " ) <nl> + / / SEMA_ATTR ( , " 123 " ) <nl> + / / SEMA_ATTR ( , " 223 " ) <nl> + / / SEMA_ATTR ( , " bar " ) <nl> + / / SEMA_ATTR ( , " class " ) <nl> + / / SEMA_ATTR ( , " crazy " ) <nl> + / / SEMA_ATTR ( , " enum " ) <nl> + / / SEMA_ATTR ( , " struct " ) <nl> + / / SEMA_ATTR ( , " struct1 " ) <nl> + / / SEMA_ATTR ( , " struct2 " ) <nl> + / / SEMA_ATTR ( , " test_driver " ) <nl> + <nl> + # undef SEMA_ATTR <nl> + <nl> new file mode 100644 <nl> index 000000000000 . . 66ce3840a92f <nl> mmm / dev / null <nl> ppp b / include / swift / Basic / Semantics . h <nl> <nl> + # ifndef SWIFT_SEMANTICS_H <nl> + # define SWIFT_SEMANTICS_H <nl> + <nl> + # include " llvm / ADT / StringRef . h " <nl> + <nl> + namespace swift { <nl> + # define SEMA_ATTR ( NAME , C_STR ) constexpr static const StringLiteral NAME = # C_STR ; <nl> + # include " Semantics . def " <nl> + } <nl> + <nl> + # endif <nl> mmm a / lib / IRGen / AllocStackHoisting . cpp <nl> ppp b / lib / IRGen / AllocStackHoisting . cpp <nl> <nl> # include " swift / SIL / SILBuilder . h " <nl> # include " swift / SIL / SILInstruction . h " <nl> # include " swift / SIL / SILArgument . h " <nl> + # include " swift / Basic / Semantics . h " <nl> <nl> # include " IRGenModule . h " <nl> # include " NonFixedTypeInfo . h " <nl> bool indicatesDynamicAvailabilityCheckUse ( SILInstruction * I ) { <nl> auto * Apply = dyn_cast < ApplyInst > ( I ) ; <nl> if ( ! Apply ) <nl> return false ; <nl> - if ( Apply - > hasSemantics ( " availability . osversion " ) ) <nl> + if ( Apply - > hasSemantics ( AVAILABILITY_OSVERSION ) ) <nl> return true ; <nl> auto * FunRef = Apply - > getReferencedFunctionOrNull ( ) ; <nl> if ( ! FunRef ) <nl> mmm a / lib / SILOptimizer / Analysis / ColdBlockInfo . cpp <nl> ppp b / lib / SILOptimizer / Analysis / ColdBlockInfo . cpp <nl> <nl> # include " swift / SILOptimizer / Analysis / ColdBlockInfo . h " <nl> # include " swift / SILOptimizer / Analysis / DominanceAnalysis . h " <nl> # include " swift / SIL / SILArgument . h " <nl> + # include " swift / Basic / Semantics . h " <nl> <nl> using namespace swift ; <nl> <nl> ColdBlockInfo : : BranchHint ColdBlockInfo : : getBranchHint ( SILValue Cond , <nl> if ( F - > hasSemanticsAttrs ( ) ) { <nl> / / fastpath / slowpath attrs are untested because the inliner luckily <nl> / / inlines them before the downstream calls . <nl> - if ( F - > hasSemanticsAttr ( " slowpath " ) ) <nl> + if ( F - > hasSemanticsAttr ( SLOWPATH ) ) <nl> return BranchHint : : LikelyFalse ; <nl> - else if ( F - > hasSemanticsAttr ( " fastpath " ) ) <nl> + else if ( F - > hasSemanticsAttr ( FASTPATH ) ) <nl> return BranchHint : : LikelyTrue ; <nl> } <nl> } <nl> mmm a / lib / SILOptimizer / Mandatory / OSLogOptimization . cpp <nl> ppp b / lib / SILOptimizer / Mandatory / OSLogOptimization . cpp <nl> <nl> # include " swift / AST / Module . h " <nl> # include " swift / AST / SubstitutionMap . h " <nl> # include " swift / Basic / OptimizationMode . h " <nl> + # include " swift / Basic / Semantics . h " <nl> # include " swift / Demangling / Demangle . h " <nl> # include " swift / Demangling / Demangler . h " <nl> # include " swift / SIL / BasicBlockUtils . h " <nl> static SILFunction * getStringMakeUTF8Init ( SILInstruction * inst ) { <nl> return nullptr ; <nl> <nl> SILFunction * callee = apply - > getCalleeFunction ( ) ; <nl> - if ( ! callee | | ! callee - > hasSemanticsAttr ( " string . makeUTF8 " ) ) <nl> + if ( ! callee | | ! callee - > hasSemanticsAttr ( STRING_MAKE_UTF8 ) ) <nl> return nullptr ; <nl> return callee ; <nl> } <nl> mmm a / lib / SILOptimizer / SILCombiner / SILCombinerApplyVisitors . cpp <nl> ppp b / lib / SILOptimizer / SILCombiner / SILCombinerApplyVisitors . cpp <nl> <nl> # include " swift / AST / Module . h " <nl> # include " swift / AST / SubstitutionMap . h " <nl> # include " swift / Basic / Range . h " <nl> + # include " swift / Basic / Semantics . h " <nl> # include " swift / SIL / DebugUtils . h " <nl> # include " swift / SIL / DynamicCasts . h " <nl> # include " swift / SIL / InstructionUtils . h " <nl> SILInstruction * SILCombiner : : visitApplyInst ( ApplyInst * AI ) { <nl> return I ; <nl> } <nl> } <nl> - if ( SF - > hasSemanticsAttr ( " array . uninitialized " ) ) { <nl> + if ( SF - > hasSemanticsAttr ( ARRAY_UNINITIALIZED ) ) { <nl> UserListTy Users ; <nl> / / If the uninitialized array is only written into then it can be removed . <nl> if ( recursivelyCollectARCUsers ( Users , AI ) ) { <nl> mmm a / lib / SILOptimizer / Transforms / ObjectOutliner . cpp <nl> ppp b / lib / SILOptimizer / Transforms / ObjectOutliner . cpp <nl> <nl> <nl> # define DEBUG_TYPE " objectoutliner " <nl> # include " swift / AST / ASTMangler . h " <nl> + # include " swift / Basic / Semantics . h " <nl> # include " swift / SIL / DebugUtils . h " <nl> # include " swift / SIL / SILBuilder . h " <nl> # include " swift / SILOptimizer / PassManager / Transforms . h " <nl> bool ObjectOutliner : : isValidUseOfObject ( SILInstruction * I , bool isCOWObject , <nl> / / There should only be a single call to findStringSwitchCase . But even <nl> / / if there are multiple calls , it ' s not problem - we ' ll just optimize the <nl> / / last one we find . <nl> - if ( cast < ApplyInst > ( I ) - > hasSemantics ( " findStringSwitchCase " ) ) <nl> + if ( cast < ApplyInst > ( I ) - > hasSemantics ( FIND_STRING_SWITCH_CASE ) ) <nl> * FindStringCall = cast < ApplyInst > ( I ) ; <nl> return true ; <nl> <nl> mmm a / lib / SILOptimizer / Transforms / PerformanceInliner . cpp <nl> ppp b / lib / SILOptimizer / Transforms / PerformanceInliner . cpp <nl> <nl> <nl> # define DEBUG_TYPE " sil - inliner " <nl> # include " swift / AST / Module . h " <nl> + # include " swift / Basic / Semantics . h " <nl> # include " swift / SIL / MemAccessUtils . h " <nl> # include " swift / SIL / OptimizationRemark . h " <nl> # include " swift / SILOptimizer / Analysis / SideEffectAnalysis . h " <nl> bool SILPerformanceInliner : : decideInColdBlock ( FullApplySite AI , <nl> static void addWeightCorrection ( FullApplySite FAS , <nl> llvm : : DenseMap < FullApplySite , int > & WeightCorrections ) { <nl> SILFunction * Callee = FAS . getReferencedFunctionOrNull ( ) ; <nl> - if ( Callee & & Callee - > hasSemanticsAttr ( " array . uninitialized " ) ) { <nl> + if ( Callee & & Callee - > hasSemanticsAttr ( ARRAY_UNINITIALIZED ) ) { <nl> / / We want to inline the argument to an array . uninitialized call , because <nl> / / this argument is most likely a call to a function which contains the <nl> / / buffer allocation for the array . It is essential to inline it for stack <nl> mmm a / lib / SILOptimizer / Utils / ConstExpr . cpp <nl> ppp b / lib / SILOptimizer / Utils / ConstExpr . cpp <nl> <nl> # include " swift / AST / SubstitutionMap . h " <nl> # include " swift / Basic / Defer . h " <nl> # include " swift / Basic / NullablePtr . h " <nl> + # include " swift / Basic / Semantics . h " <nl> # include " swift / Demangling / Demangle . h " <nl> # include " swift / SIL / ApplySite . h " <nl> # include " swift / SIL / FormalLinkage . h " <nl> enum class WellKnownFunction { <nl> } ; <nl> <nl> static llvm : : Optional < WellKnownFunction > classifyFunction ( SILFunction * fn ) { <nl> - if ( fn - > hasSemanticsAttr ( " array . init . empty " ) ) <nl> + if ( fn - > hasSemanticsAttr ( ARRAY_INIT_EMPTY ) ) <nl> return WellKnownFunction : : ArrayInitEmpty ; <nl> - if ( fn - > hasSemanticsAttr ( " array . uninitialized_intrinsic " ) ) <nl> + if ( fn - > hasSemanticsAttr ( ARRAY_UNINITIALIZED_INTRINSIC ) ) <nl> return WellKnownFunction : : AllocateUninitializedArray ; <nl> - if ( fn - > hasSemanticsAttr ( " array . append_element " ) ) <nl> + if ( fn - > hasSemanticsAttr ( ARRAY_APPEND_ELEMENT ) ) <nl> return WellKnownFunction : : ArrayAppendElement ; <nl> - if ( fn - > hasSemanticsAttr ( " string . init_empty " ) ) <nl> + if ( fn - > hasSemanticsAttr ( STRING_INIT_EMPTY ) ) <nl> return WellKnownFunction : : StringInitEmpty ; <nl> / / There are two string initializers in the standard library with the <nl> / / semantics " string . makeUTF8 " . They are identical from the perspective of <nl> / / the interpreter . One of those functions is probably redundant and not used . <nl> - if ( fn - > hasSemanticsAttr ( " string . makeUTF8 " ) ) <nl> + if ( fn - > hasSemanticsAttr ( STRING_MAKE_UTF8 ) ) <nl> return WellKnownFunction : : StringMakeUTF8 ; <nl> - if ( fn - > hasSemanticsAttr ( " string . append " ) ) <nl> + if ( fn - > hasSemanticsAttr ( STRING_APPEND ) ) <nl> return WellKnownFunction : : StringAppend ; <nl> - if ( fn - > hasSemanticsAttr ( " string . equals " ) ) <nl> + if ( fn - > hasSemanticsAttr ( STRING_EQUALS ) ) <nl> return WellKnownFunction : : StringEquals ; <nl> - if ( fn - > hasSemanticsAttr ( " string . escapePercent . get " ) ) <nl> + if ( fn - > hasSemanticsAttr ( STRING_ESCAPE_PERCENT_GET ) ) <nl> return WellKnownFunction : : StringEscapePercent ; <nl> if ( fn - > hasSemanticsAttrThatStartsWith ( " programtermination_point " ) ) <nl> return WellKnownFunction : : AssertionFailure ; <nl> mmm a / lib / SILOptimizer / Utils / ConstantFolding . cpp <nl> ppp b / lib / SILOptimizer / Utils / ConstantFolding . cpp <nl> <nl> <nl> # include " swift / AST / DiagnosticsSIL . h " <nl> # include " swift / AST / Expr . h " <nl> + # include " swift / Basic / Semantics . h " <nl> # include " swift / SIL / InstructionUtils . h " <nl> # include " swift / SIL / PatternMatch . h " <nl> # include " swift / SIL / SILBuilder . h " <nl> static bool isApplyOfBuiltin ( SILInstruction & I , BuiltinValueKind kind ) { <nl> static bool isApplyOfStringConcat ( SILInstruction & I ) { <nl> if ( auto * AI = dyn_cast < ApplyInst > ( & I ) ) <nl> if ( auto * Fn = AI - > getReferencedFunctionOrNull ( ) ) <nl> - if ( Fn - > hasSemanticsAttr ( " string . concat " ) ) <nl> + if ( Fn - > hasSemanticsAttr ( STRING_CONCAT ) ) <nl> return true ; <nl> return false ; <nl> } <nl> constantFoldGlobalStringTablePointerBuiltin ( BuiltinInst * bi , <nl> FullApplySite stringInitSite = FullApplySite : : isa ( builtinOperand ) ; <nl> if ( ! stringInitSite | | ! stringInitSite . getReferencedFunctionOrNull ( ) | | <nl> ! stringInitSite . getReferencedFunctionOrNull ( ) - > hasSemanticsAttr ( <nl> - " string . makeUTF8 " ) ) { <nl> + STRING_MAKE_UTF8 ) ) { <nl> / / Emit diagnostics only on non - transparent functions . <nl> if ( enableDiagnostics & & ! caller - > isTransparent ( ) ) { <nl> diagnose ( caller - > getASTContext ( ) , bi - > getLoc ( ) . getSourceLoc ( ) , <nl> mmm a / lib / SILOptimizer / Utils / Generics . cpp <nl> ppp b / lib / SILOptimizer / Utils / Generics . cpp <nl> <nl> # include " swift / AST / TypeMatcher . h " <nl> # include " swift / AST / DiagnosticEngine . h " <nl> # include " swift / AST / DiagnosticsSIL . h " <nl> + # include " swift / Basic / Semantics . h " <nl> # include " swift / Basic / Statistic . h " <nl> # include " swift / AST / TypeCheckRequests . h " <nl> # include " swift / Serialization / SerializedSILLoader . h " <nl> static bool createsInfiniteSpecializationLoop ( ApplySite Apply ) { <nl> <nl> static bool shouldNotSpecialize ( SILFunction * Callee , SILFunction * Caller , <nl> SubstitutionMap Subs = { } ) { <nl> - if ( Callee - > hasSemanticsAttr ( " optimize . sil . specialize . generic . never " ) ) <nl> + if ( Callee - > hasSemanticsAttr ( OPTIMIZE_SIL_SPECIALIZE_GENERIC_NEVER ) ) <nl> return true ; <nl> <nl> if ( Caller & & <nl> Caller - > getEffectiveOptimizationMode ( ) = = OptimizationMode : : ForSize & & <nl> - Callee - > hasSemanticsAttr ( " optimize . sil . specialize . generic . size . never " ) ) { <nl> + Callee - > hasSemanticsAttr ( OPTIMIZE_SIL_SPECIALIZE_GENERIC_SIZE_NEVER ) ) { <nl> return true ; <nl> } <nl> <nl> <nl> if ( Subs . hasAnySubstitutableParams ( ) & & <nl> - Callee - > hasSemanticsAttr ( " optimize . sil . specialize . generic . partial . never " ) ) <nl> + Callee - > hasSemanticsAttr ( OPTIMIZE_SIL_SPECIALIZE_GENERIC_PARTIAL_NEVER ) ) <nl> return true ; <nl> <nl> return false ; <nl> mmm a / lib / SILOptimizer / Utils / InstOptUtils . cpp <nl> ppp b / lib / SILOptimizer / Utils / InstOptUtils . cpp <nl> <nl> # include " swift / SILOptimizer / Utils / InstOptUtils . h " <nl> # include " swift / AST / GenericSignature . h " <nl> # include " swift / AST / SubstitutionMap . h " <nl> + # include " swift / Basic / Semantics . h " <nl> # include " swift / SIL / BasicBlockUtils . h " <nl> # include " swift / SIL / DebugUtils . h " <nl> # include " swift / SIL / DynamicCasts . h " <nl> bool StringConcatenationOptimizer : : extractStringConcatOperands ( ) { <nl> if ( ! Fn ) <nl> return false ; <nl> <nl> - if ( ai - > getNumArguments ( ) ! = 3 | | ! Fn - > hasSemanticsAttr ( " string . concat " ) ) <nl> + if ( ai - > getNumArguments ( ) ! = 3 | | ! Fn - > hasSemanticsAttr ( STRING_CONCAT ) ) <nl> return false ; <nl> <nl> / / Left and right operands of a string concatenation operation . <nl> bool StringConcatenationOptimizer : : extractStringConcatOperands ( ) { <nl> <nl> / / makeUTF8 should have following parameters : <nl> / / ( start : RawPointer , utf8CodeUnitCount : Word , isASCII : Int1 ) <nl> - if ( ! ( ( friLeftFun - > hasSemanticsAttr ( " string . makeUTF8 " ) <nl> + if ( ! ( ( friLeftFun - > hasSemanticsAttr ( STRING_MAKE_UTF8 ) <nl> & & aiLeftOperandsNum = = 5 ) <nl> - | | ( friRightFun - > hasSemanticsAttr ( " string . makeUTF8 " ) <nl> + | | ( friRightFun - > hasSemanticsAttr ( STRING_MAKE_UTF8 ) <nl> & & aiRightOperandsNum = = 5 ) ) ) <nl> return false ; <nl> <nl> | Add def file for semantics attributes and use constants instead of cstring literals | apple/swift | d4129d8659202c8740b315d2e3ced443d408ca42 | 2019-11-02T18:36:13Z |
mmm a / folly / Bits . h <nl> ppp b / folly / Bits . h <nl> class BitIterator <nl> ssize_t distance_to ( const BitIterator & other ) const { <nl> return <nl> ( other . base_reference ( ) - this - > base_reference ( ) ) * bitsPerBlock ( ) + <nl> - ( other . bitOffset_ - bitOffset_ ) ; <nl> + other . bitOffset_ - bitOffset_ ; <nl> } <nl> <nl> - size_t bitOffset_ ; <nl> + unsigned int bitOffset_ ; <nl> } ; <nl> <nl> / * * <nl> | folly : Bits : restore type of bitOffset_ to shorter " unsigned int " | facebook/folly | 98c4cba4a6bc766a361680664176901bb13d8697 | 2015-02-02T21:11:24Z |
mmm a / hphp / runtime / base / type - array . cpp <nl> ppp b / hphp / runtime / base / type - array . cpp <nl> void Array : : unserialize ( VariableUnserializer * uns ) { <nl> if ( size = = 0 ) { <nl> operator = ( Create ( ) ) ; <nl> } else { <nl> + if ( UNLIKELY ( size < 0 | | size > std : : numeric_limits < int > : : max ( ) ) ) { <nl> + throw Exception ( " Array size out of bounds " ) ; <nl> + } <nl> auto const scale = computeScaleFromSize ( size ) ; <nl> auto const allocsz = computeAllocBytes ( scale ) ; <nl> <nl> new file mode 100644 <nl> index 00000000000 . . 21d71fe5ce5 <nl> mmm / dev / null <nl> ppp b / hphp / test / quick / unserialize_assert . php <nl> <nl> + < ? php <nl> + $ temp = unserialize ( " a : - 33 : { " ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 740f2495072 <nl> mmm / dev / null <nl> ppp b / hphp / test / quick / unserialize_assert . php . expectf <nl> @ @ - 0 , 0 + 1 @ @ <nl> + Notice : Unable to unserialize : [ a : - 33 : { ] . Array size out of bounds . in % s <nl> | Fix a hang / assert in unserialize ( ) | facebook/hhvm | 712041fab4b9f2c881559635185062b148e29d99 | 2015-06-22T18:32:48Z |
mmm a / 3rdParty / CMakeLists . txt <nl> ppp b / 3rdParty / CMakeLists . txt <nl> add_subdirectory ( $ { CMAKE_CURRENT_SOURCE_DIR } / libev ) <nl> # # V8 and ICU <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> <nl> - set ( V8_DIR " $ { CMAKE_CURRENT_SOURCE_DIR } / V8 - 4 . 3 . 61 " ) <nl> + set ( V8_VERSION <nl> + " 4 . 3 . 61 " <nl> + CACHE INTERNAL <nl> + " $ { PROJECT_NAME } : Version " <nl> + FORCE <nl> + ) <nl> + <nl> + set ( V8_DIR " $ { CMAKE_CURRENT_SOURCE_DIR } / V8 - $ { V8_VERSION } " ) <nl> # doesn ' t work ? <nl> set ( V8_TARGET_DIR " $ { CMAKE_CURRENT_BINARY_DIR } / v8 " ) <nl> # set ( V8_TARGET_DIR " out " ) <nl> <nl> - <nl> if ( " $ { HOST_BITS } " STREQUAL " 64 " ) <nl> set ( TARGET_ARCH " x64 " ) <nl> else ( ) <nl> | added version | arangodb/arangodb | ab02faf75b9fe31b1496e90d44595bcfd6d98742 | 2016-02-22T08:57:16Z |
new file mode 100755 <nl> index 00000000000 . . 316d1ef42ea <nl> mmm / dev / null <nl> ppp b / src / operator / concat - inl . h <nl> <nl> + / * ! <nl> + * Copyright ( c ) 2015 by Contributors <nl> + * \ file concat - inl . h <nl> + * \ brief <nl> + * \ author Bing Xu <nl> + * / <nl> + # ifndef MXNET_OPERATOR_CONCAT_INL_H_ <nl> + # define MXNET_OPERATOR_CONCAT_INL_H_ <nl> + # include < dmlc / logging . h > <nl> + # include < dmlc / parameter . h > <nl> + # include < mxnet / operator . h > <nl> + # include < cstring > <nl> + # include < map > <nl> + # include < string > <nl> + # include < vector > <nl> + # include < utility > <nl> + # include " . / operator_common . h " <nl> + <nl> + namespace mxnet { <nl> + namespace op { <nl> + <nl> + enum ConcatOpInputs { kData0 , kData1 , kData2 , kData3 , kData4 } ; <nl> + enum ConcatOpOutputs { kOut } ; <nl> + <nl> + struct ConcatParam : public dmlc : : Parameter < ConcatParam > { <nl> + int num_args ; <nl> + DMLC_DECLARE_PARAMETER ( ConcatParam ) { <nl> + DMLC_DECLARE_FIELD ( num_args ) . set_range ( 1 , 5 ) <nl> + . describe ( " Number of inputs to be concated . " ) ; <nl> + } <nl> + } ; / / struct ConcatParam <nl> + <nl> + template < typename xpu > <nl> + class ConcatOp : public Operator { <nl> + public : <nl> + explicit ConcatOp ( ConcatParam param ) <nl> + : size_ ( param . num_args ) { } <nl> + <nl> + virtual void Forward ( const OpContext & ctx , <nl> + const std : : vector < TBlob > & in_data , <nl> + const std : : vector < OpReqType > & req , <nl> + const std : : vector < TBlob > & out_data , <nl> + const std : : vector < TBlob > & aux_args ) { <nl> + using namespace mshadow ; <nl> + using namespace mshadow : : expr ; <nl> + CHECK_EQ ( static_cast < int > ( in_data . size ( ) ) , size_ ) ; <nl> + CHECK_EQ ( out_data . size ( ) , 1 ) ; <nl> + CHECK_EQ ( req [ kOut ] , kWriteTo ) ; <nl> + Stream < xpu > * s = ctx . get_stream < xpu > ( ) ; <nl> + std : : vector < Tensor < xpu , 4 > > data ; <nl> + Tensor < xpu , 4 > out ; <nl> + if ( in_data [ kData0 ] . ndim ( ) = = 2 ) { <nl> + uint32_t dim = 0 ; <nl> + for ( int i = 0 ; i < size_ ; + + i ) { <nl> + uint32_t ds [ ] = { in_data [ i ] . shape_ [ 0 ] , in_data [ i ] . shape_ [ 1 ] , 1 , 1 } ; <nl> + TShape dshape ( ds , ds + 4 ) ; <nl> + data [ i ] = in_data [ i ] . get_with_shape < xpu , 4 , real_t > ( dshape , s ) ; <nl> + dim + = in_data [ i ] . shape_ [ 1 ] ; <nl> + } <nl> + uint32_t ds_out [ ] = { in_data [ kData0 ] . shape_ [ 0 ] , dim , 1 , 1 } ; <nl> + TShape dshape_out ( ds_out , ds_out + 4 ) ; <nl> + out = out_data [ kOut ] . get_with_shape < xpu , 4 , real_t > ( dshape_out , s ) ; <nl> + } else { <nl> + for ( int i = 0 ; i < size_ ; + + i ) { <nl> + data [ i ] = in_data [ i ] . get < xpu , 4 , real_t > ( s ) ; <nl> + } <nl> + out = out_data [ kOut ] . get < xpu , 4 , real_t > ( s ) ; <nl> + } <nl> + switch ( size_ ) { <nl> + case 2 : <nl> + Assign ( out , req [ kOut ] , <nl> + concat < 1 > ( data [ kData0 ] , data [ kData1 ] ) ) ; <nl> + break ; <nl> + case 3 : <nl> + Assign ( out , req [ kOut ] , <nl> + concat < 1 > ( data [ kData0 ] , <nl> + concat < 1 > ( data [ kData1 ] , data [ kData2 ] ) ) ) ; <nl> + break ; <nl> + case 4 : <nl> + Assign ( out , req [ kOut ] , <nl> + concat < 1 > ( data [ kData0 ] , <nl> + concat < 1 > ( data [ kData1 ] , <nl> + concat < 1 > ( data [ kData2 ] , data [ kData3 ] ) ) ) ) ; <nl> + break ; <nl> + case 5 : <nl> + Assign ( out , req [ kOut ] , <nl> + concat < 1 > ( data [ kData0 ] , <nl> + concat < 1 > ( data [ kData1 ] , <nl> + concat < 1 > ( data [ kData2 ] , <nl> + concat < 1 > ( data [ kData3 ] , data [ kData4 ] ) ) ) ) ) ; <nl> + break ; <nl> + default : <nl> + LOG ( FATAL ) < < " Incorrect concat size_ : " < < size_ ; <nl> + } <nl> + } <nl> + <nl> + virtual void Backward ( const OpContext & ctx , <nl> + const std : : vector < TBlob > & out_grad , <nl> + const std : : vector < TBlob > & in_data , <nl> + const std : : vector < TBlob > & out_data , <nl> + const std : : vector < OpReqType > & req , <nl> + const std : : vector < TBlob > & in_grad , <nl> + const std : : vector < TBlob > & aux_states ) { <nl> + using namespace mshadow ; <nl> + using namespace mshadow : : expr ; <nl> + CHECK_EQ ( out_grad . size ( ) , 1 ) ; <nl> + CHECK_EQ ( in_grad . size ( ) , static_cast < size_t > ( size_ ) ) ; <nl> + Stream < xpu > * s = ctx . get_stream < xpu > ( ) ; <nl> + std : : vector < Tensor < xpu , 4 > > grad_in ; <nl> + Tensor < xpu , 4 > grad ; <nl> + if ( out_grad [ kOut ] . ndim ( ) = = 2 ) { <nl> + uint32_t dim = 0 ; <nl> + for ( int i = 0 ; i < size_ ; + + i ) { <nl> + uint32_t ds [ ] = { in_grad [ i ] . shape_ [ 0 ] , in_grad [ kData0 ] . shape_ [ 1 ] , 1 , 1 } ; <nl> + TShape dshape ( ds , ds + 4 ) ; <nl> + grad_in [ i ] = in_grad [ i ] . get_with_shape < xpu , 4 , real_t > ( dshape , s ) ; <nl> + dim + = in_grad [ kData0 ] . shape_ [ 1 ] ; <nl> + CHECK_EQ ( req [ i ] , kWriteTo ) ; <nl> + } <nl> + uint32_t ds_out [ ] = { in_data [ kData0 ] . shape_ [ 0 ] , dim , 1 , 1 } ; <nl> + TShape dshape_out ( ds_out , ds_out + 4 ) ; <nl> + grad = out_grad [ kOut ] . get_with_shape < xpu , 4 , real_t > ( dshape_out , s ) ; <nl> + } else { <nl> + for ( int i = 0 ; i < size_ ; + + i ) { <nl> + grad_in [ i ] = in_grad [ i ] . get < xpu , 4 , real_t > ( s ) ; <nl> + CHECK_EQ ( req [ i ] , kWriteTo ) ; <nl> + } <nl> + grad = out_grad [ kOut ] . get < xpu , 4 , real_t > ( s ) ; <nl> + } <nl> + switch ( size_ ) { <nl> + case 2 : <nl> + concat < 1 > ( grad_in [ kData0 ] , grad_in [ kData1 ] ) = grad ; <nl> + break ; <nl> + case 3 : <nl> + concat < 1 > ( grad_in [ kData0 ] , <nl> + concat < 1 > ( grad_in [ kData1 ] , grad_in [ kData2 ] ) ) = grad ; <nl> + break ; <nl> + case 4 : <nl> + concat < 1 > ( grad_in [ kData0 ] , <nl> + concat < 1 > ( grad_in [ kData1 ] , <nl> + concat < 1 > ( grad_in [ kData2 ] , grad_in [ kData3 ] ) ) ) = grad ; <nl> + break ; <nl> + case 5 : <nl> + concat < 1 > ( grad_in [ kData0 ] , <nl> + concat < 1 > ( grad_in [ kData1 ] , <nl> + concat < 1 > ( grad_in [ kData2 ] , <nl> + concat < 1 > ( grad_in [ kData3 ] , grad_in [ kData4 ] ) ) ) ) = grad ; <nl> + break ; <nl> + default : <nl> + LOG ( FATAL ) < < " Incorrect concat size_ : " < < size_ ; <nl> + } <nl> + } <nl> + <nl> + private : <nl> + int size_ ; <nl> + } ; / / class ConcatOp <nl> + <nl> + template < typename xpu > <nl> + Operator * CreateOp ( ConcatParam param ) ; <nl> + <nl> + # if DMLC_USE_CXX11 <nl> + class ConcatProp : public OperatorProperty { <nl> + public : <nl> + void Init ( const std : : vector < std : : pair < std : : string , std : : string > > & kwargs ) override { <nl> + param_ . Init ( kwargs ) ; <nl> + } <nl> + <nl> + std : : vector < std : : string > ListArguments ( ) const override { <nl> + std : : vector < std : : string > ret ; <nl> + for ( int i = 0 ; i < param_ . num_args ; + + i ) { <nl> + ret . push_back ( std : : string ( " arg " ) + static_cast < char > ( ' 0 ' + i ) ) ; <nl> + } <nl> + return ret ; <nl> + } <nl> + <nl> + bool InferShape ( std : : vector < TShape > * in_shape , <nl> + std : : vector < TShape > * out_shape , <nl> + std : : vector < TShape > * aux_shape ) const override { <nl> + using namespace mshadow ; <nl> + CHECK_EQ ( in_shape - > size ( ) , static_cast < size_t > ( param_ . num_args ) ) ; <nl> + TShape dshape = in_shape - > at ( kData0 ) ; <nl> + if ( dshape . ndim ( ) = = 0 ) return false ; <nl> + CHECK ( dshape . ndim ( ) > 1 ) ; <nl> + for ( int i = 1 ; i < param_ . size ; + + i ) { <nl> + const TShape & tmp = in_shape - > at ( i ) ; <nl> + if ( tmp . ndim ( ) = = 0 ) return false ; <nl> + for ( uint32_t j = 0 ; j < dshape . ndim ( ) ; + + j ) { <nl> + if ( j = = 1 ) { <nl> + dshape [ 1 ] + = tmp [ 1 ] ; <nl> + } else { <nl> + CHECK_EQ ( dshape [ j ] , tmp [ j ] ) ; <nl> + } <nl> + } <nl> + } <nl> + out_shape - > clear ( ) ; <nl> + out_shape - > push_back ( dshape ) ; <nl> + return true ; <nl> + } <nl> + <nl> + OperatorProperty * Copy ( ) const override { <nl> + auto ptr = new ConcatProp ( ) ; <nl> + ptr - > param_ = param_ ; <nl> + return ptr ; <nl> + } <nl> + <nl> + std : : string TypeString ( ) const override { <nl> + return " Concat " ; <nl> + } <nl> + <nl> + std : : vector < int > DeclareBackwardDependency ( <nl> + const std : : vector < int > & out_grad , <nl> + const std : : vector < int > & in_data , <nl> + const std : : vector < int > & out_data ) const override { <nl> + return out_grad ; <nl> + } <nl> + <nl> + std : : vector < std : : pair < int , void * > > BackwardInplaceOption ( <nl> + const std : : vector < int > & out_grad , <nl> + const std : : vector < int > & in_data , <nl> + const std : : vector < int > & out_data , <nl> + const std : : vector < void * > & in_grad ) const override { <nl> + std : : vector < std : : pair < int , void * > > ret ; <nl> + for ( int i = 0 ; i < param_ . num_args ; + + i ) { <nl> + ret . emplace_back ( in_data [ i ] , in_grad [ i ] ) ; <nl> + } <nl> + return ret ; <nl> + } <nl> + <nl> + Operator * CreateOperator ( Context ctx ) const ; <nl> + <nl> + private : <nl> + ConcatParam param_ ; <nl> + } ; / / class ConcatProp <nl> + # endif / / DMLC_USE_CXX11 <nl> + } / / namespace op <nl> + } / / namespace mxnet <nl> + <nl> + # endif / / MXNET_OPERATOR_CONCAT_INL_H_ <nl> new file mode 100644 <nl> index 00000000000 . . 72583266fe0 <nl> mmm / dev / null <nl> ppp b / src / operator / concat . cc <nl> <nl> + / * ! <nl> + * Copyright ( c ) 2015 by Contributors <nl> + * \ file concat . cc <nl> + * \ brief <nl> + * \ author Bing Xu <nl> + * / <nl> + <nl> + # include " . / concat - inl . h " <nl> + <nl> + namespace mxnet { <nl> + namespace op { <nl> + template < > <nl> + Operator * CreateOp < cpu > ( ConcatParam param ) { <nl> + return new ConcatOp < cpu > ( param ) ; <nl> + } <nl> + <nl> + Operator * ConcatProp : : CreateOperator ( Context ctx ) const { <nl> + DO_BIND_DISPATCH ( CreateOp , param_ ) ; <nl> + } <nl> + <nl> + DMLC_REGISTER_PARAMETER ( ConcatParam ) ; <nl> + <nl> + MXNET_REGISTER_OP_PROPERTY ( Concat , ConcatProp ) <nl> + . describe ( " Perform an feature concat over all the inputs . " ) <nl> + . add_arguments ( ConcatParam : : __FIELDS__ ( ) ) ; <nl> + <nl> + } / / namespace op <nl> + } / / namespace mxnet <nl> + <nl> new file mode 100644 <nl> index 00000000000 . . 4e24b45cc67 <nl> mmm / dev / null <nl> ppp b / src / operator / concat . cu <nl> <nl> + / * ! <nl> + * Copyright ( c ) 2015 by Contributors <nl> + * \ file concat . cu <nl> + * \ brief <nl> + * \ author Bing Xu <nl> + * / <nl> + <nl> + # include " . / concat - inl . h " <nl> + <nl> + namespace mxnet { <nl> + namespace op { <nl> + template < > <nl> + Operator * CreateOp < gpu > ( ConcatParam param ) { <nl> + return new ConcatOp < gpu > ( param ) ; <nl> + } <nl> + <nl> + } / / namespace op <nl> + } / / namespace mxnet <nl> + <nl> mmm a / src / operator / elementwise_sum - inl . h <nl> ppp b / src / operator / elementwise_sum - inl . h <nl> <nl> # include < vector > <nl> # include < utility > <nl> # include " . / operator_common . h " <nl> + # include " . / mshadow_op . h " <nl> <nl> namespace mxnet { <nl> namespace op { <nl> enum ElementWiseSumOpInputs { kData0 , kData1 , kData2 , kData3 } ; <nl> enum ElementWiseSumOpOutputs { kOut } ; <nl> <nl> struct ElementWiseSumParam : public dmlc : : Parameter < ElementWiseSumParam > { <nl> - int size ; <nl> + int num_args ; <nl> DMLC_DECLARE_PARAMETER ( ElementWiseSumParam ) { <nl> - DMLC_DECLARE_FIELD ( size ) . set_range ( 1 , 100 ) <nl> + DMLC_DECLARE_FIELD ( num_args ) . set_range ( 1 , 100 ) <nl> . describe ( " Number of inputs to be sumed . " ) ; <nl> } <nl> } ; <nl> template < typename xpu > <nl> class ElementWiseSumOp : public Operator { <nl> public : <nl> explicit ElementWiseSumOp ( ElementWiseSumParam param ) <nl> - : size_ ( param . size ) { } <nl> + : size_ ( param . num_args ) { } <nl> <nl> virtual void Forward ( const OpContext & ctx , <nl> const std : : vector < TBlob > & in_data , <nl> class ElementWiseSumOp : public Operator { <nl> } <nl> default : { <nl> Tensor < xpu , 2 > in_0 = in_data [ kData0 ] . FlatTo2D < xpu , real_t > ( s ) ; <nl> - Assign ( out , req [ kOut ] , in_0 ) ; <nl> - for ( int i = 0 ; i < size_ ; + + i ) { <nl> + Assign ( out , req [ kOut ] , F < mshadow_op : : identity > ( in_0 ) ) ; <nl> + for ( int i = 1 ; i < size_ ; + + i ) { <nl> out + = in_data [ i ] . FlatTo2D < xpu , real_t > ( s ) ; <nl> } <nl> + break ; <nl> } <nl> } <nl> } <nl> class ElementWiseSumOp : public Operator { <nl> const std : : vector < TBlob > & aux_args ) { <nl> using namespace mshadow ; <nl> using namespace mshadow : : expr ; <nl> - CHECK_EQ ( out_grad . size ( ) , static_cast < size_t > ( size_ ) ) ; <nl> + CHECK_EQ ( in_grad . size ( ) , static_cast < size_t > ( size_ ) ) ; <nl> Stream < xpu > * s = ctx . get_stream < xpu > ( ) ; <nl> Tensor < xpu , 2 > ograd = out_grad [ kOut ] . FlatTo2D < xpu , real_t > ( s ) ; <nl> - <nl> for ( int i = 0 ; i < size_ ; + + i ) { <nl> if ( req [ i ] = = kNullOp | | req [ i ] = = kWriteInplace ) continue ; <nl> Tensor < xpu , 2 > igrad = in_grad [ i ] . FlatTo2D < xpu , real_t > ( s ) ; <nl> - Assign ( igrad , req [ i ] , ograd ) ; <nl> + Assign ( igrad , req [ i ] , F < mshadow_op : : identity > ( ograd ) ) ; <nl> } <nl> } <nl> <nl> Operator * CreateOp ( ElementWiseSumParam param ) ; <nl> class ElementWiseSumProp : public OperatorProperty { <nl> public : <nl> void Init ( const std : : vector < std : : pair < std : : string , std : : string > > & kwargs ) override { <nl> - / / TODO ( bing ) change directly to vector of pairs begin end <nl> - std : : map < std : : string , std : : string > kmap ( kwargs . begin ( ) , kwargs . end ( ) ) ; <nl> - param_ . Init ( kmap ) ; <nl> + param_ . Init ( kwargs ) ; <nl> } <nl> <nl> bool InferShape ( std : : vector < TShape > * in_shape , <nl> - std : : vector < TShape > * out_shape , <nl> - std : : vector < TShape > * aux_shape ) const override { <nl> + std : : vector < TShape > * out_shape , <nl> + std : : vector < TShape > * aux_shape ) const override { <nl> using namespace mshadow ; <nl> - CHECK_EQ ( in_shape - > size ( ) , static_cast < size_t > ( param_ . size ) ) ; <nl> - const TShape & dshape = in_shape - > at ( 0 ) ; <nl> - if ( dshape . ndim ( ) = = 0 ) return false ; <nl> - for ( int i = 1 ; i < param_ . size ; + + i ) { <nl> - SHAPE_ASSIGN_CHECK ( * in_shape , i , dshape ) ; <nl> + CHECK_EQ ( in_shape - > size ( ) , static_cast < size_t > ( param_ . num_args ) ) ; <nl> + int sidx = - 1 ; <nl> + for ( int i = 0 ; i < param_ . num_args ; + + i ) { <nl> + if ( in_shape - > at ( i ) . ndim ( ) ! = 0 ) { <nl> + sidx = i ; break ; <nl> + } <nl> + } <nl> + if ( sidx = = - 1 ) return false ; <nl> + for ( int i = 0 ; i < param_ . num_args ; + + i ) { <nl> + if ( i ! = sidx ) { <nl> + SHAPE_ASSIGN_CHECK ( * in_shape , i , in_shape - > at ( sidx ) ) ; <nl> + } <nl> } <nl> out_shape - > clear ( ) ; <nl> - out_shape - > push_back ( dshape ) ; <nl> + out_shape - > push_back ( in_shape - > at ( sidx ) ) ; <nl> return true ; <nl> } <nl> <nl> + std : : vector < std : : string > ListArguments ( ) const override { <nl> + std : : vector < std : : string > ret ; <nl> + for ( int i = 0 ; i < param_ . num_args ; + + i ) { <nl> + ret . push_back ( std : : string ( " arg " ) + static_cast < char > ( ' 0 ' + i ) ) ; <nl> + } <nl> + return ret ; <nl> + } <nl> + <nl> OperatorProperty * Copy ( ) const override { <nl> auto ptr = new ElementWiseSumProp ( ) ; <nl> ptr - > param_ = param_ ; <nl> | add concat op | apache/incubator-mxnet | 15c17eaf1792ddba532ac4c1114a7a389e99d1ef | 2015-09-06T20:35:08Z |
mmm a / addons / skin . confluence / 720p / DialogPVRTimerSettings . xml <nl> ppp b / addons / skin . confluence / 720p / DialogPVRTimerSettings . xml <nl> <nl> < param name = " DialogBackgroundHeight " value = " 660 " / > <nl> < param name = " DialogHeaderWidth " value = " 650 " / > <nl> < param name = " DialogHeaderLabel " value = " $ LOCALIZE [ 19065 ] " / > <nl> - < param name = " DialogHeaderId " value = " 2 " / > <nl> + < param name = " DialogHeaderId " value = " 0 " / > <nl> < param name = " CloseButtonLeft " value = " 640 " / > <nl> < param name = " CloseButtonNav " value = " 10 " / > <nl> < / include > <nl> | [ Confluence ] fix header label | xbmc/xbmc | 739ca3dc9494f1d21adb12d8e51afd04345127ab | 2015-04-14T20:54:48Z |
mmm a / tensorflow / tensorboard / components / tf_graph / tf - graph - scene . html <nl> ppp b / tensorflow / tensorboard / components / tf_graph / tf - graph - scene . html <nl> <nl> : : content . input - edge - highlight > text { <nl> fill : black ! important ; <nl> } <nl> - : : content . input - edge - highlight > path , <nl> : : content . input - highlight > . in - annotations > . annotation > . annotation - edge , <nl> : : content . input - highlight - selected > . in - annotations > . annotation > <nl> . annotation - edge { <nl> | Make reference edges stay orange in trace inputs mode . | tensorflow/tensorflow | 08b26581c12b724c3f734e43622c78070063b4cd | 2017-06-15T04:04:25Z |
mmm a / tensorflow / python / kernel_tests / control_flow_ops_py_test . py <nl> ppp b / tensorflow / python / kernel_tests / control_flow_ops_py_test . py <nl> def testSparseEnterExit ( self ) : <nl> self . assertAllEqual ( st1 . values , st3 . values ) <nl> self . assertAllEqual ( st1 . dense_shape , st3 . dense_shape ) <nl> <nl> + def _buildWhileWithShapeInvariants ( self , shape_invariants ) : <nl> + r = constant_op . constant ( [ 1 , 2 ] ) <nl> + <nl> + def cond ( _ ) : <nl> + return False <nl> + <nl> + def body ( _ ) : <nl> + return constant_op . constant ( [ 1 ] ) <nl> + <nl> + return control_flow_ops . while_loop ( <nl> + cond , body , [ r ] , shape_invariants = shape_invariants ) <nl> + <nl> + def testWhileOutputShapeWithShapeInvariantsUnknownRank ( self ) : <nl> + @ def_function . function <nl> + def runTest ( ) : <nl> + while_output = self . _buildWhileWithShapeInvariants ( <nl> + [ tensor_shape . TensorShape ( None ) ] ) <nl> + self . assertIsNone ( while_output . shape . rank ) <nl> + runTest ( ) <nl> + <nl> + def testWhileOutputShapeWithShapeInvariantsPartialShape ( self ) : <nl> + @ def_function . function <nl> + def runTest ( ) : <nl> + while_output = self . _buildWhileWithShapeInvariants ( <nl> + [ tensor_shape . TensorShape ( [ None ] ) ] ) <nl> + self . assertAllEqual ( while_output . shape . as_list ( ) , [ None ] ) <nl> + runTest ( ) <nl> + <nl> <nl> class ControlFlowContextCheckTest ( test . TestCase ) : <nl> <nl> mmm a / tensorflow / python / ops / while_v2 . py <nl> ppp b / tensorflow / python / ops / while_v2 . py <nl> def wrapped_body ( loop_counter , maximum_iterations_arg , * args ) : <nl> <nl> with ops . control_dependencies ( <nl> list ( cond_graph . control_captures ) + list ( body_graph . control_captures ) ) : <nl> + output_shapes = [ t . shape for t in body_graph . outputs ] <nl> + orig_loop_vars_range = slice ( first_loop_var_index , <nl> + first_loop_var_index + num_flattened_outputs ) <nl> + output_shapes [ orig_loop_vars_range ] = nest . flatten ( <nl> + shape_invariants , expand_composites = True ) [ orig_loop_vars_range ] <nl> outputs = gen_functional_ops . _while ( <nl> flattened_loop_vars , <nl> util . create_new_tf_function ( cond_graph ) , <nl> util . create_new_tf_function ( body_graph ) , <nl> - output_shapes = [ t . shape for t in body_graph . outputs ] , <nl> + output_shapes = output_shapes , <nl> parallel_iterations = parallel_iterations , <nl> name = scope ) <nl> <nl> | Fix the output shapes of While op when shape invariants are specified . | tensorflow/tensorflow | cfa66a0e7a03da1bf1725c1cf15dc118e7ac6a5c | 2019-05-20T21:43:37Z |
mmm a / modules / core / include / opencv2 / core / types . hpp <nl> ppp b / modules / core / include / opencv2 / core / types . hpp <nl> template < typename _Tp > class Point3_ <nl> / / ! conversion to another data type <nl> template < typename _Tp2 > operator Point3_ < _Tp2 > ( ) const ; <nl> / / ! conversion to cv : : Vec < > <nl> + # if OPENCV_ABI_COMPATIBILITY > 300 <nl> + template < typename _Tp2 > operator Vec < _Tp2 , 3 > ( ) const ; <nl> + # else <nl> operator Vec < _Tp , 3 > ( ) const ; <nl> + # endif <nl> <nl> / / ! dot product <nl> _Tp dot ( const Point3_ & pt ) const ; <nl> Point3_ < _Tp > : : operator Point3_ < _Tp2 > ( ) const <nl> return Point3_ < _Tp2 > ( saturate_cast < _Tp2 > ( x ) , saturate_cast < _Tp2 > ( y ) , saturate_cast < _Tp2 > ( z ) ) ; <nl> } <nl> <nl> + # if OPENCV_ABI_COMPATIBILITY > 300 <nl> + template < typename _Tp > template < typename _Tp2 > inline <nl> + Point3_ < _Tp > : : operator Vec < _Tp2 , 3 > ( ) const <nl> + { <nl> + return Vec < _Tp2 , 3 > ( x , y , z ) ; <nl> + } <nl> + # else <nl> template < typename _Tp > inline <nl> Point3_ < _Tp > : : operator Vec < _Tp , 3 > ( ) const <nl> { <nl> return Vec < _Tp , 3 > ( x , y , z ) ; <nl> } <nl> + # endif <nl> <nl> template < typename _Tp > inline <nl> Point3_ < _Tp > & Point3_ < _Tp > : : operator = ( const Point3_ & pt ) <nl> mmm a / samples / cpp / CMakeLists . txt <nl> ppp b / samples / cpp / CMakeLists . txt <nl> if ( BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND ) <nl> endif ( ) <nl> <nl> if ( CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS ) <nl> - set ( CMAKE_C_FLAGS " $ { CMAKE_C_FLAGS } - Wno - unused - function " ) <nl> + set ( CMAKE_C_FLAGS " $ { CMAKE_C_FLAGS } - Wno - unused - function - Wno - missing - declarations " ) <nl> + set ( CMAKE_CXX_FLAGS " $ { CMAKE_CXX_FLAGS } - Wno - unused - function - Wno - missing - declarations " ) <nl> endif ( ) <nl> <nl> # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> if ( BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND ) <nl> ocv_target_link_libraries ( $ { the_target } opencv_cudaarithm opencv_cudafilters ) <nl> endif ( ) <nl> <nl> - if ( HAVE_opencv_ocl ) <nl> - ocv_target_link_libraries ( $ { the_target } opencv_ocl ) <nl> + if ( " $ { srcs } " MATCHES " viz / " AND VTK_USE_FILE ) <nl> + include ( $ { VTK_USE_FILE } ) <nl> + ocv_target_link_libraries ( $ { the_target } $ { VTK_LIBRARIES } ) <nl> + add_definitions ( - DUSE_VTK ) <nl> endif ( ) <nl> <nl> set_target_properties ( $ { the_target } PROPERTIES <nl> if ( BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND ) <nl> ocv_list_filterout ( cpp_samples " / gpu / " ) <nl> endif ( ) <nl> <nl> - ocv_list_filterout ( cpp_samples " viz " ) <nl> + if ( NOT TARGET opencv_viz ) <nl> + ocv_list_filterout ( cpp_samples " / viz / " ) <nl> + endif ( ) <nl> <nl> if ( NOT HAVE_IPP_A ) <nl> ocv_list_filterout ( cpp_samples " / ippasync / " ) <nl> mmm a / samples / cpp / tutorial_code / viz / creating_widgets . cpp <nl> ppp b / samples / cpp / tutorial_code / viz / creating_widgets . cpp <nl> <nl> * @ author Ozan Cagri Tonkal <nl> * / <nl> <nl> + # ifndef USE_VTK <nl> + # include < iostream > <nl> + int main ( ) <nl> + { <nl> + std : : cout < < " This sample requires direct compilation with VTK . Stop " < < std : : endl ; <nl> + return 0 ; <nl> + } <nl> + # else <nl> # include < opencv2 / viz . hpp > <nl> # include < opencv2 / viz / widget_accessor . hpp > <nl> # include < iostream > <nl> int main ( ) <nl> <nl> return 0 ; <nl> } <nl> + # endif <nl> mmm a / samples / cpp / tutorial_code / viz / launching_viz . cpp <nl> ppp b / samples / cpp / tutorial_code / viz / launching_viz . cpp <nl> int main ( ) <nl> cout < < " First event loop is over " < < endl ; <nl> <nl> / / / Access window via its name <nl> - viz : : Viz3d sameWindow = viz : : get ( " Viz Demo " ) ; <nl> + viz : : Viz3d sameWindow = viz : : getWindowByName ( " Viz Demo " ) ; <nl> <nl> / / / Start event loop <nl> sameWindow . spin ( ) ; <nl> | Merge pull request from alalek : viz_samples | opencv/opencv | 7dc5332a92f4843321d0b1c2039d881deda48999 | 2016-07-01T15:27:01Z |
mmm a / lib / Parse / ParseSIL . cpp <nl> ppp b / lib / Parse / ParseSIL . cpp <nl> bool SILParser : : parseSILInstruction ( SILBasicBlock * BB ) { <nl> return true ; <nl> <nl> / / Parse the type for SILDeclRef . <nl> + Optional < Scope > GenericsScope ; <nl> + GenericsScope . emplace ( & P , ScopeKind : : Generics ) ; <nl> ParserResult < TypeRepr > TyR = P . parseType ( ) ; <nl> + GenericsScope . reset ( ) ; <nl> if ( TyR . isNull ( ) ) <nl> return true ; <nl> TypeLoc Ty = TyR . get ( ) ; <nl> mmm a / test / SIL / Parser / basic . sil <nl> ppp b / test / SIL / Parser / basic . sil <nl> bb0 ( % 0 : $ * P ) : <nl> <nl> / / CHECK : protocol_method { { . * } } : $ * P , # P . doIt ! 1 <nl> % 2 = protocol_method % 0 : $ * P , # P . doIt ! 1 : < Self : P > inout Self - > ( ) - > ( ) , $ @ cc ( witness_method ) ( @ inout @ sil_self P ) - > ( ) <nl> + / / Make sure we have the correct scope for generic parameters . <nl> + / / CHECK : protocol_method { { . * } } : $ * P , # P . doIt ! 1 <nl> + % 7 = protocol_method % 0 : $ * P , # P . doIt ! 1 : < Self : P > inout Self - > ( ) - > ( ) , $ @ cc ( witness_method ) ( @ inout @ sil_self P ) - > ( ) <nl> / / CHECK : apply <nl> % 3 = apply % 2 ( % 1 ) : $ @ cc ( witness_method ) ( @ inout @ sil_self P ) - > ( ) <nl> % 4 = tuple ( ) / / CHECK : tuple ( ) <nl> | [ SILParser ] use generics scope when parsing types in protocol_method . | apple/swift | c94b5cdf6be8df3f1e3a2bd5101918054cb79090 | 2014-08-11T18:23:10Z |
mmm a / xbmc / cores / VideoPlayer / DVDSubtitles / DVDSubtitlesLibass . cpp <nl> ppp b / xbmc / cores / VideoPlayer / DVDSubtitles / DVDSubtitlesLibass . cpp <nl> bool CDVDSubtitlesLibass : : CreateTrack ( char * buf , size_t size ) <nl> return true ; <nl> } <nl> <nl> - ASS_Image * CDVDSubtitlesLibass : : RenderImage ( int frameWidth , int frameHeight , int videoWidth , int videoHeight , double pts , int useMargin , double position , int * changes ) <nl> + ASS_Image * CDVDSubtitlesLibass : : RenderImage ( int frameWidth , int frameHeight , int videoWidth , int videoHeight , int sourceWidth , int sourceHeight , <nl> + double pts , int useMargin , double position , int * changes ) <nl> { <nl> CSingleLock lock ( m_section ) ; <nl> if ( ! m_renderer | | ! m_track ) <nl> ASS_Image * CDVDSubtitlesLibass : : RenderImage ( int frameWidth , int frameHeight , int <nl> return NULL ; <nl> } <nl> <nl> - double storage_aspect = ( double ) frameWidth / frameHeight ; <nl> + double sar = ( double ) sourceWidth / sourceHeight ; <nl> + double dar = ( double ) videoWidth / videoHeight ; <nl> ass_set_frame_size ( m_renderer , frameWidth , frameHeight ) ; <nl> int topmargin = ( frameHeight - videoHeight ) / 2 ; <nl> int leftmargin = ( frameWidth - videoWidth ) / 2 ; <nl> ass_set_margins ( m_renderer , topmargin , topmargin , leftmargin , leftmargin ) ; <nl> ass_set_use_margins ( m_renderer , useMargin ) ; <nl> ass_set_line_position ( m_renderer , position ) ; <nl> - ass_set_aspect_ratio ( m_renderer , storage_aspect / CServiceBroker : : GetWinSystem ( ) - > GetGfxContext ( ) . GetResInfo ( ) . fPixelRatio , storage_aspect ) ; <nl> + ass_set_aspect_ratio ( m_renderer , dar , sar ) ; <nl> return ass_render_frame ( m_renderer , m_track , DVD_TIME_TO_MSEC ( pts ) , changes ) ; <nl> } <nl> <nl> mmm a / xbmc / cores / VideoPlayer / DVDSubtitles / DVDSubtitlesLibass . h <nl> ppp b / xbmc / cores / VideoPlayer / DVDSubtitles / DVDSubtitlesLibass . h <nl> class CDVDSubtitlesLibass : public IDVDResourceCounted < CDVDSubtitlesLibass > <nl> CDVDSubtitlesLibass ( ) ; <nl> ~ CDVDSubtitlesLibass ( ) override ; <nl> <nl> - ASS_Image * RenderImage ( int frameWidth , int frameHeight , int videoWidth , int videoHeight , double pts , int useMargin = 0 , double position = 0 . 0 , int * changes = NULL ) ; <nl> + ASS_Image * RenderImage ( int frameWidth , int frameHeight , int videoWidth , int videoHeight , int sourceWidth , int sourceHeight , <nl> + double pts , int useMargin = 0 , double position = 0 . 0 , int * changes = NULL ) ; <nl> ASS_Event * GetEvents ( ) ; <nl> <nl> int GetNrOfEvents ( ) ; <nl> mmm a / xbmc / cores / VideoPlayer / VideoRenderers / OverlayRenderer . cpp <nl> ppp b / xbmc / cores / VideoPlayer / VideoRenderers / OverlayRenderer . cpp <nl> COverlay * CRenderer : : Convert ( CDVDOverlaySSA * o , double pts ) <nl> / / libass render in a target area which named as frame . the frame size may bigger than video size , <nl> / / and including margins between video to frame edge . libass allow to render subtitles into the margins . <nl> / / this has been used to show subtitles in the top or bottom " black bar " between video to frame border . <nl> + int sourceWidth = MathUtils : : round_int ( m_rs . Width ( ) ) ; <nl> + int sourceHeight = MathUtils : : round_int ( m_rs . Height ( ) ) ; <nl> int videoWidth = MathUtils : : round_int ( m_rd . Width ( ) ) ; <nl> int videoHeight = MathUtils : : round_int ( m_rd . Height ( ) ) ; <nl> int targetWidth = MathUtils : : round_int ( m_rv . Width ( ) ) ; <nl> COverlay * CRenderer : : Convert ( CDVDOverlaySSA * o , double pts ) <nl> else <nl> position = 0 . 0 ; <nl> int changes = 0 ; <nl> - ASS_Image * images = o - > m_libass - > RenderImage ( targetWidth , targetHeight , videoWidth , videoHeight , pts , useMargin , position , & changes ) ; <nl> + ASS_Image * images = o - > m_libass - > RenderImage ( targetWidth , targetHeight , videoWidth , videoHeight , sourceWidth , sourceHeight , <nl> + pts , useMargin , position , & changes ) ; <nl> <nl> if ( o - > m_textureid ) <nl> { <nl> | VideoPlayer : fix aspec ratio of libass subs | xbmc/xbmc | d6f05b20944a52e42271e20d5f32961a79d9da4f | 2018-07-24T18:25:20Z |
mmm a / source / extensions / filters / network / kafka / protocol / generator . py <nl> ppp b / source / extensions / filters / network / kafka / protocol / generator . py <nl> def compute_declaration_chain ( self ) : <nl> return self . underlying . compute_declaration_chain ( ) <nl> <nl> def deserializer_name_in_version ( self , version , compact ) : <nl> - return ' % sArrayDeserializer < % s , % s > ' % ( " Compact " if compact else " " , self . underlying . name , <nl> - self . underlying . deserializer_name_in_version ( <nl> - version , compact ) ) <nl> + # For arrays , deserializer name is ( Compact ) ( Nullable ) ArrayDeserializer < ElementDeserializer > . <nl> + element_deserializer_name = self . underlying . deserializer_name_in_version ( version , compact ) <nl> + return ' % sArrayDeserializer < % s > ' % ( " Compact " if compact else " " , element_deserializer_name ) <nl> <nl> def default_value ( self ) : <nl> return ' std : : vector < % s > { } ' % ( self . underlying . name ) <nl> mmm a / source / extensions / filters / network / kafka / serialization . h <nl> ppp b / source / extensions / filters / network / kafka / serialization . h <nl> namespace Kafka { <nl> * / <nl> template < typename T > class Deserializer { <nl> public : <nl> + / * * <nl> + * The type this deserializer is deserializing . <nl> + * / <nl> + typedef T result_type ; <nl> + <nl> virtual ~ Deserializer ( ) = default ; <nl> <nl> / * * <nl> class NullableBytesDeserializer : public Deserializer < NullableBytes > { <nl> * First reads the length of the array , then initializes N underlying deserializers of type <nl> * DeserializerType . After the last of N deserializers is ready , the results of each of them are <nl> * gathered and put in a vector . <nl> - * @ param ResponseType result type returned by deserializer of type DeserializerType . <nl> * @ param DeserializerType underlying deserializer type . <nl> * <nl> * From Kafka documentation : <nl> class NullableBytesDeserializer : public Deserializer < NullableBytes > { <nl> * STRING ) or a structure . First , the length N is given as an int32_t . Then N instances of type T <nl> * follow . A null array is represented with a length of - 1 . <nl> * / <nl> - template < typename ResponseType , typename DeserializerType > <nl> - class ArrayDeserializer : public Deserializer < std : : vector < ResponseType > > { <nl> + template < typename DeserializerType > <nl> + class ArrayDeserializer : public Deserializer < std : : vector < typename DeserializerType : : result_type > > { <nl> public : <nl> + using ResponseType = typename DeserializerType : : result_type ; <nl> + <nl> / * * <nl> * Can throw EnvoyException if array length is invalid or if underlying deserializer can throw . <nl> * / <nl> class ArrayDeserializer : public Deserializer < std : : vector < ResponseType > > { <nl> * First reads the length of the array , then initializes N underlying deserializers of type <nl> * DeserializerType . After the last of N deserializers is ready , the results of each of them are <nl> * gathered and put in a vector . <nl> - * @ param ResponseType result type returned by deserializer of type DeserializerType . <nl> * @ param DeserializerType underlying deserializer type . <nl> * <nl> * From Kafka documentation : <nl> class ArrayDeserializer : public Deserializer < std : : vector < ResponseType > > { <nl> * STRING ) or a structure . First , the length N + 1 is given as an UNSIGNED_VARINT . Then N instances <nl> * of type T follow . A null array is represented with a length of 0 . <nl> * / <nl> - template < typename ResponseType , typename DeserializerType > <nl> - class CompactArrayDeserializer : public Deserializer < std : : vector < ResponseType > > { <nl> + template < typename DeserializerType > <nl> + class CompactArrayDeserializer <nl> + : public Deserializer < std : : vector < typename DeserializerType : : result_type > > { <nl> public : <nl> + using ResponseType = typename DeserializerType : : result_type ; <nl> + <nl> / * * <nl> * Can throw EnvoyException if array length is invalid or if underlying deserializer can throw . <nl> * / <nl> class CompactArrayDeserializer : public Deserializer < std : : vector < ResponseType > > <nl> * First reads the length of the array , then initializes N underlying deserializers of type <nl> * DeserializerType . After the last of N deserializers is ready , the results of each of them are <nl> * gathered and put in a vector . <nl> - * @ param ResponseType result type returned by deserializer of type DeserializerType . <nl> * @ param DeserializerType underlying deserializer type . <nl> * <nl> * From Kafka documentation : <nl> class CompactArrayDeserializer : public Deserializer < std : : vector < ResponseType > > <nl> * STRING ) or a structure . First , the length N is given as an int32_t . Then N instances of type T <nl> * follow . A null array is represented with a length of - 1 . <nl> * / <nl> - template < typename ResponseType , typename DeserializerType > <nl> - class NullableArrayDeserializer : public Deserializer < NullableArray < ResponseType > > { <nl> + template < typename DeserializerType > <nl> + class NullableArrayDeserializer <nl> + : public Deserializer < NullableArray < typename DeserializerType : : result_type > > { <nl> public : <nl> + using ResponseType = typename DeserializerType : : result_type ; <nl> + <nl> / * * <nl> * Can throw EnvoyException if array length is invalid or if underlying deserializer can throw . <nl> * / <nl> class NullableArrayDeserializer : public Deserializer < NullableArray < ResponseType <nl> * First reads the length of the array , then initializes N underlying deserializers of type <nl> * DeserializerType . After the last of N deserializers is ready , the results of each of them are <nl> * gathered and put in a vector . <nl> - * @ param ResponseType result type returned by deserializer of type DeserializerType . <nl> * @ param DeserializerType underlying deserializer type . <nl> * <nl> * From Kafka documentation : <nl> class NullableArrayDeserializer : public Deserializer < NullableArray < ResponseType <nl> * STRING ) or a structure . First , the length N + 1 is given as an UNSIGNED_VARINT . Then N instances <nl> * of type T follow . A null array is represented with a length of 0 . <nl> * / <nl> - template < typename ResponseType , typename DeserializerType > <nl> - class NullableCompactArrayDeserializer : public Deserializer < NullableArray < ResponseType > > { <nl> + template < typename DeserializerType > <nl> + class NullableCompactArrayDeserializer <nl> + : public Deserializer < NullableArray < typename DeserializerType : : result_type > > { <nl> public : <nl> + using ResponseType = typename DeserializerType : : result_type ; <nl> + <nl> / * * <nl> * Can throw EnvoyException if array length is invalid or if underlying deserializer can throw . <nl> * / <nl> mmm a / test / extensions / filters / network / kafka / serialization_test . cc <nl> ppp b / test / extensions / filters / network / kafka / serialization_test . cc <nl> TEST_EmptyDeserializerShouldNotBeReady ( NullableBytesDeserializer ) ; <nl> <nl> TEST ( ArrayDeserializer , EmptyBufferShouldNotBeReady ) { <nl> / / given <nl> - const ArrayDeserializer < int8_t , Int8Deserializer > testee { } ; <nl> + const ArrayDeserializer < Int8Deserializer > testee { } ; <nl> / / when , then <nl> ASSERT_EQ ( testee . ready ( ) , false ) ; <nl> } <nl> <nl> TEST ( CompactArrayDeserializer , EmptyBufferShouldNotBeReady ) { <nl> / / given <nl> - const CompactArrayDeserializer < int32_t , Int32Deserializer > testee { } ; <nl> + const CompactArrayDeserializer < Int32Deserializer > testee { } ; <nl> / / when , then <nl> ASSERT_EQ ( testee . ready ( ) , false ) ; <nl> } <nl> <nl> TEST ( NullableArrayDeserializer , EmptyBufferShouldNotBeReady ) { <nl> / / given <nl> - const NullableArrayDeserializer < int8_t , Int8Deserializer > testee { } ; <nl> + const NullableArrayDeserializer < Int8Deserializer > testee { } ; <nl> / / when , then <nl> ASSERT_EQ ( testee . ready ( ) , false ) ; <nl> } <nl> <nl> TEST ( NullableCompactArrayDeserializer , EmptyBufferShouldNotBeReady ) { <nl> / / given <nl> - const NullableCompactArrayDeserializer < int32_t , Int32Deserializer > testee { } ; <nl> + const NullableCompactArrayDeserializer < Int32Deserializer > testee { } ; <nl> / / when , then <nl> ASSERT_EQ ( testee . ready ( ) , false ) ; <nl> } <nl> TEST ( NullableBytesDeserializer , ShouldThrowOnInvalidLength ) { <nl> <nl> TEST ( ArrayDeserializer , ShouldConsumeCorrectAmountOfData ) { <nl> const std : : vector < std : : string > value { { " aaa " , " bbbbb " , " cc " , " d " , " e " , " ffffffff " } } ; <nl> - serializeThenDeserializeAndCheckEquality < ArrayDeserializer < std : : string , StringDeserializer > > ( <nl> - value ) ; <nl> + serializeThenDeserializeAndCheckEquality < ArrayDeserializer < StringDeserializer > > ( value ) ; <nl> } <nl> <nl> TEST ( ArrayDeserializer , ShouldThrowOnInvalidLength ) { <nl> / / given <nl> - ArrayDeserializer < std : : string , StringDeserializer > testee ; <nl> + ArrayDeserializer < StringDeserializer > testee ; <nl> Buffer : : OwnedImpl buffer ; <nl> <nl> const int32_t len = - 1 ; / / ARRAY accepts length > = 0 . <nl> TEST ( ArrayDeserializer , ShouldThrowOnInvalidLength ) { <nl> <nl> TEST ( CompactArrayDeserializer , ShouldConsumeCorrectAmountOfData ) { <nl> const std : : vector < int32_t > value { { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 } } ; <nl> - serializeCompactThenDeserializeAndCheckEquality < <nl> - CompactArrayDeserializer < int32_t , Int32Deserializer > > ( value ) ; <nl> + serializeCompactThenDeserializeAndCheckEquality < CompactArrayDeserializer < Int32Deserializer > > ( <nl> + value ) ; <nl> } <nl> <nl> TEST ( CompactArrayDeserializer , ShouldThrowOnInvalidLength ) { <nl> / / given <nl> - CompactArrayDeserializer < int8_t , Int8Deserializer > testee ; <nl> + CompactArrayDeserializer < Int8Deserializer > testee ; <nl> Buffer : : OwnedImpl buffer ; <nl> <nl> const uint32_t len = 0 ; / / COMPACT_ARRAY accepts length > = 1 . <nl> TEST ( CompactArrayDeserializer , ShouldThrowOnInvalidLength ) { <nl> <nl> TEST ( NullableArrayDeserializer , ShouldConsumeCorrectAmountOfData ) { <nl> const NullableArray < std : : string > value { { " aaa " , " bbbbb " , " cc " , " d " , " e " , " ffffffff " } } ; <nl> - serializeThenDeserializeAndCheckEquality < <nl> - NullableArrayDeserializer < std : : string , StringDeserializer > > ( value ) ; <nl> + serializeThenDeserializeAndCheckEquality < NullableArrayDeserializer < StringDeserializer > > ( value ) ; <nl> } <nl> <nl> TEST ( NullableArrayDeserializer , ShouldConsumeNullArray ) { <nl> const NullableArray < std : : string > value = absl : : nullopt ; <nl> - serializeThenDeserializeAndCheckEquality < <nl> - NullableArrayDeserializer < std : : string , StringDeserializer > > ( value ) ; <nl> + serializeThenDeserializeAndCheckEquality < NullableArrayDeserializer < StringDeserializer > > ( value ) ; <nl> } <nl> <nl> TEST ( NullableArrayDeserializer , ShouldThrowOnInvalidLength ) { <nl> / / given <nl> - NullableArrayDeserializer < std : : string , StringDeserializer > testee ; <nl> + NullableArrayDeserializer < StringDeserializer > testee ; <nl> Buffer : : OwnedImpl buffer ; <nl> <nl> const int32_t len = - 2 ; / / - 1 is OK for NULLABLE_ARRAY . <nl> TEST ( NullableArrayDeserializer , ShouldThrowOnInvalidLength ) { <nl> TEST ( NullableCompactArrayDeserializer , ShouldConsumeCorrectAmountOfData ) { <nl> const NullableArray < int32_t > value { { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 } } ; <nl> serializeCompactThenDeserializeAndCheckEquality < <nl> - NullableCompactArrayDeserializer < int32_t , Int32Deserializer > > ( value ) ; <nl> + NullableCompactArrayDeserializer < Int32Deserializer > > ( value ) ; <nl> } <nl> <nl> TEST ( NullableCompactArrayDeserializer , ShouldConsumeNullArray ) { <nl> const NullableArray < int32_t > value = absl : : nullopt ; <nl> serializeCompactThenDeserializeAndCheckEquality < <nl> - NullableCompactArrayDeserializer < int32_t , Int32Deserializer > > ( value ) ; <nl> + NullableCompactArrayDeserializer < Int32Deserializer > > ( value ) ; <nl> } <nl> <nl> / / Tagged fields . <nl> | kafka : simplify declaration of ArrayDeserializer ( ) | envoyproxy/envoy | 04de407bf5314063bf09f7e359d6d9881f3545bf | 2020-02-20T17:42:52Z |
mmm a / Reverse_word_string . py <nl> ppp b / Reverse_word_string . py <nl> <nl> l = [ ] <nl> for i in range ( len ( m ) ) : <nl> if ( m [ i ] ! = " " ) : <nl> - s1 = s1 + m [ i ] <nl> + s1 + = m [ i ] <nl> else : <nl> l . append ( s1 ) <nl> s1 = " " <nl> | Update Reverse_word_string . py | OpenGenus/cosmos | 68bfb9598d558f97660c5dcc37a318e6fbc91517 | 2020-03-26T13:26:56Z |
mmm a / hphp / hack / src / hhbc / emit_statement . ml <nl> ppp b / hphp / hack / src / hhbc / emit_statement . ml <nl> let rec from_stmt st = <nl> | A . Foreach ( collection , await_pos , iterator , block ) - > <nl> from_foreach ( await_pos < > None ) collection iterator <nl> ( A . Block block ) <nl> + | A . Def_inline _ - > <nl> + emit_nyi " Def_inline " <nl> | A . Static_var es - > <nl> emit_static_var es <nl> ( * TODO : What do we do with unsafe ? * ) <nl> mmm a / hphp / hack / src / naming / naming . ml <nl> ppp b / hphp / hack / src / naming / naming . ml <nl> module Make ( GetLocals : GetLocals ) = struct <nl> | Switch ( e , cl ) - > switch_stmt env st e cl <nl> | Foreach ( e , aw , ae , b ) - > foreach_stmt env e aw ae b <nl> | Try ( b , cl , fb ) - > try_stmt env st b cl fb <nl> + | Def_inline _ - > <nl> + failwith " Naming of inlined definitions not ( yet ) supported . " <nl> | Expr ( cp , Call ( ( p , Id ( fp , fn ) ) , el , uel ) ) <nl> when fn = SN . SpecialFunctions . invariant - > <nl> ( * invariant is subject to a source - code transform in the HHVM <nl> mmm a / hphp / hack / src / parser / ast . ml <nl> ppp b / hphp / hack / src / parser / ast . ml <nl> and stmt = <nl> | Switch of expr * case list <nl> | Foreach of expr * Pos . t option ( * await as * ) * as_expr * block <nl> | Try of block * catch list * block <nl> + | Def_inline of def <nl> | Noop <nl> <nl> and as_expr = <nl> mmm a / hphp / hack / src / parser / ast_visitor . ml <nl> ppp b / hphp / hack / src / parser / ast_visitor . ml <nl> class type [ ' a ] ast_visitor_type = object <nl> method on_collection : ' a - > id - > afield list - > ' a <nl> method on_continue : ' a - > Pos . t - > ' a <nl> method on_darray : ' a - > ( expr * expr ) list - > ' a <nl> + method on_def_inline : ' a - > def - > ' a <nl> method on_do : ' a - > block - > expr - > ' a <nl> method on_efun : ' a - > fun_ - > ( id * bool ) list - > ' a <nl> method on_eif : ' a - > expr - > expr option - > expr - > ' a <nl> class virtual [ ' a ] ast_visitor : [ ' a ] ast_visitor_type = object ( this ) <nl> | Switch ( e , cl ) - > this # on_switch acc e cl <nl> | Foreach ( e , popt , ae , b ) - > this # on_foreach acc e popt ae b <nl> | Try ( b , cl , fb ) - > this # on_try acc b cl fb <nl> + | Def_inline d - > <nl> + this # on_def_inline acc d <nl> | Noop - > this # on_noop acc <nl> | Fallthrough - > this # on_fallthrough acc <nl> | Static_var el - > this # on_static_var acc el <nl> <nl> + method on_def_inline acc d = <nl> + this # on_def acc d <nl> + <nl> method on_expr acc ( _ , e ) = <nl> this # on_expr_ acc e <nl> <nl> mmm a / hphp / hack / src / parser / ast_visitors_endo . ml <nl> ppp b / hphp / hack / src / parser / ast_visitors_endo . ml <nl> class virtual [ ' self ] endo = <nl> if c0 = = r0 & & c1 = = r1 & & c2 = = r2 <nl> then this <nl> else Try ( r0 , r1 , r2 ) <nl> + method on_Def_inline env this c0 = <nl> + let r0 = self # on_def env c0 in <nl> + if c0 = = r0 <nl> + then this <nl> + else Def_inline r0 <nl> method on_Noop env this = this <nl> method on_stmt env this = <nl> match this with <nl> class virtual [ ' self ] endo = <nl> | Foreach ( c0 , c1 , c2 , c3 ) as this - > <nl> self # on_Foreach env this c0 c1 c2 c3 <nl> | Try ( c0 , c1 , c2 ) - > self # on_Try env this c0 c1 c2 <nl> + | Def_inline c0 - > <nl> + self # on_Def_inline env this c0 <nl> | Noop - > self # on_Noop env this <nl> method on_As_v env this c0 = <nl> let r0 = self # on_expr env c0 in <nl> mmm a / hphp / hack / src / parser / ast_visitors_endo . mli <nl> ppp b / hphp / hack / src / parser / ast_visitors_endo . mli <nl> class virtual [ ' b ] endo : <nl> on_Ctrait : ' c - > <nl> Ast_visitors_ancestors . class_kind - > <nl> Ast_visitors_ancestors . class_kind ; <nl> + on_Def_inline : ' c - > <nl> + Ast_visitors_ancestors . stmt - > <nl> + Ast_visitors_ancestors . def - > <nl> + Ast_visitors_ancestors . stmt ; <nl> on_Default : ' c - > <nl> Ast_visitors_ancestors . case - > <nl> Ast_visitors_ancestors . block - > <nl> class virtual [ ' b ] endo : <nl> method on_Ctrait : <nl> ' c - > <nl> Ast_visitors_ancestors . class_kind - > Ast_visitors_ancestors . class_kind <nl> + method on_Def_inline : <nl> + ' c - > <nl> + Ast_visitors_ancestors . stmt - > <nl> + Ast_visitors_ancestors . def - > Ast_visitors_ancestors . stmt <nl> method on_Default : <nl> ' c - > <nl> Ast_visitors_ancestors . case - > <nl> mmm a / hphp / hack / src / parser / ast_visitors_iter . ml <nl> ppp b / hphp / hack / src / parser / ast_visitors_iter . ml <nl> class virtual [ ' self ] iter = <nl> self # on_block env c0 ; <nl> self # on_list self # on_catch env c1 ; <nl> self # on_block env c2 ; <nl> + method on_Def_inline = self # on_def <nl> method on_Noop env = ( ) <nl> method on_stmt env = function <nl> | Unsafe - > self # on_Unsafe env <nl> class virtual [ ' self ] iter = <nl> | Switch ( c0 , c1 ) - > self # on_Switch env c0 c1 <nl> | Foreach ( c0 , c1 , c2 , c3 ) - > self # on_Foreach env c0 c1 c2 c3 <nl> | Try ( c0 , c1 , c2 ) - > self # on_Try env c0 c1 c2 <nl> + | Def_inline c0 - > <nl> + self # on_Def_inline env c0 <nl> | Noop - > self # on_Noop env <nl> method on_As_v = self # on_expr <nl> method on_As_kv env c0 c1 = <nl> mmm a / hphp / hack / src / parser / ast_visitors_iter . mli <nl> ppp b / hphp / hack / src / parser / ast_visitors_iter . mli <nl> class virtual [ ' b ] iter : <nl> on_Contravariant : ' c - > unit ; on_Covariant : ' c - > unit ; <nl> on_Cst_const : ' c - > unit ; on_Cst_define : ' c - > unit ; <nl> on_Ctrait : ' c - > unit ; <nl> + on_Def_inline : ' c - > <nl> + Ast_visitors_ancestors . def - > <nl> + unit ; <nl> on_Default : ' c - > Ast_visitors_ancestors . block - > unit ; <nl> on_Diff : ' c - > unit ; on_Diff2 : ' c - > unit ; <nl> on_Do : ' c - > <nl> class virtual [ ' b ] iter : <nl> method on_Cst_const : ' c - > unit <nl> method on_Cst_define : ' c - > unit <nl> method on_Ctrait : ' c - > unit <nl> + method on_Def_inline : <nl> + ' c - > <nl> + Ast_visitors_ancestors . def - > unit <nl> method on_Default : ' c - > Ast_visitors_ancestors . block - > unit <nl> method on_Diff : ' c - > unit <nl> method on_Diff2 : ' c - > unit <nl> mmm a / hphp / hack / src / parser / ast_visitors_map . ml <nl> ppp b / hphp / hack / src / parser / ast_visitors_map . ml <nl> class virtual [ ' self ] map = <nl> let r0 = self # on_block env c0 in <nl> let r1 = self # on_list self # on_catch env c1 in <nl> let r2 = self # on_block env c2 in Try ( r0 , r1 , r2 ) <nl> + method on_Def_inline env c0 = <nl> + let r0 = self # on_def env c0 in <nl> + Def_inline r0 <nl> method on_Noop env = Noop <nl> method on_stmt env this = <nl> match this with <nl> class virtual [ ' self ] map = <nl> | Switch ( c0 , c1 ) - > self # on_Switch env c0 c1 <nl> | Foreach ( c0 , c1 , c2 , c3 ) - > self # on_Foreach env c0 c1 c2 c3 <nl> | Try ( c0 , c1 , c2 ) - > self # on_Try env c0 c1 c2 <nl> + | Def_inline c0 - > <nl> + self # on_Def_inline env c0 <nl> | Noop - > self # on_Noop env <nl> method on_As_v env c0 = <nl> let r0 = self # on_expr env c0 in As_v r0 <nl> mmm a / hphp / hack / src / parser / ast_visitors_map . mli <nl> ppp b / hphp / hack / src / parser / ast_visitors_map . mli <nl> class virtual [ ' c ] map : <nl> on_Cst_const : ' d - > Ast_visitors_ancestors . cst_kind ; <nl> on_Cst_define : ' d - > Ast_visitors_ancestors . cst_kind ; <nl> on_Ctrait : ' d - > Ast_visitors_ancestors . class_kind ; <nl> + on_Def_inline : ' d - > <nl> + Ast_visitors_ancestors . def - > <nl> + Ast_visitors_ancestors . stmt ; <nl> on_Default : ' d - > <nl> Ast_visitors_ancestors . block - > <nl> Ast_visitors_ancestors . case ; <nl> mmm a / hphp / hack / src / parser / ast_visitors_reduce . ml <nl> ppp b / hphp / hack / src / parser / ast_visitors_reduce . ml <nl> class virtual [ ' self ] reduce = <nl> let r1 = self # on_list self # on_catch env c1 in <nl> let r2 = self # on_block env c2 in <nl> self # add ( self # add r0 r1 ) r2 <nl> + method on_Def_inline = self # on_def <nl> method on_Noop _ = self # e <nl> method on_stmt env = function <nl> | Unsafe - > self # on_Unsafe env <nl> class virtual [ ' self ] reduce = <nl> | Switch ( c0 , c1 ) - > self # on_Switch env c0 c1 <nl> | Foreach ( c0 , c1 , c2 , c3 ) - > self # on_Foreach env c0 c1 c2 c3 <nl> | Try ( c0 , c1 , c2 ) - > self # on_Try env c0 c1 c2 <nl> + | Def_inline c0 - > <nl> + self # on_Def_inline env c0 <nl> | Noop - > self # on_Noop env <nl> method on_As_v = self # on_expr <nl> method on_As_kv env c0 c1 = <nl> mmm a / hphp / hack / src / parser / ast_visitors_reduce . mli <nl> ppp b / hphp / hack / src / parser / ast_visitors_reduce . mli <nl> class virtual [ ' b ] reduce : <nl> on_Contravariant : ' c - > ' d ; on_Covariant : ' c - > ' d ; <nl> on_Cst_const : ' c - > ' d ; on_Cst_define : ' c - > ' d ; <nl> on_Ctrait : ' c - > ' d ; <nl> + on_Def_inline : ' c - > Ast_visitors_ancestors . def - > ' d ; <nl> on_Default : ' c - > Ast_visitors_ancestors . block - > ' d ; <nl> on_Diff : ' c - > ' d ; on_Diff2 : ' c - > ' d ; <nl> on_Do : ' c - > <nl> class virtual [ ' b ] reduce : <nl> method on_Cst_const : ' c - > ' d <nl> method on_Cst_define : ' c - > ' d <nl> method on_Ctrait : ' c - > ' d <nl> + method on_Def_inline : ' c - > Ast_visitors_ancestors . def - > ' d <nl> method on_Default : ' c - > Ast_visitors_ancestors . block - > ' d <nl> method on_Diff : ' c - > ' d <nl> method on_Diff2 : ' c - > ' d <nl> mmm a / hphp / hack / src / parser / full_fidelity_ast . ml <nl> ppp b / hphp / hack / src / parser / full_fidelity_ast . ml <nl> let php_file ( ) = ! ( lowerer_state . mode ) = = FileInfo . Mphp <nl> type env = <nl> { saw_yield : bool ref <nl> ; errors : ( Pos . t * string ) list ref <nl> + ; max_depth : int <nl> } <nl> <nl> type + ' a parser = node - > env - > ' a <nl> let pUop : bool - > ( expr - > expr_ ) parser = fun postfix node env expr - > <nl> | Some TK . Await - > Await expr <nl> | Some TK . Clone - > Clone expr <nl> | Some TK . At - > snd expr <nl> - | _ - > missing_syntax " unary operator " node env <nl> + | Some TK . Dollar - > <nl> + ( match expr with <nl> + | _ , Lvarvar ( n , id ) - > Lvarvar ( n + 1 , id ) <nl> + | _ , Lvar id - > Lvarvar ( 1 , id ) <nl> + | _ - > missing_syntax " unary operator : dollar - deref " node env <nl> + ) <nl> + | _ - > <nl> + <nl> + missing_syntax " unary operator " node env <nl> <nl> let pBop : ( expr - > expr - > expr_ ) parser = fun node env lhs rhs - > <nl> match token_kind node with <nl> let pKinds : kind list parser = couldMap ~ f : ( fun node env - > <nl> | Some TK . Private - > Private <nl> | Some TK . Public - > Public <nl> | Some TK . Protected - > Protected <nl> + | Some TK . Var - > Public <nl> | _ - > missing_syntax " kind " node env <nl> ) <nl> <nl> let rec pHint : hint parser = fun node env - > <nl> in <nl> get_pos node , pHint_ node env <nl> <nl> + type fun_hdr = <nl> + { fh_suspension_kind : suspension_kind <nl> + ; fh_name : pstring <nl> + ; fh_type_parameters : tparam list <nl> + ; fh_parameters : fun_param list <nl> + ; fh_return_type : hint option <nl> + ; fh_param_modifiers : fun_param list <nl> + ; fh_keep_noop : bool <nl> + } <nl> + <nl> + let empty_fun_hdr = <nl> + { fh_suspension_kind = SKSync <nl> + ; fh_name = Pos . none , " < ANONYMOUS > " <nl> + ; fh_type_parameters = [ ] <nl> + ; fh_parameters = [ ] <nl> + ; fh_return_type = None <nl> + ; fh_param_modifiers = [ ] <nl> + ; fh_keep_noop = false <nl> + } <nl> + <nl> let rec pSimpleInitializer node env = <nl> match syntax node with <nl> | SimpleInitializer { simple_initializer_value ; _ } - > <nl> and pExpr ? top_level : ( top_level = true ) : expr parser = fun node env - > <nl> { postfix_unary_operand = operand <nl> ; postfix_unary_operator = operator <nl> } <nl> - - > pUop ( kind node = SyntaxKind . PostfixUnaryExpression ) operator env @ @ <nl> - pExpr operand env <nl> + - > <nl> + let expr = pExpr operand env in <nl> + pUop ( kind node = SyntaxKind . PostfixUnaryExpression ) operator env expr <nl> <nl> | BinaryExpression <nl> { binary_left_operand ; binary_operator ; binary_right_operand } <nl> and pExpr ? top_level : ( top_level = true ) : expr parser = fun node env - > <nl> env . saw_yield : = true ; <nl> Yield ( pAField yield_operand env ) <nl> <nl> + | DefineExpression { define_keyword ; define_argument_list ; _ } - > Call <nl> + ( ( let name = pos_name define_keyword in fst name , Id name ) <nl> + , List . map ( fun x - > pExpr x env ) ( as_list define_argument_list ) <nl> + , [ ] <nl> + ) <nl> <nl> | ScopeResolutionExpression <nl> { scope_resolution_qualifier ; scope_resolution_name ; _ } - > <nl> and pStmt : stmt parser = fun node env - > <nl> ) ) <nl> | BreakStatement _ - > Break ( get_pos node ) <nl> | ContinueStatement _ - > Continue ( get_pos node ) <nl> + | _ when env . max_depth > 0 - > <nl> + ( * OCaml optimisers ; Forgive them , for they know not what they do ! <nl> + * <nl> + * The max_depth is only there to stop the * optimised * version from an <nl> + * unbounded recursion . Sad times . <nl> + * ) <nl> + Def_inline ( pDef node { env with max_depth = env . max_depth - 1 } ) <nl> | _ - > missing_syntax " statement " node env <nl> <nl> - let pTConstraintTy : hint parser = fun node - > <nl> + and pTConstraintTy : hint parser = fun node - > <nl> match syntax node with <nl> | TypeConstraint { constraint_type ; _ } - > pHint constraint_type <nl> | _ - > missing_syntax " type constraint " node <nl> <nl> - let pTConstraint : ( constraint_kind * hint ) parser = fun node env - > <nl> + and pTConstraint : ( constraint_kind * hint ) parser = fun node env - > <nl> match syntax node with <nl> | TypeConstraint { constraint_keyword ; constraint_type } - > <nl> ( ( match token_kind constraint_keyword with <nl> let pTConstraint : ( constraint_kind * hint ) parser = fun node env - > <nl> ) <nl> | _ - > missing_syntax " type constraint " node env <nl> <nl> - let pTParaml : tparam list parser = fun node env - > <nl> + and pTParaml : tparam list parser = fun node env - > <nl> let pTParam : tparam parser = fun node env - > <nl> match syntax node with <nl> | TypeParameter { type_variance ; type_name ; type_constraints } - > <nl> let pTParaml : tparam list parser = fun node env - > <nl> couldMap ~ f : pTParam type_parameters_parameters env <nl> | _ - > missing_syntax " type parameter list " node env <nl> <nl> - type fun_hdr = <nl> - { fh_suspension_kind : suspension_kind <nl> - ; fh_name : pstring <nl> - ; fh_type_parameters : tparam list <nl> - ; fh_parameters : fun_param list <nl> - ; fh_return_type : hint option <nl> - ; fh_param_modifiers : fun_param list <nl> - ; fh_keep_noop : bool <nl> - } <nl> - <nl> - let empty_fun_hdr = <nl> - { fh_suspension_kind = SKSync <nl> - ; fh_name = Pos . none , " < ANONYMOUS > " <nl> - ; fh_type_parameters = [ ] <nl> - ; fh_parameters = [ ] <nl> - ; fh_return_type = None <nl> - ; fh_param_modifiers = [ ] <nl> - ; fh_keep_noop = false <nl> - } <nl> - <nl> ( * TODO : Translate the where clause * ) <nl> - let pFunHdr : fun_hdr parser = fun node env - > <nl> + and pFunHdr : fun_hdr parser = fun node env - > <nl> match syntax node with <nl> | FunctionDeclarationHeader <nl> { function_async <nl> let pFunHdr : fun_hdr parser = fun node env - > <nl> | Token _ - > empty_fun_hdr <nl> | _ - > missing_syntax " function header " node env <nl> <nl> - let pClassElt : class_elt list parser = fun node env - > <nl> + and pClassElt : class_elt list parser = fun node env - > <nl> match syntax node with <nl> | ConstDeclaration <nl> { const_abstract ; const_type_specifier ; const_declarators ; _ } - > <nl> let pClassElt : class_elt list parser = fun node env - > <nl> ( * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ( <nl> * Parsing definitions ( AST ' s ` def ` ) <nl> ) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ) <nl> - let rec pDefStmt node env = try Stmt ( pStmt node env ) with _ - > pDef node env <nl> and pDef : def parser = fun node env - > <nl> match syntax node with <nl> | FunctionDeclaration <nl> and pDef : def parser = fun node env - > <nl> { syntax = NamespaceBody { namespace_declarations = decls ; _ } ; _ } <nl> ; _ } - > Namespace <nl> ( pos_name name <nl> - , List . map ( fun x - > pDefStmt x env ) ( as_list decls ) <nl> + , List . map ( fun x - > pDef x env ) ( as_list decls ) <nl> ) <nl> | NamespaceDeclaration { namespace_name = name ; _ } - > <nl> Namespace ( pos_name name , [ ] ) <nl> and pDef : def parser = fun node env - > <nl> in <nl> NamespaceUse ( List . map f ( as_list clauses ) ) <nl> | NamespaceGroupUseDeclaration _ - > NamespaceUse [ ] <nl> - ( * The ugly duckling ; Here , the FFP tree has one / fewer / level of hierarchy , <nl> - * so we have to " step back " and look at node . <nl> - * ) <nl> - | ExpressionStatement _ - > Stmt ( pStmt node env ) <nl> - ( * For PHP support ; top - level statements are allowed for scripts . In <nl> - * particular , there is the case of " if ( defined ( Foo ) ) " . However , the AST does <nl> - * not have facilities for these . Therefore , do not reject the input , just <nl> - * drop that top - level if . <nl> + ( * Fail open , assume top - level statement . Not too nice when reporting bugs , <nl> + * but if this turns out prohibitive , just ` try ` this and catch - and - correct <nl> + * the raised exception . <nl> * ) <nl> - | IfStatement _ when php_file ( ) - > Stmt Noop <nl> - | _ - > missing_syntax " definition " node env <nl> + | _ - > Stmt ( pStmt node env ) <nl> let pProgram : program parser = fun node env - > <nl> let rec post_process program = <nl> let span ( p : ' a - > bool ) = <nl> let pProgram : program parser = fun node env - > <nl> } <nl> | _ - > missing_syntax " DefineExpression : inner " args env <nl> ) : : aux env nodel <nl> - | node : : nodel - > pDefStmt node env : : aux env nodel <nl> + | node : : nodel - > pDef node env : : aux env nodel <nl> in <nl> post_process @ @ aux env ( as_list node ) <nl> <nl> let scour_comments <nl> | ` EndEmbedded , ' / ' - > mk ` Block start idx @ @ go next ` Free next <nl> ( * Whitespace skips everywhere else * ) <nl> | _ , ( ' ' | ' \ t ' | ' \ n ' ) - > go start state next <nl> - ( * All comments start with a / * ) <nl> + | ` Free , ' # ' - > go next ` LineCmt next <nl> + ( * All other comment delimiters start with a / * ) <nl> | ` Free , ' / ' - > go start ` SawSlash next <nl> ( * After a / in trivia , we must see either another / or a * * ) <nl> | ` SawSlash , ' / ' - > go next ` LineCmt next <nl> let from_text <nl> lowerer_state . mode : = fi_mode ; <nl> lowerer_state . popt : = parser_options ; <nl> lowerer_state . ignorePos : = ignore_pos ; <nl> + let saw_yield = ref false in <nl> let errors = ref [ ] in ( * The top - level error list . * ) <nl> - let ast = runP pScript script { saw_yield = ref false ; errors } in <nl> + let max_depth = 42 in ( * Filthy hack around OCaml bug * ) <nl> + let ast = runP pScript script { saw_yield ; errors ; max_depth } in <nl> let ast = <nl> if elaborate_namespaces <nl> then Namespaces . elaborate_defs parser_options ast <nl> mmm a / hphp / hack / src / typing / typing_get_locals . ml <nl> ppp b / hphp / hack / src / typing / typing_get_locals . ml <nl> and terminal_ tcopt nsenv ~ in_try = function <nl> | While _ <nl> | For _ <nl> | Foreach _ <nl> + | Def_inline _ <nl> | Noop <nl> | Expr _ <nl> | Unsafe <nl> let rec stmt tcopt ( acc : ( Namespace_env . env * Pos . t SMap . t ) ) st = <nl> | Fallthrough <nl> | Expr _ | Break _ | Continue _ | Throw _ <nl> | Do _ | While _ | For _ | Foreach _ <nl> - | Return _ | GotoLabel _ | Goto _ | Static_var _ | Noop - > acc <nl> + | Return _ | GotoLabel _ | Goto _ | Static_var _ <nl> + | Def_inline _ | Noop - > acc <nl> | Block b - > block tcopt acc b <nl> | If ( _ , b1 , b2 ) - > <nl> let term1 = is_terminal tcopt nsenv b1 in <nl> new file mode 100644 <nl> index 00000000000 . . 3402fefb39a <nl> mmm / dev / null <nl> ppp b / hphp / hack / test / full_fidelity / cases / test_indirection . exp <nl> <nl> + ( script ( header ( ( < ) ) ( ( ? ) ) ( ( name ) ( whitespace ) ( single_line_comment ) ( end_of_line ) ) ) <nl> + ( list ( expression_statement ( binary_expression <nl> + ( variable ( ( end_of_line ) ( variable ) ( whitespace ) ) ) <nl> + ( ( = ) ( whitespace ) ) <nl> + ( prefix_unary_expression ( ( $ ) ) ( variable ( ( variable ) ) ) ) <nl> + ) ( ( ; ) ) ) ) <nl> + ) <nl> new file mode 100644 <nl> index 00000000000 . . 5d6b6d03f98 <nl> mmm / dev / null <nl> ppp b / hphp / hack / test / full_fidelity / cases / test_indirection . php <nl> <nl> + < ? hh / / strict <nl> + <nl> + $ y = $ $ s ; <nl> mmm a / hphp / hack / test / full_fidelity / full_fidelity_unit_test . ml <nl> ppp b / hphp / hack / test / full_fidelity / full_fidelity_unit_test . ml <nl> let minimal_tests = <nl> " test_type_const " ; <nl> " test_class_const " ; <nl> " test_type_alias " ; <nl> + " test_indirection " ; <nl> " test_global_constant " ; <nl> " test_closure_type " ; <nl> " test_inclusion_directive " ; <nl> | Combined diffs | facebook/hhvm | 25c793e80bb000d17527ef879c25391848e669bf | 2017-04-25T15:37:40Z |
mmm a / fdbserver / Knobs . cpp <nl> ppp b / fdbserver / Knobs . cpp <nl> void ServerKnobs : : initialize ( bool randomize , ClientKnobs * clientKnobs , bool isSi <nl> init ( PROXY_COMPUTE_BUCKETS , 20000 ) ; <nl> init ( PROXY_COMPUTE_GROWTH_RATE , 0 . 01 ) ; <nl> init ( TXN_STATE_SEND_AMOUNT , 2 ) ; <nl> - init ( ASK_READ_VERSION_FROM_MASTER , false ) ; / / Please do not flip this flag . <nl> + init ( ASK_READ_VERSION_FROM_MASTER , true ) ; / / Please do not flip this flag . <nl> <nl> / / Master Server <nl> / / masterCommitter ( ) in the master server will allow lower priority tasks ( e . g . DataDistibution ) <nl> mmm a / fdbserver / MasterInterface . h <nl> ppp b / fdbserver / MasterInterface . h <nl> struct ReportRawCommittedVersionRequest { <nl> bool locked ; <nl> Optional < Value > metadataVersion ; <nl> <nl> - ReplyPromise < Void > reply ; <nl> + ReplyPromise < GetReadVersionReply > reply ; <nl> <nl> ReportRawCommittedVersionRequest ( ) : version ( invalidVersion ) , locked ( false ) { } <nl> ReportRawCommittedVersionRequest ( Version version , bool locked , Optional < Value > metadataVersion ) : version ( version ) , locked ( locked ) , metadataVersion ( metadataVersion ) { } <nl> mmm a / fdbserver / MasterProxyServer . actor . cpp <nl> ppp b / fdbserver / MasterProxyServer . actor . cpp <nl> ACTOR Future < Void > commitBatch ( <nl> <nl> TEST ( self - > committedVersion . get ( ) > commitVersion ) ; / / A later version was reported committed first <nl> if ( commitVersion > self - > committedVersion . get ( ) ) { <nl> + / / TraceEvent ( " YoungClientReport " ) <nl> + / / . detail ( " CommittedVersion " , self - > committedVersion . get ( ) ) <nl> + / / . detail ( " CommitVersion " , commitVersion ) <nl> + / / . detail ( " LockedAfter " , lockedAfter ) <nl> + / / . detail ( " MetadataVersion " , metadataVersionAfter . present ( ) ? metadataVersionAfter . get ( ) . toString ( ) : " " ) ; <nl> + <nl> + self - > committedVersion . set ( commitVersion ) ; <nl> + self - > locked = lockedAfter ; <nl> + self - > metadataVersion = metadataVersionAfter ; <nl> + <nl> if ( SERVER_KNOBS - > ASK_READ_VERSION_FROM_MASTER ) { <nl> / / Let master know this commit version so that every other proxy can know . <nl> - wait ( self - > master . reportLiveCommittedVersion . getReply ( ReportRawCommittedVersionRequest ( commitVersion , lockedAfter , metadataVersionAfter ) , TaskPriority : : ProxyMasterVersionReply ) ) ; <nl> + GetReadVersionReply reply = wait ( self - > master . reportLiveCommittedVersion . getReply ( ReportRawCommittedVersionRequest ( commitVersion , lockedAfter , metadataVersionAfter ) , TaskPriority : : ProxyMasterVersionReply ) ) ; <nl> + if ( reply . version > self - > committedVersion . get ( ) ) { <nl> + self - > committedVersion . set ( reply . version ) ; <nl> + self - > locked = reply . locked ; <nl> + self - > metadataVersion = reply . metadataVersion ; <nl> + } <nl> } <nl> <nl> - / / After we report the commit version above , other batch commitBatch executions may have updated ' self - > committedVersion ' <nl> - / / to be a larger commitVersion . <nl> - if ( commitVersion > self - > committedVersion . get ( ) ) { <nl> - self - > committedVersion . set ( commitVersion ) ; <nl> - self - > locked = lockedAfter ; <nl> - self - > metadataVersion = metadataVersionAfter ; <nl> - } <nl> + / / / / After we report the commit version above , other batch commitBatch executions may have updated ' self - > committedVersion ' <nl> + / / / / to be a larger commitVersion . <nl> + / / if ( commitVersion > self - > committedVersion . get ( ) ) { <nl> + / / self - > committedVersion . set ( commitVersion ) ; <nl> + / / self - > locked = lockedAfter ; <nl> + / / self - > metadataVersion = metadataVersionAfter ; <nl> + / / } <nl> } <nl> <nl> if ( forceRecovery ) { <nl> ACTOR Future < GetReadVersionReply > getLiveCommittedVersion ( ProxyCommitData * commi <nl> <nl> if ( SERVER_KNOBS - > ASK_READ_VERSION_FROM_MASTER ) { <nl> GetReadVersionReply replyFromMaster = wait ( replyFromMasterFuture ) ; <nl> + / / TraceEvent ( " YoungClientReceiveReport " ) <nl> + / / . detail ( " CurrentLiveCommittedVersion " , rep . version ) <nl> + / / . detail ( " CurrentLocked " , rep . locked ) <nl> + / / . detail ( " CurrentMetadataVersion " , rep . metadataVersion . present ( ) ? rep . metadataVersion . get ( ) . toString ( ) : " " ) <nl> + / / . detail ( " FromMasterCommitVersion " , replyFromMaster . version ) <nl> + / / . detail ( " FromMasterLocked " , replyFromMaster . locked ) <nl> + / / . detail ( " FromMasterMetadataVersion " , replyFromMaster . metadataVersion . present ( ) ? replyFromMaster . metadataVersion . get ( ) . toString ( ) : " " ) <nl> + / / . detail ( " Override " , replyFromMaster . version > rep . version ) ; <nl> + <nl> if ( replyFromMaster . version > rep . version ) { <nl> rep = replyFromMaster ; <nl> } <nl> mmm a / fdbserver / masterserver . actor . cpp <nl> ppp b / fdbserver / masterserver . actor . cpp <nl> ACTOR Future < Void > serveLiveCommittedVersion ( Reference < MasterData > self ) { <nl> reply . version = self - > liveCommittedVersion ; <nl> reply . locked = self - > databaseLocked ; <nl> reply . metadataVersion = self - > proxyMetadataVersion ; <nl> + / / TraceEvent ( " YoungServerSend " ) <nl> + / / . detail ( " CurrentLiveCommittedVersion " , self - > liveCommittedVersion ) <nl> + / / . detail ( " CurrentLocked " , self - > databaseLocked ) <nl> + / / . detail ( " CurrentMetadataVersion " , self - > proxyMetadataVersion . present ( ) ? self - > proxyMetadataVersion . get ( ) . toString ( ) : " " ) ; <nl> req . reply . send ( reply ) ; <nl> } <nl> when ( ReportRawCommittedVersionRequest req = waitNext ( self - > myInterface . reportLiveCommittedVersion . getFuture ( ) ) ) { <nl> + / / TraceEvent ( " YoungServerReceiveReport " ) <nl> + / / . detail ( " CurrentLiveCommittedVersion " , self - > liveCommittedVersion ) <nl> + / / . detail ( " CurrentLocked " , self - > databaseLocked ) <nl> + / / . detail ( " CurrentMetadataVersion " , self - > proxyMetadataVersion . present ( ) ? self - > proxyMetadataVersion . get ( ) . toString ( ) : " " ) <nl> + / / . detail ( " CommitVersion " , req . version ) <nl> + / / . detail ( " Locked " , req . locked ) <nl> + / / . detail ( " MetadataVersion " , req . metadataVersion . present ( ) ? req . metadataVersion . get ( ) . toString ( ) : " " ) <nl> + / / . detail ( " Override " , req . version > self - > liveCommittedVersion ) ; <nl> if ( req . version > self - > liveCommittedVersion ) { <nl> self - > liveCommittedVersion = req . version ; <nl> self - > databaseLocked = req . locked ; <nl> self - > proxyMetadataVersion = req . metadataVersion ; <nl> } <nl> - req . reply . send ( Void ( ) ) ; <nl> + GetReadVersionReply reply ; <nl> + reply . version = self - > liveCommittedVersion ; <nl> + reply . locked = self - > databaseLocked ; <nl> + reply . metadataVersion = self - > proxyMetadataVersion ; <nl> + req . reply . send ( reply ) ; <nl> } <nl> } <nl> } <nl> mmm a / fdbserver / workloads / Watches . actor . cpp <nl> ppp b / fdbserver / workloads / Watches . actor . cpp <nl> struct WatchesWorkload : TestWorkload { <nl> Optional < Value > setValue = wait ( setValueFuture ) ; <nl> <nl> if ( lastValue . present ( ) & & lastValue . get ( ) = = watchValue ) { <nl> - TraceEvent ( SevError , " WatcherTriggeredWithoutChanging " ) <nl> + TraceEvent ( SevWarn , " WatcherTriggeredWithoutChanging " ) <nl> . detail ( " WatchKey " , printable ( watchKey ) ) <nl> . detail ( " SetKey " , printable ( setKey ) ) <nl> . detail ( " WatchValue " , printable ( watchValue ) ) <nl> mmm a / flow / network . h <nl> ppp b / flow / network . h <nl> enum class TaskPriority { <nl> TLogPeek = 8590 , <nl> TLogCommitReply = 8580 , <nl> TLogCommit = 8570 , <nl> + ReportLiveCommittedVersion = 8567 , <nl> ProxyGetRawCommittedVersion = 8565 , <nl> ProxyMasterVersionReply = 8560 , <nl> ProxyCommitYield2 = 8557 , <nl> enum class TaskPriority { <nl> ProxyResolverReply = 8547 , <nl> ProxyCommit = 8545 , <nl> ProxyCommitBatcher = 8540 , <nl> - ReportLiveCommittedVersion = 8535 , <nl> TLogConfirmRunningReply = 8530 , <nl> TLogConfirmRunning = 8520 , <nl> ProxyGRVTimer = 8510 , <nl> | Change order between reporting commit version and setting committedVersion | apple/foundationdb | ed89d699160185d4a6b98f464b27cbec94b317ad | 2020-07-02T22:13:28Z |
mmm a / tensorflow / core / public / version . h <nl> ppp b / tensorflow / core / public / version . h <nl> limitations under the License . <nl> <nl> # define TF_GRAPH_DEF_VERSION_MIN_PRODUCER 0 <nl> # define TF_GRAPH_DEF_VERSION_MIN_CONSUMER 0 <nl> - # define TF_GRAPH_DEF_VERSION 121 / / Updated : 2019 / 8 / 8 <nl> + # define TF_GRAPH_DEF_VERSION 122 / / Updated : 2019 / 8 / 9 <nl> <nl> / / Checkpoint compatibility versions ( the versions field in SavedSliceMeta ) . <nl> / / <nl> | Update GraphDef version to 122 . | tensorflow/tensorflow | 08146afebc0c04acc8baf6689345c94ff885b8da | 2019-08-09T09:07:49Z |
mmm a / src / keystore . h <nl> ppp b / src / keystore . h <nl> class CBasicKeyStore : public CKeyStore <nl> ScriptMap mapScripts ; <nl> WatchOnlySet setWatchOnly ; <nl> <nl> - void ImplicitlyLearnRelatedKeyScripts ( const CPubKey & pubkey ) ; <nl> + void ImplicitlyLearnRelatedKeyScripts ( const CPubKey & pubkey ) EXCLUSIVE_LOCKS_REQUIRED ( cs_KeyStore ) ; <nl> <nl> public : <nl> bool AddKeyPubKey ( const CKey & key , const CPubKey & pubkey ) override ; <nl> | Add compile time checking for all cs_KeyStore runtime locking assertions | bitcoin/bitcoin | 66dc662c8aa5d7a178451f5ad5d826552693158c | 2018-04-25T20:31:40Z |
mmm a / test / cpp / thread_manager / thread_manager_test . cc <nl> ppp b / test / cpp / thread_manager / thread_manager_test . cc <nl> void ThreadManagerTest : : PerformTest ( ) { <nl> <nl> / / The number of times DoWork ( ) was called is equal to the number of times <nl> / / WORK_FOUND was returned <nl> - gpr_log ( GPR_DEBUG , " DoWork ( ) called % ld times " , <nl> + gpr_log ( GPR_DEBUG , " DoWork ( ) called % " PRIdPTR " times " , <nl> gpr_atm_no_barrier_load ( & num_do_work_ ) ) ; <nl> GPR_ASSERT ( gpr_atm_no_barrier_load ( & num_do_work_ ) = = <nl> gpr_atm_no_barrier_load ( & num_work_found_ ) ) ; <nl> | Merge pull request from ctiller / not - ld | grpc/grpc | 305dcf3d32bed0614325ead76f121702768ce874 | 2017-05-01T21:34:51Z |
mmm a / docs / docs / release_notes . xml <nl> ppp b / docs / docs / release_notes . xml <nl> <nl> < ! - - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - - > <nl> <nl> < current > <nl> + New Stuff : <nl> + <nl> + Non - Backwards Compatible Changes : <nl> + <nl> + Bug fixes : <nl> + <nl> + Other : <nl> + <nl> + < / current > <nl> + <nl> + < ! - - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - - > <nl> + <nl> + < old name = " 17 . 33 " date = " Dec 05 , 2010 " > <nl> New Stuff : <nl> - Added the ability to add / subtract scalar values to / from all the elements <nl> of a matrix using the - and + operators . <nl> Other : <nl> turns into diagm ( reciprocal ( d ) ) . Multiplication by a diagonal matrix <nl> is now also handled efficiently . <nl> <nl> - < / current > <nl> + < / old > <nl> <nl> < ! - - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - - > <nl> <nl> | updated docs | davisking/dlib | 1c4cdc833153290e0da6bbbcb6fa7ec26b433fa4 | 2010-12-05T18:44:10Z |
mmm a / modules / features2d / test / test_rotation_invariance . cpp <nl> ppp b / modules / features2d / test / test_rotation_invariance . cpp <nl> using namespace cv ; <nl> const string FEATURES2D_DIR = " features2d " ; <nl> const string IMAGE_FILENAME = " tsukuba . png " ; <nl> <nl> + # define SHOW_DEBUG_LOG 0 <nl> + <nl> static <nl> Mat generateHomography ( float angle ) <nl> { <nl> + / / angle - rotation around Oz in degrees <nl> float angleRadian = angle * CV_PI / 180 . ; <nl> Mat H = Mat : : eye ( 3 , 3 , CV_32FC1 ) ; <nl> H . at < float > ( 0 , 0 ) = H . at < float > ( 1 , 1 ) = std : : cos ( angleRadian ) ; <nl> Mat generateHomography ( float angle ) <nl> static <nl> Mat rotateImage ( const Mat & srcImage , float angle , Mat & dstImage , Mat & dstMask ) <nl> { <nl> + / / angle - rotation around Oz in degrees <nl> float diag = std : : sqrt ( static_cast < float > ( srcImage . cols * srcImage . cols + srcImage . rows * srcImage . rows ) ) ; <nl> Mat LUShift = Mat : : eye ( 3 , 3 , CV_32FC1 ) ; / / left up <nl> LUShift . at < float > ( 0 , 2 ) = - srcImage . cols / 2 ; <nl> Mat rotateImage ( const Mat & srcImage , float angle , Mat & dstImage , Mat & dstMask ) <nl> } <nl> <nl> static <nl> - float calcIntersectArea ( const Point2f & p0 , float r0 , const Point2f & p1 , float r1 ) <nl> + float calcCirclesIntersectArea ( const Point2f & p0 , float r0 , const Point2f & p1 , float r1 ) <nl> { <nl> float c = norm ( p0 - p1 ) , sqr_c = c * c ; <nl> <nl> float calcIntersectArea ( const Point2f & p0 , float r0 , const Point2f & p1 , float r1 <nl> static <nl> float calcIntersectRatio ( const Point2f & p0 , float r0 , const Point2f & p1 , float r1 ) <nl> { <nl> - float intersectArea = calcIntersectArea ( p0 , r0 , p1 , r1 ) ; <nl> + float intersectArea = calcCirclesIntersectArea ( p0 , r0 , p1 , r1 ) ; <nl> float unionArea = CV_PI * ( r0 * r0 + r1 * r1 ) - intersectArea ; <nl> return intersectArea / unionArea ; <nl> } <nl> <nl> + static <nl> + void matchKeyPoints ( const vector < KeyPoint > & keypoints0 , const Mat & H , <nl> + const vector < KeyPoint > & keypoints1 , <nl> + vector < DMatch > & matches ) <nl> + { <nl> + vector < Point2f > points0 ; <nl> + KeyPoint : : convert ( keypoints0 , points0 ) ; <nl> + Mat points0t ; <nl> + perspectiveTransform ( Mat ( points0 ) , points0t , H ) ; <nl> + <nl> + matches . clear ( ) ; <nl> + vector < uchar > usedMask ( keypoints1 . size ( ) , 0 ) ; <nl> + for ( size_t i0 = 0 ; i0 < keypoints0 . size ( ) ; i0 + + ) <nl> + { <nl> + int nearestPointIndex = - 1 ; <nl> + float maxIntersectRatio = - 1 . f ; <nl> + const float r0 = 0 . 5f * keypoints0 [ i0 ] . size ; <nl> + for ( size_t i1 = 0 ; i1 < keypoints1 . size ( ) ; i1 + + ) <nl> + { <nl> + if ( nearestPointIndex > = 0 & & usedMask [ i1 ] ) <nl> + continue ; <nl> + <nl> + float r1 = 0 . 5f * keypoints1 [ i1 ] . size ; <nl> + float intersectRatio = calcIntersectRatio ( points0t . at < Point2f > ( i0 ) , r0 , <nl> + keypoints1 [ i1 ] . pt , r1 ) ; <nl> + if ( intersectRatio > maxIntersectRatio ) <nl> + { <nl> + maxIntersectRatio = intersectRatio ; <nl> + nearestPointIndex = i1 ; <nl> + } <nl> + } <nl> + <nl> + matches . push_back ( DMatch ( i0 , nearestPointIndex , maxIntersectRatio ) ) ; <nl> + if ( nearestPointIndex > = 0 ) <nl> + usedMask [ nearestPointIndex ] = 1 ; <nl> + } <nl> + } <nl> + <nl> class DetectorRotatationInvarianceTest : public cvtest : : BaseTest <nl> { <nl> public : <nl> DetectorRotatationInvarianceTest ( const Ptr < FeatureDetector > & _featureDetector , <nl> - float _minInliersRatio , <nl> + float _minKeyPointMatchesRatio , <nl> float _minAngleInliersRatio ) : <nl> - featureDetector ( _featureDetector ) , minInliersRatio ( _minInliersRatio ) , minAngleInliersRatio ( _minAngleInliersRatio ) <nl> + featureDetector ( _featureDetector ) , <nl> + minKeyPointMatchesRatio ( _minKeyPointMatchesRatio ) , <nl> + minAngleInliersRatio ( _minAngleInliersRatio ) <nl> { <nl> CV_Assert ( ! featureDetector . empty ( ) ) ; <nl> } <nl> class DetectorRotatationInvarianceTest : public cvtest : : BaseTest <nl> <nl> / / Read test data <nl> Mat image0 = imread ( imageFilename ) , image1 , mask1 ; <nl> - <nl> if ( image0 . empty ( ) ) <nl> { <nl> ts - > printf ( cvtest : : TS : : LOG , " Image % s can not be read . \ n " , imageFilename . c_str ( ) ) ; <nl> class DetectorRotatationInvarianceTest : public cvtest : : BaseTest <nl> <nl> CV_Assert ( keypoints0 . size ( ) > 15 ) ; <nl> <nl> - const int maxAngle = 360 , angleStep = 10 ; <nl> + const int maxAngle = 360 , angleStep = 15 ; <nl> for ( int angle = 0 ; angle < maxAngle ; angle + = angleStep ) <nl> { <nl> Mat H = rotateImage ( image0 , angle , image1 , mask1 ) ; <nl> class DetectorRotatationInvarianceTest : public cvtest : : BaseTest <nl> vector < KeyPoint > keypoints1 ; <nl> featureDetector - > detect ( image1 , keypoints1 , mask1 ) ; <nl> <nl> - vector < Point2f > points0 ; <nl> - KeyPoint : : convert ( keypoints0 , points0 ) ; <nl> - Mat points0t ; <nl> - perspectiveTransform ( Mat ( points0 ) , points0t , H ) ; <nl> + vector < DMatch > matches ; <nl> + matchKeyPoints ( keypoints0 , H , keypoints1 , matches ) ; <nl> <nl> - int inliersCount = 0 ; <nl> int angleInliersCount = 0 ; <nl> <nl> - for ( size_t m0 = 0 ; m0 < points0t . total ( ) ; m0 + + ) <nl> + const float minIntersectRatio = 0 . 5f ; <nl> + int keyPointMatchesCount = 0 ; <nl> + for ( size_t m = 0 ; m < matches . size ( ) ; m + + ) <nl> { <nl> - int nearestPointIndex = - 1 ; <nl> - float maxIntersectRatio = 0 . f ; <nl> - const float r0 = 0 . 5f * keypoints0 [ m0 ] . size ; <nl> - for ( size_t m1 = 0 ; m1 < keypoints1 . size ( ) ; m1 + + ) <nl> - { <nl> + if ( matches [ m ] . distance < minIntersectRatio ) <nl> + continue ; <nl> + <nl> + keyPointMatchesCount + + ; <nl> + <nl> + / / Check does this inlier have consistent angles <nl> + const float maxAngleDiff = 15 . f ; / / grad <nl> + float angle0 = keypoints0 [ matches [ m ] . queryIdx ] . angle ; <nl> + float angle1 = keypoints1 [ matches [ m ] . trainIdx ] . angle ; <nl> + if ( angle0 = = - 1 | | angle1 = = - 1 ) <nl> + CV_Error ( CV_StsBadArg , " Given FeatureDetector is not rotation invariant , it can not be tested here . \ n " ) ; <nl> + CV_Assert ( angle0 > = 0 . f & & angle0 < 360 . f ) ; <nl> + CV_Assert ( angle1 > = 0 . f & & angle1 < 360 . f ) ; <nl> + <nl> + float rotAngle0 = angle0 + angle ; <nl> + if ( rotAngle0 > = 360 . f ) <nl> + rotAngle0 - = 360 . f ; <nl> + <nl> + float angleDiff = std : : max ( rotAngle0 , angle1 ) - std : : min ( rotAngle0 , angle1 ) ; <nl> + angleDiff = std : : min ( angleDiff , static_cast < float > ( 360 . f - angleDiff ) ) ; <nl> + CV_Assert ( angleDiff > = 0 . f ) ; <nl> + bool isAngleCorrect = angleDiff < maxAngleDiff ; <nl> + if ( isAngleCorrect ) <nl> + angleInliersCount + + ; <nl> + } <nl> <nl> - float r1 = 0 . 5f * keypoints1 [ m1 ] . size ; <nl> - float intersectRatio = calcIntersectRatio ( points0t . at < Point2f > ( m0 ) , r0 , <nl> - keypoints1 [ m1 ] . pt , r1 ) ; <nl> - if ( intersectRatio > maxIntersectRatio ) <nl> - { <nl> - maxIntersectRatio = intersectRatio ; <nl> - nearestPointIndex = m1 ; <nl> - } <nl> - } <nl> + float keyPointMatchesRatio = static_cast < float > ( keyPointMatchesCount ) / keypoints0 . size ( ) ; <nl> + if ( keyPointMatchesRatio < minKeyPointMatchesRatio ) <nl> + { <nl> + ts - > printf ( cvtest : : TS : : LOG , " Incorrect keyPointMatchesRatio : curr = % f , min = % f . \ n " , <nl> + keyPointMatchesRatio , minKeyPointMatchesRatio ) ; <nl> + ts - > set_failed_test_info ( cvtest : : TS : : FAIL_BAD_ACCURACY ) ; <nl> + return ; <nl> + } <nl> <nl> - if ( maxIntersectRatio > 0 . 5f ) <nl> + if ( keyPointMatchesCount ) <nl> + { <nl> + float angleInliersRatio = static_cast < float > ( angleInliersCount ) / keyPointMatchesCount ; <nl> + if ( angleInliersRatio < minAngleInliersRatio ) <nl> { <nl> - inliersCount + + ; <nl> + ts - > printf ( cvtest : : TS : : LOG , " Incorrect angleInliersRatio : curr = % f , min = % f . \ n " , <nl> + angleInliersRatio , minAngleInliersRatio ) ; <nl> + ts - > set_failed_test_info ( cvtest : : TS : : FAIL_BAD_ACCURACY ) ; <nl> + return ; <nl> + } <nl> + } <nl> + # if SHOW_DEBUG_LOG <nl> + std : : cout < < " keyPointMatchesRatio - " < < keyPointMatchesRatio <nl> + < < " - angleInliersRatio " < < static_cast < float > ( angleInliersCount ) / keyPointMatchesCount < < std : : endl ; <nl> + # endif <nl> + } <nl> + ts - > set_failed_test_info ( cvtest : : TS : : OK ) ; <nl> + } <nl> <nl> - const float maxAngleDiff = 15 . f ; / / grad <nl> + Ptr < FeatureDetector > featureDetector ; <nl> + float minKeyPointMatchesRatio ; <nl> + float minAngleInliersRatio ; <nl> + } ; <nl> <nl> - float angle0 = keypoints0 [ m0 ] . angle ; <nl> - float angle1 = keypoints1 [ nearestPointIndex ] . angle ; <nl> - if ( angle0 = = - 1 | | angle1 = = - 1 ) <nl> - CV_Error ( CV_StsBadArg , " Given FeatureDetector is not rotation invariant , it can not be tested here . \ n " ) ; <nl> - CV_Assert ( angle0 > = 0 . f & & angle0 < 360 . f ) ; <nl> - CV_Assert ( angle1 > = 0 . f & & angle1 < 360 . f ) ; <nl> + class DescriptorRotatationInvarianceTest : public cvtest : : BaseTest <nl> + { <nl> + public : <nl> + DescriptorRotatationInvarianceTest ( const Ptr < FeatureDetector > & _featureDetector , <nl> + const Ptr < DescriptorExtractor > & _descriptorExtractor , <nl> + int _normType , <nl> + float _minKeyPointMatchesRatio , <nl> + float _minDescInliersRatio ) : <nl> + featureDetector ( _featureDetector ) , <nl> + descriptorExtractor ( _descriptorExtractor ) , <nl> + normType ( _normType ) , <nl> + minKeyPointMatchesRatio ( _minKeyPointMatchesRatio ) , <nl> + minDescInliersRatio ( _minDescInliersRatio ) <nl> + { <nl> + CV_Assert ( ! featureDetector . empty ( ) ) ; <nl> + CV_Assert ( ! descriptorExtractor . empty ( ) ) ; <nl> + } <nl> <nl> - float rotAngle0 = angle0 + angle ; <nl> - if ( rotAngle0 > = 360 . f ) <nl> - rotAngle0 - = 360 . f ; <nl> + protected : <nl> <nl> - float angleDiff = std : : max ( rotAngle0 , angle1 ) - std : : min ( rotAngle0 , angle1 ) ; <nl> - angleDiff = std : : min ( angleDiff , static_cast < float > ( 360 . f - angleDiff ) ) ; <nl> - CV_Assert ( angleDiff > = 0 . f ) ; <nl> - bool isAngleCorrect = angleDiff < maxAngleDiff ; <nl> + void run ( int ) <nl> + { <nl> + const string imageFilename = string ( ts - > get_data_path ( ) ) + FEATURES2D_DIR + " / " + IMAGE_FILENAME ; <nl> <nl> - if ( isAngleCorrect ) <nl> - angleInliersCount + + ; <nl> - } <nl> - } <nl> + / / Read test data <nl> + Mat image0 = imread ( imageFilename ) , image1 , mask1 ; <nl> + if ( image0 . empty ( ) ) <nl> + { <nl> + ts - > printf ( cvtest : : TS : : LOG , " Image % s can not be read . \ n " , imageFilename . c_str ( ) ) ; <nl> + ts - > set_failed_test_info ( cvtest : : TS : : FAIL_INVALID_TEST_DATA ) ; <nl> + return ; <nl> + } <nl> + <nl> + vector < KeyPoint > keypoints0 ; <nl> + Mat descriptors0 ; <nl> + featureDetector - > detect ( image0 , keypoints0 ) ; <nl> + descriptorExtractor - > compute ( image0 , keypoints0 , descriptors0 ) ; <nl> + <nl> + CV_Assert ( keypoints0 . size ( ) > 15 ) ; <nl> + BFMatcher bfmatcher ( normType ) ; <nl> + <nl> + const int maxAngle = 360 , angleStep = 15 ; <nl> + for ( int angle = 0 ; angle < maxAngle ; angle + = angleStep ) <nl> + { <nl> + Mat H = rotateImage ( image0 , angle , image1 , mask1 ) ; <nl> <nl> - float inliersRatio = static_cast < float > ( inliersCount ) / keypoints0 . size ( ) ; <nl> - if ( inliersRatio < minInliersRatio ) <nl> + vector < KeyPoint > keypoints1 ; <nl> + Mat descriptors1 ; <nl> + featureDetector - > detect ( image1 , keypoints1 , mask1 ) ; <nl> + descriptorExtractor - > compute ( image1 , keypoints1 , descriptors1 ) ; <nl> + <nl> + vector < DMatch > descMatches ; <nl> + bfmatcher . match ( descriptors0 , descriptors1 , descMatches ) ; <nl> + <nl> + vector < DMatch > keyPointMatches ; <nl> + matchKeyPoints ( keypoints0 , H , keypoints1 , keyPointMatches ) ; <nl> + <nl> + const float minIntersectRatio = 0 . 5f ; <nl> + int keyPointMatchesCount = 0 ; <nl> + for ( size_t m = 0 ; m < keyPointMatches . size ( ) ; m + + ) <nl> + { <nl> + if ( keyPointMatches [ m ] . distance > = minIntersectRatio ) <nl> + keyPointMatchesCount + + ; <nl> + } <nl> + int descInliersCount = 0 ; <nl> + for ( size_t m = 0 ; m < descMatches . size ( ) ; m + + ) <nl> { <nl> - ts - > printf ( cvtest : : TS : : LOG , " Incorrect inliersRatio : curr = % f , min = % f . \ n " , <nl> - inliersRatio , minInliersRatio ) ; <nl> + int queryIdx = descMatches [ m ] . queryIdx ; <nl> + if ( keyPointMatches [ queryIdx ] . distance > = minIntersectRatio & & <nl> + descMatches [ m ] . trainIdx = = keyPointMatches [ queryIdx ] . trainIdx ) <nl> + descInliersCount + + ; <nl> + } <nl> + <nl> + float keyPointMatchesRatio = static_cast < float > ( keyPointMatchesCount ) / keypoints0 . size ( ) ; <nl> + if ( keyPointMatchesRatio < minKeyPointMatchesRatio ) <nl> + { <nl> + ts - > printf ( cvtest : : TS : : LOG , " Incorrect keyPointMatchesRatio : curr = % f , min = % f . \ n " , <nl> + keyPointMatchesRatio , minKeyPointMatchesRatio ) ; <nl> ts - > set_failed_test_info ( cvtest : : TS : : FAIL_BAD_ACCURACY ) ; <nl> return ; <nl> } <nl> <nl> - if ( inliersCount ) <nl> + if ( keyPointMatchesCount ) <nl> { <nl> - float angleInliersRatio = static_cast < float > ( angleInliersCount ) / inliersCount ; <nl> - if ( angleInliersRatio < minAngleInliersRatio ) <nl> + float descInliersRatio = static_cast < float > ( descInliersCount ) / keyPointMatchesCount ; <nl> + if ( descInliersRatio < minDescInliersRatio ) <nl> { <nl> - ts - > printf ( cvtest : : TS : : LOG , " Incorrect angleInliersRatio : curr = % f , min = % f . \ n " , <nl> - angleInliersRatio , minAngleInliersRatio ) ; <nl> + ts - > printf ( cvtest : : TS : : LOG , " Incorrect descInliersRatio : curr = % f , min = % f . \ n " , <nl> + descInliersRatio , minDescInliersRatio ) ; <nl> ts - > set_failed_test_info ( cvtest : : TS : : FAIL_BAD_ACCURACY ) ; <nl> return ; <nl> } <nl> } <nl> - <nl> - / / std : : cout < < " inliersRatio - " < < inliersRatio <nl> - / / < < " - angleInliersRatio " < < static_cast < float > ( angleInliersCount ) / inliersCount < < std : : endl ; <nl> + # if SHOW_DEBUG_LOG <nl> + std : : cout < < " keyPointMatchesRatio - " < < keyPointMatchesRatio <nl> + < < " - descInliersRatio " < < static_cast < float > ( descInliersCount ) / keyPointMatchesCount < < std : : endl ; <nl> + # endif <nl> } <nl> ts - > set_failed_test_info ( cvtest : : TS : : OK ) ; <nl> } <nl> <nl> Ptr < FeatureDetector > featureDetector ; <nl> - float minInliersRatio ; <nl> - float minAngleInliersRatio ; <nl> + Ptr < DescriptorExtractor > descriptorExtractor ; <nl> + int normType ; <nl> + float minKeyPointMatchesRatio ; <nl> + float minDescInliersRatio ; <nl> + <nl> } ; <nl> <nl> / / Tests registration <nl> <nl> + / / Detector ' s rotation invariance check <nl> TEST ( Features2d_RotationInvariance_Detector_ORB , regression ) <nl> { <nl> - DetectorRotatationInvarianceTest test ( Algorithm : : create < FeatureDetector > ( " Feature2D . ORB " ) , 0 . 90 , 0 . 83 ) ; <nl> + DetectorRotatationInvarianceTest test ( Algorithm : : create < FeatureDetector > ( " Feature2D . ORB " ) , <nl> + 0 . 45f , <nl> + 0 . 75f ) ; <nl> test . safe_run ( ) ; <nl> } <nl> + <nl> + / / Descriptors ' s rotation invariance check <nl> + TEST ( Features2d_RotationInvariance_Descriptor_ORB , regression ) <nl> + { <nl> + DescriptorRotatationInvarianceTest test ( Algorithm : : create < FeatureDetector > ( " Feature2D . ORB " ) , <nl> + Algorithm : : create < DescriptorExtractor > ( " Feature2D . ORB " ) , <nl> + NORM_HAMMING , <nl> + 0 . 45f , <nl> + 0 . 53f ) ; <nl> + test . safe_run ( ) ; <nl> + } <nl> + <nl> + / / TODO : uncomment test for FREAK when it will work <nl> + / / TEST ( Features2d_RotationInvariance_Descriptor_FREAK , regression ) <nl> + / / { <nl> + / / DescriptorRotatationInvarianceTest test ( Algorithm : : create < FeatureDetector > ( " Feature2D . ORB " ) , <nl> + / / Algorithm : : create < DescriptorExtractor > ( " Feature2D . FREAK " ) , <nl> + / / NORM_HAMMING ( ? ) , <nl> + / / 0 . 45f , <nl> + / / 0 . ? f ) ; <nl> + / / test . safe_run ( ) ; <nl> + / / } <nl> \ No newline at end of file <nl> mmm a / modules / nonfree / test / test_rotation_invariance . cpp <nl> ppp b / modules / nonfree / test / test_rotation_invariance . cpp <nl> using namespace cv ; <nl> const string FEATURES2D_DIR = " features2d " ; <nl> const string IMAGE_FILENAME = " tsukuba . png " ; <nl> <nl> + # define SHOW_DEBUG_LOG 0 <nl> + <nl> static <nl> Mat generateHomography ( float angle ) <nl> { <nl> + / / angle - rotation around Oz in degrees <nl> float angleRadian = angle * CV_PI / 180 . ; <nl> Mat H = Mat : : eye ( 3 , 3 , CV_32FC1 ) ; <nl> H . at < float > ( 0 , 0 ) = H . at < float > ( 1 , 1 ) = std : : cos ( angleRadian ) ; <nl> Mat generateHomography ( float angle ) <nl> static <nl> Mat rotateImage ( const Mat & srcImage , float angle , Mat & dstImage , Mat & dstMask ) <nl> { <nl> + / / angle - rotation around Oz in degrees <nl> float diag = std : : sqrt ( static_cast < float > ( srcImage . cols * srcImage . cols + srcImage . rows * srcImage . rows ) ) ; <nl> Mat LUShift = Mat : : eye ( 3 , 3 , CV_32FC1 ) ; / / left up <nl> LUShift . at < float > ( 0 , 2 ) = - srcImage . cols / 2 ; <nl> Mat rotateImage ( const Mat & srcImage , float angle , Mat & dstImage , Mat & dstMask ) <nl> } <nl> <nl> static <nl> - float calcIntersectArea ( const Point2f & p0 , float r0 , const Point2f & p1 , float r1 ) <nl> + float calcCirclesIntersectArea ( const Point2f & p0 , float r0 , const Point2f & p1 , float r1 ) <nl> { <nl> float c = norm ( p0 - p1 ) , sqr_c = c * c ; <nl> <nl> float calcIntersectArea ( const Point2f & p0 , float r0 , const Point2f & p1 , float r1 <nl> static <nl> float calcIntersectRatio ( const Point2f & p0 , float r0 , const Point2f & p1 , float r1 ) <nl> { <nl> - float intersectArea = calcIntersectArea ( p0 , r0 , p1 , r1 ) ; <nl> + float intersectArea = calcCirclesIntersectArea ( p0 , r0 , p1 , r1 ) ; <nl> float unionArea = CV_PI * ( r0 * r0 + r1 * r1 ) - intersectArea ; <nl> return intersectArea / unionArea ; <nl> } <nl> <nl> + static <nl> + void matchKeyPoints ( const vector < KeyPoint > & keypoints0 , const Mat & H , <nl> + const vector < KeyPoint > & keypoints1 , <nl> + vector < DMatch > & matches ) <nl> + { <nl> + vector < Point2f > points0 ; <nl> + KeyPoint : : convert ( keypoints0 , points0 ) ; <nl> + Mat points0t ; <nl> + perspectiveTransform ( Mat ( points0 ) , points0t , H ) ; <nl> + <nl> + matches . clear ( ) ; <nl> + vector < uchar > usedMask ( keypoints1 . size ( ) , 0 ) ; <nl> + for ( size_t i0 = 0 ; i0 < keypoints0 . size ( ) ; i0 + + ) <nl> + { <nl> + int nearestPointIndex = - 1 ; <nl> + float maxIntersectRatio = - 1 . f ; <nl> + const float r0 = 0 . 5f * keypoints0 [ i0 ] . size ; <nl> + for ( size_t i1 = 0 ; i1 < keypoints1 . size ( ) ; i1 + + ) <nl> + { <nl> + if ( nearestPointIndex > = 0 & & usedMask [ i1 ] ) <nl> + continue ; <nl> + <nl> + float r1 = 0 . 5f * keypoints1 [ i1 ] . size ; <nl> + float intersectRatio = calcIntersectRatio ( points0t . at < Point2f > ( i0 ) , r0 , <nl> + keypoints1 [ i1 ] . pt , r1 ) ; <nl> + if ( intersectRatio > maxIntersectRatio ) <nl> + { <nl> + maxIntersectRatio = intersectRatio ; <nl> + nearestPointIndex = i1 ; <nl> + } <nl> + } <nl> + <nl> + matches . push_back ( DMatch ( i0 , nearestPointIndex , maxIntersectRatio ) ) ; <nl> + if ( nearestPointIndex > = 0 ) <nl> + usedMask [ nearestPointIndex ] = 1 ; <nl> + } <nl> + } <nl> + <nl> class DetectorRotatationInvarianceTest : public cvtest : : BaseTest <nl> { <nl> public : <nl> DetectorRotatationInvarianceTest ( const Ptr < FeatureDetector > & _featureDetector , <nl> - float _minInliersRatio , <nl> + float _minKeyPointMatchesRatio , <nl> float _minAngleInliersRatio ) : <nl> - featureDetector ( _featureDetector ) , minInliersRatio ( _minInliersRatio ) , minAngleInliersRatio ( _minAngleInliersRatio ) <nl> + featureDetector ( _featureDetector ) , <nl> + minKeyPointMatchesRatio ( _minKeyPointMatchesRatio ) , <nl> + minAngleInliersRatio ( _minAngleInliersRatio ) <nl> { <nl> CV_Assert ( ! featureDetector . empty ( ) ) ; <nl> } <nl> class DetectorRotatationInvarianceTest : public cvtest : : BaseTest <nl> <nl> / / Read test data <nl> Mat image0 = imread ( imageFilename ) , image1 , mask1 ; <nl> - <nl> if ( image0 . empty ( ) ) <nl> { <nl> ts - > printf ( cvtest : : TS : : LOG , " Image % s can not be read . \ n " , imageFilename . c_str ( ) ) ; <nl> class DetectorRotatationInvarianceTest : public cvtest : : BaseTest <nl> <nl> CV_Assert ( keypoints0 . size ( ) > 15 ) ; <nl> <nl> - const int maxAngle = 360 , angleStep = 10 ; <nl> + const int maxAngle = 360 , angleStep = 15 ; <nl> for ( int angle = 0 ; angle < maxAngle ; angle + = angleStep ) <nl> { <nl> Mat H = rotateImage ( image0 , angle , image1 , mask1 ) ; <nl> class DetectorRotatationInvarianceTest : public cvtest : : BaseTest <nl> vector < KeyPoint > keypoints1 ; <nl> featureDetector - > detect ( image1 , keypoints1 , mask1 ) ; <nl> <nl> - vector < Point2f > points0 ; <nl> - KeyPoint : : convert ( keypoints0 , points0 ) ; <nl> - Mat points0t ; <nl> - perspectiveTransform ( Mat ( points0 ) , points0t , H ) ; <nl> + vector < DMatch > matches ; <nl> + matchKeyPoints ( keypoints0 , H , keypoints1 , matches ) ; <nl> <nl> - int inliersCount = 0 ; <nl> int angleInliersCount = 0 ; <nl> <nl> - for ( size_t m0 = 0 ; m0 < points0t . total ( ) ; m0 + + ) <nl> + const float minIntersectRatio = 0 . 5f ; <nl> + int keyPointMatchesCount = 0 ; <nl> + for ( size_t m = 0 ; m < matches . size ( ) ; m + + ) <nl> { <nl> - int nearestPointIndex = - 1 ; <nl> - float maxIntersectRatio = 0 . f ; <nl> - const float r0 = 0 . 5f * keypoints0 [ m0 ] . size ; <nl> - for ( size_t m1 = 0 ; m1 < keypoints1 . size ( ) ; m1 + + ) <nl> - { <nl> - <nl> - float r1 = 0 . 5f * keypoints1 [ m1 ] . size ; <nl> - float intersectRatio = calcIntersectRatio ( points0t . at < Point2f > ( m0 ) , r0 , <nl> - keypoints1 [ m1 ] . pt , r1 ) ; <nl> - if ( intersectRatio > maxIntersectRatio ) <nl> - { <nl> - maxIntersectRatio = intersectRatio ; <nl> - nearestPointIndex = m1 ; <nl> - } <nl> - } <nl> - <nl> - if ( maxIntersectRatio > 0 . 5f ) <nl> - { <nl> - inliersCount + + ; <nl> - <nl> - const float maxAngleDiff = 15 . f ; / / grad <nl> - float angle0 = keypoints0 [ m0 ] . angle ; <nl> - float angle1 = keypoints1 [ nearestPointIndex ] . angle ; <nl> - if ( angle0 = = - 1 | | angle1 = = - 1 ) <nl> - CV_Error ( CV_StsBadArg , " Given FeatureDetector is not rotation invariant , it can not be tested here . \ n " ) ; <nl> - CV_Assert ( angle0 > = 0 . f & & angle0 < 360 . f ) ; <nl> - CV_Assert ( angle1 > = 0 . f & & angle1 < 360 . f ) ; <nl> - <nl> - float rotAngle0 = angle0 + angle ; <nl> - if ( rotAngle0 > = 360 . f ) <nl> - rotAngle0 - = 360 . f ; <nl> - <nl> - float angleDiff = std : : max ( rotAngle0 , angle1 ) - std : : min ( rotAngle0 , angle1 ) ; <nl> - angleDiff = std : : min ( angleDiff , static_cast < float > ( 360 . f - angleDiff ) ) ; <nl> - CV_Assert ( angleDiff > = 0 . f ) ; <nl> - bool isAngleCorrect = angleDiff < maxAngleDiff ; <nl> - <nl> - if ( isAngleCorrect ) <nl> - angleInliersCount + + ; <nl> - } <nl> + if ( matches [ m ] . distance < minIntersectRatio ) <nl> + continue ; <nl> + <nl> + keyPointMatchesCount + + ; <nl> + <nl> + / / Check does this inlier have consistent angles <nl> + const float maxAngleDiff = 15 . f ; / / grad <nl> + float angle0 = keypoints0 [ matches [ m ] . queryIdx ] . angle ; <nl> + float angle1 = keypoints1 [ matches [ m ] . trainIdx ] . angle ; <nl> + if ( angle0 = = - 1 | | angle1 = = - 1 ) <nl> + CV_Error ( CV_StsBadArg , " Given FeatureDetector is not rotation invariant , it can not be tested here . \ n " ) ; <nl> + CV_Assert ( angle0 > = 0 . f & & angle0 < 360 . f ) ; <nl> + CV_Assert ( angle1 > = 0 . f & & angle1 < 360 . f ) ; <nl> + <nl> + float rotAngle0 = angle0 + angle ; <nl> + if ( rotAngle0 > = 360 . f ) <nl> + rotAngle0 - = 360 . f ; <nl> + <nl> + float angleDiff = std : : max ( rotAngle0 , angle1 ) - std : : min ( rotAngle0 , angle1 ) ; <nl> + angleDiff = std : : min ( angleDiff , static_cast < float > ( 360 . f - angleDiff ) ) ; <nl> + CV_Assert ( angleDiff > = 0 . f ) ; <nl> + bool isAngleCorrect = angleDiff < maxAngleDiff ; <nl> + if ( isAngleCorrect ) <nl> + angleInliersCount + + ; <nl> } <nl> <nl> - float inliersRatio = static_cast < float > ( inliersCount ) / keypoints0 . size ( ) ; <nl> - if ( inliersRatio < minInliersRatio ) <nl> + float keyPointMatchesRatio = static_cast < float > ( keyPointMatchesCount ) / keypoints0 . size ( ) ; <nl> + if ( keyPointMatchesRatio < minKeyPointMatchesRatio ) <nl> { <nl> - ts - > printf ( cvtest : : TS : : LOG , " Incorrect inliersRatio : curr = % f , min = % f . \ n " , <nl> - inliersRatio , minInliersRatio ) ; <nl> + ts - > printf ( cvtest : : TS : : LOG , " Incorrect keyPointMatchesRatio : curr = % f , min = % f . \ n " , <nl> + keyPointMatchesRatio , minKeyPointMatchesRatio ) ; <nl> ts - > set_failed_test_info ( cvtest : : TS : : FAIL_BAD_ACCURACY ) ; <nl> return ; <nl> } <nl> <nl> - if ( inliersCount ) <nl> + if ( keyPointMatchesCount ) <nl> { <nl> - float angleInliersRatio = static_cast < float > ( angleInliersCount ) / inliersCount ; <nl> + float angleInliersRatio = static_cast < float > ( angleInliersCount ) / keyPointMatchesCount ; <nl> if ( angleInliersRatio < minAngleInliersRatio ) <nl> { <nl> ts - > printf ( cvtest : : TS : : LOG , " Incorrect angleInliersRatio : curr = % f , min = % f . \ n " , <nl> class DetectorRotatationInvarianceTest : public cvtest : : BaseTest <nl> return ; <nl> } <nl> } <nl> - <nl> - / / std : : cout < < " inliersRatio - " < < inliersRatio <nl> - / / < < " - angleInliersRatio " < < static_cast < float > ( angleInliersCount ) / inliersCount < < std : : endl ; <nl> + # if SHOW_DEBUG_LOG <nl> + std : : cout < < " keyPointMatchesRatio - " < < keyPointMatchesRatio <nl> + < < " - angleInliersRatio " < < static_cast < float > ( angleInliersCount ) / keyPointMatchesCount < < std : : endl ; <nl> + # endif <nl> } <nl> ts - > set_failed_test_info ( cvtest : : TS : : OK ) ; <nl> } <nl> <nl> Ptr < FeatureDetector > featureDetector ; <nl> - float minInliersRatio ; <nl> + float minKeyPointMatchesRatio ; <nl> float minAngleInliersRatio ; <nl> } ; <nl> <nl> + class DescriptorRotatationInvarianceTest : public cvtest : : BaseTest <nl> + { <nl> + public : <nl> + DescriptorRotatationInvarianceTest ( const Ptr < FeatureDetector > & _featureDetector , <nl> + const Ptr < DescriptorExtractor > & _descriptorExtractor , <nl> + int _normType , <nl> + float _minKeyPointMatchesRatio , <nl> + float _minDescInliersRatio ) : <nl> + featureDetector ( _featureDetector ) , <nl> + descriptorExtractor ( _descriptorExtractor ) , <nl> + normType ( _normType ) , <nl> + minKeyPointMatchesRatio ( _minKeyPointMatchesRatio ) , <nl> + minDescInliersRatio ( _minDescInliersRatio ) <nl> + { <nl> + CV_Assert ( ! featureDetector . empty ( ) ) ; <nl> + CV_Assert ( ! descriptorExtractor . empty ( ) ) ; <nl> + } <nl> + <nl> + protected : <nl> + <nl> + void run ( int ) <nl> + { <nl> + const string imageFilename = string ( ts - > get_data_path ( ) ) + FEATURES2D_DIR + " / " + IMAGE_FILENAME ; <nl> + <nl> + / / Read test data <nl> + Mat image0 = imread ( imageFilename ) , image1 , mask1 ; <nl> + if ( image0 . empty ( ) ) <nl> + { <nl> + ts - > printf ( cvtest : : TS : : LOG , " Image % s can not be read . \ n " , imageFilename . c_str ( ) ) ; <nl> + ts - > set_failed_test_info ( cvtest : : TS : : FAIL_INVALID_TEST_DATA ) ; <nl> + return ; <nl> + } <nl> + <nl> + vector < KeyPoint > keypoints0 ; <nl> + Mat descriptors0 ; <nl> + featureDetector - > detect ( image0 , keypoints0 ) ; <nl> + descriptorExtractor - > compute ( image0 , keypoints0 , descriptors0 ) ; <nl> + <nl> + CV_Assert ( keypoints0 . size ( ) > 15 ) ; <nl> + BFMatcher bfmatcher ( normType ) ; <nl> + <nl> + const int maxAngle = 360 , angleStep = 15 ; <nl> + for ( int angle = 0 ; angle < maxAngle ; angle + = angleStep ) <nl> + { <nl> + Mat H = rotateImage ( image0 , angle , image1 , mask1 ) ; <nl> + <nl> + vector < KeyPoint > keypoints1 ; <nl> + Mat descriptors1 ; <nl> + featureDetector - > detect ( image1 , keypoints1 , mask1 ) ; <nl> + descriptorExtractor - > compute ( image1 , keypoints1 , descriptors1 ) ; <nl> + <nl> + vector < DMatch > descMatches ; <nl> + bfmatcher . match ( descriptors0 , descriptors1 , descMatches ) ; <nl> + <nl> + vector < DMatch > keyPointMatches ; <nl> + matchKeyPoints ( keypoints0 , H , keypoints1 , keyPointMatches ) ; <nl> + <nl> + const float minIntersectRatio = 0 . 5f ; <nl> + int keyPointMatchesCount = 0 ; <nl> + for ( size_t m = 0 ; m < keyPointMatches . size ( ) ; m + + ) <nl> + { <nl> + if ( keyPointMatches [ m ] . distance > = minIntersectRatio ) <nl> + keyPointMatchesCount + + ; <nl> + } <nl> + int descInliersCount = 0 ; <nl> + for ( size_t m = 0 ; m < descMatches . size ( ) ; m + + ) <nl> + { <nl> + int queryIdx = descMatches [ m ] . queryIdx ; <nl> + if ( keyPointMatches [ queryIdx ] . distance > = minIntersectRatio & & <nl> + descMatches [ m ] . trainIdx = = keyPointMatches [ queryIdx ] . trainIdx ) <nl> + descInliersCount + + ; <nl> + } <nl> + <nl> + float keyPointMatchesRatio = static_cast < float > ( keyPointMatchesCount ) / keypoints0 . size ( ) ; <nl> + if ( keyPointMatchesRatio < minKeyPointMatchesRatio ) <nl> + { <nl> + ts - > printf ( cvtest : : TS : : LOG , " Incorrect keyPointMatchesRatio : curr = % f , min = % f . \ n " , <nl> + keyPointMatchesRatio , minKeyPointMatchesRatio ) ; <nl> + ts - > set_failed_test_info ( cvtest : : TS : : FAIL_BAD_ACCURACY ) ; <nl> + return ; <nl> + } <nl> + <nl> + if ( keyPointMatchesCount ) <nl> + { <nl> + float descInliersRatio = static_cast < float > ( descInliersCount ) / keyPointMatchesCount ; <nl> + if ( descInliersRatio < minDescInliersRatio ) <nl> + { <nl> + ts - > printf ( cvtest : : TS : : LOG , " Incorrect descInliersRatio : curr = % f , min = % f . \ n " , <nl> + descInliersRatio , minDescInliersRatio ) ; <nl> + ts - > set_failed_test_info ( cvtest : : TS : : FAIL_BAD_ACCURACY ) ; <nl> + return ; <nl> + } <nl> + } <nl> + # if SHOW_DEBUG_LOG <nl> + std : : cout < < " keyPointMatchesRatio - " < < keyPointMatchesRatio <nl> + < < " - descInliersRatio " < < static_cast < float > ( descInliersCount ) / keyPointMatchesCount < < std : : endl ; <nl> + # endif <nl> + } <nl> + ts - > set_failed_test_info ( cvtest : : TS : : OK ) ; <nl> + } <nl> + <nl> + Ptr < FeatureDetector > featureDetector ; <nl> + Ptr < DescriptorExtractor > descriptorExtractor ; <nl> + int normType ; <nl> + float minKeyPointMatchesRatio ; <nl> + float minDescInliersRatio ; <nl> + <nl> + } ; <nl> + <nl> / / Tests registration <nl> <nl> + / / Detector ' s rotation invariance check <nl> TEST ( Features2d_RotationInvariance_Detector_SURF , regression ) <nl> { <nl> - DetectorRotatationInvarianceTest test ( Algorithm : : create < FeatureDetector > ( " Feature2D . SURF " ) , 0 . 60f , 0 . 76f ) ; <nl> + DetectorRotatationInvarianceTest test ( Algorithm : : create < FeatureDetector > ( " Feature2D . SURF " ) , <nl> + 0 . 44f , <nl> + 0 . 76f ) ; <nl> test . safe_run ( ) ; <nl> } <nl> <nl> + <nl> TEST ( Features2d_RotationInvariance_Detector_SIFT , regression ) <nl> { <nl> - DetectorRotatationInvarianceTest test ( Algorithm : : create < FeatureDetector > ( " Feature2D . SIFT " ) , 0 . 76f , 0 . 76f ) ; <nl> + DetectorRotatationInvarianceTest test ( Algorithm : : create < FeatureDetector > ( " Feature2D . SIFT " ) , <nl> + 0 . 64f , <nl> + 0 . 74f ) ; <nl> test . safe_run ( ) ; <nl> } <nl> <nl> + / / Descriptors ' s rotation invariance check <nl> + TEST ( Features2d_RotationInvariance_Descriptor_SURF , regression ) <nl> + { <nl> + DescriptorRotatationInvarianceTest test ( Algorithm : : create < FeatureDetector > ( " Feature2D . SURF " ) , <nl> + Algorithm : : create < DescriptorExtractor > ( " Feature2D . SURF " ) , <nl> + NORM_L1 , <nl> + 0 . 44f , <nl> + 0 . 64f ) ; <nl> + test . safe_run ( ) ; <nl> + } <nl> + <nl> + TEST ( Features2d_RotationInvariance_Descriptor_SIFT , regression ) <nl> + { <nl> + DescriptorRotatationInvarianceTest test ( Algorithm : : create < FeatureDetector > ( " Feature2D . SIFT " ) , <nl> + Algorithm : : create < DescriptorExtractor > ( " Feature2D . SIFT " ) , <nl> + NORM_L1 , <nl> + 0 . 64f , <nl> + 0 . 72f ) ; <nl> + test . safe_run ( ) ; <nl> + } <nl> \ No newline at end of file <nl> | added tests to check rotation invariance of descriptors ( features2d and nonfree ) | opencv/opencv | 0c6480d89ba90a9c72370705e20f7d951a5627a3 | 2012-07-14T20:03:07Z |
mmm a / Code / CryEngine / CryPhysics / articulatedentity . cpp <nl> ppp b / Code / CryEngine / CryPhysics / articulatedentity . cpp <nl> void CArticulatedEntity : : GetMemoryStatistics ( ICrySizer * pSizer ) const <nl> CRigidEntity : : GetMemoryStatistics ( pSizer ) ; <nl> pSizer - > AddObject ( m_joints , m_nJointsAlloc * sizeof ( m_joints [ 0 ] ) ) ; <nl> for ( int i = 0 ; i < m_nJoints ; i + + ) if ( m_joints [ i ] . fsbuf ) <nl> - pSizer - > AddObject ( m_joints [ i ] . fsbuf , sizeof ( sizeof ( featherstone_data ) + 16 ) ) ; <nl> + pSizer - > AddObject ( m_joints [ i ] . fsbuf , sizeof ( featherstone_data ) + 16 ) ; <nl> pSizer - > AddObject ( m_infos , m_nPartsAlloc * sizeof ( m_infos [ 0 ] ) ) ; <nl> } <nl> mmm a / Code / CryEngine / CryPhysics / physicalworld . cpp <nl> ppp b / Code / CryEngine / CryPhysics / physicalworld . cpp <nl> int CPhysicalWorld : : GetEntitiesAround ( const Vec3 & ptmin , const Vec3 & ptmax , CPhys <nl> AtomicAdd ( & pent - > m_lockUpdate , bProcessed ^ 1 ) ; <nl> volatile char * pw = ( volatile char * ) & pent - > m_lockUpdate + ( 1 + eBigEndian ) ; for ( ; * pw ; ) ; / / ReadLock ( m_lockUpdate ) <nl> AtomicAdd ( & pent - > m_bProcessed , maskCaller & ~ - bProcessed ) ; <nl> - AtomicAdd ( & pent - > m_nUsedParts , ( pent - > m_nUsedParts & 15 * maskCaller4 ) * ( bProcessed - 1 ) ) ; <nl> + AtomicAdd ( & pent - > m_nUsedParts , ( pent - > m_nUsedParts & 15 * maskCaller4 ) * ( bProcessed - 1u ) ) ; <nl> int nUsedParts = pent - > m_nUsedParts > > iCaller * 4 & 15 ; <nl> int notFull = nUsedParts + 1 > > 4 ^ 1 ; <nl> notFull & = 1 - iszero ( ( INT_PTR ) pGridEnt - > m_pEntBuddy ) ; <nl> mmm a / Code / CryEngine / CryPhysics / trimesh . cpp <nl> ppp b / Code / CryEngine / CryPhysics / trimesh . cpp <nl> void CTriMesh : : PrepareForRayTest ( float raylen ) <nl> } <nl> <nl> <nl> - void CTriMesh : : HashTrianglesToPlane ( const coord_plane & hashplane , const Vec2 & hashsize , grid & hashgrid , index_t * & pHashGrid , index_t * & pHashData , <nl> + void CTriMesh : : HashTrianglesToPlane ( const coord_plane & hashplane , const Vec2 & hashsize , grid & hashgrid , index_t * & pHashGrid , index_t * & pHashDataRet , <nl> float rcellsize , float pad , const index_t * pIndices , int nTris , int maxhash ) <nl> { <nl> float maxsz , tsx , tex , tsy , tey , ts , te ; <nl> void CTriMesh : : HashTrianglesToPlane ( const coord_plane & hashplane , const Vec2 & ha <nl> step . set ( sz . x / isz . x , sz . y / isz . y ) ; <nl> rstep . set ( isz . x / sz . x , isz . y / sz . y ) ; <nl> origin = hashplane . origin - hashplane . axes [ 0 ] * ( step . x * isz . x * 0 . 5f ) - hashplane . axes [ 1 ] * ( step . y * isz . y * 0 . 5f ) ; <nl> - pHashData = & dummy ; <nl> + index_t * pHashData = & dummy ; <nl> <nl> for ( ipass = 0 ; ipass < 2 ; ipass + + ) { <nl> for ( itri = nTris - 1 ; itri > = 0 ; itri - - ) { / / iterate tris in reversed order to get them in accending order in grid ( since the algorithm reverses order ) <nl> void CTriMesh : : HashTrianglesToPlane ( const coord_plane & hashplane , const Vec2 & ha <nl> hashgrid . stepr = rstep ; <nl> hashgrid . size = isz ; <nl> hashgrid . stride . set ( 1 , isz . x ) ; <nl> + pHashDataRet = pHashData ; <nl> } <nl> <nl> <nl> mmm a / Code / CryEngine / CryPhysics / wheeledvehicleentity . cpp <nl> ppp b / Code / CryEngine / CryPhysics / wheeledvehicleentity . cpp <nl> int CWheeledVehicleEntity : : GetParams ( pe_params * _params ) const <nl> params - > engineIdleRPM = m_engineIdlew * ( 60 . 0 / ( 2 * g_PI ) ) ; <nl> params - > engineShiftUpRPM = m_engineShiftUpw * ( 60 . 0 / ( 2 * g_PI ) ) ; <nl> params - > engineShiftDownRPM = m_engineShiftDownw * ( 60 . 0 / ( 2 * g_PI ) ) ; <nl> - params - > engineIdleRPM = m_engineIdlew * ( 60 . 0 / ( 2 * g_PI ) ) ; <nl> params - > engineStartRPM = m_engineStartw * ( 60 . 0 / ( 2 * g_PI ) ) ; <nl> params - > clutchSpeed = m_clutchSpeed ; <nl> params - > nGears = m_nGears ; <nl> mmm a / Code / CryEngine / CryPhysicsSystem / CryPhysX / baseent . cpp <nl> ppp b / Code / CryEngine / CryPhysicsSystem / CryPhysX / baseent . cpp <nl> int PhysXEnt : : GetParams ( pe_params * _params ) const <nl> <nl> if ( _params - > type = = pe_params_part : : type_id ) { <nl> pe_params_part * params = ( pe_params_part * ) _params ; <nl> - int i ; <nl> + int i = 0 ; <nl> if ( ! is_unused ( params - > partid ) ) <nl> i = idxPart ( params - > partid ) ; <nl> else if ( ! is_unused ( params - > ipart ) ) <nl> int PhysXEnt : : GetParams ( pe_params * _params ) const <nl> g_pPhysWorld - > AddRefGeometry ( params - > pPhysGeom ) ; <nl> params - > pMatMapping = 0 ; <nl> params - > nMats = 0 ; <nl> + params - > pLattice = 0 ; <nl> return 1 ; <nl> } <nl> <nl> | ! B ( Physics ) fixed some cppcheck warnings / errors | CRYTEK/CRYENGINE | 4b2c2ef96dc9f8e9599d4fd2ce9acc89d9253452 | 2018-01-10T13:59:21Z |
mmm a / xbmc / filesystem / AddonsDirectory . cpp <nl> ppp b / xbmc / filesystem / AddonsDirectory . cpp <nl> static bool Browse ( const CURL & path , CFileItemList & items ) <nl> const std : : string repo = path . GetHostName ( ) ; <nl> <nl> VECADDONS addons ; <nl> + items . SetPath ( path . Get ( ) ) ; <nl> if ( repo = = " all " ) <nl> { <nl> CAddonDatabase database ; <nl> | Merge pull request from phil65 / fix_addons_folderpath | xbmc/xbmc | bb5c4f4174b234d4d299662800a87d28b3068275 | 2016-06-20T16:38:31Z |
mmm a / lib / SILGen / RValue . cpp <nl> ppp b / lib / SILGen / RValue . cpp <nl> static SILValue implodeTupleValues ( ArrayRef < ManagedValue > values , <nl> <nl> / / To implode an address - only tuple , we need to create a buffer to hold the <nl> / / result tuple . <nl> - if ( loweredType . isAddressOnly ( SGF . F . getModule ( ) ) & & <nl> + if ( loweredType . isAddressOnly ( SGF . getModule ( ) ) & & <nl> SGF . silConv . useLoweredAddresses ( ) ) { <nl> assert ( KIND ! = ImplodeKind : : Unmanaged & & <nl> " address - only values are always managed ! " ) ; <nl> const TypeLowering & RValue : : getTypeLowering ( SILGenFunction & SGF ) const & { <nl> SILType RValue : : getLoweredType ( SILGenFunction & SGF ) const & { <nl> return getTypeLowering ( SGF ) . getLoweredType ( ) ; <nl> } <nl> + <nl> + SILType RValue : : getLoweredImplodedTupleType ( SILGenFunction & SGF ) const & { <nl> + SILType loweredType = getLoweredType ( SGF ) ; <nl> + if ( loweredType . isAddressOnly ( SGF . getModule ( ) ) & & <nl> + SGF . silConv . useLoweredAddresses ( ) ) <nl> + return loweredType . getAddressType ( ) ; <nl> + return loweredType . getObjectType ( ) ; <nl> + } <nl> mmm a / lib / SILGen / RValue . h <nl> ppp b / lib / SILGen / RValue . h <nl> class RValue { <nl> / / / Return the type lowering of RValue : : getType ( ) . <nl> const Lowering : : TypeLowering & getTypeLowering ( SILGenFunction & SGF ) const & ; <nl> <nl> + / / / Return the lowered SILType that would be used to implode the given RValue <nl> + / / / into 1 tuple value . <nl> + / / / <nl> + / / / This means that if any sub - objects are address only , an address type will <nl> + / / / be returned . Otherwise , an object will be returned . So this is a <nl> + / / / convenient way to determine if an RValue needs an address . <nl> + SILType getLoweredImplodedTupleType ( SILGenFunction & SGF ) const & ; <nl> + <nl> / / / Rewrite the type of this r - value . <nl> void rewriteType ( CanType newType ) & { <nl> # ifndef NDEBUG <nl> mmm a / lib / SILGen / SGFContext . h <nl> ppp b / lib / SILGen / SGFContext . h <nl> class SGFContext { <nl> result . state . setInt ( state . getInt ( ) ) ; <nl> return result ; <nl> } <nl> + <nl> + / / / Get a context for a sub - expression where we plan to evaluate arbitrary <nl> + / / / side - effects . This means we propagate down the initialization , but <nl> + / / / eliminates the + 0 / + 1 - ness . <nl> + SGFContext withSubExprSideEffects ( ) const { <nl> + if ( auto * init = getEmitInto ( ) ) { <nl> + return SGFContext ( init ) ; <nl> + } <nl> + <nl> + return SGFContext ( ) ; <nl> + } <nl> } ; <nl> <nl> using ValueProducerRef = <nl> mmm a / lib / SILGen / SILGenExpr . cpp <nl> ppp b / lib / SILGen / SILGenExpr . cpp <nl> RValue SILGenFunction : : emitRValue ( Expr * E , SGFContext C ) { <nl> return RValueEmitter ( * this ) . visit ( E , C ) ; <nl> } <nl> <nl> + RValue SILGenFunction : : emitPlusOneRValue ( Expr * E , SGFContext C ) { <nl> + Scope S ( * this , SILLocation ( E ) ) ; <nl> + assert ( ! E - > getType ( ) - > hasLValueType ( ) & & <nl> + " l - values must be emitted with emitLValue " ) ; <nl> + return S . popPreservingValue ( <nl> + RValueEmitter ( * this ) . visit ( E , C . withSubExprSideEffects ( ) ) ) ; <nl> + } <nl> + <nl> + RValue SILGenFunction : : emitPlusZeroRValue ( Expr * E ) { <nl> + / / Check if E is a case that we know how to emit at plus zero . If so , handle <nl> + / / it here . <nl> + / / <nl> + / / TODO : Fill this in . <nl> + <nl> + / / Otherwise , we go through the + 1 path and borrow the result . <nl> + return emitPlusOneRValue ( E ) . borrow ( * this , SILLocation ( E ) ) ; <nl> + } <nl> + <nl> / / Evaluate the expression as an lvalue or rvalue , discarding the result . <nl> void SILGenFunction : : emitIgnoredExpr ( Expr * E ) { <nl> / / If this is a tuple expression , recursively ignore its elements . <nl> mmm a / lib / SILGen / SILGenFunction . h <nl> ppp b / lib / SILGen / SILGenFunction . h <nl> class LLVM_LIBRARY_VISIBILITY SILGenFunction <nl> / / / Emit the given expression as an r - value . <nl> RValue emitRValue ( Expr * E , SGFContext C = SGFContext ( ) ) ; <nl> <nl> + / / / Emit the given expression as a + 1 r - value . <nl> + / / / <nl> + / / / * NOTE * This creates the + 1 r - value and then pushes that + 1 r - value through <nl> + / / / a scope . So all temporaries resulting will be cleaned up . <nl> + / / / <nl> + / / / * NOTE * + 0 vs + 1 is ignored by this function . The only reason to use the <nl> + / / / SGFContext argument is to pass in an initialization . <nl> + RValue emitPlusOneRValue ( Expr * E , SGFContext C = SGFContext ( ) ) ; <nl> + <nl> + / / / Emit the given expression as a + 0 r - value . <nl> + / / / <nl> + / / / * NOTE * This does not scope the creation of the + 0 r - value . The reason why <nl> + / / / this is done is that + 0 r - values can not be pushed through scopes . <nl> + RValue emitPlusZeroRValue ( Expr * E ) ; <nl> + <nl> / / / Emit the given expression as an r - value with the given conversion <nl> / / / context . This may be more efficient mmm and , in some cases , <nl> / / / semantically different mmm than emitting the expression and then <nl> mmm a / lib / SILGen / Scope . cpp <nl> ppp b / lib / SILGen / Scope . cpp <nl> ManagedValue Scope : : popPreservingValue ( ManagedValue mv ) { <nl> return cloner . clone ( value ) ; <nl> } <nl> <nl> + / / Since we have an RValue , we know that RValue invariants imply that all <nl> + / / subvalues that are addresses must be address only types . Such address only <nl> + / / types if they are + 1 rvalues should be independent of any values from outside <nl> + / / the + 1 rvalue emission ( that is if someone else has a reference to the <nl> + / / address only type , we should have produced a copy ) . This means that it is <nl> + / / safe to move the value into new memory that is guaranteed to live through the <nl> + / / scope being pushed . As an additional complication due to SIL enforcing stack <nl> + / / ordering , we can not use a temporary stack location since any stack locations <nl> + / / that are inside the scope will be cleaned up while such a scope jumping stack <nl> + / / is still alive ( violating stack ordering ) . Instead we use an alloc_box to <nl> + / / store the new value . allocbox - to - stack will then reorder / expand the stack <nl> + / / lifetimes to resolve the issues . <nl> + static void lifetimeExtendAddressOnlyRValueSubValues ( <nl> + SILGenFunction & SGF , SILLocation loc , <nl> + llvm : : SmallVectorImpl < SILValue > & values , <nl> + llvm : : SmallVectorImpl < SILValue > & lifetimeExtendingBoxes ) { <nl> + for ( SILValue & v : values ) { <nl> + / / If v is not an address , it isn ' t interesting , continue . <nl> + if ( ! v - > getType ( ) . isAddress ( ) ) { <nl> + continue ; <nl> + } <nl> + <nl> + / / Otherwise , create the box and move the address only value into the box . <nl> + assert ( v - > getType ( ) . isAddressOnly ( SGF . getModule ( ) ) & & <nl> + " RValue invariants imply that all RValue subtypes that are " <nl> + " addresses must be address only . " ) ; <nl> + auto boxTy = SILBoxType : : get ( v - > getType ( ) . getSwiftRValueType ( ) ) ; <nl> + SILValue box = SGF . B . createAllocBox ( loc , boxTy ) ; <nl> + SILValue addr = SGF . B . createProjectBox ( loc , box , 0 ) ; <nl> + SGF . B . createCopyAddr ( loc , v , addr , IsTake , IsInitialization ) ; <nl> + <nl> + / / Then save the box so we create the box destroy in the caller and <nl> + / / overwrite v with the project box since that is where the value is now . <nl> + lifetimeExtendingBoxes . emplace_back ( box ) ; <nl> + v = addr ; <nl> + } <nl> + } <nl> + <nl> RValue Scope : : popPreservingValue ( RValue & & rv ) { <nl> - assert ( rv . isPlusOne ( cleanups . SGF ) & & <nl> - " Can only push plus one rvalues through a scope " ) ; <nl> - assert ( rv . getTypeLowering ( cleanups . SGF ) . isLoadable ( ) & & <nl> - " Can only push loadable + 1 rvalues through a scope " ) ; <nl> + auto & SGF = cleanups . SGF ; <nl> + assert ( rv . isPlusOne ( SGF ) & & " Can only push plus one rvalues through a scope " ) ; <nl> <nl> / / First gather all of the data that we need to recreate the RValue in the <nl> / / outer scope . <nl> CanType type = rv . type ; <nl> unsigned numEltsRemaining = rv . elementsToBeAdded ; <nl> - CleanupCloner cloner ( cleanups . SGF , rv ) ; <nl> + CleanupCloner cloner ( SGF , rv ) ; <nl> llvm : : SmallVector < SILValue , 4 > values ; <nl> - std : : move ( rv ) . forwardAll ( cleanups . SGF , values ) ; <nl> + std : : move ( rv ) . forwardAll ( SGF , values ) ; <nl> + <nl> + / / Lifetime any address only values that we may have . <nl> + llvm : : SmallVector < SILValue , 4 > lifetimeExtendingBoxes ; <nl> + lifetimeExtendAddressOnlyRValueSubValues ( SGF , loc , values , <nl> + lifetimeExtendingBoxes ) ; <nl> <nl> / / Then pop the cleanups . <nl> pop ( ) ; <nl> <nl> + / / Then create cleanups for any lifetime extending boxes that we may have to <nl> + / / ensure that the boxes are cleaned up / after / the value stored in the box . <nl> + for ( auto v : lifetimeExtendingBoxes ) { <nl> + SGF . emitManagedRValueWithCleanup ( v ) ; <nl> + } <nl> + <nl> / / Reconstruct the managed values from the underlying sil values in the outer <nl> / / scope . Since the RValue wants a std : : vector value , we use that instead . <nl> std : : vector < ManagedValue > managedValues ; <nl> RValue Scope : : popPreservingValue ( RValue & & rv ) { <nl> [ & cloner ] ( SILValue v ) - > ManagedValue { return cloner . clone ( v ) ; } ) ; <nl> <nl> / / And then assemble the managed values into a rvalue . <nl> - return RValue ( cleanups . SGF , std : : move ( managedValues ) , type , numEltsRemaining ) ; <nl> + return RValue ( SGF , std : : move ( managedValues ) , type , numEltsRemaining ) ; <nl> } <nl> <nl> void Scope : : popImpl ( ) { <nl> mmm a / lib / Sema / TypeCheckType . cpp <nl> ppp b / lib / Sema / TypeCheckType . cpp <nl> Type TypeResolver : : resolveCompositionType ( CompositionTypeRepr * repr , <nl> } ; <nl> <nl> for ( auto tyR : repr - > getTypes ( ) ) { <nl> - Type ty = TC . resolveType ( tyR , DC , withoutContext ( options ) , Resolver ) ; <nl> + Type ty = resolveType ( tyR , withoutContext ( options ) ) ; <nl> if ( ! ty | | ty - > hasError ( ) ) return ty ; <nl> <nl> auto nominalDecl = ty - > getAnyNominal ( ) ; <nl> new file mode 100644 <nl> index 000000000000 . . 06a8ba11121e <nl> mmm / dev / null <nl> ppp b / validation - test / compiler_crashers / 28836 - functy - hasarchetype . swift <nl> <nl> + / / This source file is part of the Swift . org open source project <nl> + / / Copyright ( c ) 2014 - 2017 Apple Inc . and the Swift project authors <nl> + / / Licensed under Apache License v2 . 0 with Runtime Library Exception <nl> + / / <nl> + / / See https : / / swift . org / LICENSE . txt for license information <nl> + / / See https : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> + <nl> + / / REQUIRES : asserts <nl> + / / RUN : not - - crash % target - swift - frontend % s - emit - ir <nl> + class a < a { protocol P { } func a { protocol P { class a : a { func a : P <nl> similarity index 87 % <nl> rename from validation - test / compiler_crashers / 28810 - swift - unqualifiedlookup - unqualifiedlookup - swift - declname - swift - declcontext - swift . swift <nl> rename to validation - test / compiler_crashers_fixed / 28810 - swift - unqualifiedlookup - unqualifiedlookup - swift - declname - swift - declcontext - swift . swift <nl> mmm a / validation - test / compiler_crashers / 28810 - swift - unqualifiedlookup - unqualifiedlookup - swift - declname - swift - declcontext - swift . swift <nl> ppp b / validation - test / compiler_crashers_fixed / 28810 - swift - unqualifiedlookup - unqualifiedlookup - swift - declname - swift - declcontext - swift . swift <nl> <nl> / / See https : / / swift . org / LICENSE . txt for license information <nl> / / See https : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> <nl> - / / RUN : not - - crash % target - swift - frontend % s - emit - ir <nl> + / / RUN : not % target - swift - frontend % s - emit - ir <nl> class A : a : a { } typealias a : A . a <nl> & Ms <nl> | Merge remote - tracking branch ' origin / master ' into master - next | apple/swift | 01cf4ce0d525f1f03141397ac404b0c52daf23cd | 2017-08-14T20:51:32Z |
mmm a / jvm - packages / xgboost4j - spark / src / main / scala / ml / dmlc / xgboost4j / scala / spark / params / GeneralParams . scala <nl> ppp b / jvm - packages / xgboost4j - spark / src / main / scala / ml / dmlc / xgboost4j / scala / spark / params / GeneralParams . scala <nl> private [ spark ] trait ParamMapFuncs extends Params { <nl> " and grow_histmaker , prune or hist as the updater type " ) <nl> } <nl> val name = CaseFormat . LOWER_UNDERSCORE . to ( CaseFormat . LOWER_CAMEL , paramName ) <nl> - params . find ( _ . name = = name ) match { <nl> - case None = > <nl> - case Some ( _ : DoubleParam ) = > <nl> + params . find ( _ . name = = name ) . foreach { <nl> + case _ : DoubleParam = > <nl> set ( name , paramValue . toString . toDouble ) <nl> - case Some ( _ : BooleanParam ) = > <nl> + case _ : BooleanParam = > <nl> set ( name , paramValue . toString . toBoolean ) <nl> - case Some ( _ : IntParam ) = > <nl> + case _ : IntParam = > <nl> set ( name , paramValue . toString . toInt ) <nl> - case Some ( _ : FloatParam ) = > <nl> + case _ : FloatParam = > <nl> set ( name , paramValue . toString . toFloat ) <nl> - case Some ( _ : Param [ _ ] ) = > <nl> + case _ : Param [ _ ] = > <nl> set ( name , paramValue ) <nl> } <nl> } <nl> mmm a / jvm - packages / xgboost4j - spark / src / main / scala / org / apache / spark / SparkParallelismTracker . scala <nl> ppp b / jvm - packages / xgboost4j - spark / src / main / scala / org / apache / spark / SparkParallelismTracker . scala <nl> <nl> <nl> package org . apache . spark <nl> <nl> - import java . net . URL <nl> - import java . util . concurrent . atomic . AtomicBoolean <nl> - <nl> import org . apache . commons . logging . LogFactory <nl> - <nl> import org . apache . spark . scheduler . _ <nl> - import org . codehaus . jackson . map . ObjectMapper <nl> - import scala . collection . JavaConverters . _ <nl> - import scala . concurrent . ExecutionContext . Implicits . global <nl> - import scala . concurrent . duration . _ <nl> - import scala . concurrent . { Await , Future , TimeoutException } <nl> - import scala . util . control . ControlThrowable <nl> <nl> / * * <nl> * A tracker that ensures enough number of executor cores are alive . <nl> class SparkParallelismTracker ( <nl> numWorkers : Int ) { <nl> <nl> private [ this ] val requestedCores = numWorkers * sc . conf . getInt ( " spark . task . cpus " , 1 ) <nl> - private [ this ] val mapper = new ObjectMapper ( ) <nl> private [ this ] val logger = LogFactory . getLog ( " XGBoostSpark " ) <nl> - private [ this ] val url = sc . uiWebUrl match { <nl> - case Some ( baseUrl ) = > new URL ( s " $ baseUrl / api / v1 / applications / $ { sc . applicationId } / executors " ) <nl> - case _ = > null <nl> - } <nl> <nl> private [ this ] def numAliveCores : Int = { <nl> - try { <nl> - if ( url ! = null ) { <nl> - mapper . readTree ( url ) . findValues ( " totalCores " ) . asScala . map ( _ . asInt ) . sum <nl> - } else { <nl> - Int . MaxValue <nl> - } <nl> - } catch { <nl> - case ex : Throwable = > <nl> - logger . warn ( s " Unable to read total number of alive cores from REST API . " + <nl> - s " Health Check will be ignored . " ) <nl> - ex . printStackTrace ( ) <nl> - Int . MaxValue <nl> - } <nl> + sc . statusStore . executorList ( true ) . map ( _ . totalCores ) . sum <nl> } <nl> <nl> private [ this ] def waitForCondition ( <nl> condition : = > Boolean , <nl> timeout : Long , <nl> checkInterval : Long = 100L ) = { <nl> - val monitor = Future { <nl> - while ( ! condition ) { <nl> - Thread . sleep ( checkInterval ) <nl> + val waitImpl = new ( ( Long , Boolean ) = > Boolean ) { <nl> + override def apply ( waitedTime : Long , status : Boolean ) : Boolean = status match { <nl> + case s if s = > true <nl> + case _ = > waitedTime match { <nl> + case t if t < timeout = > <nl> + Thread . sleep ( checkInterval ) <nl> + apply ( t + checkInterval , status = condition ) <nl> + case _ = > false <nl> + } <nl> } <nl> } <nl> - Await . ready ( monitor , timeout . millis ) <nl> + waitImpl ( 0L , condition ) <nl> } <nl> <nl> private [ this ] def safeExecute [ T ] ( body : = > T ) : T = { <nl> class SparkParallelismTracker ( <nl> logger . info ( " starting training without setting timeout for waiting for resources " ) <nl> body <nl> } else { <nl> - try { <nl> - logger . info ( s " starting training with timeout set as $ timeout ms for waiting for resources " ) <nl> - waitForCondition ( numAliveCores > = requestedCores , timeout ) <nl> - } catch { <nl> - case _ : TimeoutException = > <nl> - throw new IllegalStateException ( s " Unable to get $ requestedCores workers for " + <nl> - s " XGBoost training " ) <nl> + logger . info ( s " starting training with timeout set as $ timeout ms for waiting for resources " ) <nl> + if ( ! waitForCondition ( numAliveCores > = requestedCores , timeout ) ) { <nl> + throw new IllegalStateException ( s " Unable to get $ requestedCores cores for XGBoost training " ) <nl> } <nl> safeExecute ( body ) <nl> } <nl> | [ jvm - packages ] refine numAliveCores method of SparkParallelismTracker ( ) | dmlc/xgboost | 277e25797be4e35ff3e86bd59c1611c95f5734b1 | 2019-09-19T22:18:29Z |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.