diff
stringlengths
41
2.03M
msg
stringlengths
1
1.5k
repo
stringlengths
5
40
sha
stringlengths
40
40
time
stringlengths
20
20
mmm a / . gitattributes <nl> ppp b / . gitattributes <nl> <nl> <nl> * . binary filter = lfs diff = lfs merge = lfs - crlf <nl> + data / lm / trie filter = lfs diff = lfs merge = lfs - crlf <nl> mmm a / DeepSpeech . py <nl> ppp b / DeepSpeech . py <nl> <nl> from util . feeding import DataSet , ModelFeeder <nl> from util . gpu import get_available_gpus <nl> from util . shared_lib import check_cupti <nl> - from util . spell import correction <nl> from util . text import sparse_tensor_value_to_texts , wer , Alphabet <nl> from xdg import BaseDirectory as xdg <nl> import numpy as np <nl> <nl> tf . app . flags . DEFINE_float ( ' estop_mean_thresh ' , 0 . 5 , ' mean threshold for loss to determine the condition if early stopping is required ' ) <nl> tf . app . flags . DEFINE_float ( ' estop_std_thresh ' , 0 . 5 , ' standard deviation threshold for loss to determine the condition if early stopping is required ' ) <nl> <nl> + # Decoder <nl> + <nl> + tf . app . flags . DEFINE_string ( ' decoder_library_path ' , ' native_client / libctc_decoder_with_kenlm . so ' , ' path to the libctc_decoder_with_kenlm . so library containing the decoder implementation . ' ) <nl> tf . app . flags . DEFINE_string ( ' alphabet_config_path ' , ' data / alphabet . txt ' , ' path to the configuration file specifying the alphabet used by the network . See the comment in data / alphabet . txt for a description of the format . ' ) <nl> <nl> for var in [ ' b1 ' , ' h1 ' , ' b2 ' , ' h2 ' , ' b3 ' , ' h3 ' , ' b5 ' , ' h5 ' , ' b6 ' , ' h6 ' ] : <nl> def BiRNN ( batch_x , seq_length , dropout ) : <nl> # Output shape : [ n_steps , batch_size , n_hidden_6 ] <nl> return layer_6 <nl> <nl> + custom_op_module = tf . load_op_library ( FLAGS . decoder_library_path ) <nl> + <nl> + def decode_with_lm ( inputs , sequence_length , beam_width = 100 , <nl> + top_paths = 1 , merge_repeated = True ) : <nl> + " " " Performs beam search decoding on the logits given in input . <nl> + <nl> + * * Note * * The ` ctc_greedy_decoder ` is a special case of the <nl> + ` ctc_beam_search_decoder ` with ` top_paths = 1 ` and ` beam_width = 1 ` ( but <nl> + that decoder is faster for this special case ) . <nl> + <nl> + If ` merge_repeated ` is ` True ` , merge repeated classes in the output beams . <nl> + This means that if consecutive entries in a beam are the same , <nl> + only the first of these is emitted . That is , when the top path <nl> + is ` A B B B B ` , the return value is : <nl> + <nl> + * ` A B ` if ` merge_repeated = True ` . <nl> + * ` A B B B B ` if ` merge_repeated = False ` . <nl> + <nl> + Args : <nl> + inputs : 3 - D ` float ` ` Tensor ` , size <nl> + ` [ max_time x batch_size x num_classes ] ` . The logits . <nl> + sequence_length : 1 - D ` int32 ` vector containing sequence lengths , <nl> + having size ` [ batch_size ] ` . <nl> + beam_width : An int scalar > = 0 ( beam search beam width ) . <nl> + top_paths : An int scalar > = 0 , < = beam_width ( controls output size ) . <nl> + merge_repeated : Boolean . Default : True . <nl> + <nl> + Returns : <nl> + A tuple ` ( decoded , log_probabilities ) ` where <nl> + decoded : A list of length top_paths , where ` decoded [ j ] ` <nl> + is a ` SparseTensor ` containing the decoded outputs : <nl> + ` decoded [ j ] . indices ` : Indices matrix ` ( total_decoded_outputs [ j ] x 2 ) ` <nl> + The rows store : [ batch , time ] . <nl> + ` decoded [ j ] . values ` : Values vector , size ` ( total_decoded_outputs [ j ] ) ` . <nl> + The vector stores the decoded classes for beam j . <nl> + ` decoded [ j ] . shape ` : Shape vector , size ` ( 2 ) ` . <nl> + The shape values are : ` [ batch_size , max_decoded_length [ j ] ] ` . <nl> + log_probability : A ` float ` matrix ` ( batch_size x top_paths ) ` containing <nl> + sequence log - probabilities . <nl> + " " " <nl> + <nl> + decoded_ixs , decoded_vals , decoded_shapes , log_probabilities = ( <nl> + custom_op_module . ctc_beam_search_decoder_with_lm ( <nl> + inputs , sequence_length , model_path = " data / lm / lm . binary " , trie_path = " data / lm / trie " , alphabet_path = " data / alphabet . txt " , <nl> + beam_width = beam_width , top_paths = top_paths , merge_repeated = merge_repeated ) ) <nl> + <nl> + return ( <nl> + [ tf . SparseTensor ( ix , val , shape ) for ( ix , val , shape ) <nl> + in zip ( decoded_ixs , decoded_vals , decoded_shapes ) ] , <nl> + log_probabilities ) <nl> + <nl> + <nl> <nl> # Accuracy and Loss <nl> # = = = = = = = = = = = = = = = = = <nl> def calculate_mean_edit_distance_and_loss ( model_feeder , tower , dropout ) : <nl> avg_loss = tf . reduce_mean ( total_loss ) <nl> <nl> # Beam search decode the batch <nl> - decoded , _ = tf . nn . ctc_beam_search_decoder ( logits , batch_seq_len , merge_repeated = False ) <nl> + decoded , _ = decode_with_lm ( logits , batch_seq_len , merge_repeated = False , beam_width = 1024 ) <nl> <nl> # Compute the edit ( Levenshtein ) distance <nl> distance = tf . edit_distance ( tf . cast ( decoded [ 0 ] , tf . int32 ) , batch_y ) <nl> def calculate_report ( results_tuple ) : <nl> items = list ( zip ( * results_tuple ) ) <nl> mean_wer = 0 . 0 <nl> for label , decoding , distance , loss in items : <nl> - corrected = correction ( decoding , alphabet ) <nl> - sample_wer = wer ( label , corrected ) <nl> - sample = Sample ( label , corrected , loss , distance , sample_wer ) <nl> + sample_wer = wer ( label , decoding ) <nl> + sample = Sample ( label , decoding , loss , distance , sample_wer ) <nl> samples . append ( sample ) <nl> mean_wer + = sample_wer <nl> <nl> new file mode 100644 <nl> index 000000000 . . 8647af4fd <nl> mmm / dev / null <nl> ppp b / data / lm / trie <nl> <nl> + version https : / / git - lfs . github . com / spec / v1 <nl> + oid sha256 : 55da7b52ddb19f46301a31d56aff35ed1508fd9bd1e04d907114d89771892219 <nl> + size 43550329 <nl> mmm a / requirements . txt <nl> ppp b / requirements . txt <nl> python_speech_features <nl> pyxdg <nl> bs4 <nl> six <nl> - https : / / github . com / kpu / kenlm / archive / master . zip <nl> deleted file mode 100644 <nl> index 14d4f84f1 . . 000000000 <nl> mmm a / util / spell . py <nl> ppp / dev / null <nl> <nl> - from __future__ import absolute_import <nl> - import re <nl> - import kenlm <nl> - from heapq import heapify <nl> - from six . moves import range <nl> - <nl> - # Define beam with for alt sentence search <nl> - BEAM_WIDTH = 1024 <nl> - MODEL = None <nl> - <nl> - # Lazy - load language model ( TED corpus , Kneser - Ney , 4 - gram , 30k word LM ) <nl> - def get_model ( ) : <nl> - global MODEL <nl> - if MODEL is None : <nl> - MODEL = kenlm . Model ( ' . / data / lm / lm . binary ' ) <nl> - return MODEL <nl> - <nl> - def words ( text ) : <nl> - " List of words in text . " <nl> - return re . findall ( r ' \ w + ' , text . lower ( ) ) <nl> - <nl> - # Load known word set <nl> - with open ( ' . / data / spell / words . txt ' ) as f : <nl> - WORDS = set ( words ( f . read ( ) ) ) <nl> - <nl> - def log_probability ( sentence ) : <nl> - " Log base 10 probability of ` sentence ` , a list of words " <nl> - return get_model ( ) . score ( ' ' . join ( sentence ) , bos = False , eos = False ) <nl> - <nl> - def correction ( sentence , alphabet ) : <nl> - " Most probable spelling correction for sentence . " <nl> - layer = [ ( 0 , [ ] ) ] <nl> - for word in words ( sentence ) : <nl> - layer = [ ( - log_probability ( node + [ cword ] ) , node + [ cword ] ) for cword in candidate_words ( word , alphabet ) for priority , node in layer ] <nl> - heapify ( layer ) <nl> - layer = layer [ : BEAM_WIDTH ] <nl> - return ' ' . join ( layer [ 0 ] [ 1 ] ) <nl> - <nl> - def candidate_words ( word , alphabet ) : <nl> - " Generate possible spelling corrections for word . " <nl> - return ( known_words ( [ word ] ) or known_words ( edits1 ( word , alphabet ) ) or known_words ( edits2 ( word , alphabet ) ) or [ word ] ) <nl> - <nl> - def known_words ( words ) : <nl> - " The subset of ` words ` that appear in the dictionary of WORDS . " <nl> - return set ( w for w in words if w in WORDS ) <nl> - <nl> - def edits1 ( word , alphabet ) : <nl> - " All edits that are one edit away from ` word ` . " <nl> - letters = [ alphabet . string_from_label ( i ) for i in range ( alphabet . size ( ) ) ] <nl> - splits = [ ( word [ : i ] , word [ i : ] ) for i in range ( len ( word ) + 1 ) ] <nl> - deletes = [ L + R [ 1 : ] for L , R in splits if R ] <nl> - transposes = [ L + R [ 1 ] + R [ 0 ] + R [ 2 : ] for L , R in splits if len ( R ) > 1 ] <nl> - replaces = [ L + c + R [ 1 : ] for L , R in splits if R for c in letters ] <nl> - inserts = [ L + c + R for L , R in splits for c in letters ] <nl> - return set ( deletes + transposes + replaces + inserts ) <nl> - <nl> - def edits2 ( word , alphabet ) : <nl> - " All edits that are two edits away from ` word ` . " <nl> - return ( e2 for e1 in edits1 ( word , alphabet ) for e2 in edits1 ( e1 , alphabet ) ) <nl>
Remove current re - scoring of decoder output and switch to custom op
mozilla/DeepSpeech
2cccd334527380b3da3f4d39aac06c7879ee089f
2017-09-13T14:41:15Z
mmm a / 3rdParty / libev / Makefile . am <nl> ppp b / 3rdParty / libev / Makefile . am <nl> VERSION_INFO = 4 : 0 : 0 <nl> EXTRA_DIST = LICENSE Changes libev . m4 autogen . sh \ <nl> ev_vars . h ev_wrap . h \ <nl> ev_epoll . c ev_select . c ev_poll . c ev_kqueue . c ev_port . c ev_win32 . c \ <nl> - ev . 3 ev . pod Symbols . ev Symbols . event <nl> + Symbols . ev Symbols . event <nl> <nl> include_HEADERS = ev . h ev + + . h event . h <nl> <nl>
don ' t generate pod2man
arangodb/arangodb
4473a08461cd7ee73909ec52be2e50c242f64de3
2013-09-05T12:23:50Z
mmm a / lib / AST / NameLookupImpl . h <nl> ppp b / lib / AST / NameLookupImpl . h <nl> class FindLocalVal : public StmtVisitor < FindLocalVal > { <nl> } <nl> <nl> void checkStmtCondition ( const StmtCondition & Cond ) { <nl> - for ( auto entry : Cond ) <nl> - if ( auto * P = entry . getPatternOrNull ( ) ) <nl> - if ( ! isReferencePointInRange ( entry . getSourceRange ( ) ) ) <nl> + SourceLoc start = SourceLoc ( ) ; <nl> + for ( auto entry : Cond ) { <nl> + if ( start . isInvalid ( ) ) <nl> + start = entry . getStartLoc ( ) ; <nl> + if ( auto * P = entry . getPatternOrNull ( ) ) { <nl> + SourceRange previousConditionsToHere = SourceRange ( start , entry . getEndLoc ( ) ) ; <nl> + if ( ! isReferencePointInRange ( previousConditionsToHere ) ) <nl> checkPattern ( P , DeclVisibilityKind : : LocalVariable ) ; <nl> + } <nl> + } <nl> } <nl> <nl> void visitIfStmt ( IfStmt * S ) { <nl> mmm a / test / NameBinding / name_lookup . swift <nl> ppp b / test / NameBinding / name_lookup . swift <nl> func foo1 ( ) { <nl> _ = MyGenericEnum < Int > . One / / expected - error { { enum type ' MyGenericEnum < Int > ' has no case ' One ' ; did you mean ' one ' } } { { 26 - 29 = one } } <nl> _ = MyGenericEnum < Int > . OneTwo / / expected - error { { enum type ' MyGenericEnum < Int > ' has no case ' OneTwo ' ; did you mean ' oneTwo ' } } { { 26 - 32 = oneTwo } } <nl> } <nl> + <nl> + / / SR - 4082 <nl> + func foo2 ( ) { <nl> + let x = 5 <nl> + if x < 0 , let x = Optional ( 1 ) { } / / expected - warning { { immutable value ' x ' was never used ; consider replacing with ' _ ' or removing it } } <nl> + } <nl>
Merge pull request from gregomni / 4082
apple/swift
5ff7fa60f3ad9f084f29d3f80bf6232700df424f
2017-10-14T20:07:36Z
mmm a / examples / objective - c / helloworld_macos / README . md <nl> ppp b / examples / objective - c / helloworld_macos / README . md <nl> <nl> # gRPC Objective - C Mac OS Hello World Example <nl> <nl> - A hello world example app on Mac OS . Note that Mac OS is not first class supported platform of gRPC <nl> - Objective - C library . This example is only for the reference of users who would like to try with it . <nl> + A hello world example app on Mac OS . Note that Mac OS is not a first class supported platform of gRPC <nl> + Objective - C library . This example is only for reference . <nl> <nl> Refer to [ Hello World Example ] ( . . / helloworld ) for instructions on installation and running . <nl>
Update comments
grpc/grpc
77c4e956de3f49d83d8ce24df684ea5cf7c33c96
2018-10-31T17:23:21Z
mmm a / src / core / CMakeLists . txt <nl> ppp b / src / core / CMakeLists . txt <nl> set ( HEADERS <nl> <nl> create_directory_groups ( $ { SRCS } $ { HEADERS } ) <nl> add_library ( core STATIC $ { SRCS } $ { HEADERS } ) <nl> - target_link_libraries ( core PUBLIC common PRIVATE audio_core video_core ) <nl> + target_link_libraries ( core PUBLIC common PRIVATE audio_core network video_core ) <nl> target_link_libraries ( core PUBLIC Boost : : boost PRIVATE cryptopp dynarmic fmt ) <nl> if ( ENABLE_WEB_SERVICE ) <nl> target_link_libraries ( core PUBLIC json - headers web_service ) <nl> mmm a / src / core / core . cpp <nl> ppp b / src / core / core . cpp <nl> <nl> # include " core / loader / loader . h " <nl> # include " core / memory_setup . h " <nl> # include " core / settings . h " <nl> + # include " network / network . h " <nl> # include " video_core / video_core . h " <nl> <nl> namespace Core { <nl> void System : : Shutdown ( ) { <nl> cpu_core = nullptr ; <nl> app_loader = nullptr ; <nl> telemetry_session = nullptr ; <nl> + if ( auto room_member = Network : : GetRoomMember ( ) . lock ( ) ) { <nl> + Network : : GameInfo game_info { } ; <nl> + room_member - > SendGameInfo ( game_info ) ; <nl> + } <nl> <nl> LOG_DEBUG ( Core , " Shutdown OK " ) ; <nl> } <nl> mmm a / src / core / loader / ncch . cpp <nl> ppp b / src / core / loader / ncch . cpp <nl> <nl> # include " core / loader / ncch . h " <nl> # include " core / loader / smdh . h " <nl> # include " core / memory . h " <nl> + # include " network / network . h " <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / Loader namespace <nl> ResultStatus AppLoader_NCCH : : Load ( ) { <nl> <nl> Core : : Telemetry ( ) . AddField ( Telemetry : : FieldType : : Session , " ProgramId " , program_id ) ; <nl> <nl> + if ( auto room_member = Network : : GetRoomMember ( ) . lock ( ) ) { <nl> + Network : : GameInfo game_info ; <nl> + ReadTitle ( game_info . name ) ; <nl> + game_info . id = ncch_header . program_id ; <nl> + room_member - > SendGameInfo ( game_info ) ; <nl> + } <nl> + <nl> is_loaded = true ; / / Set state to loaded <nl> <nl> result = LoadExec ( ) ; / / Load the executable into memory for booting <nl> mmm a / src / network / packet . cpp <nl> ppp b / src / network / packet . cpp <nl> <nl> <nl> namespace Network { <nl> <nl> + # ifndef htonll <nl> + u64 htonll ( u64 x ) { <nl> + return ( ( 1 = = htonl ( 1 ) ) ? ( x ) : ( ( uint64_t ) htonl ( ( x ) & 0xFFFFFFFF ) < < 32 ) | htonl ( ( x ) > > 32 ) ) ; <nl> + } <nl> + # endif <nl> + <nl> + # ifndef ntohll <nl> + u64 ntohll ( u64 x ) { <nl> + return ( ( 1 = = ntohl ( 1 ) ) ? ( x ) : ( ( uint64_t ) ntohl ( ( x ) & 0xFFFFFFFF ) < < 32 ) | ntohl ( ( x ) > > 32 ) ) ; <nl> + } <nl> + # endif <nl> + <nl> void Packet : : Append ( const void * in_data , std : : size_t size_in_bytes ) { <nl> if ( in_data & & ( size_in_bytes > 0 ) ) { <nl> std : : size_t start = data . size ( ) ; <nl> Packet & Packet : : operator > > ( u32 & out_data ) { <nl> return * this ; <nl> } <nl> <nl> + Packet & Packet : : operator > > ( s64 & out_data ) { <nl> + s64 value ; <nl> + Read ( & value , sizeof ( value ) ) ; <nl> + out_data = ntohll ( value ) ; <nl> + return * this ; <nl> + } <nl> + <nl> + Packet & Packet : : operator > > ( u64 & out_data ) { <nl> + u64 value ; <nl> + Read ( & value , sizeof ( value ) ) ; <nl> + out_data = ntohll ( value ) ; <nl> + return * this ; <nl> + } <nl> + <nl> Packet & Packet : : operator > > ( float & out_data ) { <nl> Read ( & out_data , sizeof ( out_data ) ) ; <nl> return * this ; <nl> Packet & Packet : : operator < < ( u32 in_data ) { <nl> return * this ; <nl> } <nl> <nl> + Packet & Packet : : operator < < ( s64 in_data ) { <nl> + s64 toWrite = htonll ( in_data ) ; <nl> + Append ( & toWrite , sizeof ( toWrite ) ) ; <nl> + return * this ; <nl> + } <nl> + <nl> + Packet & Packet : : operator < < ( u64 in_data ) { <nl> + u64 toWrite = htonll ( in_data ) ; <nl> + Append ( & toWrite , sizeof ( toWrite ) ) ; <nl> + return * this ; <nl> + } <nl> + <nl> Packet & Packet : : operator < < ( float in_data ) { <nl> Append ( & in_data , sizeof ( in_data ) ) ; <nl> return * this ; <nl> mmm a / src / network / packet . h <nl> ppp b / src / network / packet . h <nl> class Packet { <nl> Packet & operator > > ( u16 & out_data ) ; <nl> Packet & operator > > ( s32 & out_data ) ; <nl> Packet & operator > > ( u32 & out_data ) ; <nl> + Packet & operator > > ( s64 & out_data ) ; <nl> + Packet & operator > > ( u64 & out_data ) ; <nl> Packet & operator > > ( float & out_data ) ; <nl> Packet & operator > > ( double & out_data ) ; <nl> Packet & operator > > ( char * out_data ) ; <nl> class Packet { <nl> Packet & operator < < ( u16 in_data ) ; <nl> Packet & operator < < ( s32 in_data ) ; <nl> Packet & operator < < ( u32 in_data ) ; <nl> + Packet & operator < < ( s64 in_data ) ; <nl> + Packet & operator < < ( u64 in_data ) ; <nl> Packet & operator < < ( float in_data ) ; <nl> Packet & operator < < ( double in_data ) ; <nl> Packet & operator < < ( const char * in_data ) ; <nl> mmm a / src / network / room . cpp <nl> ppp b / src / network / room . cpp <nl> <nl> <nl> # include < algorithm > <nl> # include < atomic > <nl> + # include < mutex > <nl> # include < random > <nl> # include < thread > <nl> - # include < vector > <nl> # include " enet / enet . h " <nl> # include " network / packet . h " <nl> # include " network / room . h " <nl> class Room : : RoomImpl { <nl> <nl> struct Member { <nl> std : : string nickname ; / / / < The nickname of the member . <nl> - std : : string game_name ; / / / < The current game of the member <nl> + GameInfo game_info ; / / / < The current game of the member <nl> MacAddress mac_address ; / / / < The assigned mac address of the member . <nl> ENetPeer * peer ; / / / < The remote peer . <nl> } ; <nl> using MemberList = std : : vector < Member > ; <nl> - MemberList members ; / / / < Information about the members of this room . <nl> + MemberList members ; / / / < Information about the members of this room <nl> + mutable std : : mutex member_mutex ; / / / < Mutex for locking the members list <nl> + / / / This should be a std : : shared_mutex as soon as C + + 17 is supported <nl> <nl> RoomImpl ( ) <nl> : random_gen ( std : : random_device ( ) ( ) ) , NintendoOUI { 0x00 , 0x1F , 0x32 , 0x00 , 0x00 , 0x00 } { } <nl> void Room : : RoomImpl : : ServerLoop ( ) { <nl> case IdJoinRequest : <nl> HandleJoinRequest ( & event ) ; <nl> break ; <nl> - case IdSetGameName : <nl> + case IdSetGameInfo : <nl> HandleGameNamePacket ( & event ) ; <nl> break ; <nl> case IdWifiPacket : <nl> void Room : : RoomImpl : : HandleJoinRequest ( const ENetEvent * event ) { <nl> member . nickname = nickname ; <nl> member . peer = event - > peer ; <nl> <nl> - members . push_back ( std : : move ( member ) ) ; <nl> + { <nl> + std : : lock_guard < std : : mutex > lock ( member_mutex ) ; <nl> + members . push_back ( std : : move ( member ) ) ; <nl> + } <nl> <nl> / / Notify everyone that the room information has changed . <nl> BroadcastRoomInformation ( ) ; <nl> void Room : : RoomImpl : : HandleJoinRequest ( const ENetEvent * event ) { <nl> bool Room : : RoomImpl : : IsValidNickname ( const std : : string & nickname ) const { <nl> / / A nickname is valid if it is not already taken by anybody else in the room . <nl> / / TODO ( B3N30 ) : Check for empty names , spaces , etc . <nl> + std : : lock_guard < std : : mutex > lock ( member_mutex ) ; <nl> return std : : all_of ( members . begin ( ) , members . end ( ) , <nl> [ & nickname ] ( const auto & member ) { return member . nickname ! = nickname ; } ) ; <nl> } <nl> <nl> bool Room : : RoomImpl : : IsValidMacAddress ( const MacAddress & address ) const { <nl> / / A MAC address is valid if it is not already taken by anybody else in the room . <nl> + std : : lock_guard < std : : mutex > lock ( member_mutex ) ; <nl> return std : : all_of ( members . begin ( ) , members . end ( ) , <nl> [ & address ] ( const auto & member ) { return member . mac_address ! = address ; } ) ; <nl> } <nl> void Room : : RoomImpl : : SendCloseMessage ( ) { <nl> packet < < static_cast < u8 > ( IdCloseRoom ) ; <nl> ENetPacket * enet_packet = <nl> enet_packet_create ( packet . GetData ( ) , packet . GetDataSize ( ) , ENET_PACKET_FLAG_RELIABLE ) ; <nl> + std : : lock_guard < std : : mutex > lock ( member_mutex ) ; <nl> for ( auto & member : members ) { <nl> enet_peer_send ( member . peer , 0 , enet_packet ) ; <nl> } <nl> void Room : : RoomImpl : : BroadcastRoomInformation ( ) { <nl> packet < < room_information . member_slots ; <nl> <nl> packet < < static_cast < u32 > ( members . size ( ) ) ; <nl> - for ( const auto & member : members ) { <nl> - packet < < member . nickname ; <nl> - packet < < member . mac_address ; <nl> - packet < < member . game_name ; <nl> + { <nl> + std : : lock_guard < std : : mutex > lock ( member_mutex ) ; <nl> + for ( const auto & member : members ) { <nl> + packet < < member . nickname ; <nl> + packet < < member . mac_address ; <nl> + packet < < member . game_info . name ; <nl> + packet < < member . game_info . id ; <nl> + } <nl> } <nl> <nl> ENetPacket * enet_packet = <nl> void Room : : RoomImpl : : HandleWifiPacket ( const ENetEvent * event ) { <nl> ENET_PACKET_FLAG_RELIABLE ) ; <nl> <nl> if ( destination_address = = BroadcastMac ) { / / Send the data to everyone except the sender <nl> + std : : lock_guard < std : : mutex > lock ( member_mutex ) ; <nl> for ( const auto & member : members ) { <nl> if ( member . peer ! = event - > peer ) <nl> enet_peer_send ( member . peer , 0 , enet_packet ) ; <nl> } <nl> } else { / / Send the data only to the destination client <nl> + std : : lock_guard < std : : mutex > lock ( member_mutex ) ; <nl> auto member = std : : find_if ( members . begin ( ) , members . end ( ) , <nl> [ destination_address ] ( const Member & member ) - > bool { <nl> return member . mac_address = = destination_address ; <nl> void Room : : RoomImpl : : HandleChatPacket ( const ENetEvent * event ) { <nl> auto CompareNetworkAddress = [ event ] ( const Member member ) - > bool { <nl> return member . peer = = event - > peer ; <nl> } ; <nl> + <nl> + std : : lock_guard < std : : mutex > lock ( member_mutex ) ; <nl> const auto sending_member = std : : find_if ( members . begin ( ) , members . end ( ) , CompareNetworkAddress ) ; <nl> if ( sending_member = = members . end ( ) ) { <nl> return ; / / Received a chat message from a unknown sender <nl> void Room : : RoomImpl : : HandleGameNamePacket ( const ENetEvent * event ) { <nl> in_packet . Append ( event - > packet - > data , event - > packet - > dataLength ) ; <nl> <nl> in_packet . IgnoreBytes ( sizeof ( u8 ) ) ; / / Igonore the message type <nl> - std : : string game_name ; <nl> - in_packet > > game_name ; <nl> - auto member = <nl> - std : : find_if ( members . begin ( ) , members . end ( ) , <nl> - [ event ] ( const Member & member ) - > bool { return member . peer = = event - > peer ; } ) ; <nl> - if ( member ! = members . end ( ) ) { <nl> - member - > game_name = game_name ; <nl> - BroadcastRoomInformation ( ) ; <nl> + GameInfo game_info ; <nl> + in_packet > > game_info . name ; <nl> + in_packet > > game_info . id ; <nl> + <nl> + { <nl> + std : : lock_guard < std : : mutex > lock ( member_mutex ) ; <nl> + auto member = <nl> + std : : find_if ( members . begin ( ) , members . end ( ) , [ event ] ( const Member & member ) - > bool { <nl> + return member . peer = = event - > peer ; <nl> + } ) ; <nl> + if ( member ! = members . end ( ) ) { <nl> + member - > game_info = game_info ; <nl> + } <nl> } <nl> + BroadcastRoomInformation ( ) ; <nl> } <nl> <nl> void Room : : RoomImpl : : HandleClientDisconnection ( ENetPeer * client ) { <nl> / / Remove the client from the members list . <nl> - members . erase ( std : : remove_if ( members . begin ( ) , members . end ( ) , <nl> - [ client ] ( const Member & member ) { return member . peer = = client ; } ) , <nl> - members . end ( ) ) ; <nl> + { <nl> + std : : lock_guard < std : : mutex > lock ( member_mutex ) ; <nl> + members . erase ( <nl> + std : : remove_if ( members . begin ( ) , members . end ( ) , <nl> + [ client ] ( const Member & member ) { return member . peer = = client ; } ) , <nl> + members . end ( ) ) ; <nl> + } <nl> <nl> / / Announce the change to all clients . <nl> enet_peer_disconnect ( client , 0 ) ; <nl> const RoomInformation & Room : : GetRoomInformation ( ) const { <nl> return room_impl - > room_information ; <nl> } <nl> <nl> + std : : vector < Room : : Member > Room : : GetRoomMemberList ( ) const { <nl> + std : : vector < Room : : Member > member_list ; <nl> + std : : lock_guard < std : : mutex > lock ( room_impl - > member_mutex ) ; <nl> + for ( const auto & member_impl : room_impl - > members ) { <nl> + Member member ; <nl> + member . nickname = member_impl . nickname ; <nl> + member . mac_address = member_impl . mac_address ; <nl> + member . game_info = member_impl . game_info ; <nl> + member_list . push_back ( member ) ; <nl> + } <nl> + return member_list ; <nl> + } ; <nl> + <nl> void Room : : Destroy ( ) { <nl> room_impl - > state = State : : Closed ; <nl> room_impl - > room_thread - > join ( ) ; <nl> void Room : : Destroy ( ) { <nl> } <nl> room_impl - > room_information = { } ; <nl> room_impl - > server = nullptr ; <nl> - room_impl - > members . clear ( ) ; <nl> + { <nl> + std : : lock_guard < std : : mutex > lock ( room_impl - > member_mutex ) ; <nl> + room_impl - > members . clear ( ) ; <nl> + } <nl> room_impl - > room_information . member_slots = 0 ; <nl> room_impl - > room_information . name . clear ( ) ; <nl> } <nl> mmm a / src / network / room . h <nl> ppp b / src / network / room . h <nl> <nl> # include < array > <nl> # include < memory > <nl> # include < string > <nl> + # include < vector > <nl> # include " common / common_types . h " <nl> <nl> namespace Network { <nl> struct RoomInformation { <nl> u32 member_slots ; / / / < Maximum number of members in this room <nl> } ; <nl> <nl> + struct GameInfo { <nl> + std : : string name { " " } ; <nl> + u64 id { 0 } ; <nl> + } ; <nl> + <nl> using MacAddress = std : : array < u8 , 6 > ; <nl> / / / A special MAC address that tells the room we ' re joining to assign us a MAC address <nl> / / / automatically . <nl> enum RoomMessageTypes : u8 { <nl> IdJoinRequest = 1 , <nl> IdJoinSuccess , <nl> IdRoomInformation , <nl> - IdSetGameName , <nl> + IdSetGameInfo , <nl> IdWifiPacket , <nl> IdChatMessage , <nl> IdNameCollision , <nl> class Room final { <nl> Closed , / / / < The room is not opened and can not accept connections . <nl> } ; <nl> <nl> + struct Member { <nl> + std : : string nickname ; / / / < The nickname of the member . <nl> + GameInfo game_info ; / / / < The current game of the member <nl> + MacAddress mac_address ; / / / < The assigned mac address of the member . <nl> + } ; <nl> + <nl> Room ( ) ; <nl> ~ Room ( ) ; <nl> <nl> class Room final { <nl> * / <nl> const RoomInformation & GetRoomInformation ( ) const ; <nl> <nl> + / * * <nl> + * Gets a list of the mbmers connected to the room . <nl> + * / <nl> + std : : vector < Member > GetRoomMemberList ( ) const ; <nl> + <nl> / * * <nl> * Creates the socket for this room . Will bind to default address if <nl> * server is empty string . <nl> mmm a / src / network / room_member . cpp <nl> ppp b / src / network / room_member . cpp <nl> <nl> # include < atomic > <nl> # include < list > <nl> # include < mutex > <nl> + # include < set > <nl> # include < thread > <nl> # include " common / assert . h " <nl> # include " enet / enet . h " <nl> class RoomMember : : RoomMemberImpl { <nl> / / / Information about the room we ' re connected to . <nl> RoomInformation room_information ; <nl> <nl> + / / / The current game name , id and version <nl> + GameInfo current_game_info ; <nl> + <nl> std : : atomic < State > state { State : : Idle } ; / / / < Current state of the RoomMember . <nl> void SetState ( const State new_state ) ; <nl> bool IsConnected ( ) const ; <nl> class RoomMember : : RoomMemberImpl { <nl> std : : unique_ptr < std : : thread > loop_thread ; <nl> std : : mutex send_list_mutex ; / / / < Mutex that controls access to the ` send_list ` variable . <nl> std : : list < Packet > send_list ; / / / < A list that stores all packets to send the async <nl> + <nl> + template < typename T > <nl> + using CallbackSet = std : : set < CallbackHandle < T > > ; <nl> + std : : mutex callback_mutex ; / / / < The mutex used for handling callbacks <nl> + <nl> + class Callbacks { <nl> + public : <nl> + template < typename T > <nl> + CallbackSet < T > & Get ( ) ; <nl> + <nl> + private : <nl> + CallbackSet < WifiPacket > callback_set_wifi_packet ; <nl> + CallbackSet < ChatEntry > callback_set_chat_messages ; <nl> + CallbackSet < RoomInformation > callback_set_room_information ; <nl> + CallbackSet < State > callback_set_state ; <nl> + } ; <nl> + Callbacks callbacks ; / / / < All CallbackSets to all events <nl> + <nl> void MemberLoop ( ) ; <nl> <nl> void StartLoop ( ) ; <nl> class RoomMember : : RoomMemberImpl { <nl> * Disconnects the RoomMember from the Room <nl> * / <nl> void Disconnect ( ) ; <nl> + <nl> + template < typename T > <nl> + void Invoke ( const T & data ) ; <nl> + <nl> + template < typename T > <nl> + CallbackHandle < T > Bind ( std : : function < void ( const T & ) > callback ) ; <nl> } ; <nl> <nl> / / RoomMemberImpl <nl> void RoomMember : : RoomMemberImpl : : SetState ( const State new_state ) { <nl> - state = new_state ; <nl> - / / TODO ( B3N30 ) : Invoke the callback functions <nl> + if ( state ! = new_state ) { <nl> + state = new_state ; <nl> + Invoke < State > ( state ) ; <nl> + } <nl> } <nl> <nl> bool RoomMember : : RoomMemberImpl : : IsConnected ( ) const { <nl> void RoomMember : : RoomMemberImpl : : HandleRoomInformationPacket ( const ENetEvent * ev <nl> for ( auto & member : member_information ) { <nl> packet > > member . nickname ; <nl> packet > > member . mac_address ; <nl> - packet > > member . game_name ; <nl> + packet > > member . game_info . name ; <nl> + packet > > member . game_info . id ; <nl> } <nl> - / / TODO ( B3N30 ) : Invoke callbacks <nl> + Invoke ( room_information ) ; <nl> } <nl> <nl> void RoomMember : : RoomMemberImpl : : HandleJoinPacket ( const ENetEvent * event ) { <nl> void RoomMember : : RoomMemberImpl : : HandleJoinPacket ( const ENetEvent * event ) { <nl> <nl> / / Parse the MAC Address from the packet <nl> packet > > mac_address ; <nl> - / / TODO ( B3N30 ) : Invoke callbacks <nl> + SetState ( State : : Joined ) ; <nl> } <nl> <nl> void RoomMember : : RoomMemberImpl : : HandleWifiPackets ( const ENetEvent * event ) { <nl> void RoomMember : : RoomMemberImpl : : HandleWifiPackets ( const ENetEvent * event ) { <nl> <nl> packet > > wifi_packet . data ; <nl> <nl> - / / TODO ( B3N30 ) : Invoke callbacks <nl> + Invoke < WifiPacket > ( wifi_packet ) ; <nl> } <nl> <nl> void RoomMember : : RoomMemberImpl : : HandleChatPacket ( const ENetEvent * event ) { <nl> void RoomMember : : RoomMemberImpl : : HandleChatPacket ( const ENetEvent * event ) { <nl> ChatEntry chat_entry { } ; <nl> packet > > chat_entry . nickname ; <nl> packet > > chat_entry . message ; <nl> - / / TODO ( B3N30 ) : Invoke callbacks <nl> + Invoke < ChatEntry > ( chat_entry ) ; <nl> } <nl> <nl> void RoomMember : : RoomMemberImpl : : Disconnect ( ) { <nl> void RoomMember : : RoomMemberImpl : : Disconnect ( ) { <nl> server = nullptr ; <nl> } <nl> <nl> + template < > <nl> + RoomMember : : RoomMemberImpl : : CallbackSet < WifiPacket > & RoomMember : : RoomMemberImpl : : Callbacks : : Get ( ) { <nl> + return callback_set_wifi_packet ; <nl> + } <nl> + <nl> + template < > <nl> + RoomMember : : RoomMemberImpl : : CallbackSet < RoomMember : : State > & <nl> + RoomMember : : RoomMemberImpl : : Callbacks : : Get ( ) { <nl> + return callback_set_state ; <nl> + } <nl> + <nl> + template < > <nl> + RoomMember : : RoomMemberImpl : : CallbackSet < RoomInformation > & <nl> + RoomMember : : RoomMemberImpl : : Callbacks : : Get ( ) { <nl> + return callback_set_room_information ; <nl> + } <nl> + <nl> + template < > <nl> + RoomMember : : RoomMemberImpl : : CallbackSet < ChatEntry > & RoomMember : : RoomMemberImpl : : Callbacks : : Get ( ) { <nl> + return callback_set_chat_messages ; <nl> + } <nl> + <nl> + template < typename T > <nl> + void RoomMember : : RoomMemberImpl : : Invoke ( const T & data ) { <nl> + std : : lock_guard < std : : mutex > lock ( callback_mutex ) ; <nl> + CallbackSet < T > callback_set = callbacks . Get < T > ( ) ; <nl> + for ( auto const & callback : callback_set ) <nl> + ( * callback ) ( data ) ; <nl> + } <nl> + <nl> + template < typename T > <nl> + RoomMember : : CallbackHandle < T > RoomMember : : RoomMemberImpl : : Bind ( <nl> + std : : function < void ( const T & ) > callback ) { <nl> + std : : lock_guard < std : : mutex > lock ( callback_mutex ) ; <nl> + CallbackHandle < T > handle ; <nl> + handle = std : : make_shared < std : : function < void ( const T & ) > > ( callback ) ; <nl> + callbacks . Get < T > ( ) . insert ( handle ) ; <nl> + return handle ; <nl> + } <nl> + <nl> / / RoomMember <nl> RoomMember : : RoomMember ( ) : room_member_impl { std : : make_unique < RoomMemberImpl > ( ) } { <nl> room_member_impl - > client = enet_host_create ( nullptr , 1 , NumChannels , 0 , 0 ) ; <nl> void RoomMember : : Join ( const std : : string & nick , const char * server_addr , u16 serv <nl> room_member_impl - > SetState ( State : : Joining ) ; <nl> room_member_impl - > StartLoop ( ) ; <nl> room_member_impl - > SendJoinRequest ( nick , preferred_mac ) ; <nl> + SendGameInfo ( room_member_impl - > current_game_info ) ; <nl> } else { <nl> room_member_impl - > SetState ( State : : CouldNotConnect ) ; <nl> } <nl> void RoomMember : : SendChatMessage ( const std : : string & message ) { <nl> room_member_impl - > Send ( std : : move ( packet ) ) ; <nl> } <nl> <nl> - void RoomMember : : SendGameName ( const std : : string & game_name ) { <nl> + void RoomMember : : SendGameInfo ( const GameInfo & game_info ) { <nl> + room_member_impl - > current_game_info = game_info ; <nl> + if ( ! IsConnected ( ) ) <nl> + return ; <nl> + <nl> Packet packet ; <nl> - packet < < static_cast < u8 > ( IdSetGameName ) ; <nl> - packet < < game_name ; <nl> + packet < < static_cast < u8 > ( IdSetGameInfo ) ; <nl> + packet < < game_info . name ; <nl> + packet < < game_info . id ; <nl> room_member_impl - > Send ( std : : move ( packet ) ) ; <nl> } <nl> <nl> + RoomMember : : CallbackHandle < RoomMember : : State > RoomMember : : BindOnStateChanged ( <nl> + std : : function < void ( const RoomMember : : State & ) > callback ) { <nl> + return room_member_impl - > Bind ( callback ) ; <nl> + } <nl> + <nl> + RoomMember : : CallbackHandle < WifiPacket > RoomMember : : BindOnWifiPacketReceived ( <nl> + std : : function < void ( const WifiPacket & ) > callback ) { <nl> + return room_member_impl - > Bind ( callback ) ; <nl> + } <nl> + <nl> + RoomMember : : CallbackHandle < RoomInformation > RoomMember : : BindOnRoomInformationChanged ( <nl> + std : : function < void ( const RoomInformation & ) > callback ) { <nl> + return room_member_impl - > Bind ( callback ) ; <nl> + } <nl> + <nl> + RoomMember : : CallbackHandle < ChatEntry > RoomMember : : BindOnChatMessageRecieved ( <nl> + std : : function < void ( const ChatEntry & ) > callback ) { <nl> + return room_member_impl - > Bind ( callback ) ; <nl> + } <nl> + <nl> + template < typename T > <nl> + void RoomMember : : Unbind ( CallbackHandle < T > handle ) { <nl> + std : : lock_guard < std : : mutex > lock ( room_member_impl - > callback_mutex ) ; <nl> + room_member_impl - > callbacks . Get < T > ( ) . erase ( handle ) ; <nl> + } <nl> + <nl> void RoomMember : : Leave ( ) { <nl> room_member_impl - > SetState ( State : : Idle ) ; <nl> room_member_impl - > loop_thread - > join ( ) ; <nl> room_member_impl - > loop_thread . reset ( ) ; <nl> } <nl> <nl> + template void RoomMember : : Unbind ( CallbackHandle < WifiPacket > ) ; <nl> + template void RoomMember : : Unbind ( CallbackHandle < RoomMember : : State > ) ; <nl> + template void RoomMember : : Unbind ( CallbackHandle < RoomInformation > ) ; <nl> + template void RoomMember : : Unbind ( CallbackHandle < ChatEntry > ) ; <nl> + <nl> } / / namespace Network <nl> mmm a / src / network / room_member . h <nl> ppp b / src / network / room_member . h <nl> <nl> <nl> # pragma once <nl> <nl> + # include < functional > <nl> # include < memory > <nl> # include < string > <nl> # include < vector > <nl> class RoomMember final { <nl> <nl> struct MemberInformation { <nl> std : : string nickname ; / / / < Nickname of the member . <nl> - std : : string game_name ; / / / < Name of the game they ' re currently playing , or empty if they ' re <nl> + GameInfo game_info ; / / / < Name of the game they ' re currently playing , or empty if they ' re <nl> / / / not playing anything . <nl> MacAddress mac_address ; / / / < MAC address associated with this member . <nl> } ; <nl> using MemberList = std : : vector < MemberInformation > ; <nl> <nl> + / / The handle for the callback functions <nl> + template < typename T > <nl> + using CallbackHandle = std : : shared_ptr < std : : function < void ( const T & ) > > ; <nl> + <nl> + / * * <nl> + * Unbinds a callback function from the events . <nl> + * @ param handle The connection handle to disconnect <nl> + * / <nl> + template < typename T > <nl> + void Unbind ( CallbackHandle < T > handle ) ; <nl> + <nl> RoomMember ( ) ; <nl> ~ RoomMember ( ) ; <nl> <nl> class RoomMember final { <nl> void SendChatMessage ( const std : : string & message ) ; <nl> <nl> / * * <nl> - * Sends the current game name to the room . <nl> - * @ param game_name The game name . <nl> + * Sends the current game info to the room . <nl> + * @ param game_info The game information . <nl> + * / <nl> + void SendGameInfo ( const GameInfo & game_info ) ; <nl> + <nl> + / * * <nl> + * Binds a function to an event that will be triggered every time the State of the member <nl> + * changed . The function wil be called every time the event is triggered . The callback function <nl> + * must not bind or unbind a function . Doing so will cause a deadlock <nl> + * @ param callback The function to call <nl> + * @ return A handle used for removing the function from the registered list <nl> + * / <nl> + CallbackHandle < State > BindOnStateChanged ( std : : function < void ( const State & ) > callback ) ; <nl> + <nl> + / * * <nl> + * Binds a function to an event that will be triggered every time a WifiPacket is received . <nl> + * The function wil be called everytime the event is triggered . <nl> + * The callback function must not bind or unbind a function . Doing so will cause a deadlock <nl> + * @ param callback The function to call <nl> + * @ return A handle used for removing the function from the registered list <nl> + * / <nl> + CallbackHandle < WifiPacket > BindOnWifiPacketReceived ( <nl> + std : : function < void ( const WifiPacket & ) > callback ) ; <nl> + <nl> + / * * <nl> + * Binds a function to an event that will be triggered every time the RoomInformation changes . <nl> + * The function wil be called every time the event is triggered . <nl> + * The callback function must not bind or unbind a function . Doing so will cause a deadlock <nl> + * @ param callback The function to call <nl> + * @ return A handle used for removing the function from the registered list <nl> + * / <nl> + CallbackHandle < RoomInformation > BindOnRoomInformationChanged ( <nl> + std : : function < void ( const RoomInformation & ) > callback ) ; <nl> + <nl> + / * * <nl> + * Binds a function to an event that will be triggered every time a ChatMessage is received . <nl> + * The function wil be called every time the event is triggered . <nl> + * The callback function must not bind or unbind a function . Doing so will cause a deadlock <nl> + * @ param callback The function to call <nl> + * @ return A handle used for removing the function from the registered list <nl> * / <nl> - void SendGameName ( const std : : string & game_name ) ; <nl> + CallbackHandle < ChatEntry > BindOnChatMessageRecieved ( <nl> + std : : function < void ( const ChatEntry & ) > callback ) ; <nl> <nl> / * * <nl> * Leaves the current room . <nl>
Added missing parts in libnetwork ( )
yuzu-emu/yuzu
5d0a1e7efddf234234d54fe97395f6975f8d1a28
2017-08-19T17:14:33Z
mmm a / build / deps / github_hashes / facebook / fbthrift - rev . txt <nl> ppp b / build / deps / github_hashes / facebook / fbthrift - rev . txt <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 66df3d92843a4969a8eb3ffcf79bb4155ea41085 <nl> + Subproject commit 4433f0941b6292cd9bdb4a95d93dd7da0b8a5ca4 <nl>
Updating submodules
facebook/watchman
dcc785cef71bdf7a83423ed65947db2ac967a8de
2020-02-21T18:46:53Z
mmm a / TMessagesProj / build . gradle <nl> ppp b / TMessagesProj / build . gradle <nl> android { <nl> } <nl> } <nl> <nl> - defaultConfig . versionCode = 2196 <nl> + defaultConfig . versionCode = 2197 <nl> <nl> applicationVariants . all { variant - > <nl> variant . outputs . all { output - > <nl> mmm a / TMessagesProj / src / main / java / org / telegram / messenger / BuildVars . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / messenger / BuildVars . java <nl> <nl> public static boolean LOGS_ENABLED = false ; <nl> public static boolean USE_CLOUD_STRINGS = true ; <nl> public static boolean CHECK_UPDATES = true ; <nl> - public static int BUILD_VERSION = 2196 ; <nl> + public static int BUILD_VERSION = 2197 ; <nl> public static String BUILD_VERSION_STRING = " 7 . 3 . 0 " ; <nl> public static int APP_ID = 4 ; <nl> public static String APP_HASH = " 014b35b6184100b085b0d0572f9b5103 " ; <nl> mmm a / TMessagesProj / src / main / java / org / telegram / messenger / MessageObject . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / messenger / MessageObject . java <nl> public boolean isOutOwner ( ) { <nl> } <nl> int selfUserId = UserConfig . getInstance ( currentAccount ) . getClientUserId ( ) ; <nl> if ( getDialogId ( ) = = selfUserId ) { <nl> - return messageOwner . fwd_from . from_id instanceof TLRPC . TL_peerUser & & messageOwner . fwd_from . from_id . user_id = = selfUserId & & ( messageOwner . fwd_from . saved_from_peer = = null | | messageOwner . fwd_from . saved_from_peer . user_id = = selfUserId ) | | messageOwner . fwd_from . saved_from_peer ! = null & & messageOwner . fwd_from . saved_from_peer . user_id = = selfUserId ; <nl> + return messageOwner . fwd_from . from_id instanceof TLRPC . TL_peerUser & & messageOwner . fwd_from . from_id . user_id = = selfUserId & & ( messageOwner . fwd_from . saved_from_peer = = null | | messageOwner . fwd_from . saved_from_peer . user_id = = selfUserId ) <nl> + | | messageOwner . fwd_from . saved_from_peer ! = null & & messageOwner . fwd_from . saved_from_peer . user_id = = selfUserId & & ( messageOwner . fwd_from . from_id = = null | | messageOwner . fwd_from . from_id . user_id = = selfUserId ) ; <nl> } <nl> return messageOwner . fwd_from . saved_from_peer = = null | | messageOwner . fwd_from . saved_from_peer . user_id = = selfUserId ; <nl> } <nl> mmm a / TMessagesProj / src / main / java / org / telegram / messenger / MessagesStorage . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / messenger / MessagesStorage . java <nl> public void replaceMessageIfExists ( final TLRPC . Message message , ArrayList < TLRPC . <nl> public void putMessages ( final TLRPC . messages_Messages messages , final long dialog_id , final int load_type , final int max_id , final boolean createDialog , final boolean scheduled ) { <nl> storageQueue . postRunnable ( ( ) - > { <nl> try { <nl> - FileLog . d ( " put messages to " + dialog_id ) ; <nl> if ( scheduled ) { <nl> database . executeFast ( String . format ( Locale . US , " DELETE FROM scheduled_messages WHERE uid = % d AND mid > 0 " , dialog_id ) ) . stepThis ( ) . dispose ( ) ; <nl> SQLitePreparedStatement state_messages = database . executeFast ( " REPLACE INTO scheduled_messages VALUES ( ? , ? , ? , ? , ? , ? , NULL ) " ) ; <nl> mmm a / TMessagesProj / src / main / java / org / telegram / messenger / SendMessagesHelper . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / messenger / SendMessagesHelper . java <nl> public int sendMessage ( ArrayList < MessageObject > messages , final long peer , boole <nl> int lower_id = ( int ) peer ; <nl> int sendResult = 0 ; <nl> int myId = getUserConfig ( ) . getClientUserId ( ) ; <nl> + boolean isChannel = false ; <nl> if ( lower_id ! = 0 ) { <nl> final TLRPC . Peer peer_id = getMessagesController ( ) . getPeer ( ( int ) peer ) ; <nl> - boolean isMegagroup = false ; <nl> boolean isSignature = false ; <nl> boolean canSendStickers = true ; <nl> boolean canSendMedia = true ; <nl> public int sendMessage ( ArrayList < MessageObject > messages , final long peer , boole <nl> } else { <nl> chat = getMessagesController ( ) . getChat ( - lower_id ) ; <nl> if ( ChatObject . isChannel ( chat ) ) { <nl> - isMegagroup = chat . megagroup ; <nl> isSignature = chat . signatures ; <nl> + isChannel = ! chat . megagroup ; <nl> <nl> - if ( ! isMegagroup & & chat . has_link ) { <nl> + if ( isChannel & & chat . has_link ) { <nl> TLRPC . ChatFull chatFull = getMessagesController ( ) . getChatFull ( chat . id ) ; <nl> if ( chatFull ! = null ) { <nl> linkedToGroup = chatFull . linked_chat_id ; <nl> public int sendMessage ( ArrayList < MessageObject > messages , final long peer , boole <nl> newMsg . fwd_from . flags | = 8 ; <nl> newMsg . fwd_from . post_author = msgObj . messageOwner . fwd_from . post_author ; <nl> } <nl> - if ( ( msgObj . messageOwner . fwd_from . flags & 16 ) ! = 0 & & ! UserObject . isReplyUser ( msgObj . getDialogId ( ) ) ) { <nl> + if ( ( peer = = myId | | isChannel ) & & ( msgObj . messageOwner . fwd_from . flags & 16 ) ! = 0 & & ! UserObject . isReplyUser ( msgObj . getDialogId ( ) ) ) { <nl> newMsg . fwd_from . flags | = 16 ; <nl> newMsg . fwd_from . saved_from_peer = msgObj . messageOwner . fwd_from . saved_from_peer ; <nl> newMsg . fwd_from . saved_from_msg_id = msgObj . messageOwner . fwd_from . saved_from_msg_id ; <nl> public int sendMessage ( ArrayList < MessageObject > messages , final long peer , boole <nl> newMsg . grouped_id = gId ; <nl> newMsg . flags | = 131072 ; <nl> } <nl> - if ( peer_id . channel_id ! = 0 & & ! isMegagroup ) { <nl> + if ( peer_id . channel_id ! = 0 & & isChannel ) { <nl> if ( isSignature ) { <nl> newMsg . from_id = new TLRPC . TL_peerUser ( ) ; <nl> newMsg . from_id . user_id = myId ; <nl> public int sendMessage ( ArrayList < MessageObject > messages , final long peer , boole <nl> messagesByRandomIds . put ( newMsg . random_id , newMsg ) ; <nl> ids . add ( newMsg . fwd_msg_id ) ; <nl> newMsg . date = scheduleDate ! = 0 ? scheduleDate : getConnectionsManager ( ) . getCurrentTime ( ) ; <nl> - if ( inputPeer instanceof TLRPC . TL_inputPeerChannel & & ! isMegagroup ) { <nl> + if ( inputPeer instanceof TLRPC . TL_inputPeerChannel & & isChannel ) { <nl> if ( scheduleDate = = 0 ) { <nl> newMsg . views = 1 ; <nl> newMsg . flags | = TLRPC . MESSAGE_FLAG_HAS_VIEWS ; <nl> private void updateMediaPaths ( MessageObject newMsgObj , TLRPC . Message sentMessage <nl> } <nl> } <nl> } <nl> - sentMessage . message = newMsg . message ; <nl> + newMsg . message = sentMessage . message ; <nl> sentMessage . attachPath = newMsg . attachPath ; <nl> newMsg . media . photo . id = sentMessage . media . photo . id ; <nl> newMsg . media . photo . dc_id = sentMessage . media . photo . dc_id ; <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / ActionBar / BottomSheet . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / ActionBar / BottomSheet . java <nl> public void setTranslationY ( float translationY ) { <nl> window . setAttributes ( params ) ; <nl> } <nl> <nl> + public void setUseLightStatusBar ( boolean value ) { <nl> + useLightStatusBar = value ; <nl> + if ( Build . VERSION . SDK_INT > = 23 ) { <nl> + int color = Theme . getColor ( Theme . key_actionBarDefault , null , true ) ; <nl> + int flags = container . getSystemUiVisibility ( ) ; <nl> + if ( useLightStatusBar & & color = = 0xffffffff ) { <nl> + flags | = View . SYSTEM_UI_FLAG_LIGHT_STATUS_BAR ; <nl> + } else { <nl> + flags & = ~ View . SYSTEM_UI_FLAG_LIGHT_STATUS_BAR ; <nl> + } <nl> + container . setSystemUiVisibility ( flags ) ; <nl> + } <nl> + } <nl> + <nl> public boolean isFocusable ( ) { <nl> return focusable ; <nl> } <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / ChatActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / ChatActivity . java <nl> public void didReceivedNotification ( int id , int account , final Object . . . args ) { <nl> endReached [ loadIndex ] = true ; <nl> } <nl> <nl> - if ( isThreadChat ( ) & & load_type = = 0 & & forwardEndReached [ 0 ] & & ! pendingSendMessages . isEmpty ( ) ) { <nl> - int pasteIndex = 0 ; <nl> - int date = pendingSendMessages . get ( 0 ) . messageOwner . date ; <nl> - if ( ! messArr . isEmpty ( ) ) { <nl> - if ( date > = messArr . get ( 0 ) . messageOwner . date ) { <nl> - pasteIndex = 0 ; <nl> - } else if ( date < = messArr . get ( messArr . size ( ) - 1 ) . messageOwner . date ) { <nl> - pasteIndex = messArr . size ( ) ; <nl> - } else { <nl> - for ( int a = 0 , N = messArr . size ( ) ; a < N - 1 ; a + + ) { <nl> - if ( messArr . get ( a ) . messageOwner . date > = date & & messArr . get ( a + 1 ) . messageOwner . date < = date ) { <nl> - pasteIndex = a + 1 ; <nl> + if ( load_type = = 0 & & forwardEndReached [ 0 ] & & ! pendingSendMessages . isEmpty ( ) ) { <nl> + for ( int a = 0 , N = messArr . size ( ) ; a < N ; a + + ) { <nl> + MessageObject existing = pendingSendMessagesDict . get ( messArr . get ( a ) . getId ( ) ) ; <nl> + if ( existing ! = null ) { <nl> + pendingSendMessagesDict . remove ( existing . getId ( ) ) ; <nl> + pendingSendMessages . remove ( existing ) ; <nl> + } <nl> + } <nl> + if ( ! pendingSendMessages . isEmpty ( ) ) { <nl> + int pasteIndex = 0 ; <nl> + int date = pendingSendMessages . get ( 0 ) . messageOwner . date ; <nl> + if ( ! messArr . isEmpty ( ) ) { <nl> + if ( date > = messArr . get ( 0 ) . messageOwner . date ) { <nl> + pasteIndex = 0 ; <nl> + } else if ( date < = messArr . get ( messArr . size ( ) - 1 ) . messageOwner . date ) { <nl> + pasteIndex = messArr . size ( ) ; <nl> + } else { <nl> + for ( int a = 0 , N = messArr . size ( ) ; a < N - 1 ; a + + ) { <nl> + if ( messArr . get ( a ) . messageOwner . date > = date & & messArr . get ( a + 1 ) . messageOwner . date < = date ) { <nl> + pasteIndex = a + 1 ; <nl> + } <nl> } <nl> } <nl> } <nl> + messArr = new ArrayList < > ( messArr ) ; <nl> + messArr . addAll ( pasteIndex , pendingSendMessages ) ; <nl> + pendingSendMessages . clear ( ) ; <nl> + pendingSendMessagesDict . clear ( ) ; <nl> } <nl> - messArr = new ArrayList < > ( messArr ) ; <nl> - messArr . addAll ( pasteIndex , pendingSendMessages ) ; <nl> - pendingSendMessages . clear ( ) ; <nl> - pendingSendMessagesDict . clear ( ) ; <nl> } <nl> <nl> if ( ! threadMessageAdded & & isThreadChat ( ) & & ( load_type = = 0 & & messArr . size ( ) < count | | ( load_type = = 2 | | load_type = = 3 ) & & endReached [ 0 ] ) ) { <nl> private void processNewMessages ( ArrayList < MessageObject > arr ) { <nl> if ( messageId > 0 & & messageId < = ( messageObject . isOut ( ) ? threadMaxOutboxReadId : threadMaxInboxReadId ) ) { <nl> messageObject . setIsRead ( ) ; <nl> } <nl> - if ( ! forwardEndReached [ 0 ] & & messageId < 0 ) { <nl> - pendingSendMessagesDict . put ( messageId , messageObject ) ; <nl> - pendingSendMessages . add ( messageObject ) ; <nl> - } <nl> + } <nl> + if ( currentEncryptedChat = = null & & ! forwardEndReached [ 0 ] & & messageId < 0 ) { <nl> + pendingSendMessagesDict . put ( messageId , messageObject ) ; <nl> + pendingSendMessages . add ( 0 , messageObject ) ; <nl> } <nl> if ( messageObject . isDice ( ) & & ! messageObject . isForwarded ( ) ) { <nl> messageObject . wasUnread = true ; <nl> public void onAnimationCancel ( Animator animation ) { <nl> } <nl> <nl> private boolean hidePinnedMessageView ( boolean animated ) { <nl> - if ( pinnedMessageView . getTag ( ) = = null ) { <nl> + if ( pinnedMessageView ! = null & & pinnedMessageView . getTag ( ) = = null ) { <nl> for ( int a = 0 ; a < pinnedNextAnimation . length ; a + + ) { <nl> if ( pinnedNextAnimation [ a ] ! = null ) { <nl> pinnedNextAnimation [ a ] . cancel ( ) ; <nl> private void openDiscussionMessageChat ( int chatId , MessageObject originalMessage <nl> } <nl> <nl> private void openOriginalReplyChat ( MessageObject messageObject ) { <nl> + if ( UserObject . isUserSelf ( currentUser ) & & messageObject . messageOwner . fwd_from . saved_from_peer . user_id = = currentUser . id ) { <nl> + scrollToMessageId ( messageObject . messageOwner . fwd_from . saved_from_msg_id , messageObject . getId ( ) , true , 0 , true , 0 ) ; <nl> + return ; <nl> + } <nl> Bundle args = new Bundle ( ) ; <nl> if ( messageObject . messageOwner . fwd_from . saved_from_peer . channel_id ! = 0 ) { <nl> args . putInt ( " chat_id " , messageObject . messageOwner . fwd_from . saved_from_peer . channel_id ) ; <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / Components / ChatActivityEnterView . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / Components / ChatActivityEnterView . java <nl> public void doneEditingMessage ( ) { <nl> } <nl> return ; <nl> } <nl> - CharSequence [ ] message = new CharSequence [ ] { messageEditText . getText ( ) } ; <nl> + CharSequence [ ] message = new CharSequence [ ] { AndroidUtilities . getTrimmedString ( messageEditText . getText ( ) ) } ; <nl> ArrayList < TLRPC . MessageEntity > entities = MediaDataController . getInstance ( currentAccount ) . getEntities ( message , supportsSendingNewEntities ( ) ) ; <nl> if ( ! TextUtils . equals ( message [ 0 ] , editingMessageObject . messageText ) | | entities ! = null & & ! entities . isEmpty ( ) | | editingMessageObject . messageOwner . media instanceof TLRPC . TL_messageMediaWebPage ) { <nl> editingMessageObject . editingMessage = message [ 0 ] ; <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / Components / SearchViewPager . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / Components / SearchViewPager . java <nl> private void search ( View view , int position , String query , boolean reset ) { <nl> emptyView . showProgress ( ! dialogsSearchAdapter . isSearching ( ) , false ) ; <nl> emptyView . showProgress ( dialogsSearchAdapter . isSearching ( ) , false ) ; <nl> } else { <nl> - emptyView . showProgress ( dialogsSearchAdapter . isSearching ( ) , true ) ; <nl> + if ( ! dialogsSearchAdapter . hasRecentSearch ( ) ) { <nl> + emptyView . showProgress ( dialogsSearchAdapter . isSearching ( ) , true ) ; <nl> + } <nl> } <nl> if ( reset ) { <nl> noMediaFiltersSearchView . setVisibility ( View . GONE ) ; <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / GroupCallActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / GroupCallActivity . java <nl> private void updateLayout ( boolean animated ) { <nl> actionBarAnimation . cancel ( ) ; <nl> actionBarAnimation = null ; <nl> } <nl> + setUseLightStatusBar ( actionBar . getTag ( ) = = null ) ; <nl> <nl> actionBar . getBackButton ( ) . animate ( ) <nl> . scaleX ( show ? 1 . 0f : 0 . 9f ) <nl> mmm a / TMessagesProj / src / main / java / org / telegram / ui / ProfileActivity . java <nl> ppp b / TMessagesProj / src / main / java / org / telegram / ui / ProfileActivity . java <nl> protected void onMeasure ( int widthMeasureSpec , int heightMeasureSpec ) { <nl> break ; <nl> } <nl> } <nl> + if ( view = = null ) { <nl> + view = listView . getChildAt ( 0 ) ; <nl> + if ( view ! = null ) { <nl> + RecyclerView . ViewHolder holder = listView . findContainingViewHolder ( view ) ; <nl> + pos = holder . getAdapterPosition ( ) ; <nl> + if ( pos = = RecyclerView . NO_POSITION ) { <nl> + pos = holder . getPosition ( ) ; <nl> + } <nl> + } <nl> + } <nl> <nl> int top = 0 ; <nl> if ( view ! = null ) { <nl>
Update to 7 . 3 . 0 ( 2197 )
DrKLO/Telegram
d333b1f95689f5619e7ab47e6bd960a5d48ac9c6
2020-12-24T19:58:45Z
new file mode 100644 <nl> index 00000000 . . 0a06093a <nl> mmm / dev / null <nl> ppp b / lsteamclient / cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 . cpp <nl> <nl> + # include " steam_defs . h " <nl> + # include " steamworks_sdk_111x / steam_api . h " <nl> + # include " steamclient_private . h " <nl> + # include " cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 . h " <nl> + # ifdef __cplusplus <nl> + extern " C " { <nl> + # endif <nl> + # include " struct_converters_111x . h " <nl> + bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileWrite ( void * linux_side , const char * pchFile , const void * pvData , int32 cubData ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > FileWrite ( ( const char * ) pchFile , ( const void * ) pvData , ( int32 ) cubData ) ; <nl> + } <nl> + <nl> + int32 cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileRead ( void * linux_side , const char * pchFile , void * pvData , int32 cubDataToRead ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > FileRead ( ( const char * ) pchFile , ( void * ) pvData , ( int32 ) cubDataToRead ) ; <nl> + } <nl> + <nl> + bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileForget ( void * linux_side , const char * pchFile ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > FileForget ( ( const char * ) pchFile ) ; <nl> + } <nl> + <nl> + bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileDelete ( void * linux_side , const char * pchFile ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > FileDelete ( ( const char * ) pchFile ) ; <nl> + } <nl> + <nl> + SteamAPICall_t cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileShare ( void * linux_side , const char * pchFile ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > FileShare ( ( const char * ) pchFile ) ; <nl> + } <nl> + <nl> + bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileExists ( void * linux_side , const char * pchFile ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > FileExists ( ( const char * ) pchFile ) ; <nl> + } <nl> + <nl> + bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FilePersisted ( void * linux_side , const char * pchFile ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > FilePersisted ( ( const char * ) pchFile ) ; <nl> + } <nl> + <nl> + int32 cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileSize ( void * linux_side , const char * pchFile ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > GetFileSize ( ( const char * ) pchFile ) ; <nl> + } <nl> + <nl> + int64 cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileTimestamp ( void * linux_side , const char * pchFile ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > GetFileTimestamp ( ( const char * ) pchFile ) ; <nl> + } <nl> + <nl> + int32 cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileCount ( void * linux_side ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > GetFileCount ( ) ; <nl> + } <nl> + <nl> + const char * cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileNameAndSize ( void * linux_side , int iFile , int32 * pnFileSizeInBytes ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > GetFileNameAndSize ( ( int ) iFile , ( int32 * ) pnFileSizeInBytes ) ; <nl> + } <nl> + <nl> + bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetQuota ( void * linux_side , int32 * pnTotalBytes , int32 * puAvailableBytes ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > GetQuota ( ( int32 * ) pnTotalBytes , ( int32 * ) puAvailableBytes ) ; <nl> + } <nl> + <nl> + bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_IsCloudEnabledForAccount ( void * linux_side ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > IsCloudEnabledForAccount ( ) ; <nl> + } <nl> + <nl> + bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_IsCloudEnabledForApp ( void * linux_side ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > IsCloudEnabledForApp ( ) ; <nl> + } <nl> + <nl> + void cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_SetCloudEnabledForApp ( void * linux_side , bool bEnabled ) <nl> + { <nl> + ( ( ISteamRemoteStorage * ) linux_side ) - > SetCloudEnabledForApp ( ( bool ) bEnabled ) ; <nl> + } <nl> + <nl> + SteamAPICall_t cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_UGCDownload ( void * linux_side , UGCHandle_t hContent ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > UGCDownload ( ( UGCHandle_t ) hContent ) ; <nl> + } <nl> + <nl> + bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetUGCDetails ( void * linux_side , UGCHandle_t hContent , AppId_t * pnAppID , char * * ppchName , int32 * pnFileSizeInBytes , CSteamID * pSteamIDOwner ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > GetUGCDetails ( ( UGCHandle_t ) hContent , ( AppId_t * ) pnAppID , ( char * * ) ppchName , ( int32 * ) pnFileSizeInBytes , ( CSteamID * ) pSteamIDOwner ) ; <nl> + } <nl> + <nl> + int32 cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_UGCRead ( void * linux_side , UGCHandle_t hContent , void * pvData , int32 cubDataToRead ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > UGCRead ( ( UGCHandle_t ) hContent , ( void * ) pvData , ( int32 ) cubDataToRead ) ; <nl> + } <nl> + <nl> + int32 cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetCachedUGCCount ( void * linux_side ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > GetCachedUGCCount ( ) ; <nl> + } <nl> + <nl> + UGCHandle_t cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetCachedUGCHandle ( void * linux_side , int32 iCachedContent ) <nl> + { <nl> + return ( ( ISteamRemoteStorage * ) linux_side ) - > GetCachedUGCHandle ( ( int32 ) iCachedContent ) ; <nl> + } <nl> + <nl> + # ifdef __cplusplus <nl> + } <nl> + # endif <nl> new file mode 100644 <nl> index 00000000 . . fa3c52a7 <nl> mmm / dev / null <nl> ppp b / lsteamclient / cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 . h <nl> <nl> + # ifdef __cplusplus <nl> + extern " C " { <nl> + # endif <nl> + extern bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileWrite ( void * , const char * , const void * , int32 ) ; <nl> + extern int32 cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileRead ( void * , const char * , void * , int32 ) ; <nl> + extern bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileForget ( void * , const char * ) ; <nl> + extern bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileDelete ( void * , const char * ) ; <nl> + extern SteamAPICall_t cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileShare ( void * , const char * ) ; <nl> + extern bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileExists ( void * , const char * ) ; <nl> + extern bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FilePersisted ( void * , const char * ) ; <nl> + extern int32 cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileSize ( void * , const char * ) ; <nl> + extern int64 cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileTimestamp ( void * , const char * ) ; <nl> + extern int32 cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileCount ( void * ) ; <nl> + extern const char * cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileNameAndSize ( void * , int , int32 * ) ; <nl> + extern bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetQuota ( void * , int32 * , int32 * ) ; <nl> + extern bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_IsCloudEnabledForAccount ( void * ) ; <nl> + extern bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_IsCloudEnabledForApp ( void * ) ; <nl> + extern void cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_SetCloudEnabledForApp ( void * , bool ) ; <nl> + extern SteamAPICall_t cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_UGCDownload ( void * , UGCHandle_t ) ; <nl> + extern bool cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetUGCDetails ( void * , UGCHandle_t , AppId_t * , char * * , int32 * , CSteamID * ) ; <nl> + extern int32 cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_UGCRead ( void * , UGCHandle_t , void * , int32 ) ; <nl> + extern int32 cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetCachedUGCCount ( void * ) ; <nl> + extern UGCHandle_t cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetCachedUGCHandle ( void * , int32 ) ; <nl> + # ifdef __cplusplus <nl> + } <nl> + # endif <nl> new file mode 100644 <nl> index 00000000 . . bfdbd53b <nl> mmm / dev / null <nl> ppp b / lsteamclient / cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 . cpp <nl> <nl> + # include " steam_defs . h " <nl> + # include " steamworks_sdk_111x / steam_api . h " <nl> + # include " steamclient_private . h " <nl> + # include " cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 . h " <nl> + # ifdef __cplusplus <nl> + extern " C " { <nl> + # endif <nl> + # include " struct_converters_111x . h " <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_RequestCurrentStats ( void * linux_side ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > RequestCurrentStats ( ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetStat ( void * linux_side , const char * pchName , int32 * pData ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > GetStat ( ( const char * ) pchName , ( int32 * ) pData ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetStat_2 ( void * linux_side , const char * pchName , float * pData ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > GetStat ( ( const char * ) pchName , ( float * ) pData ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetStat ( void * linux_side , const char * pchName , int32 nData ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > SetStat ( ( const char * ) pchName , ( int32 ) nData ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetStat_2 ( void * linux_side , const char * pchName , float fData ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > SetStat ( ( const char * ) pchName , ( float ) fData ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_UpdateAvgRateStat ( void * linux_side , const char * pchName , float flCountThisSession , double dSessionLength ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > UpdateAvgRateStat ( ( const char * ) pchName , ( float ) flCountThisSession , ( double ) dSessionLength ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievement ( void * linux_side , const char * pchName , bool * pbAchieved ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > GetAchievement ( ( const char * ) pchName , ( bool * ) pbAchieved ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetAchievement ( void * linux_side , const char * pchName ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > SetAchievement ( ( const char * ) pchName ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_ClearAchievement ( void * linux_side , const char * pchName ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > ClearAchievement ( ( const char * ) pchName ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementAndUnlockTime ( void * linux_side , const char * pchName , bool * pbAchieved , uint32 * punUnlockTime ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > GetAchievementAndUnlockTime ( ( const char * ) pchName , ( bool * ) pbAchieved , ( uint32 * ) punUnlockTime ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_StoreStats ( void * linux_side ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > StoreStats ( ) ; <nl> + } <nl> + <nl> + int cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementIcon ( void * linux_side , const char * pchName ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > GetAchievementIcon ( ( const char * ) pchName ) ; <nl> + } <nl> + <nl> + const char * cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementDisplayAttribute ( void * linux_side , const char * pchName , const char * pchKey ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > GetAchievementDisplayAttribute ( ( const char * ) pchName , ( const char * ) pchKey ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_IndicateAchievementProgress ( void * linux_side , const char * pchName , uint32 nCurProgress , uint32 nMaxProgress ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > IndicateAchievementProgress ( ( const char * ) pchName , ( uint32 ) nCurProgress , ( uint32 ) nMaxProgress ) ; <nl> + } <nl> + <nl> + SteamAPICall_t cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_RequestUserStats ( void * linux_side , CSteamID steamIDUser ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > RequestUserStats ( ( CSteamID ) steamIDUser ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserStat ( void * linux_side , CSteamID steamIDUser , const char * pchName , int32 * pData ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > GetUserStat ( ( CSteamID ) steamIDUser , ( const char * ) pchName , ( int32 * ) pData ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserStat_2 ( void * linux_side , CSteamID steamIDUser , const char * pchName , float * pData ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > GetUserStat ( ( CSteamID ) steamIDUser , ( const char * ) pchName , ( float * ) pData ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserAchievement ( void * linux_side , CSteamID steamIDUser , const char * pchName , bool * pbAchieved ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > GetUserAchievement ( ( CSteamID ) steamIDUser , ( const char * ) pchName , ( bool * ) pbAchieved ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserAchievementAndUnlockTime ( void * linux_side , CSteamID steamIDUser , const char * pchName , bool * pbAchieved , uint32 * punUnlockTime ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > GetUserAchievementAndUnlockTime ( ( CSteamID ) steamIDUser , ( const char * ) pchName , ( bool * ) pbAchieved , ( uint32 * ) punUnlockTime ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_ResetAllStats ( void * linux_side , bool bAchievementsToo ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > ResetAllStats ( ( bool ) bAchievementsToo ) ; <nl> + } <nl> + <nl> + SteamAPICall_t cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_FindOrCreateLeaderboard ( void * linux_side , const char * pchLeaderboardName , ELeaderboardSortMethod eLeaderboardSortMethod , ELeaderboardDisplayType eLeaderboardDisplayType ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > FindOrCreateLeaderboard ( ( const char * ) pchLeaderboardName , ( ELeaderboardSortMethod ) eLeaderboardSortMethod , ( ELeaderboardDisplayType ) eLeaderboardDisplayType ) ; <nl> + } <nl> + <nl> + SteamAPICall_t cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_FindLeaderboard ( void * linux_side , const char * pchLeaderboardName ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > FindLeaderboard ( ( const char * ) pchLeaderboardName ) ; <nl> + } <nl> + <nl> + const char * cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardName ( void * linux_side , SteamLeaderboard_t hSteamLeaderboard ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > GetLeaderboardName ( ( SteamLeaderboard_t ) hSteamLeaderboard ) ; <nl> + } <nl> + <nl> + int cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardEntryCount ( void * linux_side , SteamLeaderboard_t hSteamLeaderboard ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > GetLeaderboardEntryCount ( ( SteamLeaderboard_t ) hSteamLeaderboard ) ; <nl> + } <nl> + <nl> + ELeaderboardSortMethod cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardSortMethod ( void * linux_side , SteamLeaderboard_t hSteamLeaderboard ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > GetLeaderboardSortMethod ( ( SteamLeaderboard_t ) hSteamLeaderboard ) ; <nl> + } <nl> + <nl> + ELeaderboardDisplayType cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardDisplayType ( void * linux_side , SteamLeaderboard_t hSteamLeaderboard ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > GetLeaderboardDisplayType ( ( SteamLeaderboard_t ) hSteamLeaderboard ) ; <nl> + } <nl> + <nl> + SteamAPICall_t cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_DownloadLeaderboardEntries ( void * linux_side , SteamLeaderboard_t hSteamLeaderboard , ELeaderboardDataRequest eLeaderboardDataRequest , int nRangeStart , int nRangeEnd ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > DownloadLeaderboardEntries ( ( SteamLeaderboard_t ) hSteamLeaderboard , ( ELeaderboardDataRequest ) eLeaderboardDataRequest , ( int ) nRangeStart , ( int ) nRangeEnd ) ; <nl> + } <nl> + <nl> + bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetDownloadedLeaderboardEntry ( void * linux_side , SteamLeaderboardEntries_t hSteamLeaderboardEntries , int index , LeaderboardEntry_t * pLeaderboardEntry , int32 * pDetails , int cDetailsMax ) <nl> + { <nl> + LeaderboardEntry_t lin_pLeaderboardEntry ; <nl> + win_to_lin_struct_LeaderboardEntry_t_111x ( pLeaderboardEntry , & lin_pLeaderboardEntry ) ; <nl> + bool retval = ( ( ISteamUserStats * ) linux_side ) - > GetDownloadedLeaderboardEntry ( ( SteamLeaderboardEntries_t ) hSteamLeaderboardEntries , ( int ) index , & lin_pLeaderboardEntry , ( int32 * ) pDetails , ( int ) cDetailsMax ) ; <nl> + lin_to_win_struct_LeaderboardEntry_t_111x ( & lin_pLeaderboardEntry , pLeaderboardEntry ) ; <nl> + return retval ; <nl> + } <nl> + <nl> + SteamAPICall_t cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_UploadLeaderboardScore ( void * linux_side , SteamLeaderboard_t hSteamLeaderboard , ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod , int32 nScore , const int32 * pScoreDetails , int cScoreDetailsCount ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > UploadLeaderboardScore ( ( SteamLeaderboard_t ) hSteamLeaderboard , ( ELeaderboardUploadScoreMethod ) eLeaderboardUploadScoreMethod , ( int32 ) nScore , ( const int32 * ) pScoreDetails , ( int ) cScoreDetailsCount ) ; <nl> + } <nl> + <nl> + SteamAPICall_t cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_AttachLeaderboardUGC ( void * linux_side , SteamLeaderboard_t hSteamLeaderboard , UGCHandle_t hUGC ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > AttachLeaderboardUGC ( ( SteamLeaderboard_t ) hSteamLeaderboard , ( UGCHandle_t ) hUGC ) ; <nl> + } <nl> + <nl> + SteamAPICall_t cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetNumberOfCurrentPlayers ( void * linux_side ) <nl> + { <nl> + return ( ( ISteamUserStats * ) linux_side ) - > GetNumberOfCurrentPlayers ( ) ; <nl> + } <nl> + <nl> + # ifdef __cplusplus <nl> + } <nl> + # endif <nl> new file mode 100644 <nl> index 00000000 . . 2e808c1f <nl> mmm / dev / null <nl> ppp b / lsteamclient / cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 . h <nl> <nl> + # ifdef __cplusplus <nl> + extern " C " { <nl> + # endif <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_RequestCurrentStats ( void * ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetStat ( void * , const char * , int32 * ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetStat_2 ( void * , const char * , float * ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetStat ( void * , const char * , int32 ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetStat_2 ( void * , const char * , float ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_UpdateAvgRateStat ( void * , const char * , float , double ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievement ( void * , const char * , bool * ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetAchievement ( void * , const char * ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_ClearAchievement ( void * , const char * ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementAndUnlockTime ( void * , const char * , bool * , uint32 * ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_StoreStats ( void * ) ; <nl> + extern int cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementIcon ( void * , const char * ) ; <nl> + extern const char * cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementDisplayAttribute ( void * , const char * , const char * ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_IndicateAchievementProgress ( void * , const char * , uint32 , uint32 ) ; <nl> + extern SteamAPICall_t cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_RequestUserStats ( void * , CSteamID ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserStat ( void * , CSteamID , const char * , int32 * ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserStat_2 ( void * , CSteamID , const char * , float * ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserAchievement ( void * , CSteamID , const char * , bool * ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserAchievementAndUnlockTime ( void * , CSteamID , const char * , bool * , uint32 * ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_ResetAllStats ( void * , bool ) ; <nl> + extern SteamAPICall_t cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_FindOrCreateLeaderboard ( void * , const char * , ELeaderboardSortMethod , ELeaderboardDisplayType ) ; <nl> + extern SteamAPICall_t cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_FindLeaderboard ( void * , const char * ) ; <nl> + extern const char * cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardName ( void * , SteamLeaderboard_t ) ; <nl> + extern int cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardEntryCount ( void * , SteamLeaderboard_t ) ; <nl> + extern ELeaderboardSortMethod cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardSortMethod ( void * , SteamLeaderboard_t ) ; <nl> + extern ELeaderboardDisplayType cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardDisplayType ( void * , SteamLeaderboard_t ) ; <nl> + extern SteamAPICall_t cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_DownloadLeaderboardEntries ( void * , SteamLeaderboard_t , ELeaderboardDataRequest , int , int ) ; <nl> + extern bool cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetDownloadedLeaderboardEntry ( void * , SteamLeaderboardEntries_t , int , LeaderboardEntry_t * , int32 * , int ) ; <nl> + extern SteamAPICall_t cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_UploadLeaderboardScore ( void * , SteamLeaderboard_t , ELeaderboardUploadScoreMethod , int32 , const int32 * , int ) ; <nl> + extern SteamAPICall_t cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_AttachLeaderboardUGC ( void * , SteamLeaderboard_t , UGCHandle_t ) ; <nl> + extern SteamAPICall_t cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetNumberOfCurrentPlayers ( void * ) ; <nl> + # ifdef __cplusplus <nl> + } <nl> + # endif <nl> mmm a / lsteamclient / gen_wrapper . py <nl> ppp b / lsteamclient / gen_wrapper . py <nl> <nl> " 113 " , <nl> " 112x " , <nl> " 112 " , <nl> + " 111x " , <nl> " 111 " , <nl> " 110 " , <nl> " 109 " , <nl> new file mode 100644 <nl> index 00000000 . . d27cd355 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / isteamapps . h <nl> <nl> + / / = = = = = = Copyright © 1996 - 2008 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : interface to app data in Steam <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef ISTEAMAPPS_H <nl> + # define ISTEAMAPPS_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : interface to app data <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamApps <nl> + { <nl> + public : <nl> + virtual bool BIsSubscribed ( ) = 0 ; <nl> + virtual bool BIsLowViolence ( ) = 0 ; <nl> + virtual bool BIsCybercafe ( ) = 0 ; <nl> + virtual bool BIsVACBanned ( ) = 0 ; <nl> + virtual const char * GetCurrentGameLanguage ( ) = 0 ; <nl> + virtual const char * GetAvailableGameLanguages ( ) = 0 ; <nl> + <nl> + / / only use this member if you need to check ownership of another game related to yours , a demo for example <nl> + virtual bool BIsSubscribedApp ( AppId_t appID ) = 0 ; <nl> + <nl> + / / Takes AppID of DLC and checks if the user owns the DLC & if the DLC is installed <nl> + virtual bool BIsDlcInstalled ( AppId_t appID ) = 0 ; <nl> + <nl> + / / returns the Unix time of the purchase of the app <nl> + virtual uint32 GetEarliestPurchaseUnixTime ( AppId_t nAppID ) = 0 ; <nl> + <nl> + / / Checks if the user is subscribed to the current app through a free weekend <nl> + / / This function will return false for users who have a retail or other type of license <nl> + / / Before using , please ask your Valve technical contact how to package and secure your free weekened <nl> + virtual bool BIsSubscribedFromFreeWeekend ( ) = 0 ; <nl> + } ; <nl> + <nl> + # define STEAMAPPS_INTERFACE_VERSION " STEAMAPPS_INTERFACE_VERSION004 " <nl> + <nl> + / / callbacks <nl> + # pragma pack ( push , 8 ) <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : posted after the user gains ownership of DLC & that DLC is installed <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct DlcInstalled_t <nl> + { <nl> + enum { k_iCallback = k_iSteamAppsCallbacks + 5 } ; <nl> + AppId_t m_nAppID ; / / AppID of the DLC <nl> + } ; <nl> + <nl> + # pragma pack ( pop ) <nl> + <nl> + # endif / / ISTEAMAPPS_H <nl> new file mode 100644 <nl> index 00000000 . . 570dc450 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / isteamappticket . h <nl> <nl> + / / = = = = = = Copyright 1996 - 2008 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : a private , but well versioned , interface to get at critical bits <nl> + / / of a steam3 appticket - consumed by the simple drm wrapper to let it <nl> + / / ask about ownership with greater confidence . <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef ISTEAMAPPTICKET_H <nl> + # define ISTEAMAPPTICKET_H <nl> + # ifdef WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # include " steamtypes . h " <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : hand out a reasonable " future proof " view of an app ownership ticket <nl> + / / the raw ( signed ) buffer , and indices into that buffer where the appid and <nl> + / / steamid are located . the sizes of the appid and steamid are implicit in <nl> + / / ( each version of ) the interface - currently uin32 appid and uint64 steamid <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamAppTicket <nl> + { <nl> + public : <nl> + virtual uint32 GetAppOwnershipTicketData ( uint32 nAppID , void * pvBuffer , uint32 cbBufferLength , uint32 * piAppId , uint32 * piSteamId , uint32 * piSignature , uint32 * pcbSignature ) = 0 ; <nl> + } ; <nl> + <nl> + # define STEAMAPPTICKET_INTERFACE_VERSION " STEAMAPPTICKET_INTERFACE_VERSION001 " <nl> + <nl> + <nl> + # endif / / ISTEAMAPPTICKET_H <nl> new file mode 100644 <nl> index 00000000 . . 7b6a6772 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / isteamclient . h <nl> <nl> + / / = = = = = = Copyright ï ¿ ½ 1996 - 2008 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : Main interface for loading and accessing Steamworks API ' s from the <nl> + / / Steam client . <nl> + / / For most uses , this code is wrapped inside of SteamAPI_Init ( ) <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef ISTEAMCLIENT_H <nl> + # define ISTEAMCLIENT_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # include " steamtypes . h " <nl> + # include " steamclientpublic . h " <nl> + <nl> + / / handle to a communication pipe to the Steam client <nl> + typedef int32 HSteamPipe ; <nl> + / / handle to single instance of a steam user <nl> + typedef int32 HSteamUser ; <nl> + / / function prototype <nl> + # if defined ( POSIX ) <nl> + # define __cdecl <nl> + # endif <nl> + extern " C " typedef void ( __cdecl * SteamAPIWarningMessageHook_t ) ( int , const char * ) ; <nl> + <nl> + # if defined ( __SNC__ ) <nl> + # pragma diag_suppress = 1700 / / warning 1700 : class " % s " has virtual functions but non - virtual destructor <nl> + # endif <nl> + <nl> + / / interface predec <nl> + class ISteamUser ; <nl> + class ISteamGameServer ; <nl> + class ISteamFriends ; <nl> + class ISteamUtils ; <nl> + class ISteamMatchmaking ; <nl> + class ISteamContentServer ; <nl> + class ISteamMasterServerUpdater ; <nl> + class ISteamMatchmakingServers ; <nl> + class ISteamUserStats ; <nl> + class ISteamApps ; <nl> + class ISteamNetworking ; <nl> + class ISteamRemoteStorage ; <nl> + class ISteamGameServerStats ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Interface to creating a new steam instance , or to <nl> + / / connect to an existing steam instance , whether it ' s in a <nl> + / / different process or is local . <nl> + / / <nl> + / / For most scenarios this is all handled automatically via SteamAPI_Init ( ) . <nl> + / / You ' ll only need to use these interfaces if you have a more complex versioning scheme , <nl> + / / where you want to get different versions of the same interface in different dll ' s in your project . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamClient <nl> + { <nl> + public : <nl> + / / Creates a communication pipe to the Steam client <nl> + virtual HSteamPipe CreateSteamPipe ( ) = 0 ; <nl> + <nl> + / / Releases a previously created communications pipe <nl> + virtual bool BReleaseSteamPipe ( HSteamPipe hSteamPipe ) = 0 ; <nl> + <nl> + / / connects to an existing global user , failing if none exists <nl> + / / used by the game to coordinate with the steamUI <nl> + virtual HSteamUser ConnectToGlobalUser ( HSteamPipe hSteamPipe ) = 0 ; <nl> + <nl> + / / used by game servers , create a steam user that won ' t be shared with anyone else <nl> + virtual HSteamUser CreateLocalUser ( HSteamPipe * phSteamPipe , EAccountType eAccountType ) = 0 ; <nl> + <nl> + / / removes an allocated user <nl> + virtual void ReleaseUser ( HSteamPipe hSteamPipe , HSteamUser hUser ) = 0 ; <nl> + <nl> + / / retrieves the ISteamUser interface associated with the handle <nl> + virtual ISteamUser * GetISteamUser ( HSteamUser hSteamUser , HSteamPipe hSteamPipe , const char * pchVersion ) = 0 ; <nl> + <nl> + / / retrieves the ISteamGameServer interface associated with the handle <nl> + virtual ISteamGameServer * GetISteamGameServer ( HSteamUser hSteamUser , HSteamPipe hSteamPipe , const char * pchVersion ) = 0 ; <nl> + <nl> + / / set the local IP and Port to bind to <nl> + / / this must be set before CreateLocalUser ( ) <nl> + virtual void SetLocalIPBinding ( uint32 unIP , uint16 usPort ) = 0 ; <nl> + <nl> + / / returns the ISteamFriends interface <nl> + virtual ISteamFriends * GetISteamFriends ( HSteamUser hSteamUser , HSteamPipe hSteamPipe , const char * pchVersion ) = 0 ; <nl> + <nl> + / / returns the ISteamUtils interface <nl> + virtual ISteamUtils * GetISteamUtils ( HSteamPipe hSteamPipe , const char * pchVersion ) = 0 ; <nl> + <nl> + / / returns the ISteamMatchmaking interface <nl> + virtual ISteamMatchmaking * GetISteamMatchmaking ( HSteamUser hSteamUser , HSteamPipe hSteamPipe , const char * pchVersion ) = 0 ; <nl> + <nl> + / / returns the ISteamMasterServerUpdater interface <nl> + virtual ISteamMasterServerUpdater * GetISteamMasterServerUpdater ( HSteamUser hSteamUser , HSteamPipe hSteamPipe , const char * pchVersion ) = 0 ; <nl> + <nl> + / / returns the ISteamMatchmakingServers interface <nl> + virtual ISteamMatchmakingServers * GetISteamMatchmakingServers ( HSteamUser hSteamUser , HSteamPipe hSteamPipe , const char * pchVersion ) = 0 ; <nl> + <nl> + / / returns the a generic interface <nl> + virtual void * GetISteamGenericInterface ( HSteamUser hSteamUser , HSteamPipe hSteamPipe , const char * pchVersion ) = 0 ; <nl> + <nl> + / / returns the ISteamUserStats interface <nl> + virtual ISteamUserStats * GetISteamUserStats ( HSteamUser hSteamUser , HSteamPipe hSteamPipe , const char * pchVersion ) = 0 ; <nl> + <nl> + / / returns the ISteamGameServerStats interface <nl> + virtual ISteamGameServerStats * GetISteamGameServerStats ( HSteamUser hSteamuser , HSteamPipe hSteamPipe , const char * pchVersion ) = 0 ; <nl> + <nl> + / / returns apps interface <nl> + virtual ISteamApps * GetISteamApps ( HSteamUser hSteamUser , HSteamPipe hSteamPipe , const char * pchVersion ) = 0 ; <nl> + <nl> + / / networking <nl> + virtual ISteamNetworking * GetISteamNetworking ( HSteamUser hSteamUser , HSteamPipe hSteamPipe , const char * pchVersion ) = 0 ; <nl> + <nl> + / / remote storage <nl> + virtual ISteamRemoteStorage * GetISteamRemoteStorage ( HSteamUser hSteamuser , HSteamPipe hSteamPipe , const char * pchVersion ) = 0 ; <nl> + <nl> + / / this needs to be called every frame to process matchmaking results <nl> + / / redundant if you ' re already calling SteamAPI_RunCallbacks ( ) <nl> + virtual void RunFrame ( ) = 0 ; <nl> + <nl> + / / returns the number of IPC calls made since the last time this function was called <nl> + / / Used for perf debugging so you can understand how many IPC calls your game makes per frame <nl> + / / Every IPC call is at minimum a thread context switch if not a process one so you want to rate <nl> + / / control how often you do them . <nl> + virtual uint32 GetIPCCallCount ( ) = 0 ; <nl> + <nl> + / / API warning handling <nl> + / / ' int ' is the severity ; 0 for msg , 1 for warning <nl> + / / ' const char * ' is the text of the message <nl> + / / callbacks will occur directly after the API function is called that generated the warning or message <nl> + virtual void SetWarningMessageHook ( SteamAPIWarningMessageHook_t pFunction ) = 0 ; <nl> + <nl> + / / Trigger global shutdown for the DLL <nl> + virtual bool BShutdownIfAllPipesClosed ( ) = 0 ; <nl> + <nl> + } ; <nl> + <nl> + # define STEAMCLIENT_INTERFACE_VERSION " SteamClient010 " <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Base values for callback identifiers , each callback must <nl> + / / have a unique ID . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + enum { k_iSteamUserCallbacks = 100 } ; <nl> + enum { k_iSteamGameServerCallbacks = 200 } ; <nl> + enum { k_iSteamFriendsCallbacks = 300 } ; <nl> + enum { k_iSteamBillingCallbacks = 400 } ; <nl> + enum { k_iSteamMatchmakingCallbacks = 500 } ; <nl> + enum { k_iSteamContentServerCallbacks = 600 } ; <nl> + enum { k_iSteamUtilsCallbacks = 700 } ; <nl> + enum { k_iClientFriendsCallbacks = 800 } ; <nl> + enum { k_iClientUserCallbacks = 900 } ; <nl> + enum { k_iSteamAppsCallbacks = 1000 } ; <nl> + enum { k_iSteamUserStatsCallbacks = 1100 } ; <nl> + enum { k_iSteamNetworkingCallbacks = 1200 } ; <nl> + enum { k_iClientRemoteStorageCallbacks = 1300 } ; <nl> + enum { k_iSteamUserItemsCallbacks = 1400 } ; <nl> + enum { k_iSteamGameServerItemsCallbacks = 1500 } ; <nl> + enum { k_iClientUtilsCallbacks = 1600 } ; <nl> + enum { k_iSteamGameCoordinatorCallbacks = 1700 } ; <nl> + enum { k_iSteamGameServerStatsCallbacks = 1800 } ; <nl> + enum { k_iSteam2AsyncCallbacks = 1900 } ; <nl> + enum { k_iSteamGameStatsCallbacks = 2000 } ; <nl> + enum { k_iClientHTTPCallbacks = 2100 } ; <nl> + <nl> + # endif / / ISTEAMCLIENT_H <nl> new file mode 100644 <nl> index 00000000 . . 900241c4 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / isteamfriends . h <nl> <nl> + / / = = = = = = Copyright © 1996 - 2008 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : interface to both friends list data and general information about users <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef ISTEAMFRIENDS_H <nl> + # define ISTEAMFRIENDS_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # include " isteamclient . h " <nl> + # include " steamclientpublic . h " <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : set of relationships to other users <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + enum EFriendRelationship <nl> + { <nl> + k_EFriendRelationshipNone = 0 , <nl> + k_EFriendRelationshipBlocked = 1 , <nl> + k_EFriendRelationshipRequestRecipient = 2 , <nl> + k_EFriendRelationshipFriend = 3 , <nl> + k_EFriendRelationshipRequestInitiator = 4 , <nl> + k_EFriendRelationshipIgnored = 5 , <nl> + k_EFriendRelationshipIgnoredFriend = 6 , <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : list of states a friend can be in <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + enum EPersonaState <nl> + { <nl> + k_EPersonaStateOffline = 0 , / / friend is not currently logged on <nl> + k_EPersonaStateOnline = 1 , / / friend is logged on <nl> + k_EPersonaStateBusy = 2 , / / user is on , but busy <nl> + k_EPersonaStateAway = 3 , / / auto - away feature <nl> + k_EPersonaStateSnooze = 4 , / / auto - away for a long time <nl> + k_EPersonaStateMax , <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : flags for enumerating friends list , or quickly checking a the relationship between users <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + enum EFriendFlags <nl> + { <nl> + k_EFriendFlagNone = 0x00 , <nl> + k_EFriendFlagBlocked = 0x01 , <nl> + k_EFriendFlagFriendshipRequested = 0x02 , <nl> + k_EFriendFlagImmediate = 0x04 , / / " regular " friend <nl> + k_EFriendFlagClanMember = 0x08 , <nl> + k_EFriendFlagOnGameServer = 0x10 , <nl> + / / k_EFriendFlagHasPlayedWith = 0x20 , / / not currently used <nl> + / / k_EFriendFlagFriendOfFriend = 0x40 , / / not currently used <nl> + k_EFriendFlagRequestingFriendship = 0x80 , <nl> + k_EFriendFlagRequestingInfo = 0x100 , <nl> + k_EFriendFlagIgnored = 0x200 , <nl> + k_EFriendFlagIgnoredFriend = 0x400 , <nl> + k_EFriendFlagAll = 0xFFFF , <nl> + } ; <nl> + <nl> + <nl> + / / friend game played information <nl> + # pragma pack ( push , 8 ) <nl> + struct FriendGameInfo_t <nl> + { <nl> + CGameID m_gameID ; <nl> + uint32 m_unGameIP ; <nl> + uint16 m_usGamePort ; <nl> + uint16 m_usQueryPort ; <nl> + CSteamID m_steamIDLobby ; <nl> + } ; <nl> + # pragma pack ( pop ) <nl> + <nl> + <nl> + / / maximum number of characters in a user ' s name . Two flavors ; one for UTF - 8 and one for UTF - 16 . <nl> + / / The UTF - 8 version has to be very generous to accomodate characters that get large when encoded <nl> + / / in UTF - 8 . <nl> + enum <nl> + { <nl> + k_cchPersonaNameMax = 128 , <nl> + k_cwchPersonaNameMax = 32 , <nl> + } ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : user restriction flags <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + enum EUserRestriction <nl> + { <nl> + k_nUserRestrictionNone = 0 , / / no known chat / content restriction <nl> + k_nUserRestrictionUnknown = 1 , / / we don ' t know yet ( user offline ) <nl> + k_nUserRestrictionChat = 2 , / / user is not allowed to send / recv text / voice chat <nl> + } ; <nl> + <nl> + <nl> + <nl> + / / size limit on chat room or member metadata <nl> + const uint32 k_cubChatMetadataMax = 8192 ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : interface to accessing information about individual users , <nl> + / / that can be a friend , in a group , on a game server or in a lobby with the local user <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamFriends <nl> + { <nl> + public : <nl> + / / returns the local players name - guaranteed to not be NULL . <nl> + / / this is the same name as on the users community profile page <nl> + / / this is stored in UTF - 8 format <nl> + / / like all the other interface functions that return a char * , it ' s important that this pointer is not saved <nl> + / / off ; it will eventually be free ' d or re - allocated <nl> + virtual const char * GetPersonaName ( ) = 0 ; <nl> + <nl> + / / sets the player name , stores it on the server and publishes the changes to all friends who are online <nl> + virtual void SetPersonaName ( const char * pchPersonaName ) = 0 ; <nl> + <nl> + / / gets the status of the current user <nl> + virtual EPersonaState GetPersonaState ( ) = 0 ; <nl> + <nl> + / / friend iteration <nl> + / / takes a set of k_EFriendFlags , and returns the number of users the client knows about who meet that criteria <nl> + / / then GetFriendByIndex ( ) can then be used to return the id ' s of each of those users <nl> + virtual int GetFriendCount ( int iFriendFlags ) = 0 ; <nl> + <nl> + / / returns the steamID of a user <nl> + / / iFriend is a index of range [ 0 , GetFriendCount ( ) ) <nl> + / / iFriendsFlags must be the same value as used in GetFriendCount ( ) <nl> + / / the returned CSteamID can then be used by all the functions below to access details about the user <nl> + virtual CSteamID GetFriendByIndex ( int iFriend , int iFriendFlags ) = 0 ; <nl> + <nl> + / / returns a relationship to a user <nl> + virtual EFriendRelationship GetFriendRelationship ( CSteamID steamIDFriend ) = 0 ; <nl> + <nl> + / / returns the current status of the specified user <nl> + / / this will only be known by the local user if steamIDFriend is in their friends list ; on the same game server ; in a chat room or lobby ; or in a small group with the local user <nl> + virtual EPersonaState GetFriendPersonaState ( CSteamID steamIDFriend ) = 0 ; <nl> + <nl> + / / returns the name another user - guaranteed to not be NULL . <nl> + / / same rules as GetFriendPersonaState ( ) apply as to whether or not the user knowns the name of the other user <nl> + / / note that on first joining a lobby , chat room or game server the local user will not known the name of the other users automatically ; that information will arrive asyncronously <nl> + / / <nl> + virtual const char * GetFriendPersonaName ( CSteamID steamIDFriend ) = 0 ; <nl> + <nl> + / / returns true if the friend is actually in a game , and fills in pFriendGameInfo with an extra details <nl> + virtual bool GetFriendGamePlayed ( CSteamID steamIDFriend , FriendGameInfo_t * pFriendGameInfo ) = 0 ; <nl> + / / accesses old friends names - returns an empty string when their are no more items in the history <nl> + virtual const char * GetFriendPersonaNameHistory ( CSteamID steamIDFriend , int iPersonaName ) = 0 ; <nl> + <nl> + / / returns true if the specified user meets any of the criteria specified in iFriendFlags <nl> + / / iFriendFlags can be the union ( binary or , | ) of one or more k_EFriendFlags values <nl> + virtual bool HasFriend ( CSteamID steamIDFriend , int iFriendFlags ) = 0 ; <nl> + <nl> + / / clan ( group ) iteration and access functions <nl> + virtual int GetClanCount ( ) = 0 ; <nl> + virtual CSteamID GetClanByIndex ( int iClan ) = 0 ; <nl> + virtual const char * GetClanName ( CSteamID steamIDClan ) = 0 ; <nl> + virtual const char * GetClanTag ( CSteamID steamIDClan ) = 0 ; <nl> + <nl> + / / iterators for getting users in a chat room , lobby , game server or clan <nl> + / / note that large clans that cannot be iterated by the local user <nl> + / / steamIDSource can be the steamID of a group , game server , lobby or chat room <nl> + virtual int GetFriendCountFromSource ( CSteamID steamIDSource ) = 0 ; <nl> + virtual CSteamID GetFriendFromSourceByIndex ( CSteamID steamIDSource , int iFriend ) = 0 ; <nl> + <nl> + / / returns true if the local user can see that steamIDUser is a member or in steamIDSource <nl> + virtual bool IsUserInSource ( CSteamID steamIDUser , CSteamID steamIDSource ) = 0 ; <nl> + <nl> + / / User is in a game pressing the talk button ( will suppress the microphone for all voice comms from the Steam friends UI ) <nl> + virtual void SetInGameVoiceSpeaking ( CSteamID steamIDUser , bool bSpeaking ) = 0 ; <nl> + <nl> + / / activates the game overlay , with an optional dialog to open <nl> + / / valid options are " Friends " , " Community " , " Players " , " Settings " , " LobbyInvite " , " OfficialGameGroup " , " Stats " , " Achievements " <nl> + virtual void ActivateGameOverlay ( const char * pchDialog ) = 0 ; <nl> + <nl> + / / activates game overlay to a specific place <nl> + / / valid options are <nl> + / / " steamid " - opens the overlay web browser to the specified user or groups profile <nl> + / / " chat " - opens a chat window to the specified user , or joins the group chat <nl> + / / " stats " - opens the overlay web browser to the specified user ' s stats <nl> + / / " achievements " - opens the overlay web browser to the specified user ' s achievements <nl> + virtual void ActivateGameOverlayToUser ( const char * pchDialog , CSteamID steamID ) = 0 ; <nl> + <nl> + / / activates game overlay web browser directly to the specified URL <nl> + / / full address with protocol type is required , e . g . http : / / www . steamgames . com / <nl> + virtual void ActivateGameOverlayToWebPage ( const char * pchURL ) = 0 ; <nl> + <nl> + / / activates game overlay to store page for app <nl> + virtual void ActivateGameOverlayToStore ( AppId_t nAppID ) = 0 ; <nl> + <nl> + / / Mark a target user as ' played with ' . This is a client - side only feature that requires that the calling user is <nl> + / / in game <nl> + virtual void SetPlayedWith ( CSteamID steamIDUserPlayedWith ) = 0 ; <nl> + <nl> + / / activates game overlay to open the invite dialog . Invitations will be sent for the provided lobby . <nl> + / / You can also use ActivateGameOverlay ( " LobbyInvite " ) to allow the user to create invitations for their current public lobby . <nl> + virtual void ActivateGameOverlayInviteDialog ( CSteamID steamIDLobby ) = 0 ; <nl> + <nl> + / / gets the small ( 32x32 ) avatar of the current user , which is a handle to be used in IClientUtils : : GetImageRGBA ( ) , or 0 if none set <nl> + virtual int GetSmallFriendAvatar ( CSteamID steamIDFriend ) = 0 ; <nl> + <nl> + / / gets the medium ( 64x64 ) avatar of the current user , which is a handle to be used in IClientUtils : : GetImageRGBA ( ) , or 0 if none set <nl> + virtual int GetMediumFriendAvatar ( CSteamID steamIDFriend ) = 0 ; <nl> + <nl> + / / gets the large ( 184x184 ) avatar of the current user , which is a handle to be used in IClientUtils : : GetImageRGBA ( ) , or 0 if none set <nl> + / / returns - 1 if this image has yet to be loaded , in this case wait for a AvatarImageLoaded_t callback and then call this again <nl> + virtual int GetLargeFriendAvatar ( CSteamID steamIDFriend ) = 0 ; <nl> + <nl> + / / requests information about a user - persona name & avatar <nl> + / / if bRequireNameOnly is set , then the avatar of a user isn ' t downloaded <nl> + / / - it ' s a lot slower to download avatars and churns the local cache , so if you don ' t need avatars , don ' t request them <nl> + / / if returns true , it means that data is being requested , and a PersonaStateChanged_t callback will be posted when it ' s retrieved <nl> + / / if returns false , it means that we already have all the details about that user , and functions can be called immediately <nl> + virtual bool RequestUserInformation ( CSteamID steamIDUser , bool bRequireNameOnly ) = 0 ; <nl> + <nl> + / / requests information about a clan officer list <nl> + / / when complete , data is returned in ClanOfficerListResponse_t call result <nl> + / / this makes available the calls below <nl> + / / you can only ask about clans that a user is a member of <nl> + / / note that this won ' t download avatars automatically ; if you get an officer , <nl> + / / and no avatar image is available , call RequestUserInformation ( steamID , false ) to download the avatar <nl> + virtual SteamAPICall_t RequestClanOfficerList ( CSteamID steamIDClan ) = 0 ; <nl> + <nl> + / / iteration of clan officers - can only be done when a RequestClanOfficerList ( ) call has completed <nl> + <nl> + / / returns the steamID of the clan owner <nl> + virtual CSteamID GetClanOwner ( CSteamID steamIDClan ) = 0 ; <nl> + / / returns the number of officers in a clan ( including the owner ) <nl> + virtual int GetClanOfficerCount ( CSteamID steamIDClan ) = 0 ; <nl> + / / returns the steamID of a clan officer , by index , of range [ 0 , GetClanOfficerCount ) <nl> + virtual CSteamID GetClanOfficerByIndex ( CSteamID steamIDClan , int iOfficer ) = 0 ; <nl> + / / if current user is chat restricted , he can ' t send or receive any text / voice chat messages . <nl> + / / the user can ' t see custom avatars . But the user can be online and send / recv game invites . <nl> + / / a chat restricted user can ' t add friends or join any groups . <nl> + virtual uint32 GetUserRestrictions ( ) = 0 ; <nl> + } ; <nl> + <nl> + # define STEAMFRIENDS_INTERFACE_VERSION " SteamFriends008 " <nl> + <nl> + / / callbacks <nl> + # pragma pack ( push , 8 ) <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : called when a friends ' status changes <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct PersonaStateChange_t <nl> + { <nl> + enum { k_iCallback = k_iSteamFriendsCallbacks + 4 } ; <nl> + <nl> + uint64 m_ulSteamID ; / / steamID of the friend who changed <nl> + int m_nChangeFlags ; / / what ' s changed <nl> + } ; <nl> + <nl> + <nl> + / / used in PersonaStateChange_t : : m_nChangeFlags to describe what ' s changed about a user <nl> + / / these flags describe what the client has learned has changed recently , so on startup you ' ll see a name , avatar & relationship change for every friend <nl> + enum EPersonaChange <nl> + { <nl> + k_EPersonaChangeName = 0x001 , <nl> + k_EPersonaChangeStatus = 0x002 , <nl> + k_EPersonaChangeComeOnline = 0x004 , <nl> + k_EPersonaChangeGoneOffline = 0x008 , <nl> + k_EPersonaChangeGamePlayed = 0x010 , <nl> + k_EPersonaChangeGameServer = 0x020 , <nl> + k_EPersonaChangeAvatar = 0x040 , <nl> + k_EPersonaChangeJoinedSource = 0x080 , <nl> + k_EPersonaChangeLeftSource = 0x100 , <nl> + k_EPersonaChangeRelationshipChanged = 0x200 , <nl> + k_EPersonaChangeNameFirstSet = 0x400 , <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : posted when game overlay activates or deactivates <nl> + / / the game can use this to be pause or resume single player games <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct GameOverlayActivated_t <nl> + { <nl> + enum { k_iCallback = k_iSteamFriendsCallbacks + 31 } ; <nl> + uint8 m_bActive ; / / true if it ' s just been activated , false otherwise <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : called when the user tries to join a different game server from their friends list <nl> + / / game client should attempt to connect to specified server when this is received <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct GameServerChangeRequested_t <nl> + { <nl> + enum { k_iCallback = k_iSteamFriendsCallbacks + 32 } ; <nl> + char m_rgchServer [ 64 ] ; / / server address ( " 127 . 0 . 0 . 1 : 27015 " , " tf2 . valvesoftware . com " ) <nl> + char m_rgchPassword [ 64 ] ; / / server password , if any <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : called when the user tries to join a lobby from their friends list <nl> + / / game client should attempt to connect to specified lobby when this is received <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct GameLobbyJoinRequested_t <nl> + { <nl> + enum { k_iCallback = k_iSteamFriendsCallbacks + 33 } ; <nl> + CSteamID m_steamIDLobby ; <nl> + CSteamID m_steamIDFriend ; / / the friend they did the join via ( will be invalid if not directly via a friend ) <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : called when an avatar is loaded in from a previous GetLargeFriendAvatar ( ) call <nl> + / / if the image wasn ' t already available <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct AvatarImageLoaded_t <nl> + { <nl> + enum { k_iCallback = k_iSteamFriendsCallbacks + 34 } ; <nl> + CSteamID m_steamID ; / / steamid the avatar has been loaded for <nl> + int m_iImage ; / / the image index of the now loaded image <nl> + int m_iWide ; / / width of the loaded image <nl> + int m_iTall ; / / height of the loaded image <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : marks the return of a request officer list call <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct ClanOfficerListResponse_t <nl> + { <nl> + enum { k_iCallback = k_iSteamFriendsCallbacks + 35 } ; <nl> + CSteamID m_steamIDClan ; <nl> + int m_cOfficers ; <nl> + uint8 m_bSuccess ; <nl> + } ; <nl> + <nl> + <nl> + # pragma pack ( pop ) <nl> + <nl> + # endif / / ISTEAMFRIENDS_H <nl> new file mode 100644 <nl> index 00000000 . . dded0942 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / isteamgamecoordinator . h <nl> <nl> + / / = = = = = = Copyright © , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : interface to the game coordinator for this application <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef ISTEAMGAMECOORDINATOR <nl> + # define ISTEAMGAMECOORDINATOR <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # include " isteamclient . h " <nl> + # include " steamtypes . h " <nl> + # include " steamclientpublic . h " <nl> + <nl> + <nl> + / / list of possible return values from the ISteamGameCoordinator API <nl> + enum EGCResults <nl> + { <nl> + k_EGCResultOK = 0 , <nl> + k_EGCResultNoMessage = 1 , / / There is no message in the queue <nl> + k_EGCResultBufferTooSmall = 2 , / / The buffer is too small for the requested message <nl> + k_EGCResultNotLoggedOn = 3 , / / The client is not logged onto Steam <nl> + k_EGCResultInvalidMessage = 4 , / / Something was wrong with the message being sent with SendMessage <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Functions for sending and receiving messages from the Game Coordinator <nl> + / / for this application <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamGameCoordinator <nl> + { <nl> + public : <nl> + <nl> + / / sends a message to the Game Coordinator <nl> + virtual EGCResults SendMessage ( uint32 unMsgType , const void * pubData , uint32 cubData ) = 0 ; <nl> + <nl> + / / returns true if there is a message waiting from the game coordinator <nl> + virtual bool IsMessageAvailable ( uint32 * pcubMsgSize ) = 0 ; <nl> + <nl> + / / fills the provided buffer with the first message in the queue and returns k_EGCResultOK or <nl> + / / returns k_EGCResultNoMessage if there is no message waiting . pcubMsgSize is filled with the message size . <nl> + / / If the provided buffer is not large enough to fit the entire message , k_EGCResultBufferTooSmall is returned <nl> + / / and the message remains at the head of the queue . <nl> + virtual EGCResults RetrieveMessage ( uint32 * punMsgType , void * pubDest , uint32 cubDest , uint32 * pcubMsgSize ) = 0 ; <nl> + <nl> + } ; <nl> + # define STEAMGAMECOORDINATOR_INTERFACE_VERSION " SteamGameCoordinator001 " <nl> + <nl> + / / callback notification - A new message is available for reading from the message queue <nl> + struct GCMessageAvailable_t <nl> + { <nl> + enum { k_iCallback = k_iSteamGameCoordinatorCallbacks + 1 } ; <nl> + uint32 m_nMessageSize ; <nl> + } ; <nl> + <nl> + / / callback notification - A message failed to make it to the GC . It may be down temporarily <nl> + struct GCMessageFailed_t <nl> + { <nl> + enum { k_iCallback = k_iSteamGameCoordinatorCallbacks + 2 } ; <nl> + } ; <nl> + <nl> + # endif / / ISTEAMGAMECOORDINATOR <nl> new file mode 100644 <nl> index 00000000 . . 6ad98b39 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / isteamgameserver . h <nl> <nl> + / / = = = = = = Copyright ( c ) 1996 - 2008 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : interface to steam for game servers <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef ISTEAMGAMESERVER_H <nl> + # define ISTEAMGAMESERVER_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # include " isteamclient . h " <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Functions for authenticating users via Steam to play on a game server <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamGameServer <nl> + { <nl> + public : <nl> + / / connection functions <nl> + virtual void LogOn ( ) = 0 ; <nl> + virtual void LogOff ( ) = 0 ; <nl> + <nl> + / / status functions <nl> + virtual bool BLoggedOn ( ) = 0 ; <nl> + virtual bool BSecure ( ) = 0 ; <nl> + virtual CSteamID GetSteamID ( ) = 0 ; <nl> + <nl> + / / Handles receiving a new connection from a Steam user . This call will ask the Steam <nl> + / / servers to validate the users identity , app ownership , and VAC status . If the Steam servers <nl> + / / are off - line , then it will validate the cached ticket itself which will validate app ownership <nl> + / / and identity . The AuthBlob here should be acquired on the game client using SteamUser ( ) - > InitiateGameConnection ( ) <nl> + / / and must then be sent up to the game server for authentication . <nl> + / / <nl> + / / Return Value : returns true if the users ticket passes basic checks . pSteamIDUser will contain the Steam ID of this user . pSteamIDUser must NOT be NULL <nl> + / / If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication <nl> + / / for the user has succeeded or failed ( the steamid in the callback will match the one returned by this call ) <nl> + virtual bool SendUserConnectAndAuthenticate ( uint32 unIPClient , const void * pvAuthBlob , uint32 cubAuthBlobSize , CSteamID * pSteamIDUser ) = 0 ; <nl> + <nl> + / / Creates a fake user ( ie , a bot ) which will be listed as playing on the server , but skips validation . <nl> + / / <nl> + / / Return Value : Returns a SteamID for the user to be tracked with , you should call HandleUserDisconnect ( ) <nl> + / / when this user leaves the server just like you would for a real user . <nl> + virtual CSteamID CreateUnauthenticatedUserConnection ( ) = 0 ; <nl> + <nl> + / / Should be called whenever a user leaves our game server , this lets Steam internally <nl> + / / track which users are currently on which servers for the purposes of preventing a single <nl> + / / account being logged into multiple servers , showing who is currently on a server , etc . <nl> + virtual void SendUserDisconnect ( CSteamID steamIDUser ) = 0 ; <nl> + <nl> + / / Update the data to be displayed in the server browser and matchmaking interfaces for a user <nl> + / / currently connected to the server . For regular users you must call this after you receive a <nl> + / / GSUserValidationSuccess callback . <nl> + / / <nl> + / / Return Value : true if successful , false if failure ( ie , steamIDUser wasn ' t for an active player ) <nl> + virtual bool BUpdateUserData ( CSteamID steamIDUser , const char * pchPlayerName , uint32 uScore ) = 0 ; <nl> + <nl> + / / You shouldn ' t need to call this as it is called internally by SteamGameServer_Init ( ) and can only be called once . <nl> + / / <nl> + / / To update the data in this call which may change during the servers lifetime see UpdateServerStatus ( ) below . <nl> + / / <nl> + / / Input : nGameAppID - The Steam assigned AppID for the game <nl> + / / unServerFlags - Any applicable combination of flags ( see k_unServerFlag____ constants below ) <nl> + / / unGameIP - The IP Address the server is listening for client connections on ( might be INADDR_ANY ) <nl> + / / unGamePort - The port which the server is listening for client connections on <nl> + / / unSpectatorPort - the port on which spectators can join to observe the server , 0 if spectating is not supported <nl> + / / usQueryPort - The port which the ISteamMasterServerUpdater API should use in order to listen for matchmaking requests <nl> + / / pchGameDir - A unique string identifier for your game <nl> + / / pchVersion - The current version of the server as a string like 1 . 0 . 0 . 0 <nl> + / / bLanMode - Is this a LAN only server ? <nl> + / / <nl> + / / bugbug jmccaskey - figure out how to remove this from the API and only expose via SteamGameServer_Init . . . or make this actually used , <nl> + / / and stop calling it in SteamGameServer_Init ( ) ? <nl> + virtual bool BSetServerType ( uint32 unServerFlags , uint32 unGameIP , uint16 unGamePort , <nl> + uint16 unSpectatorPort , uint16 usQueryPort , const char * pchGameDir , const char * pchVersion , bool bLANMode ) = 0 ; <nl> + <nl> + / / Updates server status values which shows up in the server browser and matchmaking APIs <nl> + virtual void UpdateServerStatus ( int cPlayers , int cPlayersMax , int cBotPlayers , <nl> + const char * pchServerName , const char * pSpectatorServerName , <nl> + const char * pchMapName ) = 0 ; <nl> + <nl> + / / This can be called if spectator goes away or comes back ( passing 0 means there is no spectator server now ) . <nl> + virtual void UpdateSpectatorPort ( uint16 unSpectatorPort ) = 0 ; <nl> + <nl> + / / Sets a string defining the " gametags " for this server , this is optional , but if it is set <nl> + / / it allows users to filter in the matchmaking / server - browser interfaces based on the value <nl> + virtual void SetGameTags ( const char * pchGameTags ) = 0 ; <nl> + <nl> + / / Ask for the gameplay stats for the server . Results returned in a callback <nl> + virtual void GetGameplayStats ( ) = 0 ; <nl> + <nl> + / / Gets the reputation score for the game server . This API also checks if the server or some <nl> + / / other server on the same IP is banned from the Steam master servers . <nl> + virtual SteamAPICall_t GetServerReputation ( ) = 0 ; <nl> + <nl> + / / Ask if a user in in the specified group , results returns async by GSUserGroupStatus_t <nl> + / / returns false if we ' re not connected to the steam servers and thus cannot ask <nl> + virtual bool RequestUserGroupStatus ( CSteamID steamIDUser , CSteamID steamIDGroup ) = 0 ; <nl> + <nl> + / / Returns the public IP of the server according to Steam , useful when the server is <nl> + / / behind NAT and you want to advertise its IP in a lobby for other clients to directly <nl> + / / connect to <nl> + virtual uint32 GetPublicIP ( ) = 0 ; <nl> + <nl> + / / Sets a string defining the " gamedata " for this server , this is optional , but if it is set <nl> + / / it allows users to filter in the matchmaking / server - browser interfaces based on the value <nl> + / / don ' t set this unless it actually changes , its only uploaded to the master once ( when <nl> + / / acknowledged ) <nl> + virtual void SetGameData ( const char * pchGameData ) = 0 ; <nl> + <nl> + / / After receiving a user ' s authentication data , and passing it to SendUserConnectAndAuthenticate , use this function <nl> + / / to determine if the user owns downloadable content specified by the provided AppID . <nl> + virtual EUserHasLicenseForAppResult UserHasLicenseForApp ( CSteamID steamID , AppId_t appID ) = 0 ; <nl> + <nl> + / / New auth system APIs - do not mix with the old auth system APIs . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + / / Retrieve ticket to be sent to the entity who wishes to authenticate you ( using BeginAuthSession API ) . <nl> + / / pcbTicket retrieves the length of the actual ticket . <nl> + virtual HAuthTicket GetAuthSessionTicket ( void * pTicket , int cbMaxTicket , uint32 * pcbTicket ) = 0 ; <nl> + <nl> + / / Authenticate ticket ( from GetAuthSessionTicket ) from entity steamID to be sure it is valid and isnt reused <nl> + / / Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse ) <nl> + virtual EBeginAuthSessionResult BeginAuthSession ( const void * pAuthTicket , int cbAuthTicket , CSteamID steamID ) = 0 ; <nl> + <nl> + / / Stop tracking started by BeginAuthSession - called when no longer playing game with this entity <nl> + virtual void EndAuthSession ( CSteamID steamID ) = 0 ; <nl> + <nl> + / / Cancel auth ticket from GetAuthSessionTicket , called when no longer playing game with the entity you gave the ticket to <nl> + virtual void CancelAuthTicket ( HAuthTicket hAuthTicket ) = 0 ; <nl> + <nl> + } ; <nl> + <nl> + # define STEAMGAMESERVER_INTERFACE_VERSION " SteamGameServer010 " <nl> + <nl> + / / game server flags <nl> + const uint32 k_unServerFlagNone = 0x00 ; <nl> + const uint32 k_unServerFlagActive = 0x01 ; / / server has users playing <nl> + const uint32 k_unServerFlagSecure = 0x02 ; / / server wants to be secure <nl> + const uint32 k_unServerFlagDedicated = 0x04 ; / / server is dedicated <nl> + const uint32 k_unServerFlagLinux = 0x08 ; / / linux build <nl> + const uint32 k_unServerFlagPassworded = 0x10 ; / / password protected <nl> + const uint32 k_unServerFlagPrivate = 0x20 ; / / server shouldn ' t list on master server and <nl> + / / won ' t enforce authentication of users that connect to the server . <nl> + / / Useful when you run a server where the clients may not <nl> + / / be connected to the internet but you want them to play ( i . e LANs ) <nl> + <nl> + <nl> + / / callbacks <nl> + # pragma pack ( push , 8 ) <nl> + <nl> + <nl> + / / client has been approved to connect to this game server <nl> + struct GSClientApprove_t <nl> + { <nl> + enum { k_iCallback = k_iSteamGameServerCallbacks + 1 } ; <nl> + CSteamID m_SteamID ; <nl> + } ; <nl> + <nl> + <nl> + / / client has been denied to connection to this game server <nl> + struct GSClientDeny_t <nl> + { <nl> + enum { k_iCallback = k_iSteamGameServerCallbacks + 2 } ; <nl> + CSteamID m_SteamID ; <nl> + EDenyReason m_eDenyReason ; <nl> + char m_rgchOptionalText [ 128 ] ; <nl> + } ; <nl> + <nl> + <nl> + / / request the game server should kick the user <nl> + struct GSClientKick_t <nl> + { <nl> + enum { k_iCallback = k_iSteamGameServerCallbacks + 3 } ; <nl> + CSteamID m_SteamID ; <nl> + EDenyReason m_eDenyReason ; <nl> + } ; <nl> + <nl> + / / NOTE : callback values 4 and 5 are skipped because they are used for old deprecated callbacks , <nl> + / / do not reuse them here . <nl> + <nl> + <nl> + / / client achievement info <nl> + struct GSClientAchievementStatus_t <nl> + { <nl> + enum { k_iCallback = k_iSteamGameServerCallbacks + 6 } ; <nl> + uint64 m_SteamID ; <nl> + char m_pchAchievement [ 128 ] ; <nl> + bool m_bUnlocked ; <nl> + } ; <nl> + <nl> + / / received when the game server requests to be displayed as secure ( VAC protected ) <nl> + / / m_bSecure is true if the game server should display itself as secure to users , false otherwise <nl> + struct GSPolicyResponse_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserCallbacks + 15 } ; <nl> + uint8 m_bSecure ; <nl> + } ; <nl> + <nl> + / / GS gameplay stats info <nl> + struct GSGameplayStats_t <nl> + { <nl> + enum { k_iCallback = k_iSteamGameServerCallbacks + 7 } ; <nl> + EResult m_eResult ; / / Result of the call <nl> + int32 m_nRank ; / / Overall rank of the server ( 0 - based ) <nl> + uint32 m_unTotalConnects ; / / Total number of clients who have ever connected to the server <nl> + uint32 m_unTotalMinutesPlayed ; / / Total number of minutes ever played on the server <nl> + } ; <nl> + <nl> + / / send as a reply to RequestUserGroupStatus ( ) <nl> + struct GSClientGroupStatus_t <nl> + { <nl> + enum { k_iCallback = k_iSteamGameServerCallbacks + 8 } ; <nl> + CSteamID m_SteamIDUser ; <nl> + CSteamID m_SteamIDGroup ; <nl> + bool m_bMember ; <nl> + bool m_bOfficer ; <nl> + } ; <nl> + <nl> + / / Sent as a reply to GetServerReputation ( ) <nl> + struct GSReputation_t <nl> + { <nl> + enum { k_iCallback = k_iSteamGameServerCallbacks + 9 } ; <nl> + EResult m_eResult ; / / Result of the call ; <nl> + uint32 m_unReputationScore ; / / The reputation score for the game server <nl> + bool m_bBanned ; / / True if the server is banned from the Steam <nl> + / / master servers <nl> + <nl> + / / The following members are only filled out if m_bBanned is true . They will all <nl> + / / be set to zero otherwise . Master server bans are by IP so it is possible to be <nl> + / / banned even when the score is good high if there is a bad server on another port . <nl> + / / This information can be used to determine which server is bad . <nl> + <nl> + uint32 m_unBannedIP ; / / The IP of the banned server <nl> + uint16 m_usBannedPort ; / / The port of the banned server <nl> + uint64 m_ulBannedGameID ; / / The game ID the banned server is serving <nl> + uint32 m_unBanExpires ; / / Time the ban expires , expressed in the Unix epoch ( seconds since 1 / 1 / 1970 ) <nl> + } ; <nl> + <nl> + # pragma pack ( pop ) <nl> + <nl> + # endif / / ISTEAMGAMESERVER_H <nl> new file mode 100644 <nl> index 00000000 . . 988b284d <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / isteamgameserverstats . h <nl> <nl> + / / = = = = = = Copyright © Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : interface for game servers to steam stats and achievements <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef ISTEAMGAMESERVERSTATS_H <nl> + # define ISTEAMGAMESERVERSTATS_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # include " isteamclient . h " <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Functions for authenticating users via Steam to play on a game server <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamGameServerStats <nl> + { <nl> + public : <nl> + / / downloads stats for the user <nl> + / / returns a GSStatsReceived_t callback when completed <nl> + / / if the user has no stats , GSStatsReceived_t . m_eResult will be set to k_EResultFail <nl> + / / these stats will only be auto - updated for clients playing on the server . For other <nl> + / / users you ' ll need to call RequestUserStats ( ) again to refresh any data <nl> + virtual SteamAPICall_t RequestUserStats ( CSteamID steamIDUser ) = 0 ; <nl> + <nl> + / / requests stat information for a user , usable after a successful call to RequestUserStats ( ) <nl> + virtual bool GetUserStat ( CSteamID steamIDUser , const char * pchName , int32 * pData ) = 0 ; <nl> + virtual bool GetUserStat ( CSteamID steamIDUser , const char * pchName , float * pData ) = 0 ; <nl> + virtual bool GetUserAchievement ( CSteamID steamIDUser , const char * pchName , bool * pbAchieved ) = 0 ; <nl> + <nl> + / / Set / update stats and achievements . <nl> + / / Note : These updates will work only on stats game servers are allowed to edit and only for <nl> + / / game servers that have been declared as officially controlled by the game creators . <nl> + / / Set the IP range of your official servers on the Steamworks page <nl> + virtual bool SetUserStat ( CSteamID steamIDUser , const char * pchName , int32 nData ) = 0 ; <nl> + virtual bool SetUserStat ( CSteamID steamIDUser , const char * pchName , float fData ) = 0 ; <nl> + virtual bool UpdateUserAvgRateStat ( CSteamID steamIDUser , const char * pchName , float flCountThisSession , double dSessionLength ) = 0 ; <nl> + <nl> + virtual bool SetUserAchievement ( CSteamID steamIDUser , const char * pchName ) = 0 ; <nl> + virtual bool ClearUserAchievement ( CSteamID steamIDUser , const char * pchName ) = 0 ; <nl> + <nl> + / / Store the current data on the server , will get a GSStatsStored_t callback when set . <nl> + / / <nl> + / / If the callback has a result of k_EResultInvalidParam , one or more stats <nl> + / / uploaded has been rejected , either because they broke constraints <nl> + / / or were out of date . In this case the server sends back updated values . <nl> + / / The stats should be re - iterated to keep in sync . <nl> + virtual SteamAPICall_t StoreUserStats ( CSteamID steamIDUser ) = 0 ; <nl> + } ; <nl> + <nl> + # define STEAMGAMESERVERSTATS_INTERFACE_VERSION " SteamGameServerStats001 " <nl> + <nl> + / / callbacks <nl> + # pragma pack ( push , 8 ) <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : called when the latests stats and achievements have been received <nl> + / / from the server <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct GSStatsReceived_t <nl> + { <nl> + enum { k_iCallback = k_iSteamGameServerStatsCallbacks } ; <nl> + EResult m_eResult ; / / Success / error fetching the stats <nl> + CSteamID m_steamIDUser ; / / The user for whom the stats are retrieved for <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : result of a request to store the user stats for a game <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct GSStatsStored_t <nl> + { <nl> + enum { k_iCallback = k_iSteamGameServerStatsCallbacks + 1 } ; <nl> + EResult m_eResult ; / / success / error <nl> + CSteamID m_steamIDUser ; / / The user for whom the stats were stored <nl> + } ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Callback indicating that a user ' s stats have been unloaded . <nl> + / / Call RequestUserStats again to access stats for this user <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct GSStatsUnloaded_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserStatsCallbacks + 8 } ; <nl> + CSteamID m_steamIDUser ; / / User whose stats have been unloaded <nl> + } ; <nl> + <nl> + # pragma pack ( pop ) <nl> + <nl> + <nl> + # endif / / ISTEAMGAMESERVERSTATS_H <nl> new file mode 100644 <nl> index 00000000 . . 57681f48 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / isteamgamestats . h <nl> <nl> + / / = = = = = = Copyright © 1996 - 2008 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : interface to steam for game play statistics <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef ISTEAMGAMESTATS_H <nl> + # define ISTEAMGAMESTATS_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Functions for recording game play sessions and details thereof <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamGameStats <nl> + { <nl> + public : <nl> + virtual SteamAPICall_t GetNewSession ( int8 nAccountType , uint64 ulAccountID , int32 nAppID , RTime32 rtTimeStarted ) = 0 ; <nl> + virtual SteamAPICall_t EndSession ( uint64 ulSessionID , RTime32 rtTimeEnded , int nReasonCode ) = 0 ; <nl> + virtual EResult AddSessionAttributeInt ( uint64 ulSessionID , const char * pstrName , int32 nData ) = 0 ; <nl> + virtual EResult AddSessionAttributeString ( uint64 ulSessionID , const char * pstrName , const char * pstrData ) = 0 ; <nl> + virtual EResult AddSessionAttributeFloat ( uint64 ulSessionID , const char * pstrName , float fData ) = 0 ; <nl> + <nl> + virtual EResult AddNewRow ( uint64 * pulRowID , uint64 ulSessionID , const char * pstrTableName ) = 0 ; <nl> + virtual EResult CommitRow ( uint64 ulRowID ) = 0 ; <nl> + virtual EResult CommitOutstandingRows ( uint64 ulSessionID ) = 0 ; <nl> + virtual EResult AddRowAttributeInt ( uint64 ulRowID , const char * pstrName , int32 nData ) = 0 ; <nl> + virtual EResult AddRowAtributeString ( uint64 ulRowID , const char * pstrName , const char * pstrData ) = 0 ; <nl> + virtual EResult AddRowAttributeFloat ( uint64 ulRowID , const char * pstrName , float fData ) = 0 ; <nl> + <nl> + virtual EResult AddSessionAttributeInt64 ( uint64 ulSessionID , const char * pstrName , int64 llData ) = 0 ; <nl> + virtual EResult AddRowAttributeInt64 ( uint64 ulRowID , const char * pstrName , int64 llData ) = 0 ; <nl> + } ; <nl> + <nl> + # define STEAMGAMESTATS_INTERFACE_VERSION " SteamGameStats001 " <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : nAccountType for GetNewSession <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + enum EGameStatsAccountType <nl> + { <nl> + k_EGameStatsAccountType_Steam = 1 , / / ullAccountID is a 64 - bit SteamID for a player <nl> + k_EGameStatsAccountType_Xbox = 2 , / / ullAccountID is a 64 - bit XUID <nl> + k_EGameStatsAccountType_SteamGameServer = 3 , / / ullAccountID is a 64 - bit SteamID for a game server <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : callback for GetNewSession ( ) method <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct GameStatsSessionIssued_t <nl> + { <nl> + enum { k_iCallback = k_iSteamGameStatsCallbacks + 1 } ; <nl> + <nl> + uint64 m_ulSessionID ; <nl> + EResult m_eResult ; <nl> + bool m_bCollectingAny ; <nl> + bool m_bCollectingDetails ; <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : callback for EndSession ( ) method <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct GameStatsSessionClosed_t <nl> + { <nl> + enum { k_iCallback = k_iSteamGameStatsCallbacks + 2 } ; <nl> + <nl> + uint64 m_ulSessionID ; <nl> + EResult m_eResult ; <nl> + } ; <nl> + <nl> + # endif / / ISTEAMGAMESTATS_H <nl> new file mode 100644 <nl> index 00000000 . . 9ea09a8b <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / isteammasterserverupdater . h <nl> <nl> + / / = = = = = = Copyright © 1996 - 2008 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : interface to steam for retrieving list of game servers <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef ISTEAMMASTERSERVERUPDATER_H <nl> + # define ISTEAMMASTERSERVERUPDATER_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # include " isteamclient . h " <nl> + <nl> + # define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ( ( uint16 ) - 1 ) <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Game engines use this to tell the Steam master servers <nl> + / / about their games so their games can show up in the server browser . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamMasterServerUpdater <nl> + { <nl> + public : <nl> + <nl> + / / Call this as often as you like to tell the master server updater whether or not <nl> + / / you want it to be active ( default : off ) . <nl> + virtual void SetActive ( bool bActive ) = 0 ; <nl> + <nl> + / / You usually don ' t need to modify this . <nl> + / / Pass - 1 to use the default value for iHeartbeatInterval . <nl> + / / Some mods change this . <nl> + virtual void SetHeartbeatInterval ( int iHeartbeatInterval ) = 0 ; <nl> + <nl> + <nl> + / / These are in GameSocketShare mode , where instead of ISteamMasterServerUpdater creating its own <nl> + / / socket to talk to the master server on , it lets the game use its socket to forward messages <nl> + / / back and forth . This prevents us from requiring server ops to open up yet another port <nl> + / / in their firewalls . <nl> + / / <nl> + / / the IP address and port should be in host order , i . e 127 . 0 . 0 . 1 = = 0x7f000001 <nl> + <nl> + / / These are used when you ' ve elected to multiplex the game server ' s UDP socket <nl> + / / rather than having the master server updater use its own sockets . <nl> + / / <nl> + / / Source games use this to simplify the job of the server admins , so they <nl> + / / don ' t have to open up more ports on their firewalls . <nl> + <nl> + / / Call this when a packet that starts with 0xFFFFFFFF comes in . That means <nl> + / / it ' s for us . <nl> + virtual bool HandleIncomingPacket ( const void * pData , int cbData , uint32 srcIP , uint16 srcPort ) = 0 ; <nl> + <nl> + / / AFTER calling HandleIncomingPacket for any packets that came in that frame , call this . <nl> + / / This gets a packet that the master server updater needs to send out on UDP . <nl> + / / It returns the length of the packet it wants to send , or 0 if there are no more packets to send . <nl> + / / Call this each frame until it returns 0 . <nl> + virtual int GetNextOutgoingPacket ( void * pOut , int cbMaxOut , uint32 * pNetAdr , uint16 * pPort ) = 0 ; <nl> + <nl> + <nl> + / / Functions to set various fields that are used to respond to queries . <nl> + <nl> + / / Call this to set basic data that is passed to the server browser . <nl> + virtual void SetBasicServerData ( <nl> + unsigned short nProtocolVersion , <nl> + bool bDedicatedServer , <nl> + const char * pRegionName , <nl> + const char * pProductName , <nl> + unsigned short nMaxReportedClients , <nl> + bool bPasswordProtected , <nl> + const char * pGameDescription ) = 0 ; <nl> + <nl> + / / Call this to clear the whole list of key / values that are sent in rules queries . <nl> + virtual void ClearAllKeyValues ( ) = 0 ; <nl> + <nl> + / / Call this to add / update a key / value pair . <nl> + virtual void SetKeyValue ( const char * pKey , const char * pValue ) = 0 ; <nl> + <nl> + <nl> + / / You can call this upon shutdown to clear out data stored for this game server and <nl> + / / to tell the master servers that this server is going away . <nl> + virtual void NotifyShutdown ( ) = 0 ; <nl> + <nl> + / / Returns true if the master server has requested a restart . <nl> + / / Only returns true once per request . <nl> + virtual bool WasRestartRequested ( ) = 0 ; <nl> + <nl> + / / Force it to request a heartbeat from the master servers . <nl> + virtual void ForceHeartbeat ( ) = 0 ; <nl> + <nl> + / / Manually edit and query the master server list . <nl> + / / It will provide name resolution and use the default master server port if none is provided . <nl> + virtual bool AddMasterServer ( const char * pServerAddress ) = 0 ; <nl> + virtual bool RemoveMasterServer ( const char * pServerAddress ) = 0 ; <nl> + <nl> + virtual int GetNumMasterServers ( ) = 0 ; <nl> + <nl> + / / Returns the # of bytes written to pOut . <nl> + virtual int GetMasterServerAddress ( int iServer , char * pOut , int outBufferSize ) = 0 ; <nl> + } ; <nl> + <nl> + # define STEAMMASTERSERVERUPDATER_INTERFACE_VERSION " SteamMasterServerUpdater001 " <nl> + <nl> + # endif / / ISTEAMMASTERSERVERUPDATER_H <nl> new file mode 100644 <nl> index 00000000 . . 03f253fd <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / isteammatchmaking . h <nl> <nl> + / / = = = = = = Copyright © 1996 - 2008 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : interface to steam managing game server / client match making <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef ISTEAMMATCHMAKING <nl> + # define ISTEAMMATCHMAKING <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # include " steamtypes . h " <nl> + # include " steamclientpublic . h " <nl> + # include " matchmakingtypes . h " <nl> + # include " isteamclient . h " <nl> + # include " isteamfriends . h " <nl> + <nl> + / / lobby type description <nl> + enum ELobbyType <nl> + { <nl> + k_ELobbyTypePrivate = 0 , / / only way to join the lobby is to invite to someone else <nl> + k_ELobbyTypeFriendsOnly = 1 , / / shows for friends or invitees , but not in lobby list <nl> + k_ELobbyTypePublic = 2 , / / visible for friends and in lobby list <nl> + k_ELobbyTypeInvisible = 3 , / / returned by search , but not visible to other friends <nl> + / / useful if you want a user in two lobbies , for example matching groups together <nl> + / / a user can be in only one regular lobby , and up to two invisible lobbies <nl> + } ; <nl> + <nl> + / / lobby search filter tools <nl> + enum ELobbyComparison <nl> + { <nl> + k_ELobbyComparisonEqualToOrLessThan = - 2 , <nl> + k_ELobbyComparisonLessThan = - 1 , <nl> + k_ELobbyComparisonEqual = 0 , <nl> + k_ELobbyComparisonGreaterThan = 1 , <nl> + k_ELobbyComparisonEqualToOrGreaterThan = 2 , <nl> + k_ELobbyComparisonNotEqual = 3 , <nl> + } ; <nl> + <nl> + / / lobby search distance <nl> + enum ELobbyDistanceFilter <nl> + { <nl> + k_ELobbyDistanceFilterClose , / / only lobbies in the same immediate region will be returned <nl> + k_ELobbyDistanceFilterDefault , / / only lobbies in the same region or close , but looking further if the current region has infrequent lobby activity ( the default ) <nl> + k_ELobbyDistanceFilterFar , / / for games that don ' t have many latency requirements , will return lobbies about half - way around the globe <nl> + k_ELobbyDistanceFilterWorldwide , / / no filtering , will match lobbies as far as India to NY ( not recommended , expect multiple seconds of latency between the clients ) <nl> + } ; <nl> + <nl> + / / maximum number of characters a lobby metadata key can be <nl> + # define k_nMaxLobbyKeyLength 255 <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Functions for match making services for clients to get to favorites <nl> + / / and to operate on game lobbies . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamMatchmaking <nl> + { <nl> + public : <nl> + / / game server favorites storage <nl> + / / saves basic details about a multiplayer game server locally <nl> + <nl> + / / returns the number of favorites servers the user has stored <nl> + virtual int GetFavoriteGameCount ( ) = 0 ; <nl> + <nl> + / / returns the details of the game server <nl> + / / iGame is of range [ 0 , GetFavoriteGameCount ( ) ) <nl> + / / * pnIP , * pnConnPort are filled in the with IP : port of the game server <nl> + / / * punFlags specify whether the game server was stored as an explicit favorite or in the history of connections <nl> + / / * pRTime32LastPlayedOnServer is filled in the with the Unix time the favorite was added <nl> + virtual bool GetFavoriteGame ( int iGame , AppId_t * pnAppID , uint32 * pnIP , uint16 * pnConnPort , uint16 * pnQueryPort , uint32 * punFlags , uint32 * pRTime32LastPlayedOnServer ) = 0 ; <nl> + <nl> + / / adds the game server to the local list ; updates the time played of the server if it already exists in the list <nl> + virtual int AddFavoriteGame ( AppId_t nAppID , uint32 nIP , uint16 nConnPort , uint16 nQueryPort , uint32 unFlags , uint32 rTime32LastPlayedOnServer ) = 0 ; <nl> + <nl> + / / removes the game server from the local storage ; returns true if one was removed <nl> + virtual bool RemoveFavoriteGame ( AppId_t nAppID , uint32 nIP , uint16 nConnPort , uint16 nQueryPort , uint32 unFlags ) = 0 ; <nl> + <nl> + / / / / / / / <nl> + / / Game lobby functions <nl> + <nl> + / / Get a list of relevant lobbies <nl> + / / this is an asynchronous request <nl> + / / results will be returned by LobbyMatchList_t callback & call result , with the number of lobbies found <nl> + / / this will never return lobbies that are full <nl> + / / to add more filter , the filter calls below need to be call before each and every RequestLobbyList ( ) call <nl> + / / use the CCallResult < > object in steam_api . h to match the SteamAPICall_t call result to a function in an object , e . g . <nl> + / * <nl> + class CMyLobbyListManager <nl> + { <nl> + CCallResult < CMyLobbyListManager , LobbyMatchList_t > m_CallResultLobbyMatchList ; <nl> + void FindLobbies ( ) <nl> + { <nl> + / / SteamMatchmaking ( ) - > AddRequestLobbyListFilter * ( ) functions would be called here , before RequestLobbyList ( ) <nl> + SteamAPICall_t hSteamAPICall = SteamMatchmaking ( ) - > RequestLobbyList ( ) ; <nl> + m_CallResultLobbyMatchList . Set ( hSteamAPICall , this , & CMyLobbyListManager : : OnLobbyMatchList ) ; <nl> + } <nl> + <nl> + void OnLobbyMatchList ( LobbyMatchList_t * pLobbyMatchList , bool bIOFailure ) <nl> + { <nl> + / / lobby list has be retrieved from Steam back - end , use results <nl> + } <nl> + } <nl> + * / <nl> + / / <nl> + virtual SteamAPICall_t RequestLobbyList ( ) = 0 ; <nl> + / / filters for lobbies <nl> + / / this needs to be called before RequestLobbyList ( ) to take effect <nl> + / / these are cleared on each call to RequestLobbyList ( ) <nl> + virtual void AddRequestLobbyListStringFilter ( const char * pchKeyToMatch , const char * pchValueToMatch , ELobbyComparison eComparisonType ) = 0 ; <nl> + / / numerical comparison <nl> + virtual void AddRequestLobbyListNumericalFilter ( const char * pchKeyToMatch , int nValueToMatch , ELobbyComparison eComparisonType ) = 0 ; <nl> + / / returns results closest to the specified value . Multiple near filters can be added , with early filters taking precedence <nl> + virtual void AddRequestLobbyListNearValueFilter ( const char * pchKeyToMatch , int nValueToBeCloseTo ) = 0 ; <nl> + / / returns only lobbies with the specified number of slots available <nl> + virtual void AddRequestLobbyListFilterSlotsAvailable ( int nSlotsAvailable ) = 0 ; <nl> + / / sets the distance for which we should search for lobbies ( based on users IP address to location map on the Steam backed ) <nl> + virtual void AddRequestLobbyListDistanceFilter ( ELobbyDistanceFilter eLobbyDistanceFilter ) = 0 ; <nl> + / / sets how many results to return , the lower the count the faster it is to download the lobby results & details to the client <nl> + virtual void AddRequestLobbyListResultCountFilter ( int cMaxResults ) = 0 ; <nl> + <nl> + / / returns the CSteamID of a lobby , as retrieved by a RequestLobbyList call <nl> + / / should only be called after a LobbyMatchList_t callback is received <nl> + / / iLobby is of the range [ 0 , LobbyMatchList_t : : m_nLobbiesMatching ) <nl> + / / the returned CSteamID : : IsValid ( ) will be false if iLobby is out of range <nl> + virtual CSteamID GetLobbyByIndex ( int iLobby ) = 0 ; <nl> + <nl> + / / Create a lobby on the Steam servers . <nl> + / / If private , then the lobby will not be returned by any RequestLobbyList ( ) call ; the CSteamID <nl> + / / of the lobby will need to be communicated via game channels or via InviteUserToLobby ( ) <nl> + / / this is an asynchronous request <nl> + / / results will be returned by LobbyCreated_t callback and call result ; lobby is joined & ready to use at this pointer <nl> + / / a LobbyEnter_t callback will also be received ( since the local user is joining their own lobby ) <nl> + virtual SteamAPICall_t CreateLobby ( ELobbyType eLobbyType , int cMaxMembers ) = 0 ; <nl> + <nl> + / / Joins an existing lobby <nl> + / / this is an asynchronous request <nl> + / / results will be returned by LobbyEnter_t callback & call result , check m_EChatRoomEnterResponse to see if was successful <nl> + / / lobby metadata is available to use immediately on this call completing <nl> + virtual SteamAPICall_t JoinLobby ( CSteamID steamIDLobby ) = 0 ; <nl> + <nl> + / / Leave a lobby ; this will take effect immediately on the client side <nl> + / / other users in the lobby will be notified by a LobbyChatUpdate_t callback <nl> + virtual void LeaveLobby ( CSteamID steamIDLobby ) = 0 ; <nl> + <nl> + / / Invite another user to the lobby <nl> + / / the target user will receive a LobbyInvite_t callback <nl> + / / will return true if the invite is successfully sent , whether or not the target responds <nl> + / / returns false if the local user is not connected to the Steam servers <nl> + / / if the other user clicks the join link , a GameLobbyJoinRequested_t will be posted if the user is in - game , <nl> + / / or if the game isn ' t running yet the game will be launched with the parameter + connect_lobby < 64 - bit lobby id > <nl> + virtual bool InviteUserToLobby ( CSteamID steamIDLobby , CSteamID steamIDInvitee ) = 0 ; <nl> + <nl> + / / Lobby iteration , for viewing details of users in a lobby <nl> + / / only accessible if the lobby user is a member of the specified lobby <nl> + / / persona information for other lobby members ( name , avatar , etc . ) will be asynchronously received <nl> + / / and accessible via ISteamFriends interface <nl> + <nl> + / / returns the number of users in the specified lobby <nl> + virtual int GetNumLobbyMembers ( CSteamID steamIDLobby ) = 0 ; <nl> + / / returns the CSteamID of a user in the lobby <nl> + / / iMember is of range [ 0 , GetNumLobbyMembers ( ) ) <nl> + virtual CSteamID GetLobbyMemberByIndex ( CSteamID steamIDLobby , int iMember ) = 0 ; <nl> + <nl> + / / Get data associated with this lobby <nl> + / / takes a simple key , and returns the string associated with it <nl> + / / " " will be returned if no value is set , or if steamIDLobby is invalid <nl> + virtual const char * GetLobbyData ( CSteamID steamIDLobby , const char * pchKey ) = 0 ; <nl> + / / Sets a key / value pair in the lobby metadata <nl> + / / each user in the lobby will be broadcast this new value , and any new users joining will receive any existing data <nl> + / / this can be used to set lobby names , map , etc . <nl> + / / to reset a key , just set it to " " <nl> + / / other users in the lobby will receive notification of the lobby data change via a LobbyDataUpdate_t callback <nl> + virtual bool SetLobbyData ( CSteamID steamIDLobby , const char * pchKey , const char * pchValue ) = 0 ; <nl> + <nl> + / / returns the number of metadata keys set on the specified lobby <nl> + virtual int GetLobbyDataCount ( CSteamID steamIDLobby ) = 0 ; <nl> + <nl> + / / returns a lobby metadata key / values pair by index , of range [ 0 , GetLobbyDataCount ( ) ) <nl> + virtual bool GetLobbyDataByIndex ( CSteamID steamIDLobby , int iLobbyData , char * pchKey , int cchKeyBufferSize , char * pchValue , int cchValueBufferSize ) = 0 ; <nl> + <nl> + / / removes a metadata key from the lobby <nl> + virtual bool DeleteLobbyData ( CSteamID steamIDLobby , const char * pchKey ) = 0 ; <nl> + <nl> + / / Gets per - user metadata for someone in this lobby <nl> + virtual const char * GetLobbyMemberData ( CSteamID steamIDLobby , CSteamID steamIDUser , const char * pchKey ) = 0 ; <nl> + / / Sets per - user metadata ( for the local user implicitly ) <nl> + virtual void SetLobbyMemberData ( CSteamID steamIDLobby , const char * pchKey , const char * pchValue ) = 0 ; <nl> + <nl> + / / Broadcasts a chat message to the all the users in the lobby <nl> + / / users in the lobby ( including the local user ) will receive a LobbyChatMsg_t callback <nl> + / / returns true if the message is successfully sent <nl> + / / pvMsgBody can be binary or text data , up to 4k <nl> + / / if pvMsgBody is text , cubMsgBody should be strlen ( text ) + 1 , to include the null terminator <nl> + virtual bool SendLobbyChatMsg ( CSteamID steamIDLobby , const void * pvMsgBody , int cubMsgBody ) = 0 ; <nl> + / / Get a chat message as specified in a LobbyChatMsg_t callback <nl> + / / iChatID is the LobbyChatMsg_t : : m_iChatID value in the callback <nl> + / / * pSteamIDUser is filled in with the CSteamID of the member <nl> + / / * pvData is filled in with the message itself <nl> + / / return value is the number of bytes written into the buffer <nl> + virtual int GetLobbyChatEntry ( CSteamID steamIDLobby , int iChatID , CSteamID * pSteamIDUser , void * pvData , int cubData , EChatEntryType * peChatEntryType ) = 0 ; <nl> + <nl> + / / Refreshes metadata for a lobby you ' re not necessarily in right now <nl> + / / you never do this for lobbies you ' re a member of , only if your <nl> + / / this will send down all the metadata associated with a lobby <nl> + / / this is an asynchronous call <nl> + / / returns false if the local user is not connected to the Steam servers <nl> + / / results will be returned by a LobbyDataUpdate_t callback <nl> + / / if the specified lobby doesn ' t exist , LobbyDataUpdate_t : : m_bSuccess will be set to false <nl> + virtual bool RequestLobbyData ( CSteamID steamIDLobby ) = 0 ; <nl> + <nl> + / / sets the game server associated with the lobby <nl> + / / usually at this point , the users will join the specified game server <nl> + / / either the IP / Port or the steamID of the game server has to be valid , depending on how you want the clients to be able to connect <nl> + virtual void SetLobbyGameServer ( CSteamID steamIDLobby , uint32 unGameServerIP , uint16 unGameServerPort , CSteamID steamIDGameServer ) = 0 ; <nl> + / / returns the details of a game server set in a lobby - returns false if there is no game server set , or that lobby doesn ' t exist <nl> + virtual bool GetLobbyGameServer ( CSteamID steamIDLobby , uint32 * punGameServerIP , uint16 * punGameServerPort , CSteamID * psteamIDGameServer ) = 0 ; <nl> + <nl> + / / set the limit on the # of users who can join the lobby <nl> + virtual bool SetLobbyMemberLimit ( CSteamID steamIDLobby , int cMaxMembers ) = 0 ; <nl> + / / returns the current limit on the # of users who can join the lobby ; returns 0 if no limit is defined <nl> + virtual int GetLobbyMemberLimit ( CSteamID steamIDLobby ) = 0 ; <nl> + <nl> + / / updates which type of lobby it is <nl> + / / only lobbies that are k_ELobbyTypePublic or k_ELobbyTypeInvisible , and are set to joinable , will be returned by RequestLobbyList ( ) calls <nl> + virtual bool SetLobbyType ( CSteamID steamIDLobby , ELobbyType eLobbyType ) = 0 ; <nl> + <nl> + / / sets whether or not a lobby is joinable - defaults to true for a new lobby <nl> + / / if set to false , no user can join , even if they are a friend or have been invited <nl> + virtual bool SetLobbyJoinable ( CSteamID steamIDLobby , bool bLobbyJoinable ) = 0 ; <nl> + <nl> + / / returns the current lobby owner <nl> + / / you must be a member of the lobby to access this <nl> + / / there always one lobby owner - if the current owner leaves , another user will become the owner <nl> + / / it is possible ( bur rare ) to join a lobby just as the owner is leaving , thus entering a lobby with self as the owner <nl> + virtual CSteamID GetLobbyOwner ( CSteamID steamIDLobby ) = 0 ; <nl> + <nl> + / / changes who the lobby owner is <nl> + / / you must be the lobby owner for this to succeed , and steamIDNewOwner must be in the lobby <nl> + / / after completion , the local user will no longer be the owner <nl> + virtual bool SetLobbyOwner ( CSteamID steamIDLobby , CSteamID steamIDNewOwner ) = 0 ; <nl> + } ; <nl> + # define STEAMMATCHMAKING_INTERFACE_VERSION " SteamMatchMaking008 " <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Callback interfaces for server list functions ( see ISteamMatchmakingServers below ) <nl> + / / <nl> + / / The idea here is that your game code implements objects that implement these <nl> + / / interfaces to receive callback notifications after calling asynchronous functions <nl> + / / inside the ISteamMatchmakingServers ( ) interface below . <nl> + / / <nl> + / / This is different than normal Steam callback handling due to the potentially <nl> + / / large size of server lists . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Typedef for handle type you will receive when requesting server list . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + typedef void * HServerListRequest ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Callback interface for receiving responses after a server list refresh <nl> + / / or an individual server update . <nl> + / / <nl> + / / Since you get these callbacks after requesting full list refreshes you will <nl> + / / usually implement this interface inside an object like CServerBrowser . If that <nl> + / / object is getting destructed you should use ISteamMatchMakingServers ( ) - > CancelQuery ( ) <nl> + / / to cancel any in - progress queries so you don ' t get a callback into the destructed <nl> + / / object and crash . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamMatchmakingServerListResponse <nl> + { <nl> + public : <nl> + / / Server has responded ok with updated data <nl> + virtual void ServerResponded ( HServerListRequest hRequest , int iServer ) = 0 ; <nl> + <nl> + / / Server has failed to respond <nl> + virtual void ServerFailedToRespond ( HServerListRequest hRequest , int iServer ) = 0 ; <nl> + <nl> + / / A list refresh you had initiated is now 100 % completed <nl> + virtual void RefreshComplete ( HServerListRequest hRequest , EMatchMakingServerResponse response ) = 0 ; <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Callback interface for receiving responses after pinging an individual server <nl> + / / <nl> + / / These callbacks all occur in response to querying an individual server <nl> + / / via the ISteamMatchmakingServers ( ) - > PingServer ( ) call below . If you are <nl> + / / destructing an object that implements this interface then you should call <nl> + / / ISteamMatchmakingServers ( ) - > CancelServerQuery ( ) passing in the handle to the query <nl> + / / which is in progress . Failure to cancel in progress queries when destructing <nl> + / / a callback handler may result in a crash when a callback later occurs . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamMatchmakingPingResponse <nl> + { <nl> + public : <nl> + / / Server has responded successfully and has updated data <nl> + virtual void ServerResponded ( gameserveritem_t & server ) = 0 ; <nl> + <nl> + / / Server failed to respond to the ping request <nl> + virtual void ServerFailedToRespond ( ) = 0 ; <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Callback interface for receiving responses after requesting details on <nl> + / / who is playing on a particular server . <nl> + / / <nl> + / / These callbacks all occur in response to querying an individual server <nl> + / / via the ISteamMatchmakingServers ( ) - > PlayerDetails ( ) call below . If you are <nl> + / / destructing an object that implements this interface then you should call <nl> + / / ISteamMatchmakingServers ( ) - > CancelServerQuery ( ) passing in the handle to the query <nl> + / / which is in progress . Failure to cancel in progress queries when destructing <nl> + / / a callback handler may result in a crash when a callback later occurs . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamMatchmakingPlayersResponse <nl> + { <nl> + public : <nl> + / / Got data on a new player on the server - - you ' ll get this callback once per player <nl> + / / on the server which you have requested player data on . <nl> + virtual void AddPlayerToList ( const char * pchName , int nScore , float flTimePlayed ) = 0 ; <nl> + <nl> + / / The server failed to respond to the request for player details <nl> + virtual void PlayersFailedToRespond ( ) = 0 ; <nl> + <nl> + / / The server has finished responding to the player details request <nl> + / / ( ie , you won ' t get anymore AddPlayerToList callbacks ) <nl> + virtual void PlayersRefreshComplete ( ) = 0 ; <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Callback interface for receiving responses after requesting rules <nl> + / / details on a particular server . <nl> + / / <nl> + / / These callbacks all occur in response to querying an individual server <nl> + / / via the ISteamMatchmakingServers ( ) - > ServerRules ( ) call below . If you are <nl> + / / destructing an object that implements this interface then you should call <nl> + / / ISteamMatchmakingServers ( ) - > CancelServerQuery ( ) passing in the handle to the query <nl> + / / which is in progress . Failure to cancel in progress queries when destructing <nl> + / / a callback handler may result in a crash when a callback later occurs . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamMatchmakingRulesResponse <nl> + { <nl> + public : <nl> + / / Got data on a rule on the server - - you ' ll get one of these per rule defined on <nl> + / / the server you are querying <nl> + virtual void RulesResponded ( const char * pchRule , const char * pchValue ) = 0 ; <nl> + <nl> + / / The server failed to respond to the request for rule details <nl> + virtual void RulesFailedToRespond ( ) = 0 ; <nl> + <nl> + / / The server has finished responding to the rule details request <nl> + / / ( ie , you won ' t get anymore RulesResponded callbacks ) <nl> + virtual void RulesRefreshComplete ( ) = 0 ; <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Typedef for handle type you will receive when querying details on an individual server . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + typedef int HServerQuery ; <nl> + const int HSERVERQUERY_INVALID = 0xffffffff ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Functions for match making services for clients to get to game lists and details <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamMatchmakingServers <nl> + { <nl> + public : <nl> + / / Request a new list of servers of a particular type . These calls each correspond to one of the EMatchMakingType values . <nl> + / / Each call allocates a new asynchronous request object . <nl> + / / Request object must be released by calling ReleaseRequest ( hServerListRequest ) <nl> + virtual HServerListRequest RequestInternetServerList ( AppId_t iApp , MatchMakingKeyValuePair_t * * ppchFilters , uint32 nFilters , ISteamMatchmakingServerListResponse * pRequestServersResponse ) = 0 ; <nl> + virtual HServerListRequest RequestLANServerList ( AppId_t iApp , ISteamMatchmakingServerListResponse * pRequestServersResponse ) = 0 ; <nl> + virtual HServerListRequest RequestFriendsServerList ( AppId_t iApp , MatchMakingKeyValuePair_t * * ppchFilters , uint32 nFilters , ISteamMatchmakingServerListResponse * pRequestServersResponse ) = 0 ; <nl> + virtual HServerListRequest RequestFavoritesServerList ( AppId_t iApp , MatchMakingKeyValuePair_t * * ppchFilters , uint32 nFilters , ISteamMatchmakingServerListResponse * pRequestServersResponse ) = 0 ; <nl> + virtual HServerListRequest RequestHistoryServerList ( AppId_t iApp , MatchMakingKeyValuePair_t * * ppchFilters , uint32 nFilters , ISteamMatchmakingServerListResponse * pRequestServersResponse ) = 0 ; <nl> + virtual HServerListRequest RequestSpectatorServerList ( AppId_t iApp , MatchMakingKeyValuePair_t * * ppchFilters , uint32 nFilters , ISteamMatchmakingServerListResponse * pRequestServersResponse ) = 0 ; <nl> + <nl> + / / Releases the asynchronous request object and cancels any pending query on it if there ' s a pending query in progress . <nl> + / / RefreshComplete callback is not posted when request is released . <nl> + virtual void ReleaseRequest ( HServerListRequest hServerListRequest ) = 0 ; <nl> + <nl> + / * the filters that are available in the ppchFilters params are : <nl> + <nl> + " map " - map the server is running , as set in the dedicated server api <nl> + " dedicated " - reports bDedicated from the API <nl> + " secure " - VAC - enabled <nl> + " full " - not full <nl> + " empty " - not empty <nl> + " noplayers " - is empty <nl> + " proxy " - a relay server <nl> + <nl> + * / <nl> + <nl> + / / Get details on a given server in the list , you can get the valid range of index <nl> + / / values by calling GetServerCount ( ) . You will also receive index values in <nl> + / / ISteamMatchmakingServerListResponse : : ServerResponded ( ) callbacks <nl> + virtual gameserveritem_t * GetServerDetails ( HServerListRequest hRequest , int iServer ) = 0 ; <nl> + <nl> + / / Cancel an request which is operation on the given list type . You should call this to cancel <nl> + / / any in - progress requests before destructing a callback object that may have been passed <nl> + / / to one of the above list request calls . Not doing so may result in a crash when a callback <nl> + / / occurs on the destructed object . <nl> + / / Canceling a query does not release the allocated request handle . <nl> + / / The request handle must be released using ReleaseRequest ( hRequest ) <nl> + virtual void CancelQuery ( HServerListRequest hRequest ) = 0 ; <nl> + <nl> + / / Ping every server in your list again but don ' t update the list of servers <nl> + / / Query callback installed when the server list was requested will be used <nl> + / / again to post notifications and RefreshComplete , so the callback must remain <nl> + / / valid until another RefreshComplete is called on it or the request <nl> + / / is released with ReleaseRequest ( hRequest ) <nl> + virtual void RefreshQuery ( HServerListRequest hRequest ) = 0 ; <nl> + <nl> + / / Returns true if the list is currently refreshing its server list <nl> + virtual bool IsRefreshing ( HServerListRequest hRequest ) = 0 ; <nl> + <nl> + / / How many servers in the given list , GetServerDetails above takes 0 . . . GetServerCount ( ) - 1 <nl> + virtual int GetServerCount ( HServerListRequest hRequest ) = 0 ; <nl> + <nl> + / / Refresh a single server inside of a query ( rather than all the servers ) <nl> + virtual void RefreshServer ( HServerListRequest hRequest , int iServer ) = 0 ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Queries to individual servers directly via IP / Port <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + <nl> + / / Request updated ping time and other details from a single server <nl> + virtual HServerQuery PingServer ( uint32 unIP , uint16 usPort , ISteamMatchmakingPingResponse * pRequestServersResponse ) = 0 ; <nl> + <nl> + / / Request the list of players currently playing on a server <nl> + virtual HServerQuery PlayerDetails ( uint32 unIP , uint16 usPort , ISteamMatchmakingPlayersResponse * pRequestServersResponse ) = 0 ; <nl> + <nl> + / / Request the list of rules that the server is running ( See ISteamMasterServerUpdater - > SetKeyValue ( ) to set the rules server side ) <nl> + virtual HServerQuery ServerRules ( uint32 unIP , uint16 usPort , ISteamMatchmakingRulesResponse * pRequestServersResponse ) = 0 ; <nl> + <nl> + / / Cancel an outstanding Ping / Players / Rules query from above . You should call this to cancel <nl> + / / any in - progress requests before destructing a callback object that may have been passed <nl> + / / to one of the above calls to avoid crashing when callbacks occur . <nl> + virtual void CancelServerQuery ( HServerQuery hServerQuery ) = 0 ; <nl> + } ; <nl> + # define STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION " SteamMatchMakingServers002 " <nl> + <nl> + / / game server flags <nl> + const uint32 k_unFavoriteFlagNone = 0x00 ; <nl> + const uint32 k_unFavoriteFlagFavorite = 0x01 ; / / this game favorite entry is for the favorites list <nl> + const uint32 k_unFavoriteFlagHistory = 0x02 ; / / this game favorite entry is for the history list <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Used in ChatInfo messages - fields specific to a chat member - must fit in a uint32 <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + enum EChatMemberStateChange <nl> + { <nl> + / / Specific to joining / leaving the chatroom <nl> + k_EChatMemberStateChangeEntered = 0x0001 , / / This user has joined or is joining the chat room <nl> + k_EChatMemberStateChangeLeft = 0x0002 , / / This user has left or is leaving the chat room <nl> + k_EChatMemberStateChangeDisconnected = 0x0004 , / / User disconnected without leaving the chat first <nl> + k_EChatMemberStateChangeKicked = 0x0008 , / / User kicked <nl> + k_EChatMemberStateChangeBanned = 0x0010 , / / User kicked and banned <nl> + } ; <nl> + <nl> + / / returns true of the flags indicate that a user has been removed from the chat <nl> + # define BChatMemberStateChangeRemoved ( rgfChatMemberStateChangeFlags ) ( rgfChatMemberStateChangeFlags & ( k_EChatMemberStateChangeDisconnected | k_EChatMemberStateChangeLeft | k_EChatMemberStateChangeKicked | k_EChatMemberStateChangeBanned ) ) <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Callbacks for ISteamMatchmaking ( which go through the regular Steam callback registration system ) <nl> + # pragma pack ( push , 8 ) <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : a server was added / removed from the favorites list , you should refresh now <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct FavoritesListChanged_t <nl> + { <nl> + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 2 } ; <nl> + uint32 m_nIP ; / / an IP of 0 means reload the whole list , any other value means just one server <nl> + uint32 m_nQueryPort ; <nl> + uint32 m_nConnPort ; <nl> + uint32 m_nAppID ; <nl> + uint32 m_nFlags ; <nl> + bool m_bAdd ; / / true if this is adding the entry , otherwise it is a remove <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Someone has invited you to join a Lobby <nl> + / / normally you don ' t need to do anything with this , since <nl> + / / the Steam UI will also display a ' < user > has invited you to the lobby , join ? ' dialog <nl> + / / <nl> + / / if the user outside a game chooses to join , your game will be launched with the parameter " + connect_lobby < 64 - bit lobby id > " , <nl> + / / or with the callback GameLobbyJoinRequested_t if they ' re already in - game <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct LobbyInvite_t <nl> + { <nl> + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 3 } ; <nl> + <nl> + uint64 m_ulSteamIDUser ; / / Steam ID of the person making the invite <nl> + uint64 m_ulSteamIDLobby ; / / Steam ID of the Lobby <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Sent on entering a lobby , or on failing to enter <nl> + / / m_EChatRoomEnterResponse will be set to k_EChatRoomEnterResponseSuccess on success , <nl> + / / or a higher value on failure ( see enum EChatRoomEnterResponse ) <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct LobbyEnter_t <nl> + { <nl> + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 4 } ; <nl> + <nl> + uint64 m_ulSteamIDLobby ; / / SteamID of the Lobby you have entered <nl> + uint32 m_rgfChatPermissions ; / / Permissions of the current user <nl> + bool m_bLocked ; / / If true , then only invited users may join <nl> + uint32 m_EChatRoomEnterResponse ; / / EChatRoomEnterResponse <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : The lobby metadata has changed <nl> + / / if m_ulSteamIDMember is the steamID of a lobby member , use GetLobbyMemberData ( ) to access per - user details <nl> + / / if m_ulSteamIDMember = = m_ulSteamIDLobby , use GetLobbyData ( ) to access lobby metadata <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct LobbyDataUpdate_t <nl> + { <nl> + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 5 } ; <nl> + <nl> + uint64 m_ulSteamIDLobby ; / / steamID of the Lobby <nl> + uint64 m_ulSteamIDMember ; / / steamID of the member whose data changed , or the room itself <nl> + uint8 m_bSuccess ; / / true if we lobby data was successfully changed ; <nl> + / / will only be false if RequestLobbyData ( ) was called on a lobby that no longer exists <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : The lobby chat room state has changed <nl> + / / this is usually sent when a user has joined or left the lobby <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct LobbyChatUpdate_t <nl> + { <nl> + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 6 } ; <nl> + <nl> + uint64 m_ulSteamIDLobby ; / / Lobby ID <nl> + uint64 m_ulSteamIDUserChanged ; / / user who ' s status in the lobby just changed - can be recipient <nl> + uint64 m_ulSteamIDMakingChange ; / / Chat member who made the change ( different from SteamIDUserChange if kicking , muting , etc . ) <nl> + / / for example , if one user kicks another from the lobby , this will be set to the id of the user who initiated the kick <nl> + uint32 m_rgfChatMemberStateChange ; / / bitfield of EChatMemberStateChange values <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : A chat message for this lobby has been sent <nl> + / / use GetLobbyChatEntry ( m_iChatID ) to retrieve the contents of this message <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct LobbyChatMsg_t <nl> + { <nl> + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 7 } ; <nl> + <nl> + uint64 m_ulSteamIDLobby ; / / the lobby id this is in <nl> + uint64 m_ulSteamIDUser ; / / steamID of the user who has sent this message <nl> + uint8 m_eChatEntryType ; / / type of message <nl> + uint32 m_iChatID ; / / index of the chat entry to lookup <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : A game created a game for all the members of the lobby to join , <nl> + / / as triggered by a SetLobbyGameServer ( ) <nl> + / / it ' s up to the individual clients to take action on this ; the usual <nl> + / / game behavior is to leave the lobby and connect to the specified game server <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct LobbyGameCreated_t <nl> + { <nl> + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 9 } ; <nl> + <nl> + uint64 m_ulSteamIDLobby ; / / the lobby we were in <nl> + uint64 m_ulSteamIDGameServer ; / / the new game server that has been created or found for the lobby members <nl> + uint32 m_unIP ; / / IP & Port of the game server ( if any ) <nl> + uint16 m_usPort ; <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Number of matching lobbies found <nl> + / / iterate the returned lobbies with GetLobbyByIndex ( ) , from values 0 to m_nLobbiesMatching - 1 <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct LobbyMatchList_t <nl> + { <nl> + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 10 } ; <nl> + uint32 m_nLobbiesMatching ; / / Number of lobbies that matched search criteria and we have SteamIDs for <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : posted if a user is forcefully removed from a lobby <nl> + / / can occur if a user loses connection to Steam <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct LobbyKicked_t <nl> + { <nl> + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 12 } ; <nl> + uint64 m_ulSteamIDLobby ; / / Lobby <nl> + uint64 m_ulSteamIDAdmin ; / / User who kicked you - possibly the ID of the lobby itself <nl> + uint8 m_bKickedDueToDisconnect ; / / true if you were kicked from the lobby due to the user losing connection to Steam ( currently always true ) <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Result of our request to create a Lobby <nl> + / / m_eResult = = k_EResultOK on success <nl> + / / at this point , the local user may not have finishing joining this lobby ; <nl> + / / game code should wait until the subsequent LobbyEnter_t callback is received <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct LobbyCreated_t <nl> + { <nl> + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 13 } ; <nl> + <nl> + EResult m_eResult ; / / k_EResultOK - the lobby was successfully created <nl> + / / k_EResultNoConnection - your Steam client doesn ' t have a connection to the back - end <nl> + / / k_EResultTimeout - you the message to the Steam servers , but it didn ' t respond <nl> + / / k_EResultFail - the server responded , but with an unknown internal error <nl> + / / k_EResultAccessDenied - your game isn ' t set to allow lobbies , or your client does haven ' t rights to play the game <nl> + / / k_EResultLimitExceeded - your game client has created too many lobbies <nl> + <nl> + uint64 m_ulSteamIDLobby ; / / chat room , zero if failed <nl> + } ; <nl> + <nl> + / / used by now obsolete RequestFriendsLobbiesResponse_t <nl> + / / enum { k_iCallback = k_iSteamMatchmakingCallbacks + 14 } ; <nl> + # pragma pack ( pop ) <nl> + <nl> + <nl> + <nl> + # endif / / ISTEAMMATCHMAKING <nl> new file mode 100644 <nl> index 00000000 . . 73d50e42 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / isteamnetworking . h <nl> <nl> + / / = = = = = = Copyright © 1996 - 2008 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : interface to steam managing network connections between game clients & servers <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef ISTEAMNETWORKING <nl> + # define ISTEAMNETWORKING <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # include " steamtypes . h " <nl> + # include " steamclientpublic . h " <nl> + <nl> + <nl> + / / list of possible errors returned by SendP2PPacket ( ) API <nl> + / / these will be posted in the P2PSessionConnectFail_t callback <nl> + enum EP2PSessionError <nl> + { <nl> + k_EP2PSessionErrorNone = 0 , <nl> + k_EP2PSessionErrorNotRunningApp = 1 , / / target is not running the same game <nl> + k_EP2PSessionErrorNoRightsToApp = 2 , / / local user doesn ' t own the app that is running <nl> + k_EP2PSessionErrorDestinationNotLoggedIn = 3 , / / target user isn ' t connected to Steam <nl> + k_EP2PSessionErrorTimeout = 4 , / / target isn ' t responding , perhaps not calling AcceptP2PSessionWithUser ( ) <nl> + / / corporate firewalls can also block this ( NAT traversal is not firewall traversal ) <nl> + / / make sure that UDP ports 3478 , 4379 , and 4380 are open in an outbound direction <nl> + k_EP2PSessionErrorMax = 5 <nl> + } ; <nl> + <nl> + / / SendP2PPacket ( ) send types <nl> + / / Typically k_EP2PSendUnreliable is what you want for UDP - like packets , k_EP2PSendReliable for TCP - like packets <nl> + enum EP2PSend <nl> + { <nl> + / / Basic UDP send . Packets can ' t be bigger than 1200 bytes ( your typical MTU size ) . Can be lost , or arrive out of order ( rare ) . <nl> + / / The sending API does have some knowledge of the underlying connection , so if there is no NAT - traversal accomplished or <nl> + / / there is a recognized adjustment happening on the connection , the packet will be batched until the connection is open again . <nl> + k_EP2PSendUnreliable = 0 , <nl> + <nl> + / / As above , but if the underlying p2p connection isn ' t yet established the packet will just be thrown away . Using this on the first <nl> + / / packet sent to a remote host almost guarantees the packet will be dropped . <nl> + / / This is only really useful for kinds of data that should never buffer up , i . e . voice payload packets <nl> + k_EP2PSendUnreliableNoDelay = 1 , <nl> + <nl> + / / Reliable message send . Can send up to 1MB of data in a single message . <nl> + / / Does fragmentation / re - assembly of messages under the hood , as well as a sliding window for efficient sends of large chunks of data . <nl> + k_EP2PSendReliable = 2 , <nl> + <nl> + / / As above , but applies the Nagle algorithm to the send - sends will accumulate <nl> + / / until the current MTU size ( typically ~ 1200 bytes , but can change ) or ~ 200ms has passed ( Nagle algorithm ) . <nl> + / / Useful if you want to send a set of smaller messages but have the coalesced into a single packet <nl> + / / Since the reliable stream is all ordered , you can do several small message sends with k_EP2PSendReliableWithBuffering and then <nl> + / / do a normal k_EP2PSendReliable to force all the buffered data to be sent . <nl> + k_EP2PSendReliableWithBuffering = 3 , <nl> + <nl> + } ; <nl> + <nl> + <nl> + / / connection state to a specified user , returned by GetP2PSessionState ( ) <nl> + / / this is under - the - hood info about what ' s going on with a SendP2PPacket ( ) , shouldn ' t be needed except for debuggin <nl> + # pragma pack ( push , 8 ) <nl> + struct P2PSessionState_t <nl> + { <nl> + uint8 m_bConnectionActive ; / / true if we ' ve got an active open connection <nl> + uint8 m_bConnecting ; / / true if we ' re currently trying to establish a connection <nl> + uint8 m_eP2PSessionError ; / / last error recorded ( see enum above ) <nl> + uint8 m_bUsingRelay ; / / true if it ' s going through a relay server ( TURN ) <nl> + int32 m_nBytesQueuedForSend ; <nl> + int32 m_nPacketsQueuedForSend ; <nl> + uint32 m_nRemoteIP ; / / potential IP : Port of remote host . Could be TURN server . <nl> + uint16 m_nRemotePort ; / / Only exists for compatibility with older authentication api ' s <nl> + } ; <nl> + # pragma pack ( pop ) <nl> + <nl> + <nl> + / / handle to a socket <nl> + typedef uint32 SNetSocket_t ; / / CreateP2PConnectionSocket ( ) <nl> + typedef uint32 SNetListenSocket_t ; / / CreateListenSocket ( ) <nl> + <nl> + / / connection progress indicators , used by CreateP2PConnectionSocket ( ) <nl> + enum ESNetSocketState <nl> + { <nl> + k_ESNetSocketStateInvalid = 0 , <nl> + <nl> + / / communication is valid <nl> + k_ESNetSocketStateConnected = 1 , <nl> + <nl> + / / states while establishing a connection <nl> + k_ESNetSocketStateInitiated = 10 , / / the connection state machine has started <nl> + <nl> + / / p2p connections <nl> + k_ESNetSocketStateLocalCandidatesFound = 11 , / / we ' ve found our local IP info <nl> + k_ESNetSocketStateReceivedRemoteCandidates = 12 , / / we ' ve received information from the remote machine , via the Steam back - end , about their IP info <nl> + <nl> + / / direct connections <nl> + k_ESNetSocketStateChallengeHandshake = 15 , / / we ' ve received a challenge packet from the server <nl> + <nl> + / / failure states <nl> + k_ESNetSocketStateDisconnecting = 21 , / / the API shut it down , and we ' re in the process of telling the other end <nl> + k_ESNetSocketStateLocalDisconnect = 22 , / / the API shut it down , and we ' ve completed shutdown <nl> + k_ESNetSocketStateTimeoutDuringConnect = 23 , / / we timed out while trying to creating the connection <nl> + k_ESNetSocketStateRemoteEndDisconnected = 24 , / / the remote end has disconnected from us <nl> + k_ESNetSocketStateConnectionBroken = 25 , / / connection has been broken ; either the other end has disappeared or our local network connection has broke <nl> + <nl> + } ; <nl> + <nl> + / / describes how the socket is currently connected <nl> + enum ESNetSocketConnectionType <nl> + { <nl> + k_ESNetSocketConnectionTypeNotConnected = 0 , <nl> + k_ESNetSocketConnectionTypeUDP = 1 , <nl> + k_ESNetSocketConnectionTypeUDPRelay = 2 , <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Functions for making connections and sending data between clients , <nl> + / / traversing NAT ' s where possible <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamNetworking <nl> + { <nl> + public : <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / Session - less connection functions <nl> + / / automatically establishes NAT - traversing or Relay server connections <nl> + <nl> + / / Sends a P2P packet to the specified user <nl> + / / UDP - like , unreliable and a max packet size of 1200 bytes <nl> + / / the first packet send may be delayed as the NAT - traversal code runs <nl> + / / if we can ' t get through to the user , an error will be posted via the callback P2PSessionConnectFail_t <nl> + / / see EP2PSend enum above for the descriptions of the different ways of sending packets <nl> + / / nVirtualPort is a routing number you can use to help route message to different systems - you ' ll have to call ReadP2PPacket ( ) <nl> + / / with the same nVirtualPort number in order to retrieve the data on the other end <nl> + / / using different virtual ports to talk to the same user will still use the same underlying p2p connection , saving on resources <nl> + virtual bool SendP2PPacket ( CSteamID steamIDRemote , const void * pubData , uint32 cubData , EP2PSend eP2PSendType , int nVirtualPort = 0 ) = 0 ; <nl> + <nl> + / / returns true if any data is available for read , and the amount of data that will need to be read <nl> + virtual bool IsP2PPacketAvailable ( uint32 * pcubMsgSize , int nVirtualPort = 0 ) = 0 ; <nl> + <nl> + / / reads in a packet that has been sent from another user via SendP2PPacket ( ) <nl> + / / returns the size of the message and the steamID of the user who sent it in the last two parameters <nl> + / / if the buffer passed in is too small , the message will be truncated <nl> + / / this call is not blocking , and will return false if no data is available <nl> + virtual bool ReadP2PPacket ( void * pubDest , uint32 cubDest , uint32 * pcubMsgSize , CSteamID * psteamIDRemote , int nVirtualPort = 0 ) = 0 ; <nl> + <nl> + / / AcceptP2PSessionWithUser ( ) should only be called in response to a P2PSessionRequest_t callback <nl> + / / P2PSessionRequest_t will be posted if another user tries to send you a packet that you haven ' t talked to yet <nl> + / / if you don ' t want to talk to the user , just ignore the request <nl> + / / if the user continues to send you packets , another P2PSessionRequest_t will be posted periodically <nl> + / / this may be called multiple times for a single user <nl> + / / ( if you ' ve called SendP2PPacket ( ) on the other user , this implicitly accepts the session request ) <nl> + virtual bool AcceptP2PSessionWithUser ( CSteamID steamIDRemote ) = 0 ; <nl> + <nl> + / / call CloseP2PSessionWithUser ( ) when you ' re done talking to a user , will free up resources under - the - hood <nl> + / / if the remote user tries to send data to you again , another P2PSessionRequest_t callback will be posted <nl> + virtual bool CloseP2PSessionWithUser ( CSteamID steamIDRemote ) = 0 ; <nl> + <nl> + / / fills out P2PSessionState_t structure with details about the underlying connection to the user <nl> + / / should only needed for debugging purposes <nl> + / / returns false if no connection exists to the specified user <nl> + virtual bool GetP2PSessionState ( CSteamID steamIDRemote , P2PSessionState_t * pConnectionState ) = 0 ; <nl> + <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / LISTEN / CONNECT style interface functions <nl> + / / <nl> + / / This is an older set of functions designed around the Berkeley TCP sockets model <nl> + / / it ' s preferential that you use the above P2P functions , they ' re more robust <nl> + / / and these older functions will be removed eventually <nl> + / / <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + <nl> + / / creates a socket and listens others to connect <nl> + / / will trigger a SocketStatusCallback_t callback on another client connecting <nl> + / / nVirtualP2PPort is the unique ID that the client will connect to , in case you have multiple ports <nl> + / / this can usually just be 0 unless you want multiple sets of connections <nl> + / / unIP is the local IP address to bind to <nl> + / / pass in 0 if you just want the default local IP <nl> + / / unPort is the port to use <nl> + / / pass in 0 if you don ' t want users to be able to connect via IP / Port , but expect to be always peer - to - peer connections only <nl> + virtual SNetListenSocket_t CreateListenSocket ( int nVirtualP2PPort , uint32 nIP , uint16 nPort , bool bAllowUseOfPacketRelay ) = 0 ; <nl> + <nl> + / / creates a socket and begin connection to a remote destination <nl> + / / can connect via a known steamID ( client or game server ) , or directly to an IP <nl> + / / on success will trigger a SocketStatusCallback_t callback <nl> + / / on failure or timeout will trigger a SocketStatusCallback_t callback with a failure code in m_eSNetSocketState <nl> + virtual SNetSocket_t CreateP2PConnectionSocket ( CSteamID steamIDTarget , int nVirtualPort , int nTimeoutSec , bool bAllowUseOfPacketRelay ) = 0 ; <nl> + virtual SNetSocket_t CreateConnectionSocket ( uint32 nIP , uint16 nPort , int nTimeoutSec ) = 0 ; <nl> + <nl> + / / disconnects the connection to the socket , if any , and invalidates the handle <nl> + / / any unread data on the socket will be thrown away <nl> + / / if bNotifyRemoteEnd is set , socket will not be completely destroyed until the remote end acknowledges the disconnect <nl> + virtual bool DestroySocket ( SNetSocket_t hSocket , bool bNotifyRemoteEnd ) = 0 ; <nl> + / / destroying a listen socket will automatically kill all the regular sockets generated from it <nl> + virtual bool DestroyListenSocket ( SNetListenSocket_t hSocket , bool bNotifyRemoteEnd ) = 0 ; <nl> + <nl> + / / sending data <nl> + / / must be a handle to a connected socket <nl> + / / data is all sent via UDP , and thus send sizes are limited to 1200 bytes ; after this , many routers will start dropping packets <nl> + / / use the reliable flag with caution ; although the resend rate is pretty aggressive , <nl> + / / it can still cause stalls in receiving data ( like TCP ) <nl> + virtual bool SendDataOnSocket ( SNetSocket_t hSocket , void * pubData , uint32 cubData , bool bReliable ) = 0 ; <nl> + <nl> + / / receiving data <nl> + / / returns false if there is no data remaining <nl> + / / fills out * pcubMsgSize with the size of the next message , in bytes <nl> + virtual bool IsDataAvailableOnSocket ( SNetSocket_t hSocket , uint32 * pcubMsgSize ) = 0 ; <nl> + <nl> + / / fills in pubDest with the contents of the message <nl> + / / messages are always complete , of the same size as was sent ( i . e . packetized , not streaming ) <nl> + / / if * pcubMsgSize < cubDest , only partial data is written <nl> + / / returns false if no data is available <nl> + virtual bool RetrieveDataFromSocket ( SNetSocket_t hSocket , void * pubDest , uint32 cubDest , uint32 * pcubMsgSize ) = 0 ; <nl> + <nl> + / / checks for data from any socket that has been connected off this listen socket <nl> + / / returns false if there is no data remaining <nl> + / / fills out * pcubMsgSize with the size of the next message , in bytes <nl> + / / fills out * phSocket with the socket that data is available on <nl> + virtual bool IsDataAvailable ( SNetListenSocket_t hListenSocket , uint32 * pcubMsgSize , SNetSocket_t * phSocket ) = 0 ; <nl> + <nl> + / / retrieves data from any socket that has been connected off this listen socket <nl> + / / fills in pubDest with the contents of the message <nl> + / / messages are always complete , of the same size as was sent ( i . e . packetized , not streaming ) <nl> + / / if * pcubMsgSize < cubDest , only partial data is written <nl> + / / returns false if no data is available <nl> + / / fills out * phSocket with the socket that data is available on <nl> + virtual bool RetrieveData ( SNetListenSocket_t hListenSocket , void * pubDest , uint32 cubDest , uint32 * pcubMsgSize , SNetSocket_t * phSocket ) = 0 ; <nl> + <nl> + / / returns information about the specified socket , filling out the contents of the pointers <nl> + virtual bool GetSocketInfo ( SNetSocket_t hSocket , CSteamID * pSteamIDRemote , int * peSocketStatus , uint32 * punIPRemote , uint16 * punPortRemote ) = 0 ; <nl> + <nl> + / / returns which local port the listen socket is bound to <nl> + / / * pnIP and * pnPort will be 0 if the socket is set to listen for P2P connections only <nl> + virtual bool GetListenSocketInfo ( SNetListenSocket_t hListenSocket , uint32 * pnIP , uint16 * pnPort ) = 0 ; <nl> + <nl> + / / returns true to describe how the socket ended up connecting <nl> + virtual ESNetSocketConnectionType GetSocketConnectionType ( SNetSocket_t hSocket ) = 0 ; <nl> + <nl> + / / max packet size , in bytes <nl> + virtual int GetMaxPacketSize ( SNetSocket_t hSocket ) = 0 ; <nl> + } ; <nl> + # define STEAMNETWORKING_INTERFACE_VERSION " SteamNetworking004 " <nl> + <nl> + / / callbacks <nl> + # pragma pack ( push , 8 ) <nl> + <nl> + / / callback notification - a user wants to talk to us over the P2P channel via the SendP2PPacket ( ) API <nl> + / / in response , a call to AcceptP2PPacketsFromUser ( ) needs to be made , if you want to talk with them <nl> + struct P2PSessionRequest_t <nl> + { <nl> + enum { k_iCallback = k_iSteamNetworkingCallbacks + 2 } ; <nl> + CSteamID m_steamIDRemote ; / / user who wants to talk to us <nl> + } ; <nl> + <nl> + <nl> + / / callback notification - packets can ' t get through to the specified user via the SendP2PPacket ( ) API <nl> + / / all packets queued packets unsent at this point will be dropped <nl> + / / further attempts to send will retry making the connection ( but will be dropped if we fail again ) <nl> + struct P2PSessionConnectFail_t <nl> + { <nl> + enum { k_iCallback = k_iSteamNetworkingCallbacks + 3 } ; <nl> + CSteamID m_steamIDRemote ; / / user we were sending packets to <nl> + uint8 m_eP2PSessionError ; / / EP2PSessionError indicating why we ' re having trouble <nl> + } ; <nl> + <nl> + <nl> + / / callback notification - status of a socket has changed <nl> + / / used as part of the CreateListenSocket ( ) / CreateP2PConnectionSocket ( ) <nl> + struct SocketStatusCallback_t <nl> + { <nl> + enum { k_iCallback = k_iSteamNetworkingCallbacks + 1 } ; <nl> + SNetSocket_t m_hSocket ; / / the socket used to send / receive data to the remote host <nl> + SNetListenSocket_t m_hListenSocket ; / / this is the server socket that we were listening on ; NULL if this was an outgoing connection <nl> + CSteamID m_steamIDRemote ; / / remote steamID we have connected to , if it has one <nl> + int m_eSNetSocketState ; / / socket state , ESNetSocketState <nl> + } ; <nl> + <nl> + # pragma pack ( pop ) <nl> + <nl> + # endif / / ISTEAMNETWORKING <nl> new file mode 100644 <nl> index 00000000 . . 9e5ad5e8 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / isteamremotestorage . h <nl> <nl> + / / = = = = = = Copyright © 1996 - 2008 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : public interface to user remote file storage in Steam <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef ISTEAMREMOTESTORAGE_H <nl> + # define ISTEAMREMOTESTORAGE_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # include " isteamclient . h " <nl> + <nl> + / / A handle to a piece of user generated content <nl> + typedef uint64 UGCHandle_t ; <nl> + const UGCHandle_t k_UGCHandleInvalid = 0xffffffffffffffffull ; <nl> + <nl> + / / Ways to handle a synchronization conflict <nl> + enum EResolveConflict <nl> + { <nl> + k_EResolveConflictKeepClient = 1 , / / The local version of each file will be used to overwrite the server version <nl> + k_EResolveConflictKeepServer = 2 , / / The server version of each file will be used to overwrite the local version <nl> + } ; <nl> + <nl> + enum ERemoteStoragePlatform <nl> + { <nl> + k_ERemoteStoragePlatformNone = 0 , <nl> + k_ERemoteStoragePlatformWindows = ( 1 < < 0 ) , <nl> + k_ERemoteStoragePlatformOSX = ( 1 < < 1 ) , <nl> + k_ERemoteStoragePlatformPS3 = ( 1 < < 2 ) , <nl> + <nl> + k_ERemoteStoragePlatformAll = 0xffffffff <nl> + } ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Functions for accessing , reading and writing files stored remotely <nl> + / / and cached locally <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamRemoteStorage <nl> + { <nl> + public : <nl> + / / NOTE <nl> + / / <nl> + / / Filenames are case - insensitive , and will be converted to lowercase automatically . <nl> + / / So " foo . bar " and " Foo . bar " are the same file , and if you write " Foo . bar " then <nl> + / / iterate the files , the filename returned will be " foo . bar " . <nl> + / / <nl> + <nl> + / / file operations <nl> + virtual bool FileWrite ( const char * pchFile , const void * pvData , int32 cubData ) = 0 ; <nl> + virtual int32 FileRead ( const char * pchFile , void * pvData , int32 cubDataToRead ) = 0 ; <nl> + virtual bool FileForget ( const char * pchFile ) = 0 ; <nl> + virtual bool FileDelete ( const char * pchFile ) = 0 ; <nl> + virtual SteamAPICall_t FileShare ( const char * pchFile ) = 0 ; <nl> + <nl> + / / file information <nl> + virtual bool FileExists ( const char * pchFile ) = 0 ; <nl> + virtual bool FilePersisted ( const char * pchFile ) = 0 ; <nl> + virtual int32 GetFileSize ( const char * pchFile ) = 0 ; <nl> + virtual int64 GetFileTimestamp ( const char * pchFile ) = 0 ; <nl> + <nl> + / / iteration <nl> + virtual int32 GetFileCount ( ) = 0 ; <nl> + virtual const char * GetFileNameAndSize ( int iFile , int32 * pnFileSizeInBytes ) = 0 ; <nl> + <nl> + / / configuration management <nl> + virtual bool GetQuota ( int32 * pnTotalBytes , int32 * puAvailableBytes ) = 0 ; <nl> + virtual bool IsCloudEnabledForAccount ( ) = 0 ; <nl> + virtual bool IsCloudEnabledForApp ( ) = 0 ; <nl> + virtual void SetCloudEnabledForApp ( bool bEnabled ) = 0 ; <nl> + <nl> + / / user generated content <nl> + virtual SteamAPICall_t UGCDownload ( UGCHandle_t hContent ) = 0 ; <nl> + virtual bool GetUGCDetails ( UGCHandle_t hContent , AppId_t * pnAppID , char * * ppchName , int32 * pnFileSizeInBytes , CSteamID * pSteamIDOwner ) = 0 ; <nl> + virtual int32 UGCRead ( UGCHandle_t hContent , void * pvData , int32 cubDataToRead ) = 0 ; <nl> + <nl> + / / user generated content iteration <nl> + virtual int32 GetCachedUGCCount ( ) = 0 ; <nl> + virtual UGCHandle_t GetCachedUGCHandle ( int32 iCachedContent ) = 0 ; <nl> + } ; <nl> + <nl> + # define STEAMREMOTESTORAGE_INTERFACE_VERSION " STEAMREMOTESTORAGE_INTERFACE_VERSION003 " <nl> + <nl> + / / callbacks <nl> + # pragma pack ( push , 8 ) <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : sent when the local file cache is fully synced with the server for an app <nl> + / / That means that an application can be started and has all latest files <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct RemoteStorageAppSyncedClient_t <nl> + { <nl> + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 1 } ; <nl> + AppId_t m_nAppID ; <nl> + EResult m_eResult ; <nl> + int m_unNumDownloads ; <nl> + } ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : sent when the server is fully synced with the local file cache for an app <nl> + / / That means that we can shutdown Steam and our data is stored on the server <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct RemoteStorageAppSyncedServer_t <nl> + { <nl> + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 2 } ; <nl> + AppId_t m_nAppID ; <nl> + EResult m_eResult ; <nl> + int m_unNumUploads ; <nl> + } ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Status of up and downloads during a sync session <nl> + / / <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct RemoteStorageAppSyncProgress_t <nl> + { <nl> + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 3 } ; <nl> + char m_rgchCurrentFile [ 260 ] ; / / Current file being transferred <nl> + AppId_t m_nAppID ; / / App this info relates to <nl> + uint32 m_uBytesTransferredThisChunk ; / / Bytes transferred this chunk <nl> + double m_dAppPercentComplete ; / / Percent complete that this app ' s transfers are <nl> + bool m_bUploading ; / / if false , downloading <nl> + } ; <nl> + <nl> + / / <nl> + / / IMPORTANT ! k_iClientRemoteStorageCallbacks + 4 - 5 are used , see iclientremotestorage . h <nl> + / / <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Sent after a conflict resolution attempt . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct RemoteStorageConflictResolution_t <nl> + { <nl> + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 6 } ; <nl> + AppId_t m_nAppID ; <nl> + EResult m_eResult ; <nl> + } ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : The result of a call to FileShare ( ) <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct RemoteStorageFileShareResult_t <nl> + { <nl> + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 7 } ; <nl> + EResult m_eResult ; / / The result of the operation <nl> + UGCHandle_t m_hFile ; / / The handle that can be shared with users and features <nl> + } ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : The result of a call to UGCDownload ( ) <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct RemoteStorageDownloadUGCResult_t <nl> + { <nl> + enum { k_iCallback = k_iClientRemoteStorageCallbacks + 8 } ; <nl> + EResult m_eResult ; / / The result of the operation . <nl> + UGCHandle_t m_hFile ; / / The handle to the file that was attempted to be downloaded . <nl> + AppId_t m_nAppID ; / / ID of the app that created this file . <nl> + int32 m_nSizeInBytes ; / / The size of the file that was downloaded , in bytes . <nl> + char * m_pchFileName ; / / The name of the file that was downloaded . This pointer is <nl> + / / not guaranteed to be valid indefinitely . <nl> + uint64 m_ulSteamIDOwner ; / / Steam ID of the user who created this content . <nl> + } ; <nl> + <nl> + # pragma pack ( pop ) <nl> + <nl> + <nl> + # endif / / ISTEAMREMOTESTORAGE_H <nl> new file mode 100644 <nl> index 00000000 . . ca027247 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / isteamuser . h <nl> <nl> + / / = = = = = = Copyright ( c ) 1996 - 2008 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : interface to user account information in Steam <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef ISTEAMUSER_H <nl> + # define ISTEAMUSER_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # include " isteamclient . h " <nl> + <nl> + / / structure that contains client callback data <nl> + / / see callbacks documentation for more details <nl> + # pragma pack ( push , 8 ) <nl> + struct CallbackMsg_t <nl> + { <nl> + HSteamUser m_hSteamUser ; <nl> + int m_iCallback ; <nl> + uint8 * m_pubParam ; <nl> + int m_cubParam ; <nl> + } ; <nl> + # pragma pack ( pop ) <nl> + <nl> + / / reference to a steam call , to filter results by <nl> + typedef int32 HSteamCall ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Functions for accessing and manipulating a steam account <nl> + / / associated with one client instance <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamUser <nl> + { <nl> + public : <nl> + / / returns the HSteamUser this interface represents <nl> + / / this is only used internally by the API , and by a few select interfaces that support multi - user <nl> + virtual HSteamUser GetHSteamUser ( ) = 0 ; <nl> + <nl> + / / returns true if the Steam client current has a live connection to the Steam servers . <nl> + / / If false , it means there is no active connection due to either a networking issue on the local machine , or the Steam server is down / busy . <nl> + / / The Steam client will automatically be trying to recreate the connection as often as possible . <nl> + virtual bool BLoggedOn ( ) = 0 ; <nl> + <nl> + / / returns the CSteamID of the account currently logged into the Steam client <nl> + / / a CSteamID is a unique identifier for an account , and used to differentiate users in all parts of the Steamworks API <nl> + virtual CSteamID GetSteamID ( ) = 0 ; <nl> + <nl> + / / Multiplayer Authentication functions <nl> + <nl> + / / InitiateGameConnection ( ) starts the state machine for authenticating the game client with the game server <nl> + / / It is the client portion of a three - way handshake between the client , the game server , and the steam servers <nl> + / / <nl> + / / Parameters : <nl> + / / void * pAuthBlob - a pointer to empty memory that will be filled in with the authentication token . <nl> + / / int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob . Should be at least 2048 bytes . <nl> + / / CSteamID steamIDGameServer - the steamID of the game server , received from the game server by the client <nl> + / / CGameID gameID - the ID of the current game . For games without mods , this is just CGameID ( < appID > ) <nl> + / / uint32 unIPServer , uint16 usPortServer - the IP address of the game server <nl> + / / bool bSecure - whether or not the client thinks that the game server is reporting itself as secure ( i . e . VAC is running ) <nl> + / / <nl> + / / return value - returns the number of bytes written to pBlob . If the return is 0 , then the buffer passed in was too small , and the call has failed <nl> + / / The contents of pBlob should then be sent to the game server , for it to use to complete the authentication process . <nl> + virtual int InitiateGameConnection ( void * pAuthBlob , int cbMaxAuthBlob , CSteamID steamIDGameServer , uint32 unIPServer , uint16 usPortServer , bool bSecure ) = 0 ; <nl> + <nl> + / / notify of disconnect <nl> + / / needs to occur when the game client leaves the specified game server , needs to match with the InitiateGameConnection ( ) call <nl> + virtual void TerminateGameConnection ( uint32 unIPServer , uint16 usPortServer ) = 0 ; <nl> + <nl> + / / Legacy functions <nl> + <nl> + / / used by only a few games to track usage events <nl> + virtual void TrackAppUsageEvent ( CGameID gameID , int eAppUsageEvent , const char * pchExtraInfo = " " ) = 0 ; <nl> + <nl> + / / get the local storage folder for current Steam account to write application data , e . g . save games , configs etc . <nl> + / / this will usually be something like " C : \ Progam Files \ Steam \ userdata \ < SteamID > \ < AppID > \ local " <nl> + virtual bool GetUserDataFolder ( char * pchBuffer , int cubBuffer ) = 0 ; <nl> + <nl> + / / Starts voice recording . Once started , use GetVoice ( ) to get the data <nl> + virtual void StartVoiceRecording ( ) = 0 ; <nl> + <nl> + / / Stops voice recording . Because people often release push - to - talk keys early , the system will keep recording for <nl> + / / a little bit after this function is called . GetVoice ( ) should continue to be called until it returns <nl> + / / k_eVoiceResultNotRecording <nl> + virtual void StopVoiceRecording ( ) = 0 ; <nl> + <nl> + / / Determine the amount of captured audio data that is available in bytes . <nl> + / / This provides both the compressed and uncompressed data . Please note that the uncompressed <nl> + / / data is not the raw feed from the microphone : data may only be available if audible <nl> + / / levels of speech are detected . <nl> + virtual EVoiceResult GetAvailableVoice ( uint32 * pcbCompressed , uint32 * pcbUncompressed ) = 0 ; <nl> + <nl> + / / Gets the latest voice data from the microphone . Compressed data is an arbitrary format , and is meant to be handed back to <nl> + / / DecompressVoice ( ) for playback later as a binary blob . Uncompressed data is 16 - bit , signed integer , 11025Hz PCM format . <nl> + / / Please note that the uncompressed data is not the raw feed from the microphone : data may only be available if audible <nl> + / / levels of speech are detected , and may have passed through denoising filters , etc . <nl> + / / This function should be called as often as possible once recording has started ; once per frame at least . <nl> + / / nBytesWritten is set to the number of bytes written to pDestBuffer . <nl> + / / nUncompressedBytesWritten is set to the number of bytes written to pUncompressedDestBuffer . <nl> + / / You must grab both compressed and uncompressed here at the same time , if you want both . <nl> + / / Matching data that is not read during this call will be thrown away . <nl> + / / GetAvailableVoice ( ) can be used to determine how much data is actually available . <nl> + virtual EVoiceResult GetVoice ( bool bWantCompressed , void * pDestBuffer , uint32 cbDestBufferSize , uint32 * nBytesWritten , bool bWantUncompressed , void * pUncompressedDestBuffer , uint32 cbUncompressedDestBufferSize , uint32 * nUncompressBytesWritten ) = 0 ; <nl> + <nl> + / / Decompresses a chunk of compressed data produced by GetVoice ( ) . <nl> + / / nBytesWritten is set to the number of bytes written to pDestBuffer unless the return value is k_EVoiceResultBufferTooSmall . <nl> + / / In that case , nBytesWritten is set to the size of the buffer required to decompress the given <nl> + / / data . The suggested buffer size for the destination buffer is 22 kilobytes . <nl> + / / The output format of the data is 16 - bit signed at 11025 samples per second . <nl> + virtual EVoiceResult DecompressVoice ( const void * pCompressed , uint32 cbCompressed , void * pDestBuffer , uint32 cbDestBufferSize , uint32 * nBytesWritten ) = 0 ; <nl> + <nl> + / / Retrieve ticket to be sent to the entity who wishes to authenticate you . <nl> + / / pcbTicket retrieves the length of the actual ticket . <nl> + virtual HAuthTicket GetAuthSessionTicket ( void * pTicket , int cbMaxTicket , uint32 * pcbTicket ) = 0 ; <nl> + <nl> + / / Authenticate ticket from entity steamID to be sure it is valid and isnt reused <nl> + / / Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse ) <nl> + virtual EBeginAuthSessionResult BeginAuthSession ( const void * pAuthTicket , int cbAuthTicket , CSteamID steamID ) = 0 ; <nl> + <nl> + / / Stop tracking started by BeginAuthSession - called when no longer playing game with this entity <nl> + virtual void EndAuthSession ( CSteamID steamID ) = 0 ; <nl> + <nl> + / / Cancel auth ticket from GetAuthSessionTicket , called when no longer playing game with the entity you gave the ticket to <nl> + virtual void CancelAuthTicket ( HAuthTicket hAuthTicket ) = 0 ; <nl> + <nl> + / / After receiving a user ' s authentication data , and passing it to BeginAuthSession , use this function <nl> + / / to determine if the user owns downloadable content specified by the provided AppID . <nl> + virtual EUserHasLicenseForAppResult UserHasLicenseForApp ( CSteamID steamID , AppId_t appID ) = 0 ; <nl> + <nl> + / / returns true if this users looks like they are behind a NAT device . Only valid once the user has connected to steam <nl> + / / ( i . e a SteamServersConnected_t has been issued ) and may not catch all forms of NAT . <nl> + virtual bool BIsBehindNAT ( ) = 0 ; <nl> + <nl> + / / set data to be replicated to friends so that they can join your game <nl> + / / CSteamID steamIDGameServer - the steamID of the game server , received from the game server by the client <nl> + / / uint32 unIPServer , uint16 usPortServer - the IP address of the game server <nl> + virtual void AdvertiseGame ( CSteamID steamIDGameServer , uint32 unIPServer , uint16 usPortServer ) = 0 ; <nl> + <nl> + / / Requests a ticket encrypted with an app specific shared key <nl> + / / pDataToInclude , cbDataToInclude will be encrypted into the ticket <nl> + / / ( This is asynchronous , you must wait for the ticket to be completed by the server ) <nl> + virtual SteamAPICall_t RequestEncryptedAppTicket ( void * pDataToInclude , int cbDataToInclude ) = 0 ; <nl> + <nl> + / / retrieve a finished ticket <nl> + virtual bool GetEncryptedAppTicket ( void * pTicket , int cbMaxTicket , uint32 * pcbTicket ) = 0 ; <nl> + <nl> + # ifdef _PS3 <nl> + / / Initiates PS3 Logon request using just PSN ticket . <nl> + / / <nl> + / / PARAMS : bInteractive - If set tells Steam to go ahead and show the PS3 NetStart dialog if needed to <nl> + / / prompt the user for network setup / PSN logon before initiating the Steam side of the logon . <nl> + / / <nl> + / / Listen for SteamServersConnected_t or SteamServerConnectFailure_t for status . SteamServerConnectFailure_t <nl> + / / may return with EResult k_EResultPSNAccountUnlinked if the PSN account is unknown to Steam . You should <nl> + / / then call LogOnAndLinkSteamAccountToPSN ( ) after prompting the user for credentials to establish a link . <nl> + / / Future calls to LogOn ( ) after the one time link call should succeed as long as the user is connected to PSN . <nl> + virtual void LogOn ( bool bInteractive ) = 0 ; <nl> + <nl> + / / Initiates a request to logon with a specific steam username / password and create a PSN account link at <nl> + / / the same time . Should call this only if LogOn ( ) has failed and indicated the PSN account is unlinked . <nl> + / / <nl> + / / PARAMS : bInteractive - If set tells Steam to go ahead and show the PS3 NetStart dialog if needed to <nl> + / / prompt the user for network setup / PSN logon before initiating the Steam side of the logon . pchUserName <nl> + / / should be the users Steam username , and pchPassword should be the users Steam password . <nl> + / / <nl> + / / Listen for SteamServersConnected_t or SteamServerConnectFailure_t for status . SteamServerConnectFailure_t <nl> + / / may return with EResult k_EResultPSNAccountAlreadyLinked if already linked to another account . <nl> + virtual void LogOnAndLinkSteamAccountToPSN ( bool bInteractive , const char * pchUserName , const char * pchPassword ) = 0 ; <nl> + <nl> + / / Final logon option for PS3 , this logs into an existing account if already linked , but if not already linked <nl> + / / creates a new account using the info in the PSN ticket to generate a unique account name . The new account is <nl> + / / then linked to the PSN ticket . This is the faster option for new users who don ' t have an existing Steam account <nl> + / / to get into multiplayer . <nl> + / / <nl> + / / PARAMS : bInteractive - If set tells Steam to go ahead and show the PS3 NetStart dialog if needed to <nl> + / / prompt the user for network setup / PSN logon before initiating the Steam side of the logon . <nl> + virtual void LogOnAndCreateNewSteamAccountIfNeeded ( bool bInteractive ) = 0 ; <nl> + # endif <nl> + <nl> + } ; <nl> + <nl> + # define STEAMUSER_INTERFACE_VERSION " SteamUser014 " <nl> + <nl> + <nl> + / / callbacks <nl> + # pragma pack ( push , 8 ) <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : called when a connections to the Steam back - end has been established <nl> + / / this means the Steam client now has a working connection to the Steam servers <nl> + / / usually this will have occurred before the game has launched , and should <nl> + / / only be seen if the user has dropped connection due to a networking issue <nl> + / / or a Steam server update <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct SteamServersConnected_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserCallbacks + 1 } ; <nl> + } ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : called when a connection attempt has failed <nl> + / / this will occur periodically if the Steam client is not connected , <nl> + / / and has failed in it ' s retry to establish a connection <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct SteamServerConnectFailure_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserCallbacks + 2 } ; <nl> + EResult m_eResult ; <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : called if the client has lost connection to the Steam servers <nl> + / / real - time services will be disabled until a matching SteamServersConnected_t has been posted <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct SteamServersDisconnected_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserCallbacks + 3 } ; <nl> + EResult m_eResult ; <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Sent by the Steam server to the client telling it to disconnect from the specified game server , <nl> + / / which it may be in the process of or already connected to . <nl> + / / The game client should immediately disconnect upon receiving this message . <nl> + / / This can usually occur if the user doesn ' t have rights to play on the game server . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct ClientGameServerDeny_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserCallbacks + 13 } ; <nl> + <nl> + uint32 m_uAppID ; <nl> + uint32 m_unGameServerIP ; <nl> + uint16 m_usGameServerPort ; <nl> + uint16 m_bSecure ; <nl> + uint32 m_uReason ; <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : called when the callback system for this client is in an error state ( and has flushed pending callbacks ) <nl> + / / When getting this message the client should disconnect from Steam , reset any stored Steam state and reconnect . <nl> + / / This usually occurs in the rare event the Steam client has some kind of fatal error . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct IPCFailure_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserCallbacks + 17 } ; <nl> + enum EFailureType <nl> + { <nl> + k_EFailureFlushedCallbackQueue , <nl> + k_EFailurePipeFail , <nl> + } ; <nl> + uint8 m_eFailureType ; <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / callback for BeginAuthSession <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct ValidateAuthTicketResponse_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserCallbacks + 43 } ; <nl> + CSteamID m_SteamID ; <nl> + EAuthSessionResponse m_eAuthSessionResponse ; <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : called when a user has responded to a microtransaction authorization request <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct MicroTxnAuthorizationResponse_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserCallbacks + 52 } ; <nl> + <nl> + uint32 m_unAppID ; / / AppID for this microtransaction <nl> + uint64 m_ulOrderID ; / / OrderID provided for the microtransaction <nl> + uint8 m_bAuthorized ; / / if user authorized transaction <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Result from RequestEncryptedAppTicket <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct EncryptedAppTicketResponse_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserCallbacks + 54 } ; <nl> + <nl> + EResult m_eResult ; <nl> + } ; <nl> + <nl> + # pragma pack ( pop ) <nl> + <nl> + # endif / / ISTEAMUSER_H <nl> new file mode 100644 <nl> index 00000000 . . c2d2ef6e <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / isteamuserstats . h <nl> <nl> + / / = = = = = = Copyright © 1996 - 2009 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : interface to stats , achievements , and leaderboards <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef ISTEAMUSERSTATS_H <nl> + # define ISTEAMUSERSTATS_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # include " isteamclient . h " <nl> + # include " isteamremotestorage . h " <nl> + <nl> + / / size limit on stat or achievement name ( UTF - 8 encoded ) <nl> + enum { k_cchStatNameMax = 128 } ; <nl> + <nl> + / / maximum number of bytes for a leaderboard name ( UTF - 8 encoded ) <nl> + enum { k_cchLeaderboardNameMax = 128 } ; <nl> + <nl> + / / maximum number of details int32 ' s storable for a single leaderboard entry <nl> + enum { k_cLeaderboardDetailsMax = 64 } ; <nl> + <nl> + / / handle to a single leaderboard <nl> + typedef uint64 SteamLeaderboard_t ; <nl> + <nl> + / / handle to a set of downloaded entries in a leaderboard <nl> + typedef uint64 SteamLeaderboardEntries_t ; <nl> + <nl> + / / type of data request , when downloading leaderboard entries <nl> + enum ELeaderboardDataRequest <nl> + { <nl> + k_ELeaderboardDataRequestGlobal = 0 , <nl> + k_ELeaderboardDataRequestGlobalAroundUser = 1 , <nl> + k_ELeaderboardDataRequestFriends = 2 , <nl> + k_ELeaderboardDataRequestUsers = 3 <nl> + } ; <nl> + <nl> + / / the sort order of a leaderboard <nl> + enum ELeaderboardSortMethod <nl> + { <nl> + k_ELeaderboardSortMethodNone = 0 , <nl> + k_ELeaderboardSortMethodAscending = 1 , / / top - score is lowest number <nl> + k_ELeaderboardSortMethodDescending = 2 , / / top - score is highest number <nl> + } ; <nl> + <nl> + / / the display type ( used by the Steam Community web site ) for a leaderboard <nl> + enum ELeaderboardDisplayType <nl> + { <nl> + k_ELeaderboardDisplayTypeNone = 0 , <nl> + k_ELeaderboardDisplayTypeNumeric = 1 , / / simple numerical score <nl> + k_ELeaderboardDisplayTypeTimeSeconds = 2 , / / the score represents a time , in seconds <nl> + k_ELeaderboardDisplayTypeTimeMilliSeconds = 3 , / / the score represents a time , in milliseconds <nl> + } ; <nl> + <nl> + enum ELeaderboardUploadScoreMethod <nl> + { <nl> + k_ELeaderboardUploadScoreMethodNone = 0 , <nl> + k_ELeaderboardUploadScoreMethodKeepBest = 1 , / / Leaderboard will keep user ' s best score <nl> + k_ELeaderboardUploadScoreMethodForceUpdate = 2 , / / Leaderboard will always replace score with specified <nl> + } ; <nl> + <nl> + / / a single entry in a leaderboard , as returned by GetDownloadedLeaderboardEntry ( ) <nl> + # pragma pack ( push , 8 ) <nl> + <nl> + struct LeaderboardEntry_t <nl> + { <nl> + CSteamID m_steamIDUser ; / / user with the entry - use SteamFriends ( ) - > GetFriendPersonaName ( ) & SteamFriends ( ) - > GetFriendAvatar ( ) to get more info <nl> + int32 m_nGlobalRank ; / / [ 1 . . N ] , where N is the number of users with an entry in the leaderboard <nl> + int32 m_nScore ; / / score as set in the leaderboard <nl> + int32 m_cDetails ; / / number of int32 details available for this entry <nl> + UGCHandle_t m_hUGC ; / / handle for UGC attached to the entry <nl> + } ; <nl> + <nl> + # pragma pack ( pop ) <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Functions for accessing stats , achievements , and leaderboard information <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamUserStats <nl> + { <nl> + public : <nl> + / / Ask the server to send down this user ' s data and achievements for this game <nl> + virtual bool RequestCurrentStats ( ) = 0 ; <nl> + <nl> + / / Data accessors <nl> + virtual bool GetStat ( const char * pchName , int32 * pData ) = 0 ; <nl> + virtual bool GetStat ( const char * pchName , float * pData ) = 0 ; <nl> + <nl> + / / Set / update data <nl> + virtual bool SetStat ( const char * pchName , int32 nData ) = 0 ; <nl> + virtual bool SetStat ( const char * pchName , float fData ) = 0 ; <nl> + virtual bool UpdateAvgRateStat ( const char * pchName , float flCountThisSession , double dSessionLength ) = 0 ; <nl> + <nl> + / / Achievement flag accessors <nl> + virtual bool GetAchievement ( const char * pchName , bool * pbAchieved ) = 0 ; <nl> + virtual bool SetAchievement ( const char * pchName ) = 0 ; <nl> + virtual bool ClearAchievement ( const char * pchName ) = 0 ; <nl> + <nl> + / / Get the achievement status , and the time it was unlocked if unlocked . <nl> + / / If the return value is true , but the unlock time is zero , that means it was unlocked before Steam <nl> + / / began tracking achievement unlock times ( December 2009 ) . Time is seconds since January 1 , 1970 . <nl> + virtual bool GetAchievementAndUnlockTime ( const char * pchName , bool * pbAchieved , uint32 * punUnlockTime ) = 0 ; <nl> + <nl> + / / Store the current data on the server , will get a callback when set <nl> + / / And one callback for every new achievement <nl> + / / <nl> + / / If the callback has a result of k_EResultInvalidParam , one or more stats <nl> + / / uploaded has been rejected , either because they broke constraints <nl> + / / or were out of date . In this case the server sends back updated values . <nl> + / / The stats should be re - iterated to keep in sync . <nl> + virtual bool StoreStats ( ) = 0 ; <nl> + <nl> + / / Achievement / GroupAchievement metadata <nl> + <nl> + / / Gets the icon of the achievement , which is a handle to be used in IClientUtils : : GetImageRGBA ( ) , or 0 if none set . <nl> + / / A return value of 0 may indicate we are still fetching data , and you can wait for the UserAchievementIconReady_t callback <nl> + / / which will notify you when the bits are actually read . If the callback still returns zero , then there is no image set <nl> + / / and there never will be . <nl> + virtual int GetAchievementIcon ( const char * pchName ) = 0 ; <nl> + / / Get general attributes ( display name / text , etc ) for an Achievement <nl> + virtual const char * GetAchievementDisplayAttribute ( const char * pchName , const char * pchKey ) = 0 ; <nl> + <nl> + / / Achievement progress - triggers an AchievementProgress callback , that is all . <nl> + / / Calling this w / N out of N progress will NOT set the achievement , the game must still do that . <nl> + virtual bool IndicateAchievementProgress ( const char * pchName , uint32 nCurProgress , uint32 nMaxProgress ) = 0 ; <nl> + <nl> + / / Friends stats & achievements <nl> + <nl> + / / downloads stats for the user <nl> + / / returns a UserStatsReceived_t received when completed <nl> + / / if the other user has no stats , UserStatsReceived_t . m_eResult will be set to k_EResultFail <nl> + / / these stats won ' t be auto - updated ; you ' ll need to call RequestUserStats ( ) again to refresh any data <nl> + virtual SteamAPICall_t RequestUserStats ( CSteamID steamIDUser ) = 0 ; <nl> + <nl> + / / requests stat information for a user , usable after a successful call to RequestUserStats ( ) <nl> + virtual bool GetUserStat ( CSteamID steamIDUser , const char * pchName , int32 * pData ) = 0 ; <nl> + virtual bool GetUserStat ( CSteamID steamIDUser , const char * pchName , float * pData ) = 0 ; <nl> + virtual bool GetUserAchievement ( CSteamID steamIDUser , const char * pchName , bool * pbAchieved ) = 0 ; <nl> + / / See notes for GetAchievementAndUnlockTime above <nl> + virtual bool GetUserAchievementAndUnlockTime ( CSteamID steamIDUser , const char * pchName , bool * pbAchieved , uint32 * punUnlockTime ) = 0 ; <nl> + <nl> + / / Reset stats <nl> + virtual bool ResetAllStats ( bool bAchievementsToo ) = 0 ; <nl> + <nl> + / / Leaderboard functions <nl> + <nl> + / / asks the Steam back - end for a leaderboard by name , and will create it if it ' s not yet <nl> + / / This call is asynchronous , with the result returned in LeaderboardFindResult_t <nl> + virtual SteamAPICall_t FindOrCreateLeaderboard ( const char * pchLeaderboardName , ELeaderboardSortMethod eLeaderboardSortMethod , ELeaderboardDisplayType eLeaderboardDisplayType ) = 0 ; <nl> + <nl> + / / as above , but won ' t create the leaderboard if it ' s not found <nl> + / / This call is asynchronous , with the result returned in LeaderboardFindResult_t <nl> + virtual SteamAPICall_t FindLeaderboard ( const char * pchLeaderboardName ) = 0 ; <nl> + <nl> + / / returns the name of a leaderboard <nl> + virtual const char * GetLeaderboardName ( SteamLeaderboard_t hSteamLeaderboard ) = 0 ; <nl> + <nl> + / / returns the total number of entries in a leaderboard , as of the last request <nl> + virtual int GetLeaderboardEntryCount ( SteamLeaderboard_t hSteamLeaderboard ) = 0 ; <nl> + <nl> + / / returns the sort method of the leaderboard <nl> + virtual ELeaderboardSortMethod GetLeaderboardSortMethod ( SteamLeaderboard_t hSteamLeaderboard ) = 0 ; <nl> + <nl> + / / returns the display type of the leaderboard <nl> + virtual ELeaderboardDisplayType GetLeaderboardDisplayType ( SteamLeaderboard_t hSteamLeaderboard ) = 0 ; <nl> + <nl> + / / Asks the Steam back - end for a set of rows in the leaderboard . <nl> + / / This call is asynchronous , with the result returned in LeaderboardScoresDownloaded_t <nl> + / / LeaderboardScoresDownloaded_t will contain a handle to pull the results from GetDownloadedLeaderboardEntries ( ) ( below ) <nl> + / / You can ask for more entries than exist , and it will return as many as do exist . <nl> + / / k_ELeaderboardDataRequestGlobal requests rows in the leaderboard from the full table , with nRangeStart & nRangeEnd in the range [ 1 , TotalEntries ] <nl> + / / k_ELeaderboardDataRequestGlobalAroundUser requests rows around the current user , nRangeStart being negate <nl> + / / e . g . DownloadLeaderboardEntries ( hLeaderboard , k_ELeaderboardDataRequestGlobalAroundUser , - 3 , 3 ) will return 7 rows , 3 before the user , 3 after <nl> + / / k_ELeaderboardDataRequestFriends requests all the rows for friends of the current user <nl> + virtual SteamAPICall_t DownloadLeaderboardEntries ( SteamLeaderboard_t hSteamLeaderboard , ELeaderboardDataRequest eLeaderboardDataRequest , int nRangeStart , int nRangeEnd ) = 0 ; <nl> + <nl> + / / Returns data about a single leaderboard entry <nl> + / / use a for loop from 0 to LeaderboardScoresDownloaded_t : : m_cEntryCount to get all the downloaded entries <nl> + / / e . g . <nl> + / / void OnLeaderboardScoresDownloaded ( LeaderboardScoresDownloaded_t * pLeaderboardScoresDownloaded ) <nl> + / / { <nl> + / / for ( int index = 0 ; index < pLeaderboardScoresDownloaded - > m_cEntryCount ; index + + ) <nl> + / / { <nl> + / / LeaderboardEntry_t leaderboardEntry ; <nl> + / / int32 details [ 3 ] ; / / we know this is how many we ' ve stored previously <nl> + / / GetDownloadedLeaderboardEntry ( pLeaderboardScoresDownloaded - > m_hSteamLeaderboardEntries , index , & leaderboardEntry , details , 3 ) ; <nl> + / / assert ( leaderboardEntry . m_cDetails = = 3 ) ; <nl> + / / . . . <nl> + / / } <nl> + / / once you ' ve accessed all the entries , the data will be free ' d , and the SteamLeaderboardEntries_t handle will become invalid <nl> + virtual bool GetDownloadedLeaderboardEntry ( SteamLeaderboardEntries_t hSteamLeaderboardEntries , int index , LeaderboardEntry_t * pLeaderboardEntry , int32 * pDetails , int cDetailsMax ) = 0 ; <nl> + <nl> + / / Uploads a user score to the Steam back - end . <nl> + / / This call is asynchronous , with the result returned in LeaderboardScoreUploaded_t <nl> + / / Details are extra game - defined information regarding how the user got that score <nl> + / / pScoreDetails points to an array of int32 ' s , cScoreDetailsCount is the number of int32 ' s in the list <nl> + virtual SteamAPICall_t UploadLeaderboardScore ( SteamLeaderboard_t hSteamLeaderboard , ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod , int32 nScore , const int32 * pScoreDetails , int cScoreDetailsCount ) = 0 ; <nl> + <nl> + / / Attaches a piece of user generated content the user ' s entry on a leaderboard . <nl> + / / hContent is a handle to a piece of user generated content that was shared using ISteamUserRemoteStorage : : FileShare ( ) . <nl> + / / This call is asynchronous , with the result returned in LeaderboardUGCSet_t . <nl> + virtual SteamAPICall_t AttachLeaderboardUGC ( SteamLeaderboard_t hSteamLeaderboard , UGCHandle_t hUGC ) = 0 ; <nl> + <nl> + / / Retrieves the number of players currently playing your game ( online + offline ) <nl> + / / This call is asynchronous , with the result returned in NumberOfCurrentPlayers_t <nl> + virtual SteamAPICall_t GetNumberOfCurrentPlayers ( ) = 0 ; <nl> + } ; <nl> + <nl> + # define STEAMUSERSTATS_INTERFACE_VERSION " STEAMUSERSTATS_INTERFACE_VERSION008 " <nl> + <nl> + / / callbacks <nl> + # pragma pack ( push , 8 ) <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : called when the latests stats and achievements have been received <nl> + / / from the server <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct UserStatsReceived_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserStatsCallbacks + 1 } ; <nl> + uint64 m_nGameID ; / / Game these stats are for <nl> + EResult m_eResult ; / / Success / error fetching the stats <nl> + CSteamID m_steamIDUser ; / / The user for whom the stats are retrieved for <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : result of a request to store the user stats for a game <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct UserStatsStored_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserStatsCallbacks + 2 } ; <nl> + uint64 m_nGameID ; / / Game these stats are for <nl> + EResult m_eResult ; / / success / error <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : result of a request to store the achievements for a game , or an <nl> + / / " indicate progress " call . If both m_nCurProgress and m_nMaxProgress <nl> + / / are zero , that means the achievement has been fully unlocked . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct UserAchievementStored_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserStatsCallbacks + 3 } ; <nl> + <nl> + uint64 m_nGameID ; / / Game this is for <nl> + bool m_bGroupAchievement ; / / if this is a " group " achievement <nl> + char m_rgchAchievementName [ k_cchStatNameMax ] ; / / name of the achievement <nl> + uint32 m_nCurProgress ; / / current progress towards the achievement <nl> + uint32 m_nMaxProgress ; / / " out of " this many <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : call result for finding a leaderboard , returned as a result of FindOrCreateLeaderboard ( ) or FindLeaderboard ( ) <nl> + / / use CCallResult < > to map this async result to a member function <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct LeaderboardFindResult_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserStatsCallbacks + 4 } ; <nl> + SteamLeaderboard_t m_hSteamLeaderboard ; / / handle to the leaderboard serarched for , 0 if no leaderboard found <nl> + uint8 m_bLeaderboardFound ; / / 0 if no leaderboard found <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : call result indicating scores for a leaderboard have been downloaded and are ready to be retrieved , returned as a result of DownloadLeaderboardEntries ( ) <nl> + / / use CCallResult < > to map this async result to a member function <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct LeaderboardScoresDownloaded_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserStatsCallbacks + 5 } ; <nl> + SteamLeaderboard_t m_hSteamLeaderboard ; <nl> + SteamLeaderboardEntries_t m_hSteamLeaderboardEntries ; / / the handle to pass into GetDownloadedLeaderboardEntries ( ) <nl> + int m_cEntryCount ; / / the number of entries downloaded <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : call result indicating scores has been uploaded , returned as a result of UploadLeaderboardScore ( ) <nl> + / / use CCallResult < > to map this async result to a member function <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct LeaderboardScoreUploaded_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserStatsCallbacks + 6 } ; <nl> + uint8 m_bSuccess ; / / 1 if the call was successful <nl> + SteamLeaderboard_t m_hSteamLeaderboard ; / / the leaderboard handle that was <nl> + int32 m_nScore ; / / the score that was attempted to set <nl> + uint8 m_bScoreChanged ; / / true if the score in the leaderboard change , false if the existing score was better <nl> + int m_nGlobalRankNew ; / / the new global rank of the user in this leaderboard <nl> + int m_nGlobalRankPrevious ; / / the previous global rank of the user in this leaderboard ; 0 if the user had no existing entry in the leaderboard <nl> + } ; <nl> + <nl> + struct NumberOfCurrentPlayers_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserStatsCallbacks + 7 } ; <nl> + uint8 m_bSuccess ; / / 1 if the call was successful <nl> + int32 m_cPlayers ; / / Number of players currently playing <nl> + } ; <nl> + <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Callback indicating that a user ' s stats have been unloaded . <nl> + / / Call RequestUserStats again to access stats for this user <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct UserStatsUnloaded_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserStatsCallbacks + 8 } ; <nl> + CSteamID m_steamIDUser ; / / User whose stats have been unloaded <nl> + } ; <nl> + <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Callback indicating that an achievement icon has been fetched <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct UserAchievementIconFetched_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserStatsCallbacks + 9 } ; <nl> + <nl> + CGameID m_nGameID ; / / Game this is for <nl> + char m_rgchAchievementName [ k_cchStatNameMax ] ; / / name of the achievement <nl> + bool m_bAchieved ; / / Is the icon for the achieved or not achieved version ? <nl> + int m_nIconHandle ; / / Handle to the image , which can be used in ClientUtils ( ) - > GetImageRGBA ( ) , 0 means no image is set for the achievement <nl> + } ; <nl> + <nl> + / / <nl> + / / IMPORTANT ! k_iSteamUserStatsCallbacks + 10 is used , see iclientuserstats . h <nl> + / / <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : call result indicating UGC has been uploaded , returned as a result of SetLeaderboardUGC ( ) <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct LeaderboardUGCSet_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUserStatsCallbacks + 11 } ; <nl> + EResult m_eResult ; / / The result of the operation <nl> + SteamLeaderboard_t m_hSteamLeaderboard ; / / the leaderboard handle that was <nl> + } ; <nl> + <nl> + # pragma pack ( pop ) <nl> + <nl> + <nl> + # endif / / ISTEAMUSER_H <nl> new file mode 100644 <nl> index 00000000 . . dd08ab86 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / isteamutils . h <nl> <nl> + / / = = = = = = Copyright © 1996 - 2008 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : interface to utility functions in Steam <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef ISTEAMUTILS_H <nl> + # define ISTEAMUTILS_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # include " isteamclient . h " <nl> + <nl> + <nl> + / / Steam API call failure results <nl> + enum ESteamAPICallFailure <nl> + { <nl> + k_ESteamAPICallFailureNone = - 1 , / / no failure <nl> + k_ESteamAPICallFailureSteamGone = 0 , / / the local Steam process has gone away <nl> + k_ESteamAPICallFailureNetworkFailure = 1 , / / the network connection to Steam has been broken , or was already broken <nl> + / / SteamServersDisconnected_t callback will be sent around the same time <nl> + / / SteamServersConnected_t will be sent when the client is able to talk to the Steam servers again <nl> + k_ESteamAPICallFailureInvalidHandle = 2 , / / the SteamAPICall_t handle passed in no longer exists <nl> + k_ESteamAPICallFailureMismatchedCallback = 3 , / / GetAPICallResult ( ) was called with the wrong callback type for this API call <nl> + } ; <nl> + <nl> + / / function prototype for warning message hook <nl> + # if defined ( POSIX ) <nl> + # define __cdecl <nl> + # endif <nl> + extern " C " typedef void ( __cdecl * SteamAPIWarningMessageHook_t ) ( int , const char * ) ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : interface to user independent utility functions <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class ISteamUtils <nl> + { <nl> + public : <nl> + / / return the number of seconds since the user <nl> + virtual uint32 GetSecondsSinceAppActive ( ) = 0 ; <nl> + virtual uint32 GetSecondsSinceComputerActive ( ) = 0 ; <nl> + <nl> + / / the universe this client is connecting to <nl> + virtual EUniverse GetConnectedUniverse ( ) = 0 ; <nl> + <nl> + / / Steam server time - in PST , number of seconds since January 1 , 1970 ( i . e unix time ) <nl> + virtual uint32 GetServerRealTime ( ) = 0 ; <nl> + <nl> + / / returns the 2 digit ISO 3166 - 1 - alpha - 2 format country code this client is running in ( as looked up via an IP - to - location database ) <nl> + / / e . g " US " or " UK " . <nl> + virtual const char * GetIPCountry ( ) = 0 ; <nl> + <nl> + / / returns true if the image exists , and valid sizes were filled out <nl> + virtual bool GetImageSize ( int iImage , uint32 * pnWidth , uint32 * pnHeight ) = 0 ; <nl> + <nl> + / / returns true if the image exists , and the buffer was successfully filled out <nl> + / / results are returned in RGBA format <nl> + / / the destination buffer size should be 4 * height * width * sizeof ( char ) <nl> + virtual bool GetImageRGBA ( int iImage , uint8 * pubDest , int nDestBufferSize ) = 0 ; <nl> + <nl> + / / returns the IP of the reporting server for valve - currently only used in Source engine games <nl> + virtual bool GetCSERIPPort ( uint32 * unIP , uint16 * usPort ) = 0 ; <nl> + <nl> + / / return the amount of battery power left in the current system in % [ 0 . . 100 ] , 255 for being on AC power <nl> + virtual uint8 GetCurrentBatteryPower ( ) = 0 ; <nl> + <nl> + / / returns the appID of the current process <nl> + virtual uint32 GetAppID ( ) = 0 ; <nl> + <nl> + / / Sets the position where the overlay instance for the currently calling game should show notifications . <nl> + / / This position is per - game and if this function is called from outside of a game context it will do nothing . <nl> + virtual void SetOverlayNotificationPosition ( ENotificationPosition eNotificationPosition ) = 0 ; <nl> + <nl> + / / API asynchronous call results <nl> + / / can be used directly , but more commonly used via the callback dispatch API ( see steam_api . h ) <nl> + virtual bool IsAPICallCompleted ( SteamAPICall_t hSteamAPICall , bool * pbFailed ) = 0 ; <nl> + virtual ESteamAPICallFailure GetAPICallFailureReason ( SteamAPICall_t hSteamAPICall ) = 0 ; <nl> + virtual bool GetAPICallResult ( SteamAPICall_t hSteamAPICall , void * pCallback , int cubCallback , int iCallbackExpected , bool * pbFailed ) = 0 ; <nl> + <nl> + / / this needs to be called every frame to process matchmaking results <nl> + / / redundant if you ' re already calling SteamAPI_RunCallbacks ( ) <nl> + virtual void RunFrame ( ) = 0 ; <nl> + <nl> + / / returns the number of IPC calls made since the last time this function was called <nl> + / / Used for perf debugging so you can understand how many IPC calls your game makes per frame <nl> + / / Every IPC call is at minimum a thread context switch if not a process one so you want to rate <nl> + / / control how often you do them . <nl> + virtual uint32 GetIPCCallCount ( ) = 0 ; <nl> + <nl> + / / API warning handling <nl> + / / ' int ' is the severity ; 0 for msg , 1 for warning <nl> + / / ' const char * ' is the text of the message <nl> + / / callbacks will occur directly after the API function is called that generated the warning or message <nl> + virtual void SetWarningMessageHook ( SteamAPIWarningMessageHook_t pFunction ) = 0 ; <nl> + <nl> + / / Returns true if the overlay is running & the user can access it . The overlay process could take a few seconds to <nl> + / / start & hook the game process , so this function will initially return false while the overlay is loading . <nl> + virtual bool IsOverlayEnabled ( ) = 0 ; <nl> + <nl> + / / Normally this call is unneeded if your game has a constantly running frame loop that calls the <nl> + / / D3D Present API , or OGL SwapBuffers API every frame . <nl> + / / <nl> + / / However , if you have a game that only refreshes the screen on an event driven basis then that can break <nl> + / / the overlay , as it uses your Present / SwapBuffers calls to drive it ' s internal frame loop and it may also <nl> + / / need to Present ( ) to the screen any time an even needing a notification happens or when the overlay is <nl> + / / brought up over the game by a user . You can use this API to ask the overlay if it currently need a present <nl> + / / in that case , and then you can check for this periodically ( roughly 33hz is desirable ) and make sure you <nl> + / / refresh the screen with Present or SwapBuffers to allow the overlay to do it ' s work . <nl> + virtual bool BOverlayNeedsPresent ( ) = 0 ; <nl> + <nl> + # ifndef _PS3 <nl> + / / Asynchronous call to check if an executable file has been signed using the public key set on the signing tab <nl> + / / of the partner site , for example to refuse to load modified executable files . <nl> + / / The result is returned in CheckFileSignature_t . <nl> + / / k_ECheckFileSignatureNoSignaturesFoundForThisApp - This app has not been configured on the signing tab of the partner site to enable this function . <nl> + / / k_ECheckFileSignatureNoSignaturesFoundForThisFile - This file is not listed on the signing tab for the partner site . <nl> + / / k_ECheckFileSignatureFileNotFound - The file does not exist on disk . <nl> + / / k_ECheckFileSignatureInvalidSignature - The file exists , and the signing tab has been set for this file , but the file is either not signed or the signature does not match . <nl> + / / k_ECheckFileSignatureValidSignature - The file is signed and the signature is valid . <nl> + virtual SteamAPICall_t CheckFileSignature ( const char * szFileName ) = 0 ; <nl> + # endif <nl> + <nl> + # ifdef _PS3 <nl> + virtual void PostPS3SysutilCallback ( uint64_t status , uint64_t param , void * userdata ) = 0 ; <nl> + virtual bool BIsReadyToShutdown ( ) = 0 ; <nl> + # endif <nl> + } ; <nl> + <nl> + # define STEAMUTILS_INTERFACE_VERSION " SteamUtils005 " <nl> + <nl> + <nl> + / / callbacks <nl> + # pragma pack ( push , 8 ) <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : The country of the user changed <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct IPCountry_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUtilsCallbacks + 1 } ; <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Fired when running on a laptop and less than 10 minutes of battery is left , fires then every minute <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct LowBatteryPower_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUtilsCallbacks + 2 } ; <nl> + uint8 m_nMinutesBatteryLeft ; <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : called when a SteamAsyncCall_t has completed ( or failed ) <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct SteamAPICallCompleted_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUtilsCallbacks + 3 } ; <nl> + SteamAPICall_t m_hAsyncCall ; <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / called when Steam wants to shutdown <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct SteamShutdown_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUtilsCallbacks + 4 } ; <nl> + } ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / results for CheckFileSignature <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + enum ECheckFileSignature <nl> + { <nl> + k_ECheckFileSignatureInvalidSignature = 0 , <nl> + k_ECheckFileSignatureValidSignature = 1 , <nl> + k_ECheckFileSignatureFileNotFound = 2 , <nl> + k_ECheckFileSignatureNoSignaturesFoundForThisApp = 3 , <nl> + k_ECheckFileSignatureNoSignaturesFoundForThisFile = 4 , <nl> + } ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / callback for CheckFileSignature <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct CheckFileSignature_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUtilsCallbacks + 5 } ; <nl> + ECheckFileSignature m_eCheckFileSignature ; <nl> + } ; <nl> + <nl> + # ifdef _PS3 <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / callback for NetCtlNetStartDialog finishing on PS3 <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct NetStartDialogFinished_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUtilsCallbacks + 6 } ; <nl> + } ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / callback for NetCtlNetStartDialog unloaded on PS3 <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct NetStartDialogUnloaded_t <nl> + { <nl> + enum { k_iCallback = k_iSteamUtilsCallbacks + 7 } ; <nl> + } ; <nl> + <nl> + # endif <nl> + <nl> + # pragma pack ( pop ) <nl> + <nl> + # endif / / ISTEAMUTILS_H <nl> new file mode 100644 <nl> index 00000000 . . 2f6f8380 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / matchmakingtypes . h <nl> <nl> + / / = = = = = = = = = Copyright ï ¿ ½ 1996 - 2008 , Valve LLC , All rights reserved . = = = = = = = = = = = = <nl> + / / <nl> + / / Purpose : <nl> + / / <nl> + / / $ NoKeywords : $ <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef MATCHMAKINGTYPES_H <nl> + # define MATCHMAKINGTYPES_H <nl> + <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # ifdef POSIX <nl> + # ifndef _snprintf <nl> + # define _snprintf snprintf <nl> + # endif <nl> + # endif <nl> + <nl> + # include < stdio . h > <nl> + # include < string . h > <nl> + <nl> + struct MatchMakingKeyValuePair_t <nl> + { <nl> + MatchMakingKeyValuePair_t ( ) { m_szKey [ 0 ] = m_szValue [ 0 ] = 0 ; } <nl> + MatchMakingKeyValuePair_t ( const char * pchKey , const char * pchValue ) <nl> + { <nl> + strncpy ( m_szKey , pchKey , sizeof ( m_szKey ) ) ; / / this is a public header , use basic c library string funcs only ! <nl> + strncpy ( m_szValue , pchValue , sizeof ( m_szValue ) ) ; <nl> + } <nl> + char m_szKey [ 256 ] ; <nl> + char m_szValue [ 256 ] ; <nl> + } ; <nl> + <nl> + <nl> + enum EMatchMakingServerResponse <nl> + { <nl> + eServerResponded = 0 , <nl> + eServerFailedToRespond , <nl> + eNoServersListedOnMasterServer / / for the Internet query type , returned in response callback if no servers of this type match <nl> + } ; <nl> + <nl> + / / servernetadr_t is all the addressing info the serverbrowser needs to know about a game server , <nl> + / / namely : its IP , its connection port , and its query port . <nl> + class servernetadr_t <nl> + { <nl> + public : <nl> + <nl> + void Init ( unsigned int ip , uint16 usQueryPort , uint16 usConnectionPort ) ; <nl> + # ifdef NETADR_H <nl> + void Init ( const netadr_t & ipAndQueryPort , uint16 usConnectionPort ) ; <nl> + netadr_t & GetIPAndQueryPort ( ) ; <nl> + # endif <nl> + <nl> + / / Access the query port . <nl> + uint16 GetQueryPort ( ) const ; <nl> + void SetQueryPort ( uint16 usPort ) ; <nl> + <nl> + / / Access the connection port . <nl> + uint16 GetConnectionPort ( ) const ; <nl> + void SetConnectionPort ( uint16 usPort ) ; <nl> + <nl> + / / Access the IP <nl> + uint32 GetIP ( ) const ; <nl> + void SetIP ( uint32 ) ; <nl> + <nl> + / / This gets the ' a . b . c . d : port ' string with the connection port ( instead of the query port ) . <nl> + const char * GetConnectionAddressString ( ) const ; <nl> + const char * GetQueryAddressString ( ) const ; <nl> + <nl> + / / Comparison operators and functions . <nl> + bool operator < ( const servernetadr_t & netadr ) const ; <nl> + void operator = ( const servernetadr_t & that ) <nl> + { <nl> + m_usConnectionPort = that . m_usConnectionPort ; <nl> + m_usQueryPort = that . m_usQueryPort ; <nl> + m_unIP = that . m_unIP ; <nl> + } <nl> + <nl> + <nl> + private : <nl> + const char * ToString ( uint32 unIP , uint16 usPort ) const ; <nl> + uint16 m_usConnectionPort ; / / ( in HOST byte order ) <nl> + uint16 m_usQueryPort ; <nl> + uint32 m_unIP ; <nl> + } ; <nl> + <nl> + <nl> + inline void servernetadr_t : : Init ( unsigned int ip , uint16 usQueryPort , uint16 usConnectionPort ) <nl> + { <nl> + m_unIP = ip ; <nl> + m_usQueryPort = usQueryPort ; <nl> + m_usConnectionPort = usConnectionPort ; <nl> + } <nl> + <nl> + # ifdef NETADR_H <nl> + inline void servernetadr_t : : Init ( const netadr_t & ipAndQueryPort , uint16 usConnectionPort ) <nl> + { <nl> + Init ( ipAndQueryPort . GetIP ( ) , ipAndQueryPort . GetPort ( ) , usConnectionPort ) ; <nl> + } <nl> + <nl> + inline netadr_t & servernetadr_t : : GetIPAndQueryPort ( ) <nl> + { <nl> + static netadr_t netAdr ; <nl> + netAdr . SetIP ( m_unIP ) ; <nl> + netAdr . SetPort ( m_usQueryPort ) ; <nl> + return netAdr ; <nl> + } <nl> + # endif <nl> + <nl> + inline uint16 servernetadr_t : : GetQueryPort ( ) const <nl> + { <nl> + return m_usQueryPort ; <nl> + } <nl> + <nl> + inline void servernetadr_t : : SetQueryPort ( uint16 usPort ) <nl> + { <nl> + m_usQueryPort = usPort ; <nl> + } <nl> + <nl> + inline uint16 servernetadr_t : : GetConnectionPort ( ) const <nl> + { <nl> + return m_usConnectionPort ; <nl> + } <nl> + <nl> + inline void servernetadr_t : : SetConnectionPort ( uint16 usPort ) <nl> + { <nl> + m_usConnectionPort = usPort ; <nl> + } <nl> + <nl> + inline uint32 servernetadr_t : : GetIP ( ) const <nl> + { <nl> + return m_unIP ; <nl> + } <nl> + <nl> + inline void servernetadr_t : : SetIP ( uint32 unIP ) <nl> + { <nl> + m_unIP = unIP ; <nl> + } <nl> + <nl> + inline const char * servernetadr_t : : ToString ( uint32 unIP , uint16 usPort ) const <nl> + { <nl> + static char s [ 4 ] [ 64 ] ; <nl> + static int nBuf = 0 ; <nl> + unsigned char * ipByte = ( unsigned char * ) & unIP ; <nl> + _snprintf ( s [ nBuf ] , sizeof ( s [ nBuf ] ) , " % u . % u . % u . % u : % i " , ( int ) ( ipByte [ 3 ] ) , ( int ) ( ipByte [ 2 ] ) , ( int ) ( ipByte [ 1 ] ) , ( int ) ( ipByte [ 0 ] ) , usPort ) ; <nl> + const char * pchRet = s [ nBuf ] ; <nl> + + + nBuf ; <nl> + nBuf % = ( ( sizeof ( s ) / sizeof ( s [ 0 ] ) ) ) ; <nl> + return pchRet ; <nl> + } <nl> + <nl> + inline const char * servernetadr_t : : GetConnectionAddressString ( ) const <nl> + { <nl> + return ToString ( m_unIP , m_usConnectionPort ) ; <nl> + } <nl> + <nl> + inline const char * servernetadr_t : : GetQueryAddressString ( ) const <nl> + { <nl> + return ToString ( m_unIP , m_usQueryPort ) ; <nl> + } <nl> + <nl> + inline bool servernetadr_t : : operator < ( const servernetadr_t & netadr ) const <nl> + { <nl> + return ( m_unIP < netadr . m_unIP ) | | ( m_unIP = = netadr . m_unIP & & m_usQueryPort < netadr . m_usQueryPort ) ; <nl> + } <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Data describing a single server <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class gameserveritem_t <nl> + { <nl> + public : <nl> + gameserveritem_t ( ) ; <nl> + <nl> + const char * GetName ( ) const ; <nl> + void SetName ( const char * pName ) ; <nl> + <nl> + public : <nl> + servernetadr_t m_NetAdr ; / / IP / Query Port / Connection Port for this server <nl> + int m_nPing ; / / current ping time in milliseconds <nl> + bool m_bHadSuccessfulResponse ; / / server has responded successfully in the past <nl> + bool m_bDoNotRefresh ; / / server is marked as not responding and should no longer be refreshed <nl> + char m_szGameDir [ 32 ] ; / / current game directory <nl> + char m_szMap [ 32 ] ; / / current map <nl> + char m_szGameDescription [ 64 ] ; / / game description <nl> + uint32 m_nAppID ; / / Steam App ID of this server <nl> + int m_nPlayers ; / / current number of players on the server <nl> + int m_nMaxPlayers ; / / Maximum players that can join this server <nl> + int m_nBotPlayers ; / / Number of bots ( i . e simulated players ) on this server <nl> + bool m_bPassword ; / / true if this server needs a password to join <nl> + bool m_bSecure ; / / Is this server protected by VAC <nl> + uint32 m_ulTimeLastPlayed ; / / time ( in unix time ) when this server was last played on ( for favorite / history servers ) <nl> + int m_nServerVersion ; / / server version as reported to Steam <nl> + <nl> + private : <nl> + char m_szServerName [ 64 ] ; / / Game server name <nl> + <nl> + / / For data added after SteamMatchMaking001 add it here <nl> + public : <nl> + char m_szGameTags [ 128 ] ; / / the tags this server exposes <nl> + CSteamID m_steamID ; / / steamID of the game server - invalid if it ' s doesn ' t have one ( old server , or not connected to Steam ) <nl> + } ; <nl> + <nl> + <nl> + inline gameserveritem_t : : gameserveritem_t ( ) <nl> + { <nl> + m_szGameDir [ 0 ] = m_szMap [ 0 ] = m_szGameDescription [ 0 ] = m_szServerName [ 0 ] = 0 ; <nl> + m_bHadSuccessfulResponse = m_bDoNotRefresh = m_bPassword = m_bSecure = false ; <nl> + m_nPing = m_nAppID = m_nPlayers = m_nMaxPlayers = m_nBotPlayers = m_ulTimeLastPlayed = m_nServerVersion = 0 ; <nl> + m_szGameTags [ 0 ] = 0 ; <nl> + } <nl> + <nl> + inline const char * gameserveritem_t : : GetName ( ) const <nl> + { <nl> + / / Use the IP address as the name if nothing is set yet . <nl> + if ( m_szServerName [ 0 ] = = 0 ) <nl> + return m_NetAdr . GetConnectionAddressString ( ) ; <nl> + else <nl> + return m_szServerName ; <nl> + } <nl> + <nl> + inline void gameserveritem_t : : SetName ( const char * pName ) <nl> + { <nl> + strncpy ( m_szServerName , pName , sizeof ( m_szServerName ) ) ; <nl> + } <nl> + <nl> + <nl> + # endif / / MATCHMAKINGTYPES_H <nl> new file mode 100644 <nl> index 00000000 . . 0c9d4c75 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / steam_api . h <nl> <nl> + / / = = = = = = Copyright 1996 - 2008 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef STEAM_API_H <nl> + # define STEAM_API_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # include " isteamclient . h " <nl> + # include " isteamuser . h " <nl> + # include " isteamfriends . h " <nl> + # include " isteamutils . h " <nl> + # include " isteammatchmaking . h " <nl> + # include " isteamuserstats . h " <nl> + # include " isteamapps . h " <nl> + # include " isteamnetworking . h " <nl> + # include " isteamremotestorage . h " <nl> + <nl> + / / Steam API export macro <nl> + # if defined ( _WIN32 ) & & ! defined ( _X360 ) <nl> + # if defined ( STEAM_API_EXPORTS ) <nl> + # define S_API extern " C " __declspec ( dllexport ) <nl> + # elif defined ( STEAM_API_NODLL ) <nl> + # define S_API extern " C " <nl> + # else <nl> + # define S_API extern " C " __declspec ( dllimport ) <nl> + # endif / / STEAM_API_EXPORTS <nl> + # elif defined ( GNUC ) <nl> + # if defined ( STEAM_API_EXPORTS ) <nl> + # define S_API extern " C " __attribute__ ( ( visibility ( " default " ) ) ) <nl> + # else <nl> + # define S_API extern " C " <nl> + # endif / / STEAM_API_EXPORTS <nl> + # else / / ! WIN32 <nl> + # if defined ( STEAM_API_EXPORTS ) <nl> + # define S_API extern " C " <nl> + # else <nl> + # define S_API extern " C " <nl> + # endif / / STEAM_API_EXPORTS <nl> + # endif <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - / / <nl> + / / Steam API setup & shutdown <nl> + / / <nl> + / / These functions manage loading , initializing and shutdown of the steamclient . dll <nl> + / / <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - / / <nl> + <nl> + / / S_API void SteamAPI_Init ( ) ; ( see below ) <nl> + S_API void SteamAPI_Shutdown ( ) ; <nl> + <nl> + / / checks if a local Steam client is running <nl> + S_API bool SteamAPI_IsSteamRunning ( ) ; <nl> + <nl> + / / Detects if your executable was launched through the Steam client , and restarts your game through <nl> + / / the client if necessary . The Steam client will be started if it is not running . <nl> + / / <nl> + / / Returns : true if your executable was NOT launched through the Steam client . This function will <nl> + / / then start your application through the client . Your current process should exit . <nl> + / / <nl> + / / false if your executable was started through the Steam client or a steam_appid . txt file <nl> + / / is present in your game ' s directory ( for development ) . Your current process should continue . <nl> + / / <nl> + / / NOTE : This function should be used only if you are using CEG or not using Steam ' s DRM . Once applied <nl> + / / to your executable , Steam ' s DRM will handle restarting through Steam if necessary . <nl> + S_API bool SteamAPI_RestartAppIfNecessary ( uint32 unOwnAppID ) ; <nl> + <nl> + / / crash dump recording functions <nl> + S_API void SteamAPI_WriteMiniDump ( uint32 uStructuredExceptionCode , void * pvExceptionInfo , uint32 uBuildID ) ; <nl> + S_API void SteamAPI_SetMiniDumpComment ( const char * pchMsg ) ; <nl> + <nl> + / / this should be called before the game initialized the steam APIs <nl> + / / pchDate should be of the format " Mmm dd yyyy " ( such as from the __DATE__ macro ) <nl> + / / pchTime should be of the format " hh : mm : ss " ( such as from the __TIME__ macro ) <nl> + / / bFullMemoryDumps ( Win32 only ) - - writes out a uuid - full . dmp in the client / dumps folder <nl> + / / pvContext - - can be NULL , will be the void * context passed into m_pfnPreMinidumpCallback <nl> + / / PFNPreMinidumpCallback m_pfnPreMinidumpCallback - - optional callback which occurs just before a . dmp file is written during a crash . Applications can hook this to allow adding additional information into the . dmp comment stream . <nl> + S_API void SteamAPI_UseBreakpadCrashHandler ( char const * pchVersion , char const * pchDate , char const * pchTime , bool bFullMemoryDumps , void * pvContext , PFNPreMinidumpCallback m_pfnPreMinidumpCallback ) ; <nl> + S_API void SteamAPI_SetBreakpadAppID ( uint32 unAppID ) ; <nl> + <nl> + / / interface pointers , configured by SteamAPI_Init ( ) <nl> + S_API ISteamClient * SteamClient ( ) ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - / / <nl> + / / PlayStation 3 initialization parameters <nl> + / / <nl> + / / The following structure must be passed to when loading steam_api_ps3 . prx <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - / / <nl> + # define STEAM_PS3_PATH_MAX 1055 <nl> + # define STEAM_PS3_SERVICE_ID_MAX 32 <nl> + struct SteamPS3Params_t <nl> + { <nl> + void * pReserved ; <nl> + AppId_t m_nAppId ; <nl> + <nl> + char m_rgchInstallationPath [ STEAM_PS3_PATH_MAX ] ; <nl> + char m_rgchSystemCache [ STEAM_PS3_PATH_MAX ] ; / / temp working cache , not persistent <nl> + char m_rgchGameData [ STEAM_PS3_PATH_MAX ] ; / / persistent game data path for storing user data <nl> + char m_rgchNpServiceID [ STEAM_PS3_SERVICE_ID_MAX ] ; <nl> + <nl> + / / Should be SYS_TTYP3 through SYS_TTYP10 , if it ' s 0 then Steam won ' t spawn a <nl> + / / thread to read console input at all . Using this let ' s you use Steam console commands <nl> + / / like : profile_on , profile_off , profile_dump , mem_stats , mem_validate . <nl> + unsigned int m_cSteamInputTTY ; <nl> + <nl> + struct Ps3netInit_t <nl> + { <nl> + bool m_bNeedInit ; <nl> + bool m_bNeedInitEx ; <nl> + void * m_pMemory ; <nl> + int m_nMemorySize ; <nl> + int m_flags ; <nl> + } m_sysNetInitInfo ; <nl> + <nl> + struct Ps3jpgInit_t <nl> + { <nl> + bool m_bNeedInit ; <nl> + } m_sysJpgInitInfo ; <nl> + } ; <nl> + <nl> + <nl> + / / <nl> + / / VERSION_SAFE_STEAM_API_INTERFACES is usually not necessary , but it provides safety against releasing <nl> + / / new steam_api . dll ' s without recompiling / rereleasing modules that use it . <nl> + / / <nl> + / / If you use VERSION_SAFE_STEAM_API_INTERFACES , then you should call SteamAPI_InitSafe ( ) . Also , to get the <nl> + / / Steam interfaces , you must create and Init ( ) a CSteamAPIContext ( below ) and use the interfaces in there . <nl> + / / <nl> + / / If you don ' t use VERSION_SAFE_STEAM_API_INTERFACES , then you can use SteamAPI_Init ( ) and the SteamXXXX ( ) <nl> + / / functions below to get at the Steam interfaces . <nl> + / / <nl> + # ifdef VERSION_SAFE_STEAM_API_INTERFACES <nl> + S_API bool SteamAPI_InitSafe ( ) ; <nl> + # else <nl> + <nl> + # if defined ( _PS3 ) <nl> + S_API bool SteamAPI_Init ( SteamPS3Params_t * pParams ) ; <nl> + # else <nl> + S_API bool SteamAPI_Init ( ) ; <nl> + # endif <nl> + <nl> + S_API ISteamUser * SteamUser ( ) ; <nl> + S_API ISteamFriends * SteamFriends ( ) ; <nl> + S_API ISteamUtils * SteamUtils ( ) ; <nl> + S_API ISteamMatchmaking * SteamMatchmaking ( ) ; <nl> + S_API ISteamUserStats * SteamUserStats ( ) ; <nl> + S_API ISteamApps * SteamApps ( ) ; <nl> + S_API ISteamNetworking * SteamNetworking ( ) ; <nl> + S_API ISteamMatchmakingServers * SteamMatchmakingServers ( ) ; <nl> + S_API ISteamRemoteStorage * SteamRemoteStorage ( ) ; <nl> + # endif / / VERSION_SAFE_STEAM_API_INTERFACES <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - / / <nl> + / / steam callback helper functions <nl> + / / <nl> + / / The following classes / macros are used to be able to easily multiplex callbacks <nl> + / / from the Steam API into various objects in the app in a thread - safe manner <nl> + / / <nl> + / / These functors are triggered via the SteamAPI_RunCallbacks ( ) function , mapping the callback <nl> + / / to as many functions / objects as are registered to it <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - / / <nl> + <nl> + S_API void SteamAPI_RunCallbacks ( ) ; <nl> + <nl> + <nl> + <nl> + / / functions used by the utility CCallback objects to receive callbacks <nl> + S_API void SteamAPI_RegisterCallback ( class CCallbackBase * pCallback , int iCallback ) ; <nl> + S_API void SteamAPI_UnregisterCallback ( class CCallbackBase * pCallback ) ; <nl> + / / functions used by the utility CCallResult objects to receive async call results <nl> + S_API void SteamAPI_RegisterCallResult ( class CCallbackBase * pCallback , SteamAPICall_t hAPICall ) ; <nl> + S_API void SteamAPI_UnregisterCallResult ( class CCallbackBase * pCallback , SteamAPICall_t hAPICall ) ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : base for callbacks , <nl> + / / used only by CCallback , shouldn ' t be used directly <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class CCallbackBase <nl> + { <nl> + public : <nl> + CCallbackBase ( ) { m_nCallbackFlags = 0 ; m_iCallback = 0 ; } <nl> + / / don ' t add a virtual destructor because we export this binary interface across dll ' s <nl> + virtual void Run ( void * pvParam ) = 0 ; <nl> + virtual void Run ( void * pvParam , bool bIOFailure , SteamAPICall_t hSteamAPICall ) = 0 ; <nl> + int GetICallback ( ) { return m_iCallback ; } <nl> + virtual int GetCallbackSizeBytes ( ) = 0 ; <nl> + <nl> + protected : <nl> + enum { k_ECallbackFlagsRegistered = 0x01 , k_ECallbackFlagsGameServer = 0x02 } ; <nl> + uint8 m_nCallbackFlags ; <nl> + int m_iCallback ; <nl> + friend class CCallbackMgr ; <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : maps a steam async call result to a class member function <nl> + / / template params : T = local class , P = parameter struct <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + template < class T , class P > <nl> + class CCallResult : private CCallbackBase <nl> + { <nl> + public : <nl> + typedef void ( T : : * func_t ) ( P * , bool ) ; <nl> + <nl> + CCallResult ( ) <nl> + { <nl> + m_hAPICall = k_uAPICallInvalid ; <nl> + m_pObj = NULL ; <nl> + m_Func = NULL ; <nl> + m_iCallback = P : : k_iCallback ; <nl> + } <nl> + <nl> + void Set ( SteamAPICall_t hAPICall , T * p , func_t func ) <nl> + { <nl> + if ( m_hAPICall ) <nl> + SteamAPI_UnregisterCallResult ( this , m_hAPICall ) ; <nl> + <nl> + m_hAPICall = hAPICall ; <nl> + m_pObj = p ; <nl> + m_Func = func ; <nl> + <nl> + if ( hAPICall ) <nl> + SteamAPI_RegisterCallResult ( this , hAPICall ) ; <nl> + } <nl> + <nl> + bool IsActive ( ) const <nl> + { <nl> + return ( m_hAPICall ! = k_uAPICallInvalid ) ; <nl> + } <nl> + <nl> + void Cancel ( ) <nl> + { <nl> + if ( m_hAPICall ! = k_uAPICallInvalid ) <nl> + { <nl> + SteamAPI_UnregisterCallResult ( this , m_hAPICall ) ; <nl> + m_hAPICall = k_uAPICallInvalid ; <nl> + } <nl> + <nl> + } <nl> + <nl> + ~ CCallResult ( ) <nl> + { <nl> + Cancel ( ) ; <nl> + } <nl> + <nl> + private : <nl> + virtual void Run ( void * pvParam ) <nl> + { <nl> + m_hAPICall = k_uAPICallInvalid ; / / caller unregisters for us <nl> + ( m_pObj - > * m_Func ) ( ( P * ) pvParam , false ) ; <nl> + } <nl> + void Run ( void * pvParam , bool bIOFailure , SteamAPICall_t hSteamAPICall ) <nl> + { <nl> + if ( hSteamAPICall = = m_hAPICall ) <nl> + { <nl> + m_hAPICall = k_uAPICallInvalid ; / / caller unregisters for us <nl> + ( m_pObj - > * m_Func ) ( ( P * ) pvParam , bIOFailure ) ; <nl> + } <nl> + } <nl> + int GetCallbackSizeBytes ( ) <nl> + { <nl> + return sizeof ( P ) ; <nl> + } <nl> + <nl> + SteamAPICall_t m_hAPICall ; <nl> + T * m_pObj ; <nl> + func_t m_Func ; <nl> + } ; <nl> + <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : maps a steam callback to a class member function <nl> + / / template params : T = local class , P = parameter struct <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + template < class T , class P , bool bGameServer > <nl> + class CCallback : private CCallbackBase <nl> + { <nl> + public : <nl> + typedef void ( T : : * func_t ) ( P * ) ; <nl> + <nl> + / / If you can ' t support constructing a callback with the correct parameters <nl> + / / then uncomment the empty constructor below and manually call <nl> + / / : : Register ( ) for your object <nl> + / / Or , just call the regular constructor with ( NULL , NULL ) <nl> + / / CCallback ( ) { } <nl> + <nl> + / / constructor for initializing this object in owner ' s constructor <nl> + CCallback ( T * pObj , func_t func ) : m_pObj ( pObj ) , m_Func ( func ) <nl> + { <nl> + if ( pObj & & func ) <nl> + Register ( pObj , func ) ; <nl> + } <nl> + <nl> + ~ CCallback ( ) <nl> + { <nl> + if ( m_nCallbackFlags & k_ECallbackFlagsRegistered ) <nl> + Unregister ( ) ; <nl> + } <nl> + <nl> + / / manual registration of the callback <nl> + void Register ( T * pObj , func_t func ) <nl> + { <nl> + if ( ! pObj | | ! func ) <nl> + return ; <nl> + <nl> + if ( m_nCallbackFlags & k_ECallbackFlagsRegistered ) <nl> + Unregister ( ) ; <nl> + <nl> + if ( bGameServer ) <nl> + { <nl> + m_nCallbackFlags | = k_ECallbackFlagsGameServer ; <nl> + } <nl> + m_pObj = pObj ; <nl> + m_Func = func ; <nl> + / / SteamAPI_RegisterCallback sets k_ECallbackFlagsRegistered <nl> + SteamAPI_RegisterCallback ( this , P : : k_iCallback ) ; <nl> + } <nl> + <nl> + void Unregister ( ) <nl> + { <nl> + / / SteamAPI_UnregisterCallback removes k_ECallbackFlagsRegistered <nl> + SteamAPI_UnregisterCallback ( this ) ; <nl> + } <nl> + <nl> + void SetGameserverFlag ( ) { m_nCallbackFlags | = k_ECallbackFlagsGameServer ; } <nl> + private : <nl> + virtual void Run ( void * pvParam ) <nl> + { <nl> + ( m_pObj - > * m_Func ) ( ( P * ) pvParam ) ; <nl> + } <nl> + virtual void Run ( void * pvParam , bool , SteamAPICall_t ) <nl> + { <nl> + ( m_pObj - > * m_Func ) ( ( P * ) pvParam ) ; <nl> + } <nl> + int GetCallbackSizeBytes ( ) <nl> + { <nl> + return sizeof ( P ) ; <nl> + } <nl> + <nl> + T * m_pObj ; <nl> + func_t m_Func ; <nl> + } ; <nl> + <nl> + / / Allows you to defer registration of the callback <nl> + template < class T , class P , bool bGameServer > <nl> + class CCallbackManual : public CCallback < T , P , bGameServer > <nl> + { <nl> + public : <nl> + CCallbackManual ( ) : CCallback < T , P , bGameServer > ( NULL , NULL ) { } <nl> + } ; <nl> + <nl> + / / utility macro for declaring the function and callback object together <nl> + # define STEAM_CALLBACK ( thisclass , func , param , var ) CCallback < thisclass , param , false > var ; void func ( param * pParam ) <nl> + <nl> + / / same as above , but lets you defer the callback binding by calling Register later <nl> + # define STEAM_CALLBACK_MANUAL ( thisclass , func , param , var ) CCallbackManual < thisclass , param , false > var ; void func ( param * pParam ) <nl> + <nl> + <nl> + # ifdef _WIN32 <nl> + / / disable this warning ; this pattern need for steam callback registration <nl> + # pragma warning ( disable : 4355 ) / / ' this ' : used in base member initializer list <nl> + # endif <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - / / <nl> + / / steamclient . dll private wrapper functions <nl> + / / <nl> + / / The following functions are part of abstracting API access to the steamclient . dll , but should only be used in very specific cases <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - / / <nl> + <nl> + / / pumps out all the steam messages , calling the register callback <nl> + S_API void Steam_RunCallbacks ( HSteamPipe hSteamPipe , bool bGameServerCallbacks ) ; <nl> + <nl> + / / register the callback funcs to use to interact with the steam dll <nl> + S_API void Steam_RegisterInterfaceFuncs ( void * hModule ) ; <nl> + <nl> + / / returns the HSteamUser of the last user to dispatch a callback <nl> + S_API HSteamUser Steam_GetHSteamUserCurrent ( ) ; <nl> + <nl> + / / returns the filename path of the current running Steam process , used if you need to load an explicit steam dll by name <nl> + S_API const char * SteamAPI_GetSteamInstallPath ( ) ; <nl> + <nl> + / / returns the pipe we are communicating to Steam with <nl> + S_API HSteamPipe SteamAPI_GetHSteamPipe ( ) ; <nl> + <nl> + / / sets whether or not Steam_RunCallbacks ( ) should do a try { } catch ( . . . ) { } around calls to issuing callbacks <nl> + S_API void SteamAPI_SetTryCatchCallbacks ( bool bTryCatchCallbacks ) ; <nl> + <nl> + / / backwards compat export , passes through to SteamAPI_ variants <nl> + S_API HSteamPipe GetHSteamPipe ( ) ; <nl> + S_API HSteamUser GetHSteamUser ( ) ; <nl> + <nl> + # ifdef VERSION_SAFE_STEAM_API_INTERFACES <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - / / <nl> + / / VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that <nl> + / / lets them each specify the interface versions they are compiled with . <nl> + / / <nl> + / / It ' s important that these stay inlined in the header so the calling module specifies the interface versions <nl> + / / for whatever Steam API version it has . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - / / <nl> + <nl> + S_API HSteamUser SteamAPI_GetHSteamUser ( ) ; <nl> + <nl> + class CSteamAPIContext <nl> + { <nl> + public : <nl> + CSteamAPIContext ( ) ; <nl> + void Clear ( ) ; <nl> + <nl> + bool Init ( ) ; <nl> + <nl> + ISteamUser * SteamUser ( ) { return m_pSteamUser ; } <nl> + ISteamFriends * SteamFriends ( ) { return m_pSteamFriends ; } <nl> + ISteamUtils * SteamUtils ( ) { return m_pSteamUtils ; } <nl> + ISteamMatchmaking * SteamMatchmaking ( ) { return m_pSteamMatchmaking ; } <nl> + ISteamUserStats * SteamUserStats ( ) { return m_pSteamUserStats ; } <nl> + ISteamApps * SteamApps ( ) { return m_pSteamApps ; } <nl> + ISteamMatchmakingServers * SteamMatchmakingServers ( ) { return m_pSteamMatchmakingServers ; } <nl> + ISteamNetworking * SteamNetworking ( ) { return m_pSteamNetworking ; } <nl> + ISteamRemoteStorage * SteamRemoteStorage ( ) { return m_pSteamRemoteStorage ; } <nl> + <nl> + private : <nl> + ISteamUser * m_pSteamUser ; <nl> + ISteamFriends * m_pSteamFriends ; <nl> + ISteamUtils * m_pSteamUtils ; <nl> + ISteamMatchmaking * m_pSteamMatchmaking ; <nl> + ISteamUserStats * m_pSteamUserStats ; <nl> + ISteamApps * m_pSteamApps ; <nl> + ISteamMatchmakingServers * m_pSteamMatchmakingServers ; <nl> + ISteamNetworking * m_pSteamNetworking ; <nl> + ISteamRemoteStorage * m_pSteamRemoteStorage ; <nl> + } ; <nl> + <nl> + inline CSteamAPIContext : : CSteamAPIContext ( ) <nl> + { <nl> + Clear ( ) ; <nl> + } <nl> + <nl> + inline void CSteamAPIContext : : Clear ( ) <nl> + { <nl> + m_pSteamUser = NULL ; <nl> + m_pSteamFriends = NULL ; <nl> + m_pSteamUtils = NULL ; <nl> + m_pSteamMatchmaking = NULL ; <nl> + m_pSteamUserStats = NULL ; <nl> + m_pSteamApps = NULL ; <nl> + m_pSteamMatchmakingServers = NULL ; <nl> + m_pSteamNetworking = NULL ; <nl> + m_pSteamRemoteStorage = NULL ; <nl> + } <nl> + <nl> + / / This function must be inlined so the module using steam_api . dll gets the version names they want . <nl> + inline bool CSteamAPIContext : : Init ( ) <nl> + { <nl> + if ( ! SteamClient ( ) ) <nl> + return false ; <nl> + <nl> + HSteamUser hSteamUser = SteamAPI_GetHSteamUser ( ) ; <nl> + HSteamPipe hSteamPipe = SteamAPI_GetHSteamPipe ( ) ; <nl> + <nl> + m_pSteamUser = SteamClient ( ) - > GetISteamUser ( hSteamUser , hSteamPipe , STEAMUSER_INTERFACE_VERSION ) ; <nl> + if ( ! m_pSteamUser ) <nl> + return false ; <nl> + <nl> + m_pSteamFriends = SteamClient ( ) - > GetISteamFriends ( hSteamUser , hSteamPipe , STEAMFRIENDS_INTERFACE_VERSION ) ; <nl> + if ( ! m_pSteamFriends ) <nl> + return false ; <nl> + <nl> + m_pSteamUtils = SteamClient ( ) - > GetISteamUtils ( hSteamPipe , STEAMUTILS_INTERFACE_VERSION ) ; <nl> + if ( ! m_pSteamUtils ) <nl> + return false ; <nl> + <nl> + m_pSteamMatchmaking = SteamClient ( ) - > GetISteamMatchmaking ( hSteamUser , hSteamPipe , STEAMMATCHMAKING_INTERFACE_VERSION ) ; <nl> + if ( ! m_pSteamMatchmaking ) <nl> + return false ; <nl> + <nl> + m_pSteamMatchmakingServers = SteamClient ( ) - > GetISteamMatchmakingServers ( hSteamUser , hSteamPipe , STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION ) ; <nl> + if ( ! m_pSteamMatchmakingServers ) <nl> + return false ; <nl> + <nl> + m_pSteamUserStats = SteamClient ( ) - > GetISteamUserStats ( hSteamUser , hSteamPipe , STEAMUSERSTATS_INTERFACE_VERSION ) ; <nl> + if ( ! m_pSteamUserStats ) <nl> + return false ; <nl> + <nl> + m_pSteamApps = SteamClient ( ) - > GetISteamApps ( hSteamUser , hSteamPipe , STEAMAPPS_INTERFACE_VERSION ) ; <nl> + if ( ! m_pSteamApps ) <nl> + return false ; <nl> + <nl> + m_pSteamNetworking = SteamClient ( ) - > GetISteamNetworking ( hSteamUser , hSteamPipe , STEAMNETWORKING_INTERFACE_VERSION ) ; <nl> + if ( ! m_pSteamNetworking ) <nl> + return false ; <nl> + <nl> + m_pSteamRemoteStorage = SteamClient ( ) - > GetISteamRemoteStorage ( hSteamUser , hSteamPipe , STEAMREMOTESTORAGE_INTERFACE_VERSION ) ; <nl> + if ( ! m_pSteamRemoteStorage ) <nl> + return false ; <nl> + <nl> + return true ; <nl> + } <nl> + <nl> + # endif / / VERSION_SAFE_STEAM_API_INTERFACES <nl> + <nl> + # endif / / STEAM_API_H <nl> new file mode 100644 <nl> index 00000000 . . 98dfc6c3 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / steam_gameserver . h <nl> <nl> + / / = = = = = = Copyright © 1996 - 2008 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef STEAM_GAMESERVER_H <nl> + # define STEAM_GAMESERVER_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + # include " steam_api . h " <nl> + # include " isteamgameserver . h " <nl> + # include " isteammasterserverupdater . h " <nl> + # include " isteamgameserverstats . h " <nl> + <nl> + enum EServerMode <nl> + { <nl> + eServerModeInvalid = 0 , / / DO NOT USE <nl> + eServerModeNoAuthentication = 1 , / / Don ' t authenticate user logins and don ' t list on the server list <nl> + eServerModeAuthentication = 2 , / / Authenticate users , list on the server list , don ' t run VAC on clients that connect <nl> + eServerModeAuthenticationAndSecure = 3 , / / Authenticate users , list on the server list and VAC protect clients <nl> + } ; <nl> + <nl> + / / Note : if you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE for usQueryPort , then it will use " GameSocketShare " mode , <nl> + / / which means that the game is responsible for sending and receiving UDP packets for the master <nl> + / / server updater . See references to GameSocketShare in isteammasterserverupdater . h . <nl> + / / <nl> + / / Pass 0 for usGamePort or usSpectatorPort if you ' re not using that . Then , the master server updater will report <nl> + / / what ' s running based on that . <nl> + # ifndef _PS3 <nl> + <nl> + # ifdef VERSION_SAFE_STEAM_API_INTERFACES <nl> + S_API bool SteamGameServer_InitSafe ( uint32 unIP , uint16 usPort , uint16 usGamePort , uint16 usSpectatorPort , uint16 usQueryPort , EServerMode eServerMode , const char * pchGameDir , const char * pchVersionString ) ; <nl> + # else <nl> + S_API bool SteamGameServer_Init ( uint32 unIP , uint16 usPort , uint16 usGamePort , uint16 usSpectatorPort , uint16 usQueryPort , EServerMode eServerMode , const char * pchGameDir , const char * pchVersionString ) ; <nl> + # endif <nl> + <nl> + # else <nl> + <nl> + # ifdef VERSION_SAFE_STEAM_API_INTERFACES <nl> + S_API bool SteamGameServer_InitSafe ( const SteamPS3Params_t * ps3Params , uint32 unIP , uint16 usPort , uint16 usGamePort , uint16 usSpectatorPort , uint16 usQueryPort , EServerMode eServerMode , const char * pchGameDir , const char * pchVersionString ) ; <nl> + # else <nl> + S_API bool SteamGameServer_Init ( const SteamPS3Params_t * ps3Params , uint32 unIP , uint16 usPort , uint16 usGamePort , uint16 usSpectatorPort , uint16 usQueryPort , EServerMode eServerMode , const char * pchGameDir , const char * pchVersionString ) ; <nl> + # endif <nl> + <nl> + # endif <nl> + <nl> + # ifndef VERSION_SAFE_STEAM_API_INTERFACES <nl> + S_API ISteamGameServer * SteamGameServer ( ) ; <nl> + S_API ISteamUtils * SteamGameServerUtils ( ) ; <nl> + S_API ISteamMasterServerUpdater * SteamMasterServerUpdater ( ) ; <nl> + S_API ISteamNetworking * SteamGameServerNetworking ( ) ; <nl> + S_API ISteamGameServerStats * SteamGameServerStats ( ) ; <nl> + # endif <nl> + <nl> + S_API void SteamGameServer_Shutdown ( ) ; <nl> + S_API void SteamGameServer_RunCallbacks ( ) ; <nl> + <nl> + S_API bool SteamGameServer_BSecure ( ) ; <nl> + S_API uint64 SteamGameServer_GetSteamID ( ) ; <nl> + <nl> + # define STEAM_GAMESERVER_CALLBACK ( thisclass , func , param , var ) CCallback < thisclass , param , true > var ; void func ( param * pParam ) <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - / / <nl> + / / steamclient . dll private wrapper functions <nl> + / / <nl> + / / The following functions are part of abstracting API access to the steamclient . dll , but should only be used in very specific cases <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - / / <nl> + S_API HSteamPipe SteamGameServer_GetHSteamPipe ( ) ; <nl> + <nl> + # ifdef VERSION_SAFE_STEAM_API_INTERFACES <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - / / <nl> + / / VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that <nl> + / / lets them each specify the interface versions they are compiled with . <nl> + / / <nl> + / / It ' s important that these stay inlined in the header so the calling module specifies the interface versions <nl> + / / for whatever Steam API version it has . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - / / <nl> + <nl> + S_API HSteamUser SteamGameServer_GetHSteamUser ( ) ; <nl> + <nl> + class CSteamGameServerAPIContext <nl> + { <nl> + public : <nl> + CSteamGameServerAPIContext ( ) ; <nl> + void Clear ( ) ; <nl> + <nl> + bool Init ( ) ; <nl> + <nl> + ISteamGameServer * SteamGameServer ( ) { return m_pSteamGameServer ; } <nl> + ISteamUtils * SteamGameServerUtils ( ) { return m_pSteamGameServerUtils ; } <nl> + ISteamMasterServerUpdater * SteamMasterServerUpdater ( ) { return m_pSteamMasterServerUpdater ; } <nl> + ISteamNetworking * SteamGameServerNetworking ( ) { return m_pSteamGameServerNetworking ; } <nl> + ISteamGameServerStats * SteamGameServerStats ( ) { return m_pSteamGameServerStats ; } <nl> + <nl> + private : <nl> + ISteamGameServer * m_pSteamGameServer ; <nl> + ISteamUtils * m_pSteamGameServerUtils ; <nl> + ISteamMasterServerUpdater * m_pSteamMasterServerUpdater ; <nl> + ISteamNetworking * m_pSteamGameServerNetworking ; <nl> + ISteamGameServerStats * m_pSteamGameServerStats ; <nl> + } ; <nl> + <nl> + inline CSteamGameServerAPIContext : : CSteamGameServerAPIContext ( ) <nl> + { <nl> + Clear ( ) ; <nl> + } <nl> + <nl> + inline void CSteamGameServerAPIContext : : Clear ( ) <nl> + { <nl> + m_pSteamGameServer = NULL ; <nl> + m_pSteamGameServerUtils = NULL ; <nl> + m_pSteamMasterServerUpdater = NULL ; <nl> + m_pSteamGameServerNetworking = NULL ; <nl> + m_pSteamGameServerStats = NULL ; <nl> + } <nl> + <nl> + S_API ISteamClient * g_pSteamClientGameServer ; <nl> + / / This function must be inlined so the module using steam_api . dll gets the version names they want . <nl> + inline bool CSteamGameServerAPIContext : : Init ( ) <nl> + { <nl> + if ( ! g_pSteamClientGameServer ) <nl> + return false ; <nl> + <nl> + HSteamUser hSteamUser = SteamGameServer_GetHSteamUser ( ) ; <nl> + HSteamPipe hSteamPipe = SteamGameServer_GetHSteamPipe ( ) ; <nl> + <nl> + m_pSteamGameServer = g_pSteamClientGameServer - > GetISteamGameServer ( hSteamUser , hSteamPipe , STEAMGAMESERVER_INTERFACE_VERSION ) ; <nl> + if ( ! m_pSteamGameServer ) <nl> + return false ; <nl> + <nl> + m_pSteamGameServerUtils = g_pSteamClientGameServer - > GetISteamUtils ( hSteamPipe , STEAMUTILS_INTERFACE_VERSION ) ; <nl> + if ( ! m_pSteamGameServerUtils ) <nl> + return false ; <nl> + <nl> + m_pSteamMasterServerUpdater = g_pSteamClientGameServer - > GetISteamMasterServerUpdater ( hSteamUser , hSteamPipe , STEAMMASTERSERVERUPDATER_INTERFACE_VERSION ) ; <nl> + if ( ! m_pSteamMasterServerUpdater ) <nl> + return false ; <nl> + <nl> + m_pSteamGameServerNetworking = g_pSteamClientGameServer - > GetISteamNetworking ( hSteamUser , hSteamPipe , STEAMNETWORKING_INTERFACE_VERSION ) ; <nl> + if ( ! m_pSteamGameServerNetworking ) <nl> + return false ; <nl> + <nl> + m_pSteamGameServerStats = g_pSteamClientGameServer - > GetISteamGameServerStats ( hSteamUser , hSteamPipe , STEAMGAMESERVERSTATS_INTERFACE_VERSION ) ; <nl> + if ( ! m_pSteamGameServerStats ) <nl> + return false ; <nl> + <nl> + return true ; <nl> + } <nl> + <nl> + # endif / / VERSION_SAFE_STEAM_API_INTERFACES <nl> + <nl> + <nl> + # endif / / STEAM_GAMESERVER_H <nl> new file mode 100644 <nl> index 00000000 . . 852a7596 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / steamclientpublic . h <nl> <nl> + / / = = = = = = = = = Copyright ï ¿ ½ 1996 - 2008 , Valve LLC , All rights reserved . = = = = = = = = = = = = <nl> + / / <nl> + / / Purpose : <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef STEAMCLIENTPUBLIC_H <nl> + # define STEAMCLIENTPUBLIC_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + / / lint - save - e1931 - e1927 - e1924 - e613 - e726 <nl> + <nl> + / / This header file defines the interface between the calling application and the code that <nl> + / / knows how to communicate with the connection manager ( CM ) from the Steam service <nl> + <nl> + / / This header file is intended to be portable ; ideally this 1 header file plus a lib or dll <nl> + / / is all you need to integrate the client library into some other tree . So please avoid <nl> + / / including or requiring other header files if possible . This header should only describe the <nl> + / / interface layer , no need to include anything about the implementation . <nl> + <nl> + # include " steamtypes . h " <nl> + <nl> + <nl> + / / General result codes <nl> + enum EResult <nl> + { <nl> + k_EResultOK = 1 , / / success <nl> + k_EResultFail = 2 , / / generic failure <nl> + k_EResultNoConnection = 3 , / / no / failed network connection <nl> + / / k_EResultNoConnectionRetry = 4 , / / OBSOLETE - removed <nl> + k_EResultInvalidPassword = 5 , / / password / ticket is invalid <nl> + k_EResultLoggedInElsewhere = 6 , / / same user logged in elsewhere <nl> + k_EResultInvalidProtocolVer = 7 , / / protocol version is incorrect <nl> + k_EResultInvalidParam = 8 , / / a parameter is incorrect <nl> + k_EResultFileNotFound = 9 , / / file was not found <nl> + k_EResultBusy = 10 , / / called method busy - action not taken <nl> + k_EResultInvalidState = 11 , / / called object was in an invalid state <nl> + k_EResultInvalidName = 12 , / / name is invalid <nl> + k_EResultInvalidEmail = 13 , / / email is invalid <nl> + k_EResultDuplicateName = 14 , / / name is not unique <nl> + k_EResultAccessDenied = 15 , / / access is denied <nl> + k_EResultTimeout = 16 , / / operation timed out <nl> + k_EResultBanned = 17 , / / VAC2 banned <nl> + k_EResultAccountNotFound = 18 , / / account not found <nl> + k_EResultInvalidSteamID = 19 , / / steamID is invalid <nl> + k_EResultServiceUnavailable = 20 , / / The requested service is currently unavailable <nl> + k_EResultNotLoggedOn = 21 , / / The user is not logged on <nl> + k_EResultPending = 22 , / / Request is pending ( may be in process , or waiting on third party ) <nl> + k_EResultEncryptionFailure = 23 , / / Encryption or Decryption failed <nl> + k_EResultInsufficientPrivilege = 24 , / / Insufficient privilege <nl> + k_EResultLimitExceeded = 25 , / / Too much of a good thing <nl> + k_EResultRevoked = 26 , / / Access has been revoked ( used for revoked guest passes ) <nl> + k_EResultExpired = 27 , / / License / Guest pass the user is trying to access is expired <nl> + k_EResultAlreadyRedeemed = 28 , / / Guest pass has already been redeemed by account , cannot be acked again <nl> + k_EResultDuplicateRequest = 29 , / / The request is a duplicate and the action has already occurred in the past , ignored this time <nl> + k_EResultAlreadyOwned = 30 , / / All the games in this guest pass redemption request are already owned by the user <nl> + k_EResultIPNotFound = 31 , / / IP address not found <nl> + k_EResultPersistFailed = 32 , / / failed to write change to the data store <nl> + k_EResultLockingFailed = 33 , / / failed to acquire access lock for this operation <nl> + k_EResultLogonSessionReplaced = 34 , <nl> + k_EResultConnectFailed = 35 , <nl> + k_EResultHandshakeFailed = 36 , <nl> + k_EResultIOFailure = 37 , <nl> + k_EResultRemoteDisconnect = 38 , <nl> + k_EResultShoppingCartNotFound = 39 , / / failed to find the shopping cart requested <nl> + k_EResultBlocked = 40 , / / a user didn ' t allow it <nl> + k_EResultIgnored = 41 , / / target is ignoring sender <nl> + k_EResultNoMatch = 42 , / / nothing matching the request found <nl> + k_EResultAccountDisabled = 43 , <nl> + k_EResultServiceReadOnly = 44 , / / this service is not accepting content changes right now <nl> + k_EResultAccountNotFeatured = 45 , / / account doesn ' t have value , so this feature isn ' t available <nl> + k_EResultAdministratorOK = 46 , / / allowed to take this action , but only because requester is admin <nl> + k_EResultContentVersion = 47 , / / A Version mismatch in content transmitted within the Steam protocol . <nl> + k_EResultTryAnotherCM = 48 , / / The current CM can ' t service the user making a request , user should try another . <nl> + k_EResultPasswordRequiredToKickSession = 49 , / / You are already logged in elsewhere , this cached credential login has failed . <nl> + k_EResultAlreadyLoggedInElsewhere = 50 , / / You are already logged in elsewhere , you must wait <nl> + k_EResultSuspended = 51 , / / Long running operation ( content download ) suspended / paused <nl> + k_EResultCancelled = 52 , / / Operation canceled ( typically by user : content download ) <nl> + k_EResultDataCorruption = 53 , / / Operation canceled because data is ill formed or unrecoverable <nl> + k_EResultDiskFull = 54 , / / Operation canceled - not enough disk space . <nl> + k_EResultRemoteCallFailed = 55 , / / an remote call or IPC call failed <nl> + k_EResultPasswordUnset = 56 , / / Password could not be verified as it ' s unset server side <nl> + k_EResultPSNAccountUnlinked = 57 , / / Attempt to logon from a PS3 failed because the PSN online id is not linked to a Steam account <nl> + k_EResultPSNTicketInvalid = 58 , / / PSN ticket was invalid <nl> + k_EResultPSNAccountAlreadyLinked = 59 , / / PSN account is already linked to some other account , must explicitly request to replace / delete the link first <nl> + k_EResultRemoteFileConflict = 60 , / / The sync cannot resume due to a conflict between the local and remote files <nl> + } ; <nl> + <nl> + / / Error codes for use with the voice functions <nl> + enum EVoiceResult <nl> + { <nl> + k_EVoiceResultOK = 0 , <nl> + k_EVoiceResultNotInitialized = 1 , <nl> + k_EVoiceResultNotRecording = 2 , <nl> + k_EVoiceResultNoData = 3 , <nl> + k_EVoiceResultBufferTooSmall = 4 , <nl> + k_EVoiceResultDataCorrupted = 5 , <nl> + k_EVoiceResultRestricted = 6 , <nl> + <nl> + } ; <nl> + <nl> + / / Result codes to GSHandleClientDeny / Kick <nl> + typedef enum <nl> + { <nl> + k_EDenyInvalid = 0 , <nl> + k_EDenyInvalidVersion = 1 , <nl> + k_EDenyGeneric = 2 , <nl> + k_EDenyNotLoggedOn = 3 , <nl> + k_EDenyNoLicense = 4 , <nl> + k_EDenyCheater = 5 , <nl> + k_EDenyLoggedInElseWhere = 6 , <nl> + k_EDenyUnknownText = 7 , <nl> + k_EDenyIncompatibleAnticheat = 8 , <nl> + k_EDenyMemoryCorruption = 9 , <nl> + k_EDenyIncompatibleSoftware = 10 , <nl> + k_EDenySteamConnectionLost = 11 , <nl> + k_EDenySteamConnectionError = 12 , <nl> + k_EDenySteamResponseTimedOut = 13 , <nl> + k_EDenySteamValidationStalled = 14 , <nl> + k_EDenySteamOwnerLeftGuestUser = 15 , <nl> + } EDenyReason ; <nl> + <nl> + / / return type of GetAuthSessionTicket <nl> + typedef uint32 HAuthTicket ; <nl> + const HAuthTicket k_HAuthTicketInvalid = 0 ; <nl> + <nl> + / / results from BeginAuthSession <nl> + typedef enum <nl> + { <nl> + k_EBeginAuthSessionResultOK = 0 , / / Ticket is valid for this game and this steamID . <nl> + k_EBeginAuthSessionResultInvalidTicket = 1 , / / Ticket is not valid . <nl> + k_EBeginAuthSessionResultDuplicateRequest = 2 , / / A ticket has already been submitted for this steamID <nl> + k_EBeginAuthSessionResultInvalidVersion = 3 , / / Ticket is from an incompatible interface version <nl> + k_EBeginAuthSessionResultGameMismatch = 4 , / / Ticket is not for this game <nl> + k_EBeginAuthSessionResultExpiredTicket = 5 , / / Ticket has expired <nl> + } EBeginAuthSessionResult ; <nl> + <nl> + / / Callback values for callback ValidateAuthTicketResponse_t which is a response to BeginAuthSession <nl> + typedef enum <nl> + { <nl> + k_EAuthSessionResponseOK = 0 , / / Steam has verified the user is online , the ticket is valid and ticket has not been reused . <nl> + k_EAuthSessionResponseUserNotConnectedToSteam = 1 , / / The user in question is not connected to steam <nl> + k_EAuthSessionResponseNoLicenseOrExpired = 2 , / / The license has expired . <nl> + k_EAuthSessionResponseVACBanned = 3 , / / The user is VAC banned for this game . <nl> + k_EAuthSessionResponseLoggedInElseWhere = 4 , / / The user account has logged in elsewhere and the session containing the game instance has been disconnected . <nl> + k_EAuthSessionResponseVACCheckTimedOut = 5 , / / VAC has been unable to perform anti - cheat checks on this user <nl> + k_EAuthSessionResponseAuthTicketCanceled = 6 , / / The ticket has been canceled by the issuer <nl> + k_EAuthSessionResponseAuthTicketInvalidAlreadyUsed = 7 , / / This ticket has already been used , it is not valid . <nl> + k_EAuthSessionResponseAuthTicketInvalid = 8 , / / This ticket is not from a user instance currently connected to steam . <nl> + } EAuthSessionResponse ; <nl> + <nl> + / / results from UserHasLicenseForApp <nl> + typedef enum <nl> + { <nl> + k_EUserHasLicenseResultHasLicense = 0 , / / User has a license for specified app <nl> + k_EUserHasLicenseResultDoesNotHaveLicense = 1 , / / User does not have a license for the specified app <nl> + k_EUserHasLicenseResultNoAuth = 2 , / / User has not been authenticated <nl> + } EUserHasLicenseForAppResult ; <nl> + <nl> + <nl> + / / Steam universes . Each universe is a self - contained Steam instance . <nl> + enum EUniverse <nl> + { <nl> + k_EUniverseInvalid = 0 , <nl> + k_EUniversePublic = 1 , <nl> + k_EUniverseBeta = 2 , <nl> + k_EUniverseInternal = 3 , <nl> + k_EUniverseDev = 4 , <nl> + k_EUniverseRC = 5 , <nl> + k_EUniverseMax <nl> + } ; <nl> + <nl> + / / Steam account types <nl> + enum EAccountType <nl> + { <nl> + k_EAccountTypeInvalid = 0 , <nl> + k_EAccountTypeIndividual = 1 , / / single user account <nl> + k_EAccountTypeMultiseat = 2 , / / multiseat ( e . g . cybercafe ) account <nl> + k_EAccountTypeGameServer = 3 , / / game server account <nl> + k_EAccountTypeAnonGameServer = 4 , / / anonymous game server account <nl> + k_EAccountTypePending = 5 , / / pending <nl> + k_EAccountTypeContentServer = 6 , / / content server <nl> + k_EAccountTypeClan = 7 , <nl> + k_EAccountTypeChat = 8 , <nl> + / / k_EAccountTypeP2PSuperSeeder = 9 , / / unused <nl> + k_EAccountTypeAnonUser = 10 , <nl> + <nl> + / / Max of 16 items in this field <nl> + k_EAccountTypeMax <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / types of user game stats fields <nl> + / / WARNING : DO NOT RENUMBER EXISTING VALUES - STORED IN DATABASE <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + enum ESteamUserStatType <nl> + { <nl> + k_ESteamUserStatTypeINVALID = 0 , <nl> + k_ESteamUserStatTypeINT = 1 , <nl> + k_ESteamUserStatTypeFLOAT = 2 , <nl> + / / Read as FLOAT , set with count / session length <nl> + k_ESteamUserStatTypeAVGRATE = 3 , <nl> + k_ESteamUserStatTypeACHIEVEMENTS = 4 , <nl> + k_ESteamUserStatTypeGROUPACHIEVEMENTS = 5 , <nl> + <nl> + / / max , for sanity checks <nl> + k_ESteamUserStatTypeMAX <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Chat Entry Types ( previously was only friend - to - friend message types ) <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + enum EChatEntryType <nl> + { <nl> + k_EChatEntryTypeInvalid = 0 , <nl> + k_EChatEntryTypeChatMsg = 1 , / / Normal text message from another user <nl> + k_EChatEntryTypeTyping = 2 , / / Another user is typing ( not used in multi - user chat ) <nl> + k_EChatEntryTypeInviteGame = 3 , / / Invite from other user into that users current game <nl> + k_EChatEntryTypeEmote = 4 , / / text emote message <nl> + k_EChatEntryTypeLobbyGameStart = 5 , / / lobby game is starting <nl> + k_EChatEntryTypeLeftConversation = 6 , / / user has left the conversation ( closed chat window ) <nl> + / / Above are previous FriendMsgType entries , now merged into more generic chat entry types <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Chat Room Enter Responses <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + enum EChatRoomEnterResponse <nl> + { <nl> + k_EChatRoomEnterResponseSuccess = 1 , / / Success <nl> + k_EChatRoomEnterResponseDoesntExist = 2 , / / Chat doesn ' t exist ( probably closed ) <nl> + k_EChatRoomEnterResponseNotAllowed = 3 , / / General Denied - You don ' t have the permissions needed to join the chat <nl> + k_EChatRoomEnterResponseFull = 4 , / / Chat room has reached its maximum size <nl> + k_EChatRoomEnterResponseError = 5 , / / Unexpected Error <nl> + k_EChatRoomEnterResponseBanned = 6 , / / You are banned from this chat room and may not join <nl> + k_EChatRoomEnterResponseLimited = 7 , / / Joining this chat is not allowed because you are a limited user ( no value on account ) <nl> + k_EChatRoomEnterResponseClanDisabled = 8 , / / Attempt to join a clan chat when the clan is locked or disabled <nl> + k_EChatRoomEnterResponseCommunityBan = 9 , / / Attempt to join a chat when the user has a community lock on their account <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Status of a given depot version , these are stored in the DB , don ' t renumber <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + enum EStatusDepotVersion <nl> + { <nl> + k_EStatusDepotVersionInvalid = 0 , <nl> + k_EStatusDepotVersionDisabled = 1 , / / version was disabled , no manifest & content available <nl> + k_EStatusDepotVersionAvailable = 2 , / / manifest & content is available , but not current <nl> + k_EStatusDepotVersionCurrent = 3 , / / current depot version . The can be multiple , one for public and one for each beta key <nl> + } ; <nl> + <nl> + <nl> + typedef void ( * PFNLegacyKeyRegistration ) ( const char * pchCDKey , const char * pchInstallPath ) ; <nl> + typedef bool ( * PFNLegacyKeyInstalled ) ( ) ; <nl> + <nl> + const int k_unSteamAccountIDMask = 0xFFFFFFFF ; <nl> + const int k_unSteamAccountInstanceMask = 0x000FFFFF ; <nl> + <nl> + / / Special flags for Chat accounts - they go in the top 8 bits <nl> + / / of the steam ID ' s " instance " , leaving 12 for the actual instances <nl> + enum EChatSteamIDInstanceFlags <nl> + { <nl> + k_EChatAccountInstanceMask = 0x00000FFF , / / top 8 bits are flags <nl> + <nl> + k_EChatInstanceFlagClan = ( k_unSteamAccountInstanceMask + 1 ) > > 1 , / / top bit <nl> + k_EChatInstanceFlagLobby = ( k_unSteamAccountInstanceMask + 1 ) > > 2 , / / next one down , etc <nl> + k_EChatInstanceFlagMMSLobby = ( k_unSteamAccountInstanceMask + 1 ) > > 3 , / / next one down , etc <nl> + <nl> + / / Max of 8 flags <nl> + } ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Marketing message flags that change how a client should handle them <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + enum EMarketingMessageFlags <nl> + { <nl> + k_EMarketingMessageFlagsNone = 0 , <nl> + k_EMarketingMessageFlagsHighPriority = 1 < < 0 , <nl> + k_EMarketingMessageFlagsPlatformWindows = 1 < < 1 , <nl> + k_EMarketingMessageFlagsPlatformMac = 1 < < 2 , <nl> + <nl> + / / aggregate flags <nl> + k_EMarketingMessageFlagsPlatformRestrictions = <nl> + k_EMarketingMessageFlagsPlatformWindows | k_EMarketingMessageFlagsPlatformMac , <nl> + } ; <nl> + <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Possible positions to tell the overlay to show notifications in <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + enum ENotificationPosition <nl> + { <nl> + k_EPositionTopLeft = 0 , <nl> + k_EPositionTopRight = 1 , <nl> + k_EPositionBottomLeft = 2 , <nl> + k_EPositionBottomRight = 3 , <nl> + } ; <nl> + <nl> + <nl> + # pragma pack ( push , 1 ) <nl> + <nl> + / / Steam ID structure ( 64 bits total ) <nl> + class CSteamID <nl> + { <nl> + public : <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Constructor <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + CSteamID ( ) <nl> + { <nl> + m_steamid . m_comp . m_unAccountID = 0 ; <nl> + m_steamid . m_comp . m_EAccountType = k_EAccountTypeInvalid ; <nl> + m_steamid . m_comp . m_EUniverse = k_EUniverseInvalid ; <nl> + m_steamid . m_comp . m_unAccountInstance = 0 ; <nl> + } <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Constructor <nl> + / / Input : unAccountID - 32 - bit account ID <nl> + / / eUniverse - Universe this account belongs to <nl> + / / eAccountType - Type of account <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + CSteamID ( uint32 unAccountID , EUniverse eUniverse , EAccountType eAccountType ) <nl> + { <nl> + Set ( unAccountID , eUniverse , eAccountType ) ; <nl> + } <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Constructor <nl> + / / Input : unAccountID - 32 - bit account ID <nl> + / / unAccountInstance - instance <nl> + / / eUniverse - Universe this account belongs to <nl> + / / eAccountType - Type of account <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + CSteamID ( uint32 unAccountID , unsigned int unAccountInstance , EUniverse eUniverse , EAccountType eAccountType ) <nl> + { <nl> + # if defined ( _SERVER ) & & defined ( Assert ) <nl> + Assert ( ! ( ( k_EAccountTypeIndividual = = eAccountType ) & & ( 1 ! = unAccountInstance ) ) ) ; / / enforce that for individual accounts , instance is always 1 <nl> + # endif / / _SERVER <nl> + InstancedSet ( unAccountID , unAccountInstance , eUniverse , eAccountType ) ; <nl> + } <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Constructor <nl> + / / Input : ulSteamID - 64 - bit representation of a Steam ID <nl> + / / Note : Will not accept a uint32 or int32 as input , as that is a probable mistake . <nl> + / / See the stubbed out overloads in the private : section for more info . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + CSteamID ( uint64 ulSteamID ) <nl> + { <nl> + SetFromUint64 ( ulSteamID ) ; <nl> + } <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Sets parameters for steam ID <nl> + / / Input : unAccountID - 32 - bit account ID <nl> + / / eUniverse - Universe this account belongs to <nl> + / / eAccountType - Type of account <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + void Set ( uint32 unAccountID , EUniverse eUniverse , EAccountType eAccountType ) <nl> + { <nl> + m_steamid . m_comp . m_unAccountID = unAccountID ; <nl> + m_steamid . m_comp . m_EUniverse = eUniverse ; <nl> + m_steamid . m_comp . m_EAccountType = eAccountType ; <nl> + <nl> + if ( eAccountType = = k_EAccountTypeClan ) <nl> + { <nl> + m_steamid . m_comp . m_unAccountInstance = 0 ; <nl> + } <nl> + else <nl> + { <nl> + m_steamid . m_comp . m_unAccountInstance = 1 ; <nl> + } <nl> + } <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Sets parameters for steam ID <nl> + / / Input : unAccountID - 32 - bit account ID <nl> + / / eUniverse - Universe this account belongs to <nl> + / / eAccountType - Type of account <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + void InstancedSet ( uint32 unAccountID , uint32 unInstance , EUniverse eUniverse , EAccountType eAccountType ) <nl> + { <nl> + m_steamid . m_comp . m_unAccountID = unAccountID ; <nl> + m_steamid . m_comp . m_EUniverse = eUniverse ; <nl> + m_steamid . m_comp . m_EAccountType = eAccountType ; <nl> + m_steamid . m_comp . m_unAccountInstance = unInstance ; <nl> + } <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Initializes a steam ID from its 52 bit parts and universe / type <nl> + / / Input : ulIdentifier - 52 bits of goodness <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + void FullSet ( uint64 ulIdentifier , EUniverse eUniverse , EAccountType eAccountType ) <nl> + { <nl> + m_steamid . m_comp . m_unAccountID = ( ulIdentifier & 0xFFFFFFFF ) ; / / account ID is low 32 bits <nl> + m_steamid . m_comp . m_unAccountInstance = ( ( ulIdentifier > > 32 ) & 0xFFFFF ) ; / / account instance is next 20 bits <nl> + m_steamid . m_comp . m_EUniverse = eUniverse ; <nl> + m_steamid . m_comp . m_EAccountType = eAccountType ; <nl> + } <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Initializes a steam ID from its 64 - bit representation <nl> + / / Input : ulSteamID - 64 - bit representation of a Steam ID <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + void SetFromUint64 ( uint64 ulSteamID ) <nl> + { <nl> + m_steamid . m_unAll64Bits = ulSteamID ; <nl> + } <nl> + <nl> + <nl> + # if defined ( INCLUDED_STEAM_COMMON_STEAMCOMMON_H ) <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Initializes a steam ID from a Steam2 ID structure <nl> + / / Input : pTSteamGlobalUserID - Steam2 ID to convert <nl> + / / eUniverse - universe this ID belongs to <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + void SetFromSteam2 ( TSteamGlobalUserID * pTSteamGlobalUserID , EUniverse eUniverse ) <nl> + { <nl> + m_steamid . m_comp . m_unAccountID = pTSteamGlobalUserID - > m_SteamLocalUserID . Split . Low32bits * 2 + <nl> + pTSteamGlobalUserID - > m_SteamLocalUserID . Split . High32bits ; <nl> + m_steamid . m_comp . m_EUniverse = eUniverse ; / / set the universe <nl> + m_steamid . m_comp . m_EAccountType = k_EAccountTypeIndividual ; / / Steam 2 accounts always map to account type of individual <nl> + m_steamid . m_comp . m_unAccountInstance = 1 ; / / individual accounts always have an account instance ID of 1 <nl> + } <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Fills out a Steam2 ID structure <nl> + / / Input : pTSteamGlobalUserID - Steam2 ID to write to <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + void ConvertToSteam2 ( TSteamGlobalUserID * pTSteamGlobalUserID ) const <nl> + { <nl> + / / only individual accounts have any meaning in Steam 2 , only they can be mapped <nl> + / / Assert ( m_steamid . m_comp . m_EAccountType = = k_EAccountTypeIndividual ) ; <nl> + <nl> + pTSteamGlobalUserID - > m_SteamInstanceID = 0 ; <nl> + pTSteamGlobalUserID - > m_SteamLocalUserID . Split . High32bits = m_steamid . m_comp . m_unAccountID % 2 ; <nl> + pTSteamGlobalUserID - > m_SteamLocalUserID . Split . Low32bits = m_steamid . m_comp . m_unAccountID / 2 ; <nl> + } <nl> + # endif / / defined ( INCLUDED_STEAM_COMMON_STEAMCOMMON_H ) <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Converts steam ID to its 64 - bit representation <nl> + / / Output : 64 - bit representation of a Steam ID <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + uint64 ConvertToUint64 ( ) const <nl> + { <nl> + return m_steamid . m_unAll64Bits ; <nl> + } <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Converts the static parts of a steam ID to a 64 - bit representation . <nl> + / / For multiseat accounts , all instances of that account will have the <nl> + / / same static account key , so they can be grouped together by the static <nl> + / / account key . <nl> + / / Output : 64 - bit static account key <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + uint64 GetStaticAccountKey ( ) const <nl> + { <nl> + / / note we do NOT include the account instance ( which is a dynamic property ) in the static account key <nl> + return ( uint64 ) ( ( ( ( uint64 ) m_steamid . m_comp . m_EUniverse ) < < 56 ) + ( ( uint64 ) m_steamid . m_comp . m_EAccountType < < 52 ) + m_steamid . m_comp . m_unAccountID ) ; <nl> + } <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : create an anonymous game server login to be filled in by the AM <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + void CreateBlankAnonLogon ( EUniverse eUniverse ) <nl> + { <nl> + m_steamid . m_comp . m_unAccountID = 0 ; <nl> + m_steamid . m_comp . m_EAccountType = k_EAccountTypeAnonGameServer ; <nl> + m_steamid . m_comp . m_EUniverse = eUniverse ; <nl> + m_steamid . m_comp . m_unAccountInstance = 0 ; <nl> + } <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : create an anonymous game server login to be filled in by the AM <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + void CreateBlankAnonUserLogon ( EUniverse eUniverse ) <nl> + { <nl> + m_steamid . m_comp . m_unAccountID = 0 ; <nl> + m_steamid . m_comp . m_EAccountType = k_EAccountTypeAnonUser ; <nl> + m_steamid . m_comp . m_EUniverse = eUniverse ; <nl> + m_steamid . m_comp . m_unAccountInstance = 0 ; <nl> + } <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Is this an anonymous game server login that will be filled in ? <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + bool BBlankAnonAccount ( ) const <nl> + { <nl> + return m_steamid . m_comp . m_unAccountID = = 0 & & BAnonAccount ( ) & & m_steamid . m_comp . m_unAccountInstance = = 0 ; <nl> + } <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Is this a game server account id ? <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + bool BGameServerAccount ( ) const <nl> + { <nl> + return m_steamid . m_comp . m_EAccountType = = k_EAccountTypeGameServer | | m_steamid . m_comp . m_EAccountType = = k_EAccountTypeAnonGameServer ; <nl> + } <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Is this a content server account id ? <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + bool BContentServerAccount ( ) const <nl> + { <nl> + return m_steamid . m_comp . m_EAccountType = = k_EAccountTypeContentServer ; <nl> + } <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Is this a clan account id ? <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + bool BClanAccount ( ) const <nl> + { <nl> + return m_steamid . m_comp . m_EAccountType = = k_EAccountTypeClan ; <nl> + } <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Is this a chat account id ? <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + bool BChatAccount ( ) const <nl> + { <nl> + return m_steamid . m_comp . m_EAccountType = = k_EAccountTypeChat ; <nl> + } <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Is this a chat account id ? <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + bool IsLobby ( ) const <nl> + { <nl> + return ( m_steamid . m_comp . m_EAccountType = = k_EAccountTypeChat ) <nl> + & & ( m_steamid . m_comp . m_unAccountInstance & k_EChatInstanceFlagLobby ) ; <nl> + } <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Is this an individual user account id ? <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + bool BIndividualAccount ( ) const <nl> + { <nl> + return m_steamid . m_comp . m_EAccountType = = k_EAccountTypeIndividual ; <nl> + } <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Is this an anonymous account ? <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + bool BAnonAccount ( ) const <nl> + { <nl> + return m_steamid . m_comp . m_EAccountType = = k_EAccountTypeAnonUser | | m_steamid . m_comp . m_EAccountType = = k_EAccountTypeAnonGameServer ; <nl> + } <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Is this an anonymous user account ? ( used to create an account or reset a password ) <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + bool BAnonUserAccount ( ) const <nl> + { <nl> + return m_steamid . m_comp . m_EAccountType = = k_EAccountTypeAnonUser ; <nl> + } <nl> + <nl> + <nl> + / / simple accessors <nl> + void SetAccountID ( uint32 unAccountID ) { m_steamid . m_comp . m_unAccountID = unAccountID ; } <nl> + uint32 GetAccountID ( ) const { return m_steamid . m_comp . m_unAccountID ; } <nl> + uint32 GetUnAccountInstance ( ) const { return m_steamid . m_comp . m_unAccountInstance ; } <nl> + EAccountType GetEAccountType ( ) const { return ( EAccountType ) m_steamid . m_comp . m_EAccountType ; } <nl> + EUniverse GetEUniverse ( ) const { return m_steamid . m_comp . m_EUniverse ; } <nl> + void SetEUniverse ( EUniverse eUniverse ) { m_steamid . m_comp . m_EUniverse = eUniverse ; } <nl> + bool IsValid ( ) const ; <nl> + <nl> + / / this set of functions is hidden , will be moved out of class <nl> + explicit CSteamID ( const char * pchSteamID , EUniverse eDefaultUniverse = k_EUniverseInvalid ) ; <nl> + const char * Render ( ) const ; / / renders this steam ID to string <nl> + static const char * Render ( uint64 ulSteamID ) ; / / static method to render a uint64 representation of a steam ID to a string <nl> + <nl> + void SetFromString ( const char * pchSteamID , EUniverse eDefaultUniverse ) ; <nl> + bool SetFromSteam2String ( const char * pchSteam2ID , EUniverse eUniverse ) ; <nl> + <nl> + inline bool operator = = ( const CSteamID & val ) const { return m_steamid . m_unAll64Bits = = val . m_steamid . m_unAll64Bits ; } <nl> + inline bool operator ! = ( const CSteamID & val ) const { return ! operator = = ( val ) ; } <nl> + inline bool operator < ( const CSteamID & val ) const { return m_steamid . m_unAll64Bits < val . m_steamid . m_unAll64Bits ; } <nl> + inline bool operator > ( const CSteamID & val ) const { return m_steamid . m_unAll64Bits > val . m_steamid . m_unAll64Bits ; } <nl> + <nl> + / / DEBUG function <nl> + bool BValidExternalSteamID ( ) const ; <nl> + <nl> + private : <nl> + / / These are defined here to prevent accidental implicit conversion of a u32AccountID to a CSteamID . <nl> + / / If you get a compiler error about an ambiguous constructor / function then it may be because you ' re <nl> + / / passing a 32 - bit int to a function that takes a CSteamID . You should explicitly create the SteamID <nl> + / / using the correct Universe and account Type / Instance values . <nl> + CSteamID ( uint32 ) ; <nl> + CSteamID ( int32 ) ; <nl> + <nl> + / / 64 bits total <nl> + union SteamID_t <nl> + { <nl> + struct SteamIDComponent_t <nl> + { <nl> + # ifdef VALVE_BIG_ENDIAN <nl> + EUniverse m_EUniverse : 8 ; / / universe this account belongs to <nl> + unsigned int m_EAccountType : 4 ; / / type of account - can ' t show as EAccountType , due to signed / unsigned difference <nl> + unsigned int m_unAccountInstance : 20 ; / / dynamic instance ID ( used for multiseat type accounts only ) <nl> + uint32 m_unAccountID : 32 ; / / unique account identifier <nl> + # else <nl> + uint32 m_unAccountID : 32 ; / / unique account identifier <nl> + unsigned int m_unAccountInstance : 20 ; / / dynamic instance ID ( used for multiseat type accounts only ) <nl> + unsigned int m_EAccountType : 4 ; / / type of account - can ' t show as EAccountType , due to signed / unsigned difference <nl> + EUniverse m_EUniverse : 8 ; / / universe this account belongs to <nl> + # endif <nl> + } m_comp ; <nl> + <nl> + uint64 m_unAll64Bits ; <nl> + } m_steamid ; <nl> + } ; <nl> + <nl> + inline bool CSteamID : : IsValid ( ) const <nl> + { <nl> + if ( m_steamid . m_comp . m_EAccountType < = k_EAccountTypeInvalid | | m_steamid . m_comp . m_EAccountType > = k_EAccountTypeMax ) <nl> + return false ; <nl> + <nl> + if ( m_steamid . m_comp . m_EUniverse < = k_EUniverseInvalid | | m_steamid . m_comp . m_EUniverse > = k_EUniverseMax ) <nl> + return false ; <nl> + <nl> + if ( m_steamid . m_comp . m_EAccountType = = k_EAccountTypeIndividual ) <nl> + { <nl> + if ( m_steamid . m_comp . m_unAccountID = = 0 | | m_steamid . m_comp . m_unAccountInstance ! = 1 ) <nl> + return false ; <nl> + } <nl> + <nl> + if ( m_steamid . m_comp . m_EAccountType = = k_EAccountTypeClan ) <nl> + { <nl> + if ( m_steamid . m_comp . m_unAccountID = = 0 | | m_steamid . m_comp . m_unAccountInstance ! = 0 ) <nl> + return false ; <nl> + } <nl> + return true ; <nl> + } <nl> + <nl> + / / generic invalid CSteamID <nl> + # define k_steamIDNil CSteamID ( ) <nl> + <nl> + / / This steamID comes from a user game connection to an out of date GS that hasnt implemented the protocol <nl> + / / to provide its steamID <nl> + # define k_steamIDOutofDateGS CSteamID ( 0 , 0 , k_EUniverseInvalid , k_EAccountTypeInvalid ) <nl> + / / This steamID comes from a user game connection to an sv_lan GS <nl> + # define k_steamIDLanModeGS CSteamID ( 0 , 0 , k_EUniversePublic , k_EAccountTypeInvalid ) <nl> + / / This steamID can come from a user game connection to a GS that has just booted but hasnt yet even initialized <nl> + / / its steam3 component and started logging on . <nl> + # define k_steamIDNotInitYetGS CSteamID ( 1 , 0 , k_EUniverseInvalid , k_EAccountTypeInvalid ) <nl> + / / This steamID can come from a user game connection to a GS that isn ' t using the steam authentication system but still <nl> + / / wants to support the " Join Game " option in the friends list <nl> + # define k_steamIDNonSteamGS CSteamID ( 2 , 0 , k_EUniverseInvalid , k_EAccountTypeInvalid ) <nl> + <nl> + <nl> + # ifdef STEAM <nl> + / / Returns the matching chat steamID , with the default instance of 0 <nl> + / / If the steamID passed in is already of type k_EAccountTypeChat it will be returned with the same instance <nl> + CSteamID ChatIDFromSteamID ( const CSteamID & steamID ) ; <nl> + / / Returns the matching clan steamID , with the default instance of 0 <nl> + / / If the steamID passed in is already of type k_EAccountTypeClan it will be returned with the same instance <nl> + CSteamID ClanIDFromSteamID ( const CSteamID & steamID ) ; <nl> + / / Asserts steamID type before conversion <nl> + CSteamID ChatIDFromClanID ( const CSteamID & steamIDClan ) ; <nl> + / / Asserts steamID type before conversion <nl> + CSteamID ClanIDFromChatID ( const CSteamID & steamIDChat ) ; <nl> + <nl> + # endif / / _STEAM <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : encapsulates an appID / modID pair <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + class CGameID <nl> + { <nl> + public : <nl> + <nl> + CGameID ( ) <nl> + { <nl> + m_gameID . m_nType = k_EGameIDTypeApp ; <nl> + m_gameID . m_nAppID = k_uAppIdInvalid ; <nl> + m_gameID . m_nModID = 0 ; <nl> + } <nl> + <nl> + explicit CGameID ( uint64 ulGameID ) <nl> + { <nl> + m_ulGameID = ulGameID ; <nl> + } <nl> + <nl> + explicit CGameID ( int32 nAppID ) <nl> + { <nl> + m_ulGameID = 0 ; <nl> + m_gameID . m_nAppID = nAppID ; <nl> + } <nl> + <nl> + explicit CGameID ( uint32 nAppID ) <nl> + { <nl> + m_ulGameID = 0 ; <nl> + m_gameID . m_nAppID = nAppID ; <nl> + } <nl> + <nl> + CGameID ( uint32 nAppID , uint32 nModID ) <nl> + { <nl> + m_ulGameID = 0 ; <nl> + m_gameID . m_nAppID = nAppID ; <nl> + m_gameID . m_nModID = nModID ; <nl> + m_gameID . m_nType = k_EGameIDTypeGameMod ; <nl> + } <nl> + <nl> + / / Hidden functions used only by Steam <nl> + explicit CGameID ( const char * pchGameID ) ; <nl> + const char * Render ( ) const ; / / render this Game ID to string <nl> + static const char * Render ( uint64 ulGameID ) ; / / static method to render a uint64 representation of a Game ID to a string <nl> + <nl> + / / must include checksum_crc . h first to get this functionality <nl> + # if defined ( CHECKSUM_CRC_H ) <nl> + CGameID ( uint32 nAppID , const char * pchModPath ) <nl> + { <nl> + m_ulGameID = 0 ; <nl> + m_gameID . m_nAppID = nAppID ; <nl> + m_gameID . m_nType = k_EGameIDTypeGameMod ; <nl> + <nl> + char rgchModDir [ MAX_PATH ] ; <nl> + Q_FileBase ( pchModPath , rgchModDir , sizeof ( rgchModDir ) ) ; <nl> + CRC32_t crc32 ; <nl> + CRC32_Init ( & crc32 ) ; <nl> + CRC32_ProcessBuffer ( & crc32 , rgchModDir , Q_strlen ( rgchModDir ) ) ; <nl> + CRC32_Final ( & crc32 ) ; <nl> + <nl> + / / set the high - bit on the mod - id <nl> + / / reduces crc32 to 31bits , but lets us use the modID as a guaranteed unique <nl> + / / replacement for appID ' s <nl> + m_gameID . m_nModID = crc32 | ( 0x80000000 ) ; <nl> + } <nl> + <nl> + CGameID ( const char * pchExePath , const char * pchAppName ) <nl> + { <nl> + m_ulGameID = 0 ; <nl> + m_gameID . m_nAppID = k_uAppIdInvalid ; <nl> + m_gameID . m_nType = k_EGameIDTypeShortcut ; <nl> + <nl> + CRC32_t crc32 ; <nl> + CRC32_Init ( & crc32 ) ; <nl> + CRC32_ProcessBuffer ( & crc32 , pchExePath , Q_strlen ( pchExePath ) ) ; <nl> + CRC32_ProcessBuffer ( & crc32 , pchAppName , Q_strlen ( pchAppName ) ) ; <nl> + CRC32_Final ( & crc32 ) ; <nl> + <nl> + / / set the high - bit on the mod - id <nl> + / / reduces crc32 to 31bits , but lets us use the modID as a guaranteed unique <nl> + / / replacement for appID ' s <nl> + m_gameID . m_nModID = crc32 | ( 0x80000000 ) ; <nl> + } <nl> + <nl> + # if defined ( VSTFILEID_H ) <nl> + <nl> + CGameID ( VstFileID vstFileID ) <nl> + { <nl> + m_ulGameID = 0 ; <nl> + m_gameID . m_nAppID = k_uAppIdInvalid ; <nl> + m_gameID . m_nType = k_EGameIDTypeP2P ; <nl> + <nl> + CRC32_t crc32 ; <nl> + CRC32_Init ( & crc32 ) ; <nl> + const char * pchFileId = vstFileID . Render ( ) ; <nl> + CRC32_ProcessBuffer ( & crc32 , pchFileId , Q_strlen ( pchFileId ) ) ; <nl> + CRC32_Final ( & crc32 ) ; <nl> + <nl> + / / set the high - bit on the mod - id <nl> + / / reduces crc32 to 31bits , but lets us use the modID as a guaranteed unique <nl> + / / replacement for appID ' s <nl> + m_gameID . m_nModID = crc32 | ( 0x80000000 ) ; <nl> + } <nl> + <nl> + # endif / * VSTFILEID_H * / <nl> + <nl> + # endif / * CHECKSUM_CRC_H * / <nl> + <nl> + <nl> + uint64 ToUint64 ( ) const <nl> + { <nl> + return m_ulGameID ; <nl> + } <nl> + <nl> + uint64 * GetUint64Ptr ( ) <nl> + { <nl> + return & m_ulGameID ; <nl> + } <nl> + <nl> + void Set ( uint64 ulGameID ) <nl> + { <nl> + m_ulGameID = ulGameID ; <nl> + } <nl> + <nl> + bool IsMod ( ) const <nl> + { <nl> + return ( m_gameID . m_nType = = k_EGameIDTypeGameMod ) ; <nl> + } <nl> + <nl> + bool IsShortcut ( ) const <nl> + { <nl> + return ( m_gameID . m_nType = = k_EGameIDTypeShortcut ) ; <nl> + } <nl> + <nl> + bool IsP2PFile ( ) const <nl> + { <nl> + return ( m_gameID . m_nType = = k_EGameIDTypeP2P ) ; <nl> + } <nl> + <nl> + bool IsSteamApp ( ) const <nl> + { <nl> + return ( m_gameID . m_nType = = k_EGameIDTypeApp ) ; <nl> + } <nl> + <nl> + uint32 ModID ( ) const <nl> + { <nl> + return m_gameID . m_nModID ; <nl> + } <nl> + <nl> + uint32 AppID ( ) const <nl> + { <nl> + return m_gameID . m_nAppID ; <nl> + } <nl> + <nl> + bool operator = = ( const CGameID & rhs ) const <nl> + { <nl> + return m_ulGameID = = rhs . m_ulGameID ; <nl> + } <nl> + <nl> + bool operator ! = ( const CGameID & rhs ) const <nl> + { <nl> + return ! ( * this = = rhs ) ; <nl> + } <nl> + <nl> + bool operator < ( const CGameID & rhs ) const <nl> + { <nl> + return ( m_ulGameID < rhs . m_ulGameID ) ; <nl> + } <nl> + <nl> + bool IsValid ( ) const <nl> + { <nl> + / / each type has it ' s own invalid fixed point : <nl> + switch ( m_gameID . m_nType ) <nl> + { <nl> + case k_EGameIDTypeApp : <nl> + return m_gameID . m_nAppID ! = k_uAppIdInvalid ; <nl> + <nl> + case k_EGameIDTypeGameMod : <nl> + return m_gameID . m_nAppID ! = k_uAppIdInvalid & & m_gameID . m_nModID & 0x80000000 ; <nl> + <nl> + case k_EGameIDTypeShortcut : <nl> + return ( m_gameID . m_nModID & 0x80000000 ) ! = 0 ; <nl> + <nl> + case k_EGameIDTypeP2P : <nl> + return m_gameID . m_nAppID = = k_uAppIdInvalid & & m_gameID . m_nModID & 0x80000000 ; <nl> + <nl> + default : <nl> + # if defined ( Assert ) <nl> + Assert ( false ) ; <nl> + # endif <nl> + return false ; <nl> + } <nl> + <nl> + } <nl> + <nl> + void Reset ( ) <nl> + { <nl> + m_ulGameID = 0 ; <nl> + } <nl> + <nl> + <nl> + <nl> + private : <nl> + <nl> + enum EGameIDType <nl> + { <nl> + k_EGameIDTypeApp = 0 , <nl> + k_EGameIDTypeGameMod = 1 , <nl> + k_EGameIDTypeShortcut = 2 , <nl> + k_EGameIDTypeP2P = 3 , <nl> + } ; <nl> + <nl> + struct GameID_t <nl> + { <nl> + # ifdef VALVE_BIG_ENDIAN <nl> + unsigned int m_nModID : 32 ; <nl> + unsigned int m_nType : 8 ; <nl> + unsigned int m_nAppID : 24 ; <nl> + # else <nl> + unsigned int m_nAppID : 24 ; <nl> + unsigned int m_nType : 8 ; <nl> + unsigned int m_nModID : 32 ; <nl> + # endif <nl> + } ; <nl> + <nl> + union <nl> + { <nl> + uint64 m_ulGameID ; <nl> + GameID_t m_gameID ; <nl> + } ; <nl> + } ; <nl> + <nl> + # pragma pack ( pop ) <nl> + <nl> + const int k_cchGameExtraInfoMax = 64 ; <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Constants used for query ports . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + <nl> + # define QUERY_PORT_NOT_INITIALIZED 0xFFFF / / We haven ' t asked the GS for this query port ' s actual value yet . <nl> + # define QUERY_PORT_ERROR 0xFFFE / / We were unable to get the query port for this server . <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Passed as argument to SteamAPI_UseBreakpadCrashHandler to enable optional callback <nl> + / / just before minidump file is captured after a crash has occurred . ( Allows app to append additional comment data to the dump , etc . ) <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + typedef void ( * PFNPreMinidumpCallback ) ( void * context ) ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Used by ICrashHandler interfaces to reference particular installed crash handlers <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + typedef void * BREAKPAD_HANDLE ; <nl> + # define BREAKPAD_INVALID_HANDLE ( BREAKPAD_HANDLE ) 0 <nl> + <nl> + # endif / / STEAMCLIENTPUBLIC_H <nl> new file mode 100644 <nl> index 00000000 . . 0331c139 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / steamencryptedappticket . h <nl> <nl> + / / = = = = = = = = = Copyright © 1996 - 2010 , Valve LLC , All rights reserved . = = = = = = = = = = = = <nl> + / / <nl> + / / Purpose : utilities to decode / decrypt a ticket from the <nl> + / / ISteamUser : : RequestEncryptedAppTicket , ISteamUser : : GetEncryptedAppTicket API <nl> + / / <nl> + / / To use : declare CSteamEncryptedAppTicket , then call BDecryptTicket <nl> + / / if BDecryptTicket returns true , other accessors are valid <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # include " steam_api . h " <nl> + <nl> + static const int k_nSteamEncryptedAppTicketSymmetricKeyLen = 32 ; <nl> + <nl> + <nl> + S_API bool SteamEncryptedAppTicket_BDecryptTicket ( const uint8 * rgubTicketEncrypted , uint32 cubTicketEncrypted , <nl> + uint8 * rgubTicketDecrypted , uint32 * pcubTicketDecrypted , <nl> + const uint8 rgubKey [ k_nSteamEncryptedAppTicketSymmetricKeyLen ] , int cubKey ) ; <nl> + <nl> + S_API bool SteamEncryptedAppTicket_BIsTicketForApp ( uint8 * rgubTicketDecrypted , uint32 cubTicketDecrypted , AppId_t nAppID ) ; <nl> + <nl> + S_API RTime32 SteamEncryptedAppTicket_GetTicketIssueTime ( uint8 * rgubTicketDecrypted , uint32 cubTicketDecrypted ) ; <nl> + <nl> + S_API void SteamEncryptedAppTicket_GetTicketSteamID ( uint8 * rgubTicketDecrypted , uint32 cubTicketDecrypted , CSteamID * psteamID ) ; <nl> + <nl> + S_API AppId_t SteamEncryptedAppTicket_GetTicketAppID ( uint8 * rgubTicketDecrypted , uint32 cubTicketDecrypted ) ; <nl> + <nl> + S_API bool SteamEncryptedAppTicket_BUserOwnsAppInTicket ( uint8 * rgubTicketDecrypted , uint32 cubTicketDecrypted , AppId_t nAppID ) ; <nl> + <nl> + S_API bool SteamEncryptedAppTicket_BUserIsVacBanned ( uint8 * rgubTicketDecrypted , uint32 cubTicketDecrypted ) ; <nl> + <nl> + S_API const uint8 * SteamEncryptedAppTicket_GetUserVariableData ( uint8 * rgubTicketDecrypted , uint32 cubTicketDecrypted , uint32 * pcubUserData ) ; <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 00000000 . . eab1c59a <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / steamps3params_internal . h <nl> <nl> + / / = = = = = = Copyright 1996 - 2008 , Valve Corporation , All rights reserved . = = = = = = = <nl> + / / <nl> + / / Purpose : <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef STEAM_PS3PARAMSINTERNAL_API_H <nl> + # define STEAM_PS3PARAMSINTERNAL_API_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / Purpose : Params used only internally at Valve . This is the reserved pointer of SteamPS3Params_t <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + struct SteamPS3ParamsInternal_t <nl> + { <nl> + int m_nVersion ; <nl> + EUniverse m_eUniverse ; <nl> + const char * m_pchCMForce ; / / list of CMs in form " IP : port ; IP : port " or " IP ; IP " <nl> + } ; <nl> + <nl> + # define STEAM_PS3_PARAMS_INTERNAL_VERSION 1 <nl> + <nl> + <nl> + # endif / / STEAM_PS3PARAMSINTERNAL_API_H <nl> new file mode 100644 <nl> index 00000000 . . 975ff914 <nl> mmm / dev / null <nl> ppp b / lsteamclient / steamworks_sdk_111x / steamtypes . h <nl> <nl> + / / = = = = = = = = = Copyright © 1996 - 2008 , Valve LLC , All rights reserved . = = = = = = = = = = = = <nl> + / / <nl> + / / Purpose : <nl> + / / <nl> + / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + # ifndef STEAMTYPES_H <nl> + # define STEAMTYPES_H <nl> + # ifdef _WIN32 <nl> + # pragma once <nl> + # endif <nl> + <nl> + / / Steam - specific types . Defined here so this header file can be included in other code bases . <nl> + # ifndef WCHARTYPES_H <nl> + typedef unsigned char uint8 ; <nl> + # endif <nl> + <nl> + # if defined ( __GNUC__ ) & & ! defined ( POSIX ) <nl> + # if __GNUC__ < 4 <nl> + # error " Steamworks requires GCC 4 . X ( 4 . 2 or 4 . 4 have been tested ) " <nl> + # endif <nl> + # define POSIX 1 <nl> + # endif <nl> + <nl> + # if defined ( __x86_64__ ) | | defined ( _WIN64 ) <nl> + # define X64BITS <nl> + # endif <nl> + <nl> + / / Make sure VALVE_BIG_ENDIAN gets set on PS3 , may already be set previously in Valve internal code . <nl> + # if ! defined ( VALVE_BIG_ENDIAN ) & & defined ( _PS3 ) <nl> + # define VALVE_BIG_ENDIAN <nl> + # endif <nl> + <nl> + typedef unsigned char uint8 ; <nl> + typedef signed char int8 ; <nl> + <nl> + # if defined ( _WIN32 ) <nl> + <nl> + typedef __int16 int16 ; <nl> + typedef unsigned __int16 uint16 ; <nl> + typedef __int32 int32 ; <nl> + typedef unsigned __int32 uint32 ; <nl> + typedef __int64 int64 ; <nl> + typedef unsigned __int64 uint64 ; <nl> + <nl> + # ifdef X64BITS <nl> + typedef __int64 intp ; / / intp is an integer that can accomodate a pointer <nl> + typedef unsigned __int64 uintp ; / / ( ie , sizeof ( intp ) > = sizeof ( int ) & & sizeof ( intp ) > = sizeof ( void * ) <nl> + # else <nl> + typedef __int32 intp ; <nl> + typedef unsigned __int32 uintp ; <nl> + # endif <nl> + <nl> + # else / / _WIN32 <nl> + <nl> + typedef short int16 ; <nl> + typedef unsigned short uint16 ; <nl> + typedef int int32 ; <nl> + typedef unsigned int uint32 ; <nl> + typedef long long int64 ; <nl> + typedef unsigned long long uint64 ; <nl> + # ifdef X64BITS <nl> + typedef long long intp ; <nl> + typedef unsigned long long uintp ; <nl> + # else <nl> + typedef int intp ; <nl> + typedef unsigned int uintp ; <nl> + # endif <nl> + <nl> + # endif / / else _WIN32 <nl> + <nl> + const int k_cubSaltSize = 8 ; <nl> + typedef uint8 Salt_t [ k_cubSaltSize ] ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / GID ( GlobalID ) stuff <nl> + / / This is a globally unique identifier . It ' s guaranteed to be unique across all <nl> + / / racks and servers for as long as a given universe persists . <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / NOTE : for GID parsing / rendering and other utils , see gid . h <nl> + typedef uint64 GID_t ; <nl> + <nl> + const GID_t k_GIDNil = 0xffffffffffffffffull ; <nl> + <nl> + / / For convenience , we define a number of types that are just new names for GIDs <nl> + typedef GID_t JobID_t ; / / Each Job has a unique ID <nl> + typedef GID_t TxnID_t ; / / Each financial transaction has a unique ID <nl> + <nl> + const GID_t k_TxnIDNil = k_GIDNil ; <nl> + const GID_t k_TxnIDUnknown = 0 ; <nl> + <nl> + <nl> + / / this is baked into client messages and interfaces as an int , <nl> + / / make sure we never break this . <nl> + typedef uint32 PackageId_t ; <nl> + const PackageId_t k_uPackageIdFreeSub = 0x0 ; <nl> + const PackageId_t k_uPackageIdInvalid = 0xFFFFFFFF ; <nl> + <nl> + <nl> + / / this is baked into client messages and interfaces as an int , <nl> + / / make sure we never break this . <nl> + typedef uint32 AppId_t ; <nl> + const AppId_t k_uAppIdInvalid = 0x0 ; <nl> + <nl> + <nl> + / / this is baked into client messages and interfaces as an int , <nl> + / / make sure we never break this . AppIds and DepotIDs also presently <nl> + / / share the same namespace , but since we ' d like to change that in the future <nl> + / / I ' ve defined it seperately here . <nl> + typedef uint32 DepotId_t ; <nl> + const DepotId_t k_uDepotIdInvalid = 0x0 ; <nl> + <nl> + / / RTime32 <nl> + / / We use this 32 bit time representing real world time . <nl> + / / It offers 1 second resolution beginning on January 1 , 1970 ( Unix time ) <nl> + typedef uint32 RTime32 ; <nl> + <nl> + typedef uint32 CellID_t ; <nl> + const CellID_t k_uCellIDInvalid = 0xFFFFFFFF ; <nl> + <nl> + / / handle to a Steam API call <nl> + typedef uint64 SteamAPICall_t ; <nl> + const SteamAPICall_t k_uAPICallInvalid = 0x0 ; <nl> + <nl> + <nl> + <nl> + <nl> + # endif / / STEAMTYPES_H <nl> new file mode 100644 <nl> index 00000000 . . e346bc51 <nl> mmm / dev / null <nl> ppp b / lsteamclient / struct_converters_111x . cpp <nl> <nl> + # include " steam_defs . h " <nl> + # include " steamworks_sdk_111x / steam_api . h " <nl> + # include " steamworks_sdk_111x / isteamgameserver . h " <nl> + # include " steamworks_sdk_111x / isteamgameserverstats . h " <nl> + # include " steamworks_sdk_111x / isteamgamecoordinator . h " <nl> + # include " steamclient_private . h " <nl> + extern " C " { <nl> + # pragma pack ( push , 8 ) <nl> + struct winLeaderboardEntry_t_111x { <nl> + CSteamID m_steamIDUser ; <nl> + int32 m_nGlobalRank ; <nl> + int32 m_nScore ; <nl> + int32 m_cDetails ; <nl> + UGCHandle_t m_hUGC ; <nl> + } __attribute__ ( ( ms_struct ) ) ; <nl> + # pragma pack ( pop ) <nl> + void win_to_lin_struct_LeaderboardEntry_t_111x ( const void * w , void * l ) <nl> + { <nl> + LeaderboardEntry_t * lin = ( LeaderboardEntry_t * ) l ; <nl> + struct winLeaderboardEntry_t_111x * win = ( struct winLeaderboardEntry_t_111x * ) w ; <nl> + lin - > m_steamIDUser = win - > m_steamIDUser ; <nl> + lin - > m_nGlobalRank = win - > m_nGlobalRank ; <nl> + lin - > m_nScore = win - > m_nScore ; <nl> + lin - > m_cDetails = win - > m_cDetails ; <nl> + lin - > m_hUGC = win - > m_hUGC ; <nl> + } <nl> + <nl> + void lin_to_win_struct_LeaderboardEntry_t_111x ( const void * l , void * w ) <nl> + { <nl> + LeaderboardEntry_t * lin = ( LeaderboardEntry_t * ) l ; <nl> + struct winLeaderboardEntry_t_111x * win = ( struct winLeaderboardEntry_t_111x * ) w ; <nl> + win - > m_steamIDUser = lin - > m_steamIDUser ; <nl> + win - > m_nGlobalRank = lin - > m_nGlobalRank ; <nl> + win - > m_nScore = lin - > m_nScore ; <nl> + win - > m_cDetails = lin - > m_cDetails ; <nl> + win - > m_hUGC = lin - > m_hUGC ; <nl> + } <nl> + <nl> + <nl> + } <nl> new file mode 100644 <nl> index 00000000 . . f5b084bd <nl> mmm / dev / null <nl> ppp b / lsteamclient / struct_converters_111x . h <nl> <nl> + extern void win_to_lin_struct_LeaderboardEntry_t_111x ( const void * w , void * l ) ; <nl> + extern void lin_to_win_struct_LeaderboardEntry_t_111x ( const void * l , void * w ) ; <nl> + <nl> mmm a / lsteamclient / winISteamRemoteStorage . c <nl> ppp b / lsteamclient / winISteamRemoteStorage . c <nl> winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION004 * create_winISteam <nl> return r ; <nl> } <nl> <nl> + # include " cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 . h " <nl> + <nl> + typedef struct __winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 { <nl> + vtable_ptr * vtable ; <nl> + void * linux_side ; <nl> + } winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 ; <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileWrite , 16 ) <nl> + bool __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileWrite ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , const char * pchFile , const void * pvData , int32 cubData ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileWrite ( _this - > linux_side , pchFile , pvData , cubData ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileRead , 16 ) <nl> + int32 __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileRead ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , const char * pchFile , void * pvData , int32 cubDataToRead ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileRead ( _this - > linux_side , pchFile , pvData , cubDataToRead ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileForget , 8 ) <nl> + bool __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileForget ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , const char * pchFile ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileForget ( _this - > linux_side , pchFile ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileDelete , 8 ) <nl> + bool __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileDelete ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , const char * pchFile ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileDelete ( _this - > linux_side , pchFile ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileShare , 8 ) <nl> + SteamAPICall_t __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileShare ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , const char * pchFile ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileShare ( _this - > linux_side , pchFile ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileExists , 8 ) <nl> + bool __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileExists ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , const char * pchFile ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileExists ( _this - > linux_side , pchFile ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FilePersisted , 8 ) <nl> + bool __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FilePersisted ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , const char * pchFile ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FilePersisted ( _this - > linux_side , pchFile ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileSize , 8 ) <nl> + int32 __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileSize ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , const char * pchFile ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileSize ( _this - > linux_side , pchFile ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileTimestamp , 8 ) <nl> + int64 __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileTimestamp ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , const char * pchFile ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileTimestamp ( _this - > linux_side , pchFile ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileCount , 4 ) <nl> + int32 __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileCount ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileCount ( _this - > linux_side ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileNameAndSize , 12 ) <nl> + const char * __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileNameAndSize ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , int iFile , int32 * pnFileSizeInBytes ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileNameAndSize ( _this - > linux_side , iFile , pnFileSizeInBytes ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetQuota , 12 ) <nl> + bool __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetQuota ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , int32 * pnTotalBytes , int32 * puAvailableBytes ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetQuota ( _this - > linux_side , pnTotalBytes , puAvailableBytes ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_IsCloudEnabledForAccount , 4 ) <nl> + bool __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_IsCloudEnabledForAccount ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_IsCloudEnabledForAccount ( _this - > linux_side ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_IsCloudEnabledForApp , 4 ) <nl> + bool __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_IsCloudEnabledForApp ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_IsCloudEnabledForApp ( _this - > linux_side ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_SetCloudEnabledForApp , 5 ) <nl> + void __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_SetCloudEnabledForApp ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , bool bEnabled ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_SetCloudEnabledForApp ( _this - > linux_side , bEnabled ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_UGCDownload , 12 ) <nl> + SteamAPICall_t __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_UGCDownload ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , UGCHandle_t hContent ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_UGCDownload ( _this - > linux_side , hContent ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetUGCDetails , 28 ) <nl> + bool __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetUGCDetails ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , UGCHandle_t hContent , AppId_t * pnAppID , char * * ppchName , int32 * pnFileSizeInBytes , CSteamID * pSteamIDOwner ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetUGCDetails ( _this - > linux_side , hContent , pnAppID , ppchName , pnFileSizeInBytes , pSteamIDOwner ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_UGCRead , 20 ) <nl> + int32 __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_UGCRead ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , UGCHandle_t hContent , void * pvData , int32 cubDataToRead ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_UGCRead ( _this - > linux_side , hContent , pvData , cubDataToRead ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetCachedUGCCount , 4 ) <nl> + int32 __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetCachedUGCCount ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetCachedUGCCount ( _this - > linux_side ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetCachedUGCHandle , 8 ) <nl> + UGCHandle_t __thiscall winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetCachedUGCHandle ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * _this , int32 iCachedContent ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetCachedUGCHandle ( _this - > linux_side , iCachedContent ) ; <nl> + } <nl> + <nl> + extern vtable_ptr winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_vtable ; <nl> + <nl> + # ifndef __GNUC__ <nl> + void __asm_dummy_vtables ( void ) { <nl> + # endif <nl> + __ASM_VTABLE ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 , <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileWrite ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileRead ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileForget ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileDelete ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileShare ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FileExists ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_FilePersisted ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileSize ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileTimestamp ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileCount ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetFileNameAndSize ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetQuota ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_IsCloudEnabledForAccount ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_IsCloudEnabledForApp ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_SetCloudEnabledForApp ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_UGCDownload ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetUGCDetails ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_UGCRead ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetCachedUGCCount ) <nl> + VTABLE_ADD_FUNC ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_GetCachedUGCHandle ) <nl> + ) ; <nl> + # ifndef __GNUC__ <nl> + } <nl> + # endif <nl> + <nl> + winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * create_winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 ( void * linux_side ) <nl> + { <nl> + winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 * r = HeapAlloc ( GetProcessHeap ( ) , 0 , sizeof ( winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 ) ) ; <nl> + TRACE ( " - > % p \ n " , r ) ; <nl> + r - > vtable = & winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003_vtable ; <nl> + r - > linux_side = linux_side ; <nl> + return r ; <nl> + } <nl> + <nl> # include " cppISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION002 . h " <nl> <nl> typedef struct __winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION002 { <nl> mmm a / lsteamclient / winISteamUserStats . c <nl> ppp b / lsteamclient / winISteamUserStats . c <nl> winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION009 * create_winISteamUserStat <nl> return r ; <nl> } <nl> <nl> + # include " cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 . h " <nl> + <nl> + typedef struct __winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 { <nl> + vtable_ptr * vtable ; <nl> + void * linux_side ; <nl> + } winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 ; <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_RequestCurrentStats , 4 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_RequestCurrentStats ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_RequestCurrentStats ( _this - > linux_side ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetStat , 12 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetStat ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , const char * pchName , int32 * pData ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetStat ( _this - > linux_side , pchName , pData ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetStat_2 , 12 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetStat_2 ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , const char * pchName , float * pData ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetStat_2 ( _this - > linux_side , pchName , pData ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetStat , 12 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetStat ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , const char * pchName , int32 nData ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetStat ( _this - > linux_side , pchName , nData ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetStat_2 , 12 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetStat_2 ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , const char * pchName , float fData ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetStat_2 ( _this - > linux_side , pchName , fData ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_UpdateAvgRateStat , 20 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_UpdateAvgRateStat ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , const char * pchName , float flCountThisSession , double dSessionLength ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_UpdateAvgRateStat ( _this - > linux_side , pchName , flCountThisSession , dSessionLength ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievement , 12 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievement ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , const char * pchName , bool * pbAchieved ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievement ( _this - > linux_side , pchName , pbAchieved ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetAchievement , 8 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetAchievement ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , const char * pchName ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetAchievement ( _this - > linux_side , pchName ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_ClearAchievement , 8 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_ClearAchievement ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , const char * pchName ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_ClearAchievement ( _this - > linux_side , pchName ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementAndUnlockTime , 16 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementAndUnlockTime ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , const char * pchName , bool * pbAchieved , uint32 * punUnlockTime ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementAndUnlockTime ( _this - > linux_side , pchName , pbAchieved , punUnlockTime ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_StoreStats , 4 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_StoreStats ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_StoreStats ( _this - > linux_side ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementIcon , 8 ) <nl> + int __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementIcon ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , const char * pchName ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementIcon ( _this - > linux_side , pchName ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementDisplayAttribute , 12 ) <nl> + const char * __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementDisplayAttribute ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , const char * pchName , const char * pchKey ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementDisplayAttribute ( _this - > linux_side , pchName , pchKey ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_IndicateAchievementProgress , 16 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_IndicateAchievementProgress ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , const char * pchName , uint32 nCurProgress , uint32 nMaxProgress ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_IndicateAchievementProgress ( _this - > linux_side , pchName , nCurProgress , nMaxProgress ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_RequestUserStats , 12 ) <nl> + SteamAPICall_t __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_RequestUserStats ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , CSteamID steamIDUser ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_RequestUserStats ( _this - > linux_side , steamIDUser ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserStat , 20 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserStat ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , CSteamID steamIDUser , const char * pchName , int32 * pData ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserStat ( _this - > linux_side , steamIDUser , pchName , pData ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserStat_2 , 20 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserStat_2 ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , CSteamID steamIDUser , const char * pchName , float * pData ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserStat_2 ( _this - > linux_side , steamIDUser , pchName , pData ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserAchievement , 20 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserAchievement ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , CSteamID steamIDUser , const char * pchName , bool * pbAchieved ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserAchievement ( _this - > linux_side , steamIDUser , pchName , pbAchieved ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserAchievementAndUnlockTime , 24 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserAchievementAndUnlockTime ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , CSteamID steamIDUser , const char * pchName , bool * pbAchieved , uint32 * punUnlockTime ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserAchievementAndUnlockTime ( _this - > linux_side , steamIDUser , pchName , pbAchieved , punUnlockTime ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_ResetAllStats , 5 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_ResetAllStats ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , bool bAchievementsToo ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_ResetAllStats ( _this - > linux_side , bAchievementsToo ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_FindOrCreateLeaderboard , 16 ) <nl> + SteamAPICall_t __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_FindOrCreateLeaderboard ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , const char * pchLeaderboardName , ELeaderboardSortMethod eLeaderboardSortMethod , ELeaderboardDisplayType eLeaderboardDisplayType ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_FindOrCreateLeaderboard ( _this - > linux_side , pchLeaderboardName , eLeaderboardSortMethod , eLeaderboardDisplayType ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_FindLeaderboard , 8 ) <nl> + SteamAPICall_t __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_FindLeaderboard ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , const char * pchLeaderboardName ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_FindLeaderboard ( _this - > linux_side , pchLeaderboardName ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardName , 12 ) <nl> + const char * __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardName ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , SteamLeaderboard_t hSteamLeaderboard ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardName ( _this - > linux_side , hSteamLeaderboard ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardEntryCount , 12 ) <nl> + int __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardEntryCount ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , SteamLeaderboard_t hSteamLeaderboard ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardEntryCount ( _this - > linux_side , hSteamLeaderboard ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardSortMethod , 12 ) <nl> + ELeaderboardSortMethod __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardSortMethod ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , SteamLeaderboard_t hSteamLeaderboard ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardSortMethod ( _this - > linux_side , hSteamLeaderboard ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardDisplayType , 12 ) <nl> + ELeaderboardDisplayType __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardDisplayType ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , SteamLeaderboard_t hSteamLeaderboard ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardDisplayType ( _this - > linux_side , hSteamLeaderboard ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_DownloadLeaderboardEntries , 24 ) <nl> + SteamAPICall_t __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_DownloadLeaderboardEntries ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , SteamLeaderboard_t hSteamLeaderboard , ELeaderboardDataRequest eLeaderboardDataRequest , int nRangeStart , int nRangeEnd ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_DownloadLeaderboardEntries ( _this - > linux_side , hSteamLeaderboard , eLeaderboardDataRequest , nRangeStart , nRangeEnd ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetDownloadedLeaderboardEntry , 28 ) <nl> + bool __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetDownloadedLeaderboardEntry ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , SteamLeaderboardEntries_t hSteamLeaderboardEntries , int index , LeaderboardEntry_t * pLeaderboardEntry , int32 * pDetails , int cDetailsMax ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetDownloadedLeaderboardEntry ( _this - > linux_side , hSteamLeaderboardEntries , index , pLeaderboardEntry , pDetails , cDetailsMax ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_UploadLeaderboardScore , 28 ) <nl> + SteamAPICall_t __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_UploadLeaderboardScore ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , SteamLeaderboard_t hSteamLeaderboard , ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod , int32 nScore , const int32 * pScoreDetails , int cScoreDetailsCount ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_UploadLeaderboardScore ( _this - > linux_side , hSteamLeaderboard , eLeaderboardUploadScoreMethod , nScore , pScoreDetails , cScoreDetailsCount ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_AttachLeaderboardUGC , 20 ) <nl> + SteamAPICall_t __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_AttachLeaderboardUGC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this , SteamLeaderboard_t hSteamLeaderboard , UGCHandle_t hUGC ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_AttachLeaderboardUGC ( _this - > linux_side , hSteamLeaderboard , hUGC ) ; <nl> + } <nl> + <nl> + DEFINE_THISCALL_WRAPPER ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetNumberOfCurrentPlayers , 4 ) <nl> + SteamAPICall_t __thiscall winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetNumberOfCurrentPlayers ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * _this ) <nl> + { <nl> + TRACE ( " % p \ n " , _this ) ; <nl> + return cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetNumberOfCurrentPlayers ( _this - > linux_side ) ; <nl> + } <nl> + <nl> + extern vtable_ptr winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_vtable ; <nl> + <nl> + # ifndef __GNUC__ <nl> + void __asm_dummy_vtables ( void ) { <nl> + # endif <nl> + __ASM_VTABLE ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 , <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_RequestCurrentStats ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetStat_2 ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetStat ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetStat_2 ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetStat ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_UpdateAvgRateStat ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievement ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_SetAchievement ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_ClearAchievement ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementAndUnlockTime ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_StoreStats ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementIcon ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetAchievementDisplayAttribute ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_IndicateAchievementProgress ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_RequestUserStats ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserStat_2 ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserStat ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserAchievement ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetUserAchievementAndUnlockTime ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_ResetAllStats ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_FindOrCreateLeaderboard ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_FindLeaderboard ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardName ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardEntryCount ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardSortMethod ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetLeaderboardDisplayType ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_DownloadLeaderboardEntries ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetDownloadedLeaderboardEntry ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_UploadLeaderboardScore ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_AttachLeaderboardUGC ) <nl> + VTABLE_ADD_FUNC ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_GetNumberOfCurrentPlayers ) <nl> + ) ; <nl> + # ifndef __GNUC__ <nl> + } <nl> + # endif <nl> + <nl> + winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * create_winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 ( void * linux_side ) <nl> + { <nl> + winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 * r = HeapAlloc ( GetProcessHeap ( ) , 0 , sizeof ( winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 ) ) ; <nl> + TRACE ( " - > % p \ n " , r ) ; <nl> + r - > vtable = & winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008_vtable ; <nl> + r - > linux_side = linux_side ; <nl> + return r ; <nl> + } <nl> + <nl> # include " cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION007 . h " <nl> <nl> typedef struct __winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION007 { <nl> mmm a / lsteamclient / win_constructors . h <nl> ppp b / lsteamclient / win_constructors . h <nl> extern void * create_winISteamUser_SteamUser015 ( void * ) ; <nl> extern void * create_winISteamUser_SteamUser014 ( void * ) ; <nl> extern void * create_winISteamFriends_SteamFriends008 ( void * ) ; <nl> extern void * create_winISteamNetworking_SteamNetworking004 ( void * ) ; <nl> + extern void * create_winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 ( void * ) ; <nl> + extern void * create_winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 ( void * ) ; <nl> extern void * create_winISteamClient_SteamClient009 ( void * ) ; <nl> extern void * create_winISteamFriends_SteamFriends007 ( void * ) ; <nl> extern void * create_winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION007 ( void * ) ; <nl> mmm a / lsteamclient / win_constructors_table . dat <nl> ppp b / lsteamclient / win_constructors_table . dat <nl> <nl> { " SteamUser014 " , & create_winISteamUser_SteamUser014 } , <nl> { " SteamFriends008 " , & create_winISteamFriends_SteamFriends008 } , <nl> { " SteamNetworking004 " , & create_winISteamNetworking_SteamNetworking004 } , <nl> + { " STEAMREMOTESTORAGE_INTERFACE_VERSION003 " , & create_winISteamRemoteStorage_STEAMREMOTESTORAGE_INTERFACE_VERSION003 } , <nl> + { " STEAMUSERSTATS_INTERFACE_VERSION008 " , & create_winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION008 } , <nl> { " SteamClient009 " , & create_winISteamClient_SteamClient009 } , <nl> { " SteamFriends007 " , & create_winISteamFriends_SteamFriends007 } , <nl> { " STEAMUSERSTATS_INTERFACE_VERSION007 " , & create_winISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION007 } , <nl>
lsteamclient : Synthesize SDK version 1 . 11x
ValveSoftware/Proton
e0ddf0fc28dd981ddcb036046ba72a3966e3b2be
2019-02-14T14:32:39Z
mmm a / utils / buildbot - release - notes . txt <nl> ppp b / utils / buildbot - release - notes . txt <nl> <nl> names use the singular form ( " NSSomethingOptionMagic " ) , this is considered <nl> a matching prefix ( but only if nothing follows the plural ) . <nl> <nl> + * Cocoa APIs that take pointers to plain C types as arguments now get imported <nl> + as taking the new ' CMutablePointer < T > ' and ' CConstPointer < T > ' types instead <nl> + of ' UnsafePointer < T > ' . These new types allow implicit conversions from <nl> + Swift ' inout ' parameters and from Swift arrays : <nl> + <nl> + let rgb = CGColorSpaceCreateDeviceRGB ( ) <nl> + / / CGColorRef CGColorCreate ( CGColorSpaceRef , const CGFloat * ) ; <nl> + let white = CGColorCreate ( rgb , [ 1 . 0 , 1 . 0 , 1 . 0 ] ) <nl> + <nl> + var s = 0 . 0 , c = 0 . 0 <nl> + / / void sincos ( double , double * , double * ) ; <nl> + sincos ( M_PI / 2 , & s , & c ) <nl> + <nl> + This is currently limited to non - void , non - ObjC pointer types ; support for <nl> + pointers to ObjC pointers , such as ' NSError * * ' , and for void pointers will <nl> + be coming soon . <nl> + <nl> <nl> 2014 - 03 - 26 <nl> mmmmmmmmm - <nl>
Release note C * Pointer < T > .
apple/swift
83a830eb8a87ace7e6961294a59c3adf4d4abc17
2014-04-01T00:32:16Z
mmm a / README . md <nl> ppp b / README . md <nl> and discussion . * * <nl> <nl> People who are a little more adventurous can also try our nightly binaries : <nl> <nl> - * Linux CPU - only : [ Python 2 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = cpu - slave / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 9 . 0 - cp27 - none - linux_x86_64 . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = cpu - slave / ) ) / [ Python 3 . 4 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = cpu - slave / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 9 . 0 - cp34 - cp34m - linux_x86_64 . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = cpu - slave / ) ) / [ Python 3 . 5 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - python35 - linux - cpu / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 9 . 0 - cp35 - cp35m - linux_x86_64 . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - python35 - linux - cpu / ) ) <nl> - * Linux GPU : [ Python 2 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - linux - gpu / TF_BUILD_CONTAINER_TYPE = GPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = gpu - linux / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 9 . 0 - cp27 - none - linux_x86_64 . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - linux - gpu / TF_BUILD_CONTAINER_TYPE = GPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = gpu - linux / ) ) / [ Python 3 . 4 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - linux - gpu / TF_BUILD_CONTAINER_TYPE = GPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = gpu - linux / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 9 . 0 - cp34 - cp34m - linux_x86_64 . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - linux - gpu / TF_BUILD_CONTAINER_TYPE = GPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = gpu - linux / ) ) / [ Python 3 . 5 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - linux - gpu / TF_BUILD_CONTAINER_TYPE = GPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 . 5 , label = gpu - linux / 140 / artifact / pip_test / whl / tensorflow - 0 . 8 . 0 - cp35 - cp35m - linux_x86_64 . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - linux - gpu / TF_BUILD_CONTAINER_TYPE = GPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 . 5 , label = gpu - linux / ) ) <nl> - * Mac CPU - only : [ Python 2 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = mac1 - slave / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 9 . 0 - py2 - none - any . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = mac1 - slave / ) ) / [ Python 3 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = mac1 - slave / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 9 . 0 - py3 - none - any . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = mac1 - slave / ) ) <nl> - * Mac GPU : [ Python 2 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - mac - gpu / TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = gpu - mac / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 9 . 0 - py2 - none - any . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - mac - gpu / TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = gpu - mac / ) ) / [ Python 3 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - mac - gpu / TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = gpu - mac / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 9 . 0 - py3 - none - any . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - mac - gpu / TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = gpu - mac / ) ) <nl> + * Linux CPU - only : [ Python 2 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = cpu - slave / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 10 . 0rc0 - cp27 - none - linux_x86_64 . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = cpu - slave / ) ) / [ Python 3 . 4 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = cpu - slave / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 10 . 0rc0 - cp34 - cp34m - linux_x86_64 . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = cpu - slave / ) ) / [ Python 3 . 5 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - python35 - linux - cpu / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 10 . 0rc0 - cp35 - cp35m - linux_x86_64 . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - python35 - linux - cpu / ) ) <nl> + * Linux GPU : [ Python 2 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - linux - gpu / TF_BUILD_CONTAINER_TYPE = GPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = gpu - linux / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 10 . 0rc0 - cp27 - none - linux_x86_64 . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - linux - gpu / TF_BUILD_CONTAINER_TYPE = GPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = gpu - linux / ) ) / [ Python 3 . 4 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - linux - gpu / TF_BUILD_CONTAINER_TYPE = GPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = gpu - linux / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 10 . 0rc0 - cp34 - cp34m - linux_x86_64 . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - linux - gpu / TF_BUILD_CONTAINER_TYPE = GPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = gpu - linux / ) ) / [ Python 3 . 5 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - linux - gpu / TF_BUILD_CONTAINER_TYPE = GPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 . 5 , label = gpu - linux / 140 / artifact / pip_test / whl / tensorflow - 0 . 8 . 0 - cp35 - cp35m - linux_x86_64 . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - linux - gpu / TF_BUILD_CONTAINER_TYPE = GPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 . 5 , label = gpu - linux / ) ) <nl> + * Mac CPU - only : [ Python 2 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = mac1 - slave / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 10 . 0rc0 - py2 - none - any . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = mac1 - slave / ) ) / [ Python 3 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = mac1 - slave / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 10 . 0rc0 - py3 - none - any . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = mac1 - slave / ) ) <nl> + * Mac GPU : [ Python 2 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - mac - gpu / TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = gpu - mac / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 10 . 0rc0 - py2 - none - any . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - mac - gpu / TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = gpu - mac / ) ) / [ Python 3 ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - mac - gpu / TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = gpu - mac / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 10 . 0rc0 - py3 - none - any . whl ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nigntly - matrix - mac - gpu / TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON3 , label = gpu - mac / ) ) <nl> * [ Android ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - android / TF_BUILD_CONTAINER_TYPE = ANDROID , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = NO_PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = android - slave / lastSuccessfulBuild / artifact / bazel - out / local_linux / bin / tensorflow / examples / android / tensorflow_demo . apk ) ( [ build history ] ( http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - android / TF_BUILD_CONTAINER_TYPE = ANDROID , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = NO_PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = android - slave / ) ) <nl> <nl> # # # # * Try your first TensorFlow program * <nl> mmm a / RELEASE . md <nl> ppp b / RELEASE . md <nl> <nl> - # Changes Since Last Release <nl> <nl> - # # Features and Improvements <nl> - * Connectionist Temporal Classification ops are now " official " ( see , e . g . , <nl> - ` tf . nn . ctc_loss ` ) <nl> - * Preliminary graph - construction C API , for use by language bindings . <nl> - * Major revision to the graph - construction C + + API . Scoping mechanism to make op <nl> - naming , specifying control dependencies etc . more consistent . C + + values can <nl> - be used directly as operands , making op construction more concise . <nl> + # Release 0 . 10 . 0 <nl> <nl> - # # Breaking Changes to the API <nl> - * ` env . h ` replaces use of ` New * File ( ) ` functions to use ` std : : unique_ptr ` <nl> - return arguments , removing the old raw pointer returns . <nl> + # # Major Features and Improvements <nl> + <nl> + * Added support for C + + shape inference <nl> + * Added graph - construction C API <nl> + * Major revision to the graph - construction C + + API <nl> + * Support makefile build for iOS <nl> + * Added Mac GPU support <nl> + * Full version of TF - Slim available as ` tf . contrib . slim ` <nl> + * Added k - Means clustering and WALS matrix factorization <nl> + <nl> + # # Big Fixes and Other Changes <nl> + <nl> + * Allow gradient computation for scalar values . <nl> + * Performance improvements for gRPC <nl> + * Improved support for fp16 <nl> + * New high - level ops in tf . contrib . { layers , metrics } <nl> + * New features for TensorBoard , such as shape display , exponential smoothing <nl> + * Faster and more stable Google Cloud Storage ( GCS ) filesystem support <nl> + * Support for zlib compression and decompression for TFRecordReader and TFRecordWriter <nl> + * Support for reading ( animated ) GIFs <nl> + * Improved support for SparseTensor <nl> + * Added support for more probability distributions ( Dirichlet , Beta , Bernoulli , etc . ) <nl> + * Added Python interfaces to reset resource containers . <nl> + * Many bugfixes and performance improvements <nl> + * Many documentation fixes <nl> + <nl> + # # Thanks to our Contributors <nl> + <nl> + This release contains contributions from many people at Google , as well as : <nl> + <nl> + Alex Rothberg , Andrew Royer , Austin Marshall , @ BlackCoal , Bob Adolf , Brian Diesel , Charles - Emmanuel Dias , @ chemelnucfin , Chris Lesniewski , Daeyun Shin , Daniel Rodriguez , Danijar Hafner , Darcy Liu , Kristinn R . Thórisson , Daniel Castro , Dmitry Savintsev , Kashif Rasul , Dylan Paiton , Emmanuel T . Odeke , Ernest Grzybowski , Gavin Sherry , Gideon Dresdner , Gregory King , Harold Cooper , @ heinzbeinz , Henry Saputra , Huarong Huo , Huazuo Gao , Igor Babuschkin , Igor Macedo Quintanilha , Ivan Ukhov , James Fysh , Jan Wilken Dörrie , Jihun Choi , Johnny Lim , Jonathan Raiman , Justin Francis , @ lilac , Li Yi , Marc Khoury , Marco Marchesi , Max Melnick , Micael Carvalho , @ mikowals , Mostafa Gazar , Nico Galoppo , Nishant Agrawal , Petr Janda , Yuncheng Li , @ raix852 , Robert Rose , @ Robin - des - Bois , Rohit Girdhar , Sam Abrahams , satok16 , Sergey Kishchenko , Sharkd Tu , @ shotat , Siddharth Agrawal , Simon Denel , @ sono - bfio , SunYeop Lee , Thijs Vogels , @ tobegit3hub , @ Undo1 , Wang Yang , Wenjian Huang , Yaroslav Bulatov , Yuan Tang , Yunfeng Wang , Ziming Dong <nl> + <nl> + We are also grateful to all who filed issues or helped resolve them , asked and <nl> + answered questions , and were part of inspiring discussions . <nl> <nl> # Release 0 . 9 . 0 <nl> <nl> <nl> <nl> This release contains contributions from many people at Google , as well as : <nl> <nl> - Aaron Schumacher , Aidan Dang , Akihiko ITOH , Aki Sukegawa , Arbit Chen , Aziz Alto , Danijar Hafner , Erik Erwitt , Fabrizio Milo , Felix Maximilian Möller , Henry Saputra , Sung Kim , Igor Babuschkin , Jan Zikes , Jeremy Barnes , Jesper Steen Møller , Johannes Mayer , Justin Harris , Kashif Rasul , Kevin Robinson , Loo Rong Jie , Lucas Moura , Łukasz Bieniasz - Krzywiec , Mario Cho , Maxim Grechkin , Michael Heilman , Mostafa Rahmani , Mourad Mourafiq , @ ninotoshi , Orion Reblitz - Richardson , Yuncheng Li , @ raoqiyu , Robert DiPietro , Sam Abrahams , Sebastian Raschka , Siddharth Agrawal , @ snakecharmer1024 , Stephen Roller , Sung Kim , SunYeop Lee , Thijs Vogels , Till Hoffmann , Victor Melo , Ville Kallioniemi , Waleed Abdulla , Wenjian Huang , Yaroslav Bulatov , Yeison Rodriguez , Yuan ( Terry ) Tang , Yuxin Wu , @ zhongzyd , Ziming Dong , Zohar Jackson <nl> + Aaron Schumacher , Aidan Dang , Akihiko ITOH , Aki Sukegawa , Arbit Chen , Aziz Alto , Danijar Hafner , Erik Erwitt , Fabrizio Milo , Felix Maximilian Möller , Henry Saputra , Sung Kim , Igor Babuschkin , Jan Zikes , Jeremy Barnes , Jesper Steen Møller , Johannes Mayer , Justin Harris , Kashif Rasul , Kevin Robinson , Loo Rong Jie , Lucas Moura , Łukasz Bieniasz - Krzywiec , Mario Cho , Maxim Grechkin , Michael Heilman , Mostafa Rahmani , Mourad Mourafiq , @ ninotoshi , Orion Reblitz - Richardson , Yuncheng Li , @ raoqiyu , Robert DiPietro , Sam Abrahams , Sebastian Raschka , Siddharth Agrawal , @ snakecharmer1024 , Stephen Roller , Sung Kim , SunYeop Lee , Thijs Vogels , Till Hoffmann , Victor Melo , Ville Kallioniemi , Waleed Abdulla , Wenjian Huang , Yaroslav Bulatov , Yeison Rodriguez , Yuan Tang , Yuxin Wu , @ zhongzyd , Ziming Dong , Zohar Jackson <nl> <nl> We are also grateful to all who filed issues or helped resolve them , asked and <nl> answered questions , and were part of inspiring discussions . <nl> answered questions , and were part of inspiring discussions . <nl> <nl> This release contains contributions from many people at Google , as well as : <nl> <nl> - Abhinav Upadhyay , Aggelos Avgerinos , Alan Wu , Alexander G . de G . Matthews , Aleksandr Yahnev , @ amchercashin , Andy Kitchen , Aurelien Geron , Awni Hannun , @ BanditCat , Bas Veeling , Cameron Chen , @ cg31 , Cheng - Lung Sung , Christopher Bonnett , Dan Becker , Dan Van Boxel , Daniel Golden , Danijar Hafner , Danny Goodman , Dave Decker , David Dao , David Kretch , Dongjoon Hyun , Dustin Dorroh , @ e - lin , Eurico Doirado , Erik Erwitt , Fabrizio Milo , @ gaohuazuo , Iblis Lin , Igor Babuschkin , Isaac Hodes , Isaac Turner , Iván Vallés , J Yegerlehner , Jack Zhang , James Wexler , Jan Zikes , Jay Young , Jeff Hodges , @ jmtatsch , Johnny Lim , Jonas Meinertz Hansen , Kanit Wongsuphasawat , Kashif Rasul , Ken Shirriff , Kenneth Mitchner , Kenta Yonekura , Konrad Magnusson , Konstantin Lopuhin , @ lahwran , @ lekaha , @ liyongsea , Lucas Adams , @ makseq , Mandeep Singh , @ manipopopo , Mark Amery , Memo Akten , Michael Heilman , Michael Peteuil , Nathan Daly , Nicolas Fauchereau , @ ninotoshi , Olav Nymoen , @ panmari , @ papelita1234 , Pedro Lopes , Pranav Sailesh Mani , RJ Ryan , Rob Culliton , Robert DiPietro , @ ronrest , Sam Abrahams , Sarath Shekkizhar , Scott Graham , Sebastian Raschka , Sung Kim , Surya Bhupatiraju , Syed Ahmed , Till Hoffmann , @ timsl , @ urimend , @ vesnica , Vlad Frolov , Vlad Zagorodniy , Wei - Ting Kuo , Wenjian Huang , William Dmitri Breaden Madden , Wladimir Schmidt , Yuwen Yan , Yuxin Wu , Yuya Kusakabe , @ zhongzyd , @ znah . <nl> + Abhinav Upadhyay , Aggelos Avgerinos , Alan Wu , Alexander G . de G . Matthews , Aleksandr Yahnev , @ amchercashin , Andy Kitchen , Aurelien Geron , Awni Hannun , @ BanditCat , Bas Veeling , Cameron Chen , @ cg31 , Cheng - Lung Sung , Christopher Bonnett , Dan Becker , Dan Van Boxel , Daniel Golden , Danijar Hafner , Danny Goodman , Dave Decker , David Dao , David Kretch , Dongjoon Hyun , Dustin Dorroh , @ e - lin , Eurico Doirado , Erik Erwitt , Fabrizio Milo , @ gaohuazuo , Iblis Lin , Igor Babuschkin , Isaac Hodes , Isaac Turner , Iván Vallés , J Yegerlehner , Jack Zhang , James Wexler , Jan Zikes , Jay Young , Jeff Hodges , @ jmtatsch , Johnny Lim , Jonas Meinertz Hansen , Kanit Wongsuphasawat , Kashif Rasul , Ken Shirriff , Kenneth Mitchner , Kenta Yonekura , Konrad Magnusson , Konstantin Lopuhin , @ lahwran , @ lekaha , @ liyongsea , Lucas Adams , @ makseq , Mandeep Singh , @ manipopopo , Mark Amery , Memo Akten , Michael Heilman , Michael Peteuil , Nathan Daly , Nicolas Fauchereau , @ ninotoshi , Olav Nymoen , @ panmari , @ papelita1234 , Pedro Lopes , Pranav Sailesh Mani , RJ Ryan , Rob Culliton , Robert DiPietro , @ ronrest , Sam Abrahams , Sarath Shekkizhar , Scott Graham , Sebastian Raschka , Sung Kim , Surya Bhupatiraju , Syed Ahmed , Till Hoffmann , @ timsl , @ urimend , @ vesnica , Vlad Frolov , Vlad Zagorodniy , Wei - Ting Kuo , Wenjian Huang , William Dmitri Breaden Madden , Wladimir Schmidt , Yuan Tang , Yuwen Yan , Yuxin Wu , Yuya Kusakabe , @ zhongzyd , @ znah . <nl> <nl> We are also grateful to all who filed issues or helped resolve them , asked and <nl> answered questions , and were part of inspiring discussions . <nl> mmm a / tensorflow / contrib / makefile / Makefile <nl> ppp b / tensorflow / contrib / makefile / Makefile <nl> LIBDIR : = $ ( GENDIR ) lib / <nl> BINDIR : = $ ( GENDIR ) bin / <nl> PBTGENDIR : = $ ( GENDIR ) proto_text / <nl> PROTOGENDIR : = $ ( GENDIR ) proto / <nl> + DEPDIR : = $ ( GENDIR ) dep / <nl> + $ ( shell mkdir - p $ ( DEPDIR ) > / dev / null ) <nl> <nl> # Settings for the target compiler . <nl> CXX : = $ ( CC_PREFIX ) gcc <nl> OPTFLAGS : = - O0 <nl> CXXFLAGS : = - - std = c + + 11 - DIS_SLIM_BUILD $ ( OPTFLAGS ) <nl> LDFLAGS : = \ <nl> - L / usr / local / lib <nl> + DEPFLAGS = - MT $ @ - MMD - MP - MF $ ( DEPDIR ) / $ * . Td <nl> <nl> INCLUDES : = \ <nl> - I . \ <nl> ifeq ( $ ( TARGET ) , IOS ) <nl> - L $ ( GENDIR ) protobuf_ios / lib \ <nl> - lz <nl> endif <nl> + OBJDIR : = $ ( OBJDIR ) ios_ $ ( IOS_ARCH ) / <nl> + LIBDIR : = $ ( LIBDIR ) ios_ $ ( IOS_ARCH ) / <nl> + BINDIR : = $ ( BINDIR ) ios_ $ ( IOS_ARCH ) / <nl> + DEPDIR : = $ ( DEPDIR ) ios_ $ ( IOS_ARCH ) / <nl> endif <nl> <nl> # This library is the main target for this makefile . It will contain a minimal <nl> $ ( BENCHMARK_NAME ) : $ ( BENCHMARK_OBJS ) $ ( LIB_PATH ) <nl> # Matches on the normal hand - written TensorFlow C + + source files . <nl> $ ( OBJDIR ) % . o : % . cc | $ ( PBT_GEN_FILES ) <nl> @ mkdir - p $ ( dir $ @ ) <nl> - $ ( CXX ) $ ( CXXFLAGS ) $ ( INCLUDES ) - c $ < - o $ @ <nl> + @ mkdir - p $ ( dir $ ( DEPDIR ) $ * ) <nl> + $ ( CXX ) $ ( CXXFLAGS ) $ ( DEPFLAGS ) $ ( INCLUDES ) - c $ < - o $ @ <nl> + @ mv - f $ ( DEPDIR ) / $ * . Td $ ( DEPDIR ) / $ * . d <nl> <nl> # Compiles C + + source files that have been generated by protoc . <nl> $ ( OBJDIR ) % . pb . o : $ ( PROTOGENDIR ) % . pb . cc <nl> clean : <nl> cleantarget : <nl> rm - rf $ ( OBJDIR ) <nl> rm - rf $ ( BINDIR ) <nl> + <nl> + $ ( DEPDIR ) / % . d : ; <nl> + . PRECIOUS : $ ( DEPDIR ) / % . d <nl> + <nl> + - include $ ( patsubst % , $ ( DEPDIR ) / % . d , $ ( basename $ ( TF_CC_SRCS ) ) ) <nl> mmm a / tensorflow / contrib / makefile / build_all_ios . sh <nl> ppp b / tensorflow / contrib / makefile / build_all_ios . sh <nl> rm - rf tensorflow / contrib / makefile / downloads <nl> # Pull down the required versions of the frameworks we need . <nl> tensorflow / contrib / makefile / download_dependencies . sh <nl> <nl> + # TODO ( petewarden ) - Some new code in Eigen triggers a clang bug , so work <nl> + # around it by patching the source . <nl> + sed - e ' s # static uint32x4_t p4ui_CONJ_XOR = vld1q_u32 ( conj_XOR_DATA ) ; # static uint32x4_t p4ui_CONJ_XOR ; / / = vld1q_u32 ( conj_XOR_DATA ) ; - Removed by script # ' \ <nl> + - i ' ' \ <nl> + tensorflow / contrib / makefile / downloads / eigen - latest / eigen / src / Core / arch / NEON / Complex . h <nl> + sed - e ' s # static uint32x2_t p2ui_CONJ_XOR = vld1_u32 ( conj_XOR_DATA ) ; # static uint32x2_t p2ui_CONJ_XOR ; / / = vld1_u32 ( conj_XOR_DATA ) ; - Removed by scripts # ' \ <nl> + - i ' ' \ <nl> + tensorflow / contrib / makefile / downloads / eigen - latest / eigen / src / Core / arch / NEON / Complex . h <nl> + sed - e ' s # static uint64x2_t p2ul_CONJ_XOR = vld1q_u64 ( p2ul_conj_XOR_DATA ) ; # static uint64x2_t p2ul_CONJ_XOR ; / / = vld1q_u64 ( p2ul_conj_XOR_DATA ) ; - Removed by script # ' \ <nl> + - i ' ' \ <nl> + tensorflow / contrib / makefile / downloads / eigen - latest / eigen / src / Core / arch / NEON / Complex . h <nl> + <nl> # Compile protobuf for the target iOS device architectures . <nl> tensorflow / contrib / makefile / compile_ios_protobuf . sh $ { JOBS_COUNT } <nl> <nl> mmm a / tensorflow / contrib / makefile / compile_ios_tensorflow . sh <nl> ppp b / tensorflow / contrib / makefile / compile_ios_tensorflow . sh <nl> GENDIR = tensorflow / contrib / makefile / gen / <nl> LIBDIR = $ { GENDIR } lib <nl> LIB_PREFIX = libtensorflow - core <nl> <nl> - # TODO ( petewarden ) - Some new code in Eigen triggers a clang bug , so work <nl> - # around it by patching the source . <nl> - sed - e ' s # static uint32x4_t p4ui_CONJ_XOR = vld1q_u32 ( conj_XOR_DATA ) ; # static uint32x4_t p4ui_CONJ_XOR ; / / = vld1q_u32 ( conj_XOR_DATA ) ; - Removed by script # ' \ <nl> - - i ' ' \ <nl> - tensorflow / contrib / makefile / downloads / eigen - latest / eigen / src / Core / arch / NEON / Complex . h <nl> - sed - e ' s # static uint32x2_t p2ui_CONJ_XOR = vld1_u32 ( conj_XOR_DATA ) ; # static uint32x2_t p2ui_CONJ_XOR ; / / = vld1_u32 ( conj_XOR_DATA ) ; - Removed by scripts # ' \ <nl> - - i ' ' \ <nl> - tensorflow / contrib / makefile / downloads / eigen - latest / eigen / src / Core / arch / NEON / Complex . h <nl> - sed - e ' s # static uint64x2_t p2ul_CONJ_XOR = vld1q_u64 ( p2ul_conj_XOR_DATA ) ; # static uint64x2_t p2ul_CONJ_XOR ; / / = vld1q_u64 ( p2ul_conj_XOR_DATA ) ; - Removed by script # ' \ <nl> - - i ' ' \ <nl> - tensorflow / contrib / makefile / downloads / eigen - latest / eigen / src / Core / arch / NEON / Complex . h <nl> - <nl> - make - f tensorflow / contrib / makefile / Makefile cleantarget <nl> make - f tensorflow / contrib / makefile / Makefile \ <nl> TARGET = IOS IOS_ARCH = ARMV7 LIB_NAME = $ { LIB_PREFIX } - armv7 . a OPTFLAGS = " $ 1 " $ 2 $ 3 <nl> if [ $ ? - ne 0 ] <nl> then <nl> exit 1 <nl> fi <nl> <nl> - make - f tensorflow / contrib / makefile / Makefile cleantarget <nl> make - f tensorflow / contrib / makefile / Makefile \ <nl> TARGET = IOS IOS_ARCH = ARMV7S LIB_NAME = $ { LIB_PREFIX } - armv7s . a OPTFLAGS = " $ 1 " $ 2 $ 3 <nl> if [ $ ? - ne 0 ] <nl> then <nl> exit 1 <nl> fi <nl> <nl> - make - f tensorflow / contrib / makefile / Makefile cleantarget <nl> make - f tensorflow / contrib / makefile / Makefile \ <nl> TARGET = IOS IOS_ARCH = ARM64 LIB_NAME = $ { LIB_PREFIX } - arm64 . a OPTFLAGS = " $ 1 " $ 2 $ 3 <nl> if [ $ ? - ne 0 ] <nl> then <nl> exit 1 <nl> fi <nl> <nl> - make - f tensorflow / contrib / makefile / Makefile cleantarget <nl> make - f tensorflow / contrib / makefile / Makefile \ <nl> TARGET = IOS IOS_ARCH = I386 LIB_NAME = $ { LIB_PREFIX } - i386 . a OPTFLAGS = " $ 1 " $ 2 $ 3 <nl> if [ $ ? - ne 0 ] <nl> then <nl> exit 1 <nl> fi <nl> <nl> - make - f tensorflow / contrib / makefile / Makefile cleantarget <nl> make - f tensorflow / contrib / makefile / Makefile \ <nl> TARGET = IOS IOS_ARCH = X86_64 LIB_NAME = $ { LIB_PREFIX } - x86_64 . a OPTFLAGS = " $ 1 " $ 2 $ 3 <nl> if [ $ ? - ne 0 ] <nl> then <nl> fi <nl> <nl> lipo \ <nl> - $ { LIBDIR } / $ { LIB_PREFIX } - armv7 . a \ <nl> - $ { LIBDIR } / $ { LIB_PREFIX } - armv7s . a \ <nl> - $ { LIBDIR } / $ { LIB_PREFIX } - arm64 . a \ <nl> - $ { LIBDIR } / $ { LIB_PREFIX } - i386 . a \ <nl> - $ { LIBDIR } / $ { LIB_PREFIX } - x86_64 . a \ <nl> + $ { LIBDIR } / ios_ARMV7 / $ { LIB_PREFIX } - armv7 . a \ <nl> + $ { LIBDIR } / ios_ARMV7S / $ { LIB_PREFIX } - armv7s . a \ <nl> + $ { LIBDIR } / ios_ARM64 / $ { LIB_PREFIX } - arm64 . a \ <nl> + $ { LIBDIR } / ios_I386 / $ { LIB_PREFIX } - i386 . a \ <nl> + $ { LIBDIR } / ios_X86_64 / $ { LIB_PREFIX } - x86_64 . a \ <nl> - create \ <nl> - output $ { LIBDIR } / $ { LIB_PREFIX } . a <nl> mmm a / tensorflow / contrib / makefile / tf_op_files . txt <nl> ppp b / tensorflow / contrib / makefile / tf_op_files . txt <nl> tensorflow / core / kernels / pad_op . cc <nl> tensorflow / core / kernels / pack_op . cc <nl> tensorflow / core / kernels / ops_util . cc <nl> tensorflow / core / kernels / no_op . cc <nl> + tensorflow / core / kernels / mirror_pad_op . cc <nl> tensorflow / core / kernels / maxpooling_op . cc <nl> tensorflow / core / kernels / matmul_op . cc <nl> tensorflow / core / kernels / lrn_op . cc <nl> mmm a / tensorflow / core / common_runtime / optimization_registry . h <nl> ppp b / tensorflow / core / common_runtime / optimization_registry . h <nl> limitations under the License . <nl> # include " tensorflow / core / graph / graph . h " <nl> <nl> namespace tensorflow { <nl> - class SessionOptions ; <nl> + struct SessionOptions ; <nl> <nl> / / All the parameters used by an optimization pass are packaged in <nl> / / this struct . They should be enough for the optimization pass to use <nl> mmm a / tensorflow / core / common_runtime / simple_graph_execution_state . h <nl> ppp b / tensorflow / core / common_runtime / simple_graph_execution_state . h <nl> limitations under the License . <nl> # include " tensorflow / core / platform / types . h " <nl> <nl> namespace tensorflow { <nl> - class SessionOptions ; <nl> + struct SessionOptions ; <nl> class StepStats ; <nl> class Timeline ; <nl> <nl> mmm a / tensorflow / core / graph / gradients . cc <nl> ppp b / tensorflow / core / graph / gradients . cc <nl> namespace tensorflow { <nl> / / TODO ( andydavis ) Remove some of the code duplicated between this module <nl> / / and that in ' common_runtime / function . cc ' . <nl> / / A few string constant used throughout this module . <nl> - static const char * const kArgOp = " _Arg " ; <nl> - static const char * const kRetOp = " _Retval " ; <nl> static const char * const kGradientOp = " SymbolicGradient " ; <nl> static const char * const kNodeLabel = " Func " ; <nl> <nl> mmm a / tensorflow / core / graph / graph . cc <nl> ppp b / tensorflow / core / graph / graph . cc <nl> namespace tensorflow { <nl> / / Node <nl> <nl> string Node : : DebugString ( ) const { <nl> - if ( this = = nullptr ) { <nl> - return " { nullptr } " ; <nl> - } <nl> string ret = strings : : StrCat ( " { name : ' " , name ( ) , " ' id : " , id_ ) ; <nl> if ( IsSource ( ) ) { <nl> strings : : StrAppend ( & ret , " source } " ) ; <nl> mmm a / tensorflow / core / kernels / argmax_op . cc <nl> ppp b / tensorflow / core / kernels / argmax_op . cc <nl> class ArgOp : public OpKernel { <nl> <nl> OP_REQUIRES ( context , dim > = 0 , errors : : InvalidArgument ( " dim must be > = 0 " ) ) ; <nl> OP_REQUIRES ( context , dim < input_dims , <nl> - errors : : InvalidArgument ( " Minimum tensor rank : " , dim , <nl> + errors : : InvalidArgument ( " Minimum tensor rank : " , dim + 1 , <nl> " but got : " , input_dims ) ) ; <nl> OP_REQUIRES ( <nl> context , input . dim_size ( dim ) > 0 , <nl> mmm a / tensorflow / core / kernels / cwise_op_conj . cc <nl> ppp b / tensorflow / core / kernels / cwise_op_conj . cc <nl> namespace tensorflow { <nl> <nl> REGISTER2 ( UnaryOp , CPU , " Conj " , functor : : conj , complex64 , complex128 ) ; <nl> # if GOOGLE_CUDA <nl> - / / REGISTER_KERNEL_BUILDER ( Name ( " Conj " ) . Device ( DEVICE_GPU ) , <nl> - / / UnaryOp < GPUDevice , functor : : conj < complex64 > > ) ; <nl> + REGISTER_KERNEL_BUILDER ( Name ( " Conj " ) . Device ( DEVICE_GPU ) . TypeConstraint < complex64 > ( " T " ) , <nl> + UnaryOp < GPUDevice , functor : : conj < complex64 > > ) ; <nl> + REGISTER_KERNEL_BUILDER ( Name ( " Conj " ) . Device ( DEVICE_GPU ) . TypeConstraint < complex128 > ( " T " ) , <nl> + UnaryOp < GPUDevice , functor : : conj < complex128 > > ) ; <nl> # endif <nl> } / / namespace tensorflow <nl> mmm a / tensorflow / core / kernels / cwise_op_gpu_conj . cu . cc <nl> ppp b / tensorflow / core / kernels / cwise_op_gpu_conj . cu . cc <nl> limitations under the License . <nl> <nl> namespace tensorflow { <nl> namespace functor { <nl> - / / DEFINE_UNARY1 ( conj , complex64 ) ; / / not working <nl> + DEFINE_UNARY1 ( conj , complex64 ) ; <nl> + DEFINE_UNARY1 ( conj , complex128 ) ; <nl> } / / namespace functor <nl> } / / namespace tensorflow <nl> <nl> mmm a / tensorflow / core / kernels / cwise_op_sub . cc <nl> ppp b / tensorflow / core / kernels / cwise_op_sub . cc <nl> limitations under the License . <nl> namespace tensorflow { <nl> REGISTER7 ( BinaryOp , CPU , " Sub " , functor : : sub , float , Eigen : : half , double , int32 , <nl> int64 , complex64 , complex128 ) ; <nl> + # if defined ( __ANDROID_TYPES_SLIM__ ) <nl> + / / We only register the first type when we have multi - argument calls in the <nl> + / / case where we ' re trying to reduce executable size , but it turns out that the <nl> + / / int32 version of this op is needed , so explicitly include it . <nl> + REGISTER ( BinaryOp , CPU , " Sub " , functor : : sub , int32 ) ; <nl> + # endif / / __ANDROID_TYPES_SLIM__ <nl> # if GOOGLE_CUDA <nl> REGISTER4 ( BinaryOp , GPU , " Sub " , functor : : sub , float , Eigen : : half , double , <nl> int64 ) ; <nl> mmm a / tensorflow / core / kernels / cwise_ops_test . cc <nl> ppp b / tensorflow / core / kernels / cwise_ops_test . cc <nl> limitations under the License . <nl> <nl> namespace tensorflow { <nl> <nl> - / / Creates a Graph which applies a unary " func " on a 3D float tensor <nl> - / / of " num " elements . <nl> - static Graph * Unary ( const string & func , int num ) { <nl> + / / Creates a Graph which applies a unary " func " on a 3D tensor of <nl> + / / type T with " num " elements . <nl> + template < typename T > <nl> + static Graph * Unary ( const string & func , int num , DataType dtype ) { <nl> Graph * g = new Graph ( OpRegistry : : Global ( ) ) ; <nl> - Tensor data ( DT_FLOAT , TensorShape ( { 64 , 64 , num / ( 64 * 64 ) } ) ) ; <nl> + Tensor data ( dtype , TensorShape ( { 64 , 64 , num / ( 64 * 64 ) } ) ) ; <nl> CHECK_GT ( data . NumElements ( ) , 0 ) ; <nl> - data . flat < float > ( ) . setRandom ( ) ; <nl> + data . flat < T > ( ) . setRandom ( ) ; <nl> test : : graph : : Unary ( g , func , test : : graph : : Constant ( g , data ) , 0 ) ; <nl> return g ; <nl> } <nl> static int RowsAndColsArg ( int r , int c ) { return r * kRows + c ; } <nl> static int RowsFromArg ( int arg ) { return ( arg / kRows ) ; } <nl> static int ColsFromArg ( int arg ) { return ( arg % kRows ) ; } <nl> <nl> - # define BM_UNARY ( DEVICE , FUNC ) \ <nl> - static void BM_ # # DEVICE # # _ # # FUNC ( int iters , int num ) { \ <nl> - const int64 tot = static_cast < int64 > ( iters ) * num ; \ <nl> - testing : : ItemsProcessed ( tot ) ; \ <nl> - testing : : BytesProcessed ( tot * sizeof ( float ) ) ; \ <nl> - test : : Benchmark ( # DEVICE , Unary ( # FUNC , num ) ) . Run ( iters ) ; \ <nl> - } \ <nl> - BENCHMARK ( BM_ # # DEVICE # # _ # # FUNC ) - > Range ( 4 < < 10 , 1 < < 20 ) ; <nl> - <nl> - BM_UNARY ( cpu , Floor ) ; <nl> - BM_UNARY ( gpu , Floor ) ; <nl> + # define BM_UNARY ( DEVICE , FUNC , T , TYPE ) \ <nl> + static void BM_ # # DEVICE # # _ # # FUNC # # _ # # TYPE ( int iters , int num ) { \ <nl> + const int64 tot = static_cast < int64 > ( iters ) * num ; \ <nl> + testing : : ItemsProcessed ( tot ) ; \ <nl> + testing : : BytesProcessed ( tot * sizeof ( T ) ) ; \ <nl> + test : : Benchmark ( # DEVICE , Unary < T > ( # FUNC , num , TYPE ) ) . Run ( iters ) ; \ <nl> + } \ <nl> + BENCHMARK ( BM_ # # DEVICE # # _ # # FUNC # # _ # # TYPE ) - > Range ( 4 < < 10 , 1 < < 20 ) ; <nl> + <nl> + BM_UNARY ( cpu , Floor , float , DT_FLOAT ) ; <nl> + BM_UNARY ( gpu , Floor , float , DT_FLOAT ) ; <nl> + BM_UNARY ( cpu , Floor , double , DT_DOUBLE ) ; <nl> + BM_UNARY ( gpu , Floor , double , DT_DOUBLE ) ; <nl> + BM_UNARY ( cpu , Conj , std : : complex < float > , DT_COMPLEX64 ) ; <nl> + BM_UNARY ( gpu , Conj , std : : complex < float > , DT_COMPLEX64 ) ; <nl> + BM_UNARY ( cpu , Conj , std : : complex < double > , DT_COMPLEX128 ) ; <nl> + BM_UNARY ( gpu , Conj , std : : complex < double > , DT_COMPLEX128 ) ; <nl> <nl> / / data func scalar . <nl> static Graph * BinaryScalar ( int num , const string & func ) { <nl> mmm a / tensorflow / core / kernels / lookup_table_init_op . cc <nl> ppp b / tensorflow / core / kernels / lookup_table_init_op . cc <nl> class KeyValueTensorIterator <nl> <nl> Status status ( ) const override { return status_ ; } <nl> <nl> - int64 total_size ( ) const { <nl> + int64 total_size ( ) const override { <nl> return keys_ = = nullptr ? - 1 : keys_ - > NumElements ( ) ; <nl> } <nl> <nl> mmm a / tensorflow / core / ops / math_ops . cc <nl> ppp b / tensorflow / core / ops / math_ops . cc <nl> REGISTER_OP ( " Add " ) <nl> . Doc ( R " doc ( <nl> Returns x + y element - wise . <nl> <nl> - * NOTE * : Add supports broadcasting . AddN does not . <nl> + * NOTE * : ` Add ` supports broadcasting . ` AddN ` does not . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> REGISTER_OP ( " Sub " ) <nl> REGISTER_OP ( " Sub " ) <nl> . SetShapeFn ( BroadcastBinaryOpShapeFn ) <nl> . Doc ( R " doc ( <nl> Returns x - y element - wise . <nl> + <nl> + * NOTE * : ` Sub ` supports broadcasting . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> REGISTER_OP ( " Mul " ) <nl> REGISTER_OP ( " Mul " ) <nl> . SetShapeFn ( BroadcastBinaryOpShapeFn ) <nl> . Doc ( R " doc ( <nl> Returns x * y element - wise . <nl> + <nl> + * NOTE * : ` Mul ` supports broadcasting . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> REGISTER_OP ( " Div " ) . BINARY_MORE ( ) . SetShapeFn ( BroadcastBinaryOpShapeFn ) . Doc ( R " doc ( <nl> Returns x / y element - wise . <nl> + <nl> + * NOTE * : ` Div ` supports broadcasting . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> REGISTER_OP ( " SquaredDifference " ) <nl> REGISTER_OP ( " SquaredDifference " ) <nl> . SetShapeFn ( BroadcastBinaryOpShapeFn ) <nl> . Doc ( R " doc ( <nl> Returns ( x - y ) ( x - y ) element - wise . <nl> + <nl> + * NOTE * : ` SquaredDifference ` supports broadcasting . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> # undef BINARY_FEWER <nl> REGISTER_OP ( " Maximum " ) <nl> . SetIsCommutative ( ) <nl> . SetShapeFn ( BroadcastBinaryOpShapeFn ) <nl> . Doc ( R " doc ( <nl> - Returns the max of x and y ( i . e . x > y ? x : y ) element - wise , broadcasts . <nl> + Returns the max of x and y ( i . e . x > y ? x : y ) element - wise . <nl> + <nl> + * NOTE * : ` Maximum ` supports broadcasting . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> REGISTER_OP ( " Minimum " ) <nl> REGISTER_OP ( " Minimum " ) <nl> . SetIsCommutative ( ) <nl> . SetShapeFn ( BroadcastBinaryOpShapeFn ) <nl> . Doc ( R " doc ( <nl> - Returns the min of x and y ( i . e . x < y ? x : y ) element - wise , broadcasts . <nl> + Returns the min of x and y ( i . e . x < y ? x : y ) element - wise . <nl> + <nl> + * NOTE * : ` Minimum ` supports broadcasting . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> REGISTER_OP ( " Mod " ) <nl> REGISTER_OP ( " Mod " ) <nl> . SetShapeFn ( BroadcastBinaryOpShapeFn ) <nl> . Doc ( R " doc ( <nl> Returns element - wise remainder of division . <nl> + <nl> + * NOTE * : ` Mod ` supports broadcasting . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> REGISTER_OP ( " Pow " ) <nl> REGISTER_OP ( " Less " ) <nl> . COMPARISON ( ) <nl> . Doc ( R " doc ( <nl> Returns the truth value of ( x < y ) element - wise . <nl> + <nl> + * NOTE * : ` Less ` supports broadcasting . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> REGISTER_OP ( " LessEqual " ) <nl> . COMPARISON ( ) <nl> . Doc ( R " doc ( <nl> Returns the truth value of ( x < = y ) element - wise . <nl> + <nl> + * NOTE * : ` LessEqual ` supports broadcasting . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> REGISTER_OP ( " Greater " ) <nl> . COMPARISON ( ) <nl> . Doc ( R " doc ( <nl> Returns the truth value of ( x > y ) element - wise . <nl> + <nl> + * NOTE * : ` Greater ` supports broadcasting . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> REGISTER_OP ( " GreaterEqual " ) <nl> . COMPARISON ( ) <nl> . Doc ( R " doc ( <nl> Returns the truth value of ( x > = y ) element - wise . <nl> + <nl> + * NOTE * : ` GreaterEqual ` supports broadcasting . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> # undef COMPARISON <nl> REGISTER_OP ( " Equal " ) <nl> . EQUALITY_COMPARISON ( ) <nl> . Doc ( R " doc ( <nl> Returns the truth value of ( x = = y ) element - wise . <nl> + <nl> + * NOTE * : ` Equal ` supports broadcasting . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> REGISTER_OP ( " NotEqual " ) <nl> . EQUALITY_COMPARISON ( ) <nl> . Doc ( R " doc ( <nl> Returns the truth value of ( x ! = y ) element - wise . <nl> + <nl> + * NOTE * : ` NotEqual ` supports broadcasting . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> # undef EQUALITY_COMPARISON <nl> REGISTER_OP ( " LogicalAnd " ) <nl> . BINARY_LOGICAL ( ) <nl> . Doc ( R " doc ( <nl> Returns the truth value of x AND y element - wise . <nl> + <nl> + * NOTE * : ` LogicalAnd ` supports broadcasting . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> REGISTER_OP ( " LogicalOr " ) <nl> . BINARY_LOGICAL ( ) <nl> . Doc ( R " doc ( <nl> Returns the truth value of x OR y element - wise . <nl> + <nl> + * NOTE * : ` LogicalOr ` supports broadcasting . More about broadcasting <nl> + [ here ] ( http : / / docs . scipy . org / doc / numpy / user / basics . broadcasting . html ) <nl> ) doc " ) ; <nl> <nl> # undef BINARY_LOGICAL <nl> mmm a / tensorflow / core / ops / ops . pbtxt <nl> ppp b / tensorflow / core / ops / ops . pbtxt <nl> op { <nl> summary : " Decode a PNG - encoded image to a uint8 or uint16 tensor . " <nl> description : " The attr ` channels ` indicates the desired number of color channels for the \ ndecoded image . \ n \ nAccepted values are : \ n \ n * 0 : Use the number of channels in the PNG - encoded image . \ n * 1 : output a grayscale image . \ n * 3 : output an RGB image . \ n * 4 : output an RGBA image . \ n \ nIf needed , the PNG - encoded image is transformed to match the requested number \ nof color channels . " <nl> } <nl> + op { <nl> + name : " DecodeGif " <nl> + input_arg { <nl> + name : " contents " <nl> + description : " 0 - D . The GIF - encoded image . " <nl> + type : DT_STRING <nl> + } <nl> + output_arg { <nl> + name : " image " <nl> + description : " 3 - D with shape ` [ height , width , channels ] ` . " <nl> + type_attr : " dtype " <nl> + } <nl> + attr { <nl> + name : " channels " <nl> + type : " int " <nl> + default_value { <nl> + i : 0 <nl> + } <nl> + description : " Number of color channels for the decoded image . " <nl> + } <nl> + attr { <nl> + name : " dtype " <nl> + type : " type " <nl> + default_value { <nl> + type : DT_UINT8 <nl> + } <nl> + allowed_values { <nl> + list { <nl> + type : DT_UINT8 <nl> + type : DT_UINT16 <nl> + } <nl> + } <nl> + } <nl> + summary : " Decode a GIF - encoded image to a uint8 or uint16 tensor . " <nl> + description : " The attr ` channels ` indicates the desired number of color channels for the \ ndecoded image . \ n \ nAccepted values are : \ n \ n * 0 : Use the number of channels in the GIF - encoded image . \ n * 1 : output a grayscale image . \ n * 3 : output an RGB image . \ n * 4 : output an RGBA image . \ n \ nIf needed , the GIF - encoded image is transformed to match the requested number \ nof color channels . " <nl> + } <nl> op { <nl> name : " DecodeRaw " <nl> input_arg { <nl> mmm a / tensorflow / core / public / version . h <nl> ppp b / tensorflow / core / public / version . h <nl> limitations under the License . <nl> / / TensorFlow uses semantic versioning , see http : / / semver . org / . <nl> <nl> # define TF_MAJOR_VERSION 0 <nl> - # define TF_MINOR_VERSION 9 <nl> - # define TF_PATCH_VERSION 0 <nl> + # define TF_MINOR_VERSION 10 <nl> + # define TF_PATCH_VERSION 0rc0 <nl> <nl> / / TF_VERSION_SUFFIX is non - empty for pre - releases ( e . g . " - alpha " , " - alpha . 1 " , <nl> / / " - beta " , " - rc " , " - rc . 1 " ) <nl> mmm a / tensorflow / examples / how_tos / reading_data / convert_to_records . py <nl> ppp b / tensorflow / examples / how_tos / reading_data / convert_to_records . py <nl> <nl> from __future__ import print_function <nl> <nl> import os <nl> - import numpy <nl> import tensorflow as tf <nl> from tensorflow . contrib . learn . python . learn . datasets import mnist <nl> <nl> mmm a / tensorflow / examples / how_tos / reading_data / fully_connected_preloaded . py <nl> ppp b / tensorflow / examples / how_tos / reading_data / fully_connected_preloaded . py <nl> <nl> from __future__ import division <nl> from __future__ import print_function <nl> <nl> - import os . path <nl> import time <nl> - <nl> - import numpy <nl> import tensorflow as tf <nl> <nl> from tensorflow . examples . tutorials . mnist import input_data <nl> mmm a / tensorflow / examples / how_tos / reading_data / fully_connected_preloaded_var . py <nl> ppp b / tensorflow / examples / how_tos / reading_data / fully_connected_preloaded_var . py <nl> <nl> from __future__ import division <nl> from __future__ import print_function <nl> <nl> - import os . path <nl> import time <nl> - <nl> - import numpy <nl> import tensorflow as tf <nl> <nl> from tensorflow . examples . tutorials . mnist import input_data <nl> mmm a / tensorflow / examples / how_tos / reading_data / fully_connected_reader . py <nl> ppp b / tensorflow / examples / how_tos / reading_data / fully_connected_reader . py <nl> <nl> <nl> import os . path <nl> import time <nl> - <nl> - import numpy <nl> import tensorflow as tf <nl> <nl> from tensorflow . examples . tutorials . mnist import mnist <nl> mmm a / tensorflow / examples / image_retraining / retrain_test . py <nl> ppp b / tensorflow / examples / image_retraining / retrain_test . py <nl> <nl> from __future__ import division <nl> from __future__ import print_function <nl> <nl> - import os <nl> import tensorflow as tf <nl> <nl> from tensorflow . examples . image_retraining import retrain <nl> from tensorflow . python . framework import test_util <nl> - from tensorflow . python . platform import googletest <nl> <nl> <nl> class ImageRetrainingTest ( test_util . TensorFlowTestCase ) : <nl> mmm a / tensorflow / examples / learn / wide_n_deep_tutorial . py <nl> ppp b / tensorflow / examples / learn / wide_n_deep_tutorial . py <nl> def maybe_download ( ) : <nl> urllib . urlretrieve ( " https : / / archive . ics . uci . edu / ml / machine - learning - databases / adult / adult . data " , train_file . name ) # pylint : disable = line - too - long <nl> train_file_name = train_file . name <nl> train_file . close ( ) <nl> - print ( " Training data is downlaoded to % s " % train_file_name ) <nl> + print ( " Training data is downloaded to % s " % train_file_name ) <nl> <nl> if FLAGS . test_data : <nl> test_file_name = FLAGS . test_data <nl> def maybe_download ( ) : <nl> urllib . urlretrieve ( " https : / / archive . ics . uci . edu / ml / machine - learning - databases / adult / adult . test " , test_file . name ) # pylint : disable = line - too - long <nl> test_file_name = test_file . name <nl> test_file . close ( ) <nl> - print ( " Test data is downlaoded to % s " % test_file_name ) <nl> + print ( " Test data is downloaded to % s " % test_file_name ) <nl> <nl> return train_file_name , test_file_name <nl> <nl> mmm a / tensorflow / examples / skflow / multioutput_regression . py <nl> ppp b / tensorflow / examples / skflow / multioutput_regression . py <nl> <nl> <nl> import numpy as np <nl> import matplotlib . pyplot as plt <nl> - from sklearn import datasets <nl> from sklearn . metrics import mean_squared_error <nl> <nl> from tensorflow . contrib import learn <nl> mmm a / tensorflow / examples / tutorials / mnist / fully_connected_feed . py <nl> ppp b / tensorflow / examples / tutorials / mnist / fully_connected_feed . py <nl> def fill_feed_dict ( data_set , images_pl , labels_pl ) : <nl> feed_dict : The feed dictionary mapping from placeholders to values . <nl> " " " <nl> # Create the feed_dict for the placeholders filled with the next <nl> - # ` batch size ` examples . <nl> + # ` batch size ` examples . <nl> images_feed , labels_feed = data_set . next_batch ( FLAGS . batch_size , <nl> FLAGS . fake_data ) <nl> feed_dict = { <nl> mmm a / tensorflow / g3doc / api_docs / cc / ClassEnv . md <nl> ppp b / tensorflow / g3doc / api_docs / cc / ClassEnv . md <nl> Returns the file system schemes registered for this Env . <nl> <nl> <nl> <nl> - # # # # ` Status tensorflow : : Env : : NewRandomAccessFile ( const string & fname , RandomAccessFile * * result ) ` { # Status_tensorflow_Env_NewRandomAccessFile } <nl> + # # # # ` Status tensorflow : : Env : : NewRandomAccessFile ( const string & fname , std : : unique_ptr < RandomAccessFile > * result ) ` { # Status_tensorflow_Env_NewRandomAccessFile } <nl> <nl> Creates a brand new random access read - only file with the specified name . <nl> <nl> The returned file may be concurrently accessed by multiple threads . <nl> <nl> The ownership of the returned RandomAccessFile is passed to the caller and the object should be deleted when is not used . The file object shouldn & apos ; t live longer than the Env object . <nl> <nl> - # # # # ` Status tensorflow : : Env : : NewWritableFile ( const string & fname , WritableFile * * result ) ` { # Status_tensorflow_Env_NewWritableFile } <nl> + # # # # ` Status tensorflow : : Env : : NewWritableFile ( const string & fname , std : : unique_ptr < WritableFile > * result ) ` { # Status_tensorflow_Env_NewWritableFile } <nl> <nl> Creates an object that writes to a new file with the specified name . <nl> <nl> The returned file will only be accessed by one thread at a time . <nl> <nl> The ownership of the returned WritableFile is passed to the caller and the object should be deleted when is not used . The file object shouldn & apos ; t live longer than the Env object . <nl> <nl> - # # # # ` Status tensorflow : : Env : : NewAppendableFile ( const string & fname , WritableFile * * result ) ` { # Status_tensorflow_Env_NewAppendableFile } <nl> + # # # # ` Status tensorflow : : Env : : NewAppendableFile ( const string & fname , std : : unique_ptr < WritableFile > * result ) ` { # Status_tensorflow_Env_NewAppendableFile } <nl> <nl> Creates an object that either appends to an existing file , or writes to a new file ( if the file does not exist to begin with ) . <nl> <nl> The returned file will only be accessed by one thread at a time . <nl> <nl> The ownership of the returned WritableFile is passed to the caller and the object should be deleted when is not used . The file object shouldn & apos ; t live longer than the Env object . <nl> <nl> - # # # # ` Status tensorflow : : Env : : NewReadOnlyMemoryRegionFromFile ( const string & fname , ReadOnlyMemoryRegion * * result ) ` { # Status_tensorflow_Env_NewReadOnlyMemoryRegionFromFile } <nl> + # # # # ` Status tensorflow : : Env : : NewReadOnlyMemoryRegionFromFile ( const string & fname , std : : unique_ptr < ReadOnlyMemoryRegion > * result ) ` { # Status_tensorflow_Env_NewReadOnlyMemoryRegionFromFile } <nl> <nl> Creates a readonly region of memory with the file context . <nl> <nl> Deletes the named file . <nl> <nl> <nl> <nl> + # # # # ` Status tensorflow : : Env : : DeleteRecursively ( const string & dirname , int64 * undeleted_files , int64 * undeleted_dirs ) ` { # Status_tensorflow_Env_DeleteRecursively } <nl> + <nl> + Deletes the specified directory and all subdirectories and files underneath it . undeleted_files and undeleted_dirs stores the number of files and directories that weren & apos ; t deleted ( unspecified if the return status is not OK ) . REQUIRES : undeleted_files , undeleted_dirs to be not null . Typical return codes . <nl> + <nl> + <nl> + <nl> + OK - dirname exists and we were able to delete everything underneath . <nl> + <nl> + NOT_FOUND - dirname doesn & apos ; t exist <nl> + <nl> + PERMISSION_DENIED - dirname or some descendant is not writable <nl> + <nl> + UNIMPLEMENTED - Some underlying functions ( like Delete ) are not implemented <nl> + <nl> # # # # ` Status tensorflow : : Env : : CreateDir ( const string & dirname ) ` { # Status_tensorflow_Env_CreateDir } <nl> <nl> Creates the specified directory . <nl> Deletes the specified directory . <nl> <nl> <nl> <nl> + # # # # ` Status tensorflow : : Env : : Stat ( const string & fname , FileStatistics * stat ) ` { # Status_tensorflow_Env_Stat } <nl> + <nl> + Obtains statistics for the given path . <nl> + <nl> + <nl> + <nl> + # # # # ` Status tensorflow : : Env : : IsDirectory ( const string & fname ) ` { # Status_tensorflow_Env_IsDirectory } <nl> + <nl> + Returns whether the given path is a directory or not . Typical return codes ( not guaranteed exhaustive ) : <nl> + <nl> + <nl> + <nl> + OK - The path exists and is a directory . <nl> + <nl> + FAILED_PRECONDITION - The path exists and is not a directory . <nl> + <nl> + NOT_FOUND - The path entry does not exist . <nl> + <nl> + PERMISSION_DENIED - Insufficient permissions . <nl> + <nl> + UNIMPLEMENTED - The file factory doesn & apos ; t support directories . <nl> + <nl> # # # # ` Status tensorflow : : Env : : GetFileSize ( const string & fname , uint64 * file_size ) ` { # Status_tensorflow_Env_GetFileSize } <nl> <nl> Stores the size of ` fname ` in ` * file_size ` . <nl> Returns the number of micro - seconds since some fixed point in time . Only useful <nl> <nl> <nl> <nl> - # # # # ` virtual void tensorflow : : Env : : SleepForMicroseconds ( int micros ) = 0 ` { # virtual_void_tensorflow_Env_SleepForMicroseconds } <nl> + # # # # ` virtual uint64 tensorflow : : Env : : NowSeconds ( ) ` { # virtual_uint64_tensorflow_Env_NowSeconds } <nl> + <nl> + Returns the number of seconds since some fixed point in time . Only useful for computing deltas of time . <nl> + <nl> + <nl> + <nl> + # # # # ` virtual void tensorflow : : Env : : SleepForMicroseconds ( int64 micros ) = 0 ` { # virtual_void_tensorflow_Env_SleepForMicroseconds } <nl> <nl> Sleeps / delays the thread for the prescribed number of micro - seconds . <nl> <nl> Caller takes ownership of the result and must delete it eventually ( the deletion <nl> <nl> <nl> <nl> - # # # # ` virtual void tensorflow : : Env : : SchedClosureAfter ( int micros , std : : function < void ( ) > closure ) = 0 ` { # virtual_void_tensorflow_Env_SchedClosureAfter } <nl> + # # # # ` virtual void tensorflow : : Env : : SchedClosureAfter ( int64 micros , std : : function < void ( ) > closure ) = 0 ` { # virtual_void_tensorflow_Env_SchedClosureAfter } <nl> <nl> <nl> <nl> mmm a / tensorflow / g3doc / api_docs / cc / ClassEnvWrapper . md <nl> ppp b / tensorflow / g3doc / api_docs / cc / ClassEnvWrapper . md <nl> Returns the number of micro - seconds since some fixed point in time . Only useful <nl> <nl> <nl> <nl> - # # # # ` void tensorflow : : EnvWrapper : : SleepForMicroseconds ( int micros ) override ` { # void_tensorflow_EnvWrapper_SleepForMicroseconds } <nl> + # # # # ` void tensorflow : : EnvWrapper : : SleepForMicroseconds ( int64 micros ) override ` { # void_tensorflow_EnvWrapper_SleepForMicroseconds } <nl> <nl> Sleeps / delays the thread for the prescribed number of micro - seconds . <nl> <nl> Caller takes ownership of the result and must delete it eventually ( the deletion <nl> <nl> <nl> <nl> - # # # # ` void tensorflow : : EnvWrapper : : SchedClosureAfter ( int micros , std : : function < void ( ) > closure ) override ` { # void_tensorflow_EnvWrapper_SchedClosureAfter } <nl> + # # # # ` void tensorflow : : EnvWrapper : : SchedClosureAfter ( int64 micros , std : : function < void ( ) > closure ) override ` { # void_tensorflow_EnvWrapper_SchedClosureAfter } <nl> <nl> <nl> <nl> mmm a / tensorflow / g3doc / api_docs / cc / ClassTensor . md <nl> ppp b / tensorflow / g3doc / api_docs / cc / ClassTensor . md <nl> Represents an n - dimensional array of values . <nl> <nl> # # # # ` tensorflow : : Tensor : : Tensor ( ) ` { # tensorflow_Tensor_Tensor } <nl> <nl> - Default Tensor constructor . Creates a 1 - dimension , 0 - element float tensor . <nl> + Creates a 1 - dimensional , 0 - element float tensor . <nl> <nl> + The returned Tensor is not a scalar ( shape { } ) , but is instead an empty one - dimensional Tensor ( shape { 0 } , NumElements ( ) = = 0 ) . Since it has no elements , it does not need to be assigned a value and is initialized by default ( IsInitialized ( ) is true ) . If this is undesirable , consider creating a one - element scalar which does require initialization : <nl> <nl> + ` ` ` c + + Tensor ( DT_FLOAT , TensorShape ( { } ) ) <nl> + <nl> + ` ` ` <nl> <nl> # # # # ` tensorflow : : Tensor : : Tensor ( DataType type , const TensorShape & shape ) ` { # tensorflow_Tensor_Tensor } <nl> <nl> Creates a tensor with the input ` type ` and ` shape ` , using the allocator ` a ` and <nl> <nl> # # # # ` tensorflow : : Tensor : : Tensor ( DataType type ) ` { # tensorflow_Tensor_Tensor } <nl> <nl> - Creates an uninitialized Tensor of the given data type . <nl> - <nl> + Creates an empty Tensor of the given data type . <nl> <nl> + Like Tensor ( ) , returns a 1 - dimensional , 0 - element Tensor with IsInitialized ( ) returning True . See the Tensor ( ) documentation for details . <nl> <nl> # # # # ` tensorflow : : Tensor : : Tensor ( const Tensor & other ) ` { # tensorflow_Tensor_Tensor } <nl> <nl> Creates an uninitialized Tensor of the given data type . <nl> <nl> <nl> <nl> - # # # # ` tensorflow : : Tensor : : ~ Tensor ( ) ` { # tensorflow_Tensor_Tensor } <nl> + # # # # ` tensorflow : : Tensor : : Tensor ( Tensor & & other ) ` { # tensorflow_Tensor_Tensor } <nl> <nl> Copy constructor . <nl> <nl> <nl> <nl> + # # # # ` tensorflow : : Tensor : : ~ Tensor ( ) ` { # tensorflow_Tensor_Tensor } <nl> + <nl> + <nl> + <nl> + <nl> + <nl> # # # # ` DataType tensorflow : : Tensor : : dtype ( ) const ` { # DataType_tensorflow_Tensor_dtype } <nl> <nl> Returns the data type . <nl> Convenience accessor for the tensor shape . <nl> <nl> # # # # ` bool tensorflow : : Tensor : : IsInitialized ( ) const ` { # bool_tensorflow_Tensor_IsInitialized } <nl> <nl> - Has this Tensor been initialized ? <nl> - <nl> + If necessary , has this Tensor been initialized ? <nl> <nl> + Zero - element Tensors are always considered initialized , even if they have never been assigned to and do not have any memory allocated . <nl> <nl> # # # # ` size_t tensorflow : : Tensor : : TotalBytes ( ) const ` { # size_t_tensorflow_Tensor_TotalBytes } <nl> <nl> Assign operator . This tensor shares other & apos ; s underlying storage . <nl> <nl> <nl> <nl> + # # # # ` Tensor & tensorflow : : Tensor : : operator = ( Tensor & & other ) ` { # Tensor_tensorflow_Tensor_operator_ } <nl> + <nl> + Move operator . See move constructor for details . <nl> + <nl> + <nl> + <nl> # # # # ` bool tensorflow : : Tensor : : CopyFrom ( const Tensor & other , const TensorShape & shape ) TF_MUST_USE_RESULT ` { # bool_tensorflow_Tensor_CopyFrom } <nl> <nl> Copy the other tensor into this tensor and reshape it . <nl> auto mat = my_mat . matrix < int32 > ( ) ; / / CHECK fails as type mismatch . <nl> <nl> <nl> <nl> + # # # # ` TTypes < T , NDIMS > : : Tensor tensorflow : : Tensor : : bit_casted_tensor ( ) ` { # TTypes_T_NDIMS_Tensor_tensorflow_Tensor_bit_casted_tensor } <nl> + <nl> + Return the tensor data to an ` Eigen : : Tensor ` with the same size but a bitwise cast to the specified dtype ` T ` . <nl> + <nl> + Using a bitcast is useful for move and copy operations . NOTE : this is the same as ` tensor ( ) ` except a bitcast is allowed . <nl> + <nl> # # # # ` TTypes < T > : : Flat tensorflow : : Tensor : : flat ( ) ` { # TTypes_T_Flat_tensorflow_Tensor_flat } <nl> <nl> Return the tensor data as an ` Eigen : : Tensor ` of the data type and a specified shape . <nl> Returns the data as an Eigen : : Tensor with NDIMS dimensions , collapsing all Tenso <nl> <nl> <nl> <nl> + # # # # ` TTypes < T , NDIMS > : : Tensor tensorflow : : Tensor : : bit_casted_shaped ( gtl : : ArraySlice < int64 > new_sizes ) ` { # TTypes_T_NDIMS_Tensor_tensorflow_Tensor_bit_casted_shaped } <nl> + <nl> + Return the tensor data to an ` Eigen : : Tensor ` with the new shape specified in ` new_sizes ` and cast to a new dtype ` T ` . <nl> + <nl> + Using a bitcast is useful for move and copy operations . The allowed bitcast is the only difference from ` shaped ( ) ` . <nl> + <nl> # # # # ` TTypes < T , NDIMS > : : UnalignedTensor tensorflow : : Tensor : : unaligned_shaped ( gtl : : ArraySlice < int64 > new_sizes ) ` { # TTypes_T_NDIMS_UnalignedTensor_tensorflow_Tensor_unaligned_shaped } <nl> <nl> <nl> Const versions of all the methods above . <nl> <nl> <nl> <nl> + # # # # ` TTypes < T , NDIMS > : : ConstTensor tensorflow : : Tensor : : bit_casted_tensor ( ) const ` { # TTypes_T_NDIMS_ConstTensor_tensorflow_Tensor_bit_casted_tensor } <nl> + <nl> + Return the tensor data to an ` Eigen : : Tensor ` with the same size but a bitwise cast to the specified dtype ` T ` . <nl> + <nl> + Using a bitcast is useful for move and copy operations . NOTE : this is the same as ` tensor ( ) ` except a bitcast is allowed . <nl> + <nl> # # # # ` TTypes < T > : : ConstFlat tensorflow : : Tensor : : flat ( ) const ` { # TTypes_T_ConstFlat_tensorflow_Tensor_flat } <nl> <nl> <nl> Const versions of all the methods above . <nl> <nl> <nl> <nl> + # # # # ` TTypes < T , NDIMS > : : ConstTensor tensorflow : : Tensor : : bit_casted_shaped ( gtl : : ArraySlice < int64 > new_sizes ) const ` { # TTypes_T_NDIMS_ConstTensor_tensorflow_Tensor_bit_casted_shaped } <nl> + <nl> + Return the tensor data to an ` Eigen : : Tensor ` with the new shape specified in ` new_sizes ` and cast to a new dtype ` T ` . <nl> + <nl> + Using a bitcast is useful for move and copy operations . The allowed bitcast is the only difference from ` shaped ( ) ` . <nl> + <nl> # # # # ` TTypes < T , NDIMS > : : UnalignedConstTensor tensorflow : : Tensor : : unaligned_shaped ( gtl : : ArraySlice < int64 > new_sizes ) const ` { # TTypes_T_NDIMS_UnalignedConstTensor_tensorflow_Tensor_unaligned_shaped } <nl> <nl> <nl> The returned ` StringPiece ` may point to memory location on devices that the CP <nl> <nl> NOTE : The underlying tensor buffer is refcounted , so the lifetime of the contents mapped by the ` StringPiece ` matches the lifetime of the buffer ; callers should arrange to make sure the buffer does not get destroyed while the ` StringPiece ` is still used . <nl> <nl> - REQUIRES : ` DataTypeCanUseMemcpy ( dtype ( ) ) ` . <nl> + REQUIRES : ` DataTypeCanUseMemcpy ( dtype ( ) ) ` . <nl> <nl> # # # # ` void tensorflow : : Tensor : : UnsafeCopyFromInternal ( const Tensor & , const TensorShape & ) ` { # void_tensorflow_Tensor_UnsafeCopyFromInternal } <nl> <nl> mmm a / tensorflow / g3doc / api_docs / cc / ClassTensorShape . md <nl> ppp b / tensorflow / g3doc / api_docs / cc / ClassTensorShape . md <nl> Copy the specified shape . <nl> <nl> <nl> <nl> + # # # # ` tensorflow : : TensorShape : : TensorShape ( TensorShape & & b ) ` { # tensorflow_TensorShape_TensorShape } <nl> + <nl> + Move the specified shape . After moving , is safe for destruction and . <nl> + <nl> + <nl> + <nl> + # # # # ` void tensorflow : : TensorShape : : operator = ( TensorShape & & b ) ` { # void_tensorflow_TensorShape_operator_ } <nl> + <nl> + <nl> + <nl> + <nl> + <nl> # # # # ` void tensorflow : : TensorShape : : Clear ( ) ` { # void_tensorflow_TensorShape_Clear } <nl> <nl> Clear a tensor shape . <nl> mmm a / tensorflow / g3doc / api_docs / cc / ClassTensorShapeUtils . md <nl> ppp b / tensorflow / g3doc / api_docs / cc / ClassTensorShapeUtils . md <nl> Static helper routines for ` TensorShape ` . Includes a few common predicates on <nl> <nl> <nl> <nl> - # # # # ` static Status tensorflow : : TensorShapeUtils : : MakeShape ( const int32 * dims , int n , TensorShape * out ) ` { # static_Status_tensorflow_TensorShapeUtils_MakeShape } <nl> + # # # # ` static Status tensorflow : : TensorShapeUtils : : MakeShape ( const int32 * dims , int64 n , TensorShape * out ) ` { # static_Status_tensorflow_TensorShapeUtils_MakeShape } <nl> <nl> Returns a ` TensorShape ` whose dimensions are ` dims [ 0 ] ` , ` dims [ 1 ] ` , . . . , ` dims [ n - 1 ] ` . <nl> <nl> <nl> <nl> - # # # # ` static Status tensorflow : : TensorShapeUtils : : MakeShape ( const int64 * dims , int n , TensorShape * out ) ` { # static_Status_tensorflow_TensorShapeUtils_MakeShape } <nl> + # # # # ` static Status tensorflow : : TensorShapeUtils : : MakeShape ( const int64 * dims , int64 n , TensorShape * out ) ` { # static_Status_tensorflow_TensorShapeUtils_MakeShape } <nl> + <nl> + <nl> + <nl> + <nl> + <nl> + # # # # ` static Status tensorflow : : TensorShapeUtils : : MakeShape ( gtl : : ArraySlice < int32 > shape , TensorShape * out ) ` { # static_Status_tensorflow_TensorShapeUtils_MakeShape } <nl> + <nl> + <nl> + <nl> + <nl> + <nl> + # # # # ` static Status tensorflow : : TensorShapeUtils : : MakeShape ( gtl : : ArraySlice < int64 > shape , TensorShape * out ) ` { # static_Status_tensorflow_TensorShapeUtils_MakeShape } <nl> <nl> <nl> <nl> mmm a / tensorflow / g3doc / api_docs / cc / StructTF_Buffer . md <nl> ppp b / tensorflow / g3doc / api_docs / cc / StructTF_Buffer . md <nl> <nl> <nl> <nl> <nl> - # # # # ` void ( * TF_Buffer : : data_deallocator ) ( void * data , size_t length ) ) ( void * data , size_t length ) ` { # void_TF_Buffer_data_deallocator_void_data_size_t_length_ } <nl> + # # # # ` void ( * TF_Buffer : : data_deallocator ) ( void * data , size_t length ) ) ( void * data , size_t length ) ` { # void_TF_Buffer_data_deallocator_void_data_size_t_length_ } <nl> <nl> <nl> <nl> mmm a / tensorflow / g3doc / api_docs / index . md <nl> ppp b / tensorflow / g3doc / api_docs / index . md <nl> languages like Go , Java , JavaScript , Lua , R , and perhaps others . With <nl> [ SWIG ] ( http : / / swig . org ) , it ' s relatively easy to develop a TensorFlow interface <nl> for your favorite language . <nl> <nl> - Note : Many practical aspects of usage are covered in the Mechanics tab , and <nl> - some additional documentation not specific to any particular language API is <nl> - available in the Resources tab . <nl> + Note : Many practical aspects of usage are covered in the TUTORIALS and <nl> + HOW TO tab , and some additional documentation not specific to any <nl> + particular language API is available in the RESOURCES tab . <nl> <nl> * [ Python API ] ( python / index . md ) <nl> * [ C + + API ] ( cc / index . md ) <nl> mmm a / tensorflow / g3doc / api_docs / python / functions_and_classes / shard0 / tf . nn . rnn . md <nl> ppp b / tensorflow / g3doc / api_docs / python / functions_and_classes / shard0 / tf . nn . rnn . md <nl> <nl> <nl> Creates a recurrent neural network specified by RNNCell ` cell ` . <nl> <nl> - # # # # # The simplest form of RNN network generated is : <nl> - <nl> + The simplest form of RNN network generated is : <nl> + ` ` ` py <nl> state = cell . zero_state ( . . . ) <nl> outputs = [ ] <nl> for input_ in inputs : <nl> output , state = cell ( input_ , state ) <nl> outputs . append ( output ) <nl> return ( outputs , state ) <nl> - <nl> + ` ` ` <nl> However , a few other options are available : <nl> <nl> An initial state can be provided . <nl> mmm a / tensorflow / g3doc / api_docs / python / functions_and_classes / shard6 / tf . train . exponential_decay . md <nl> ppp b / tensorflow / g3doc / api_docs / python / functions_and_classes / shard6 / tf . train . exponential_decay . md <nl> learning_rate = tf . train . exponential_decay ( starter_learning_rate , global_step , <nl> 100000 , 0 . 96 , staircase = True ) <nl> # Passing global_step to minimize ( ) will increment it at each step . <nl> learning_step = ( <nl> - tf . GradientDescentOptimizer ( learning_rate ) <nl> + tf . train . GradientDescentOptimizer ( learning_rate ) <nl> . minimize ( . . . my loss . . . , global_step = global_step ) <nl> ) <nl> ` ` ` <nl> mmm a / tensorflow / g3doc / api_docs / python / nn . md <nl> ppp b / tensorflow / g3doc / api_docs / python / nn . md <nl> automatically performed . <nl> <nl> Creates a recurrent neural network specified by RNNCell ` cell ` . <nl> <nl> - # # # # # The simplest form of RNN network generated is : <nl> - <nl> + The simplest form of RNN network generated is : <nl> + ` ` ` py <nl> state = cell . zero_state ( . . . ) <nl> outputs = [ ] <nl> for input_ in inputs : <nl> output , state = cell ( input_ , state ) <nl> outputs . append ( output ) <nl> return ( outputs , state ) <nl> - <nl> + ` ` ` <nl> However , a few other options are available : <nl> <nl> An initial state can be provided . <nl> mmm a / tensorflow / g3doc / get_started / os_setup . md <nl> ppp b / tensorflow / g3doc / get_started / os_setup . md <nl> Then , select the correct binary to install : <nl> <nl> ` ` ` bash <nl> # Ubuntu / Linux 64 - bit , CPU only , Python 2 . 7 <nl> - $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 9 . 0 - cp27 - none - linux_x86_64 . whl <nl> + $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 10 . 0rc0 - cp27 - none - linux_x86_64 . whl <nl> <nl> # Ubuntu / Linux 64 - bit , GPU enabled , Python 2 . 7 <nl> # Requires CUDA toolkit 7 . 5 and CuDNN v4 . For other versions , see " Install from sources " below . <nl> - $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 9 . 0 - cp27 - none - linux_x86_64 . whl <nl> + $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 10 . 0rc0 - cp27 - none - linux_x86_64 . whl <nl> <nl> # Mac OS X , CPU only , Python 2 . 7 : <nl> - $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / tensorflow - 0 . 9 . 0 - py2 - none - any . whl <nl> + $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / cpu / tensorflow - 0 . 10 . 0rc0 - py2 - none - any . whl <nl> + <nl> + # Mac OS X , GPU enabled , Python 2 . 7 : <nl> + $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / gpu / tensorflow - 0 . 10 . 0rc0 - py2 - none - any . whl <nl> <nl> # Ubuntu / Linux 64 - bit , CPU only , Python 3 . 4 <nl> - $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 9 . 0 - cp34 - cp34m - linux_x86_64 . whl <nl> + $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 10 . 0rc0 - cp34 - cp34m - linux_x86_64 . whl <nl> <nl> # Ubuntu / Linux 64 - bit , GPU enabled , Python 3 . 4 <nl> # Requires CUDA toolkit 7 . 5 and CuDNN v4 . For other versions , see " Install from sources " below . <nl> - $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 9 . 0 - cp34 - cp34m - linux_x86_64 . whl <nl> + $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 10 . 0rc0 - cp34 - cp34m - linux_x86_64 . whl <nl> <nl> # Ubuntu / Linux 64 - bit , CPU only , Python 3 . 5 <nl> - $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 9 . 0 - cp35 - cp35m - linux_x86_64 . whl <nl> + $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 10 . 0rc0 - cp35 - cp35m - linux_x86_64 . whl <nl> <nl> # Ubuntu / Linux 64 - bit , GPU enabled , Python 3 . 5 <nl> # Requires CUDA toolkit 7 . 5 and CuDNN v4 . For other versions , see " Install from sources " below . <nl> - $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 9 . 0 - cp35 - cp35m - linux_x86_64 . whl <nl> + $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 10 . 0rc0 - cp35 - cp35m - linux_x86_64 . whl <nl> <nl> # Mac OS X , CPU only , Python 3 . 4 or 3 . 5 : <nl> - $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / tensorflow - 0 . 9 . 0 - py3 - none - any . whl <nl> + $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / cpu / tensorflow - 0 . 10 . 0rc0 - py3 - none - any . whl <nl> + <nl> + # Mac OS X , GPU enabled , Python 3 . 4 or 3 . 5 : <nl> + $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / gpu / tensorflow - 0 . 10 . 0rc0 - py3 - none - any . whl <nl> ` ` ` <nl> <nl> Install TensorFlow : <nl> Now , install TensorFlow just as you would for a regular Pip installation . First <nl> <nl> ` ` ` bash <nl> # Ubuntu / Linux 64 - bit , CPU only , Python 2 . 7 <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 9 . 0 - cp27 - none - linux_x86_64 . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 10 . 0rc0 - cp27 - none - linux_x86_64 . whl <nl> <nl> # Ubuntu / Linux 64 - bit , GPU enabled , Python 2 . 7 <nl> # Requires CUDA toolkit 7 . 5 and CuDNN v4 . For other versions , see " Install from sources " below . <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 9 . 0 - cp27 - none - linux_x86_64 . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 10 . 0rc0 - cp27 - none - linux_x86_64 . whl <nl> <nl> # Mac OS X , CPU only , Python 2 . 7 : <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / tensorflow - 0 . 9 . 0 - py2 - none - any . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / cpu / tensorflow - 0 . 10 . 0rc0 - py2 - none - any . whl <nl> + <nl> + # Mac OS X , GPU enabled , Python 2 . 7 : <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / gpu / tensorflow - 0 . 10 . 0rc0 - py2 - none - any . whl <nl> <nl> # Ubuntu / Linux 64 - bit , CPU only , Python 3 . 4 <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 9 . 0 - cp34 - cp34m - linux_x86_64 . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 10 . 0rc0 - cp34 - cp34m - linux_x86_64 . whl <nl> <nl> # Ubuntu / Linux 64 - bit , GPU enabled , Python 3 . 4 <nl> # Requires CUDA toolkit 7 . 5 and CuDNN v4 . For other versions , see " Install from sources " below . <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 9 . 0 - cp34 - cp34m - linux_x86_64 . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 10 . 0rc0 - cp34 - cp34m - linux_x86_64 . whl <nl> <nl> # Ubuntu / Linux 64 - bit , CPU only , Python 3 . 5 <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 9 . 0 - cp35 - cp35m - linux_x86_64 . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 10 . 0rc0 - cp35 - cp35m - linux_x86_64 . whl <nl> <nl> # Ubuntu / Linux 64 - bit , GPU enabled , Python 3 . 5 <nl> # Requires CUDA toolkit 7 . 5 and CuDNN v4 . For other versions , see " Install from sources " below . <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 9 . 0 - cp35 - cp35m - linux_x86_64 . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 10 . 0rc0 - cp35 - cp35m - linux_x86_64 . whl <nl> <nl> # Mac OS X , CPU only , Python 3 . 4 or 3 . 5 : <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / tensorflow - 0 . 9 . 0 - py3 - none - any . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / cpu / tensorflow - 0 . 10 . 0rc0 - py3 - none - any . whl <nl> + <nl> + # Mac OS X , GPU enabled , Python 3 . 4 or 3 . 5 : <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / gpu / tensorflow - 0 . 10 . 0rc0 - py3 - none - any . whl <nl> ` ` ` <nl> <nl> Finally install TensorFlow : <nl> packages needed by TensorFlow . <nl> * Activate the conda environment and install TensorFlow in it . <nl> * After the install you will activate the conda environment each time you <nl> want to use TensorFlow . <nl> + * Optionally install ipython and other packages into the conda environment <nl> <nl> Install Anaconda : <nl> <nl> $ conda create - n tensorflow python = 3 . 5 <nl> <nl> Activate the environment and use conda or pip to install TensorFlow inside it . <nl> <nl> + <nl> # # # Using conda <nl> <nl> A community maintained conda package is available [ from conda - forge ] ( https : / / github . com / conda - forge / tensorflow - feedstock ) . <nl> Now , install TensorFlow just as you would for a regular Pip installation . First <nl> <nl> ` ` ` bash <nl> # Ubuntu / Linux 64 - bit , CPU only , Python 2 . 7 <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 9 . 0 - cp27 - none - linux_x86_64 . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 10 . 0rc0 - cp27 - none - linux_x86_64 . whl <nl> <nl> # Ubuntu / Linux 64 - bit , GPU enabled , Python 2 . 7 <nl> # Requires CUDA toolkit 7 . 5 and CuDNN v4 . For other versions , see " Install from sources " below . <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 9 . 0 - cp27 - none - linux_x86_64 . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 10 . 0rc0 - cp27 - none - linux_x86_64 . whl <nl> <nl> # Mac OS X , CPU only , Python 2 . 7 : <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / tensorflow - 0 . 9 . 0 - py2 - none - any . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / cpu / tensorflow - 0 . 10 . 0rc0 - py2 - none - any . whl <nl> + <nl> + # Mac OS X , GPU enabled , Python 2 . 7 : <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / gpu / tensorflow - 0 . 10 . 0rc0 - py2 - none - any . whl <nl> <nl> # Ubuntu / Linux 64 - bit , CPU only , Python 3 . 4 <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 9 . 0 - cp34 - cp34m - linux_x86_64 . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 10 . 0rc0 - cp34 - cp34m - linux_x86_64 . whl <nl> <nl> # Ubuntu / Linux 64 - bit , GPU enabled , Python 3 . 4 <nl> # Requires CUDA toolkit 7 . 5 and CuDNN v4 . For other versions , see " Install from sources " below . <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 9 . 0 - cp34 - cp34m - linux_x86_64 . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 10 . 0rc0 - cp34 - cp34m - linux_x86_64 . whl <nl> <nl> # Ubuntu / Linux 64 - bit , CPU only , Python 3 . 5 <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 9 . 0 - cp35 - cp35m - linux_x86_64 . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / cpu / tensorflow - 0 . 10 . 0rc0 - cp35 - cp35m - linux_x86_64 . whl <nl> <nl> # Ubuntu / Linux 64 - bit , GPU enabled , Python 3 . 5 <nl> # Requires CUDA toolkit 7 . 5 and CuDNN v4 . For other versions , see " Install from sources " below . <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 9 . 0 - cp35 - cp35m - linux_x86_64 . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / linux / gpu / tensorflow - 0 . 10 . 0rc0 - cp35 - cp35m - linux_x86_64 . whl <nl> <nl> # Mac OS X , CPU only , Python 3 . 4 or 3 . 5 : <nl> - ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / tensorflow - 0 . 9 . 0 - py3 - none - any . whl <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / cpu / tensorflow - 0 . 10 . 0rc0 - py3 - none - any . whl <nl> + <nl> + # Mac OS X , GPU enabled , Python 3 . 4 or 3 . 5 : <nl> + ( tensorflow ) $ export TF_BINARY_URL = https : / / storage . googleapis . com / tensorflow / mac / gpu / tensorflow - 0 . 10 . 0rc0 - py3 - none - any . whl <nl> ` ` ` <nl> <nl> Finally install TensorFlow : <nl> $ source activate tensorflow <nl> ( tensorflow ) $ source deactivate <nl> ` ` ` <nl> <nl> + # # # Install IPython <nl> + <nl> + To use tensorflow with IPython it may be necessary to install IPython into the tensorflow environment : <nl> + <nl> + ` ` ` bash <nl> + $ source activate tensorflow <nl> + ( tensorflow ) $ conda install ipython <nl> + ` ` ` <nl> + <nl> + Similarly , other Python packages like pandas may need to get installed into the tensorflow environment <nl> + before they can be used together with tensorflow . <nl> + <nl> + <nl> # # Docker installation <nl> <nl> [ Docker ] ( http : / / docker . com / ) is a system to build self contained versions of a <nl> code . <nl> * ` gcr . io / tensorflow / tensorflow : latest - devel - gpu ` : GPU Binary image plus source <nl> code . <nl> <nl> - We also have tags with ` latest ` replaced by a released version ( e . g . , ` 0 . 9 . 0 - gpu ` ) . <nl> + We also have tags with ` latest ` replaced by a released version ( e . g . , ` 0 . 10 . 0rc0 - gpu ` ) . <nl> <nl> With Docker the installation is as follows : <nl> <nl> which you can install as follows : <nl> $ sudo easy_install ipython <nl> ` ` ` <nl> <nl> + # # # # Optional : Setup GPU for Mac <nl> + <nl> If you plan to build with GPU support you will need to make sure you have <nl> GNU coreutils installed via homebrew : <nl> <nl> $ sudo mv lib / libcudnn * / Developer / NVIDIA / CUDA - 7 . 5 / lib <nl> $ sudo ln - s / Developer / NVIDIA / CUDA - 7 . 5 / lib / libcudnn * / usr / local / cuda / lib / <nl> ` ` ` <nl> <nl> + To verify the CUDA installation , you can build and run deviceQuery to make sure <nl> + it passes . <nl> + <nl> + ` ` ` bash <nl> + $ cp - r / usr / local / cuda / samples ~ / cuda - samples <nl> + $ pushd ~ / cuda - samples <nl> + $ make <nl> + $ popd <nl> + $ ~ / cuda - samples / bin / x86_64 / darwin / release / deviceQuery <nl> + ` ` ` <nl> + <nl> + If you want to compile tensorflow and have the XCode 7 . 3 installed , note that <nl> + Xcode 7 . 3 is not yet compatible with CUDA 7 . 5 . You will need to download Xcode <nl> + 7 . 2 and select it as your default : <nl> + <nl> + ` ` ` bash <nl> + $ sudo xcode - select - s / Application / Xcode - 7 . 2 / Xcode . app <nl> + ` ` ` <nl> + <nl> + <nl> # # # Configure the installation <nl> <nl> Run the ` configure ` script at the root of the tree . The configure script <nl> $ bazel build - c opt - - config = cuda / / tensorflow / tools / pip_package : build_pip_pack <nl> $ bazel - bin / tensorflow / tools / pip_package / build_pip_package / tmp / tensorflow_pkg <nl> <nl> # The name of the . whl file will depend on your platform . <nl> - $ sudo pip install / tmp / tensorflow_pkg / tensorflow - 0 . 9 . 0 - py2 - none - any . whl <nl> + $ sudo pip install / tmp / tensorflow_pkg / tensorflow - 0 . 10 . 0rc0 - py2 - none - any . whl <nl> ` ` ` <nl> <nl> # # Setting up TensorFlow for Development <nl> mmm a / tensorflow / g3doc / how_tos / using_gpu / index . md <nl> ppp b / tensorflow / g3doc / how_tos / using_gpu / index . md <nl> within that context will have the same device assignment . <nl> with tf . device ( ' / cpu : 0 ' ) : <nl> a = tf . constant ( [ 1 . 0 , 2 . 0 , 3 . 0 , 4 . 0 , 5 . 0 , 6 . 0 ] , shape = [ 2 , 3 ] , name = ' a ' ) <nl> b = tf . constant ( [ 1 . 0 , 2 . 0 , 3 . 0 , 4 . 0 , 5 . 0 , 6 . 0 ] , shape = [ 3 , 2 ] , name = ' b ' ) <nl> - c = tf . matmul ( a , b ) <nl> + c = tf . matmul ( a , b ) <nl> # Creates a session with log_device_placement set to True . <nl> sess = tf . Session ( config = tf . ConfigProto ( log_device_placement = True ) ) <nl> # Runs the op . <nl> mmm a / tensorflow / python / ops / rnn . py <nl> ppp b / tensorflow / python / ops / rnn . py <nl> def rnn ( cell , inputs , initial_state = None , dtype = None , <nl> " " " Creates a recurrent neural network specified by RNNCell ` cell ` . <nl> <nl> The simplest form of RNN network generated is : <nl> + ` ` ` py <nl> state = cell . zero_state ( . . . ) <nl> outputs = [ ] <nl> for input_ in inputs : <nl> output , state = cell ( input_ , state ) <nl> outputs . append ( output ) <nl> return ( outputs , state ) <nl> - <nl> + ` ` ` <nl> However , a few other options are available : <nl> <nl> An initial state can be provided . <nl> mmm a / tensorflow / python / ops / rnn_cell . py <nl> ppp b / tensorflow / python / ops / rnn_cell . py <nl> def _state_size_with_prefix ( state_size , prefix = None ) : <nl> class RNNCell ( object ) : <nl> " " " Abstract object representing an RNN cell . <nl> <nl> + The definition of cell in this package differs from the definition used in the <nl> + literature . In the literature , cell refers to an object with a single scalar <nl> + output . The definition in this package refers to a horizontal array of such <nl> + units . <nl> + <nl> An RNN cell , in the most abstract setting , is anything that has <nl> a state and performs some operation that takes a matrix of inputs . <nl> This operation results in an output matrix with ` self . output_size ` columns . <nl> mmm a / tensorflow / python / platform / tf_logging . py <nl> ppp b / tensorflow / python / platform / tf_logging . py <nl> <nl> fatal = _logger . fatal <nl> info = _logger . info <nl> warn = _logger . warn <nl> - warning = _logger . warn <nl> + warning = _logger . warning <nl> <nl> _level_names = { <nl> FATAL : ' FATAL ' , <nl> mmm a / tensorflow / python / training / learning_rate_decay . py <nl> ppp b / tensorflow / python / training / learning_rate_decay . py <nl> def exponential_decay ( learning_rate , global_step , decay_steps , decay_rate , <nl> 100000 , 0 . 96 , staircase = True ) <nl> # Passing global_step to minimize ( ) will increment it at each step . <nl> learning_step = ( <nl> - tf . GradientDescentOptimizer ( learning_rate ) <nl> + tf . train . GradientDescentOptimizer ( learning_rate ) <nl> . minimize ( . . . my loss . . . , global_step = global_step ) <nl> ) <nl> ` ` ` <nl> def polynomial_decay ( learning_rate , global_step , decay_steps , <nl> power = 0 . 5 ) <nl> # Passing global_step to minimize ( ) will increment it at each step . <nl> learning_step = ( <nl> - tf . GradientDescentOptimizer ( learning_rate ) <nl> + tf . train . GradientDescentOptimizer ( learning_rate ) <nl> . minimize ( . . . my loss . . . , global_step = global_step ) <nl> ) <nl> ` ` ` <nl> def natural_exp_decay ( learning_rate , global_step , decay_steps , decay_rate , <nl> <nl> # Passing global_step to minimize ( ) will increment it at each step . <nl> learning_step = ( <nl> - tf . GradientDescentOptimizer ( learning_rate ) <nl> + tf . train . GradientDescentOptimizer ( learning_rate ) <nl> . minimize ( . . . my loss . . . , global_step = global_step ) <nl> ) <nl> ` ` ` <nl> def inverse_time_decay ( learning_rate , global_step , decay_steps , decay_rate , <nl> <nl> # Passing global_step to minimize ( ) will increment it at each step . <nl> learning_step = ( <nl> - tf . GradientDescentOptimizer ( learning_rate ) <nl> + tf . train . GradientDescentOptimizer ( learning_rate ) <nl> . minimize ( . . . my loss . . . , global_step = global_step ) <nl> ) <nl> ` ` ` <nl> mmm a / tensorflow / tensorboard / README . md <nl> ppp b / tensorflow / tensorboard / README . md <nl> work , but there may be bugs or performance issues . <nl> <nl> The first step in using TensorBoard is acquiring data from your TensorFlow run . <nl> For this , you need [ summary <nl> - ops ] ( https : / / www . tensorflow . org / versions / r0 . 9 / api_docs / python / train . html # summary - operations ) . <nl> + ops ] ( https : / / www . tensorflow . org / versions / r0 . 10 / api_docs / python / train . html # summary - operations ) . <nl> Summary ops are ops , like <nl> - [ ` tf . matmul ` ] ( https : / / www . tensorflow . org / versions / r0 . 9 / api_docs / python / math_ops . html # matmul ) <nl> + [ ` tf . matmul ` ] ( https : / / www . tensorflow . org / versions / r0 . 10 / api_docs / python / math_ops . html # matmul ) <nl> or <nl> - [ ` tf . nn . relu ` ] ( https : / / www . tensorflow . org / versions / r0 . 9 / api_docs / python / nn . html # relu ) , <nl> + [ ` tf . nn . relu ` ] ( https : / / www . tensorflow . org / versions / r0 . 10 / api_docs / python / nn . html # relu ) , <nl> which means they take in tensors , produce tensors , and are evaluated from within <nl> a TensorFlow graph . However , summary ops have a twist : the Tensors they produce <nl> contain serialized protobufs , which are written to disk and sent to TensorBoard . <nl> To visualize the summary data in TensorBoard , you should evaluate the summary <nl> op , retrieve the result , and then write that result to disk using a <nl> SummaryWriter . A full explanation , with examples , is in [ the <nl> - tutorial ] ( https : / / www . tensorflow . org / versions / r0 . 9 / how_tos / summaries_and_tensorboard / index . html ) . <nl> + tutorial ] ( https : / / www . tensorflow . org / versions / r0 . 10 / how_tos / summaries_and_tensorboard / index . html ) . <nl> <nl> # # # Tags : Giving names to data <nl> <nl> TensorFlow model . To get best use of the graph visualizer , you should use name <nl> scopes to hierarchically group the ops in your graph - otherwise , the graph may <nl> be difficult to decipher . For more information , including examples , see [ the <nl> graph visualizer <nl> - tutorial ] ( https : / / www . tensorflow . org / versions / r0 . 9 / how_tos / graph_viz / index . html # tensorboard - graph - visualization ) . <nl> + tutorial ] ( https : / / www . tensorflow . org / versions / r0 . 10 / how_tos / graph_viz / index . html # tensorboard - graph - visualization ) . <nl> <nl> # Frequently Asked Questions <nl> <nl> mmm a / tensorflow / tools / ci_build / Dockerfile . debian . jessie . cpu <nl> ppp b / tensorflow / tools / ci_build / Dockerfile . debian . jessie . cpu <nl> RUN / install / install_deb_packages . sh <nl> RUN / install / install_pip_packages . sh <nl> RUN / install / install_bazel . sh <nl> <nl> + # Fix a virtualenv install issue specific to Debian Jessie . <nl> + RUN pip install - - upgrade virtualenv <nl> + <nl> # Set up bazelrc . <nl> COPY install / . bazelrc / root / . bazelrc <nl> ENV BAZELRC / root / . bazelrc <nl> mmm a / tensorflow / tools / ci_build / builds / pip . sh <nl> ppp b / tensorflow / tools / ci_build / builds / pip . sh <nl> fi <nl> <nl> PIP_BUILD_TARGET = " / / tensorflow / tools / pip_package : build_pip_package " <nl> GPU_FLAG = " " <nl> - if [ [ $ { CONTAINER_TYPE } = = " cpu " ] ] ; then <nl> + if [ [ $ { CONTAINER_TYPE } = = " cpu " ] ] | | \ <nl> + [ [ $ { CONTAINER_TYPE } = = " debian . jessie . cpu " ] ] ; then <nl> bazel build - c opt $ { MAVX_FLAG } $ { PIP_BUILD_TARGET } | | \ <nl> die " Build failed . " <nl> elif [ [ $ { CONTAINER_TYPE } = = " gpu " ] ] ; then <nl> mmm a / tensorflow / tools / ci_build / ci_parameterized_build . sh <nl> ppp b / tensorflow / tools / ci_build / ci_parameterized_build . sh <nl> if [ [ - z " $ ( which docker ) " ] ] ; then <nl> fi <nl> <nl> # Process container type <nl> - if [ [ $ { CTYPE } = = " cpu " ] ] ; then <nl> + if [ [ $ { CTYPE } = = " cpu " ] ] | | [ [ $ { CTYPE } = = " debian . jessie . cpu " ] ] ; then <nl> : <nl> elif [ [ $ { CTYPE } = = " gpu " ] ] ; then <nl> OPT_FLAG = " $ { OPT_FLAG } - - config = cuda " <nl> if [ [ $ { TF_BUILD_IS_PIP } = = " no_pip " ] ] | | <nl> BAZEL_TARGET = $ { TF_BUILD_BAZEL_TARGET } <nl> fi <nl> <nl> - if [ [ $ { CTYPE } = = " cpu " ] ] | | [ [ $ { CTYPE } = = " gpu " ] ] ; then <nl> + if [ [ $ { CTYPE } = = " cpu " ] ] | | \ <nl> + [ [ $ { CTYPE } = = " debian . jessie . cpu " ] ] | | \ <nl> + [ [ $ { CTYPE } = = " gpu " ] ] ; then <nl> # Run Bazel <nl> NO_PIP_MAIN_CMD = " $ { MAIN_CMD } $ { BAZEL_CMD } $ { OPT_FLAG } " \ <nl> " $ { EXTRA_ARGS } $ { BAZEL_TARGET } " <nl> mmm a / tensorflow / tools / dist_test / Dockerfile <nl> ppp b / tensorflow / tools / dist_test / Dockerfile <nl> RUN / var / gcloud / google - cloud - sdk / bin / gcloud components install kubectl <nl> # Install nightly TensorFlow pip <nl> # TODO ( cais ) : Should we build it locally instead ? <nl> RUN pip install \ <nl> - http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = cpu - slave / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 9 . 0 - cp27 - none - linux_x86_64 . whl <nl> + http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = cpu - slave / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 10 . 0rc0 - cp27 - none - linux_x86_64 . whl <nl> <nl> # Copy test files <nl> COPY scripts / var / tf - dist - test / scripts <nl> mmm a / tensorflow / tools / dist_test / server / Dockerfile <nl> ppp b / tensorflow / tools / dist_test / server / Dockerfile <nl> RUN curl - O https : / / bootstrap . pypa . io / get - pip . py & & \ <nl> <nl> # Install TensorFlow CPU version from nightly build <nl> RUN pip - - no - cache - dir install \ <nl> - http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = cpu - slave / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 9 . 0 - cp27 - none - linux_x86_64 . whl <nl> + http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = cpu - slave / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 10 . 0rc0 - cp27 - none - linux_x86_64 . whl <nl> <nl> # Copy files , including the GRPC server binary at <nl> # server / grpc_tensorflow_server . py <nl> mmm a / tensorflow / tools / dist_test / server / Dockerfile . test <nl> ppp b / tensorflow / tools / dist_test / server / Dockerfile . test <nl> RUN pip install - - upgrade pandas = = 0 . 18 . 1 <nl> <nl> # Install TensorFlow CPU version . <nl> RUN pip - - no - cache - dir install \ <nl> - http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = cpu - slave / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 9 . 0 - cp27 - none - linux_x86_64 . whl <nl> + http : / / ci . tensorflow . org / view / Nightly / job / nightly - matrix - cpu / TF_BUILD_CONTAINER_TYPE = CPU , TF_BUILD_IS_OPT = OPT , TF_BUILD_IS_PIP = PIP , TF_BUILD_PYTHON_VERSION = PYTHON2 , label = cpu - slave / lastSuccessfulBuild / artifact / pip_test / whl / tensorflow - 0 . 10 . 0rc0 - cp27 - none - linux_x86_64 . whl <nl> <nl> # Copy files , including the GRPC server binary at <nl> # server / grpc_tensorflow_server . py <nl> mmm a / tensorflow / tools / docker / Dockerfile <nl> ppp b / tensorflow / tools / docker / Dockerfile <nl> RUN pip - - no - cache - dir install \ <nl> & & \ <nl> python - m ipykernel . kernelspec <nl> <nl> - ENV TENSORFLOW_VERSION 0 . 9 . 0 <nl> + ENV TENSORFLOW_VERSION 0 . 10 . 0rc0 <nl> <nl> # mmm DO NOT EDIT OR DELETE BETWEEN THE LINES mmm # <nl> # These lines will be edited automatically by parameterized_docker_build . sh . # <nl> mmm a / tensorflow / tools / docker / Dockerfile . devel <nl> ppp b / tensorflow / tools / docker / Dockerfile . devel <nl> RUN mkdir / bazel & & \ <nl> <nl> RUN git clone - - recursive https : / / github . com / tensorflow / tensorflow . git & & \ <nl> cd tensorflow & & \ <nl> - git checkout r0 . 9 <nl> + git checkout r0 . 10 <nl> WORKDIR / tensorflow <nl> <nl> # TODO ( craigcitro ) : Don ' t install the pip package , since it makes it <nl> mmm a / tensorflow / tools / docker / Dockerfile . devel - gpu <nl> ppp b / tensorflow / tools / docker / Dockerfile . devel - gpu <nl> RUN mkdir / bazel & & \ <nl> <nl> # Download and build TensorFlow . <nl> <nl> - RUN git clone - b r0 . 9 - - recursive - - recurse - submodules https : / / github . com / tensorflow / tensorflow . git & & \ <nl> + RUN git clone - b r0 . 10 - - recursive - - recurse - submodules https : / / github . com / tensorflow / tensorflow . git & & \ <nl> cd tensorflow & & \ <nl> - git checkout r0 . 9 <nl> + git checkout r0 . 10 <nl> WORKDIR / tensorflow <nl> <nl> # Configure the build for our CUDA configuration . <nl> mmm a / tensorflow / tools / docker / Dockerfile . gpu <nl> ppp b / tensorflow / tools / docker / Dockerfile . gpu <nl> RUN pip - - no - cache - dir install \ <nl> & & \ <nl> python - m ipykernel . kernelspec <nl> <nl> - ENV TENSORFLOW_VERSION 0 . 9 . 0 <nl> + ENV TENSORFLOW_VERSION 0 . 10 . 0rc0 <nl> <nl> # mmm DO NOT EDIT OR DELETE BETWEEN THE LINES mmm # <nl> # These lines will be edited automatically by parameterized_docker_build . sh . # <nl> mmm a / tensorflow / tools / docker / parameterized_docker_build . sh <nl> ppp b / tensorflow / tools / docker / parameterized_docker_build . sh <nl> if [ [ " $ { DO_PIP_BUILD } " = = " 1 " ] ] ; then <nl> export TF_BUILD_IS_OPT = " OPT " <nl> export TF_BUILD_IS_PIP = " PIP " <nl> <nl> - export TF_BUILD_APPEND_CI_DOCKER_EXTRA_PARAMS = \ <nl> - " - e TF_CUDA_COMPUTE_CAPABILITIES = 3 . 0 , 3 . 5 , 5 . 2 " <nl> + if [ [ " $ { TF_DOCKER_BUILD_TYPE } " = = " gpu " ] ] ; then <nl> + export TF_BUILD_APPEND_CI_DOCKER_EXTRA_PARAMS = \ <nl> + " $ { TF_BUILD_APPEND_CI_DOCKER_EXTRA_PARAMS } - e TF_CUDA_COMPUTE_CAPABILITIES = 3 . 0 , 3 . 5 , 5 . 2 " <nl> + fi <nl> <nl> pushd " $ { SCRIPT_DIR } / . . / . . / . . / " <nl> rm - rf pip_test / whl & & <nl> mmm a / tensorflow / tools / pip_package / setup . py <nl> ppp b / tensorflow / tools / pip_package / setup . py <nl> <nl> from setuptools . command . install import install as InstallCommandBase <nl> from setuptools . dist import Distribution <nl> <nl> - _VERSION = ' 0 . 9 . 0 ' <nl> + _VERSION = ' 0 . 10 . 0rc0 ' <nl> <nl> numpy_version = " 1 . 8 . 2 " <nl> if platform . system ( ) = = " Darwin " : <nl> mmm a / third_party / gpus / crosstool / CROSSTOOL <nl> ppp b / third_party / gpus / crosstool / CROSSTOOL <nl> default_toolchain { <nl> cpu : " darwin " <nl> toolchain_identifier : " local_darwin " <nl> } <nl> + default_toolchain { <nl> + cpu : " ppc " <nl> + toolchain_identifier : " local_linux " <nl> + } <nl> <nl> toolchain { <nl> abi_version : " local " <nl>
Merge changes from github .
tensorflow/tensorflow
abe9ab326625105adb3c9d46c027931aec947d1f
2016-08-01T06:17:46Z
mmm a / doc / cascadia / profiles . schema . json <nl> ppp b / doc / cascadia / profiles . schema . json <nl> <nl> " description " : " When set to ` true ` , the color and font formatting of selected text is also copied to your clipboard . When set to ` false ` , only plain text is copied to your clipboard . An array of specific formats can also be used . Supported array values include ` html ` and ` rtf ` . Plain text is always copied . " , <nl> " $ ref " : " # / definitions / CopyFormat " <nl> } , <nl> + " disableAnimations " : { <nl> + " default " : false , <nl> + " description " : " When set to ` true ` , visual animations will be disabled across the application . " , <nl> + " type " : " boolean " <nl> + } , <nl> " largePasteWarning " : { <nl> " default " : true , <nl> " description " : " When set to true , trying to paste text with more than 5 KiB of characters will display a warning asking you whether to continue or not with the paste . " , <nl> mmm a / src / cascadia / TerminalApp / Pane . cpp <nl> ppp b / src / cascadia / TerminalApp / Pane . cpp <nl> static const int PaneBorderSize = 2 ; <nl> static const int CombinedPaneBorderSize = 2 * PaneBorderSize ; <nl> static const float Half = 0 . 50f ; <nl> <nl> + / / WARNING : Don ' t do this ! This won ' t work <nl> + / / Duration duration { std : : chrono : : milliseconds { 200 } } ; <nl> + / / Instead , make a duration from a TimeSpan from the time in millis <nl> + / / <nl> + / / 200ms was chosen because it ' s quick enough that it doesn ' t break your <nl> + / / flow , but not too quick to see <nl> + static const int AnimationDurationInMilliseconds = 200 ; <nl> + static const Duration AnimationDuration = DurationHelper : : FromTimeSpan ( winrt : : Windows : : Foundation : : TimeSpan ( std : : chrono : : milliseconds ( AnimationDurationInMilliseconds ) ) ) ; <nl> + <nl> winrt : : Windows : : UI : : Xaml : : Media : : SolidColorBrush Pane : : s_focusedBorderBrush = { nullptr } ; <nl> winrt : : Windows : : UI : : Xaml : : Media : : SolidColorBrush Pane : : s_unfocusedBorderBrush = { nullptr } ; <nl> <nl> Pane : : Pane ( const GUID & profile , const TermControl & control , const bool lastFocus <nl> _SetupResources ( ) ; <nl> } <nl> <nl> + / / Use the unfocused border color as the pane background , so an actual color <nl> + / / appears behind panes as we animate them sliding in . <nl> + _root . Background ( s_unfocusedBorderBrush ) ; <nl> + <nl> / / Register an event with the control to have it inform us when it gains focus . <nl> _gotFocusRevoker = control . GotFocus ( winrt : : auto_revoke , { this , & Pane : : _ControlGotFocusHandler } ) ; <nl> <nl> void Pane : : _ControlConnectionStateChangedHandler ( const TermControl & / * sender * / , <nl> if ( ( mode = = CloseOnExitMode : : Always ) | | <nl> ( mode = = CloseOnExitMode : : Graceful & & newConnectionState = = ConnectionState : : Closed ) ) <nl> { <nl> - _ClosedHandlers ( nullptr , nullptr ) ; <nl> + Close ( ) ; <nl> } <nl> } <nl> } <nl> winrt : : fire_and_forget Pane : : _CloseChildRoutine ( const bool closeFirst ) <nl> <nl> if ( auto pane { weakThis . get ( ) } ) <nl> { <nl> - _CloseChild ( closeFirst ) ; <nl> + / / This will query if animations are enabled via the " Show animations in <nl> + / / Windows " setting in the OS <nl> + winrt : : Windows : : UI : : ViewManagement : : UISettings uiSettings ; <nl> + const auto animationsEnabledInOS = uiSettings . AnimationsEnabled ( ) ; <nl> + const auto animationsEnabledInApp = Media : : Animation : : Timeline : : AllowDependentAnimations ( ) ; <nl> + <nl> + / / If animations are disabled , just skip this and go straight to <nl> + / / _CloseChild . Curiously , the pane opening animation doesn ' t need this , <nl> + / / and will skip straight to Completed when animations are disabled , but <nl> + / / this one doesn ' t seem to . <nl> + if ( ! animationsEnabledInOS | | ! animationsEnabledInApp ) <nl> + { <nl> + pane - > _CloseChild ( closeFirst ) ; <nl> + co_return ; <nl> + } <nl> + <nl> + / / Setup the animation <nl> + <nl> + auto removedChild = closeFirst ? _firstChild : _secondChild ; <nl> + auto remainingChild = closeFirst ? _secondChild : _firstChild ; <nl> + const bool splitWidth = _splitState = = SplitState : : Vertical ; <nl> + const auto totalSize = splitWidth ? _root . ActualWidth ( ) : _root . ActualHeight ( ) ; <nl> + <nl> + Size removedOriginalSize { <nl> + : : base : : saturated_cast < float > ( removedChild - > _root . ActualWidth ( ) ) , <nl> + : : base : : saturated_cast < float > ( removedChild - > _root . ActualHeight ( ) ) <nl> + } ; <nl> + Size remainingOriginalSize { <nl> + : : base : : saturated_cast < float > ( remainingChild - > _root . ActualWidth ( ) ) , <nl> + : : base : : saturated_cast < float > ( remainingChild - > _root . ActualHeight ( ) ) <nl> + } ; <nl> + <nl> + / / Remove both children from the grid <nl> + _root . Children ( ) . Clear ( ) ; <nl> + / / Add the remaining child back to the grid , in the right place . <nl> + _root . Children ( ) . Append ( remainingChild - > GetRootElement ( ) ) ; <nl> + if ( _splitState = = SplitState : : Vertical ) <nl> + { <nl> + Controls : : Grid : : SetColumn ( remainingChild - > GetRootElement ( ) , closeFirst ? 1 : 0 ) ; <nl> + } <nl> + else if ( _splitState = = SplitState : : Horizontal ) <nl> + { <nl> + Controls : : Grid : : SetRow ( remainingChild - > GetRootElement ( ) , closeFirst ? 1 : 0 ) ; <nl> + } <nl> + <nl> + / / Create the dummy grid . This grid will be the one we actually animate , <nl> + / / in the place of the closed pane . <nl> + Controls : : Grid dummyGrid ; <nl> + dummyGrid . Background ( s_unfocusedBorderBrush ) ; <nl> + / / It should be the size of the closed pane . <nl> + dummyGrid . Width ( removedOriginalSize . Width ) ; <nl> + dummyGrid . Height ( removedOriginalSize . Height ) ; <nl> + / / Put it where the removed child is <nl> + if ( _splitState = = SplitState : : Vertical ) <nl> + { <nl> + Controls : : Grid : : SetColumn ( dummyGrid , closeFirst ? 0 : 1 ) ; <nl> + } <nl> + else if ( _splitState = = SplitState : : Horizontal ) <nl> + { <nl> + Controls : : Grid : : SetRow ( dummyGrid , closeFirst ? 0 : 1 ) ; <nl> + } <nl> + / / Add it to the tree <nl> + _root . Children ( ) . Append ( dummyGrid ) ; <nl> + <nl> + / / Set up the rows / cols as auto / auto , so they ' ll only use the size of <nl> + / / the elements in the grid . <nl> + / / <nl> + / / * For the closed pane , we want to make that row / col " auto " sized , so <nl> + / / it takes up as much space as is available . <nl> + / / * For the remaining pane , we ' ll make that row / col " * " sized , so it <nl> + / / takes all the remaining space . As the dummy grid is resized down , <nl> + / / the remaining pane will expand to take the rest of the space . <nl> + _root . ColumnDefinitions ( ) . Clear ( ) ; <nl> + _root . RowDefinitions ( ) . Clear ( ) ; <nl> + if ( _splitState = = SplitState : : Vertical ) <nl> + { <nl> + auto firstColDef = Controls : : ColumnDefinition ( ) ; <nl> + auto secondColDef = Controls : : ColumnDefinition ( ) ; <nl> + firstColDef . Width ( ! closeFirst ? GridLengthHelper : : FromValueAndType ( 1 , GridUnitType : : Star ) : GridLengthHelper : : Auto ( ) ) ; <nl> + secondColDef . Width ( closeFirst ? GridLengthHelper : : FromValueAndType ( 1 , GridUnitType : : Star ) : GridLengthHelper : : Auto ( ) ) ; <nl> + _root . ColumnDefinitions ( ) . Append ( firstColDef ) ; <nl> + _root . ColumnDefinitions ( ) . Append ( secondColDef ) ; <nl> + } <nl> + else if ( _splitState = = SplitState : : Horizontal ) <nl> + { <nl> + auto firstRowDef = Controls : : RowDefinition ( ) ; <nl> + auto secondRowDef = Controls : : RowDefinition ( ) ; <nl> + firstRowDef . Height ( ! closeFirst ? GridLengthHelper : : FromValueAndType ( 1 , GridUnitType : : Star ) : GridLengthHelper : : Auto ( ) ) ; <nl> + secondRowDef . Height ( closeFirst ? GridLengthHelper : : FromValueAndType ( 1 , GridUnitType : : Star ) : GridLengthHelper : : Auto ( ) ) ; <nl> + _root . RowDefinitions ( ) . Append ( firstRowDef ) ; <nl> + _root . RowDefinitions ( ) . Append ( secondRowDef ) ; <nl> + } <nl> + <nl> + / / Animate the dummy grid from its current size down to 0 <nl> + Media : : Animation : : DoubleAnimation animation { } ; <nl> + animation . Duration ( AnimationDuration ) ; <nl> + animation . From ( splitWidth ? removedOriginalSize . Width : removedOriginalSize . Height ) ; <nl> + animation . To ( 0 . 0 ) ; <nl> + / / This easing is the same as the entrance animation . <nl> + animation . EasingFunction ( Media : : Animation : : QuadraticEase { } ) ; <nl> + animation . EnableDependentAnimation ( true ) ; <nl> + <nl> + Media : : Animation : : Storyboard s ; <nl> + s . Duration ( AnimationDuration ) ; <nl> + s . Children ( ) . Append ( animation ) ; <nl> + s . SetTarget ( animation , dummyGrid ) ; <nl> + s . SetTargetProperty ( animation , splitWidth ? L " Width " : L " Height " ) ; <nl> + <nl> + / / Start the animation . <nl> + s . Begin ( ) ; <nl> + <nl> + std : : weak_ptr < Pane > weakThis { shared_from_this ( ) } ; <nl> + <nl> + / / When the animation is completed , reparent the child ' s content up to <nl> + / / us , and remove the child nodes from the tree . <nl> + animation . Completed ( [ weakThis , closeFirst ] ( auto & & , auto & & ) { <nl> + if ( auto pane { weakThis . lock ( ) } ) <nl> + { <nl> + / / We don ' t need to manually undo any of the above trickiness . <nl> + / / We ' re going to re - parent the child ' s content into us anyways <nl> + pane - > _CloseChild ( closeFirst ) ; <nl> + } <nl> + } ) ; <nl> } <nl> } <nl> <nl> void Pane : : _ApplySplitDefinitions ( ) <nl> } <nl> } <nl> <nl> + / / Method Description : <nl> + / / - Create a pair of animations when a new control enters this pane . This <nl> + / / should _ONLY_ be called in _Split , AFTER the first and second child panes <nl> + / / have been set up . <nl> + void Pane : : _SetupEntranceAnimation ( ) <nl> + { <nl> + / / This will query if animations are enabled via the " Show animations in <nl> + / / Windows " setting in the OS <nl> + winrt : : Windows : : UI : : ViewManagement : : UISettings uiSettings ; <nl> + const auto animationsEnabledInOS = uiSettings . AnimationsEnabled ( ) ; <nl> + <nl> + const bool splitWidth = _splitState = = SplitState : : Vertical ; <nl> + const auto totalSize = splitWidth ? _root . ActualWidth ( ) : _root . ActualHeight ( ) ; <nl> + / / If we don ' t have a size yet , it ' s likely that we ' re in startup , or we ' re <nl> + / / being executed as a sequence of actions . In that case , just skip the <nl> + / / animation . <nl> + if ( totalSize < = 0 | | ! animationsEnabledInOS ) <nl> + { <nl> + return ; <nl> + } <nl> + <nl> + const auto [ firstSize , secondSize ] = _CalcChildrenSizes ( : : base : : saturated_cast < float > ( totalSize ) ) ; <nl> + <nl> + / / This is safe to capture this , because it ' s only being called in the <nl> + / / context of this method ( not on another thread ) <nl> + auto setupAnimation = [ & ] ( const auto & size , const bool isFirstChild ) { <nl> + auto child = isFirstChild ? _firstChild : _secondChild ; <nl> + auto childGrid = child - > _root ; <nl> + auto control = child - > _control ; <nl> + / / Build up our animation : <nl> + / / * it ' ll take as long as our duration ( 200ms ) <nl> + / / * it ' ll change the value of our property from 0 to secondSize <nl> + / / * it ' ll animate that value using a quadratic function ( like f ( t ) = t ^ 2 ) <nl> + / / * IMPORTANT ! We ' ll manually tell the animation that " yes we know what <nl> + / / we ' re doing , we want an animation here . " <nl> + Media : : Animation : : DoubleAnimation animation { } ; <nl> + animation . Duration ( AnimationDuration ) ; <nl> + if ( isFirstChild ) <nl> + { <nl> + / / If we ' re animating the first pane , the size should decrease , from <nl> + / / the full size down to the given size . <nl> + animation . From ( totalSize ) ; <nl> + animation . To ( size ) ; <nl> + } <nl> + else <nl> + { <nl> + / / Otherwise , we want to show the pane getting larger , so animate <nl> + / / from 0 to the requested size . <nl> + animation . From ( 0 . 0 ) ; <nl> + animation . To ( size ) ; <nl> + } <nl> + animation . EasingFunction ( Media : : Animation : : QuadraticEase { } ) ; <nl> + animation . EnableDependentAnimation ( true ) ; <nl> + <nl> + / / Now we ' re going to set up the Storyboard . This is a unit that uses the <nl> + / / Animation from above , and actually applies it to a property . <nl> + / / * we ' ll set it up for the same duration as the animation we have <nl> + / / * Apply the animation to the grid of the new pane we ' re adding to the tree . <nl> + / / * apply the animation to the Width or Height property . <nl> + Media : : Animation : : Storyboard s ; <nl> + s . Duration ( AnimationDuration ) ; <nl> + s . Children ( ) . Append ( animation ) ; <nl> + s . SetTarget ( animation , childGrid ) ; <nl> + s . SetTargetProperty ( animation , splitWidth ? L " Width " : L " Height " ) ; <nl> + <nl> + / / BE TRICKY : <nl> + / / We ' re animating the width or height of our child pane ' s grid . <nl> + / / <nl> + / / We DON ' T want to change the size of the control itself , because the <nl> + / / terminal has to reflow the buffer every time the control changes size . So <nl> + / / what we ' re going to do there is manually set the control ' s size to how <nl> + / / big we _actually know_ the control will be . <nl> + / / <nl> + / / We ' re also going to be changing alignment of our child pane and the <nl> + / / control . This way , we ' ll be able to have the control stick to the inside <nl> + / / of the child pane ' s grid ( the side that ' s moving ) , while we also have the <nl> + / / pane ' s grid stick to " outside " of the grid ( the side that ' s not moving ) <nl> + if ( splitWidth ) <nl> + { <nl> + / / If we ' re animating the first child , then stick to the top / left of <nl> + / / the parent pane , otherwise use the bottom / right . This is always <nl> + / / the " outside " of the parent pane . <nl> + childGrid . HorizontalAlignment ( isFirstChild ? HorizontalAlignment : : Left : HorizontalAlignment : : Right ) ; <nl> + control . HorizontalAlignment ( HorizontalAlignment : : Left ) ; <nl> + control . Width ( isFirstChild ? totalSize : size ) ; <nl> + } <nl> + else <nl> + { <nl> + / / If we ' re animating the first child , then stick to the top / left of <nl> + / / the parent pane , otherwise use the bottom / right . This is always <nl> + / / the " outside " of the parent pane . <nl> + childGrid . VerticalAlignment ( isFirstChild ? VerticalAlignment : : Top : VerticalAlignment : : Bottom ) ; <nl> + control . VerticalAlignment ( VerticalAlignment : : Top ) ; <nl> + control . Height ( isFirstChild ? totalSize : size ) ; <nl> + } <nl> + <nl> + / / Start the animation . <nl> + s . Begin ( ) ; <nl> + <nl> + std : : weak_ptr < Pane > weakThis { shared_from_this ( ) } ; <nl> + / / When the animation is completed , undo the trickiness from before , to <nl> + / / restore the controls to the behavior they ' d usually have . <nl> + animation . Completed ( [ weakThis , isFirstChild , splitWidth ] ( auto & & , auto & & ) { <nl> + if ( auto pane { weakThis . lock ( ) } ) <nl> + { <nl> + auto child = isFirstChild ? pane - > _firstChild : pane - > _secondChild ; <nl> + auto childGrid = child - > _root ; <nl> + if ( auto control = child - > _control ) <nl> + { <nl> + if ( splitWidth ) <nl> + { <nl> + control . Width ( NAN ) ; <nl> + childGrid . Width ( NAN ) ; <nl> + childGrid . HorizontalAlignment ( HorizontalAlignment : : Stretch ) ; <nl> + control . HorizontalAlignment ( HorizontalAlignment : : Stretch ) ; <nl> + } <nl> + else <nl> + { <nl> + control . Height ( NAN ) ; <nl> + childGrid . Height ( NAN ) ; <nl> + childGrid . VerticalAlignment ( VerticalAlignment : : Stretch ) ; <nl> + control . VerticalAlignment ( VerticalAlignment : : Stretch ) ; <nl> + } <nl> + } <nl> + } <nl> + } ) ; <nl> + } ; <nl> + <nl> + / / TODO : GH # 7365 - animating the first child right now doesn ' t _really_ do <nl> + / / anything . We could do better though . <nl> + setupAnimation ( firstSize , true ) ; <nl> + setupAnimation ( secondSize , false ) ; <nl> + } <nl> + <nl> / / Method Description : <nl> / / - Determines whether the pane can be split <nl> / / Arguments : <nl> std : : pair < std : : shared_ptr < Pane > , std : : shared_ptr < Pane > > Pane : : _Split ( SplitState <nl> <nl> _lastActive = false ; <nl> <nl> + _SetupEntranceAnimation ( ) ; <nl> + <nl> return { _firstChild , _secondChild } ; <nl> } <nl> <nl> mmm a / src / cascadia / TerminalApp / Pane . h <nl> ppp b / src / cascadia / TerminalApp / Pane . h <nl> class Pane : public std : : enable_shared_from_this < Pane > <nl> <nl> void _CreateRowColDefinitions ( ) ; <nl> void _ApplySplitDefinitions ( ) ; <nl> + void _SetupEntranceAnimation ( ) ; <nl> void _UpdateBorders ( ) ; <nl> <nl> bool _Resize ( const winrt : : Microsoft : : Terminal : : Settings : : Model : : Direction & direction ) ; <nl> mmm a / src / cascadia / TerminalApp / TerminalPage . cpp <nl> ppp b / src / cascadia / TerminalApp / TerminalPage . cpp <nl> namespace winrt : : TerminalApp : : implementation <nl> } <nl> } ) ; <nl> <nl> + / / Settings AllowDependentAnimations will affect whether animations are <nl> + / / enabled application - wide , so we don ' t need to check it each time we <nl> + / / want to create an animation . <nl> + WUX : : Media : : Animation : : Timeline : : AllowDependentAnimations ( ! _settings . GlobalSettings ( ) . DisableAnimations ( ) ) ; <nl> + <nl> / / Once the page is actually laid out on the screen , trigger all our <nl> / / startup actions . Things like Panes need to know at least how big the <nl> / / window will be , so they can subdivide that space . <nl> namespace winrt : : TerminalApp : : implementation <nl> / / the alwaysOnTop setting will be lost . <nl> _isAlwaysOnTop = _settings . GlobalSettings ( ) . AlwaysOnTop ( ) ; <nl> _alwaysOnTopChangedHandlers ( * this , nullptr ) ; <nl> + <nl> + / / Settings AllowDependentAnimations will affect whether animations are <nl> + / / enabled application - wide , so we don ' t need to check it each time we <nl> + / / want to create an animation . <nl> + WUX : : Media : : Animation : : Timeline : : AllowDependentAnimations ( ! _settings . GlobalSettings ( ) . DisableAnimations ( ) ) ; <nl> } <nl> <nl> / / This is a helper to aid in sorting commands by their ` Name ` s , alphabetically . <nl> mmm a / src / cascadia / TerminalApp / pch . h <nl> ppp b / src / cascadia / TerminalApp / pch . h <nl> <nl> # include < winrt / Windows . UI . Xaml . Controls . Primitives . h > <nl> # include < winrt / Windows . UI . Xaml . Data . h > <nl> # include < winrt / Windows . ui . xaml . media . h > <nl> + # include < winrt / Windows . UI . Xaml . Media . Animation . h > <nl> # include < winrt / Windows . ui . xaml . input . h > <nl> # include < winrt / Windows . UI . Xaml . Hosting . h > <nl> # include " winrt / Windows . UI . Xaml . Markup . h " <nl> # include " winrt / Windows . UI . Xaml . Documents . h " <nl> # include " winrt / Windows . UI . Xaml . Automation . h " <nl> + # include " winrt / Windows . UI . ViewManagement . h " <nl> # include < winrt / Windows . ApplicationModel . h > <nl> # include < winrt / Windows . ApplicationModel . DataTransfer . h > <nl> <nl> mmm a / src / cascadia / TerminalSettingsModel / GlobalAppSettings . cpp <nl> ppp b / src / cascadia / TerminalSettingsModel / GlobalAppSettings . cpp <nl> static constexpr std : : string_view SnapToGridOnResizeKey { " snapToGridOnResize " } ; <nl> static constexpr std : : string_view EnableStartupTaskKey { " startOnUserLogin " } ; <nl> static constexpr std : : string_view AlwaysOnTopKey { " alwaysOnTop " } ; <nl> static constexpr std : : string_view UseTabSwitcherKey { " useTabSwitcher " } ; <nl> + static constexpr std : : string_view DisableAnimationsKey { " disableAnimations " } ; <nl> <nl> static constexpr std : : string_view DebugFeaturesKey { " debugFeatures " } ; <nl> <nl> void GlobalAppSettings : : LayerJson ( const Json : : Value & json ) <nl> <nl> JsonUtils : : GetValueForKey ( json , UseTabSwitcherKey , _UseTabSwitcher ) ; <nl> <nl> + JsonUtils : : GetValueForKey ( json , DisableAnimationsKey , _DisableAnimations ) ; <nl> + <nl> / / This is a helper lambda to get the keybindings and commands out of both <nl> / / and array of objects . We ' ll use this twice , once on the legacy <nl> / / ` keybindings ` key , and again on the newer ` bindings ` key . <nl> mmm a / src / cascadia / TerminalSettingsModel / GlobalAppSettings . h <nl> ppp b / src / cascadia / TerminalSettingsModel / GlobalAppSettings . h <nl> namespace winrt : : Microsoft : : Terminal : : Settings : : Model : : implementation <nl> GETSET_PROPERTY ( bool , StartOnUserLogin , false ) ; <nl> GETSET_PROPERTY ( bool , AlwaysOnTop , false ) ; <nl> GETSET_PROPERTY ( bool , UseTabSwitcher , true ) ; <nl> + GETSET_PROPERTY ( bool , DisableAnimations , false ) ; <nl> <nl> private : <nl> hstring _unparsedDefaultProfile ; <nl> mmm a / src / cascadia / TerminalSettingsModel / GlobalAppSettings . idl <nl> ppp b / src / cascadia / TerminalSettingsModel / GlobalAppSettings . idl <nl> namespace Microsoft . Terminal . Settings . Model <nl> Boolean StartOnUserLogin ; <nl> Boolean AlwaysOnTop ; <nl> Boolean UseTabSwitcher ; <nl> + Boolean DisableAnimations ; <nl> <nl> Windows . Foundation . Collections . IMapView < String , ColorScheme > ColorSchemes ( ) ; <nl> void AddColorScheme ( ColorScheme scheme ) ; <nl> mmm a / src / cascadia / TerminalSettingsModel / defaults . json <nl> ppp b / src / cascadia / TerminalSettingsModel / defaults . json <nl> <nl> " startOnUserLogin " : false , <nl> " theme " : " system " , <nl> " snapToGridOnResize " : true , <nl> + " disableAnimations " : false , <nl> <nl> " profiles " : <nl> [ <nl>
Add an animation to pane entrance / exit ( )
microsoft/terminal
9dc38ad0f51ed72b0d0eb21de618ecbe65f04246
2020-10-09T23:06:40Z
mmm a / js / apps / system / aardvark / clusterFrontend / js / templates / clusterUnreachable . ejs <nl> ppp b / js / apps / system / aardvark / clusterFrontend / js / templates / clusterUnreachable . ejs <nl> <nl> < a class = " arangoHeader " > Cluster Unreachable < / a > <nl> < / div > <nl> <nl> - < div class = " clusterDownBtn " > <nl> + < div class = " cluster - unreachable - info " > <nl> < p > <nl> None of your Coordinators is reachable . <nl> However your DBServers are still running . <nl> - This might be a network network problem . <nl> + This might be a network problem . <nl> < / p > <nl> - < p > <nl> - Please check the coordinators manually on the following servers : <nl> + Please check the your network connection to the following servers : <nl> < / p > <nl> + < % if ( coordinators . length > 0 ) { % > <nl> < ul > <nl> - < li > Bla < / li > <nl> - < li > blub < / li > <nl> + < % _ . each ( coordinators , function ( c ) { % > <nl> + < li > < b > < % = c % > < / b > < / li > <nl> + < % } ) ; % > <nl> < / ul > <nl> + < % } % > <nl> + < p > <nl> + If none of these servers is reachable they are either located behind a firewall and not accessable to the outside , or there is a network disconnection . <nl> + < / p > <nl> + < p > <nl> + If at least of these servers is reachable the coordinator potentially crashed , please have a look in the log files . <nl> + In this case you can shutdown the cluster and relaunch it again . <nl> + < / p > <nl> + < p > <nl> + < button id = " clusterShutdown " class = " button - danger shutdown " > Shutdown Cluster < / button > <nl> + < / p > <nl> + < p > <nl> + If you want to file a bug , please use < a href = " https : / / github . com / triAGENS / ArangoDB / issues " > our issue tracker < / a > . Or feel free to ask a question on < a href = " https : / / groups . google . com / forum / # ! forum / arangodb " > our google group < / a > . <nl> < / div > <nl> < / script > <nl> mmm a / js / apps / system / aardvark / clusterFrontend / js / views / clusterUnreachableView . js <nl> ppp b / js / apps / system / aardvark / clusterFrontend / js / views / clusterUnreachableView . js <nl> <nl> / * jslint indent : 2 , nomen : true , maxlen : 100 , sloppy : true , vars : true , white : true , plusplus : true , newcap : true * / <nl> - / * global window , $ , Backbone , templateEngine , plannerTemplateEngine , alert * / <nl> + / * global window , $ , Backbone , templateEngine , plannerTemplateEngine , alert , _ * / <nl> <nl> ( function ( ) { <nl> " use strict " ; <nl> <nl> el : " # content " , <nl> <nl> template : templateEngine . createTemplate ( " clusterUnreachable . ejs " ) , <nl> + modal : templateEngine . createTemplate ( " waitModal . ejs " ) , <nl> <nl> events : { <nl> + " click # clusterShutdown " : " shutdown " <nl> } , <nl> <nl> initialize : function ( ) { <nl> <nl> } ) ; <nl> } , <nl> <nl> + shutdown : function ( ) { <nl> + window . clearTimeout ( this . timer ) ; <nl> + window . App . shutdownView . clusterShutdown ( ) ; <nl> + } , <nl> + <nl> render : function ( ) { <nl> - $ ( this . el ) . html ( this . template . render ( { } ) ) ; <nl> - window . setTimeout ( this . retryConnection . bind ( this ) , 10000 ) ; <nl> + var plan = window . App . clusterPlan ; <nl> + var list = [ ] ; <nl> + if ( plan & & plan . has ( " runInfo " ) ) { <nl> + var startServerInfos = _ . where ( plan . get ( " runInfo " ) , { isStartServers : true } ) ; <nl> + _ . each ( <nl> + _ . filter ( startServerInfos , function ( s ) { <nl> + return _ . contains ( s . roles , " Coordinator " ) ; <nl> + } ) , function ( s ) { <nl> + var name = s . endpoints [ 0 ] . split ( " : / / " ) [ 1 ] ; <nl> + name = name . split ( " : " ) [ 0 ] ; <nl> + list . push ( name ) ; <nl> + } <nl> + ) ; <nl> + } <nl> + $ ( this . el ) . html ( this . template . render ( { <nl> + coordinators : list <nl> + } ) ) ; <nl> + $ ( this . el ) . append ( this . modal . render ( { } ) ) ; <nl> + this . timer = window . setTimeout ( this . retryConnection . bind ( this ) , 10000 ) ; <nl> } <nl> <nl> } ) ; <nl> mmm a / js / apps / system / aardvark / frontend / scss / _clusterStates . scss <nl> ppp b / js / apps / system / aardvark / frontend / scss / _clusterStates . scss <nl> a . dbserver { <nl> color : $ c - negative ; <nl> margin - left : 20px ; <nl> } <nl> + <nl> + . cluster - unreachable - info { <nl> + margin : 0 auto ; <nl> + max - width : 320px ; <nl> + padding - top : 17px ; <nl> + text - align : center ; <nl> + } <nl> mmm a / js / apps / system / aardvark / frontend / scss / cluster . css <nl> ppp b / js / apps / system / aardvark / frontend / scss / cluster . css <nl> a . dbserver . double { <nl> color : # da4f49 ; <nl> margin - left : 20px ; } <nl> <nl> + . cluster - unreachable - info { <nl> + margin : 0 auto ; <nl> + max - width : 320px ; <nl> + padding - top : 17px ; <nl> + text - align : center ; } <nl> + <nl> . machineClass { <nl> background - color : # e1e1e1 ; <nl> margin - left : 31px ; <nl>
Fixed cluster dashboard on server failure
arangodb/arangodb
53abe18fe5cc28bc20f03118d362614378f3e329
2014-08-06T07:18:19Z
mmm a / src / compiler / instruction - selector . cc <nl> ppp b / src / compiler / instruction - selector . cc <nl> FrameStateDescriptor * InstructionSelector : : GetFrameStateDescriptor ( <nl> state_info . shared_info ( ) , outer_state ) ; <nl> } <nl> <nl> + / / static <nl> + void InstructionSelector : : CanonicalizeShuffle ( bool inputs_equal , <nl> + uint8_t * shuffle , <nl> + bool * needs_swap , <nl> + bool * is_swizzle ) { <nl> + * needs_swap = false ; <nl> + / / Inputs equal , then it ' s a swizzle . <nl> + if ( inputs_equal ) { <nl> + * is_swizzle = true ; <nl> + } else { <nl> + / / Inputs are distinct ; check that both are required . <nl> + bool src0_is_used = false ; <nl> + bool src1_is_used = false ; <nl> + for ( int i = 0 ; i < kSimd128Size ; + + i ) { <nl> + if ( shuffle [ i ] < kSimd128Size ) { <nl> + src0_is_used = true ; <nl> + } else { <nl> + src1_is_used = true ; <nl> + } <nl> + } <nl> + if ( src0_is_used & & ! src1_is_used ) { <nl> + * is_swizzle = true ; <nl> + } else if ( src1_is_used & & ! src0_is_used ) { <nl> + * needs_swap = true ; <nl> + * is_swizzle = true ; <nl> + } else { <nl> + * is_swizzle = false ; <nl> + / / Canonicalize general 2 input shuffles so that the first input lanes are <nl> + / / encountered first . This makes architectural shuffle pattern matching <nl> + / / easier , since we only need to consider 1 input ordering instead of 2 . <nl> + if ( shuffle [ 0 ] > = kSimd128Size ) { <nl> + / / The second operand is used first . Swap inputs and adjust the shuffle . <nl> + * needs_swap = true ; <nl> + for ( int i = 0 ; i < kSimd128Size ; + + i ) { <nl> + shuffle [ i ] ^ = kSimd128Size ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + if ( * is_swizzle ) { <nl> + for ( int i = 0 ; i < kSimd128Size ; + + i ) shuffle [ i ] & = kSimd128Size - 1 ; <nl> + } <nl> + } <nl> + <nl> + void InstructionSelector : : CanonicalizeShuffle ( Node * node , uint8_t * shuffle , <nl> + bool * is_swizzle ) { <nl> + / / Get raw shuffle indices . <nl> + memcpy ( shuffle , OpParameter < uint8_t * > ( node - > op ( ) ) , kSimd128Size ) ; <nl> + bool needs_swap ; <nl> + bool inputs_equal = GetVirtualRegister ( node - > InputAt ( 0 ) ) = = <nl> + GetVirtualRegister ( node - > InputAt ( 1 ) ) ; <nl> + CanonicalizeShuffle ( inputs_equal , shuffle , & needs_swap , is_swizzle ) ; <nl> + if ( needs_swap ) { <nl> + SwapShuffleInputs ( node ) ; <nl> + } <nl> + / / Duplicate the first input ; for some shuffles on some architectures , it ' s <nl> + / / easiest to implement a swizzle as a shuffle so it might be used . <nl> + if ( * is_swizzle ) { <nl> + node - > ReplaceInput ( 1 , node - > InputAt ( 0 ) ) ; <nl> + } <nl> + } <nl> + <nl> + / / static <nl> + void InstructionSelector : : SwapShuffleInputs ( Node * node ) { <nl> + Node * input0 = node - > InputAt ( 0 ) ; <nl> + Node * input1 = node - > InputAt ( 1 ) ; <nl> + node - > ReplaceInput ( 0 , input1 ) ; <nl> + node - > ReplaceInput ( 1 , input0 ) ; <nl> + } <nl> + <nl> / / static <nl> bool InstructionSelector : : TryMatchIdentity ( const uint8_t * shuffle ) { <nl> for ( int i = 0 ; i < kSimd128Size ; + + i ) { <nl> bool InstructionSelector : : TryMatchBlend ( const uint8_t * shuffle ) { <nl> return true ; <nl> } <nl> <nl> - void InstructionSelector : : CanonicalizeShuffle ( Node * node , uint8_t * shuffle , <nl> - bool * is_swizzle ) { <nl> - / / Get raw shuffle indices . <nl> - memcpy ( shuffle , OpParameter < uint8_t * > ( node - > op ( ) ) , kSimd128Size ) ; <nl> - <nl> - / / Detect shuffles that only operate on one input . <nl> - if ( GetVirtualRegister ( node - > InputAt ( 0 ) ) = = <nl> - GetVirtualRegister ( node - > InputAt ( 1 ) ) ) { <nl> - * is_swizzle = true ; <nl> - } else { <nl> - / / Inputs are distinct ; check that both are required . <nl> - bool src0_is_used = false ; <nl> - bool src1_is_used = false ; <nl> - for ( int i = 0 ; i < kSimd128Size ; + + i ) { <nl> - if ( shuffle [ i ] < kSimd128Size ) { <nl> - src0_is_used = true ; <nl> - } else { <nl> - src1_is_used = true ; <nl> - } <nl> - } <nl> - if ( src0_is_used & & ! src1_is_used ) { <nl> - node - > ReplaceInput ( 1 , node - > InputAt ( 0 ) ) ; <nl> - * is_swizzle = true ; <nl> - } else if ( src1_is_used & & ! src0_is_used ) { <nl> - node - > ReplaceInput ( 0 , node - > InputAt ( 1 ) ) ; <nl> - * is_swizzle = true ; <nl> - } else { <nl> - * is_swizzle = false ; <nl> - / / Canonicalize general 2 input shuffles so that the first input lanes are <nl> - / / encountered first . This makes architectural shuffle pattern matching <nl> - / / easier , since we only need to consider 1 input ordering instead of 2 . <nl> - if ( shuffle [ 0 ] > = kSimd128Size ) { <nl> - / / The second operand is used first . Swap inputs and adjust the shuffle . <nl> - SwapShuffleInputs ( node ) ; <nl> - for ( int i = 0 ; i < kSimd128Size ; + + i ) { <nl> - shuffle [ i ] ^ = kSimd128Size ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> - if ( * is_swizzle ) { <nl> - for ( int i = 0 ; i < kSimd128Size ; + + i ) shuffle [ i ] & = kSimd128Size - 1 ; <nl> - } <nl> - } <nl> - <nl> / / static <nl> int32_t InstructionSelector : : Pack4Lanes ( const uint8_t * shuffle ) { <nl> int32_t result = 0 ; <nl> int32_t InstructionSelector : : Pack4Lanes ( const uint8_t * shuffle ) { <nl> return result ; <nl> } <nl> <nl> - / / static <nl> - void InstructionSelector : : SwapShuffleInputs ( Node * node ) { <nl> - Node * input0 = node - > InputAt ( 0 ) ; <nl> - Node * input1 = node - > InputAt ( 1 ) ; <nl> - node - > ReplaceInput ( 0 , input1 ) ; <nl> - node - > ReplaceInput ( 1 , input0 ) ; <nl> - } <nl> - <nl> bool InstructionSelector : : NeedsPoisoning ( IsSafetyCheck safety_check ) const { <nl> switch ( poisoning_level_ ) { <nl> case PoisoningMitigationLevel : : kDontPoison : <nl> mmm a / src / compiler / instruction - selector . h <nl> ppp b / src / compiler / instruction - selector . h <nl> class V8_EXPORT_PRIVATE InstructionSelector final { <nl> } <nl> <nl> / / Expose these SIMD helper functions for testing . <nl> + static void CanonicalizeShuffleForTesting ( bool inputs_equal , uint8_t * shuffle , <nl> + bool * needs_swap , <nl> + bool * is_swizzle ) { <nl> + CanonicalizeShuffle ( inputs_equal , shuffle , needs_swap , is_swizzle ) ; <nl> + } <nl> + <nl> static bool TryMatchIdentityForTesting ( const uint8_t * shuffle ) { <nl> return TryMatchIdentity ( shuffle ) ; <nl> } <nl> class V8_EXPORT_PRIVATE InstructionSelector final { <nl> / / = = = = = = = = = = = = = Vector instruction ( SIMD ) helper fns . = = = = = = = = = = = = = = = = = = = = = = = <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> <nl> + / / Converts a shuffle into canonical form , meaning that the first lane index <nl> + / / is in the range [ 0 . . 15 ] . Set | inputs_equal | true if this is an explicit <nl> + / / swizzle . Returns canonicalized | shuffle | , | needs_swap | , and | is_swizzle | . <nl> + / / If | needs_swap | is true , inputs must be swapped . If | is_swizzle | is true , <nl> + / / the second input can be ignored . <nl> + static void CanonicalizeShuffle ( bool inputs_equal , uint8_t * shuffle , <nl> + bool * needs_swap , bool * is_swizzle ) ; <nl> + <nl> + / / Canonicalize shuffles to make pattern matching simpler . Returns the shuffle <nl> + / / indices , and a boolean indicating if the shuffle is a swizzle ( one input ) . <nl> + void CanonicalizeShuffle ( Node * node , uint8_t * shuffle , bool * is_swizzle ) ; <nl> + <nl> + / / Swaps the two first input operands of the node , to help match shuffles <nl> + / / to specific architectural instructions . <nl> + void SwapShuffleInputs ( Node * node ) ; <nl> + <nl> / / Tries to match an 8x16 byte shuffle to the identity shuffle , which is <nl> / / [ 0 1 . . . 15 ] . This should be called after canonicalizing the shuffle , so <nl> / / the second identity shuffle , [ 16 17 . . 31 ] is converted to the first one . <nl> class V8_EXPORT_PRIVATE InstructionSelector final { <nl> / / Packs 4 bytes of shuffle into a 32 bit immediate . <nl> static int32_t Pack4Lanes ( const uint8_t * shuffle ) ; <nl> <nl> - / / Canonicalize shuffles to make pattern matching simpler . Returns the shuffle <nl> - / / indices , and a boolean indicating if the shuffle is a swizzle ( one input ) . <nl> - void CanonicalizeShuffle ( Node * node , uint8_t * shuffle , bool * is_swizzle ) ; <nl> - <nl> - / / Swaps the two first input operands of the node , to help match shuffles <nl> - / / to specific architectural instructions . <nl> - void SwapShuffleInputs ( Node * node ) ; <nl> - <nl> / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> <nl> Schedule * schedule ( ) const { return schedule_ ; } <nl> mmm a / test / unittests / compiler / instruction - selector - unittest . cc <nl> ppp b / test / unittests / compiler / instruction - selector - unittest . cc <nl> TARGET_TEST_F ( InstructionSelectorTest , CallStubWithDeoptRecursiveFrameState ) { <nl> EXPECT_EQ ( index , s . size ( ) ) ; <nl> } <nl> <nl> - / / Helper to make calls to private InstructionSelector : : TryMatch * functions . <nl> + / / Helper to make calls to private InstructionSelector shuffle functions . <nl> class InstructionSelectorShuffleTest : public : : testing : : Test { <nl> public : <nl> using Shuffle = std : : array < uint8_t , kSimd128Size > ; <nl> - / / Call private members <nl> + <nl> + struct TestShuffle { <nl> + Shuffle non_canonical ; <nl> + Shuffle canonical ; <nl> + bool needs_swap ; <nl> + bool is_swizzle ; <nl> + } ; <nl> + <nl> + / / Call testing members in InstructionSelector . <nl> + static void CanonicalizeShuffle ( bool inputs_equal , Shuffle * shuffle , <nl> + bool * needs_swap , bool * is_swizzle ) { <nl> + InstructionSelector : : CanonicalizeShuffleForTesting ( <nl> + inputs_equal , & ( * shuffle ) [ 0 ] , needs_swap , is_swizzle ) ; <nl> + } <nl> + <nl> static bool TryMatchIdentity ( const Shuffle & shuffle ) { <nl> return InstructionSelector : : TryMatchIdentityForTesting ( & shuffle [ 0 ] ) ; <nl> } <nl> - <nl> template < int LANES > <nl> static bool TryMatchDup ( const Shuffle & shuffle , int * index ) { <nl> return InstructionSelector : : TryMatchDupForTesting < LANES > ( & shuffle [ 0 ] , <nl> index ) ; <nl> } <nl> - <nl> static bool TryMatch32x4Shuffle ( const Shuffle & shuffle , <nl> uint8_t * shuffle32x4 ) { <nl> return InstructionSelector : : TryMatch32x4ShuffleForTesting ( & shuffle [ 0 ] , <nl> shuffle32x4 ) ; <nl> } <nl> - <nl> static bool TryMatch16x8Shuffle ( const Shuffle & shuffle , <nl> uint8_t * shuffle16x8 ) { <nl> return InstructionSelector : : TryMatch16x8ShuffleForTesting ( & shuffle [ 0 ] , <nl> shuffle16x8 ) ; <nl> } <nl> - <nl> static bool TryMatchConcat ( const Shuffle & shuffle , uint8_t * offset ) { <nl> return InstructionSelector : : TryMatchConcatForTesting ( & shuffle [ 0 ] , offset ) ; <nl> } <nl> - <nl> static bool TryMatchBlend ( const Shuffle & shuffle ) { <nl> return InstructionSelector : : TryMatchBlendForTesting ( & shuffle [ 0 ] ) ; <nl> } <nl> } ; <nl> <nl> + bool operator = = ( const InstructionSelectorShuffleTest : : Shuffle & a , <nl> + const InstructionSelectorShuffleTest : : Shuffle & b ) { <nl> + for ( int i = 0 ; i < kSimd128Size ; + + i ) { <nl> + if ( a [ i ] ! = b [ i ] ) return false ; <nl> + } <nl> + return true ; <nl> + } <nl> + <nl> + TEST_F ( InstructionSelectorShuffleTest , CanonicalizeShuffle ) { <nl> + const bool kInputsEqual = true ; <nl> + const bool kNeedsSwap = true ; <nl> + const bool kIsSwizzle = true ; <nl> + <nl> + bool needs_swap ; <nl> + bool is_swizzle ; <nl> + <nl> + / / Test canonicalization driven by input shuffle . <nl> + TestShuffle test_shuffles [ ] = { <nl> + / / Identity is canonical . <nl> + { { { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 } } , <nl> + { { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 } } , <nl> + ! kNeedsSwap , <nl> + kIsSwizzle } , <nl> + / / Non - canonical identity requires a swap . <nl> + { { { 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 } } , <nl> + { { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 } } , <nl> + kNeedsSwap , <nl> + kIsSwizzle } , <nl> + / / General shuffle , canonical is unchanged . <nl> + { { { 0 , 16 , 1 , 17 , 2 , 18 , 3 , 19 , 4 , 20 , 5 , 21 , 6 , 22 , 7 , 23 } } , <nl> + { { 0 , 16 , 1 , 17 , 2 , 18 , 3 , 19 , 4 , 20 , 5 , 21 , 6 , 22 , 7 , 23 } } , <nl> + ! kNeedsSwap , <nl> + ! kIsSwizzle } , <nl> + / / Non - canonical shuffle requires a swap . <nl> + { { { 16 , 0 , 17 , 1 , 18 , 2 , 19 , 3 , 20 , 4 , 21 , 5 , 22 , 6 , 23 , 7 } } , <nl> + { { 0 , 16 , 1 , 17 , 2 , 18 , 3 , 19 , 4 , 20 , 5 , 21 , 6 , 22 , 7 , 23 } } , <nl> + kNeedsSwap , <nl> + ! kIsSwizzle } , <nl> + } ; <nl> + for ( size_t i = 0 ; i < arraysize ( test_shuffles ) ; + + i ) { <nl> + Shuffle shuffle = test_shuffles [ i ] . non_canonical ; <nl> + CanonicalizeShuffle ( ! kInputsEqual , & shuffle , & needs_swap , & is_swizzle ) ; <nl> + EXPECT_EQ ( shuffle , test_shuffles [ i ] . canonical ) ; <nl> + EXPECT_EQ ( needs_swap , test_shuffles [ i ] . needs_swap ) ; <nl> + EXPECT_EQ ( is_swizzle , test_shuffles [ i ] . is_swizzle ) ; <nl> + } <nl> + <nl> + / / Test canonicalization when inputs are equal ( explicit swizzle ) . <nl> + TestShuffle test_swizzles [ ] = { <nl> + / / Identity is canonical . <nl> + { { { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 } } , <nl> + { { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 } } , <nl> + ! kNeedsSwap , <nl> + kIsSwizzle } , <nl> + / / Non - canonical identity requires a swap . <nl> + { { { 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 } } , <nl> + { { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 } } , <nl> + ! kNeedsSwap , <nl> + kIsSwizzle } , <nl> + / / Canonicalized to swizzle . <nl> + { { { 0 , 16 , 1 , 17 , 2 , 18 , 3 , 19 , 4 , 20 , 5 , 21 , 6 , 22 , 7 , 23 } } , <nl> + { { 0 , 0 , 1 , 1 , 2 , 2 , 3 , 3 , 4 , 4 , 5 , 5 , 6 , 6 , 7 , 7 } } , <nl> + ! kNeedsSwap , <nl> + kIsSwizzle } , <nl> + / / Canonicalized to swizzle . <nl> + { { { 16 , 0 , 17 , 1 , 18 , 2 , 19 , 3 , 20 , 4 , 21 , 5 , 22 , 6 , 23 , 7 } } , <nl> + { { 0 , 0 , 1 , 1 , 2 , 2 , 3 , 3 , 4 , 4 , 5 , 5 , 6 , 6 , 7 , 7 } } , <nl> + ! kNeedsSwap , <nl> + kIsSwizzle } , <nl> + } ; <nl> + for ( size_t i = 0 ; i < arraysize ( test_swizzles ) ; + + i ) { <nl> + Shuffle shuffle = test_swizzles [ i ] . non_canonical ; <nl> + CanonicalizeShuffle ( kInputsEqual , & shuffle , & needs_swap , & is_swizzle ) ; <nl> + EXPECT_EQ ( shuffle , test_swizzles [ i ] . canonical ) ; <nl> + EXPECT_EQ ( needs_swap , test_swizzles [ i ] . needs_swap ) ; <nl> + EXPECT_EQ ( is_swizzle , test_swizzles [ i ] . is_swizzle ) ; <nl> + } <nl> + } <nl> + <nl> TEST_F ( InstructionSelectorShuffleTest , TryMatchIdentity ) { <nl> / / Match shuffle that returns first source operand . <nl> EXPECT_TRUE ( TryMatchIdentity ( <nl>
[ wasm simd ] Rework CanonicalizeShuffle for testing
v8/v8
16de08ea725da1190f086b9d7fdbbd618d7ea7ea
2018-07-06T21:13:01Z
mmm a / package . json <nl> ppp b / package . json <nl> <nl> " private " : true , <nl> <nl> " scripts " : { <nl> - " preinstall " : " true " <nl> + " preinstall " : " node - e ' process . exit ( 0 ) ' " <nl> } <nl> } <nl>
Fix the " ' true ' is not recognized as an internal or external command " error .
electron/electron
618d0c63973fc9e48c5815f1031533fa0a1b8dc4
2013-11-01T02:15:41Z
mmm a / lib / SILPasses / SILCombine . cpp <nl> ppp b / lib / SILPasses / SILCombine . cpp <nl> SILInstruction * SILCombiner : : visitPartialApplyInst ( PartialApplyInst * PAI ) { <nl> if ( ! PAI - > hasOneUse ( ) ) <nl> return nullptr ; <nl> <nl> + SILLocation Loc = PAI - > getLoc ( ) ; <nl> + <nl> / / The single user must be the StrongReleaseInst . <nl> if ( auto * SRI = dyn_cast < StrongReleaseInst > ( PAI - > use_begin ( ) - > getUser ( ) ) ) { <nl> SILFunctionType * ClosureTy = <nl> SILInstruction * SILCombiner : : visitPartialApplyInst ( PartialApplyInst * PAI ) { <nl> int ArgNum = 0 ; <nl> / / For each parameter of the closure function : <nl> for ( auto Param : ClosureTy - > getInterfaceParameters ( ) ) { <nl> - / / The partial_apply takes the ownership of @ In arguments . When we delete <nl> - / / the closure then we need to increase the ref - count of @ In arguments <nl> - / / manually . <nl> - if ( Param . isIndirect ( ) & & Param . isConsumed ( ) ) { <nl> - SILLocation Loc = PAI - > getLoc ( ) ; <nl> - SILValue Ld = Builder - > createLoad ( Loc , PAI - > getArguments ( ) [ ArgNum ] ) ; <nl> - Builder - > createStrongRelease ( Loc , Ld ) ; <nl> - } <nl> + SILValue Arg = PAI - > getArguments ( ) [ ArgNum + + ] ; <nl> + <nl> + if ( ! Param . isIndirect ( ) & & Param . isConsumed ( ) ) <nl> + if ( ! Arg . getType ( ) . isAddress ( ) ) <nl> + Builder - > createDestroyValue ( Loc , Arg ) ; <nl> <nl> - ArgNum + + ; <nl> } <nl> <nl> / / Delete the strong_release . <nl> mmm a / test / SILPasses / pa_removal . sil <nl> ppp b / test / SILPasses / pa_removal . sil <nl> class K { <nl> <nl> / / CHECK : sil @ a_function2 <nl> / / CHECK - NOT : partial_apply <nl> + / / The destroy_value of $ K is optimized to a strong_release . <nl> + / / CHECK : strong_release <nl> / / CHECK : return <nl> - sil @ a_function2 : $ @ thin ( @ in K ) - > ( ) { <nl> - bb0 ( % 0 : $ * K ) : <nl> + sil @ a_function2 : $ @ thin ( @ owned K ) - > ( ) { <nl> + bb0 ( % 0 : $ K ) : <nl> % 1 = alloc_ref $ K <nl> - % 2 = function_ref @ our_closure_function2 : $ @ thin ( @ in K ) - > Bool / / user : % 2 <nl> - % 3 = partial_apply % 2 ( % 0 ) : $ @ thin ( @ in K ) - > Bool / / user : % 3 <nl> + % 2 = function_ref @ our_closure_function2 : $ @ thin ( @ owned K ) - > Bool / / user : % 2 <nl> + % 3 = partial_apply % 2 ( % 0 ) : $ @ thin ( @ owned K ) - > Bool / / user : % 3 <nl> strong_release % 3 : $ @ callee_owned ( ) - > Bool / / id : % 3 <nl> % 5 = tuple ( ) / / user : % 5 <nl> return % 5 : $ ( ) / / id : % 5 <nl> } <nl> <nl> - sil @ our_closure_function2 : $ @ thin ( @ in K ) - > Bool <nl> + sil @ our_closure_function2 : $ @ thin ( @ owned K ) - > Bool <nl> sil @ our_closure_function1 : $ @ thin ( Int64 ) - > Bool <nl>
partial_apply does not take ownership of @ in arguments ,
apple/swift
d472fe0b18be4582d911c83aa6cf53f4e23bd262
2014-01-21T19:49:24Z
mmm a / cocos / scripting / lua - bindings / auto / api / GLView . lua <nl> ppp b / cocos / scripting / lua - bindings / auto / api / GLView . lua <nl> <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ module GLView <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm @ function [ parent = # GLView ] setIMEKeyboardState <nl> mmm @ param self <nl> mmm @ param # bool bool <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm @ function [ parent = # GLView ] isOpenGLReady <nl> mmm @ param self <nl> mmm @ return bool # bool ret ( return value : bool ) <nl> - <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - - @ function [ parent = # GLView ] createWithRect <nl> - - @ param self <nl> mmm a / cocos / scripting / lua - bindings / auto / lua_cocos2dx_auto . cpp . REMOVED . git - id <nl> ppp b / cocos / scripting / lua - bindings / auto / lua_cocos2dx_auto . cpp . REMOVED . git - id <nl> @ @ - 1 + 1 @ @ <nl> - 5b99d1a1621323c9e0f9eda1a5535280bec64f1f <nl> \ No newline at end of file <nl> + c0580e239bc0d30c6d09103a806ab3e6e76da123 <nl> \ No newline at end of file <nl> mmm a / cocos / scripting / lua - bindings / auto / lua_cocos2dx_auto . hpp <nl> ppp b / cocos / scripting / lua - bindings / auto / lua_cocos2dx_auto . hpp <nl> int register_all_cocos2dx ( lua_State * tolua_S ) ; <nl> <nl> <nl> <nl> - <nl> - <nl> <nl> <nl> <nl>
Merge pull request from CocosRobot / update_lua_bindings_1394610107
cocos2d/cocos2d-x
bac19d68972be9cf2434248941023cfeb75ff377
2014-03-12T07:44:20Z
mmm a / xbmc / guilib / GUIButtonControl . cpp <nl> ppp b / xbmc / guilib / GUIButtonControl . cpp <nl> void CGUIButtonControl : : ProcessText ( unsigned int currentTime ) <nl> if ( m_minWidth & & m_width ! = renderWidth ) <nl> { <nl> CRect rect ( m_posX , m_posY , renderWidth , m_height ) ; <nl> - SetHitRect ( rect ) ; <nl> + SetHitRect ( rect , m_hitColor ) ; <nl> } <nl> <nl> / / render the second label if it exists <nl> mmm a / xbmc / guilib / GUIControl . cpp <nl> ppp b / xbmc / guilib / GUIControl . cpp <nl> <nl> # include " utils / log . h " <nl> # include " GUIWindowManager . h " <nl> # include " GUIControlProfiler . h " <nl> + # include " GUITexture . h " <nl> # include " input / MouseStat . h " <nl> # include " input / InputManager . h " <nl> # include " input / Key . h " <nl> void CGUIControl : : DoRender ( ) <nl> g_graphicsContext . SetStereoFactor ( m_stereo ) ; <nl> <nl> GUIPROFILER_RENDER_BEGIN ( this ) ; <nl> + <nl> + if ( m_hitColor ! = 0xFFFFFFFF ) <nl> + { <nl> + color_t color = g_graphicsContext . MergeAlpha ( m_hitColor ) ; <nl> + CGUITexture : : DrawQuad ( g_graphicsContext . generateAABB ( m_hitRect ) , color ) ; <nl> + } <nl> + <nl> Render ( ) ; <nl> + <nl> GUIPROFILER_RENDER_END ( this ) ; <nl> <nl> if ( hasStereo ) <nl> void CGUIControl : : SaveStates ( std : : vector < CControlState > & states ) <nl> / / empty for now - do nothing with the majority of controls <nl> } <nl> <nl> - void CGUIControl : : SetHitRect ( const CRect & rect ) <nl> + void CGUIControl : : SetHitRect ( const CRect & rect , const CGUIInfoColor & color ) <nl> { <nl> m_hitRect = rect ; <nl> + m_hitColor = color ; <nl> } <nl> <nl> void CGUIControl : : SetCamera ( const CPoint & camera ) <nl> mmm a / xbmc / guilib / GUIControl . h <nl> ppp b / xbmc / guilib / GUIControl . h <nl> class CGUIControl <nl> bool IsVisibleFromSkin ( ) const { return m_visibleFromSkinCondition ; } ; <nl> virtual bool IsDisabled ( ) const ; <nl> virtual void SetPosition ( float posX , float posY ) ; <nl> - virtual void SetHitRect ( const CRect & rect ) ; <nl> + virtual void SetHitRect ( const CRect & rect , const CGUIInfoColor & color ) ; <nl> virtual void SetCamera ( const CPoint & camera ) ; <nl> virtual void SetStereoFactor ( const float & factor ) ; <nl> bool SetColorDiffuse ( const CGUIInfoColor & color ) ; <nl> class CGUIControl <nl> float m_height ; <nl> float m_width ; <nl> CRect m_hitRect ; <nl> + CGUIInfoColor m_hitColor ; <nl> CGUIInfoColor m_diffuseColor ; <nl> int m_controlID ; <nl> int m_parentID ; <nl> mmm a / xbmc / guilib / GUIControlFactory . cpp <nl> ppp b / xbmc / guilib / GUIControlFactory . cpp <nl> CGUIControl * CGUIControlFactory : : Create ( int parentID , const CRect & rect , TiXmlEl <nl> CLabelInfo labelInfo ; <nl> CLabelInfo spinInfo ; <nl> <nl> + CGUIInfoColor hitColor ( 0xFFFFFFFF ) ; <nl> CGUIInfoColor textColor3 ; <nl> CGUIInfoColor headlineColor ; <nl> <nl> CGUIControl * CGUIControlFactory : : Create ( int parentID , const CRect & rect , TiXmlEl <nl> hitRect . SetRect ( posX , posY , posX + width , posY + height ) ; <nl> GetHitRect ( pControlNode , hitRect ) ; <nl> <nl> + GetInfoColor ( pControlNode , " hitrectcolor " , hitColor , parentID ) ; <nl> + <nl> GetActions ( pControlNode , " onup " , actions [ ACTION_MOVE_UP ] ) ; <nl> GetActions ( pControlNode , " ondown " , actions [ ACTION_MOVE_DOWN ] ) ; <nl> GetActions ( pControlNode , " onleft " , actions [ ACTION_MOVE_LEFT ] ) ; <nl> CGUIControl * CGUIControlFactory : : Create ( int parentID , const CRect & rect , TiXmlEl <nl> / / things that apply to all controls <nl> if ( control ) <nl> { <nl> - control - > SetHitRect ( hitRect ) ; <nl> + control - > SetHitRect ( hitRect , hitColor ) ; <nl> control - > SetVisibleCondition ( visibleCondition , allowHiddenFocus ) ; <nl> control - > SetEnableCondition ( enableCondition ) ; <nl> control - > SetAnimations ( animations ) ; <nl>
[ guilib ] add ability to visualize controls hitrects
xbmc/xbmc
23b04f107aca8f598813d644871b11cb626d945d
2015-10-15T16:24:04Z
mmm a / tensorflow / compiler / mlir / lite / flatbuffer_import . cc <nl> ppp b / tensorflow / compiler / mlir / lite / flatbuffer_import . cc <nl> StatusOr < QuantizedType > GetQuantizedType ( const TensorT & tensor , Builder builder , <nl> uint32_t flags = <nl> is_signed ? mlir : : quant : : QuantizationFlags : : FlagValue : : Signed : 0 ; <nl> <nl> - if ( 0 ! = quant_params . quantized_dimension ) { <nl> + / / Scale size can ' t be zero as it is checked before . <nl> + if ( quant_params . scale . size ( ) ! = 1 ) { <nl> llvm : : SmallVector < double , 4 > scales ( quant_params . scale . begin ( ) , <nl> quant_params . scale . end ( ) ) ; <nl> return mlir : : quant : : UniformQuantizedPerAxisType : : get ( <nl> mmm a / tensorflow / compiler / mlir / lite / tests / flatbuffer2mlir / constants . mlir <nl> ppp b / tensorflow / compiler / mlir / lite / tests / flatbuffer2mlir / constants . mlir <nl> func @ qi32_per_axis ( ) - > tensor < 3x3x ! quant . uniform < i32 : f32 : 1 , { 1 . 0 , 0 . 5 : 1 , 0 . 25 : <nl> return % 0 : tensor < 3x3x ! quant . uniform < i32 : f32 : 1 , { 1 . 0 , 0 . 5 : 1 , 0 . 25 : 1 } > > <nl> } <nl> <nl> + func @ qi32_per_axis_zero ( ) - > tensor < 3x3x ! quant . uniform < i32 : f32 : 0 , { 1 . 0 , 0 . 5 : 1 , 0 . 25 : 1 } > > { <nl> + / / CHECK - LABEL : @ qi32_per_axis_zero <nl> + / / CHECK : { qtype = tensor < 3x3x ! quant . uniform < i32 : f32 : 0 , { 1 . 000000e + 00 , 5 . 000000e - 01 : 1 , 2 . 500000e - 01 : 1 } > > , value = dense < 1 > : tensor < 3x3xi32 > } : ( ) - > tensor < 3x3x ! quant . uniform < i32 : f32 : 0 , { 1 . 000000e + 00 , 5 . 000000e - 01 : 1 , 2 . 500000e - 01 : 1 } > > <nl> + % 0 = " tfl . pseudo_qconst " ( ) { qtype = tensor < 3x3x ! quant . uniform < i32 : f32 : 0 , { 1 . 0 , 0 . 5 : 1 , 0 . 25 : 1 } > > , value = dense < 1 > : tensor < 3x3xi32 > } : ( ) - > tensor < 3x3x ! quant . uniform < i32 : f32 : 0 , { 1 . 0 , 0 . 5 : 1 , 0 . 25 : 1 } > > <nl> + return % 0 : tensor < 3x3x ! quant . uniform < i32 : f32 : 0 , { 1 . 0 , 0 . 5 : 1 , 0 . 25 : 1 } > > <nl> + } <nl> + <nl> func @ qu8 ( ) - > tensor < 3x ! quant . uniform < u8 < 1 : 255 > : f32 , 1 . 0 > > { <nl> / / CHECK - LABEL : @ qu8 <nl> / / CHECK : { qtype = tensor < 3x ! quant . uniform < u8 < 1 : 255 > : f32 , 1 . 000000e + 00 > > , value = dense < 1 > : tensor < 3xi8 > } : ( ) - > tensor < 3x ! quant . uniform < u8 < 1 : 255 > : f32 , 1 . 000000e + 00 > > <nl>
Fixing per axis quantization bug in flatbuffer importer .
tensorflow/tensorflow
be937a3290223f926fe50684f1344569a573ed4b
2019-11-20T00:28:40Z
mmm a / examples / difftaichi / mass_spring . py <nl> ppp b / examples / difftaichi / mass_spring . py <nl> def optimize ( toi , visualize ) : <nl> <nl> robot_id = 0 <nl> if len ( sys . argv ) ! = 3 : <nl> - print ( " Usage : python3 mass_spring . py [ robot_id = 0 , 1 , 2 , . . . ] [ task ] " ) <nl> + print ( " Usage : python3 mass_spring . py [ robot_id = 0 , 1 , 2 , . . . ] [ task = train / plot ] " ) <nl> exit ( - 1 ) <nl> else : <nl> robot_id = int ( sys . argv [ 1 ] ) <nl> mmm a / examples / difftaichi / rigid_body . py <nl> ppp b / examples / difftaichi / rigid_body . py <nl> def optimize ( toi = True , visualize = True ) : <nl> <nl> robot_id = 0 <nl> if len ( sys . argv ) ! = 3 : <nl> - print ( " Usage : python3 rigid_body . py [ robot_id = 0 , 1 , 2 , . . . ] cmd " ) <nl> + print ( " Usage : python3 rigid_body . py [ robot_id = 0 , 1 , 2 , . . . ] [ cmd = train / plot ] " ) <nl> exit ( - 1 ) <nl> else : <nl> robot_id = int ( sys . argv [ 1 ] ) <nl> mmm a / taichi / runtime / runtime . cpp <nl> ppp b / taichi / runtime / runtime . cpp <nl> struct ElementList { <nl> } ; <nl> <nl> void ElementList_initialize ( Runtime * runtime , ElementList * element_list ) { <nl> - element_list - > elements = ( Element * ) allocate ( runtime , 1024 * 1024 * 1024 ) ; <nl> + # if defined ( _WIN32 ) <nl> + auto list_size = 32 * 1024 * 1024 ; <nl> + # else <nl> + auto list_size = 1024 * 1024 * 1024 ; <nl> + # endif <nl> + element_list - > elements = ( Element * ) allocate ( runtime , list_size ) ; <nl> element_list - > tail = 0 ; <nl> } <nl> <nl>
fixed all python tests on Windows
taichi-dev/taichi
3c1893e54b6877b6390367ff8ba4a161c119124d
2019-11-10T23:41:24Z
mmm a / libraries / chain / block_header_state . cpp <nl> ppp b / libraries / chain / block_header_state . cpp <nl> namespace eosio { namespace chain { <nl> auto exts = h . validate_and_extract_header_extensions ( ) ; <nl> <nl> std : : optional < producer_authority_schedule > maybe_new_producer_schedule ; <nl> + std : : optional < digest_type > maybe_new_producer_schedule_hash ; <nl> + bool wtmsig_enabled = false ; <nl> <nl> - if ( h . new_producers ) { <nl> + if ( h . new_producers | | exts . count ( producer_schedule_change_extension : : extension_id ( ) ) > 0 ) { <nl> auto wtmsig_digest = pfs . get_builtin_digest ( builtin_protocol_feature_t : : wtmsig_block_signatures ) ; <nl> const auto & protocol_features = prev_activated_protocol_features - > protocol_features ; <nl> - bool wtmsig_enabled = wtmsig_digest & & protocol_features . find ( * wtmsig_digest ) ! = protocol_features . end ( ) ; <nl> + wtmsig_enabled = wtmsig_digest & & protocol_features . find ( * wtmsig_digest ) ! = protocol_features . end ( ) ; <nl> + } <nl> <nl> + if ( h . new_producers ) { <nl> EOS_ASSERT ( ! wtmsig_enabled , producer_schedule_exception , " Block header contains legacy producer schedule outdated by activation of WTMsig Block Signatures " ) ; <nl> <nl> EOS_ASSERT ( ! was_pending_promoted , producer_schedule_exception , " cannot set pending producer schedule in the same block in which pending was promoted to active " ) ; <nl> namespace eosio { namespace chain { <nl> EOS_ASSERT ( prev_pending_schedule . schedule . producers . empty ( ) , producer_schedule_exception , <nl> " cannot set new pending producers until last pending is confirmed " ) ; <nl> <nl> + maybe_new_producer_schedule_hash . emplace ( digest_type : : hash ( new_producers ) ) ; <nl> maybe_new_producer_schedule . emplace ( new_producers ) ; <nl> } <nl> <nl> if ( exts . count ( producer_schedule_change_extension : : extension_id ( ) ) > 0 ) { <nl> - auto wtmsig_digest = pfs . get_builtin_digest ( builtin_protocol_feature_t : : wtmsig_block_signatures ) ; <nl> - const auto & protocol_features = prev_activated_protocol_features - > protocol_features ; <nl> - bool wtmsig_enabled = wtmsig_digest & & protocol_features . find ( * wtmsig_digest ) ! = protocol_features . end ( ) ; <nl> - <nl> EOS_ASSERT ( wtmsig_enabled , producer_schedule_exception , " Block header producer_schedule_change_extension before activation of WTMsig Block Signatures " ) ; <nl> EOS_ASSERT ( ! was_pending_promoted , producer_schedule_exception , " cannot set pending producer schedule in the same block in which pending was promoted to active " ) ; <nl> <nl> namespace eosio { namespace chain { <nl> EOS_ASSERT ( prev_pending_schedule . schedule . producers . empty ( ) , producer_schedule_exception , <nl> " cannot set new pending producers until last pending is confirmed " ) ; <nl> <nl> + maybe_new_producer_schedule_hash . emplace ( digest_type : : hash ( new_producer_schedule ) ) ; <nl> maybe_new_producer_schedule . emplace ( new_producer_schedule ) ; <nl> } <nl> <nl> namespace eosio { namespace chain { <nl> <nl> if ( maybe_new_producer_schedule ) { <nl> result . pending_schedule . schedule = std : : move ( * maybe_new_producer_schedule ) ; <nl> - result . pending_schedule . schedule_hash = digest_type : : hash ( result . pending_schedule . schedule ) ; <nl> + result . pending_schedule . schedule_hash = std : : move ( * maybe_new_producer_schedule_hash ) ; <nl> result . pending_schedule . schedule_lib_num = block_number ; <nl> } else { <nl> if ( was_pending_promoted ) { <nl> mmm a / libraries / chain / controller . cpp <nl> ppp b / libraries / chain / controller . cpp <nl> struct controller_impl { <nl> void initialize_blockchain_state ( ) { <nl> wlog ( " Initializing new blockchain with genesis state " ) ; <nl> producer_authority_schedule initial_schedule = { 0 , { producer_authority { config : : system_account_name , block_signing_authority_v0 { 1 , { { conf . genesis . initial_key , 1 } } } } } } ; <nl> + legacy : : producer_schedule_type initial_legacy_schedule { 0 , { { config : : system_account_name , conf . genesis . initial_key } } } ; <nl> <nl> block_header_state genheader ; <nl> genheader . active_schedule = initial_schedule ; <nl> genheader . pending_schedule . schedule = initial_schedule ; <nl> - genheader . pending_schedule . schedule_hash = fc : : sha256 : : hash ( initial_schedule ) ; <nl> + / / TODO : if wtmsig block signatures are enabled this should be the hash of the producer authority <nl> + genheader . pending_schedule . schedule_hash = fc : : sha256 : : hash ( initial_legacy_schedule ) ; <nl> genheader . header . timestamp = conf . genesis . initial_timestamp ; <nl> genheader . header . action_mroot = conf . genesis . compute_chain_id ( ) ; <nl> genheader . id = genheader . header . id ( ) ; <nl> mmm a / unittests / snapshot_tests . cpp <nl> ppp b / unittests / snapshot_tests . cpp <nl> BOOST_AUTO_TEST_CASE_TEMPLATE ( test_compatible_versions , SNAPSHOT_SUITE , snapshot <nl> snapshotted_tester v2_tester ( chain . get_config ( ) , SNAPSHOT_SUITE : : get_reader ( v2 ) , 0 ) ; <nl> auto v2_integrity_value = v2_tester . control - > calculate_integrity_hash ( ) ; <nl> <nl> + BOOST_CHECK_EQUAL ( v2_integrity_value . str ( ) , base_integrity_value . str ( ) ) ; <nl> + <nl> / / create a latest snapshot <nl> auto latest_writer = SNAPSHOT_SUITE : : get_writer ( ) ; <nl> v2_tester . control - > write_snapshot ( latest_writer ) ; <nl> new file mode 100644 <nl> index 0000000000 . . f22b0f72d2 <nl> mmm / dev / null <nl> ppp b / unittests / snapshots / CMakeLists . txt <nl> <nl> + configure_file ( $ { CMAKE_CURRENT_SOURCE_DIR } / snap_v2 . bin . gz $ { CMAKE_CURRENT_BINARY_DIR } / snap_v2 . bin . gz COPYONLY ) <nl> + configure_file ( $ { CMAKE_CURRENT_SOURCE_DIR } / snap_v2 . json . gz $ { CMAKE_CURRENT_BINARY_DIR } / snap_v2 . json . gz COPYONLY ) <nl> new file mode 100644 <nl> index 0000000000 . . 541a429ca6 <nl> Binary files / dev / null and b / unittests / snapshots / snap_v2 . bin . gz differ <nl> new file mode 100644 <nl> index 0000000000 . . 1c2cf69b83 <nl> Binary files / dev / null and b / unittests / snapshots / snap_v2 . json . gz differ <nl>
set the schedule_hash for block signature digests correctly based on the activation of the protocol features . Added v2 snapshots based on a deterministic blockchain and added test to make sure that recreateing the blockchain and loading the compatible snapshot produce the same integrity hash
EOSIO/eos
161f765637cf98a3c76db3712c7677f2c77049fa
2019-05-23T20:03:39Z
mmm a / utils / swift - api - dump . py <nl> ppp b / utils / swift - api - dump . py <nl> def collect_frameworks ( sdk ) : <nl> ( exitcode , sdk_path , err ) = run_command ( <nl> [ " xcrun " , " - - show - sdk - path " , " - sdk " , sdk ] ) <nl> if exitcode ! = 0 : <nl> - print ( ' error : framework collection failed with error % d ' % ( exitcode ) ) <nl> + print ( ' error : framework collection failed to find SDK path for % s with error % d ' % ( sdk , exitcode ) ) <nl> return ( ) <nl> sdk_path = sdk_path . rstrip ( ) <nl> <nl> ( exitcode , sdk_version , err ) = run_command ( <nl> [ " xcrun " , " - - show - sdk - version " , " - sdk " , sdk ] ) <nl> if exitcode ! = 0 : <nl> - print ( ' error : framework collection failed with error % d ' % ( exitcode ) ) <nl> + print ( ' error : framework collection failed to find SDK version for % s with error % d ' % ( sdk , exitcode ) ) <nl> return ( ) <nl> sdk_version = sdk_version . rstrip ( ) <nl> <nl>
[ swift - api - dump ] Improve failure diagnostics slightly
apple/swift
4d5dfffbaad28cf1c8e3f93fe10831d0e573978d
2016-04-19T00:08:06Z
mmm a / xbmc / filesystem / CurlFile . cpp <nl> ppp b / xbmc / filesystem / CurlFile . cpp <nl> extern " C " int debug_callback ( CURL_HANDLE * handle , curl_infotype info , char * out <nl> CUtil : : Tokenize ( strLine , vecLines , " \ r \ n " ) ; <nl> std : : vector < CStdString > : : const_iterator it = vecLines . begin ( ) ; <nl> <nl> - while ( it ! = vecLines . end ( ) ) { <nl> - CLog : : Log ( LOGDEBUG , " Curl : : Debug % s " , ( * it ) . c_str ( ) ) ; <nl> + char * infotype ; <nl> + switch ( info ) <nl> + { <nl> + case CURLINFO_TEXT : infotype = ( char * ) " TEXT : " ; break ; <nl> + case CURLINFO_HEADER_IN : infotype = ( char * ) " HEADER_IN : " ; break ; <nl> + case CURLINFO_HEADER_OUT : infotype = ( char * ) " HEADER_OUT : " ; break ; <nl> + case CURLINFO_SSL_DATA_IN : infotype = ( char * ) " SSL_DATA_IN : " ; break ; <nl> + case CURLINFO_SSL_DATA_OUT : infotype = ( char * ) " SSL_DATA_OUT : " ; break ; <nl> + case CURLINFO_END : infotype = ( char * ) " END : " ; break ; <nl> + default : infotype = ( char * ) " " ; break ; <nl> + } <nl> + <nl> + while ( it ! = vecLines . end ( ) ) <nl> + { <nl> + CLog : : Log ( LOGDEBUG , " Curl : : Debug - % s % s " , infotype , ( * it ) . c_str ( ) ) ; <nl> it + + ; <nl> } <nl> return 0 ; <nl> size_t CCurlFile : : CReadState : : WriteCallback ( char * buffer , size_t size , size_t ni <nl> if ( maxWriteable ) <nl> { <nl> if ( ! m_buffer . WriteData ( m_overflowBuffer , maxWriteable ) ) <nl> - CLog : : Log ( LOGERROR , " Unable to write to buffer - what ' s up ? " ) ; <nl> + CLog : : Log ( LOGERROR , " CCurlFile : : WriteCallback - Unable to write to buffer - what ' s up ? " ) ; <nl> if ( m_overflowSize > maxWriteable ) <nl> { / / still have some more - copy it down <nl> memmove ( m_overflowBuffer , m_overflowBuffer + maxWriteable , m_overflowSize - maxWriteable ) ; <nl> size_t CCurlFile : : CReadState : : WriteCallback ( char * buffer , size_t size , size_t ni <nl> { <nl> if ( ! m_buffer . WriteData ( buffer , maxWriteable ) ) <nl> { <nl> - CLog : : Log ( LOGERROR , " % s - Unable to write to buffer with % i bytes - what ' s up ? " , __FUNCTION__ , maxWriteable ) ; <nl> + CLog : : Log ( LOGERROR , " CCurlFile : : WriteCallback - Unable to write to buffer with % i bytes - what ' s up ? " , maxWriteable ) ; <nl> } <nl> else <nl> { <nl> size_t CCurlFile : : CReadState : : WriteCallback ( char * buffer , size_t size , size_t ni <nl> m_overflowBuffer = ( char * ) realloc_simple ( m_overflowBuffer , amount + m_overflowSize ) ; <nl> if ( m_overflowBuffer = = NULL ) <nl> { <nl> - CLog : : Log ( LOGWARNING , " % s - Failed to grow overflow buffer from % i bytes to % i bytes " , __FUNCTION__ , m_overflowSize , amount + m_overflowSize ) ; <nl> + CLog : : Log ( LOGWARNING , " CCurlFile : : WriteCallback - Failed to grow overflow buffer from % i bytes to % i bytes " , m_overflowSize , amount + m_overflowSize ) ; <nl> return 0 ; <nl> } <nl> memcpy ( m_overflowBuffer + m_overflowSize , buffer , amount ) ; <nl> long CCurlFile : : CReadState : : Connect ( unsigned int size ) <nl> m_stillRunning = 1 ; <nl> if ( ! FillBuffer ( 1 ) ) <nl> { <nl> - CLog : : Log ( LOGERROR , " CCurlFile : : CReadState : : Open , didn ' t get any data from stream . " ) ; <nl> + CLog : : Log ( LOGERROR , " CCurlFile : : CReadState : : Connect , didn ' t get any data from stream . " ) ; <nl> return - 1 ; <nl> } <nl> <nl> bool CCurlFile : : ReadData ( CStdString & strHTML ) <nl> <nl> bool CCurlFile : : Download ( const CStdString & strURL , const CStdString & strFileName , LPDWORD pdwSize ) <nl> { <nl> - CLog : : Log ( LOGINFO , " Download : % s - > % s " , strURL . c_str ( ) , strFileName . c_str ( ) ) ; <nl> + CLog : : Log ( LOGINFO , " CCurlFile : : Download - % s - > % s " , strURL . c_str ( ) , strFileName . c_str ( ) ) ; <nl> <nl> CStdString strData ; <nl> if ( ! Get ( strURL , strData ) ) <nl> bool CCurlFile : : Download ( const CStdString & strURL , const CStdString & strFileName <nl> XFILE : : CFile file ; <nl> if ( ! file . OpenForWrite ( strFileName , true ) ) <nl> { <nl> - CLog : : Log ( LOGERROR , " Unable to open file % s : % u " , <nl> + CLog : : Log ( LOGERROR , " CCurlFile : : Download - Unable to open file % s : % u " , <nl> strFileName . c_str ( ) , GetLastError ( ) ) ; <nl> return false ; <nl> } <nl> bool CCurlFile : : Open ( const CURL & url ) <nl> | | ! m_state - > m_httpheader . GetValue ( " icy - name " ) . IsEmpty ( ) <nl> | | ! m_state - > m_httpheader . GetValue ( " icy - br " ) . IsEmpty ( ) ) & & ! m_skipshout ) <nl> { <nl> - CLog : : Log ( LOGDEBUG , " CurlFile - file < % s > is a shoutcast stream . re - opening " , m_url . c_str ( ) ) ; <nl> + CLog : : Log ( LOGDEBUG , " CCurlFile : : Open - File < % s > is a shoutcast stream . Re - opening " , m_url . c_str ( ) ) ; <nl> throw new CRedirectException ( new CShoutcastFile ) ; <nl> } <nl> <nl> bool CCurlFile : : Open ( const CURL & url ) <nl> m_multisession = true ; <nl> if ( m_state - > m_httpheader . GetValue ( " Server " ) . Find ( " Portable SDK for UPnP devices " ) > = 0 ) <nl> { <nl> - CLog : : Log ( LOGWARNING , " CurlFile - disabling multi session due to broken libupnp server " ) ; <nl> + CLog : : Log ( LOGWARNING , " CCurlFile : : Open - Disabling multi session due to broken libupnp server " ) ; <nl> m_multisession = false ; <nl> } <nl> } <nl> int CCurlFile : : Write ( const void * lpBuf , int64_t uiBufSize ) <nl> { <nl> long code ; <nl> if ( g_curlInterface . easy_getinfo ( m_state - > m_easyHandle , CURLINFO_RESPONSE_CODE , & code ) = = CURLE_OK ) <nl> - CLog : : Log ( LOGERROR , " % s - unable to write curl resource ( % s ) - % ld " , __FUNCTION__ , m_url . c_str ( ) , code ) ; <nl> + CLog : : Log ( LOGERROR , " % s - Unable to write curl resource ( % s ) - % ld " , __FUNCTION__ , m_url . c_str ( ) , code ) ; <nl> m_inError = true ; <nl> return - 1 ; <nl> } <nl> bool CCurlFile : : Exists ( const CURL & url ) <nl> / / if file is already running , get info from it <nl> if ( m_opened ) <nl> { <nl> - CLog : : Log ( LOGWARNING , " % s - Exist called on open file " , __FUNCTION__ ) ; <nl> + CLog : : Log ( LOGWARNING , " CCurlFile : : Exists - Exist called on open file " , __FUNCTION__ ) ; <nl> return true ; <nl> } <nl> <nl> bool CCurlFile : : Exists ( const CURL & url ) <nl> if ( result = = CURLE_WRITE_ERROR | | result = = CURLE_OK ) <nl> return true ; <nl> <nl> + if ( result = = CURLE_HTTP_RETURNED_ERROR ) <nl> + { <nl> + long code ; <nl> + if ( g_curlInterface . easy_getinfo ( m_state - > m_easyHandle , CURLINFO_RESPONSE_CODE , & code ) = = CURLE_OK & & code ! = 404 ) <nl> + CLog : : Log ( LOGERROR , " CCurlFile : : Exists - Failed : HTTP returned error % ld for % s " , code , url . Get ( ) . c_str ( ) ) ; <nl> + } <nl> + else if ( result ! = CURLE_REMOTE_FILE_NOT_FOUND & & result ! = CURLE_FTP_COULDNT_RETR_FILE ) <nl> + { <nl> + CLog : : Log ( LOGERROR , " CCurlFile : : Exists - Failed : % s ( % d ) for % s " , g_curlInterface . easy_strerror ( result ) , result , url . Get ( ) . c_str ( ) ) ; <nl> + } <nl> + <nl> errno = ENOENT ; <nl> return false ; <nl> } <nl> int CCurlFile : : Stat ( const CURL & url , struct __stat64 * buffer ) <nl> / / if file is already running , get info from it <nl> if ( m_opened ) <nl> { <nl> - CLog : : Log ( LOGWARNING , " % s - Stat called on open file % s " , __FUNCTION__ , url . Get ( ) . c_str ( ) ) ; <nl> + CLog : : Log ( LOGWARNING , " CCurlFile : : Stat - Stat called on open file % s " , __FUNCTION__ , url . Get ( ) . c_str ( ) ) ; <nl> if ( buffer ) <nl> { <nl> memset ( buffer , 0 , sizeof ( struct __stat64 ) ) ; <nl> int CCurlFile : : Stat ( const CURL & url , struct __stat64 * buffer ) <nl> { <nl> g_curlInterface . easy_release ( & m_state - > m_easyHandle , NULL ) ; <nl> errno = ENOENT ; <nl> + CLog : : Log ( LOGERROR , " CCurlFile : : Stat - Failed : % s ( % d ) for % s " , g_curlInterface . easy_strerror ( result ) , result , url . Get ( ) . c_str ( ) ) ; <nl> return - 1 ; <nl> } <nl> <nl> double length ; <nl> - if ( CURLE_OK ! = g_curlInterface . easy_getinfo ( m_state - > m_easyHandle , CURLINFO_CONTENT_LENGTH_DOWNLOAD , & length ) | | length < 0 . 0 ) <nl> + result = g_curlInterface . easy_getinfo ( m_state - > m_easyHandle , CURLINFO_CONTENT_LENGTH_DOWNLOAD , & length ) ; <nl> + if ( result ! = CURLE_OK | | length < 0 . 0 ) <nl> { <nl> if ( url . GetProtocol ( ) = = " ftp " ) <nl> { <nl> g_curlInterface . easy_release ( & m_state - > m_easyHandle , NULL ) ; <nl> + CLog : : Log ( LOGNOTICE , " CCurlFile : : Stat - Content length failed : % s ( % d ) for % s " , g_curlInterface . easy_strerror ( result ) , result , url . Get ( ) . c_str ( ) ) ; <nl> errno = ENOENT ; <nl> return - 1 ; <nl> } <nl> int CCurlFile : : Stat ( const CURL & url , struct __stat64 * buffer ) <nl> if ( buffer ) <nl> { <nl> char * content ; <nl> - if ( CURLE_OK ! = g_curlInterface . easy_getinfo ( m_state - > m_easyHandle , CURLINFO_CONTENT_TYPE , & content ) ) <nl> + result = g_curlInterface . easy_getinfo ( m_state - > m_easyHandle , CURLINFO_CONTENT_TYPE , & content ) ; <nl> + if ( result ! = CURLE_OK ) <nl> { <nl> + CLog : : Log ( LOGNOTICE , " CCurlFile : : Stat - Content type failed : % s ( % d ) for % s " , g_curlInterface . easy_strerror ( result ) , result , url . Get ( ) . c_str ( ) ) ; <nl> g_curlInterface . easy_release ( & m_state - > m_easyHandle , NULL ) ; <nl> errno = ENOENT ; <nl> return - 1 ; <nl> int CCurlFile : : Stat ( const CURL & url , struct __stat64 * buffer ) <nl> buffer - > st_mode = _S_IFREG ; <nl> } <nl> long filetime ; <nl> - if ( CURLE_OK ! = g_curlInterface . easy_getinfo ( m_state - > m_easyHandle , CURLINFO_FILETIME , & filetime ) ) <nl> + result = g_curlInterface . easy_getinfo ( m_state - > m_easyHandle , CURLINFO_FILETIME , & filetime ) ; <nl> + if ( result ! = CURLE_OK ) <nl> { <nl> - CLog : : Log ( LOGWARNING , " % s - Cannot get curl filetime for % s " , __FUNCTION__ , url . Get ( ) . c_str ( ) ) ; <nl> + CLog : : Log ( LOGNOTICE , " CCurlFile : : Stat - Filetime failed : % s ( % d ) for % s " , g_curlInterface . easy_strerror ( result ) , result , url . Get ( ) . c_str ( ) ) ; <nl> } <nl> else <nl> { <nl> bool CCurlFile : : CReadState : : FillBuffer ( unsigned int want ) <nl> if ( msg - > data . result = = CURLE_OK ) <nl> return true ; <nl> <nl> - CLog : : Log ( LOGWARNING , " % s : curl failed with code % i " , __FUNCTION__ , msg - > data . result ) ; <nl> + CLog : : Log ( LOGERROR , " CCurlFile : : FillBuffer - Failed : % s ( % d ) " , g_curlInterface . easy_strerror ( msg - > data . result ) , msg - > data . result ) ; <nl> <nl> / / We need to check the result here as we don ' t want to retry on every error <nl> if ( ( msg - > data . result = = CURLE_OPERATION_TIMEDOUT | | <nl> bool CCurlFile : : CReadState : : FillBuffer ( unsigned int want ) <nl> / / If we got here something is wrong <nl> if ( + + retry > g_advancedSettings . m_curlretries ) <nl> { <nl> - CLog : : Log ( LOGWARNING , " % s : Reconnect failed ! " , __FUNCTION__ ) ; <nl> + CLog : : Log ( LOGERROR , " CCurlFile : : FillBuffer - Reconnect failed ! " ) ; <nl> / / Reset the rest of the variables like we would in Disconnect ( ) <nl> m_filePos = 0 ; <nl> m_fileSize = 0 ; <nl> bool CCurlFile : : CReadState : : FillBuffer ( unsigned int want ) <nl> return false ; <nl> } <nl> <nl> - CLog : : Log ( LOGWARNING , " % s : Reconnect , ( re ) try % i " , __FUNCTION__ , retry ) ; <nl> + CLog : : Log ( LOGNOTICE , " CCurlFile : : FillBuffer - Reconnect , ( re ) try % i " , retry ) ; <nl> <nl> / / Connect + seek to current position ( again ) <nl> SetResume ( ) ; <nl> bool CCurlFile : : CReadState : : FillBuffer ( unsigned int want ) <nl> we call dllselect ( 0 , . . . ) , which is basically equal to sleep . * / <nl> if ( SOCKET_ERROR = = dllselect ( maxfd + 1 , & fdread , & fdwrite , & fdexcep , & t ) ) <nl> { <nl> - CLog : : Log ( LOGERROR , " % s - curl failed with socket error " , __FUNCTION__ ) ; <nl> + CLog : : Log ( LOGERROR , " CCurlFile : : FillBuffer - Failed with socket error " ) ; <nl> return false ; <nl> } <nl> } <nl> bool CCurlFile : : CReadState : : FillBuffer ( unsigned int want ) <nl> break ; <nl> default : <nl> { <nl> - CLog : : Log ( LOGERROR , " % s - curl multi perform failed with code % d , aborting " , __FUNCTION__ , result ) ; <nl> + CLog : : Log ( LOGERROR , " CCurlFile : : FillBuffer - Multi perform failed with code % d , aborting " , result ) ; <nl> return false ; <nl> } <nl> break ; <nl> mmm a / xbmc / filesystem / DllLibCurl . h <nl> ppp b / xbmc / filesystem / DllLibCurl . h <nl> namespace XCURL <nl> DEFINE_METHOD1 ( void , multi_cleanup , ( CURLM * p1 ) ) <nl> DEFINE_METHOD2 ( struct curl_slist * , slist_append , ( struct curl_slist * p1 , const char * p2 ) ) <nl> DEFINE_METHOD1 ( void , slist_free_all , ( struct curl_slist * p1 ) ) <nl> + DEFINE_METHOD1 ( const char * , easy_strerror , ( CURLcode p1 ) ) <nl> BEGIN_METHOD_RESOLVE ( ) <nl> RESOLVE_METHOD_RENAME ( curl_global_init , global_init ) <nl> RESOLVE_METHOD_RENAME ( curl_global_cleanup , global_cleanup ) <nl> RESOLVE_METHOD_RENAME ( curl_easy_init , easy_init ) <nl> + RESOLVE_METHOD_RENAME ( curl_easy_strerror , easy_strerror ) <nl> RESOLVE_METHOD_RENAME_FP ( curl_easy_setopt , easy_setopt ) <nl> RESOLVE_METHOD_RENAME ( curl_easy_perform , easy_perform ) <nl> RESOLVE_METHOD_RENAME ( curl_easy_pause , easy_pause ) <nl>
changed : Improve Curl ( error ) logging to make it easier to detect issues
xbmc/xbmc
a5e6fa761a82ce8360690e206c22e29f0d426243
2013-04-01T10:34:43Z
mmm a / tensorflow / compiler / mlir / xla / ir / hlo_ops . cc <nl> ppp b / tensorflow / compiler / mlir / xla / ir / hlo_ops . cc <nl> OpFoldResult IotaOp : : fold ( ArrayRef < Attribute > operands ) { <nl> / / ConvertOp <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> <nl> + void ConvertOp : : build ( Builder * builder , OperationState & result , Value * operand , <nl> + Type result_element_ty ) { <nl> + Type result_ty ; <nl> + Type operand_ty = operand - > getType ( ) ; <nl> + if ( auto ranked_ty = operand_ty . dyn_cast < RankedTensorType > ( ) ) { <nl> + result_ty = RankedTensorType : : get ( ranked_ty . getShape ( ) , result_element_ty ) ; <nl> + } else { <nl> + result_ty = UnrankedTensorType : : get ( result_element_ty ) ; <nl> + } <nl> + build ( builder , result , result_ty , operand ) ; <nl> + } <nl> + <nl> namespace { <nl> <nl> / / Converts the values of an ElementsAttr into the corresponding type . <nl> OpFoldResult ReverseOp : : fold ( ArrayRef < Attribute > operands ) { <nl> / / ReduceOp <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> <nl> + / / Returns the result type after reducing operand of the given type across the <nl> + / / specified dimensions . <nl> + static TensorType GetReduceResultType ( Type operand_ty , <nl> + DenseIntElementsAttr dimensions , <nl> + Builder * builder ) { <nl> + Type element_ty = getElementTypeOrSelf ( operand_ty ) ; <nl> + <nl> + auto ranked_ty = operand_ty . dyn_cast < RankedTensorType > ( ) ; <nl> + if ( ! ranked_ty ) return UnrankedTensorType : : get ( element_ty ) ; <nl> + <nl> + int64_t rank = ranked_ty . getRank ( ) ; <nl> + llvm : : SmallVector < bool , 4 > dims_mask ( rank , false ) ; <nl> + for ( int64_t dim : dimensions . getValues < int64_t > ( ) ) dims_mask [ dim ] = true ; <nl> + <nl> + SmallVector < int64_t , 4 > shape ; <nl> + for ( int64_t i = 0 ; i < rank ; + + i ) { <nl> + if ( ! dims_mask [ i ] ) shape . push_back ( ranked_ty . getDimSize ( i ) ) ; <nl> + } <nl> + <nl> + return RankedTensorType : : get ( shape , element_ty ) ; <nl> + } <nl> + <nl> + void ReduceOp : : build ( Builder * builder , OperationState & state , <nl> + ArrayRef < Value * > operands , ArrayRef < Value * > init_values , <nl> + DenseIntElementsAttr dimensions ) { <nl> + SmallVector < Type , 1 > result_ty ; <nl> + result_ty . reserve ( operands . size ( ) ) ; <nl> + <nl> + for ( Value * operand : operands ) { <nl> + result_ty . push_back ( <nl> + GetReduceResultType ( operand - > getType ( ) , dimensions , builder ) ) ; <nl> + } <nl> + build ( builder , state , result_ty , operands , init_values , dimensions ) ; <nl> + } <nl> + <nl> LogicalResult ReduceOp : : fold ( ArrayRef < Attribute > operands , <nl> SmallVectorImpl < OpFoldResult > & results ) { <nl> / / No dimensions to reduce . <nl> mmm a / tensorflow / compiler / mlir / xla / ir / hlo_ops . td <nl> ppp b / tensorflow / compiler / mlir / xla / ir / hlo_ops . td <nl> def HLO_CeilOp : HLO_UnaryElementwiseOp < " ceil " , [ NoSideEffect , SameOperandsAndRes <nl> <nl> def HLO_ConvertOp : HLO_UnaryElementwiseOp < <nl> " convert " , [ NoSideEffect , SameOperandsAndResultShape ] > , BASE_HLO_ConvertOp { <nl> + <nl> + let builders = [ OpBuilder < <nl> + " Builder * , OperationState & tblgen_state , Value * operand , " <nl> + " Type result_element_ty " <nl> + > ] ; <nl> + <nl> let hasFolder = 1 ; <nl> <nl> / / TODO ( b / 130357376 ) Convert has a special constructor . Use a custom <nl> def HLO_ReduceOp : HLO_Op < " reduce " , [ <nl> <nl> let results = ( outs Variadic < HLO_TensorOrTuple > ) ; <nl> <nl> + let builders = [ OpBuilder < <nl> + " Builder * , OperationState & state , ArrayRef < Value * > operands , " <nl> + " ArrayRef < Value * > init_values , DenseIntElementsAttr dimensions " <nl> + > ] ; <nl> + <nl> let hasFolder = 1 ; <nl> <nl> / / TODO ( hinsu ) : Verify that the attached body arguments and results are <nl> mmm a / tensorflow / compiler / mlir / xla / transforms / legalize_tf . cc <nl> ppp b / tensorflow / compiler / mlir / xla / transforms / legalize_tf . cc <nl> static llvm : : Optional < int64_t > GetIntegerHLOAxisFromTFAxis ( Value * value , <nl> / / / the shape of the input value . <nl> static xla_hlo : : ConvertOp CastElementsToI64 ( Location loc , Value * value , <nl> PatternRewriter * rewriter ) { <nl> - auto type = value - > getType ( ) . cast < RankedTensorType > ( ) ; <nl> - assert ( type & & " CastElementsToI64 requires a shaped tensor as input . " ) ; <nl> - ArrayRef < int64_t > shape = type . getShape ( ) ; <nl> - auto i64_type = RankedTensorType : : get ( shape , rewriter - > getIntegerType ( 64 ) ) ; <nl> - return rewriter - > create < xla_hlo : : ConvertOp > ( loc , i64_type , value ) ; <nl> + return rewriter - > create < xla_hlo : : ConvertOp > ( loc , value , <nl> + rewriter - > getIntegerType ( 64 ) ) ; <nl> } <nl> <nl> / / Returns size of dimension at the specified index , if ranked tensor . <nl> static void BuildReduceBody ( Type element_type , Region * body , <nl> block - > addArguments ( { type , type } ) ; <nl> <nl> Location loc = body - > getLoc ( ) ; <nl> - auto reducer = builder - > create < Op > ( loc , type , block - > getArgument ( 0 ) , <nl> - block - > getArgument ( 1 ) , <nl> - / * broadcast_dimensions = * / nullptr ) ; <nl> + auto reducer = <nl> + builder - > create < Op > ( loc , block - > getArgument ( 0 ) , block - > getArgument ( 1 ) , <nl> + / * broadcast_dimensions = * / nullptr ) ; <nl> builder - > create < xla_hlo : : ReturnOp > ( loc , reducer . getResult ( ) ) ; <nl> } <nl> <nl> static void BuildArgMinMaxReductionBody ( Type input_element_type , <nl> block - > addArguments ( { input_type , index_type , input_type , index_type } ) ; <nl> <nl> Location loc = body - > getLoc ( ) ; <nl> - Type compare_type = <nl> - RankedTensorType : : get ( / * shape = * / { } , builder - > getIntegerType ( 1 ) ) ; <nl> StringAttr compare_direction = <nl> StringAttr : : get ( direction , builder - > getContext ( ) ) ; <nl> Value * compare = builder - > create < xla_hlo : : CompareOp > ( <nl> - loc , compare_type , block - > getArgument ( 0 ) , block - > getArgument ( 2 ) , <nl> + loc , block - > getArgument ( 0 ) , block - > getArgument ( 2 ) , <nl> / * broadcast_dimensions = * / nullptr , compare_direction ) ; <nl> <nl> Value * selected_input = builder - > create < xla_hlo : : SelectOp > ( <nl> class ConvertBF16FloorDivOp : public OpRewritePattern < TF : : FloorDivOp > { <nl> <nl> auto out_type = op . z ( ) - > getType ( ) . cast < TensorType > ( ) ; <nl> <nl> - RankedTensorType l_type = op . x ( ) - > getType ( ) . dyn_cast < RankedTensorType > ( ) ; <nl> - RankedTensorType r_type = op . y ( ) - > getType ( ) . dyn_cast < RankedTensorType > ( ) ; <nl> + l = rewriter . create < xla_hlo : : ConvertOp > ( op . getLoc ( ) , l , <nl> + rewriter . getF32Type ( ) ) ; <nl> + r = rewriter . create < xla_hlo : : ConvertOp > ( op . getLoc ( ) , r , <nl> + rewriter . getF32Type ( ) ) ; <nl> <nl> - auto new_l_type = <nl> - ChangeTensorElementType ( & rewriter , l_type , rewriter . getF32Type ( ) ) ; <nl> - auto new_r_type = <nl> - ChangeTensorElementType ( & rewriter , r_type , rewriter . getF32Type ( ) ) ; <nl> - <nl> - l = rewriter . create < xla_hlo : : ConvertOp > ( op . getLoc ( ) , new_l_type , l ) ; <nl> - r = rewriter . create < xla_hlo : : ConvertOp > ( op . getLoc ( ) , new_r_type , r ) ; <nl> - <nl> - auto intermediate_type = rewriter . create < TF : : FloorDivOp > ( <nl> + auto intermediate = rewriter . create < TF : : FloorDivOp > ( <nl> op . getLoc ( ) , <nl> ChangeTensorElementType ( & rewriter , out_type , rewriter . getF32Type ( ) ) , l , <nl> r ) ; <nl> <nl> auto floor_op = rewriter . create < xla_hlo : : ConvertOp > ( op . getLoc ( ) , out_type , <nl> - intermediate_type ) ; <nl> + intermediate ) ; <nl> rewriter . replaceOp ( op , floor_op . getResult ( ) ) ; <nl> return Pattern : : matchSuccess ( ) ; <nl> } <nl> class ConvertSigmoidOp : public OpRewritePattern < TF : : SigmoidOp > { <nl> . cast < DenseIntElementsAttr > ( ) ) ; <nl> <nl> auto scaled_input = rewriter . create < xla_hlo : : MulOp > ( <nl> - op . getLoc ( ) , operand - > getType ( ) , operand , constant_ones , <nl> - DenseIntElementsAttr ( ) ) ; <nl> + op . getLoc ( ) , operand , constant_ones , DenseIntElementsAttr ( ) ) ; <nl> auto tanh_op = rewriter . create < xla_hlo : : TanhOp > ( <nl> op . getLoc ( ) , operand - > getType ( ) , scaled_input ) ; <nl> auto mul_op = rewriter . create < xla_hlo : : MulOp > ( <nl> - op . getLoc ( ) , operand - > getType ( ) , tanh_op , constant_ones , <nl> + op . getLoc ( ) , tanh_op , constant_ones , <nl> / * DenseIntElementsAttr = * / DenseIntElementsAttr ( ) ) ; <nl> auto add_op = rewriter . create < xla_hlo : : AddOp > ( <nl> - op . getLoc ( ) , operand - > getType ( ) , mul_op , constant_ones , <nl> + op . getLoc ( ) , mul_op , constant_ones , <nl> / * DenseIntElementsAttr = * / DenseIntElementsAttr ( ) ) ; <nl> <nl> rewriter . replaceOp ( op , add_op . getResult ( ) ) ; <nl> class ConvertSoftmaxOp : public OpRewritePattern < OpTy > { <nl> <nl> if ( use_log ) { <nl> Value * log = rewriter . create < xla_hlo : : LogOp > ( loc , reduce_out_type , sum ) ; <nl> - rewriter . replaceOpWithNewOp < xla_hlo : : SubOp > ( <nl> - op , op . getType ( ) , shifted_logits , log , batch_dims ) ; <nl> - } else { <nl> - rewriter . replaceOpWithNewOp < xla_hlo : : DivOp > ( op , op . getType ( ) , exp , sum , <nl> + rewriter . replaceOpWithNewOp < xla_hlo : : SubOp > ( op , shifted_logits , log , <nl> batch_dims ) ; <nl> + } else { <nl> + rewriter . replaceOpWithNewOp < xla_hlo : : DivOp > ( op , exp , sum , batch_dims ) ; <nl> } <nl> return Pattern : : matchSuccess ( ) ; <nl> } <nl> class GenericConvertReductionOp : public OpRewritePattern < OpTy > { <nl> reduced_dimensions_bitmap [ index ] = true ; <nl> xla_dimensions . push_back ( index ) ; <nl> } <nl> - SmallVector < int64_t , 4 > reduced_shape ; <nl> - reduced_shape . reserve ( input_shape . size ( ) ) ; <nl> - for ( size_t i = 0 ; i < input_shape . size ( ) ; + + i ) { <nl> - if ( ! reduced_dimensions_bitmap [ i ] ) { <nl> - / / If we are not reducing along dimension i . <nl> - int64_t dim = input_shape [ i ] ; <nl> - reduced_shape . push_back ( dim ) ; <nl> - } <nl> - } <nl> <nl> Location loc = op . getLoc ( ) ; <nl> Type element_type = input_ty . getElementType ( ) ; <nl> class GenericConvertReductionOp : public OpRewritePattern < OpTy > { <nl> Type reduce_element_type = <nl> is_accumulation ? GetAccumulationType ( element_type ) : element_type ; <nl> auto casted_input = rewriter . create < xla_hlo : : ConvertOp > ( <nl> - loc , RankedTensorType : : get ( input_shape , reduce_element_type ) , <nl> - op . input ( ) ) ; <nl> + loc , op . input ( ) , reduce_element_type ) ; <nl> <nl> / / Each reduction op can have a different initial value . <nl> Value * init = Derived : : GetInitialValue ( reduce_element_type , loc , rewriter ) ; <nl> <nl> - Type reduced_out_type = <nl> - RankedTensorType : : get ( reduced_shape , reduce_element_type ) ; <nl> - / / TODO ( hinsu ) : Infer reduced_out_type . <nl> auto reduction = rewriter . create < xla_hlo : : ReduceOp > ( <nl> - loc , reduced_out_type , casted_input . getResult ( ) , init , <nl> + loc , casted_input . getResult ( ) , init , <nl> GetI64ElementsAttr ( xla_dimensions , & rewriter ) ) ; <nl> BuildReduceBody < ReductionOp > ( reduce_element_type , & reduction . body ( ) , <nl> & rewriter ) ; <nl> class GenericConvertReductionOp : public OpRewritePattern < OpTy > { <nl> auto divisor = <nl> GetScalarForType ( reduce_element_type , loc , divisor_count , & rewriter ) ; <nl> auto broadcast_dims = GetI64ElementsAttr ( { } , & rewriter ) ; <nl> - result = rewriter . create < xla_hlo : : DivOp > ( <nl> - loc , reduced_out_type , result , divisor . getResult ( ) , broadcast_dims ) ; <nl> + result = rewriter . create < xla_hlo : : DivOp > ( loc , result , divisor . getResult ( ) , <nl> + broadcast_dims ) ; <nl> } <nl> <nl> - Type reduced_final_type = <nl> - RankedTensorType : : get ( reduced_shape , element_type ) ; <nl> - result = <nl> - rewriter . create < xla_hlo : : ConvertOp > ( loc , reduced_final_type , result ) ; <nl> + result = rewriter . create < xla_hlo : : ConvertOp > ( loc , result , element_type ) ; <nl> <nl> / / Need to reshape back after the reduction if we ' re keeping the reduced <nl> / / dimensions . <nl> class ConvertArgMinMaxOp : public OpRewritePattern < OpTy > { <nl> dimensions . erase ( dimensions . begin ( ) + axis ) ; <nl> ArrayRef < int64_t > reduction_result_shape ( dimensions ) ; <nl> <nl> - Type input_reduction_result_type = RankedTensorType : : get ( <nl> - reduction_result_shape , input_type . getElementType ( ) ) ; <nl> - Type index_reduction_result_type = RankedTensorType : : get ( <nl> - reduction_result_shape , index_type . getElementType ( ) ) ; <nl> - <nl> - Type result_types [ ] = { input_reduction_result_type , <nl> - index_reduction_result_type } ; <nl> Value * operands [ ] = { op . input ( ) , index_values } ; <nl> Value * init_values [ ] = { init_value , index_init_value } ; <nl> DenseIntElementsAttr reduction_dimensions = <nl> GetI64ElementsAttr ( { axis } , & rewriter ) ; <nl> <nl> auto reduction = rewriter . create < xla_hlo : : ReduceOp > ( <nl> - loc , llvm : : ArrayRef < Type > ( result_types ) , <nl> - llvm : : ArrayRef < Value * > ( operands ) , llvm : : ArrayRef < Value * > ( init_values ) , <nl> - reduction_dimensions ) ; <nl> + loc , llvm : : ArrayRef < Value * > ( operands ) , <nl> + llvm : : ArrayRef < Value * > ( init_values ) , reduction_dimensions ) ; <nl> StringRef direction = Derived : : GetDirection ( ) ; <nl> BuildArgMinMaxReductionBody ( input_element_type , index_element_type , <nl> direction , & reduction . body ( ) , & rewriter ) ; <nl> class ConvertMaxPoolGradOp : public OpRewritePattern < TF : : MaxPoolGradOp > { <nl> Type type = RankedTensorType : : get ( / * shape = * / { } , element_type ) ; <nl> block - > addArguments ( { type , type } ) ; <nl> <nl> - Type pred_type = <nl> - RankedTensorType : : get ( / * shape = * / { } , rewriter . getI1Type ( ) ) ; <nl> - <nl> auto reducer = rewriter . create < xla_hlo : : CompareOp > ( <nl> - loc , pred_type , block - > getArgument ( 0 ) , block - > getArgument ( 1 ) , <nl> + loc , block - > getArgument ( 0 ) , block - > getArgument ( 1 ) , <nl> / * broadcast_dimensions = * / nullptr , <nl> StringAttr : : get ( " GE " , rewriter . getContext ( ) ) ) ; <nl> rewriter . create < xla_hlo : : ReturnOp > ( loc , reducer . getResult ( ) ) ; <nl> class ConvertOneHotOp : public OpRewritePattern < TF : : OneHotOp > { <nl> llvm : : to_vector < 4 > ( indices_shape ) ; <nl> output_dims . insert ( output_dims . begin ( ) + axis , depth ) ; <nl> <nl> - auto index_type = RankedTensorType : : get ( output_dims , element_type ) ; <nl> - auto compare_type = <nl> - RankedTensorType : : get ( output_dims , rewriter . getIntegerType ( 1 ) ) ; <nl> - <nl> Location loc = op . getLoc ( ) ; <nl> + auto index_type = RankedTensorType : : get ( output_dims , element_type ) ; <nl> Value * compare = rewriter . create < xla_hlo : : CompareOp > ( <nl> - loc , compare_type , op . indices ( ) , <nl> + loc , op . indices ( ) , <nl> rewriter . create < xla_hlo : : IotaOp > ( <nl> loc , index_type , <nl> IntegerAttr : : get ( rewriter . getIntegerType ( 64 ) , axis ) ) , <nl>
Add build methods without output types for HLO ConvertOp and ReduceOp
tensorflow/tensorflow
dabad7d5fdfaefde215b7560517b6508bedefd28
2019-10-25T23:25:10Z
mmm a / android / sdk / src / main / java / com / taobao / weex / dom / flex / CSSNode . java <nl> ppp b / android / sdk / src / main / java / com / taobao / weex / dom / flex / CSSNode . java <nl> public boolean isLayoutChanged ( ) { <nl> * @ return <nl> * / <nl> public boolean updateLastLayout ( CSSLayout newLayout ) { <nl> - mIsLayoutChanged = lastLayout . equals ( newLayout ) ; <nl> + mIsLayoutChanged = ! lastLayout . equals ( newLayout ) ; <nl> if ( mIsLayoutChanged ) { <nl> lastLayout . copy ( newLayout ) ; <nl> } <nl>
* [ android ] fix Layout change flag result
apache/incubator-weex
9a550344746d16e3466bc54f843d6c94a7f28ce9
2016-05-16T12:34:56Z
mmm a / selfdrive / car / hyundai / values . py <nl> ppp b / selfdrive / car / hyundai / values . py <nl> class Buttons : <nl> 67 : 8 , 68 : 8 , 80 : 4 , 160 : 8 , 161 : 8 , 272 : 8 , 288 : 4 , 339 : 8 , 356 : 8 , 357 : 8 , 399 : 8 , 544 : 8 , 608 : 8 , 672 : 8 , 688 : 5 , 704 : 1 , 790 : 8 , 809 : 8 , 848 : 8 , 880 : 8 , 898 : 8 , 900 : 8 , 901 : 8 , 904 : 8 , 1056 : 8 , 1064 : 8 , 1065 : 8 , 1072 : 8 , 1075 : 8 , 1087 : 8 , 1088 : 8 , 1151 : 8 , 1200 : 8 , 1201 : 8 , 1232 : 4 , 1264 : 8 , 1265 : 8 , 1266 : 8 , 1296 : 8 , 1306 : 8 , 1312 : 8 , 1322 : 8 , 1331 : 8 , 1332 : 8 , 1333 : 8 , 1348 : 8 , 1349 : 8 , 1369 : 8 , 1370 : 8 , 1371 : 8 , 1407 : 8 , 1415 : 8 , 1419 : 8 , 1440 : 8 , 1442 : 4 , 1461 : 8 , 1470 : 8 <nl> } ] , <nl> CAR . SONATA : [ <nl> - { 67 : 8 , 68 : 8 , 127 : 8 , 304 : 8 , 320 : 8 , 339 : 8 , 356 : 4 , 544 : 8 , 545 : 8 , 546 : 8 , 547 : 8 , 548 : 8 , 549 : 8 , 550 : 8 , 576 : 8 , 593 : 8 , 608 : 8 , 688 : 6 , 809 : 8 , 832 : 8 , 854 : 8 , 865 : 8 , 870 : 7 , 871 : 8 , 872 : 8 , 897 : 8 , 902 : 8 , 903 : 8 , 905 : 8 , 908 : 8 , 909 : 8 , 912 : 7 , 913 : 8 , 916 : 8 , 1040 : 8 , 1042 : 8 , 1056 : 8 , 1057 : 8 , 1078 : 4 , 1089 : 5 , 1107 : 5 , 1108 : 8 , 1114 : 8 , 1136 : 8 , 1145 : 8 , 1151 : 8 , 1155 : 8 , 1156 : 8 , 1157 : 4 , 1162 : 8 , 1164 : 8 , 1168 : 8 , 1170 : 8 , 1173 : 8 , 1180 : 8 , 1183 : 8 , 1184 : 8 , 1186 : 2 , 1191 : 2 , 1193 : 8 , 1210 : 8 , 1225 : 8 , 1227 : 8 , 1265 : 4 , 1268 : 8 , 1280 : 8 , 1287 : 4 , 1290 : 8 , 1292 : 8 , 1294 : 8 , 1312 : 8 , 1322 : 8 , 1330 : 8 , 1339 : 8 , 1342 : 6 , 1343 : 8 , 1345 : 8 , 1348 : 8 , 1363 : 8 , 1369 : 8 , 1371 : 8 , 1378 : 8 , 1384 : 8 , 1394 : 8 , 1407 : 8 , 1419 : 8 , 1427 : 6 , 1446 : 8 , 1456 : 4 , 1460 : 8 , 1470 : 8 , 1485 : 8 , 1504 : 3 } , <nl> + { 67 : 8 , 68 : 8 , 127 : 8 , 304 : 8 , 320 : 8 , 339 : 8 , 356 : 4 , 544 : 8 , 576 : 8 , 593 : 8 , 608 : 8 , 688 : 6 , 809 : 8 , 832 : 8 , 854 : 8 , 865 : 8 , 870 : 7 , 871 : 8 , 872 : 8 , 897 : 8 , 902 : 8 , 903 : 8 , 905 : 8 , 908 : 8 , 909 : 8 , 912 : 7 , 913 : 8 , 916 : 8 , 1040 : 8 , 1042 : 8 , 1056 : 8 , 1057 : 8 , 1078 : 4 , 1089 : 5 , 1096 : 8 , 1107 : 5 , 1108 : 8 , 1114 : 8 , 1136 : 8 , 1145 : 8 , 1151 : 8 , 1155 : 8 , 1156 : 8 , 1157 : 4 , 1162 : 8 , 1164 : 8 , 1168 : 8 , 1170 : 8 , 1173 : 8 , 1180 : 8 , 1183 : 8 , 1184 : 8 , 1186 : 2 , 1191 : 2 , 1193 : 8 , 1210 : 8 , 1225 : 8 , 1227 : 8 , 1265 : 4 , 1268 : 8 , 1280 : 8 , 1287 : 4 , 1290 : 8 , 1292 : 8 , 1294 : 8 , 1312 : 8 , 1322 : 8 , 1330 : 8 , 1339 : 8 , 1342 : 6 , 1343 : 8 , 1345 : 8 , 1348 : 8 , 1363 : 8 , 1369 : 8 , 1371 : 8 , 1378 : 8 , 1379 : 8 , 1384 : 8 , 1394 : 8 , 1407 : 8 , 1419 : 8 , 1427 : 6 , 1446 : 8 , 1456 : 4 , 1460 : 8 , 1470 : 8 , 1485 : 8 , 1504 : 3 , 1988 : 8 , 1996 : 8 , 2000 : 8 , 2004 : 8 , 2008 : 8 , 2012 : 8 , 2015 : 8 } , <nl> ] , <nl> CAR . SONATA_2019 : [ <nl> { 66 : 8 , 67 : 8 , 68 : 8 , 127 : 8 , 273 : 8 , 274 : 8 , 275 : 8 , 339 : 8 , 356 : 4 , 399 : 8 , 447 : 8 , 512 : 6 , 544 : 8 , 593 : 8 , 608 : 8 , 688 : 5 , 790 : 8 , 809 : 8 , 832 : 8 , 884 : 8 , 897 : 8 , 899 : 8 , 902 : 8 , 903 : 6 , 916 : 8 , 1040 : 8 , 1056 : 8 , 1057 : 8 , 1078 : 4 , 1151 : 6 , 1168 : 7 , 1170 : 8 , 1253 : 8 , 1254 : 8 , 1255 : 8 , 1265 : 4 , 1280 : 1 , 1287 : 4 , 1290 : 8 , 1292 : 8 , 1294 : 8 , 1312 : 8 , 1314 : 8 , 1322 : 8 , 1331 : 8 , 1332 : 8 , 1333 : 8 , 1342 : 6 , 1345 : 8 , 1348 : 8 , 1349 : 8 , 1351 : 8 , 1353 : 8 , 1363 : 8 , 1365 : 8 , 1366 : 8 , 1367 : 8 , 1369 : 8 , 1397 : 8 , 1407 : 8 , 1415 : 8 , 1419 : 8 , 1425 : 2 , 1427 : 6 , 1440 : 8 , 1456 : 4 , 1470 : 8 , 1472 : 8 , 1486 : 8 , 1487 : 8 , 1491 : 8 , 1530 : 8 , 1532 : 5 , 2000 : 8 , 2001 : 8 , 2004 : 8 , 2005 : 8 , 2008 : 8 , 2009 : 8 , 2012 : 8 , 2013 : 8 , 2014 : 8 , 2016 : 8 , 2017 : 8 , 2024 : 8 , 2025 : 8 } , <nl>
Update 2020 Sonata Print ( )
commaai/openpilot
d417481e2b7bc364342be29d2611bfb6dcec656b
2020-07-03T23:29:31Z
mmm a / spawn . c <nl> ppp b / spawn . c <nl> static void spawn_command ( w_root_t * root , <nl> <nl> json_unpack ( cmd - > definition , " { s : s } " , " chdir " , & cwd ) ; <nl> if ( cwd ) { <nl> - w_string_t * cwd_str = w_string_new ( cwd ) ; <nl> + w_string_t * cwd_str = w_string_new_typed ( cwd , W_STRING_BYTE ) ; <nl> <nl> if ( w_is_path_absolute ( cwd ) ) { <nl> w_string_delref ( working_dir ) ; <nl>
Fixes spawn . c to use the new string types .
facebook/watchman
a664d73e704619a4424f9306575713ede3bd8685
2016-07-29T20:24:52Z
mmm a / src / wasm / wasm - objects . h <nl> ppp b / src / wasm / wasm - objects . h <nl> class WasmInstanceObject : public JSObject { <nl> V ( kImportedMutableGlobalsBuffersOffset , kPointerSize ) \ <nl> V ( kDebugInfoOffset , kPointerSize ) \ <nl> V ( kTableObjectOffset , kPointerSize ) \ <nl> - V ( kFunctionTablesOffset , kPointerSize ) \ <nl> V ( kImportedFunctionInstancesOffset , kPointerSize ) \ <nl> V ( kImportedFunctionCallablesOffset , kPointerSize ) \ <nl> V ( kIndirectFunctionTableInstancesOffset , kPointerSize ) \ <nl>
[ wasm ] Remove dead field from WasmInstanceObject
v8/v8
6cbd3186eed0533e4701fad0f7e0fb0035346a42
2018-05-17T12:27:49Z
mmm a / src / arm / code - stubs - arm . cc <nl> ppp b / src / arm / code - stubs - arm . cc <nl> void StringHelper : : GenerateCopyCharacters ( MacroAssembler * masm , <nl> __ bind ( & done ) ; <nl> } <nl> <nl> - void ToStringStub : : Generate ( MacroAssembler * masm ) { <nl> - / / The ToString stub takes one argument in r0 . <nl> - Label is_number ; <nl> - __ JumpIfSmi ( r0 , & is_number ) ; <nl> - <nl> - __ CompareObjectType ( r0 , r1 , r1 , FIRST_NONSTRING_TYPE ) ; <nl> - / / r0 : receiver <nl> - / / r1 : receiver instance type <nl> - __ Ret ( lo ) ; <nl> - <nl> - Label not_heap_number ; <nl> - __ cmp ( r1 , Operand ( HEAP_NUMBER_TYPE ) ) ; <nl> - __ b ( ne , & not_heap_number ) ; <nl> - __ bind ( & is_number ) ; <nl> - NumberToStringStub stub ( isolate ( ) ) ; <nl> - __ TailCallStub ( & stub ) ; <nl> - __ bind ( & not_heap_number ) ; <nl> - <nl> - Label not_oddball ; <nl> - __ cmp ( r1 , Operand ( ODDBALL_TYPE ) ) ; <nl> - __ b ( ne , & not_oddball ) ; <nl> - __ ldr ( r0 , FieldMemOperand ( r0 , Oddball : : kToStringOffset ) ) ; <nl> - __ Ret ( ) ; <nl> - __ bind ( & not_oddball ) ; <nl> - <nl> - __ push ( r0 ) ; / / Push argument . <nl> - __ TailCallRuntime ( Runtime : : kToString ) ; <nl> - } <nl> - <nl> <nl> void StringHelper : : GenerateFlatOneByteStringEquals ( <nl> MacroAssembler * masm , Register left , Register right , Register scratch1 , <nl> mmm a / src / arm64 / code - stubs - arm64 . cc <nl> ppp b / src / arm64 / code - stubs - arm64 . cc <nl> void CompareICStub : : GenerateMiss ( MacroAssembler * masm ) { <nl> __ Jump ( stub_entry ) ; <nl> } <nl> <nl> - void ToStringStub : : Generate ( MacroAssembler * masm ) { <nl> - / / The ToString stub takes one argument in x0 . <nl> - Label is_number ; <nl> - __ JumpIfSmi ( x0 , & is_number ) ; <nl> - <nl> - Label not_string ; <nl> - __ JumpIfObjectType ( x0 , x1 , x1 , FIRST_NONSTRING_TYPE , & not_string , hs ) ; <nl> - / / x0 : receiver <nl> - / / x1 : receiver instance type <nl> - __ Ret ( ) ; <nl> - __ Bind ( & not_string ) ; <nl> - <nl> - Label not_heap_number ; <nl> - __ Cmp ( x1 , HEAP_NUMBER_TYPE ) ; <nl> - __ B ( ne , & not_heap_number ) ; <nl> - __ Bind ( & is_number ) ; <nl> - NumberToStringStub stub ( isolate ( ) ) ; <nl> - __ TailCallStub ( & stub ) ; <nl> - __ Bind ( & not_heap_number ) ; <nl> - <nl> - Label not_oddball ; <nl> - __ Cmp ( x1 , ODDBALL_TYPE ) ; <nl> - __ B ( ne , & not_oddball ) ; <nl> - __ Ldr ( x0 , FieldMemOperand ( x0 , Oddball : : kToStringOffset ) ) ; <nl> - __ Ret ( ) ; <nl> - __ Bind ( & not_oddball ) ; <nl> - <nl> - __ Push ( x0 ) ; / / Push argument . <nl> - __ TailCallRuntime ( Runtime : : kToString ) ; <nl> - } <nl> - <nl> <nl> void StringHelper : : GenerateFlatOneByteStringEquals ( <nl> MacroAssembler * masm , Register left , Register right , Register scratch1 , <nl> mmm a / src / builtins / arm / builtins - arm . cc <nl> ppp b / src / builtins / arm / builtins - arm . cc <nl> void Builtins : : Generate_StringConstructor ( MacroAssembler * masm ) { <nl> __ bind ( & to_string ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( r2 ) ; <nl> __ EnterBuiltinFrame ( cp , r1 , r2 ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ LeaveBuiltinFrame ( cp , r1 , r2 ) ; <nl> __ SmiUntag ( r2 ) ; <nl> } <nl> void Builtins : : Generate_StringConstructor_ConstructStub ( MacroAssembler * masm ) { <nl> __ bind ( & convert ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( r6 ) ; <nl> __ EnterBuiltinFrame ( cp , r1 , r6 ) ; <nl> __ Push ( r3 ) ; <nl> __ Move ( r0 , r2 ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ Move ( r2 , r0 ) ; <nl> __ Pop ( r3 ) ; <nl> __ LeaveBuiltinFrame ( cp , r1 , r6 ) ; <nl> mmm a / src / builtins / arm64 / builtins - arm64 . cc <nl> ppp b / src / builtins / arm64 / builtins - arm64 . cc <nl> void Builtins : : Generate_StringConstructor ( MacroAssembler * masm ) { <nl> __ Bind ( & to_string ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( x2 ) ; <nl> __ EnterBuiltinFrame ( cp , x1 , x2 ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ LeaveBuiltinFrame ( cp , x1 , x2 ) ; <nl> __ SmiUntag ( x2 ) ; <nl> } <nl> void Builtins : : Generate_StringConstructor_ConstructStub ( MacroAssembler * masm ) { <nl> __ Bind ( & convert ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( x6 ) ; <nl> __ EnterBuiltinFrame ( cp , x1 , x6 ) ; <nl> __ Push ( x3 ) ; <nl> __ Move ( x0 , x2 ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ Move ( x2 , x0 ) ; <nl> __ Pop ( x3 ) ; <nl> __ LeaveBuiltinFrame ( cp , x1 , x6 ) ; <nl> mmm a / src / builtins / builtins - conversion . cc <nl> ppp b / src / builtins / builtins - conversion . cc <nl> void Builtins : : Generate_ToNumber ( CodeStubAssembler * assembler ) { <nl> assembler - > Return ( assembler - > ToNumber ( context , input ) ) ; <nl> } <nl> <nl> + void Builtins : : Generate_ToString ( CodeStubAssembler * assembler ) { <nl> + typedef CodeStubAssembler : : Label Label ; <nl> + typedef compiler : : Node Node ; <nl> + typedef TypeConversionDescriptor Descriptor ; <nl> + <nl> + Node * input = assembler - > Parameter ( Descriptor : : kArgument ) ; <nl> + Node * context = assembler - > Parameter ( Descriptor : : kContext ) ; <nl> + <nl> + Label is_number ( assembler ) ; <nl> + Label runtime ( assembler ) ; <nl> + <nl> + assembler - > GotoIf ( assembler - > WordIsSmi ( input ) , & is_number ) ; <nl> + <nl> + Node * input_map = assembler - > LoadMap ( input ) ; <nl> + Node * input_instance_type = assembler - > LoadMapInstanceType ( input_map ) ; <nl> + <nl> + Label not_string ( assembler ) ; <nl> + assembler - > GotoIf ( <nl> + assembler - > Int32GreaterThanOrEqual ( <nl> + input_instance_type , assembler - > Int32Constant ( FIRST_NONSTRING_TYPE ) ) , <nl> + & not_string ) ; <nl> + assembler - > Return ( input ) ; <nl> + <nl> + Label not_heap_number ( assembler ) ; <nl> + <nl> + assembler - > Bind ( & not_string ) ; <nl> + { <nl> + assembler - > GotoUnless ( <nl> + assembler - > WordEqual ( input_map , assembler - > HeapNumberMapConstant ( ) ) , <nl> + & not_heap_number ) ; <nl> + assembler - > Goto ( & is_number ) ; <nl> + } <nl> + <nl> + assembler - > Bind ( & is_number ) ; <nl> + { <nl> + / / TODO ( tebbi ) : inline as soon as NumberToString is in the CodeStubAssembler <nl> + Callable callable = CodeFactory : : NumberToString ( assembler - > isolate ( ) ) ; <nl> + assembler - > Return ( assembler - > CallStub ( callable , context , input ) ) ; <nl> + } <nl> + <nl> + assembler - > Bind ( & not_heap_number ) ; <nl> + { <nl> + assembler - > GotoIf ( <nl> + assembler - > Word32NotEqual ( input_instance_type , <nl> + assembler - > Int32Constant ( ODDBALL_TYPE ) ) , <nl> + & runtime ) ; <nl> + assembler - > Return ( <nl> + assembler - > LoadObjectField ( input , Oddball : : kToStringOffset ) ) ; <nl> + } <nl> + <nl> + assembler - > Bind ( & runtime ) ; <nl> + { <nl> + assembler - > Return ( <nl> + assembler - > CallRuntime ( Runtime : : kToString , context , input ) ) ; <nl> + } <nl> + } <nl> + <nl> Handle < Code > Builtins : : OrdinaryToPrimitive ( OrdinaryToPrimitiveHint hint ) { <nl> switch ( hint ) { <nl> case OrdinaryToPrimitiveHint : : kNumber : <nl> mmm a / src / builtins / builtins . h <nl> ppp b / src / builtins / builtins . h <nl> namespace internal { <nl> TFS ( ToName , BUILTIN , kNoExtraICState , TypeConversion ) \ <nl> TFS ( NonNumberToNumber , BUILTIN , kNoExtraICState , TypeConversion ) \ <nl> TFS ( ToNumber , BUILTIN , kNoExtraICState , TypeConversion ) \ <nl> + TFS ( ToString , BUILTIN , kNoExtraICState , TypeConversion ) \ <nl> \ <nl> / * Handlers * / \ <nl> ASH ( KeyedLoadIC_Megamorphic , KEYED_LOAD_IC , kNoExtraICState ) \ <nl> mmm a / src / builtins / ia32 / builtins - ia32 . cc <nl> ppp b / src / builtins / ia32 / builtins - ia32 . cc <nl> void Builtins : : Generate_StringConstructor ( MacroAssembler * masm ) { <nl> __ bind ( & to_string ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( ebx ) ; <nl> __ EnterBuiltinFrame ( esi , edi , ebx ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ LeaveBuiltinFrame ( esi , edi , ebx ) ; <nl> __ SmiUntag ( ebx ) ; <nl> } <nl> void Builtins : : Generate_StringConstructor_ConstructStub ( MacroAssembler * masm ) { <nl> __ bind ( & convert ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( ebx ) ; <nl> __ EnterBuiltinFrame ( esi , edi , ebx ) ; <nl> __ Push ( edx ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ Pop ( edx ) ; <nl> __ LeaveBuiltinFrame ( esi , edi , ebx ) ; <nl> __ SmiUntag ( ebx ) ; <nl> mmm a / src / builtins / mips / builtins - mips . cc <nl> ppp b / src / builtins / mips / builtins - mips . cc <nl> void Builtins : : Generate_StringConstructor ( MacroAssembler * masm ) { <nl> __ bind ( & to_string ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( t0 ) ; <nl> __ EnterBuiltinFrame ( cp , a1 , t0 ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ LeaveBuiltinFrame ( cp , a1 , t0 ) ; <nl> __ SmiUntag ( t0 ) ; <nl> } <nl> void Builtins : : Generate_StringConstructor_ConstructStub ( MacroAssembler * masm ) { <nl> __ bind ( & convert ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( t0 ) ; <nl> __ EnterBuiltinFrame ( cp , a1 , t0 ) ; <nl> __ Push ( a3 ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ Move ( a0 , v0 ) ; <nl> __ Pop ( a3 ) ; <nl> __ LeaveBuiltinFrame ( cp , a1 , t0 ) ; <nl> mmm a / src / builtins / mips64 / builtins - mips64 . cc <nl> ppp b / src / builtins / mips64 / builtins - mips64 . cc <nl> void Builtins : : Generate_StringConstructor ( MacroAssembler * masm ) { <nl> __ bind ( & to_string ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( t0 ) ; <nl> __ EnterBuiltinFrame ( cp , a1 , t0 ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ LeaveBuiltinFrame ( cp , a1 , t0 ) ; <nl> __ SmiUntag ( t0 ) ; <nl> } <nl> void Builtins : : Generate_StringConstructor_ConstructStub ( MacroAssembler * masm ) { <nl> __ bind ( & convert ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( t0 ) ; <nl> __ EnterBuiltinFrame ( cp , a1 , t0 ) ; <nl> __ Push ( a3 ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ Move ( a0 , v0 ) ; <nl> __ Pop ( a3 ) ; <nl> __ LeaveBuiltinFrame ( cp , a1 , t0 ) ; <nl> mmm a / src / builtins / ppc / builtins - ppc . cc <nl> ppp b / src / builtins / ppc / builtins - ppc . cc <nl> void Builtins : : Generate_StringConstructor ( MacroAssembler * masm ) { <nl> __ bind ( & to_string ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( r5 ) ; <nl> __ EnterBuiltinFrame ( cp , r4 , r5 ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ LeaveBuiltinFrame ( cp , r4 , r5 ) ; <nl> __ SmiUntag ( r5 ) ; <nl> } <nl> void Builtins : : Generate_StringConstructor_ConstructStub ( MacroAssembler * masm ) { <nl> __ bind ( & convert ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( r9 ) ; <nl> __ EnterBuiltinFrame ( cp , r4 , r9 ) ; <nl> __ Push ( r6 ) ; <nl> __ mr ( r3 , r5 ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ mr ( r5 , r3 ) ; <nl> __ Pop ( r6 ) ; <nl> __ LeaveBuiltinFrame ( cp , r4 , r9 ) ; <nl> mmm a / src / builtins / s390 / builtins - s390 . cc <nl> ppp b / src / builtins / s390 / builtins - s390 . cc <nl> void Builtins : : Generate_StringConstructor ( MacroAssembler * masm ) { <nl> __ bind ( & to_string ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( r4 ) ; <nl> __ EnterBuiltinFrame ( cp , r3 , r4 ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ LeaveBuiltinFrame ( cp , r3 , r4 ) ; <nl> __ SmiUntag ( r4 ) ; <nl> } <nl> void Builtins : : Generate_StringConstructor_ConstructStub ( MacroAssembler * masm ) { <nl> __ bind ( & convert ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( r8 ) ; <nl> __ EnterBuiltinFrame ( cp , r3 , r8 ) ; <nl> __ Push ( r5 ) ; <nl> __ LoadRR ( r2 , r4 ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ LoadRR ( r4 , r2 ) ; <nl> __ Pop ( r5 ) ; <nl> __ LeaveBuiltinFrame ( cp , r3 , r8 ) ; <nl> mmm a / src / builtins / x64 / builtins - x64 . cc <nl> ppp b / src / builtins / x64 / builtins - x64 . cc <nl> void Builtins : : Generate_StringConstructor ( MacroAssembler * masm ) { <nl> __ bind ( & to_string ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ EnterBuiltinFrame ( rsi , rdi , r8 ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ LeaveBuiltinFrame ( rsi , rdi , r8 ) ; <nl> } <nl> __ jmp ( & drop_frame_and_ret , Label : : kNear ) ; <nl> void Builtins : : Generate_StringConstructor_ConstructStub ( MacroAssembler * masm ) { <nl> __ bind ( & convert ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ EnterBuiltinFrame ( rsi , rdi , r8 ) ; <nl> __ Push ( rdx ) ; <nl> __ Move ( rax , rbx ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ Move ( rbx , rax ) ; <nl> __ Pop ( rdx ) ; <nl> __ LeaveBuiltinFrame ( rsi , rdi , r8 ) ; <nl> mmm a / src / builtins / x87 / builtins - x87 . cc <nl> ppp b / src / builtins / x87 / builtins - x87 . cc <nl> void Builtins : : Generate_StringConstructor ( MacroAssembler * masm ) { <nl> __ bind ( & to_string ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( ebx ) ; <nl> __ EnterBuiltinFrame ( esi , edi , ebx ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ LeaveBuiltinFrame ( esi , edi , ebx ) ; <nl> __ SmiUntag ( ebx ) ; <nl> } <nl> void Builtins : : Generate_StringConstructor_ConstructStub ( MacroAssembler * masm ) { <nl> __ bind ( & convert ) ; <nl> { <nl> FrameScope scope ( masm , StackFrame : : MANUAL ) ; <nl> - ToStringStub stub ( masm - > isolate ( ) ) ; <nl> __ SmiTag ( ebx ) ; <nl> __ EnterBuiltinFrame ( esi , edi , ebx ) ; <nl> __ Push ( edx ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ Call ( masm - > isolate ( ) - > builtins ( ) - > ToString ( ) , RelocInfo : : CODE_TARGET ) ; <nl> __ Pop ( edx ) ; <nl> __ LeaveBuiltinFrame ( esi , edi , ebx ) ; <nl> __ SmiUntag ( ebx ) ; <nl> mmm a / src / code - factory . cc <nl> ppp b / src / code - factory . cc <nl> Callable CodeFactory : : StringToNumber ( Isolate * isolate ) { <nl> <nl> / / static <nl> Callable CodeFactory : : ToString ( Isolate * isolate ) { <nl> - ToStringStub stub ( isolate ) ; <nl> - return make_callable ( stub ) ; <nl> + return Callable ( isolate - > builtins ( ) - > ToString ( ) , <nl> + TypeConversionDescriptor ( isolate ) ) ; <nl> } <nl> <nl> / / static <nl> mmm a / src / code - stubs - hydrogen . cc <nl> ppp b / src / code - stubs - hydrogen . cc <nl> <nl> # include < memory > <nl> <nl> # include " src / bailout - reason . h " <nl> + # include " src / code - factory . h " <nl> # include " src / crankshaft / hydrogen . h " <nl> # include " src / crankshaft / lithium . h " <nl> # include " src / field - index . h " <nl> HValue * CodeStubGraphBuilderBase : : BuildToString ( HValue * input , bool convert ) { <nl> } <nl> if_inputisprimitive . End ( ) ; <nl> / / Convert the primitive to a string value . <nl> - ToStringStub stub ( isolate ( ) ) ; <nl> HValue * values [ ] = { context ( ) , Pop ( ) } ; <nl> - Push ( AddUncasted < HCallWithDescriptor > ( Add < HConstant > ( stub . GetCode ( ) ) , 0 , <nl> - stub . GetCallInterfaceDescriptor ( ) , <nl> + Callable toString = CodeFactory : : ToString ( isolate ( ) ) ; <nl> + Push ( AddUncasted < HCallWithDescriptor > ( Add < HConstant > ( toString . code ( ) ) , 0 , <nl> + toString . descriptor ( ) , <nl> ArrayVector ( values ) ) ) ; <nl> } <nl> if_inputisstring . End ( ) ; <nl> mmm a / src / code - stubs . h <nl> ppp b / src / code - stubs . h <nl> class ObjectLiteral ; <nl> V ( StoreBufferOverflow ) \ <nl> V ( StoreElement ) \ <nl> V ( SubString ) \ <nl> - V ( ToString ) \ <nl> V ( StoreIC ) \ <nl> V ( KeyedStoreIC ) \ <nl> V ( KeyedLoadIC ) \ <nl> class SubStringStub : public TurboFanCodeStub { <nl> DEFINE_CODE_STUB ( SubString , TurboFanCodeStub ) ; <nl> } ; <nl> <nl> - class ToStringStub final : public PlatformCodeStub { <nl> - public : <nl> - explicit ToStringStub ( Isolate * isolate ) : PlatformCodeStub ( isolate ) { } <nl> - <nl> - DEFINE_CALL_INTERFACE_DESCRIPTOR ( TypeConversion ) ; <nl> - DEFINE_PLATFORM_CODE_STUB ( ToString , PlatformCodeStub ) ; <nl> - } ; <nl> - <nl> class ToObjectStub final : public TurboFanCodeStub { <nl> public : <nl> explicit ToObjectStub ( Isolate * isolate ) : TurboFanCodeStub ( isolate ) { } <nl> mmm a / src / ia32 / code - stubs - ia32 . cc <nl> ppp b / src / ia32 / code - stubs - ia32 . cc <nl> void StringHelper : : GenerateCopyCharacters ( MacroAssembler * masm , <nl> __ bind ( & done ) ; <nl> } <nl> <nl> - void ToStringStub : : Generate ( MacroAssembler * masm ) { <nl> - / / The ToString stub takes one argument in eax . <nl> - Label is_number ; <nl> - __ JumpIfSmi ( eax , & is_number , Label : : kNear ) ; <nl> - <nl> - Label not_string ; <nl> - __ CmpObjectType ( eax , FIRST_NONSTRING_TYPE , edi ) ; <nl> - / / eax : receiver <nl> - / / edi : receiver map <nl> - __ j ( above_equal , & not_string , Label : : kNear ) ; <nl> - __ Ret ( ) ; <nl> - __ bind ( & not_string ) ; <nl> - <nl> - Label not_heap_number ; <nl> - __ CompareMap ( eax , masm - > isolate ( ) - > factory ( ) - > heap_number_map ( ) ) ; <nl> - __ j ( not_equal , & not_heap_number , Label : : kNear ) ; <nl> - __ bind ( & is_number ) ; <nl> - NumberToStringStub stub ( isolate ( ) ) ; <nl> - __ TailCallStub ( & stub ) ; <nl> - __ bind ( & not_heap_number ) ; <nl> - <nl> - Label not_oddball ; <nl> - __ CmpInstanceType ( edi , ODDBALL_TYPE ) ; <nl> - __ j ( not_equal , & not_oddball , Label : : kNear ) ; <nl> - __ mov ( eax , FieldOperand ( eax , Oddball : : kToStringOffset ) ) ; <nl> - __ Ret ( ) ; <nl> - __ bind ( & not_oddball ) ; <nl> - <nl> - __ pop ( ecx ) ; / / Pop return address . <nl> - __ push ( eax ) ; / / Push argument . <nl> - __ push ( ecx ) ; / / Push return address . <nl> - __ TailCallRuntime ( Runtime : : kToString ) ; <nl> - } <nl> - <nl> <nl> void StringHelper : : GenerateFlatOneByteStringEquals ( MacroAssembler * masm , <nl> Register left , <nl> mmm a / src / mips / code - stubs - mips . cc <nl> ppp b / src / mips / code - stubs - mips . cc <nl> void StringHelper : : GenerateCopyCharacters ( MacroAssembler * masm , <nl> __ bind ( & done ) ; <nl> } <nl> <nl> - void ToStringStub : : Generate ( MacroAssembler * masm ) { <nl> - / / The ToString stub takes on argument in a0 . <nl> - Label is_number ; <nl> - __ JumpIfSmi ( a0 , & is_number ) ; <nl> - <nl> - Label not_string ; <nl> - __ GetObjectType ( a0 , a1 , a1 ) ; <nl> - / / a0 : receiver <nl> - / / a1 : receiver instance type <nl> - __ Branch ( & not_string , ge , a1 , Operand ( FIRST_NONSTRING_TYPE ) ) ; <nl> - __ Ret ( USE_DELAY_SLOT ) ; <nl> - __ mov ( v0 , a0 ) ; <nl> - __ bind ( & not_string ) ; <nl> - <nl> - Label not_heap_number ; <nl> - __ Branch ( & not_heap_number , ne , a1 , Operand ( HEAP_NUMBER_TYPE ) ) ; <nl> - __ bind ( & is_number ) ; <nl> - NumberToStringStub stub ( isolate ( ) ) ; <nl> - __ TailCallStub ( & stub ) ; <nl> - __ bind ( & not_heap_number ) ; <nl> - <nl> - Label not_oddball ; <nl> - __ Branch ( & not_oddball , ne , a1 , Operand ( ODDBALL_TYPE ) ) ; <nl> - __ Ret ( USE_DELAY_SLOT ) ; <nl> - __ lw ( v0 , FieldMemOperand ( a0 , Oddball : : kToStringOffset ) ) ; <nl> - __ bind ( & not_oddball ) ; <nl> - <nl> - __ push ( a0 ) ; / / Push argument . <nl> - __ TailCallRuntime ( Runtime : : kToString ) ; <nl> - } <nl> - <nl> <nl> void StringHelper : : GenerateFlatOneByteStringEquals ( <nl> MacroAssembler * masm , Register left , Register right , Register scratch1 , <nl> mmm a / src / mips64 / code - stubs - mips64 . cc <nl> ppp b / src / mips64 / code - stubs - mips64 . cc <nl> void StringHelper : : GenerateCopyCharacters ( MacroAssembler * masm , <nl> __ bind ( & done ) ; <nl> } <nl> <nl> - void ToStringStub : : Generate ( MacroAssembler * masm ) { <nl> - / / The ToString stub takes on argument in a0 . <nl> - Label is_number ; <nl> - __ JumpIfSmi ( a0 , & is_number ) ; <nl> - <nl> - Label not_string ; <nl> - __ GetObjectType ( a0 , a1 , a1 ) ; <nl> - / / a0 : receiver <nl> - / / a1 : receiver instance type <nl> - __ Branch ( & not_string , ge , a1 , Operand ( FIRST_NONSTRING_TYPE ) ) ; <nl> - __ Ret ( USE_DELAY_SLOT ) ; <nl> - __ mov ( v0 , a0 ) ; <nl> - __ bind ( & not_string ) ; <nl> - <nl> - Label not_heap_number ; <nl> - __ Branch ( & not_heap_number , ne , a1 , Operand ( HEAP_NUMBER_TYPE ) ) ; <nl> - __ bind ( & is_number ) ; <nl> - NumberToStringStub stub ( isolate ( ) ) ; <nl> - __ TailCallStub ( & stub ) ; <nl> - __ bind ( & not_heap_number ) ; <nl> - <nl> - Label not_oddball ; <nl> - __ Branch ( & not_oddball , ne , a1 , Operand ( ODDBALL_TYPE ) ) ; <nl> - __ Ret ( USE_DELAY_SLOT ) ; <nl> - __ ld ( v0 , FieldMemOperand ( a0 , Oddball : : kToStringOffset ) ) ; <nl> - __ bind ( & not_oddball ) ; <nl> - <nl> - __ push ( a0 ) ; / / Push argument . <nl> - __ TailCallRuntime ( Runtime : : kToString ) ; <nl> - } <nl> - <nl> <nl> void StringHelper : : GenerateFlatOneByteStringEquals ( <nl> MacroAssembler * masm , Register left , Register right , Register scratch1 , <nl> mmm a / src / ppc / code - stubs - ppc . cc <nl> ppp b / src / ppc / code - stubs - ppc . cc <nl> void StringHelper : : GenerateCopyCharacters ( MacroAssembler * masm , Register dest , <nl> __ bind ( & done ) ; <nl> } <nl> <nl> - void ToStringStub : : Generate ( MacroAssembler * masm ) { <nl> - / / The ToString stub takes one argument in r3 . <nl> - Label is_number ; <nl> - __ JumpIfSmi ( r3 , & is_number ) ; <nl> - <nl> - __ CompareObjectType ( r3 , r4 , r4 , FIRST_NONSTRING_TYPE ) ; <nl> - / / r3 : receiver <nl> - / / r4 : receiver instance type <nl> - __ Ret ( lt ) ; <nl> - <nl> - Label not_heap_number ; <nl> - __ cmpi ( r4 , Operand ( HEAP_NUMBER_TYPE ) ) ; <nl> - __ bne ( & not_heap_number ) ; <nl> - __ bind ( & is_number ) ; <nl> - NumberToStringStub stub ( isolate ( ) ) ; <nl> - __ TailCallStub ( & stub ) ; <nl> - __ bind ( & not_heap_number ) ; <nl> - <nl> - Label not_oddball ; <nl> - __ cmpi ( r4 , Operand ( ODDBALL_TYPE ) ) ; <nl> - __ bne ( & not_oddball ) ; <nl> - __ LoadP ( r3 , FieldMemOperand ( r3 , Oddball : : kToStringOffset ) ) ; <nl> - __ Ret ( ) ; <nl> - __ bind ( & not_oddball ) ; <nl> - <nl> - __ push ( r3 ) ; / / Push argument . <nl> - __ TailCallRuntime ( Runtime : : kToString ) ; <nl> - } <nl> - <nl> <nl> void StringHelper : : GenerateFlatOneByteStringEquals ( MacroAssembler * masm , <nl> Register left , <nl> mmm a / src / s390 / code - stubs - s390 . cc <nl> ppp b / src / s390 / code - stubs - s390 . cc <nl> void StringHelper : : GenerateCopyCharacters ( MacroAssembler * masm , Register dest , <nl> __ bind ( & done ) ; <nl> } <nl> <nl> - void ToStringStub : : Generate ( MacroAssembler * masm ) { <nl> - / / The ToString stub takes one argument in r2 . <nl> - Label done ; <nl> - Label is_number ; <nl> - __ JumpIfSmi ( r2 , & is_number ) ; <nl> - <nl> - __ CompareObjectType ( r2 , r3 , r3 , FIRST_NONSTRING_TYPE ) ; <nl> - / / r2 : receiver <nl> - / / r3 : receiver instance type <nl> - __ blt ( & done ) ; <nl> - <nl> - Label not_heap_number ; <nl> - __ CmpP ( r3 , Operand ( HEAP_NUMBER_TYPE ) ) ; <nl> - __ bne ( & not_heap_number ) ; <nl> - __ bind ( & is_number ) ; <nl> - NumberToStringStub stub ( isolate ( ) ) ; <nl> - __ TailCallStub ( & stub ) ; <nl> - __ bind ( & not_heap_number ) ; <nl> - <nl> - Label not_oddball ; <nl> - __ CmpP ( r3 , Operand ( ODDBALL_TYPE ) ) ; <nl> - __ bne ( & not_oddball ) ; <nl> - __ LoadP ( r2 , FieldMemOperand ( r2 , Oddball : : kToStringOffset ) ) ; <nl> - __ Ret ( ) ; <nl> - __ bind ( & not_oddball ) ; <nl> - <nl> - __ push ( r2 ) ; / / Push argument . <nl> - __ TailCallRuntime ( Runtime : : kToString ) ; <nl> - <nl> - __ bind ( & done ) ; <nl> - __ Ret ( ) ; <nl> - } <nl> <nl> void StringHelper : : GenerateFlatOneByteStringEquals ( MacroAssembler * masm , <nl> Register left , <nl> mmm a / src / x64 / code - stubs - x64 . cc <nl> ppp b / src / x64 / code - stubs - x64 . cc <nl> void StringHelper : : GenerateCopyCharacters ( MacroAssembler * masm , <nl> __ bind ( & done ) ; <nl> } <nl> <nl> - void ToStringStub : : Generate ( MacroAssembler * masm ) { <nl> - / / The ToString stub takes one argument in rax . <nl> - Label is_number ; <nl> - __ JumpIfSmi ( rax , & is_number , Label : : kNear ) ; <nl> - <nl> - Label not_string ; <nl> - __ CmpObjectType ( rax , FIRST_NONSTRING_TYPE , rdi ) ; <nl> - / / rax : receiver <nl> - / / rdi : receiver map <nl> - __ j ( above_equal , & not_string , Label : : kNear ) ; <nl> - __ Ret ( ) ; <nl> - __ bind ( & not_string ) ; <nl> - <nl> - Label not_heap_number ; <nl> - __ CompareRoot ( rdi , Heap : : kHeapNumberMapRootIndex ) ; <nl> - __ j ( not_equal , & not_heap_number , Label : : kNear ) ; <nl> - __ bind ( & is_number ) ; <nl> - NumberToStringStub stub ( isolate ( ) ) ; <nl> - __ TailCallStub ( & stub ) ; <nl> - __ bind ( & not_heap_number ) ; <nl> - <nl> - Label not_oddball ; <nl> - __ CmpInstanceType ( rdi , ODDBALL_TYPE ) ; <nl> - __ j ( not_equal , & not_oddball , Label : : kNear ) ; <nl> - __ movp ( rax , FieldOperand ( rax , Oddball : : kToStringOffset ) ) ; <nl> - __ Ret ( ) ; <nl> - __ bind ( & not_oddball ) ; <nl> - <nl> - __ PopReturnAddressTo ( rcx ) ; / / Pop return address . <nl> - __ Push ( rax ) ; / / Push argument . <nl> - __ PushReturnAddressFrom ( rcx ) ; / / Push return address . <nl> - __ TailCallRuntime ( Runtime : : kToString ) ; <nl> - } <nl> - <nl> <nl> void StringHelper : : GenerateFlatOneByteStringEquals ( MacroAssembler * masm , <nl> Register left , <nl> mmm a / src / x87 / code - stubs - x87 . cc <nl> ppp b / src / x87 / code - stubs - x87 . cc <nl> void StringHelper : : GenerateCopyCharacters ( MacroAssembler * masm , <nl> __ bind ( & done ) ; <nl> } <nl> <nl> - void ToStringStub : : Generate ( MacroAssembler * masm ) { <nl> - / / The ToString stub takes one argument in eax . <nl> - Label is_number ; <nl> - __ JumpIfSmi ( eax , & is_number , Label : : kNear ) ; <nl> - <nl> - Label not_string ; <nl> - __ CmpObjectType ( eax , FIRST_NONSTRING_TYPE , edi ) ; <nl> - / / eax : receiver <nl> - / / edi : receiver map <nl> - __ j ( above_equal , & not_string , Label : : kNear ) ; <nl> - __ Ret ( ) ; <nl> - __ bind ( & not_string ) ; <nl> - <nl> - Label not_heap_number ; <nl> - __ CompareMap ( eax , masm - > isolate ( ) - > factory ( ) - > heap_number_map ( ) ) ; <nl> - __ j ( not_equal , & not_heap_number , Label : : kNear ) ; <nl> - __ bind ( & is_number ) ; <nl> - NumberToStringStub stub ( isolate ( ) ) ; <nl> - __ TailCallStub ( & stub ) ; <nl> - __ bind ( & not_heap_number ) ; <nl> - <nl> - Label not_oddball ; <nl> - __ CmpInstanceType ( edi , ODDBALL_TYPE ) ; <nl> - __ j ( not_equal , & not_oddball , Label : : kNear ) ; <nl> - __ mov ( eax , FieldOperand ( eax , Oddball : : kToStringOffset ) ) ; <nl> - __ Ret ( ) ; <nl> - __ bind ( & not_oddball ) ; <nl> - <nl> - __ pop ( ecx ) ; / / Pop return address . <nl> - __ push ( eax ) ; / / Push argument . <nl> - __ push ( ecx ) ; / / Push return address . <nl> - __ TailCallRuntime ( Runtime : : kToString ) ; <nl> - } <nl> - <nl> <nl> void StringHelper : : GenerateFlatOneByteStringEquals ( MacroAssembler * masm , <nl> Register left , <nl>
[ stubs ] Port ToString platform stub to TurboFan .
v8/v8
8c87212186107fbe1b02086f87ce90645557865c
2016-09-29T14:50:57Z
mmm a / SConstruct <nl> ppp b / SConstruct <nl> def doConfigure ( myenv , needPcre = True , shell = False ) : <nl> myCheckLib ( " ncurses " , staticOnly = release ) <nl> myCheckLib ( " tinfo " , staticOnly = release ) <nl> else : <nl> - print ( " \ n * * * warning : no readline library , mongo shell will not have nice interactive line editing * * * \ n " ) <nl> + print ( " \ n * * * notice : no readline library , mongo shell will not have nice interactive line editing * * * \ n " ) <nl> <nl> if linux : <nl> myCheckLib ( " rt " , True ) <nl>
reword " no readline library " message so buildbot doesn ' t think it ' s a warning
mongodb/mongo
a3b17a92ca58cade69fd995af040dbca76ba5d21
2010-07-02T01:33:57Z
mmm a / src / Interpreters / ClusterProxy / SelectStreamFactory . cpp <nl> ppp b / src / Interpreters / ClusterProxy / SelectStreamFactory . cpp <nl> <nl> # include < Processors / Transforms / ConvertingTransform . h > <nl> # include < Processors / Sources / RemoteSource . h > <nl> # include < Processors / Sources / DelayedSource . h > <nl> + # include < Processors / QueryPlan / QueryPlan . h > <nl> <nl> namespace ProfileEvents <nl> { <nl> SelectStreamFactory : : SelectStreamFactory ( <nl> namespace <nl> { <nl> <nl> - QueryPipeline createLocalStream ( <nl> + auto createLocalPipe ( <nl> const ASTPtr & query_ast , const Block & header , const Context & context , QueryProcessingStage : : Enum processed_stage ) <nl> { <nl> checkStackSize ( ) ; <nl> <nl> - InterpreterSelectQuery interpreter { query_ast , context , SelectQueryOptions ( processed_stage ) } ; <nl> + InterpreterSelectQuery interpreter ( query_ast , context , SelectQueryOptions ( processed_stage ) ) ; <nl> + auto query_plan = std : : make_unique < QueryPlan > ( ) ; <nl> <nl> - auto pipeline = interpreter . execute ( ) . pipeline ; <nl> + interpreter . buildQueryPlan ( * query_plan ) ; <nl> + auto pipeline = std : : move ( * query_plan - > buildQueryPipeline ( ) ) ; <nl> + <nl> + / / / Avoid going it out - of - scope for EXPLAIN <nl> + pipeline . addQueryPlan ( std : : move ( query_plan ) ) ; <nl> <nl> pipeline . addSimpleTransform ( [ & ] ( const Block & source_header ) <nl> { <nl> QueryPipeline createLocalStream ( <nl> / / / return std : : make_shared < MaterializingBlockInputStream > ( stream ) ; <nl> <nl> pipeline . setMaxThreads ( 1 ) ; <nl> - return pipeline ; <nl> + return QueryPipeline : : getPipe ( std : : move ( pipeline ) ) ; <nl> } <nl> <nl> String formattedAST ( const ASTPtr & ast ) <nl> void SelectStreamFactory : : createForShard ( <nl> <nl> auto emplace_local_stream = [ & ] ( ) <nl> { <nl> - pipes . emplace_back ( QueryPipeline : : getPipe ( createLocalStream ( modified_query_ast , header , context , processed_stage ) ) ) ; <nl> + pipes . emplace_back ( createLocalPipe ( modified_query_ast , header , context , processed_stage ) ) ; <nl> } ; <nl> <nl> String modified_query = formattedAST ( modified_query_ast ) ; <nl> void SelectStreamFactory : : createForShard ( <nl> } <nl> <nl> if ( try_results . empty ( ) | | local_delay < max_remote_delay ) <nl> - return QueryPipeline : : getPipe ( createLocalStream ( modified_query_ast , header , context , stage ) ) ; <nl> + return createLocalPipe ( modified_query_ast , header , context , stage ) ; <nl> else <nl> { <nl> std : : vector < IConnectionPool : : Entry > connections ; <nl> mmm a / src / Interpreters / InterpreterExplainQuery . cpp <nl> ppp b / src / Interpreters / InterpreterExplainQuery . cpp <nl> BlockInputStreamPtr InterpreterExplainQuery : : executeImpl ( ) <nl> <nl> if ( settings . graph ) <nl> { <nl> - auto processors = Pipe : : detachProcessors ( QueryPipeline : : getPipe ( std : : move ( * pipeline ) ) ) ; <nl> + / / / Pipe holds QueryPlan , should not go out - of - scope <nl> + auto pipe = QueryPipeline : : getPipe ( std : : move ( * pipeline ) ) ; <nl> + const auto & processors = pipe . getProcessors ( ) ; <nl> <nl> if ( settings . compact ) <nl> printPipelineCompact ( processors , buffer , settings . query_pipeline_options . header ) ; <nl> mmm a / src / Processors / Pipe . cpp <nl> ppp b / src / Processors / Pipe . cpp <nl> Pipe : : Holder & Pipe : : Holder : : operator = ( Holder & & rhs ) <nl> storage_holders . insert ( storage_holders . end ( ) , rhs . storage_holders . begin ( ) , rhs . storage_holders . end ( ) ) ; <nl> interpreter_context . insert ( interpreter_context . end ( ) , <nl> rhs . interpreter_context . begin ( ) , rhs . interpreter_context . end ( ) ) ; <nl> + for ( auto & plan : rhs . query_plans ) <nl> + query_plans . emplace_back ( std : : move ( plan ) ) ; <nl> <nl> return * this ; <nl> } <nl> mmm a / src / Processors / Pipe . h <nl> ppp b / src / Processors / Pipe . h <nl> <nl> # pragma once <nl> # include < Processors / IProcessor . h > <nl> # include < Processors / Sources / SourceWithProgress . h > <nl> + # include < Processors / QueryPlan / QueryPlan . h > <nl> <nl> namespace DB <nl> { <nl> namespace DB <nl> class Pipe ; <nl> using Pipes = std : : vector < Pipe > ; <nl> <nl> + class QueryPipeline ; <nl> + <nl> class IStorage ; <nl> using StoragePtr = std : : shared_ptr < IStorage > ; <nl> <nl> class Pipe <nl> <nl> / / / Get processors from Pipe . Use it with cautious , it is easy to loss totals and extremes ports . <nl> static Processors detachProcessors ( Pipe pipe ) { return std : : move ( pipe . processors ) ; } <nl> + / / / Get processors from Pipe w / o destroying pipe ( used for EXPLAIN to keep QueryPlan ) . <nl> + const Processors & getProcessors ( ) const { return processors ; } <nl> <nl> / / / Specify quotas and limits for every ISourceWithProgress . <nl> void setLimits ( const SourceWithProgress : : LocalLimits & limits ) ; <nl> class Pipe <nl> / / / This methods are from QueryPipeline . Needed to make conversion from pipeline to pipe possible . <nl> void addInterpreterContext ( std : : shared_ptr < Context > context ) { holder . interpreter_context . emplace_back ( std : : move ( context ) ) ; } <nl> void addStorageHolder ( StoragePtr storage ) { holder . storage_holders . emplace_back ( std : : move ( storage ) ) ; } <nl> + / / / For queries with nested interpreters ( i . e . StorageDistributed ) <nl> + void addQueryPlan ( std : : unique_ptr < QueryPlan > plan ) { holder . query_plans . emplace_back ( std : : move ( plan ) ) ; } <nl> <nl> private : <nl> / / / Destruction order : processors , header , locks , temporary storages , local contexts <nl> class Pipe <nl> std : : vector < std : : shared_ptr < Context > > interpreter_context ; <nl> std : : vector < StoragePtr > storage_holders ; <nl> std : : vector < TableLockHolder > table_locks ; <nl> + std : : vector < std : : unique_ptr < QueryPlan > > query_plans ; <nl> } ; <nl> <nl> Holder holder ; <nl> mmm a / src / Processors / QueryPipeline . h <nl> ppp b / src / Processors / QueryPipeline . h <nl> class QueryPipelineProcessorsCollector ; <nl> struct AggregatingTransformParams ; <nl> using AggregatingTransformParamsPtr = std : : shared_ptr < AggregatingTransformParams > ; <nl> <nl> + class QueryPlan ; <nl> + <nl> class QueryPipeline <nl> { <nl> public : <nl> class QueryPipeline <nl> void addTableLock ( const TableLockHolder & lock ) { pipe . addTableLock ( lock ) ; } <nl> void addInterpreterContext ( std : : shared_ptr < Context > context ) { pipe . addInterpreterContext ( std : : move ( context ) ) ; } <nl> void addStorageHolder ( StoragePtr storage ) { pipe . addStorageHolder ( std : : move ( storage ) ) ; } <nl> + void addQueryPlan ( std : : unique_ptr < QueryPlan > plan ) { pipe . addQueryPlan ( std : : move ( plan ) ) ; } <nl> <nl> / / / For compatibility with IBlockInputStream . <nl> void setProgressCallback ( const ProgressCallback & callback ) ; <nl> new file mode 100644 <nl> index 00000000000 . . e69de29bb2d <nl> new file mode 100644 <nl> index 00000000000 . . 8fd145e7f65 <nl> mmm / dev / null <nl> ppp b / tests / queries / 0_stateless / 01470_explain . sql <nl> <nl> + - - <nl> + - - regressions <nl> + - - <nl> + <nl> + - - SIGSEGV regression due to QueryPlan lifetime <nl> + EXPLAIN PIPELINE graph = 1 SELECT * FROM remote ( ' 127 . { 1 , 2 } ' , system . one ) FORMAT Null ; <nl>
Merge pull request from azat / EXPLAIN - SIGSEGV - fix
ClickHouse/ClickHouse
811e44a9370966c95c5df8f9335e92b478ac68b9
2020-09-02T09:46:59Z
mmm a / modules / dnn / src / cuda / region . cu <nl> ppp b / modules / dnn / src / cuda / region . cu <nl> namespace cv { namespace dnn { namespace cuda4dnn { namespace kernels { <nl> __global__ void region_box ( <nl> Span < T > output , View < T > input , View < T > bias , <nl> size_type boxes_per_cell , size_type box_size , <nl> - size_type rows , size_type cols , <nl> + size_type rows , size_type cols , T scale_x_y , <nl> size_type height_norm , size_type width_norm , <nl> T object_prob_cutoff ) <nl> { <nl> namespace cv { namespace dnn { namespace cuda4dnn { namespace kernels { <nl> const auto x = ( box_index % row_inner_size ) / col_inner_size ; <nl> <nl> using device : : fast_sigmoid ; <nl> - output [ box_offset + 0 ] = ( T ( x ) + fast_sigmoid ( input [ box_offset + 0 ] ) ) / T ( cols ) ; <nl> - output [ box_offset + 1 ] = ( T ( y ) + fast_sigmoid ( input [ box_offset + 1 ] ) ) / T ( rows ) ; <nl> + const auto tmp_x = ( fast_sigmoid ( input [ box_offset + 0 ] ) - static_cast < T > ( 0 . 5 ) ) * scale_x_y + static_cast < T > ( 0 . 5 ) ; <nl> + const auto tmp_y = ( fast_sigmoid ( input [ box_offset + 1 ] ) - static_cast < T > ( 0 . 5 ) ) * scale_x_y + static_cast < T > ( 0 . 5 ) ; <nl> + output [ box_offset + 0 ] = ( T ( x ) + tmp_x ) / T ( cols ) ; <nl> + output [ box_offset + 1 ] = ( T ( y ) + tmp_y ) / T ( rows ) ; <nl> <nl> vector2_type bias_xy ; <nl> v_load ( bias_xy , bias_vPtr [ box_of_the_cell ] ) ; <nl> namespace cv { namespace dnn { namespace cuda4dnn { namespace kernels { <nl> void region ( const Stream & stream , Span < T > output , View < T > input , View < T > bias , <nl> T object_prob_cutoff , T class_prob_cutoff , <nl> std : : size_t boxes_per_cell , std : : size_t box_size , <nl> - std : : size_t rows , std : : size_t cols , <nl> + std : : size_t rows , std : : size_t cols , T scale_x_y , <nl> std : : size_t height_norm , std : : size_t width_norm , <nl> bool if_true_sigmoid_else_softmax / * true = sigmoid , false = softmax * / ) <nl> { <nl> namespace cv { namespace dnn { namespace cuda4dnn { namespace kernels { <nl> auto box_policy = make_policy ( box_kernel , output . size ( ) / box_size , 0 , stream ) ; <nl> launch_kernel ( box_kernel , box_policy , <nl> output , input , bias , boxes_per_cell , box_size , <nl> - rows , cols , height_norm , width_norm , <nl> + rows , cols , scale_x_y , height_norm , width_norm , <nl> object_prob_cutoff ) ; <nl> <nl> if ( if_true_sigmoid_else_softmax ) { <nl> namespace cv { namespace dnn { namespace cuda4dnn { namespace kernels { <nl> <nl> # if ! defined ( __CUDA_ARCH__ ) | | ( __CUDA_ARCH__ > = 530 ) <nl> template void region ( const Stream & , Span < __half > , View < __half > , View < __half > , <nl> - __half , __half , std : : size_t , std : : size_t , std : : size_t , std : : size_t , std : : size_t , std : : size_t , bool ) ; <nl> + __half , __half , std : : size_t , std : : size_t , std : : size_t , std : : size_t , __half , std : : size_t , std : : size_t , bool ) ; <nl> # endif <nl> <nl> template void region ( const Stream & , Span < float > , View < float > , View < float > , <nl> - float , float , std : : size_t , std : : size_t , std : : size_t , std : : size_t , std : : size_t , std : : size_t , bool ) ; <nl> + float , float , std : : size_t , std : : size_t , std : : size_t , std : : size_t , float , std : : size_t , std : : size_t , bool ) ; <nl> <nl> } } } } / * namespace cv : : dnn : : cuda4dnn : : kernels * / <nl> mmm a / modules / dnn / src / cuda4dnn / kernels / region . hpp <nl> ppp b / modules / dnn / src / cuda4dnn / kernels / region . hpp <nl> namespace cv { namespace dnn { namespace cuda4dnn { namespace kernels { <nl> void region ( const csl : : Stream & stream , csl : : Span < T > output , csl : : View < T > input , csl : : View < T > bias , <nl> T object_prob_cutoff , T class_prob_cutoff , <nl> std : : size_t boxes_per_cell , std : : size_t box_size , <nl> - std : : size_t rows , std : : size_t cols , <nl> + std : : size_t rows , std : : size_t cols , T scale_x_y , <nl> std : : size_t height_norm , std : : size_t width_norm , <nl> bool if_true_sigmoid_else_softmax ) ; <nl> <nl> mmm a / modules / dnn / src / cuda4dnn / primitives / region . hpp <nl> ppp b / modules / dnn / src / cuda4dnn / primitives / region . hpp <nl> namespace cv { namespace dnn { namespace cuda4dnn { <nl> * <nl> * actual class probability = conditional_class_prob * object_prob <nl> * / <nl> + std : : size_t classes , boxes_per_cell ; <nl> + std : : size_t width_norm , height_norm ; <nl> + T scale_x_y ; <nl> <nl> / * method for reducing class scores to probabilities * / <nl> SquashMethod squash_method ; <nl> <nl> - std : : size_t classes , boxes_per_cell ; <nl> - <nl> - std : : size_t width_norm , height_norm ; <nl> - <nl> / * prob cutoffs below which the prediction is nulled * / <nl> T object_prob_cutoff ; <nl> T class_prob_cutoff ; <nl> namespace cv { namespace dnn { namespace cuda4dnn { <nl> width_norm = config . width_norm ; <nl> height_norm = config . height_norm ; <nl> <nl> - squash_type = config . squash_method ; <nl> + scale_x_y = config . scale_x_y ; <nl> <nl> + squash_type = config . squash_method ; <nl> object_prob_cutoff = config . object_prob_cutoff ; <nl> class_prob_cutoff = config . class_prob_cutoff ; <nl> <nl> namespace cv { namespace dnn { namespace cuda4dnn { <nl> kernels : : region < T > ( stream , output , input , biasTensor , <nl> object_prob_cutoff , class_prob_cutoff , <nl> boxes_per_cell , cell_box_size , <nl> - rows , cols , <nl> + rows , cols , scale_x_y , <nl> height_norm , width_norm , <nl> if_true_sigmoid_else_softmax <nl> ) ; <nl> namespace cv { namespace dnn { namespace cuda4dnn { <nl> csl : : Tensor < T > biasTensor ; <nl> std : : size_t classes , boxes_per_cell ; <nl> std : : size_t width_norm , height_norm ; <nl> - SquashMethod squash_type ; <nl> + T scale_x_y ; <nl> <nl> + SquashMethod squash_type ; <nl> T object_prob_cutoff , class_prob_cutoff ; <nl> + <nl> T nms_iou_threshold ; <nl> } ; <nl> <nl> mmm a / modules / dnn / src / layers / region_layer . cpp <nl> ppp b / modules / dnn / src / layers / region_layer . cpp <nl> class RegionLayerImpl CV_FINAL : public RegionLayer <nl> config . height_norm = height_norm ; <nl> config . width_norm = width_norm ; <nl> <nl> + config . scale_x_y = scale_x_y ; <nl> + <nl> config . object_prob_cutoff = ( classfix = = - 1 ) ? 0 . 5 : 0 . 0 ; <nl> config . class_prob_cutoff = thresh ; <nl> <nl>
Merge pull request from YashasSamaga : cuda4dnn - region - yolov4
opencv/opencv
583f4b9633e7af21a26377856523ff3e43b5b818
2020-05-11T19:23:55Z
mmm a / DEPS <nl> ppp b / DEPS <nl> vars = { <nl> <nl> deps = { <nl> ' build ' : <nl> - Var ( ' chromium_url ' ) + ' / chromium / src / build . git ' + ' @ ' + ' 7dff8d48fb647492bed34cfd788d3ccaf8e8da4d ' , <nl> + Var ( ' chromium_url ' ) + ' / chromium / src / build . git ' + ' @ ' + ' c843282e3af31d4d3e286140a2c81d3e4dcbaf88 ' , <nl> ' third_party / depot_tools ' : <nl> - Var ( ' chromium_url ' ) + ' / chromium / tools / depot_tools . git ' + ' @ ' + ' 0fa91d0f3563276834b632b21d03fc327eff6c9c ' , <nl> + Var ( ' chromium_url ' ) + ' / chromium / tools / depot_tools . git ' + ' @ ' + ' 3bd3c99b4d5c884798648198ba7b01755214fd90 ' , <nl> ' third_party / icu ' : <nl> Var ( ' chromium_url ' ) + ' / chromium / deps / icu . git ' + ' @ ' + ' 79326efe26e5440f530963704c3c0ff965b3a4ac ' , <nl> ' third_party / instrumented_libraries ' : <nl> - Var ( ' chromium_url ' ) + ' / chromium / src / third_party / instrumented_libraries . git ' + ' @ ' + ' bb3f1802c237dd19105dd0f7919f99e536a39d10 ' , <nl> + Var ( ' chromium_url ' ) + ' / chromium / src / third_party / instrumented_libraries . git ' + ' @ ' + ' 3c52ccdd3b9edf8fb7b3bd8ba945cce47d887ea8 ' , <nl> ' buildtools ' : <nl> Var ( ' chromium_url ' ) + ' / chromium / src / buildtools . git ' + ' @ ' + ' b00ad0af636401e5eb4b5d0ab01b65164dca1914 ' , <nl> ' buildtools / clang_format / script ' : <nl> deps = { <nl> ' condition ' : ' checkout_android ' , <nl> } , <nl> ' third_party / android_platform ' : { <nl> - ' url ' : Var ( ' chromium_url ' ) + ' / chromium / src / third_party / android_platform . git ' + ' @ ' + ' 5edcbfdb8b1a7f4cc412628ee646bfa384fe8f17 ' , <nl> + ' url ' : Var ( ' chromium_url ' ) + ' / chromium / src / third_party / android_platform . git ' + ' @ ' + ' fc6c6840eeb254ac4fd199c548c54178ce3545bb ' , <nl> ' condition ' : ' checkout_android ' , <nl> } , <nl> ' third_party / android_sdk / public ' : { <nl> deps = { <nl> ' dep_type ' : ' cipd ' , <nl> } , <nl> ' third_party / catapult ' : { <nl> - ' url ' : Var ( ' chromium_url ' ) + ' / catapult . git ' + ' @ ' + ' c4d3ff474abec0ece4c42552b25aea9b54ecc047 ' , <nl> + ' url ' : Var ( ' chromium_url ' ) + ' / catapult . git ' + ' @ ' + ' 69d93258d753ea8b5fdd46abce7c5dd9f04e2d83 ' , <nl> ' condition ' : ' checkout_android ' , <nl> } , <nl> ' third_party / colorama / src ' : { <nl> deps = { <nl> ' condition ' : ' checkout_android ' , <nl> } , <nl> ' third_party / fuchsia - sdk ' : { <nl> - ' url ' : Var ( ' chromium_url ' ) + ' / chromium / src / third_party / fuchsia - sdk . git ' + ' @ ' + ' 8ce22865fbbc501198e0dc9d3ca2eeaa46471d11 ' , <nl> + ' url ' : Var ( ' chromium_url ' ) + ' / chromium / src / third_party / fuchsia - sdk . git ' + ' @ ' + ' 6a38b0e1f1f4a6255959b259a681e46ee72dee58 ' , <nl> ' condition ' : ' checkout_fuchsia ' , <nl> } , <nl> ' third_party / googletest / src ' : <nl> deps = { <nl> ' condition ' : ' checkout_google_benchmark ' , <nl> } , <nl> ' third_party / jinja2 ' : <nl> - Var ( ' chromium_url ' ) + ' / chromium / src / third_party / jinja2 . git ' + ' @ ' + ' 3f90fa05c85718505e28c9c3426c1ba52843b9b7 ' , <nl> + Var ( ' chromium_url ' ) + ' / chromium / src / third_party / jinja2 . git ' + ' @ ' + ' 61cfe2ac6c9108534c43b4039a95a0980251f266 ' , <nl> ' third_party / markupsafe ' : <nl> - Var ( ' chromium_url ' ) + ' / chromium / src / third_party / markupsafe . git ' + ' @ ' + ' 8f45f5cfa0009d2a70589bcda0349b8cb2b72783 ' , <nl> + Var ( ' chromium_url ' ) + ' / chromium / src / third_party / markupsafe . git ' + ' @ ' + ' f2fb0f21ef1e1d4ffd43be8c63fc3d4928dea7ab ' , <nl> ' tools / swarming_client ' : <nl> Var ( ' chromium_url ' ) + ' / infra / luci / client - py . git ' + ' @ ' + ' 4c095d04179dc725a300085ae21fe3b79900d072 ' , <nl> ' test / benchmarks / data ' : <nl> deps = { <nl> ' packages ' : [ <nl> { <nl> ' package ' : ' fuchsia / third_party / aemu / linux - amd64 ' , <nl> - ' version ' : ' NHKI_hy9EiYHTk25 - SwU9lqq_Nmk1LQ748n - ZAtBu9YC ' <nl> + ' version ' : ' zCy9vIuheNK - - OaT_8WBj3IbVxW_RuxRLMp8KWTLqzIC ' <nl> } , <nl> ] , <nl> ' condition ' : ' host_os = = " linux " and checkout_fuchsia ' , <nl> deps = { <nl> ' dep_type ' : ' cipd ' , <nl> } , <nl> ' tools / clang ' : <nl> - Var ( ' chromium_url ' ) + ' / chromium / src / tools / clang . git ' + ' @ ' + ' 6b794b908e719f989cfaff8d5ebaf9b1dc749e7c ' , <nl> + Var ( ' chromium_url ' ) + ' / chromium / src / tools / clang . git ' + ' @ ' + ' 724075d080680e60c3d1b64cfeee7fb385231a20 ' , <nl> ' tools / luci - go ' : { <nl> ' packages ' : [ <nl> { <nl>
Update V8 DEPS .
v8/v8
87b7b2bfeaf0b95bd39418addfed74b5f25ba13c
2020-08-15T03:58:28Z
deleted file mode 100644 <nl> index 5f3dc567b00 . . 00000000000 <nl> mmm a / modules / perception / fusion / lib / interface / BUILD . txt <nl> ppp / dev / null <nl> <nl> - # DO NOT MODIFY <nl> - # THIS FILE IS GENERATED AUTOMATICALLY TO HELP WRITE BUILD FILE <nl> - # DELETE THIS FILE WHEN YOU HAVE CREATED THE COMPLETE BUILD FILE <nl> - load ( " / / tools : cpplint . bzl " , " cpplint " ) <nl> - <nl> - package ( default_visibility = [ " / / visibility : public " ] ) <nl> - <nl> - cc_library ( <nl> - name = " base_data_association " , <nl> - hdrs = [ <nl> - " base_data_association . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " base_existance_fusion " , <nl> - hdrs = [ <nl> - " base_existance_fusion . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " base_fusion_system " , <nl> - hdrs = [ <nl> - " base_fusion_system . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " base_gatekeeper " , <nl> - hdrs = [ <nl> - " base_gatekeeper . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " base_motion_fusion " , <nl> - hdrs = [ <nl> - " base_motion_fusion . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " base_shape_fusion " , <nl> - hdrs = [ <nl> - " base_shape_fusion . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " base_tracker " , <nl> - hdrs = [ <nl> - " base_tracker . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " base_type_fusion " , <nl> - hdrs = [ <nl> - " base_type_fusion . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cpplint ( ) <nl> deleted file mode 100644 <nl> index 0cb3a831fea . . 00000000000 <nl> mmm a / modules / perception / lidar / lib / interface / BUILD . txt <nl> ppp / dev / null <nl> <nl> - # DO NOT MODIFY <nl> - # THIS FILE IS GENERATED AUTOMATICALLY TO HELP WRITE BUILD FILE <nl> - # DELETE THIS FILE WHEN YOU HAVE CREATED THE COMPLETE BUILD FILE <nl> - load ( " / / tools : cpplint . bzl " , " cpplint " ) <nl> - <nl> - package ( default_visibility = [ " / / visibility : public " ] ) <nl> - <nl> - cc_library ( <nl> - name = " base_bipartite_graph_matcher " , <nl> - hdrs = [ <nl> - " base_bipartite_graph_matcher . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " base_classifier " , <nl> - hdrs = [ <nl> - " base_classifier . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " base_ground_detector " , <nl> - hdrs = [ <nl> - " base_ground_detector . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " base_multi_target_tracker " , <nl> - hdrs = [ <nl> - " base_multi_target_tracker . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " base_object_filter " , <nl> - hdrs = [ <nl> - " base_object_filter . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " base_roi_filter " , <nl> - hdrs = [ <nl> - " base_roi_filter . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " base_segmentation " , <nl> - hdrs = [ <nl> - " base_segmentation . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cpplint ( ) <nl> deleted file mode 100644 <nl> index 41f8bb493b2 . . 00000000000 <nl> mmm a / modules / perception / onboard / component / BUILD . txt <nl> ppp / dev / null <nl> <nl> - # DO NOT MODIFY <nl> - # THIS FILE IS GENERATED AUTOMATICALLY TO HELP WRITE BUILD FILE <nl> - # DELETE THIS FILE WHEN YOU HAVE CREATED THE COMPLETE BUILD FILE <nl> - load ( " / / tools : cpplint . bzl " , " cpplint " ) <nl> - <nl> - package ( default_visibility = [ " / / visibility : public " ] ) <nl> - <nl> - cc_library ( <nl> - name = " fusion_component " , <nl> - srcs = [ <nl> - " fusion_component . cc " , <nl> - ] , <nl> - hdrs = [ <nl> - " fusion_component . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " lidar_common_flags " , <nl> - srcs = [ <nl> - " lidar_common_flags . cc " , <nl> - ] , <nl> - hdrs = [ <nl> - " lidar_common_flags . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " lidar_inner_component_messages " , <nl> - hdrs = [ <nl> - " lidar_inner_component_messages . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " lidar_output_component " , <nl> - srcs = [ <nl> - " lidar_output_component . cc " , <nl> - ] , <nl> - hdrs = [ <nl> - " lidar_output_component . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " radar_detection_component " , <nl> - srcs = [ <nl> - " radar_detection_component . cc " , <nl> - ] , <nl> - hdrs = [ <nl> - " radar_detection_component . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " recognition_component " , <nl> - srcs = [ <nl> - " recognition_component . cc " , <nl> - ] , <nl> - hdrs = [ <nl> - " recognition_component . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cc_library ( <nl> - name = " segmentation_component " , <nl> - srcs = [ <nl> - " segmentation_component . cc " , <nl> - ] , <nl> - hdrs = [ <nl> - " segmentation_component . h " , <nl> - ] , <nl> - deps = [ <nl> - ] , <nl> - ) <nl> - <nl> - cpplint ( ) <nl>
perception : remove BUILD . txt for these dir .
ApolloAuto/apollo
f0fdb029eff7811d9784650ea91f65b76a1ae676
2018-09-26T21:42:33Z
mmm a / ChangeLog <nl> ppp b / ChangeLog <nl> <nl> - 2008 - 08 - 13 : Version 0 . 2 . 2 ( 130807 ) <nl> + 2008 - 08 - 14 : Version 0 . 2 . 3 <nl> + <nl> + Improved performance of garbage collection by moving the <nl> + function that updates pointers during compacting collection <nl> + into the updating visitor . This gives the compiler a better <nl> + chance to inline and avoid a function call per ( potential ) <nl> + pointer . <nl> + <nl> + Extended the shell sample with a - - runtime - flags option . <nl> + <nl> + Added Visual Studio project files for the shell . cc and <nl> + process . cc samples . <nl> + <nl> + <nl> + 2008 - 08 - 13 : Version 0 . 2 . 2 <nl> <nl> Improved performance of garbage collection by changing the way <nl> we use the marking stack in the event of stack overflow during <nl> <nl> Added first version of Visual Studio project files . <nl> <nl> <nl> - 2008 - 08 - 06 : Version 0 . 2 . 1 ( 130029 ) <nl> + 2008 - 08 - 06 : Version 0 . 2 . 1 <nl> <nl> Improved performance of unary addition by avoiding runtime calls . <nl> <nl> <nl> implementations . <nl> <nl> <nl> - 2008 - 07 - 30 : Version 0 . 2 . 0 ( 129146 ) <nl> + 2008 - 07 - 30 : Version 0 . 2 . 0 <nl> <nl> Changed all text files to have native svn : eol - style . <nl> <nl> <nl> Merged disassembler - { arch } files . <nl> <nl> <nl> - 2008 - 07 - 28 : Version 0 . 1 . 4 ( 128918 ) <nl> + 2008 - 07 - 28 : Version 0 . 1 . 4 <nl> <nl> Added support for storing JavaScript stack traces in a stack <nl> allocated buffer to make it visible in shallow core dumps . <nl> <nl> disabled by default . <nl> <nl> <nl> - 2008 - 07 - 25 : Version 0 . 1 . 3 ( 128832 ) <nl> + 2008 - 07 - 25 : Version 0 . 1 . 3 <nl> <nl> Fixed bug in JSObject : : GetPropertyAttributePostInterceptor where <nl> map transitions would count as properties . <nl> <nl> across multiple users of V8 when linked as a shared library . <nl> <nl> <nl> - 2008 - 07 - 16 : Version 0 . 1 . 2 ( 127441 ) <nl> + 2008 - 07 - 16 : Version 0 . 1 . 2 <nl> <nl> Fixed building on Mac OS X by recognizing i386 and friends as <nl> IA - 32 platforms . <nl> <nl> SetInternalFieldCount from FunctionTemplate to ObjectTemplate . <nl> <nl> <nl> - 2008 - 07 - 09 : Version 0 . 1 . 1 ( 126448 ) <nl> + 2008 - 07 - 09 : Version 0 . 1 . 1 <nl> <nl> Fixed bug in stack overflow check code for IA - 32 targets where a <nl> non - tagged value in register eax was pushed to the stack . <nl> <nl> setting break points in them . <nl> <nl> <nl> - 2008 - 07 - 03 : Version 0 . 1 . 0 ( 125876 ) <nl> + 2008 - 07 - 03 : Version 0 . 1 . 0 <nl> <nl> Initial export . <nl> <nl> mmm a / public / v8 . h <nl> ppp b / public / v8 . h <nl> class ScriptData { <nl> * / <nl> class ScriptOrigin { <nl> public : <nl> - ScriptOrigin ( Handle < String > resource_name , <nl> + ScriptOrigin ( Handle < Value > resource_name , <nl> Handle < Integer > resource_line_offset = Handle < Integer > ( ) , <nl> Handle < Integer > resource_column_offset = Handle < Integer > ( ) ) <nl> : resource_name_ ( resource_name ) , <nl> resource_line_offset_ ( resource_line_offset ) , <nl> resource_column_offset_ ( resource_column_offset ) { } <nl> - inline Handle < String > ResourceName ( ) ; <nl> + inline Handle < Value > ResourceName ( ) ; <nl> inline Handle < Integer > ResourceLineOffset ( ) ; <nl> inline Handle < Integer > ResourceColumnOffset ( ) ; <nl> private : <nl> - Handle < String > resource_name_ ; <nl> + Handle < Value > resource_name_ ; <nl> Handle < Integer > resource_line_offset_ ; <nl> Handle < Integer > resource_column_offset_ ; <nl> } ; <nl> class Script { <nl> ScriptOrigin * origin = NULL , <nl> ScriptData * pre_data = NULL ) ; <nl> <nl> + / * * <nl> + * Compiles the specified script using the specified file name <nl> + * object ( typically a string ) as the script ' s origin . <nl> + * / <nl> + static Local < Script > Compile ( Handle < String > source , <nl> + Handle < Value > file_name ) ; <nl> + <nl> Local < Value > Run ( ) ; <nl> } ; <nl> <nl> Local < T > HandleScope : : Close ( Handle < T > value ) { <nl> return Local < T > ( reinterpret_cast < T * > ( after ) ) ; <nl> } <nl> <nl> - Handle < String > ScriptOrigin : : ResourceName ( ) { <nl> + Handle < Value > ScriptOrigin : : ResourceName ( ) { <nl> return resource_name_ ; <nl> } <nl> <nl> mmm a / samples / shell . cc <nl> ppp b / samples / shell . cc <nl> <nl> <nl> <nl> void RunShell ( v8 : : Handle < v8 : : Context > context ) ; <nl> - bool ExecuteString ( v8 : : Handle < v8 : : String > source ) ; <nl> + bool ExecuteString ( v8 : : Handle < v8 : : String > source , <nl> + v8 : : Handle < v8 : : Value > name , <nl> + bool print_result ) ; <nl> v8 : : Handle < v8 : : Value > Print ( const v8 : : Arguments & args ) ; <nl> v8 : : Handle < v8 : : String > ReadFile ( const char * name ) ; <nl> + void ProcessRuntimeFlags ( int argc , char * argv [ ] ) ; <nl> <nl> <nl> int main ( int argc , char * argv [ ] ) { <nl> + ProcessRuntimeFlags ( argc , argv ) ; <nl> v8 : : HandleScope handle_scope ; <nl> / / Create a template for the global object . <nl> v8 : : Handle < v8 : : ObjectTemplate > global = v8 : : ObjectTemplate : : New ( ) ; <nl> int main ( int argc , char * argv [ ] ) { <nl> const char * str = argv [ i ] ; <nl> if ( strcmp ( str , " - - shell " ) = = 0 ) { <nl> run_shell = true ; <nl> + } else if ( strcmp ( str , " - - runtime - flags " ) = = 0 ) { <nl> + / / Skip the - - runtime - flags flag since it was processed earlier . <nl> + i + + ; <nl> } else { <nl> + / / Use all other arguments as names of files to load and run . <nl> v8 : : HandleScope handle_scope ; <nl> + v8 : : Handle < v8 : : String > file_name = v8 : : String : : New ( str ) ; <nl> v8 : : Handle < v8 : : String > source = ReadFile ( str ) ; <nl> if ( source . IsEmpty ( ) ) { <nl> printf ( " Error reading ' % s ' \ n " , str ) ; <nl> return 1 ; <nl> } <nl> - if ( ! ExecuteString ( source ) ) <nl> + if ( ! ExecuteString ( source , file_name , false ) ) <nl> return 1 ; <nl> } <nl> } <nl> void RunShell ( v8 : : Handle < v8 : : Context > context ) { <nl> char * str = fgets ( buffer , kBufferSize , stdin ) ; <nl> if ( str = = NULL ) break ; <nl> v8 : : HandleScope handle_scope ; <nl> - ExecuteString ( v8 : : String : : New ( str ) ) ; <nl> + ExecuteString ( v8 : : String : : New ( str ) , v8 : : Undefined ( ) , true ) ; <nl> } <nl> printf ( " \ n " ) ; <nl> } <nl> <nl> <nl> / / Executes a string within the current v8 context . <nl> - bool ExecuteString ( v8 : : Handle < v8 : : String > source ) { <nl> + bool ExecuteString ( v8 : : Handle < v8 : : String > source , <nl> + v8 : : Handle < v8 : : Value > name , <nl> + bool print_result ) { <nl> v8 : : HandleScope handle_scope ; <nl> v8 : : TryCatch try_catch ; <nl> - v8 : : Handle < v8 : : Script > script = v8 : : Script : : Compile ( source ) ; <nl> + v8 : : Handle < v8 : : Script > script = v8 : : Script : : Compile ( source , name ) ; <nl> if ( script . IsEmpty ( ) ) { <nl> / / Print errors that happened during compilation . <nl> v8 : : String : : AsciiValue error ( try_catch . Exception ( ) ) ; <nl> bool ExecuteString ( v8 : : Handle < v8 : : String > source ) { <nl> printf ( " % s \ n " , * error ) ; <nl> return false ; <nl> } else { <nl> - if ( ! result - > IsUndefined ( ) ) { <nl> + if ( print_result & & ! result - > IsUndefined ( ) ) { <nl> / / If all went well and the result wasn ' t undefined then print <nl> / / the returned value . <nl> v8 : : String : : AsciiValue str ( result ) ; <nl> bool ExecuteString ( v8 : : Handle < v8 : : String > source ) { <nl> } <nl> } <nl> } <nl> + <nl> + <nl> + / / Set the vm flags before using the vm . <nl> + void ProcessRuntimeFlags ( int argc , char * argv [ ] ) { <nl> + for ( int i = 1 ; i < argc ; i + + ) { <nl> + if ( strcmp ( argv [ i ] , " - - runtime - flags " ) = = 0 & & i + 1 < argc ) { <nl> + i + + ; <nl> + v8 : : V8 : : SetFlagsFromString ( argv [ i ] , strlen ( argv [ i ] ) ) ; <nl> + } <nl> + } <nl> + } <nl> mmm a / src / api . cc <nl> ppp b / src / api . cc <nl> Local < Script > Script : : Compile ( v8 : : Handle < String > source , <nl> ON_BAILOUT ( " v8 : : Script : : Compile ( ) " , return Local < Script > ( ) ) ; <nl> LOG_API ( " Script : : Compile " ) ; <nl> i : : Handle < i : : String > str = Utils : : OpenHandle ( * source ) ; <nl> - i : : Handle < i : : String > name_obj ; <nl> + i : : Handle < i : : Object > name_obj ; <nl> int line_offset = 0 ; <nl> int column_offset = 0 ; <nl> if ( origin ! = NULL ) { <nl> Local < Script > Script : : Compile ( v8 : : Handle < String > source , <nl> } <nl> <nl> <nl> + Local < Script > Script : : Compile ( v8 : : Handle < String > source , <nl> + v8 : : Handle < Value > file_name ) { <nl> + ScriptOrigin origin ( file_name ) ; <nl> + return Compile ( source , & origin ) ; <nl> + } <nl> + <nl> + <nl> Local < Value > Script : : Run ( ) { <nl> ON_BAILOUT ( " v8 : : Script : : Run ( ) " , return Local < Value > ( ) ) ; <nl> LOG_API ( " Script : : Run " ) ; <nl> bool v8 : : V8 : : Initialize ( ) { <nl> <nl> <nl> const char * v8 : : V8 : : GetVersion ( ) { <nl> - return " 0 . 2 . 2 ( 130807 ) " ; <nl> + return " 0 . 2 . 3 " ; <nl> } <nl> <nl> <nl> mmm a / src / bootstrapper . cc <nl> ppp b / src / bootstrapper . cc <nl> <nl> <nl> namespace v8 { namespace internal { <nl> <nl> + DEFINE_string ( expose_natives_as , NULL , " expose natives in global object " ) ; <nl> + DEFINE_string ( expose_debug_as , NULL , " expose debug in global object " ) ; <nl> DEFINE_string ( natives_file , NULL , " alternative natives file " ) ; / / for debugging <nl> DEFINE_bool ( expose_gc , false , " expose gc extension " ) ; / / for debugging <nl> <nl> class Genesis BASE_EMBEDDED { <nl> bool InstallExtensions ( v8 : : ExtensionConfiguration * extensions ) ; <nl> bool InstallExtension ( const char * name ) ; <nl> bool InstallExtension ( v8 : : RegisteredExtension * current ) ; <nl> + bool InstallSpecialObjects ( ) ; <nl> bool ConfigureGlobalObject ( v8 : : Handle < v8 : : ObjectTemplate > global_template ) ; <nl> <nl> / / Migrates all properties from the ' from ' object to the ' to ' <nl> bool Genesis : : InstallNatives ( ) { <nl> } <nl> <nl> <nl> + bool Genesis : : InstallSpecialObjects ( ) { <nl> + HandleScope scope ; <nl> + Handle < JSGlobalObject > global ( <nl> + JSGlobalObject : : cast ( global_context ( ) - > global ( ) ) ) ; <nl> + / / Expose the natives in global if a name for it is specified . <nl> + if ( FLAG_expose_natives_as ! = NULL & & strlen ( FLAG_expose_natives_as ) ! = 0 ) { <nl> + Handle < String > natives_string = <nl> + Factory : : LookupAsciiSymbol ( FLAG_expose_natives_as ) ; <nl> + SetProperty ( global , natives_string , <nl> + Handle < JSObject > ( global - > builtins ( ) ) , DONT_ENUM ) ; <nl> + } <nl> + <nl> + / / Expose the debug global object in global if a name for it is specified . <nl> + if ( FLAG_expose_debug_as ! = NULL & & strlen ( FLAG_expose_debug_as ) ! = 0 ) { <nl> + / / If loading fails we just bail out without installing the <nl> + / / debugger but without tanking the whole context . <nl> + if ( ! Debug : : Load ( ) ) <nl> + return true ; <nl> + Handle < JSGlobalObject > debug_global = <nl> + Handle < JSGlobalObject > ( <nl> + JSGlobalObject : : cast ( Debug : : debug_context ( ) - > global ( ) ) ) ; <nl> + Handle < String > debug_string = <nl> + Factory : : LookupAsciiSymbol ( FLAG_expose_debug_as ) ; <nl> + SetProperty ( global , debug_string , <nl> + Handle < JSObject > ( debug_global ) , DONT_ENUM ) ; <nl> + <nl> + / / Set the security token for the debugger global object to the same as <nl> + / / the shell global object to allow calling between these ( otherwise <nl> + / / exposing debug global object dosen ' t make much sense ) . <nl> + debug_global - > set_security_token ( global - > security_token ( ) ) ; <nl> + } <nl> + <nl> + return true ; <nl> + } <nl> + <nl> + <nl> bool Genesis : : InstallExtensions ( v8 : : ExtensionConfiguration * extensions ) { <nl> / / Clear coloring of extension list <nl> v8 : : RegisteredExtension * current = v8 : : RegisteredExtension : : first_extension ( ) ; <nl> Genesis : : Genesis ( Handle < Object > global_object , <nl> <nl> if ( ! InstallExtensions ( extensions ) ) return ; <nl> <nl> + if ( ! InstallSpecialObjects ( ) ) return ; <nl> + <nl> result_ = global_context_ ; <nl> } <nl> <nl> mmm a / src / compiler . cc <nl> ppp b / src / compiler . cc <nl> static StaticResource < SafeStringInputBuffer > safe_string_input_buffer ; <nl> <nl> <nl> Handle < JSFunction > Compiler : : Compile ( Handle < String > source , <nl> - Handle < String > script_name , <nl> + Handle < Object > script_name , <nl> int line_offset , int column_offset , <nl> v8 : : Extension * extension , <nl> ScriptDataImpl * input_pre_data ) { <nl> mmm a / src / compiler . h <nl> ppp b / src / compiler . h <nl> class Compiler : public AllStatic { <nl> <nl> / / Compile a String source within a context . <nl> static Handle < JSFunction > Compile ( Handle < String > source , <nl> - Handle < String > script_name , <nl> + Handle < Object > script_name , <nl> int line_offset , int column_offset , <nl> v8 : : Extension * extension , <nl> ScriptDataImpl * script_Data ) ; <nl> mmm a / src / debug - delay . js <nl> ppp b / src / debug - delay . js <nl> Debug . breakLocations = function ( f ) { <nl> / / Returns a Script object . If the parameter is a function the return value <nl> / / is the script in which the function is defined . If the parameter is a string <nl> / / the return value is the script for which the script name has that string <nl> - / / value . <nl> + / / value . If it is a regexp and there is a unique script whose name matches <nl> + / / we return that , otherwise undefined . <nl> Debug . findScript = function ( func_or_script_name ) { <nl> if ( IS_FUNCTION ( func_or_script_name ) ) { <nl> return % FunctionGetScript ( func_or_script_name ) ; <nl> + } else if ( IS_REGEXP ( func_or_script_name ) ) { <nl> + var scripts = Debug . scripts ( ) ; <nl> + var last_result = null ; <nl> + var result_count = 0 ; <nl> + for ( var i in scripts ) { <nl> + var script = scripts [ i ] ; <nl> + if ( func_or_script_name . test ( script . name ) ) { <nl> + last_result = script ; <nl> + result_count + + ; <nl> + } <nl> + } <nl> + / / Return the unique script matching the regexp . If there are more <nl> + / / than one we don ' t return a value since there is no good way to <nl> + / / decide which one to return . Returning a " random " one , say the <nl> + / / first , would introduce nondeterminism ( or something close to it ) <nl> + / / because the order is the heap iteration order . <nl> + if ( result_count = = 1 ) { <nl> + return last_result ; <nl> + } else { <nl> + return undefined ; <nl> + } <nl> } else { <nl> return % GetScript ( func_or_script_name ) ; <nl> } <nl> mmm a / src / debug . cc <nl> ppp b / src / debug . cc <nl> <nl> namespace v8 { namespace internal { <nl> <nl> DEFINE_bool ( remote_debugging , false , " enable remote debugging " ) ; <nl> - DEFINE_int ( debug_port , 5858 , " port for remote debugging " ) ; <nl> DEFINE_bool ( trace_debug_json , false , " trace debugging JSON request / response " ) ; <nl> DECLARE_bool ( allow_natives_syntax ) ; <nl> DECLARE_bool ( log_debugger ) ; <nl> bool Debug : : Load ( ) { <nl> <nl> / / Bail out if we ' re already in the process of compiling the native <nl> / / JavaScript source code for the debugger . <nl> - if ( Debugger : : compiling_natives ( ) ) return false ; <nl> + if ( Debugger : : compiling_natives ( ) | | Debugger : : is_loading_debugger ( ) ) <nl> + return false ; <nl> + Debugger : : set_loading_debugger ( true ) ; <nl> <nl> / / Disable breakpoints and interrupts while compiling and running the <nl> / / debugger scripts including the context creation code . <nl> bool Debug : : Load ( ) { <nl> ! CompileDebuggerScript ( Natives : : GetIndex ( " debug " ) ) ; <nl> Debugger : : set_compiling_natives ( false ) ; <nl> <nl> + / / Make sure we mark the debugger as not loading before we might <nl> + / / return . <nl> + Debugger : : set_loading_debugger ( false ) ; <nl> + <nl> / / Check for caught exceptions . <nl> if ( caught_exception ) return false ; <nl> <nl> bool Debug : : IsDebugGlobal ( GlobalObject * global ) { <nl> <nl> bool Debugger : : debugger_active_ = false ; <nl> bool Debugger : : compiling_natives_ = false ; <nl> + bool Debugger : : is_loading_debugger_ = false ; <nl> DebugMessageThread * Debugger : : message_thread_ = NULL ; <nl> v8 : : DebugMessageHandler Debugger : : debug_message_handler_ = NULL ; <nl> void * Debugger : : debug_message_handler_data_ = NULL ; <nl> mmm a / src / debug . h <nl> ppp b / src / debug . h <nl> class Debugger { <nl> Debugger : : compiling_natives_ = compiling_natives ; <nl> } <nl> static bool compiling_natives ( ) { return Debugger : : compiling_natives_ ; } <nl> + static void set_loading_debugger ( bool v ) { is_loading_debugger_ = v ; } <nl> + static bool is_loading_debugger ( ) { return Debugger : : is_loading_debugger_ ; } <nl> <nl> private : <nl> static bool debugger_active_ ; / / Are there any active debugger ? <nl> static bool compiling_natives_ ; / / Are we compiling natives ? <nl> + static bool is_loading_debugger_ ; / / Are we loading the debugger ? <nl> static DebugMessageThread * message_thread_ ; <nl> static v8 : : DebugMessageHandler debug_message_handler_ ; <nl> static void * debug_message_handler_data_ ; <nl> mmm a / src / mark - compact . cc <nl> ppp b / src / mark - compact . cc <nl> void MarkCompactCollector : : VerifyPageHeaders ( PagedSpace * space ) { <nl> / / Helper class for updating pointers in HeapObjects . <nl> class UpdatingVisitor : public ObjectVisitor { <nl> public : <nl> - <nl> void VisitPointer ( Object * * p ) { <nl> - MarkCompactCollector : : UpdatePointer ( p ) ; <nl> + UpdatePointer ( p ) ; <nl> } <nl> <nl> void VisitPointers ( Object * * start , Object * * end ) { <nl> / / Mark all HeapObject pointers in [ start , end ) <nl> - for ( Object * * p = start ; p < end ; p + + ) { <nl> - MarkCompactCollector : : UpdatePointer ( p ) ; <nl> + for ( Object * * p = start ; p < end ; p + + ) UpdatePointer ( p ) ; <nl> + } <nl> + <nl> + private : <nl> + void UpdatePointer ( Object * * p ) { <nl> + if ( ! ( * p ) - > IsHeapObject ( ) ) return ; <nl> + <nl> + HeapObject * obj = HeapObject : : cast ( * p ) ; <nl> + Address old_addr = obj - > address ( ) ; <nl> + Address new_addr ; <nl> + ASSERT ( ! Heap : : InFromSpace ( obj ) ) ; <nl> + <nl> + if ( Heap : : new_space ( ) - > Contains ( obj ) ) { <nl> + Address f_addr = Heap : : new_space ( ) - > FromSpaceLow ( ) + <nl> + Heap : : new_space ( ) - > ToSpaceOffsetForAddress ( old_addr ) ; <nl> + new_addr = Memory : : Address_at ( f_addr ) ; <nl> + <nl> + # ifdef DEBUG <nl> + ASSERT ( Heap : : old_space ( ) - > Contains ( new_addr ) | | <nl> + Heap : : code_space ( ) - > Contains ( new_addr ) | | <nl> + Heap : : new_space ( ) - > FromSpaceContains ( new_addr ) ) ; <nl> + <nl> + if ( Heap : : new_space ( ) - > FromSpaceContains ( new_addr ) ) { <nl> + ASSERT ( Heap : : new_space ( ) - > FromSpaceOffsetForAddress ( new_addr ) < = <nl> + Heap : : new_space ( ) - > ToSpaceOffsetForAddress ( old_addr ) ) ; <nl> + } <nl> + # endif <nl> + <nl> + } else if ( Heap : : lo_space ( ) - > Contains ( obj ) ) { <nl> + / / Don ' t move objects in the large object space . <nl> + return ; <nl> + <nl> + } else { <nl> + ASSERT ( Heap : : old_space ( ) - > Contains ( obj ) | | <nl> + Heap : : code_space ( ) - > Contains ( obj ) | | <nl> + Heap : : map_space ( ) - > Contains ( obj ) ) ; <nl> + <nl> + new_addr = MarkCompactCollector : : GetForwardingAddressInOldSpace ( obj ) ; <nl> + ASSERT ( Heap : : old_space ( ) - > Contains ( new_addr ) | | <nl> + Heap : : code_space ( ) - > Contains ( new_addr ) | | <nl> + Heap : : map_space ( ) - > Contains ( new_addr ) ) ; <nl> + <nl> + # ifdef DEBUG <nl> + if ( Heap : : old_space ( ) - > Contains ( obj ) ) { <nl> + ASSERT ( Heap : : old_space ( ) - > MCSpaceOffsetForAddress ( new_addr ) < = <nl> + Heap : : old_space ( ) - > MCSpaceOffsetForAddress ( old_addr ) ) ; <nl> + } else if ( Heap : : code_space ( ) - > Contains ( obj ) ) { <nl> + ASSERT ( Heap : : code_space ( ) - > MCSpaceOffsetForAddress ( new_addr ) < = <nl> + Heap : : code_space ( ) - > MCSpaceOffsetForAddress ( old_addr ) ) ; <nl> + } else { <nl> + ASSERT ( Heap : : map_space ( ) - > MCSpaceOffsetForAddress ( new_addr ) < = <nl> + Heap : : map_space ( ) - > MCSpaceOffsetForAddress ( old_addr ) ) ; <nl> + } <nl> + # endif <nl> } <nl> + <nl> + * p = HeapObject : : FromAddress ( new_addr ) ; <nl> + <nl> + # ifdef DEBUG <nl> + if ( FLAG_gc_verbose ) { <nl> + PrintF ( " update % p : % p - > % p \ n " , <nl> + reinterpret_cast < Address > ( p ) , old_addr , new_addr ) ; <nl> + } <nl> + # endif <nl> } <nl> } ; <nl> <nl> + <nl> void MarkCompactCollector : : UpdatePointers ( ) { <nl> # ifdef DEBUG <nl> ASSERT ( state_ = = ENCODE_FORWARDING_ADDRESSES ) ; <nl> Address MarkCompactCollector : : GetForwardingAddressInOldSpace ( HeapObject * obj ) { <nl> return next_page - > OffsetToAddress ( offset ) ; <nl> } <nl> <nl> - void MarkCompactCollector : : UpdatePointer ( Object * * p ) { <nl> - / / We need to check if p is in to_space . <nl> - if ( ! ( * p ) - > IsHeapObject ( ) ) return ; <nl> - <nl> - HeapObject * obj = HeapObject : : cast ( * p ) ; <nl> - Address old_addr = obj - > address ( ) ; <nl> - Address new_addr ; <nl> - <nl> - ASSERT ( ! Heap : : InFromSpace ( obj ) ) ; <nl> - <nl> - if ( Heap : : new_space ( ) - > Contains ( obj ) ) { <nl> - Address f_addr = Heap : : new_space ( ) - > FromSpaceLow ( ) + <nl> - Heap : : new_space ( ) - > ToSpaceOffsetForAddress ( old_addr ) ; <nl> - new_addr = Memory : : Address_at ( f_addr ) ; <nl> - <nl> - # ifdef DEBUG <nl> - ASSERT ( Heap : : old_space ( ) - > Contains ( new_addr ) | | <nl> - Heap : : code_space ( ) - > Contains ( new_addr ) | | <nl> - Heap : : new_space ( ) - > FromSpaceContains ( new_addr ) ) ; <nl> - <nl> - if ( Heap : : new_space ( ) - > FromSpaceContains ( new_addr ) ) { <nl> - ASSERT ( Heap : : new_space ( ) - > FromSpaceOffsetForAddress ( new_addr ) < = <nl> - Heap : : new_space ( ) - > ToSpaceOffsetForAddress ( old_addr ) ) ; <nl> - } <nl> - # endif <nl> - <nl> - } else if ( Heap : : lo_space ( ) - > Contains ( obj ) ) { <nl> - / / Don ' t move objects in the large object space . <nl> - new_addr = obj - > address ( ) ; <nl> - <nl> - } else { <nl> - ASSERT ( Heap : : old_space ( ) - > Contains ( obj ) | | <nl> - Heap : : code_space ( ) - > Contains ( obj ) | | <nl> - Heap : : map_space ( ) - > Contains ( obj ) ) ; <nl> - <nl> - new_addr = GetForwardingAddressInOldSpace ( obj ) ; <nl> - ASSERT ( Heap : : old_space ( ) - > Contains ( new_addr ) | | <nl> - Heap : : code_space ( ) - > Contains ( new_addr ) | | <nl> - Heap : : map_space ( ) - > Contains ( new_addr ) ) ; <nl> - <nl> - # ifdef DEBUG <nl> - if ( Heap : : old_space ( ) - > Contains ( obj ) ) { <nl> - ASSERT ( Heap : : old_space ( ) - > MCSpaceOffsetForAddress ( new_addr ) < = <nl> - Heap : : old_space ( ) - > MCSpaceOffsetForAddress ( old_addr ) ) ; <nl> - } else if ( Heap : : code_space ( ) - > Contains ( obj ) ) { <nl> - ASSERT ( Heap : : code_space ( ) - > MCSpaceOffsetForAddress ( new_addr ) < = <nl> - Heap : : code_space ( ) - > MCSpaceOffsetForAddress ( old_addr ) ) ; <nl> - } else { <nl> - ASSERT ( Heap : : map_space ( ) - > MCSpaceOffsetForAddress ( new_addr ) < = <nl> - Heap : : map_space ( ) - > MCSpaceOffsetForAddress ( old_addr ) ) ; <nl> - } <nl> - # endif <nl> - } <nl> - <nl> - * p = HeapObject : : FromAddress ( new_addr ) ; <nl> - <nl> - # ifdef DEBUG <nl> - if ( FLAG_gc_verbose ) { <nl> - PrintF ( " update % p : % p - > % p \ n " , <nl> - reinterpret_cast < Address > ( p ) , old_addr , new_addr ) ; <nl> - } <nl> - # endif <nl> - } <nl> - <nl> <nl> # ifdef DEBUG <nl> void MarkCompactCollector : : VerifyHeapAfterUpdatingPointers ( ) { <nl> mmm a / src / mark - compact . h <nl> ppp b / src / mark - compact . h <nl> class MarkCompactCollector : public AllStatic { <nl> / / Returns the heap size of the object . <nl> static int UpdatePointersInOldObject ( HeapObject * obj ) ; <nl> <nl> - / / Updates the pointer in a slot . <nl> - static void UpdatePointer ( Object * * p ) ; <nl> - <nl> / / Calculates the forwarding address of an object in an old space . <nl> static Address GetForwardingAddressInOldSpace ( HeapObject * obj ) ; <nl> <nl> mmm a / src / runtime . cc <nl> ppp b / src / runtime . cc <nl> static Object * IllegalOperation ( ) { <nl> static Object * Runtime_CloneObjectLiteralBoilerplate ( Arguments args ) { <nl> CONVERT_CHECKED ( JSObject , boilerplate , args [ 0 ] ) ; <nl> <nl> - # ifdef DEBUG <nl> - / / Verify the constructor of the boilerplate is equal to the <nl> - / / object function in the CURRENT global_context . <nl> - CHECK ( boilerplate - > map ( ) - > constructor ( ) <nl> - = = Top : : context ( ) - > global_context ( ) - > object_function ( ) ) ; <nl> - # endif <nl> + / / Verify that the constructor of the boilerplate is equal to the <nl> + / / object function in the current global context . <nl> + ASSERT ( boilerplate - > map ( ) - > constructor ( ) = = <nl> + Top : : context ( ) - > global_context ( ) - > object_function ( ) ) ; <nl> return boilerplate - > Copy ( ) ; <nl> } <nl> <nl> new file mode 100644 <nl> index 00000000000 . . 29b0f013de5 <nl> mmm / dev / null <nl> ppp b / test / mjsunit / mjsunit . js <nl> <nl> + / / Copyright 2006 - 2008 Google Inc . All Rights Reserved . <nl> + / / Redistribution and use in source and binary forms , with or without <nl> + / / modification , are permitted provided that the following conditions are <nl> + / / met : <nl> + / / <nl> + / / * Redistributions of source code must retain the above copyright <nl> + / / notice , this list of conditions and the following disclaimer . <nl> + / / * Redistributions in binary form must reproduce the above <nl> + / / copyright notice , this list of conditions and the following <nl> + / / disclaimer in the documentation and / or other materials provided <nl> + / / with the distribution . <nl> + / / * Neither the name of Google Inc . nor the names of its <nl> + / / contributors may be used to endorse or promote products derived <nl> + / / from this software without specific prior written permission . <nl> + / / <nl> + / / THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + / / " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + / / LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + / / A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + / / OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + / / SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + / / LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + / / DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + / / THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + / / ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + / / OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + <nl> + / * <nl> + * This file is included in all mini jsunit test cases . The test <nl> + * framework expects lines that signal failed tests to start with <nl> + * the f - word and ignore all other lines . <nl> + * / <nl> + <nl> + / / Avoid writing the f - word , since some tests output parts of this code . <nl> + var the_f_word = " Fai " + " lure " ; <nl> + <nl> + function fail ( expected , found , name_opt ) { <nl> + var start ; <nl> + if ( name_opt ) { <nl> + start = the_f_word + " ( " + name_opt + " ) : " ; <nl> + } else { <nl> + start = the_f_word + " : " ; <nl> + } <nl> + print ( start + " expected < " + expected + " > found < " + found + " > " ) ; <nl> + } <nl> + <nl> + <nl> + function assertEquals ( expected , found , name_opt ) { <nl> + if ( expected ! = found ) { <nl> + fail ( expected , found , name_opt ) ; <nl> + } <nl> + } <nl> + <nl> + <nl> + function assertArrayEquals ( expected , found , name_opt ) { <nl> + var start = " " ; <nl> + if ( name_opt ) { <nl> + start = name_opt + " - " ; <nl> + } <nl> + assertEquals ( expected . length , found . length , start + " array length " ) ; <nl> + if ( expected . length = = found . length ) { <nl> + for ( var i = 0 ; i < expected . length ; + + i ) { <nl> + assertEquals ( expected [ i ] , found [ i ] , start + " array element at index " + i ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + <nl> + function assertTrue ( value , name_opt ) { <nl> + assertEquals ( true , value , name_opt ) ; <nl> + } <nl> + <nl> + <nl> + function assertFalse ( value , name_opt ) { <nl> + assertEquals ( false , value , name_opt ) ; <nl> + } <nl> + <nl> + <nl> + function assertNaN ( value , name_opt ) { <nl> + if ( ! isNaN ( value ) ) { <nl> + fail ( " NaN " , value , name_opt ) ; <nl> + } <nl> + } <nl> + <nl> + <nl> + function assertThrows ( code ) { <nl> + try { <nl> + eval ( code ) ; <nl> + assertTrue ( false , " did not throw exception " ) ; <nl> + } catch ( e ) { <nl> + / / Do nothing . <nl> + } <nl> + } <nl> + <nl> + <nl> + function assertInstanceof ( obj , type ) { <nl> + if ( ! ( obj instanceof type ) ) { <nl> + assertTrue ( false , " Object < " + obj + " > is not an instance of < " + type + " > " ) ; <nl> + } <nl> + } <nl> + <nl> + <nl> + function assertDoesNotThrow ( code ) { <nl> + try { <nl> + eval ( code ) ; <nl> + } catch ( e ) { <nl> + assertTrue ( false , " threw an exception " ) ; <nl> + } <nl> + } <nl> + <nl> + <nl> + function assertUnreachable ( name_opt ) { <nl> + var message = the_f_word + " : unreachable " <nl> + if ( name_opt ) { <nl> + message + = " - " + name_opt ; <nl> + } <nl> + print ( message ) ; <nl> + } <nl> + <nl> mmm a / tools / visual_studio / README . txt <nl> ppp b / tools / visual_studio / README . txt <nl> A project which uses V8 should then depend on v8_snapshot . vcproj . <nl> If V8 without snapshot if preferred only v8_base . vcproj and v8 . vcproj are <nl> required and a project which uses V8 should depend on v8 . vcproj . <nl> <nl> + Two sample project files are available as well . These are v8_shell_sample . vcproj <nl> + for building the sample in samples \ shell . cc and v8_process_sample . vcproj for <nl> + building the sample in samples \ process . cc . Add either of these ( or both ) to a <nl> + solution with v8_base , v8 , v8_mksnapshot and v8_snapshot set up as described <nl> + above and have them depend on v8_snapshot . <nl> + <nl> Python requirements <nl> mmmmmmmmmmmmmmmmmm - <nl> When using the Microsoft Visual Studio project files Python version 2 . 4 or later <nl> mmm a / tools / visual_studio / v8 . vcproj <nl> ppp b / tools / visual_studio / v8 . vcproj <nl> <nl> < Tool <nl> Name = " VCCustomBuildTool " <nl> Description = " Processing js files . . . " <nl> - CommandLine = " . \ js2c . cmd . . \ . . \ src $ ( IntDir ) \ DerivedSources " <nl> + CommandLine = " . \ js2c . cmd . . \ . . \ src $ ( IntDir ) \ DerivedSources & # x0D ; & # x0A ; " <nl> AdditionalDependencies = " . . \ . . \ src \ macros . py ; . . \ . . \ src \ runtime . js ; . . \ . . \ src \ v8natives . js ; . . \ . . \ src \ array . js ; . . \ . . \ src \ string . js ; . . \ . . \ src \ uri . js ; . . \ . . \ src \ math . js ; . . \ . . \ src \ messages . js ; . . \ . . \ src \ apinatives . js ; . . \ . . \ src \ debug - delay . js ; . . \ . . \ src \ mirror - delay . js ; . . \ . . \ src \ date - delay . js ; . . \ . . \ src \ regexp - delay . js " <nl> Outputs = " $ ( IntDir ) \ DerivedSources \ natives . cc ; $ ( IntDir ) \ DerivedSources \ natives - empty . cc " <nl> / > <nl> <nl> < Tool <nl> Name = " VCCustomBuildTool " <nl> Description = " Processing js files . . . " <nl> - CommandLine = " . \ js2c . cmd . . \ . . \ src $ ( IntDir ) \ DerivedSources " <nl> + CommandLine = " . \ js2c . cmd . . \ . . \ src $ ( IntDir ) \ DerivedSources & # x0D ; & # x0A ; " <nl> AdditionalDependencies = " . . \ . . \ src \ macros . py ; . . \ . . \ src \ runtime . js ; . . \ . . \ src \ v8natives . js ; . . \ . . \ src \ array . js ; . . \ . . \ src \ string . js ; . . \ . . \ src \ uri . js ; . . \ . . \ src \ math . js ; . . \ . . \ src \ messages . js ; . . \ . . \ src \ apinatives . js ; . . \ . . \ src \ debug - delay . js ; . . \ . . \ src \ mirror - delay . js ; . . \ . . \ src \ date - delay . js ; . . \ . . \ src \ regexp - delay . js " <nl> Outputs = " $ ( IntDir ) \ DerivedSources \ natives . cc ; $ ( IntDir ) \ DerivedSources \ natives - empty . cc " <nl> / > <nl> <nl> RelativePath = " $ ( IntDir ) \ DerivedSources \ natives . cc " <nl> > <nl> < / File > <nl> - < File <nl> - RelativePath = " . \ prebuild . py " <nl> - > <nl> - < / File > <nl> < / Filter > <nl> < File <nl> RelativePath = " . . \ . . \ src \ snapshot - empty . cc " <nl> new file mode 100644 <nl> index 00000000000 . . 36ff787044b <nl> mmm / dev / null <nl> ppp b / tools / visual_studio / v8_process_sample . vcproj <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " Windows - 1252 " ? > <nl> + < VisualStudioProject <nl> + ProjectType = " Visual C + + " <nl> + Version = " 8 , 00 " <nl> + Name = " v8_process_sample " <nl> + ProjectGUID = " { EF019874 - D38A - 40E3 - B17C - DB5923F0A79C } " <nl> + RootNamespace = " v8_process_sample " <nl> + Keyword = " Win32Proj " <nl> + > <nl> + < Platforms > <nl> + < Platform <nl> + Name = " Win32 " <nl> + / > <nl> + < / Platforms > <nl> + < ToolFiles > <nl> + < / ToolFiles > <nl> + < Configurations > <nl> + < Configuration <nl> + Name = " Debug | Win32 " <nl> + ConfigurationType = " 1 " <nl> + InheritedPropertySheets = " . \ common . vsprops ; . \ debug . vsprops " <nl> + > <nl> + < Tool <nl> + Name = " VCPreBuildEventTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCCustomBuildTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCXMLDataGeneratorTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCWebServiceProxyGeneratorTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCMIDLTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCCLCompilerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCManagedResourceCompilerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCResourceCompilerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCPreLinkEventTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCLinkerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCALinkTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCManifestTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCXDCMakeTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCBscMakeTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCFxCopTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCAppVerifierTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCWebDeploymentTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCPostBuildEventTool " <nl> + / > <nl> + < / Configuration > <nl> + < Configuration <nl> + Name = " Release | Win32 " <nl> + ConfigurationType = " 1 " <nl> + InheritedPropertySheets = " . \ common . vsprops ; . \ release . vsprops " <nl> + > <nl> + < Tool <nl> + Name = " VCPreBuildEventTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCCustomBuildTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCXMLDataGeneratorTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCWebServiceProxyGeneratorTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCMIDLTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCCLCompilerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCManagedResourceCompilerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCResourceCompilerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCPreLinkEventTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCLinkerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCALinkTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCManifestTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCXDCMakeTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCBscMakeTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCFxCopTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCAppVerifierTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCWebDeploymentTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCPostBuildEventTool " <nl> + / > <nl> + < / Configuration > <nl> + < / Configurations > <nl> + < References > <nl> + < / References > <nl> + < Files > <nl> + < File <nl> + RelativePath = " . . \ . . \ samples \ process . cc " <nl> + > <nl> + < / File > <nl> + < / Files > <nl> + < Globals > <nl> + < / Globals > <nl> + < / VisualStudioProject > <nl> new file mode 100644 <nl> index 00000000000 . . 27f5d7feeda <nl> mmm / dev / null <nl> ppp b / tools / visual_studio / v8_shell_sample . vcproj <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " Windows - 1252 " ? > <nl> + < VisualStudioProject <nl> + ProjectType = " Visual C + + " <nl> + Version = " 8 , 00 " <nl> + Name = " v8_shell_sample " <nl> + ProjectGUID = " { 2DE20FFA - 6F5E - 48D9 - 84D8 - 09B044A5B119 } " <nl> + RootNamespace = " v8_shell_sample " <nl> + Keyword = " Win32Proj " <nl> + > <nl> + < Platforms > <nl> + < Platform <nl> + Name = " Win32 " <nl> + / > <nl> + < / Platforms > <nl> + < ToolFiles > <nl> + < / ToolFiles > <nl> + < Configurations > <nl> + < Configuration <nl> + Name = " Debug | Win32 " <nl> + ConfigurationType = " 1 " <nl> + InheritedPropertySheets = " . \ common . vsprops ; . \ debug . vsprops " <nl> + > <nl> + < Tool <nl> + Name = " VCPreBuildEventTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCCustomBuildTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCXMLDataGeneratorTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCWebServiceProxyGeneratorTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCMIDLTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCCLCompilerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCManagedResourceCompilerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCResourceCompilerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCPreLinkEventTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCLinkerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCALinkTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCManifestTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCXDCMakeTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCBscMakeTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCFxCopTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCAppVerifierTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCWebDeploymentTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCPostBuildEventTool " <nl> + / > <nl> + < / Configuration > <nl> + < Configuration <nl> + Name = " Release | Win32 " <nl> + ConfigurationType = " 1 " <nl> + InheritedPropertySheets = " . \ common . vsprops ; . \ release . vsprops " <nl> + > <nl> + < Tool <nl> + Name = " VCPreBuildEventTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCCustomBuildTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCXMLDataGeneratorTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCWebServiceProxyGeneratorTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCMIDLTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCCLCompilerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCManagedResourceCompilerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCResourceCompilerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCPreLinkEventTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCLinkerTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCALinkTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCManifestTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCXDCMakeTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCBscMakeTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCFxCopTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCAppVerifierTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCWebDeploymentTool " <nl> + / > <nl> + < Tool <nl> + Name = " VCPostBuildEventTool " <nl> + / > <nl> + < / Configuration > <nl> + < / Configurations > <nl> + < References > <nl> + < / References > <nl> + < Files > <nl> + < File <nl> + RelativePath = " . . \ . . \ samples \ shell . cc " <nl> + > <nl> + < / File > <nl> + < / Files > <nl> + < Globals > <nl> + < / Globals > <nl> + < / VisualStudioProject > <nl>
Improved performance of garbage collection by moving the function that updates pointers during compacting collection into the updating visitor . This gives the compiler a better chance to inline and avoid a function call per ( potential ) pointer .
v8/v8
cbaa060d2827a6c7aab497845a1fe6ae6f2dfab4
2008-08-14T13:41:48Z
mmm a / xbmc / android / jni / AudioManager . h <nl> ppp b / xbmc / android / jni / AudioManager . h <nl> class CJNIAudioManager : public CJNIBase <nl> void setStreamVolume ( int index = 0 , int flags = 0 ) ; <nl> <nl> static void PopulateStaticFields ( ) ; <nl> + static int STREAM_MUSIC ; <nl> <nl> private : <nl> CJNIAudioManager ( ) ; <nl> - <nl> - static int STREAM_MUSIC ; <nl> } ; <nl> + <nl>
[ DROID ] [ JNI ] Expose constant from AudioManager .
xbmc/xbmc
cca846e32602baeac725bf1f0c76b91789bd5a30
2013-12-19T18:00:10Z
mmm a / lib / AST / ASTPrinter . cpp <nl> ppp b / lib / AST / ASTPrinter . cpp <nl> class TypePrinter : public TypeVisitor < TypePrinter > { <nl> bool isSimple = T - > hasSimpleTypeRepr ( ) ; <nl> if ( isSimple & & T - > is < OpaqueTypeArchetypeType > ( ) ) { <nl> auto opaqueTy = T - > castTo < OpaqueTypeArchetypeType > ( ) ; <nl> - auto opaqueDecl = opaqueTy - > getDecl ( ) ; <nl> - if ( ! opaqueDecl - > hasName ( ) ) { <nl> - switch ( Options . OpaqueReturnTypePrinting ) { <nl> - case PrintOptions : : OpaqueReturnTypePrintingMode : : StableReference : <nl> - case PrintOptions : : OpaqueReturnTypePrintingMode : : Description : <nl> - isSimple = true ; <nl> - break ; <nl> - case PrintOptions : : OpaqueReturnTypePrintingMode : : WithOpaqueKeyword : <nl> - isSimple = false ; <nl> - break ; <nl> - case PrintOptions : : OpaqueReturnTypePrintingMode : : WithoutOpaqueKeyword : { <nl> - isSimple = opaqueTy - > getConformsTo ( ) . size ( ) < 2 ; <nl> - } <nl> - } <nl> + switch ( Options . OpaqueReturnTypePrinting ) { <nl> + case PrintOptions : : OpaqueReturnTypePrintingMode : : StableReference : <nl> + case PrintOptions : : OpaqueReturnTypePrintingMode : : Description : <nl> + isSimple = true ; <nl> + break ; <nl> + case PrintOptions : : OpaqueReturnTypePrintingMode : : WithOpaqueKeyword : <nl> + isSimple = false ; <nl> + break ; <nl> + case PrintOptions : : OpaqueReturnTypePrintingMode : : WithoutOpaqueKeyword : { <nl> + isSimple = opaqueTy - > getExistentialType ( ) - > hasSimpleTypeRepr ( ) ; <nl> + break ; <nl> + } <nl> } <nl> } <nl> <nl> class TypePrinter : public TypeVisitor < TypePrinter > { <nl> Printer < < " some " ; <nl> LLVM_FALLTHROUGH ; <nl> case PrintOptions : : OpaqueReturnTypePrintingMode : : WithoutOpaqueKeyword : { <nl> - SmallVector < Type , 2 > types ; <nl> - for ( auto proto : T - > getConformsTo ( ) ) <nl> - types . push_back ( proto - > TypeDecl : : getDeclaredInterfaceType ( ) ) ; <nl> - <nl> - / / Create and visit temporary ProtocolCompositionType . <nl> - auto composition = <nl> - ProtocolCompositionType : : get ( T - > getASTContext ( ) , types , false ) ; <nl> - visit ( composition ) ; <nl> + visit ( T - > getExistentialType ( ) ) ; <nl> return ; <nl> } <nl> case PrintOptions : : OpaqueReturnTypePrintingMode : : StableReference : { <nl> new file mode 100644 <nl> index 000000000000 . . 83285137c189 <nl> mmm / dev / null <nl> ppp b / test / IDE / print_opaque_result_type . swift <nl> <nl> + / / RUN : % swift - ide - test - print - swift - file - interface - source - filename % s <nl> + <nl> + public class Base { } <nl> + / / CHECK : public class Base { <nl> + public protocol Proto { } <nl> + / / CHECK : public protocol Proto { <nl> + } <nl> + public func foo ( ) - > some Base & Proto { <nl> + / / CHECK : public func foo ( ) - > some Base & Proto <nl> + class Derived : Base , Proto { } <nl> + return Derived ( ) <nl> + } <nl>
Merge pull request from rintaro / astprint - print - opaquetype
apple/swift
23ad86daa02db44c65487f7f19d61187b1608798
2019-04-26T20:01:24Z
mmm a / trunk / src / app / srs_app_hls . cpp <nl> ppp b / trunk / src / app / srs_app_hls . cpp <nl> bool SrsHlsMuxer : : is_segment_overflow ( ) <nl> srs_assert ( current ) ; <nl> <nl> / / to prevent very small segment . <nl> - if ( current - > duration < 2 * SRS_AUTO_HLS_SEGMENT_MIN_DURATION_MS ) { <nl> + if ( current - > duration * 1000 < 2 * SRS_AUTO_HLS_SEGMENT_MIN_DURATION_MS ) { <nl> return false ; <nl> } <nl> <nl> bool SrsHlsMuxer : : is_segment_absolutely_overflow ( ) <nl> srs_assert ( current ) ; <nl> <nl> / / to prevent very small segment . <nl> - if ( current - > duration < 2 * SRS_AUTO_HLS_SEGMENT_MIN_DURATION_MS ) { <nl> + if ( current - > duration * 1000 < 2 * SRS_AUTO_HLS_SEGMENT_MIN_DURATION_MS ) { <nl> return false ; <nl> } <nl> <nl>
refine the overflow algorithm , prevent smaller piece .
ossrs/srs
4e5ddb51e745b8452cd5bdffd9b28e9f9f74463f
2015-04-21T08:21:22Z
mmm a / tensorflow / lite / experimental / objc / BUILD . apple <nl> ppp b / tensorflow / lite / experimental / objc / BUILD . apple <nl> package ( default_visibility = [ " / / visibility : private " ] ) <nl> licenses ( [ " notice " ] ) # Apache 2 . 0 <nl> <nl> load ( " / / tensorflow / lite / experimental / ios : ios . bzl " , " TFL_DEFAULT_TAGS " , " TFL_DISABLED_SANITIZER_TAGS " , " TFL_MINIMUM_OS_VERSION " ) <nl> - load ( " @ build_bazel_rules_apple / / apple : ios . bzl " , " ios_unit_test " ) <nl> + load ( " @ build_bazel_rules_apple / / apple : ios . bzl " , " ios_application " , " ios_unit_test " ) <nl> <nl> SOURCES = glob ( [ <nl> " sources / * . h " , <nl> objc_library ( <nl> srcs = SOURCES , <nl> hdrs = API_HEADERS , <nl> copts = RELEASE_COPTS , <nl> - module_map = " apis / module . modulemap " , <nl> tags = TFL_DEFAULT_TAGS , <nl> deps = [ <nl> " / / tensorflow / lite / experimental / c : c_api " , <nl> objc_library ( <nl> ) <nl> <nl> ios_unit_test ( <nl> - name = " TensorFlowLiteTests " , <nl> + name = " Tests " , <nl> size = " medium " , <nl> minimum_os_version = TFL_MINIMUM_OS_VERSION , <nl> tags = TFL_DEFAULT_TAGS + TFL_DISABLED_SANITIZER_TAGS , <nl> deps = [ <nl> - " : TestsLib " , <nl> + " : TestsLibrary " , <nl> ] , <nl> ) <nl> <nl> objc_library ( <nl> - name = " TestsLib " , <nl> + name = " TestsLibrary " , <nl> testonly = 1 , <nl> srcs = glob ( [ <nl> " tests / * . m " , <nl> objc_library ( <nl> " : TensorFlowLite " , <nl> ] , <nl> ) <nl> + <nl> + ios_application ( <nl> + name = " TestApp " , <nl> + app_icons = glob ( [ " apps / TestApp / TestApp / Assets . xcassets / AppIcon . appiconset / * * " ] ) , <nl> + bundle_id = " com . tensorflow . lite . objc . TestApp " , <nl> + families = [ <nl> + " ipad " , <nl> + " iphone " , <nl> + ] , <nl> + infoplists = [ " apps / TestApp / TestApp / Info . plist " ] , <nl> + minimum_os_version = TFL_MINIMUM_OS_VERSION , <nl> + sdk_frameworks = [ <nl> + " CoreGraphics " , <nl> + ] , <nl> + tags = TFL_DEFAULT_TAGS , <nl> + deps = [ <nl> + " : TestAppLibrary " , <nl> + ] , <nl> + ) <nl> + <nl> + objc_library ( <nl> + name = " TestAppLibrary " , <nl> + srcs = glob ( [ " apps / TestApp / TestApp / * . m " ] ) , <nl> + hdrs = glob ( [ " apps / TestApp / TestApp / * . h " ] ) , <nl> + data = glob ( [ " apps / TestApp / TestApp / Base . lproj / * . storyboard " ] ) + [ <nl> + " / / tensorflow / lite : testdata / add . bin " , <nl> + " / / tensorflow / lite : testdata / add_quantized . bin " , <nl> + " / / tensorflow / lite : testdata / multi_add . bin " , <nl> + ] , <nl> + includes = [ <nl> + " apis " , <nl> + ] , <nl> + module_name = " TestApp " , <nl> + tags = TFL_DEFAULT_TAGS + [ " manual " ] , <nl> + deps = [ <nl> + " : TensorFlowLite " , <nl> + ] , <nl> + ) <nl> mmm a / tensorflow / lite / experimental / objc / README . md <nl> ppp b / tensorflow / lite / experimental / objc / README . md <nl> Build the ` TensorFlowLite ` Objective - C library target : <nl> bazel build tensorflow / lite / experimental / objc : TensorFlowLite <nl> ` ` ` <nl> <nl> - Build the ` TensorFlowLiteTests ` target : <nl> + Build the ` Tests ` target : <nl> <nl> ` ` ` shell <nl> - bazel test tensorflow / lite / experimental / objc : TensorFlowLiteTests <nl> + bazel test tensorflow / lite / experimental / objc : Tests <nl> ` ` ` <nl> <nl> # # # # Generate the Xcode project using Tulsi <nl> mmm a / tensorflow / lite / experimental / objc / TensorFlowLite . tulsiproj / Configs / TensorFlowLite . tulsigen <nl> ppp b / tensorflow / lite / experimental / objc / TensorFlowLite . tulsiproj / Configs / TensorFlowLite . tulsigen <nl> <nl> " tensorflow / lite / experimental / c " , <nl> " tensorflow / lite / experimental / objc " , <nl> " tensorflow / lite / experimental / objc / apis " , <nl> + " tensorflow / lite / experimental / objc / apps / TestApp / TestApp " , <nl> + " tensorflow / lite / experimental / objc / apps / TestApp / TestApp / Base . lproj " , <nl> " tensorflow / lite / experimental / objc / sources " , <nl> " tensorflow / lite / experimental / objc / tests " , <nl> " tensorflow / lite / kernels " , <nl> <nl> ] , <nl> " buildTargets " : [ <nl> " / / tensorflow / lite / experimental / objc : TensorFlowLite " , <nl> - " / / tensorflow / lite / experimental / objc : TensorFlowLiteTests " , <nl> + " / / tensorflow / lite / experimental / objc : TestApp " , <nl> + " / / tensorflow / lite / experimental / objc : Tests " , <nl> ] , <nl> " projectName " : " TensorFlowLite " , <nl> " optionSet " : { <nl> mmm a / tensorflow / lite / experimental / objc / apis / framework . modulemap <nl> ppp b / tensorflow / lite / experimental / objc / apis / framework . modulemap <nl> <nl> framework module TFLTensorFlowLite { <nl> umbrella header " TFLTensorFlowLite . h " <nl> <nl> - header " TFLInterpreter . h " <nl> - header " TFLInterpreterOptions . h " <nl> - header " TFLQuantizationParameters . h " <nl> - header " TFLTensor . h " <nl> - <nl> export * <nl> } <nl> deleted file mode 100644 <nl> index 37b98478f60f6 . . 0000000000000 <nl> mmm a / tensorflow / lite / experimental / objc / apis / module . modulemap <nl> ppp / dev / null <nl> <nl> - module TFLTensorFlowLite { <nl> - umbrella header " TFLTensorFlowLite . h " <nl> - <nl> - header " TFLInterpreter . h " <nl> - header " TFLInterpreterOptions . h " <nl> - header " TFLQuantizationParameters . h " <nl> - header " TFLTensor . h " <nl> - <nl> - export * <nl> - } <nl> new file mode 100644 <nl> index 0000000000000 . . 7060500690d5b <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / objc / apps / TestApp / Podfile <nl> <nl> + platform : ios , ' 9 . 0 ' <nl> + <nl> + target ' TestApp ' do <nl> + pod ' TensorFlowLiteObjC ' <nl> + end <nl> new file mode 100644 <nl> index 0000000000000 . . 9ce01df5b1000 <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / objc / apps / TestApp / TestApp . xcodeproj / project . pbxproj <nl> <nl> + / / ! $ * UTF8 * $ ! <nl> + { <nl> + archiveVersion = 1 ; <nl> + classes = { <nl> + } ; <nl> + objectVersion = 50 ; <nl> + objects = { <nl> + <nl> + / * Begin PBXBuildFile section * / <nl> + B20F5F3622937C9000A4FBD8 / * add_quantized . bin in Resources * / = { isa = PBXBuildFile ; fileRef = B20F5F3322937C8D00A4FBD8 / * add_quantized . bin * / ; } ; <nl> + B20F5F3722937C9000A4FBD8 / * add . bin in Resources * / = { isa = PBXBuildFile ; fileRef = B20F5F3422937C8F00A4FBD8 / * add . bin * / ; } ; <nl> + B20F5F3822937C9000A4FBD8 / * multi_add . bin in Resources * / = { isa = PBXBuildFile ; fileRef = B20F5F3522937C8F00A4FBD8 / * multi_add . bin * / ; } ; <nl> + B210BD922291D78D00572163 / * AppDelegate . m in Sources * / = { isa = PBXBuildFile ; fileRef = B210BD912291D78D00572163 / * AppDelegate . m * / ; } ; <nl> + B210BD952291D78D00572163 / * ViewController . m in Sources * / = { isa = PBXBuildFile ; fileRef = B210BD942291D78D00572163 / * ViewController . m * / ; } ; <nl> + B210BD982291D78D00572163 / * Main . storyboard in Resources * / = { isa = PBXBuildFile ; fileRef = B210BD962291D78D00572163 / * Main . storyboard * / ; } ; <nl> + B210BD9A2291D78E00572163 / * Assets . xcassets in Resources * / = { isa = PBXBuildFile ; fileRef = B210BD992291D78E00572163 / * Assets . xcassets * / ; } ; <nl> + B210BD9D2291D78F00572163 / * LaunchScreen . storyboard in Resources * / = { isa = PBXBuildFile ; fileRef = B210BD9B2291D78F00572163 / * LaunchScreen . storyboard * / ; } ; <nl> + B210BDA02291D78F00572163 / * main . m in Sources * / = { isa = PBXBuildFile ; fileRef = B210BD9F2291D78F00572163 / * main . m * / ; } ; <nl> + / * End PBXBuildFile section * / <nl> + <nl> + / * Begin PBXFileReference section * / <nl> + B20F5F3322937C8D00A4FBD8 / * add_quantized . bin * / = { isa = PBXFileReference ; lastKnownFileType = archive . macbinary ; name = add_quantized . bin ; path = . . / . . / . . / . . / testdata / add_quantized . bin ; sourceTree = " < group > " ; } ; <nl> + B20F5F3422937C8F00A4FBD8 / * add . bin * / = { isa = PBXFileReference ; lastKnownFileType = archive . macbinary ; name = add . bin ; path = . . / . . / . . / . . / testdata / add . bin ; sourceTree = " < group > " ; } ; <nl> + B20F5F3522937C8F00A4FBD8 / * multi_add . bin * / = { isa = PBXFileReference ; lastKnownFileType = archive . macbinary ; name = multi_add . bin ; path = . . / . . / . . / . . / testdata / multi_add . bin ; sourceTree = " < group > " ; } ; <nl> + B210BD8D2291D78D00572163 / * TestApp . app * / = { isa = PBXFileReference ; explicitFileType = wrapper . application ; includeInIndex = 0 ; path = TestApp . app ; sourceTree = BUILT_PRODUCTS_DIR ; } ; <nl> + B210BD902291D78D00572163 / * AppDelegate . h * / = { isa = PBXFileReference ; lastKnownFileType = sourcecode . c . h ; path = AppDelegate . h ; sourceTree = " < group > " ; } ; <nl> + B210BD912291D78D00572163 / * AppDelegate . m * / = { isa = PBXFileReference ; lastKnownFileType = sourcecode . c . objc ; path = AppDelegate . m ; sourceTree = " < group > " ; } ; <nl> + B210BD932291D78D00572163 / * ViewController . h * / = { isa = PBXFileReference ; lastKnownFileType = sourcecode . c . h ; path = ViewController . h ; sourceTree = " < group > " ; } ; <nl> + B210BD942291D78D00572163 / * ViewController . m * / = { isa = PBXFileReference ; lastKnownFileType = sourcecode . c . objc ; path = ViewController . m ; sourceTree = " < group > " ; } ; <nl> + B210BD972291D78D00572163 / * Base * / = { isa = PBXFileReference ; lastKnownFileType = file . storyboard ; name = Base ; path = Base . lproj / Main . storyboard ; sourceTree = " < group > " ; } ; <nl> + B210BD992291D78E00572163 / * Assets . xcassets * / = { isa = PBXFileReference ; lastKnownFileType = folder . assetcatalog ; path = Assets . xcassets ; sourceTree = " < group > " ; } ; <nl> + B210BD9C2291D78F00572163 / * Base * / = { isa = PBXFileReference ; lastKnownFileType = file . storyboard ; name = Base ; path = Base . lproj / LaunchScreen . storyboard ; sourceTree = " < group > " ; } ; <nl> + B210BD9E2291D78F00572163 / * Info . plist * / = { isa = PBXFileReference ; lastKnownFileType = text . plist . xml ; path = Info . plist ; sourceTree = " < group > " ; } ; <nl> + B210BD9F2291D78F00572163 / * main . m * / = { isa = PBXFileReference ; lastKnownFileType = sourcecode . c . objc ; path = main . m ; sourceTree = " < group > " ; } ; <nl> + / * End PBXFileReference section * / <nl> + <nl> + / * Begin PBXFrameworksBuildPhase section * / <nl> + B210BD8A2291D78D00572163 / * Frameworks * / = { <nl> + isa = PBXFrameworksBuildPhase ; <nl> + buildActionMask = 2147483647 ; <nl> + files = ( <nl> + ) ; <nl> + runOnlyForDeploymentPostprocessing = 0 ; <nl> + } ; <nl> + / * End PBXFrameworksBuildPhase section * / <nl> + <nl> + / * Begin PBXGroup section * / <nl> + B210BD842291D78D00572163 = { <nl> + isa = PBXGroup ; <nl> + children = ( <nl> + B20F5F3322937C8D00A4FBD8 / * add_quantized . bin * / , <nl> + B20F5F3422937C8F00A4FBD8 / * add . bin * / , <nl> + B20F5F3522937C8F00A4FBD8 / * multi_add . bin * / , <nl> + B210BD8F2291D78D00572163 / * TestApp * / , <nl> + B210BD8E2291D78D00572163 / * Products * / , <nl> + ) ; <nl> + sourceTree = " < group > " ; <nl> + } ; <nl> + B210BD8E2291D78D00572163 / * Products * / = { <nl> + isa = PBXGroup ; <nl> + children = ( <nl> + B210BD8D2291D78D00572163 / * TestApp . app * / , <nl> + ) ; <nl> + name = Products ; <nl> + sourceTree = " < group > " ; <nl> + } ; <nl> + B210BD8F2291D78D00572163 / * TestApp * / = { <nl> + isa = PBXGroup ; <nl> + children = ( <nl> + B210BD902291D78D00572163 / * AppDelegate . h * / , <nl> + B210BD912291D78D00572163 / * AppDelegate . m * / , <nl> + B210BD932291D78D00572163 / * ViewController . h * / , <nl> + B210BD942291D78D00572163 / * ViewController . m * / , <nl> + B210BD962291D78D00572163 / * Main . storyboard * / , <nl> + B210BD992291D78E00572163 / * Assets . xcassets * / , <nl> + B210BD9B2291D78F00572163 / * LaunchScreen . storyboard * / , <nl> + B210BD9E2291D78F00572163 / * Info . plist * / , <nl> + B210BD9F2291D78F00572163 / * main . m * / , <nl> + ) ; <nl> + path = TestApp ; <nl> + sourceTree = " < group > " ; <nl> + } ; <nl> + / * End PBXGroup section * / <nl> + <nl> + / * Begin PBXNativeTarget section * / <nl> + B210BD8C2291D78D00572163 / * TestApp * / = { <nl> + isa = PBXNativeTarget ; <nl> + buildConfigurationList = B210BDA32291D78F00572163 / * Build configuration list for PBXNativeTarget " TestApp " * / ; <nl> + buildPhases = ( <nl> + B210BD892291D78D00572163 / * Sources * / , <nl> + B210BD8A2291D78D00572163 / * Frameworks * / , <nl> + B210BD8B2291D78D00572163 / * Resources * / , <nl> + ) ; <nl> + buildRules = ( <nl> + ) ; <nl> + dependencies = ( <nl> + ) ; <nl> + name = TestApp ; <nl> + productName = TestApp ; <nl> + productReference = B210BD8D2291D78D00572163 / * TestApp . app * / ; <nl> + productType = " com . apple . product - type . application " ; <nl> + } ; <nl> + / * End PBXNativeTarget section * / <nl> + <nl> + / * Begin PBXProject section * / <nl> + B210BD852291D78D00572163 / * Project object * / = { <nl> + isa = PBXProject ; <nl> + attributes = { <nl> + LastUpgradeCheck = 1010 ; <nl> + ORGANIZATIONNAME = " Google Inc " ; <nl> + TargetAttributes = { <nl> + B210BD8C2291D78D00572163 = { <nl> + CreatedOnToolsVersion = 10 . 1 ; <nl> + } ; <nl> + } ; <nl> + } ; <nl> + buildConfigurationList = B210BD882291D78D00572163 / * Build configuration list for PBXProject " TestApp " * / ; <nl> + compatibilityVersion = " Xcode 9 . 3 " ; <nl> + developmentRegion = en ; <nl> + hasScannedForEncodings = 0 ; <nl> + knownRegions = ( <nl> + en , <nl> + Base , <nl> + ) ; <nl> + mainGroup = B210BD842291D78D00572163 ; <nl> + productRefGroup = B210BD8E2291D78D00572163 / * Products * / ; <nl> + projectDirPath = " " ; <nl> + projectRoot = " " ; <nl> + targets = ( <nl> + B210BD8C2291D78D00572163 / * TestApp * / , <nl> + ) ; <nl> + } ; <nl> + / * End PBXProject section * / <nl> + <nl> + / * Begin PBXResourcesBuildPhase section * / <nl> + B210BD8B2291D78D00572163 / * Resources * / = { <nl> + isa = PBXResourcesBuildPhase ; <nl> + buildActionMask = 2147483647 ; <nl> + files = ( <nl> + B210BD9D2291D78F00572163 / * LaunchScreen . storyboard in Resources * / , <nl> + B20F5F3622937C9000A4FBD8 / * add_quantized . bin in Resources * / , <nl> + B20F5F3722937C9000A4FBD8 / * add . bin in Resources * / , <nl> + B210BD9A2291D78E00572163 / * Assets . xcassets in Resources * / , <nl> + B210BD982291D78D00572163 / * Main . storyboard in Resources * / , <nl> + B20F5F3822937C9000A4FBD8 / * multi_add . bin in Resources * / , <nl> + ) ; <nl> + runOnlyForDeploymentPostprocessing = 0 ; <nl> + } ; <nl> + / * End PBXResourcesBuildPhase section * / <nl> + <nl> + / * Begin PBXSourcesBuildPhase section * / <nl> + B210BD892291D78D00572163 / * Sources * / = { <nl> + isa = PBXSourcesBuildPhase ; <nl> + buildActionMask = 2147483647 ; <nl> + files = ( <nl> + B210BD952291D78D00572163 / * ViewController . m in Sources * / , <nl> + B210BDA02291D78F00572163 / * main . m in Sources * / , <nl> + B210BD922291D78D00572163 / * AppDelegate . m in Sources * / , <nl> + ) ; <nl> + runOnlyForDeploymentPostprocessing = 0 ; <nl> + } ; <nl> + / * End PBXSourcesBuildPhase section * / <nl> + <nl> + / * Begin PBXVariantGroup section * / <nl> + B210BD962291D78D00572163 / * Main . storyboard * / = { <nl> + isa = PBXVariantGroup ; <nl> + children = ( <nl> + B210BD972291D78D00572163 / * Base * / , <nl> + ) ; <nl> + name = Main . storyboard ; <nl> + sourceTree = " < group > " ; <nl> + } ; <nl> + B210BD9B2291D78F00572163 / * LaunchScreen . storyboard * / = { <nl> + isa = PBXVariantGroup ; <nl> + children = ( <nl> + B210BD9C2291D78F00572163 / * Base * / , <nl> + ) ; <nl> + name = LaunchScreen . storyboard ; <nl> + sourceTree = " < group > " ; <nl> + } ; <nl> + / * End PBXVariantGroup section * / <nl> + <nl> + / * Begin XCBuildConfiguration section * / <nl> + B210BDA12291D78F00572163 / * Debug * / = { <nl> + isa = XCBuildConfiguration ; <nl> + buildSettings = { <nl> + ALWAYS_SEARCH_USER_PATHS = NO ; <nl> + CLANG_ANALYZER_NONNULL = YES ; <nl> + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE ; <nl> + CLANG_CXX_LANGUAGE_STANDARD = " gnu + + 14 " ; <nl> + CLANG_CXX_LIBRARY = " libc + + " ; <nl> + CLANG_ENABLE_MODULES = YES ; <nl> + CLANG_ENABLE_OBJC_ARC = YES ; <nl> + CLANG_ENABLE_OBJC_WEAK = YES ; <nl> + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES ; <nl> + CLANG_WARN_BOOL_CONVERSION = YES ; <nl> + CLANG_WARN_COMMA = YES ; <nl> + CLANG_WARN_CONSTANT_CONVERSION = YES ; <nl> + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES ; <nl> + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR ; <nl> + CLANG_WARN_DOCUMENTATION_COMMENTS = YES ; <nl> + CLANG_WARN_EMPTY_BODY = YES ; <nl> + CLANG_WARN_ENUM_CONVERSION = YES ; <nl> + CLANG_WARN_INFINITE_RECURSION = YES ; <nl> + CLANG_WARN_INT_CONVERSION = YES ; <nl> + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES ; <nl> + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES ; <nl> + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES ; <nl> + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR ; <nl> + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES ; <nl> + CLANG_WARN_STRICT_PROTOTYPES = YES ; <nl> + CLANG_WARN_SUSPICIOUS_MOVE = YES ; <nl> + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE ; <nl> + CLANG_WARN_UNREACHABLE_CODE = YES ; <nl> + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES ; <nl> + CODE_SIGN_IDENTITY = " iPhone Developer " ; <nl> + COPY_PHASE_STRIP = NO ; <nl> + DEBUG_INFORMATION_FORMAT = dwarf ; <nl> + ENABLE_STRICT_OBJC_MSGSEND = YES ; <nl> + ENABLE_TESTABILITY = YES ; <nl> + GCC_C_LANGUAGE_STANDARD = gnu11 ; <nl> + GCC_DYNAMIC_NO_PIC = NO ; <nl> + GCC_NO_COMMON_BLOCKS = YES ; <nl> + GCC_OPTIMIZATION_LEVEL = 0 ; <nl> + GCC_PREPROCESSOR_DEFINITIONS = ( <nl> + " DEBUG = 1 " , <nl> + " $ ( inherited ) " , <nl> + ) ; <nl> + GCC_WARN_64_TO_32_BIT_CONVERSION = YES ; <nl> + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR ; <nl> + GCC_WARN_UNDECLARED_SELECTOR = YES ; <nl> + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE ; <nl> + GCC_WARN_UNUSED_FUNCTION = YES ; <nl> + GCC_WARN_UNUSED_VARIABLE = YES ; <nl> + IPHONEOS_DEPLOYMENT_TARGET = 12 . 1 ; <nl> + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE ; <nl> + MTL_FAST_MATH = YES ; <nl> + ONLY_ACTIVE_ARCH = YES ; <nl> + SDKROOT = iphoneos ; <nl> + } ; <nl> + name = Debug ; <nl> + } ; <nl> + B210BDA22291D78F00572163 / * Release * / = { <nl> + isa = XCBuildConfiguration ; <nl> + buildSettings = { <nl> + ALWAYS_SEARCH_USER_PATHS = NO ; <nl> + CLANG_ANALYZER_NONNULL = YES ; <nl> + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE ; <nl> + CLANG_CXX_LANGUAGE_STANDARD = " gnu + + 14 " ; <nl> + CLANG_CXX_LIBRARY = " libc + + " ; <nl> + CLANG_ENABLE_MODULES = YES ; <nl> + CLANG_ENABLE_OBJC_ARC = YES ; <nl> + CLANG_ENABLE_OBJC_WEAK = YES ; <nl> + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES ; <nl> + CLANG_WARN_BOOL_CONVERSION = YES ; <nl> + CLANG_WARN_COMMA = YES ; <nl> + CLANG_WARN_CONSTANT_CONVERSION = YES ; <nl> + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES ; <nl> + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR ; <nl> + CLANG_WARN_DOCUMENTATION_COMMENTS = YES ; <nl> + CLANG_WARN_EMPTY_BODY = YES ; <nl> + CLANG_WARN_ENUM_CONVERSION = YES ; <nl> + CLANG_WARN_INFINITE_RECURSION = YES ; <nl> + CLANG_WARN_INT_CONVERSION = YES ; <nl> + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES ; <nl> + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES ; <nl> + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES ; <nl> + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR ; <nl> + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES ; <nl> + CLANG_WARN_STRICT_PROTOTYPES = YES ; <nl> + CLANG_WARN_SUSPICIOUS_MOVE = YES ; <nl> + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE ; <nl> + CLANG_WARN_UNREACHABLE_CODE = YES ; <nl> + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES ; <nl> + CODE_SIGN_IDENTITY = " iPhone Developer " ; <nl> + COPY_PHASE_STRIP = NO ; <nl> + DEBUG_INFORMATION_FORMAT = " dwarf - with - dsym " ; <nl> + ENABLE_NS_ASSERTIONS = NO ; <nl> + ENABLE_STRICT_OBJC_MSGSEND = YES ; <nl> + GCC_C_LANGUAGE_STANDARD = gnu11 ; <nl> + GCC_NO_COMMON_BLOCKS = YES ; <nl> + GCC_WARN_64_TO_32_BIT_CONVERSION = YES ; <nl> + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR ; <nl> + GCC_WARN_UNDECLARED_SELECTOR = YES ; <nl> + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE ; <nl> + GCC_WARN_UNUSED_FUNCTION = YES ; <nl> + GCC_WARN_UNUSED_VARIABLE = YES ; <nl> + IPHONEOS_DEPLOYMENT_TARGET = 12 . 1 ; <nl> + MTL_ENABLE_DEBUG_INFO = NO ; <nl> + MTL_FAST_MATH = YES ; <nl> + SDKROOT = iphoneos ; <nl> + VALIDATE_PRODUCT = YES ; <nl> + } ; <nl> + name = Release ; <nl> + } ; <nl> + B210BDA42291D78F00572163 / * Debug * / = { <nl> + isa = XCBuildConfiguration ; <nl> + buildSettings = { <nl> + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon ; <nl> + CODE_SIGN_STYLE = Automatic ; <nl> + INFOPLIST_FILE = TestApp / Info . plist ; <nl> + LD_RUNPATH_SEARCH_PATHS = ( <nl> + " $ ( inherited ) " , <nl> + " @ executable_path / Frameworks " , <nl> + ) ; <nl> + PRODUCT_BUNDLE_IDENTIFIER = com . tensorflow . lite . objc . TestApp ; <nl> + PRODUCT_NAME = " $ ( TARGET_NAME ) " ; <nl> + TARGETED_DEVICE_FAMILY = " 1 , 2 " ; <nl> + } ; <nl> + name = Debug ; <nl> + } ; <nl> + B210BDA52291D78F00572163 / * Release * / = { <nl> + isa = XCBuildConfiguration ; <nl> + buildSettings = { <nl> + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon ; <nl> + CODE_SIGN_STYLE = Automatic ; <nl> + INFOPLIST_FILE = TestApp / Info . plist ; <nl> + LD_RUNPATH_SEARCH_PATHS = ( <nl> + " $ ( inherited ) " , <nl> + " @ executable_path / Frameworks " , <nl> + ) ; <nl> + PRODUCT_BUNDLE_IDENTIFIER = com . tensorflow . lite . objc . TestApp ; <nl> + PRODUCT_NAME = " $ ( TARGET_NAME ) " ; <nl> + TARGETED_DEVICE_FAMILY = " 1 , 2 " ; <nl> + } ; <nl> + name = Release ; <nl> + } ; <nl> + / * End XCBuildConfiguration section * / <nl> + <nl> + / * Begin XCConfigurationList section * / <nl> + B210BD882291D78D00572163 / * Build configuration list for PBXProject " TestApp " * / = { <nl> + isa = XCConfigurationList ; <nl> + buildConfigurations = ( <nl> + B210BDA12291D78F00572163 / * Debug * / , <nl> + B210BDA22291D78F00572163 / * Release * / , <nl> + ) ; <nl> + defaultConfigurationIsVisible = 0 ; <nl> + defaultConfigurationName = Release ; <nl> + } ; <nl> + B210BDA32291D78F00572163 / * Build configuration list for PBXNativeTarget " TestApp " * / = { <nl> + isa = XCConfigurationList ; <nl> + buildConfigurations = ( <nl> + B210BDA42291D78F00572163 / * Debug * / , <nl> + B210BDA52291D78F00572163 / * Release * / , <nl> + ) ; <nl> + defaultConfigurationIsVisible = 0 ; <nl> + defaultConfigurationName = Release ; <nl> + } ; <nl> + / * End XCConfigurationList section * / <nl> + } ; <nl> + rootObject = B210BD852291D78D00572163 / * Project object * / ; <nl> + } <nl> new file mode 100644 <nl> index 0000000000000 . . a8442869d47ef <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / objc / apps / TestApp / TestApp / AppDelegate . h <nl> <nl> + / / Copyright 2019 Google Inc . All rights reserved . <nl> + / / <nl> + / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + / / you may not use this file except in compliance with the License . <nl> + / / You may obtain a copy of the License at : <nl> + / / <nl> + / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + / / <nl> + / / Unless required by applicable law or agreed to in writing , software <nl> + / / distributed under the License is distributed on an " AS IS " BASIS , <nl> + / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + / / See the License for the specific language governing permissions and <nl> + / / limitations under the License . <nl> + <nl> + # import < UIKit / UIKit . h > <nl> + <nl> + NS_ASSUME_NONNULL_BEGIN <nl> + <nl> + @ interface AppDelegate : UIResponder < UIApplicationDelegate > <nl> + <nl> + @ property ( nonatomic ) UIWindow * window ; <nl> + <nl> + @ end <nl> + <nl> + NS_ASSUME_NONNULL_END <nl> new file mode 100644 <nl> index 0000000000000 . . 06bb8d9b61089 <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / objc / apps / TestApp / TestApp / AppDelegate . m <nl> <nl> + / / Copyright 2019 Google Inc . All rights reserved . <nl> + / / <nl> + / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + / / you may not use this file except in compliance with the License . <nl> + / / You may obtain a copy of the License at : <nl> + / / <nl> + / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + / / <nl> + / / Unless required by applicable law or agreed to in writing , software <nl> + / / distributed under the License is distributed on an " AS IS " BASIS , <nl> + / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + / / See the License for the specific language governing permissions and <nl> + / / limitations under the License . <nl> + <nl> + # import " AppDelegate . h " <nl> + <nl> + NS_ASSUME_NONNULL_BEGIN <nl> + <nl> + @ implementation AppDelegate <nl> + @ end <nl> + <nl> + NS_ASSUME_NONNULL_END <nl> new file mode 100644 <nl> index 0000000000000 . . d8db8d65fd79f <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / objc / apps / TestApp / TestApp / Assets . xcassets / AppIcon . appiconset / Contents . json <nl> <nl> + { <nl> + " images " : [ <nl> + { <nl> + " idiom " : " iphone " , <nl> + " size " : " 20x20 " , <nl> + " scale " : " 2x " <nl> + } , <nl> + { <nl> + " idiom " : " iphone " , <nl> + " size " : " 20x20 " , <nl> + " scale " : " 3x " <nl> + } , <nl> + { <nl> + " idiom " : " iphone " , <nl> + " size " : " 29x29 " , <nl> + " scale " : " 2x " <nl> + } , <nl> + { <nl> + " idiom " : " iphone " , <nl> + " size " : " 29x29 " , <nl> + " scale " : " 3x " <nl> + } , <nl> + { <nl> + " idiom " : " iphone " , <nl> + " size " : " 40x40 " , <nl> + " scale " : " 2x " <nl> + } , <nl> + { <nl> + " idiom " : " iphone " , <nl> + " size " : " 40x40 " , <nl> + " scale " : " 3x " <nl> + } , <nl> + { <nl> + " idiom " : " iphone " , <nl> + " size " : " 60x60 " , <nl> + " scale " : " 2x " <nl> + } , <nl> + { <nl> + " idiom " : " iphone " , <nl> + " size " : " 60x60 " , <nl> + " scale " : " 3x " <nl> + } , <nl> + { <nl> + " idiom " : " ipad " , <nl> + " size " : " 20x20 " , <nl> + " scale " : " 1x " <nl> + } , <nl> + { <nl> + " idiom " : " ipad " , <nl> + " size " : " 20x20 " , <nl> + " scale " : " 2x " <nl> + } , <nl> + { <nl> + " idiom " : " ipad " , <nl> + " size " : " 29x29 " , <nl> + " scale " : " 1x " <nl> + } , <nl> + { <nl> + " idiom " : " ipad " , <nl> + " size " : " 29x29 " , <nl> + " scale " : " 2x " <nl> + } , <nl> + { <nl> + " idiom " : " ipad " , <nl> + " size " : " 40x40 " , <nl> + " scale " : " 1x " <nl> + } , <nl> + { <nl> + " idiom " : " ipad " , <nl> + " size " : " 40x40 " , <nl> + " scale " : " 2x " <nl> + } , <nl> + { <nl> + " idiom " : " ipad " , <nl> + " size " : " 76x76 " , <nl> + " scale " : " 1x " <nl> + } , <nl> + { <nl> + " idiom " : " ipad " , <nl> + " size " : " 76x76 " , <nl> + " scale " : " 2x " <nl> + } , <nl> + { <nl> + " idiom " : " ipad " , <nl> + " size " : " 83 . 5x83 . 5 " , <nl> + " scale " : " 2x " <nl> + } , <nl> + { <nl> + " idiom " : " ios - marketing " , <nl> + " size " : " 1024x1024 " , <nl> + " scale " : " 1x " <nl> + } <nl> + ] , <nl> + " info " : { <nl> + " version " : 1 , <nl> + " author " : " xcode " <nl> + } <nl> + } <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 0000000000000 . . da4a164c91865 <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / objc / apps / TestApp / TestApp / Assets . xcassets / Contents . json <nl> <nl> + { <nl> + " info " : { <nl> + " version " : 1 , <nl> + " author " : " xcode " <nl> + } <nl> + } <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 0000000000000 . . 6c97d768e15ad <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / objc / apps / TestApp / TestApp / Base . lproj / LaunchScreen . storyboard <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < document type = " com . apple . InterfaceBuilder3 . CocoaTouch . Storyboard . XIB " version = " 3 . 0 " toolsVersion = " 14460 . 31 " targetRuntime = " iOS . CocoaTouch " propertyAccessControl = " none " useAutolayout = " YES " launchScreen = " YES " useTraitCollections = " YES " colorMatched = " YES " initialViewController = " 01J - lp - oVM " > <nl> + < device id = " retina4_7 " orientation = " portrait " > <nl> + < adaptation id = " fullscreen " / > <nl> + < / device > <nl> + < dependencies > <nl> + < deployment identifier = " iOS " / > <nl> + < plugIn identifier = " com . apple . InterfaceBuilder . IBCocoaTouchPlugin " version = " 14460 . 20 " / > <nl> + < capability name = " documents saved in the Xcode 8 format " minToolsVersion = " 8 . 0 " / > <nl> + < / dependencies > <nl> + < scenes > <nl> + < ! - - View Controller - - > <nl> + < scene sceneID = " EHf - IW - A2E " > <nl> + < objects > <nl> + < viewController id = " 01J - lp - oVM " sceneMemberID = " viewController " > <nl> + < layoutGuides > <nl> + < viewControllerLayoutGuide type = " top " id = " Y0Z - 8F - bB8 " / > <nl> + < viewControllerLayoutGuide type = " bottom " id = " TqJ - Hq - gHs " / > <nl> + < / layoutGuides > <nl> + < view key = " view " contentMode = " scaleToFill " id = " Ze5 - 6b - 2t3 " > <nl> + < rect key = " frame " x = " 0 . 0 " y = " 0 . 0 " width = " 375 " height = " 667 " / > <nl> + < autoresizingMask key = " autoresizingMask " widthSizable = " YES " heightSizable = " YES " / > <nl> + < subviews > <nl> + < label opaque = " NO " userInteractionEnabled = " NO " contentMode = " left " horizontalHuggingPriority = " 251 " verticalHuggingPriority = " 251 " text = " TensorFlow Lite Test " textAlignment = " center " lineBreakMode = " tailTruncation " baselineAdjustment = " alignBaselines " minimumScaleFactor = " 0 . 25 " translatesAutoresizingMaskIntoConstraints = " NO " id = " zIC - MS - HeK " > <nl> + < rect key = " frame " x = " 16 " y = " 314 " width = " 343 " height = " 39 " / > <nl> + < fontDescription key = " fontDescription " type = " boldSystem " pointSize = " 32 " / > <nl> + < color key = " textColor " red = " 1 " green = " 0 . 50329624702372611 " blue = " 0 . 013296667412401542 " alpha = " 0 . 84705882352941175 " colorSpace = " custom " customColorSpace = " displayP3 " / > <nl> + < nil key = " highlightedColor " / > <nl> + < / label > <nl> + < / subviews > <nl> + < color key = " backgroundColor " red = " 1 " green = " 1 " blue = " 1 " alpha = " 1 " colorSpace = " custom " customColorSpace = " sRGB " / > <nl> + < constraints > <nl> + < constraint firstAttribute = " trailing " secondItem = " zIC - MS - HeK " secondAttribute = " trailing " constant = " 16 " id = " 1Wp - jb - ol6 " / > <nl> + < constraint firstItem = " zIC - MS - HeK " firstAttribute = " centerY " secondItem = " Ze5 - 6b - 2t3 " secondAttribute = " centerY " id = " R2T - Hp - TBa " / > <nl> + < constraint firstItem = " zIC - MS - HeK " firstAttribute = " leading " secondItem = " Ze5 - 6b - 2t3 " secondAttribute = " leading " constant = " 16 " id = " alE - O6 - WL6 " / > <nl> + < / constraints > <nl> + < / view > <nl> + < / viewController > <nl> + < placeholder placeholderIdentifier = " IBFirstResponder " id = " iYj - Kq - Ea1 " userLabel = " First Responder " sceneMemberID = " firstResponder " / > <nl> + < / objects > <nl> + < point key = " canvasLocation " x = " 52 " y = " 374 . 66266866566718 " / > <nl> + < / scene > <nl> + < / scenes > <nl> + < / document > <nl> new file mode 100644 <nl> index 0000000000000 . . 602ef636aa9c8 <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / objc / apps / TestApp / TestApp / Base . lproj / Main . storyboard <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < document type = " com . apple . InterfaceBuilder3 . CocoaTouch . Storyboard . XIB " version = " 3 . 0 " toolsVersion = " 14460 . 31 " targetRuntime = " iOS . CocoaTouch " propertyAccessControl = " none " useAutolayout = " YES " useTraitCollections = " YES " colorMatched = " YES " initialViewController = " BYZ - 38 - t0r " > <nl> + < device id = " retina4_7 " orientation = " portrait " > <nl> + < adaptation id = " fullscreen " / > <nl> + < / device > <nl> + < dependencies > <nl> + < deployment version = " 2304 " identifier = " iOS " / > <nl> + < plugIn identifier = " com . apple . InterfaceBuilder . IBCocoaTouchPlugin " version = " 14460 . 20 " / > <nl> + < capability name = " documents saved in the Xcode 8 format " minToolsVersion = " 8 . 0 " / > <nl> + < / dependencies > <nl> + < scenes > <nl> + < ! - - View Controller - - > <nl> + < scene sceneID = " tne - QT - ifu " > <nl> + < objects > <nl> + < viewController id = " BYZ - 38 - t0r " customClass = " ViewController " sceneMemberID = " viewController " > <nl> + < layoutGuides > <nl> + < viewControllerLayoutGuide type = " top " id = " 5Qd - iD - SiH " / > <nl> + < viewControllerLayoutGuide type = " bottom " id = " zTS - de - uge " / > <nl> + < / layoutGuides > <nl> + < view key = " view " contentMode = " scaleToFill " id = " 8bC - Xf - vdC " > <nl> + < rect key = " frame " x = " 0 . 0 " y = " 0 . 0 " width = " 375 " height = " 667 " / > <nl> + < autoresizingMask key = " autoresizingMask " widthSizable = " YES " heightSizable = " YES " / > <nl> + < subviews > <nl> + < toolbar opaque = " NO " clearsContextBeforeDrawing = " NO " contentMode = " scaleToFill " translatesAutoresizingMaskIntoConstraints = " NO " id = " ahi - i4 - 2FP " userLabel = " Top Model Toolbar " > <nl> + < rect key = " frame " x = " 0 . 0 " y = " 34 " width = " 375 " height = " 44 " / > <nl> + < constraints > <nl> + < constraint firstAttribute = " height " constant = " 44 " id = " nwy - nk - 0wZ " / > <nl> + < / constraints > <nl> + < items > <nl> + < barButtonItem style = " plain " id = " Ywd - KS - s96 " > <nl> + < segmentedControl key = " customView " opaque = " NO " contentMode = " scaleToFill " contentHorizontalAlignment = " left " contentVerticalAlignment = " top " segmentControlStyle = " bar " selectedSegmentIndex = " 0 " id = " 8kc - 88 - CHj " userLabel = " Model Control " > <nl> + < rect key = " frame " x = " 16 " y = " 7 . 5 " width = " 343 " height = " 29 " / > <nl> + < autoresizingMask key = " autoresizingMask " flexibleMaxX = " YES " flexibleMaxY = " YES " / > <nl> + < segments > <nl> + < segment title = " Add " / > <nl> + < segment title = " AddQuantized " / > <nl> + < segment title = " MultiAdd " / > <nl> + < / segments > <nl> + < connections > <nl> + < action selector = " modelChanged : " destination = " BYZ - 38 - t0r " eventType = " valueChanged " id = " z13 - 8K - EwC " / > <nl> + < / connections > <nl> + < / segmentedControl > <nl> + < / barButtonItem > <nl> + < / items > <nl> + < / toolbar > <nl> + < toolbar opaque = " NO " clearsContextBeforeDrawing = " NO " contentMode = " scaleToFill " translatesAutoresizingMaskIntoConstraints = " NO " id = " UWb - 3E - O5r " userLabel = " Bottom Invoke Toolbar " > <nl> + < rect key = " frame " x = " 0 . 0 " y = " 140 " width = " 375 " height = " 44 " / > <nl> + < items > <nl> + < barButtonItem title = " Invoke Interpreter " width = " 374 " id = " He4 - 7G - biW " > <nl> + < connections > <nl> + < action selector = " invokeInterpreter : " destination = " BYZ - 38 - t0r " id = " Ycs - E9 - Vul " / > <nl> + < / connections > <nl> + < / barButtonItem > <nl> + < / items > <nl> + < / toolbar > <nl> + < textView clipsSubviews = " YES " multipleTouchEnabled = " YES " contentMode = " scaleToFill " misplaced = " YES " editable = " NO " adjustsFontForContentSizeCategory = " YES " selectable = " NO " translatesAutoresizingMaskIntoConstraints = " NO " id = " 7Ws - 3t - 76I " > <nl> + < rect key = " frame " x = " 0 . 0 " y = " 194 " width = " 375 " height = " 488 " / > <nl> + < color key = " backgroundColor " red = " 0 . 12820077356385221 " green = " 0 . 40366933178860925 " blue = " 0 . 96080166101455688 " alpha = " 1 " colorSpace = " custom " customColorSpace = " displayP3 " / > <nl> + < color key = " textColor " cocoaTouchSystemColor = " tableCellGroupedBackgroundColor " / > <nl> + < fontDescription key = " fontDescription " type = " system " pointSize = " 14 " / > <nl> + < textInputTraits key = " textInputTraits " autocapitalizationType = " sentences " / > <nl> + < / textView > <nl> + < / subviews > <nl> + < color key = " backgroundColor " red = " 1 " green = " 1 " blue = " 1 " alpha = " 1 " colorSpace = " custom " customColorSpace = " sRGB " / > <nl> + < constraints > <nl> + < constraint firstItem = " ahi - i4 - 2FP " firstAttribute = " top " secondItem = " 5Qd - iD - SiH " secondAttribute = " bottom " constant = " 14 " id = " 0V2 - 16 - 9cM " / > <nl> + < constraint firstAttribute = " trailing " secondItem = " ahi - i4 - 2FP " secondAttribute = " trailing " id = " 1D2 - FC - OQ0 " / > <nl> + < constraint firstItem = " UWb - 3E - O5r " firstAttribute = " leading " secondItem = " 8bC - Xf - vdC " secondAttribute = " leading " id = " 1To - 8n - Knb " / > <nl> + < constraint firstItem = " 7Ws - 3t - 76I " firstAttribute = " leading " secondItem = " 8bC - Xf - vdC " secondAttribute = " leading " id = " 3Et - px - WCV " / > <nl> + < constraint firstItem = " zTS - de - uge " firstAttribute = " top " secondItem = " 7Ws - 3t - 76I " secondAttribute = " bottom " id = " Lkb - XF - ldX " / > <nl> + < constraint firstItem = " 7Ws - 3t - 76I " firstAttribute = " top " secondItem = " UWb - 3E - O5r " secondAttribute = " bottom " id = " bXr - pF - Ld2 " / > <nl> + < constraint firstItem = " ahi - i4 - 2FP " firstAttribute = " leading " secondItem = " 8bC - Xf - vdC " secondAttribute = " leading " id = " c98 - HO - 3m5 " / > <nl> + < constraint firstAttribute = " trailing " secondItem = " UWb - 3E - O5r " secondAttribute = " trailing " id = " oJz - hf - dJa " / > <nl> + < constraint firstAttribute = " trailing " secondItem = " 7Ws - 3t - 76I " secondAttribute = " trailing " id = " oyy - C7 - mUJ " / > <nl> + < constraint firstItem = " UWb - 3E - O5r " firstAttribute = " top " secondItem = " ahi - i4 - 2FP " secondAttribute = " bottom " constant = " 62 " id = " uFg - MF - aJz " / > <nl> + < / constraints > <nl> + < / view > <nl> + < connections > <nl> + < outlet property = " invokeButton " destination = " He4 - 7G - biW " id = " kpj - CS - Fss " / > <nl> + < outlet property = " modelControl " destination = " 8kc - 88 - CHj " id = " GTB - WG - ozW " / > <nl> + < outlet property = " resultsTextView " destination = " 7Ws - 3t - 76I " id = " fnd - i5 - Pdh " / > <nl> + < / connections > <nl> + < / viewController > <nl> + < placeholder placeholderIdentifier = " IBFirstResponder " id = " dkx - z0 - nzr " sceneMemberID = " firstResponder " / > <nl> + < / objects > <nl> + < point key = " canvasLocation " x = " 136 . 80000000000001 " y = " 132 . 68365817091455 " / > <nl> + < / scene > <nl> + < / scenes > <nl> + < / document > <nl> new file mode 100644 <nl> index 0000000000000 . . b16c1e9fb58f0 <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / objc / apps / TestApp / TestApp / Info . plist <nl> <nl> + < ? xml version = " 1 . 0 " encoding = " UTF - 8 " ? > <nl> + < ! DOCTYPE plist PUBLIC " - / / Apple / / DTD PLIST 1 . 0 / / EN " " http : / / www . apple . com / DTDs / PropertyList - 1 . 0 . dtd " > <nl> + < plist version = " 1 . 0 " > <nl> + < dict > <nl> + < key > CFBundleDevelopmentRegion < / key > <nl> + < string > en < / string > <nl> + < key > CFBundleExecutable < / key > <nl> + < string > $ ( EXECUTABLE_NAME ) < / string > <nl> + < key > CFBundleIdentifier < / key > <nl> + < string > $ ( PRODUCT_BUNDLE_IDENTIFIER ) < / string > <nl> + < key > CFBundleInfoDictionaryVersion < / key > <nl> + < string > 6 . 0 < / string > <nl> + < key > CFBundleName < / key > <nl> + < string > $ ( PRODUCT_NAME ) < / string > <nl> + < key > CFBundlePackageType < / key > <nl> + < string > APPL < / string > <nl> + < key > CFBundleShortVersionString < / key > <nl> + < string > 1 . 0 < / string > <nl> + < key > CFBundleVersion < / key > <nl> + < string > 0 . 0 . 1 < / string > <nl> + < key > LSRequiresIPhoneOS < / key > <nl> + < true / > <nl> + < key > UILaunchStoryboardName < / key > <nl> + < string > LaunchScreen < / string > <nl> + < key > UIMainStoryboardFile < / key > <nl> + < string > Main < / string > <nl> + < key > UIRequiredDeviceCapabilities < / key > <nl> + < array > <nl> + < string > armv7 < / string > <nl> + < / array > <nl> + < key > UISupportedInterfaceOrientations < / key > <nl> + < array > <nl> + < string > UIInterfaceOrientationPortrait < / string > <nl> + < string > UIInterfaceOrientationPortraitUpsideDown < / string > <nl> + < / array > <nl> + < key > UISupportedInterfaceOrientations ~ ipad < / key > <nl> + < array > <nl> + < string > UIInterfaceOrientationPortrait < / string > <nl> + < string > UIInterfaceOrientationPortraitUpsideDown < / string > <nl> + < / array > <nl> + < / dict > <nl> + < / plist > <nl> new file mode 100644 <nl> index 0000000000000 . . 797c964dd4ea6 <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / objc / apps / TestApp / TestApp / ViewController . h <nl> <nl> + / / Copyright 2019 Google Inc . All rights reserved . <nl> + / / <nl> + / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + / / you may not use this file except in compliance with the License . <nl> + / / You may obtain a copy of the License at : <nl> + / / <nl> + / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + / / <nl> + / / Unless required by applicable law or agreed to in writing , software <nl> + / / distributed under the License is distributed on an " AS IS " BASIS , <nl> + / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + / / See the License for the specific language governing permissions and <nl> + / / limitations under the License . <nl> + <nl> + # import < UIKit / UIKit . h > <nl> + <nl> + NS_ASSUME_NONNULL_BEGIN <nl> + <nl> + @ interface ViewController : UIViewController <nl> + @ end <nl> + <nl> + NS_ASSUME_NONNULL_END <nl> new file mode 100644 <nl> index 0000000000000 . . 2b805f0d1be96 <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / objc / apps / TestApp / TestApp / ViewController . m <nl> <nl> + / / Copyright 2019 Google Inc . All rights reserved . <nl> + / / <nl> + / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + / / you may not use this file except in compliance with the License . <nl> + / / You may obtain a copy of the License at : <nl> + / / <nl> + / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + / / <nl> + / / Unless required by applicable law or agreed to in writing , software <nl> + / / distributed under the License is distributed on an " AS IS " BASIS , <nl> + / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + / / See the License for the specific language governing permissions and <nl> + / / limitations under the License . <nl> + <nl> + # import " ViewController . h " <nl> + <nl> + # import " TFLTensorFlowLite . h " <nl> + <nl> + NS_ASSUME_NONNULL_BEGIN <nl> + <nl> + / * * <nl> + * Safely dispatches the given ` block ` on the main thread . If already on the main thread , the given <nl> + * block is executed immediately ; otherwise , dispatches the block asynchronously on the main thread . <nl> + * <nl> + * @ param block The block to dispatch on the main thread . <nl> + * / <nl> + void TLTSafeDispatchOnMain ( dispatch_block_t block ) { <nl> + if ( block = = nil ) return ; <nl> + if ( NSThread . isMainThread ) { <nl> + block ( ) ; <nl> + } else { <nl> + dispatch_async ( dispatch_get_main_queue ( ) , block ) ; <nl> + } <nl> + } <nl> + <nl> + / * * <nl> + * Name of a float model that performs two add operations on one input tensor and returns the result <nl> + * in one output tensor . <nl> + * / <nl> + static NSString * const kModelNameAdd = @ " add " ; <nl> + <nl> + / * * <nl> + * Name of a quantized model that performs two add operations on one input tensor and returns the <nl> + * result in one output tensor . <nl> + * / <nl> + static NSString * const kModelNameAddQuantized = @ " add_quantized " ; <nl> + <nl> + / * * <nl> + * Name of a float model that performs three add operations on four input tensors and returns the <nl> + * results in 2 output tensors . <nl> + * / <nl> + static NSString * const kModelNameMultiAdd = @ " multi_add " ; <nl> + <nl> + / * * Model resource type . * / <nl> + static NSString * const kModelType = @ " bin " ; <nl> + <nl> + / * * The label for the serial queue for synchronizing interpreter calls . * / <nl> + static const char * kInterpreterSerialQueueLabel = " com . tensorflow . lite . objc . testapp . interpreter " ; <nl> + <nl> + static NSString * const kNilInterpreterError = <nl> + @ " Failed to invoke the interpreter because the interpreter was nil . " ; <nl> + static NSString * const kInvokeInterpreterError = @ " Failed to invoke interpreter due to error : % @ . " ; <nl> + <nl> + / * * Model paths . * / <nl> + static NSArray * gModelPaths ; <nl> + <nl> + @ interface ViewController ( ) <nl> + <nl> + / * * Serial queue for synchronizing interpreter calls . * / <nl> + @ property ( nonatomic ) dispatch_queue_t interpreterSerialQueue ; <nl> + <nl> + / * * TensorFlow Lite interpreter for the currently selected model . * / <nl> + @ property ( nonatomic ) TFLInterpreter * interpreter ; <nl> + <nl> + @ property ( weak , nonatomic ) IBOutlet UISegmentedControl * modelControl ; <nl> + @ property ( weak , nonatomic ) IBOutlet UIBarButtonItem * invokeButton ; <nl> + @ property ( weak , nonatomic ) IBOutlet UITextView * resultsTextView ; <nl> + <nl> + @ end <nl> + <nl> + @ implementation ViewController <nl> + <nl> + # pragma mark - NSObject <nl> + <nl> + + ( void ) initialize { <nl> + if ( self = = [ ViewController self ] ) { <nl> + gModelPaths = @ [ <nl> + [ NSBundle . mainBundle pathForResource : kModelNameAdd ofType : kModelType ] , <nl> + [ NSBundle . mainBundle pathForResource : kModelNameAddQuantized ofType : kModelType ] , <nl> + [ NSBundle . mainBundle pathForResource : kModelNameMultiAdd ofType : kModelType ] , <nl> + ] ; <nl> + } <nl> + } <nl> + <nl> + # pragma mark - UIViewController <nl> + <nl> + - ( void ) viewDidLoad { <nl> + [ super viewDidLoad ] ; <nl> + self . interpreterSerialQueue = <nl> + dispatch_queue_create ( kInterpreterSerialQueueLabel , DISPATCH_QUEUE_SERIAL ) ; <nl> + self . invokeButton . enabled = NO ; <nl> + [ self updateResultsText : [ NSString stringWithFormat : @ " Using TensorFlow Lite runtime version % @ . " , <nl> + TFLVersion ] ] ; <nl> + [ self loadModel ] ; <nl> + } <nl> + <nl> + # pragma mark - IBActions <nl> + <nl> + - ( IBAction ) modelChanged : ( id ) sender { <nl> + self . invokeButton . enabled = NO ; <nl> + NSString * results = [ NSString <nl> + stringWithFormat : @ " Switched to the % @ model . " , <nl> + [ self . modelControl <nl> + titleForSegmentAtIndex : self . modelControl . selectedSegmentIndex ] ] ; <nl> + [ self updateResultsText : results ] ; <nl> + [ self loadModel ] ; <nl> + } <nl> + <nl> + - ( IBAction ) invokeInterpreter : ( id ) sender { <nl> + switch ( self . modelControl . selectedSegmentIndex ) { <nl> + case 0 : <nl> + [ self invokeAdd ] ; <nl> + break ; <nl> + case 1 : <nl> + [ self invokeAddQuantized ] ; <nl> + break ; <nl> + case 2 : <nl> + [ self invokeMultiAdd ] ; <nl> + } <nl> + } <nl> + <nl> + # pragma mark - Private <nl> + <nl> + / * * Path of the currently selected model . * / <nl> + - ( nullable NSString * ) currentModelPath { <nl> + return self . modelControl . selectedSegmentIndex = = UISegmentedControlNoSegment <nl> + ? nil <nl> + : gModelPaths [ self . modelControl . selectedSegmentIndex ] ; <nl> + } <nl> + <nl> + - ( void ) loadModel { <nl> + NSString * modelPath = [ self currentModelPath ] ; <nl> + if ( modelPath . length = = 0 ) { <nl> + [ self updateResultsText : @ " No model is selected . " ] ; <nl> + return ; <nl> + } <nl> + <nl> + __weak typeof ( self ) weakSelf = self ; <nl> + dispatch_async ( self . interpreterSerialQueue , ^ { <nl> + TFLInterpreterOptions * options = [ [ TFLInterpreterOptions alloc ] init ] ; <nl> + options . numberOfThreads = 2 ; <nl> + <nl> + NSError * error ; <nl> + weakSelf . interpreter = [ [ TFLInterpreter alloc ] initWithModelPath : modelPath <nl> + options : options <nl> + error : & error ] ; <nl> + if ( weakSelf . interpreter = = nil | | error ! = nil ) { <nl> + NSString * results = <nl> + [ NSString stringWithFormat : @ " Failed to create the interpreter due to error : % @ " , <nl> + error . localizedDescription ] ; <nl> + [ weakSelf updateResultsText : results ] ; <nl> + } else { <nl> + TLTSafeDispatchOnMain ( ^ { <nl> + weakSelf . invokeButton . enabled = YES ; <nl> + } ) ; <nl> + } <nl> + } ) ; <nl> + } <nl> + <nl> + - ( void ) invokeAdd { <nl> + __weak typeof ( self ) weakSelf = self ; <nl> + dispatch_async ( self . interpreterSerialQueue , ^ { <nl> + if ( weakSelf . interpreter = = nil ) { <nl> + [ weakSelf updateResultsText : kNilInterpreterError ] ; <nl> + return ; <nl> + } <nl> + <nl> + NSArray < NSNumber * > * shape = @ [ @ 2 ] ; <nl> + NSError * error ; <nl> + <nl> + if ( ! [ weakSelf . interpreter resizeInputTensorAtIndex : 0 toShape : shape error : & error ] ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + if ( ! [ weakSelf . interpreter allocateTensorsWithError : & error ] ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + TFLTensor * inputTensor = [ weakSelf . interpreter inputTensorAtIndex : 0 error : & error ] ; <nl> + if ( inputTensor = = nil | | error ! = nil ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + NSMutableData * inputData = [ NSMutableData dataWithCapacity : 0 ] ; <nl> + float one = 1 . f ; <nl> + float three = 3 . f ; <nl> + [ inputData appendBytes : & one length : sizeof ( float ) ] ; <nl> + [ inputData appendBytes : & three length : sizeof ( float ) ] ; <nl> + if ( ! [ inputTensor copyData : inputData error : & error ] ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + if ( ! [ weakSelf . interpreter invokeWithError : & error ] ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + TFLTensor * outputTensor = [ weakSelf . interpreter outputTensorAtIndex : 0 error : & error ] ; <nl> + if ( outputTensor = = nil | | error ! = nil ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + NSData * outputData = [ outputTensor dataWithError : & error ] ; <nl> + if ( outputData = = nil | | error ! = nil ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + float output [ 2U ] ; <nl> + [ outputData getBytes : output length : ( sizeof ( float ) * 2U ) ] ; <nl> + <nl> + [ weakSelf <nl> + updateResultsText : [ NSString stringWithFormat : @ " Performing 2 add operations : \ n \ nInput = " <nl> + @ " [ % . 1f , % . 1f ] \ n \ nOutput = [ % . 1f , % . 1f ] " , <nl> + one , three , output [ 0 ] , output [ 1 ] ] ] ; <nl> + } ) ; <nl> + } <nl> + <nl> + - ( void ) invokeAddQuantized { <nl> + __weak typeof ( self ) weakSelf = self ; <nl> + dispatch_async ( self . interpreterSerialQueue , ^ { <nl> + if ( weakSelf . interpreter = = nil ) { <nl> + [ weakSelf updateResultsText : kNilInterpreterError ] ; <nl> + return ; <nl> + } <nl> + <nl> + NSArray < NSNumber * > * shape = @ [ @ 2 ] ; <nl> + NSError * error ; <nl> + <nl> + if ( ! [ weakSelf . interpreter resizeInputTensorAtIndex : 0 toShape : shape error : & error ] ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + if ( ! [ weakSelf . interpreter allocateTensorsWithError : & error ] ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + TFLTensor * inputTensor = [ weakSelf . interpreter inputTensorAtIndex : 0 error : & error ] ; <nl> + if ( inputTensor = = nil | | error ! = nil ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + NSMutableData * inputData = [ NSMutableData dataWithCapacity : 0 ] ; <nl> + uint8_t one = 1U ; <nl> + uint8_t three = 3U ; <nl> + [ inputData appendBytes : & one length : sizeof ( uint8_t ) ] ; <nl> + [ inputData appendBytes : & three length : sizeof ( uint8_t ) ] ; <nl> + if ( ! [ inputTensor copyData : inputData error : & error ] ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + if ( ! [ weakSelf . interpreter invokeWithError : & error ] ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + TFLTensor * outputTensor = [ weakSelf . interpreter outputTensorAtIndex : 0 error : & error ] ; <nl> + if ( outputTensor = = nil | | error ! = nil ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + TFLQuantizationParameters * params = outputTensor . quantizationParameters ; <nl> + if ( params = = nil ) { <nl> + [ weakSelf updateResultsText : <nl> + [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + @ " Missing qualitization parameters in the output " ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + NSData * outputData = [ outputTensor dataWithError : & error ] ; <nl> + if ( outputData = = nil | | error ! = nil ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + uint8_t output [ 2U ] ; <nl> + [ outputData getBytes : output length : ( sizeof ( uint8_t ) * 2U ) ] ; <nl> + float dequantized [ 2U ] ; <nl> + dequantized [ 0 ] = params . scale * ( output [ 0 ] - params . zeroPoint ) ; <nl> + dequantized [ 1 ] = params . scale * ( output [ 1 ] - params . zeroPoint ) ; <nl> + <nl> + [ weakSelf updateResultsText : <nl> + [ NSString stringWithFormat : @ " Performing 2 add operations on quantized input : \ n \ n " <nl> + @ " Input = [ % d , % d ] \ n \ nQuantized Output = [ % d , % d ] \ n \ n " <nl> + @ " Dequantized Output = [ % f , % f ] " , <nl> + one , three , output [ 0 ] , output [ 1 ] , dequantized [ 0 ] , <nl> + dequantized [ 1 ] ] ] ; <nl> + } ) ; <nl> + } <nl> + <nl> + - ( void ) invokeMultiAdd { <nl> + __weak typeof ( self ) weakSelf = self ; <nl> + dispatch_async ( self . interpreterSerialQueue , ^ { <nl> + if ( weakSelf . interpreter = = nil ) { <nl> + [ weakSelf updateResultsText : kNilInterpreterError ] ; <nl> + return ; <nl> + } <nl> + <nl> + NSArray < NSNumber * > * shape = @ [ @ 2 ] ; <nl> + NSError * error ; <nl> + <nl> + for ( int i = 0 ; i < weakSelf . interpreter . inputTensorCount ; + + i ) { <nl> + if ( ! [ weakSelf . interpreter resizeInputTensorAtIndex : i toShape : shape error : & error ] ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + } <nl> + <nl> + if ( ! [ weakSelf . interpreter allocateTensorsWithError : & error ] ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + NSString * inputs = @ " " ; <nl> + for ( int i = 0 ; i < weakSelf . interpreter . inputTensorCount ; + + i ) { <nl> + TFLTensor * inputTensor = [ weakSelf . interpreter inputTensorAtIndex : i error : & error ] ; <nl> + if ( inputTensor = = nil | | error ! = nil ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + NSMutableData * inputData = [ NSMutableData dataWithCapacity : 0 ] ; <nl> + float input1 = ( float ) ( i + 1 ) ; <nl> + float input2 = ( float ) ( i + 2 ) ; <nl> + inputs = [ NSString stringWithFormat : @ " % @ % @ [ % . 1f , % . 1f ] " , inputs , <nl> + ( inputs . length = = 0 ? @ " [ " : @ " , " ) , input1 , input2 ] ; <nl> + <nl> + [ inputData appendBytes : & input1 length : sizeof ( float ) ] ; <nl> + [ inputData appendBytes : & input2 length : sizeof ( float ) ] ; <nl> + if ( ! [ inputTensor copyData : inputData error : & error ] ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + } <nl> + inputs = [ NSString stringWithFormat : @ " % @ ] " , inputs ] ; <nl> + <nl> + if ( ! [ weakSelf . interpreter invokeWithError : & error ] ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + NSString * outputs = @ " " ; <nl> + for ( int i = 0 ; i < weakSelf . interpreter . outputTensorCount ; + + i ) { <nl> + TFLTensor * outputTensor = [ weakSelf . interpreter outputTensorAtIndex : i error : & error ] ; <nl> + if ( outputTensor = = nil | | error ! = nil ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + <nl> + NSData * outputData = [ outputTensor dataWithError : & error ] ; <nl> + if ( outputData = = nil | | error ! = nil ) { <nl> + [ weakSelf updateResultsText : [ NSString stringWithFormat : kInvokeInterpreterError , <nl> + error . localizedDescription ] ] ; <nl> + return ; <nl> + } <nl> + float output [ 2U ] ; <nl> + [ outputData getBytes : output length : ( sizeof ( float ) * 2U ) ] ; <nl> + outputs = <nl> + [ NSString stringWithFormat : @ " % @ % @ [ % . 1f , % . 1f ] " , outputs , <nl> + ( outputs . length = = 0 ? @ " [ " : @ " , " ) , output [ 0 ] , output [ 1 ] ] ; <nl> + } <nl> + outputs = [ NSString stringWithFormat : @ " % @ ] " , outputs ] ; <nl> + <nl> + [ weakSelf <nl> + updateResultsText : <nl> + [ NSString <nl> + stringWithFormat : @ " Performing 3 add operations : \ n \ nInputs = % @ \ n \ nOutputs = % @ " , <nl> + inputs , outputs ] ] ; <nl> + } ) ; <nl> + } <nl> + <nl> + - ( void ) updateResultsText : ( NSString * ) text { <nl> + __weak typeof ( self ) weakSelf = self ; <nl> + TLTSafeDispatchOnMain ( ^ { <nl> + weakSelf . resultsTextView . text = text ; <nl> + } ) ; <nl> + } <nl> + <nl> + @ end <nl> + <nl> + NS_ASSUME_NONNULL_END <nl> new file mode 100644 <nl> index 0000000000000 . . b7ab1325e1b82 <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / objc / apps / TestApp / TestApp / main . m <nl> <nl> + / / Copyright 2019 Google Inc . All rights reserved . <nl> + / / <nl> + / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + / / you may not use this file except in compliance with the License . <nl> + / / You may obtain a copy of the License at : <nl> + / / <nl> + / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + / / <nl> + / / Unless required by applicable law or agreed to in writing , software <nl> + / / distributed under the License is distributed on an " AS IS " BASIS , <nl> + / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + / / See the License for the specific language governing permissions and <nl> + / / limitations under the License . <nl> + <nl> + # import < UIKit / UIKit . h > <nl> + # import " AppDelegate . h " <nl> + <nl> + int main ( int argc , char * argv [ ] ) { <nl> + @ autoreleasepool { <nl> + return UIApplicationMain ( argc , argv , nil , NSStringFromClass ( [ AppDelegate class ] ) ) ; <nl> + } <nl> + } <nl> mmm a / tensorflow / lite / experimental / objc / tests / TFLInterpreterTests . m <nl> ppp b / tensorflow / lite / experimental / objc / tests / TFLInterpreterTests . m <nl> <nl> / * * Model resource type . * / <nl> static NSString * const kAddModelResourceType = @ " bin " ; <nl> <nl> - / * * Rank of the input and output tensor in the Add model . * / <nl> - static const NSUInteger kAddModelTensorRank = 1U ; <nl> - <nl> / * * Size of the first ( and only ) dimension of the input and output tensor in the Add model . * / <nl> static const NSUInteger kAddModelTensorFirstDimensionSize = 2U ; <nl> <nl> - ( void ) testTFLVersion { <nl> <nl> - ( void ) testSuccessfulFullRunAddFloatModel { <nl> / / Shape for both input and output tensor . <nl> - NSMutableArray * shape = [ NSMutableArray arrayWithCapacity : kAddModelTensorRank ] ; <nl> - shape [ 0 ] = [ NSNumber numberWithUnsignedInteger : kAddModelTensorFirstDimensionSize ] ; <nl> + NSArray < NSNumber * > * shape = @ [ @ ( kAddModelTensorFirstDimensionSize ) ] ; <nl> <nl> / / Creates the interpreter options . <nl> TFLInterpreterOptions * options = [ [ TFLInterpreterOptions alloc ] init ] ; <nl> - ( void ) testSuccessfulFullRunAddFloatModel { <nl> <nl> - ( void ) testSuccessfulFullRunQuantizedModel { <nl> / / Shape for both input and output tensor . <nl> - NSMutableArray * shape = [ NSMutableArray arrayWithCapacity : kAddModelTensorRank ] ; <nl> - shape [ 0 ] = [ NSNumber numberWithUnsignedInteger : kAddModelTensorFirstDimensionSize ] ; <nl> + NSArray < NSNumber * > * shape = @ [ @ ( kAddModelTensorFirstDimensionSize ) ] ; <nl> <nl> / / Creates the interpreter options . <nl> TFLInterpreterOptions * options = [ [ TFLInterpreterOptions alloc ] init ] ; <nl> - ( void ) testSuccessfulFullRunQuantizedModel { <nl> } <nl> <nl> - ( void ) testInitWithModelPath_invalidPath { <nl> - / / Shape for both input and output tensor . <nl> - NSMutableArray * shape = [ NSMutableArray arrayWithCapacity : kAddModelTensorRank ] ; <nl> - shape [ 0 ] = [ NSNumber numberWithUnsignedInteger : kAddModelTensorFirstDimensionSize ] ; <nl> - <nl> / / Creates the interpreter . <nl> NSError * error ; <nl> TFLInterpreter * brokenInterpreter = [ [ TFLInterpreter alloc ] initWithModelPath : @ " InvalidPath " <nl> - ( void ) testInputTensorAtIndex_invalidIndex { <nl> } <nl> <nl> - ( void ) testResizeInputTensorAtIndex_invalidIndex { <nl> - NSMutableArray * shape = [ NSMutableArray arrayWithCapacity : kAddModelTensorRank ] ; <nl> - shape [ 0 ] = [ NSNumber numberWithUnsignedInteger : kAddModelTensorFirstDimensionSize ] ; <nl> + NSArray < NSNumber * > * shape = @ [ @ ( kAddModelTensorFirstDimensionSize ) ] ; <nl> NSError * error ; <nl> XCTAssertFalse ( [ self . interpreter resizeInputTensorAtIndex : kInvalidInputTensorIndex <nl> toShape : shape <nl> - ( void ) testResizeInputTensorAtIndex_emptyShape { <nl> } <nl> <nl> - ( void ) testResizeInputTensorAtIndex_zeroDimensionSize { <nl> - NSMutableArray * shape = [ NSMutableArray arrayWithCapacity : kAddModelTensorRank ] ; <nl> - shape [ 0 ] = [ NSNumber numberWithUnsignedInteger : 0 ] ; <nl> + NSArray < NSNumber * > * shape = @ [ @ 0 ] ; <nl> NSError * error ; <nl> XCTAssertFalse ( [ self . interpreter resizeInputTensorAtIndex : 0 toShape : shape error : & error ] ) ; <nl> XCTAssertEqual ( error . code , TFLInterpreterErrorCodeInvalidShape ) ; <nl> mmm a / tensorflow / lite / experimental / swift / TestApp / TestApp / AppDelegate . swift <nl> ppp b / tensorflow / lite / experimental / swift / TestApp / TestApp / AppDelegate . swift <nl> <nl> + / / Copyright 2019 Google Inc . All rights reserved . <nl> + / / <nl> + / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + / / you may not use this file except in compliance with the License . <nl> + / / You may obtain a copy of the License at : <nl> + / / <nl> + / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + / / <nl> + / / Unless required by applicable law or agreed to in writing , software <nl> + / / distributed under the License is distributed on an " AS IS " BASIS , <nl> + / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + / / See the License for the specific language governing permissions and <nl> + / / limitations under the License . <nl> + <nl> import UIKit <nl> <nl> @ UIApplicationMain <nl> mmm a / tensorflow / lite / experimental / swift / TestApp / TestApp / Array + TensorFlowLite . swift <nl> ppp b / tensorflow / lite / experimental / swift / TestApp / TestApp / Array + TensorFlowLite . swift <nl> <nl> + / / Copyright 2019 Google Inc . All rights reserved . <nl> + / / <nl> + / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + / / you may not use this file except in compliance with the License . <nl> + / / You may obtain a copy of the License at : <nl> + / / <nl> + / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + / / <nl> + / / Unless required by applicable law or agreed to in writing , software <nl> + / / distributed under the License is distributed on an " AS IS " BASIS , <nl> + / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + / / See the License for the specific language governing permissions and <nl> + / / limitations under the License . <nl> + <nl> import Foundation <nl> <nl> extension Array { <nl> mmm a / tensorflow / lite / experimental / swift / TestApp / TestApp / Data + TensorFlowLite . swift <nl> ppp b / tensorflow / lite / experimental / swift / TestApp / TestApp / Data + TensorFlowLite . swift <nl> <nl> + / / Copyright 2019 Google Inc . All rights reserved . <nl> + / / <nl> + / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + / / you may not use this file except in compliance with the License . <nl> + / / You may obtain a copy of the License at : <nl> + / / <nl> + / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + / / <nl> + / / Unless required by applicable law or agreed to in writing , software <nl> + / / distributed under the License is distributed on an " AS IS " BASIS , <nl> + / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + / / See the License for the specific language governing permissions and <nl> + / / limitations under the License . <nl> + <nl> import Foundation <nl> <nl> extension Data { <nl> mmm a / tensorflow / lite / experimental / swift / TestApp / TestApp / ViewController . swift <nl> ppp b / tensorflow / lite / experimental / swift / TestApp / TestApp / ViewController . swift <nl> <nl> + / / Copyright 2019 Google Inc . All rights reserved . <nl> + / / <nl> + / / Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + / / you may not use this file except in compliance with the License . <nl> + / / You may obtain a copy of the License at : <nl> + / / <nl> + / / http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + / / <nl> + / / Unless required by applicable law or agreed to in writing , software <nl> + / / distributed under the License is distributed on an " AS IS " BASIS , <nl> + / / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + / / See the License for the specific language governing permissions and <nl> + / / limitations under the License . <nl> + <nl> import class TensorFlowLite . Interpreter <nl> import struct TensorFlowLite . InterpreterOptions <nl> import struct TensorFlowLite . Tensor <nl>
Add a test app for TFLite ObjC API .
tensorflow/tensorflow
2be59a5191a2d32c3e2a1e630b6335910135d7d0
2019-05-22T06:03:01Z
mmm a / doc / release - notes - 14023 . md <nl> ppp b / doc / release - notes - 14023 . md <nl> <nl> - Accout API removed <nl> mmmmmmmmmmmmmmmmmm - <nl> + Account API removed <nl> + mmmmmmmmmmmmmmmmmm - <nl> <nl> The ' account ' API was deprecated in v0 . 17 and has been fully removed in v0 . 18 . <nl> The ' label ' API was introduced in v0 . 17 as a replacement for accounts . <nl> mmm a / src / interfaces / wallet . cpp <nl> ppp b / src / interfaces / wallet . cpp <nl> class PendingWalletTxImpl : public PendingWalletTx <nl> <nl> bool commit ( WalletValueMap value_map , <nl> WalletOrderForm order_form , <nl> - std : : string from_account , <nl> std : : string & reject_reason ) override <nl> { <nl> LOCK2 ( cs_main , m_wallet . cs_wallet ) ; <nl> CValidationState state ; <nl> - if ( ! m_wallet . CommitTransaction ( m_tx , std : : move ( value_map ) , std : : move ( order_form ) , std : : move ( from_account ) , m_key , g_connman . get ( ) , state ) ) { <nl> + if ( ! m_wallet . CommitTransaction ( m_tx , std : : move ( value_map ) , std : : move ( order_form ) , m_key , g_connman . get ( ) , state ) ) { <nl> reject_reason = state . GetRejectReason ( ) ; <nl> return false ; <nl> } <nl> mmm a / src / interfaces / wallet . h <nl> ppp b / src / interfaces / wallet . h <nl> class PendingWalletTx <nl> / / ! Send pending transaction and commit to wallet . <nl> virtual bool commit ( WalletValueMap value_map , <nl> WalletOrderForm order_form , <nl> - std : : string from_account , <nl> std : : string & reject_reason ) = 0 ; <nl> } ; <nl> <nl> mmm a / src / qt / walletmodel . cpp <nl> ppp b / src / qt / walletmodel . cpp <nl> WalletModel : : SendCoinsReturn WalletModel : : sendCoins ( WalletModelTransaction & tran <nl> <nl> auto & newTx = transaction . getWtx ( ) ; <nl> std : : string rejectReason ; <nl> - if ( ! newTx - > commit ( { } / * mapValue * / , std : : move ( vOrderForm ) , { } / * fromAccount * / , rejectReason ) ) <nl> + if ( ! newTx - > commit ( { } / * mapValue * / , std : : move ( vOrderForm ) , rejectReason ) ) <nl> return SendCoinsReturn ( TransactionCommitFailed , QString : : fromStdString ( rejectReason ) ) ; <nl> <nl> CDataStream ssTx ( SER_NETWORK , PROTOCOL_VERSION ) ; <nl> mmm a / src / wallet / feebumper . cpp <nl> ppp b / src / wallet / feebumper . cpp <nl> Result CommitTransaction ( CWallet * wallet , const uint256 & txid , CMutableTransacti <nl> <nl> CReserveKey reservekey ( wallet ) ; <nl> CValidationState state ; <nl> - if ( ! wallet - > CommitTransaction ( tx , std : : move ( mapValue ) , oldWtx . vOrderForm , oldWtx . strFromAccount , reservekey , g_connman . get ( ) , state ) ) { <nl> + if ( ! wallet - > CommitTransaction ( tx , std : : move ( mapValue ) , oldWtx . vOrderForm , reservekey , g_connman . get ( ) , state ) ) { <nl> / / NOTE : CommitTransaction never returns false , so this should never happen . <nl> errors . push_back ( strprintf ( " The transaction was rejected : % s " , FormatStateMessage ( state ) ) ) ; <nl> return Result : : WALLET_ERROR ; <nl> mmm a / src / wallet / init . cpp <nl> ppp b / src / wallet / init . cpp <nl> void WalletInit : : AddWalletOptions ( ) const <nl> gArgs . AddArg ( " - walletnotify = < cmd > " , " Execute command when a wallet transaction changes ( % s in cmd is replaced by TxID ) " , false , OptionsCategory : : WALLET ) ; <nl> gArgs . AddArg ( " - walletrbf " , strprintf ( " Send transactions with full - RBF opt - in enabled ( RPC only , default : % u ) " , DEFAULT_WALLET_RBF ) , false , OptionsCategory : : WALLET ) ; <nl> gArgs . AddArg ( " - zapwallettxes = < mode > " , " Delete all wallet transactions and only recover those parts of the blockchain through - rescan on startup " <nl> - " ( 1 = keep tx meta data e . g . account owner and payment request information , 2 = drop tx meta data ) " , false , OptionsCategory : : WALLET ) ; <nl> + " ( 1 = keep tx meta data e . g . payment request information , 2 = drop tx meta data ) " , false , OptionsCategory : : WALLET ) ; <nl> <nl> gArgs . AddArg ( " - dblogsize = < n > " , strprintf ( " Flush wallet database activity from memory to disk log every < n > megabytes ( default : % u ) " , DEFAULT_WALLET_DBLOGSIZE ) , true , OptionsCategory : : WALLET_DEBUG_TEST ) ; <nl> gArgs . AddArg ( " - flushwallet " , strprintf ( " Run a thread to flush wallet periodically ( default : % u ) " , DEFAULT_FLUSHWALLET ) , true , OptionsCategory : : WALLET_DEBUG_TEST ) ; <nl> mmm a / src / wallet / rpcwallet . cpp <nl> ppp b / src / wallet / rpcwallet . cpp <nl> static UniValue getnewaddress ( const JSONRPCRequest & request ) <nl> return EncodeDestination ( dest ) ; <nl> } <nl> <nl> - CTxDestination GetLabelDestination ( CWallet * const pwallet , const std : : string & label , bool bForceNew = false ) <nl> - { <nl> - CTxDestination dest ; <nl> - if ( ! pwallet - > GetLabelDestination ( dest , label , bForceNew ) ) { <nl> - throw JSONRPCError ( RPC_WALLET_KEYPOOL_RAN_OUT , " Error : Keypool ran out , please call keypoolrefill first " ) ; <nl> - } <nl> - <nl> - return dest ; <nl> - } <nl> - <nl> static UniValue getrawchangeaddress ( const JSONRPCRequest & request ) <nl> { <nl> std : : shared_ptr < CWallet > const wallet = GetWalletForJSONRPCRequest ( request ) ; <nl> static UniValue setlabel ( const JSONRPCRequest & request ) <nl> pwallet - > SetAddressBook ( dest , label , " send " ) ; <nl> } <nl> <nl> - / / Detect when there are no addresses using this label . <nl> - / / If so , delete the account record for it . Labels , unlike addresses , can be deleted , <nl> - / / and if we wouldn ' t do this , the record would stick around forever . <nl> - bool found_address = false ; <nl> - for ( const std : : pair < const CTxDestination , CAddressBookData > & item : pwallet - > mapAddressBook ) { <nl> - if ( item . second . name = = label ) { <nl> - found_address = true ; <nl> - break ; <nl> - } <nl> - } <nl> - if ( ! found_address ) { <nl> - pwallet - > DeleteLabel ( old_label ) ; <nl> - } <nl> - <nl> return NullUniValue ; <nl> } <nl> <nl> static CTransactionRef SendMoney ( CWallet * const pwallet , const CTxDestination & <nl> throw JSONRPCError ( RPC_WALLET_ERROR , strError ) ; <nl> } <nl> CValidationState state ; <nl> - if ( ! pwallet - > CommitTransaction ( tx , std : : move ( mapValue ) , { } / * orderForm * / , " " / * account * / , reservekey , g_connman . get ( ) , state ) ) { <nl> + if ( ! pwallet - > CommitTransaction ( tx , std : : move ( mapValue ) , { } / * orderForm * / , reservekey , g_connman . get ( ) , state ) ) { <nl> strError = strprintf ( " Error : The transaction was rejected ! Reason given : % s " , FormatStateMessage ( state ) ) ; <nl> throw JSONRPCError ( RPC_WALLET_ERROR , strError ) ; <nl> } <nl> static UniValue sendmany ( const JSONRPCRequest & request ) <nl> EnsureWalletIsUnlocked ( pwallet ) ; <nl> <nl> / / Check funds <nl> - if ( totalAmount > pwallet - > GetLegacyBalance ( ISMINE_SPENDABLE , nMinDepth , nullptr ) ) { <nl> + if ( totalAmount > pwallet - > GetLegacyBalance ( ISMINE_SPENDABLE , nMinDepth ) ) { <nl> throw JSONRPCError ( RPC_WALLET_INSUFFICIENT_FUNDS , " Wallet has insufficient funds " ) ; <nl> } <nl> <nl> static UniValue sendmany ( const JSONRPCRequest & request ) <nl> if ( ! fCreated ) <nl> throw JSONRPCError ( RPC_WALLET_INSUFFICIENT_FUNDS , strFailReason ) ; <nl> CValidationState state ; <nl> - if ( ! pwallet - > CommitTransaction ( tx , std : : move ( mapValue ) , { } / * orderForm * / , " " / * account * / , keyChange , g_connman . get ( ) , state ) ) { <nl> + if ( ! pwallet - > CommitTransaction ( tx , std : : move ( mapValue ) , { } / * orderForm * / , keyChange , g_connman . get ( ) , state ) ) { <nl> strFailReason = strprintf ( " Transaction commit failed : : % s " , FormatStateMessage ( state ) ) ; <nl> throw JSONRPCError ( RPC_WALLET_ERROR , strFailReason ) ; <nl> } <nl> static void MaybePushAddress ( UniValue & entry , const CTxDestination & dest ) <nl> static void ListTransactions ( CWallet * const pwallet , const CWalletTx & wtx , int nMinDepth , bool fLong , UniValue & ret , const isminefilter & filter ) EXCLUSIVE_LOCKS_REQUIRED ( cs_main ) <nl> { <nl> CAmount nFee ; <nl> - std : : string dummy_account ; <nl> std : : list < COutputEntry > listReceived ; <nl> std : : list < COutputEntry > listSent ; <nl> <nl> - wtx . GetAmounts ( listReceived , listSent , nFee , dummy_account , filter ) ; <nl> + wtx . GetAmounts ( listReceived , listSent , nFee , filter ) ; <nl> <nl> bool involvesWatchonly = wtx . IsFromMe ( ISMINE_WATCH_ONLY ) ; <nl> <nl> UniValue listtransactions ( const JSONRPCRequest & request ) <nl> / / iterate backwards until we have nCount items to return : <nl> for ( CWallet : : TxItems : : const_reverse_iterator it = txOrdered . rbegin ( ) ; it ! = txOrdered . rend ( ) ; + + it ) <nl> { <nl> - CWalletTx * const pwtx = ( * it ) . second . first ; <nl> - if ( pwtx ! = nullptr ) { <nl> - ListTransactions ( pwallet , * pwtx , 0 , true , ret , filter ) ; <nl> - } <nl> + CWalletTx * const pwtx = ( * it ) . second ; <nl> + ListTransactions ( pwallet , * pwtx , 0 , true , ret , filter ) ; <nl> if ( ( int ) ret . size ( ) > = ( nCount + nFrom ) ) break ; <nl> } <nl> } <nl> mmm a / src / wallet / test / wallet_tests . cpp <nl> ppp b / src / wallet / test / wallet_tests . cpp <nl> class ListCoinsTestingSetup : public TestChain100Setup <nl> CCoinControl dummy ; <nl> BOOST_CHECK ( wallet - > CreateTransaction ( { recipient } , tx , reservekey , fee , changePos , error , dummy ) ) ; <nl> CValidationState state ; <nl> - BOOST_CHECK ( wallet - > CommitTransaction ( tx , { } , { } , { } , reservekey , nullptr , state ) ) ; <nl> + BOOST_CHECK ( wallet - > CommitTransaction ( tx , { } , { } , reservekey , nullptr , state ) ) ; <nl> CMutableTransaction blocktx ; <nl> { <nl> LOCK ( wallet - > cs_wallet ) ; <nl> mmm a / src / wallet / wallet . cpp <nl> ppp b / src / wallet / wallet . cpp <nl> void CWallet : : SyncMetaData ( std : : pair < TxSpends : : iterator , TxSpends : : iterator > ran <nl> / / nTimeReceived not copied on purpose <nl> copyTo - > nTimeSmart = copyFrom - > nTimeSmart ; <nl> copyTo - > fFromMe = copyFrom - > fFromMe ; <nl> - copyTo - > strFromAccount = copyFrom - > strFromAccount ; <nl> / / nOrderPos not copied on purpose <nl> / / cached members not copied on purpose <nl> } <nl> DBErrors CWallet : : ReorderTransactions ( ) <nl> / / Old wallets didn ' t have any defined order for transactions <nl> / / Probably a bad idea to change the output of this <nl> <nl> - / / First : get all CWalletTx and CAccountingEntry into a sorted - by - time multimap . <nl> - typedef std : : pair < CWalletTx * , CAccountingEntry * > TxPair ; <nl> - typedef std : : multimap < int64_t , TxPair > TxItems ; <nl> + / / First : get all CWalletTx into a sorted - by - time multimap . <nl> + typedef std : : multimap < int64_t , CWalletTx * > TxItems ; <nl> TxItems txByTime ; <nl> <nl> for ( auto & entry : mapWallet ) <nl> { <nl> CWalletTx * wtx = & entry . second ; <nl> - txByTime . insert ( std : : make_pair ( wtx - > nTimeReceived , TxPair ( wtx , nullptr ) ) ) ; <nl> - } <nl> - std : : list < CAccountingEntry > acentries ; <nl> - batch . ListAccountCreditDebit ( " " , acentries ) ; <nl> - for ( CAccountingEntry & entry : acentries ) <nl> - { <nl> - txByTime . insert ( std : : make_pair ( entry . nTime , TxPair ( nullptr , & entry ) ) ) ; <nl> + txByTime . insert ( std : : make_pair ( wtx - > nTimeReceived , wtx ) ) ; <nl> } <nl> <nl> nOrderPosNext = 0 ; <nl> std : : vector < int64_t > nOrderPosOffsets ; <nl> for ( TxItems : : iterator it = txByTime . begin ( ) ; it ! = txByTime . end ( ) ; + + it ) <nl> { <nl> - CWalletTx * const pwtx = ( * it ) . second . first ; <nl> - CAccountingEntry * const pacentry = ( * it ) . second . second ; <nl> - int64_t & nOrderPos = ( pwtx ! = nullptr ) ? pwtx - > nOrderPos : pacentry - > nOrderPos ; <nl> + CWalletTx * const pwtx = ( * it ) . second ; <nl> + int64_t & nOrderPos = pwtx - > nOrderPos ; <nl> <nl> if ( nOrderPos = = - 1 ) <nl> { <nl> nOrderPos = nOrderPosNext + + ; <nl> nOrderPosOffsets . push_back ( nOrderPos ) ; <nl> <nl> - if ( pwtx ) <nl> - { <nl> - if ( ! batch . WriteTx ( * pwtx ) ) <nl> - return DBErrors : : LOAD_FAIL ; <nl> - } <nl> - else <nl> - if ( ! batch . WriteAccountingEntry ( pacentry - > nEntryNo , * pacentry ) ) <nl> - return DBErrors : : LOAD_FAIL ; <nl> + if ( ! batch . WriteTx ( * pwtx ) ) <nl> + return DBErrors : : LOAD_FAIL ; <nl> } <nl> else <nl> { <nl> DBErrors CWallet : : ReorderTransactions ( ) <nl> continue ; <nl> <nl> / / Since we ' re changing the order , write it back <nl> - if ( pwtx ) <nl> - { <nl> - if ( ! batch . WriteTx ( * pwtx ) ) <nl> - return DBErrors : : LOAD_FAIL ; <nl> - } <nl> - else <nl> - if ( ! batch . WriteAccountingEntry ( pacentry - > nEntryNo , * pacentry ) ) <nl> - return DBErrors : : LOAD_FAIL ; <nl> + if ( ! batch . WriteTx ( * pwtx ) ) <nl> + return DBErrors : : LOAD_FAIL ; <nl> } <nl> } <nl> batch . WriteOrderPosNext ( nOrderPosNext ) ; <nl> int64_t CWallet : : IncOrderPosNext ( WalletBatch * batch ) <nl> return nRet ; <nl> } <nl> <nl> - bool CWallet : : AccountMove ( std : : string strFrom , std : : string strTo , CAmount nAmount , std : : string strComment ) <nl> - { <nl> - WalletBatch batch ( * database ) ; <nl> - if ( ! batch . TxnBegin ( ) ) <nl> - return false ; <nl> - <nl> - int64_t nNow = GetAdjustedTime ( ) ; <nl> - <nl> - / / Debit <nl> - CAccountingEntry debit ; <nl> - debit . nOrderPos = IncOrderPosNext ( & batch ) ; <nl> - debit . strAccount = strFrom ; <nl> - debit . nCreditDebit = - nAmount ; <nl> - debit . nTime = nNow ; <nl> - debit . strOtherAccount = strTo ; <nl> - debit . strComment = strComment ; <nl> - AddAccountingEntry ( debit , & batch ) ; <nl> - <nl> - / / Credit <nl> - CAccountingEntry credit ; <nl> - credit . nOrderPos = IncOrderPosNext ( & batch ) ; <nl> - credit . strAccount = strTo ; <nl> - credit . nCreditDebit = nAmount ; <nl> - credit . nTime = nNow ; <nl> - credit . strOtherAccount = strFrom ; <nl> - credit . strComment = strComment ; <nl> - AddAccountingEntry ( credit , & batch ) ; <nl> - <nl> - if ( ! batch . TxnCommit ( ) ) <nl> - return false ; <nl> - <nl> - return true ; <nl> - } <nl> - <nl> - bool CWallet : : GetLabelDestination ( CTxDestination & dest , const std : : string & label , bool bForceNew ) <nl> - { <nl> - WalletBatch batch ( * database ) ; <nl> - <nl> - CAccount account ; <nl> - batch . ReadAccount ( label , account ) ; <nl> - <nl> - if ( ! bForceNew ) { <nl> - if ( ! account . vchPubKey . IsValid ( ) ) <nl> - bForceNew = true ; <nl> - else { <nl> - / / Check if the current key has been used ( TODO : check other addresses with the same key ) <nl> - CScript scriptPubKey = GetScriptForDestination ( GetDestinationForKey ( account . vchPubKey , m_default_address_type ) ) ; <nl> - for ( std : : map < uint256 , CWalletTx > : : iterator it = mapWallet . begin ( ) ; <nl> - it ! = mapWallet . end ( ) & & account . vchPubKey . IsValid ( ) ; <nl> - + + it ) <nl> - for ( const CTxOut & txout : ( * it ) . second . tx - > vout ) <nl> - if ( txout . scriptPubKey = = scriptPubKey ) { <nl> - bForceNew = true ; <nl> - break ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - / / Generate a new key <nl> - if ( bForceNew ) { <nl> - if ( ! GetKeyFromPool ( account . vchPubKey , false ) ) <nl> - return false ; <nl> - <nl> - LearnRelatedScripts ( account . vchPubKey , m_default_address_type ) ; <nl> - dest = GetDestinationForKey ( account . vchPubKey , m_default_address_type ) ; <nl> - SetAddressBook ( dest , label , " receive " ) ; <nl> - batch . WriteAccount ( label , account ) ; <nl> - } else { <nl> - dest = GetDestinationForKey ( account . vchPubKey , m_default_address_type ) ; <nl> - } <nl> - <nl> - return true ; <nl> - } <nl> - <nl> void CWallet : : MarkDirty ( ) <nl> { <nl> { <nl> bool CWallet : : AddToWallet ( const CWalletTx & wtxIn , bool fFlushOnClose ) <nl> if ( fInsertedNew ) { <nl> wtx . nTimeReceived = GetAdjustedTime ( ) ; <nl> wtx . nOrderPos = IncOrderPosNext ( & batch ) ; <nl> - wtx . m_it_wtxOrdered = wtxOrdered . insert ( std : : make_pair ( wtx . nOrderPos , TxPair ( & wtx , nullptr ) ) ) ; <nl> + wtx . m_it_wtxOrdered = wtxOrdered . insert ( std : : make_pair ( wtx . nOrderPos , & wtx ) ) ; <nl> wtx . nTimeSmart = ComputeTimeSmart ( wtx ) ; <nl> AddToSpends ( hash ) ; <nl> } <nl> void CWallet : : LoadToWallet ( const CWalletTx & wtxIn ) <nl> CWalletTx & wtx = ins . first - > second ; <nl> wtx . BindWallet ( this ) ; <nl> if ( / * insertion took place * / ins . second ) { <nl> - wtx . m_it_wtxOrdered = wtxOrdered . insert ( std : : make_pair ( wtx . nOrderPos , TxPair ( & wtx , nullptr ) ) ) ; <nl> + wtx . m_it_wtxOrdered = wtxOrdered . insert ( std : : make_pair ( wtx . nOrderPos , & wtx ) ) ; <nl> } <nl> AddToSpends ( hash ) ; <nl> for ( const CTxIn & txin : wtx . tx - > vin ) { <nl> int CalculateMaximumSignedInputSize ( const CTxOut & txout , const CWallet * wallet , <nl> } <nl> <nl> void CWalletTx : : GetAmounts ( std : : list < COutputEntry > & listReceived , <nl> - std : : list < COutputEntry > & listSent , CAmount & nFee , std : : string & strSentAccount , const isminefilter & filter ) const <nl> + std : : list < COutputEntry > & listSent , CAmount & nFee , const isminefilter & filter ) const <nl> { <nl> nFee = 0 ; <nl> listReceived . clear ( ) ; <nl> listSent . clear ( ) ; <nl> - strSentAccount = strFromAccount ; <nl> <nl> / / Compute fee : <nl> CAmount nDebit = GetDebit ( filter ) ; <nl> CAmount CWallet : : GetImmatureWatchOnlyBalance ( ) const <nl> / / wallet , and then subtracts the values of TxIns spending from the wallet . This <nl> / / also has fewer restrictions on which unconfirmed transactions are considered <nl> / / trusted . <nl> - CAmount CWallet : : GetLegacyBalance ( const isminefilter & filter , int minDepth , const std : : string * account ) const <nl> + CAmount CWallet : : GetLegacyBalance ( const isminefilter & filter , int minDepth ) const <nl> { <nl> LOCK2 ( cs_main , cs_wallet ) ; <nl> <nl> CAmount CWallet : : GetLegacyBalance ( const isminefilter & filter , int minDepth , cons <nl> for ( const CTxOut & out : wtx . tx - > vout ) { <nl> if ( outgoing & & IsChange ( out ) ) { <nl> debit - = out . nValue ; <nl> - } else if ( IsMine ( out ) & filter & & depth > = minDepth & & ( ! account | | * account = = GetLabelName ( out . scriptPubKey ) ) ) { <nl> + } else if ( IsMine ( out ) & filter & & depth > = minDepth ) { <nl> balance + = out . nValue ; <nl> } <nl> } <nl> <nl> / / For outgoing txs , subtract amount debited . <nl> - if ( outgoing & & ( ! account | | * account = = wtx . strFromAccount ) ) { <nl> + if ( outgoing ) { <nl> balance - = debit ; <nl> } <nl> } <nl> <nl> - if ( account ) { <nl> - balance + = WalletBatch ( * database ) . GetAccountCreditDebit ( * account ) ; <nl> - } <nl> - <nl> return balance ; <nl> } <nl> <nl> bool CWallet : : CreateTransaction ( const std : : vector < CRecipient > & vecSend , CTransac <nl> / * * <nl> * Call after CreateTransaction unless you want to abort <nl> * / <nl> - bool CWallet : : CommitTransaction ( CTransactionRef tx , mapValue_t mapValue , std : : vector < std : : pair < std : : string , std : : string > > orderForm , std : : string fromAccount , CReserveKey & reservekey , CConnman * connman , CValidationState & state ) <nl> + bool CWallet : : CommitTransaction ( CTransactionRef tx , mapValue_t mapValue , std : : vector < std : : pair < std : : string , std : : string > > orderForm , CReserveKey & reservekey , CConnman * connman , CValidationState & state ) <nl> { <nl> { <nl> LOCK2 ( cs_main , cs_wallet ) ; <nl> bool CWallet : : CommitTransaction ( CTransactionRef tx , mapValue_t mapValue , std : : ve <nl> CWalletTx wtxNew ( this , std : : move ( tx ) ) ; <nl> wtxNew . mapValue = std : : move ( mapValue ) ; <nl> wtxNew . vOrderForm = std : : move ( orderForm ) ; <nl> - wtxNew . strFromAccount = std : : move ( fromAccount ) ; <nl> wtxNew . fTimeReceivedIsTxTime = true ; <nl> wtxNew . fFromMe = true ; <nl> <nl> bool CWallet : : CommitTransaction ( CTransactionRef tx , mapValue_t mapValue , std : : ve <nl> return true ; <nl> } <nl> <nl> - void CWallet : : ListAccountCreditDebit ( const std : : string & strAccount , std : : list < CAccountingEntry > & entries ) { <nl> - WalletBatch batch ( * database ) ; <nl> - return batch . ListAccountCreditDebit ( strAccount , entries ) ; <nl> - } <nl> - <nl> - bool CWallet : : AddAccountingEntry ( const CAccountingEntry & acentry ) <nl> - { <nl> - WalletBatch batch ( * database ) ; <nl> - <nl> - return AddAccountingEntry ( acentry , & batch ) ; <nl> - } <nl> - <nl> - bool CWallet : : AddAccountingEntry ( const CAccountingEntry & acentry , WalletBatch * batch ) <nl> - { <nl> - if ( ! batch - > WriteAccountingEntry ( + + nAccountingEntryNumber , acentry ) ) { <nl> - return false ; <nl> - } <nl> - <nl> - laccentries . push_back ( acentry ) ; <nl> - CAccountingEntry & entry = laccentries . back ( ) ; <nl> - wtxOrdered . insert ( std : : make_pair ( entry . nOrderPos , TxPair ( nullptr , & entry ) ) ) ; <nl> - <nl> - return true ; <nl> - } <nl> - <nl> DBErrors CWallet : : LoadWallet ( bool & fFirstRunRet ) <nl> { <nl> LOCK2 ( cs_main , cs_wallet ) ; <nl> std : : set < CTxDestination > CWallet : : GetLabelAddresses ( const std : : string & label ) co <nl> return result ; <nl> } <nl> <nl> - void CWallet : : DeleteLabel ( const std : : string & label ) <nl> - { <nl> - WalletBatch batch ( * database ) ; <nl> - batch . EraseAccount ( label ) ; <nl> - } <nl> - <nl> bool CReserveKey : : GetReservedKey ( CPubKey & pubkey , bool internal ) <nl> { <nl> if ( nIndex = = - 1 ) <nl> unsigned int CWallet : : ComputeTimeSmart ( const CWalletTx & wtx ) const <nl> int64_t latestTolerated = latestNow + 300 ; <nl> const TxItems & txOrdered = wtxOrdered ; <nl> for ( auto it = txOrdered . rbegin ( ) ; it ! = txOrdered . rend ( ) ; + + it ) { <nl> - CWalletTx * const pwtx = it - > second . first ; <nl> + CWalletTx * const pwtx = it - > second ; <nl> if ( pwtx = = & wtx ) { <nl> continue ; <nl> } <nl> - CAccountingEntry * const pacentry = it - > second . second ; <nl> int64_t nSmartTime ; <nl> - if ( pwtx ) { <nl> - nSmartTime = pwtx - > nTimeSmart ; <nl> - if ( ! nSmartTime ) { <nl> - nSmartTime = pwtx - > nTimeReceived ; <nl> - } <nl> - } else { <nl> - nSmartTime = pacentry - > nTime ; <nl> + nSmartTime = pwtx - > nTimeSmart ; <nl> + if ( ! nSmartTime ) { <nl> + nSmartTime = pwtx - > nTimeReceived ; <nl> } <nl> if ( nSmartTime < = latestTolerated ) { <nl> latestEntry = nSmartTime ; <nl> std : : shared_ptr < CWallet > CWallet : : CreateWalletFromFile ( const std : : string & name , <nl> copyTo - > nTimeReceived = copyFrom - > nTimeReceived ; <nl> copyTo - > nTimeSmart = copyFrom - > nTimeSmart ; <nl> copyTo - > fFromMe = copyFrom - > fFromMe ; <nl> - copyTo - > strFromAccount = copyFrom - > strFromAccount ; <nl> copyTo - > nOrderPos = copyFrom - > nOrderPos ; <nl> batch . WriteTx ( * copyTo ) ; <nl> } <nl> mmm a / src / wallet / wallet . h <nl> ppp b / src / wallet / wallet . h <nl> class CWalletTx : public CMerkleTx <nl> * externally and came in through the network or sendrawtransaction RPC . <nl> * / <nl> char fFromMe ; <nl> - std : : string strFromAccount ; <nl> int64_t nOrderPos ; / / ! < position in ordered transaction list <nl> - std : : multimap < int64_t , std : : pair < CWalletTx * , CAccountingEntry * > > : : const_iterator m_it_wtxOrdered ; <nl> + std : : multimap < int64_t , CWalletTx * > : : const_iterator m_it_wtxOrdered ; <nl> <nl> / / memory only <nl> mutable bool fDebitCached ; <nl> class CWalletTx : public CMerkleTx <nl> nTimeReceived = 0 ; <nl> nTimeSmart = 0 ; <nl> fFromMe = false ; <nl> - strFromAccount . clear ( ) ; <nl> fDebitCached = false ; <nl> fCreditCached = false ; <nl> fImmatureCreditCached = false ; <nl> class CWalletTx : public CMerkleTx <nl> char fSpent = false ; <nl> mapValue_t mapValueCopy = mapValue ; <nl> <nl> - mapValueCopy [ " fromaccount " ] = strFromAccount ; <nl> + mapValueCopy [ " fromaccount " ] = " " ; <nl> WriteOrderPos ( nOrderPos , mapValueCopy ) ; <nl> if ( nTimeSmart ) { <nl> mapValueCopy [ " timesmart " ] = strprintf ( " % u " , nTimeSmart ) ; <nl> class CWalletTx : public CMerkleTx <nl> std : : vector < CMerkleTx > vUnused ; / / ! < Used to be vtxPrev <nl> s > > vUnused > > mapValue > > vOrderForm > > fTimeReceivedIsTxTime > > nTimeReceived > > fFromMe > > fSpent ; <nl> <nl> - strFromAccount = std : : move ( mapValue [ " fromaccount " ] ) ; <nl> ReadOrderPos ( nOrderPos , mapValue ) ; <nl> nTimeSmart = mapValue . count ( " timesmart " ) ? ( unsigned int ) atoi64 ( mapValue [ " timesmart " ] ) : 0 ; <nl> <nl> class CWalletTx : public CMerkleTx <nl> } <nl> <nl> void GetAmounts ( std : : list < COutputEntry > & listReceived , <nl> - std : : list < COutputEntry > & listSent , CAmount & nFee , std : : string & strSentAccount , const isminefilter & filter ) const ; <nl> + std : : list < COutputEntry > & listSent , CAmount & nFee , const isminefilter & filter ) const ; <nl> <nl> bool IsFromMe ( const isminefilter & filter ) const <nl> { <nl> class CWalletKey <nl> } <nl> } ; <nl> <nl> - / * * <nl> - * DEPRECATED Internal transfers . <nl> - * Database key is acentry < account > < counter > . <nl> - * / <nl> - class CAccountingEntry <nl> - { <nl> - public : <nl> - std : : string strAccount ; <nl> - CAmount nCreditDebit ; <nl> - int64_t nTime ; <nl> - std : : string strOtherAccount ; <nl> - std : : string strComment ; <nl> - mapValue_t mapValue ; <nl> - int64_t nOrderPos ; / / ! < position in ordered transaction list <nl> - uint64_t nEntryNo ; <nl> - <nl> - CAccountingEntry ( ) <nl> - { <nl> - SetNull ( ) ; <nl> - } <nl> - <nl> - void SetNull ( ) <nl> - { <nl> - nCreditDebit = 0 ; <nl> - nTime = 0 ; <nl> - strAccount . clear ( ) ; <nl> - strOtherAccount . clear ( ) ; <nl> - strComment . clear ( ) ; <nl> - nOrderPos = - 1 ; <nl> - nEntryNo = 0 ; <nl> - } <nl> - <nl> - template < typename Stream > <nl> - void Serialize ( Stream & s ) const { <nl> - int nVersion = s . GetVersion ( ) ; <nl> - if ( ! ( s . GetType ( ) & SER_GETHASH ) ) { <nl> - s < < nVersion ; <nl> - } <nl> - / / ! Note : strAccount is serialized as part of the key , not here . <nl> - s < < nCreditDebit < < nTime < < strOtherAccount ; <nl> - <nl> - mapValue_t mapValueCopy = mapValue ; <nl> - WriteOrderPos ( nOrderPos , mapValueCopy ) ; <nl> - <nl> - std : : string strCommentCopy = strComment ; <nl> - if ( ! mapValueCopy . empty ( ) | | ! _ssExtra . empty ( ) ) { <nl> - CDataStream ss ( s . GetType ( ) , s . GetVersion ( ) ) ; <nl> - ss . insert ( ss . begin ( ) , ' \ 0 ' ) ; <nl> - ss < < mapValueCopy ; <nl> - ss . insert ( ss . end ( ) , _ssExtra . begin ( ) , _ssExtra . end ( ) ) ; <nl> - strCommentCopy . append ( ss . str ( ) ) ; <nl> - } <nl> - s < < strCommentCopy ; <nl> - } <nl> - <nl> - template < typename Stream > <nl> - void Unserialize ( Stream & s ) { <nl> - int nVersion = s . GetVersion ( ) ; <nl> - if ( ! ( s . GetType ( ) & SER_GETHASH ) ) { <nl> - s > > nVersion ; <nl> - } <nl> - / / ! Note : strAccount is serialized as part of the key , not here . <nl> - s > > nCreditDebit > > nTime > > LIMITED_STRING ( strOtherAccount , 65536 ) > > LIMITED_STRING ( strComment , 65536 ) ; <nl> - <nl> - size_t nSepPos = strComment . find ( " \ 0 " , 0 , 1 ) ; <nl> - mapValue . clear ( ) ; <nl> - if ( std : : string : : npos ! = nSepPos ) { <nl> - CDataStream ss ( std : : vector < char > ( strComment . begin ( ) + nSepPos + 1 , strComment . end ( ) ) , s . GetType ( ) , s . GetVersion ( ) ) ; <nl> - ss > > mapValue ; <nl> - _ssExtra = std : : vector < char > ( ss . begin ( ) , ss . end ( ) ) ; <nl> - } <nl> - ReadOrderPos ( nOrderPos , mapValue ) ; <nl> - if ( std : : string : : npos ! = nSepPos ) { <nl> - strComment . erase ( nSepPos ) ; <nl> - } <nl> - <nl> - mapValue . erase ( " n " ) ; <nl> - } <nl> - <nl> - private : <nl> - std : : vector < char > _ssExtra ; <nl> - } ; <nl> - <nl> struct CoinSelectionParams <nl> { <nl> bool use_bnb = true ; <nl> class CWallet final : public CCryptoKeyStore , public CValidationInterface <nl> } <nl> <nl> std : : map < uint256 , CWalletTx > mapWallet ; <nl> - std : : list < CAccountingEntry > laccentries ; <nl> <nl> - typedef std : : pair < CWalletTx * , CAccountingEntry * > TxPair ; <nl> - typedef std : : multimap < int64_t , TxPair > TxItems ; <nl> + typedef std : : multimap < int64_t , CWalletTx * > TxItems ; <nl> TxItems wtxOrdered ; <nl> <nl> int64_t nOrderPosNext = 0 ; <nl> class CWallet final : public CCryptoKeyStore , public CValidationInterface <nl> * / <nl> int64_t IncOrderPosNext ( WalletBatch * batch = nullptr ) EXCLUSIVE_LOCKS_REQUIRED ( cs_wallet ) ; <nl> DBErrors ReorderTransactions ( ) ; <nl> - bool AccountMove ( std : : string strFrom , std : : string strTo , CAmount nAmount , std : : string strComment = " " ) EXCLUSIVE_LOCKS_REQUIRED ( cs_wallet ) ; <nl> - bool GetLabelDestination ( CTxDestination & dest , const std : : string & label , bool bForceNew = false ) ; <nl> <nl> void MarkDirty ( ) ; <nl> bool AddToWallet ( const CWalletTx & wtxIn , bool fFlushOnClose = true ) ; <nl> class CWallet final : public CCryptoKeyStore , public CValidationInterface <nl> CAmount GetImmatureBalance ( ) const ; <nl> CAmount GetUnconfirmedWatchOnlyBalance ( ) const ; <nl> CAmount GetImmatureWatchOnlyBalance ( ) const ; <nl> - CAmount GetLegacyBalance ( const isminefilter & filter , int minDepth , const std : : string * account ) const ; <nl> + CAmount GetLegacyBalance ( const isminefilter & filter , int minDepth ) const ; <nl> CAmount GetAvailableBalance ( const CCoinControl * coinControl = nullptr ) const ; <nl> <nl> OutputType TransactionChangeType ( OutputType change_type , const std : : vector < CRecipient > & vecSend ) ; <nl> class CWallet final : public CCryptoKeyStore , public CValidationInterface <nl> * / <nl> bool CreateTransaction ( const std : : vector < CRecipient > & vecSend , CTransactionRef & tx , CReserveKey & reservekey , CAmount & nFeeRet , int & nChangePosInOut , <nl> std : : string & strFailReason , const CCoinControl & coin_control , bool sign = true ) ; <nl> - bool CommitTransaction ( CTransactionRef tx , mapValue_t mapValue , std : : vector < std : : pair < std : : string , std : : string > > orderForm , std : : string fromAccount , CReserveKey & reservekey , CConnman * connman , CValidationState & state ) ; <nl> + bool CommitTransaction ( CTransactionRef tx , mapValue_t mapValue , std : : vector < std : : pair < std : : string , std : : string > > orderForm , CReserveKey & reservekey , CConnman * connman , CValidationState & state ) ; <nl> <nl> - void ListAccountCreditDebit ( const std : : string & strAccount , std : : list < CAccountingEntry > & entries ) ; <nl> - bool AddAccountingEntry ( const CAccountingEntry & ) ; <nl> - bool AddAccountingEntry ( const CAccountingEntry & , WalletBatch * batch ) ; <nl> bool DummySignTx ( CMutableTransaction & txNew , const std : : set < CTxOut > & txouts , bool use_max_sig = false ) const <nl> { <nl> std : : vector < CTxOut > v_txouts ( txouts . size ( ) ) ; <nl> class CWallet final : public CCryptoKeyStore , public CValidationInterface <nl> std : : map < CTxDestination , CAmount > GetAddressBalances ( ) EXCLUSIVE_LOCKS_REQUIRED ( cs_main ) ; <nl> <nl> std : : set < CTxDestination > GetLabelAddresses ( const std : : string & label ) const ; <nl> - void DeleteLabel ( const std : : string & label ) ; <nl> <nl> isminetype IsMine ( const CTxIn & txin ) const ; <nl> / * * <nl> class CReserveKey final : public CReserveScript <nl> void KeepScript ( ) override { KeepKey ( ) ; } <nl> } ; <nl> <nl> - <nl> - / * * <nl> - * DEPRECATED Account information . <nl> - * Stored in wallet with key " acc " + string account name . <nl> - * / <nl> - class CAccount <nl> - { <nl> - public : <nl> - CPubKey vchPubKey ; <nl> - <nl> - CAccount ( ) <nl> - { <nl> - SetNull ( ) ; <nl> - } <nl> - <nl> - void SetNull ( ) <nl> - { <nl> - vchPubKey = CPubKey ( ) ; <nl> - } <nl> - <nl> - ADD_SERIALIZE_METHODS ; <nl> - <nl> - template < typename Stream , typename Operation > <nl> - inline void SerializationOp ( Stream & s , Operation ser_action ) { <nl> - int nVersion = s . GetVersion ( ) ; <nl> - if ( ! ( s . GetType ( ) & SER_GETHASH ) ) <nl> - READWRITE ( nVersion ) ; <nl> - READWRITE ( vchPubKey ) ; <nl> - } <nl> - } ; <nl> - <nl> / * * RAII object to check and reserve a wallet rescan * / <nl> class WalletRescanReserver <nl> { <nl> mmm a / src / wallet / walletdb . cpp <nl> ppp b / src / wallet / walletdb . cpp <nl> <nl> # include < wallet / wallet . h > <nl> <nl> # include < atomic > <nl> + # include < string > <nl> <nl> # include < boost / thread . hpp > <nl> <nl> bool WalletBatch : : WriteMinVersion ( int nVersion ) <nl> return WriteIC ( std : : string ( " minversion " ) , nVersion ) ; <nl> } <nl> <nl> - bool WalletBatch : : ReadAccount ( const std : : string & strAccount , CAccount & account ) <nl> - { <nl> - account . SetNull ( ) ; <nl> - return m_batch . Read ( std : : make_pair ( std : : string ( " acc " ) , strAccount ) , account ) ; <nl> - } <nl> - <nl> - bool WalletBatch : : WriteAccount ( const std : : string & strAccount , const CAccount & account ) <nl> - { <nl> - return WriteIC ( std : : make_pair ( std : : string ( " acc " ) , strAccount ) , account ) ; <nl> - } <nl> - <nl> - bool WalletBatch : : EraseAccount ( const std : : string & strAccount ) <nl> - { <nl> - return EraseIC ( std : : make_pair ( std : : string ( " acc " ) , strAccount ) ) ; <nl> - } <nl> - <nl> - bool WalletBatch : : WriteAccountingEntry ( const uint64_t nAccEntryNum , const CAccountingEntry & acentry ) <nl> - { <nl> - return WriteIC ( std : : make_pair ( std : : string ( " acentry " ) , std : : make_pair ( acentry . strAccount , nAccEntryNum ) ) , acentry ) ; <nl> - } <nl> - <nl> - CAmount WalletBatch : : GetAccountCreditDebit ( const std : : string & strAccount ) <nl> - { <nl> - std : : list < CAccountingEntry > entries ; <nl> - ListAccountCreditDebit ( strAccount , entries ) ; <nl> - <nl> - CAmount nCreditDebit = 0 ; <nl> - for ( const CAccountingEntry & entry : entries ) <nl> - nCreditDebit + = entry . nCreditDebit ; <nl> - <nl> - return nCreditDebit ; <nl> - } <nl> - <nl> - void WalletBatch : : ListAccountCreditDebit ( const std : : string & strAccount , std : : list < CAccountingEntry > & entries ) <nl> - { <nl> - bool fAllAccounts = ( strAccount = = " * " ) ; <nl> - <nl> - Dbc * pcursor = m_batch . GetCursor ( ) ; <nl> - if ( ! pcursor ) <nl> - throw std : : runtime_error ( std : : string ( __func__ ) + " : cannot create DB cursor " ) ; <nl> - bool setRange = true ; <nl> - while ( true ) <nl> - { <nl> - / / Read next record <nl> - CDataStream ssKey ( SER_DISK , CLIENT_VERSION ) ; <nl> - if ( setRange ) <nl> - ssKey < < std : : make_pair ( std : : string ( " acentry " ) , std : : make_pair ( ( fAllAccounts ? std : : string ( " " ) : strAccount ) , uint64_t ( 0 ) ) ) ; <nl> - CDataStream ssValue ( SER_DISK , CLIENT_VERSION ) ; <nl> - int ret = m_batch . ReadAtCursor ( pcursor , ssKey , ssValue , setRange ) ; <nl> - setRange = false ; <nl> - if ( ret = = DB_NOTFOUND ) <nl> - break ; <nl> - else if ( ret ! = 0 ) <nl> - { <nl> - pcursor - > close ( ) ; <nl> - throw std : : runtime_error ( std : : string ( __func__ ) + " : error scanning DB " ) ; <nl> - } <nl> - <nl> - / / Unserialize <nl> - std : : string strType ; <nl> - ssKey > > strType ; <nl> - if ( strType ! = " acentry " ) <nl> - break ; <nl> - CAccountingEntry acentry ; <nl> - ssKey > > acentry . strAccount ; <nl> - if ( ! fAllAccounts & & acentry . strAccount ! = strAccount ) <nl> - break ; <nl> - <nl> - ssValue > > acentry ; <nl> - ssKey > > acentry . nEntryNo ; <nl> - entries . push_back ( acentry ) ; <nl> - } <nl> - <nl> - pcursor - > close ( ) ; <nl> - } <nl> - <nl> class CWalletScanState { <nl> public : <nl> unsigned int nKeys ; <nl> ReadKeyValue ( CWallet * pwallet , CDataStream & ssKey , CDataStream & ssValue , <nl> { <nl> char fTmp ; <nl> char fUnused ; <nl> - ssValue > > fTmp > > fUnused > > wtx . strFromAccount ; <nl> - strErr = strprintf ( " LoadWallet ( ) upgrading tx ver = % d % d ' % s ' % s " , <nl> - wtx . fTimeReceivedIsTxTime , fTmp , wtx . strFromAccount , hash . ToString ( ) ) ; <nl> + std : : string unused_string ; <nl> + ssValue > > fTmp > > fUnused > > unused_string ; <nl> + strErr = strprintf ( " LoadWallet ( ) upgrading tx ver = % d % d % s " , <nl> + wtx . fTimeReceivedIsTxTime , fTmp , hash . ToString ( ) ) ; <nl> wtx . fTimeReceivedIsTxTime = fTmp ; <nl> } <nl> else <nl> ReadKeyValue ( CWallet * pwallet , CDataStream & ssKey , CDataStream & ssValue , <nl> <nl> pwallet - > LoadToWallet ( wtx ) ; <nl> } <nl> - else if ( strType = = " acentry " ) <nl> - { <nl> - std : : string strAccount ; <nl> - ssKey > > strAccount ; <nl> - uint64_t nNumber ; <nl> - ssKey > > nNumber ; <nl> - if ( nNumber > pwallet - > nAccountingEntryNumber ) { <nl> - pwallet - > nAccountingEntryNumber = nNumber ; <nl> - } <nl> - <nl> - if ( ! wss . fAnyUnordered ) <nl> - { <nl> - CAccountingEntry acentry ; <nl> - ssValue > > acentry ; <nl> - if ( acentry . nOrderPos = = - 1 ) <nl> - wss . fAnyUnordered = true ; <nl> - } <nl> - } <nl> else if ( strType = = " watchs " ) <nl> { <nl> wss . nWatchKeys + + ; <nl> ReadKeyValue ( CWallet * pwallet , CDataStream & ssKey , CDataStream & ssValue , <nl> return false ; <nl> } <nl> } else if ( strType ! = " bestblock " & & strType ! = " bestblock_nomerkle " & & <nl> - strType ! = " minversion " ) { <nl> + strType ! = " minversion " & & strType ! = " acentry " ) { <nl> wss . m_unknown_records + + ; <nl> } <nl> } catch ( . . . ) <nl> DBErrors WalletBatch : : LoadWallet ( CWallet * pwallet ) <nl> if ( wss . fAnyUnordered ) <nl> result = pwallet - > ReorderTransactions ( ) ; <nl> <nl> - pwallet - > laccentries . clear ( ) ; <nl> - ListAccountCreditDebit ( " * " , pwallet - > laccentries ) ; <nl> - for ( CAccountingEntry & entry : pwallet - > laccentries ) { <nl> - pwallet - > wtxOrdered . insert ( make_pair ( entry . nOrderPos , CWallet : : TxPair ( nullptr , & entry ) ) ) ; <nl> - } <nl> - <nl> return result ; <nl> } <nl> <nl> mmm a / src / wallet / walletdb . h <nl> ppp b / src / wallet / walletdb . h <nl> <nl> <nl> static const bool DEFAULT_FLUSHWALLET = true ; <nl> <nl> - class CAccount ; <nl> - class CAccountingEntry ; <nl> struct CBlockLocator ; <nl> class CKeyPool ; <nl> class CMasterKey ; <nl> class WalletBatch <nl> <nl> bool WriteMinVersion ( int nVersion ) ; <nl> <nl> - / / / This writes directly to the database , and will not update the CWallet ' s cached accounting entries ! <nl> - / / / Use wallet . AddAccountingEntry instead , to write * and * update its caches . <nl> - bool WriteAccountingEntry ( const uint64_t nAccEntryNum , const CAccountingEntry & acentry ) ; <nl> - bool ReadAccount ( const std : : string & strAccount , CAccount & account ) ; <nl> - bool WriteAccount ( const std : : string & strAccount , const CAccount & account ) ; <nl> - bool EraseAccount ( const std : : string & strAccount ) ; <nl> - <nl> / / / Write destination data key , value tuple to database <nl> bool WriteDestData ( const std : : string & address , const std : : string & key , const std : : string & value ) ; <nl> / / / Erase destination data tuple from wallet database <nl> bool EraseDestData ( const std : : string & address , const std : : string & key ) ; <nl> <nl> - CAmount GetAccountCreditDebit ( const std : : string & strAccount ) ; <nl> - void ListAccountCreditDebit ( const std : : string & strAccount , std : : list < CAccountingEntry > & acentries ) ; <nl> - <nl> DBErrors LoadWallet ( CWallet * pwallet ) ; <nl> DBErrors FindWalletTx ( std : : vector < uint256 > & vTxHash , std : : vector < CWalletTx > & vWtx ) ; <nl> DBErrors ZapWalletTx ( std : : vector < CWalletTx > & vWtx ) ; <nl>
[ wallet ] Kill accounts
bitcoin/bitcoin
c9c32e6b844fc79467b7e24c6c916142a0d08484
2018-08-30T14:08:42Z
mmm a / configure . ac <nl> ppp b / configure . ac <nl> echo " gprof enabled = $ enable_gprof " <nl> echo " werror = $ enable_werror " <nl> echo <nl> echo " target os = $ TARGET_OS " <nl> - echo " build os = $ BUILD_OS " <nl> + echo " build os = $ build_os " <nl> echo <nl> echo " CC = $ CC " <nl> echo " CFLAGS = $ CFLAGS " <nl>
Merge : build : improve build OS configure output
bitcoin/bitcoin
b42bc33d2d4d32c11f8ad0aa812bb9b4d3ae3a5f
2020-06-04T02:44:34Z
mmm a / include / swift / AST / ASTVisitor . h <nl> ppp b / include / swift / AST / ASTVisitor . h <nl> <nl> - / / = = = - - ASTVisitor . h - Decl , Expr and Stmt Visitor mmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm ASTVisitor . h - Decl , Expr and Stmt Visitor mmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / CanTypeVisitor . h <nl> ppp b / include / swift / AST / CanTypeVisitor . h <nl> <nl> - / / = = = - - CanTypeVisitor . h - TypeVisitor specialization mmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm CanTypeVisitor . h - TypeVisitor specialization mmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DeclNodes . def <nl> ppp b / include / swift / AST / DeclNodes . def <nl> <nl> - / / = = = - - DeclNodes . def - Swift Declaration AST Metaprogramming mmm * - C + + - * - = = = / / <nl> + / / = = = mmm DeclNodes . def - Swift Declaration AST Metaprogramming - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticEngine . h <nl> ppp b / include / swift / AST / DiagnosticEngine . h <nl> <nl> - / / = = = - DiagnosticEngine . h - Diagnostic Display Engine mmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticEngine . h - Diagnostic Display Engine mmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsAll . def <nl> ppp b / include / swift / AST / DiagnosticsAll . def <nl> <nl> - / / = = = - DiagnosticsAll . def - Diagnostics Text Index mmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsAll . def - Diagnostics Text Index mmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsClangImporter . def <nl> ppp b / include / swift / AST / DiagnosticsClangImporter . def <nl> <nl> - / / = = = - DiagnosticsClangImporter . def - Diagnostics Text mmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsClangImporter . def - Diagnostics Text mmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsClangImporter . h <nl> ppp b / include / swift / AST / DiagnosticsClangImporter . h <nl> <nl> - / / = = = - DiagnosticsClangImporter . h - Diagnostic Definitions mmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsClangImporter . h - Diagnostic Definitions mmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsCommon . def <nl> ppp b / include / swift / AST / DiagnosticsCommon . def <nl> <nl> - / / = = = - DiagnosticsCommon . def - Diagnostics Text mmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsCommon . def - Diagnostics Text mmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsCommon . h <nl> ppp b / include / swift / AST / DiagnosticsCommon . h <nl> <nl> - / / = = = - DiagnosticsCommon . h - Shared Diagnostic Definitions mmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsCommon . h - Shared Diagnostic Definitions mmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsDriver . def <nl> ppp b / include / swift / AST / DiagnosticsDriver . def <nl> <nl> - / / = = = - DiagnosticsDriver . def - Diagnostics Text mmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsDriver . def - Diagnostics Text mmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsDriver . h <nl> ppp b / include / swift / AST / DiagnosticsDriver . h <nl> <nl> - / / = = = - DiagnosticsDriver . h - Diagnostic Definitions mmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsDriver . h - Diagnostic Definitions mmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsFrontend . def <nl> ppp b / include / swift / AST / DiagnosticsFrontend . def <nl> <nl> - / / = = = - DiagnosticsFrontend . def - Diagnostics Text mmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsFrontend . def - Diagnostics Text mmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsFrontend . h <nl> ppp b / include / swift / AST / DiagnosticsFrontend . h <nl> <nl> - / / = = = - DiagnosticsFrontend . h - Diagnostic Definitions mmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsFrontend . h - Diagnostic Definitions mmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsIRGen . def <nl> ppp b / include / swift / AST / DiagnosticsIRGen . def <nl> <nl> - / / = = = - DiagnosticsIRGen . def - Diagnostics Text mmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsIRGen . def - Diagnostics Text mmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsIRGen . h <nl> ppp b / include / swift / AST / DiagnosticsIRGen . h <nl> <nl> - / / = = = - DiagnosticsIRGen . h - Diagnostic Definitions mmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsIRGen . h - Diagnostic Definitions mmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsParse . def <nl> ppp b / include / swift / AST / DiagnosticsParse . def <nl> <nl> - / / = = = - DiagnosticsParse . def - Diagnostics Text mmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsParse . def - Diagnostics Text mmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsParse . h <nl> ppp b / include / swift / AST / DiagnosticsParse . h <nl> <nl> - / / = = = - DiagnosticsParse . h - Diagnostic Definitions mmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsParse . h - Diagnostic Definitions mmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsSIL . def <nl> ppp b / include / swift / AST / DiagnosticsSIL . def <nl> <nl> - / / = = = - DiagnosticsSIL . def - Diagnostics Text mmmmmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsSIL . def - Diagnostics Text mmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsSIL . h <nl> ppp b / include / swift / AST / DiagnosticsSIL . h <nl> <nl> - / / = = = - DiagnosticsSIL . h - Diagnostic Definitions mmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsSIL . h - Diagnostic Definitions mmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsSema . def <nl> ppp b / include / swift / AST / DiagnosticsSema . def <nl> <nl> - / / = = = - DiagnosticsSema . def - Diagnostics Text mmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsSema . def - Diagnostics Text mmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / DiagnosticsSema . h <nl> ppp b / include / swift / AST / DiagnosticsSema . h <nl> <nl> - / / = = = - DiagnosticsSema . h - Diagnostic Definitions mmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticsSema . h - Diagnostic Definitions mmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / KnownDecls . def <nl> ppp b / include / swift / AST / KnownDecls . def <nl> <nl> - / / = = = - - KnownDecls . def - Compiler declaration metaprogramming mmm * - C + + - * - = = = / / <nl> + / / = = = mmm KnownDecls . def - Compiler declaration metaprogramming - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / PrettyStackTrace . h <nl> ppp b / include / swift / AST / PrettyStackTrace . h <nl> <nl> - / / = = = - PrettyStackTrace . h - Crash trace information mmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm PrettyStackTrace . h - Crash trace information mmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / SubstTypeVisitor . h <nl> ppp b / include / swift / AST / SubstTypeVisitor . h <nl> <nl> - / / = = = - - SubstTypeVisitor . h - Visitor for substituted types mmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm SubstTypeVisitor . h - Visitor for substituted types mmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / TypeMatcher . h <nl> ppp b / include / swift / AST / TypeMatcher . h <nl> <nl> - / / = = = - - TypeMatcher . h - Recursive Type Matchermmmmmm - mmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm TypeMatcher . h - Recursive Type Matcher mmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / TypeMemberVisitor . h <nl> ppp b / include / swift / AST / TypeMemberVisitor . h <nl> <nl> - / / = = = - - TypeMemberVisitor . h - ASTVisitor specialization mmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm TypeMemberVisitor . h - ASTVisitor specialization mmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / AST / TypeVisitor . h <nl> ppp b / include / swift / AST / TypeVisitor . h <nl> <nl> - / / = = = - - TypeVisitor . h - Type Visitor mmmmmmmmmmmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm TypeVisitor . h - Type Visitor mmmmmmmmmmmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / AssertImplements . h <nl> ppp b / include / swift / Basic / AssertImplements . h <nl> <nl> - / / = = = - AssertImplements . h - Assert that a class overrides a function mmmmmm = = = / / <nl> + / / = = = mmm AssertImplements . h - Assert that a class overrides a function mmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / BlotMapVector . h <nl> ppp b / include / swift / Basic / BlotMapVector . h <nl> <nl> - / / = = = - BlotMapVector . h - Map vector with " blot " operation mmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm BlotMapVector . h - Map vector with " blot " operation mmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / Defer . h <nl> ppp b / include / swift / Basic / Defer . h <nl> <nl> - / / = = = - Defer . h - ' defer ' helper macro mmmmmmmmmmmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm Defer . h - ' defer ' helper macro mmmmmmmmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / DemangleNodes . def <nl> ppp b / include / swift / Basic / DemangleNodes . def <nl> <nl> - / / = = = - - DemangleNodes . def - Demangling Tree Metaprogramming mmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm DemangleNodes . def - Demangling Tree Metaprogramming mmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / DiagnosticConsumer . h <nl> ppp b / include / swift / Basic / DiagnosticConsumer . h <nl> <nl> - / / = = = - DiagnosticConsumer . h - Diagnostic Consumer Interface mmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticConsumer . h - Diagnostic Consumer Interface mmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / Fallthrough . h <nl> ppp b / include / swift / Basic / Fallthrough . h <nl> <nl> - / / = = = - Fallthrough . h - switch fallthrough annotation macro mmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm Fallthrough . h - switch fallthrough annotation macro mmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / FlaggedPointer . h <nl> ppp b / include / swift / Basic / FlaggedPointer . h <nl> <nl> - / / = = = - FlaggedPointer . h - Explicit pointer tagging container mmm - * - C + + - * - = = = / / <nl> + / / = = = mmm FlaggedPointer . h - Explicit pointer tagging container - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / Malloc . h <nl> ppp b / include / swift / Basic / Malloc . h <nl> <nl> - / / = = = - Malloc . h - Aligned malloc interface mmmmmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm Malloc . h - Aligned malloc interface mmmmmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / NullablePtr . h <nl> ppp b / include / swift / Basic / NullablePtr . h <nl> <nl> - / / = = = - NullablePtr . h - A pointer that allows null mmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm NullablePtr . h - A pointer that allows null mmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / OptionSet . h <nl> ppp b / include / swift / Basic / OptionSet . h <nl> <nl> - / / = = = - - OptionSet . h - Sets of boolean options mmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm OptionSet . h - Sets of boolean options mmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / Program . h <nl> ppp b / include / swift / Basic / Program . h <nl> <nl> - / / = = = - Program . h mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm Program . h mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / QuotedString . h <nl> ppp b / include / swift / Basic / QuotedString . h <nl> <nl> - / / = = = - QuotedString . h - Print a string in double - quotes mmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm QuotedString . h - Print a string in double - quotes mmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / Range . h <nl> ppp b / include / swift / Basic / Range . h <nl> <nl> - / / = = = - Range . h - Classes for conveniently working with ranges mmm * - C + + - * - = = = / / <nl> + / / = = = mmm Range . h - Classes for conveniently working with ranges - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / RelativePointer . h <nl> ppp b / include / swift / Basic / RelativePointer . h <nl> <nl> - / / = = = - - RelativePointer . h - Relative Pointer Support mmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm RelativePointer . h - Relative Pointer Support mmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / STLExtras . h <nl> ppp b / include / swift / Basic / STLExtras . h <nl> <nl> - / / = = = - STLExtras . h - additions to the STL mmmmmmmmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm STLExtras . h - additions to the STL mmmmmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / SourceLoc . h <nl> ppp b / include / swift / Basic / SourceLoc . h <nl> <nl> - / / = = = - SourceLoc . h - Source Locations and Ranges mmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm SourceLoc . h - Source Locations and Ranges mmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / TreeScopedHashTable . h <nl> ppp b / include / swift / Basic / TreeScopedHashTable . h <nl> <nl> - / / = = = - TreeScopedHashTable . h - Hash table with multiple active scopes mmm - - = = = / / <nl> + / / = = = mmm TreeScopedHashTable . h - Hash table with multiple active scopes mmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Basic / Version . h <nl> ppp b / include / swift / Basic / Version . h <nl> <nl> - / / = = = - Version . h - Swift Version Number mmmmmmmmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm Version . h - Swift Version Number mmmmmmmmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / ClangImporter / ClangImporterOptions . h <nl> ppp b / include / swift / ClangImporter / ClangImporterOptions . h <nl> <nl> - / / = = = - - ClangImporterOptions . h mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm ClangImporterOptions . h mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Driver / Driver . h <nl> ppp b / include / swift / Driver / Driver . h <nl> <nl> - / / = = = - - Driver . h - Swift compiler driver mmmmmmmmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm Driver . h - Swift compiler driver mmmmmmmmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Driver / OutputFileMap . h <nl> ppp b / include / swift / Driver / OutputFileMap . h <nl> <nl> - / / = = = - - OutputFileMap . h - Driver output file map mmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm OutputFileMap . h - Driver output file map mmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Frontend / DiagnosticVerifier . h <nl> ppp b / include / swift / Frontend / DiagnosticVerifier . h <nl> <nl> - / / = = = - DiagnosticVerifier . h - Diagnostic Verifier ( - verify ) mmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticVerifier . h - Diagnostic Verifier ( - verify ) mmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Frontend / Frontend . h <nl> ppp b / include / swift / Frontend / Frontend . h <nl> <nl> - / / = = = - - Frontend . h - frontend utility methods mmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm Frontend . h - frontend utility methods mmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Frontend / PrintingDiagnosticConsumer . h <nl> ppp b / include / swift / Frontend / PrintingDiagnosticConsumer . h <nl> <nl> - / / = = = - PrintingDiagnosticConsumer . h - Print Text Diagnostics mmm - * - C + + - * - = = = / / <nl> + / / = = = mmm PrintingDiagnosticConsumer . h - Print Text Diagnostics - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Frontend / SerializedDiagnosticConsumer . h <nl> ppp b / include / swift / Frontend / SerializedDiagnosticConsumer . h <nl> <nl> - / / = = = - SerializedDiagnosticConsumer . h - Serialize Diagnostics mmm * - C + + - * - = = = / / <nl> + / / = = = mmm SerializedDiagnosticConsumer . h - Serialize Diagnostics - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / IDE / CodeCompletion . h <nl> ppp b / include / swift / IDE / CodeCompletion . h <nl> <nl> - / / = = = - CodeCompletion . h - Routines for code completion mmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm CodeCompletion . h - Routines for code completion mmmmmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / IDE / CodeCompletionCache . h <nl> ppp b / include / swift / IDE / CodeCompletionCache . h <nl> <nl> - / / = = = - CodeCompletionCache . h - Routines for code completion caching mmmmmm - = = = / / <nl> + / / = = = mmm CodeCompletionCache . h - Routines for code completion caching mmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / IDE / SourceEntityWalker . h <nl> ppp b / include / swift / IDE / SourceEntityWalker . h <nl> <nl> - / / = = = - SourceEntityWalker . h - Routines for semantic source info mmmmmmmmm - - = = = / / <nl> + / / = = = mmm SourceEntityWalker . h - Routines for semantic source info mmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / IDE / SyntaxModel . h <nl> ppp b / include / swift / IDE / SyntaxModel . h <nl> <nl> - / / = = = - SyntaxModel . h - Routines for IDE syntax model mmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm SyntaxModel . h - Routines for IDE syntax model mmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / IDE / Utils . h <nl> ppp b / include / swift / IDE / Utils . h <nl> <nl> - / / = = = - Utils . h - Misc utilities mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm Utils . h - Misc utilities mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Immediate / Immediate . h <nl> ppp b / include / swift / Immediate / Immediate . h <nl> <nl> - / / = = = - - Immediate . h - Entry point for swift immediate mode mmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm Immediate . h - Entry point for swift immediate mode mmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / PrintAsObjC / PrintAsObjC . h <nl> ppp b / include / swift / PrintAsObjC / PrintAsObjC . h <nl> <nl> - / / = = = - - PrintAsObjC . h - Emit a header file for a Swift AST mmmmmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm PrintAsObjC . h - Emit a header file for a Swift AST mmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SIL / LoopInfo . h <nl> ppp b / include / swift / SIL / LoopInfo . h <nl> <nl> - / / = = = mmmmmmmmmmmm - - LoopInfo . h - SIL Loop Analysis mmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm LoopInfo . h - SIL Loop Analysis mmmmmmmmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SIL / PrettyStackTrace . h <nl> ppp b / include / swift / SIL / PrettyStackTrace . h <nl> <nl> - / / = = = - PrettyStackTrace . h - Crash trace information mmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm PrettyStackTrace . h - Crash trace information mmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SIL / SILValueProjection . h <nl> ppp b / include / swift / SIL / SILValueProjection . h <nl> <nl> - / / = = = mmmmmmmmmmmmmmmmmmmmmmmm SILValueProjection . h mmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm SILValueProjection . h mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / Analysis / ARCAnalysis . h <nl> ppp b / include / swift / SILOptimizer / Analysis / ARCAnalysis . h <nl> <nl> - / / = = = mmmmmmmmmmmmmmm ARCAnalysis . h - SIL ARC Analysis mmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm ARCAnalysis . h - SIL ARC Analysis mmmmmmmmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / Analysis / AliasAnalysis . h <nl> ppp b / include / swift / SILOptimizer / Analysis / AliasAnalysis . h <nl> <nl> - / / = = = mmmmmmmmmmmm - - AliasAnalysis . h - SIL Alias Analysis mmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm AliasAnalysis . h - SIL Alias Analysis mmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / Analysis / Analysis . h <nl> ppp b / include / swift / SILOptimizer / Analysis / Analysis . h <nl> <nl> - / / = = = - - Analysis . h - Swift Analysis mmmmmmmmmmmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm Analysis . h - Swift Analysis mmmmmmmmmmmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / Analysis / ColdBlockInfo . h <nl> ppp b / include / swift / SILOptimizer / Analysis / ColdBlockInfo . h <nl> <nl> - / / = = = - - ColdBlockInfo . h - Fast / slow path analysis for SIL CFG mmm * - C + + - * - = = = / / <nl> + / / = = = mmm ColdBlockInfo . h - Fast / slow path analysis for SIL CFG - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / Analysis / EscapeAnalysis . h <nl> ppp b / include / swift / SILOptimizer / Analysis / EscapeAnalysis . h <nl> <nl> - / / = = = mmmmmmmmm - - EscapeAnalysis . h - SIL Escape Analysis mmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm EscapeAnalysis . h - SIL Escape Analysis mmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / Analysis / IVAnalysis . h <nl> ppp b / include / swift / SILOptimizer / Analysis / IVAnalysis . h <nl> <nl> - / / = = = mmmmmmmmmmmmmmmmmm - IVAnalysis . h - SIL IV Analysis mmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm IVAnalysis . h - SIL IV Analysis mmmmmmmmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / Analysis / LoopAnalysis . h <nl> ppp b / include / swift / SILOptimizer / Analysis / LoopAnalysis . h <nl> <nl> - / / = = = mmmmmmmmmmmm - - LoopAnalysis . h - SIL Loop Analysis mmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm LoopAnalysis . h - SIL Loop Analysis mmmmmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / Analysis / SideEffectAnalysis . h <nl> ppp b / include / swift / SILOptimizer / Analysis / SideEffectAnalysis . h <nl> <nl> - / / = = = mmmmmm SideEffectAnalysis . h - SIL Side Effect Analysis mmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm SideEffectAnalysis . h - SIL Side Effect Analysis mmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / Analysis / ValueTracking . h <nl> ppp b / include / swift / SILOptimizer / Analysis / ValueTracking . h <nl> <nl> - / / = = = - - ValueTracking . h - SIL Value Tracking Analysis mmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm ValueTracking . h - SIL Value Tracking Analysis mmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / PassManager / PassManager . h <nl> ppp b / include / swift / SILOptimizer / PassManager / PassManager . h <nl> <nl> - / / = = = - - PassManager . h - Swift Pass Manager mmmmmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm PassManager . h - Swift Pass Manager mmmmmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / PassManager / Passes . h <nl> ppp b / include / swift / SILOptimizer / PassManager / Passes . h <nl> <nl> - / / = = = mmmmmm - - Passes . h - Swift Compiler SIL Pass Entrypoints mmm - * - C + + - * - = = = / / <nl> + / / = = = mmm Passes . h - Swift Compiler SIL Pass Entrypoints mmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / PassManager / Transforms . h <nl> ppp b / include / swift / SILOptimizer / PassManager / Transforms . h <nl> <nl> - / / = = = - - Transforms . h - Swift Transformations mmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm Transforms . h - Swift Transformations mmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / Utils / Devirtualize . h <nl> ppp b / include / swift / SILOptimizer / Utils / Devirtualize . h <nl> <nl> - / / = = = - - Devirtualize . h - Helper for devirtualizing apply mmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm Devirtualize . h - Helper for devirtualizing apply mmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / Utils / GenericCloner . h <nl> ppp b / include / swift / SILOptimizer / Utils / GenericCloner . h <nl> <nl> - / / = = = - - GenericCloner . h - Specializes generic functions mmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm GenericCloner . h - Specializes generic functions mmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / Utils / Generics . h <nl> ppp b / include / swift / SILOptimizer / Utils / Generics . h <nl> <nl> - / / = = = - - Generics . h - Utilities for transforming generics mmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm Generics . h - Utilities for transforming generics mmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / Utils / SCCVisitor . h <nl> ppp b / include / swift / SILOptimizer / Utils / SCCVisitor . h <nl> <nl> - / / = = = mmmmmmmmmmmmmmmmmm - SCCVisitor . h - SIL SCC Visitor mmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm SCCVisitor . h - SIL SCC Visitor mmmmmmmmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / SILOptimizer / Utils / SILSSAUpdater . h <nl> ppp b / include / swift / SILOptimizer / Utils / SILSSAUpdater . h <nl> <nl> - / / = = = mmmmmm SILSSAUpdater . h - Unstructured SSA Update Tool mmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm SILSSAUpdater . h - Unstructured SSA Update Tool mmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / include / swift / Sema / TypeCheckRequestPayloads . def <nl> ppp b / include / swift / Sema / TypeCheckRequestPayloads . def <nl> <nl> - / / = = = - - TypeCheckRequestPayloads . def - Type Checking Payloads mmm * - C + + - * - = = = / / <nl> + / / = = = mmm TypeCheckRequestPayloads . def - Type Checking Payloads - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / AST / DiagnosticEngine . cpp <nl> ppp b / lib / AST / DiagnosticEngine . cpp <nl> <nl> - / / = = = - DiagnosticEngine . cpp - Diagnostic Display Engine mmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticEngine . cpp - Diagnostic Display Engine mmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / AST / DiagnosticList . cpp <nl> ppp b / lib / AST / DiagnosticList . cpp <nl> <nl> - / / = = = - DiagnosticList . cpp - Diagnostic Definitions mmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm DiagnosticList . cpp - Diagnostic Definitions mmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Basic / DiagnosticConsumer . cpp <nl> ppp b / lib / Basic / DiagnosticConsumer . cpp <nl> <nl> - / / = = = - DiagnosticConsumer . cpp - Diagnostic Consumer Impl mmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm DiagnosticConsumer . cpp - Diagnostic Consumer Impl mmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Basic / Platform . cpp <nl> ppp b / lib / Basic / Platform . cpp <nl> <nl> - / / = = = - - Platform . cpp - Implement platform - related helpers mmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm Platform . cpp - Implement platform - related helpers mmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Basic / Program . cpp <nl> ppp b / lib / Basic / Program . cpp <nl> <nl> - / / = = = - - Program . cpp - Implement OS Program Concept mmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm Program . cpp - Implement OS Program Concept mmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Driver / Driver . cpp <nl> ppp b / lib / Driver / Driver . cpp <nl> <nl> - / / = = = - - Driver . cpp - Swift compiler driver mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm Driver . cpp - Swift compiler driver mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Driver / OutputFileMap . cpp <nl> ppp b / lib / Driver / OutputFileMap . cpp <nl> <nl> - / / = = = - - OutputFileMap . cpp - Driver output file map mmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm OutputFileMap . cpp - Driver output file map mmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Frontend / CompilerInvocation . cpp <nl> ppp b / lib / Frontend / CompilerInvocation . cpp <nl> <nl> - / / = = = - - CompilerInvocation . cpp - CompilerInvocation methods mmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm CompilerInvocation . cpp - CompilerInvocation methods mmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Frontend / DiagnosticVerifier . cpp <nl> ppp b / lib / Frontend / DiagnosticVerifier . cpp <nl> <nl> - / / = = = - DiagnosticVerifier . cpp - Diagnostic Verifier ( - verify ) mmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm DiagnosticVerifier . cpp - Diagnostic Verifier ( - verify ) mmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Frontend / Frontend . cpp <nl> ppp b / lib / Frontend / Frontend . cpp <nl> <nl> - / / = = = - - Frontend . cpp - frontend utility methods mmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm Frontend . cpp - frontend utility methods mmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Frontend / PrintingDiagnosticConsumer . cpp <nl> ppp b / lib / Frontend / PrintingDiagnosticConsumer . cpp <nl> <nl> - / / = = = - PrintingDiagnosticConsumer . cpp - Print Text Diagnostics mmmmmmmmmmmm = = = / / <nl> + / / = = = mmm PrintingDiagnosticConsumer . cpp - Print Text Diagnostics mmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / IDE / CodeCompletion . cpp <nl> ppp b / lib / IDE / CodeCompletion . cpp <nl> <nl> - / / = = = - CodeCompletion . cpp - Code completion implementation mmmmmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm CodeCompletion . cpp - Code completion implementation mmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / IDE / CodeCompletionResultBuilder . h <nl> ppp b / lib / IDE / CodeCompletionResultBuilder . h <nl> <nl> - / / = = = - CodeCompletionResultBuilder . h - Build completion results mmmmmmmmm - - = = = / / <nl> + / / = = = mmm CodeCompletionResultBuilder . h - Build completion results mmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / IDE / SourceEntityWalker . cpp <nl> ppp b / lib / IDE / SourceEntityWalker . cpp <nl> <nl> - / / = = = - SourceEntityWalker . cpp - Routines for semantic source info mmmmmmmmm = = = / / <nl> + / / = = = mmm SourceEntityWalker . cpp - Routines for semantic source info mmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / IDE / SyntaxModel . cpp <nl> ppp b / lib / IDE / SyntaxModel . cpp <nl> <nl> - / / = = = - SyntaxModel . cpp - Routines for IDE syntax model mmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm SyntaxModel . cpp - Routines for IDE syntax model mmmmmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / IRGen / RuntimeFunctions . def <nl> ppp b / lib / IRGen / RuntimeFunctions . def <nl> <nl> - / / = = = - - RuntimeFunctions . def - Runtime Functions Database mmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm RuntimeFunctions . def - Runtime Functions Database mmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / IRGen / TypeVisitor . h <nl> ppp b / lib / IRGen / TypeVisitor . h <nl> <nl> - / / = = = - - TypeVisitor . h - IR - gen TypeVisitor specialization mmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm TypeVisitor . h - IR - gen TypeVisitor specialization mmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Immediate / Immediate . cpp <nl> ppp b / lib / Immediate / Immediate . cpp <nl> <nl> - / / = = = - - Immediate . cpp - the swift immediate mode mmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm Immediate . cpp - the swift immediate mode mmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / Immediate / REPL . cpp <nl> ppp b / lib / Immediate / REPL . cpp <nl> <nl> - / / = = = - - REPL . cpp - the integrated REPL mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm REPL . cpp - the integrated REPL mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / PrintAsObjC / PrintAsObjC . cpp <nl> ppp b / lib / PrintAsObjC / PrintAsObjC . cpp <nl> <nl> - / / = = = - - PrintAsObjC . cpp - Emit a header file for a Swift AST mmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm PrintAsObjC . cpp - Emit a header file for a Swift AST mmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SIL / LoopInfo . cpp <nl> ppp b / lib / SIL / LoopInfo . cpp <nl> <nl> - / / = = = mmmmmmmmmmmm - - LoopInfo . cpp - SIL Loop Analysis mmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm LoopInfo . cpp - SIL Loop Analysis mmmmmmmmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SIL / SILValueProjection . cpp <nl> ppp b / lib / SIL / SILValueProjection . cpp <nl> <nl> - / / = = = mmmmmmmmmmmmmmmmmmmmmmmm - SILValueProjection . cpp mmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm SILValueProjection . cpp mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILGen / ASTVisitor . h <nl> ppp b / lib / SILGen / ASTVisitor . h <nl> <nl> - / / = = = - - ASTVisitor . h - SILGen ASTVisitor specialization mmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm ASTVisitor . h - SILGen ASTVisitor specialization mmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Analysis / ARCAnalysis . cpp <nl> ppp b / lib / SILOptimizer / Analysis / ARCAnalysis . cpp <nl> <nl> - / / = = = mmmmmmmmmmmm - - ARCAnalysis . cpp - SIL ARC Analysis mmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm ARCAnalysis . cpp - SIL ARC Analysis mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Analysis / AliasAnalysis . cpp <nl> ppp b / lib / SILOptimizer / Analysis / AliasAnalysis . cpp <nl> <nl> - / / = = = mmmmmmmmmmmm - - AliasAnalysis . cpp - SIL Alias Analysis mmmmmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm AliasAnalysis . cpp - SIL Alias Analysis mmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Analysis / Analysis . cpp <nl> ppp b / lib / SILOptimizer / Analysis / Analysis . cpp <nl> <nl> - / / = = = mmm - - Analysis . cpp - Swift Analysis mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm Analysis . cpp - Swift Analysis mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Analysis / BasicCalleeAnalysis . cpp <nl> ppp b / lib / SILOptimizer / Analysis / BasicCalleeAnalysis . cpp <nl> <nl> - / / = = = - BasicCalleeAnalysis . cpp - Determine callees per call site mmmmmmmmm - = = = / / <nl> + / / = = = mmm BasicCalleeAnalysis . cpp - Determine callees per call site mmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Analysis / ColdBlockInfo . cpp <nl> ppp b / lib / SILOptimizer / Analysis / ColdBlockInfo . cpp <nl> <nl> - / / = = = mmm - - ColdBlockInfo . cpp - Fast / slow path analysis for the SIL CFG mmm - = = = / / <nl> + / / = = = mmm ColdBlockInfo . cpp - Fast / slow path analysis for the SIL CFG mmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Analysis / EscapeAnalysis . cpp <nl> ppp b / lib / SILOptimizer / Analysis / EscapeAnalysis . cpp <nl> <nl> - / / = = = mmmmmmmmmmmm - - EscapeAnalysis . cpp - SIL Escape Analysis mmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm EscapeAnalysis . cpp - SIL Escape Analysis mmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Analysis / FunctionOrder . cpp <nl> ppp b / lib / SILOptimizer / Analysis / FunctionOrder . cpp <nl> <nl> - / / = = = mmm - - FunctionOrder . cpp - Utility for function ordering mmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm FunctionOrder . cpp - Utility for function ordering mmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Analysis / IVAnalysis . cpp <nl> ppp b / lib / SILOptimizer / Analysis / IVAnalysis . cpp <nl> <nl> - / / = = = mmmmmmmmmmmmmmm - - IVAnalysis . cpp - SIL IV Analysis mmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm IVAnalysis . cpp - SIL IV Analysis mmmmmmmmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Analysis / LoopAnalysis . cpp <nl> ppp b / lib / SILOptimizer / Analysis / LoopAnalysis . cpp <nl> <nl> - / / = = = mmmmmmmmmmmm - - LoopAnalysis . cpp - SIL Loop Analysis mmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm LoopAnalysis . cpp - SIL Loop Analysis mmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Analysis / SideEffectAnalysis . cpp <nl> ppp b / lib / SILOptimizer / Analysis / SideEffectAnalysis . cpp <nl> <nl> - / / = = = mmmmmmmmm - SideEffectAnalysis . cpp - SIL Side Effect Analysis mmmmmmmmm = = = / / <nl> + / / = = = mmm SideEffectAnalysis . cpp - SIL Side Effect Analysis mmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Analysis / TypeExpansionAnalysis . cpp <nl> ppp b / lib / SILOptimizer / Analysis / TypeExpansionAnalysis . cpp <nl> <nl> - / / = = = mmmmmmmmm - TypeExpansionAnalysis . cpp - Type Expansion Analysis mmmmmm - = = = / / <nl> + / / = = = mmm TypeExpansionAnalysis . cpp - Type Expansion Analysis mmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Analysis / ValueTracking . cpp <nl> ppp b / lib / SILOptimizer / Analysis / ValueTracking . cpp <nl> <nl> - / / = = = - - ValueTracking . cpp - SIL Value Tracking Analysis mmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm ValueTracking . cpp - SIL Value Tracking Analysis mmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / IPO / CapturePropagation . cpp <nl> ppp b / lib / SILOptimizer / IPO / CapturePropagation . cpp <nl> <nl> - / / = = = mmm - CapturePropagation . cpp - Propagate closure capture constants mmm - = = = / / <nl> + / / = = = mmm CapturePropagation . cpp - Propagate closure capture constants mmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / IPO / ClosureSpecializer . cpp <nl> ppp b / lib / SILOptimizer / IPO / ClosureSpecializer . cpp <nl> <nl> - / / = = = mmm - ClosureSpecializer . cpp mmmmmm Performs Closure Specializationmmm - = = = / / <nl> + / / = = = mmm ClosureSpecializer . cpp - Performs Closure Specialization mmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / IPO / FunctionSignatureOpts . cpp <nl> ppp b / lib / SILOptimizer / IPO / FunctionSignatureOpts . cpp <nl> <nl> - / / = = = - - FunctionSignatureOpts . cpp - Optimizes function signatures mmmmmmmmm = = = / / <nl> + / / = = = mmm FunctionSignatureOpts . cpp - Optimizes function signatures mmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / IPO / LetPropertiesOpts . cpp <nl> ppp b / lib / SILOptimizer / IPO / LetPropertiesOpts . cpp <nl> <nl> - / / = = = mmmmmmmmm - LetPropertiesOpts . cpp - Optimize let properties mmmmmmmmm - - = = = / / <nl> + / / = = = mmm LetPropertiesOpts . cpp - Optimize let properties mmmmmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / IPO / UsePrespecialized . cpp <nl> ppp b / lib / SILOptimizer / IPO / UsePrespecialized . cpp <nl> <nl> - / / = = = mmmmmm - UsePrespecialized . cpp - use pre - specialized functions mmmmmm - - = = = / / <nl> + / / = = = mmm UsePrespecialized . cpp - use pre - specialized functions mmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / LoopTransforms / ArrayBoundsCheckOpts . cpp <nl> ppp b / lib / SILOptimizer / LoopTransforms / ArrayBoundsCheckOpts . cpp <nl> <nl> - / / = = = mmm - - ArrayBoundsCheckOpts . cpp - Bounds check elim mmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm ArrayBoundsCheckOpts . cpp - Bounds check elim mmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / LoopTransforms / COWArrayOpt . cpp <nl> ppp b / lib / SILOptimizer / LoopTransforms / COWArrayOpt . cpp <nl> <nl> - / / = = = mmmmmm - COWArrayOpt . cpp - Optimize Copy - On - Write Array Checks mmmmmm - - = = = / / <nl> + / / = = = mmm COWArrayOpt . cpp - Optimize Copy - On - Write Array Checks mmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / LoopTransforms / LICM . cpp <nl> ppp b / lib / SILOptimizer / LoopTransforms / LICM . cpp <nl> <nl> - / / = = = mmmmmmmmm LICM . cpp - Loop invariant code motion mmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm LICM . cpp - Loop invariant code motion mmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / LoopTransforms / LoopRotate . cpp <nl> ppp b / lib / SILOptimizer / LoopTransforms / LoopRotate . cpp <nl> <nl> - / / = = = mmmmmmmmm LoopRotate . cpp - Loop structure simplify mmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm LoopRotate . cpp - Loop structure simplify mmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / LoopTransforms / LoopUnroll . cpp <nl> ppp b / lib / SILOptimizer / LoopTransforms / LoopUnroll . cpp <nl> <nl> - / / = = = mmmmmmmmm LoopUnroll . cpp - Loop unrolling mmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm LoopUnroll . cpp - Loop unrolling mmmmmmmmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / PassManager / PassManager . cpp <nl> ppp b / lib / SILOptimizer / PassManager / PassManager . cpp <nl> <nl> - / / = = = mmm - - PassManager . cpp - Swift Pass Manager mmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm PassManager . cpp - Swift Pass Manager mmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / PassManager / Passes . cpp <nl> ppp b / lib / SILOptimizer / PassManager / Passes . cpp <nl> <nl> - / / = = = mmmmmm - - Passes . cpp - Swift Compiler SIL Pass Entrypoints mmmmmmmmmmmm = = = / / <nl> + / / = = = mmm Passes . cpp - Swift Compiler SIL Pass Entrypoints mmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / SILCombiner / SILCombine . cpp <nl> ppp b / lib / SILOptimizer / SILCombiner / SILCombine . cpp <nl> <nl> - / / = = = mmmmmmmmmmmmmmmmmmmmmmmm - - SILCombine mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm SILCombine mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / SILCombiner / SILCombiner . h <nl> ppp b / lib / SILOptimizer / SILCombiner / SILCombiner . h <nl> <nl> - / / = = = mmmmmmmmmmmmmmmmmmmmmmmm - - SILCombiner . h mmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm SILCombiner . h mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / SILCombiner / SILCombinerMiscVisitors . cpp <nl> ppp b / lib / SILOptimizer / SILCombiner / SILCombinerMiscVisitors . cpp <nl> <nl> - / / = = = mmm - SILCombinerMiscVisitors . cpp mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm SILCombinerMiscVisitors . cpp mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / ArrayCountPropagation . cpp <nl> ppp b / lib / SILOptimizer / Transforms / ArrayCountPropagation . cpp <nl> <nl> - / / = = = mmmmmm ArrayCountPropagation . cpp - Propagate the count of arrays mmm - - = = = / / <nl> + / / = = = mmm ArrayCountPropagation . cpp - Propagate the count of arrays mmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / CSE . cpp <nl> ppp b / lib / SILOptimizer / Transforms / CSE . cpp <nl> <nl> - / / = = = - CSE . cpp - Simple and fast CSE pass mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm CSE . cpp - Simple and fast CSE pass mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / DeadObjectElimination . cpp <nl> ppp b / lib / SILOptimizer / Transforms / DeadObjectElimination . cpp <nl> <nl> - / / = = = - - DeadObjectElimination . cpp - Remove unused objects mmmmmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm DeadObjectElimination . cpp - Remove unused objects mmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / DeadStoreElimination . cpp <nl> ppp b / lib / SILOptimizer / Transforms / DeadStoreElimination . cpp <nl> <nl> - / / = = = mmm - DeadStoreElimination . cpp - SIL Dead Store Elimination mmmmmmmmm - - = = = / / <nl> + / / = = = mmm DeadStoreElimination . cpp - SIL Dead Store Elimination mmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / Devirtualizer . cpp <nl> ppp b / lib / SILOptimizer / Transforms / Devirtualizer . cpp <nl> <nl> - / / = = = mmmmmm - - Devirtualizer . cpp - Devirtualize indirect calls mmmmmmmmmmmm = = = / / <nl> + / / = = = mmm Devirtualizer . cpp - Devirtualize indirect calls mmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / GenericSpecializer . cpp <nl> ppp b / lib / SILOptimizer / Transforms / GenericSpecializer . cpp <nl> <nl> - / / = = = - - GenericSpecializer . cpp - Specialization of generic functions mmmmmm = = = / / <nl> + / / = = = mmm GenericSpecializer . cpp - Specialization of generic functions mmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / MergeCondFail . cpp <nl> ppp b / lib / SILOptimizer / Transforms / MergeCondFail . cpp <nl> <nl> - / / = = = - - MergeCondFail . cpp - Merge cond_fail instructions mmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm MergeCondFail . cpp - Merge cond_fail instructions mmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / RedundantLoadElimination . cpp <nl> ppp b / lib / SILOptimizer / Transforms / RedundantLoadElimination . cpp <nl> <nl> - / / = = = mmmmmm - - RedundantLoadElimination . cpp - SIL Load Forwarding mmmmmmmmm - = = = / / <nl> + / / = = = mmm RedundantLoadElimination . cpp - SIL Load Forwarding mmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / RedundantOverflowCheckRemoval . cpp <nl> ppp b / lib / SILOptimizer / Transforms / RedundantOverflowCheckRemoval . cpp <nl> <nl> - / / = = = - - RedundantOverflowCheckRemoval . cpp mmmmmmmmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm RedundantOverflowCheckRemoval . cpp mmmmmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / ReleaseDevirtualizer . cpp <nl> ppp b / lib / SILOptimizer / Transforms / ReleaseDevirtualizer . cpp <nl> <nl> - / / = = = mmm - ReleaseDevirtualizer . cpp - Devirtualizes release - instructions mmm = = = / / <nl> + / / = = = mmm ReleaseDevirtualizer . cpp - Devirtualizes release - instructions mmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / RemovePin . cpp <nl> ppp b / lib / SILOptimizer / Transforms / RemovePin . cpp <nl> <nl> - / / = = = mmmmmm - RemovePin . cpp - StrongPin / Unpin removal mmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm RemovePin . cpp - StrongPin / Unpin removal mmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / SILCleanup . cpp <nl> ppp b / lib / SILOptimizer / Transforms / SILCleanup . cpp <nl> <nl> - / / = = = - - SILCleanup . cpp - Removes diagnostics instructions mmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm SILCleanup . cpp - Removes diagnostics instructions mmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / SILCodeMotion . cpp <nl> ppp b / lib / SILOptimizer / Transforms / SILCodeMotion . cpp <nl> <nl> - / / = = = - SILCodeMotion . cpp - Code Motion Optimizations mmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm SILCodeMotion . cpp - Code Motion Optimizations mmmmmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / SILLowerAggregateInstrs . cpp <nl> ppp b / lib / SILOptimizer / Transforms / SILLowerAggregateInstrs . cpp <nl> <nl> - / / = = = - SILLowerAggregateInstrs . cpp - Aggregate insts to Scalar insts mmm - - = = = / / <nl> + / / = = = mmm SILLowerAggregateInstrs . cpp - Aggregate insts to Scalar insts mmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / SILSROA . cpp <nl> ppp b / lib / SILOptimizer / Transforms / SILSROA . cpp <nl> <nl> - / / = = = - - SILSROA . cpp - Scalar Replacement of Aggregates mmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm SILSROA . cpp - Scalar Replacement of Aggregates mmmmmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / Sink . cpp <nl> ppp b / lib / SILOptimizer / Transforms / Sink . cpp <nl> <nl> - / / = = = - - Sink . cpp mmm - - Code Sinking mmmmmmmmmmmmmmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm Sink . cpp mmm - - Code Sinking mmmmmmmmmmmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Transforms / StackPromotion . cpp <nl> ppp b / lib / SILOptimizer / Transforms / StackPromotion . cpp <nl> <nl> - / / = = = mmmmmm - StackPromotion . cpp - Promotes allocations to the stack mmmmmm - = = = / / <nl> + / / = = = mmm StackPromotion . cpp - Promotes allocations to the stack mmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / UtilityPasses / AADumper . cpp <nl> ppp b / lib / SILOptimizer / UtilityPasses / AADumper . cpp <nl> <nl> - / / = = = mmmmmm - - AADumper . cpp - Compare all values in Function with AA mmmmmm - = = = / / <nl> + / / = = = mmm AADumper . cpp - Compare all values in Function with AA mmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / UtilityPasses / BasicCalleePrinter . cpp <nl> ppp b / lib / SILOptimizer / UtilityPasses / BasicCalleePrinter . cpp <nl> <nl> - / / = = = - - BasicCalleePrinter . cpp - Callee cache printing pass mmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm BasicCalleePrinter . cpp - Callee cache printing pass mmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / UtilityPasses / CFGPrinter . cpp <nl> ppp b / lib / SILOptimizer / UtilityPasses / CFGPrinter . cpp <nl> <nl> - / / = = = - - CFGPrinter . cpp - CFG printer pass mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm CFGPrinter . cpp - CFG printer pass mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / UtilityPasses / EscapeAnalysisDumper . cpp <nl> ppp b / lib / SILOptimizer / UtilityPasses / EscapeAnalysisDumper . cpp <nl> <nl> - / / = = = mmmmmm - - EscapeAnalysisDumper . cpp - Dumps the escape analysis mmmmmm - - = = = / / <nl> + / / = = = mmm EscapeAnalysisDumper . cpp - Dumps the escape analysis mmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / UtilityPasses / FunctionOrderPrinter . cpp <nl> ppp b / lib / SILOptimizer / UtilityPasses / FunctionOrderPrinter . cpp <nl> <nl> - / / = = = - - FunctionOrderPrinter . cpp - Function ordering test pass mmmmmmmmmmmm = = = / / <nl> + / / = = = mmm FunctionOrderPrinter . cpp - Function ordering test pass mmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / UtilityPasses / IVInfoPrinter . cpp <nl> ppp b / lib / SILOptimizer / UtilityPasses / IVInfoPrinter . cpp <nl> <nl> - / / = = = mmmmmmmmmmmm IVInfoPrinter . cpp - Print SIL IV Info mmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm IVInfoPrinter . cpp - Print SIL IV Info mmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / UtilityPasses / InstCount . cpp <nl> ppp b / lib / SILOptimizer / UtilityPasses / InstCount . cpp <nl> <nl> - / / = = = - - InstCount . cpp - Collects the count of all instructions mmmmmmmmmmmm = = = / / <nl> + / / = = = mmm InstCount . cpp - Collects the count of all instructions mmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / UtilityPasses / LoopInfoPrinter . cpp <nl> ppp b / lib / SILOptimizer / UtilityPasses / LoopInfoPrinter . cpp <nl> <nl> - / / = = = mmmmmmmmmmmm LoopInfoPrinter . cpp - Print SIL Loop Info mmm - - * - C + + - * - = = = / / <nl> + / / = = = mmm LoopInfoPrinter . cpp - Print SIL Loop Info mmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / UtilityPasses / SideEffectsDumper . cpp <nl> ppp b / lib / SILOptimizer / UtilityPasses / SideEffectsDumper . cpp <nl> <nl> - / / = = = mmmmmm - SideEffectsDumper . cpp - Dumps the side effect analysis mmmmmm - = = = / / <nl> + / / = = = mmm SideEffectsDumper . cpp - Dumps the side effect analysis mmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / UtilityPasses / StripDebugInfo . cpp <nl> ppp b / lib / SILOptimizer / UtilityPasses / StripDebugInfo . cpp <nl> <nl> - / / = = = mmmmmm - - StripDebugInfo . cpp - Strip debug info from SIL mmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm StripDebugInfo . cpp - Strip debug info from SIL mmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Utils / Devirtualize . cpp <nl> ppp b / lib / SILOptimizer / Utils / Devirtualize . cpp <nl> <nl> - / / = = = - - Devirtualize . cpp - Helper for devirtualizing apply mmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm Devirtualize . cpp - Helper for devirtualizing apply mmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Utils / GenericCloner . cpp <nl> ppp b / lib / SILOptimizer / Utils / GenericCloner . cpp <nl> <nl> - / / = = = mmmmmmmmm GenericCloner . cpp - Specializes generic functions mmmmmmmmm = = = / / <nl> + / / = = = mmm GenericCloner . cpp - Specializes generic functions mmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Utils / Generics . cpp <nl> ppp b / lib / SILOptimizer / Utils / Generics . cpp <nl> <nl> - / / = = = - Generics . cpp mmm - Utilities for transforming generics mmm - * - C + + - * - = = = / / <nl> + / / = = = mmm Generics . cpp mmm - Utilities for transforming generics - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SILOptimizer / Utils / SILSSAUpdater . cpp <nl> ppp b / lib / SILOptimizer / Utils / SILSSAUpdater . cpp <nl> <nl> - / / = = = mmmmmm SILSSAUpdater . cpp - Unstructured SSA Update Tool mmm - * - C + + - * - = = = / / <nl> + / / = = = mmm SILSSAUpdater . cpp - Unstructured SSA Update Tool mmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / lib / SwiftDemangle / MangleHack . cpp <nl> ppp b / lib / SwiftDemangle / MangleHack . cpp <nl> <nl> - / / = = = - - MangleHack . cpp - Swift Mangle Hack for various clients mmmmmmmmmmmm = = = / / <nl> + / / = = = mmm MangleHack . cpp - Swift Mangle Hack for various clients mmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / stdlib / public / core / Range . swift <nl> ppp b / stdlib / public / core / Range . swift <nl> <nl> - / / = = = - Range . swift mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - * - swift - * - = = = / / <nl> + / / = = = mmm Range . swift mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm * - swift - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / stdlib / public / core / RangeMirrors . swift . gyb <nl> ppp b / stdlib / public / core / RangeMirrors . swift . gyb <nl> <nl> - / / = = = - RangeMirrors . swift . gyb mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm * - swift - * - = = = / / <nl> + / / = = = mmm RangeMirrors . swift . gyb mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - * - swift - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / stdlib / public / stubs / UnicodeExtendedGraphemeClusters . cpp . gyb <nl> ppp b / stdlib / public / stubs / UnicodeExtendedGraphemeClusters . cpp . gyb <nl> <nl> - / / = = = - UnicodeExtendedGraphemeClusters . cpp . gyb mmmmmmmmmmmmmmmmmm * - C + + - * - = = = / / <nl> + / / = = = mmm UnicodeExtendedGraphemeClusters . cpp . gyb mmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / SourceKit / include / SourceKit / Support / Logging . h <nl> ppp b / tools / SourceKit / include / SourceKit / Support / Logging . h <nl> <nl> - / / = = = - Logging . h - Logging Interface mmmmmmmmmmmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm Logging . h - Logging Interface mmmmmmmmmmmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / SourceKit / include / SourceKit / Support / Tracing . h <nl> ppp b / tools / SourceKit / include / SourceKit / Support / Tracing . h <nl> <nl> - / / = = = - Tracing . h - Tracing Interface mmmmmmmmmmmmmmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm Tracing . h - Tracing Interface mmmmmmmmmmmmmmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / SourceKit / tools / sourcekitd / include / sourcekitd / XpcTracing . h <nl> ppp b / tools / SourceKit / tools / sourcekitd / include / sourcekitd / XpcTracing . h <nl> <nl> - / / = = = - XpcTracing . h - XPC - side Tracing Interface mmmmmmmmmmmmmmm - * - C + + - * - = = = / / <nl> + / / = = = mmm XpcTracing . h - XPC - side Tracing Interface mmmmmmmmmmmm - - * - C + + - * - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / driver / autolink_extract_main . cpp <nl> ppp b / tools / driver / autolink_extract_main . cpp <nl> <nl> - / / = = = - - autolink_extract_main . cpp - autolink extraction utility mmmmmmmmm - - = = = / / <nl> + / / = = = mmm autolink_extract_main . cpp - autolink extraction utility mmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / driver / driver . cpp <nl> ppp b / tools / driver / driver . cpp <nl> <nl> - / / = = = - - driver . cpp - Swift Compiler Driver mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm driver . cpp - Swift Compiler Driver mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / driver / frontend_main . cpp <nl> ppp b / tools / driver / frontend_main . cpp <nl> <nl> - / / = = = - - frontend_main . cpp - Swift Compiler Frontend mmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm frontend_main . cpp - Swift Compiler Frontend mmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / driver / modulewrap_main . cpp <nl> ppp b / tools / driver / modulewrap_main . cpp <nl> <nl> - / / = = = - - modulewrap_main . cpp - module wrapping utility mmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm modulewrap_main . cpp - module wrapping utility mmmmmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / lldb - moduleimport - test / lldb - moduleimport - test . cpp <nl> ppp b / tools / lldb - moduleimport - test / lldb - moduleimport - test . cpp <nl> <nl> - / / = = = - - lldb - moduleimport - test . cpp - LLDB moduleimport tester mmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm lldb - moduleimport - test . cpp - LLDB moduleimport tester mmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / sil - extract / SILExtract . cpp <nl> ppp b / tools / sil - extract / SILExtract . cpp <nl> <nl> - / / = = = - - SILExtract . cpp - SIL function extraction utility mmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm SILExtract . cpp - SIL function extraction utility mmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / sil - opt / SILOpt . cpp <nl> ppp b / tools / sil - opt / SILOpt . cpp <nl> <nl> - / / = = = - - SILOpt . cpp - SIL Optimization Driver mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm SILOpt . cpp - SIL Optimization Driver mmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / swift - compress / swift - compress . cpp <nl> ppp b / tools / swift - compress / swift - compress . cpp <nl> <nl> - / / = = = - - swift - compress . cpp - Swift compression tool mmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm swift - compress . cpp - Swift compression tool mmmmmmmmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / swift - demangle / swift - demangle . cpp <nl> ppp b / tools / swift - demangle / swift - demangle . cpp <nl> <nl> - / / = = = - - swift - demangle . cpp - Swift Demangler app mmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm swift - demangle . cpp - Swift Demangler app mmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / tools / swift - ide - test / XMLValidator . h <nl> ppp b / tools / swift - ide - test / XMLValidator . h <nl> <nl> - / / = = = - - XMLValidator . h - XML validation mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm XMLValidator . h - XML validation mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / unittests / Basic / CompressionTests . cpp <nl> ppp b / unittests / Basic / CompressionTests . cpp <nl> <nl> - / / = = = - CompressionTests . cpp - for swift / ABI / Compression . h mmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm CompressionTests . cpp - for swift / ABI / Compression . h mmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / unittests / Basic / FileSystemTests . cpp <nl> ppp b / unittests / Basic / FileSystemTests . cpp <nl> <nl> - / / = = = - FileSystemTests . cpp - for swift / Basic / FileSystem . h mmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm FileSystemTests . cpp - for swift / Basic / FileSystem . h mmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / unittests / runtime / Enum . cpp <nl> ppp b / unittests / runtime / Enum . cpp <nl> <nl> - / / = = = - Enum . cpp - Enum tests mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / = = = mmm Enum . cpp - Enum tests mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / unittests / runtime / Metadata . cpp <nl> ppp b / unittests / runtime / Metadata . cpp <nl> <nl> - / / = = = - Metadata . cpp - Metadata tests mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + / / = = = mmm Metadata . cpp - Metadata tests mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl> mmm a / unittests / runtime / weak . mm <nl> ppp b / unittests / runtime / weak . mm <nl> <nl> - / / = = = - weak . mm - Weak - pointer tests mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + / / = = = mmm weak . mm - Weak - pointer tests mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / <nl> / / This source file is part of the Swift . org open source project <nl> / / <nl>
Merge pull request from practicalswift / headers
apple/swift
d56b8ba4214869a5a4d5afdd7d23399eab383b51
2016-01-04T16:41:47Z
similarity index 83 % <nl> rename from tools / SourceKit / include / SourceKit / Support / FuzzyStringMatcher . h <nl> rename to include / swift / IDE / FuzzyStringMatcher . h <nl> mmm a / tools / SourceKit / include / SourceKit / Support / FuzzyStringMatcher . h <nl> ppp b / include / swift / IDE / FuzzyStringMatcher . h <nl> <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> + / / Copyright ( c ) 2014 - 2020 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> <nl> / / <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> <nl> - # ifndef LLVM_SOURCEKIT_LIB_SUPPORT_FUZZYSTRINGMATCHER_H <nl> - # define LLVM_SOURCEKIT_LIB_SUPPORT_FUZZYSTRINGMATCHER_H <nl> + # ifndef SWIFT_IDE_FUZZYSTRINGMATCHER_H <nl> + # define SWIFT_IDE_FUZZYSTRINGMATCHER_H <nl> <nl> - # include " SourceKit / Core / LLVM . h " <nl> + # include " swift / Basic / LLVM . h " <nl> # include " llvm / ADT / BitVector . h " <nl> # include < string > <nl> <nl> - namespace SourceKit { <nl> + namespace swift { <nl> + namespace ide { <nl> <nl> / / / FuzzyStringMatcher compares candidate strings against a pattern <nl> / / / string using a fuzzy matching algorithm and provides a numerical <nl> class FuzzyStringMatcher { <nl> double scoreCandidate ( StringRef candidate ) const ; <nl> } ; <nl> <nl> - } / / end namespace SourceKit <nl> + } / / namespace ide <nl> + } / / namespace swift <nl> <nl> - # endif / / LLVM_SOURCEKIT_LIB_SUPPORT_FUZZYSTRINGMATCHER_H <nl> + # endif / / SWIFT_IDE_FUZZYSTRINGMATCHER_H <nl> mmm a / lib / IDE / CMakeLists . txt <nl> ppp b / lib / IDE / CMakeLists . txt <nl> add_swift_host_library ( swiftIDE STATIC <nl> ConformingMethodList . cpp <nl> ExprContextAnalysis . cpp <nl> Formatting . cpp <nl> + FuzzyStringMatcher . cpp <nl> Refactoring . cpp <nl> ModuleInterfacePrinting . cpp <nl> REPLCodeCompletion . cpp <nl> similarity index 99 % <nl> rename from tools / SourceKit / lib / Support / FuzzyStringMatcher . cpp <nl> rename to lib / IDE / FuzzyStringMatcher . cpp <nl> mmm a / tools / SourceKit / lib / Support / FuzzyStringMatcher . cpp <nl> ppp b / lib / IDE / FuzzyStringMatcher . cpp <nl> <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> + / / Copyright ( c ) 2014 - 2020 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> <nl> / / <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> <nl> - # include " SourceKit / Support / FuzzyStringMatcher . h " <nl> + # include " swift / IDE / FuzzyStringMatcher . h " <nl> # include " clang / Basic / CharInfo . h " <nl> # include " llvm / ADT / ArrayRef . h " <nl> # include " llvm / ADT / SmallString . h " <nl> <nl> - using namespace SourceKit ; <nl> + using namespace swift ; <nl> + using namespace swift : : ide ; <nl> using clang : : toUppercase ; <nl> using clang : : toLowercase ; <nl> using clang : : isUppercase ; <nl> mmm a / tools / SourceKit / lib / Support / CMakeLists . txt <nl> ppp b / tools / SourceKit / lib / Support / CMakeLists . txt <nl> <nl> add_sourcekit_library ( SourceKitSupport <nl> Concurrency - libdispatch . cpp <nl> - FuzzyStringMatcher . cpp <nl> Logging . cpp <nl> ImmutableTextBuffer . cpp <nl> ThreadSafeRefCntPtr . cpp <nl> mmm a / tools / SourceKit / lib / SwiftLang / CodeCompletionOrganizer . cpp <nl> ppp b / tools / SourceKit / lib / SwiftLang / CodeCompletionOrganizer . cpp <nl> <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> <nl> # include " CodeCompletionOrganizer . h " <nl> - # include " SourceKit / Support / FuzzyStringMatcher . h " <nl> # include " swift / AST / ASTContext . h " <nl> # include " swift / AST / Module . h " <nl> # include " swift / IDE / CodeCompletionResultPrinter . h " <nl> + # include " swift / IDE / FuzzyStringMatcher . h " <nl> # include " swift / Frontend / Frontend . h " <nl> # include " swift / Markup / XMLUtils . h " <nl> # include " clang / Basic / CharInfo . h " <nl> mmm a / unittests / SourceKit / Support / FuzzyStringMatcherTest . cpp <nl> ppp b / unittests / SourceKit / Support / FuzzyStringMatcherTest . cpp <nl> <nl> / / <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> <nl> - # include " SourceKit / Support / FuzzyStringMatcher . h " <nl> + # include " swift / IDE / FuzzyStringMatcher . h " <nl> # include " gtest / gtest . h " <nl> <nl> - using FuzzyStringMatcher = SourceKit : : FuzzyStringMatcher ; <nl> + using FuzzyStringMatcher = swift : : ide : : FuzzyStringMatcher ; <nl> <nl> TEST ( FuzzyStringMatcher , BasicMatching ) { <nl> { <nl>
[ gardening ] Move FuzzyStringMatcher to libIDE
apple/swift
6480bfaad2c0e7f2e3b813f9bc2c4de987401c40
2020-08-25T17:39:08Z
mmm a / hphp / hack / src / server / serverCommand . ml <nl> ppp b / hphp / hack / src / server / serverCommand . ml <nl> open ServerCommandTypes <nl> <nl> module TLazyHeap = Typing_lazy_heap <nl> <nl> - exception Nonfatal_rpc_exception of <nl> - exn * string * ServerEnv . env * ServerEnv . recheck_iteration_flag option <nl> + exception Nonfatal_rpc_exception of exn * string * ServerEnv . env <nl> <nl> <nl> ( * Some client commands require full check to be run in order to update global <nl> let stream_response ( genv : ServerEnv . genv ) env ( ic , oc ) ~ cmd = <nl> match cmd with <nl> | LIST_FILES - > <nl> ServerEnv . list_files env oc ; <nl> - ServerUtils . shutdown_client ( ic , oc ) ; <nl> - false <nl> + ServerUtils . shutdown_client ( ic , oc ) <nl> | LIST_MODES - > <nl> Relative_path . Map . iter env . ServerEnv . files_info begin fun fn fileinfo - > <nl> match Relative_path . prefix fn with <nl> let stream_response ( genv : ServerEnv . genv ) env ( ic , oc ) ~ cmd = <nl> | _ - > ( ) <nl> end ; <nl> flush oc ; <nl> - ServerUtils . shutdown_client ( ic , oc ) ; <nl> - false <nl> + ServerUtils . shutdown_client ( ic , oc ) <nl> | SHOW name - > <nl> output_string oc " starting \ n " ; <nl> SharedMem . invalidate_caches ( ) ; <nl> let stream_response ( genv : ServerEnv . genv ) env ( ic , oc ) ~ cmd = <nl> output_string oc ( td_str ^ " \ n " ) <nl> ) ; <nl> flush oc ; <nl> - ServerUtils . shutdown_client ( ic , oc ) ; <nl> - false <nl> + ServerUtils . shutdown_client ( ic , oc ) <nl> | BUILD build_opts - > <nl> - let build_hook = BuildMain . go build_opts genv env oc in <nl> - ( match build_hook with <nl> - | None - > ServerUtils . shutdown_client ( ic , oc ) <nl> - | Some build_hook - > begin <nl> - ServerTypeCheck . hook_after_parsing : = <nl> - Some ( fun genv env - > <nl> - ( * subtle : an exception there ( such as writing on a closed pipe ) <nl> - * will not be caught by handle_connection ( ) because <nl> - * we have already returned from handle_connection ( ) , hence <nl> - * this additional try . <nl> - * ) <nl> - ( try <nl> - with_context <nl> - ~ enter : ( fun ( ) - > ( ) ) <nl> - ~ exit : ( fun ( ) - > ServerUtils . shutdown_client ( ic , oc ) ) <nl> - ~ do_ : ( fun ( ) - > build_hook genv env ) ; <nl> - with exn - > <nl> - let msg = Printexc . to_string exn in <nl> - Printf . printf " Exn in build_hook : % s " msg ; <nl> - EventLogger . master_exception exn ; <nl> - ) ; <nl> - ServerTypeCheck . hook_after_parsing : = None <nl> - ) <nl> - end ) ; <nl> - true <nl> + BuildMain . go build_opts genv env oc ; <nl> + ServerUtils . shutdown_client ( ic , oc ) <nl> <nl> let handle <nl> ( genv : ServerEnv . genv ) <nl> ( env : ServerEnv . env ) <nl> ( client : ClientProvider . client ) <nl> - : ( ServerEnv . env * ServerEnv . recheck_iteration_flag option ) = <nl> + : ServerEnv . env = <nl> let msg = ClientProvider . read_client_msg client in <nl> let d_event = Debug_event . HandleServerCommand msg in <nl> let _ = Debug_port . write_opt d_event genv . ServerEnv . debug_port in <nl> let handle <nl> not @ @ ( ClientProvider . is_persistent client ) <nl> then ClientProvider . shutdown_client client ; <nl> if ServerCommandTypes . is_kill_rpc cmd then ServerUtils . die_nicely ( ) ; <nl> - new_env , None <nl> + new_env <nl> with e - > <nl> let stack = Printexc . get_backtrace ( ) in <nl> if ServerCommandTypes . is_critical_rpc cmd then raise e <nl> - else raise ( Nonfatal_rpc_exception ( e , stack , env , None ) ) <nl> + else raise ( Nonfatal_rpc_exception ( e , stack , env ) ) <nl> end <nl> | Stream cmd - > <nl> let ic , oc = ClientProvider . get_channels client in <nl> - let needs_flush = stream_response genv env ( ic , oc ) ~ cmd in <nl> - env , if needs_flush then Some ServerEnv . Force_flush else None <nl> + stream_response genv env ( ic , oc ) ~ cmd ; <nl> + env <nl> | Debug - > <nl> let ic , oc = ClientProvider . get_channels client in <nl> genv . ServerEnv . debug_channels < - Some ( ic , oc ) ; <nl> ServerDebug . say_hello genv ; <nl> - env , None <nl> + env <nl> mmm a / hphp / hack / src / server / serverEnv . ml <nl> ppp b / hphp / hack / src / server / serverEnv . ml <nl> let empty_recheck_loop_stats = { <nl> total_rechecked_count = 0 ; <nl> } <nl> <nl> - type recheck_iteration_flag = <nl> - ( * * On next iteration of recheck loop , force a flush of the notififer . * ) <nl> - | Force_flush <nl> - <nl> ( * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ) <nl> ( * The " static " environment , initialized first and then doesn ' t change * ) <nl> ( * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ) <nl> mmm a / hphp / hack / src / server / serverMain . ml <nl> ppp b / hphp / hack / src / server / serverMain . ml <nl> let handle_connection_ genv env client = <nl> in <nl> ClientProvider . send_response_to_client client Connected ; <nl> { env with persistent_client = <nl> - Some ( ClientProvider . make_persistent client ) } , None <nl> + Some ( ClientProvider . make_persistent client ) } <nl> | Non_persistent - > <nl> ServerCommand . handle genv env client <nl> with <nl> | ClientProvider . Client_went_away | Read_command_timeout - > <nl> ClientProvider . shutdown_client client ; <nl> - env , None <nl> + env <nl> ( * * Connection dropped off . Its unforunate that we don ' t actually know <nl> * which connection went bad ( could be any write to any connection to <nl> * child processes / daemons ) , we just assume at this top - level that <nl> let handle_connection_ genv env client = <nl> | Sys_error ( " Connection reset by peer " ) - > <nl> Hh_logger . log " Client channel went bad . Shutting down client connection " ; <nl> ClientProvider . shutdown_client client ; <nl> - env , None <nl> + env <nl> | e - > <nl> HackEventLogger . handle_connection_exception e ; <nl> let msg = Printexc . to_string e in <nl> let handle_connection_ genv env client = <nl> Printf . fprintf stderr " Error : % s \ n % ! " msg ; <nl> Printexc . print_backtrace stderr ; <nl> ClientProvider . shutdown_client client ; <nl> - env , None <nl> + env <nl> <nl> <nl> let report_persistent_exception <nl> let handle_persistent_connection_ genv env client = <nl> | Sys_error ( " Broken pipe " ) <nl> | ServerCommandTypes . Read_command_timeout <nl> | ServerClientProvider . Client_went_away - > <nl> - shutdown_persistent_client env client , None <nl> - | ServerCommand . Nonfatal_rpc_exception ( e , stack , env , flag ) - > <nl> + shutdown_persistent_client env client <nl> + | ServerCommand . Nonfatal_rpc_exception ( e , stack , env ) - > <nl> report_persistent_exception ~ e ~ stack ~ client ~ is_fatal : false ; <nl> - env , flag <nl> + env <nl> | e - > <nl> let stack = Printexc . get_backtrace ( ) in <nl> report_persistent_exception ~ e ~ stack ~ client ~ is_fatal : true ; <nl> - shutdown_persistent_client env client , None <nl> + shutdown_persistent_client env client <nl> <nl> let handle_connection genv env client is_from_existing_persistent_client = <nl> ServerIdle . stamp_connection ( ) ; <nl> let recheck genv old_env check_kind = <nl> * right after one rechecking round finishes to be part of the same <nl> * rebase , and we don ' t log the recheck_end event until the update list <nl> * is no longer getting populated . * ) <nl> - let rec recheck_loop ~ iteration_flag <nl> - acc genv env new_client has_persistent_connection_request = <nl> + let rec recheck_loop acc genv env new_client has_persistent_connection_request = <nl> let open ServerNotifierTypes in <nl> let t = Unix . gettimeofday ( ) in <nl> ( * * When a new client connects , we use the synchronous notifier . <nl> acc genv env new_client has_persistent_connection_request = <nl> * NB : This also uses synchronous notify on establishing a persistent <nl> * connection . This is harmless , but could maybe be filtered away . * ) <nl> let env , raw_updates = <nl> - match iteration_flag , new_client , has_persistent_connection_request with <nl> - | Some Force_flush , _ , _ <nl> - | _ , Some _ , false - > begin <nl> + match new_client , has_persistent_connection_request with <nl> + | Some _ , false - > begin <nl> env , try Notifier_synchronous_changes ( genv . notifier ( ) ) with <nl> | Watchman . Timeout - > Notifier_unavailable <nl> end <nl> - | _ , None , false when t - . env . last_notifier_check_time > 0 . 5 - > <nl> + | None , false when t - . env . last_notifier_check_time > 0 . 5 - > <nl> { env with last_notifier_check_time = t ; } , genv . notifier_async ( ) <nl> ( * Do not process any disk changes when there are pending persistent <nl> * client requests - some of them might be edits , and we don ' t want to <nl> * do analysis on mid - edit state of the world * ) <nl> - | _ , _ , true <nl> - | _ , None , _ - > <nl> + | _ , true <nl> + | None , _ - > <nl> env , Notifier_async_changes SSet . empty <nl> in <nl> let genv , acc , raw_updates = match raw_updates with <nl> acc genv env new_client has_persistent_connection_request = <nl> * other ide edits to process first and we want to give the main loop <nl> * a chance to process them first . * ) <nl> if ide_recheck then acc , env else <nl> - recheck_loop ~ iteration_flag : None <nl> - acc genv env new_client has_persistent_connection_request <nl> + recheck_loop acc genv env new_client has_persistent_connection_request <nl> end <nl> <nl> - let recheck_loop ~ iteration_flag <nl> - genv env client has_persistent_connection_request = <nl> - let stats , env = recheck_loop ~ iteration_flag <nl> - empty_recheck_loop_stats genv env client <nl> + let recheck_loop genv env client has_persistent_connection_request = <nl> + let stats , env = recheck_loop empty_recheck_loop_stats genv env client <nl> has_persistent_connection_request in <nl> { env with recent_recheck_loop_stats = stats } <nl> <nl> let new_serve_iteration_id ( ) = <nl> Random_id . short_string ( ) <nl> <nl> - let serve_one_iteration ~ iteration_flag genv env client_provider = <nl> + let serve_one_iteration genv env client_provider = <nl> let recheck_id = new_serve_iteration_id ( ) in <nl> ServerMonitorUtils . exit_if_parent_dead ( ) ; <nl> let client , has_persistent_connection_request = <nl> let serve_one_iteration ~ iteration_flag genv env client_provider = <nl> ( * persistent client ( i . e . has_persistent_connection_request ) , or if * ) <nl> ( * there ' s nothing to handle . It ' s " Some . . . " if we should handle from * ) <nl> ( * a new client . * ) <nl> - let has_parsing_hook = ! ServerTypeCheck . hook_after_parsing < > None in <nl> - let env = if not has_persistent_connection_request & & <nl> - client = None & & not has_parsing_hook <nl> + let env = if not has_persistent_connection_request & & client = None <nl> then begin <nl> let last_stats = env . recent_recheck_loop_stats in <nl> ( * Ugly hack : We want GC_SHAREDMEM_RAN to record the last rechecked <nl> let serve_one_iteration ~ iteration_flag genv env client_provider = <nl> let start_t = Unix . gettimeofday ( ) in <nl> let stage = if env . init_env . needs_full_init then ` Init else ` Recheck in <nl> HackEventLogger . with_id ~ stage recheck_id @ @ fun ( ) - > <nl> - let env = recheck_loop ~ iteration_flag genv env client <nl> + let env = recheck_loop genv env client <nl> has_persistent_connection_request in <nl> let stats = env . recent_recheck_loop_stats in <nl> if stats . total_rechecked_count > 0 then begin <nl> - HackEventLogger . recheck_end start_t has_parsing_hook <nl> + HackEventLogger . recheck_end start_t <nl> stats . rechecked_batches <nl> stats . rechecked_count <nl> stats . total_rechecked_count ; <nl> let serve_one_iteration ~ iteration_flag genv env client_provider = <nl> { env with diag_subscribe = Some sub } <nl> end in <nl> <nl> - let env , next_iteration_flag = match client with <nl> - | None - > env , None <nl> + let env = match client with <nl> + | None - > env <nl> | Some client - > begin <nl> try <nl> ( * client here is the new client ( not the existing persistent client ) * ) <nl> ( * whose request we ' re going to handle . * ) <nl> - let env , next_iteration_flag = handle_connection genv env client false in <nl> + let env = handle_connection genv env client false in <nl> HackEventLogger . handled_connection start_t ; <nl> - env , next_iteration_flag <nl> + env <nl> with <nl> | e - > <nl> HackEventLogger . handle_connection_exception e ; <nl> Hh_logger . log " Handling client failed . Ignoring . " ; <nl> - env , None <nl> + env <nl> end in <nl> if has_persistent_connection_request then <nl> let client = Utils . unsafe_opt env . persistent_client in <nl> let serve_one_iteration ~ iteration_flag genv env client_provider = <nl> ( * whose request we ' re going to handle . * ) <nl> HackEventLogger . got_persistent_client_channels start_t ; <nl> ( try <nl> - let env , next_iteration_flag_2 = handle_connection genv env client true in <nl> + let env = handle_connection genv env client true in <nl> HackEventLogger . handled_persistent_connection start_t ; <nl> - env , Option . first_some next_iteration_flag next_iteration_flag_2 <nl> + env <nl> with <nl> | e - > <nl> HackEventLogger . handle_persistent_connection_exception e ; <nl> Hh_logger . log " Handling persistent client failed . Ignoring . " ; <nl> - env , next_iteration_flag ) <nl> - else env , next_iteration_flag <nl> + env ) <nl> + else env <nl> <nl> let initial_check genv env = <nl> let start_t = Unix . gettimeofday ( ) in <nl> let initial_check genv env = <nl> recheck genv env ServerTypeCheck . Full_check in <nl> if total_rechecked > 0 then begin <nl> HackEventLogger . recheck_end start_t <nl> - false ( * has parsing hook * ) <nl> 1 ( * number of batches * ) <nl> rechecked total_rechecked ; <nl> Hh_logger . log " Recheck id : % s " recheck_id <nl> let serve genv env in_fd _ = <nl> let client_provider = ClientProvider . provider_from_file_descriptor in_fd in <nl> let env = initial_check genv env in <nl> let env = ref env in <nl> - let flag = ref None in <nl> while true do <nl> - let new_env , next_iteration_flag = serve_one_iteration <nl> - ~ iteration_flag : ( ! flag ) <nl> - genv ! env client_provider in <nl> - env : = new_env ; <nl> - flag : = next_iteration_flag ; <nl> + let new_env = serve_one_iteration genv ! env client_provider in <nl> + env : = new_env <nl> done <nl> <nl> let resolve_init_approach genv = <nl> mmm a / hphp / hack / src / server / serverMain . mli <nl> ppp b / hphp / hack / src / server / serverMain . mli <nl> val save_state : ServerArgs . options - > SharedMem . handle - > ' a <nl> val initial_check : ServerEnv . genv - > ServerEnv . env - > ServerEnv . env <nl> <nl> val serve_one_iteration : <nl> - iteration_flag : ServerEnv . recheck_iteration_flag option - > <nl> ServerEnv . genv - > <nl> ServerEnv . env - > <nl> ClientProvider . t - > <nl> - ServerEnv . env * ServerEnv . recheck_iteration_flag option <nl> + ServerEnv . env <nl> mmm a / hphp / hack / src / server / serverTypeCheck . ml <nl> ppp b / hphp / hack / src / server / serverTypeCheck . ml <nl> let union_set_and_map_keys set map = <nl> ~ init : set <nl> ~ f : ( fun k _ acc - > Relative_path . Set . add acc k ) <nl> <nl> - ( * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ) <nl> - ( * Function called after parsing , does nothing by default . * ) <nl> - ( * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ) <nl> - <nl> - let hook_after_parsing = ref None <nl> - <nl> ( * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ) <nl> ( * Where the action is ! * ) <nl> ( * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ) <nl> end = functor ( CheckKind : CheckKindType ) - > struct <nl> HackEventLogger . updating_deps_end t ; <nl> let t = Hh_logger . log_duration logstring t in <nl> <nl> - ( * BUILDING AUTOLOADMAP * ) <nl> - Option . iter ! hook_after_parsing begin fun f - > <nl> - f genv { env with files_info } <nl> - end ; <nl> - HackEventLogger . parsing_hook_end t ; <nl> - let t = Hh_logger . log_duration " Parsing Hook " t in <nl> - <nl> ( * NAMING * ) <nl> let logstring = " Naming " in <nl> Hh_logger . log " Begin % s " logstring ; <nl> mmm a / hphp / hack / src / server / serverTypeCheck . mli <nl> ppp b / hphp / hack / src / server / serverTypeCheck . mli <nl> val type_check : ServerEnv . genv - > ServerEnv . env - > check_kind - > <nl> val check : ServerEnv . genv - > ServerEnv . env - > check_kind - > <nl> ServerEnv . env * int * int <nl> <nl> - val hook_after_parsing : ( ServerEnv . genv - > <nl> - ( * new * ) ServerEnv . env - > unit ) option ref <nl> - <nl> ( * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ) <nl> ( * Debugging : Declared here to stop ocamlc yelling at us for unused defs * ) <nl> ( * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ) <nl> mmm a / hphp / hack / src / stubs / buildMain . ml <nl> ppp b / hphp / hack / src / stubs / buildMain . ml <nl> <nl> * <nl> * ) <nl> <nl> - let go _ _ _ _ = Some ( fun _ _ - > ( ) ) <nl> + let go _ _ _ _ = ( ) <nl> let get_live_targets _ = ( [ ] , [ ] ) <nl> mmm a / hphp / hack / src / stubs / hackEventLogger . ml <nl> ppp b / hphp / hack / src / stubs / hackEventLogger . ml <nl> let handle_persistent_connection_exception _ = ( ) <nl> let handled_command _ _ = ( ) <nl> let build_differs _ _ _ = ( ) <nl> let build_same _ _ = ( ) <nl> - let recheck_end _ _ _ _ _ = ( ) <nl> + let recheck_end _ _ _ _ = ( ) <nl> let indexing_end _ = ( ) <nl> let parsing_end _ _ ~ parsed_count : _ = ( ) <nl> - let parsing_hook_end _ = ( ) <nl> let updating_deps_end _ = ( ) <nl> let naming_end _ = ( ) <nl> let global_naming_end _ = ( ) <nl> mmm a / hphp / hack / test / integration_ml / integration_test_base . ml <nl> ppp b / hphp / hack / test / integration_ml / integration_test_base . ml <nl> let run_loop_once : type a b . ServerEnv . env - > ( a , b ) loop_inputs - > <nl> ( * Always pick up disk changes in tests immediately * ) <nl> let env = ServerEnv . ( { env with last_notifier_check_time = 0 . 0 } ) in <nl> <nl> - let env , _needs_flush = ServerMain . serve_one_iteration <nl> - ~ iteration_flag : None genv env client_provider in <nl> + let env = ServerMain . serve_one_iteration genv env client_provider in <nl> SearchServiceRunner . run_completely genv ; <nl> env , { <nl> did_read_disk_changes = ! did_read_disk_changes_ref ; <nl>
Run all arc build steps immediately , without waiting for filesystem updates and parsing hook
facebook/hhvm
68bde4e3953ea73816c1ee669dc0984c28ba5714
2018-02-17T01:51:56Z
mmm a / test / message / wasm - trace - memory . js <nl> ppp b / test / message / wasm - trace - memory . js <nl> <nl> / / found in the LICENSE file . <nl> <nl> / / Flags : - - no - stress - opt - - trace - wasm - memory - - no - liftoff - - no - future <nl> - / / Flags : - - no - wasm - tier - up - - experimental - wasm - simd <nl> + / / Flags : - - experimental - wasm - simd <nl> <nl> load ( " test / mjsunit / wasm / wasm - module - builder . js " ) ; <nl> <nl> mmm a / test / mjsunit / regress / regress - 863810 . js <nl> ppp b / test / mjsunit / regress / regress - 863810 . js <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> - / / Flags : - - no - liftoff - - no - wasm - tier - up - - no - future - - debug - code <nl> + / / Flags : - - no - liftoff - - no - future - - debug - code <nl> <nl> load ( ' test / mjsunit / wasm / wasm - module - builder . js ' ) ; <nl> <nl> mmm a / test / mjsunit / regress / wasm / regress - 864509 . js <nl> ppp b / test / mjsunit / regress / wasm / regress - 864509 . js <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> - / / Flags : - - liftoff - - no - wasm - tier - up - - no - future - - wasm - tier - mask - for - testing = 2 <nl> + / / Flags : - - liftoff - - no - wasm - tier - up - - wasm - tier - mask - for - testing = 2 <nl> <nl> load ( ' test / mjsunit / wasm / wasm - module - builder . js ' ) ; <nl> <nl> mmm a / test / mjsunit / regress / wasm / regress - 9759 . js <nl> ppp b / test / mjsunit / regress / wasm / regress - 9759 . js <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> - / / Flags : - - no - wasm - tier - up - - no - liftoff - - no - force - slow - path <nl> + / / Flags : - - no - liftoff - - no - force - slow - path <nl> <nl> load ( " test / mjsunit / wasm / wasm - module - builder . js " ) ; <nl> <nl> mmm a / test / mjsunit / wasm / liftoff . js <nl> ppp b / test / mjsunit / wasm / liftoff . js <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> - / / Flags : - - allow - natives - syntax - - liftoff - - no - future - - no - wasm - tier - up <nl> + / / Flags : - - allow - natives - syntax - - liftoff - - no - wasm - tier - up <nl> <nl> load ( ' test / mjsunit / wasm / wasm - module - builder . js ' ) ; <nl> <nl> mmm a / tools / clusterfuzz / v8_foozzie . py <nl> ppp b / tools / clusterfuzz / v8_foozzie . py <nl> <nl> ignition_turbo_opt = [ <nl> ' - - always - opt ' , <nl> ' - - no - liftoff ' , <nl> - ' - - no - wasm - tier - up ' , <nl> ' - - no - lazy - feedback - allocation ' <nl> ] , <nl> ignition_turbo_opt_eager = [ <nl> mmm a / tools / testrunner / local / variants . py <nl> ppp b / tools / testrunner / local / variants . py <nl> <nl> " nooptimization " : [ [ " - - no - opt " , " - - liftoff " , " - - no - wasm - tier - up " ] ] , <nl> " slow_path " : [ [ " - - force - slow - path " ] ] , <nl> " stress " : [ [ " - - stress - opt " , " - - always - opt " , " - - no - liftoff " , <nl> - " - - no - wasm - tier - up " , ' - - stress - lazy - source - positions ' ] ] , <nl> + " - - stress - lazy - source - positions " ] ] , <nl> " stress_js_bg_compile_wasm_code_gc " : [ [ " - - stress - background - compile " , <nl> " - - stress - wasm - code - gc " ] ] , <nl> " stress_incremental_marking " : [ [ " - - stress - incremental - marking " ] ] , <nl>
[ wasm ] Adjust flags after changed implications
v8/v8
816ea121248ada9579f8f2705594bbb8b53c67d1
2020-01-09T16:55:42Z
mmm a / guide / README . md <nl> ppp b / guide / README . md <nl> Please also refer to the [ API Documentation ] ( http : / / homes . cs . washington . edu / ~ tqc <nl> - [ Running Rabit using MPI ] ( # running - rabit - using - mpi ) <nl> - [ Customize Tracker Script ] ( # customize - tracker - script ) <nl> * [ Fault Tolerance ] ( # fault - tolerance ) <nl> + * [ Python Wrapper ] ( # python - wrapper ) <nl> <nl> What is Allreduce <nl> = = = = = <nl> touching the disk . This makes rabit programs more reliable and efficient . <nl> This is just a conceptual introduction to rabit ' s fault tolerance model . The actual implementation is more sophisticated , <nl> and can deal with more complicated cases such as multiple nodes failure and node failure during recovery phase . <nl> <nl> + Python Wrapper <nl> + = = = = = <nl> + In order to make the library available for a wider range of developers , we decided to provide a python wrapper to our C + + code . <nl> + <nl> + Developers can now program rabit applications in Python ! We provide a couple of examples : <nl> + <nl> + * [ . / basic . py ] ( . / basic . py ) : [ . / basic . cc ] counterpart , explained above . <nl> + * [ . / broadcast . py ] ( . / broadcast . py ) : [ . / broadcast . cc ] counterpart , explained above . <nl>
adding wrapper section
dmlc/xgboost
54e2f7e90d7e03430dbce62ea999163c9cd887d6
2015-01-13T08:48:37Z
mmm a / tools / darwin / packaging / xbmc - atv2 / mkdeb - xbmc - atv2 . sh <nl> ppp b / tools / darwin / packaging / xbmc - atv2 / mkdeb - xbmc - atv2 . sh <nl> fi <nl> PACKAGE = org . xbmc . xbmc - atv2 <nl> <nl> VERSION = 10 . 0 <nl> - REVISION = 8 <nl> + REVISION = 9 <nl> ARCHIVE = $ { PACKAGE } _ $ { VERSION } - $ { REVISION } _iphoneos - arm . deb <nl> <nl> echo Creating $ PACKAGE package version $ VERSION revision $ REVISION <nl> mmm a / tools / darwin / packaging / xbmc - ios / mkdeb - xbmc - ios . sh <nl> ppp b / tools / darwin / packaging / xbmc - ios / mkdeb - xbmc - ios . sh <nl> fi <nl> PACKAGE = org . xbmc . xbmc - ios <nl> <nl> VERSION = 10 . 0 <nl> - REVISION = 8 <nl> + REVISION = 9 <nl> ARCHIVE = $ { PACKAGE } _ $ { VERSION } - $ { REVISION } _iphoneos - arm . deb <nl> <nl> echo Creating $ PACKAGE package version $ VERSION revision $ REVISION <nl>
[ ios / atv2 ] bump mkdeb revision to 9
xbmc/xbmc
35a177bed909cd7ecc56aa5f803b97d16065c5cc
2011-06-23T19:53:22Z
mmm a / xbmc / Application . cpp <nl> ppp b / xbmc / Application . cpp <nl> bool CApplication : : SwitchToFullScreen ( bool force / * = false * / ) <nl> return false ; <nl> <nl> / / if playing from the video info window , close it first ! <nl> - if ( g_windowManager . HasModalDialog ( ) & & g_windowManager . GetTopmostModalDialogID ( ) = = WINDOW_DIALOG_VIDEO_INFO ) <nl> + if ( g_windowManager . HasModalDialog ( ) & & g_windowManager . GetTopmostModalDialog ( ) = = WINDOW_DIALOG_VIDEO_INFO ) <nl> { <nl> CGUIDialogVideoInfo * pDialog = g_windowManager . GetWindow < CGUIDialogVideoInfo > ( WINDOW_DIALOG_VIDEO_INFO ) ; <nl> if ( pDialog ) pDialog - > Close ( true ) ; <nl> mmm a / xbmc / GUIInfoManager . cpp <nl> ppp b / xbmc / GUIInfoManager . cpp <nl> bool CGUIInfoManager : : GetMultiInfoBool ( const GUIInfo & info , int contextWindow , c <nl> if ( ! window ) <nl> { <nl> / / try topmost dialog <nl> - window = g_windowManager . GetWindow ( g_windowManager . GetTopmostModalDialogID ( ) ) ; <nl> + window = g_windowManager . GetWindow ( g_windowManager . GetTopmostModalDialog ( ) ) ; <nl> if ( ! window ) <nl> { <nl> / / try active window <nl> CGUIWindow * CGUIInfoManager : : GetWindowWithCondition ( int contextWindow , int condi <nl> return window ; <nl> <nl> / / try topmost dialog <nl> - window = g_windowManager . GetWindow ( g_windowManager . GetTopmostModalDialogID ( ) ) ; <nl> + window = g_windowManager . GetWindow ( g_windowManager . GetTopmostModalDialog ( ) ) ; <nl> if ( CheckWindowCondition ( window , condition ) ) <nl> return window ; <nl> <nl> mmm a / xbmc / addons / interfaces / GUI / General . cpp <nl> ppp b / xbmc / addons / interfaces / GUI / General . cpp <nl> int Interface_GUIGeneral : : get_current_window_dialog_id ( void * kodiBase ) <nl> } <nl> <nl> CSingleLock gl ( g_graphicsContext ) ; <nl> - return g_windowManager . GetTopmostModalDialogID ( ) ; <nl> + return g_windowManager . GetTopmostModalDialog ( ) ; <nl> } <nl> <nl> int Interface_GUIGeneral : : get_current_window_id ( void * kodiBase ) <nl> mmm a / xbmc / dialogs / GUIDialogBusy . cpp <nl> ppp b / xbmc / dialogs / GUIDialogBusy . cpp <nl> void CGUIDialogBusy : : Open_Internal ( const std : : string & param / * = " " * / ) <nl> <nl> void CGUIDialogBusy : : DoProcess ( unsigned int currentTime , CDirtyRegionList & dirtyregions ) <nl> { <nl> - bool visible = g_windowManager . GetTopmostModalDialogID ( ) = = WINDOW_DIALOG_BUSY ; <nl> + bool visible = g_windowManager . GetTopmostModalDialog ( ) = = WINDOW_DIALOG_BUSY ; <nl> if ( ! visible & & m_bLastVisible ) <nl> dirtyregions . push_back ( CDirtyRegion ( m_renderRegion ) ) ; <nl> m_bLastVisible = visible ; <nl> mmm a / xbmc / guilib / GUIWindowManager . cpp <nl> ppp b / xbmc / guilib / GUIWindowManager . cpp <nl> bool CGUIWindowManager : : HasVisibleModalDialog ( const std : : vector < DialogModalityTy <nl> return HasModalDialog ( types , false ) ; <nl> } <nl> <nl> - / / / \ brief Get the ID of the top most routed window <nl> - / / / \ return id ID of the window or WINDOW_INVALID if no routed window available <nl> - int CGUIWindowManager : : GetTopmostModalDialogID ( bool ignoreClosing / * = false * / ) const <nl> + int CGUIWindowManager : : GetTopmostDialog ( bool modal , bool ignoreClosing ) const <nl> { <nl> CSingleLock lock ( g_graphicsContext ) ; <nl> for ( auto it = m_activeDialogs . rbegin ( ) ; it ! = m_activeDialogs . rend ( ) ; + + it ) <nl> { <nl> CGUIWindow * dialog = * it ; <nl> - if ( dialog - > IsModalDialog ( ) & & ( ! ignoreClosing | | ! dialog - > IsAnimating ( ANIM_TYPE_WINDOW_CLOSE ) ) ) <nl> - { / / have a modal window <nl> + if ( ( ! modal | | dialog - > IsModalDialog ( ) ) & & ( ! ignoreClosing | | ! dialog - > IsAnimating ( ANIM_TYPE_WINDOW_CLOSE ) ) ) <nl> return dialog - > GetID ( ) ; <nl> - } <nl> } <nl> return WINDOW_INVALID ; <nl> } <nl> <nl> + int CGUIWindowManager : : GetTopmostDialog ( bool ignoreClosing / * = false * / ) const <nl> + { <nl> + return GetTopmostDialog ( false , ignoreClosing ) ; <nl> + } <nl> + <nl> + int CGUIWindowManager : : GetTopmostModalDialog ( bool ignoreClosing / * = false * / ) const <nl> + { <nl> + return GetTopmostDialog ( true , ignoreClosing ) ; <nl> + } <nl> + <nl> void CGUIWindowManager : : SendThreadMessage ( CGUIMessage & message , int window / * = 0 * / ) <nl> { <nl> CSingleLock lock ( m_critSection ) ; <nl> int CGUIWindowManager : : GetActiveWindowID ( ) const <nl> <nl> / / If there is a dialog active get the dialog id instead <nl> if ( HasModalDialog ( ) ) <nl> - iWin = GetTopmostModalDialogID ( ) & WINDOW_ID_MASK ; <nl> + iWin = GetTopmostModalDialog ( ) & WINDOW_ID_MASK ; <nl> <nl> / / If the window is FullScreenVideo check for special cases <nl> if ( iWin = = WINDOW_FULLSCREEN_VIDEO ) <nl> int CGUIWindowManager : : GetActiveWindowID ( ) const <nl> / / same as GetActiveWindow ( ) except it first grabs dialogs <nl> int CGUIWindowManager : : GetFocusedWindow ( ) const <nl> { <nl> - int dialog = GetTopmostModalDialogID ( true ) ; <nl> + int dialog = GetTopmostModalDialog ( true ) ; <nl> if ( dialog ! = WINDOW_INVALID ) <nl> return dialog ; <nl> <nl> void CGUIWindowManager : : RemoveFromWindowHistory ( int windowID ) <nl> } <nl> } <nl> <nl> - CGUIWindow * CGUIWindowManager : : GetTopmostDialog ( ) const <nl> - { <nl> - CSingleLock lock ( g_graphicsContext ) ; <nl> - / / find the window with the lowest render order <nl> - auto renderList = m_activeDialogs ; <nl> - stable_sort ( renderList . begin ( ) , renderList . end ( ) , RenderOrderSortFunction ) ; <nl> - <nl> - if ( ! renderList . size ( ) ) <nl> - return nullptr ; <nl> - <nl> - / / return the last window in the list <nl> - return * renderList . rbegin ( ) ; <nl> - } <nl> - <nl> bool CGUIWindowManager : : IsDialogTopmost ( int id ) const <nl> { <nl> - CGUIWindow * topmost = GetTopmostDialog ( ) ; <nl> + CGUIWindow * topmost = GetWindow ( GetTopmostDialog ( false ) ) ; <nl> if ( topmost & & ( topmost - > GetID ( ) & WINDOW_ID_MASK ) = = id ) <nl> return true ; <nl> return false ; <nl> bool CGUIWindowManager : : IsDialogTopmost ( int id ) const <nl> <nl> bool CGUIWindowManager : : IsDialogTopmost ( const std : : string & xmlFile ) const <nl> { <nl> - CGUIWindow * topmost = GetTopmostDialog ( ) ; <nl> + CGUIWindow * topmost = GetWindow ( GetTopmostDialog ( false ) ) ; <nl> if ( topmost & & StringUtils : : EqualsNoCase ( URIUtils : : GetFileName ( topmost - > GetProperty ( " xmlfile " ) . asString ( ) ) , xmlFile ) ) <nl> return true ; <nl> return false ; <nl> mmm a / xbmc / guilib / GUIWindowManager . h <nl> ppp b / xbmc / guilib / GUIWindowManager . h <nl> class CGUIWindowManager : public KODI : : MESSAGING : : IMessageTarget <nl> * / <nl> void RegisterDialog ( CGUIWindow * dialog ) ; <nl> void RemoveDialog ( int id ) ; <nl> - int GetTopmostModalDialogID ( bool ignoreClosing = false ) const ; <nl> + <nl> + / * ! \ brief Get the ID of the topmost dialog <nl> + * <nl> + * \ param ignoreClosing ignore dialog is closing <nl> + * \ return the ID of the topmost dialog or WINDOW_INVALID if no dialog is active <nl> + * / <nl> + int GetTopmostDialog ( bool ignoreClosing = false ) const ; <nl> + <nl> + / * ! \ brief Get the ID of the topmost modal dialog <nl> + * <nl> + * \ param ignoreClosing ignore dialog is closing <nl> + * \ return the ID of the topmost modal dialog or WINDOW_INVALID if no modal dialog is active <nl> + * / <nl> + int GetTopmostModalDialog ( bool ignoreClosing = false ) const ; <nl> <nl> void SendThreadMessage ( CGUIMessage & message , int window = 0 ) ; <nl> void DispatchThreadMessages ( ) ; <nl> class CGUIWindowManager : public KODI : : MESSAGING : : IMessageTarget <nl> void RemoveFromWindowHistory ( int windowID ) ; <nl> void ClearWindowHistory ( ) ; <nl> void CloseWindowSync ( CGUIWindow * window , int nextWindowID = 0 ) ; <nl> - CGUIWindow * GetTopmostDialog ( ) const ; <nl> + int GetTopmostDialog ( bool modal , bool ignoreClosing ) const ; <nl> <nl> friend class KODI : : MESSAGING : : CApplicationMessenger ; <nl> <nl> mmm a / xbmc / interfaces / legacy / ModuleXbmc . cpp <nl> ppp b / xbmc / interfaces / legacy / ModuleXbmc . cpp <nl> namespace XBMCAddon <nl> { <nl> XBMCAddonUtils : : GuiLock lock ( nullptr , false ) ; <nl> <nl> - int id = g_windowManager . GetTopmostModalDialogID ( ) ; <nl> + int id = g_windowManager . GetTopmostModalDialog ( ) ; <nl> if ( id = = WINDOW_INVALID ) id = g_windowManager . GetActiveWindow ( ) ; <nl> ret = g_infoManager . EvaluateBool ( condition , id ) ; <nl> } <nl> mmm a / xbmc / interfaces / legacy / ModuleXbmcgui . cpp <nl> ppp b / xbmc / interfaces / legacy / ModuleXbmcgui . cpp <nl> namespace XBMCAddon <nl> { <nl> DelayedCallGuard dg ; <nl> CSingleLock gl ( g_graphicsContext ) ; <nl> - return g_windowManager . GetTopmostModalDialogID ( ) ; <nl> + return g_windowManager . GetTopmostModalDialog ( ) ; <nl> } <nl> <nl> long getScreenHeight ( ) <nl> mmm a / xbmc / pvr / PVRActionListener . cpp <nl> ppp b / xbmc / pvr / PVRActionListener . cpp <nl> bool CPVRActionListener : : OnAction ( const CAction & action ) <nl> { <nl> / / do not consume action if a python modal is the top most dialog <nl> / / as a python modal can ' t return that it consumed the action . <nl> - if ( g_windowManager . IsPythonWindow ( g_windowManager . GetTopmostModalDialogID ( ) ) ) <nl> + if ( g_windowManager . IsPythonWindow ( g_windowManager . GetTopmostModalDialog ( ) ) ) <nl> return false ; <nl> <nl> char cCharacter ; <nl> mmm a / xbmc / windows / GUIWindowLoginScreen . cpp <nl> ppp b / xbmc / windows / GUIWindowLoginScreen . cpp <nl> bool CGUIWindowLoginScreen : : OnBack ( int actionID ) <nl> <nl> void CGUIWindowLoginScreen : : FrameMove ( ) <nl> { <nl> - if ( GetFocusedControlID ( ) = = CONTROL_BIG_LIST & & g_windowManager . GetTopmostModalDialogID ( ) = = WINDOW_INVALID ) <nl> + if ( GetFocusedControlID ( ) = = CONTROL_BIG_LIST & & g_windowManager . GetTopmostModalDialog ( ) = = WINDOW_INVALID ) <nl> if ( m_viewControl . HasControl ( CONTROL_BIG_LIST ) ) <nl> m_iSelectedItem = m_viewControl . GetSelectedItem ( ) ; <nl> std : : string strLabel = StringUtils : : Format ( g_localizeStrings . Get ( 20114 ) . c_str ( ) , m_iSelectedItem + 1 , CProfilesManager : : GetInstance ( ) . GetNumberOfProfiles ( ) ) ; <nl>
[ refactor ] merge topmost dialog methods in GUIWindowManager
xbmc/xbmc
d44376211f5b43123a3a6a88aa94c0108f39f989
2018-01-11T12:39:02Z
mmm a / docs / Testing . md <nl> ppp b / docs / Testing . md <nl> development cycle . To invoke LLVM ' s ` lit . py ` script directly , it must be <nl> configured to use your local build directory . For example : <nl> <nl> ` ` ` <nl> - % $ { LLVM_SOURCE_ROOT } / utils / lit / lit . py - sv $ { SWIFT_BUILD_DIR } / test - iphonesimulator - i386 / Parse / <nl> + % $ { LLVM_SOURCE_ROOT } / utils / lit / lit . py - sv $ { SWIFT_BUILD_DIR } / test - macosx - x86_64 / Parse / <nl> ` ` ` <nl> <nl> - This runs the tests in the ' test / Parse / ' directory targeting the 32 - bit iOS <nl> - Simulator . The ` ` - sv ` ` options give you a nice progress bar and only show you <nl> + This runs the tests in the ' test / Parse / ' directory targeting 64 - bit macOS . <nl> + The ` ` - sv ` ` options give you a nice progress bar and only show you <nl> output from the tests that fail . <nl> <nl> One downside of using this form is that you ' re appending relative paths from <nl> the source directory to the test directory in your build directory . ( That is , <nl> there may not actually be a directory named ' Parse ' in <nl> - ' test - iphonesimulator - i386 / ' ; the invocation works because there is one in the <nl> + ' test - macosx - x86_64 / ' ; the invocation works because there is one in the <nl> source ' test / ' directory . ) There is a more verbose form that specifies the <nl> testing configuration explicitly , which then allows you to test files <nl> regardless of location . <nl> <nl> ` ` ` <nl> - % $ { LLVM_SOURCE_ROOT } / utils / lit / lit . py - sv - - param swift_site_config = $ { SWIFT_BUILD_DIR } / test - iphonesimulator - i386 / lit . site . cfg $ { SWIFT_SOURCE_ROOT } / test / Parse / <nl> + % $ { LLVM_SOURCE_ROOT } / utils / lit / lit . py - sv - - param swift_site_config = $ { SWIFT_BUILD_DIR } / test - macosx - x86_64 / lit . site . cfg $ { SWIFT_SOURCE_ROOT } / test / Parse / <nl> ` ` ` <nl> <nl> For more complicated configuration , copy the invocation from one of the build <nl>
Merge remote - tracking branch ' origin / master ' into master - next
apple/swift
e3dc3fb2b8ff0b5e7f126fd23838e7ffdb33571c
2019-01-03T05:29:31Z
mmm a / lib / SILPasses / SILCombiner / SILCombinerMiscVisitors . cpp <nl> ppp b / lib / SILPasses / SILCombiner / SILCombinerMiscVisitors . cpp <nl> SILInstruction * SILCombiner : : visitSelectValueInst ( SelectValueInst * SVI ) { <nl> SILInstruction * SILCombiner : : visitSwitchValueInst ( SwitchValueInst * SVI ) { <nl> return nullptr ; <nl> } <nl> - SILInstruction * SILCombiner : : visitAllocStackInst ( AllocStackInst * AS ) { <nl> - / / init_existential_addr instructions behave like memory allocation within <nl> - / / the allocated object . We can promote the init_existential_addr allocation <nl> - / / into a dedicated allocation . <nl> - <nl> - / / Detect this pattern <nl> - / / % 0 = alloc_stack $ LogicValue <nl> - / / % 1 = init_existential_addr % 0 # 1 : $ * LogicValue , $ * Bool <nl> - / / . . . <nl> - / / use of % 1 <nl> - / / . . . <nl> - / / destroy_addr % 0 # 1 : $ * LogicValue <nl> - / / dealloc_stack % 0 # 0 : $ * @ local_storage LogicValue <nl> - / / <nl> <nl> - / / At the same time also look for dead alloc_stack live ranges that are only <nl> - / / copied into . <nl> - / / % 0 = alloc_stack <nl> - / / copy_addr % src , % 0 <nl> - / / destroy_addr % 0 # 1 : $ * LogicValue <nl> - / / dealloc_stack % 0 # 0 : $ * @ local_storage LogicValue <nl> + namespace { <nl> <nl> + / / / A SILInstruction visitor that analyzes alloc stack values for dead live <nl> + / / / range and promotion opportunities . <nl> + / / / <nl> + / / / init_existential_addr instructions behave like memory allocation within the <nl> + / / / allocated object . We can promote the init_existential_addr allocation into a <nl> + / / / dedicated allocation . <nl> + / / / <nl> + / / / We detect this pattern <nl> + / / / % 0 = alloc_stack $ LogicValue <nl> + / / / % 1 = init_existential_addr % 0 # 1 : $ * LogicValue , $ * Bool <nl> + / / / . . . <nl> + / / / use of % 1 <nl> + / / / . . . <nl> + / / / destroy_addr % 0 # 1 : $ * LogicValue <nl> + / / / dealloc_stack % 0 # 0 : $ * @ local_storage LogicValue <nl> + / / / <nl> + / / / At the same we time also look for dead alloc_stack live ranges that are only <nl> + / / / copied into . <nl> + / / / <nl> + / / / % 0 = alloc_stack <nl> + / / / copy_addr % src , % 0 <nl> + / / / destroy_addr % 0 # 1 : $ * LogicValue <nl> + / / / dealloc_stack % 0 # 0 : $ * @ local_storage LogicValue <nl> + struct AllocStackAnalyzer : SILInstructionVisitor < AllocStackAnalyzer > { <nl> + / / / The alloc_stack that we are analyzing . <nl> + AllocStackInst * ASI ; <nl> + <nl> + / / / Do all of the users of the alloc stack allow us to perform optimizations . <nl> bool LegalUsers = true ; <nl> + <nl> + / / / If we saw an init_existential_addr in the use list of the alloc_stack , <nl> + / / / this is the init_existential_addr . We are conservative in the face of <nl> + / / / having multiple init_existential_addr . In such a case , we say that the use <nl> + / / / list of the alloc_stack does not allow for optimizations to occur . <nl> InitExistentialAddrInst * IEI = nullptr ; <nl> + <nl> + / / / If we saw an open_existential_addr in the use list of the alloc_stack , <nl> + / / / this is the open_existential_addr . We are conservative in the case of <nl> + / / / multiple open_existential_addr . In such a case , we say that the use list <nl> + / / / of the alloc_stack does not allow for optimizations to occur . <nl> OpenExistentialAddrInst * OEI = nullptr ; <nl> + <nl> + / / / Did we see any copies into the alloc stack . <nl> bool HaveSeenCopyInto = false ; <nl> - / / Scan all of the uses of the AllocStack and check if it is not used for <nl> - / / anything other than the init_existential_addr / open_existential_addr container . <nl> - for ( Operand * Op : getNonDebugUses ( * AS ) ) { <nl> - / / Destroy and dealloc are both fine . <nl> - if ( isa < DestroyAddrInst > ( Op - > getUser ( ) ) | | <nl> - isa < DeinitExistentialAddrInst > ( Op - > getUser ( ) ) | | <nl> - isa < DeallocStackInst > ( Op - > getUser ( ) ) ) <nl> - continue ; <nl> <nl> - / / Make sure there is exactly one init_existential_addr . <nl> - if ( auto * I = dyn_cast < InitExistentialAddrInst > ( Op - > getUser ( ) ) ) { <nl> - if ( IEI | | HaveSeenCopyInto ) { <nl> - LegalUsers = false ; <nl> - break ; <nl> - } <nl> - IEI = I ; <nl> - continue ; <nl> - } <nl> + public : <nl> + AllocStackAnalyzer ( AllocStackInst * ASI ) : ASI ( ASI ) { } <nl> <nl> - / / Make sure there is exactly one open_existential_addr . <nl> - if ( auto * I = dyn_cast < OpenExistentialAddrInst > ( Op - > getUser ( ) ) ) { <nl> - if ( OEI ) { <nl> - LegalUsers = false ; <nl> - break ; <nl> - } <nl> + / / / Analyze the alloc_stack instruction ' s uses . <nl> + void analyze ( ) { <nl> + / / Scan all of the uses of the AllocStack and check if it is not used for <nl> + / / anything other than the init_existential_addr / open_existential_addr <nl> + / / container . <nl> <nl> - / / This open_existential should not have any uses except destroy_addr . <nl> - for ( auto Use : getNonDebugUses ( * I ) ) { <nl> - if ( ! isa < DestroyAddrInst > ( Use - > getUser ( ) ) ) { <nl> - LegalUsers = false ; <nl> - break ; <nl> - } <nl> - } <nl> + for ( auto * Op : getNonDebugUses ( * ASI ) ) { <nl> + visit ( Op - > getUser ( ) ) ; <nl> <nl> + / / If we found a non - legal user , bail early . <nl> if ( ! LegalUsers ) <nl> break ; <nl> + } <nl> + } <nl> <nl> - OEI = I ; <nl> - continue ; <nl> + / / / Given an unhandled case , we have an illegal use for our optimization <nl> + / / / purposes . Set LegalUsers to false and return . <nl> + void visitSILInstruction ( SILInstruction * I ) { LegalUsers = false ; } <nl> + <nl> + / / Destroy and dealloc are both fine . <nl> + void visitDestroyAddrInst ( DestroyAddrInst * I ) { } <nl> + void visitDeinitExistentialAddrInst ( DeinitExistentialAddrInst * I ) { } <nl> + void visitDeallocStackInst ( DeallocStackInst * I ) { } <nl> + <nl> + void visitInitExistentialAddrInst ( InitExistentialAddrInst * I ) { <nl> + / / If we have already seen an init_existential_addr , we can not <nl> + / / optimize . This is because we only handle the single init_existential_addr <nl> + / / case . <nl> + if ( IEI | | HaveSeenCopyInto ) { <nl> + LegalUsers = false ; <nl> + return ; <nl> } <nl> + IEI = I ; <nl> + } <nl> <nl> - if ( auto * CopyAddr = dyn_cast < CopyAddrInst > ( Op - > getUser ( ) ) ) { <nl> - if ( IEI ) { <nl> + void visitOpenExistentialAddrInst ( OpenExistentialAddrInst * I ) { <nl> + / / If we have already seen an open_existential_addr , we can not <nl> + / / optimize . This is because we only handle the single open_existential_addr <nl> + / / case . <nl> + if ( OEI ) { <nl> + LegalUsers = false ; <nl> + return ; <nl> + } <nl> + <nl> + / / Make sure tht the open_existential does not have any uses except <nl> + / / destroy_addr . <nl> + for ( auto * Use : getNonDebugUses ( * I ) ) { <nl> + if ( ! isa < DestroyAddrInst > ( Use - > getUser ( ) ) ) { <nl> LegalUsers = false ; <nl> - break ; <nl> - } <nl> - / / Copies into the alloc_stack live range are safe . <nl> - if ( CopyAddr - > getDest ( ) . getDef ( ) = = AS ) { <nl> - HaveSeenCopyInto = true ; <nl> - continue ; <nl> + return ; <nl> } <nl> + } <nl> + <nl> + OEI = I ; <nl> + } <nl> <nl> + void visitCopyAddrInst ( CopyAddrInst * I ) { <nl> + if ( IEI ) { <nl> LegalUsers = false ; <nl> - break ; <nl> + return ; <nl> + } <nl> + <nl> + / / Copies into the alloc_stack live range are safe . <nl> + if ( I - > getDest ( ) . getDef ( ) = = ASI ) { <nl> + HaveSeenCopyInto = true ; <nl> + return ; <nl> } <nl> <nl> - / / All other instructions are illegal . <nl> LegalUsers = false ; <nl> - break ; <nl> } <nl> + } ; <nl> + <nl> + } / / end anonymous namespace <nl> + <nl> + SILInstruction * SILCombiner : : visitAllocStackInst ( AllocStackInst * AS ) { <nl> + AllocStackAnalyzer Analyzer ( AS ) ; <nl> + Analyzer . analyze ( ) ; <nl> + <nl> + / / If when analyzing , we found a user that makes our optimization , illegal , <nl> + / / bail early . <nl> + if ( ! Analyzer . LegalUsers ) <nl> + return nullptr ; <nl> + <nl> + InitExistentialAddrInst * IEI = Analyzer . IEI ; <nl> + OpenExistentialAddrInst * OEI = Analyzer . OEI ; <nl> <nl> / / If the only users of the alloc_stack are alloc , destroy and <nl> / / init_existential_addr then we can promote the allocation of the init <nl> / / existential . <nl> - if ( LegalUsers & & IEI & & ! OEI ) { <nl> + if ( IEI & & ! OEI ) { <nl> auto * ConcAlloc = Builder . createAllocStack ( AS - > getLoc ( ) , <nl> IEI - > getLoweredConcreteType ( ) ) ; <nl> ConcAlloc - > setDebugScope ( AS - > getDebugScope ( ) ) ; <nl> SILInstruction * SILCombiner : : visitAllocStackInst ( AllocStackInst * AS ) { <nl> eraseInstFromFunction ( * DS ) ; <nl> } <nl> <nl> - eraseInstFromFunction ( * AS ) ; <nl> + return eraseInstFromFunction ( * AS ) ; <nl> } <nl> <nl> - / / Remove a dead live range that is only copied into . <nl> - if ( LegalUsers & & HaveSeenCopyInto & & ! IEI ) { <nl> - SmallPtrSet < SILInstruction * , 16 > ToDelete ; <nl> - <nl> - for ( auto * Op : AS - > getUses ( ) ) { <nl> - / / Replace a copy_addr [ take ] % src . . . by a destroy_addr % src if % src is <nl> - / / no the alloc_stack . <nl> - / / Otherwise , just delete the copy_addr . <nl> - if ( auto * CopyAddr = dyn_cast < CopyAddrInst > ( Op - > getUser ( ) ) ) { <nl> - if ( CopyAddr - > isTakeOfSrc ( ) & & CopyAddr - > getSrc ( ) . getDef ( ) ! = AS ) { <nl> - Builder . setInsertionPoint ( CopyAddr ) ; <nl> - Builder . createDestroyAddr ( CopyAddr - > getLoc ( ) , CopyAddr - > getSrc ( ) ) <nl> - - > setDebugScope ( CopyAddr - > getDebugScope ( ) ) ; <nl> - } <nl> - } <nl> - if ( auto * OEAI = dyn_cast < OpenExistentialAddrInst > ( Op - > getUser ( ) ) ) { <nl> - for ( auto * Op : OEAI - > getUses ( ) ) { <nl> - assert ( isa < DestroyAddrInst > ( Op - > getUser ( ) ) | | <nl> - isDebugInst ( Op - > getUser ( ) ) & & " Unexpected instruction " ) ; <nl> - ToDelete . insert ( Op - > getUser ( ) ) ; <nl> - } <nl> + / / If we have a live ' live range ' or a live range that we have not sen a copy <nl> + / / into , bail . <nl> + if ( ! Analyzer . HaveSeenCopyInto | | IEI ) <nl> + return nullptr ; <nl> + <nl> + / / Otherwise remove the dead live range that is only copied into . <nl> + / / <nl> + / / TODO : Do we not remove purely dead live ranges here ? Seems like we should . <nl> + SmallPtrSet < SILInstruction * , 16 > ToDelete ; <nl> + <nl> + for ( auto * Op : AS - > getUses ( ) ) { <nl> + / / Replace a copy_addr [ take ] % src . . . by a destroy_addr % src if % src is <nl> + / / no the alloc_stack . <nl> + / / Otherwise , just delete the copy_addr . <nl> + if ( auto * CopyAddr = dyn_cast < CopyAddrInst > ( Op - > getUser ( ) ) ) { <nl> + if ( CopyAddr - > isTakeOfSrc ( ) & & CopyAddr - > getSrc ( ) . getDef ( ) ! = AS ) { <nl> + Builder . setInsertionPoint ( CopyAddr ) ; <nl> + Builder . createDestroyAddr ( CopyAddr - > getLoc ( ) , CopyAddr - > getSrc ( ) ) <nl> + - > setDebugScope ( CopyAddr - > getDebugScope ( ) ) ; <nl> } <nl> - assert ( isa < CopyAddrInst > ( Op - > getUser ( ) ) | | <nl> - isa < OpenExistentialAddrInst > ( Op - > getUser ( ) ) | | <nl> - isa < DestroyAddrInst > ( Op - > getUser ( ) ) | | <nl> - isa < DeallocStackInst > ( Op - > getUser ( ) ) | | <nl> - isa < DeinitExistentialAddrInst > ( Op - > getUser ( ) ) | | <nl> - isDebugInst ( Op - > getUser ( ) ) & & " Unexpected instruction " ) ; <nl> - ToDelete . insert ( Op - > getUser ( ) ) ; <nl> } <nl> <nl> - / / Erase the ' live - range ' <nl> - for ( auto * Inst : ToDelete ) { <nl> - Inst - > replaceAllUsesWithUndef ( ) ; <nl> - eraseInstFromFunction ( * Inst ) ; <nl> + if ( auto * OEAI = dyn_cast < OpenExistentialAddrInst > ( Op - > getUser ( ) ) ) { <nl> + for ( auto * Op : OEAI - > getUses ( ) ) { <nl> + assert ( isa < DestroyAddrInst > ( Op - > getUser ( ) ) | | <nl> + isDebugInst ( Op - > getUser ( ) ) & & " Unexpected instruction " ) ; <nl> + ToDelete . insert ( Op - > getUser ( ) ) ; <nl> + } <nl> } <nl> - eraseInstFromFunction ( * AS ) ; <nl> + <nl> + assert ( isa < CopyAddrInst > ( Op - > getUser ( ) ) | | <nl> + isa < OpenExistentialAddrInst > ( Op - > getUser ( ) ) | | <nl> + isa < DestroyAddrInst > ( Op - > getUser ( ) ) | | <nl> + isa < DeallocStackInst > ( Op - > getUser ( ) ) | | <nl> + isa < DeinitExistentialAddrInst > ( Op - > getUser ( ) ) | | <nl> + isDebugInst ( Op - > getUser ( ) ) & & " Unexpected instruction " ) ; <nl> + ToDelete . insert ( Op - > getUser ( ) ) ; <nl> } <nl> <nl> - return nullptr ; <nl> + / / Erase the ' live - range ' <nl> + for ( auto * Inst : ToDelete ) { <nl> + Inst - > replaceAllUsesWithUndef ( ) ; <nl> + eraseInstFromFunction ( * Inst ) ; <nl> + } <nl> + return eraseInstFromFunction ( * AS ) ; <nl> } <nl> <nl> SILInstruction * SILCombiner : : visitLoadInst ( LoadInst * LI ) { <nl>
Refactor SILCombiner : : visitAllocStackInst .
apple/swift
c1bf6d3e553c98ce8dfbc691a954b2179a658c66
2015-11-15T00:09:31Z
mmm a / hphp / hack / hhi / Set . hhi <nl> ppp b / hphp / hack / hhi / Set . hhi <nl> final class Set < Tv > implements MutableSet < Tv > { <nl> public function values ( ) : Vector < Tv > ; <nl> public function map < Tu > ( ( function ( Tv ) : Tu ) $ callback ) : Set < Tu > ; <nl> public function filter ( ( function ( Tv ) : bool ) $ callback ) : Set < Tv > ; <nl> + <nl> + / * * <nl> + * Ensures that this Set contains only members for which <nl> + * the $ callback returns a truthy result . <nl> + * / <nl> + public function retain ( ( function ( Tv ) : bool ) $ callback ) : Set < Tv > ; <nl> + <nl> public function zip < Tu > ( Traversable < Tu > $ traversable ) : Set < Pair < Tv , Tu > > ; <nl> public function take ( int $ n ) : Set < Tv > ; <nl> public function takeWhile ( ( function ( Tv ) : bool ) $ fn ) : Set < Tv > ; <nl> mmm a / hphp / runtime / ext / ext_collections . cpp <nl> ppp b / hphp / runtime / ext / ext_collections . cpp <nl> BaseSet : : php_zip ( const Variant & iterable ) { <nl> return obj ; <nl> } <nl> <nl> + ALWAYS_INLINE <nl> + Object BaseSet : : php_retain ( const Variant & callback ) { <nl> + CallCtx ctx ; <nl> + vm_decode_function ( callback , nullptr , false , ctx ) ; <nl> + if ( ! ctx . func ) { <nl> + Object e ( SystemLib : : AllocInvalidArgumentExceptionObject ( <nl> + " Parameter must be a valid callback " ) ) ; <nl> + throw e ; <nl> + } <nl> + auto size = m_size ; <nl> + if ( ! size ) { return this ; } <nl> + for ( ssize_t ipos = iter_begin ( ) ; iter_valid ( ipos ) ; ipos = iter_next ( ipos ) ) { <nl> + int32_t version = m_version ; <nl> + auto * e = iter_elm ( ipos ) ; <nl> + bool b = invokeAndCastToBool ( ctx , 1 , & e - > data ) ; <nl> + if ( UNLIKELY ( version ! = m_version ) ) { <nl> + throw_collection_modified ( ) ; <nl> + } <nl> + if ( b ) { continue ; } <nl> + mutateAndBump ( ) ; <nl> + version = m_version ; <nl> + e = iter_elm ( ipos ) ; <nl> + int32_t * pp ; <nl> + if ( e - > hasInt ( ) ) { <nl> + pp = findForInsert ( e - > data . m_data . num ) ; <nl> + } else { <nl> + assert ( e - > hasStr ( ) ) ; <nl> + auto const sd = e - > data . m_data . pstr ; <nl> + pp = findForInsert ( sd , sd - > hash ( ) ) ; <nl> + } <nl> + eraseNoCompact ( pp ) ; <nl> + if ( UNLIKELY ( version ! = m_version ) ) { <nl> + throw_collection_modified ( ) ; <nl> + } <nl> + } <nl> + assert ( m_size < = size ) ; <nl> + compactIfNecessary ( ) ; <nl> + return this ; <nl> + } <nl> + <nl> template < class TSet > <nl> ALWAYS_INLINE <nl> typename std : : enable_if < <nl> Object c_Set : : t_filter ( const Variant & callback ) { <nl> return BaseSet : : php_filter < c_Set > ( callback ) ; <nl> } <nl> <nl> + Object c_Set : : t_retain ( const Variant & callback ) { <nl> + return php_retain ( callback ) ; <nl> + } <nl> + <nl> Object c_Set : : t_zip ( const Variant & iterable ) { <nl> return BaseSet : : php_zip < c_Set > ( iterable ) ; <nl> } <nl> mmm a / hphp / runtime / ext / ext_collections . h <nl> ppp b / hphp / runtime / ext / ext_collections . h <nl> class BaseSet : public ExtCollectionObjectData { <nl> std : : is_base_of < BaseSet , TSet > : : value , Object > : : type <nl> php_filter ( const Variant & callback ) ; <nl> <nl> + Object php_retain ( const Variant & callback ) ; <nl> + <nl> template < class TSet > <nl> typename std : : enable_if < <nl> std : : is_base_of < BaseSet , TSet > : : value , Object > : : type <nl> class c_Set : public BaseSet { <nl> Object t_getiterator ( ) ; <nl> Object t_map ( const Variant & callback ) ; <nl> Object t_filter ( const Variant & callback ) ; <nl> + Object t_retain ( const Variant & callback ) ; <nl> Object t_zip ( const Variant & iterable ) ; <nl> Object t_take ( const Variant & n ) ; <nl> Object t_takewhile ( const Variant & callback ) ; <nl> mmm a / hphp / system / idl / collections . idl . json <nl> ppp b / hphp / system / idl / collections . idl . json <nl> <nl> } <nl> ] <nl> } , <nl> + { <nl> + " name " : " retain " , <nl> + " flags " : [ <nl> + ] , <nl> + " desc " : " Ensures that this Set contains only values for which the specified callback returns true . " , <nl> + " return " : { <nl> + " type " : " Object " <nl> + } , <nl> + " args " : [ <nl> + { <nl> + " name " : " callback " , <nl> + " type " : " Variant " <nl> + } <nl> + ] <nl> + } , <nl> { <nl> " name " : " zip " , <nl> " flags " : [ <nl> mmm a / hphp / test / slow / collection_classes / retain . php <nl> ppp b / hphp / test / slow / collection_classes / retain . php <nl> function print_keyed_iterable ( $ iterable ) { <nl> echo " ] \ n " ; <nl> } <nl> <nl> - function main ( ) { <nl> + function retain_map ( ) { <nl> echo " * * * * * * * * Map * * * * * * * * \ n " ; <nl> <nl> $ x = Map { ' a ' = > 1 , ' b ' = > 2 , ' c ' = > 3 , ' d ' = > 4 , } ; <nl> function main ( ) { <nl> var_dump ( $ x = = = $ y ) ; <nl> print_keyed_iterable ( $ y ) ; <nl> } <nl> + <nl> + function retain_set ( ) { <nl> + echo " * * * * * * * * Set * * * * * * * * \ n " ; <nl> + <nl> + $ x = Set { ' a ' , ' b ' , ' c ' , ' d ' , } ; <nl> + $ y = $ x - > retain ( function ( $ v ) { <nl> + echo " callback ( $ v ) \ n " ; <nl> + return true ; <nl> + } ) ; <nl> + echo " = = = = = = = = \ n " ; <nl> + var_dump ( $ x = = = $ y ) ; <nl> + print_keyed_iterable ( $ y ) ; <nl> + echo " = = = = = = = = \ n " ; <nl> + $ x = Set { ' a ' , ' b ' , ' c ' , ' d ' , } ; <nl> + $ y = $ x - > retain ( function ( $ v ) { <nl> + echo " callback ( $ v ) \ n " ; <nl> + return ( bool ) ( ord ( $ v ) % 2 ) ; <nl> + } ) ; <nl> + echo " = = = = = = = = \ n " ; <nl> + var_dump ( $ x = = = $ y ) ; <nl> + print_keyed_iterable ( $ y ) ; <nl> + } <nl> + <nl> + function main ( ) { <nl> + retain_map ( ) ; <nl> + retain_set ( ) ; <nl> + } <nl> + <nl> main ( ) ; <nl> mmm a / hphp / test / slow / collection_classes / retain . php . expect <nl> ppp b / hphp / test / slow / collection_classes / retain . php . expect <nl> bool ( true ) <nl> HH \ Map [ <nl> a = > 1 <nl> c = > 3 <nl> - ] <nl> \ No newline at end of file <nl> + ] <nl> + * * * * * * * * Set * * * * * * * * <nl> + callback ( a ) <nl> + callback ( b ) <nl> + callback ( c ) <nl> + callback ( d ) <nl> + = = = = = = = = <nl> + bool ( true ) <nl> + HH \ Set [ <nl> + a = > a <nl> + b = > b <nl> + c = > c <nl> + d = > d <nl> + ] <nl> + = = = = = = = = <nl> + callback ( a ) <nl> + callback ( b ) <nl> + callback ( c ) <nl> + callback ( d ) <nl> + = = = = = = = = <nl> + bool ( true ) <nl> + HH \ Set [ <nl> + a = > a <nl> + c = > c <nl> + ] <nl>
collections : add Set : : retain
facebook/hhvm
08d565d96d4d208c54ea3e01455d52759662f3bb
2014-05-19T16:21:49Z
mmm a / tensorflow / python / keras / distribute / distribute_strategy_test . py <nl> ppp b / tensorflow / python / keras / distribute / distribute_strategy_test . py <nl> def run_fn ( ) : <nl> self . assertIsNotNone ( grad_v1 ) <nl> self . assertIsNotNone ( grad_v2 ) <nl> <nl> + @ combinations . generate ( <nl> + combinations . combine ( <nl> + distribution = [ strategy_combinations . one_device_strategy ] + <nl> + tpu_strategies , <nl> + mode = [ ' graph ' , ' eager ' ] ) ) <nl> + def test_optimizer_in_cross_replica_context_raises_error ( self , distribution ) : <nl> + <nl> + with self . cached_session ( ) , distribution . scope ( ) : <nl> + model = keras . models . Sequential ( [ keras . layers . Dense ( 1 ) ] ) <nl> + x = np . array ( [ [ 1 . ] ] ) <nl> + with backprop . GradientTape ( ) as tape : <nl> + y = model ( x ) <nl> + gradients = tape . gradient ( y , model . trainable_variables ) <nl> + optimizer = gradient_descent_keras . SGD ( ) <nl> + <nl> + with self . assertRaisesRegex ( RuntimeError , <nl> + ' cannot be called in cross - replica context ' ) : <nl> + optimizer . apply_gradients ( zip ( gradients , model . trainable_variables ) ) <nl> + <nl> @ combinations . generate ( all_strategy_combinations_plus_run_distributed ( ) ) <nl> def test_calling_model_with_nested_numpy_arrays ( self , distribution , <nl> experimental_run_tf_function ) : <nl> mmm a / tensorflow / python / keras / optimizer_v2 / optimizer_v2 . py <nl> ppp b / tensorflow / python / keras / optimizer_v2 / optimizer_v2 . py <nl> def apply_gradients ( self , <nl> # Distribution strategy does not support reducing an empty list of <nl> # gradients <nl> return control_flow_ops . no_op ( ) <nl> + <nl> + if distribute_ctx . in_cross_replica_context ( ) : <nl> + raise RuntimeError ( <nl> + " ` apply_gradients ( ) cannot be called in cross - replica context . " <nl> + " Use ` tf . distribute . Strategy . experimental_run_v2 ` to enter replica " <nl> + " context . " ) <nl> + <nl> apply_state = self . _prepare ( var_list ) <nl> return distribute_ctx . get_replica_context ( ) . merge_call ( <nl> functools . partial ( self . _distributed_apply , apply_state = apply_state ) , <nl>
Merge pull request from hakos : fix / optimizer_v2_cross_replica_error
tensorflow/tensorflow
0c24180bbcf7d4d419acb103d6ab7aa43b2d1bb9
2020-02-24T13:53:54Z
mmm a / src / runtime / runtime - regexp . cc <nl> ppp b / src / runtime / runtime - regexp . cc <nl> static Object * SearchRegExpMultiple ( Isolate * isolate , Handle < String > subject , <nl> for ( int i = 0 ; i < capture_registers ; i + + ) { <nl> last_match_cache - > set ( i , Smi : : FromInt ( last_match [ i ] ) ) ; <nl> } <nl> - Handle < FixedArray > result_array = builder . array ( ) ; <nl> - result_array - > Shrink ( builder . length ( ) ) ; <nl> + Handle < FixedArray > result_fixed_array = builder . array ( ) ; <nl> + result_fixed_array - > Shrink ( builder . length ( ) ) ; <nl> / / Cache the result and turn the FixedArray into a COW array . <nl> RegExpResultsCache : : Enter ( <nl> - isolate , subject , handle ( regexp - > data ( ) , isolate ) , result_array , <nl> + isolate , subject , handle ( regexp - > data ( ) , isolate ) , result_fixed_array , <nl> last_match_cache , RegExpResultsCache : : REGEXP_MULTIPLE_INDICES ) ; <nl> } <nl> return * builder . ToJSArray ( result_array ) ; <nl>
Rename shadow variable in SearchRegExpMultiple .
v8/v8
0ceca58771a22125e25c3eda730c1d431212598c
2015-10-29T14:11:11Z
mmm a / hphp / hack / src / parser / full_fidelity_parser_errors . ml <nl> ppp b / hphp / hack / src / parser / full_fidelity_parser_errors . ml <nl> let parse_errors_impl env = <nl> Typical : suppress cascading errors ; give second pass errors always . <nl> Maximum : all errors <nl> * ) <nl> - let errors1 = match env . level with <nl> - | Maximum - > SyntaxTree . all_errors env . syntax_tree <nl> - | _ - > SyntaxTree . errors env . syntax_tree in <nl> - let errors2 = <nl> - if env . level = Minimum & & errors1 < > [ ] then [ ] <nl> - else find_syntax_errors env in <nl> - List . sort SyntaxError . compare ( List . append errors1 errors2 ) <nl> + try <nl> + let errors1 = match env . level with <nl> + | Maximum - > SyntaxTree . all_errors env . syntax_tree <nl> + | _ - > SyntaxTree . errors env . syntax_tree in <nl> + let errors2 = <nl> + if env . level = Minimum & & errors1 < > [ ] then [ ] <nl> + else find_syntax_errors env in <nl> + List . sort SyntaxError . compare ( List . append errors1 errors2 ) <nl> + with e - > <nl> + let error_msg = " UNEXPECTED_ERROR : " ^ ( Exn . to_string e ) in <nl> + [ make_error_from_node ( SyntaxTree . root env . syntax_tree ) error_msg ] <nl> <nl> let parse_errors env = <nl> Stats_container . wrap_nullary_fn_timing <nl>
Convert exceptions from FFP errors into a Parser error .
facebook/hhvm
7f37ef970b54f552103dae52a72ea1ec1e301d65
2019-05-18T06:17:38Z
mmm a / addons / skin . confluence / 720p / SettingsCategory . xml <nl> ppp b / addons / skin . confluence / 720p / SettingsCategory . xml <nl> <nl> < itemgap > - 1 < / itemgap > <nl> < onleft > 5 < / onleft > <nl> < onright > 5 < / onright > <nl> - < onup > 20 < / onup > <nl> + < onup > 3 < / onup > <nl> < ondown > 20 < / ondown > <nl> < / control > <nl> < control type = " button " id = " 20 " > <nl>
[ Confluence ] Change the onup of the settings category list to itself instead of the settingslevel button .
xbmc/xbmc
1126f815549b04b6bf4c288ac3d206a025c9043b
2014-02-15T17:57:33Z
mmm a / include / v8 . h <nl> ppp b / include / v8 . h <nl> class V8_EXPORT Data { <nl> } ; <nl> <nl> / * * <nl> - * This is an unfinished experimental feature , and is only exposed <nl> - * here for internal testing purposes . DO NOT USE . <nl> - * <nl> * A container type that holds relevant metadata for module loading . <nl> * <nl> * This is passed back to the embedder as part of <nl> class V8_EXPORT ScriptOrModule { <nl> } ; <nl> <nl> / * * <nl> - * This is an unfinished experimental feature , and is only exposed <nl> - * here for internal testing purposes . DO NOT USE . <nl> - * <nl> * An array to hold Primitive values . This is used by the embedder to <nl> * pass host defined options to the ScriptOptions during compilation . <nl> * <nl> class V8_EXPORT Isolate { <nl> AbortOnUncaughtExceptionCallback callback ) ; <nl> <nl> / * * <nl> - * This is an unfinished experimental feature , and is only exposed <nl> - * here for internal testing purposes . DO NOT USE . <nl> - * <nl> * This specifies the callback called by the upcoming dynamic <nl> * import ( ) language feature to load modules . <nl> * / <nl>
[ module ] Remove experimental status for dynamic import API
v8/v8
67aae25f61b8fd116dd6ba9c67ff7be2ae6de175
2017-10-31T00:33:36Z
mmm a / tools / tolua / cocos2dx_studio . ini <nl> ppp b / tools / tolua / cocos2dx_studio . ini <nl> skip = * : : [ ^ visit $ copyWith . * onEnter . * onExit . * ^ description $ getObjectType . * <nl> ActionObject : : [ initWithDictionary initWithBinary ] , <nl> BaseData : : [ copy subtract ] , <nl> ActionTimelineCache : : [ getInstance loadActionTimelineFromXML loadAnimationWithDataBuffer ] , <nl> - ActionTimeline : : [ setFrameEventCallFunc ] <nl> + ActionTimeline : : [ setFrameEventCallFunc ] , <nl> CSLoader : : [ createNodeWithDataBuffer ] <nl> <nl> rename_functions = ActionManagerEx : : [ shareManager = getInstance purgeActionManager = destroyInstance ] , <nl>
Fix setting file
cocos2d/cocos2d-x
63f8b941c99c16cd6fb9d9ae3fa0f1de401cefa1
2015-07-27T08:03:05Z
mmm a / Engine / EngineAssets / Particles / Advanced / exposion_debris . pfxp <nl> ppp b / Engine / EngineAssets / Particles / Advanced / exposion_debris . pfxp <nl> @ @ - 1 + 1 , 119 @ @ <nl> - { " Name " : " exposion_debris " , " Features " : [ { " RenderMeshes " : { " Scale " : [ 1 . 0 , 1 . 0 , 1 . 0 ] , " PiecesMode " : " RandomPiece " , " PiecePlacement " : " Standard " , " SizeMode " : " Scale " , " Mesh " : " " , " OriginMode " : " Origin " } } , { " SpawnCount " : { " Delay " : { " modifiers " : [ ] , " value " : 0 . 0 } , " Duration " : { " State " : true , " Value " : { " modifiers " : [ ] , " value " : 0 . 0 } } , " Amount " : { " modifiers " : [ ] , " value " : 10 . 0 } , " Restart " : { " State " : true , " Value " : { " modifiers " : [ ] , " value " : 1 . 0 } } } } , { " LifeTime " : { " LifeTime " : { " modifiers " : [ ] , " value " : 5 . 0 } } } , { " FieldSize " : { " value " : { " modifiers " : [ { " Curve " : { " Owner " : " Self " , " TimeBias " : 0 . 0 , " Curve " : " 0 , 1 , 8 , , 0 ; 0 . 79833335 , 1 , 9 , 0 , 0 ; 1 , 0 , 1 , - 1 . 8380263 " , " TimeScale " : 1 . 0 , " TimeSource " : " Age " } } ] , " value " : 0 . 1 } } } , { " AnglesRotate3D " : { " InitialAngle " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " RandomSpin " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " InitialSpin " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " RandomAngle " : [ 180 . 0 , 180 . 0 , 180 . 0 ] } } , { " VelocityOmniDirectional " : { " Velocity " : { " modifiers " : [ { " Random " : { " Amount " : 0 . 5 } } ] , " value " : 5 . 0 } } } , { " MotionPhysics " : { " AngularDragMultiplier " : 0 . 0 , " UniformAcceleration " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " UniformWind " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " gravity " : { " modifiers " : [ ] , " value " : 1 . 0 } , " drag " : { " modifiers " : [ ] , " value " : 0 . 0 } , " windMultiplier " : 0 . 2 , " localEffectors " : [ ] } } , { " MotionCollisions " : { " StaticObjects " : true , " Terrain " : true , " Elasticity " : 0 . 0 , " CollisionsLimitMode " : " Unlimited " , " DynamicObjects " : false , " SlidingFriction " : 0 . 0 } } , { " SecondGenOnCollide " : { " Components " : [ ] , " Enabled " : false , " Mode " : " All " , " Probability " : 1 . 0 } } ] } <nl> \ No newline at end of file <nl> + { <nl> + " Name " : " exposion_debris " , <nl> + " Features " : [ <nl> + { <nl> + " RenderMeshes " : { <nl> + " Scale " : [ 1 . 0 , 1 . 0 , 1 . 0 ] , <nl> + " PiecesMode " : " RandomPiece " , <nl> + " PiecePlacement " : " Standard " , <nl> + " SizeMode " : " Scale " , <nl> + " Mesh " : " objects / default / primitive_cube . cgf " , <nl> + " OriginMode " : " Origin " <nl> + } <nl> + } , <nl> + { <nl> + " SpawnCount " : { <nl> + " Delay " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " Duration " : { <nl> + " State " : true , <nl> + " Value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } <nl> + } , <nl> + " Amount " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 10 . 0 <nl> + } , <nl> + " Restart " : { <nl> + " State " : true , <nl> + " Value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " LifeTime " : { <nl> + " LifeTime " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 5 . 0 <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " FieldSize " : { <nl> + " value " : { <nl> + " modifiers " : [ <nl> + { <nl> + " Curve " : { <nl> + " Owner " : " Self " , <nl> + " TimeBias " : 0 . 0 , <nl> + " Curve " : " 0 , 1 , 8 , , 0 ; 0 . 79833335 , 1 , 9 , 0 , 0 ; 1 , 0 , 1 , - 1 . 8380263 " , <nl> + " TimeScale " : 1 . 0 , <nl> + " TimeSource " : " Age " <nl> + } <nl> + } <nl> + ] , <nl> + " value " : 0 . 1 <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " AnglesRotate3D " : { <nl> + " InitialAngle " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " RandomSpin " : [ 360 . 0 , 360 . 0 , 360 . 0 ] , <nl> + " InitialSpin " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " RandomAngle " : [ 180 . 0 , 180 . 0 , 180 . 0 ] <nl> + } <nl> + } , <nl> + { <nl> + " VelocityOmniDirectional " : { <nl> + " Velocity " : { <nl> + " modifiers " : [ { " Random " : { " Amount " : 0 . 5 } } ] , <nl> + " value " : 5 . 0 <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " MotionPhysics " : { <nl> + " AngularDragMultiplier " : 0 . 0 , <nl> + " UniformAcceleration " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " UniformWind " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " gravity " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } , <nl> + " drag " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " windMultiplier " : 0 . 2 , <nl> + " localEffectors " : [ ] <nl> + } <nl> + } , <nl> + { <nl> + " MotionCollisions " : { <nl> + " StaticObjects " : true , <nl> + " Terrain " : true , <nl> + " Elasticity " : 0 . 5 , <nl> + " Friction " : 1 . 0 , <nl> + " CollisionsLimitMode " : " Unlimited " , <nl> + " DynamicObjects " : false , <nl> + " SlidingFriction " : 0 . 0 <nl> + } <nl> + } , <nl> + { <nl> + " SecondGenOnCollide " : { <nl> + " Components " : [ ] , <nl> + " Enabled " : false , <nl> + " Mode " : " All " , <nl> + " Probability " : 1 . 0 <nl> + } <nl> + } <nl> + ] <nl> + } <nl> \ No newline at end of file <nl> mmm a / Engine / EngineAssets / Particles / Advanced / falling_debris . pfxp <nl> ppp b / Engine / EngineAssets / Particles / Advanced / falling_debris . pfxp <nl> @ @ - 1 + 1 , 132 @ @ <nl> - { " Name " : " falling_debris " , " Features " : [ { " RenderMeshes " : { " Scale " : [ 1 . 0 , 1 . 0 , 1 . 0 ] , " PiecesMode " : " RandomPiece " , " PiecePlacement " : " Standard " , " SizeMode " : " Scale " , " Mesh " : " " , " OriginMode " : " Origin " } } , { " SpawnCount " : { " Delay " : { " modifiers " : [ ] , " value " : 0 . 0 } , " Duration " : { " State " : true , " Value " : { " modifiers " : [ ] , " value " : 0 . 5 } } , " Amount " : { " modifiers " : [ ] , " value " : 10 . 0 } , " Restart " : { " State " : true , " Value " : { " modifiers " : [ ] , " value " : 1 . 0 } } } } , { " LocationSphere " : { " Velocity " : { " modifiers " : [ ] , " value " : 0 . 0 } , " Radius " : { " modifiers " : [ ] , " value " : 1 . 0 } , " AxisScale " : [ 1 . 0 , 1 . 0 , 0 . 0 ] } } , { " LifeTime " : { " LifeTime " : { " modifiers " : [ ] , " value " : 5 . 0 } } } , { " FieldSize " : { " value " : { " modifiers " : [ { " Curve " : { " Owner " : " Self " , " TimeBias " : 0 . 0 , " Curve " : " 0 , 1 , 8 , , 0 ; 0 . 79833335 , 1 , 9 , 0 , 0 ; 1 , 0 , 1 , - 1 . 8380263 " , " TimeScale " : 1 . 0 , " TimeSource " : " Age " } } ] , " value " : 0 . 1 } } } , { " VelocityOmniDirectional " : { " Velocity " : { " modifiers " : [ { " Random " : { " Amount " : 1 . 0 } } ] , " value " : 0 . 5 } } } , { " MotionPhysics " : { " AngularDragMultiplier " : 0 . 0 , " UniformAcceleration " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " UniformWind " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " gravity " : { " modifiers " : [ ] , " value " : 1 . 0 } , " drag " : { " modifiers " : [ ] , " value " : 0 . 0 } , " windMultiplier " : 0 . 2 , " localEffectors " : [ ] } } , { " MotionCollisions " : { " StaticObjects " : true , " Terrain " : true , " Elasticity " : 0 . 1 , " CollisionsLimitMode " : " Unlimited " , " DynamicObjects " : false , " SlidingFriction " : 0 . 0 } } , { " AnglesRotate3D " : { " InitialAngle " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " RandomSpin " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " InitialSpin " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " RandomAngle " : [ 180 . 0 , 180 . 0 , 180 . 0 ] } } , { " SecondGenOnCollide " : { " Components " : [ ] , " Enabled " : false , " Mode " : " All " , " Probability " : 1 . 0 } } ] } <nl> \ No newline at end of file <nl> + { <nl> + " Name " : " falling_debris " , <nl> + " Features " : [ <nl> + { <nl> + " RenderMeshes " : { <nl> + " Scale " : [ 1 . 0 , 1 . 0 , 1 . 0 ] , <nl> + " PiecesMode " : " RandomPiece " , <nl> + " PiecePlacement " : " Standard " , <nl> + " SizeMode " : " Scale " , <nl> + " Mesh " : " objects / default / primitive_sphere . cgf " , <nl> + " OriginMode " : " Origin " <nl> + } <nl> + } , <nl> + { <nl> + " SpawnCount " : { <nl> + " Delay " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " Duration " : { <nl> + " State " : true , <nl> + " Value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 5 <nl> + } <nl> + } , <nl> + " Amount " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 10 . 0 <nl> + } , <nl> + " Restart " : { <nl> + " State " : true , <nl> + " Value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " LocationSphere " : { <nl> + " Velocity " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " Radius " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } , <nl> + " AxisScale " : [ 1 . 0 , 1 . 0 , 0 . 0 ] <nl> + } <nl> + } , <nl> + { <nl> + " LifeTime " : { <nl> + " LifeTime " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 5 . 0 <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " FieldSize " : { <nl> + " value " : { <nl> + " modifiers " : [ <nl> + { <nl> + " Curve " : { <nl> + " Owner " : " Self " , <nl> + " TimeBias " : 0 . 0 , <nl> + " Curve " : " 0 , 1 , 8 , , 0 ; 0 . 79833335 , 1 , 9 , 0 , 0 ; 1 , 0 , 1 , - 1 . 8380263 " , <nl> + " TimeScale " : 1 . 0 , <nl> + " TimeSource " : " Age " <nl> + } <nl> + } <nl> + ] , <nl> + " value " : 0 . 1 <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " VelocityOmniDirectional " : { <nl> + " Velocity " : { <nl> + " modifiers " : [ { " Random " : { " Amount " : 1 . 0 } } ] , <nl> + " value " : 0 . 5 <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " MotionPhysics " : { <nl> + " AngularDragMultiplier " : 0 . 0 , <nl> + " UniformAcceleration " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " UniformWind " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " gravity " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } , <nl> + " drag " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " windMultiplier " : 0 . 2 , <nl> + " localEffectors " : [ ] <nl> + } <nl> + } , <nl> + { <nl> + " MotionCollisions " : { <nl> + " StaticObjects " : true , <nl> + " Terrain " : true , <nl> + " Elasticity " : 0 . 2 , <nl> + " Friction " : 0 . 5 , <nl> + " CollisionsLimitMode " : " Unlimited " , <nl> + " DynamicObjects " : false , <nl> + " SlidingFriction " : 0 . 0 <nl> + } <nl> + } , <nl> + { <nl> + " AnglesRotate3D " : { <nl> + " InitialAngle " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " RandomSpin " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " InitialSpin " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " RandomAngle " : [ 180 . 0 , 180 . 0 , 180 . 0 ] <nl> + } <nl> + } , <nl> + { <nl> + " SecondGenOnCollide " : { <nl> + " Components " : [ ] , <nl> + " Enabled " : false , <nl> + " Mode " : " All " , <nl> + " Probability " : 1 . 0 <nl> + } <nl> + } <nl> + ] <nl> + } <nl> \ No newline at end of file <nl> mmm a / Engine / EngineAssets / Particles / Advanced / impact_debris . pfxp <nl> ppp b / Engine / EngineAssets / Particles / Advanced / impact_debris . pfxp <nl> @ @ - 1 + 1 , 124 @ @ <nl> - { " Name " : " impact_debris " , " Features " : [ { " RenderMeshes " : { " Scale " : [ 1 . 0 , 1 . 0 , 1 . 0 ] , " PiecesMode " : " RandomPiece " , " PiecePlacement " : " Standard " , " SizeMode " : " Scale " , " Mesh " : " " , " OriginMode " : " Origin " } } , { " SpawnCount " : { " Delay " : { " modifiers " : [ ] , " value " : 0 . 0 } , " Duration " : { " State " : true , " Value " : { " modifiers " : [ ] , " value " : 0 . 0 } } , " Amount " : { " modifiers " : [ ] , " value " : 10 . 0 } , " Restart " : { " State " : true , " Value " : { " modifiers " : [ ] , " value " : 1 . 0 } } } } , { " LifeTime " : { " LifeTime " : { " modifiers " : [ ] , " value " : 5 . 0 } } } , { " FieldSize " : { " value " : { " modifiers " : [ { " Curve " : { " Owner " : " Self " , " TimeBias " : 0 . 0 , " Curve " : " 0 , 1 , 8 , , 0 ; 0 . 79833335 , 1 , 9 , 0 , 0 ; 1 , 0 , 1 , - 1 . 8380263 " , " TimeScale " : 1 . 0 , " TimeSource " : " Age " } } ] , " value " : 0 . 1 } } } , { " AnglesRotate3D " : { " InitialAngle " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " RandomSpin " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " InitialSpin " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " RandomAngle " : [ 180 . 0 , 180 . 0 , 180 . 0 ] } } , { " VelocityCone " : { " Velocity " : { " modifiers " : [ { " Random " : { " Amount " : 0 . 5 } } ] , " value " : 5 . 0 } , " Angle " : { " modifiers " : [ { " Random " : { " Amount " : 1 . 0 } } ] , " value " : 35 . 0 } , " Axis " : [ 0 . 0 , 0 . 0 , 1 . 0 ] } } , { " MotionPhysics " : { " AngularDragMultiplier " : 0 . 0 , " UniformAcceleration " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " UniformWind " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " gravity " : { " modifiers " : [ ] , " value " : 1 . 0 } , " drag " : { " modifiers " : [ ] , " value " : 0 . 0 } , " windMultiplier " : 1 . 0 , " localEffectors " : [ ] } } , { " MotionCollisions " : { " StaticObjects " : true , " Terrain " : true , " Elasticity " : 0 . 0 , " CollisionsLimitMode " : " Unlimited " , " DynamicObjects " : false , " SlidingFriction " : 0 . 0 } } , { " SecondGenOnCollide " : { " Components " : [ ] , " Enabled " : false , " Mode " : " All " , " Probability " : 1 . 0 } } ] } <nl> \ No newline at end of file <nl> + { <nl> + " Name " : " impact_debris " , <nl> + " Features " : [ <nl> + { <nl> + " RenderMeshes " : { <nl> + " Scale " : [ 1 . 0 , 1 . 0 , 1 . 0 ] , <nl> + " PiecesMode " : " RandomPiece " , <nl> + " PiecePlacement " : " Standard " , <nl> + " SizeMode " : " Scale " , <nl> + " Mesh " : " objects / default / primitive_cube . cgf " , <nl> + " OriginMode " : " Origin " <nl> + } <nl> + } , <nl> + { <nl> + " SpawnCount " : { <nl> + " Delay " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " Duration " : { <nl> + " State " : true , <nl> + " Value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } <nl> + } , <nl> + " Amount " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 10 . 0 <nl> + } , <nl> + " Restart " : { <nl> + " State " : true , <nl> + " Value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " LifeTime " : { <nl> + " LifeTime " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 5 . 0 <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " FieldSize " : { <nl> + " value " : { <nl> + " modifiers " : [ <nl> + { <nl> + " Curve " : { <nl> + " Owner " : " Self " , <nl> + " TimeBias " : 0 . 0 , <nl> + " Curve " : " 0 , 1 , 8 , , 0 ; 0 . 79833335 , 1 , 9 , 0 , 0 ; 1 , 0 , 1 , - 1 . 8380263 " , <nl> + " TimeScale " : 1 . 0 , <nl> + " TimeSource " : " Age " <nl> + } <nl> + } <nl> + ] , <nl> + " value " : 0 . 1 <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " AnglesRotate3D " : { <nl> + " InitialAngle " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " RandomSpin " : [ 90 . 0 , 90 . 0 , 90 . 0 ] , <nl> + " InitialSpin " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " RandomAngle " : [ 180 . 0 , 180 . 0 , 180 . 0 ] <nl> + } <nl> + } , <nl> + { <nl> + " VelocityCone " : { <nl> + " Velocity " : { <nl> + " modifiers " : [ { " Random " : { " Amount " : 0 . 5 } } ] , <nl> + " value " : 5 . 0 <nl> + } , <nl> + " Angle " : { <nl> + " modifiers " : [ { " Random " : { " Amount " : 1 . 0 } } ] , <nl> + " value " : 35 . 0 <nl> + } , <nl> + " Axis " : [ 0 . 0 , 0 . 0 , 1 . 0 ] <nl> + } <nl> + } , <nl> + { <nl> + " MotionPhysics " : { <nl> + " AngularDragMultiplier " : 0 . 0 , <nl> + " UniformAcceleration " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " UniformWind " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " gravity " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } , <nl> + " drag " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " windMultiplier " : 1 . 0 , <nl> + " localEffectors " : [ ] <nl> + } <nl> + } , <nl> + { <nl> + " MotionCollisions " : { <nl> + " StaticObjects " : true , <nl> + " Terrain " : true , <nl> + " Elasticity " : 0 . 5 , <nl> + " Friction " : 1 . 0 , <nl> + " CollisionsLimitMode " : " Unlimited " , <nl> + " DynamicObjects " : false , <nl> + " SlidingFriction " : 0 . 0 <nl> + } <nl> + } , <nl> + { <nl> + " SecondGenOnCollide " : { <nl> + " Components " : [ ] , <nl> + " Enabled " : false , <nl> + " Mode " : " All " , <nl> + " Probability " : 1 . 0 <nl> + } <nl> + } <nl> + ] <nl> + } <nl> \ No newline at end of file <nl> mmm a / Engine / EngineAssets / Particles / Advanced / trail . pfxp <nl> ppp b / Engine / EngineAssets / Particles / Advanced / trail . pfxp <nl> <nl> { <nl> - " Name " : " light " , <nl> + " Name " : " trail " , <nl> " Features " : [ <nl> { <nl> - " SpawnRate " : { <nl> + " RenderRibbon " : { <nl> + " TextureFrequency " : 1 . 0 , <nl> + " RibbonMode " : " Camera " , <nl> + " ConnectToOrigin " : false , <nl> + " SortBias " : 0 . 0 , <nl> + " Offset " : 0 . 0 , <nl> + " StreamSource " : " Age " <nl> + } <nl> + } , <nl> + { <nl> + " SpawnDistance " : { <nl> " Delay " : { <nl> " modifiers " : [ ] , <nl> " value " : 0 . 0 <nl> <nl> } , <nl> " Amount " : { <nl> " modifiers " : [ ] , <nl> - " value " : 1 . 0 <nl> + " value " : 8 . 0 <nl> } , <nl> - " Mode " : " ParticlesPerSecond " <nl> + " Mode " : " ParticlesPerMeter " <nl> } <nl> } , <nl> { <nl> - " SpawnCount " : { <nl> + " SpawnRate " : { <nl> " Delay " : { <nl> " modifiers " : [ ] , <nl> " value " : 0 . 0 <nl> } , <nl> " Duration " : { <nl> - " State " : true , <nl> + " State " : false , <nl> " Value " : { <nl> " modifiers " : [ ] , <nl> " value " : 0 . 0 <nl> <nl> } , <nl> " Amount " : { <nl> " modifiers " : [ ] , <nl> - " value " : 1 . 0 <nl> + " value " : 8 . 0 <nl> } , <nl> " Enabled " : false , <nl> - " Restart " : { <nl> - " State " : false , <nl> - " Value " : { <nl> - " modifiers " : [ ] , <nl> - " value " : 1 . 0 <nl> - } <nl> - } <nl> + " Mode " : " ParticlesPerSecond " <nl> } <nl> } , <nl> { <nl> <nl> { <nl> " FieldSize " : { <nl> " value " : { <nl> - " modifiers " : [ ] , <nl> - " value " : 1 . 0 <nl> + " modifiers " : [ <nl> + { " Inherit " : { " SpawnOnly " : false } } , <nl> + { <nl> + " Curve " : { <nl> + " Owner " : " Self " , <nl> + " TimeBias " : 0 . 0 , <nl> + " Curve " : " 0 , 0 , 8 , , 0 ; 0 . 22633334 , 1 , 9 , 0 , 0 ; 1 , 0 , 1 , 0 " , <nl> + " TimeScale " : 1 . 0 , <nl> + " TimeSource " : " Age " <nl> + } <nl> + } <nl> + ] , <nl> + " value " : 0 . 1 <nl> } <nl> } <nl> } , <nl> <nl> " Curve " : { <nl> " Owner " : " Self " , <nl> " TimeBias " : 0 . 0 , <nl> - " Curve " : " 0 , 0 , 8 , , 0 ; 0 . 4985 , 1 , 9 , 0 , 0 ; 1 , 0 , 1 , 0 " , <nl> + " Curve " : " 0 , 0 , 8 , , 0 ; 0 . 23866667 , 1 , 9 , 0 , 0 ; 1 , 0 , 1 , 0 " , <nl> " TimeScale " : 1 . 0 , <nl> " TimeSource " : " Age " <nl> } <nl> <nl> } <nl> } , <nl> { <nl> - " FieldColor " : { <nl> - " Color " : { <nl> - " Color " : [ 255 , 255 , 255 , 255 ] , <nl> - " Modifiers " : [ ] <nl> - } <nl> + " AppearanceLighting " : { <nl> + " AffectedByFog " : true , <nl> + " Emissive " : 0 . 0 , <nl> + " Curvature " : 0 . 5 , <nl> + " ReceiveShadows " : false , <nl> + " Albedo " : 100 . 0 , <nl> + " BackLight " : 0 . 5 <nl> } <nl> } , <nl> { <nl> - " LightLight " : { <nl> - " AffectsThisAreaOnly " : false , <nl> - " Affectsfog " : " Both " , <nl> - " Intensity " : 1 . 0 , <nl> - " Radius " : 1 . 0 <nl> + " AppearanceMaterial " : { <nl> + " Material " : " " , <nl> + " Texture " : " " <nl> + } <nl> + } , <nl> + { <nl> + " MotionPhysics " : { <nl> + " AngularDragMultiplier " : 0 . 0 , <nl> + " UniformAcceleration " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " UniformWind " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " gravity " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " drag " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " windMultiplier " : 1 . 0 , <nl> + " localEffectors " : [ ] <nl> } <nl> } <nl> ] <nl> mmm a / Engine / EngineAssets / Particles / Default / mesh . pfxp <nl> ppp b / Engine / EngineAssets / Particles / Default / mesh . pfxp <nl> @ @ - 1 + 1 , 95 @ @ <nl> - { " Name " : " mesh " , " Features " : [ { " RenderMeshes " : { " Scale " : [ 1 . 0 , 1 . 0 , 1 . 0 ] , " PiecesMode " : " RandomPiece " , " PiecePlacement " : " Standard " , " SizeMode " : " Scale " , " Mesh " : " " , " OriginMode " : " Origin " } } , { " SpawnRate " : { " Delay " : { " modifiers " : [ ] , " value " : 0 . 0 } , " Duration " : { " State " : false , " Value " : { " modifiers " : [ ] , " value " : 0 . 0 } } , " Amount " : { " modifiers " : [ ] , " value " : 1 . 0 } , " Mode " : " ParticlesPerSecond " } } , { " SpawnCount " : { " Delay " : { " modifiers " : [ ] , " value " : 0 . 0 } , " Duration " : { " State " : true , " Value " : { " modifiers " : [ ] , " value " : 0 . 0 } } , " Amount " : { " modifiers " : [ ] , " value " : 1 . 0 } , " Enabled " : false , " Restart " : { " State " : false , " Value " : { " modifiers " : [ ] , " value " : 1 . 0 } } } } , { " LifeTime " : { " LifeTime " : { " modifiers " : [ ] , " value " : 1 . 0 } } } , { " FieldSize " : { " value " : { " modifiers " : [ ] , " value " : 1 . 0 } } } , { " MotionPhysics " : { " AngularDragMultiplier " : 0 . 0 , " UniformAcceleration " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " UniformWind " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " gravity " : { " modifiers " : [ ] , " value " : 0 . 0 } , " drag " : { " modifiers " : [ ] , " value " : 0 . 0 } , " windMultiplier " : 1 . 0 , " localEffectors " : [ ] } } ] } <nl> \ No newline at end of file <nl> + { <nl> + " Name " : " mesh " , <nl> + " Features " : [ <nl> + { <nl> + " RenderMeshes " : { <nl> + " Scale " : [ 1 . 0 , 1 . 0 , 1 . 0 ] , <nl> + " PiecesMode " : " RandomPiece " , <nl> + " PiecePlacement " : " Standard " , <nl> + " SizeMode " : " Scale " , <nl> + " Mesh " : " objects / default / primitive_sphere . cgf " , <nl> + " OriginMode " : " Origin " <nl> + } <nl> + } , <nl> + { <nl> + " SpawnRate " : { <nl> + " Delay " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " Duration " : { <nl> + " State " : false , <nl> + " Value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } <nl> + } , <nl> + " Amount " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } , <nl> + " Mode " : " ParticlesPerSecond " <nl> + } <nl> + } , <nl> + { <nl> + " SpawnCount " : { <nl> + " Delay " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " Duration " : { <nl> + " State " : true , <nl> + " Value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } <nl> + } , <nl> + " Amount " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } , <nl> + " Enabled " : false , <nl> + " Restart " : { <nl> + " State " : false , <nl> + " Value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " LifeTime " : { <nl> + " LifeTime " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " FieldSize " : { <nl> + " value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " MotionPhysics " : { <nl> + " AngularDragMultiplier " : 0 . 0 , <nl> + " UniformAcceleration " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " UniformWind " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " gravity " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " drag " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " windMultiplier " : 1 . 0 , <nl> + " localEffectors " : [ ] <nl> + } <nl> + } <nl> + ] <nl> + } <nl> \ No newline at end of file <nl> mmm a / Engine / EngineAssets / Particles / Default / mesh_immortal . pfxp <nl> ppp b / Engine / EngineAssets / Particles / Default / mesh_immortal . pfxp <nl> @ @ - 1 + 1 , 59 @ @ <nl> - { " Name " : " mesh_immortal " , " Features " : [ { " RenderMeshes " : { " Scale " : [ 1 . 0 , 1 . 0 , 1 . 0 ] , " PiecesMode " : " RandomPiece " , " PiecePlacement " : " Standard " , " SizeMode " : " Scale " , " Mesh " : " " , " OriginMode " : " Origin " } } , { " SpawnCount " : { " Delay " : { " modifiers " : [ ] , " value " : 0 . 0 } , " Duration " : { " State " : true , " Value " : { " modifiers " : [ ] , " value " : 0 . 0 } } , " Amount " : { " modifiers " : [ ] , " value " : 1 . 0 } , " Restart " : { " State " : false , " Value " : { " modifiers " : [ ] , " value " : 1 . 0 } } } } , { " LifeImmortal " : [ ] } , { " FieldSize " : { " value " : { " modifiers " : [ ] , " value " : 1 . 0 } } } , { " VelocityMoveRelativeToEmitter " : { " AngularInherit " : 0 . 0 , " PositionInherit " : 1 . 0 , " VelocityInheritAfterDeath " : 0 . 0 , " Enabled " : false , " VelocityInherit " : 1 . 0 } } ] } <nl> \ No newline at end of file <nl> + { <nl> + " Name " : " mesh_immortal " , <nl> + " Features " : [ <nl> + { <nl> + " RenderMeshes " : { <nl> + " Scale " : [ 1 . 0 , 1 . 0 , 1 . 0 ] , <nl> + " PiecesMode " : " RandomPiece " , <nl> + " PiecePlacement " : " Standard " , <nl> + " SizeMode " : " Scale " , <nl> + " Mesh " : " objects / default / primitive_sphere . cgf " , <nl> + " OriginMode " : " Origin " <nl> + } <nl> + } , <nl> + { <nl> + " SpawnCount " : { <nl> + " Delay " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " Duration " : { <nl> + " State " : true , <nl> + " Value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } <nl> + } , <nl> + " Amount " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } , <nl> + " Restart " : { <nl> + " State " : false , <nl> + " Value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } <nl> + } <nl> + } <nl> + } , <nl> + { " LifeImmortal " : [ ] } , <nl> + { <nl> + " FieldSize " : { <nl> + " value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " VelocityMoveRelativeToEmitter " : { <nl> + " AngularInherit " : 0 . 0 , <nl> + " PositionInherit " : 1 . 0 , <nl> + " VelocityInheritAfterDeath " : 0 . 0 , <nl> + " Enabled " : false , <nl> + " VelocityInherit " : 1 . 0 <nl> + } <nl> + } <nl> + ] <nl> + } <nl> \ No newline at end of file <nl> mmm a / Engine / EngineAssets / Particles / Default / ribbon . pfxp <nl> ppp b / Engine / EngineAssets / Particles / Default / ribbon . pfxp <nl> @ @ - 1 + 1 , 108 @ @ <nl> - { " Name " : " ribbon " , " Features " : [ { " RenderRibbon " : { " TextureFrequency " : 1 . 0 , " RibbonMode " : " Camera " , " ConnectToOrigin " : false , " SortBias " : 0 . 0 , " Offset " : 0 . 0 , " StreamSource " : " Age " } } , { " SpawnRate " : { " Delay " : { " modifiers " : [ ] , " value " : 0 . 0 } , " Duration " : { " State " : false , " Value " : { " modifiers " : [ ] , " value " : 0 . 0 } } , " Amount " : { " modifiers " : [ ] , " value " : 8 . 0 } , " Mode " : " ParticlesPerSecond " } } , { " SpawnCount " : { " Delay " : { " modifiers " : [ ] , " value " : 0 . 0 } , " Duration " : { " State " : true , " Value " : { " modifiers " : [ ] , " value " : 0 . 0 } } , " Amount " : { " modifiers " : [ ] , " value " : 1 . 0 } , " Enabled " : false , " Restart " : { " State " : false , " Value " : { " modifiers " : [ ] , " value " : 1 . 0 } } } } , { " LifeTime " : { " LifeTime " : { " modifiers " : [ ] , " value " : 1 . 0 } } } , { " FieldSize " : { " value " : { " modifiers " : [ { " Inherit " : { " SpawnOnly " : false } } ] , " value " : 1 . 0 } } } , { " FieldOpacity " : { " AlphaScale " : [ 0 . 0 , 1 . 0 ] , " ClipRange " : [ 1 . 0 , 1 . 0 ] , " ClipLow " : [ 0 . 0 , 0 . 0 ] , " Enabled " : false , " value " : { " modifiers " : [ ] , " value " : 1 . 0 } } } , { " AppearanceLighting " : { " AffectedByFog " : true , " Emissive " : 0 . 0 , " Curvature " : 0 . 5 , " ReceiveShadows " : false , " Albedo " : 100 . 0 , " BackLight " : 0 . 5 } } , { " AppearanceMaterial " : { " Material " : " " , " Texture " : " " } } , { " MotionPhysics " : { " AngularDragMultiplier " : 0 . 0 , " UniformAcceleration " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " UniformWind " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , " gravity " : { " modifiers " : [ ] , " value " : 0 . 0 } , " drag " : { " modifiers " : [ ] , " value " : 0 . 0 } , " windMultiplier " : 1 . 0 , " localEffectors " : [ ] } } ] } <nl> \ No newline at end of file <nl> + { <nl> + " Name " : " ribbon " , <nl> + " Features " : [ <nl> + { <nl> + " RenderRibbon " : { <nl> + " TextureFrequency " : 1 . 0 , <nl> + " RibbonMode " : " Camera " , <nl> + " ConnectToOrigin " : false , <nl> + " SortBias " : 0 . 0 , <nl> + " ConnectToOrigin " : true , <nl> + " Offset " : 0 . 0 , <nl> + " StreamSource " : " Age " <nl> + } <nl> + } , <nl> + { <nl> + " SpawnRate " : { <nl> + " Delay " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " Duration " : { <nl> + " State " : false , <nl> + " Value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } <nl> + } , <nl> + " Amount " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 8 . 0 <nl> + } , <nl> + " Mode " : " ParticlesPerSecond " <nl> + } <nl> + } , <nl> + { <nl> + " SpawnCount " : { <nl> + " Delay " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " Duration " : { <nl> + " State " : true , <nl> + " Value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } <nl> + } , <nl> + " Amount " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } , <nl> + " Enabled " : false , <nl> + " Restart " : { <nl> + " State " : false , <nl> + " Value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " LifeTime " : { <nl> + " LifeTime " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " FieldSize " : { <nl> + " value " : { <nl> + " modifiers " : [ { " Inherit " : { " SpawnOnly " : false } } ] , <nl> + " value " : 1 . 0 <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " FieldOpacity " : { <nl> + " AlphaScale " : [ 0 . 0 , 1 . 0 ] , <nl> + " ClipRange " : [ 1 . 0 , 1 . 0 ] , <nl> + " ClipLow " : [ 0 . 0 , 0 . 0 ] , <nl> + " Enabled " : false , <nl> + " value " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 1 . 0 <nl> + } <nl> + } <nl> + } , <nl> + { <nl> + " MotionPhysics " : { <nl> + " AngularDragMultiplier " : 0 . 0 , <nl> + " UniformAcceleration " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " UniformWind " : [ 0 . 0 , 0 . 0 , 0 . 0 ] , <nl> + " gravity " : { <nl> + " modifiers " : [ ] , <nl> + " value " : - 1 . 0 <nl> + } , <nl> + " drag " : { <nl> + " modifiers " : [ ] , <nl> + " value " : 0 . 0 <nl> + } , <nl> + " windMultiplier " : 1 . 0 , <nl> + " localEffectors " : [ ] <nl> + } <nl> + } <nl> + ] <nl> + } <nl> \ No newline at end of file <nl> deleted file mode 100644 <nl> index 11b9e929dd . . 0000000000 <nl> mmm a / Engine / EngineAssets / Particles / Parent / projection . pfxp <nl> ppp / dev / null <nl> @ @ - 1 + 0 , 0 @ @ <nl> - { " Name " : " projection " , " Features " : [ { " SpawnRate " : { " Delay " : { " modifiers " : [ ] , " value " : 0 . 0 } , " Duration " : { " State " : false , " Value " : { " modifiers " : [ ] , " value " : 0 . 0 } } , " Amount " : { " modifiers " : [ ] , " value " : 1 . 0 } , " Mode " : " ParticlesPerSecond " } } , { " LifeTime " : { " LifeTime " : { " modifiers " : [ ] , " value " : 1 . 0 } } } , { " FieldSize " : { " value " : { " modifiers " : [ ] , " value " : 1 . 0 } } } , { " ProjectTerrain " : { " ProjectPosition " : true , " SpawnOnly " : false , " ProjectAngles " : false , " ProjectVelocity " : true } } , { " ProjectWater " : { " ProjectPosition " : true , " SpawnOnly " : false , " Enabled " : false , " ProjectAngles " : false , " ProjectVelocity " : true } } , { " VelocityMoveRelativeToEmitter " : { " AngularInherit " : 0 . 0 , " PositionInherit " : 1 . 0 , " VelocityInheritAfterDeath " : 0 . 0 , " VelocityInherit " : 1 . 0 } } , { " SecondGenOnSpawn " : { " Components " : [ ] , " Mode " : " All " , " Probability " : 1 . 0 } } ] } <nl> \ No newline at end of file <nl>
! B ( CE - 13301 ) ( Wavicle ) Fixed non - functioning presets . Mesh presets now have sphere default , ribbon has anti - gravity .
CRYTEK/CRYENGINE
3b5df0e4ef33933309108f4906aa398fadfa8349
2017-08-23T13:16:48Z
mmm a / contracts / asserter / CMakeLists . txt <nl> ppp b / contracts / asserter / CMakeLists . txt <nl> configure_file ( " $ { ABI_FILES } " " $ { CMAKE_CURRENT_BINARY_DIR } " COPYONLY ) <nl> <nl> add_wast_executable ( TARGET asserter <nl> INCLUDE_FOLDERS " $ { STANDARD_INCLUDE_FOLDERS } " <nl> - LIBRARIES eosiolib <nl> + LIBRARIES libc libc + + eosiolib <nl> DESTINATION_FOLDER $ { CMAKE_CURRENT_BINARY_DIR } <nl> ) <nl> mmm a / contracts / bancor / CMakeLists . txt <nl> ppp b / contracts / bancor / CMakeLists . txt <nl> configure_file ( " $ { ABI_FILES } " " $ { CMAKE_CURRENT_BINARY_DIR } " COPYONLY ) <nl> <nl> add_wast_executable ( TARGET bancor <nl> INCLUDE_FOLDERS " $ { STANDARD_INCLUDE_FOLDERS } " <nl> - LIBRARIES eosiolib <nl> + LIBRARIES libc libc + + eosiolib <nl> DESTINATION_FOLDER $ { CMAKE_CURRENT_BINARY_DIR } <nl> ) <nl> mmm a / contracts / currency / CMakeLists . txt <nl> ppp b / contracts / currency / CMakeLists . txt <nl> configure_file ( " $ { ABI_FILES } " " $ { CMAKE_CURRENT_BINARY_DIR } " COPYONLY ) <nl> <nl> add_wast_executable ( TARGET currency <nl> INCLUDE_FOLDERS " $ { STANDARD_INCLUDE_FOLDERS } " <nl> - LIBRARIES eosiolib <nl> + LIBRARIES libc + + libc eosiolib <nl> DESTINATION_FOLDER $ { CMAKE_CURRENT_BINARY_DIR } <nl> ) <nl> mmm a / contracts / eosio . system / CMakeLists . txt <nl> ppp b / contracts / eosio . system / CMakeLists . txt <nl> configure_file ( " $ { ABI_FILES } " " $ { CMAKE_CURRENT_BINARY_DIR } " COPYONLY ) <nl> <nl> add_wast_executable ( TARGET eosio . system <nl> INCLUDE_FOLDERS " $ { STANDARD_INCLUDE_FOLDERS } " <nl> - LIBRARIES eosiolib <nl> + LIBRARIES libc + + libc eosiolib <nl> DESTINATION_FOLDER $ { CMAKE_CURRENT_BINARY_DIR } <nl> ) <nl> mmm a / contracts / exchange / CMakeLists . txt <nl> ppp b / contracts / exchange / CMakeLists . txt <nl> <nl> file ( GLOB ABI_FILES " * . abi " ) <nl> add_wast_executable ( TARGET exchange <nl> INCLUDE_FOLDERS " $ { STANDARD_INCLUDE_FOLDERS } " <nl> - LIBRARIES eosiolib <nl> + LIBRARIES libc + + libc eosiolib <nl> DESTINATION_FOLDER $ { CMAKE_CURRENT_BINARY_DIR } <nl> ) <nl> configure_file ( " $ { ABI_FILES } " " $ { CMAKE_CURRENT_BINARY_DIR } " COPYONLY ) <nl> mmm a / contracts / identity / CMakeLists . txt <nl> ppp b / contracts / identity / CMakeLists . txt <nl> file ( GLOB ABI_FILES " * . abi " ) <nl> configure_file ( " $ { ABI_FILES } " " $ { CMAKE_CURRENT_BINARY_DIR } " COPYONLY ) <nl> add_wast_executable ( TARGET identity <nl> INCLUDE_FOLDERS " $ { STANDARD_INCLUDE_FOLDERS } " <nl> - LIBRARIES eosiolib <nl> + LIBRARIES libc + + libc eosiolib <nl> DESTINATION_FOLDER $ { CMAKE_CURRENT_BINARY_DIR } <nl> ) <nl> <nl> mmm a / contracts / infinite / CMakeLists . txt <nl> ppp b / contracts / infinite / CMakeLists . txt <nl> <nl> add_wast_executable ( TARGET infinite <nl> INCLUDE_FOLDERS " $ { STANDARD_INCLUDE_FOLDERS } " <nl> - LIBRARIES eosiolib <nl> + LIBRARIES libc + + libc eosiolib <nl> DESTINATION_FOLDER $ { CMAKE_CURRENT_BINARY_DIR } <nl> ) <nl> mmm a / contracts / noop / CMakeLists . txt <nl> ppp b / contracts / noop / CMakeLists . txt <nl> file ( GLOB ABI_FILES " * . abi " ) <nl> configure_file ( " $ { ABI_FILES } " " $ { CMAKE_CURRENT_BINARY_DIR } " COPYONLY ) <nl> add_wast_executable ( TARGET noop <nl> INCLUDE_FOLDERS " $ { STANDARD_INCLUDE_FOLDERS } " <nl> - LIBRARIES eosiolib <nl> + LIBRARIES libc + + libc eosiolib <nl> DESTINATION_FOLDER $ { CMAKE_CURRENT_BINARY_DIR } <nl> ) <nl> <nl> mmm a / contracts / proxy / CMakeLists . txt <nl> ppp b / contracts / proxy / CMakeLists . txt <nl> configure_file ( " $ { ABI_FILES } " " $ { CMAKE_CURRENT_BINARY_DIR } " COPYONLY ) <nl> <nl> add_wast_executable ( TARGET proxy <nl> INCLUDE_FOLDERS " $ { STANDARD_INCLUDE_FOLDERS } " <nl> - LIBRARIES eosiolib <nl> + LIBRARIES libc + + libc eosiolib <nl> DESTINATION_FOLDER $ { CMAKE_CURRENT_BINARY_DIR } <nl> ) <nl> mmm a / contracts / test . system / CMakeLists . txt <nl> ppp b / contracts / test . system / CMakeLists . txt <nl> configure_file ( " $ { ABI_FILES } " " $ { CMAKE_CURRENT_BINARY_DIR } " COPYONLY ) <nl> <nl> add_wast_executable ( TARGET test . system <nl> INCLUDE_FOLDERS " $ { STANDARD_INCLUDE_FOLDERS } " <nl> - LIBRARIES eosiolib <nl> + LIBRARIES libc + + libc eosiolib <nl> DESTINATION_FOLDER $ { CMAKE_CURRENT_BINARY_DIR } <nl> ) <nl> mmm a / contracts / test_api / CMakeLists . txt <nl> ppp b / contracts / test_api / CMakeLists . txt <nl> <nl> add_wast_executable ( TARGET test_api <nl> INCLUDE_FOLDERS " $ { STANDARD_INCLUDE_FOLDERS } " <nl> - LIBRARIES eosiolib <nl> + LIBRARIES libc + + libc eosiolib <nl> DESTINATION_FOLDER $ { CMAKE_CURRENT_BINARY_DIR } <nl> ) <nl> mmm a / tests / wasm_tests / wasm_tests . cpp <nl> ppp b / tests / wasm_tests / wasm_tests . cpp <nl> BOOST_FIXTURE_TEST_CASE ( memory_init_border , tester ) try { <nl> } FC_LOG_AND_RETHROW ( ) <nl> <nl> BOOST_FIXTURE_TEST_CASE ( imports , tester ) try { <nl> - produce_blocks ( 2 ) ; <nl> + try { <nl> + produce_blocks ( 2 ) ; <nl> <nl> - create_accounts ( { N ( imports ) } ) ; <nl> - produce_block ( ) ; <nl> + create_accounts ( { N ( imports ) } ) ; <nl> + produce_block ( ) ; <nl> <nl> - / / this will fail to link but that ' s okay ; mainly looking to make sure that the constraint <nl> - / / system doesn ' t choke when memories and tables exist only as imports <nl> - BOOST_CHECK_THROW ( set_code ( N ( imports ) , memory_table_import ) , fc : : exception ) ; <nl> + / / this will fail to link but that ' s okay ; mainly looking to make sure that the constraint <nl> + / / system doesn ' t choke when memories and tables exist only as imports <nl> + BOOST_CHECK_THROW ( set_code ( N ( imports ) , memory_table_import ) , fc : : exception ) ; <nl> + } catch ( const fc : : exception & e ) { <nl> + <nl> + edump ( ( e . to_detail_string ( ) ) ) ; <nl> + throw ; <nl> + } <nl> <nl> } FC_LOG_AND_RETHROW ( ) <nl> <nl> BOOST_FIXTURE_TEST_CASE ( noop , tester ) try { <nl> produce_block ( ) ; <nl> <nl> set_code ( N ( noop ) , noop_wast ) ; <nl> + <nl> set_abi ( N ( noop ) , noop_abi ) ; <nl> const auto & accnt = control - > get_database ( ) . get < account_object , by_name > ( N ( noop ) ) ; <nl> abi_def abi ; <nl>
merge master , fix tests
EOSIO/eos
f2bd1302ecc7337f366f796674d74064eca658f7
2018-02-09T21:16:31Z
mmm a / xbmc / view / GUIViewState . cpp <nl> ppp b / xbmc / view / GUIViewState . cpp <nl> SortOrder CGUIViewState : : GetSortOrder ( ) const <nl> int CGUIViewState : : GetSortOrderLabel ( ) const <nl> { <nl> if ( m_currentSortMethod > = 0 & & m_currentSortMethod < ( int ) m_sortMethods . size ( ) ) <nl> - if ( m_sortMethods [ m_currentSortMethod ] . m_sortDescription . sortOrder = = SortOrderAscending ) <nl> + if ( m_sortMethods [ m_currentSortMethod ] . m_sortDescription . sortOrder = = SortOrderDescending ) <nl> return 585 ; <nl> <nl> return 584 ; / / default sort order label ' Ascending ' <nl>
fix Container . SortOrder infolabel
xbmc/xbmc
57e0c05b96a7fc85945cfb5d24c32b3e1401ca50
2016-01-10T18:26:36Z
mmm a / include / swift / AST / DiagnosticsSema . def <nl> ppp b / include / swift / AST / DiagnosticsSema . def <nl> ERROR ( extra_trailing_closure_in_call , none , <nl> ERROR ( trailing_closure_bad_param , none , <nl> " trailing closure passed to parameter of type % 0 that does not " <nl> " accept a closure " , ( Type ) ) <nl> - WARNING ( unlabeled_trailing_closure_changed_behavior , none , <nl> - " since Swift 5 . 3 , unlabeled trailing closure argument matches parameter % 0 rather than parameter % 1 " , <nl> - ( Identifier , Identifier ) ) <nl> - WARNING ( unlabeled_trailing_closure_changed_behavior_same_param_name , none , <nl> - " since Swift 5 . 3 , unlabeled trailing closure argument matches earlier parameter % 0 rather than later parameter with the same name " , <nl> - ( Identifier ) ) <nl> - NOTE ( trailing_closure_select_parameter , none , <nl> - " label the argument with % 0 to % select { retain the pre - Swift 5 . 3 behavior | silence this warning for Swift 5 . 3 and newer } 1 " , <nl> - ( Identifier , unsigned ) ) <nl> WARNING ( unlabeled_trailing_closure_deprecated , none , <nl> " backward matching of the unlabeled trailing closure is deprecated ; label the argument with % 0 to suppress this warning " , <nl> ( Identifier ) ) <nl> mmm a / lib / Sema / CSApply . cpp <nl> ppp b / lib / Sema / CSApply . cpp <nl> static bool hasCurriedSelf ( ConstraintSystem & cs , ConcreteDeclRef callee , <nl> return false ; <nl> } <nl> <nl> - / / / Determine the arity of the given parameter of function type . <nl> - static unsigned functionParameterArity ( AnyFunctionType : : Param param ) { <nl> - Type paramType = param . getPlainType ( ) ; <nl> - if ( param . isVariadic ( ) ) <nl> - paramType = ParamDecl : : getVarargBaseTy ( paramType ) ; <nl> - <nl> - paramType = paramType - > lookThroughAllOptionalTypes ( ) ; <nl> - <nl> - if ( param . isAutoClosure ( ) ) { <nl> - paramType = paramType - > castTo < AnyFunctionType > ( ) - > getResult ( ) ; <nl> - paramType = paramType - > lookThroughAllOptionalTypes ( ) ; <nl> - } <nl> - <nl> - return paramType - > castTo < AnyFunctionType > ( ) - > getNumParams ( ) ; <nl> - } <nl> - <nl> / / / Attach a Fix - It to the given diagnostic to give the trailing closure <nl> / / / argument a label . <nl> static void labelTrailingClosureArgument ( <nl> static unsigned findParamBindingArgument ( <nl> llvm_unreachable ( " No parameter binds the argument ? " ) ; <nl> } <nl> <nl> - / / / SE - 0286 changed the direction in which the unlabeled trailing closure <nl> - / / / argument is matched to a parameter , from backward ( the pre - Swift 5 . 3 <nl> - / / / semantics ) to forward ( after SE - 0286 ) . Identify cases where this may <nl> - / / / have resulted in a silent change in behavior . <nl> - static void maybeWarnAboutTrailingClosureBindingChange ( <nl> - ConcreteDeclRef callee , <nl> - Expr * fn , <nl> - Expr * arg , <nl> - ArrayRef < AnyFunctionType : : Param > args , <nl> - ArrayRef < AnyFunctionType : : Param > params , <nl> - const ParameterListInfo & paramInfo , <nl> - Optional < unsigned > unlabeledTrailingClosureIndex , <nl> - ArrayRef < ParamBinding > parameterBindings ) { <nl> - <nl> - if ( ! unlabeledTrailingClosureIndex ) <nl> - return ; <nl> - <nl> - if ( * unlabeledTrailingClosureIndex ! = args . size ( ) - 1 ) <nl> - return ; <nl> - <nl> - / / Find the parameter that bound the unlabeled trailing closure argument . <nl> - unsigned paramIdx = findParamBindingArgument ( <nl> - parameterBindings , * unlabeledTrailingClosureIndex ) ; <nl> - <nl> - / / If this parameter requires an argument , it would have been unfilled <nl> - / / prior to SE - 2086 ; there is nothing to diagnose . <nl> - if ( parameterRequiresArgument ( params , paramInfo , paramIdx ) ) <nl> - return ; <nl> - <nl> - / / Look for a later parameter that could match a trailing closure ; the <nl> - / / last one of these would have been picked prior to SE - 0286 . <nl> - Optional < unsigned > matchingBackwardParamIdx ; <nl> - for ( unsigned backwardParamIdx : <nl> - range ( paramIdx + 1 , parameterBindings . size ( ) ) ) { <nl> - if ( ! paramInfo . acceptsUnlabeledTrailingClosureArgument ( backwardParamIdx ) ) <nl> - continue ; <nl> - <nl> - matchingBackwardParamIdx = backwardParamIdx ; <nl> - } <nl> - <nl> - / / If there is no other parameter that could match the unlabeled trailing <nl> - / / closure , there is nothing to diagnose . <nl> - if ( ! matchingBackwardParamIdx ) <nl> - return ; <nl> - <nl> - / / Do a simple arity check ; if the matched parameter and backward - matched <nl> - / / parameter accept functions with different arity , this would not have <nl> - / / type - checked with the backward scan , so there is nothing to report . <nl> - if ( functionParameterArity ( params [ paramIdx ] ) ! = <nl> - functionParameterArity ( params [ * matchingBackwardParamIdx ] ) ) <nl> - return ; <nl> - <nl> - / / Dig out the trailing closure . <nl> - Expr * trailingClosure = findTrailingClosureArgument ( arg ) ; <nl> - <nl> - / / Determine the names of the parameters that would be matched by the <nl> - / / forward and backward scans . <nl> - Identifier paramName = params [ paramIdx ] . getLabel ( ) ; <nl> - Identifier backwardParamName = params [ * matchingBackwardParamIdx ] . getLabel ( ) ; <nl> - <nl> - / / Produce a diagnostic referencing the callee . <nl> - ASTContext & ctx = params [ paramIdx ] . getPlainType ( ) - > getASTContext ( ) ; <nl> - auto noteCallee = [ & ] { <nl> - auto decl = callee . getDecl ( ) ; <nl> - if ( ! decl ) <nl> - return ; <nl> - <nl> - auto diag = ctx . Diags . diagnose ( <nl> - decl , diag : : decl_multiple_defaulted_closure_parameters , <nl> - decl - > getName ( ) , paramName , backwardParamName ) ; <nl> - <nl> - / / Dig out the parameter declarations so we can highlight them . <nl> - if ( const ParameterList * paramList = getParameterList ( decl ) ) { <nl> - diag . highlight ( paramList - > get ( paramIdx ) - > getLoc ( ) ) ; <nl> - diag . highlight ( paramList - > get ( * matchingBackwardParamIdx ) - > getLoc ( ) ) ; <nl> - } <nl> - } ; <nl> - <nl> - / / If the parameters have the same name , provide a custom diagnostic and then <nl> - / / bail out early ; there are no useful notes we can provide here . <nl> - if ( paramName = = backwardParamName ) { <nl> - ctx . Diags . diagnose ( trailingClosure - > getStartLoc ( ) , diag : : unlabeled_trailing_closure_changed_behavior_same_param_name , <nl> - paramName ) ; <nl> - noteCallee ( ) ; <nl> - return ; <nl> - } <nl> - <nl> - / / Produce the diagnostic . <nl> - ctx . Diags . diagnose ( trailingClosure - > getStartLoc ( ) , diag : : unlabeled_trailing_closure_changed_behavior , paramName , <nl> - backwardParamName ) ; <nl> - <nl> - / / Produce a note with a Fix - It describing how to resolve the ambiguity . <nl> - auto diagResolution = [ & ] ( Identifier paramName , unsigned which ) { <nl> - / / Emit the note . <nl> - auto diag = ctx . Diags . diagnose ( <nl> - trailingClosure - > getStartLoc ( ) , diag : : trailing_closure_select_parameter , <nl> - paramName , which ) ; <nl> - labelTrailingClosureArgument ( <nl> - ctx , fn , arg , paramName , trailingClosure , diag ) ; <nl> - } ; <nl> - <nl> - diagResolution ( backwardParamName , 0 ) ; <nl> - diagResolution ( paramName , 1 ) ; <nl> - <nl> - noteCallee ( ) ; <nl> - } <nl> - <nl> / / / Warn about the use of the deprecated " backward " scan for matching the <nl> / / / unlabeled trailing closure . It was needed to properly type check , but <nl> / / / this code will break with a future version of Swift . <nl> Expr * ExprRewriter : : coerceCallArguments ( <nl> / / FIXME : Eventually , we want to enforce that we have either argTuple or <nl> / / argParen here . <nl> <nl> - / / Warn if there was a recent change in trailing closure binding semantics <nl> - / / that might have lead to a silent change in behavior . <nl> - if ( trailingClosureMatching = = TrailingClosureMatching : : Forward ) { <nl> - maybeWarnAboutTrailingClosureBindingChange ( <nl> - callee , apply ? apply - > getFn ( ) : nullptr , arg , args , params , paramInfo , <nl> - unlabeledTrailingClosureIndex , parameterBindings ) ; <nl> - } else { <nl> + / / Warn about the backward scan being deprecated . <nl> + if ( trailingClosureMatching = = TrailingClosureMatching : : Backward ) { <nl> warnAboutTrailingClosureBackwardScan ( <nl> callee , apply ? apply - > getFn ( ) : nullptr , arg , params , <nl> unlabeledTrailingClosureIndex , parameterBindings ) ; <nl>
[ Trailing closures ] Remove dynamically - dead warning about behavior change .
apple/swift
2979d4af7ae896679b503eb96243a1f8d37e9b8f
2020-07-24T15:47:51Z
mmm a / build / deps / github_hashes / facebook / fbthrift - rev . txt <nl> ppp b / build / deps / github_hashes / facebook / fbthrift - rev . txt <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit c058884b7f4515f4e8defbea7f733a3ee740f861 <nl> + Subproject commit bd4d114d4a90f13db735be6dcdea1d9f5594b4e4 <nl>
Updating submodules
facebook/watchman
6305a5c2f3b2c6a4b5708e62c4bb1c2594e69d84
2020-06-20T07:41:51Z
new file mode 100644 <nl> index 00000000000 . . 2f1465d1598 <nl> mmm / dev / null <nl> ppp b / dbms / tests / queries / 0_stateless / 00429_point_in_ellipses . reference <nl> <nl> + 1 <nl> + 1 <nl> + 0 <nl> new file mode 100644 <nl> index 00000000000 . . 9ded2e0d440 <nl> mmm / dev / null <nl> ppp b / dbms / tests / queries / 0_stateless / 00429_point_in_ellipses . sql <nl> <nl> + SELECT pointInEllipses ( 33 . 3 , 55 . 3 , 33 . 4 , 55 . 1 , 1 . 0 , 1 . 0 ) AS distance ; <nl> + SELECT pointInEllipses ( 33 . 3 + v , 55 . 3 + v , 33 . 4 , 55 . 1 , 1 . 0 , 1 . 0 ) AS distance from <nl> + ( <nl> + select number + 0 . 1 as v from system . numbers limit 1 <nl> + ) ; <nl> + SELECT pointInEllipses ( 33 . 3 , 55 . 3 , 33 . 4 , 55 . 1 , 0 . 1 , 0 . 2 ) AS distance ; <nl>
add test for pointInEllipses
ClickHouse/ClickHouse
6b3135959d7f5469a274cee9a538ef05602f4824
2017-03-02T11:33:38Z
mmm a / scene / 2d / touch_screen_button . cpp <nl> ppp b / scene / 2d / touch_screen_button . cpp <nl> bool TouchScreenButton : : _is_point_inside ( const Point2 & p_point ) { <nl> bool check_rect = true ; <nl> <nl> if ( shape . is_valid ( ) ) { <nl> - <nl> check_rect = false ; <nl> - Transform2D xform = shape_centered ? Transform2D ( ) . translated ( shape - > get_rect ( ) . size * 0 . 5f ) : Transform2D ( ) ; <nl> + <nl> + Vector2 size = texture . is_null ( ) ? shape - > get_rect ( ) . size : texture - > get_size ( ) ; <nl> + Transform2D xform = shape_centered ? Transform2D ( ) . translated ( size * 0 . 5f ) : Transform2D ( ) ; <nl> touched = shape - > collide ( xform , unit_rect , Transform2D ( 0 , coord + Vector2 ( 0 . 5 , 0 . 5 ) ) ) ; <nl> } <nl> <nl>
GUI : Touch screen button click area now is synced with its draw
godotengine/godot
e253451a5b01926a32aa52bf2e78150f0f9f4bd5
2020-05-07T19:21:13Z
new file mode 100644 <nl> index 0000000000 . . ae7e296ad2 <nl> mmm / dev / null <nl> ppp b / jvm - packages / xgboost4j - spark / src / main / scala / ml / dmlc / xgboost4j / scala / spark / CheckpointManager . scala <nl> <nl> + / * <nl> + Copyright ( c ) 2014 by Contributors <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + * / <nl> + <nl> + package ml . dmlc . xgboost4j . scala . spark <nl> + <nl> + import ml . dmlc . xgboost4j . scala . Booster <nl> + import org . apache . commons . logging . LogFactory <nl> + import org . apache . hadoop . fs . { FileSystem , Path } <nl> + import org . apache . spark . SparkContext <nl> + <nl> + / * * <nl> + * A class which allows user to save checkpoint boosters every a few rounds . If a previous job <nl> + * fails , the job can restart training from a saved booster instead of from scratch . This class <nl> + * provides interface and helper methods for the checkpoint functionality . <nl> + * <nl> + * @ param sc the sparkContext object <nl> + * @ param checkpointPath the hdfs path to store checkpoint boosters <nl> + * / <nl> + private [ spark ] class CheckpointManager ( sc : SparkContext , checkpointPath : String ) { <nl> + private val logger = LogFactory . getLog ( " XGBoostSpark " ) <nl> + private val modelSuffix = " . model " <nl> + <nl> + private def getPath ( version : Int ) = { <nl> + s " $ checkpointPath / $ version $ modelSuffix " <nl> + } <nl> + <nl> + private def getExistingVersions : Seq [ Int ] = { <nl> + val fs = FileSystem . get ( sc . hadoopConfiguration ) <nl> + if ( checkpointPath . isEmpty | | ! fs . exists ( new Path ( checkpointPath ) ) ) { <nl> + Seq ( ) <nl> + } else { <nl> + fs . listStatus ( new Path ( checkpointPath ) ) . map ( _ . getPath . getName ) . collect { <nl> + case fileName if fileName . endsWith ( modelSuffix ) = > fileName . stripSuffix ( modelSuffix ) . toInt <nl> + } <nl> + } <nl> + } <nl> + <nl> + / * * <nl> + * Load existing checkpoint with the highest version . <nl> + * <nl> + * @ return the booster with the highest version , null if no checkpoints available . <nl> + * / <nl> + private [ spark ] def loadBooster : Booster = { <nl> + val versions = getExistingVersions <nl> + if ( versions . nonEmpty ) { <nl> + val version = versions . max <nl> + val fullPath = getPath ( version ) <nl> + logger . info ( s " Start training from previous booster at $ fullPath " ) <nl> + val model = XGBoost . loadModelFromHadoopFile ( fullPath ) ( sc ) <nl> + model . booster . booster . setVersion ( version ) <nl> + model . booster <nl> + } else { <nl> + null <nl> + } <nl> + } <nl> + <nl> + / * * <nl> + * Clean up all previous models and save a new model <nl> + * <nl> + * @ param model the xgboost model to save <nl> + * / <nl> + private [ spark ] def updateModel ( model : XGBoostModel ) : Unit = { <nl> + val fs = FileSystem . get ( sc . hadoopConfiguration ) <nl> + val prevModelPaths = getExistingVersions . map ( version = > new Path ( getPath ( version ) ) ) <nl> + val fullPath = getPath ( model . version ) <nl> + logger . info ( s " Saving checkpoint model with version $ { model . version } to $ fullPath " ) <nl> + model . saveModelAsHadoopFile ( fullPath ) ( sc ) <nl> + prevModelPaths . foreach ( path = > fs . delete ( path , true ) ) <nl> + } <nl> + <nl> + / * * <nl> + * Clean up checkpoint boosters with version higher than or equal to the round . <nl> + * <nl> + * @ param round the number of rounds in the current training job <nl> + * / <nl> + private [ spark ] def cleanUpHigherVersions ( round : Int ) : Unit = { <nl> + val higherVersions = getExistingVersions . filter ( _ / 2 > = round ) <nl> + higherVersions . foreach { version = > <nl> + val fs = FileSystem . get ( sc . hadoopConfiguration ) <nl> + fs . delete ( new Path ( getPath ( version ) ) , true ) <nl> + } <nl> + } <nl> + <nl> + / * * <nl> + * Calculate a list of checkpoint rounds to save checkpoints based on the savingFreq and <nl> + * total number of rounds for the training . Concretely , the saving rounds start with <nl> + * prevRounds + savingFreq , and increase by savingFreq in each step until it reaches total <nl> + * number of rounds . If savingFreq is 0 , the checkpoint will be disabled and the method <nl> + * returns Seq ( round ) <nl> + * <nl> + * @ param savingFreq the increase on rounds during each step of training <nl> + * @ param round the total number of rounds for the training <nl> + * @ return a seq of integers , each represent the index of round to save the checkpoints <nl> + * / <nl> + private [ spark ] def getSavingRounds ( savingFreq : Int , round : Int ) : Seq [ Int ] = { <nl> + if ( checkpointPath . nonEmpty & & savingFreq > 0 ) { <nl> + val prevRounds = getExistingVersions . map ( _ / 2 ) <nl> + val firstSavingRound = ( 0 + : prevRounds ) . max + savingFreq <nl> + ( firstSavingRound until round by savingFreq ) : + round <nl> + } else if ( savingFreq < = 0 ) { <nl> + Seq ( round ) <nl> + } else { <nl> + throw new IllegalArgumentException ( " parameters \ " checkpoint_path \ " should also be set . " ) <nl> + } <nl> + } <nl> + } <nl> + <nl> + object CheckpointManager { <nl> + <nl> + private [ spark ] def extractParams ( params : Map [ String , Any ] ) : ( String , Int ) = { <nl> + val checkpointPath : String = params . get ( " checkpoint_path " ) match { <nl> + case None = > " " <nl> + case Some ( path : String ) = > path <nl> + case _ = > throw new IllegalArgumentException ( " parameter \ " checkpoint_path \ " must be " + <nl> + " an instance of String . " ) <nl> + } <nl> + <nl> + val savingFreq : Int = params . get ( " saving_frequency " ) match { <nl> + case None = > 0 <nl> + case Some ( freq : Int ) = > freq <nl> + case _ = > throw new IllegalArgumentException ( " parameter \ " saving_frequency \ " must be " + <nl> + " an instance of Int . " ) <nl> + } <nl> + ( checkpointPath , savingFreq ) <nl> + } <nl> + } <nl> mmm a / jvm - packages / xgboost4j - spark / src / main / scala / ml / dmlc / xgboost4j / scala / spark / XGBoost . scala <nl> ppp b / jvm - packages / xgboost4j - spark / src / main / scala / ml / dmlc / xgboost4j / scala / spark / XGBoost . scala <nl> import java . io . File <nl> <nl> import scala . collection . mutable <nl> import scala . util . Random <nl> - <nl> import ml . dmlc . xgboost4j . java . { IRabitTracker , Rabit , XGBoostError , RabitTracker = > PyRabitTracker } <nl> import ml . dmlc . xgboost4j . scala . rabit . RabitTracker <nl> import ml . dmlc . xgboost4j . scala . { XGBoost = > SXGBoost , _ } <nl> object XGBoost extends Serializable { <nl> data : RDD [ XGBLabeledPoint ] , <nl> params : Map [ String , Any ] , <nl> rabitEnv : java . util . Map [ String , String ] , <nl> - numWorkers : Int , <nl> round : Int , <nl> obj : ObjectiveTrait , <nl> eval : EvalTrait , <nl> useExternalMemory : Boolean , <nl> - missing : Float ) : RDD [ ( Booster , Map [ String , Array [ Float ] ] ) ] = { <nl> - val partitionedData = if ( data . getNumPartitions ! = numWorkers ) { <nl> - logger . info ( s " repartitioning training set to $ numWorkers partitions " ) <nl> - data . repartition ( numWorkers ) <nl> - } else { <nl> - data <nl> - } <nl> - val partitionedBaseMargin = partitionedData . map ( _ . baseMargin ) <nl> + missing : Float , <nl> + prevBooster : Booster <nl> + ) : RDD [ ( Booster , Map [ String , Array [ Float ] ] ) ] = { <nl> + <nl> + val partitionedBaseMargin = data . map ( _ . baseMargin ) <nl> / / to workaround the empty partitions in training dataset , <nl> / / this might not be the best efficient implementation , see <nl> / / ( https : / / github . com / dmlc / xgboost / issues / 1277 ) <nl> - partitionedData . zipPartitions ( partitionedBaseMargin ) { ( labeledPoints , baseMargins ) = > <nl> + data . zipPartitions ( partitionedBaseMargin ) { ( labeledPoints , baseMargins ) = > <nl> if ( labeledPoints . isEmpty ) { <nl> throw new XGBoostError ( <nl> s " detected an empty partition in the training data , partition ID : " + <nl> object XGBoost extends Serializable { <nl> val metrics = Array . tabulate ( watches . size ) ( _ = > Array . ofDim [ Float ] ( round ) ) <nl> val booster = SXGBoost . train ( watches . train , params , round , <nl> watches . toMap , metrics , obj , eval , <nl> - earlyStoppingRound = numEarlyStoppingRounds ) <nl> + earlyStoppingRound = numEarlyStoppingRounds , prevBooster ) <nl> Iterator ( booster - > watches . toMap . keys . zip ( metrics ) . toMap ) <nl> } finally { <nl> Rabit . shutdown ( ) <nl> object XGBoost extends Serializable { <nl> case _ = > throw new IllegalArgumentException ( " parameter \ " timeout_request_workers \ " must be " + <nl> " an instance of Long . " ) <nl> } <nl> - <nl> - val tracker = startTracker ( nWorkers , trackerConf ) <nl> - try { <nl> - val sc = trainingData . sparkContext <nl> - val parallelismTracker = new SparkParallelismTracker ( sc , timeoutRequestWorkers , nWorkers ) <nl> - val overriddenParams = overrideParamsAccordingToTaskCPUs ( params , trainingData . sparkContext ) <nl> - val boostersAndMetrics = buildDistributedBoosters ( trainingData , overriddenParams , <nl> - tracker . getWorkerEnvs , nWorkers , round , obj , eval , useExternalMemory , missing ) <nl> - val sparkJobThread = new Thread ( ) { <nl> - override def run ( ) { <nl> - / / force the job <nl> - boostersAndMetrics . foreachPartition ( ( ) = > _ ) <nl> - } <nl> - } <nl> - sparkJobThread . setUncaughtExceptionHandler ( tracker ) <nl> - sparkJobThread . start ( ) <nl> - val isClsTask = isClassificationTask ( params ) <nl> - val trackerReturnVal = parallelismTracker . execute ( tracker . waitFor ( 0L ) ) <nl> - logger . info ( s " Rabit returns with exit code $ trackerReturnVal " ) <nl> - val model = postTrackerReturnProcessing ( trackerReturnVal , boostersAndMetrics , <nl> - sparkJobThread , isClsTask ) <nl> - if ( isClsTask ) { <nl> - model . asInstanceOf [ XGBoostClassificationModel ] . numOfClasses = <nl> - params . getOrElse ( " num_class " , " 2 " ) . toString . toInt <nl> + val ( checkpointPath , savingFeq ) = CheckpointManager . extractParams ( params ) <nl> + val partitionedData = repartitionForTraining ( trainingData , nWorkers ) <nl> + <nl> + val sc = trainingData . sparkContext <nl> + val checkpointManager = new CheckpointManager ( sc , checkpointPath ) <nl> + checkpointManager . cleanUpHigherVersions ( round ) <nl> + <nl> + var prevBooster = checkpointManager . loadBooster <nl> + / / Train for every $ { savingRound } rounds and save the partially completed booster <nl> + checkpointManager . getSavingRounds ( savingFeq , round ) . map { <nl> + savingRound : Int = > <nl> + val tracker = startTracker ( nWorkers , trackerConf ) <nl> + try { <nl> + val parallelismTracker = new SparkParallelismTracker ( sc , timeoutRequestWorkers , nWorkers ) <nl> + val overriddenParams = overrideParamsAccordingToTaskCPUs ( params , sc ) <nl> + val boostersAndMetrics = buildDistributedBoosters ( partitionedData , overriddenParams , <nl> + tracker . getWorkerEnvs , savingRound , obj , eval , useExternalMemory , missing , prevBooster ) <nl> + val sparkJobThread = new Thread ( ) { <nl> + override def run ( ) { <nl> + / / force the job <nl> + boostersAndMetrics . foreachPartition ( ( ) = > _ ) <nl> + } <nl> + } <nl> + sparkJobThread . setUncaughtExceptionHandler ( tracker ) <nl> + sparkJobThread . start ( ) <nl> + val isClsTask = isClassificationTask ( params ) <nl> + val trackerReturnVal = parallelismTracker . execute ( tracker . waitFor ( 0L ) ) <nl> + logger . info ( s " Rabit returns with exit code $ trackerReturnVal " ) <nl> + val model = postTrackerReturnProcessing ( trackerReturnVal , boostersAndMetrics , <nl> + sparkJobThread , isClsTask ) <nl> + if ( isClsTask ) { <nl> + model . asInstanceOf [ XGBoostClassificationModel ] . numOfClasses = <nl> + params . getOrElse ( " num_class " , " 2 " ) . toString . toInt <nl> + } <nl> + if ( savingRound < round ) { <nl> + prevBooster = model . booster <nl> + checkpointManager . updateModel ( model ) <nl> + } <nl> + model <nl> + } finally { <nl> + tracker . stop ( ) <nl> } <nl> - model <nl> - } finally { <nl> - tracker . stop ( ) <nl> + } . last <nl> + } <nl> + <nl> + <nl> + private [ spark ] def repartitionForTraining ( trainingData : RDD [ XGBLabeledPoint ] , nWorkers : Int ) = { <nl> + if ( trainingData . getNumPartitions ! = nWorkers ) { <nl> + logger . info ( s " repartitioning training set to $ nWorkers partitions " ) <nl> + trainingData . repartition ( nWorkers ) <nl> + } else { <nl> + trainingData <nl> } <nl> } <nl> <nl> object XGBoost extends Serializable { <nl> xgBoostModel . setPredictionCol ( predCol ) <nl> } <nl> <nl> + <nl> / * * <nl> * Load XGBoost model from path in HDFS - compatible file system <nl> * <nl> mmm a / jvm - packages / xgboost4j - spark / src / main / scala / ml / dmlc / xgboost4j / scala / spark / XGBoostModel . scala <nl> ppp b / jvm - packages / xgboost4j - spark / src / main / scala / ml / dmlc / xgboost4j / scala / spark / XGBoostModel . scala <nl> abstract class XGBoostModel ( protected var _booster : Booster ) <nl> <nl> def booster : Booster = _booster <nl> <nl> + def version : Int = this . booster . booster . getVersion <nl> + <nl> override def copy ( extra : ParamMap ) : XGBoostModel = defaultCopy ( extra ) <nl> <nl> override def write : MLWriter = new XGBoostModel . XGBoostModelModelWriter ( this ) <nl> 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> trait GeneralParams extends Params { <nl> " request new Workers if numCores are insufficient . The timeout will be disabled if this " + <nl> " value is set smaller than or equal to 0 . " ) <nl> <nl> + / * * <nl> + * The hdfs folder to load and save checkpoint boosters . default : ` empty_string ` <nl> + * / <nl> + val checkpointPath = new Param [ String ] ( this , " checkpoint_path " , " the hdfs folder to load and " + <nl> + " save checkpoints . The job will try to load the existing booster as the starting point for " + <nl> + " training . If saving_frequency is also set , the job will save a checkpoint every a few rounds . " ) <nl> + <nl> + / * * <nl> + * The frequency to save checkpoint boosters . default : 0 <nl> + * / <nl> + val savingFrequency = new IntParam ( this , " saving_frequency " , " if checkpoint_path is also set , " + <nl> + " the job will save checkpoints at this frequency . If the job fails and gets restarted with " + <nl> + " same setting , it will load the existing booster instead of training from scratch . " + <nl> + " Checkpoint will be disabled if set to 0 . " ) <nl> + <nl> / * * <nl> * Rabit tracker configurations . The parameter must be provided as an instance of the <nl> * TrackerConf class , which has the following definition : <nl> trait GeneralParams extends Params { <nl> setDefault ( round - > 1 , nWorkers - > 1 , numThreadPerTask - > 1 , <nl> useExternalMemory - > false , silent - > 0 , <nl> customObj - > null , customEval - > null , missing - > Float . NaN , <nl> - trackerConf - > TrackerConf ( ) , seed - > 0 , timeoutRequestWorkers - > 30 * 60 * 1000L <nl> + trackerConf - > TrackerConf ( ) , seed - > 0 , timeoutRequestWorkers - > 30 * 60 * 1000L , <nl> + checkpointPath - > " " , savingFrequency - > 0 <nl> ) <nl> } <nl> new file mode 100644 <nl> index 0000000000 . . f0c9ba6971 <nl> mmm / dev / null <nl> ppp b / jvm - packages / xgboost4j - spark / src / test / scala / ml / dmlc / xgboost4j / scala / spark / CheckpointManagerSuite . scala <nl> <nl> + / * <nl> + Copyright ( c ) 2014 by Contributors <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + * / <nl> + <nl> + package ml . dmlc . xgboost4j . scala . spark <nl> + <nl> + import java . io . File <nl> + import java . nio . file . Files <nl> + <nl> + import org . scalatest . { BeforeAndAfterAll , FunSuite } <nl> + import org . apache . hadoop . fs . { FileSystem , Path } <nl> + import org . apache . spark . { SparkConf , SparkContext } <nl> + <nl> + class CheckpointManagerSuite extends FunSuite with BeforeAndAfterAll { <nl> + var sc : SparkContext = _ <nl> + <nl> + override def beforeAll ( ) : Unit = { <nl> + val conf : SparkConf = new SparkConf ( ) <nl> + . setMaster ( " local [ * ] " ) <nl> + . setAppName ( " XGBoostSuite " ) <nl> + sc = new SparkContext ( conf ) <nl> + } <nl> + <nl> + private lazy val ( model4 , model8 ) = { <nl> + import DataUtils . _ <nl> + val trainingRDD = sc . parallelize ( Classification . train ) . map ( _ . asML ) . cache ( ) <nl> + val paramMap = Map ( " eta " - > " 1 " , " max_depth " - > " 2 " , " silent " - > " 1 " , <nl> + " objective " - > " binary : logistic " ) <nl> + ( XGBoost . trainWithRDD ( trainingRDD , paramMap , round = 2 , sc . defaultParallelism ) , <nl> + XGBoost . trainWithRDD ( trainingRDD , paramMap , round = 4 , sc . defaultParallelism ) ) <nl> + } <nl> + <nl> + test ( " test update / load models " ) { <nl> + val tmpPath = Files . createTempDirectory ( " test " ) . toAbsolutePath . toString <nl> + val manager = new CheckpointManager ( sc , tmpPath ) <nl> + manager . updateModel ( model4 ) <nl> + var files = FileSystem . get ( sc . hadoopConfiguration ) . listStatus ( new Path ( tmpPath ) ) <nl> + assert ( files . length = = 1 ) <nl> + assert ( files . head . getPath . getName = = " 4 . model " ) <nl> + assert ( manager . loadBooster . booster . getVersion = = 4 ) <nl> + <nl> + manager . updateModel ( model8 ) <nl> + files = FileSystem . get ( sc . hadoopConfiguration ) . listStatus ( new Path ( tmpPath ) ) <nl> + assert ( files . length = = 1 ) <nl> + assert ( files . head . getPath . getName = = " 8 . model " ) <nl> + assert ( manager . loadBooster . booster . getVersion = = 8 ) <nl> + } <nl> + <nl> + test ( " test cleanUpHigherVersions " ) { <nl> + val tmpPath = Files . createTempDirectory ( " test " ) . toAbsolutePath . toString <nl> + val manager = new CheckpointManager ( sc , tmpPath ) <nl> + manager . updateModel ( model8 ) <nl> + manager . cleanUpHigherVersions ( round = 8 ) <nl> + assert ( new File ( s " $ tmpPath / 8 . model " ) . exists ( ) ) <nl> + <nl> + manager . cleanUpHigherVersions ( round = 4 ) <nl> + assert ( ! new File ( s " $ tmpPath / 8 . model " ) . exists ( ) ) <nl> + } <nl> + <nl> + test ( " test saving rounds " ) { <nl> + val tmpPath = Files . createTempDirectory ( " test " ) . toAbsolutePath . toString <nl> + val manager = new CheckpointManager ( sc , tmpPath ) <nl> + assertResult ( Seq ( 7 ) ) ( manager . getSavingRounds ( savingFreq = 0 , round = 7 ) ) <nl> + assertResult ( Seq ( 2 , 4 , 6 , 7 ) ) ( manager . getSavingRounds ( savingFreq = 2 , round = 7 ) ) <nl> + manager . updateModel ( model4 ) <nl> + assertResult ( Seq ( 4 , 6 , 7 ) ) ( manager . getSavingRounds ( 2 , 7 ) ) <nl> + } <nl> + } <nl> mmm a / jvm - packages / xgboost4j - spark / src / test / scala / ml / dmlc / xgboost4j / scala / spark / XGBoostGeneralSuite . scala <nl> ppp b / jvm - packages / xgboost4j - spark / src / test / scala / ml / dmlc / xgboost4j / scala / spark / XGBoostGeneralSuite . scala <nl> <nl> <nl> package ml . dmlc . xgboost4j . scala . spark <nl> <nl> + import java . nio . file . Files <nl> import java . util . concurrent . LinkedBlockingDeque <nl> <nl> import scala . util . Random <nl> - <nl> import ml . dmlc . xgboost4j . java . Rabit <nl> import ml . dmlc . xgboost4j . scala . DMatrix <nl> import ml . dmlc . xgboost4j . scala . rabit . RabitTracker <nl> + import org . apache . hadoop . fs . { FileSystem , Path } <nl> import org . apache . spark . SparkContext <nl> import org . apache . spark . ml . feature . { LabeledPoint = > MLLabeledPoint } <nl> import org . apache . spark . ml . linalg . { DenseVector , Vectors , Vector = > SparkVector } <nl> class XGBoostGeneralSuite extends FunSuite with PerTest { <nl> <nl> test ( " build RDD containing boosters with the specified worker number " ) { <nl> val trainingRDD = sc . parallelize ( Classification . train ) <nl> + val partitionedRDD = XGBoost . repartitionForTraining ( trainingRDD , 2 ) <nl> val boosterRDD = XGBoost . buildDistributedBoosters ( <nl> - trainingRDD , <nl> + partitionedRDD , <nl> List ( " eta " - > " 1 " , " max_depth " - > " 6 " , " silent " - > " 1 " , <nl> " objective " - > " binary : logistic " ) . toMap , <nl> new java . util . HashMap [ String , String ] ( ) , <nl> - numWorkers = 2 , round = 5 , eval = null , obj = null , useExternalMemory = true , <nl> - missing = Float . NaN ) <nl> + round = 5 , eval = null , obj = null , useExternalMemory = true , <nl> + missing = Float . NaN , prevBooster = null ) <nl> val boosterCount = boosterRDD . count ( ) <nl> assert ( boosterCount = = = 2 ) <nl> } <nl> class XGBoostGeneralSuite extends FunSuite with PerTest { <nl> assert ( XGBoost . isClassificationTask ( params ) = = isClassificationTask ) <nl> } <nl> } <nl> + <nl> + test ( " training with saving checkpoint boosters " ) { <nl> + import DataUtils . _ <nl> + val eval = new EvalError ( ) <nl> + val trainingRDD = sc . parallelize ( Classification . train ) . map ( _ . asML ) <nl> + val testSetDMatrix = new DMatrix ( Classification . test . iterator ) <nl> + <nl> + val tmpPath = Files . createTempDirectory ( " model1 " ) . toAbsolutePath . toString <nl> + val paramMap = List ( " eta " - > " 1 " , " max_depth " - > 2 , " silent " - > " 1 " , <nl> + " objective " - > " binary : logistic " , " checkpoint_path " - > tmpPath , <nl> + " saving_frequency " - > 2 ) . toMap <nl> + val prevModel = XGBoost . trainWithRDD ( trainingRDD , paramMap , round = 5 , <nl> + nWorkers = numWorkers ) <nl> + def error ( model : XGBoostModel ) : Float = eval . eval ( <nl> + model . booster . predict ( testSetDMatrix , outPutMargin = true ) , testSetDMatrix ) <nl> + <nl> + / / Check only one model is kept after training <nl> + val files = FileSystem . get ( sc . hadoopConfiguration ) . listStatus ( new Path ( tmpPath ) ) <nl> + assert ( files . length = = 1 ) <nl> + assert ( files . head . getPath . getName = = " 8 . model " ) <nl> + val tmpModel = XGBoost . loadModelFromHadoopFile ( s " $ tmpPath / 8 . model " ) <nl> + <nl> + / / Train next model based on prev model <nl> + val nextModel = XGBoost . trainWithRDD ( trainingRDD , paramMap , round = 8 , <nl> + nWorkers = numWorkers ) <nl> + assert ( error ( tmpModel ) > error ( prevModel ) ) <nl> + assert ( error ( prevModel ) > error ( nextModel ) ) <nl> + assert ( error ( nextModel ) < 0 . 1 ) <nl> + } <nl> } <nl> mmm a / jvm - packages / xgboost4j / src / main / java / ml / dmlc / xgboost4j / java / Booster . java <nl> ppp b / jvm - packages / xgboost4j / src / main / java / ml / dmlc / xgboost4j / java / Booster . java <nl> <nl> private static final Log logger = LogFactory . getLog ( Booster . class ) ; <nl> / / handle to the booster . <nl> private long handle = 0 ; <nl> + private int version = 0 ; <nl> <nl> / * * <nl> * Create a new Booster with empty stage . <nl> public void saveModel ( OutputStream out ) throws XGBoostError , IOException { <nl> return modelInfos [ 0 ] ; <nl> } <nl> <nl> + public int getVersion ( ) { <nl> + return this . version ; <nl> + } <nl> + <nl> + public void setVersion ( int version ) { <nl> + this . version = version ; <nl> + } <nl> + <nl> / * * <nl> * <nl> * @ return the saved byte array . <nl> public void saveModel ( OutputStream out ) throws XGBoostError , IOException { <nl> int loadRabitCheckpoint ( ) throws XGBoostError { <nl> int [ ] out = new int [ 1 ] ; <nl> XGBoostJNI . checkCall ( XGBoostJNI . XGBoosterLoadRabitCheckpoint ( this . handle , out ) ) ; <nl> - return out [ 0 ] ; <nl> + version = out [ 0 ] ; <nl> + return version ; <nl> } <nl> <nl> / * * <nl> - * Save the booster model into thread - local rabit checkpoint . <nl> + * Save the booster model into thread - local rabit checkpoint and increment the version . <nl> * This is only used in distributed training . <nl> * @ throws XGBoostError <nl> * / <nl> void saveRabitCheckpoint ( ) throws XGBoostError { <nl> XGBoostJNI . checkCall ( XGBoostJNI . XGBoosterSaveRabitCheckpoint ( this . handle ) ) ; <nl> + version + = 1 ; <nl> } <nl> <nl> / * * <nl> private void init ( DMatrix [ ] cacheMats ) throws XGBoostError { <nl> / / making Booster serializable <nl> private void writeObject ( java . io . ObjectOutputStream out ) throws IOException { <nl> try { <nl> + out . writeInt ( version ) ; <nl> out . writeObject ( this . toByteArray ( ) ) ; <nl> } catch ( XGBoostError ex ) { <nl> ex . printStackTrace ( ) ; <nl> private void readObject ( java . io . ObjectInputStream in ) <nl> throws IOException , ClassNotFoundException { <nl> try { <nl> this . init ( null ) ; <nl> + this . version = in . readInt ( ) ; <nl> byte [ ] bytes = ( byte [ ] ) in . readObject ( ) ; <nl> XGBoostJNI . checkCall ( XGBoostJNI . XGBoosterLoadModelFromBuffer ( this . handle , bytes ) ) ; <nl> } catch ( XGBoostError ex ) { <nl> public void write ( Kryo kryo , Output output ) { <nl> int serObjSize = serObj . length ; <nl> System . out . println ( " = = = = serialized obj size " + serObjSize ) ; <nl> output . writeInt ( serObjSize ) ; <nl> + output . writeInt ( version ) ; <nl> output . write ( serObj ) ; <nl> } catch ( XGBoostError ex ) { <nl> ex . printStackTrace ( ) ; <nl> public void read ( Kryo kryo , Input input ) { <nl> try { <nl> this . init ( null ) ; <nl> int serObjSize = input . readInt ( ) ; <nl> + this . version = input . readInt ( ) ; <nl> System . out . println ( " = = = = the size of the object : " + serObjSize ) ; <nl> byte [ ] bytes = new byte [ serObjSize ] ; <nl> input . readBytes ( bytes ) ; <nl> mmm a / jvm - packages / xgboost4j / src / main / java / ml / dmlc / xgboost4j / java / XGBoost . java <nl> ppp b / jvm - packages / xgboost4j / src / main / java / ml / dmlc / xgboost4j / java / XGBoost . java <nl> public static Booster loadModel ( InputStream in ) <nl> return Booster . loadModel ( in ) ; <nl> } <nl> <nl> + / * * <nl> + * Train a booster given parameters . <nl> + * <nl> + * @ param dtrain Data to be trained . <nl> + * @ param params Parameters . <nl> + * @ param round Number of boosting iterations . <nl> + * @ param watches a group of items to be evaluated during training , this allows user to watch <nl> + * performance on the validation set . <nl> + * @ param obj customized objective <nl> + * @ param eval customized evaluation <nl> + * @ return The trained booster . <nl> + * / <nl> public static Booster train ( <nl> DMatrix dtrain , <nl> Map < String , Object > params , <nl> public static Booster train ( <nl> return train ( dtrain , params , round , watches , null , obj , eval , 0 ) ; <nl> } <nl> <nl> + / * * <nl> + * Train a booster given parameters . <nl> + * <nl> + * @ param dtrain Data to be trained . <nl> + * @ param params Parameters . <nl> + * @ param round Number of boosting iterations . <nl> + * @ param watches a group of items to be evaluated during training , this allows user to watch <nl> + * performance on the validation set . <nl> + * @ param metrics array containing the evaluation metrics for each matrix in watches for each <nl> + * iteration <nl> + * @ param earlyStoppingRound if non - zero , training would be stopped <nl> + * after a specified number of consecutive <nl> + * increases in any evaluation metric . <nl> + * @ param obj customized objective <nl> + * @ param eval customized evaluation <nl> + * @ return The trained booster . <nl> + * / <nl> public static Booster train ( <nl> DMatrix dtrain , <nl> Map < String , Object > params , <nl> public static Booster train ( <nl> IObjective obj , <nl> IEvaluation eval , <nl> int earlyStoppingRound ) throws XGBoostError { <nl> + return train ( dtrain , params , round , watches , metrics , obj , eval , earlyStoppingRound , null ) ; <nl> + } <nl> + <nl> + / * * <nl> + * Train a booster given parameters . <nl> + * <nl> + * @ param dtrain Data to be trained . <nl> + * @ param params Parameters . <nl> + * @ param round Number of boosting iterations . <nl> + * @ param watches a group of items to be evaluated during training , this allows user to watch <nl> + * performance on the validation set . <nl> + * @ param metrics array containing the evaluation metrics for each matrix in watches for each <nl> + * iteration <nl> + * @ param earlyStoppingRound if non - zero , training would be stopped <nl> + * after a specified number of consecutive <nl> + * increases in any evaluation metric . <nl> + * @ param obj customized objective <nl> + * @ param eval customized evaluation <nl> + * @ param booster train from scratch if set to null ; train from an existing booster if not null . <nl> + * @ return The trained booster . <nl> + * / <nl> + public static Booster train ( <nl> + DMatrix dtrain , <nl> + Map < String , Object > params , <nl> + int round , <nl> + Map < String , DMatrix > watches , <nl> + float [ ] [ ] metrics , <nl> + IObjective obj , <nl> + IEvaluation eval , <nl> + int earlyStoppingRound , <nl> + Booster booster ) throws XGBoostError { <nl> <nl> / / collect eval matrixs <nl> String [ ] evalNames ; <nl> public static Booster train ( <nl> } <nl> <nl> / / initialize booster <nl> - Booster booster = new Booster ( params , allMats ) ; <nl> - <nl> - int version = booster . loadRabitCheckpoint ( ) ; <nl> + if ( booster = = null ) { <nl> + / / Start training on a new booster <nl> + booster = new Booster ( params , allMats ) ; <nl> + booster . loadRabitCheckpoint ( ) ; <nl> + } else { <nl> + / / Start training on an existing booster <nl> + booster . setParams ( params ) ; <nl> + } <nl> <nl> / / begin to train <nl> - for ( int iter = version / 2 ; iter < round ; iter + + ) { <nl> - if ( version % 2 = = 0 ) { <nl> + for ( int iter = booster . getVersion ( ) / 2 ; iter < round ; iter + + ) { <nl> + if ( booster . getVersion ( ) % 2 = = 0 ) { <nl> if ( obj ! = null ) { <nl> booster . update ( dtrain , obj ) ; <nl> } else { <nl> booster . update ( dtrain , iter ) ; <nl> } <nl> booster . saveRabitCheckpoint ( ) ; <nl> - version + = 1 ; <nl> } <nl> <nl> / / evaluation <nl> public static Booster train ( <nl> } <nl> } <nl> booster . saveRabitCheckpoint ( ) ; <nl> - version + = 1 ; <nl> } <nl> return booster ; <nl> } <nl> mmm a / jvm - packages / xgboost4j / src / main / scala / ml / dmlc / xgboost4j / scala / Booster . scala <nl> ppp b / jvm - packages / xgboost4j / src / main / scala / ml / dmlc / xgboost4j / scala / Booster . scala <nl> import ml . dmlc . xgboost4j . java . XGBoostError <nl> import scala . collection . JavaConverters . _ <nl> import scala . collection . mutable <nl> <nl> - class Booster private [ xgboost4j ] ( private var booster : JBooster ) <nl> + class Booster private [ xgboost4j ] ( private [ xgboost4j ] var booster : JBooster ) <nl> extends Serializable with KryoSerializable { <nl> <nl> / * * <nl> mmm a / jvm - packages / xgboost4j / src / main / scala / ml / dmlc / xgboost4j / scala / XGBoost . scala <nl> ppp b / jvm - packages / xgboost4j / src / main / scala / ml / dmlc / xgboost4j / scala / XGBoost . scala <nl> package ml . dmlc . xgboost4j . scala <nl> <nl> import java . io . InputStream <nl> <nl> - import ml . dmlc . xgboost4j . java . { XGBoost = > JXGBoost , XGBoostError } <nl> + import ml . dmlc . xgboost4j . java . { Booster = > JBooster , XGBoost = > JXGBoost , XGBoostError } <nl> import scala . collection . JavaConverters . _ <nl> <nl> / * * <nl> object XGBoost { <nl> * increases in any evaluation metric . <nl> * @ param obj customized objective <nl> * @ param eval customized evaluation <nl> + * @ param booster train from scratch if set to null ; train from an existing booster if not null . <nl> * @ return The trained booster . <nl> * / <nl> @ throws ( classOf [ XGBoostError ] ) <nl> object XGBoost { <nl> metrics : Array [ Array [ Float ] ] = null , <nl> obj : ObjectiveTrait = null , <nl> eval : EvalTrait = null , <nl> - earlyStoppingRound : Int = 0 ) : Booster = { <nl> + earlyStoppingRound : Int = 0 , <nl> + booster : Booster = null ) : Booster = { <nl> val jWatches = watches . mapValues ( _ . jDMatrix ) . asJava <nl> + val jBooster = if ( booster = = null ) { <nl> + null <nl> + } else { <nl> + booster . booster <nl> + } <nl> val xgboostInJava = JXGBoost . train ( <nl> dtrain . jDMatrix , <nl> / / we have to filter null value for customized obj and eval <nl> params . filter ( _ . _2 ! = null ) . mapValues ( _ . toString . asInstanceOf [ AnyRef ] ) . asJava , <nl> - round , jWatches , metrics , obj , eval , earlyStoppingRound ) <nl> + round , jWatches , metrics , obj , eval , earlyStoppingRound , jBooster ) <nl> new Booster ( xgboostInJava ) <nl> } <nl> <nl> mmm a / jvm - packages / xgboost4j / src / test / java / ml / dmlc / xgboost4j / java / BoosterImplTest . java <nl> ppp b / jvm - packages / xgboost4j / src / test / java / ml / dmlc / xgboost4j / java / BoosterImplTest . java <nl> <nl> * / <nl> package ml . dmlc . xgboost4j . java ; <nl> <nl> - import java . io . File ; <nl> - import java . io . FileInputStream ; <nl> - import java . io . FileOutputStream ; <nl> - import java . io . IOException ; <nl> + import java . io . * ; <nl> import java . nio . file . Files ; <nl> import java . nio . file . Path ; <nl> import java . util . Arrays ; <nl> public void testCV ( ) throws XGBoostError { <nl> int nfold = 5 ; <nl> String [ ] evalHist = XGBoost . crossValidation ( trainMat , param , round , nfold , null , null , null ) ; <nl> } <nl> + <nl> + / * * <nl> + * test train from existing model <nl> + * <nl> + * @ throws XGBoostError <nl> + * / <nl> + @ Test <nl> + public void testTrainFromExistingModel ( ) throws XGBoostError , IOException { <nl> + DMatrix trainMat = new DMatrix ( " . . / . . / demo / data / agaricus . txt . train " ) ; <nl> + DMatrix testMat = new DMatrix ( " . . / . . / demo / data / agaricus . txt . test " ) ; <nl> + IEvaluation eval = new EvalError ( ) ; <nl> + <nl> + Map < String , Object > paramMap = new HashMap < String , Object > ( ) { <nl> + { <nl> + put ( " eta " , 1 . 0 ) ; <nl> + put ( " max_depth " , 2 ) ; <nl> + put ( " silent " , 1 ) ; <nl> + put ( " objective " , " binary : logistic " ) ; <nl> + } <nl> + } ; <nl> + <nl> + / / set watchList <nl> + HashMap < String , DMatrix > watches = new HashMap < String , DMatrix > ( ) ; <nl> + <nl> + watches . put ( " train " , trainMat ) ; <nl> + watches . put ( " test " , testMat ) ; <nl> + <nl> + / / Train without saving temp booster <nl> + int round = 4 ; <nl> + Booster booster1 = XGBoost . train ( trainMat , paramMap , round , watches , null , null , null , 0 ) ; <nl> + float booster1error = eval . eval ( booster1 . predict ( testMat , true , 0 ) , testMat ) ; <nl> + <nl> + / / Train with temp Booster <nl> + round = 2 ; <nl> + Booster tempBooster = XGBoost . train ( trainMat , paramMap , round , watches , null , null , null , 0 ) ; <nl> + float tempBoosterError = eval . eval ( tempBooster . predict ( testMat , true , 0 ) , testMat ) ; <nl> + <nl> + / / Save tempBooster to bytestream and load back <nl> + int prevVersion = tempBooster . getVersion ( ) ; <nl> + ByteArrayInputStream in = new ByteArrayInputStream ( tempBooster . toByteArray ( ) ) ; <nl> + tempBooster = XGBoost . loadModel ( in ) ; <nl> + in . close ( ) ; <nl> + tempBooster . setVersion ( prevVersion ) ; <nl> + <nl> + / / Continue training using tempBooster <nl> + round = 4 ; <nl> + Booster booster2 = XGBoost . train ( trainMat , paramMap , round , watches , null , null , null , 0 , tempBooster ) ; <nl> + float booster2error = eval . eval ( booster2 . predict ( testMat , true , 0 ) , testMat ) ; <nl> + TestCase . assertTrue ( booster1error = = booster2error ) ; <nl> + TestCase . assertTrue ( tempBoosterError > booster2error ) ; <nl> + } <nl> } <nl>
[ jvm - packages ] Saving models into a tmp folder every a few rounds ( )
dmlc/xgboost
9004ca03cacd520cc66f453ace5091ab5507eb24
2017-12-29T16:36:41Z
mmm a / src / library_gl . js <nl> ppp b / src / library_gl . js <nl> var LibraryGL = { <nl> HEAPF32 . set ( GL . immediate . matrix [ ' p ' ] , params > > 2 ) ; <nl> } else if ( pname = = 0x0BA8 ) { / / GL_TEXTURE_MATRIX <nl> HEAPF32 . set ( GL . immediate . matrix [ ' t ' ] , params > > 2 ) ; <nl> + } else if ( pname = = 0x0B66 ) { / / GL_FOG_COLOR <nl> + { { { makeSetValue ( ' params ' , ' 0 ' , ' 0 ' , ' float ' ) } } } ; <nl> } else { <nl> glGetFloatv ( pname , params ) ; <nl> } <nl>
stub for glGetFloat of GL_FOG_COLOR
emscripten-core/emscripten
89c6df3505ab531a4330dc2759d485eb9d06eb0e
2012-04-20T18:18:33Z
mmm a / stdlib / public / core / Dictionary . swift <nl> ppp b / stdlib / public / core / Dictionary . swift <nl> internal class _RawNativeDictionaryStorage <nl> / / / Get the NSEnumerator implementation for self . <nl> / / / _HashableTypedNativeDictionaryStorage overloads this to give <nl> / / / _NativeSelfNSEnumerator proper type parameters . <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> @ objc <nl> internal func enumerator ( ) - > _NSEnumerator { <nl> return _NativeDictionaryNSEnumerator < AnyObject , AnyObject > ( <nl> internal class _RawNativeDictionaryStorage <nl> return nil <nl> } <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> internal func keyEnumerator ( ) - > _NSEnumerator { <nl> return enumerator ( ) <nl> } <nl> final internal class _HashableTypedNativeDictionaryStorage < Key : Hashable , Value > <nl> return FullContainer ( _nativeBuffer : buffer ) <nl> } <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> + @ objc <nl> internal override func enumerator ( ) - > _NSEnumerator { <nl> return _NativeDictionaryNSEnumerator < Key , Value > ( <nl> Buffer ( _storage : self ) ) <nl> extension _NativeDictionaryBuffer where Key : Hashable <nl> # if _runtime ( _ObjC ) <nl> / / / An NSEnumerator that works with any NativeDictionaryBuffer of <nl> / / / verbatim bridgeable elements . Used by the various NSDictionary impls . <nl> - @ _fixed_layout / / FIXME ( sil - serialize - all ) <nl> - @ usableFromInline / / FIXME ( sil - serialize - all ) <nl> final internal class _NativeDictionaryNSEnumerator < Key , Value > <nl> : _SwiftNativeNSEnumerator , _NSEnumerator { <nl> <nl> - @ usableFromInline <nl> internal typealias Buffer = _NativeDictionaryBuffer < Key , Value > <nl> - @ usableFromInline <nl> internal typealias Index = _NativeDictionaryIndex < Key , Value > <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> internal override required init ( ) { <nl> _sanityCheckFailure ( " don ' t call this designated initializer " ) <nl> } <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> internal init ( _ buffer : Buffer ) { <nl> self . buffer = buffer <nl> nextIndex = buffer . startIndex <nl> endIndex = buffer . endIndex <nl> } <nl> <nl> - @ usableFromInline / / FIXME ( sil - serialize - all ) <nl> internal var buffer : Buffer <nl> - @ usableFromInline / / FIXME ( sil - serialize - all ) <nl> internal var nextIndex : Index <nl> - @ usableFromInline / / FIXME ( sil - serialize - all ) <nl> internal var endIndex : Index <nl> <nl> / / <nl> final internal class _NativeDictionaryNSEnumerator < Key , Value > <nl> / / Do not call any of these methods from the standard library ! <nl> / / <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> @ objc <nl> internal func nextObject ( ) - > AnyObject ? { <nl> if nextIndex = = endIndex { <nl> final internal class _NativeDictionaryNSEnumerator < Key , Value > <nl> return key <nl> } <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> @ objc ( countByEnumeratingWithState : objects : count : ) <nl> internal func countByEnumerating ( <nl> with state : UnsafeMutablePointer < _SwiftNSFastEnumerationState > , <nl> final internal class _SwiftDeferredNSDictionary < Key : Hashable , Value > <nl> return bridgingObjectForKey ( aKey ) <nl> } <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> @ objc <nl> internal func keyEnumerator ( ) - > _NSEnumerator { <nl> return enumerator ( ) <nl> final internal class _SwiftDeferredNSDictionary < Key : Hashable , Value > <nl> return nil <nl> } <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> @ objc <nl> internal func enumerator ( ) - > _NSEnumerator { <nl> bridgeEverything ( ) <nl> mmm a / stdlib / public / core / Set . swift <nl> ppp b / stdlib / public / core / Set . swift <nl> internal class _RawNativeSetStorage : <nl> / / / Get the NSEnumerator implementation for self . <nl> / / / _HashableTypedNativeSetStorage overloads this to give <nl> / / / _NativeSelfNSEnumerator proper type parameters . <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> @ objc <nl> internal func enumerator ( ) - > _NSEnumerator { <nl> return _NativeSetNSEnumerator < AnyObject > ( <nl> internal class _RawNativeSetStorage : <nl> return nil <nl> } <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> @ objc <nl> internal func objectEnumerator ( ) - > _NSEnumerator { <nl> return enumerator ( ) <nl> final internal class _HashableTypedNativeSetStorage < Element : Hashable > <nl> return FullContainer ( _nativeBuffer : buffer ) <nl> } <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> + @ objc <nl> internal override func enumerator ( ) - > _NSEnumerator { <nl> return _NativeSetNSEnumerator < Element > ( <nl> Buffer ( _storage : self ) ) <nl> extension _NativeSetBuffer where Element : Hashable <nl> # if _runtime ( _ObjC ) <nl> / / / An NSEnumerator that works with any NativeSetBuffer of <nl> / / / verbatim bridgeable elements . Used by the various NSSet impls . <nl> - @ _fixed_layout / / FIXME ( sil - serialize - all ) <nl> - @ usableFromInline / / FIXME ( sil - serialize - all ) <nl> final internal class _NativeSetNSEnumerator < Element > <nl> : _SwiftNativeNSEnumerator , _NSEnumerator { <nl> <nl> - @ usableFromInline <nl> internal typealias Buffer = _NativeSetBuffer < Element > <nl> - @ usableFromInline <nl> internal typealias Index = _NativeSetIndex < Element > <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> internal override required init ( ) { <nl> _sanityCheckFailure ( " don ' t call this designated initializer " ) <nl> } <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> internal init ( _ buffer : Buffer ) { <nl> self . buffer = buffer <nl> nextIndex = buffer . startIndex <nl> endIndex = buffer . endIndex <nl> } <nl> <nl> - @ usableFromInline / / FIXME ( sil - serialize - all ) <nl> internal var buffer : Buffer <nl> - @ usableFromInline / / FIXME ( sil - serialize - all ) <nl> internal var nextIndex : Index <nl> - @ usableFromInline / / FIXME ( sil - serialize - all ) <nl> internal var endIndex : Index <nl> <nl> / / <nl> final internal class _NativeSetNSEnumerator < Element > <nl> / / Do not call any of these methods from the standard library ! <nl> / / <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> @ objc <nl> internal func nextObject ( ) - > AnyObject ? { <nl> if nextIndex = = endIndex { <nl> final internal class _NativeSetNSEnumerator < Element > <nl> return key <nl> } <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> @ objc ( countByEnumeratingWithState : objects : count : ) <nl> internal func countByEnumerating ( <nl> with state : UnsafeMutablePointer < _SwiftNSFastEnumerationState > , <nl> final internal class _SwiftDeferredNSSet < Element : Hashable > <nl> return bridgingObjectForKey ( object ) <nl> } <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> @ objc <nl> internal func objectEnumerator ( ) - > _NSEnumerator { <nl> return enumerator ( ) <nl> final internal class _SwiftDeferredNSSet < Element : Hashable > <nl> return nil <nl> } <nl> <nl> - @ inlinable / / FIXME ( sil - serialize - all ) <nl> @ objc <nl> internal func enumerator ( ) - > _NSEnumerator { <nl> bridgeEverything ( ) <nl>
[ stdlib ] Make Set & Dictionary enumerators internal
apple/swift
c72bf4cdfab866053bc61447fa062d99a14c0643
2018-07-17T14:59:50Z
mmm a / . circleci / config . yml <nl> ppp b / . circleci / config . yml <nl> jobs : <nl> docker run - - gpus all \ <nl> - e CUDA_ARCHS = " 35 ; 52 ; 60 ; 61 ; 70 ; 72 ; 75 " \ <nl> - e ANACONDA_API_TOKEN = $ ANACONDA_API_TOKEN \ <nl> + faiss \ <nl> conda build faiss - gpu - - variants ' { " cudatoolkit " : " < < parameters . cuda > > " } ' \ <nl> - - user pytorch - - label < < parameters . label > > <nl> <nl>
Fix nightly build for GPU .
facebookresearch/faiss
04fde4032a8b3ccb026f9f0073c9a5c94e7229b5
2020-10-27T05:33:52Z
mmm a / admin / static / coffee / tables / table . coffee <nl> ppp b / admin / static / coffee / tables / table . coffee <nl> module ' TableView ' , - > <nl> <nl> <nl> fetch_data : = > <nl> - # TODO Use table_config to retrieve the number of shards / replicas <nl> ignore = ( shard ) - > shard ( ' role ' ) . ne ( ' nothing ' ) <nl> this_id = @ id <nl> query = <nl>
Remove TODO done
rethinkdb/rethinkdb
f4742ad772ee8057a76f9852c88fde715bc0b6ad
2014-09-11T00:48:24Z
deleted file mode 100644 <nl> index 154ebf6c35e . . 00000000000 <nl> mmm a / tests / integration / test_http_handlers_config / common_configs / common_config . xml <nl> ppp / dev / null <nl> <nl> - < ? xml version = " 1 . 0 " ? > <nl> - < ! - - <nl> - NOTE : User and query level settings are set up in " users . xml " file . <nl> mmm > <nl> - < yandex > <nl> - < logger > <nl> - < ! - - Possible levels : https : / / github . com / pocoproject / poco / blob / develop / Foundation / include / Poco / Logger . h # L105 - - > <nl> - < level > trace < / level > <nl> - < log > / var / log / clickhouse - server / clickhouse - server . log < / log > <nl> - < errorlog > / var / log / clickhouse - server / clickhouse - server . err . log < / errorlog > <nl> - < size > 1000M < / size > <nl> - < count > 10 < / count > <nl> - < ! - - < console > 1 < / console > - - > < ! - - Default behavior is autodetection ( log to console if not daemon mode and is tty ) - - > <nl> - < / logger > <nl> - < ! - - display_name > production < / display_name - - > < ! - - It is the name that will be shown in the client - - > <nl> - < http_port > 8123 < / http_port > <nl> - < tcp_port > 9000 < / tcp_port > <nl> - <nl> - < ! - - For HTTPS and SSL over native protocol . - - > <nl> - < ! - - <nl> - < https_port > 8443 < / https_port > <nl> - < tcp_port_secure > 9440 < / tcp_port_secure > <nl> - - - > <nl> - <nl> - < ! - - Used with https_port and tcp_port_secure . Full ssl options list : https : / / github . com / ClickHouse - Extras / poco / blob / master / NetSSL_OpenSSL / include / Poco / Net / SSLManager . h # L71 - - > <nl> - < openSSL > <nl> - < server > < ! - - Used for https server AND secure tcp port - - > <nl> - < ! - - openssl req - subj " / CN = localhost " - new - newkey rsa : 2048 - days 365 - nodes - x509 - keyout / etc / clickhouse - server / server . key - out / etc / clickhouse - server / server . crt - - > <nl> - < certificateFile > / etc / clickhouse - server / server . crt < / certificateFile > <nl> - < privateKeyFile > / etc / clickhouse - server / server . key < / privateKeyFile > <nl> - < ! - - openssl dhparam - out / etc / clickhouse - server / dhparam . pem 4096 - - > <nl> - < dhParamsFile > / etc / clickhouse - server / dhparam . pem < / dhParamsFile > <nl> - < verificationMode > none < / verificationMode > <nl> - < loadDefaultCAFile > true < / loadDefaultCAFile > <nl> - < cacheSessions > true < / cacheSessions > <nl> - < disableProtocols > sslv2 , sslv3 < / disableProtocols > <nl> - < preferServerCiphers > true < / preferServerCiphers > <nl> - < / server > <nl> - <nl> - < client > < ! - - Used for connecting to https dictionary source - - > <nl> - < loadDefaultCAFile > true < / loadDefaultCAFile > <nl> - < cacheSessions > true < / cacheSessions > <nl> - < disableProtocols > sslv2 , sslv3 < / disableProtocols > <nl> - < preferServerCiphers > true < / preferServerCiphers > <nl> - < ! - - Use for self - signed : < verificationMode > none < / verificationMode > - - > <nl> - < invalidCertificateHandler > <nl> - < ! - - Use for self - signed : < name > AcceptCertificateHandler < / name > - - > <nl> - < name > RejectCertificateHandler < / name > <nl> - < / invalidCertificateHandler > <nl> - < / client > <nl> - < / openSSL > <nl> - <nl> - < ! - - Default root page on http [ s ] server . For example load UI from https : / / tabix . io / when opening http : / / localhost : 8123 - - > <nl> - < ! - - <nl> - < http_server_default_response > < ! [ CDATA [ < html ng - app = " SMI2 " > < head > < base href = " http : / / ui . tabix . io / " > < / head > < body > < div ui - view = " " class = " content - ui " > < / div > < script src = " http : / / loader . tabix . io / master . js " > < / script > < / body > < / html > ] ] > < / http_server_default_response > <nl> - - - > <nl> - <nl> - < ! - - Port for communication between replicas . Used for data exchange . - - > <nl> - < interserver_http_port > 9009 < / interserver_http_port > <nl> - <nl> - < ! - - Hostname that is used by other replicas to request this server . <nl> - If not specified , than it is determined analoguous to ' hostname - f ' command . <nl> - This setting could be used to switch replication to another network interface . <nl> - - - > <nl> - < ! - - <nl> - < interserver_http_host > example . yandex . ru < / interserver_http_host > <nl> - - - > <nl> - <nl> - < ! - - Listen specified host . use : : ( wildcard IPv6 address ) , if you want to accept connections both with IPv4 and IPv6 from everywhere . - - > <nl> - < ! - - < listen_host > : : < / listen_host > - - > <nl> - < ! - - Same for hosts with disabled ipv6 : - - > <nl> - < ! - - < listen_host > 0 . 0 . 0 . 0 < / listen_host > - - > <nl> - <nl> - < ! - - Default values - try listen localhost on ipv4 and ipv6 : - - > <nl> - < ! - - <nl> - < listen_host > : : 1 < / listen_host > <nl> - < listen_host > 127 . 0 . 0 . 1 < / listen_host > <nl> - - - > <nl> - < ! - - Don ' t exit if ipv6 or ipv4 unavailable , but listen_host with this protocol specified - - > <nl> - < ! - - < listen_try > 0 < / listen_try > - - > <nl> - <nl> - < ! - - Allow listen on same address : port - - > <nl> - < ! - - < listen_reuse_port > 0 < / listen_reuse_port > - - > <nl> - <nl> - < ! - - < listen_backlog > 64 < / listen_backlog > - - > <nl> - <nl> - < max_connections > 4096 < / max_connections > <nl> - < keep_alive_timeout > 3 < / keep_alive_timeout > <nl> - <nl> - < ! - - Maximum number of concurrent queries . - - > <nl> - < max_concurrent_queries > 100 < / max_concurrent_queries > <nl> - <nl> - < ! - - Set limit on number of open files ( default : maximum ) . This setting makes sense on Mac OS X because getrlimit ( ) fails to retrieve <nl> - correct maximum value . - - > <nl> - < ! - - < max_open_files > 262144 < / max_open_files > - - > <nl> - <nl> - < ! - - Size of cache of uncompressed blocks of data , used in tables of MergeTree family . <nl> - In bytes . Cache is single for server . Memory is allocated only on demand . <nl> - Cache is used when ' use_uncompressed_cache ' user setting turned on ( off by default ) . <nl> - Uncompressed cache is advantageous only for very short queries and in rare cases . <nl> - - - > <nl> - < uncompressed_cache_size > 8589934592 < / uncompressed_cache_size > <nl> - <nl> - < ! - - Approximate size of mark cache , used in tables of MergeTree family . <nl> - In bytes . Cache is single for server . Memory is allocated only on demand . <nl> - You should not lower this value . <nl> - - - > <nl> - < mark_cache_size > 5368709120 < / mark_cache_size > <nl> - <nl> - <nl> - < ! - - Path to data directory , with trailing slash . - - > <nl> - < path > / var / lib / clickhouse / < / path > <nl> - <nl> - < ! - - Path to temporary data for processing hard queries . - - > <nl> - < tmp_path > / var / lib / clickhouse / tmp / < / tmp_path > <nl> - <nl> - < ! - - Directory with user provided files that are accessible by ' file ' table function . - - > <nl> - < user_files_path > / var / lib / clickhouse / user_files / < / user_files_path > <nl> - <nl> - < ! - - Path to configuration file with users , access rights , profiles of settings , quotas . - - > <nl> - < users_config > users . xml < / users_config > <nl> - <nl> - < ! - - Default profile of settings . - - > <nl> - < default_profile > default < / default_profile > <nl> - <nl> - < ! - - System profile of settings . This settings are used by internal processes ( Buffer storage , Distibuted DDL worker and so on ) . - - > <nl> - < ! - - < system_profile > default < / system_profile > - - > <nl> - <nl> - < ! - - Default database . - - > <nl> - < default_database > default < / default_database > <nl> - <nl> - < ! - - Server time zone could be set here . <nl> - <nl> - Time zone is used when converting between String and DateTime types , <nl> - when printing DateTime in text formats and parsing DateTime from text , <nl> - it is used in date and time related functions , if specific time zone was not passed as an argument . <nl> - <nl> - Time zone is specified as identifier from IANA time zone database , like UTC or Africa / Abidjan . <nl> - If not specified , system time zone at server startup is used . <nl> - <nl> - Please note , that server could display time zone alias instead of specified name . <nl> - Example : W - SU is an alias for Europe / Moscow and Zulu is an alias for UTC . <nl> - - - > <nl> - < ! - - < timezone > Europe / Moscow < / timezone > - - > <nl> - <nl> - < ! - - You can specify umask here ( see " man umask " ) . Server will apply it on startup . <nl> - Number is always parsed as octal . Default umask is 027 ( other users cannot read logs , data files , etc ; group can only read ) . <nl> - - - > <nl> - < ! - - < umask > 022 < / umask > - - > <nl> - <nl> - < ! - - Perform mlockall after startup to lower first queries latency <nl> - and to prevent clickhouse executable from being paged out under high IO load . <nl> - Enabling this option is recommended but will lead to increased startup time for up to a few seconds . <nl> - - - > <nl> - < mlock_executable > false < / mlock_executable > <nl> - <nl> - < ! - - Configuration of clusters that could be used in Distributed tables . <nl> - https : / / clickhouse . yandex / docs / en / table_engines / distributed / <nl> - - - > <nl> - < remote_servers incl = " clickhouse_remote_servers " > <nl> - < ! - - Test only shard config for testing distributed storage - - > <nl> - < test_shard_localhost > <nl> - < shard > <nl> - < replica > <nl> - < host > localhost < / host > <nl> - < port > 9000 < / port > <nl> - < / replica > <nl> - < / shard > <nl> - < / test_shard_localhost > <nl> - < test_cluster_two_shards_localhost > <nl> - < shard > <nl> - < replica > <nl> - < host > localhost < / host > <nl> - < port > 9000 < / port > <nl> - < / replica > <nl> - < / shard > <nl> - < shard > <nl> - < replica > <nl> - < host > localhost < / host > <nl> - < port > 9000 < / port > <nl> - < / replica > <nl> - < / shard > <nl> - < / test_cluster_two_shards_localhost > <nl> - < test_shard_localhost_secure > <nl> - < shard > <nl> - < replica > <nl> - < host > localhost < / host > <nl> - < port > 9440 < / port > <nl> - < secure > 1 < / secure > <nl> - < / replica > <nl> - < / shard > <nl> - < / test_shard_localhost_secure > <nl> - < test_unavailable_shard > <nl> - < shard > <nl> - < replica > <nl> - < host > localhost < / host > <nl> - < port > 9000 < / port > <nl> - < / replica > <nl> - < / shard > <nl> - < shard > <nl> - < replica > <nl> - < host > localhost < / host > <nl> - < port > 1 < / port > <nl> - < / replica > <nl> - < / shard > <nl> - < / test_unavailable_shard > <nl> - < / remote_servers > <nl> - <nl> - <nl> - < ! - - If element has ' incl ' attribute , then for it ' s value will be used corresponding substitution from another file . <nl> - By default , path to file with substitutions is / etc / metrika . xml . It could be changed in config in ' include_from ' element . <nl> - Values for substitutions are specified in / yandex / name_of_substitution elements in that file . <nl> - - - > <nl> - <nl> - < ! - - ZooKeeper is used to store metadata about replicas , when using Replicated tables . <nl> - Optional . If you don ' t use replicated tables , you could omit that . <nl> - <nl> - See https : / / clickhouse . yandex / docs / en / table_engines / replication / <nl> - - - > <nl> - < zookeeper incl = " zookeeper - servers " optional = " true " / > <nl> - <nl> - < ! - - Substitutions for parameters of replicated tables . <nl> - Optional . If you don ' t use replicated tables , you could omit that . <nl> - <nl> - See https : / / clickhouse . yandex / docs / en / table_engines / replication / # creating - replicated - tables <nl> - - - > <nl> - < macros incl = " macros " optional = " true " / > <nl> - <nl> - <nl> - < ! - - Reloading interval for embedded dictionaries , in seconds . Default : 3600 . - - > <nl> - < builtin_dictionaries_reload_interval > 3600 < / builtin_dictionaries_reload_interval > <nl> - <nl> - <nl> - < ! - - Maximum session timeout , in seconds . Default : 3600 . - - > <nl> - < max_session_timeout > 3600 < / max_session_timeout > <nl> - <nl> - < ! - - Default session timeout , in seconds . Default : 60 . - - > <nl> - < default_session_timeout > 60 < / default_session_timeout > <nl> - <nl> - < ! - - Sending data to Graphite for monitoring . Several sections can be defined . - - > <nl> - < ! - - <nl> - interval - send every X second <nl> - root_path - prefix for keys <nl> - hostname_in_path - append hostname to root_path ( default = true ) <nl> - metrics - send data from table system . metrics <nl> - events - send data from table system . events <nl> - asynchronous_metrics - send data from table system . asynchronous_metrics <nl> - - - > <nl> - < ! - - <nl> - < graphite > <nl> - < host > localhost < / host > <nl> - < port > 42000 < / port > <nl> - < timeout > 0 . 1 < / timeout > <nl> - < interval > 60 < / interval > <nl> - < root_path > one_min < / root_path > <nl> - < hostname_in_path > true < / hostname_in_path > <nl> - <nl> - < metrics > true < / metrics > <nl> - < events > true < / events > <nl> - < asynchronous_metrics > true < / asynchronous_metrics > <nl> - < / graphite > <nl> - < graphite > <nl> - < host > localhost < / host > <nl> - < port > 42000 < / port > <nl> - < timeout > 0 . 1 < / timeout > <nl> - < interval > 1 < / interval > <nl> - < root_path > one_sec < / root_path > <nl> - <nl> - < metrics > true < / metrics > <nl> - < events > true < / events > <nl> - < asynchronous_metrics > false < / asynchronous_metrics > <nl> - < / graphite > <nl> - - - > <nl> - <nl> - <nl> - < ! - - Query log . Used only for queries with setting log_queries = 1 . - - > <nl> - < query_log > <nl> - < ! - - What table to insert data . If table is not exist , it will be created . <nl> - When query log structure is changed after system update , <nl> - then old table will be renamed and new table will be created automatically . <nl> - - - > <nl> - < database > system < / database > <nl> - < table > query_log < / table > <nl> - < ! - - <nl> - PARTITION BY expr https : / / clickhouse . yandex / docs / en / table_engines / custom_partitioning_key / <nl> - Example : <nl> - event_date <nl> - toMonday ( event_date ) <nl> - toYYYYMM ( event_date ) <nl> - toStartOfHour ( event_time ) <nl> - - - > <nl> - < partition_by > toYYYYMM ( event_date ) < / partition_by > <nl> - < ! - - Interval of flushing data . - - > <nl> - < flush_interval_milliseconds > 7500 < / flush_interval_milliseconds > <nl> - < / query_log > <nl> - <nl> - < ! - - Query thread log . Has information about all threads participated in query execution . <nl> - Used only for queries with setting log_query_threads = 1 . - - > <nl> - < query_thread_log > <nl> - < database > system < / database > <nl> - < table > query_thread_log < / table > <nl> - < partition_by > toYYYYMM ( event_date ) < / partition_by > <nl> - < flush_interval_milliseconds > 7500 < / flush_interval_milliseconds > <nl> - < / query_thread_log > <nl> - <nl> - < ! - - Uncomment if use part log . <nl> - Part log contains information about all actions with parts in MergeTree tables ( creation , deletion , merges , downloads ) . <nl> - < part_log > <nl> - < database > system < / database > <nl> - < table > part_log < / table > <nl> - < flush_interval_milliseconds > 7500 < / flush_interval_milliseconds > <nl> - < / part_log > <nl> - - - > <nl> - <nl> - <nl> - < ! - - Parameters for embedded dictionaries , used in Yandex . Metrica . <nl> - See https : / / clickhouse . yandex / docs / en / dicts / internal_dicts / <nl> - - - > <nl> - <nl> - < ! - - Path to file with region hierarchy . - - > <nl> - < ! - - < path_to_regions_hierarchy_file > / opt / geo / regions_hierarchy . txt < / path_to_regions_hierarchy_file > - - > <nl> - <nl> - < ! - - Path to directory with files containing names of regions - - > <nl> - < ! - - < path_to_regions_names_files > / opt / geo / < / path_to_regions_names_files > - - > <nl> - <nl> - <nl> - < ! - - Configuration of external dictionaries . See : <nl> - https : / / clickhouse . yandex / docs / en / dicts / external_dicts / <nl> - - - > <nl> - < dictionaries_config > * _dictionary . xml < / dictionaries_config > <nl> - <nl> - < ! - - Uncomment if you want data to be compressed 30 - 100 % better . <nl> - Don ' t do that if you just started using ClickHouse . <nl> - - - > <nl> - < compression incl = " clickhouse_compression " > <nl> - < ! - - <nl> - < ! - - Set of variants . Checked in order . Last matching case wins . If nothing matches , lz4 will be used . - - > <nl> - < case > <nl> - <nl> - < ! - - Conditions . All must be satisfied . Some conditions may be omitted . - - > <nl> - < min_part_size > 10000000000 < / min_part_size > < ! - - Min part size in bytes . - - > <nl> - < min_part_size_ratio > 0 . 01 < / min_part_size_ratio > < ! - - Min size of part relative to whole table size . - - > <nl> - <nl> - < ! - - What compression method to use . - - > <nl> - < method > zstd < / method > <nl> - < / case > <nl> - - - > <nl> - < / compression > <nl> - <nl> - < ! - - Allow to execute distributed DDL queries ( CREATE , DROP , ALTER , RENAME ) on cluster . <nl> - Works only if ZooKeeper is enabled . Comment it if such functionality isn ' t required . - - > <nl> - < distributed_ddl > <nl> - < ! - - Path in ZooKeeper to queue with DDL queries - - > <nl> - < path > / clickhouse / task_queue / ddl < / path > <nl> - <nl> - < ! - - Settings from this profile will be used to execute DDL queries - - > <nl> - < ! - - < profile > default < / profile > - - > <nl> - < / distributed_ddl > <nl> - <nl> - < ! - - Settings to fine tune MergeTree tables . See documentation in source code , in MergeTreeSettings . h - - > <nl> - < ! - - <nl> - < merge_tree > <nl> - < max_suspicious_broken_parts > 5 < / max_suspicious_broken_parts > <nl> - < / merge_tree > <nl> - - - > <nl> - <nl> - < ! - - Protection from accidental DROP . <nl> - If size of a MergeTree table is greater than max_table_size_to_drop ( in bytes ) than table could not be dropped with any DROP query . <nl> - If you want do delete one table and don ' t want to restart clickhouse - server , you could create special file < clickhouse - path > / flags / force_drop_table and make DROP once . <nl> - By default max_table_size_to_drop is 50GB ; max_table_size_to_drop = 0 allows to DROP any tables . <nl> - The same for max_partition_size_to_drop . <nl> - Uncomment to disable protection . <nl> - - - > <nl> - < ! - - < max_table_size_to_drop > 0 < / max_table_size_to_drop > - - > <nl> - < ! - - < max_partition_size_to_drop > 0 < / max_partition_size_to_drop > - - > <nl> - <nl> - < ! - - Example of parameters for GraphiteMergeTree table engine - - > <nl> - < graphite_rollup_example > <nl> - < pattern > <nl> - < regexp > click_cost < / regexp > <nl> - < function > any < / function > <nl> - < retention > <nl> - < age > 0 < / age > <nl> - < precision > 3600 < / precision > <nl> - < / retention > <nl> - < retention > <nl> - < age > 86400 < / age > <nl> - < precision > 60 < / precision > <nl> - < / retention > <nl> - < / pattern > <nl> - < default > <nl> - < function > max < / function > <nl> - < retention > <nl> - < age > 0 < / age > <nl> - < precision > 60 < / precision > <nl> - < / retention > <nl> - < retention > <nl> - < age > 3600 < / age > <nl> - < precision > 300 < / precision > <nl> - < / retention > <nl> - < retention > <nl> - < age > 86400 < / age > <nl> - < precision > 3600 < / precision > <nl> - < / retention > <nl> - < / default > <nl> - < / graphite_rollup_example > <nl> - <nl> - < ! - - Directory in < clickhouse - path > containing schema files for various input formats . <nl> - The directory will be created if it doesn ' t exist . <nl> - - - > <nl> - < format_schema_path > / var / lib / clickhouse / format_schemas / < / format_schema_path > <nl> - <nl> - < ! - - Uncomment to disable ClickHouse internal DNS caching . - - > <nl> - < ! - - < disable_internal_dns_cache > 1 < / disable_internal_dns_cache > - - > <nl> - < / yandex > <nl> deleted file mode 100644 <nl> index 9755c29d480 . . 00000000000 <nl> mmm a / tests / integration / test_http_handlers_config / common_configs / common_users . xml <nl> ppp / dev / null <nl> <nl> - < ? xml version = " 1 . 0 " ? > <nl> - < yandex > <nl> - < ! - - Profiles of settings . - - > <nl> - < profiles > <nl> - < ! - - Default settings . - - > <nl> - < default > <nl> - < ! - - Maximum memory usage for processing single query , in bytes . - - > <nl> - < max_memory_usage > 10000000000 < / max_memory_usage > <nl> - <nl> - < ! - - Use cache of uncompressed blocks of data . Meaningful only for processing many of very short queries . - - > <nl> - < use_uncompressed_cache > 0 < / use_uncompressed_cache > <nl> - <nl> - < ! - - How to choose between replicas during distributed query processing . <nl> - random - choose random replica from set of replicas with minimum number of errors <nl> - nearest_hostname - from set of replicas with minimum number of errors , choose replica <nl> - with minimum number of different symbols between replica ' s hostname and local hostname <nl> - ( Hamming distance ) . <nl> - in_order - first live replica is chosen in specified order . <nl> - first_or_random - if first replica one has higher number of errors , pick a random one from replicas with minimum number of errors . <nl> - - - > <nl> - < load_balancing > random < / load_balancing > <nl> - < / default > <nl> - <nl> - < ! - - Profile that allows only read queries . - - > <nl> - < readonly > <nl> - < readonly > 1 < / readonly > <nl> - < / readonly > <nl> - < / profiles > <nl> - <nl> - < ! - - Users and ACL . - - > <nl> - < users > <nl> - < ! - - If user name was not specified , ' default ' user is used . - - > <nl> - < default > <nl> - < ! - - Password could be specified in plaintext or in SHA256 ( in hex format ) . <nl> - <nl> - If you want to specify password in plaintext ( not recommended ) , place it in ' password ' element . <nl> - Example : < password > qwerty < / password > . <nl> - Password could be empty . <nl> - <nl> - If you want to specify SHA256 , place it in ' password_sha256_hex ' element . <nl> - Example : < password_sha256_hex > 65e84be33532fb784c48129675f9eff3a682b27168c0ea744b2cf58ee02337c5 < / password_sha256_hex > <nl> - Restrictions of SHA256 : impossibility to connect to ClickHouse using MySQL JS client ( as of July 2019 ) . <nl> - <nl> - If you want to specify double SHA1 , place it in ' password_double_sha1_hex ' element . <nl> - Example : < password_double_sha1_hex > e395796d6546b1b65db9d665cd43f0e858dd4303 < / password_double_sha1_hex > <nl> - <nl> - How to generate decent password : <nl> - Execute : PASSWORD = $ ( base64 < / dev / urandom | head - c8 ) ; echo " $ PASSWORD " ; echo - n " $ PASSWORD " | sha256sum | tr - d ' - ' <nl> - In first line will be password and in second - corresponding SHA256 . <nl> - <nl> - How to generate double SHA1 : <nl> - Execute : PASSWORD = $ ( base64 < / dev / urandom | head - c8 ) ; echo " $ PASSWORD " ; echo - n " $ PASSWORD " | openssl dgst - sha1 - binary | openssl dgst - sha1 <nl> - In first line will be password and in second - corresponding double SHA1 . <nl> - - - > <nl> - < password > < / password > <nl> - <nl> - < ! - - List of networks with open access . <nl> - <nl> - To open access from everywhere , specify : <nl> - < ip > : : / 0 < / ip > <nl> - <nl> - To open access only from localhost , specify : <nl> - < ip > : : 1 < / ip > <nl> - < ip > 127 . 0 . 0 . 1 < / ip > <nl> - <nl> - Each element of list has one of the following forms : <nl> - < ip > IP - address or network mask . Examples : 213 . 180 . 204 . 3 or 10 . 0 . 0 . 1 / 8 or 10 . 0 . 0 . 1 / 255 . 255 . 255 . 0 <nl> - 2a02 : 6b8 : : 3 or 2a02 : 6b8 : : 3 / 64 or 2a02 : 6b8 : : 3 / ffff : ffff : ffff : ffff : : . <nl> - < host > Hostname . Example : server01 . yandex . ru . <nl> - To check access , DNS query is performed , and all received addresses compared to peer address . <nl> - < host_regexp > Regular expression for host names . Example , ^ server \ d \ d - \ d \ d - \ d \ . yandex \ . ru $ <nl> - To check access , DNS PTR query is performed for peer address and then regexp is applied . <nl> - Then , for result of PTR query , another DNS query is performed and all received addresses compared to peer address . <nl> - Strongly recommended that regexp is ends with $ <nl> - All results of DNS requests are cached till server restart . <nl> - - - > <nl> - < networks incl = " networks " replace = " replace " > <nl> - < ip > : : / 0 < / ip > <nl> - < / networks > <nl> - <nl> - < ! - - Settings profile for user . - - > <nl> - < profile > default < / profile > <nl> - <nl> - < ! - - Quota for user . - - > <nl> - < quota > default < / quota > <nl> - <nl> - < ! - - For testing the table filters - - > <nl> - < databases > <nl> - < test > <nl> - < ! - - Simple expression filter - - > <nl> - < filtered_table1 > <nl> - < filter > a = 1 < / filter > <nl> - < / filtered_table1 > <nl> - <nl> - < ! - - Complex expression filter - - > <nl> - < filtered_table2 > <nl> - < filter > a + b & lt ; 1 or c - d & gt ; 5 < / filter > <nl> - < / filtered_table2 > <nl> - <nl> - < ! - - Filter with ALIAS column - - > <nl> - < filtered_table3 > <nl> - < filter > c = 1 < / filter > <nl> - < / filtered_table3 > <nl> - < / test > <nl> - < / databases > <nl> - < / default > <nl> - <nl> - < ! - - Example of user with readonly access . - - > <nl> - < ! - - < readonly > <nl> - < password > < / password > <nl> - < networks incl = " networks " replace = " replace " > <nl> - < ip > : : 1 < / ip > <nl> - < ip > 127 . 0 . 0 . 1 < / ip > <nl> - < / networks > <nl> - < profile > readonly < / profile > <nl> - < quota > default < / quota > <nl> - < / readonly > - - > <nl> - < / users > <nl> - <nl> - < ! - - Quotas . - - > <nl> - < quotas > <nl> - < ! - - Name of quota . - - > <nl> - < default > <nl> - < ! - - Limits for time interval . You could specify many intervals with different limits . - - > <nl> - < interval > <nl> - < ! - - Length of interval . - - > <nl> - < duration > 3600 < / duration > <nl> - <nl> - < ! - - No limits . Just calculate resource usage for time interval . - - > <nl> - < queries > 0 < / queries > <nl> - < errors > 0 < / errors > <nl> - < result_rows > 0 < / result_rows > <nl> - < read_rows > 0 < / read_rows > <nl> - < execution_time > 0 < / execution_time > <nl> - < / interval > <nl> - < / default > <nl> - < / quotas > <nl> - < / yandex > <nl> mmm a / tests / integration / test_http_handlers_config / test . py <nl> ppp b / tests / integration / test_http_handlers_config / test . py <nl> def __init__ ( self , cluster , name , config_dir ) : <nl> <nl> def add_instance ( self , name , config_dir ) : <nl> script_path = os . path . dirname ( os . path . realpath ( __file__ ) ) <nl> - return self . cluster . add_instance ( name , config_dir = os . path . join ( script_path , config_dir ) , <nl> - main_configs = [ os . path . join ( script_path , ' common_configs ' , ' common_config . xml ' ) ] , <nl> - user_configs = [ os . path . join ( script_path , ' common_configs ' , ' common_users . xml ' ) ] ) <nl> + return self . cluster . add_instance ( name , main_configs = [ os . path . join ( script_path , config_dir , ' config . xml ' ) ] ) <nl> <nl> <nl> def test_dynamic_query_handler ( ) : <nl> deleted file mode 100644 <nl> index 9aba4ac0914 . . 00000000000 <nl> mmm a / tests / integration / test_http_handlers_config / test_dynamic_handler / users . xml <nl> ppp / dev / null <nl> <nl> - < ? xml version = " 1 . 0 " ? > <nl> - < yandex > <nl> - < / yandex > <nl> deleted file mode 100644 <nl> index 9aba4ac0914 . . 00000000000 <nl> mmm a / tests / integration / test_http_handlers_config / test_predefined_handler / users . xml <nl> ppp / dev / null <nl> <nl> - < ? xml version = " 1 . 0 " ? > <nl> - < yandex > <nl> - < / yandex > <nl> deleted file mode 100644 <nl> index 9aba4ac0914 . . 00000000000 <nl> mmm a / tests / integration / test_http_handlers_config / test_static_handler / users . xml <nl> ppp / dev / null <nl> <nl> - < ? xml version = " 1 . 0 " ? > <nl> - < yandex > <nl> - < / yandex > <nl>
remove redundant configs from test
ClickHouse/ClickHouse
5a1d22a363b814be05189cc4913abd43e68af590
2020-04-27T23:05:15Z
mmm a / include / swift / AST / ReferenceStorage . def <nl> ppp b / include / swift / AST / ReferenceStorage . def <nl> <nl> / / / UNCHECKED_REF_STORAGE <nl> / / / Name # # RetainValueInst <nl> / / / Name # # ReleaseValueInst <nl> + / / / Copy # # Name # # ValueInst <nl> / / / LOADABLE_REF_STORAGE <nl> / / / Ref * ToNameInst <nl> / / / Name * ToRefInst <nl> <nl> / / / storage type , and SOMETIMES_LOADABLE_CHECKED_REF_STORAGE needs * two * <nl> / / / TypeInfos to be created . One for the loadable scenario , and one for the <nl> / / / address - only scenario . <nl> + / / / <nl> + / / / TODO : We should change Copy # # Name # # ValueInst to be defined on <nl> + / / / LOADABLE_REF_STORAGE . It just will require us to go through , refactor , and <nl> + / / / fix up this code . <nl> <nl> <nl> # ifndef REF_STORAGE <nl> mmm a / include / swift / SIL / SILBuilder . h <nl> ppp b / include / swift / SIL / SILBuilder . h <nl> class SILBuilder { <nl> return insert ( new ( getModule ( ) ) \ <nl> Store # # Name # # Inst ( getSILDebugLocation ( Loc ) , value , dest , isInit ) ) ; \ <nl> } <nl> - # define LOADABLE_REF_STORAGE_HELPER ( Name ) \ <nl> - Name # # ToRefInst * create # # Name # # ToRef ( SILLocation Loc , SILValue op , \ <nl> - SILType ty ) { \ <nl> - return insert ( new ( getModule ( ) ) \ <nl> - Name # # ToRefInst ( getSILDebugLocation ( Loc ) , op , ty ) ) ; \ <nl> - } \ <nl> - RefTo # # Name # # Inst * createRefTo # # Name ( SILLocation Loc , SILValue op , \ <nl> - SILType ty ) { \ <nl> - return insert ( new ( getModule ( ) ) \ <nl> - RefTo # # Name # # Inst ( getSILDebugLocation ( Loc ) , op , ty ) ) ; \ <nl> + # define LOADABLE_REF_STORAGE_HELPER ( Name ) \ <nl> + Name # # ToRefInst * create # # Name # # ToRef ( SILLocation Loc , SILValue op , \ <nl> + SILType ty ) { \ <nl> + return insert ( new ( getModule ( ) ) \ <nl> + Name # # ToRefInst ( getSILDebugLocation ( Loc ) , op , ty ) ) ; \ <nl> + } \ <nl> + RefTo # # Name # # Inst * createRefTo # # Name ( SILLocation Loc , SILValue op , \ <nl> + SILType ty ) { \ <nl> + return insert ( new ( getModule ( ) ) \ <nl> + RefTo # # Name # # Inst ( getSILDebugLocation ( Loc ) , op , ty ) ) ; \ <nl> + } \ <nl> + Copy # # Name # # ValueInst * createCopy # # Name # # Value ( SILLocation Loc , \ <nl> + SILValue operand ) { \ <nl> + auto type = getFunction ( ) . getLoweredType ( \ <nl> + operand - > getType ( ) . getASTType ( ) . getReferenceStorageReferent ( ) ) ; \ <nl> + return insert ( new ( getModule ( ) ) Copy # # Name # # ValueInst ( \ <nl> + getSILDebugLocation ( Loc ) , operand , type ) ) ; \ <nl> } <nl> + <nl> # define ALWAYS_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> LOADABLE_REF_STORAGE_HELPER ( Name ) \ <nl> StrongRetain # # Name # # Inst * createStrongRetain # # Name ( SILLocation Loc , \ <nl> class SILBuilder { <nl> Atomicity atomicity ) { \ <nl> return insert ( new ( getModule ( ) ) \ <nl> Name # # ReleaseInst ( getSILDebugLocation ( Loc ) , Operand , atomicity ) ) ; \ <nl> - } \ <nl> - Copy # # Name # # ValueInst * createCopy # # Name # # Value ( SILLocation Loc , \ <nl> - SILValue operand ) { \ <nl> - auto type = getFunction ( ) . getLoweredType ( \ <nl> - operand - > getType ( ) . getASTType ( ) . getReferenceStorageReferent ( ) ) ; \ <nl> - return insert ( new ( getModule ( ) ) \ <nl> - Copy # # Name # # ValueInst ( getSILDebugLocation ( Loc ) , operand , type ) ) ; \ <nl> } <nl> # define SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> NEVER_LOADABLE_CHECKED_REF_STORAGE ( Name , " . . . " ) \ <nl> mmm a / include / swift / SIL / SILCloner . h <nl> ppp b / include / swift / SIL / SILCloner . h <nl> SILCloner < ImplClass > : : visitDebugValueAddrInst ( DebugValueAddrInst * Inst ) { <nl> Inst , getBuilder ( ) . create # # Name # # ToRef ( getOpLocation ( Inst - > getLoc ( ) ) , \ <nl> getOpValue ( Inst - > getOperand ( ) ) , \ <nl> getOpType ( Inst - > getType ( ) ) ) ) ; \ <nl> + } \ <nl> + template < typename ImplClass > \ <nl> + void SILCloner < ImplClass > : : visitCopy # # Name # # ValueInst ( \ <nl> + Copy # # Name # # ValueInst * Inst ) { \ <nl> + getBuilder ( ) . setCurrentDebugScope ( getOpScope ( Inst - > getDebugScope ( ) ) ) ; \ <nl> + recordClonedInstruction ( Inst , getBuilder ( ) . createCopy # # Name # # Value ( \ <nl> + getOpLocation ( Inst - > getLoc ( ) ) , \ <nl> + getOpValue ( Inst - > getOperand ( ) ) ) ) ; \ <nl> } <nl> # define ALWAYS_LOADABLE_CHECKED_REF_STORAGE ( Name , name , . . . ) \ <nl> LOADABLE_REF_STORAGE_HELPER ( Name , name ) \ <nl> SILCloner < ImplClass > : : visitDebugValueAddrInst ( DebugValueAddrInst * Inst ) { <nl> getOpLocation ( Inst - > getLoc ( ) ) , \ <nl> getOpValue ( Inst - > getOperand ( ) ) , \ <nl> Inst - > getAtomicity ( ) ) ) ; \ <nl> - } \ <nl> - template < typename ImplClass > \ <nl> - void SILCloner < ImplClass > : : visitCopy # # Name # # ValueInst ( \ <nl> - Copy # # Name # # ValueInst * Inst ) { \ <nl> - getBuilder ( ) . setCurrentDebugScope ( getOpScope ( Inst - > getDebugScope ( ) ) ) ; \ <nl> - recordClonedInstruction ( Inst , getBuilder ( ) . createCopy # # Name # # Value ( \ <nl> - getOpLocation ( Inst - > getLoc ( ) ) , \ <nl> - getOpValue ( Inst - > getOperand ( ) ) ) ) ; \ <nl> } <nl> # define SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , name , . . . ) \ <nl> NEVER_LOADABLE_CHECKED_REF_STORAGE ( Name , name , " . . . " ) \ <nl> mmm a / include / swift / SIL / SILInstruction . h <nl> ppp b / include / swift / SIL / SILInstruction . h <nl> class CopyValueInst <nl> : UnaryInstructionBase ( DebugLoc , operand , operand - > getType ( ) ) { } <nl> } ; <nl> <nl> - # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> - class Copy # # Name # # ValueInst \ <nl> - : public UnaryInstructionBase < SILInstructionKind : : Copy # # Name # # ValueInst , \ <nl> - SingleValueInstruction > { \ <nl> - friend class SILBuilder ; \ <nl> - Copy # # Name # # ValueInst ( SILDebugLocation DebugLoc , SILValue operand , \ <nl> - SILType type ) \ <nl> - : UnaryInstructionBase ( DebugLoc , operand , type ) { } \ <nl> - } ; <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + class Copy # # Name # # ValueInst \ <nl> + : public UnaryInstructionBase < SILInstructionKind : : Copy # # Name # # ValueInst , \ <nl> + SingleValueInstruction > { \ <nl> + friend class SILBuilder ; \ <nl> + Copy # # Name # # ValueInst ( SILDebugLocation DebugLoc , SILValue operand , \ <nl> + SILType type ) \ <nl> + : UnaryInstructionBase ( DebugLoc , operand , type ) { } \ <nl> + } ; <nl> + <nl> + # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + class Copy # # Name # # ValueInst \ <nl> + : public UnaryInstructionBase < SILInstructionKind : : Copy # # Name # # ValueInst , \ <nl> + SingleValueInstruction > { \ <nl> + friend class SILBuilder ; \ <nl> + Copy # # Name # # ValueInst ( SILDebugLocation DebugLoc , SILValue operand , \ <nl> + SILType type ) \ <nl> + : UnaryInstructionBase ( DebugLoc , operand , type ) { } \ <nl> + } ; <nl> # include " swift / AST / ReferenceStorage . def " <nl> <nl> class DestroyValueInst <nl> mmm a / include / swift / SIL / SILNodes . def <nl> ppp b / include / swift / SIL / SILNodes . def <nl> ABSTRACT_VALUE_AND_INST ( SingleValueInstruction , ValueBase , SILInstruction ) <nl> SingleValueInstruction , MayHaveSideEffects , DoesNotRelease ) <nl> SINGLE_VALUE_INST ( CopyValueInst , copy_value , <nl> SingleValueInstruction , MayHaveSideEffects , DoesNotRelease ) <nl> + # define UNCHECKED_REF_STORAGE ( Name , name , . . . ) \ <nl> + SINGLE_VALUE_INST ( Copy # # Name # # ValueInst , copy_ # # name # # _value , \ <nl> + SingleValueInstruction , MayHaveSideEffects , DoesNotRelease ) <nl> # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , name , . . . ) \ <nl> SINGLE_VALUE_INST ( Copy # # Name # # ValueInst , copy_ # # name # # _value , \ <nl> SingleValueInstruction , MayHaveSideEffects , DoesNotRelease ) <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 = 512 ; / / extended types may be left as unbound generic types <nl> + const uint16_t SWIFTMODULE_VERSION_MINOR = 513 ; / / Added copy_unmanaged_value . <nl> <nl> using DeclIDField = BCFixed < 31 > ; <nl> <nl> mmm a / lib / IRGen / IRGenSIL . cpp <nl> ppp b / lib / IRGen / IRGenSIL . cpp <nl> class IRGenSILFunction : <nl> <nl> void visitKeyPathInst ( KeyPathInst * I ) ; <nl> <nl> - <nl> - # define LOADABLE_REF_STORAGE_HELPER ( Name ) \ <nl> - void visitRefTo # # Name # # Inst ( RefTo # # Name # # Inst * i ) ; \ <nl> - void visit # # Name # # ToRefInst ( Name # # ToRefInst * i ) ; <nl> + # define LOADABLE_REF_STORAGE_HELPER ( Name ) \ <nl> + void visitRefTo # # Name # # Inst ( RefTo # # Name # # Inst * i ) ; \ <nl> + void visit # # Name # # ToRefInst ( Name # # ToRefInst * i ) ; \ <nl> + void visitCopy # # Name # # ValueInst ( Copy # # Name # # ValueInst * i ) ; <nl> # define NEVER_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> void visitLoad # # Name # # Inst ( Load # # Name # # Inst * i ) ; \ <nl> void visitStore # # Name # # Inst ( Store # # Name # # Inst * i ) ; <nl> - # define ALWAYS_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> - LOADABLE_REF_STORAGE_HELPER ( Name ) \ <nl> - void visitStrongRetain # # Name # # Inst ( StrongRetain # # Name # # Inst * i ) ; \ <nl> - void visit # # Name # # RetainInst ( Name # # RetainInst * i ) ; \ <nl> - void visit # # Name # # ReleaseInst ( Name # # ReleaseInst * i ) ; \ <nl> - void visitCopy # # Name # # ValueInst ( Copy # # Name # # ValueInst * i ) ; <nl> + # define ALWAYS_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + LOADABLE_REF_STORAGE_HELPER ( Name ) \ <nl> + void visitStrongRetain # # Name # # Inst ( StrongRetain # # Name # # Inst * i ) ; \ <nl> + void visit # # Name # # RetainInst ( Name # # RetainInst * i ) ; \ <nl> + void visit # # Name # # ReleaseInst ( Name # # ReleaseInst * i ) ; <nl> # define SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> NEVER_LOADABLE_CHECKED_REF_STORAGE ( Name , " . . . " ) \ <nl> ALWAYS_LOADABLE_CHECKED_REF_STORAGE ( Name , " . . . " ) <nl> static const ReferenceTypeInfo & getReferentTypeInfo ( IRGenFunction & IGF , <nl> # define SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , name , . . . ) \ <nl> NEVER_LOADABLE_CHECKED_REF_STORAGE ( Name , name , " . . . " ) \ <nl> ALWAYS_LOADABLE_CHECKED_REF_STORAGE ( Name , name , " . . . " ) <nl> + # define UNCHECKED_REF_STORAGE ( Name , name , . . . ) \ <nl> + void IRGenSILFunction : : visitCopy # # Name # # ValueInst ( \ <nl> + swift : : Copy # # Name # # ValueInst * i ) { \ <nl> + Explosion in = getLoweredExplosion ( i - > getOperand ( ) ) ; \ <nl> + auto silTy = i - > getOperand ( ) - > getType ( ) ; \ <nl> + auto ty = cast < Name # # StorageType > ( silTy . getASTType ( ) ) ; \ <nl> + auto isOptional = bool ( ty . getReferentType ( ) - > getOptionalObjectType ( ) ) ; \ <nl> + auto & ti = getReferentTypeInfo ( * this , silTy ) ; \ <nl> + / * Since we are unchecked , we just use strong retain here . We do not \ <nl> + * perform any checks * / \ <nl> + ti . strongRetain ( * this , in , irgen : : Atomicity : : Atomic ) ; \ <nl> + / * Semantically we are just passing through the input parameter but as a \ <nl> + * / \ <nl> + / * strong reference . . . at LLVM IR level these type differences don ' t * / \ <nl> + / * matter . So just set the lowered explosion appropriately . * / \ <nl> + Explosion output = getLoweredExplosion ( i - > getOperand ( ) ) ; \ <nl> + if ( isOptional ) { \ <nl> + auto values = output . claimAll ( ) ; \ <nl> + output . reset ( ) ; \ <nl> + for ( auto value : values ) { \ <nl> + output . add ( Builder . CreatePtrToInt ( value , IGM . IntPtrTy ) ) ; \ <nl> + } \ <nl> + } \ <nl> + setLoweredExplosion ( i , output ) ; \ <nl> + } <nl> # include " swift / AST / ReferenceStorage . def " <nl> # undef COMMON_CHECKED_REF_STORAGE <nl> <nl> mmm a / lib / ParseSIL / ParseSIL . cpp <nl> ppp b / lib / ParseSIL / ParseSIL . cpp <nl> bool SILParser : : parseSILInstruction ( SILBuilder & B ) { <nl> REFCOUNTING_INSTRUCTION ( RetainValue ) <nl> REFCOUNTING_INSTRUCTION ( ReleaseValueAddr ) <nl> REFCOUNTING_INSTRUCTION ( RetainValueAddr ) <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) UNARY_INSTRUCTION ( Copy # # Name # # Value ) <nl> # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> REFCOUNTING_INSTRUCTION ( StrongRetain # # Name ) \ <nl> REFCOUNTING_INSTRUCTION ( Name # # Retain ) \ <nl> mmm a / lib / SIL / InstructionUtils . cpp <nl> ppp b / lib / SIL / InstructionUtils . cpp <nl> bool swift : : onlyAffectsRefCount ( SILInstruction * user ) { <nl> case SILInstructionKind : : StrongReleaseInst : <nl> case SILInstructionKind : : StrongRetainInst : <nl> case SILInstructionKind : : UnmanagedAutoreleaseValueInst : <nl> - case SILInstructionKind : : UnmanagedReleaseValueInst : <nl> - case SILInstructionKind : : UnmanagedRetainValueInst : <nl> - # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> - case SILInstructionKind : : Name # # RetainInst : \ <nl> - case SILInstructionKind : : Name # # ReleaseInst : \ <nl> - case SILInstructionKind : : StrongRetain # # Name # # Inst : <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + case SILInstructionKind : : Name # # RetainValueInst : \ <nl> + case SILInstructionKind : : Name # # ReleaseValueInst : \ <nl> + case SILInstructionKind : : Copy # # Name # # ValueInst : <nl> + # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + case SILInstructionKind : : Name # # RetainInst : \ <nl> + case SILInstructionKind : : Name # # ReleaseInst : \ <nl> + case SILInstructionKind : : StrongRetain # # Name # # Inst : \ <nl> + case SILInstructionKind : : Copy # # Name # # ValueInst : <nl> # include " swift / AST / ReferenceStorage . def " <nl> return true ; <nl> } <nl> mmm a / lib / SIL / MemAccessUtils . cpp <nl> ppp b / lib / SIL / MemAccessUtils . cpp <nl> void swift : : visitAccessedAddress ( SILInstruction * I , <nl> } <nl> / / Non - access cases : these are marked with memory side effects , but , by <nl> / / themselves , do not access formal memory . <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + case SILInstructionKind : : Copy # # Name # # ValueInst : <nl> # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> case SILInstructionKind : : Copy # # Name # # ValueInst : <nl> # include " swift / AST / ReferenceStorage . def " <nl> mmm a / lib / SIL / OperandOwnership . cpp <nl> ppp b / lib / SIL / OperandOwnership . cpp <nl> ACCEPTS_ANY_OWNERSHIP_INST ( ConvertEscapeToNoEscape ) <nl> ACCEPTS_ANY_OWNERSHIP_INST ( RefTo # # Name ) \ <nl> ACCEPTS_ANY_OWNERSHIP_INST ( Name # # ToRef ) \ <nl> ACCEPTS_ANY_OWNERSHIP_INST ( Copy # # Name # # Value ) <nl> - # define UNCHECKED_REF_STORAGE ( Name , . . . ) ACCEPTS_ANY_OWNERSHIP_INST ( RefTo # # Name ) <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + ACCEPTS_ANY_OWNERSHIP_INST ( RefTo # # Name ) \ <nl> + ACCEPTS_ANY_OWNERSHIP_INST ( Copy # # Name # # Value ) <nl> # include " swift / AST / ReferenceStorage . def " <nl> # undef ACCEPTS_ANY_OWNERSHIP_INST <nl> <nl> mmm a / lib / SIL / SILBuilder . cpp <nl> ppp b / lib / SIL / SILBuilder . cpp <nl> static bool couldReduceStrongRefcount ( SILInstruction * Inst ) { <nl> # define SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> case SILInstructionKind : : Store # # Name # # Inst : \ <nl> ALWAYS_LOADABLE_CHECKED_REF_STORAGE ( Name , " . . . " ) <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + case SILInstructionKind : : Copy # # Name # # ValueInst : \ <nl> + return false ; <nl> # include " swift / AST / ReferenceStorage . def " <nl> case SILInstructionKind : : LoadInst : <nl> case SILInstructionKind : : StoreInst : <nl> mmm a / lib / SIL / SILInstruction . cpp <nl> ppp b / lib / SIL / SILInstruction . cpp <nl> namespace { <nl> return true ; <nl> } <nl> <nl> - # define LOADABLE_REF_STORAGE_HELPER ( Name ) \ <nl> - bool visit # # Name # # ToRefInst ( Name # # ToRefInst * RHS ) { return true ; } \ <nl> - bool visitRefTo # # Name # # Inst ( RefTo # # Name # # Inst * RHS ) { return true ; } <nl> + # define LOADABLE_REF_STORAGE_HELPER ( Name ) \ <nl> + bool visit # # Name # # ToRefInst ( Name # # ToRefInst * RHS ) { return true ; } \ <nl> + bool visitRefTo # # Name # # Inst ( RefTo # # Name # # Inst * RHS ) { return true ; } \ <nl> + bool visitCopy # # Name # # ValueInst ( Copy # # Name # # ValueInst * RHS ) { return true ; } <nl> # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> LOADABLE_REF_STORAGE_HELPER ( Name ) \ <nl> bool visitStrongRetain # # Name # # Inst ( const StrongRetain # # Name # # Inst * RHS ) { \ <nl> mmm a / lib / SIL / SILPrinter . cpp <nl> ppp b / lib / SIL / SILPrinter . cpp <nl> class SILPrinter : public SILInstructionVisitor < SILPrinter > { <nl> * this < < getIDAndType ( I - > getOperand ( ) ) ; <nl> } <nl> <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + void visitCopy # # Name # # ValueInst ( Copy # # Name # # ValueInst * I ) { \ <nl> + * this < < getIDAndType ( I - > getOperand ( ) ) ; \ <nl> + } <nl> + <nl> # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> void visitCopy # # Name # # ValueInst ( Copy # # Name # # ValueInst * I ) { \ <nl> * this < < getIDAndType ( I - > getOperand ( ) ) ; \ <nl> mmm a / lib / SIL / SILVerifier . cpp <nl> ppp b / lib / SIL / SILVerifier . cpp <nl> class SILVerifier : public SILVerifierBase < SILVerifier > { <nl> " Operand of " # name " _to_ref does not have the " \ <nl> " operand ' s type as its referent type " ) ; \ <nl> } <nl> - # define ALWAYS_LOADABLE_CHECKED_REF_STORAGE_HELPER ( Name , name , closure ) \ <nl> - void checkStrongRetain # # Name # # Inst ( StrongRetain # # Name # # Inst * RI ) { \ <nl> - auto ty = requireObjectType ( Name # # StorageType , RI - > getOperand ( ) , \ <nl> - " Operand of strong_retain_ " # name ) ; \ <nl> - closure ( ) ; \ <nl> - ( void ) ty ; \ <nl> - require ( ! F . hasOwnership ( ) , " strong_retain_ " # name " is only in " \ <nl> - " functions with unqualified " \ <nl> - " ownership " ) ; \ <nl> - } \ <nl> - void check # # Name # # RetainInst ( Name # # RetainInst * RI ) { \ <nl> - auto ty = requireObjectType ( Name # # StorageType , RI - > getOperand ( ) , \ <nl> - " Operand of " # name " _retain " ) ; \ <nl> - closure ( ) ; \ <nl> - ( void ) ty ; \ <nl> - require ( ! F . hasOwnership ( ) , \ <nl> - # name " _retain is only in functions with unqualified ownership " ) ; \ <nl> - } \ <nl> - void check # # Name # # ReleaseInst ( Name # # ReleaseInst * RI ) { \ <nl> - auto ty = requireObjectType ( Name # # StorageType , RI - > getOperand ( ) , \ <nl> - " Operand of " # name " _release " ) ; \ <nl> - closure ( ) ; \ <nl> - ( void ) ty ; \ <nl> - require ( ! F . hasOwnership ( ) , \ <nl> + # define ALWAYS_LOADABLE_CHECKED_REF_STORAGE_HELPER ( Name , name , closure ) \ <nl> + void checkStrongRetain # # Name # # Inst ( StrongRetain # # Name # # Inst * RI ) { \ <nl> + auto ty = requireObjectType ( Name # # StorageType , RI - > getOperand ( ) , \ <nl> + " Operand of strong_retain_ " # name ) ; \ <nl> + closure ( ) ; \ <nl> + ( void ) ty ; \ <nl> + require ( ! F . hasOwnership ( ) , " strong_retain_ " # name " is only in " \ <nl> + " functions with unqualified " \ <nl> + " ownership " ) ; \ <nl> + } \ <nl> + void check # # Name # # RetainInst ( Name # # RetainInst * RI ) { \ <nl> + auto ty = requireObjectType ( Name # # StorageType , RI - > getOperand ( ) , \ <nl> + " Operand of " # name " _retain " ) ; \ <nl> + closure ( ) ; \ <nl> + ( void ) ty ; \ <nl> + require ( ! F . hasOwnership ( ) , \ <nl> + # name " _retain is only in functions with unqualified ownership " ) ; \ <nl> + } \ <nl> + void check # # Name # # ReleaseInst ( Name # # ReleaseInst * RI ) { \ <nl> + auto ty = requireObjectType ( Name # # StorageType , RI - > getOperand ( ) , \ <nl> + " Operand of " # name " _release " ) ; \ <nl> + closure ( ) ; \ <nl> + ( void ) ty ; \ <nl> + require ( ! F . hasOwnership ( ) , \ <nl> # name " _release is only in functions with unqualified ownership " ) ; \ <nl> - } \ <nl> - void checkCopy # # Name # # ValueInst ( Copy # # Name # # ValueInst * I ) { \ <nl> - auto ty = requireObjectType ( Name # # StorageType , I - > getOperand ( ) , \ <nl> - " Operand of " # name " _retain " ) ; \ <nl> - closure ( ) ; \ <nl> - ( void ) ty ; \ <nl> + } \ <nl> + void checkCopy # # Name # # ValueInst ( Copy # # Name # # ValueInst * I ) { \ <nl> + auto ty = requireObjectType ( Name # # StorageType , I - > getOperand ( ) , \ <nl> + " Operand of " # name " _retain " ) ; \ <nl> + closure ( ) ; \ <nl> + ( void ) ty ; \ <nl> / * * NOTE * We allow copy_ # # name # # _value to be used throughout the entire * / \ <nl> - / * pipeline even though it is a higher level instruction . * / \ <nl> + / * pipeline even though it is a higher level instruction . * / \ <nl> } <nl> + <nl> # define ALWAYS_LOADABLE_CHECKED_REF_STORAGE ( Name , name , . . . ) \ <nl> LOADABLE_REF_STORAGE_HELPER ( Name , name ) \ <nl> ALWAYS_LOADABLE_CHECKED_REF_STORAGE_HELPER ( Name , name , [ ] { } ) <nl> class SILVerifier : public SILVerifierBase < SILVerifier > { <nl> require ( ty - > isLoadable ( ResilienceExpansion : : Maximal ) , \ <nl> " ' " # name " ' type must be loadable " ) ; \ <nl> } ) <nl> - # define UNCHECKED_REF_STORAGE ( Name , name , . . . ) \ <nl> - LOADABLE_REF_STORAGE_HELPER ( Name , name ) <nl> + # define UNCHECKED_REF_STORAGE ( Name , name , . . . ) \ <nl> + LOADABLE_REF_STORAGE_HELPER ( Name , name ) \ <nl> + void checkCopy # # Name # # ValueInst ( Copy # # Name # # ValueInst * I ) { \ <nl> + auto ty = requireObjectType ( Name # # StorageType , I - > getOperand ( ) , \ <nl> + " Operand of " # name " _retain " ) ; \ <nl> + ( void ) ty ; \ <nl> + / * * NOTE * We allow copy_ # # name # # _value to be used throughout the entire * / \ <nl> + / * pipeline even though it is a higher level instruction . * / \ <nl> + } <nl> + <nl> # include " swift / AST / ReferenceStorage . def " <nl> # undef LOADABLE_REF_STORAGE_HELPER <nl> # undef ALWAYS_LOADABLE_CHECKED_REF_STORAGE_HELPER <nl> mmm a / lib / SIL / ValueOwnership . cpp <nl> ppp b / lib / SIL / ValueOwnership . cpp <nl> class ValueOwnershipKindClassifier <nl> # define SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> NEVER_LOADABLE_CHECKED_REF_STORAGE ( Name , " . . . " ) \ <nl> ALWAYS_LOADABLE_CHECKED_REF_STORAGE ( Name , " . . . " ) <nl> - # define UNCHECKED_REF_STORAGE ( Name , . . . ) \ <nl> - CONSTANT_OWNERSHIP_INST ( Any , RefTo # # Name ) \ <nl> - CONSTANT_OWNERSHIP_INST ( Unowned , Name # # ToRef ) <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + CONSTANT_OWNERSHIP_INST ( Any , RefTo # # Name ) \ <nl> + CONSTANT_OWNERSHIP_INST ( Unowned , Name # # ToRef ) \ <nl> + CONSTANT_OWNERSHIP_INST ( Owned , Copy # # Name # # Value ) <nl> # include " swift / AST / ReferenceStorage . def " <nl> <nl> CONSTANT_OWNERSHIP_INST ( Guaranteed , BeginBorrow ) <nl> mmm a / lib / SILOptimizer / Analysis / EscapeAnalysis . cpp <nl> ppp b / lib / SILOptimizer / Analysis / EscapeAnalysis . cpp <nl> void EscapeAnalysis : : analyzeInstruction ( SILInstruction * I , <nl> ConGraph - > getNode ( cast < SingleValueInstruction > ( I ) , this ) ; <nl> return ; <nl> <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + case SILInstructionKind : : Copy # # Name # # ValueInst : <nl> # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> case SILInstructionKind : : Name # # RetainInst : \ <nl> case SILInstructionKind : : StrongRetain # # Name # # Inst : \ <nl> mmm a / lib / SILOptimizer / Analysis / MemoryBehavior . cpp <nl> ppp b / lib / SILOptimizer / Analysis / MemoryBehavior . cpp <nl> class MemoryBehaviorVisitor <nl> } <nl> REFCOUNTINC_MEMBEHAVIOR_INST ( StrongRetainInst ) <nl> REFCOUNTINC_MEMBEHAVIOR_INST ( RetainValueInst ) <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + REFCOUNTINC_MEMBEHAVIOR_INST ( Name # # RetainValueInst ) \ <nl> + REFCOUNTINC_MEMBEHAVIOR_INST ( Copy # # Name # # ValueInst ) <nl> # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> REFCOUNTINC_MEMBEHAVIOR_INST ( Name # # RetainInst ) \ <nl> REFCOUNTINC_MEMBEHAVIOR_INST ( StrongRetain # # Name # # Inst ) \ <nl> mmm a / lib / SILOptimizer / Analysis / SideEffectAnalysis . cpp <nl> ppp b / lib / SILOptimizer / Analysis / SideEffectAnalysis . cpp <nl> void FunctionSideEffects : : analyzeInstruction ( SILInstruction * I ) { <nl> case SILInstructionKind : : AllocStackInst : <nl> case SILInstructionKind : : DeallocStackInst : <nl> return ; <nl> + # define UNCHECKED_REF_CAST ( Name , . . . ) \ <nl> + case SILInstructionKind : : Name # # RetainValueInst : \ <nl> + case SILInstructionKind : : Copy # # Name # # ValueInst : <nl> # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> case SILInstructionKind : : Name # # RetainInst : \ <nl> case SILInstructionKind : : StrongRetain # # Name # # Inst : \ <nl> void FunctionSideEffects : : analyzeInstruction ( SILInstruction * I ) { <nl> case SILInstructionKind : : RetainValueInst : <nl> getEffectsOn ( I - > getOperand ( 0 ) ) - > Retains = true ; <nl> return ; <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + case SILInstructionKind : : Name # # ReleaseValueInst : <nl> # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> case SILInstructionKind : : Name # # ReleaseInst : <nl> # include " swift / AST / ReferenceStorage . def " <nl> mmm a / lib / SILOptimizer / Mandatory / GuaranteedARCOpts . cpp <nl> ppp b / lib / SILOptimizer / Mandatory / GuaranteedARCOpts . cpp <nl> bool GuaranteedARCOptsVisitor : : visitDestroyAddrInst ( DestroyAddrInst * DAI ) { <nl> static bool couldReduceStrongRefcount ( SILInstruction * Inst ) { <nl> / / Simple memory accesses cannot reduce refcounts . <nl> switch ( Inst - > getKind ( ) ) { <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + case SILInstructionKind : : Name # # RetainValueInst : \ <nl> + case SILInstructionKind : : Copy # # Name # # ValueInst : <nl> # define NEVER_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> case SILInstructionKind : : Store # # Name # # Inst : <nl> # define ALWAYS_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> case SILInstructionKind : : Name # # RetainInst : \ <nl> - case SILInstructionKind : : Name # # ReleaseInst : \ <nl> case SILInstructionKind : : StrongRetain # # Name # # Inst : \ <nl> case SILInstructionKind : : Copy # # Name # # ValueInst : <nl> # define SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> mmm a / lib / SILOptimizer / Transforms / DeadStoreElimination . cpp <nl> ppp b / lib / SILOptimizer / Transforms / DeadStoreElimination . cpp <nl> static inline bool isPerformingDSE ( DSEKind Kind ) { <nl> / / / general sense but are inert from a load store perspective . <nl> static bool isDeadStoreInertInstruction ( SILInstruction * Inst ) { <nl> switch ( Inst - > getKind ( ) ) { <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + case SILInstructionKind : : Copy # # Name # # ValueInst : <nl> # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> case SILInstructionKind : : Name # # RetainInst : \ <nl> case SILInstructionKind : : StrongRetain # # Name # # Inst : \ <nl> mmm a / lib / SILOptimizer / Transforms / RedundantLoadElimination . cpp <nl> ppp b / lib / SILOptimizer / Transforms / RedundantLoadElimination . cpp <nl> static bool inline isPerformingRLE ( RLEKind Kind ) { <nl> / / / general sense but are inert from a load store perspective . <nl> static bool isRLEInertInstruction ( SILInstruction * Inst ) { <nl> switch ( Inst - > getKind ( ) ) { <nl> - # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> - case SILInstructionKind : : Name # # RetainInst : \ <nl> - case SILInstructionKind : : StrongRetain # # Name # # Inst : <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + case SILInstructionKind : : Copy # # Name # # ValueInst : <nl> + # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + case SILInstructionKind : : Name # # RetainInst : \ <nl> + case SILInstructionKind : : StrongRetain # # Name # # Inst : \ <nl> + case SILInstructionKind : : Copy # # Name # # ValueInst : <nl> # include " swift / AST / ReferenceStorage . def " <nl> case SILInstructionKind : : StrongRetainInst : <nl> case SILInstructionKind : : RetainValueInst : <nl> static bool isRLEInertInstruction ( SILInstruction * Inst ) { <nl> case SILInstructionKind : : IsEscapingClosureInst : <nl> case SILInstructionKind : : IsUniqueInst : <nl> case SILInstructionKind : : FixLifetimeInst : <nl> - case SILInstructionKind : : CopyUnownedValueInst : <nl> return true ; <nl> default : <nl> return false ; <nl> mmm a / lib / SILOptimizer / Utils / SILInliner . cpp <nl> ppp b / lib / SILOptimizer / Utils / SILInliner . cpp <nl> InlineCost swift : : instructionInlineCost ( SILInstruction & I ) { <nl> case SILInstructionKind : : SelectValueInst : <nl> case SILInstructionKind : : KeyPathInst : <nl> case SILInstructionKind : : GlobalValueInst : <nl> - # define COMMON_ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name ) \ <nl> - case SILInstructionKind : : Name # # ToRefInst : \ <nl> - case SILInstructionKind : : RefTo # # Name # # Inst : <nl> + # define COMMON_ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name ) \ <nl> + case SILInstructionKind : : Name # # ToRefInst : \ <nl> + case SILInstructionKind : : RefTo # # Name # # Inst : \ <nl> + case SILInstructionKind : : Copy # # Name # # ValueInst : <nl> # define NEVER_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> case SILInstructionKind : : Load # # Name # # Inst : \ <nl> case SILInstructionKind : : Store # # Name # # Inst : <nl> - # define ALWAYS_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> - COMMON_ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name ) \ <nl> - case SILInstructionKind : : Name # # RetainInst : \ <nl> - case SILInstructionKind : : Name # # ReleaseInst : \ <nl> - case SILInstructionKind : : StrongRetain # # Name # # Inst : \ <nl> - case SILInstructionKind : : Copy # # Name # # ValueInst : <nl> + # define ALWAYS_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + COMMON_ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name ) \ <nl> + case SILInstructionKind : : Name # # RetainInst : \ <nl> + case SILInstructionKind : : Name # # ReleaseInst : \ <nl> + case SILInstructionKind : : StrongRetain # # Name # # Inst : <nl> # define SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> NEVER_LOADABLE_CHECKED_REF_STORAGE ( Name , " . . . " ) \ <nl> ALWAYS_LOADABLE_CHECKED_REF_STORAGE ( Name , " . . . " ) <nl> mmm a / lib / Serialization / DeserializeSIL . cpp <nl> ppp b / lib / Serialization / DeserializeSIL . cpp <nl> bool SILDeserializer : : readSILInstruction ( SILFunction * Fn , SILBasicBlock * BB , <nl> ( Atomicity ) Attr ) ; \ <nl> break ; <nl> <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) UNARY_INSTRUCTION ( Copy # # Name # # Value ) <nl> # define ALWAYS_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> REFCOUNTING_INSTRUCTION ( Name # # Retain ) \ <nl> REFCOUNTING_INSTRUCTION ( Name # # Release ) \ <nl> mmm a / lib / Serialization / SerializeSIL . cpp <nl> ppp b / lib / Serialization / SerializeSIL . cpp <nl> void SILSerializer : : writeSILInstruction ( const SILInstruction & SI ) { <nl> ListOfValues ) ; <nl> break ; <nl> } <nl> + # define UNCHECKED_REF_STORAGE ( Name , . . . ) \ <nl> + case SILInstructionKind : : Copy # # Name # # ValueInst : <nl> # define NEVER_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> case SILInstructionKind : : Load # # Name # # Inst : <nl> # define ALWAYS_LOADABLE_CHECKED_REF_STORAGE ( Name , . . . ) \ <nl> mmm a / test / IRGen / existentials . sil <nl> ppp b / test / IRGen / existentials . sil <nl> entry ( % s : $ CP ) : <nl> strong_release % t : $ CP <nl> <nl> % v = ref_to_unmanaged % s : $ CP to $ @ sil_unmanaged CP <nl> - % z = unmanaged_to_ref % v : $ @ sil_unmanaged CP to $ CP <nl> + / / CHECK : call % swift . refcounted * @ swift_retain ( % swift . refcounted * returned % 0 ) <nl> + % v_copy = copy_unmanaged_value % v : $ @ sil_unmanaged CP <nl> + / / CHECK : call void @ swift_release ( % swift . refcounted * % 0 ) <nl> + strong_release % v_copy : $ CP <nl> <nl> / / CHECK : [ [ RESULT_A : % . * ] ] = insertvalue { % swift . refcounted * , i8 * * } undef , % swift . refcounted * % 0 , 0 <nl> / / CHECK : [ [ RESULT_B : % . * ] ] = insertvalue { % swift . refcounted * , i8 * * } [ [ RESULT_A ] ] , i8 * * % 1 , 1 <nl> + % z = unmanaged_to_ref % v : $ @ sil_unmanaged CP to $ CP <nl> + <nl> / / CHECK : ret { % swift . refcounted * , i8 * * } [ [ RESULT_B ] ] <nl> <nl> return % z : $ CP <nl> mmm a / test / IRGen / existentials_objc . sil <nl> ppp b / test / IRGen / existentials_objc . sil <nl> entry ( % s : $ CP ) : <nl> dealloc_stack % u1 : $ * @ sil_unowned CP <nl> <nl> % v = ref_to_unmanaged % s : $ CP to $ @ sil_unmanaged CP <nl> + / / CHECK : call % objc_object * @ swift_unknownObjectRetain ( % objc_object * <nl> + % v_copy = copy_unmanaged_value % v : $ @ sil_unmanaged CP <nl> + / / CHECK : call void @ swift_unknownObjectRelease ( % objc_object * <nl> + strong_release % v_copy : $ CP <nl> + <nl> % z = unmanaged_to_ref % v : $ @ sil_unmanaged CP to $ CP <nl> <nl> / / CHECK : [ [ RESULT_A : % . * ] ] = insertvalue { % objc_object * , i8 * * } undef , % objc_object * % 0 , 0 <nl> mmm a / test / SIL / Parser / basic2 . sil <nl> ppp b / test / SIL / Parser / basic2 . sil <nl> bb0 ( % 0 : @ owned $ @ sil_unowned Builtin . NativeObject ) : <nl> destroy_value % 0 : $ @ sil_unowned Builtin . NativeObject <nl> return % 1 : $ Builtin . NativeObject <nl> } <nl> + <nl> + sil [ ossa ] @ copy_unmanaged_value_test : $ @ convention ( thin ) ( @ sil_unmanaged Builtin . NativeObject ) - > @ owned Builtin . NativeObject { <nl> + bb0 ( % 0 : $ @ sil_unmanaged Builtin . NativeObject ) : <nl> + % 1 = copy_unmanaged_value % 0 : $ @ sil_unmanaged Builtin . NativeObject <nl> + return % 1 : $ Builtin . NativeObject <nl> + } <nl> mmm a / test / SIL / Serialization / basic . sil <nl> ppp b / test / SIL / Serialization / basic . sil <nl> bb0 : <nl> ( ) = destructure_tuple % 1 : $ ( ) <nl> return % 1 : $ ( ) <nl> } <nl> + <nl> + sil [ ossa ] @ copy_unmanaged_value_test : $ @ convention ( thin ) ( @ sil_unmanaged Builtin . NativeObject ) - > @ owned Builtin . NativeObject { <nl> + bb0 ( % 0 : $ @ sil_unmanaged Builtin . NativeObject ) : <nl> + % 1 = copy_unmanaged_value % 0 : $ @ sil_unmanaged Builtin . NativeObject <nl> + return % 1 : $ Builtin . NativeObject <nl> + } <nl> mmm a / test / SIL / ownership - verifier / use_verifier . sil <nl> ppp b / test / SIL / ownership - verifier / use_verifier . sil <nl> bb1 : <nl> unreachable <nl> } <nl> <nl> + sil [ ossa ] @ copy_unmanaged_value_test : $ @ convention ( thin ) ( @ sil_unmanaged Builtin . NativeObject ) - > @ owned Builtin . NativeObject { <nl> + bb0 ( % 0 : $ @ sil_unmanaged Builtin . NativeObject ) : <nl> + % 1 = copy_unmanaged_value % 0 : $ @ sil_unmanaged Builtin . NativeObject <nl> + return % 1 : $ Builtin . NativeObject <nl> + } <nl> mmm a / utils / sil - mode . el <nl> ppp b / utils / sil - mode . el <nl> <nl> " autorelease_value " " copy_value " " destroy_value " <nl> " unmanaged_retain_value " " unmanaged_release_value " <nl> " unmanaged_autorelease_value " <nl> - " copy_unowned_value " <nl> + " copy_unowned_value " " copy_unmanaged_value " <nl> " destructure_struct " " destructure_tuple " ) <nl> ' words ) . font - lock - keyword - face ) <nl> ; ; Enums . * NOTE * We do not include enum itself here since enum is a <nl>
[ ownership ] Define a new instruction copy_unmanaged_value .
apple/swift
5fc1d1d3497643c0c6975b9445568e230a91d8bf
2019-08-26T04:26:40Z
mmm a / README . md <nl> ppp b / README . md <nl> Your case if you want to change internal functions and / or extend its functionali <nl> 3 . Adding An Extra Module : Learn how to add an extra module in [ doc / library_add_new_module . md ] ( doc / library_add_new_module . md ) . <nl> <nl> <nl> - # # # Doxygen Documentation Autogeneration <nl> - You can generate the documentation by running the following command . The documentation will be generated in ` doc / doxygen / html / index . html ` . You can simply open it with double - click ( your default browser should automatically display it ) . <nl> - ` ` ` <nl> - cd doc / <nl> - doxygen doc_autogeneration . doxygen <nl> - ` ` ` <nl> - <nl> - <nl> <nl> # # Output <nl> Check the output ( format , keypoint index ordering , etc . ) in [ doc / output . md ] ( doc / output . md ) . <nl> mmm a / doc / installation . md <nl> ppp b / doc / installation . md <nl> OpenPose - Installation and FAQ <nl> 4 . [ Ubuntu ] ( # ubuntu ) <nl> 5 . [ Windows ] ( # windows ) <nl> 6 . [ OpenPose 3D Demo ] ( # openpose - 3d - demo ) <nl> - 7 . [ Custom Caffe ] ( # custom - caffe ) <nl> - 8 . [ Compiling without cuDNN ] ( # compiling - without - cudnn ) <nl> - 9 . [ FAQ ] ( # faq ) <nl> + 7 . [ Doxygen Documentation Autogeneration ] ( # doxygen - documentation - autogeneration ) <nl> + 8 . [ Custom Caffe ] ( # custom - caffe ) <nl> + 9 . [ Compiling without cuDNN ] ( # compiling - without - cudnn ) <nl> + 10 . [ FAQ ] ( # faq ) <nl> <nl> <nl> <nl> If you want to try our OpenPose 3 - D reconstruction demo , see [ doc / openpose_3d_re <nl> <nl> <nl> <nl> + # # Doxygen Documentation Autogeneration <nl> + You can generate the documentation by running the following command . The documentation will be generated in ` doc / doxygen / html / index . html ` . You can simply open it with double - click ( your default browser should automatically display it ) . <nl> + ` ` ` <nl> + cd doc / <nl> + doxygen doc_autogeneration . doxygen <nl> + ` ` ` <nl> + <nl> + <nl> + <nl> + <nl> + <nl> # # Custom Caffe <nl> We only modified some Caffe compilation flags and minor details . You can use your own Caffe distribution , these are the files we added and modified : <nl> <nl> mmm a / doc / installation_cmake . md <nl> ppp b / doc / installation_cmake . md <nl> OpenPose - Installation using CMake <nl> 4 . [ Run OpenPose ] ( # run - openpose ) <nl> 5 . [ Reinstallation ] ( # reinstallation ) <nl> 6 . [ Optional Settings ] ( # optional - settings ) <nl> - 1 . [ Custom Caffe ] ( # custom - caffe ) <nl> - 2 . [ Custom OpenCV ] ( # custom - opencv ) <nl> - 3 . [ MPI Model ] ( # mpi - model ) <nl> - 4 . [ CMake Command Line Configuration ] ( # cmake - command - line - configuration ) <nl> + 1 . [ Doxygen Documentation Autogeneration ] ( # doxygen - documentation - autogeneration ) <nl> + 2 . [ Custom Caffe ] ( # custom - caffe ) <nl> + 3 . [ Custom OpenCV ] ( # custom - opencv ) <nl> + 4 . [ MPI Model ] ( # mpi - model ) <nl> + 5 . [ CMake Command Line Configuration ] ( # cmake - command - line - configuration ) <nl> <nl> <nl> <nl> In order to re - install OpenPose : <nl> <nl> <nl> # # # Optional Settings <nl> + # # # # Doxygen Documentation Autogeneration <nl> + You can generate the documentation by setting the ` BUILD_DOCS ` flag . <nl> + <nl> + <nl> + <nl> # # # # Custom Caffe <nl> We only modified some Caffe compilation flags and minor details . You can use your own Caffe distribution , simply specify the Caffe include path and the library as shown below . You will also need to turn off the ` BUILD_CAFFE ` variable . <nl> < p align = " center " > <nl> mmm a / src / openpose / filestream / cocoJsonSaver . cpp <nl> ppp b / src / openpose / filestream / cocoJsonSaver . cpp <nl> namespace op <nl> mJsonOfstream . comma ( ) ; <nl> mJsonOfstream . plainText ( poseKeypoints [ finalIndex + 1 ] ) ; <nl> mJsonOfstream . comma ( ) ; <nl> - mJsonOfstream . plainText ( 1 ) ; <nl> + mJsonOfstream . plainText ( ( poseKeypoints [ finalIndex + 2 ] > 0 . f ? 1 : 0 ) ) ; <nl> if ( bodyPart < indexesInCocoOrder . size ( ) - 1u ) <nl> mJsonOfstream . comma ( ) ; <nl> } <nl>
CocoJson assigns 0 to score if no detected
CMU-Perceptual-Computing-Lab/openpose
3aadfc99f70fc9bb54161a6f87f4376c8a76b782
2017-09-22T21:19:42Z
mmm a / project / VS2010Express / XBMC . vcxproj <nl> ppp b / project / VS2010Express / XBMC . vcxproj <nl> <nl> - < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> +  < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < Project DefaultTargets = " Build " ToolsVersion = " 4 . 0 " xmlns = " http : / / schemas . microsoft . com / developer / msbuild / 2003 " > <nl> < ItemGroup Label = " ProjectConfigurations " > <nl> < ProjectConfiguration Include = " Debug ( DirectX ) | Win32 " > <nl> <nl> < ExcludedFromBuild Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Debug ( DirectX ) | Win32 ' " > true < / ExcludedFromBuild > <nl> < ExcludedFromBuild Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release ( DirectX ) | Win32 ' " > true < / ExcludedFromBuild > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ . . \ xbmc \ windowing \ WinEventsSDL . cpp " / > <nl> < ClCompile Include = " . . \ . . \ xbmc \ windowing \ WinSystem . cpp " / > <nl> < ClCompile Include = " . . \ . . \ xbmc \ windows \ GUIMediaWindow . cpp " / > <nl> < ClCompile Include = " . . \ . . \ xbmc \ windows \ GUIWindowDebugInfo . cpp " / > <nl> <nl> < ExcludedFromBuild Condition = " ' $ ( Configuration ) | $ ( Platform ) ' = = ' Release ( DirectX ) | Win32 ' " > true < / ExcludedFromBuild > <nl> < / ClInclude > <nl> < ClInclude Include = " . . \ . . \ xbmc \ windowing \ WinEvents . h " / > <nl> - < ClInclude Include = " . . \ . . \ xbmc \ windowing \ WinEventsSDL . h " / > <nl> < ClInclude Include = " . . \ . . \ xbmc \ windowing \ WinSystem . h " / > <nl> < ClInclude Include = " . . \ . . \ xbmc \ windowing \ XBMC_events . h " / > <nl> < ClInclude Include = " . . \ . . \ xbmc \ windows \ GUIMediaWindow . h " / > <nl> <nl> < / VisualStudio > <nl> < / ProjectExtensions > <nl> < Import Project = " $ ( SolutionDir ) \ $ ( ProjectFileName ) . targets . user " Condition = " Exists ( ' $ ( SolutionDir ) \ $ ( ProjectFileName ) . targets . user ' ) " / > <nl> - < / Project > <nl> + < / Project > <nl> \ No newline at end of file <nl> mmm a / project / VS2010Express / XBMC . vcxproj . filters <nl> ppp b / project / VS2010Express / XBMC . vcxproj . filters <nl> <nl> < ClCompile Include = " . . \ . . \ xbmc \ video \ windows \ GUIWindowVideoPlaylist . cpp " > <nl> < Filter > video \ windows < / Filter > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ . . \ xbmc \ windowing \ WinEventsSDL . cpp " > <nl> - < Filter > windowing < / Filter > <nl> - < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ xbmc \ windowing \ WinSystem . cpp " > <nl> < Filter > windowing < / Filter > <nl> < / ClCompile > <nl> <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ xbmc \ network \ httprequesthandler \ HTTPVfsHandler . cpp " > <nl> < Filter > network \ httprequesthandler < / Filter > <nl> - < / ClCompile > <nl> + < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ xbmc \ utils \ XBMCTinyXML . cpp " > <nl> < Filter > utils < / Filter > <nl> < / ClCompile > <nl> <nl> < ClInclude Include = " . . \ . . \ xbmc \ windowing \ WinEvents . h " > <nl> < Filter > windowing < / Filter > <nl> < / ClInclude > <nl> - < ClInclude Include = " . . \ . . \ xbmc \ windowing \ WinEventsSDL . h " > <nl> - < Filter > windowing < / Filter > <nl> - < / ClInclude > <nl> < ClInclude Include = " . . \ . . \ xbmc \ windowing \ WinSystem . h " > <nl> < Filter > windowing < / Filter > <nl> < / ClInclude > <nl> <nl> < / ClInclude > <nl> < ClInclude Include = " . . \ . . \ xbmc \ filesystem \ FileCache . h " > <nl> < Filter > filesystem < / Filter > <nl> - < / ClInclude > <nl> + < / ClInclude > <nl> < ClInclude Include = " . . \ . . \ xbmc \ utils \ XBMCTinyXML . h " > <nl> < Filter > utils < / Filter > <nl> < / ClInclude > <nl> <nl> < Filter > win32 < / Filter > <nl> < / CustomBuild > <nl> < / ItemGroup > <nl> - < / Project > <nl> + < / Project > <nl> \ No newline at end of file <nl>
[ WIN32 ] removed unneeded files from vs project
xbmc/xbmc
51f79c788acf1300fb75bfdc6168d5a1cc3537b6
2012-05-08T21:03:06Z
mmm a / models / bvlc_alexnet / readme . md <nl> ppp b / models / bvlc_alexnet / readme . md <nl> The best validation performance during training was iteration 358 , 000 with valid <nl> This model obtains a top - 1 accuracy 57 . 1 % and a top - 5 accuracy 80 . 2 % on the validation set , using just the center crop . <nl> ( Using the average of 10 crops , ( 4 + 1 center ) * 2 mirror , should obtain a bit higher accuracy . ) <nl> <nl> + This model was trained by Evan Shelhamer @ shelhamer <nl> + <nl> # # License <nl> <nl> The data used to train this model comes from the ImageNet project , which distributes its database to researchers who agree to a following term of access : <nl> mmm a / models / bvlc_googlenet / readme . md <nl> ppp b / models / bvlc_googlenet / readme . md <nl> caffemodel_url : http : / / dl . caffe . berkeleyvision . org / bvlc_googlenet . caffemodel <nl> license : non - commercial <nl> sha1 : 405fc5acd08a3bb12de8ee5e23a96bec22f08204 <nl> caffe_commit : bc614d1bd91896e3faceaf40b23b72dab47d44f5 <nl> + gist_id : 866e2aa1fd707b89b913 <nl> mmm <nl> <nl> This model is a replication of the model described in the [ GoogleNet ] ( http : / / arxiv . org / abs / 1409 . 4842 ) publication . We would like to thank Christian Szegedy for all his help in the replication of GoogleNet model . <nl> Timings for bvlc_googlenet with cuDNN using batch_size : 128 on a K40c : <nl> - Average Backward pass : 1123 . 84 ms . <nl> - Average Forward - Backward : 1688 . 8 ms . <nl> <nl> + This model was trained by Sergio Guadarrama @ sguada <nl> <nl> # # License <nl> <nl> mmm a / models / bvlc_reference_caffenet / readme . md <nl> ppp b / models / bvlc_reference_caffenet / readme . md <nl> The best validation performance during training was iteration 313 , 000 with valid <nl> This model obtains a top - 1 accuracy 57 . 4 % and a top - 5 accuracy 80 . 4 % on the validation set , using just the center crop . <nl> ( Using the average of 10 crops , ( 4 + 1 center ) * 2 mirror , should obtain a bit higher accuracy still . ) <nl> <nl> + This model was trained by Jeff Donahue @ jeffdonahue <nl> + <nl> # # License <nl> <nl> The data used to train this model comes from the ImageNet project , which distributes its database to researchers who agree to a following term of access : <nl> mmm a / models / bvlc_reference_rcnn_ilsvrc13 / readme . md <nl> ppp b / models / bvlc_reference_rcnn_ilsvrc13 / readme . md <nl> Try the [ detection example ] ( http : / / nbviewer . ipython . org / github / BVLC / caffe / blob / m <nl> <nl> * N . B . For research purposes , make use of the official R - CNN package and not this example . * <nl> <nl> + This model was trained by Ross Girshick @ rbgirshick <nl> + <nl> # # License <nl> <nl> The data used to train this model comes from the ImageNet project , which distributes its database to researchers who agree to a following term of access : <nl> mmm a / models / finetune_flickr_style / readme . md <nl> ppp b / models / finetune_flickr_style / readme . md <nl> The final performance : <nl> I1017 07 : 36 : 17 . 370730 31333 solver . cpp : 247 ] Iteration 100000 , Testing net ( # 0 ) <nl> I1017 07 : 36 : 34 . 248730 31333 solver . cpp : 298 ] Test net output # 0 : accuracy = 0 . 3916 <nl> <nl> + This model was trained by Sergey Karayev @ sergeyk <nl> + <nl> # # License <nl> <nl> The Flickr Style dataset contains only URLs to images . <nl>
Added credits for training bvlc models
BVLC/caffe
f347355207601a602cc1081ea10f969f995138e9
2014-12-21T07:24:58Z
mmm a / CODEOWNERS <nl> ppp b / CODEOWNERS <nl> extensions / filters / common / original_src @ snowp @ klarose <nl> / * / extensions / filters / http / dynamic_forward_proxy @ mattklein123 @ alyssawilk <nl> # omit_canary_hosts retry predicate <nl> / * / extensions / retry / host / omit_canary_hosts @ sriduth @ snowp <nl> + # http inspector <nl> + / * / extensions / filters / listener / http_inspector @ crazyxy @ PiotrSikora @ lizan <nl> new file mode 100644 <nl> index 00000000000 . . 5972e0ad89c <nl> mmm / dev / null <nl> ppp b / docs / root / configuration / listener_filters / http_inspector . rst <nl> <nl> + . . _config_listener_filters_http_inspector : <nl> + <nl> + HTTP Inspector <nl> + = = = = = = = = = = = = = = <nl> + <nl> + HTTP Inspector listener filter allows detecting whether the application protocol appears to be HTTP , <nl> + and if it is HTTP , it detects the HTTP protocol ( HTTP / 1 . x or HTTP / 2 ) further . This can be used to select a <nl> + : ref : ` FilterChain < envoy_api_msg_listener . FilterChain > ` via the : ref : ` application_protocols < envoy_api_field_listener . FilterChainMatch . application_protocols > ` <nl> + of a : ref : ` FilterChainMatch < envoy_api_msg_listener . FilterChainMatch > ` . <nl> + <nl> + * : ref : ` v2 API reference < envoy_api_field_listener . ListenerFilter . name > ` <nl> + * This filter should be configured with the name * envoy . listener . http_inspector * . <nl> + <nl> + Example <nl> + mmmmmm - <nl> + <nl> + A sample filter configuration could be : <nl> + <nl> + . . code - block : : yaml <nl> + <nl> + listener_filters : <nl> + - name : " envoy . listener . http_inspector " <nl> + typed_config : { } <nl> + <nl> + Statistics <nl> + mmmmmmmmm - <nl> + <nl> + This filter has a statistics tree rooted at * http_inspector * with the following statistics : <nl> + <nl> + . . csv - table : : <nl> + : header : Name , Type , Description <nl> + : widths : 1 , 1 , 2 <nl> + <nl> + read_error , Counter , Total read errors <nl> + http10_found , Counter , Total number of times HTTP / 1 . 0 was found <nl> + http11_found , Counter , Total number of times HTTP / 1 . 1 was found <nl> + http2_found , Counter , Total number of times HTTP / 2 was found <nl> + http_not_found , Counter , Total number of times HTTP protocol was not found <nl> mmm a / docs / root / configuration / listener_filters / listener_filters . rst <nl> ppp b / docs / root / configuration / listener_filters / listener_filters . rst <nl> Envoy has the following builtin listener filters . <nl> . . toctree : : <nl> : maxdepth : 2 <nl> <nl> + http_inspector <nl> original_dst_filter <nl> original_src_filter <nl> proxy_protocol <nl> mmm a / docs / root / intro / version_history . rst <nl> ppp b / docs / root / intro / version_history . rst <nl> Version history <nl> = = = = = = = = = = = = = = = = <nl> * admin : added ability to configure listener : ref : ` socket options < envoy_api_field_config . bootstrap . v2 . Admin . socket_options > ` . <nl> * config : async data access for local and remote data source . <nl> + * listeners : added : ref : ` HTTP inspector listener filter < config_listener_filters_http_inspector > ` . <nl> * http : added the ability to reject HTTP / 1 . 1 requests with invalid HTTP header values , using the runtime feature ` envoy . reloadable_features . strict_header_validation ` . <nl> <nl> 1 . 11 . 0 ( July 11 , 2019 ) <nl> mmm a / source / extensions / extensions_build_config . bzl <nl> ppp b / source / extensions / extensions_build_config . bzl <nl> EXTENSIONS = { <nl> # Listener filters <nl> # <nl> <nl> - # NOTE : The proxy_protocol filter is implicitly loaded if proxy_protocol functionality is <nl> - # configured on the listener . Do not remove it in that case or configs will fail to load . <nl> - " envoy . filters . listener . proxy_protocol " : " / / source / extensions / filters / listener / proxy_protocol : config " , <nl> - <nl> + " envoy . filters . listener . http_inspector " : " / / source / extensions / filters / listener / http_inspector : config " , <nl> # NOTE : The original_dst filter is implicitly loaded if original_dst functionality is <nl> # configured on the listener . Do not remove it in that case or configs will fail to load . <nl> " envoy . filters . listener . original_dst " : " / / source / extensions / filters / listener / original_dst : config " , <nl> - <nl> " envoy . filters . listener . original_src " : " / / source / extensions / filters / listener / original_src : config " , <nl> - <nl> + # NOTE : The proxy_protocol filter is implicitly loaded if proxy_protocol functionality is <nl> + # configured on the listener . Do not remove it in that case or configs will fail to load . <nl> + " envoy . filters . listener . proxy_protocol " : " / / source / extensions / filters / listener / proxy_protocol : config " , <nl> " envoy . filters . listener . tls_inspector " : " / / source / extensions / filters / listener / tls_inspector : config " , <nl> <nl> # <nl> new file mode 100644 <nl> index 00000000000 . . 1d5b13218f0 <nl> mmm / dev / null <nl> ppp b / source / extensions / filters / listener / http_inspector / BUILD <nl> <nl> + licenses ( [ " notice " ] ) # Apache 2 <nl> + <nl> + # HTTP inspector filter for sniffing HTTP protocol and setting HTTP version to a FilterChain . <nl> + <nl> + load ( <nl> + " / / bazel : envoy_build_system . bzl " , <nl> + " envoy_cc_library " , <nl> + " envoy_package " , <nl> + ) <nl> + <nl> + envoy_package ( ) <nl> + <nl> + envoy_cc_library ( <nl> + name = " http_inspector_lib " , <nl> + srcs = [ " http_inspector . cc " ] , <nl> + hdrs = [ " http_inspector . h " ] , <nl> + deps = [ <nl> + " / / include / envoy / event : dispatcher_interface " , <nl> + " / / include / envoy / event : timer_interface " , <nl> + " / / include / envoy / network : filter_interface " , <nl> + " / / include / envoy / network : listen_socket_interface " , <nl> + " / / source / common / api : os_sys_calls_lib " , <nl> + " / / source / common / common : minimal_logger_lib " , <nl> + " / / source / common / http : headers_lib " , <nl> + " / / source / extensions / transport_sockets : well_known_names " , <nl> + ] , <nl> + ) <nl> + <nl> + envoy_cc_library ( <nl> + name = " config " , <nl> + srcs = [ " config . cc " ] , <nl> + deps = [ <nl> + " : http_inspector_lib " , <nl> + " / / include / envoy / registry " , <nl> + " / / include / envoy / server : filter_config_interface " , <nl> + " / / source / extensions / filters / listener : well_known_names " , <nl> + ] , <nl> + ) <nl> new file mode 100644 <nl> index 00000000000 . . 3a0833d6721 <nl> mmm / dev / null <nl> ppp b / source / extensions / filters / listener / http_inspector / config . cc <nl> <nl> + # include " envoy / registry / registry . h " <nl> + # include " envoy / server / filter_config . h " <nl> + <nl> + # include " extensions / filters / listener / http_inspector / http_inspector . h " <nl> + # include " extensions / filters / listener / well_known_names . h " <nl> + <nl> + namespace Envoy { <nl> + namespace Extensions { <nl> + namespace ListenerFilters { <nl> + namespace HttpInspector { <nl> + <nl> + / * * <nl> + * Config registration for the Http inspector filter . @ see NamedNetworkFilterConfigFactory . <nl> + * / <nl> + class HttpInspectorConfigFactory : public Server : : Configuration : : NamedListenerFilterConfigFactory { <nl> + public : <nl> + / / NamedListenerFilterConfigFactory <nl> + Network : : ListenerFilterFactoryCb <nl> + createFilterFactoryFromProto ( const Protobuf : : Message & , <nl> + Server : : Configuration : : ListenerFactoryContext & context ) override { <nl> + ConfigSharedPtr config ( std : : make_shared < Config > ( context . scope ( ) ) ) ; <nl> + return [ config ] ( Network : : ListenerFilterManager & filter_manager ) - > void { <nl> + filter_manager . addAcceptFilter ( std : : make_unique < Filter > ( config ) ) ; <nl> + } ; <nl> + } <nl> + <nl> + ProtobufTypes : : MessagePtr createEmptyConfigProto ( ) override { <nl> + return std : : make_unique < Envoy : : ProtobufWkt : : Empty > ( ) ; <nl> + } <nl> + <nl> + std : : string name ( ) override { return ListenerFilterNames : : get ( ) . HttpInspector ; } <nl> + } ; <nl> + <nl> + / * * <nl> + * Static registration for the http inspector filter . @ see RegisterFactory . <nl> + * / <nl> + REGISTER_FACTORY ( HttpInspectorConfigFactory , <nl> + Server : : Configuration : : NamedListenerFilterConfigFactory ) ; <nl> + <nl> + } / / namespace HttpInspector <nl> + } / / namespace ListenerFilters <nl> + } / / namespace Extensions <nl> + } / / namespace Envoy <nl> new file mode 100644 <nl> index 00000000000 . . 332149a8681 <nl> mmm / dev / null <nl> ppp b / source / extensions / filters / listener / http_inspector / http_inspector . cc <nl> <nl> + # include " extensions / filters / listener / http_inspector / http_inspector . h " <nl> + <nl> + # include " envoy / event / dispatcher . h " <nl> + # include " envoy / network / listen_socket . h " <nl> + # include " envoy / stats / scope . h " <nl> + <nl> + # include " common / api / os_sys_calls_impl . h " <nl> + # include " common / common / assert . h " <nl> + # include " common / common / macros . h " <nl> + # include " common / http / headers . h " <nl> + <nl> + # include " extensions / transport_sockets / well_known_names . h " <nl> + <nl> + # include " absl / strings / match . h " <nl> + # include " absl / strings / str_split . h " <nl> + <nl> + namespace Envoy { <nl> + namespace Extensions { <nl> + namespace ListenerFilters { <nl> + namespace HttpInspector { <nl> + <nl> + Config : : Config ( Stats : : Scope & scope ) <nl> + : stats_ { ALL_HTTP_INSPECTOR_STATS ( POOL_COUNTER_PREFIX ( scope , " http_inspector . " ) ) } { } <nl> + <nl> + const absl : : string_view Filter : : HTTP2_CONNECTION_PREFACE = " PRI * HTTP / 2 . 0 \ r \ n \ r \ nSM \ r \ n \ r \ n " ; <nl> + thread_local uint8_t Filter : : buf_ [ Config : : MAX_INSPECT_SIZE ] ; <nl> + <nl> + Filter : : Filter ( const ConfigSharedPtr config ) : config_ ( config ) { } <nl> + <nl> + Network : : FilterStatus Filter : : onAccept ( Network : : ListenerFilterCallbacks & cb ) { <nl> + ENVOY_LOG ( debug , " http inspector : new connection accepted " ) ; <nl> + <nl> + Network : : ConnectionSocket & socket = cb . socket ( ) ; <nl> + <nl> + absl : : string_view transport_protocol = socket . detectedTransportProtocol ( ) ; <nl> + if ( ! transport_protocol . empty ( ) & & <nl> + transport_protocol ! = TransportSockets : : TransportSocketNames : : get ( ) . RawBuffer ) { <nl> + ENVOY_LOG ( trace , " http inspector : cannot inspect http protocol with transport socket { } " , <nl> + transport_protocol ) ; <nl> + return Network : : FilterStatus : : Continue ; <nl> + } <nl> + <nl> + ASSERT ( file_event_ = = nullptr ) ; <nl> + <nl> + file_event_ = cb . dispatcher ( ) . createFileEvent ( <nl> + socket . ioHandle ( ) . fd ( ) , <nl> + [ this ] ( uint32_t events ) { <nl> + ASSERT ( events = = Event : : FileReadyType : : Read ) ; <nl> + onRead ( ) ; <nl> + } , <nl> + Event : : FileTriggerType : : Edge , Event : : FileReadyType : : Read ) ; <nl> + <nl> + cb_ = & cb ; <nl> + return Network : : FilterStatus : : StopIteration ; <nl> + } <nl> + <nl> + void Filter : : onRead ( ) { <nl> + auto & os_syscalls = Api : : OsSysCallsSingleton : : get ( ) ; <nl> + const Api : : SysCallSizeResult result = <nl> + os_syscalls . recv ( cb_ - > socket ( ) . ioHandle ( ) . fd ( ) , buf_ , Config : : MAX_INSPECT_SIZE , MSG_PEEK ) ; <nl> + ENVOY_LOG ( trace , " http inspector : recv : { } " , result . rc_ ) ; <nl> + if ( result . rc_ = = - 1 & & result . errno_ = = EAGAIN ) { <nl> + return ; <nl> + } else if ( result . rc_ < 0 ) { <nl> + config_ - > stats ( ) . read_error_ . inc ( ) ; <nl> + done ( false ) ; <nl> + return ; <nl> + } <nl> + <nl> + parseHttpHeader ( absl : : string_view ( reinterpret_cast < const char * > ( buf_ ) , result . rc_ ) ) ; <nl> + } <nl> + <nl> + void Filter : : parseHttpHeader ( absl : : string_view data ) { <nl> + if ( absl : : StartsWith ( data , Filter : : HTTP2_CONNECTION_PREFACE ) ) { <nl> + ENVOY_LOG ( trace , " http inspector : http2 connection preface found " ) ; <nl> + protocol_ = " HTTP / 2 " ; <nl> + done ( true ) ; <nl> + } else { <nl> + size_t pos = data . find_first_of ( " \ r \ n " ) ; <nl> + <nl> + / / Cannot find \ r or \ n <nl> + if ( pos = = absl : : string_view : : npos ) { <nl> + ENVOY_LOG ( trace , " http inspector : no request line detected " ) ; <nl> + return done ( false ) ; <nl> + } <nl> + <nl> + absl : : string_view request_line = data . substr ( 0 , pos ) ; <nl> + std : : vector < absl : : string_view > fields = absl : : StrSplit ( request_line , absl : : MaxSplits ( ' ' , 4 ) ) ; <nl> + <nl> + / / Method SP Request - URI SP HTTP - Version <nl> + if ( fields . size ( ) ! = 3 ) { <nl> + ENVOY_LOG ( trace , " http inspector : invalid http1x request line " ) ; <nl> + return done ( false ) ; <nl> + } <nl> + <nl> + if ( httpProtocols ( ) . count ( fields [ 2 ] ) = = 0 ) { <nl> + ENVOY_LOG ( trace , " http inspector : protocol : { } not valid " , fields [ 2 ] ) ; <nl> + return done ( false ) ; <nl> + } <nl> + <nl> + ENVOY_LOG ( trace , " http inspector : method : { } , request uri : { } , protocol : { } " , fields [ 0 ] , <nl> + fields [ 1 ] , fields [ 2 ] ) ; <nl> + <nl> + protocol_ = fields [ 2 ] ; <nl> + done ( true ) ; <nl> + } <nl> + } <nl> + <nl> + void Filter : : done ( bool success ) { <nl> + ENVOY_LOG ( trace , " http inspector : done : { } " , success ) ; <nl> + <nl> + if ( success ) { <nl> + absl : : string_view protocol ; <nl> + if ( protocol_ = = Http : : Headers : : get ( ) . ProtocolStrings . Http10String ) { <nl> + config_ - > stats ( ) . http10_found_ . inc ( ) ; <nl> + protocol = " http / 1 . 0 " ; <nl> + } else if ( protocol_ = = Http : : Headers : : get ( ) . ProtocolStrings . Http11String ) { <nl> + config_ - > stats ( ) . http11_found_ . inc ( ) ; <nl> + protocol = " http / 1 . 1 " ; <nl> + } else { <nl> + ASSERT ( protocol_ = = " HTTP / 2 " ) ; <nl> + config_ - > stats ( ) . http2_found_ . inc ( ) ; <nl> + protocol = " h2 " ; <nl> + } <nl> + <nl> + cb_ - > socket ( ) . setRequestedApplicationProtocols ( { protocol } ) ; <nl> + } else { <nl> + config_ - > stats ( ) . http_not_found_ . inc ( ) ; <nl> + } <nl> + <nl> + file_event_ . reset ( ) ; <nl> + / / Do not skip following listener filters . <nl> + cb_ - > continueFilterChain ( true ) ; <nl> + } <nl> + <nl> + const absl : : flat_hash_set < std : : string > & Filter : : httpProtocols ( ) const { <nl> + CONSTRUCT_ON_FIRST_USE ( absl : : flat_hash_set < std : : string > , <nl> + Http : : Headers : : get ( ) . ProtocolStrings . Http10String , <nl> + Http : : Headers : : get ( ) . ProtocolStrings . Http11String ) ; <nl> + } <nl> + <nl> + } / / namespace HttpInspector <nl> + } / / namespace ListenerFilters <nl> + } / / namespace Extensions <nl> + } / / namespace Envoy <nl> new file mode 100644 <nl> index 00000000000 . . cb284910a0d <nl> mmm / dev / null <nl> ppp b / source / extensions / filters / listener / http_inspector / http_inspector . h <nl> <nl> + # pragma once <nl> + <nl> + # include " envoy / event / file_event . h " <nl> + # include " envoy / event / timer . h " <nl> + # include " envoy / network / filter . h " <nl> + # include " envoy / stats / scope . h " <nl> + # include " envoy / stats / stats_macros . h " <nl> + <nl> + # include " common / common / logger . h " <nl> + <nl> + # include " absl / container / flat_hash_set . h " <nl> + <nl> + namespace Envoy { <nl> + namespace Extensions { <nl> + namespace ListenerFilters { <nl> + namespace HttpInspector { <nl> + <nl> + / * * <nl> + * All stats for the http inspector . @ see stats_macros . h <nl> + * / <nl> + # define ALL_HTTP_INSPECTOR_STATS ( COUNTER ) \ <nl> + COUNTER ( read_error ) \ <nl> + COUNTER ( http10_found ) \ <nl> + COUNTER ( http11_found ) \ <nl> + COUNTER ( http2_found ) \ <nl> + COUNTER ( http_not_found ) <nl> + <nl> + / * * <nl> + * Definition of all stats for the Http inspector . @ see stats_macros . h <nl> + * / <nl> + struct HttpInspectorStats { <nl> + ALL_HTTP_INSPECTOR_STATS ( GENERATE_COUNTER_STRUCT ) <nl> + } ; <nl> + <nl> + / * * <nl> + * Global configuration for http inspector . <nl> + * / <nl> + class Config { <nl> + public : <nl> + Config ( Stats : : Scope & scope ) ; <nl> + <nl> + const HttpInspectorStats & stats ( ) const { return stats_ ; } <nl> + <nl> + static constexpr uint32_t MAX_INSPECT_SIZE = 8192 ; <nl> + <nl> + private : <nl> + HttpInspectorStats stats_ ; <nl> + } ; <nl> + <nl> + using ConfigSharedPtr = std : : shared_ptr < Config > ; <nl> + <nl> + / * * <nl> + * Http inspector listener filter . <nl> + * / <nl> + class Filter : public Network : : ListenerFilter , Logger : : Loggable < Logger : : Id : : filter > { <nl> + public : <nl> + Filter ( const ConfigSharedPtr config ) ; <nl> + <nl> + / / Network : : ListenerFilter <nl> + Network : : FilterStatus onAccept ( Network : : ListenerFilterCallbacks & cb ) override ; <nl> + <nl> + private : <nl> + static const absl : : string_view HTTP2_CONNECTION_PREFACE ; <nl> + <nl> + void onRead ( ) ; <nl> + void done ( bool success ) ; <nl> + void parseHttpHeader ( absl : : string_view data ) ; <nl> + <nl> + const absl : : flat_hash_set < std : : string > & httpProtocols ( ) const ; <nl> + <nl> + ConfigSharedPtr config_ ; <nl> + Network : : ListenerFilterCallbacks * cb_ { nullptr } ; <nl> + Event : : FileEventPtr file_event_ ; <nl> + absl : : string_view protocol_ ; <nl> + <nl> + / / Use static thread_local to avoid allocating buffer over and over again . <nl> + static thread_local uint8_t buf_ [ Config : : MAX_INSPECT_SIZE ] ; <nl> + } ; <nl> + <nl> + } / / namespace HttpInspector <nl> + } / / namespace ListenerFilters <nl> + } / / namespace Extensions <nl> + } / / namespace Envoy <nl> mmm a / source / extensions / filters / listener / well_known_names . h <nl> ppp b / source / extensions / filters / listener / well_known_names . h <nl> namespace ListenerFilters { <nl> * / <nl> class ListenerFilterNameValues { <nl> public : <nl> + / / HTTP Inspector listener filter <nl> + const std : : string HttpInspector = " envoy . listener . http_inspector " ; <nl> / / Original destination listener filter <nl> const std : : string OriginalDst = " envoy . listener . original_dst " ; <nl> / / Original source listener filter <nl> new file mode 100644 <nl> index 00000000000 . . fcce5eea944 <nl> mmm / dev / null <nl> ppp b / test / extensions / filters / listener / http_inspector / BUILD <nl> <nl> + licenses ( [ " notice " ] ) # Apache 2 <nl> + <nl> + load ( <nl> + " / / bazel : envoy_build_system . bzl " , <nl> + " envoy_cc_test " , <nl> + " envoy_package " , <nl> + ) <nl> + load ( <nl> + " / / test / extensions : extensions_build_system . bzl " , <nl> + " envoy_extension_cc_test " , <nl> + ) <nl> + <nl> + envoy_package ( ) <nl> + <nl> + envoy_extension_cc_test ( <nl> + name = " http_inspector_test " , <nl> + srcs = [ " http_inspector_test . cc " ] , <nl> + extension_name = " envoy . filters . listener . http_inspector " , <nl> + deps = [ <nl> + " / / source / common / common : hex_lib " , <nl> + " / / source / extensions / filters / listener / http_inspector : http_inspector_lib " , <nl> + " / / test / mocks / api : api_mocks " , <nl> + " / / test / mocks / network : network_mocks " , <nl> + " / / test / mocks / stats : stats_mocks " , <nl> + " / / test / test_common : threadsafe_singleton_injector_lib " , <nl> + ] , <nl> + ) <nl> + <nl> + envoy_extension_cc_test ( <nl> + name = " http_inspector_config_test " , <nl> + srcs = [ " http_inspector_config_test . cc " ] , <nl> + extension_name = " envoy . filters . listener . http_inspector " , <nl> + deps = [ <nl> + " / / source / extensions / filters / listener : well_known_names " , <nl> + " / / source / extensions / filters / listener / http_inspector : config " , <nl> + " / / source / extensions / filters / listener / http_inspector : http_inspector_lib " , <nl> + " / / test / mocks / api : api_mocks " , <nl> + " / / test / mocks / network : network_mocks " , <nl> + " / / test / mocks / server : server_mocks " , <nl> + " / / test / mocks / stats : stats_mocks " , <nl> + " / / test / test_common : threadsafe_singleton_injector_lib " , <nl> + ] , <nl> + ) <nl> new file mode 100644 <nl> index 00000000000 . . 4e647709f7d <nl> mmm / dev / null <nl> ppp b / test / extensions / filters / listener / http_inspector / http_inspector_config_test . cc <nl> <nl> + # include " extensions / filters / listener / http_inspector / http_inspector . h " <nl> + # include " extensions / filters / listener / well_known_names . h " <nl> + <nl> + # include " test / mocks / server / mocks . h " <nl> + <nl> + # include " gmock / gmock . h " <nl> + # include " gtest / gtest . h " <nl> + <nl> + using testing : : Invoke ; <nl> + <nl> + namespace Envoy { <nl> + namespace Extensions { <nl> + namespace ListenerFilters { <nl> + namespace HttpInspector { <nl> + namespace { <nl> + <nl> + TEST ( HttpInspectorConfigFactoryTest , TestCreateFactory ) { <nl> + Server : : Configuration : : NamedListenerFilterConfigFactory * factory = <nl> + Registry : : FactoryRegistry < Server : : Configuration : : NamedListenerFilterConfigFactory > : : <nl> + getFactory ( ListenerFilters : : ListenerFilterNames : : get ( ) . HttpInspector ) ; <nl> + <nl> + EXPECT_EQ ( factory - > name ( ) , ListenerFilters : : ListenerFilterNames : : get ( ) . HttpInspector ) ; <nl> + <nl> + std : : string yaml = R " EOF ( <nl> + { } <nl> + ) EOF " ; <nl> + <nl> + ProtobufTypes : : MessagePtr proto_config = factory - > createEmptyConfigProto ( ) ; <nl> + TestUtility : : loadFromYaml ( yaml , * proto_config ) ; <nl> + <nl> + Server : : Configuration : : MockListenerFactoryContext context ; <nl> + EXPECT_CALL ( context , scope ( ) ) . Times ( 1 ) ; <nl> + Network : : ListenerFilterFactoryCb cb = <nl> + factory - > createFilterFactoryFromProto ( * proto_config , context ) ; <nl> + <nl> + Network : : MockListenerFilterManager manager ; <nl> + Network : : ListenerFilterPtr added_filter ; <nl> + EXPECT_CALL ( manager , addAcceptFilter_ ( _ ) ) <nl> + . WillOnce ( Invoke ( [ & added_filter ] ( Network : : ListenerFilterPtr & filter ) { <nl> + added_filter = std : : move ( filter ) ; <nl> + } ) ) ; <nl> + cb ( manager ) ; <nl> + <nl> + / / Make sure we actually create the correct type ! <nl> + EXPECT_NE ( dynamic_cast < HttpInspector : : Filter * > ( added_filter . get ( ) ) , nullptr ) ; <nl> + } <nl> + <nl> + } / / namespace <nl> + } / / namespace HttpInspector <nl> + } / / namespace ListenerFilters <nl> + } / / namespace Extensions <nl> + } / / namespace Envoy <nl> new file mode 100644 <nl> index 00000000000 . . f1aa3012c7b <nl> mmm / dev / null <nl> ppp b / test / extensions / filters / listener / http_inspector / http_inspector_test . cc <nl> <nl> + # include " common / common / hex . h " <nl> + # include " common / network / io_socket_handle_impl . h " <nl> + <nl> + # include " extensions / filters / listener / http_inspector / http_inspector . h " <nl> + <nl> + # include " test / mocks / api / mocks . h " <nl> + # include " test / mocks / network / mocks . h " <nl> + # include " test / mocks / stats / mocks . h " <nl> + # include " test / test_common / threadsafe_singleton_injector . h " <nl> + <nl> + # include " gtest / gtest . h " <nl> + <nl> + using testing : : _ ; <nl> + using testing : : AtLeast ; <nl> + using testing : : Eq ; <nl> + using testing : : InSequence ; <nl> + using testing : : Invoke ; <nl> + using testing : : InvokeWithoutArgs ; <nl> + using testing : : NiceMock ; <nl> + using testing : : Return ; <nl> + using testing : : ReturnNew ; <nl> + using testing : : ReturnRef ; <nl> + using testing : : SaveArg ; <nl> + <nl> + namespace Envoy { <nl> + namespace Extensions { <nl> + namespace ListenerFilters { <nl> + namespace HttpInspector { <nl> + namespace { <nl> + <nl> + class HttpInspectorTest : public testing : : Test { <nl> + public : <nl> + HttpInspectorTest ( ) <nl> + : cfg_ ( std : : make_shared < Config > ( store_ ) ) , <nl> + io_handle_ ( std : : make_unique < Network : : IoSocketHandleImpl > ( 42 ) ) { } <nl> + ~ HttpInspectorTest ( ) { io_handle_ - > close ( ) ; } <nl> + <nl> + void init ( ) { <nl> + filter_ = std : : make_unique < Filter > ( cfg_ ) ; <nl> + <nl> + EXPECT_CALL ( cb_ , socket ( ) ) . WillRepeatedly ( ReturnRef ( socket_ ) ) ; <nl> + EXPECT_CALL ( socket_ , detectedTransportProtocol ( ) ) . WillRepeatedly ( Return ( " raw_buffer " ) ) ; <nl> + EXPECT_CALL ( cb_ , dispatcher ( ) ) . WillRepeatedly ( ReturnRef ( dispatcher_ ) ) ; <nl> + EXPECT_CALL ( socket_ , ioHandle ( ) ) . WillRepeatedly ( ReturnRef ( * io_handle_ ) ) ; <nl> + <nl> + EXPECT_CALL ( dispatcher_ , <nl> + createFileEvent_ ( _ , _ , Event : : FileTriggerType : : Edge , Event : : FileReadyType : : Read ) ) <nl> + . WillOnce ( <nl> + DoAll ( SaveArg < 1 > ( & file_event_callback_ ) , ReturnNew < NiceMock < Event : : MockFileEvent > > ( ) ) ) ; <nl> + filter_ - > onAccept ( cb_ ) ; <nl> + } <nl> + <nl> + NiceMock < Api : : MockOsSysCalls > os_sys_calls_ ; <nl> + TestThreadsafeSingletonInjector < Api : : OsSysCallsImpl > os_calls_ { & os_sys_calls_ } ; <nl> + Stats : : IsolatedStoreImpl store_ ; <nl> + ConfigSharedPtr cfg_ ; <nl> + std : : unique_ptr < Filter > filter_ ; <nl> + Network : : MockListenerFilterCallbacks cb_ ; <nl> + Network : : MockConnectionSocket socket_ ; <nl> + NiceMock < Event : : MockDispatcher > dispatcher_ ; <nl> + Event : : FileReadyCb file_event_callback_ ; <nl> + Network : : IoHandlePtr io_handle_ ; <nl> + } ; <nl> + <nl> + TEST_F ( HttpInspectorTest , SkipHttpInspectForTLS ) { <nl> + filter_ = std : : make_unique < Filter > ( cfg_ ) ; <nl> + <nl> + EXPECT_CALL ( cb_ , socket ( ) ) . WillRepeatedly ( ReturnRef ( socket_ ) ) ; <nl> + EXPECT_CALL ( socket_ , detectedTransportProtocol ( ) ) . WillRepeatedly ( Return ( " TLS " ) ) ; <nl> + EXPECT_EQ ( filter_ - > onAccept ( cb_ ) , Network : : FilterStatus : : Continue ) ; <nl> + } <nl> + <nl> + TEST_F ( HttpInspectorTest , InspectHttp10 ) { <nl> + init ( ) ; <nl> + absl : : string_view header = <nl> + " GET / anything HTTP / 1 . 0 \ r \ nhost : google . com \ r \ nuser - agent : curl / 7 . 64 . 0 \ r \ naccept : " <nl> + " * / * \ r \ nx - forwarded - proto : http \ r \ nx - request - id : " <nl> + " a52df4a0 - ed00 - 4a19 - 86a7 - 80e5049c6c84 \ r \ nx - envoy - expected - rq - timeout - ms : " <nl> + " 15000 \ r \ ncontent - length : 0 \ r \ n \ r \ n " ; <nl> + <nl> + EXPECT_CALL ( os_sys_calls_ , recv ( 42 , _ , _ , MSG_PEEK ) ) <nl> + . WillOnce ( Invoke ( [ & header ] ( int , void * buffer , size_t length , int ) - > Api : : SysCallSizeResult { <nl> + ASSERT ( length > = header . size ( ) ) ; <nl> + memcpy ( buffer , header . data ( ) , header . size ( ) ) ; <nl> + return Api : : SysCallSizeResult { ssize_t ( header . size ( ) ) , 0 } ; <nl> + } ) ) ; <nl> + <nl> + const std : : vector < absl : : string_view > alpn_protos { absl : : string_view ( " http / 1 . 0 " ) } ; <nl> + <nl> + EXPECT_CALL ( socket_ , setRequestedApplicationProtocols ( alpn_protos ) ) ; <nl> + EXPECT_CALL ( cb_ , continueFilterChain ( true ) ) ; <nl> + file_event_callback_ ( Event : : FileReadyType : : Read ) ; <nl> + EXPECT_EQ ( 1 , cfg_ - > stats ( ) . http10_found_ . value ( ) ) ; <nl> + } <nl> + <nl> + TEST_F ( HttpInspectorTest , InspectHttp11 ) { <nl> + init ( ) ; <nl> + absl : : string_view header = <nl> + " GET / anything HTTP / 1 . 1 \ r \ nhost : google . com \ r \ nuser - agent : curl / 7 . 64 . 0 \ r \ naccept : " <nl> + " * / * \ r \ nx - forwarded - proto : http \ r \ nx - request - id : " <nl> + " a52df4a0 - ed00 - 4a19 - 86a7 - 80e5049c6c84 \ r \ nx - envoy - expected - rq - timeout - ms : " <nl> + " 15000 \ r \ ncontent - length : 0 \ r \ n \ r \ n " ; <nl> + <nl> + EXPECT_CALL ( os_sys_calls_ , recv ( 42 , _ , _ , MSG_PEEK ) ) <nl> + . WillOnce ( Invoke ( [ & header ] ( int , void * buffer , size_t length , int ) - > Api : : SysCallSizeResult { <nl> + ASSERT ( length > = header . size ( ) ) ; <nl> + memcpy ( buffer , header . data ( ) , header . size ( ) ) ; <nl> + return Api : : SysCallSizeResult { ssize_t ( header . size ( ) ) , 0 } ; <nl> + } ) ) ; <nl> + <nl> + const std : : vector < absl : : string_view > alpn_protos { absl : : string_view ( " http / 1 . 1 " ) } ; <nl> + <nl> + EXPECT_CALL ( socket_ , setRequestedApplicationProtocols ( alpn_protos ) ) ; <nl> + EXPECT_CALL ( cb_ , continueFilterChain ( true ) ) ; <nl> + file_event_callback_ ( Event : : FileReadyType : : Read ) ; <nl> + EXPECT_EQ ( 1 , cfg_ - > stats ( ) . http11_found_ . value ( ) ) ; <nl> + } <nl> + <nl> + TEST_F ( HttpInspectorTest , InvalidHttpMethod ) { <nl> + init ( ) ; <nl> + absl : : string_view header = " BAD / anything HTTP / 1 . 1 \ r \ n " ; <nl> + <nl> + EXPECT_CALL ( os_sys_calls_ , recv ( 42 , _ , _ , MSG_PEEK ) ) <nl> + . WillOnce ( Invoke ( [ & header ] ( int , void * buffer , size_t length , int ) - > Api : : SysCallSizeResult { <nl> + ASSERT ( length > = header . size ( ) ) ; <nl> + memcpy ( buffer , header . data ( ) , header . size ( ) ) ; <nl> + return Api : : SysCallSizeResult { ssize_t ( header . size ( ) ) , 0 } ; <nl> + } ) ) ; <nl> + <nl> + const std : : vector < absl : : string_view > alpn_protos { absl : : string_view ( " http / 1 . 1 " ) } ; <nl> + <nl> + EXPECT_CALL ( socket_ , setRequestedApplicationProtocols ( alpn_protos ) ) ; <nl> + EXPECT_CALL ( cb_ , continueFilterChain ( true ) ) ; <nl> + file_event_callback_ ( Event : : FileReadyType : : Read ) ; <nl> + EXPECT_EQ ( 1 , cfg_ - > stats ( ) . http11_found_ . value ( ) ) ; <nl> + } <nl> + <nl> + TEST_F ( HttpInspectorTest , InvalidHttpRequestLine ) { <nl> + init ( ) ; <nl> + absl : : string_view header = " BAD / anything HTTP / 1 . 1 " ; <nl> + <nl> + EXPECT_CALL ( os_sys_calls_ , recv ( 42 , _ , _ , MSG_PEEK ) ) <nl> + . WillOnce ( Invoke ( [ & header ] ( int , void * buffer , size_t length , int ) - > Api : : SysCallSizeResult { <nl> + ASSERT ( length > = header . size ( ) ) ; <nl> + memcpy ( buffer , header . data ( ) , header . size ( ) ) ; <nl> + return Api : : SysCallSizeResult { ssize_t ( header . size ( ) ) , 0 } ; <nl> + } ) ) ; <nl> + <nl> + EXPECT_CALL ( socket_ , setRequestedApplicationProtocols ( _ ) ) . Times ( 0 ) ; <nl> + EXPECT_CALL ( cb_ , continueFilterChain ( true ) ) ; <nl> + file_event_callback_ ( Event : : FileReadyType : : Read ) ; <nl> + EXPECT_EQ ( 1 , cfg_ - > stats ( ) . http_not_found_ . value ( ) ) ; <nl> + } <nl> + <nl> + TEST_F ( HttpInspectorTest , UnsupportedHttpProtocol ) { <nl> + init ( ) ; <nl> + absl : : string_view header = " GET / anything HTTP / 0 . 9 \ r \ n " ; <nl> + <nl> + EXPECT_CALL ( os_sys_calls_ , recv ( 42 , _ , _ , MSG_PEEK ) ) <nl> + . WillOnce ( Invoke ( [ & header ] ( int , void * buffer , size_t length , int ) - > Api : : SysCallSizeResult { <nl> + ASSERT ( length > = header . size ( ) ) ; <nl> + memcpy ( buffer , header . data ( ) , header . size ( ) ) ; <nl> + return Api : : SysCallSizeResult { ssize_t ( header . size ( ) ) , 0 } ; <nl> + } ) ) ; <nl> + <nl> + EXPECT_CALL ( socket_ , setRequestedApplicationProtocols ( _ ) ) . Times ( 0 ) ; <nl> + EXPECT_CALL ( cb_ , continueFilterChain ( true ) ) ; <nl> + file_event_callback_ ( Event : : FileReadyType : : Read ) ; <nl> + EXPECT_EQ ( 1 , cfg_ - > stats ( ) . http_not_found_ . value ( ) ) ; <nl> + } <nl> + <nl> + TEST_F ( HttpInspectorTest , InvalidRequestLine ) { <nl> + init ( ) ; <nl> + absl : : string_view header = " GET / anything HTTP / 1 . 1 BadRequestLine \ r \ n " ; <nl> + <nl> + EXPECT_CALL ( os_sys_calls_ , recv ( 42 , _ , _ , MSG_PEEK ) ) <nl> + . WillOnce ( Invoke ( [ & header ] ( int , void * buffer , size_t length , int ) - > Api : : SysCallSizeResult { <nl> + ASSERT ( length > = header . size ( ) ) ; <nl> + memcpy ( buffer , header . data ( ) , header . size ( ) ) ; <nl> + return Api : : SysCallSizeResult { ssize_t ( header . size ( ) ) , 0 } ; <nl> + } ) ) ; <nl> + <nl> + EXPECT_CALL ( socket_ , setRequestedApplicationProtocols ( _ ) ) . Times ( 0 ) ; <nl> + EXPECT_CALL ( cb_ , continueFilterChain ( true ) ) ; <nl> + file_event_callback_ ( Event : : FileReadyType : : Read ) ; <nl> + EXPECT_EQ ( 1 , cfg_ - > stats ( ) . http_not_found_ . value ( ) ) ; <nl> + } <nl> + <nl> + TEST_F ( HttpInspectorTest , InspectHttp2 ) { <nl> + init ( ) ; <nl> + <nl> + std : : string header = <nl> + " 505249202a20485454502f322e300d0a0d0a534d0d0a0d0a00000c04000000000000041000000000020000000000 " <nl> + " 00040800000000000fff000100007d010500000001418aa0e41d139d09b8f0000f048860757a4ce6aa660582867a " <nl> + " 8825b650c3abb8d2e053032a2f2a408df2b4a7b3c0ec90b22d5d8749ff839d29af4089f2b585ed6950958d279a18 " <nl> + " 9e03f1ca5582265f59a75b0ac3111959c7e49004908db6e83f4096f2b16aee7f4b17cd65224b22d6765926a4a7b5 " <nl> + " 2b528f840b60003f " ; <nl> + std : : vector < uint8_t > data = Hex : : decode ( header ) ; <nl> + <nl> + EXPECT_CALL ( os_sys_calls_ , recv ( 42 , _ , _ , MSG_PEEK ) ) <nl> + . WillOnce ( Invoke ( [ & data ] ( int , void * buffer , size_t length , int ) - > Api : : SysCallSizeResult { <nl> + ASSERT ( length > = data . size ( ) ) ; <nl> + memcpy ( buffer , data . data ( ) , data . size ( ) ) ; <nl> + return Api : : SysCallSizeResult { ssize_t ( data . size ( ) ) , 0 } ; <nl> + } ) ) ; <nl> + <nl> + const std : : vector < absl : : string_view > alpn_protos { absl : : string_view ( " h2 " ) } ; <nl> + <nl> + EXPECT_CALL ( socket_ , setRequestedApplicationProtocols ( alpn_protos ) ) ; <nl> + EXPECT_CALL ( cb_ , continueFilterChain ( true ) ) ; <nl> + file_event_callback_ ( Event : : FileReadyType : : Read ) ; <nl> + EXPECT_EQ ( 1 , cfg_ - > stats ( ) . http2_found_ . value ( ) ) ; <nl> + } <nl> + <nl> + TEST_F ( HttpInspectorTest , InvalidConnectionPreface ) { <nl> + init ( ) ; <nl> + <nl> + std : : string header = " 505249202a20485454502f322e300d0a " ; <nl> + std : : vector < uint8_t > data = Hex : : decode ( header ) ; <nl> + <nl> + EXPECT_CALL ( os_sys_calls_ , recv ( 42 , _ , _ , MSG_PEEK ) ) <nl> + . WillOnce ( Invoke ( [ & data ] ( int , void * buffer , size_t length , int ) - > Api : : SysCallSizeResult { <nl> + ASSERT ( length > = data . size ( ) ) ; <nl> + memcpy ( buffer , data . data ( ) , data . size ( ) ) ; <nl> + return Api : : SysCallSizeResult { ssize_t ( data . size ( ) ) , 0 } ; <nl> + } ) ) ; <nl> + <nl> + EXPECT_CALL ( socket_ , setRequestedApplicationProtocols ( _ ) ) . Times ( 0 ) ; <nl> + EXPECT_CALL ( cb_ , continueFilterChain ( true ) ) ; <nl> + file_event_callback_ ( Event : : FileReadyType : : Read ) ; <nl> + EXPECT_EQ ( 1 , cfg_ - > stats ( ) . http_not_found_ . value ( ) ) ; <nl> + } <nl> + <nl> + TEST_F ( HttpInspectorTest , ReadError ) { <nl> + init ( ) ; <nl> + <nl> + EXPECT_CALL ( os_sys_calls_ , recv ( 42 , _ , _ , MSG_PEEK ) ) . WillOnce ( InvokeWithoutArgs ( [ ] ( ) { <nl> + return Api : : SysCallSizeResult { ssize_t ( - 1 ) , ENOTSUP } ; <nl> + } ) ) ; <nl> + EXPECT_CALL ( cb_ , continueFilterChain ( true ) ) ; <nl> + file_event_callback_ ( Event : : FileReadyType : : Read ) ; <nl> + EXPECT_EQ ( 1 , cfg_ - > stats ( ) . read_error_ . value ( ) ) ; <nl> + } <nl> + <nl> + TEST_F ( HttpInspectorTest , MultipleReads ) { <nl> + <nl> + init ( ) ; <nl> + const std : : vector < absl : : string_view > alpn_protos = { absl : : string_view ( " h2 " ) } ; <nl> + <nl> + const std : : string header = <nl> + " 505249202a20485454502f322e300d0a0d0a534d0d0a0d0a00000c04000000000000041000000000020000000000 " <nl> + " 00040800000000000fff000100007d010500000001418aa0e41d139d09b8f0000f048860757a4ce6aa660582867a " <nl> + " 8825b650c3abb8d2e053032a2f2a408df2b4a7b3c0ec90b22d5d8749ff839d29af4089f2b585ed6950958d279a18 " <nl> + " 9e03f1ca5582265f59a75b0ac3111959c7e49004908db6e83f4096f2b16aee7f4b17cd65224b22d6765926a4a7b5 " <nl> + " 2b528f840b60003f " ; <nl> + const std : : vector < uint8_t > data = Hex : : decode ( header ) ; <nl> + { <nl> + InSequence s ; <nl> + <nl> + EXPECT_CALL ( os_sys_calls_ , recv ( 42 , _ , _ , MSG_PEEK ) ) . WillOnce ( InvokeWithoutArgs ( [ ] ( ) { <nl> + return Api : : SysCallSizeResult { ssize_t ( - 1 ) , EAGAIN } ; <nl> + } ) ) ; <nl> + EXPECT_CALL ( os_sys_calls_ , recv ( 42 , _ , _ , MSG_PEEK ) ) <nl> + . WillOnce ( Invoke ( [ & data ] ( int , void * buffer , size_t length , int ) - > Api : : SysCallSizeResult { <nl> + ASSERT ( length > = data . size ( ) ) ; <nl> + memcpy ( buffer , data . data ( ) , data . size ( ) ) ; <nl> + return Api : : SysCallSizeResult { ssize_t ( data . size ( ) ) , 0 } ; <nl> + } ) ) ; <nl> + } <nl> + <nl> + bool got_continue = false ; <nl> + EXPECT_CALL ( socket_ , setRequestedApplicationProtocols ( alpn_protos ) ) ; <nl> + EXPECT_CALL ( cb_ , continueFilterChain ( true ) ) . WillOnce ( InvokeWithoutArgs ( [ & got_continue ] ( ) { <nl> + got_continue = true ; <nl> + } ) ) ; <nl> + while ( ! got_continue ) { <nl> + file_event_callback_ ( Event : : FileReadyType : : Read ) ; <nl> + } <nl> + EXPECT_EQ ( 1 , cfg_ - > stats ( ) . http2_found_ . value ( ) ) ; <nl> + } <nl> + <nl> + } / / namespace <nl> + } / / namespace HttpInspector <nl> + } / / namespace ListenerFilters <nl> + } / / namespace Extensions <nl> + } / / namespace Envoy <nl> mmm a / tools / spelling_dictionary . txt <nl> ppp b / tools / spelling_dictionary . txt <nl> XDS <nl> decRefCount <nl> getaddrinfo <nl> sendto <nl> + ssize <nl> upcasts <nl> vip <nl> xDSes <nl>
listener filter : new listener filter for inspecting http protocol ( )
envoyproxy/envoy
c2967a82c9e55dd77bbbc932e4907b204b87cb45
2019-07-19T17:47:40Z
mmm a / db / jsobj . cpp <nl> ppp b / db / jsobj . cpp <nl> namespace mongo { <nl> case Bool : appendBool ( field . c_str ( ) , false ) ; return ; <nl> case Date : appendDate ( field . c_str ( ) , 0 ) ; return ; <nl> case jstNULL : appendNull ( field . c_str ( ) ) ; return ; <nl> + case Symbol : <nl> case String : append ( field . c_str ( ) , " " ) ; return ; <nl> case Object : append ( field . c_str ( ) , BSONObj ( ) ) ; return ; <nl> case Array : <nl> namespace mongo { <nl> return ; <nl> } <nl> case Code : appendCode ( field . c_str ( ) , " " ) ; return ; <nl> - case Symbol : appendSymbol ( field . c_str ( ) , " " ) ; return ; <nl> case CodeWScope : appendCodeWScope ( field . c_str ( ) , " " , BSONObj ( ) ) ; return ; <nl> case Timestamp : appendTimestamp ( field . c_str ( ) , 0 ) ; return ; <nl> <nl> namespace mongo { <nl> } <nl> case Bool : appendBool ( field . c_str ( ) , true ) ; break ; <nl> case Date : appendDate ( field . c_str ( ) , 0xFFFFFFFFFFFFFFFFLL ) ; break ; <nl> + case Symbol : <nl> case String : append ( field . c_str ( ) , BSONObj ( ) ) ; break ; <nl> + case Code : <nl> + case CodeWScope : <nl> + appendMinForType ( field , Timestamp ) ; break ; <nl> case Timestamp : <nl> appendTimestamp ( field . c_str ( ) , numeric_limits < unsigned long long > : : max ( ) ) ; break ; <nl> default : <nl>
fallout from Symbol change
mongodb/mongo
157df4a2ccce0b4d49e8996cb6f287fd58c8fcb6
2009-08-27T14:09:55Z
mmm a / hphp / runtime / ext / reflection / ext_reflection - classes . php <nl> ppp b / hphp / runtime / ext / reflection / ext_reflection - classes . php <nl> public function isDefaultValueConstant ( ) : ? bool { <nl> / / If there is a default value , then there has to be defaultText <nl> / / If the defaultText is a class constant , then classname will be <nl> / / associated with the text , so you can use defined for that as well . <nl> + / / Exception here - - if this is in a closure , then it will return false <nl> + / / PHP fatals on closures and getting default values , we will just <nl> + / / return false . <nl> return defined ( $ this - > info [ ' defaultText ' ] ) ; <nl> } <nl> <nl> public function getDefaultValue ( ) { <nl> } <nl> <nl> / * * <nl> - * @ deprecated <nl> + * This is an HHVM only function that gets the raw text associated with <nl> + * a default parameter . <nl> + * <nl> + * For example , for : <nl> + * function foo ( $ x = FOO * FOO ) <nl> + * <nl> + * " FOO * FOO " is returned . <nl> + * <nl> + * getDefaultValue ( ) will return the result of FOO * FOO . <nl> + * <nl> + * @ return string The raw text of a default value , or empty if it does not <nl> + * exist . <nl> * / <nl> public function getDefaultValueText ( ) { <nl> - return $ this - > getDefaultValueConstantName ( ) ; <nl> + if ( array_key_exists ( ' defaultText ' , $ this - > info ) ) { <nl> + return $ this - > info [ ' defaultText ' ] ; <nl> + } <nl> + <nl> + return ' ' ; <nl> } <nl> <nl> - / / This doc comment block generated by idl / sysdoc . php <nl> / * * <nl> * ( excerpt from <nl> - * http : / / php . net / manual / en / reflectionparameter . getdefaultvalueconstantname . php <nl> + * php . net / manual / en / reflectionparameter . getdefaultvalueconstantname . php <nl> * ) <nl> * <nl> - * Warning : This function is currently not documented ; only its argument <nl> - * list is available . <nl> + * Returns the default value ' s constant name if default value is constant or <nl> + * null <nl> * <nl> * @ return mixed Returns string on success or NULL on failure . <nl> * / <nl> public function getDefaultValueConstantName ( ) { <nl> - if ( array_key_exists ( ' defaultText ' , $ this - > info ) ) { <nl> + if ( $ this - > isDefaultValueConstant ( ) ) { <nl> return $ this - > info [ ' defaultText ' ] ; <nl> } <nl> - <nl> - return ' ' ; <nl> + return null ; <nl> } <nl> <nl> / / This doc comment block generated by idl / sysdoc . php <nl> mmm a / hphp / test / slow / namespace / const_param . php <nl> ppp b / hphp / test / slow / namespace / const_param . php <nl> function j ( $ k = PHP_VERSION , $ l = B , $ m = array ( PHP_VERSION ) , $ n = array ( B ) ) { <nl> foreach ( $ params as $ param ) { <nl> var_dump ( <nl> $ param - > getDefaultValue ( ) , <nl> + $ param - > getDefaultValueText ( ) , <nl> $ param - > getDefaultValueConstantName ( ) <nl> ) ; <nl> } <nl> mmm a / hphp / test / slow / namespace / const_param . php . expect <nl> ppp b / hphp / test / slow / namespace / const_param . php . expect <nl> <nl> string ( 11 ) " 5 . 6 . 99 - hhvm " <nl> string ( 11 ) " PHP_VERSION " <nl> + string ( 11 ) " PHP_VERSION " <nl> string ( 1 ) " c " <nl> string ( 1 ) " B " <nl> + NULL <nl> array ( 1 ) { <nl> [ 0 ] = > <nl> string ( 11 ) " 5 . 6 . 99 - hhvm " <nl> } <nl> string ( 18 ) " array ( PHP_VERSION ) " <nl> + NULL <nl> array ( 1 ) { <nl> [ 0 ] = > <nl> string ( 1 ) " c " <nl> } <nl> string ( 8 ) " array ( B ) " <nl> + NULL <nl> string ( 11 ) " 5 . 6 . 99 - hhvm " <nl> string ( 11 ) " PHP_VERSION " <nl> + string ( 11 ) " PHP_VERSION " <nl> string ( 1 ) " c " <nl> string ( 1 ) " B " <nl> + NULL <nl> array ( 1 ) { <nl> [ 0 ] = > <nl> string ( 11 ) " 5 . 6 . 99 - hhvm " <nl> } <nl> string ( 18 ) " array ( PHP_VERSION ) " <nl> + NULL <nl> array ( 1 ) { <nl> [ 0 ] = > <nl> string ( 1 ) " c " <nl> } <nl> string ( 8 ) " array ( B ) " <nl> + NULL <nl> mmm a / hphp / test / slow / namespace / const_param . php . expect - repo <nl> ppp b / hphp / test / slow / namespace / const_param . php . expect - repo <nl> <nl> string ( 11 ) " 5 . 6 . 99 - hhvm " <nl> string ( 11 ) " PHP_VERSION " <nl> + string ( 11 ) " PHP_VERSION " <nl> string ( 1 ) " c " <nl> string ( 1 ) " B " <nl> + NULL <nl> array ( 1 ) { <nl> [ 0 ] = > <nl> string ( 11 ) " 5 . 6 . 99 - hhvm " <nl> array ( 1 ) { <nl> string ( 31 ) " array ( <nl> 0 = > " 5 . 6 . 99 - hhvm " , <nl> ) " <nl> + NULL <nl> array ( 1 ) { <nl> [ 0 ] = > <nl> string ( 1 ) " c " <nl> array ( 1 ) { <nl> string ( 21 ) " array ( <nl> 0 = > " c " , <nl> ) " <nl> + NULL <nl> string ( 11 ) " 5 . 6 . 99 - hhvm " <nl> string ( 11 ) " PHP_VERSION " <nl> + string ( 11 ) " PHP_VERSION " <nl> string ( 1 ) " c " <nl> string ( 1 ) " B " <nl> + NULL <nl> array ( 1 ) { <nl> [ 0 ] = > <nl> string ( 11 ) " 5 . 6 . 99 - hhvm " <nl> array ( 1 ) { <nl> string ( 31 ) " array ( <nl> 0 = > " 5 . 6 . 99 - hhvm " , <nl> ) " <nl> + NULL <nl> array ( 1 ) { <nl> [ 0 ] = > <nl> string ( 1 ) " c " <nl> array ( 1 ) { <nl> string ( 21 ) " array ( <nl> 0 = > " c " , <nl> ) " <nl> + NULL <nl> new file mode 100644 <nl> index 00000000000 . . f269daa6af0 <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / reflection / ReflectionParameter - basic . php <nl> <nl> + < ? hh <nl> + function foo ( string $ a , int $ b , float $ c , bool $ d , Exception & $ e , <nl> + callable $ f = null , resource $ g = null , $ noType = ' whatever ' ) { } <nl> + <nl> + $ reflectionFunction = new ReflectionFunction ( ' foo ' ) ; <nl> + foreach ( $ reflectionFunction - > getParameters ( ) as $ parameter ) { <nl> + echo ' name : ' ; <nl> + var_dump ( $ parameter - > getName ( ) ) ; <nl> + echo ' position : ' ; <nl> + var_dump ( $ parameter - > getPosition ( ) ) ; <nl> + echo ' canBePassedByValue : ' ; <nl> + var_dump ( $ parameter - > canBePassedByValue ( ) ) ; <nl> + echo ' isPassedByReference : ' ; <nl> + var_dump ( $ parameter - > isPassedByReference ( ) ) ; <nl> + echo ' hasType : ' ; <nl> + var_dump ( $ parameter - > hasType ( ) ) ; <nl> + echo ' getType : ' ; <nl> + var_dump ( $ parameter - > getType ( ) ) ; <nl> + echo ' type isBuiltin : ' ; <nl> + var_dump ( $ parameter - > hasType ( ) ? $ parameter - > getType ( ) - > isBuiltin ( ) : false ) ; <nl> + echo ' type allowsNull : ' ; <nl> + var_dump ( $ parameter - > hasType ( ) ? $ parameter - > getType ( ) - > allowsNull ( ) : false ) ; <nl> + echo ' type hint : ' ; <nl> + var_dump ( $ parameter - > hasType ( ) ? $ parameter - > getType ( ) - > __toString ( ) : false ) ; <nl> + echo ' isArray : ' ; <nl> + var_dump ( $ parameter - > isArray ( ) ) ; <nl> + echo ' isCallable : ' ; <nl> + var_dump ( $ parameter - > isCallable ( ) ) ; <nl> + echo ' isOptional : ' ; <nl> + var_dump ( $ parameter - > isOptional ( ) ) ; <nl> + echo ' isVariadic : ' ; <nl> + var_dump ( $ parameter - > isVariadic ( ) ) ; <nl> + echo ' allowsNull : ' ; <nl> + var_dump ( $ parameter - > allowsNull ( ) ) ; <nl> + echo ' isDefaultValueAvailable : ' ; <nl> + var_dump ( $ parameter - > isDefaultValueAvailable ( ) ) ; <nl> + echo ' isDefaultValueConstant : ' ; <nl> + var_dump ( $ parameter - > isDefaultValueAvailable ( ) & & <nl> + $ parameter - > isDefaultValueConstant ( ) ) ; <nl> + echo ' getDefaultValue : ' ; <nl> + var_dump ( $ parameter - > isDefaultValueAvailable ( ) <nl> + ? $ parameter - > getDefaultValue ( ) <nl> + : ' no default value ' ) ; <nl> + echo ' getDefaultValueConstantName : ' ; <nl> + var_dump ( $ parameter - > isDefaultValueAvailable ( ) <nl> + ? $ parameter - > getDefaultValueConstantName ( ) <nl> + : ' no default value ' ) ; <nl> + echo PHP_EOL , PHP_EOL ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 5a2bc83f466 <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / reflection / ReflectionParameter - basic . php . expectf <nl> <nl> + name : string ( 1 ) " a " <nl> + position : int ( 0 ) <nl> + canBePassedByValue : bool ( true ) <nl> + isPassedByReference : bool ( false ) <nl> + hasType : bool ( true ) <nl> + getType : object ( ReflectionType ) # % d ( 1 ) { <nl> + [ " type_hint_info " : " ReflectionType " : private ] = > <nl> + array ( 3 ) { <nl> + [ " name " ] = > <nl> + string ( 9 ) " HH \ string " <nl> + [ " nullable " ] = > <nl> + bool ( false ) <nl> + [ " builtin " ] = > <nl> + bool ( true ) <nl> + } <nl> + } <nl> + type isBuiltin : bool ( true ) <nl> + type allowsNull : bool ( false ) <nl> + type hint : string ( 9 ) " HH \ string " <nl> + isArray : bool ( false ) <nl> + isCallable : bool ( false ) <nl> + isOptional : bool ( false ) <nl> + isVariadic : bool ( false ) <nl> + allowsNull : bool ( false ) <nl> + isDefaultValueAvailable : bool ( false ) <nl> + isDefaultValueConstant : bool ( false ) <nl> + getDefaultValue : string ( 16 ) " no default value " <nl> + getDefaultValueConstantName : string ( 16 ) " no default value " <nl> + <nl> + <nl> + name : string ( 1 ) " b " <nl> + position : int ( 1 ) <nl> + canBePassedByValue : bool ( true ) <nl> + isPassedByReference : bool ( false ) <nl> + hasType : bool ( true ) <nl> + getType : object ( ReflectionType ) # % d ( 1 ) { <nl> + [ " type_hint_info " : " ReflectionType " : private ] = > <nl> + array ( 3 ) { <nl> + [ " name " ] = > <nl> + string ( 6 ) " HH \ int " <nl> + [ " nullable " ] = > <nl> + bool ( false ) <nl> + [ " builtin " ] = > <nl> + bool ( true ) <nl> + } <nl> + } <nl> + type isBuiltin : bool ( true ) <nl> + type allowsNull : bool ( false ) <nl> + type hint : string ( 6 ) " HH \ int " <nl> + isArray : bool ( false ) <nl> + isCallable : bool ( false ) <nl> + isOptional : bool ( false ) <nl> + isVariadic : bool ( false ) <nl> + allowsNull : bool ( false ) <nl> + isDefaultValueAvailable : bool ( false ) <nl> + isDefaultValueConstant : bool ( false ) <nl> + getDefaultValue : string ( 16 ) " no default value " <nl> + getDefaultValueConstantName : string ( 16 ) " no default value " <nl> + <nl> + <nl> + name : string ( 1 ) " c " <nl> + position : int ( 2 ) <nl> + canBePassedByValue : bool ( true ) <nl> + isPassedByReference : bool ( false ) <nl> + hasType : bool ( true ) <nl> + getType : object ( ReflectionType ) # % d ( 1 ) { <nl> + [ " type_hint_info " : " ReflectionType " : private ] = > <nl> + array ( 3 ) { <nl> + [ " name " ] = > <nl> + string ( 8 ) " HH \ float " <nl> + [ " nullable " ] = > <nl> + bool ( false ) <nl> + [ " builtin " ] = > <nl> + bool ( true ) <nl> + } <nl> + } <nl> + type isBuiltin : bool ( true ) <nl> + type allowsNull : bool ( false ) <nl> + type hint : string ( 8 ) " HH \ float " <nl> + isArray : bool ( false ) <nl> + isCallable : bool ( false ) <nl> + isOptional : bool ( false ) <nl> + isVariadic : bool ( false ) <nl> + allowsNull : bool ( false ) <nl> + isDefaultValueAvailable : bool ( false ) <nl> + isDefaultValueConstant : bool ( false ) <nl> + getDefaultValue : string ( 16 ) " no default value " <nl> + getDefaultValueConstantName : string ( 16 ) " no default value " <nl> + <nl> + <nl> + name : string ( 1 ) " d " <nl> + position : int ( 3 ) <nl> + canBePassedByValue : bool ( true ) <nl> + isPassedByReference : bool ( false ) <nl> + hasType : bool ( true ) <nl> + getType : object ( ReflectionType ) # % d ( 1 ) { <nl> + [ " type_hint_info " : " ReflectionType " : private ] = > <nl> + array ( 3 ) { <nl> + [ " name " ] = > <nl> + string ( 7 ) " HH \ bool " <nl> + [ " nullable " ] = > <nl> + bool ( false ) <nl> + [ " builtin " ] = > <nl> + bool ( true ) <nl> + } <nl> + } <nl> + type isBuiltin : bool ( true ) <nl> + type allowsNull : bool ( false ) <nl> + type hint : string ( 7 ) " HH \ bool " <nl> + isArray : bool ( false ) <nl> + isCallable : bool ( false ) <nl> + isOptional : bool ( false ) <nl> + isVariadic : bool ( false ) <nl> + allowsNull : bool ( false ) <nl> + isDefaultValueAvailable : bool ( false ) <nl> + isDefaultValueConstant : bool ( false ) <nl> + getDefaultValue : string ( 16 ) " no default value " <nl> + getDefaultValueConstantName : string ( 16 ) " no default value " <nl> + <nl> + <nl> + name : string ( 1 ) " e " <nl> + position : int ( 4 ) <nl> + canBePassedByValue : bool ( false ) <nl> + isPassedByReference : bool ( true ) <nl> + hasType : bool ( true ) <nl> + getType : object ( ReflectionType ) # % d ( 1 ) { <nl> + [ " type_hint_info " : " ReflectionType " : private ] = > <nl> + array ( 3 ) { <nl> + [ " name " ] = > <nl> + string ( 9 ) " Exception " <nl> + [ " nullable " ] = > <nl> + bool ( false ) <nl> + [ " builtin " ] = > <nl> + bool ( false ) <nl> + } <nl> + } <nl> + type isBuiltin : bool ( false ) <nl> + type allowsNull : bool ( false ) <nl> + type hint : string ( 9 ) " Exception " <nl> + isArray : bool ( false ) <nl> + isCallable : bool ( false ) <nl> + isOptional : bool ( false ) <nl> + isVariadic : bool ( false ) <nl> + allowsNull : bool ( false ) <nl> + isDefaultValueAvailable : bool ( false ) <nl> + isDefaultValueConstant : bool ( false ) <nl> + getDefaultValue : string ( 16 ) " no default value " <nl> + getDefaultValueConstantName : string ( 16 ) " no default value " <nl> + <nl> + <nl> + name : string ( 1 ) " f " <nl> + position : int ( 5 ) <nl> + canBePassedByValue : bool ( true ) <nl> + isPassedByReference : bool ( false ) <nl> + hasType : bool ( true ) <nl> + getType : object ( ReflectionType ) # % d ( 1 ) { <nl> + [ " type_hint_info " : " ReflectionType " : private ] = > <nl> + array ( 3 ) { <nl> + [ " name " ] = > <nl> + string ( 8 ) " callable " <nl> + [ " nullable " ] = > <nl> + bool ( true ) <nl> + [ " builtin " ] = > <nl> + bool ( true ) <nl> + } <nl> + } <nl> + type isBuiltin : bool ( true ) <nl> + type allowsNull : bool ( true ) <nl> + type hint : string ( 8 ) " callable " <nl> + isArray : bool ( false ) <nl> + isCallable : bool ( true ) <nl> + isOptional : bool ( true ) <nl> + isVariadic : bool ( false ) <nl> + allowsNull : bool ( true ) <nl> + isDefaultValueAvailable : bool ( true ) <nl> + isDefaultValueConstant : bool ( true ) <nl> + getDefaultValue : NULL <nl> + getDefaultValueConstantName : string ( 4 ) " NULL " <nl> + <nl> + <nl> + name : string ( 1 ) " g " <nl> + position : int ( 6 ) <nl> + canBePassedByValue : bool ( true ) <nl> + isPassedByReference : bool ( false ) <nl> + hasType : bool ( true ) <nl> + getType : object ( ReflectionType ) # % d ( 1 ) { <nl> + [ " type_hint_info " : " ReflectionType " : private ] = > <nl> + array ( 3 ) { <nl> + [ " name " ] = > <nl> + string ( 11 ) " HH \ resource " <nl> + [ " nullable " ] = > <nl> + bool ( true ) <nl> + [ " builtin " ] = > <nl> + bool ( true ) <nl> + } <nl> + } <nl> + type isBuiltin : bool ( true ) <nl> + type allowsNull : bool ( true ) <nl> + type hint : string ( 11 ) " HH \ resource " <nl> + isArray : bool ( false ) <nl> + isCallable : bool ( false ) <nl> + isOptional : bool ( true ) <nl> + isVariadic : bool ( false ) <nl> + allowsNull : bool ( true ) <nl> + isDefaultValueAvailable : bool ( true ) <nl> + isDefaultValueConstant : bool ( true ) <nl> + getDefaultValue : NULL <nl> + getDefaultValueConstantName : string ( 4 ) " NULL " <nl> + <nl> + <nl> + name : string ( 6 ) " noType " <nl> + position : int ( 7 ) <nl> + canBePassedByValue : bool ( true ) <nl> + isPassedByReference : bool ( false ) <nl> + hasType : bool ( false ) <nl> + getType : NULL <nl> + type isBuiltin : bool ( false ) <nl> + type allowsNull : bool ( false ) <nl> + type hint : bool ( false ) <nl> + isArray : bool ( false ) <nl> + isCallable : bool ( false ) <nl> + isOptional : bool ( true ) <nl> + isVariadic : bool ( false ) <nl> + allowsNull : bool ( true ) <nl> + isDefaultValueAvailable : bool ( true ) <nl> + isDefaultValueConstant : bool ( false ) <nl> + getDefaultValue : string ( 8 ) " whatever " <nl> + getDefaultValueConstantName : NULL <nl> mmm a / hphp / test / slow / reflection / closure_namespace . php <nl> ppp b / hphp / test / slow / reflection / closure_namespace . php <nl> function main ( ) { <nl> var_dump ( $ rp - > getDeclaringFunction ( ) - > getDeclaringClass ( ) - > getName ( ) ) ; <nl> var_dump ( $ rp - > getDeclaringClass ( ) - > getName ( ) ) ; <nl> var_dump ( $ rp - > getDefaultValue ( ) ) ; <nl> - var_dump ( $ rp - > getDefaultValueConstantName ( ) ) ; <nl> + var_dump ( $ rp - > getDefaultValueText ( ) ) ; <nl> + var_dump ( $ rp - > getDefaultValueConstantName ( ) ) ; / / returning NULL for closures <nl> } <nl> <nl> main ( ) ; <nl> mmm a / hphp / test / slow / reflection / closure_namespace . php . expectf <nl> ppp b / hphp / test / slow / reflection / closure_namespace . php . expectf <nl> string ( % d ) " Closure $ Foo \ Bar \ C : : func ; % d " <nl> string ( % d ) " Closure $ Foo \ Bar \ C : : func ; % d " <nl> int ( 2 ) <nl> string ( 3 ) " BAZ " <nl> + NULL <nl> mmm a / hphp / test / slow / reflection / get_default_constant_name . php <nl> ppp b / hphp / test / slow / reflection / get_default_constant_name . php <nl> function test ( $ param ) { <nl> $ r = new ReflectionParameter ( ' params ' , $ param ) ; <nl> <nl> var_dump ( $ r - > getDefaultValue ( ) ) ; <nl> + var_dump ( $ r - > getDefaultValueText ( ) ) ; <nl> var_dump ( $ r - > getDefaultValueConstantName ( ) ) ; <nl> } <nl> <nl> mmm a / hphp / test / slow / reflection / get_default_constant_name . php . expect <nl> ppp b / hphp / test / slow / reflection / get_default_constant_name . php . expect <nl> <nl> int ( 1 ) <nl> string ( 3 ) " ONE " <nl> + string ( 3 ) " ONE " <nl> int ( 4 ) <nl> string ( 9 ) " TWO * TWO " <nl> + NULL <nl> int ( 10 ) <nl> string ( 7 ) " TWO * 5 " <nl> + NULL <nl> mmm a / hphp / test / slow / reflection_classes / default_value_with_namespace . php <nl> ppp b / hphp / test / slow / reflection_classes / default_value_with_namespace . php <nl> function f ( $ k = \ B \ SORT_NUMERIC ) { var_dump ( $ k ) ; } <nl> echo " A \ \ $ func reflection : \ n " ; <nl> $ rc = new ReflectionFunction ( " A \ \ $ func " ) ; <nl> var_dump ( $ rc - > getParameters ( ) [ 0 ] - > getDefaultValue ( ) ) ; <nl> + var_dump ( $ rc - > getParameters ( ) [ 0 ] - > getDefaultValueText ( ) ) ; <nl> var_dump ( $ rc - > getParameters ( ) [ 0 ] - > getDefaultValueConstantName ( ) ) ; <nl> echo " \ n " ; <nl> echo " A \ \ $ func call : \ n " ; <nl> mmm a / hphp / test / slow / reflection_classes / default_value_with_namespace . php . expect <nl> ppp b / hphp / test / slow / reflection_classes / default_value_with_namespace . php . expect <nl> <nl> A \ a reflection : <nl> int ( 0 ) <nl> string ( 12 ) " SORT_REGULAR " <nl> + string ( 12 ) " SORT_REGULAR " <nl> <nl> A \ a call : <nl> int ( 0 ) <nl> int ( 0 ) <nl> A \ b reflection : <nl> int ( 42 ) <nl> string ( 12 ) " SORT_NUMERIC " <nl> + string ( 12 ) " SORT_NUMERIC " <nl> <nl> A \ b call : <nl> int ( 42 ) <nl> int ( 42 ) <nl> A \ c reflection : <nl> int ( 0 ) <nl> string ( 13 ) " \ SORT_REGULAR " <nl> + string ( 13 ) " \ SORT_REGULAR " <nl> <nl> A \ c call : <nl> int ( 0 ) <nl> int ( 0 ) <nl> A \ d reflection : <nl> int ( 1 ) <nl> string ( 13 ) " \ SORT_NUMERIC " <nl> + string ( 13 ) " \ SORT_NUMERIC " <nl> <nl> A \ d call : <nl> int ( 1 ) <nl> int ( 1 ) <nl> A \ e reflection : <nl> string ( 7 ) " A \ B val " <nl> string ( 17 ) " \ A \ B \ SORT_NUMERIC " <nl> + string ( 17 ) " \ A \ B \ SORT_NUMERIC " <nl> <nl> A \ e call : <nl> string ( 7 ) " A \ B val " <nl> string ( 7 ) " A \ B val " <nl> A \ f reflection : <nl> string ( 5 ) " B val " <nl> string ( 15 ) " \ B \ SORT_NUMERIC " <nl> + string ( 15 ) " \ B \ SORT_NUMERIC " <nl> <nl> A \ f call : <nl> string ( 5 ) " B val " <nl> mmm a / hphp / test / slow / reflection_classes / default_value_with_namespace2 . php <nl> ppp b / hphp / test / slow / reflection_classes / default_value_with_namespace2 . php <nl> function main ( ) { <nl> echo " reflection : \ n " ; <nl> $ rc = ( new \ ReflectionClass ( " Foo \ \ Derived " ) ) - > getMethod ( ' set ' ) ; <nl> var_dump ( $ rc - > getParameters ( ) [ 0 ] - > getDefaultValue ( ) ) ; <nl> + var_dump ( $ rc - > getParameters ( ) [ 0 ] - > getDefaultValueText ( ) ) ; <nl> var_dump ( $ rc - > getParameters ( ) [ 0 ] - > getDefaultValueConstantName ( ) ) ; <nl> echo " call : \ n " ; <nl> ( new Foo \ Derived ( ) ) - > set ( ) ; <nl> mmm a / hphp / test / slow / reflection_classes / default_value_with_namespace2 . php . expect <nl> ppp b / hphp / test / slow / reflection_classes / default_value_with_namespace2 . php . expect <nl> array ( 3 ) { <nl> string ( 3 ) " foo " <nl> } <nl> string ( 65 ) " array ( SORT_NUMERIC , array ( \ Foo \ Derived : : NUM ) , \ Foo \ Bar \ Base : : STR ) " <nl> + NULL <nl> call : <nl> array ( 3 ) { <nl> [ 0 ] = > <nl> mmm a / hphp / test / slow / reflection_classes / default_value_with_namespace2 . php . expect - repo <nl> ppp b / hphp / test / slow / reflection_classes / default_value_with_namespace2 . php . expect - repo <nl> string ( 71 ) " array ( <nl> ) , <nl> 2 = > " foo " , <nl> ) " <nl> + NULL <nl> call : <nl> array ( 3 ) { <nl> [ 0 ] = > <nl> array ( 3 ) { <nl> } <nl> [ 2 ] = > <nl> string ( 3 ) " foo " <nl> - } <nl> \ No newline at end of file <nl> + } <nl> mmm a / hphp / test / slow / reflection_classes / default_value_with_namespace3 . php <nl> ppp b / hphp / test / slow / reflection_classes / default_value_with_namespace3 . php <nl> function foo ( $ k = I : : SORT_NUMERIC ) { var_dump ( $ k ) ; } <nl> echo " reflection : \ n " ; <nl> $ rc = new ReflectionMethod ( ' A \ Bar ' , ' foo ' ) ; <nl> var_dump ( $ rc - > getParameters ( ) [ 0 ] - > getDefaultValue ( ) ) ; <nl> + var_dump ( $ rc - > getParameters ( ) [ 0 ] - > getDefaultValueText ( ) ) ; <nl> var_dump ( $ rc - > getParameters ( ) [ 0 ] - > getDefaultValueConstantName ( ) ) ; <nl> echo " call : \ n " ; <nl> ( new A \ Bar ( ) ) - > foo ( ) ; <nl> mmm a / hphp / test / slow / reflection_classes / default_value_with_namespace3 . php . expect <nl> ppp b / hphp / test / slow / reflection_classes / default_value_with_namespace3 . php . expect <nl> <nl> reflection : <nl> int ( 42 ) <nl> string ( 18 ) " \ A \ I : : SORT_NUMERIC " <nl> + string ( 18 ) " \ A \ I : : SORT_NUMERIC " <nl> call : <nl> int ( 42 ) <nl> mmm a / hphp / test / slow / reflection_classes / default_value_with_self . php <nl> ppp b / hphp / test / slow / reflection_classes / default_value_with_self . php <nl> function main ( ) { <nl> $ rc = new ReflectionClass ( " Foo \ \ Bar \ \ A " ) ; <nl> var_dump ( $ rc - > isInterface ( ) ) ; <nl> var_dump ( $ rc - > getMethod ( ' set ' ) - > getParameters ( ) [ 0 ] - > getDefaultValue ( ) ) ; <nl> + var_dump ( $ rc - > getMethod ( ' set ' ) - > getParameters ( ) [ 0 ] - > getDefaultValueText ( ) ) ; <nl> var_dump ( $ rc - > getMethod ( ' set ' ) - > getParameters ( ) [ 0 ] - > getDefaultValueConstantName ( ) ) ; <nl> <nl> $ rc = new \ ReflectionFunction ( " Foo \ \ Bar \ \ foo " ) ; <nl> var_dump ( $ rc - > getParameters ( ) [ 0 ] - > getDefaultValue ( ) ) ; <nl> + var_dump ( $ rc - > getParameters ( ) [ 0 ] - > getDefaultValueText ( ) ) ; <nl> var_dump ( $ rc - > getParameters ( ) [ 0 ] - > getDefaultValueConstantName ( ) ) ; <nl> Foo \ Bar \ foo ( ) ; <nl> } <nl> mmm a / hphp / test / slow / reflection_classes / default_value_with_self . php . expect <nl> ppp b / hphp / test / slow / reflection_classes / default_value_with_self . php . expect <nl> <nl> bool ( true ) <nl> string ( 9 ) " container " <nl> string ( 27 ) " \ Foo \ Bar \ A : : SCOPE_CONTAINER " <nl> + string ( 27 ) " \ Foo \ Bar \ A : : SCOPE_CONTAINER " <nl> string ( 9 ) " container " <nl> string ( 27 ) " \ Foo \ Bar \ A : : SCOPE_CONTAINER " <nl> + string ( 27 ) " \ Foo \ Bar \ A : : SCOPE_CONTAINER " <nl> string ( 9 ) " container " <nl>
Make ReflectionParameter : : getDefaultValueConstantName compatible with
facebook/hhvm
74259b6d035e16f40c68d542501a7fb3f05bc62a
2016-01-23T02:02:06Z
mmm a / src / apps / EventViewer / Resources / MainMenu . xib <nl> ppp b / src / apps / EventViewer / Resources / MainMenu . xib <nl> <nl> < rect key = " frame " x = " 17 " y = " 10 " width = " 766 " height = " 216 " / > <nl> < clipView key = " contentView " drawsBackground = " NO " id = " OS0 - 60 - iDz " > <nl> < rect key = " frame " x = " 1 " y = " 0 . 0 " width = " 749 " height = " 215 " / > <nl> - < autoresizingMask key = " autoresizingMask " widthSizable = " YES " heightSizable = " YES " / > <nl> + < autoresizingMask key = " autoresizingMask " / > <nl> < subviews > <nl> < tableView focusRingType = " none " verticalHuggingPriority = " 750 " allowsExpansionToolTips = " YES " columnAutoresizingStyle = " lastColumnOnly " alternatingRowBackgroundColors = " YES " columnReordering = " NO " columnResizing = " NO " multipleSelection = " NO " autosaveColumns = " NO " typeSelect = " NO " enabled = " NO " rowHeight = " 14 " headerView = " 565 " id = " 564 " > <nl> < rect key = " frame " x = " 0 . 0 " y = " 0 . 0 " width = " 749 " height = " 192 " / > <nl> <nl> < rect key = " frame " x = " 10 " y = " 10 " width = " 642 " height = " 112 " / > <nl> < clipView key = " contentView " drawsBackground = " NO " id = " Hx6 - 3h - z4E " > <nl> < rect key = " frame " x = " 1 " y = " 1 " width = " 625 " height = " 110 " / > <nl> - < autoresizingMask key = " autoresizingMask " widthSizable = " YES " heightSizable = " YES " / > <nl> + < autoresizingMask key = " autoresizingMask " / > <nl> < subviews > <nl> < textView importsGraphics = " NO " verticallyResizable = " YES " baseWritingDirection = " leftToRight " usesFontPanel = " YES " findStyle = " panel " allowsUndo = " YES " usesRuler = " YES " allowsNonContiguousLayout = " YES " smartInsertDelete = " YES " id = " A4A - YB - ifF " > <nl> < rect key = " frame " x = " 0 . 0 " y = " 0 . 0 " width = " 625 " height = " 110 " / > <nl> You have to allow Karabiner - EventViewer on Security & amp ; Privacy System Prefere <nl> < outlet property = " textView " destination = " pzX - J3 - r2O " id = " lLT - uo - 5zn " / > <nl> < / connections > <nl> < / customObject > <nl> - < customObject id = " 571 " customClass = " EventQueue " > <nl> + < customObject id = " 571 " customClass = " EventQueue " customModule = " Karabiner_EventViewer " > <nl> < connections > <nl> < outlet property = " addSimpleModificationButton " destination = " e5W - WO - Kah " id = " eWW - tb - Yab " / > <nl> < outlet property = " view " destination = " 564 " id = " qxL - 30 - rPh " / > <nl> mmm a / src / apps / EventViewer / src / AppDelegate . m <nl> ppp b / src / apps / EventViewer / src / AppDelegate . m <nl> <nl> @ import Carbon ; <nl> # import " AppDelegate . h " <nl> - # import " EventQueue . h " <nl> # import " KarabinerKit / KarabinerKit . h " <nl> # import " Karabiner_EventViewer - Swift . h " <nl> # import " KeyResponder . h " <nl> deleted file mode 100644 <nl> index 276e80a0e . . 000000000 <nl> mmm a / src / apps / EventViewer / src / EventQueue . h <nl> ppp / dev / null <nl> <nl> - / / - * - mode : objective - c - * - <nl> - <nl> - @ import Cocoa ; <nl> - <nl> - @ interface EventQueue : NSObject <nl> - <nl> - @ property ( readonly ) BOOL observed ; <nl> - <nl> - - ( void ) setup ; <nl> - - ( void ) pushMouseEvent : ( NSEvent * ) event ; <nl> - <nl> - @ end <nl> deleted file mode 100644 <nl> index 085da0856 . . 000000000 <nl> mmm a / src / apps / EventViewer / src / EventQueue . m <nl> ppp / dev / null <nl> <nl> - # import " EventQueue . h " <nl> - # import " KarabinerKit / KarabinerKit . h " <nl> - # import " PreferencesKeys . h " <nl> - # import " libkrbn / libkrbn . h " <nl> - # import < pqrs / weakify . h > <nl> - <nl> - @ interface EventQueue ( ) <nl> - <nl> - @ property NSMutableArray * queue ; <nl> - @ property NSMutableDictionary < NSNumber * , NSMutableSet < NSString * > * > * modifierFlags ; <nl> - @ property ( copy ) NSString * simpleModificationJsonString ; <nl> - @ property ( weak ) IBOutlet NSTableView * view ; <nl> - @ property ( weak ) IBOutlet NSButton * addSimpleModificationButton ; <nl> - <nl> - - ( void ) pushKeyEvent : ( NSString * ) code <nl> - name : ( NSString * ) name <nl> - eventType : ( NSString * ) eventType <nl> - misc : ( NSString * ) misc ; <nl> - - ( void ) updateAddSimpleModificationButton : ( NSString * ) title ; <nl> - <nl> - @ end <nl> - <nl> - static void hid_value_observer_callback ( uint64_t device_id , <nl> - libkrbn_hid_value_type type , <nl> - uint32_t value , <nl> - libkrbn_hid_value_event_type event_type , <nl> - void * refcon ) { <nl> - EventQueue * queue = ( __bridge EventQueue * ) ( refcon ) ; <nl> - if ( ! queue ) { <nl> - return ; <nl> - } <nl> - <nl> - @ weakify ( queue ) ; <nl> - dispatch_async ( dispatch_get_main_queue ( ) , ^ { <nl> - @ strongify ( queue ) ; <nl> - if ( ! queue ) { <nl> - return ; <nl> - } <nl> - <nl> - NSNumber * deviceId = @ ( device_id ) ; <nl> - <nl> - NSString * code = nil ; <nl> - if ( [ [ NSUserDefaults standardUserDefaults ] boolForKey : kShowHex ] ) { <nl> - code = [ NSString stringWithFormat : @ " 0x % 02x " , value ] ; <nl> - } else { <nl> - code = [ NSString stringWithFormat : @ " % d " , value ] ; <nl> - } <nl> - NSString * keyType = @ " " ; <nl> - NSMutableDictionary * simpleModificationJson = [ NSMutableDictionary new ] ; <nl> - <nl> - char buffer [ 256 ] ; <nl> - buffer [ 0 ] = ' \ 0 ' ; <nl> - NSString * name = @ " " ; <nl> - <nl> - switch ( type ) { <nl> - case libkrbn_hid_value_type_key_code : { <nl> - keyType = @ " key " ; <nl> - libkrbn_get_key_code_name ( buffer , sizeof ( buffer ) , value ) ; <nl> - name = [ NSString stringWithUTF8String : buffer ] ; <nl> - <nl> - NSNumber * unnamedNumber = nil ; <nl> - { <nl> - uint32_t unnamedKeyCodeNumber = 0 ; <nl> - if ( libkrbn_find_unnamed_key_code_number ( & unnamedKeyCodeNumber , buffer ) ) { <nl> - unnamedNumber = [ NSNumber numberWithInteger : unnamedKeyCodeNumber ] ; <nl> - } <nl> - } <nl> - <nl> - if ( libkrbn_is_modifier_flag ( value ) ) { <nl> - NSMutableSet * set = queue . modifierFlags [ deviceId ] ; <nl> - if ( ! set ) { <nl> - set = [ NSMutableSet new ] ; <nl> - queue . modifierFlags [ deviceId ] = set ; <nl> - } <nl> - <nl> - if ( event_type = = libkrbn_hid_value_event_type_key_down ) { <nl> - [ set addObject : name ] ; <nl> - } else { <nl> - [ set removeObject : name ] ; <nl> - } <nl> - } <nl> - <nl> - simpleModificationJson [ @ " from " ] = [ NSMutableDictionary new ] ; <nl> - simpleModificationJson [ @ " from " ] [ @ " key_code " ] = unnamedNumber ? unnamedNumber : name ; <nl> - break ; <nl> - } <nl> - <nl> - case libkrbn_hid_value_type_consumer_key_code : { <nl> - keyType = @ " consumer_key " ; <nl> - libkrbn_get_consumer_key_code_name ( buffer , sizeof ( buffer ) , value ) ; <nl> - name = [ NSString stringWithUTF8String : buffer ] ; <nl> - <nl> - NSNumber * unnamedNumber = nil ; <nl> - { <nl> - uint32_t unnamedConsumerKeyCodeNumber = 0 ; <nl> - if ( libkrbn_find_unnamed_consumer_key_code_number ( & unnamedConsumerKeyCodeNumber , buffer ) ) { <nl> - unnamedNumber = [ NSNumber numberWithInteger : unnamedConsumerKeyCodeNumber ] ; <nl> - } <nl> - } <nl> - <nl> - simpleModificationJson [ @ " from " ] = [ NSMutableDictionary new ] ; <nl> - simpleModificationJson [ @ " from " ] [ @ " consumer_key_code " ] = unnamedNumber ? unnamedNumber : name ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - NSString * eventType = @ " " ; <nl> - switch ( event_type ) { <nl> - case libkrbn_hid_value_event_type_key_down : <nl> - eventType = [ NSString stringWithFormat : @ " % @ _down " , keyType ] ; <nl> - break ; <nl> - case libkrbn_hid_value_event_type_key_up : <nl> - eventType = [ NSString stringWithFormat : @ " % @ _up " , keyType ] ; <nl> - break ; <nl> - case libkrbn_hid_value_event_type_single : <nl> - eventType = @ " " ; <nl> - break ; <nl> - } <nl> - <nl> - NSString * misc = @ " " ; <nl> - { <nl> - NSMutableSet * set = queue . modifierFlags [ deviceId ] ; <nl> - if ( set & & set . count > 0 ) { <nl> - NSArray * flags = [ [ set allObjects ] sortedArrayUsingSelector : @ selector ( compare : ) ] ; <nl> - misc = [ misc stringByAppendingString : [ NSString stringWithFormat : @ " flags : % @ " , [ flags componentsJoinedByString : @ " , " ] ] ] ; <nl> - } <nl> - } <nl> - <nl> - [ queue pushKeyEvent : code name : name eventType : eventType misc : misc ] ; <nl> - <nl> - if ( simpleModificationJson . count > 0 ) { <nl> - queue . simpleModificationJsonString = [ KarabinerKitJsonUtility createJsonString : simpleModificationJson ] ; <nl> - [ queue updateAddSimpleModificationButton : [ NSString stringWithFormat : @ " Add ` % @ ` to Karabiner - Elements " , name ] ] ; <nl> - } <nl> - } ) ; <nl> - } <nl> - <nl> - @ implementation EventQueue <nl> - <nl> - enum { <nl> - MAXNUM = 256 , <nl> - } ; <nl> - <nl> - - ( instancetype ) init { <nl> - self = [ super init ] ; <nl> - <nl> - if ( self ) { <nl> - _queue = [ NSMutableArray new ] ; <nl> - _modifierFlags = [ NSMutableDictionary new ] ; <nl> - } <nl> - <nl> - return self ; <nl> - } <nl> - <nl> - - ( void ) dealloc { <nl> - [ self terminateHidValueObserver ] ; <nl> - <nl> - [ [ NSDistributedNotificationCenter defaultCenter ] removeObserver : self <nl> - name : nil <nl> - object : nil ] ; <nl> - } <nl> - <nl> - - ( void ) setup { <nl> - [ self initializeHidValueObserver ] ; <nl> - [ self updateAddSimpleModificationButton : nil ] ; <nl> - <nl> - { <nl> - NSString * name = [ NSString stringWithUTF8String : libkrbn_get_distributed_notification_device_grabbing_state_is_changed ( ) ] ; <nl> - NSString * object = [ NSString stringWithUTF8String : libkrbn_get_distributed_notification_observed_object ( ) ] ; <nl> - <nl> - [ [ NSDistributedNotificationCenter defaultCenter ] addObserver : self <nl> - selector : @ selector ( deviceGrabbingStateIsChangedCallback ) <nl> - name : name <nl> - object : object <nl> - suspensionBehavior : NSNotificationSuspensionBehaviorDeliverImmediately ] ; <nl> - } <nl> - } <nl> - <nl> - - ( void ) initializeHidValueObserver { <nl> - libkrbn_enable_hid_value_monitor ( hid_value_observer_callback , <nl> - ( __bridge void * ) ( self ) ) ; <nl> - } <nl> - <nl> - - ( void ) terminateHidValueObserver { <nl> - libkrbn_disable_hid_value_monitor ( ) ; <nl> - } <nl> - <nl> - - ( void ) updateAddSimpleModificationButton : ( NSString * ) title { <nl> - if ( title ) { <nl> - self . addSimpleModificationButton . hidden = NO ; <nl> - } else { <nl> - self . addSimpleModificationButton . hidden = YES ; <nl> - } <nl> - self . addSimpleModificationButton . title = title ; <nl> - } <nl> - <nl> - - ( void ) deviceGrabbingStateIsChangedCallback { <nl> - [ self initializeHidValueObserver ] ; <nl> - } <nl> - <nl> - - ( BOOL ) observed { <nl> - return libkrbn_hid_value_monitor_observed ( ) ; <nl> - } <nl> - <nl> - - ( NSInteger ) numberOfRowsInTableView : ( NSTableView * ) aTableView { <nl> - return [ self . queue count ] ; <nl> - } <nl> - <nl> - - ( id ) tableView : ( NSTableView * ) aTableView objectValueForTableColumn : ( NSTableColumn * ) aTableColumn row : ( NSInteger ) rowIndex { <nl> - id identifier = [ aTableColumn identifier ] ; <nl> - <nl> - NSDictionary * dict = self . queue [ ( [ self . queue count ] - 1 - rowIndex ) ] ; <nl> - return dict [ identifier ] ; <nl> - } <nl> - <nl> - - ( void ) refresh { <nl> - [ self . view reloadData ] ; <nl> - [ self . view scrollRowToVisible : ( [ self . queue count ] - 1 ) ] ; <nl> - } <nl> - <nl> - - ( NSString * ) modifierFlagsToString : ( NSUInteger ) flags { <nl> - NSMutableArray * names = [ NSMutableArray new ] ; <nl> - if ( flags & NSEventModifierFlagCapsLock ) { <nl> - [ names addObject : @ " caps " ] ; <nl> - } <nl> - if ( flags & NSEventModifierFlagShift ) { <nl> - [ names addObject : @ " shift " ] ; <nl> - } <nl> - if ( flags & NSEventModifierFlagControl ) { <nl> - [ names addObject : @ " ctrl " ] ; <nl> - } <nl> - if ( flags & NSEventModifierFlagOption ) { <nl> - [ names addObject : @ " opt " ] ; <nl> - } <nl> - if ( flags & NSEventModifierFlagCommand ) { <nl> - [ names addObject : @ " cmd " ] ; <nl> - } <nl> - if ( flags & NSEventModifierFlagNumericPad ) { <nl> - [ names addObject : @ " numpad " ] ; <nl> - } <nl> - if ( flags & NSEventModifierFlagHelp ) { <nl> - [ names addObject : @ " help " ] ; <nl> - } <nl> - if ( flags & NSEventModifierFlagFunction ) { <nl> - [ names addObject : @ " fn " ] ; <nl> - } <nl> - <nl> - return [ names componentsJoinedByString : @ " , " ] ; <nl> - } <nl> - <nl> - - ( NSString * ) buttonToString : ( NSEvent * ) event { <nl> - NSInteger number = [ event buttonNumber ] ; <nl> - return [ NSString stringWithFormat : @ " button % d " , ( int ) ( number + 1 ) ] ; <nl> - } <nl> - <nl> - - ( void ) pushKeyEvent : ( NSString * ) code <nl> - name : ( NSString * ) name <nl> - eventType : ( NSString * ) eventType <nl> - misc : ( NSString * ) misc { <nl> - [ self push : eventType <nl> - code : code <nl> - name : name <nl> - misc : misc ] ; <nl> - } <nl> - <nl> - - ( void ) pushMouseEvent : ( NSEvent * ) event eventType : ( NSString * ) eventType { <nl> - NSString * flags = [ self modifierFlagsToString : [ event modifierFlags ] ] ; <nl> - [ self push : eventType <nl> - code : [ NSString stringWithFormat : @ " % d " , ( int ) ( [ event buttonNumber ] ) ] <nl> - name : [ self buttonToString : event ] <nl> - misc : [ NSString stringWithFormat : @ " { x : % d , y : % d } click_count : % d % @ " , <nl> - ( int ) ( [ event locationInWindow ] . x ) , ( int ) ( [ event locationInWindow ] . y ) , <nl> - ( int ) ( [ event clickCount ] ) , <nl> - [ flags length ] > 0 ? [ NSString stringWithFormat : @ " flags : % @ " , flags ] : @ " " ] ] ; <nl> - } <nl> - <nl> - - ( void ) pushScrollWheelEvent : ( NSEvent * ) event eventType : ( NSString * ) eventType { <nl> - [ self push : eventType <nl> - code : @ " " <nl> - name : @ " " <nl> - misc : [ NSString stringWithFormat : @ " dx : % . 03f dy : % . 03f dz : % . 03f " , [ event deltaX ] , [ event deltaY ] , [ event deltaZ ] ] ] ; <nl> - } <nl> - <nl> - - ( void ) pushMouseEvent : ( NSEvent * ) event { <nl> - switch ( [ event type ] ) { <nl> - case NSEventTypeLeftMouseDown : <nl> - case NSEventTypeRightMouseDown : <nl> - case NSEventTypeOtherMouseDown : <nl> - [ self pushMouseEvent : event eventType : @ " button_down " ] ; <nl> - break ; <nl> - <nl> - case NSEventTypeLeftMouseUp : <nl> - case NSEventTypeRightMouseUp : <nl> - case NSEventTypeOtherMouseUp : <nl> - [ self pushMouseEvent : event eventType : @ " button_up " ] ; <nl> - break ; <nl> - <nl> - case NSEventTypeLeftMouseDragged : <nl> - case NSEventTypeRightMouseDragged : <nl> - case NSEventTypeOtherMouseDragged : <nl> - [ self pushMouseEvent : event eventType : @ " mouse_dragged " ] ; <nl> - break ; <nl> - <nl> - case NSEventTypeScrollWheel : <nl> - [ self pushScrollWheelEvent : event eventType : @ " scroll_wheel " ] ; <nl> - break ; <nl> - <nl> - default : <nl> - / / Do nothing <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - - ( void ) push : ( NSString * ) eventType code : ( NSString * ) code name : ( NSString * ) name misc : ( NSString * ) misc { <nl> - NSDictionary * dict = @ { @ " eventType " : eventType , <nl> - @ " code " : code , <nl> - @ " name " : name , <nl> - @ " misc " : misc } ; <nl> - <nl> - [ self . queue insertObject : dict atIndex : 0 ] ; <nl> - if ( [ self . queue count ] > MAXNUM ) { <nl> - [ self . queue removeLastObject ] ; <nl> - } <nl> - [ self refresh ] ; <nl> - } <nl> - <nl> - - ( IBAction ) clear : ( id ) sender { <nl> - [ self . queue removeAllObjects ] ; <nl> - [ self updateAddSimpleModificationButton : nil ] ; <nl> - [ self refresh ] ; <nl> - } <nl> - <nl> - - ( IBAction ) copy : ( id ) sender { <nl> - NSPasteboard * pboard = [ NSPasteboard generalPasteboard ] ; <nl> - NSMutableString * string = [ NSMutableString new ] ; <nl> - <nl> - for ( NSUInteger i = 0 ; i < [ self . queue count ] ; + + i ) { <nl> - NSDictionary * dict = self . queue [ ( [ self . queue count ] - 1 - i ) ] ; <nl> - <nl> - NSString * eventType = [ NSString stringWithFormat : @ " type : % @ " , dict [ @ " eventType " ] ] ; <nl> - NSString * code = [ NSString stringWithFormat : @ " code : % @ " , dict [ @ " code " ] ] ; <nl> - NSString * name = [ NSString stringWithFormat : @ " name : % @ " , dict [ @ " name " ] ] ; <nl> - NSString * misc = [ NSString stringWithFormat : @ " misc : % @ " , dict [ @ " misc " ] ] ; <nl> - <nl> - [ string appendFormat : @ " % @ % @ % @ % @ \ n " , <nl> - [ eventType stringByPaddingToLength : 20 <nl> - withString : @ " " <nl> - startingAtIndex : 0 ] , <nl> - [ code stringByPaddingToLength : 15 <nl> - withString : @ " " <nl> - startingAtIndex : 0 ] , <nl> - [ name stringByPaddingToLength : 20 <nl> - withString : @ " " <nl> - startingAtIndex : 0 ] , <nl> - misc ] ; <nl> - } <nl> - <nl> - if ( [ string length ] > 0 ) { <nl> - [ pboard clearContents ] ; <nl> - [ pboard writeObjects : @ [ string ] ] ; <nl> - } <nl> - } <nl> - <nl> - - ( IBAction ) addSimpleModification : ( id ) sender { <nl> - NSString * escapedJsonString = [ self . simpleModificationJsonString stringByAddingPercentEncodingWithAllowedCharacters : NSCharacterSet . URLQueryAllowedCharacterSet ] ; <nl> - NSString * url = [ NSString stringWithFormat : @ " karabiner : / / karabiner / simple_modifications / new ? json = % @ " , escapedJsonString ] ; <nl> - NSLog ( @ " url % @ " , url ) ; <nl> - [ [ NSWorkspace sharedWorkspace ] openURL : [ NSURL URLWithString : url ] ] ; <nl> - } <nl> - <nl> - @ end <nl> new file mode 100644 <nl> index 000000000 . . ee82cb95e <nl> mmm / dev / null <nl> ppp b / src / apps / EventViewer / src / EventQueue . swift <nl> <nl> + import AnyCodable <nl> + import Cocoa <nl> + <nl> + private class SimpleModificationJson : Codable { <nl> + var from : [ String : AnyCodable ] = [ : ] <nl> + } <nl> + <nl> + private func callback ( _ deviceId : UInt64 , <nl> + _ type : libkrbn_hid_value_type , <nl> + _ value : UInt32 , <nl> + _ eventType : libkrbn_hid_value_event_type , <nl> + _ context : UnsafeMutableRawPointer ? ) <nl> + { <nl> + let obj : EventQueue ! = unsafeBitCast ( context , to : EventQueue . self ) <nl> + <nl> + DispatchQueue . main . async { [ weak obj ] in <nl> + guard let obj = obj else { return } <nl> + <nl> + let entry = EventQueueEntry ( ) <nl> + let simpleModificationJson = SimpleModificationJson ( ) <nl> + <nl> + / / <nl> + / / entry . code <nl> + / / <nl> + <nl> + if UserDefaults . standard . bool ( forKey : " kShowHex " ) { <nl> + entry . code = String ( format : " 0x % 02x " , value ) <nl> + } else { <nl> + entry . code = String ( value ) <nl> + } <nl> + <nl> + / / <nl> + / / entry . name <nl> + / / <nl> + <nl> + var keyType = " " <nl> + var buffer = [ Int8 ] ( repeating : 0 , count : 256 ) <nl> + <nl> + switch type { <nl> + case libkrbn_hid_value_type_key_code : <nl> + keyType = " key " <nl> + libkrbn_get_key_code_name ( & buffer , buffer . count , value ) <nl> + entry . name = String ( cString : buffer ) <nl> + <nl> + / / <nl> + / / modifierFlags <nl> + / / <nl> + <nl> + if libkrbn_is_modifier_flag ( value ) { <nl> + if obj . modifierFlags [ deviceId ] = = nil { <nl> + obj . modifierFlags [ deviceId ] = Set ( ) <nl> + } <nl> + <nl> + if eventType = = libkrbn_hid_value_event_type_key_down { <nl> + obj . modifierFlags [ deviceId ] ! . insert ( entry . name ) <nl> + } else { <nl> + obj . modifierFlags [ deviceId ] ! . remove ( entry . name ) <nl> + } <nl> + } <nl> + <nl> + / / <nl> + / / simpleModificationJson <nl> + / / <nl> + <nl> + do { <nl> + var unnamedNumber : UInt32 = 0 <nl> + if libkrbn_find_unnamed_key_code_number ( & unnamedNumber , & buffer ) { <nl> + simpleModificationJson . from [ " key_code " ] = AnyCodable ( unnamedNumber ) <nl> + } else { <nl> + simpleModificationJson . from [ " key_code " ] = AnyCodable ( entry . name ) <nl> + } <nl> + } <nl> + <nl> + case libkrbn_hid_value_type_consumer_key_code : <nl> + keyType = " consumer_key " <nl> + libkrbn_get_consumer_key_code_name ( & buffer , buffer . count , value ) <nl> + entry . name = String ( cString : buffer ) <nl> + <nl> + / / <nl> + / / simpleModificationJson <nl> + / / <nl> + <nl> + do { <nl> + var unnamedNumber : UInt32 = 0 <nl> + if libkrbn_find_unnamed_consumer_key_code_number ( & unnamedNumber , & buffer ) { <nl> + simpleModificationJson . from [ " consumer_key_code " ] = AnyCodable ( unnamedNumber ) <nl> + } else { <nl> + simpleModificationJson . from [ " consumer_key_code " ] = AnyCodable ( entry . name ) <nl> + } <nl> + } <nl> + <nl> + default : <nl> + break <nl> + } <nl> + <nl> + / / <nl> + / / entry . eventType <nl> + / / <nl> + <nl> + switch eventType { <nl> + case libkrbn_hid_value_event_type_key_down : <nl> + entry . eventType = " \ ( keyType ) _down " <nl> + case libkrbn_hid_value_event_type_key_up : <nl> + entry . eventType = " \ ( keyType ) _up " <nl> + case libkrbn_hid_value_event_type_single : <nl> + break <nl> + default : <nl> + break <nl> + } <nl> + <nl> + / / <nl> + / / entry . misc <nl> + / / <nl> + <nl> + if let set = obj . modifierFlags [ deviceId ] { <nl> + if set . count > 0 { <nl> + let flags = set . sorted ( ) . joined ( separator : " , " ) <nl> + entry . misc = " flags \ ( flags ) " <nl> + } <nl> + } <nl> + <nl> + / / <nl> + / / EventQueue . queue <nl> + / / <nl> + <nl> + obj . append ( entry ) <nl> + <nl> + if simpleModificationJson . from . count > 0 { <nl> + let jsonEncoder = JSONEncoder ( ) <nl> + if let data = try ? jsonEncoder . encode ( simpleModificationJson ) { <nl> + if let jsonString = String ( data : data , encoding : . utf8 ) { <nl> + obj . simpleModificationJsonString = jsonString <nl> + obj . updateAddSimpleModificationButton ( " Add ` \ ( entry . name ) ` to Karabiner - Elements " ) <nl> + } <nl> + } <nl> + } <nl> + } <nl> + } <nl> + <nl> + @ objcMembers <nl> + public class EventQueueEntry : NSObject { <nl> + var eventType : String = " " <nl> + var code : String = " " <nl> + var name : String = " " <nl> + var misc : String = " " <nl> + } <nl> + <nl> + @ objc <nl> + public class EventQueue : NSObject , NSTableViewDataSource { <nl> + var queue : [ EventQueueEntry ] = [ ] <nl> + let maxQueueCount = 256 <nl> + var modifierFlags : [ UInt64 : Set < String > ] = [ : ] <nl> + var simpleModificationJsonString : String = " " <nl> + <nl> + @ IBOutlet var view : NSTableView ! <nl> + @ IBOutlet var addSimpleModificationButton : NSButton ! <nl> + <nl> + deinit { <nl> + libkrbn_disable_hid_value_monitor ( ) <nl> + } <nl> + <nl> + @ objc <nl> + public func setup ( ) { <nl> + updateAddSimpleModificationButton ( nil ) <nl> + <nl> + let obj = unsafeBitCast ( self , to : UnsafeMutableRawPointer . self ) <nl> + libkrbn_enable_hid_value_monitor ( callback , obj ) <nl> + <nl> + / / { <nl> + / / NSString * name = [ NSString stringWithUTF8String : libkrbn_get_distributed_notification_device_grabbing_state_is_changed ( ) ] ; <nl> + / / NSString * object = [ NSString stringWithUTF8String : libkrbn_get_distributed_notification_observed_object ( ) ] ; <nl> + / / <nl> + / / [ [ NSDistributedNotificationCenter defaultCenter ] addObserver : self <nl> + / / selector : @ selector ( deviceGrabbingStateIsChangedCallback ) <nl> + / / name : name <nl> + / / object : object <nl> + / / suspensionBehavior : NSNotificationSuspensionBehaviorDeliverImmediately ] ; <nl> + / / } <nl> + } <nl> + <nl> + @ objc <nl> + public func observed ( ) - > Bool { <nl> + return libkrbn_hid_value_monitor_observed ( ) <nl> + } <nl> + <nl> + public func append ( _ entry : EventQueueEntry ) { <nl> + queue . append ( entry ) <nl> + if queue . count > maxQueueCount { <nl> + queue . removeFirst ( ) <nl> + } <nl> + refresh ( ) <nl> + } <nl> + <nl> + func refresh ( ) { <nl> + view . reloadData ( ) <nl> + view . scrollRowToVisible ( queue . count - 1 ) <nl> + } <nl> + <nl> + public func updateAddSimpleModificationButton ( _ title : String ? ) { <nl> + if title ! = nil { <nl> + addSimpleModificationButton . title = title ! <nl> + addSimpleModificationButton . isHidden = false <nl> + } else { <nl> + addSimpleModificationButton . isHidden = true <nl> + } <nl> + } <nl> + <nl> + @ IBAction func clear ( _ : NSButton ) { <nl> + queue . removeAll ( ) <nl> + updateAddSimpleModificationButton ( nil ) <nl> + refresh ( ) <nl> + } <nl> + <nl> + @ IBAction func copy ( _ : NSButton ) { <nl> + var string = " " <nl> + <nl> + queue . forEach { entry in <nl> + let eventType = " type : \ ( entry . eventType ) " . padding ( toLength : 20 , withPad : " " , startingAt : 0 ) <nl> + let code = " code : \ ( entry . code ) " . padding ( toLength : 15 , withPad : " " , startingAt : 0 ) <nl> + let name = " name : \ ( entry . name ) " . padding ( toLength : 20 , withPad : " " , startingAt : 0 ) <nl> + let misc = " misc : \ ( entry . misc ) " <nl> + <nl> + string . append ( " \ ( eventType ) \ ( code ) \ ( name ) \ ( misc ) \ n " ) <nl> + } <nl> + <nl> + if ! string . isEmpty { <nl> + let pboard = NSPasteboard . general <nl> + pboard . clearContents ( ) <nl> + pboard . writeObjects ( [ string as NSString ] ) <nl> + } <nl> + } <nl> + <nl> + @ IBAction func addSimpleModification ( _ : NSButton ) { <nl> + guard let string = simpleModificationJsonString . addingPercentEncoding ( withAllowedCharacters : . urlQueryAllowed ) else { return } <nl> + guard let url = URL ( string : " karabiner : / / karabiner / simple_modifications / new ? json = \ ( string ) " ) else { return } <nl> + NSWorkspace . shared . open ( url ) <nl> + } <nl> + <nl> + / / <nl> + / / Mouse event handling <nl> + / / <nl> + <nl> + func modifierFlagsString ( _ flags : NSEvent . ModifierFlags ) - > String { <nl> + var names : [ String ] = [ ] <nl> + if flags . contains ( . capsLock ) { <nl> + names . append ( " caps " ) <nl> + } <nl> + if flags . contains ( . shift ) { <nl> + names . append ( " shift " ) <nl> + } <nl> + if flags . contains ( . control ) { <nl> + names . append ( " ctrl " ) <nl> + } <nl> + if flags . contains ( . option ) { <nl> + names . append ( " opt " ) <nl> + } <nl> + if flags . contains ( . command ) { <nl> + names . append ( " cmd " ) <nl> + } <nl> + if flags . contains ( . numericPad ) { <nl> + names . append ( " numpad " ) <nl> + } <nl> + if flags . contains ( . help ) { <nl> + names . append ( " help " ) <nl> + } <nl> + if flags . contains ( . function ) { <nl> + names . append ( " fn " ) <nl> + } <nl> + <nl> + return names . joined ( separator : " , " ) <nl> + } <nl> + <nl> + func pushMouseEvent ( event : NSEvent , eventType : String ) { <nl> + let entry = EventQueueEntry ( ) <nl> + entry . eventType = eventType <nl> + entry . code = String ( event . buttonNumber ) <nl> + entry . name = " button \ ( event . buttonNumber + 1 ) " <nl> + <nl> + entry . misc = String ( format : " { x : % d , y : % d } click_count : % d " , <nl> + Int ( event . locationInWindow . x ) , <nl> + Int ( event . locationInWindow . y ) , <nl> + Int ( event . clickCount ) ) <nl> + var flags = modifierFlagsString ( event . modifierFlags ) <nl> + if ! flags . isEmpty { <nl> + entry . misc . append ( " flags : \ ( flags ) " ) <nl> + } <nl> + <nl> + append ( entry ) <nl> + } <nl> + <nl> + func pushScrollWheelEvent ( event : NSEvent , eventType : String ) { <nl> + let entry = EventQueueEntry ( ) <nl> + entry . eventType = eventType <nl> + entry . misc = String ( format : " dx : % . 03f dy : % . 03f dz : % . 03f " , <nl> + event . deltaX , <nl> + event . deltaY , <nl> + event . deltaZ ) <nl> + <nl> + append ( entry ) <nl> + } <nl> + <nl> + @ objc <nl> + func pushMouseEvent ( _ event : NSEvent ) { <nl> + switch event . type { <nl> + case . leftMouseDown , <nl> + . rightMouseDown , <nl> + . otherMouseDown : <nl> + pushMouseEvent ( event : event , eventType : " button_down " ) <nl> + <nl> + case . leftMouseUp , <nl> + . rightMouseUp , <nl> + . otherMouseUp : <nl> + pushMouseEvent ( event : event , eventType : " button_up " ) <nl> + <nl> + case . leftMouseDragged , <nl> + . rightMouseDragged , <nl> + . otherMouseDragged : <nl> + pushMouseEvent ( event : event , eventType : " mouse_dragged " ) <nl> + <nl> + case . scrollWheel : <nl> + pushScrollWheelEvent ( event : event , eventType : " scroll_wheel " ) <nl> + <nl> + default : <nl> + / / Do nothing <nl> + break <nl> + } <nl> + } <nl> + <nl> + / / <nl> + / / NSTableViewDataSource <nl> + / / <nl> + <nl> + public func numberOfRows ( in _ : NSTableView ) - > Int { <nl> + return queue . count <nl> + } <nl> + <nl> + public func tableView ( _ : NSTableView , <nl> + objectValueFor tableColumn : NSTableColumn ? , <nl> + row : Int ) - > Any ? <nl> + { <nl> + guard let identifier = tableColumn ? . identifier else { return nil } <nl> + return queue [ row ] . value ( forKey : identifier . rawValue ) <nl> + } <nl> + } <nl> mmm a / src / apps / EventViewer / src / KeyResponder . m <nl> ppp b / src / apps / EventViewer / src / KeyResponder . m <nl> <nl> # import " KeyResponder . h " <nl> - # import " EventQueue . h " <nl> + # import " Karabiner_EventViewer - Swift . h " <nl> <nl> @ interface KeyResponder ( ) <nl> <nl>
EventViewer / src / EventQueue . m - > swift
pqrs-org/Karabiner-Elements
2b28ee5a8fa1450600adc3a77cb218ad4102feb2
2020-09-25T14:58:42Z
mmm a / drivers / windows / file_access_windows . cpp <nl> ppp b / drivers / windows / file_access_windows . cpp <nl> void FileAccessWindows : : seek ( size_t p_position ) { <nl> last_error = OK ; <nl> if ( fseek ( f , p_position , SEEK_SET ) ) <nl> check_errors ( ) ; <nl> + prev_op = 0 ; <nl> } <nl> void FileAccessWindows : : seek_end ( int64_t p_position ) { <nl> <nl> ERR_FAIL_COND ( ! f ) ; <nl> if ( fseek ( f , p_position , SEEK_END ) ) <nl> check_errors ( ) ; <nl> + prev_op = 0 ; <nl> } <nl> size_t FileAccessWindows : : get_position ( ) const { <nl> <nl> bool FileAccessWindows : : eof_reached ( ) const { <nl> uint8_t FileAccessWindows : : get_8 ( ) const { <nl> <nl> ERR_FAIL_COND_V ( ! f , 0 ) ; <nl> + if ( flags = = READ_WRITE | | flags = = WRITE_READ ) { <nl> + if ( prev_op = = WRITE ) { <nl> + fflush ( f ) ; <nl> + } <nl> + prev_op = READ ; <nl> + } <nl> uint8_t b ; <nl> if ( fread ( & b , 1 , 1 , f ) = = 0 ) { <nl> check_errors ( ) ; <nl> uint8_t FileAccessWindows : : get_8 ( ) const { <nl> int FileAccessWindows : : get_buffer ( uint8_t * p_dst , int p_length ) const { <nl> <nl> ERR_FAIL_COND_V ( ! f , - 1 ) ; <nl> + if ( flags = = READ_WRITE | | flags = = WRITE_READ ) { <nl> + if ( prev_op = = WRITE ) { <nl> + fflush ( f ) ; <nl> + } <nl> + prev_op = READ ; <nl> + } <nl> int read = fread ( p_dst , 1 , p_length , f ) ; <nl> check_errors ( ) ; <nl> return read ; <nl> void FileAccessWindows : : flush ( ) { <nl> <nl> ERR_FAIL_COND ( ! f ) ; <nl> fflush ( f ) ; <nl> + if ( prev_op = = WRITE ) <nl> + prev_op = 0 ; <nl> } <nl> <nl> void FileAccessWindows : : store_8 ( uint8_t p_dest ) { <nl> <nl> ERR_FAIL_COND ( ! f ) ; <nl> + if ( flags = = READ_WRITE | | flags = = WRITE_READ ) { <nl> + if ( prev_op = = READ ) { <nl> + if ( last_error ! = ERR_FILE_EOF ) { <nl> + fseek ( f , 0 , SEEK_CUR ) ; <nl> + } <nl> + } <nl> + prev_op = WRITE ; <nl> + } <nl> fwrite ( & p_dest , 1 , 1 , f ) ; <nl> } <nl> <nl> void FileAccessWindows : : store_buffer ( const uint8_t * p_src , int p_length ) { <nl> ERR_FAIL_COND ( ! f ) ; <nl> + if ( flags = = READ_WRITE | | flags = = WRITE_READ ) { <nl> + if ( prev_op = = READ ) { <nl> + if ( last_error ! = ERR_FILE_EOF ) { <nl> + fseek ( f , 0 , SEEK_CUR ) ; <nl> + } <nl> + } <nl> + prev_op = WRITE ; <nl> + } <nl> ERR_FAIL_COND ( fwrite ( p_src , 1 , p_length , f ) ! = p_length ) ; <nl> } <nl> <nl> uint64_t FileAccessWindows : : _get_modified_time ( const String & p_file ) { <nl> FileAccessWindows : : FileAccessWindows ( ) : <nl> f ( NULL ) , <nl> flags ( 0 ) , <nl> + prev_op ( 0 ) , <nl> last_error ( OK ) { <nl> } <nl> FileAccessWindows : : ~ FileAccessWindows ( ) { <nl> mmm a / drivers / windows / file_access_windows . h <nl> ppp b / drivers / windows / file_access_windows . h <nl> class FileAccessWindows : public FileAccess { <nl> FILE * f ; <nl> int flags ; <nl> void check_errors ( ) const ; <nl> + mutable int prev_op ; <nl> mutable Error last_error ; <nl> String path ; <nl> String path_src ; <nl>
Fix File opened with READ_WRITE on Windows
godotengine/godot
8d12dfa24d70b6a86660baaafb83781d6dea4680
2019-04-05T12:15:40Z
mmm a / Code / CryEngine / CryAudioSystem / implementations / CryAudioImplFmod / AudioImpl . cpp <nl> ppp b / Code / CryEngine / CryAudioSystem / implementations / CryAudioImplFmod / AudioImpl . cpp <nl> bool CAudioImpl : : LoadMasterBanks ( ) <nl> <nl> FMOD_STUDIO_BANK_INFO bankInfo ; <nl> ZeroStruct ( bankInfo ) ; <nl> - bankInfo . closeCallback = & FmodFileCloseCallback ; <nl> - bankInfo . openCallback = & FmodFileOpenCallback ; <nl> - bankInfo . readCallback = & FmodFileReadCallback ; <nl> - bankInfo . seekCallback = & FmodFileSeekCallback ; <nl> + bankInfo . closecallback = & FmodFileCloseCallback ; <nl> + bankInfo . opencallback = & FmodFileOpenCallback ; <nl> + bankInfo . readcallback = & FmodFileReadCallback ; <nl> + bankInfo . seekcallback = & FmodFileSeekCallback ; <nl> bankInfo . size = sizeof ( bankInfo ) ; <nl> - bankInfo . userData = static_cast < void * > ( & fileData ) ; <nl> - bankInfo . userDataLength = sizeof ( SFmodFileData ) ; <nl> + bankInfo . userdata = static_cast < void * > ( & fileData ) ; <nl> + bankInfo . userdatalength = sizeof ( SFmodFileData ) ; <nl> <nl> fmodResult = m_pSystem - > loadBankCustom ( & bankInfo , FMOD_STUDIO_LOAD_BANK_NORMAL , & m_pMasterBank ) ; <nl> ASSERT_FMOD_OK ; <nl>
! U ( Audio ) updated FMOD Studio API to version 1 . 09 . 01 ( Approved by thomasw )
CRYTEK/CRYENGINE
380202ca8da7b066806ef970328e3a55cccdbf99
2017-02-15T09:57:58Z
mmm a / include / swift / AST / Decl . h <nl> ppp b / include / swift / AST / Decl . h <nl> namespace swift { <nl> class Type ; <nl> class Expr ; <nl> class DeclRefExpr ; <nl> + class ForeignAsyncConvention ; <nl> class ForeignErrorConvention ; <nl> class LiteralExpr ; <nl> class BraceStmt ; <nl> class AbstractFunctionDecl : public GenericContext , public ValueDecl { <nl> / / / being dropped altogether . ` None ` is returned for a normal function <nl> / / / or method . <nl> Optional < int > getForeignFunctionAsMethodSelfParameterIndex ( ) const ; <nl> - <nl> + <nl> + / / / Set information about the foreign async convention used by this <nl> + / / / declaration . <nl> + void setForeignAsyncConvention ( const ForeignAsyncConvention & convention ) ; <nl> + <nl> + / / / Get information about the foreign async convention used by this <nl> + / / / declaration , given that it is @ objc and ' async ' . <nl> + Optional < ForeignAsyncConvention > getForeignAsyncConvention ( ) const ; <nl> + <nl> static bool classof ( const Decl * D ) { <nl> return D - > getKind ( ) > = DeclKind : : First_AbstractFunctionDecl & & <nl> D - > getKind ( ) < = DeclKind : : Last_AbstractFunctionDecl ; <nl> class FuncDecl : public AbstractFunctionDecl { <nl> DeclContext * Parent ) ; <nl> <nl> static FuncDecl * createImported ( ASTContext & Context , SourceLoc FuncLoc , <nl> - DeclName Name , SourceLoc NameLoc , bool Throws , <nl> + DeclName Name , SourceLoc NameLoc , <nl> + bool Async , bool Throws , <nl> ParameterList * BodyParams , Type FnRetType , <nl> DeclContext * Parent , ClangNode ClangN ) ; <nl> <nl> new file mode 100644 <nl> index 000000000000 . . f3657766e02a <nl> mmm / dev / null <nl> ppp b / include / swift / AST / ForeignAsyncConvention . h <nl> <nl> + / / = = = mmm ForeignAsyncConvention . h - Async conventions mmmmmmmmm - - * - C + + - * - = = = / / <nl> + / / <nl> + / / This source file is part of the Swift . org open source project <nl> + / / <nl> + / / Copyright ( c ) 2014 - 2020 Apple Inc . and the Swift project authors <nl> + / / Licensed under Apache License v2 . 0 with Runtime Library Exception <nl> + / / <nl> + / / See https : / / swift . org / LICENSE . txt for license information <nl> + / / See https : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> + / / <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / <nl> + / / This file defines the ForeignAsyncConvention structure , which <nl> + / / describes the rules for how to detect that a foreign API is asynchronous . <nl> + / / <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + # ifndef SWIFT_FOREIGN_ASYNC_CONVENTION_H <nl> + # define SWIFT_FOREIGN_ASYNC_CONVENTION_H <nl> + <nl> + # include " swift / AST / Type . h " <nl> + <nl> + namespace swift { <nl> + <nl> + / / / A small structure describing the async convention of a foreign declaration . <nl> + class ForeignAsyncConvention { <nl> + / / / The index of the completion handler parameters . <nl> + unsigned CompletionHandlerParamIndex ; <nl> + <nl> + / / / When non - zero , indicates which parameter to the completion handler is the <nl> + / / / Error ? parameter ( minus one ) that makes this async function also throwing . <nl> + unsigned CompletionHandlerErrorParamIndex ; <nl> + public : <nl> + ForeignAsyncConvention ( ) <nl> + : CompletionHandlerParamIndex ( 0 ) , CompletionHandlerErrorParamIndex ( 0 ) { } <nl> + <nl> + ForeignAsyncConvention ( unsigned completionHandlerParamIndex , <nl> + Optional < unsigned > completionHandlerErrorParamIndex ) <nl> + : CompletionHandlerParamIndex ( completionHandlerParamIndex ) , <nl> + CompletionHandlerErrorParamIndex ( <nl> + completionHandlerErrorParamIndex <nl> + ? * completionHandlerErrorParamIndex + 1 <nl> + : 0 ) { } <nl> + <nl> + / / / Retrieve the index of the completion handler parameter , which will be <nl> + / / / erased from the Swift signature of the imported async function . <nl> + unsigned completionHandlerParamIndex ( ) const { <nl> + return CompletionHandlerParamIndex ; <nl> + } <nl> + <nl> + / / / Retrieve the index of the \ c Error ? parameter in the completion handler ' s <nl> + / / / parameter list . When argument passed to this parameter is non - null , the <nl> + / / / provided error will be thrown by the async function . <nl> + Optional < unsigned > completionHandlerErrorParamIndex ( ) const { <nl> + if ( CompletionHandlerErrorParamIndex = = 0 ) <nl> + return None ; <nl> + <nl> + return CompletionHandlerErrorParamIndex - 1 ; <nl> + } <nl> + <nl> + / / / Whether the async function is throwing due to the completion handler <nl> + / / / having an \ c Error ? parameter . <nl> + / / / <nl> + / / / Equivalent to \ c static_cast < bool > ( completionHandlerErrorParamIndex ( ) ) . <nl> + bool isThrowing ( ) const { <nl> + return CompletionHandlerErrorParamIndex ! = 0 ; <nl> + } <nl> + <nl> + bool operator = = ( ForeignAsyncConvention other ) const { <nl> + return CompletionHandlerParamIndex = = other . CompletionHandlerParamIndex <nl> + & & CompletionHandlerErrorParamIndex = = <nl> + other . CompletionHandlerErrorParamIndex ; <nl> + } <nl> + bool operator ! = ( ForeignAsyncConvention other ) const { <nl> + return ! ( * this = = other ) ; <nl> + } <nl> + } ; <nl> + <nl> + } <nl> + <nl> + # endif <nl> mmm a / include / swift / AST / ForeignErrorConvention . h <nl> ppp b / include / swift / AST / ForeignErrorConvention . h <nl> class ForeignErrorConvention { <nl> } <nl> <nl> Info ( ) = default ; <nl> + <nl> + Kind getKind ( ) const { <nl> + return static_cast < Kind > ( TheKind ) ; <nl> + } <nl> } ; <nl> <nl> private : <nl> class ForeignErrorConvention { <nl> / / / Returns the physical result type of the function , for functions <nl> / / / that completely erase this information . <nl> CanType getResultType ( ) const { <nl> - assert ( getKind ( ) = = ZeroResult | | <nl> - getKind ( ) = = NonZeroResult ) ; <nl> + assert ( resultTypeErasedToVoid ( getKind ( ) ) ) ; <nl> return ResultType ; <nl> } <nl> - <nl> + <nl> + / / / Whether this kind of error import erases the result type to ' Void ' . <nl> + static bool resultTypeErasedToVoid ( Kind kind ) { <nl> + switch ( kind ) { <nl> + case ZeroResult : <nl> + case NonZeroResult : <nl> + return true ; <nl> + <nl> + case ZeroPreservedResult : <nl> + case NilResult : <nl> + case NonNilError : <nl> + return false ; <nl> + } <nl> + } <nl> + <nl> bool operator = = ( ForeignErrorConvention other ) const { <nl> return info . TheKind = = other . info . TheKind <nl> & & info . ErrorIsOwned = = other . info . ErrorIsOwned <nl> mmm a / lib / AST / ASTContext . cpp <nl> ppp b / lib / AST / ASTContext . cpp <nl> <nl> # include " ClangTypeConverter . h " <nl> # include " ForeignRepresentationInfo . h " <nl> # include " SubstitutionMapStorage . h " <nl> + # include " swift / AST / ForeignAsyncConvention . h " <nl> # include " swift / AST / ClangModuleLoader . h " <nl> # include " swift / AST / ConcreteDeclRef . h " <nl> # include " swift / AST / DiagnosticEngine . h " <nl> struct ASTContext : : Implementation { <nl> llvm : : DenseMap < const AbstractFunctionDecl * , <nl> ForeignErrorConvention > ForeignErrorConventions ; <nl> <nl> + / / / Map from declarations to foreign async conventions . <nl> + llvm : : DenseMap < const AbstractFunctionDecl * , <nl> + ForeignAsyncConvention > ForeignAsyncConventions ; <nl> + <nl> / / / Cache of previously looked - up precedence queries . <nl> AssociativityCacheType AssociativityCache ; <nl> <nl> AbstractFunctionDecl : : getForeignErrorConvention ( ) const { <nl> return it - > second ; <nl> } <nl> <nl> + void AbstractFunctionDecl : : setForeignAsyncConvention ( <nl> + const ForeignAsyncConvention & conv ) { <nl> + assert ( hasAsync ( ) & & " setting error convention on non - throwing decl " ) ; <nl> + auto & conventionsMap = getASTContext ( ) . getImpl ( ) . ForeignAsyncConventions ; <nl> + assert ( ! conventionsMap . count ( this ) & & " error convention already set " ) ; <nl> + conventionsMap . insert ( { this , conv } ) ; <nl> + } <nl> + <nl> + Optional < ForeignAsyncConvention > <nl> + AbstractFunctionDecl : : getForeignAsyncConvention ( ) const { <nl> + if ( ! hasAsync ( ) ) <nl> + return None ; <nl> + auto & conventionsMap = getASTContext ( ) . getImpl ( ) . ForeignAsyncConventions ; <nl> + auto it = conventionsMap . find ( this ) ; <nl> + if ( it = = conventionsMap . end ( ) ) return None ; <nl> + return it - > second ; <nl> + } <nl> + <nl> Optional < KnownFoundationEntity > swift : : getKnownFoundationEntity ( StringRef name ) { <nl> return llvm : : StringSwitch < Optional < KnownFoundationEntity > > ( name ) <nl> # define FOUNDATION_ENTITY ( Name ) . Case ( # Name , KnownFoundationEntity : : Name ) <nl> mmm a / lib / AST / Decl . cpp <nl> ppp b / lib / AST / Decl . cpp <nl> FuncDecl * FuncDecl : : createImplicit ( ASTContext & Context , <nl> <nl> FuncDecl * FuncDecl : : createImported ( ASTContext & Context , SourceLoc FuncLoc , <nl> DeclName Name , SourceLoc NameLoc , <nl> - bool Throws , ParameterList * BodyParams , <nl> + bool Async , bool Throws , <nl> + ParameterList * BodyParams , <nl> Type FnRetType , DeclContext * Parent , <nl> ClangNode ClangN ) { <nl> assert ( ClangN & & FnRetType ) ; <nl> auto * const FD = FuncDecl : : createImpl ( <nl> Context , SourceLoc ( ) , StaticSpellingKind : : None , FuncLoc , Name , NameLoc , <nl> - / * Async = * / false , SourceLoc ( ) , Throws , SourceLoc ( ) , <nl> + Async , SourceLoc ( ) , Throws , SourceLoc ( ) , <nl> / * GenericParams = * / nullptr , Parent , ClangN ) ; <nl> FD - > setParameters ( BodyParams ) ; <nl> FD - > setResultInterfaceType ( FnRetType ) ; <nl> mmm a / lib / ClangImporter / ClangAdapter . cpp <nl> ppp b / lib / ClangImporter / ClangAdapter . cpp <nl> bool importer : : isUnavailableInSwift ( <nl> return false ; <nl> } <nl> <nl> - OptionalTypeKind importer : : getParamOptionality ( version : : Version swiftVersion , <nl> - const clang : : ParmVarDecl * param , <nl> + OptionalTypeKind importer : : getParamOptionality ( const clang : : ParmVarDecl * param , <nl> bool knownNonNull ) { <nl> auto & clangCtx = param - > getASTContext ( ) ; <nl> <nl> mmm a / lib / ClangImporter / ClangAdapter . h <nl> ppp b / lib / ClangImporter / ClangAdapter . h <nl> bool isUnavailableInSwift ( const clang : : Decl * decl , const PlatformAvailability & , <nl> <nl> / / / Determine the optionality of the given Clang parameter . <nl> / / / <nl> - / / / \ param swiftLanguageVersion What version of Swift we ' re using , which affects <nl> - / / / how optionality is inferred . <nl> - / / / <nl> / / / \ param param The Clang parameter . <nl> / / / <nl> / / / \ param knownNonNull Whether a function - or method - level " nonnull " attribute <nl> / / / applies to this parameter . <nl> - OptionalTypeKind getParamOptionality ( version : : Version swiftLanguageVersion , <nl> - const clang : : ParmVarDecl * param , <nl> + OptionalTypeKind getParamOptionality ( const clang : : ParmVarDecl * param , <nl> bool knownNonNull ) ; <nl> } <nl> } <nl> mmm a / lib / ClangImporter / ClangImporter . cpp <nl> ppp b / lib / ClangImporter / ClangImporter . cpp <nl> void ClangImporter : : Implementation : : lookupValue ( <nl> clangDecl - > getMostRecentDecl ( ) ; <nl> <nl> CurrentVersion . forEachOtherImportNameVersion ( <nl> + SwiftContext . LangOpts . EnableExperimentalConcurrency , <nl> [ & ] ( ImportNameVersion nameVersion ) { <nl> if ( anyMatching ) <nl> return ; <nl> void ClangImporter : : Implementation : : lookupValue ( <nl> if ( ! newName . getDeclName ( ) . matchesRef ( name ) ) <nl> return ; <nl> <nl> + / / If we asked for an async import and didn ' t find one , skip this . <nl> + / / This filters out duplicates . <nl> + if ( nameVersion . supportsConcurrency ( ) & & <nl> + ! newName . getAsyncInfo ( ) ) <nl> + return ; <nl> + <nl> const clang : : DeclContext * clangDC = <nl> newName . getEffectiveContext ( ) . getAsDeclContext ( ) ; <nl> if ( ! clangDC | | ! clangDC - > isFileContext ( ) ) <nl> mmm a / lib / ClangImporter / ImportDecl . cpp <nl> ppp b / lib / ClangImporter / ImportDecl . cpp <nl> static FuncDecl * createFuncOrAccessor ( ASTContext & ctx , SourceLoc funcLoc , <nl> DeclName name , SourceLoc nameLoc , <nl> ParameterList * bodyParams , <nl> Type resultTy , <nl> + bool async , <nl> bool throws , <nl> DeclContext * dc , <nl> ClangNode clangNode ) { <nl> static FuncDecl * createFuncOrAccessor ( ASTContext & ctx , SourceLoc funcLoc , <nl> bodyParams , <nl> resultTy , dc , clangNode ) ; <nl> } else { <nl> - return FuncDecl : : createImported ( ctx , funcLoc , name , nameLoc , throws , <nl> + return FuncDecl : : createImported ( ctx , funcLoc , name , nameLoc , async , throws , <nl> bodyParams , resultTy , dc , clangNode ) ; <nl> } <nl> } <nl> namespace { <nl> / / / Whether the names we ' re importing are from the language version the user <nl> / / / requested , or if these are decls from another version <nl> bool isActiveSwiftVersion ( ) const { <nl> - return getVersion ( ) = = getActiveSwiftVersion ( ) ; <nl> + return getVersion ( ) . withConcurrency ( false ) = = getActiveSwiftVersion ( ) . withConcurrency ( false ) ; <nl> } <nl> <nl> void recordMemberInContext ( const DeclContext * dc , ValueDecl * member ) { <nl> namespace { <nl> return canonicalName ; <nl> } <nl> <nl> - / / Special handling when we import using the older Swift name . <nl> + / / Special handling when we import using the alternate Swift name . <nl> / / <nl> / / Import using the alternate Swift name . If that fails , or if it ' s <nl> / / identical to the active Swift name , we won ' t introduce an alternate <nl> namespace { <nl> if ( ! alternateName ) <nl> return ImportedName ( ) ; <nl> <nl> + / / Importing for concurrency is special in that the same declaration <nl> + / / is imported both with a completion handler parameter and as ' async ' , <nl> + / / creating two separate declarations . <nl> + if ( getVersion ( ) . supportsConcurrency ( ) ) { <nl> + / / If the resulting name isn ' t special for concurrency , it ' s not <nl> + / / different . <nl> + if ( ! alternateName . getAsyncInfo ( ) ) <nl> + return ImportedName ( ) ; <nl> + <nl> + / / Otherwise , it ' s a legitimately different import . <nl> + return alternateName ; <nl> + } <nl> + <nl> if ( alternateName . getDeclName ( ) = = canonicalName . getDeclName ( ) & & <nl> alternateName . getEffectiveContext ( ) . equalsWithoutResolving ( <nl> canonicalName . getEffectiveContext ( ) ) ) { <nl> namespace { <nl> return ; <nl> } <nl> <nl> + / / If this the active and current Swift versions differ based on <nl> + / / concurrency , it ' s not actually a variant . <nl> + if ( getVersion ( ) . supportsConcurrency ( ) ! = <nl> + getActiveSwiftVersion ( ) . supportsConcurrency ( ) ) { <nl> + return ; <nl> + } <nl> + <nl> / / TODO : some versions should be deprecated instead of unavailable <nl> <nl> ASTContext & ctx = decl - > getASTContext ( ) ; <nl> namespace { <nl> <nl> / / FIXME : Poor location info . <nl> auto nameLoc = Impl . importSourceLoc ( decl - > getLocation ( ) ) ; <nl> - result = createFuncOrAccessor ( Impl . SwiftContext , loc , accessorInfo , name , <nl> - nameLoc , bodyParams , resultTy , <nl> - / * throws * / false , dc , decl ) ; <nl> + result = createFuncOrAccessor ( <nl> + Impl . SwiftContext , loc , accessorInfo , name , <nl> + nameLoc , bodyParams , resultTy , <nl> + / * async * / false , / * throws * / false , dc , decl ) ; <nl> <nl> if ( ! dc - > isModuleScopeContext ( ) ) { <nl> if ( selfIsInOut ) <nl> namespace { <nl> } <nl> } <nl> <nl> + / / Determine whether the function is throwing and / or async . <nl> + bool throws = importedName . getErrorInfo ( ) . hasValue ( ) ; <nl> + bool async = false ; <nl> + auto asyncConvention = importedName . getAsyncInfo ( ) ; <nl> + if ( asyncConvention ) { <nl> + async = true ; <nl> + if ( asyncConvention - > isThrowing ( ) ) <nl> + throws = true ; <nl> + } <nl> + <nl> auto resultTy = importedType . getType ( ) ; <nl> auto isIUO = importedType . isImplicitlyUnwrapped ( ) ; <nl> <nl> namespace { <nl> importedName . getDeclName ( ) , <nl> / * nameLoc * / SourceLoc ( ) , <nl> bodyParams , resultTy , <nl> - importedName . getErrorInfo ( ) . hasValue ( ) , <nl> - dc , decl ) ; <nl> + async , throws , dc , decl ) ; <nl> <nl> result - > setAccess ( getOverridableAccessLevel ( dc ) ) ; <nl> <nl> namespace { <nl> result - > setForeignErrorConvention ( * errorConvention ) ; <nl> } <nl> <nl> + / / Record the async convention . <nl> + if ( asyncConvention ) { <nl> + result - > setForeignAsyncConvention ( * asyncConvention ) ; <nl> + } <nl> + <nl> / / Handle attributes . <nl> if ( decl - > hasAttr < clang : : IBActionAttr > ( ) & & <nl> isa < FuncDecl > ( result ) & & <nl> namespace { <nl> Impl . addAlternateDecl ( result , cast < ValueDecl > ( imported ) ) ; <nl> } <nl> } <nl> + <nl> return result ; <nl> } <nl> <nl> ConstructorDecl * SwiftDeclConverter : : importConstructor ( <nl> return known - > second ; <nl> <nl> / / Create the actual constructor . <nl> + assert ( ! importedName . getAsyncInfo ( ) ) ; <nl> auto result = Impl . createDeclWithClangNode < ConstructorDecl > ( <nl> objcMethod , AccessLevel : : Public , importedName . getDeclName ( ) , <nl> / * NameLoc = * / SourceLoc ( ) , failability , / * FailabilityLoc = * / SourceLoc ( ) , <nl> void SwiftDeclConverter : : importMirroredProtocolMembers ( <nl> if ( isa < AccessorDecl > ( afd ) ) <nl> return ; <nl> <nl> + / / Asynch methods are also always imported without async , so don ' t <nl> + / / record them here . <nl> + if ( afd - > hasAsync ( ) ) <nl> + return ; <nl> + <nl> auto objcMethod = <nl> dyn_cast_or_null < clang : : ObjCMethodDecl > ( member - > getClangDecl ( ) ) ; <nl> if ( ! objcMethod ) <nl> mmm a / lib / ClangImporter / ImportName . cpp <nl> ppp b / lib / ClangImporter / ImportName . cpp <nl> static bool omitNeedlessWordsInFunctionName ( <nl> Optional < unsigned > errorParamIndex , bool returnsSelf , bool isInstanceMethod , <nl> NameImporter & nameImporter ) { <nl> clang : : ASTContext & clangCtx = nameImporter . getClangContext ( ) ; <nl> - const version : : Version & swiftLanguageVersion = <nl> - nameImporter . getLangOpts ( ) . EffectiveLanguageVersion ; <nl> <nl> / / Collect the parameter type names . <nl> StringRef firstParamName ; <nl> static bool omitNeedlessWordsInFunctionName ( <nl> bool hasDefaultArg = <nl> ClangImporter : : Implementation : : inferDefaultArgument ( <nl> param - > getType ( ) , <nl> - getParamOptionality ( swiftLanguageVersion , param , <nl> - ! nonNullArgs . empty ( ) & & nonNullArgs [ i ] ) , <nl> + getParamOptionality ( param , ! nonNullArgs . empty ( ) & & nonNullArgs [ i ] ) , <nl> nameImporter . getIdentifier ( baseName ) , argumentName , i = = 0 , <nl> isLastParameter , nameImporter ) ! = DefaultArgumentKind : : None ; <nl> <nl> Optional < ForeignErrorConvention : : Info > NameImporter : : considerErrorImport ( <nl> return None ; <nl> } <nl> <nl> + / / / Whether the given parameter name identifies a completion handler . <nl> + static bool isCompletionHandlerParamName ( StringRef paramName ) { <nl> + return paramName = = " completionHandler " | | paramName = = " completion " | | <nl> + paramName = = " withCompletionHandler " ; <nl> + } <nl> + <nl> + / / / Whether the give base name implies that the first parameter is a completion <nl> + / / / handler . <nl> + / / / <nl> + / / / \ returns a trimmed base name when it does , \ c None others <nl> + static Optional < StringRef > isCompletionHandlerInBaseName ( StringRef basename ) { <nl> + if ( basename . endswith ( " WithCompletionHandler " ) ) { <nl> + return basename . drop_back ( strlen ( " WithCompletionHandler " ) ) ; <nl> + } <nl> + <nl> + if ( basename . endswith ( " WithCompletion " ) ) { <nl> + return basename . drop_back ( strlen ( " WithCompletion " ) ) ; <nl> + } <nl> + <nl> + return None ; <nl> + } <nl> + <nl> + <nl> + / / Determine whether the given type is a nullable NSError type . <nl> + static bool isNullableNSErrorType ( <nl> + clang : : ASTContext & clangCtx , clang : : QualType type ) { <nl> + auto objcPtrType = type - > getAs < clang : : ObjCObjectPointerType > ( ) ; <nl> + if ( ! objcPtrType ) <nl> + return false ; <nl> + <nl> + auto iface = objcPtrType - > getInterfaceDecl ( ) ; <nl> + if ( ! iface | | iface - > getName ( ) ! = " NSError " ) <nl> + return false ; <nl> + <nl> + / / If nullability is specified , check it . <nl> + if ( auto nullability = type - > getNullability ( clangCtx ) ) { <nl> + switch ( translateNullability ( * nullability ) ) { <nl> + case OTK_None : <nl> + return false ; <nl> + <nl> + case OTK_ImplicitlyUnwrappedOptional : <nl> + case OTK_Optional : <nl> + return true ; <nl> + } <nl> + } <nl> + <nl> + / / Otherwise , assume it ' s nullable . <nl> + return true ; <nl> + } <nl> + <nl> + Optional < ForeignAsyncConvention > <nl> + NameImporter : : considerAsyncImport ( <nl> + const clang : : ObjCMethodDecl * clangDecl , <nl> + StringRef & baseName , <nl> + SmallVectorImpl < StringRef > & paramNames , <nl> + ArrayRef < const clang : : ParmVarDecl * > params , <nl> + bool isInitializer , bool hasCustomName , <nl> + Optional < ForeignErrorConvention : : Info > errorInfo ) { <nl> + / / If there are no unclaimed parameters , there ' s no . <nl> + unsigned errorParamAdjust = errorInfo ? 1 : 0 ; <nl> + if ( params . size ( ) - errorParamAdjust = = 0 ) <nl> + return None ; <nl> + <nl> + / / If the # of parameter names doesn ' t line up with the # of parameters , <nl> + / / bail out . There are extra C parameters on the method or a custom name <nl> + / / was incorrect . <nl> + if ( params . size ( ) ! = paramNames . size ( ) + errorParamAdjust ) <nl> + return None ; <nl> + <nl> + / / The last parameter will be the completion handler for an async function . <nl> + unsigned completionHandlerParamIndex = params . size ( ) - 1 ; <nl> + unsigned completionHandlerParamNameIndex = paramNames . size ( ) - 1 ; <nl> + <nl> + / / Determine whether the naming indicates that this is a completion <nl> + / / handler . <nl> + Optional < StringRef > newBaseName ; <nl> + if ( isCompletionHandlerParamName ( paramNames [ completionHandlerParamNameIndex ] ) ) { <nl> + / / The argument label itself has an appropriate name . <nl> + } else if ( ! hasCustomName & & completionHandlerParamIndex = = 0 & & <nl> + ( newBaseName = isCompletionHandlerInBaseName ( baseName ) ) ) { <nl> + / / The base name implies that the first parameter is a completion handler . <nl> + } else if ( isCompletionHandlerParamName ( <nl> + params [ completionHandlerParamIndex ] - > getName ( ) ) ) { <nl> + / / The parameter has an appropriate name . <nl> + } else { <nl> + return None ; <nl> + } <nl> + <nl> + / / Used for returns once we ' ve determined that the method cannot be <nl> + / / imported as async , even though it has what looks like a completion handler <nl> + / / parameter . <nl> + auto notAsync = [ & ] ( const char * reason ) - > Optional < ForeignAsyncConvention > { <nl> + # ifdef ASYNC_IMPORT_DEBUG <nl> + llvm : : errs ( ) < < " * * * failed async import : " < < reason < < " \ n " ; <nl> + clangDecl - > dump ( llvm : : errs ( ) ) ; <nl> + # endif <nl> + <nl> + return None ; <nl> + } ; <nl> + <nl> + / / Initializers cannot be ' async ' . <nl> + / / FIXME : We might eventually allow this . <nl> + if ( isInitializer ) <nl> + return notAsync ( " initializers cannot be async " ) ; <nl> + <nl> + / / Accessors are never imported as async . <nl> + if ( clangDecl - > isPropertyAccessor ( ) ) <nl> + return notAsync ( " method is a property accessor " ) ; <nl> + <nl> + / / Check whether we method has a suitable return type . <nl> + if ( clangDecl - > getReturnType ( ) - > isVoidType ( ) ) { <nl> + / / ' void ' is the common case ; the method produces no synchronous result . <nl> + } else if ( errorInfo & & <nl> + ForeignErrorConvention : : resultTypeErasedToVoid ( <nl> + errorInfo - > getKind ( ) ) ) { <nl> + / / The method has been imported as throwing in a manner that erased the <nl> + / / result type to Void . <nl> + } else { <nl> + return notAsync ( " method does not return void " ) ; <nl> + } <nl> + <nl> + / / The completion handler parameter must have block type . <nl> + auto completionHandlerParam = params [ completionHandlerParamIndex ] ; <nl> + if ( ! isBlockParameter ( completionHandlerParam ) ) <nl> + return notAsync ( " parameter is not a block " ) ; <nl> + <nl> + / / Dig out the function type of the completion handler ' s block type . <nl> + / / If there is no prototype , ( e . g . , the completion handler is of type <nl> + / / void ( ^ ) ( ) ) , we cannot importer it . <nl> + auto completionHandlerFunctionType = <nl> + completionHandlerParam - > getType ( ) - > castAs < clang : : BlockPointerType > ( ) <nl> + - > getPointeeType ( ) - > getAs < clang : : FunctionProtoType > ( ) ; <nl> + if ( ! completionHandlerFunctionType ) <nl> + return notAsync ( " block parameter does not have a prototype " ) ; <nl> + <nl> + / / The completion handler parameter must itself return ' void ' . <nl> + if ( ! completionHandlerFunctionType - > getReturnType ( ) - > isVoidType ( ) ) <nl> + return notAsync ( " completion handler parameter does not return ' void ' " ) ; <nl> + <nl> + / / Scan the parameters of the block type to look for a parameter of a <nl> + / / nullable NSError type , which would indicate that the async method could <nl> + / / throw . <nl> + Optional < unsigned > completionHandlerErrorParamIndex ; <nl> + auto completionHandlerParamTypes = <nl> + completionHandlerFunctionType - > getParamTypes ( ) ; <nl> + auto & clangCtx = clangDecl - > getASTContext ( ) ; <nl> + for ( unsigned paramIdx : indices ( completionHandlerParamTypes ) ) { <nl> + auto paramType = completionHandlerParamTypes [ paramIdx ] ; <nl> + <nl> + / / We are only interested in nullable NSError parameters . <nl> + if ( ! isNullableNSErrorType ( clangCtx , paramType ) ) <nl> + continue ; <nl> + <nl> + / / If this is the first nullable error parameter , note that . <nl> + if ( ! completionHandlerErrorParamIndex ) { <nl> + completionHandlerErrorParamIndex = paramIdx ; <nl> + continue ; <nl> + } <nl> + <nl> + / / More than one nullable NSError parameter . Don ' t import as throwing . <nl> + completionHandlerErrorParamIndex = None ; <nl> + break ; <nl> + } <nl> + <nl> + / / Drop the completion handler parameter name . <nl> + paramNames . erase ( paramNames . begin ( ) + completionHandlerParamNameIndex ) ; <nl> + <nl> + / / Update the base name , if needed . <nl> + if ( newBaseName & & ! hasCustomName ) <nl> + baseName = * newBaseName ; <nl> + <nl> + return ForeignAsyncConvention ( <nl> + completionHandlerParamIndex , completionHandlerErrorParamIndex ) ; <nl> + } <nl> + <nl> bool NameImporter : : hasErrorMethodNameCollision ( <nl> const clang : : ObjCMethodDecl * method , unsigned paramIndex , <nl> StringRef suffixToStrip ) { <nl> ImportedName NameImporter : : importNameImpl ( const clang : : NamedDecl * D , <nl> else if ( parsedName . IsSetter ) <nl> result . info . accessorKind = ImportedAccessorKind : : PropertySetter ; <nl> <nl> - if ( method & & parsedName . IsFunctionName ) { <nl> + if ( method & & parsedName . IsFunctionName & & <nl> + result . info . accessorKind = = ImportedAccessorKind : : None ) { <nl> / / Get the parameters . <nl> ArrayRef < const clang : : ParmVarDecl * > params { method - > param_begin ( ) , <nl> method - > param_end ( ) } ; <nl> ImportedName NameImporter : : importNameImpl ( const clang : : NamedDecl * D , <nl> result . info . hasErrorInfo = true ; <nl> result . info . errorInfo = * errorInfo ; <nl> } <nl> + <nl> + if ( version . supportsConcurrency ( ) ) { <nl> + if ( auto asyncInfo = considerAsyncImport ( <nl> + method , parsedName . BaseName , parsedName . ArgumentLabels , <nl> + params , isInitializer , / * hasCustomName = * / true , <nl> + result . getErrorInfo ( ) ) ) { <nl> + result . info . hasAsyncInfo = true ; <nl> + result . info . asyncInfo = * asyncInfo ; <nl> + <nl> + / / Update the name to reflect the new parameter labels . <nl> + result . declName = formDeclName ( <nl> + swiftCtx , parsedName . BaseName , parsedName . ArgumentLabels , <nl> + / * isFunction = * / true , isInitializer ) ; <nl> + } <nl> + } <nl> } <nl> <nl> return result ; <nl> ImportedName NameImporter : : importNameImpl ( const clang : : NamedDecl * D , <nl> result . info . accessorKind = ImportedAccessorKind : : SubscriptSetter ; <nl> } <nl> <nl> + if ( version . supportsConcurrency ( ) & & <nl> + result . info . accessorKind = = ImportedAccessorKind : : None ) { <nl> + if ( auto asyncInfo = considerAsyncImport ( <nl> + objcMethod , baseName , argumentNames , params , isInitializer , <nl> + / * hasCustomName = * / false , <nl> + result . getErrorInfo ( ) ) ) { <nl> + result . info . hasAsyncInfo = true ; <nl> + result . info . asyncInfo = * asyncInfo ; <nl> + } <nl> + } <nl> + <nl> break ; <nl> } <nl> } <nl> bool NameImporter : : forEachDistinctImportName ( <nl> seenNames . push_back ( key ) ; <nl> <nl> activeVersion . forEachOtherImportNameVersion ( <nl> + swiftCtx . LangOpts . EnableExperimentalConcurrency , <nl> [ & ] ( ImportNameVersion nameVersion ) { <nl> / / Check to see if the name is different . <nl> ImportedName newName = importName ( decl , nameVersion ) ; <nl> mmm a / lib / ClangImporter / ImportName . h <nl> ppp b / lib / ClangImporter / ImportName . h <nl> <nl> # include " swift / Basic / Version . h " <nl> # include " swift / AST / ASTContext . h " <nl> # include " swift / AST / Decl . h " <nl> + # include " swift / AST / ForeignAsyncConvention . h " <nl> # include " swift / AST / ForeignErrorConvention . h " <nl> # include " clang / Sema / Sema . h " <nl> <nl> enum { NumImportedAccessorKindBits = 3 } ; <nl> <nl> / / / The name version <nl> class ImportNameVersion : public RelationalOperationsBase < ImportNameVersion > { <nl> - unsigned rawValue ; <nl> + unsigned rawValue : 31 ; <nl> + unsigned concurrency : 1 ; <nl> + <nl> friend llvm : : DenseMapInfo < ImportNameVersion > ; <nl> <nl> enum AsConstExpr_t { AsConstExpr } ; <nl> <nl> - constexpr ImportNameVersion ( ) : rawValue ( 0 ) { } <nl> + constexpr ImportNameVersion ( ) : rawValue ( 0 ) , concurrency ( false ) { } <nl> constexpr ImportNameVersion ( unsigned version , AsConstExpr_t ) <nl> - : rawValue ( version ) { } <nl> - explicit ImportNameVersion ( unsigned version ) : rawValue ( version ) { <nl> + : rawValue ( version ) , concurrency ( false ) { } <nl> + explicit ImportNameVersion ( unsigned version , bool concurrency = false ) <nl> + : rawValue ( version ) , concurrency ( concurrency ) { <nl> assert ( version > = 2 & & " only Swift 2 and later are supported " ) ; <nl> } <nl> public : <nl> class ImportNameVersion : public RelationalOperationsBase < ImportNameVersion > { <nl> return ImportNameVersion : : swift4_2 ( ) ; <nl> } <nl> unsigned major = version [ 0 ] ; <nl> - return ImportNameVersion ( major > = 5 ? major + 1 : major ) ; <nl> + return ImportNameVersion ( major > = 5 ? major + 1 : major , false ) ; <nl> } <nl> <nl> unsigned majorVersionNumber ( ) const { <nl> class ImportNameVersion : public RelationalOperationsBase < ImportNameVersion > { <nl> return llvm : : VersionTuple ( majorVersionNumber ( ) , minorVersionNumber ( ) ) ; <nl> } <nl> <nl> + / / / Whether to consider importing functions as ' async ' . <nl> + bool supportsConcurrency ( ) const { return concurrency ; } <nl> + <nl> + ImportNameVersion withConcurrency ( bool concurrency ) const { <nl> + ImportNameVersion result = * this ; <nl> + result . concurrency = concurrency ; <nl> + return result ; <nl> + } <nl> + <nl> bool operator = = ( ImportNameVersion other ) const { <nl> - return rawValue = = other . rawValue ; <nl> + return rawValue = = other . rawValue & & concurrency = = other . concurrency ; <nl> } <nl> bool operator < ( ImportNameVersion other ) const { <nl> - return rawValue < other . rawValue ; <nl> + return rawValue < other . rawValue | | <nl> + ( rawValue = = other . rawValue & & concurrency < other . concurrency ) ; <nl> } <nl> <nl> / / / Calls \ p action for each name version other than this one , first going <nl> class ImportNameVersion : public RelationalOperationsBase < ImportNameVersion > { <nl> / / / <nl> / / / This is the most useful order for importing compatibility stubs . <nl> void forEachOtherImportNameVersion ( <nl> + bool withConcurrency , <nl> llvm : : function_ref < void ( ImportNameVersion ) > action ) const { <nl> assert ( * this > = ImportNameVersion : : swift2 ( ) ) ; <nl> <nl> ImportNameVersion nameVersion = * this ; <nl> + assert ( ! nameVersion . supportsConcurrency ( ) ) ; <nl> + <nl> + / / If we ' ve been asked to also consider concurrency , do so for the <nl> + / / primary version ( only ) . <nl> + if ( withConcurrency ) { <nl> + action ( nameVersion . withConcurrency ( true ) ) ; <nl> + } <nl> + <nl> while ( nameVersion > ImportNameVersion : : swift2 ( ) ) { <nl> - - nameVersion . rawValue ; <nl> action ( nameVersion ) ; <nl> class ImportedName { <nl> / / / throwing Swift methods , describes how the mapping is performed . <nl> ForeignErrorConvention : : Info errorInfo ; <nl> <nl> + / / / For names that map Objective - C completion handlers into async <nl> + / / / Swift methods , describes how the mapping is performed . <nl> + ForeignAsyncConvention asyncInfo ; <nl> + <nl> / / / For a declaration name that makes the declaration into an <nl> / / / instance member , the index of the " Self " parameter . <nl> unsigned selfIndex ; <nl> class ImportedName { <nl> <nl> unsigned hasErrorInfo : 1 ; <nl> <nl> + unsigned hasAsyncInfo : 1 ; <nl> + <nl> Info ( ) <nl> : errorInfo ( ) , selfIndex ( ) , initKind ( CtorInitializerKind : : Designated ) , <nl> accessorKind ( ImportedAccessorKind : : None ) , hasCustomName ( false ) , <nl> droppedVariadic ( false ) , importAsMember ( false ) , hasSelfIndex ( false ) , <nl> - hasErrorInfo ( false ) { } <nl> + hasErrorInfo ( false ) , hasAsyncInfo ( false ) { } <nl> } info ; <nl> <nl> public : <nl> class ImportedName { <nl> return None ; <nl> } <nl> <nl> + / / / For names that map Objective - C methods with completion handlers into <nl> + / / / async Swift methods , describes how the mapping is performed . <nl> + Optional < ForeignAsyncConvention > getAsyncInfo ( ) const { <nl> + if ( info . hasAsyncInfo ) <nl> + return info . asyncInfo ; <nl> + return None ; <nl> + } <nl> + <nl> / / / For a declaration name that makes the declaration into an <nl> / / / instance member , the index of the " Self " parameter . <nl> Optional < unsigned > getSelfIndex ( ) const { <nl> class NameImporter { <nl> ArrayRef < const clang : : ParmVarDecl * > params , <nl> bool isInitializer , bool hasCustomName ) ; <nl> <nl> + Optional < ForeignAsyncConvention > <nl> + considerAsyncImport ( const clang : : ObjCMethodDecl * clangDecl , <nl> + StringRef & baseName , <nl> + SmallVectorImpl < StringRef > & paramNames , <nl> + ArrayRef < const clang : : ParmVarDecl * > params , <nl> + bool isInitializer , bool hasCustomName , <nl> + Optional < ForeignErrorConvention : : Info > errorInfo ) ; <nl> + <nl> EffectiveClangContext determineEffectiveContext ( const clang : : NamedDecl * , <nl> const clang : : DeclContext * , <nl> ImportNameVersion version ) ; <nl> mmm a / lib / ClangImporter / ImportType . cpp <nl> ppp b / lib / ClangImporter / ImportType . cpp <nl> ParameterList * ClangImporter : : Implementation : : importFunctionParameterList ( <nl> <nl> / / Check nullability of the parameter . <nl> OptionalTypeKind OptionalityOfParam = <nl> - getParamOptionality ( SwiftContext . LangOpts . EffectiveLanguageVersion , <nl> - param , ! nonNullArgs . empty ( ) & & nonNullArgs [ index ] ) ; <nl> + getParamOptionality ( param , ! nonNullArgs . empty ( ) & & nonNullArgs [ index ] ) ; <nl> <nl> ImportTypeKind importKind = ImportTypeKind : : Parameter ; <nl> if ( param - > hasAttr < clang : : CFReturnsRetainedAttr > ( ) ) <nl> static Type mapGenericArgs ( const DeclContext * fromDC , <nl> return type . subst ( subs ) ; <nl> } <nl> <nl> + / / / Decompose the type of a completion handler parameter in a function <nl> + / / / imported as ' async ' and produce the result type of the ' async ' function . <nl> + static Type decomposeCompletionHandlerType ( <nl> + Type paramTy , ForeignAsyncConvention info ) { <nl> + auto fnType = paramTy - > lookThroughAllOptionalTypes ( ) - > getAs < FunctionType > ( ) ; <nl> + if ( ! fnType ) <nl> + return Type ( ) ; <nl> + <nl> + SmallVector < TupleTypeElt , 2 > resultTypeElts ; <nl> + auto params = fnType - > getParams ( ) ; <nl> + for ( unsigned paramIdx : indices ( params ) ) { <nl> + const auto & param = params [ paramIdx ] ; <nl> + if ( param . isInOut ( ) | | param . isVariadic ( ) ) <nl> + return Type ( ) ; <nl> + <nl> + / / If there is an error parameter to the completion handler , it is <nl> + / / not part of the result type of the asynchronous function . <nl> + if ( info . completionHandlerErrorParamIndex ( ) & & <nl> + paramIdx = = * info . completionHandlerErrorParamIndex ( ) ) <nl> + continue ; <nl> + <nl> + resultTypeElts . push_back ( param . getPlainType ( ) ) ; <nl> + } <nl> + <nl> + switch ( resultTypeElts . size ( ) ) { <nl> + case 0 : <nl> + return paramTy - > getASTContext ( ) . getVoidDecl ( ) - > getDeclaredInterfaceType ( ) ; <nl> + <nl> + case 1 : <nl> + return resultTypeElts . front ( ) . getType ( ) ; <nl> + <nl> + default : <nl> + return TupleType : : get ( resultTypeElts , paramTy - > getASTContext ( ) ) ; <nl> + } <nl> + } <nl> + <nl> ImportedType ClangImporter : : Implementation : : importMethodParamsAndReturnType ( <nl> const DeclContext * dc , const clang : : ObjCMethodDecl * clangDecl , <nl> ArrayRef < const clang : : ParmVarDecl * > params , bool isVariadic , <nl> ImportedType ClangImporter : : Implementation : : importMethodParamsAndReturnType ( <nl> CanType origSwiftResultTy ; <nl> Optional < ForeignErrorConvention : : Info > errorInfo = <nl> importedName . getErrorInfo ( ) ; <nl> + auto asyncInfo = importedName . getAsyncInfo ( ) ; <nl> OptionalTypeKind OptionalityOfReturn ; <nl> if ( clangDecl - > hasAttr < clang : : ReturnsNonNullAttr > ( ) ) { <nl> OptionalityOfReturn = OTK_None ; <nl> ImportedType ClangImporter : : Implementation : : importMethodParamsAndReturnType ( <nl> continue ; <nl> } <nl> <nl> + bool paramIsCompletionHandler = <nl> + asyncInfo & & paramIndex = = asyncInfo - > completionHandlerParamIndex ( ) ; <nl> + <nl> / / Import the parameter type into Swift . <nl> <nl> / / Check nullability of the parameter . <nl> OptionalTypeKind optionalityOfParam <nl> - = getParamOptionality ( SwiftContext . LangOpts . EffectiveLanguageVersion , <nl> - param , <nl> + = getParamOptionality ( param , <nl> ! nonNullArgs . empty ( ) & & nonNullArgs [ paramIndex ] ) ; <nl> <nl> bool allowNSUIntegerAsIntInParam = isFromSystemModule ; <nl> ImportedType ClangImporter : : Implementation : : importMethodParamsAndReturnType ( <nl> continue ; <nl> } <nl> <nl> + / / If this is a completion handler , figure out it ' s effect on the result <nl> + / / type but don ' t build it into the parameter type . <nl> + if ( paramIsCompletionHandler ) { <nl> + if ( Type replacedSwiftResultTy = <nl> + decomposeCompletionHandlerType ( swiftParamTy , * asyncInfo ) ) { <nl> + swiftResultTy = replacedSwiftResultTy ; <nl> + <nl> + / / FIXME : We will need an equivalent to " error parameter is replaced " <nl> + / / for asynchronous functions . Perhaps add " async : ( ) " ? <nl> + continue ; <nl> + } <nl> + <nl> + llvm_unreachable ( " async info computed incorrectly ? " ) ; <nl> + } <nl> + <nl> / / Map __attribute__ ( ( noescape ) ) to @ noescape . <nl> bool addNoEscapeAttr = false ; <nl> if ( param - > hasAttr < clang : : NoEscapeAttr > ( ) ) { <nl> mmm a / lib / ClangImporter / SwiftLookupTable . cpp <nl> ppp b / lib / ClangImporter / SwiftLookupTable . cpp <nl> SwiftNameLookupExtension : : hashExtension ( llvm : : hash_code code ) const { <nl> SWIFT_LOOKUP_TABLE_VERSION_MAJOR , <nl> SWIFT_LOOKUP_TABLE_VERSION_MINOR , <nl> inferImportAsMember , <nl> + swiftCtx . LangOpts . EnableExperimentalConcurrency , <nl> version : : getSwiftFullVersion ( ) ) ; <nl> } <nl> <nl> new file mode 100644 <nl> index 000000000000 . . 15b149a89c5d <nl> mmm / dev / null <nl> ppp b / test / ClangImporter / objc_async . swift <nl> <nl> + / / RUN : % target - swift - frontend ( mock - sdk : % clang - importer - sdk ) - emit - sil - I % S / Inputs / custom - modules - enable - experimental - concurrency % s - verify <nl> + <nl> + / / REQUIRES : objc_interop <nl> + import Foundation <nl> + import ObjCConcurrency <nl> + <nl> + func testSlowServer ( slowServer : SlowServer ) async { <nl> + let _ : Int = await slowServer . doSomethingSlow ( " mail " ) <nl> + let _ : Bool = await slowServer . checkAvailability ( ) <nl> + let _ : String = await slowServer . findAnswer ( ) ? ? " nope " <nl> + let _ : String = await slowServer . findAnswerFailingly ( ) ? ? " nope " <nl> + / / FIXME : expected - error @ - 2 { { call can throw , but it is not marked with ' try ' } } <nl> + / / FIXME : expected - error @ - 2 { { call can throw , but it is not marked with ' try ' } } <nl> + let _ : Void = await slowServer . doSomethingFun ( " jump " ) <nl> + let _ : ( Int ) - > Void = slowServer . completionHandler <nl> + } <nl> + <nl> + func testSlowServerOldSchool ( slowServer : SlowServer ) { <nl> + var i1 : Int = 0 <nl> + slowServer . doSomethingSlow ( " mail " ) { i in <nl> + i1 = i <nl> + } <nl> + print ( i1 ) <nl> + } <nl> new file mode 100644 <nl> index 000000000000 . . 7d3029fff8be <nl> mmm / dev / null <nl> ppp b / test / IDE / print_clang_objc_async . swift <nl> <nl> + / / RUN : % empty - directory ( % t ) <nl> + <nl> + / / RUN : % target - swift - ide - test ( mock - sdk : % clang - importer - sdk ) - print - module - source - filename % s - module - to - print = ObjCConcurrency - function - definitions = false - enable - experimental - concurrency > % t / ObjCConcurrency . printed . txt <nl> + / / RUN : % FileCheck - input - file % t / ObjCConcurrency . printed . txt % s <nl> + <nl> + / / REQUIRES : objc_interop <nl> + <nl> + / / CHECK - LABEL : class SlowServer : NSObject { <nl> + / / CHECK - DAG : func doSomethingSlow ( _ operation : String , completionHandler handler : @ escaping ( Int ) - > Void ) <nl> + / / CHECK - DAG : func doSomethingSlow ( _ operation : String ) async - > Int <nl> + / / CHECK - DAG : func doSomethingDangerous ( _ operation : String , completionHandler handler : ( ( String ? , Error ? ) - > Void ) ? = nil ) <nl> + / / CHECK - DAG : func doSomethingDangerous ( _ operation : String ) async throws - > String ? <nl> + / / CHECK - DAG : func checkAvailability ( completionHandler : @ escaping ( Bool ) - > Void ) <nl> + / / CHECK - DAG : func checkAvailability ( ) async - > Bool <nl> + / / CHECK - DAG : func findAnswer ( completionHandler handler : @ escaping ( String ? , Error ? ) - > Void ) <nl> + / / CHECK - DAG : func findAnswer ( ) async throws - > String ? <nl> + / / CHECK - DAG : func findAnswerFailingly ( completionHandler handler : @ escaping ( String ? , Error ? ) - > Void ) throws <nl> + / / CHECK - DAG : func findAnswerFailingly ( ) async throws - > String ? <nl> + / / CHECK - DAG : func doSomethingFun ( _ operation : String ) async <nl> + / / CHECK : { { ^ [ } ] $ } } <nl> new file mode 100644 <nl> index 000000000000 . . b03e3530a496 <nl> mmm / dev / null <nl> ppp b / test / Inputs / clang - importer - sdk / usr / include / ObjCConcurrency . h <nl> <nl> + @ import Foundation ; <nl> + @ import ctypes ; <nl> + <nl> + # pragma clang assume_nonnull begin <nl> + <nl> + @ interface SlowServer : NSObject <nl> + - ( void ) doSomethingSlow : ( NSString * ) operation completionHandler : ( void ( ^ ) ( NSInteger ) ) handler ; <nl> + - ( void ) doSomethingDangerous : ( NSString * ) operation completionHandler : ( void ( ^ _Nullable ) ( NSString * _Nullable , NSError * _Nullable ) ) handler ; <nl> + - ( void ) checkAvailabilityWithCompletionHandler : ( void ( ^ ) ( BOOL isAvailable ) ) completionHandler ; <nl> + - ( void ) findAnswerAsynchronously : ( void ( ^ ) ( NSString * _Nullable , NSError * _Nullable ) ) handler __attribute__ ( ( swift_name ( " findAnswer ( completionHandler : ) " ) ) ) ; <nl> + - ( BOOL ) findAnswerFailinglyWithError : ( NSError * _Nullable * _Nullable ) error completion : ( void ( ^ ) ( NSString * _Nullable , NSError * _Nullable ) ) handler __attribute__ ( ( swift_name ( " findAnswerFailingly ( completionHandler : ) " ) ) ) ; <nl> + - ( void ) doSomethingFun : ( NSString * ) operation then : ( void ( ^ ) ( void ) ) completionHandler ; <nl> + @ property ( readwrite ) void ( ^ completionHandler ) ( NSInteger ) ; <nl> + @ end <nl> + <nl> + # pragma clang assume_nonnull end <nl> mmm a / test / Inputs / clang - importer - sdk / usr / include / module . map <nl> ppp b / test / Inputs / clang - importer - sdk / usr / include / module . map <nl> module WinBOOL { <nl> header " winbool . h " <nl> export * <nl> } <nl> + <nl> + module ObjCConcurrency { <nl> + header " ObjCConcurrency . h " <nl> + export * <nl> + } <nl> \ No newline at end of file <nl> mmm a / utils / swift - api - dump . py <nl> ppp b / utils / swift - api - dump . py <nl> def create_parser ( ) : <nl> parser . add_argument ( ' - - enable - infer - import - as - member ' , action = ' store_true ' , <nl> help = ' Infer when a global could be imported as a ' + <nl> ' member . ' ) <nl> + parser . add_argument ( ' - - enable - experimental - concurrency ' , action = ' store_true ' , <nl> + help = ' Enable experimental concurrency model . ' ) <nl> parser . add_argument ( ' - swift - version ' , metavar = ' N ' , <nl> help = ' the Swift version to use ' ) <nl> parser . add_argument ( ' - show - overlay ' , action = ' store_true ' , <nl> def main ( ) : <nl> extra_args = [ ' - skip - imports ' ] <nl> if args . enable_infer_import_as_member : <nl> extra_args = extra_args + [ ' - enable - infer - import - as - member ' ] <nl> + if args . enable_experimental_concurrency : <nl> + extra_args = extra_args + [ ' - enable - experimental - concurrency ' ] <nl> if args . swift_version : <nl> extra_args = extra_args + [ ' - swift - version ' , ' % s ' % args . swift_version ] <nl> <nl>
Merge pull request from DougGregor / concurrency - objc - import - async
apple/swift
10fa19b2b543684d76bdbedbaac7743fa3a9b194
2020-08-29T02:48:02Z
mmm a / atom / browser / mac / atom_application_delegate . mm <nl> ppp b / atom / browser / mac / atom_application_delegate . mm <nl> - ( BOOL ) applicationShouldHandleReopen : ( NSApplication * ) theApplication <nl> return flag ; <nl> } <nl> <nl> + - ( BOOL ) application : ( NSApplication * ) sender <nl> + continueUserActivity : ( NSUserActivity * ) userActivity <nl> + restorationHandler : ( void ( ^ ) ( NSArray * restorableObjects ) ) restorationHandler { <nl> + std : : string activity_type ( base : : SysNSStringToUTF8 ( userActivity . activityType ) ) ; <nl> + <nl> + std : : map < std : : string , std : : string > user_info ; <nl> + <nl> + NSArray * keys = [ userActivity . userInfo allKeys ] ; <nl> + for ( NSString * key in keys ) <nl> + { <nl> + NSString * value = [ userActivity . userInfo objectForKey : key ] ; <nl> + std : : string key_str ( base : : SysNSStringToUTF8 ( key ) ) ; <nl> + std : : string value_str ( base : : SysNSStringToUTF8 ( value ) ) ; <nl> + user_info [ key_str ] = value_str ; <nl> + } <nl> + <nl> + atom : : Browser * browser = atom : : Browser : : Get ( ) ; <nl> + return browser - > ContinueUserActivity ( activity_type , user_info ) ? YES : NO ; <nl> + } <nl> + <nl> @ end <nl>
Add the AppDelegate override for restoring from hand - off , and fire the app event .
electron/electron
3a9a1d35d7356c45bb292d3c176520d8c25119d2
2016-04-30T00:37:01Z
mmm a / docs / README . md <nl> ppp b / docs / README . md <nl> These individual tutorials expand on topics discussed in the guide above . <nl> * Electron Releases & Developer Feedback <nl> * [ Versioning Policy ] ( tutorial / electron - versioning . md ) <nl> * [ Release Timelines ] ( tutorial / electron - timelines . md ) <nl> - * [ App Feedback Program ] ( tutorial / app - feedback - program . md ) <nl> * [ Packaging App Source Code with asar ] ( tutorial / application - packaging . md ) <nl> * [ Generating asar Archives ] ( tutorial / application - packaging . md # generating - asar - archives ) <nl> * [ Using asar Archives ] ( tutorial / application - packaging . md # using - asar - archives ) <nl> deleted file mode 100644 <nl> index 862dec5de9c3 . . 000000000000 <nl> mmm a / docs / tutorial / app - feedback - program . md <nl> ppp / dev / null <nl> <nl> - # Electron App Feedback Program <nl> - <nl> - Electron is working on building a streamlined release process and having faster releases . To help with that , we have the App Feedback Program for large - scale Electron apps to test our beta releases and report app - specific issues to the Electron team . We use this program to help us prioritize work and get applications upgraded to the next stable release as soon as possible . There are a few requirements we expect from participants , such as attending short , online weekly check - ins . Please visit the [ blog post ] ( https : / / electronjs . org / blog / app - feedback - program ) for details and sign - up . <nl>
docs : remove app feedback program doc ( )
electron/electron
f373cc770f3828eaf2125bd90f5e4ad6762cd512
2020-05-21T22:39:13Z
mmm a / src / app / commands / cmd_set_loop_section . cpp <nl> ppp b / src / app / commands / cmd_set_loop_section . cpp <nl> void SetLoopSectionCommand : : onExecute ( Context * ctx ) <nl> Transaction transaction ( writer . context ( ) , " Remove Loop " ) ; <nl> transaction . execute ( new cmd : : RemoveFrameTag ( sprite , loopTag ) ) ; <nl> transaction . commit ( ) ; <nl> - delete loopTag ; <nl> } <nl> } <nl> <nl>
Fix crash removing the loop section with SetLoopSectionCommand
aseprite/aseprite
50fd6e9e2f706f4bf6ada6c6326274ebda6f381d
2015-03-11T18:02:08Z
mmm a / modules / imgproc / src / color_rgb . cpp <nl> ppp b / modules / imgproc / src / color_rgb . cpp <nl> <nl> # include " precomp . hpp " <nl> # include " color . hpp " <nl> <nl> + # define IPP_DISABLE_CVTCOLOR_GRAY2BGR_8UC3 1 <nl> + <nl> namespace cv <nl> { <nl> <nl> static ippiGeneralFunc ippiRGB2GrayC4Tab [ ] = <nl> } ; <nl> <nl> <nl> + # if ! IPP_DISABLE_CVTCOLOR_GRAY2BGR_8UC3 <nl> static IppStatus ippiGrayToRGB_C1C3R ( const Ipp8u * pSrc , int srcStep , Ipp8u * pDst , int dstStep , IppiSize roiSize ) <nl> { <nl> return CV_INSTRUMENT_FUN_IPP ( ippiGrayToRGB_8u_C1C3R , pSrc , srcStep , pDst , dstStep , roiSize ) ; <nl> } <nl> + # endif <nl> static IppStatus ippiGrayToRGB_C1C3R ( const Ipp16u * pSrc , int srcStep , Ipp16u * pDst , int dstStep , IppiSize roiSize ) <nl> { <nl> return CV_INSTRUMENT_FUN_IPP ( ippiGrayToRGB_16u_C1C3R , pSrc , srcStep , pDst , dstStep , roiSize ) ; <nl> void cvtGraytoBGR ( const uchar * src_data , size_t src_step , <nl> if ( dcn = = 3 ) <nl> { <nl> if ( depth = = CV_8U ) <nl> + { <nl> + # if ! IPP_DISABLE_CVTCOLOR_GRAY2BGR_8UC3 <nl> ippres = CvtColorIPPLoop ( src_data , src_step , dst_data , dst_step , width , height , IPPGray2BGRFunctor < Ipp8u > ( ) ) ; <nl> + # endif <nl> + } <nl> else if ( depth = = CV_16U ) <nl> ippres = CvtColorIPPLoop ( src_data , src_step , dst_data , dst_step , width , height , IPPGray2BGRFunctor < Ipp16u > ( ) ) ; <nl> else <nl>
imgproc ( cvtColor ) : temporary disable IPP for 8U GRAY2BGR mode
opencv/opencv
b00758babef1e10973ba80a9e0eff6156fc9156f
2018-08-08T10:58:45Z
mmm a / build / deps / github_hashes / facebook / folly - rev . txt <nl> ppp b / build / deps / github_hashes / facebook / folly - rev . txt <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 11018acbb7eaf77ef91aaff9f7b59cb64a5fb0b4 <nl> + Subproject commit e7e80abf3d0c97355087dd3c5964966844b27353 <nl>
Updating submodules
facebook/watchman
f9512bbb901933f320a1b8632c9b2e39475185bb
2020-08-06T01:42:00Z
mmm a / tools / depends / native / gas - preprocessor - native / gas - preprocessor . pl <nl> ppp b / tools / depends / native / gas - preprocessor - native / gas - preprocessor . pl <nl> <nl> my % macro_args_default ; <nl> my $ macro_count = 0 ; <nl> my $ altmacro = 0 ; <nl> + my $ in_irp = 0 ; <nl> <nl> my @ pass1_lines ; <nl> my @ ifstack ; <nl> <nl> <nl> sub eval_expr { <nl> my $ expr = $ _ [ 0 ] ; <nl> - $ expr = ~ s / ( [ A - Za - z . _ ] [ A - Za - z0 - 9 . _ ] * ) / $ symbols { $ 1 } / g ; <nl> + while ( $ expr = ~ / ( [ A - Za - z . _ ] [ A - Za - z0 - 9 . _ ] * ) / g ) { <nl> + my $ sym = $ 1 ; <nl> + $ expr = ~ s / $ sym / $ symbols { $ sym } / if defined $ symbols { $ sym } ; <nl> + } <nl> eval $ expr ; <nl> } <nl> <nl> sub handle_if { <nl> } <nl> } <nl> <nl> - sub parse_line { <nl> + sub parse_if_line { <nl> my $ line = @ _ [ 0 ] ; <nl> <nl> # evaluate . if blocks <nl> if ( scalar ( @ ifstack ) ) { <nl> - if ( / \ . endif / ) { <nl> + if ( $ line = ~ / \ . endif / ) { <nl> pop ( @ ifstack ) ; <nl> - return ; <nl> + return 1 ; <nl> } elsif ( $ line = ~ / \ . elseif \ s + ( . * ) / ) { <nl> if ( $ ifstack [ - 1 ] = = 0 ) { <nl> $ ifstack [ - 1 ] = ! ! eval_expr ( $ 1 ) ; <nl> } elsif ( $ ifstack [ - 1 ] > 0 ) { <nl> $ ifstack [ - 1 ] = - $ ifstack [ - 1 ] ; <nl> } <nl> - return ; <nl> - } elsif ( / \ . else / ) { <nl> + return 1 ; <nl> + } elsif ( $ line = ~ / \ . else / ) { <nl> $ ifstack [ - 1 ] = ! $ ifstack [ - 1 ] ; <nl> - return ; <nl> + return 1 ; <nl> } elsif ( handle_if ( $ line ) ) { <nl> - return ; <nl> + return 1 ; <nl> } <nl> <nl> # discard lines in false . if blocks <nl> foreach my $ i ( 0 . . $ # ifstack ) { <nl> if ( $ ifstack [ $ i ] < = 0 ) { <nl> - return ; <nl> + return 1 ; <nl> } <nl> } <nl> } <nl> + return 0 ; <nl> + } <nl> + <nl> + sub parse_line { <nl> + my $ line = @ _ [ 0 ] ; <nl> + <nl> + return if ( parse_if_line ( $ line ) ) ; <nl> <nl> if ( / \ . macro / ) { <nl> $ macro_level + + ; <nl> sub parse_line { <nl> $ current_macro = ' ' ; <nl> return ; <nl> } <nl> + } elsif ( / \ . irp / or / \ . rept / ) { <nl> + $ in_irp = 1 ; <nl> + } elsif ( / . endr / ) { <nl> + $ in_irp = 0 ; <nl> } <nl> <nl> if ( $ macro_level > 1 ) { <nl> sub parse_line { <nl> } <nl> } <nl> <nl> + sub handle_set { <nl> + my $ line = $ _ [ 0 ] ; <nl> + if ( $ line = ~ / \ . set \ s + ( . * ) , \ s * ( . * ) / ) { <nl> + $ symbols { $ 1 } = eval_expr ( $ 2 ) ; <nl> + } <nl> + } <nl> + <nl> sub expand_macros { <nl> my $ line = @ _ [ 0 ] ; <nl> <nl> # handle . if directives ; apple ' s assembler doesn ' t support important non - basic ones <nl> # evaluating them is also needed to handle recursive macros <nl> - if ( handle_if ( $ line ) ) { <nl> + if ( ! $ in_irp & & handle_if ( $ line ) ) { <nl> return ; <nl> } <nl> <nl> sub expand_macros { <nl> <nl> $ line = ~ s / \ % ( [ ^ , ] * ) / eval_expr ( $ 1 ) / eg if $ altmacro ; <nl> <nl> - if ( $ line = ~ / \ . set \ s + ( . * ) , \ s * ( . * ) / ) { <nl> - $ symbols { $ 1 } = eval_expr ( $ 2 ) ; <nl> - } <nl> + handle_set ( $ line ) ; <nl> <nl> if ( $ line = ~ / ( \ S + : | ) \ s * ( [ \ w \ d \ . ] + ) \ s * ( . * ) / & & exists $ macro_lines { $ 2 } ) { <nl> push ( @ pass1_lines , $ 1 ) ; <nl> sub expand_macros { <nl> <nl> my @ sections ; <nl> my $ num_repts ; <nl> - my $ rept_lines ; <nl> + my @ rept_lines ; <nl> <nl> my % literal_labels ; # for ldr < reg > , = < expr > <nl> my $ literal_num = 0 ; <nl> sub expand_macros { <nl> my % thumb_labels ; <nl> my % call_targets ; <nl> <nl> - my $ in_irp = 0 ; <nl> my @ irp_args ; <nl> my $ irp_param ; <nl> <nl> # pass 2 : parse . rept and . if variants <nl> - # NOTE : since we don ' t implement a proper parser , using . rept with a <nl> - # variable assigned from . set is not supported <nl> foreach my $ line ( @ pass1_lines ) { <nl> # handle . previous ( only with regard to . section not . subsection ) <nl> if ( $ line = ~ / \ . ( section | text | const_data ) / ) { <nl> sub expand_macros { <nl> if ( $ fix_unreq ) { <nl> if ( $ line = ~ / \ . unreq \ s + ( . * ) / ) { <nl> $ line = " . unreq " . lc ( $ 1 ) . " \ n " ; <nl> - print ASMFILE " . unreq " . uc ( $ 1 ) . " \ n " ; <nl> + $ line . = " . unreq " . uc ( $ 1 ) . " \ n " ; <nl> } <nl> } <nl> <nl> if ( $ line = ~ / \ . rept \ s + ( . * ) / ) { <nl> $ num_repts = $ 1 ; <nl> - $ rept_lines = " \ n " ; <nl> + @ rept_lines = ( " \ n " ) ; <nl> <nl> # handle the possibility of repeating another directive on the same line <nl> # . endr on the same line is not valid , I don ' t know if a non - directive is <nl> if ( $ num_repts = ~ s / ( \ . \ w + . * ) / / ) { <nl> - $ rept_lines . = " $ 1 \ n " ; <nl> + push ( @ rept_lines , " $ 1 \ n " ) ; <nl> } <nl> - $ num_repts = eval ( $ num_repts ) ; <nl> + $ num_repts = eval_expr ( $ num_repts ) ; <nl> } elsif ( $ line = ~ / \ . irp \ s + ( [ \ d \ w \ . ] + ) \ s * ( . * ) / ) { <nl> $ in_irp = 1 ; <nl> $ num_repts = 1 ; <nl> - $ rept_lines = " \ n " ; <nl> + @ rept_lines = ( " \ n " ) ; <nl> $ irp_param = $ 1 ; <nl> <nl> # only use whitespace as the separator <nl> sub expand_macros { <nl> } elsif ( $ line = ~ / \ . irpc \ s + ( [ \ d \ w \ . ] + ) \ s * ( . * ) / ) { <nl> $ in_irp = 1 ; <nl> $ num_repts = 1 ; <nl> - $ rept_lines = " \ n " ; <nl> + @ rept_lines = ( " \ n " ) ; <nl> $ irp_param = $ 1 ; <nl> <nl> my $ irp_arglist = $ 2 ; <nl> sub expand_macros { <nl> } elsif ( $ line = ~ / \ . endr / ) { <nl> if ( $ in_irp ! = 0 ) { <nl> foreach my $ i ( @ irp_args ) { <nl> - my $ line = $ rept_lines ; <nl> - $ line = ~ s / \ \ $ irp_param / $ i / g ; <nl> - $ line = ~ s / \ \ \ ( \ ) / / g ; # remove \ ( ) <nl> - print ASMFILE $ line ; <nl> + foreach my $ origline ( @ rept_lines ) { <nl> + my $ line = $ origline ; <nl> + $ line = ~ s / \ \ $ irp_param / $ i / g ; <nl> + $ line = ~ s / \ \ \ ( \ ) / / g ; # remove \ ( ) <nl> + if ( ! parse_if_line ( $ line ) & & ! handle_if ( $ line ) ) { <nl> + handle_set ( $ line ) ; <nl> + print ASMFILE $ line ; <nl> + } <nl> + } <nl> } <nl> } else { <nl> for ( 1 . . $ num_repts ) { <nl> - print ASMFILE $ rept_lines ; <nl> + foreach my $ line ( @ rept_lines ) { <nl> + if ( ! parse_if_line ( $ line ) & & ! handle_if ( $ line ) ) { <nl> + handle_set ( $ line ) ; <nl> + print ASMFILE $ line ; <nl> + } <nl> + } <nl> } <nl> } <nl> - $ rept_lines = ' ' ; <nl> + @ rept_lines = ( ) ; <nl> $ in_irp = 0 ; <nl> @ irp_args = ' ' ; <nl> - } elsif ( $ rept_lines ) { <nl> - $ rept_lines . = $ line ; <nl> + } elsif ( scalar ( @ rept_lines ) ) { <nl> + push ( @ rept_lines , $ line ) ; <nl> } else { <nl> + handle_set ( $ line ) ; <nl> print ASMFILE $ line ; <nl> } <nl> } <nl>
[ tools ] Updated to latest gas - preprocessor . pl http : / / git . libav . org / ? p = gas - preprocessor . git
xbmc/xbmc
0260168c659a9d90a22d39a9e124a4d983f483fc
2013-08-02T13:22:44Z
mmm a / src / parsing / parser - base . h <nl> ppp b / src / parsing / parser - base . h <nl> ParserBase < Traits > : : ParsePropertyDefinition ( <nl> classifier - > RecordLetPatternError ( <nl> scanner ( ) - > location ( ) , MessageTemplate : : kLetInLexicalBinding ) ; <nl> } <nl> - if ( is_await & & is_async_function ( ) ) { <nl> - classifier - > RecordPatternError ( <nl> - Scanner : : Location ( next_beg_pos , next_end_pos ) , <nl> - MessageTemplate : : kAwaitBindingIdentifier ) ; <nl> + if ( is_await ) { <nl> + if ( is_async_function ( ) ) { <nl> + classifier - > RecordPatternError ( <nl> + Scanner : : Location ( next_beg_pos , next_end_pos ) , <nl> + MessageTemplate : : kAwaitBindingIdentifier ) ; <nl> + } else { <nl> + classifier - > RecordAsyncArrowFormalParametersError ( <nl> + Scanner : : Location ( next_beg_pos , next_end_pos ) , <nl> + MessageTemplate : : kAwaitBindingIdentifier ) ; <nl> + } <nl> } <nl> ExpressionT lhs = this - > ExpressionFromIdentifier ( <nl> * name , next_beg_pos , next_end_pos , scope_ , factory ( ) ) ; <nl> mmm a / test / cctest / test - parsing . cc <nl> ppp b / test / cctest / test - parsing . cc <nl> TEST ( AsyncAwaitErrors ) { <nl> arraysize ( always_flags ) ) ; <nl> RunParserSyncTest ( strict_context_data , strict_error_data , kError , NULL , 0 , <nl> always_flags , arraysize ( always_flags ) ) ; <nl> - { <nl> - / / TODO ( caitp ) : support these early errors in preparser <nl> - USE ( formal_parameters_data ) ; <nl> - / / const bool kIsModule = false ; <nl> - / / const bool kTestPreparser = false ; <nl> - / / TODO ( caitp ) : These tests seem to fail test - parsing . cc , even with <nl> - / / test_preparser disabled . <nl> - / / RunParserSyncTest ( context_data , formal_parameters_data , kError , NULL , 0 , <nl> - / / always_flags , arraysize ( always_flags ) , NULL , 0 , <nl> - / / kIsModule , kTestPreparser ) ; <nl> - } <nl> + <nl> + RunParserSyncTest ( context_data , formal_parameters_data , kError , NULL , 0 , <nl> + always_flags , arraysize ( always_flags ) ) ; <nl> } <nl> <nl> TEST ( AsyncAwaitModule ) { <nl>
[ parser ] report error for shorthand property " await " in async arrow formals
v8/v8
4efd20ab575b98ba531cbbcc55051f3d85657948
2016-06-27T21:12:19Z
mmm a / include / swift / AST / DiagnosticsDriver . def <nl> ppp b / include / swift / AST / DiagnosticsDriver . def <nl> WARNING ( warn_drv_darwin_sdk_invalid_settings , none , <nl> " SDK settings were ignored because ' SDKSettings . json ' could not be parsed " , <nl> ( ) ) <nl> <nl> + REMARK ( remark_forwarding_to_new_driver , none , " new Swift driver will be used " , ( ) ) <nl> + <nl> # define UNDEFINE_DIAGNOSTIC_MACROS <nl> # include " DefineDiagnosticMacros . h " <nl> mmm a / tools / driver / driver . cpp <nl> ppp b / tools / driver / driver . cpp <nl> <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> <nl> # include " swift / AST / DiagnosticEngine . h " <nl> + # include " swift / AST / DiagnosticsDriver . h " <nl> # include " swift / Basic / LLVMInitialize . h " <nl> # include " swift / Basic / PrettyStackTrace . h " <nl> # include " swift / Basic / Program . h " <nl> static int run_driver ( StringRef ExecName , <nl> DiagnosticEngine Diags ( SM ) ; <nl> Diags . addConsumer ( PDC ) ; <nl> <nl> + / / Forwarding calls to the swift driver if the C + + driver is invoked as ` swift ` <nl> + / / or ` swiftc ` , and an environment variable SWIFT_USE_NEW_DRIVER is defined . <nl> + if ( llvm : : sys : : Process : : GetEnv ( " SWIFT_USE_NEW_DRIVER " ) & & <nl> + ( ExecName = = " swift " | | ExecName = = " swiftc " ) ) { <nl> + SmallString < 256 > NewDriverPath ( llvm : : sys : : path : : parent_path ( Path ) ) ; <nl> + llvm : : sys : : path : : append ( NewDriverPath , " swift - driver " ) ; <nl> + SmallVector < const char * , 256 > subCommandArgs ; <nl> + / / Rewrite the program argument . <nl> + subCommandArgs . push_back ( NewDriverPath . c_str ( ) ) ; <nl> + if ( ExecName = = " swiftc " ) { <nl> + subCommandArgs . push_back ( " - - driver - mode = swiftc " ) ; <nl> + } else { <nl> + assert ( ExecName = = " swift " ) ; <nl> + subCommandArgs . push_back ( " - - driver - mode = swift " ) ; <nl> + } <nl> + subCommandArgs . insert ( subCommandArgs . end ( ) , argv . begin ( ) + 1 , argv . end ( ) ) ; <nl> + <nl> + / / Execute the subcommand . <nl> + subCommandArgs . push_back ( nullptr ) ; <nl> + Diags . diagnose ( SourceLoc ( ) , diag : : remark_forwarding_to_new_driver ) ; <nl> + ExecuteInPlace ( NewDriverPath . c_str ( ) , subCommandArgs . data ( ) ) ; <nl> + <nl> + / / If we reach here then an error occurred ( typically a missing path ) . <nl> + std : : string ErrorString = llvm : : sys : : StrError ( ) ; <nl> + llvm : : errs ( ) < < " error : unable to invoke subcommand : " < < subCommandArgs [ 0 ] <nl> + < < " ( " < < ErrorString < < " ) \ n " ; <nl> + return 2 ; <nl> + } <nl> + <nl> Driver TheDriver ( Path , ExecName , argv , Diags ) ; <nl> switch ( TheDriver . getDriverKind ( ) ) { <nl> case Driver : : DriverKind : : AutolinkExtract : <nl>
Merge pull request from nkcsgexi / forward - call - new - driver
apple/swift
a8c48d1d170e24ef5edc58d2b9ecbadd1daf6ab0
2020-10-02T23:26:57Z
mmm a / ChangeLog . rst <nl> ppp b / ChangeLog . rst <nl> <nl> fmt : : print ( " The date is { : % Y - % m - % d } . " , * std : : localtime ( & t ) ) ; <nl> <nl> * Added support for ` custom argument formatters <nl> - < http : / / cppformat . github . io / dev / api . html # argument - formatters > ` _ <nl> + < http : / / fmtlib . net / dev / api . html # argument - formatters > ` _ <nl> ( ` # 235 < https : / / github . com / fmtlib / fmt / issues / 235 > ` _ ) . <nl> <nl> * Added support for locale - specific integer formatting with the ` ` n ` ` specifier <nl>
Update ChangeLog . rst
fmtlib/fmt
6dfdada493760d1a7a4e05ea2f5013b0026194b7
2016-05-07T15:00:12Z
mmm a / Installation / Pipeline / Jenkinsfile . feature <nl> ppp b / Installation / Pipeline / Jenkinsfile . feature <nl> credentials = ' 8d893d23 - 6714 - 4f35 - a239 - c847c798e080 ' <nl> / / jenkins cache <nl> cacheDir = ' / vol / cache / ' + env . JOB_NAME . replaceAll ( ' % ' , ' _ ' ) <nl> <nl> + / / source branch for pull requests <nl> + sourceBranchLabel = env . BRANCH_NAME <nl> + <nl> + if ( env . BRANCH_NAME = ~ / ^ PR - / ) { <nl> + def prUrl = new URL ( " https : / / api . github . com / repos / arangodb / arangodb / pulls / $ { env . CHANGE_ID } " ) <nl> + sourceBranchLabel = new groovy . json . JsonSlurper ( ) . parseText ( prUrl . text ) . head . label <nl> + <nl> + def reg = ~ / ^ arangodb : / <nl> + sourceBranchLabel = sourceBranchLabel - reg <nl> + } <nl> + <nl> / / copy data to master cache <nl> def scpToMaster ( os , from , to ) { <nl> if ( os = = ' linux ' | | os = = ' mac ' ) { <nl> def checkoutCommunity ( ) { <nl> <nl> def checkoutEnterprise ( ) { <nl> try { <nl> - echo " Trying enterprise branch $ { env . BRANCH_NAME } " <nl> + echo " Trying enterprise branch $ { sourceBranchLabel } " <nl> <nl> checkout ( <nl> changelog : false , <nl> poll : false , <nl> scm : [ <nl> $ class : ' GitSCM ' , <nl> - branches : [ [ name : " * / $ { env . BRANCH_NAME } " ] ] , <nl> + branches : [ [ name : " * / $ { sourceBranchLabel } " ] ] , <nl> doGenerateSubmoduleConfigurations : false , <nl> extensions : [ [ $ class : ' RelativeTargetDirectory ' , relativeTargetDir : ' enterprise ' ] ] , <nl> submoduleCfg : [ ] , <nl> userRemoteConfigs : [ [ credentialsId : credentials , url : enterpriseRepo ] ] ] ) <nl> } <nl> catch ( exc ) { <nl> - echo " Failed $ { env . BRANCH_NAME } , trying enterprise branch devel " <nl> + echo " Failed $ { sourceBranchLabel } , trying enterprise branch devel " <nl> <nl> checkout ( <nl> changelog : false , <nl> def checkCommitMessages ( ) { <nl> } <nl> <nl> echo " " " BRANCH_NAME : $ { env . BRANCH_NAME } <nl> + SOURCE : $ { sourceBranchLabel } <nl> CHANGE_ID : $ { env . CHANGE_ID } <nl> CHANGE_TARGET : $ { env . CHANGE_TARGET } <nl> JOB_NAME : $ { env . JOB_NAME } <nl> mmm a / arangod / Cluster / ClusterMethods . cpp <nl> ppp b / arangod / Cluster / ClusterMethods . cpp <nl> std : : unordered_map < std : : string , std : : vector < std : : string > > distributeShards ( <nl> } <nl> <nl> # ifndef USE_ENTERPRISE <nl> - std : : unique_ptr < LogicalCollection > <nl> - ClusterMethods : : createCollectionOnCoordinator ( TRI_col_type_e collectionType , <nl> - TRI_vocbase_t * vocbase , <nl> - VPackSlice parameters , <nl> - bool ignoreDistributeShardsLikeErrors , <nl> - bool waitForSyncReplication ) { <nl> - auto col = std : : make_unique < LogicalCollection > ( vocbase , parameters ) ; <nl> + std : : unique_ptr < LogicalCollection > ClusterMethods : : createCollectionOnCoordinator ( <nl> + TRI_col_type_e collectionType , TRI_vocbase_t * vocbase , VPackSlice parameters , <nl> + bool ignoreDistributeShardsLikeErrors , bool waitForSyncReplication ) { <nl> + auto col = std : : make_unique < LogicalCollection > ( vocbase , parameters ) ; <nl> / / Collection is a temporary collection object that undergoes sanity checks etc . <nl> / / It is not used anywhere and will be cleaned up after this call . <nl> / / Persist collection will return the real object . <nl> - return persistCollectionInAgency ( col . get ( ) , ignoreDistributeShardsLikeErrors , waitForSyncReplication ) ; <nl> + return persistCollectionInAgency ( <nl> + col . get ( ) , ignoreDistributeShardsLikeErrors , waitForSyncReplication , parameters ) ; <nl> } <nl> # endif <nl> <nl> ClusterMethods : : createCollectionOnCoordinator ( TRI_col_type_e collectionType , <nl> / / / @ brief Persist collection in Agency and trigger shard creation process <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> - std : : unique_ptr < LogicalCollection > <nl> - ClusterMethods : : persistCollectionInAgency ( <nl> - LogicalCollection * col , bool ignoreDistributeShardsLikeErrors , bool waitForSyncReplication ) { <nl> + std : : unique_ptr < LogicalCollection > ClusterMethods : : persistCollectionInAgency ( <nl> + LogicalCollection * col , bool ignoreDistributeShardsLikeErrors , <nl> + bool waitForSyncReplication , VPackSlice parameters ) { <nl> + <nl> std : : string distributeShardsLike = col - > distributeShardsLike ( ) ; <nl> std : : vector < std : : string > avoid = col - > avoidServers ( ) ; <nl> size_t replicationFactor = col - > replicationFactor ( ) ; <nl> + size_t numberOfShards = col - > numberOfShards ( ) ; <nl> + std : : string const replicationFactorStr ( " replicationFactor " ) ; <nl> + std : : string const numberOfShardsStr ( " numberOfShards " ) ; <nl> <nl> ClusterInfo * ci = ClusterInfo : : instance ( ) ; <nl> std : : vector < std : : string > dbServers ; <nl> + <nl> if ( ! distributeShardsLike . empty ( ) ) { <nl> + <nl> CollectionNameResolver resolver ( col - > vocbase ( ) ) ; <nl> TRI_voc_cid_t otherCid = <nl> resolver . getCollectionIdCluster ( distributeShardsLike ) ; <nl> - <nl> + <nl> if ( otherCid ! = 0 ) { <nl> - bool chainOfDistributeShardsLike = false ; <nl> <nl> + bool chainOfDistributeShardsLike = false ; <nl> + bool numberOfShardsConflict = false ; <nl> + bool replicationFactorConflict = false ; <nl> std : : string otherCidString <nl> = arangodb : : basics : : StringUtils : : itoa ( otherCid ) ; <nl> <nl> + VPackBuilder builder ; <nl> + { VPackObjectBuilder a ( & builder ) ; <nl> + col - > toVelocyPack ( builder , false ) ; } <nl> + <nl> try { <nl> - std : : shared_ptr < LogicalCollection > collInfo = <nl> - ci - > getCollection ( col - > dbName ( ) , otherCidString ) ; <nl> - if ( ! collInfo - > distributeShardsLike ( ) . empty ( ) ) { <nl> + <nl> + std : : shared_ptr < LogicalCollection > other = <nl> + ci - > getCollection ( col - > dbName ( ) , otherCidString ) ; <nl> + <nl> + size_t otherReplFactor = size_t ( other - > replicationFactor ( ) ) ; <nl> + <nl> + if ( ! col - > isSmart ( ) ) { <nl> + if ( parameters . hasKey ( replicationFactorStr ) ) { <nl> + replicationFactor = parameters . get ( replicationFactorStr ) . getNumber < size_t > ( ) ; <nl> + if ( otherReplFactor ! = replicationFactor ) { <nl> + replicationFactor = otherReplFactor ; <nl> + col - > replicationFactor ( otherReplFactor ) ; <nl> + / / replicationFactorConflict = true ; <nl> + } <nl> + } else { <nl> + replicationFactor = otherReplFactor ; <nl> + col - > replicationFactor ( otherReplFactor ) ; <nl> + } <nl> + <nl> + size_t otherNumOfShards = size_t ( other - > numberOfShards ( ) ) ; <nl> + if ( parameters . hasKey ( numberOfShardsStr ) ) { <nl> + numberOfShards = parameters . get ( numberOfShardsStr ) . getNumber < size_t > ( ) ; <nl> + if ( otherNumOfShards ! = numberOfShards ) { <nl> + numberOfShards = otherNumOfShards ; <nl> + col - > replicationFactor ( otherNumOfShards ) ; <nl> + / / numberOfShardsConflict = true ; <nl> + } <nl> + } else { <nl> + numberOfShards = otherNumOfShards ; <nl> + col - > replicationFactor ( otherNumOfShards ) ; <nl> + } <nl> + <nl> + } <nl> + if ( ! other - > distributeShardsLike ( ) . empty ( ) ) { <nl> chainOfDistributeShardsLike = true ; <nl> } <nl> - auto shards = collInfo - > shardIds ( ) ; <nl> + <nl> + auto shards = other - > shardIds ( ) ; <nl> auto shardList = ci - > getShardList ( otherCidString ) ; <nl> + <nl> for ( auto const & s : * shardList ) { <nl> auto it = shards - > find ( s ) ; <nl> if ( it ! = shards - > end ( ) ) { <nl> ClusterMethods : : persistCollectionInAgency ( <nl> } <nl> } <nl> } <nl> + <nl> + <nl> + <nl> } catch ( . . . ) { } <nl> <nl> + if ( replicationFactorConflict ) { <nl> + THROW_ARANGO_EXCEPTION ( <nl> + TRI_ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_REPLICATION_FACTOR ) ; <nl> + } <nl> + <nl> + if ( numberOfShardsConflict ) { <nl> + THROW_ARANGO_EXCEPTION ( <nl> + TRI_ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_NUMBER_OF_SHARDS ) ; <nl> + } <nl> + <nl> if ( chainOfDistributeShardsLike ) { <nl> THROW_ARANGO_EXCEPTION ( TRI_ERROR_CLUSTER_CHAIN_OF_DISTRIBUTESHARDSLIKE ) ; <nl> } <nl> + <nl> col - > distributeShardsLike ( otherCidString ) ; <nl> } else { <nl> dbServers = ci - > getCurrentDBServers ( ) ; <nl> ClusterMethods : : persistCollectionInAgency ( <nl> / / Now create the shards : <nl> auto shards = std : : make_shared < <nl> std : : unordered_map < std : : string , std : : vector < std : : string > > > ( <nl> - arangodb : : distributeShards ( col - > numberOfShards ( ) , <nl> - col - > replicationFactor ( ) , dbServers ) ) ; <nl> + arangodb : : distributeShards ( numberOfShards , replicationFactor , dbServers ) ) ; <nl> if ( shards - > empty ( ) & & ! col - > isSmart ( ) ) { <nl> THROW_ARANGO_EXCEPTION_MESSAGE ( TRI_ERROR_INTERNAL , <nl> " no database servers found in cluster " ) ; <nl> ClusterMethods : : persistCollectionInAgency ( <nl> std : : string errorMsg ; <nl> int myerrno = ci - > createCollectionCoordinator ( <nl> col - > dbName ( ) , col - > cid_as_string ( ) , <nl> - col - > numberOfShards ( ) , col - > replicationFactor ( ) , waitForSyncReplication , velocy . slice ( ) , errorMsg , 240 . 0 ) ; <nl> + numberOfShards , replicationFactor , waitForSyncReplication , velocy . slice ( ) , errorMsg , 240 . 0 ) ; <nl> <nl> if ( myerrno ! = TRI_ERROR_NO_ERROR ) { <nl> if ( errorMsg . empty ( ) ) { <nl> mmm a / arangod / Cluster / ClusterMethods . h <nl> ppp b / arangod / Cluster / ClusterMethods . h <nl> class ClusterMethods { <nl> <nl> static std : : unique_ptr < LogicalCollection > persistCollectionInAgency ( <nl> LogicalCollection * col , bool ignoreDistributeShardsLikeErrors , <nl> - bool waitForSyncReplication ) ; <nl> + bool waitForSyncReplication , arangodb : : velocypack : : Slice parameters ) ; <nl> } ; <nl> <nl> } / / namespace arangodb <nl> mmm a / arangod / V8Server / v8 - vocindex . cpp <nl> ppp b / arangod / V8Server / v8 - vocindex . cpp <nl> static void CreateVocBase ( v8 : : FunctionCallbackInfo < v8 : : Value > const & args , <nl> <nl> v8 : : Handle < v8 : : Value > result ; <nl> if ( ServerState : : instance ( ) - > isCoordinator ( ) ) { <nl> - bool createWaitsForSyncReplication = application_features : : ApplicationServer : : getFeature < ClusterFeature > ( " Cluster " ) - > createWaitsForSyncReplication ( ) ; <nl> + bool createWaitsForSyncReplication = <nl> + application_features : : ApplicationServer : : getFeature < ClusterFeature > ( " Cluster " ) - > createWaitsForSyncReplication ( ) ; <nl> <nl> if ( args . Length ( ) > = 3 & & args [ args . Length ( ) - 1 ] - > IsObject ( ) ) { <nl> v8 : : Handle < v8 : : Object > obj = args [ args . Length ( ) - 1 ] - > ToObject ( ) ; <nl> mmm a / arangod / VocBase / LogicalCollection . cpp <nl> ppp b / arangod / VocBase / LogicalCollection . cpp <nl> void LogicalCollection : : getIndexesVPack ( VPackBuilder & result , bool withFigures , <nl> int LogicalCollection : : replicationFactor ( ) const { <nl> return static_cast < int > ( _replicationFactor ) ; <nl> } <nl> + void LogicalCollection : : replicationFactor ( int r ) { <nl> + _replicationFactor = static_cast < size_t > ( r ) ; <nl> + } <nl> <nl> / / SECTION : Sharding <nl> int LogicalCollection : : numberOfShards ( ) const { <nl> return static_cast < int > ( _numberOfShards ) ; <nl> } <nl> + void LogicalCollection : : numberOfShards ( int n ) { <nl> + _numberOfShards = static_cast < size_t > ( n ) ; <nl> + } <nl> <nl> bool LogicalCollection : : allowUserKeys ( ) const { return _allowUserKeys ; } <nl> <nl> mmm a / arangod / VocBase / LogicalCollection . h <nl> ppp b / arangod / VocBase / LogicalCollection . h <nl> class LogicalCollection { <nl> <nl> / / SECTION : Replication <nl> int replicationFactor ( ) const ; <nl> + void replicationFactor ( int ) ; <nl> bool isSatellite ( ) const ; <nl> <nl> / / SECTION : Sharding <nl> int numberOfShards ( ) const ; <nl> + void numberOfShards ( int ) ; <nl> bool allowUserKeys ( ) const ; <nl> virtual bool usesDefaultShardKeys ( ) const ; <nl> std : : vector < std : : string > const & shardKeys ( ) const ; <nl> mmm a / arangosh / Import / arangoimp . cpp <nl> ppp b / arangosh / Import / arangoimp . cpp <nl> int main ( int argc , char * argv [ ] ) { <nl> ret = EXIT_SUCCESS ; <nl> } <nl> } catch ( std : : exception const & ex ) { <nl> - LOG_TOPIC ( ERR , arangodb : : Logger : : FIXME ) < < " arangoimp terminated because of an unhandled exception : " <nl> - < < ex . what ( ) ; <nl> + LOG_TOPIC ( ERR , arangodb : : Logger : : FIXME ) <nl> + < < " arangoimp terminated because of an unhandled exception : " < < ex . what ( ) ; <nl> ret = EXIT_FAILURE ; <nl> } catch ( . . . ) { <nl> - LOG_TOPIC ( ERR , arangodb : : Logger : : FIXME ) < < " arangoimp terminated because of an unhandled exception of " <nl> - " unknown type " ; <nl> + LOG_TOPIC ( ERR , arangodb : : Logger : : FIXME ) <nl> + < < " arangoimp terminated because of an unhandled exception of unknown type " ; <nl> ret = EXIT_FAILURE ; <nl> } <nl> <nl> mmm a / js / actions / _api / collection / app . js <nl> ppp b / js / actions / _api / collection / app . js <nl> function post_api_collection ( req , res ) { <nl> r . type = arangodb . ArangoCollection . TYPE_EDGE ; <nl> } <nl> } <nl> + <nl> if ( r . type = = = arangodb . ArangoCollection . TYPE_EDGE ) { <nl> collection = arangodb . db . _createEdgeCollection ( r . name , r . parameters , options ) ; <nl> } else { <nl> mmm a / js / common / bootstrap / errors . js <nl> ppp b / js / common / bootstrap / errors . js <nl> <nl> " ERROR_CLUSTER_SHARD_FOLLOWER_REFUSES_OPERATION " : { " code " : 1490 , " message " : " a shard follower refuses to perform an operation that is not a replication " } , <nl> " ERROR_CLUSTER_SHARD_LEADER_RESIGNED " : { " code " : 1491 , " message " : " a ( former ) shard leader refuses to perform an operation , because it has resigned in the meantime " } , <nl> " ERROR_CLUSTER_AGENCY_COMMUNICATION_FAILED " : { " code " : 1492 , " message " : " some agency operation failed " } , <nl> + " ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_REPLICATION_FACTOR " : { " code " : 1493 , " message " : " conflicting replication factor with distributeShardsLike parameter assignment " } , <nl> + " ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_NUMBER_OF_SHARDS " : { " code " : 1494 , " message " : " conflicting shard number with distributeShardsLike parameter assignment " } , <nl> " ERROR_QUERY_KILLED " : { " code " : 1500 , " message " : " query killed " } , <nl> " ERROR_QUERY_PARSE " : { " code " : 1501 , " message " : " % s " } , <nl> " ERROR_QUERY_EMPTY " : { " code " : 1502 , " message " : " query is empty " } , <nl> mmm a / lib / Basics / errors . dat <nl> ppp b / lib / Basics / errors . dat <nl> ERROR_CLUSTER_SHARD_LEADER_REFUSES_REPLICATION , 1489 , " a shard leader refuses to p <nl> ERROR_CLUSTER_SHARD_FOLLOWER_REFUSES_OPERATION , 1490 , " a shard follower refuses to perform an operation that is not a replication " , " Will be raised if a non - replication operation is refused by a shard follower . " <nl> ERROR_CLUSTER_SHARD_LEADER_RESIGNED , 1491 , " a ( former ) shard leader refuses to perform an operation , because it has resigned in the meantime " , " Will be raised if a non - replication operation is refused by a former shard leader that has found out that it is no longer the leader . " <nl> ERROR_CLUSTER_AGENCY_COMMUNICATION_FAILED , 1492 , " some agency operation failed " , " Will be raised if after various retries an agency operation could not be performed successfully . " <nl> + ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_REPLICATION_FACTOR , 1493 , " conflicting replication factor with distributeShardsLike parameter assignment " , " Will be raised if intended replication factor does not match that of the prototype shard given in ditributeShardsLike parameter . " <nl> + ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_NUMBER_OF_SHARDS , 1494 , " conflicting shard number with distributeShardsLike parameter assignment " , " Will be raised if intended number of shards does not match that of the prototype shard given in ditributeShardsLike parameter . " <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # # ArangoDB query errors <nl> mmm a / lib / Basics / voc - errors . cpp <nl> ppp b / lib / Basics / voc - errors . cpp <nl> void TRI_InitializeErrorMessages ( ) { <nl> REG_ERROR ( ERROR_CLUSTER_SHARD_LEADER_REFUSES_REPLICATION , " a shard leader refuses to perform a replication operation " ) ; <nl> REG_ERROR ( ERROR_CLUSTER_SHARD_FOLLOWER_REFUSES_OPERATION , " a shard follower refuses to perform an operation that is not a replication " ) ; <nl> REG_ERROR ( ERROR_CLUSTER_SHARD_LEADER_RESIGNED , " a ( former ) shard leader refuses to perform an operation , because it has resigned in the meantime " ) ; <nl> + REG_ERROR ( ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_REPLICATION_FACTOR , " conflicting replication factor with distributeShardsLike parameter assignment " ) ; <nl> + REG_ERROR ( ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_NUMBER_OF_SHARDS , " conflicting shard number with distributeShardsLike parameter assignment " ) ; <nl> REG_ERROR ( ERROR_CLUSTER_AGENCY_COMMUNICATION_FAILED , " some agency operation failed " ) ; <nl> REG_ERROR ( ERROR_QUERY_KILLED , " query killed " ) ; <nl> REG_ERROR ( ERROR_QUERY_PARSE , " % s " ) ; <nl> mmm a / lib / Basics / voc - errors . h <nl> ppp b / lib / Basics / voc - errors . h <nl> <nl> / / / - 1492 : @ LIT { some agency operation failed } <nl> / / / Will be raised if after various retries an agency operation could not be <nl> / / / performed successfully . <nl> + / / / - 1493 : @ LIT { conflicting replication factor with distributeShardsLike parameter assignment } <nl> + / / / Will be raised if intended replication factor does not match that of the <nl> + / / / prototype shard given in ditributeShardsLike parameter . <nl> + / / / - 1494 : @ LIT { conflicting shard number with distributeShardsLike parameter assignment } <nl> + / / / Will be raised if intended number of shards does not match that of the <nl> + / / / prototype shard given in ditributeShardsLike parameter . <nl> / / / - 1500 : @ LIT { query killed } <nl> / / / Will be raised when a running query is killed by an explicit admin <nl> / / / command . <nl> void TRI_InitializeErrorMessages ( ) ; <nl> <nl> # define TRI_ERROR_CLUSTER_AGENCY_COMMUNICATION_FAILED ( 1492 ) <nl> <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / @ brief 1493 : ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_REPLICATION_FACTOR <nl> + / / / <nl> + / / / conflicting replication factor with distributeShardsLike parameter assignment <nl> + / / / <nl> + / / / Will be raised if intended replication factor does not match that of the <nl> + / / / prototype shard given in ditributeShardsLike parameter . <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + # define TRI_ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_REPLICATION_FACTOR ( 1493 ) <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / @ brief 1494 : ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_NUMBER_OF_SHARDS <nl> + / / / <nl> + / / / conflicting shard number with distributeShardsLike parameter assignment <nl> + / / / <nl> + / / / Will be raised if intended number of shards does not match that of the <nl> + / / / prototype shard given in ditributeShardsLike parameter . <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + # define TRI_ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_NUMBER_OF_SHARDS ( 1494 ) <nl> + <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / / @ brief 1500 : ERROR_QUERY_KILLED <nl> / / / <nl>
Fixed distributeShardsLike bug in creating collections . numberOfShard … ( )
arangodb/arangodb
0b6d6d9287c279c65d86e527fe5c4ddef8fecb8c
2017-08-03T17:38:16Z
mmm a / src / csharp / Grpc . Core . Api / Metadata . cs <nl> ppp b / src / csharp / Grpc . Core . Api / Metadata . cs <nl> internal Metadata Freeze ( ) <nl> return this ; <nl> } <nl> <nl> - / / TODO : add support for access by key <nl> + / / / < summary > <nl> + / / / Gets the last metadata entry with the specified key . <nl> + / / / If there are no matching entries then < c > null < / c > is returned . <nl> + / / / < / summary > <nl> + public Entry Get ( string key ) <nl> + { <nl> + for ( int i = entries . Count - 1 ; i > = 0 ; i - - ) <nl> + { <nl> + if ( entries [ i ] . Key = = key ) <nl> + { <nl> + return entries [ i ] ; <nl> + } <nl> + } <nl> + <nl> + return null ; <nl> + } <nl> + <nl> + / / / < summary > <nl> + / / / Gets the string value of the last metadata entry with the specified key . <nl> + / / / If the metadata entry is binary then an exception is thrown . <nl> + / / / If there are no matching entries then < c > null < / c > is returned . <nl> + / / / < / summary > <nl> + public string GetValue ( string key ) <nl> + { <nl> + return Get ( key ) ? . Value ; <nl> + } <nl> + <nl> + / / / < summary > <nl> + / / / Gets the bytes value of the last metadata entry with the specified key . <nl> + / / / If the metadata entry is not binary the string value will be returned as ASCII encoded bytes . <nl> + / / / If there are no matching entries then < c > null < / c > is returned . <nl> + / / / < / summary > <nl> + public byte [ ] GetValueBytes ( string key ) <nl> + { <nl> + return Get ( key ) ? . ValueBytes ; <nl> + } <nl> + <nl> + / / / < summary > <nl> + / / / Gets all metadata entries with the specified key . <nl> + / / / < / summary > <nl> + public IEnumerable < Entry > GetAll ( string key ) <nl> + { <nl> + for ( int i = 0 ; i < entries . Count ; i + + ) <nl> + { <nl> + if ( entries [ i ] . Key = = key ) <nl> + { <nl> + yield return entries [ i ] ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + / / / < summary > <nl> + / / / Adds a new ASCII - valued metadata entry . See < c > Metadata . Entry < / c > constructor for params . <nl> + / / / < / summary > <nl> + public void Add ( string key , string value ) <nl> + { <nl> + Add ( new Entry ( key , value ) ) ; <nl> + } <nl> + <nl> + / / / < summary > <nl> + / / / Adds a new binary - valued metadata entry . See < c > Metadata . Entry < / c > constructor for params . <nl> + / / / < / summary > <nl> + public void Add ( string key , byte [ ] valueBytes ) <nl> + { <nl> + Add ( new Entry ( key , valueBytes ) ) ; <nl> + } <nl> <nl> # region IList members <nl> <nl> public void Add ( Metadata . Entry item ) <nl> entries . Add ( item ) ; <nl> } <nl> <nl> - / / / < summary > <nl> - / / / Adds a new ASCII - valued metadata entry . See < c > Metadata . Entry < / c > constructor for params . <nl> - / / / < / summary > <nl> - public void Add ( string key , string value ) <nl> - { <nl> - Add ( new Entry ( key , value ) ) ; <nl> - } <nl> - <nl> - / / / < summary > <nl> - / / / Adds a new binary - valued metadata entry . See < c > Metadata . Entry < / c > constructor for params . <nl> - / / / < / summary > <nl> - public void Add ( string key , byte [ ] valueBytes ) <nl> - { <nl> - Add ( new Entry ( key , valueBytes ) ) ; <nl> - } <nl> - <nl> / / / < summary > <nl> / / / < see cref = " T : IList ` 1 " / > <nl> / / / < / summary > <nl> public string Key <nl> <nl> / / / < summary > <nl> / / / Gets the binary value of this metadata entry . <nl> + / / / If the metadata entry is not binary the string value will be returned as ASCII encoded bytes . <nl> / / / < / summary > <nl> public byte [ ] ValueBytes <nl> { <nl> public byte [ ] ValueBytes <nl> <nl> / / / < summary > <nl> / / / Gets the string value of this metadata entry . <nl> + / / / If the metadata entry is binary then an exception is thrown . <nl> / / / < / summary > <nl> public string Value <nl> { <nl> get <nl> { <nl> GrpcPreconditions . CheckState ( ! IsBinary , " Cannot access string value of a binary metadata entry " ) ; <nl> - return value ? ? EncodingASCII . GetString ( valueBytes ) ; <nl> + return value ; <nl> } <nl> } <nl> <nl> mmm a / src / csharp / Grpc . Core . Tests / MetadataTest . cs <nl> ppp b / src / csharp / Grpc . Core . Tests / MetadataTest . cs <nl> <nl> <nl> using System ; <nl> using System . Diagnostics ; <nl> + using System . Linq ; <nl> using System . Runtime . InteropServices ; <nl> + using System . Text ; <nl> using System . Threading ; <nl> using System . Threading . Tasks ; <nl> using Grpc . Core ; <nl> public void FreezeMakesReadOnly ( ) <nl> Assert . Throws < InvalidOperationException > ( ( ) = > metadata . Remove ( metadata [ 0 ] ) ) ; <nl> } <nl> <nl> + [ Test ] <nl> + public void GetAll ( ) <nl> + { <nl> + var metadata = new Metadata <nl> + { <nl> + { " abc " , " abc - value1 " } , <nl> + { " abc " , " abc - value2 " } , <nl> + { " xyz " , " xyz - value1 " } , <nl> + } ; <nl> + <nl> + var abcEntries = metadata . GetAll ( " abc " ) . ToList ( ) ; <nl> + Assert . AreEqual ( 2 , abcEntries . Count ) ; <nl> + Assert . AreEqual ( " abc - value1 " , abcEntries [ 0 ] . Value ) ; <nl> + Assert . AreEqual ( " abc - value2 " , abcEntries [ 1 ] . Value ) ; <nl> + <nl> + var xyzEntries = metadata . GetAll ( " xyz " ) . ToList ( ) ; <nl> + Assert . AreEqual ( 1 , xyzEntries . Count ) ; <nl> + Assert . AreEqual ( " xyz - value1 " , xyzEntries [ 0 ] . Value ) ; <nl> + } <nl> + <nl> + [ Test ] <nl> + public void Get ( ) <nl> + { <nl> + var metadata = new Metadata <nl> + { <nl> + { " abc " , " abc - value1 " } , <nl> + { " abc " , " abc - value2 " } , <nl> + { " xyz " , " xyz - value1 " } , <nl> + } ; <nl> + <nl> + var abcEntry = metadata . Get ( " abc " ) ; <nl> + Assert . AreEqual ( " abc - value2 " , abcEntry . Value ) ; <nl> + <nl> + var xyzEntry = metadata . Get ( " xyz " ) ; <nl> + Assert . AreEqual ( " xyz - value1 " , xyzEntry . Value ) ; <nl> + <nl> + var notFound = metadata . Get ( " not - found " ) ; <nl> + Assert . AreEqual ( null , notFound ) ; <nl> + } <nl> + <nl> + [ Test ] <nl> + public void GetValue ( ) <nl> + { <nl> + var metadata = new Metadata <nl> + { <nl> + { " abc " , " abc - value1 " } , <nl> + { " abc " , " abc - value2 " } , <nl> + { " xyz " , " xyz - value1 " } , <nl> + { " xyz - bin " , Encoding . ASCII . GetBytes ( " xyz - value1 " ) } , <nl> + } ; <nl> + <nl> + var abcValue = metadata . GetValue ( " abc " ) ; <nl> + Assert . AreEqual ( " abc - value2 " , abcValue ) ; <nl> + <nl> + var xyzValue = metadata . GetValue ( " xyz " ) ; <nl> + Assert . AreEqual ( " xyz - value1 " , xyzValue ) ; <nl> + <nl> + var notFound = metadata . GetValue ( " not - found " ) ; <nl> + Assert . AreEqual ( null , notFound ) ; <nl> + } <nl> + <nl> + [ Test ] <nl> + public void GetValue_BytesValue ( ) <nl> + { <nl> + var metadata = new Metadata <nl> + { <nl> + { " xyz - bin " , Encoding . ASCII . GetBytes ( " xyz - value1 " ) } , <nl> + } ; <nl> + <nl> + Assert . Throws < InvalidOperationException > ( ( ) = > metadata . GetValue ( " xyz - bin " ) ) ; <nl> + } <nl> + <nl> + [ Test ] <nl> + public void GetValueBytes ( ) <nl> + { <nl> + var metadata = new Metadata <nl> + { <nl> + { " abc - bin " , Encoding . ASCII . GetBytes ( " abc - value1 " ) } , <nl> + { " abc - bin " , Encoding . ASCII . GetBytes ( " abc - value2 " ) } , <nl> + { " xyz - bin " , Encoding . ASCII . GetBytes ( " xyz - value1 " ) } , <nl> + } ; <nl> + <nl> + var abcValue = metadata . GetValueBytes ( " abc - bin " ) ; <nl> + Assert . AreEqual ( Encoding . ASCII . GetBytes ( " abc - value2 " ) , abcValue ) ; <nl> + <nl> + var xyzValue = metadata . GetValueBytes ( " xyz - bin " ) ; <nl> + Assert . AreEqual ( Encoding . ASCII . GetBytes ( " xyz - value1 " ) , xyzValue ) ; <nl> + <nl> + var notFound = metadata . GetValueBytes ( " not - found " ) ; <nl> + Assert . AreEqual ( null , notFound ) ; <nl> + } <nl> + <nl> + [ Test ] <nl> + public void GetValueBytes_StringValue ( ) <nl> + { <nl> + var metadata = new Metadata <nl> + { <nl> + { " xyz " , " xyz - value1 " } , <nl> + } ; <nl> + <nl> + var xyzValue = metadata . GetValueBytes ( " xyz " ) ; <nl> + Assert . AreEqual ( Encoding . ASCII . GetBytes ( " xyz - value1 " ) , xyzValue ) ; <nl> + } <nl> + <nl> private Metadata CreateMetadata ( ) <nl> { <nl> return new Metadata <nl>
Merge pull request from JamesNK / jamesnk / metadata - helpers
grpc/grpc
71a22caaf8bbac5f2b540a5533c8bb51d31d3d11
2020-04-29T06:03:29Z
mmm a / docs / tutorials / vision / cnn_visualization . md <nl> ppp b / docs / tutorials / vision / cnn_visualization . md <nl> <nl> # Visualizing Decisions of Convolutional Neural Networks <nl> <nl> - Convolutional Neural Networks have made a lot of progress in Computer Vision . Their accuracy is as good as humans in some tasks . However it remains hard to explain the predictions of convolutional neural networks , as they lack the interpretability offered by other models , for example decision trees . <nl> + Convolutional Neural Networks have made a lot of progress in Computer Vision . Their accuracy is as good as humans in some tasks . However , it remains difficult to explain the predictions of convolutional neural networks , as they lack the interpretability offered by other models such as decision trees . <nl> <nl> - It is often helpful to be able to explain why a model made the prediction it made . For example when a model misclassifies an image , it is hard to say why without visualizing the network ' s decision . <nl> + It is often helpful to be able to explain why a model made the prediction it made . For example , when a model misclassifies an image , without visualizing the network ' s decision , it is hard to say why the misclassification was made . <nl> <nl> < img align = " right " src = " https : / / raw . githubusercontent . com / dmlc / web - data / master / mxnet / example / cnn_visualization / volcano_barn_spider . png " alt = " Explaining the misclassification of volcano as spider " width = 500px / > <nl> <nl> - Visualizations also help build confidence about the predictions of a model . For example , even if a model correctly predicts birds as birds , we would want to confirm that the model bases its decision on the features of bird and not on the features of some other object that might occur together with birds in the dataset ( like leaves ) . <nl> + Visualizations can also build confidence about the predictions of a model . For example , even if a model correctly predicts birds as birds , we would want to confirm that the model bases its decision on the features of bird and not on the features of some other object that might occur together with birds in the dataset ( like leaves ) . <nl> <nl> - In this tutorial , we show how to visualize the predictions made by convolutional neural networks using [ Gradient - weighted Class Activation Mapping ] ( https : / / arxiv . org / abs / 1610 . 02391 ) . Unlike many other visualization methods , Grad - CAM can be used on a wide variety of CNN model families - CNNs with fully connected layers , CNNs used for structural outputs ( e . g . captioning ) , CNNs used in tasks with multi - model input ( e . g . VQA ) or reinforcement learning without architectural changes or re - training . <nl> + In this tutorial we show how to visualize the predictions made by convolutional neural networks using [ Gradient - weighted Class Activation Mapping ] ( https : / / arxiv . org / abs / 1610 . 02391 ) . Unlike many other visualization methods , Grad - CAM can be used on a wide variety of CNN model families - CNNs with fully connected layers , CNNs used for structural outputs ( e . g . captioning ) , CNNs used in tasks with multi - model input ( e . g . VQA ) or reinforcement learning without architectural changes or re - training . <nl> <nl> - In the rest of this notebook , we will explain how to visualize predictions made by [ VGG - 16 ] ( https : / / arxiv . org / abs / 1409 . 1556 ) . We begin by importing the required dependencies . ` gradcam ` module contains the implementation of visualization techniques used in this notebook . <nl> + In the rest of this notebook , we will explain how to visualize predictions made by [ VGG - 16 ] ( https : / / arxiv . org / abs / 1409 . 1556 ) . We begin by importing the required dependencies . <nl> + <nl> + # # Prerequesites <nl> + * OpenCV is required by ` gradcam ` ( below ) and can be installed with pip using ` pip opencv - python ` . <nl> + <nl> + * the ` gradcam ` module contains the implementation of visualization techniques used in this notebook . ` gradcam ` can be installed to a temporary directory by executing the following code block . <nl> <nl> ` ` ` python <nl> from __future__ import print_function <nl>
Clarify dependency on OpenCV in CNN Visualization tutorial . ( )
apache/incubator-mxnet
2bc4430c9c9999640a34df4a606a89b74b12008f
2018-12-01T07:35:42Z
mmm a / utils / list - versions / version_date . tsv <nl> ppp b / utils / list - versions / version_date . tsv <nl> <nl> + v20 . 7 . 2 . 30 - stable 2020 - 08 - 31 <nl> v20 . 6 . 4 . 44 - stable 2020 - 08 - 20 <nl> v20 . 6 . 3 . 28 - stable 2020 - 08 - 07 <nl> v20 . 5 . 5 . 74 - stable 2020 - 08 - 20 <nl>
Update version_date . tsv after release 20 . 7 . 2 . 30
ClickHouse/ClickHouse
41181555a6e2a07b387ba54a8e6f4029587175a4
2020-08-31T16:23:16Z
mmm a / src / video_core / engines / shader_bytecode . h <nl> ppp b / src / video_core / engines / shader_bytecode . h <nl> class OpCode { <nl> KIL , <nl> LD_A , <nl> ST_A , <nl> - TEXS , <nl> + TEXQ , / / Texture Query <nl> + TEXS , / / Texture Fetch with scalar / non - vec4 source / destinations <nl> + TLDS , / / Texture Load with scalar / non - vec4 source / destinations <nl> EXIT , <nl> IPA , <nl> - FFMA_IMM , <nl> + FFMA_IMM , / / Fused Multiply and Add <nl> FFMA_CR , <nl> FFMA_RC , <nl> FFMA_RR , <nl> class OpCode { <nl> FMUL_R , <nl> FMUL_IMM , <nl> FMUL32_IMM , <nl> - MUFU , <nl> + MUFU , / / Multi - Function Operator <nl> + RRO , / / Range Reduction Operator <nl> + F2F_C , <nl> + F2F_R , <nl> + F2F_IMM , <nl> + F2I_C , <nl> + F2I_R , <nl> + F2I_IMM , <nl> + I2F_C , <nl> + I2F_R , <nl> + I2F_IMM , <nl> + LOP32I , <nl> + MOV_C , <nl> + MOV_R , <nl> + MOV_IMM , <nl> + MOV32I , <nl> + SHR_C , <nl> + SHR_R , <nl> + SHR_IMM , <nl> + FSETP_C , / / Set Predicate <nl> FSETP_R , <nl> - FSETP_C , <nl> FSETP_IMM , <nl> + ISETP_C , <nl> + ISETP_IMM , <nl> + ISETP_R , <nl> } ; <nl> <nl> enum class Type { <nl> class OpCode { <nl> Flow , <nl> Memory , <nl> FloatPredicate , <nl> + IntegerPredicate , <nl> Unknown , <nl> } ; <nl> <nl> class OpCode { <nl> INST ( " 111000110011mmm - " , Id : : KIL , Type : : Flow , " KIL " ) , <nl> INST ( " 1110111111011mmm " , Id : : LD_A , Type : : Memory , " LD_A " ) , <nl> INST ( " 1110111111110mmm " , Id : : ST_A , Type : : Memory , " ST_A " ) , <nl> + INST ( " 1101111101001mmm " , Id : : TEXQ , Type : : Memory , " TEXQ " ) , <nl> INST ( " 1101100mmmmmmmmm " , Id : : TEXS , Type : : Memory , " TEXS " ) , <nl> + INST ( " 1101101mmmmmmmmm " , Id : : TLDS , Type : : Memory , " TLDS " ) , <nl> INST ( " 111000110000mmm - " , Id : : EXIT , Type : : Trivial , " EXIT " ) , <nl> INST ( " 11100000mmmmmm - - " , Id : : IPA , Type : : Trivial , " IPA " ) , <nl> INST ( " 001100101mmmmmm - " , Id : : FFMA_IMM , Type : : Ffma , " FFMA_IMM " ) , <nl> class OpCode { <nl> INST ( " 0011100 - 01101mmm " , Id : : FMUL_IMM , Type : : Arithmetic , " FMUL_IMM " ) , <nl> INST ( " 00011110mmmmmm - - " , Id : : FMUL32_IMM , Type : : Arithmetic , " FMUL32_IMM " ) , <nl> INST ( " 0101000010000mmm " , Id : : MUFU , Type : : Arithmetic , " MUFU " ) , <nl> - INST ( " 010110111011mmm - " , Id : : FSETP_R , Type : : FloatPredicate , " FSETP_R " ) , <nl> + INST ( " 0101110010010mmm " , Id : : RRO , Type : : Arithmetic , " RRO " ) , <nl> + INST ( " 0100110010101mmm " , Id : : F2F_C , Type : : Arithmetic , " F2F_C " ) , <nl> + INST ( " 0101110010101mmm " , Id : : F2F_R , Type : : Arithmetic , " F2F_R " ) , <nl> + INST ( " 0011100 - 10101mmm " , Id : : F2F_IMM , Type : : Arithmetic , " F2F_IMM " ) , <nl> + INST ( " 0100110010110mmm " , Id : : F2I_C , Type : : Arithmetic , " F2I_C " ) , <nl> + INST ( " 0101110010110mmm " , Id : : F2I_R , Type : : Arithmetic , " F2I_R " ) , <nl> + INST ( " 0011100 - 10110mmm " , Id : : F2I_IMM , Type : : Arithmetic , " F2I_IMM " ) , <nl> + INST ( " 0100110010111mmm " , Id : : I2F_C , Type : : Arithmetic , " I2F_C " ) , <nl> + INST ( " 0101110010111mmm " , Id : : I2F_R , Type : : Arithmetic , " I2F_R " ) , <nl> + INST ( " 0011100 - 10111mmm " , Id : : I2F_IMM , Type : : Arithmetic , " I2F_IMM " ) , <nl> + INST ( " 000001mmmmmmmmm - " , Id : : LOP32I , Type : : Arithmetic , " LOP32I " ) , <nl> + INST ( " 0100110010011mmm " , Id : : MOV_C , Type : : Arithmetic , " MOV_C " ) , <nl> + INST ( " 0101110010011mmm " , Id : : MOV_R , Type : : Arithmetic , " MOV_R " ) , <nl> + INST ( " 0011100 - 10011mmm " , Id : : MOV_IMM , Type : : Arithmetic , " MOV_IMM " ) , <nl> + INST ( " 000000010000mmm - " , Id : : MOV32I , Type : : Arithmetic , " MOV32I " ) , <nl> + INST ( " 0100110000101mmm " , Id : : SHR_C , Type : : Arithmetic , " SHR_C " ) , <nl> + INST ( " 0101110000101mmm " , Id : : SHR_R , Type : : Arithmetic , " SHR_R " ) , <nl> + INST ( " 0011100 - 00101mmm " , Id : : SHR_IMM , Type : : Arithmetic , " SHR_IMM " ) , <nl> INST ( " 010010111011mmm - " , Id : : FSETP_C , Type : : FloatPredicate , " FSETP_C " ) , <nl> + INST ( " 010110111011mmm - " , Id : : FSETP_R , Type : : FloatPredicate , " FSETP_R " ) , <nl> INST ( " 0011011 - 1011mmm - " , Id : : FSETP_IMM , Type : : FloatPredicate , " FSETP_IMM " ) , <nl> + INST ( " 010010110110mmm - " , Id : : ISETP_C , Type : : IntegerPredicate , " ISETP_C " ) , <nl> + INST ( " 010110110110mmm - " , Id : : ISETP_R , Type : : IntegerPredicate , " ISETP_R " ) , <nl> + INST ( " 0011011 - 0110mmm - " , Id : : ISETP_IMM , Type : : IntegerPredicate , " ISETP_IMM " ) , <nl> } ; <nl> # undef INST <nl> std : : stable_sort ( table . begin ( ) , table . end ( ) , [ ] ( const auto & a , const auto & b ) { <nl>
shader_bytecode : Add several more instruction decodings .
yuzu-emu/yuzu
e1630c4d438167c795ff237fa3e8f7421f5ffef6
2018-04-21T02:30:56Z
mmm a / dbms / src / Core / Block . cpp <nl> ppp b / dbms / src / Core / Block . cpp <nl> void Block : : insert ( size_t position , const ColumnWithTypeAndName & elem ) <nl> throw Exception ( " Position out of bound in Block : : insert ( ) , max position = " <nl> + toString ( data . size ( ) ) , ErrorCodes : : POSITION_OUT_OF_BOUND ) ; <nl> <nl> + for ( auto & name_pos : index_by_name ) <nl> + if ( name_pos . second > = position ) <nl> + + + name_pos . second ; <nl> + <nl> index_by_name [ elem . name ] = position ; <nl> data . emplace ( data . begin ( ) + position , elem ) ; <nl> } <nl> void Block : : insert ( size_t position , ColumnWithTypeAndName & & elem ) <nl> throw Exception ( " Position out of bound in Block : : insert ( ) , max position = " <nl> + toString ( data . size ( ) ) , ErrorCodes : : POSITION_OUT_OF_BOUND ) ; <nl> <nl> + for ( auto & name_pos : index_by_name ) <nl> + if ( name_pos . second > = position ) <nl> + + + name_pos . second ; <nl> + <nl> index_by_name [ elem . name ] = position ; <nl> data . emplace ( data . begin ( ) + position , std : : move ( elem ) ) ; <nl> } <nl>
Fixed error [ # METR - 22173 ] .
ClickHouse/ClickHouse
a37b9371b0aae3a003b9f69068794b245c1cd0f1
2016-08-05T19:15:07Z
mmm a / README <nl> ppp b / README <nl> <nl> - CATCH v0 . 9 build 20 ( integration branch ) <nl> + CATCH v0 . 9 build 21 ( integration branch ) <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> CATCH is an automated test framework for C , C + + and Objective - C . <nl> mmm a / generateSingleHeader . py <nl> ppp b / generateSingleHeader . py <nl> <nl> readmePath = os . path . join ( catchPath , " README " ) <nl> # outputPath = os . path . join ( catchPath , ' single_include / catch . hpp ' ) <nl> <nl> + bumpVersion = len ( sys . argv ) < 2 or sys . argv [ 1 ] < > " nobump " <nl> + <nl> def parseFile ( path , filename ) : <nl> f = open ( path + filename , ' r ' ) <nl> blanks = 0 <nl> def updateReadmeFile ( self ) : <nl> <nl> def generateSingleInclude ( ) : <nl> v = Version ( ) <nl> - v . incrementBuildNumber ( ) <nl> - v . updateVersionFile ( ) <nl> - v . updateReadmeFile ( ) <nl> + if bumpVersion : <nl> + v . incrementBuildNumber ( ) <nl> + v . updateVersionFile ( ) <nl> + v . updateReadmeFile ( ) <nl> print " / * " <nl> print " * CATCH v { 0 } . { 1 } build { 2 } ( { 3 } branch ) " . format ( v . majorVersion , v . minorVersion , v . buildNumber , v . branchName ) <nl> print " * Generated : " + str ( datetime . datetime . now ( ) ) <nl> mmm a / include / internal / catch_console_colour_impl . hpp <nl> ppp b / include / internal / catch_console_colour_impl . hpp <nl> <nl> <nl> # include " catch_console_colour . hpp " <nl> <nl> + # if ! defined ( CATCH_CONFIG_USE_ANSI_COLOUR_CODES ) & & ! defined ( CATCH_PLATFORM_WINDOWS ) <nl> + # define CATCH_CONFIG_USE_ANSI_COLOUR_CODES 1 <nl> + # endif <nl> + <nl> # if defined ( CATCH_CONFIG_USE_ANSI_COLOUR_CODES ) <nl> <nl> # include < unistd . h > <nl> namespace Catch { <nl> <nl> namespace { const char colourEscape = ' \ 033 ' ; } <nl> <nl> + inline bool shouldUseColour ( ) { <nl> + static bool s_shouldUseColour <nl> + = CATCH_CONFIG_USE_ANSI_COLOUR_CODES ! = 0 & & <nl> + isatty ( fileno ( stdout ) ) & & <nl> + ! isDebuggerActive ( ) ; <nl> + return s_shouldUseColour ; <nl> + } <nl> void TextColour : : set ( Colours colour ) { <nl> - if ( isatty ( fileno ( stdout ) ) & & ! isDebuggerActive ( ) ) { <nl> + if ( shouldUseColour ( ) ) { <nl> switch ( colour ) { <nl> case TextColour : : FileName : <nl> std : : cout < < colourEscape < < " [ 0m " ; / / white / normal <nl> mmm a / include / internal / catch_expressionresult_builder . hpp <nl> ppp b / include / internal / catch_expressionresult_builder . hpp <nl> namespace Catch { <nl> else if ( m_exprComponents . op = = " matches " ) <nl> return m_exprComponents . lhs + " " + m_exprComponents . rhs ; <nl> else if ( m_exprComponents . op ! = " ! " ) { <nl> - if ( m_exprComponents . lhs . size ( ) + m_exprComponents . rhs . size ( ) < 30 ) <nl> + if ( m_exprComponents . lhs . size ( ) + m_exprComponents . rhs . size ( ) < 40 ) <nl> return m_exprComponents . lhs + " " + m_exprComponents . op + " " + m_exprComponents . rhs ; <nl> - else if ( m_exprComponents . lhs . size ( ) < 70 & & m_exprComponents . rhs . size ( ) < 70 ) <nl> - return " \ n \ t " + m_exprComponents . lhs + " \ n \ t " + m_exprComponents . op + " \ n \ t " + m_exprComponents . rhs ; <nl> else <nl> - return " \ n " + m_exprComponents . lhs + " \ n " + m_exprComponents . op + " \ n " + m_exprComponents . rhs + " \ n \ n " ; <nl> + return m_exprComponents . lhs + " \ n " + m_exprComponents . op + " \ n " + m_exprComponents . rhs ; <nl> } <nl> else <nl> return " { can ' t expand - use " + info . macroName + " _FALSE ( " + info . capturedExpression . substr ( 1 ) + " ) instead of " + info . macroName + " ( " + info . capturedExpression + " ) for better diagnostics } " ; <nl> mmm a / include / internal / catch_runner_impl . hpp <nl> ppp b / include / internal / catch_runner_impl . hpp <nl> namespace Catch { <nl> missingAssertions = true ; <nl> <nl> } <nl> - m_runningTest - > endSection ( info . name ) ; <nl> + m_runningTest - > endSection ( info . name , false ) ; <nl> <nl> m_reporter - > sectionEnded ( SectionStats ( info , assertions , missingAssertions ) ) ; <nl> m_messages . clear ( ) ; <nl> mmm a / include / internal / catch_running_test . hpp <nl> ppp b / include / internal / catch_running_test . hpp <nl> namespace Catch { <nl> return false ; <nl> } <nl> <nl> - void endSection ( const std : : string & ) { <nl> + void endSection ( const std : : string & , bool stealth ) { <nl> if ( m_currentSection - > ran ( ) ) { <nl> - m_runStatus = RanAtLeastOneSection ; <nl> + if ( ! stealth ) <nl> + m_runStatus = RanAtLeastOneSection ; <nl> m_changed = true ; <nl> } <nl> else if ( m_runStatus = = EncounteredASection ) { <nl> - m_runStatus = RanAtLeastOneSection ; <nl> + if ( ! stealth ) <nl> + m_runStatus = RanAtLeastOneSection ; <nl> m_lastSectionToRun = m_currentSection ; <nl> } <nl> m_currentSection = m_currentSection - > getParent ( ) ; <nl> mmm a / include / internal / catch_tostring . hpp <nl> ppp b / include / internal / catch_tostring . hpp <nl> <nl> <nl> # include " catch_common . h " <nl> # include < sstream > <nl> + # include < iomanip > <nl> + # include < limits > <nl> <nl> # ifdef __OBJC__ <nl> # include " catch_objc_arc . hpp " <nl> namespace Detail { <nl> template < typename T > NonStreamable ( const T & ) { } <nl> } ; <nl> <nl> - / / If the type does not have its own < < overload for ostream then <nl> - / / this one will be used instead <nl> - inline std : : ostream & operator < < ( std : : ostream & ss , NonStreamable ) { <nl> - return ss < < " { ? } " ; <nl> - } <nl> - <nl> - template < typename T > <nl> - inline std : : string makeString ( const T & value ) { <nl> + } / / end namespace Detail <nl> + <nl> + / / If the type does not have its own < < overload for ostream then <nl> + / / this one will be used instead <nl> + inline std : : ostream & operator < < ( std : : ostream & ss , Detail : : NonStreamable ) { <nl> + return ss < < " { ? } " ; <nl> + } <nl> + <nl> + template < typename T > <nl> + struct StringMaker { <nl> + static std : : string convert ( T const & value ) { <nl> std : : ostringstream oss ; <nl> oss < < value ; <nl> return oss . str ( ) ; <nl> - } <nl> - <nl> - template < typename T > <nl> - inline std : : string makeString ( T * p ) { <nl> + } <nl> + } ; <nl> + template < typename T > <nl> + struct StringMaker < T * > { <nl> + static std : : string convert ( T const * p ) { <nl> if ( ! p ) <nl> return INTERNAL_CATCH_STRINGIFY ( NULL ) ; <nl> std : : ostringstream oss ; <nl> oss < < p ; <nl> return oss . str ( ) ; <nl> - } <nl> + } <nl> + } ; <nl> <nl> - template < typename T > <nl> - inline std : : string makeString ( const T * p ) { <nl> - if ( ! p ) <nl> - return INTERNAL_CATCH_STRINGIFY ( NULL ) ; <nl> + template < typename T > <nl> + struct StringMaker < std : : vector < T > > { <nl> + static std : : string convert ( std : : vector < T > const & v ) { <nl> std : : ostringstream oss ; <nl> - oss < < p ; <nl> + oss < < " { " ; <nl> + for ( std : : size_t i = 0 ; i < v . size ( ) ; + + i ) { <nl> + oss < < v [ i ] ; <nl> + if ( i < v . size ( ) - 1 ) <nl> + oss < < " , " ; <nl> + } <nl> + oss < < " } " ; <nl> return oss . str ( ) ; <nl> - } <nl> + } <nl> + } ; <nl> <nl> + namespace Detail { <nl> + template < typename T > <nl> + inline std : : string makeString ( const T & value ) { <nl> + return StringMaker < T > : : convert ( value ) ; <nl> + } <nl> } / / end namespace Detail <nl> <nl> / / / \ brief converts any type to a string <nl> namespace Detail { <nl> / / / to provide an ostream overload for . <nl> template < typename T > <nl> std : : string toString ( const T & value ) { <nl> - return Detail : : makeString ( value ) ; <nl> + return StringMaker < T > : : convert ( value ) ; <nl> + / / return Detail : : makeString ( value ) ; <nl> } <nl> <nl> / / Built in overloads <nl> inline std : : string toString ( unsigned int value ) { <nl> <nl> inline std : : string toString ( const double value ) { <nl> std : : ostringstream oss ; <nl> - oss < < value ; <nl> + oss < < std : : setprecision ( std : : numeric_limits < double > : : digits10 + 1 ) <nl> + < < value ; <nl> return oss . str ( ) ; <nl> } <nl> <nl> mmm a / include / internal / catch_version . hpp <nl> ppp b / include / internal / catch_version . hpp <nl> <nl> namespace Catch { <nl> <nl> / / These numbers are maintained by a script <nl> - Version libraryVersion ( 0 , 9 , 20 , " integration " ) ; <nl> + Version libraryVersion ( 0 , 9 , 21 , " integration " ) ; <nl> } <nl> <nl> # endif / / TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED <nl> mmm a / include / reporters / catch_reporter_console . hpp <nl> ppp b / include / reporters / catch_reporter_console . hpp <nl> namespace Catch { <nl> } <nl> <nl> void print ( ) const { <nl> + printSourceInfo ( ) ; <nl> if ( stats . totals . assertions . total ( ) > 0 ) { <nl> + if ( result . isOk ( ) ) <nl> + stream < < " \ n " ; <nl> printResultType ( ) ; <nl> printOriginalExpression ( ) ; <nl> printReconstructedExpression ( ) ; <nl> } <nl> + else { <nl> + stream < < " \ n " ; <nl> + } <nl> printMessage ( ) ; <nl> - printSourceInfo ( ) ; <nl> } <nl> <nl> private : <nl> namespace Catch { <nl> } <nl> void printSourceInfo ( ) const { <nl> TextColour colourGuard ( TextColour : : FileName ) ; <nl> - stream < < result . getSourceInfo ( ) < < " : \ n " ; <nl> + stream < < result . getSourceInfo ( ) < < " : " ; <nl> } <nl> <nl> static std : : string wrapLongStrings ( std : : string const & _string ) { <nl> mmm a / projects / SelfTest / ApproxTests . cpp <nl> ppp b / projects / SelfTest / ApproxTests . cpp <nl> TEST_CASE <nl> REQUIRE ( approx ( d ) ! = 1 . 25 ) ; <nl> } <nl> <nl> + inline double divide ( double a , double b ) { <nl> + return a / b ; <nl> + } <nl> + <nl> + TEST_CASE ( " Approximate PI " , " [ Approx ] [ PI ] " ) <nl> + { <nl> + REQUIRE ( divide ( 22 , 7 ) = = Approx ( 3 . 141 ) . epsilon ( 0 . 001 ) ) ; <nl> + REQUIRE ( divide ( 22 , 7 ) ! = Approx ( 3 . 141 ) . epsilon ( 0 . 0001 ) ) ; <nl> + } <nl> mmm a / projects / SelfTest / Baselines / approvedResults . txt <nl> ppp b / projects / SelfTest / Baselines / approvedResults . txt <nl> <nl> <nl> - CatchSelfTest is a CATCH v0 . 9 b19 ( integration ) host application . <nl> + CatchSelfTest is a CATCH v0 . 9 b21 ( integration ) host application . <nl> Run with - ? for options <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Approx / simple <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ApproxTests . cpp : 20 : <nl> PASSED : <nl> REQUIRE ( d = = Approx ( 1 . 23 ) ) <nl> with expansion : <nl> 1 . 23 = = Approx ( 1 . 23 ) <nl> - ApproxTests . cpp : 20 : <nl> <nl> + ApproxTests . cpp : 21 : <nl> PASSED : <nl> REQUIRE ( d ! = Approx ( 1 . 22 ) ) <nl> with expansion : <nl> 1 . 23 ! = Approx ( 1 . 22 ) <nl> - ApproxTests . cpp : 21 : <nl> <nl> + ApproxTests . cpp : 22 : <nl> PASSED : <nl> REQUIRE ( d ! = Approx ( 1 . 24 ) ) <nl> with expansion : <nl> 1 . 23 ! = Approx ( 1 . 24 ) <nl> - ApproxTests . cpp : 22 : <nl> <nl> + ApproxTests . cpp : 24 : <nl> PASSED : <nl> REQUIRE ( Approx ( d ) = = 1 . 23 ) <nl> with expansion : <nl> Approx ( 1 . 23 ) = = 1 . 23 <nl> - ApproxTests . cpp : 24 : <nl> <nl> + ApproxTests . cpp : 25 : <nl> PASSED : <nl> REQUIRE ( Approx ( d ) ! = 1 . 22 ) <nl> with expansion : <nl> Approx ( 1 . 23 ) ! = 1 . 22 <nl> - ApproxTests . cpp : 25 : <nl> <nl> + ApproxTests . cpp : 26 : <nl> PASSED : <nl> REQUIRE ( Approx ( d ) ! = 1 . 24 ) <nl> with expansion : <nl> Approx ( 1 . 23 ) ! = 1 . 24 <nl> - ApproxTests . cpp : 26 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Approx / epsilon <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ApproxTests . cpp : 38 : <nl> PASSED : <nl> REQUIRE ( d ! = Approx ( 1 . 231 ) ) <nl> with expansion : <nl> 1 . 23 ! = Approx ( 1 . 231 ) <nl> - ApproxTests . cpp : 38 : <nl> <nl> + ApproxTests . cpp : 39 : <nl> PASSED : <nl> REQUIRE ( d = = Approx ( 1 . 231 ) . epsilon ( 0 . 1 ) ) <nl> with expansion : <nl> 1 . 23 = = Approx ( 1 . 231 ) <nl> - ApproxTests . cpp : 39 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Approx / float <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ApproxTests . cpp : 49 : <nl> PASSED : <nl> REQUIRE ( 1 . 23f = = Approx ( 1 . 23f ) ) <nl> with expansion : <nl> 1 . 23 = = Approx ( 1 . 23 ) <nl> - ApproxTests . cpp : 49 : <nl> <nl> + ApproxTests . cpp : 50 : <nl> PASSED : <nl> REQUIRE ( 0 . 0f = = Approx ( 0 . 0f ) ) <nl> with expansion : <nl> 0 = = Approx ( 0 ) <nl> - ApproxTests . cpp : 50 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Approx / int <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ApproxTests . cpp : 60 : <nl> PASSED : <nl> REQUIRE ( 1 = = Approx ( 1 ) ) <nl> - ApproxTests . cpp : 60 : <nl> <nl> + ApproxTests . cpp : 61 : <nl> PASSED : <nl> REQUIRE ( 0 = = Approx ( 0 ) ) <nl> - ApproxTests . cpp : 61 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Approx / mixed <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ApproxTests . cpp : 75 : <nl> PASSED : <nl> REQUIRE ( 1 . 0f = = Approx ( 1 ) ) <nl> with expansion : <nl> 1 = = Approx ( 1 ) <nl> - ApproxTests . cpp : 75 : <nl> <nl> + ApproxTests . cpp : 76 : <nl> PASSED : <nl> REQUIRE ( 0 = = Approx ( dZero ) ) <nl> with expansion : <nl> 0 = = Approx ( 0 ) <nl> - ApproxTests . cpp : 76 : <nl> <nl> + ApproxTests . cpp : 77 : <nl> PASSED : <nl> REQUIRE ( 0 = = Approx ( dSmall ) . epsilon ( 0 . 001 ) ) <nl> with expansion : <nl> 0 = = Approx ( 1e - 05 ) <nl> - ApproxTests . cpp : 77 : <nl> <nl> + ApproxTests . cpp : 78 : <nl> PASSED : <nl> REQUIRE ( 1 . 234f = = Approx ( dMedium ) ) <nl> with expansion : <nl> 1 . 234 = = Approx ( 1 . 234 ) <nl> - ApproxTests . cpp : 78 : <nl> <nl> + ApproxTests . cpp : 79 : <nl> PASSED : <nl> REQUIRE ( dMedium = = Approx ( 1 . 234f ) ) <nl> with expansion : <nl> 1 . 234 = = Approx ( 1 . 234 ) <nl> - ApproxTests . cpp : 79 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Approx / custom <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ApproxTests . cpp : 93 : <nl> PASSED : <nl> REQUIRE ( d = = approx ( 1 . 23 ) ) <nl> with expansion : <nl> 1 . 23 = = Approx ( 1 . 23 ) <nl> - ApproxTests . cpp : 93 : <nl> <nl> + ApproxTests . cpp : 94 : <nl> PASSED : <nl> REQUIRE ( d = = approx ( 1 . 22 ) ) <nl> with expansion : <nl> 1 . 23 = = Approx ( 1 . 22 ) <nl> - ApproxTests . cpp : 94 : <nl> <nl> + ApproxTests . cpp : 95 : <nl> PASSED : <nl> REQUIRE ( d = = approx ( 1 . 24 ) ) <nl> with expansion : <nl> 1 . 23 = = Approx ( 1 . 24 ) <nl> - ApproxTests . cpp : 95 : <nl> <nl> + ApproxTests . cpp : 96 : <nl> PASSED : <nl> REQUIRE ( d ! = approx ( 1 . 25 ) ) <nl> with expansion : <nl> 1 . 23 ! = Approx ( 1 . 25 ) <nl> - ApproxTests . cpp : 96 : <nl> <nl> + ApproxTests . cpp : 98 : <nl> PASSED : <nl> REQUIRE ( approx ( d ) = = 1 . 23 ) <nl> with expansion : <nl> Approx ( 1 . 23 ) = = 1 . 23 <nl> - ApproxTests . cpp : 98 : <nl> <nl> + ApproxTests . cpp : 99 : <nl> PASSED : <nl> REQUIRE ( approx ( d ) = = 1 . 22 ) <nl> with expansion : <nl> Approx ( 1 . 23 ) = = 1 . 22 <nl> - ApproxTests . cpp : 99 : <nl> <nl> + ApproxTests . cpp : 100 : <nl> PASSED : <nl> REQUIRE ( approx ( d ) = = 1 . 24 ) <nl> with expansion : <nl> Approx ( 1 . 23 ) = = 1 . 24 <nl> - ApproxTests . cpp : 100 : <nl> <nl> + ApproxTests . cpp : 101 : <nl> PASSED : <nl> REQUIRE ( approx ( d ) ! = 1 . 25 ) <nl> with expansion : <nl> Approx ( 1 . 23 ) ! = 1 . 25 <nl> - ApproxTests . cpp : 101 : <nl> + <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + Approximate PI <nl> + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> + <nl> + ApproxTests . cpp : 110 : <nl> + PASSED : <nl> + REQUIRE ( divide ( 22 , 7 ) = = Approx ( 3 . 141 ) . epsilon ( 0 . 001 ) ) <nl> + with expansion : <nl> + 3 . 142857142857143 = = Approx ( 3 . 141 ) <nl> + <nl> + ApproxTests . cpp : 111 : <nl> + PASSED : <nl> + REQUIRE ( divide ( 22 , 7 ) ! = Approx ( 3 . 141 ) . epsilon ( 0 . 0001 ) ) <nl> + with expansion : <nl> + 3 . 142857142857143 ! = Approx ( 3 . 141 ) <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / TestClass / succeedingCase <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ClassTests . cpp : 24 : <nl> PASSED : <nl> REQUIRE ( s = = " hello " ) <nl> with expansion : <nl> " hello " = = " hello " <nl> - ClassTests . cpp : 24 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / TestClass / failingCase <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ClassTests . cpp : 28 : FAILED : <nl> REQUIRE ( s = = " world " ) <nl> with expansion : <nl> " hello " = = " world " <nl> - ClassTests . cpp : 28 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Fixture / succeedingCase <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ClassTests . cpp : 47 : <nl> PASSED : <nl> REQUIRE ( m_a = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - ClassTests . cpp : 47 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / Fixture / failingCase <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ClassTests . cpp : 55 : FAILED : <nl> REQUIRE ( m_a = = 2 ) <nl> with expansion : <nl> 1 = = 2 <nl> - ClassTests . cpp : 55 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / conditions / equality <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ConditionTests . cpp : 55 : <nl> PASSED : <nl> REQUIRE ( data . int_seven = = 7 ) <nl> with expansion : <nl> 7 = = 7 <nl> - ConditionTests . cpp : 55 : <nl> <nl> + ConditionTests . cpp : 56 : <nl> PASSED : <nl> REQUIRE ( data . float_nine_point_one = = Approx ( 9 . 1f ) ) <nl> with expansion : <nl> 9 . 1 = = Approx ( 9 . 1 ) <nl> - ConditionTests . cpp : 56 : <nl> <nl> + ConditionTests . cpp : 57 : <nl> PASSED : <nl> REQUIRE ( data . double_pi = = Approx ( 3 . 1415926535 ) ) <nl> with expansion : <nl> - 3 . 14159 = = Approx ( 3 . 14159 ) <nl> - ConditionTests . cpp : 57 : <nl> + 3 . 1415926535 = = Approx ( 3 . 14159 ) <nl> <nl> + ConditionTests . cpp : 58 : <nl> PASSED : <nl> REQUIRE ( data . str_hello = = " hello " ) <nl> with expansion : <nl> " hello " = = " hello " <nl> - ConditionTests . cpp : 58 : <nl> <nl> + ConditionTests . cpp : 59 : <nl> PASSED : <nl> REQUIRE ( " hello " = = data . str_hello ) <nl> with expansion : <nl> " hello " = = " hello " <nl> - ConditionTests . cpp : 59 : <nl> <nl> + ConditionTests . cpp : 60 : <nl> PASSED : <nl> REQUIRE ( data . str_hello . size ( ) = = 5 ) <nl> with expansion : <nl> 5 = = 5 <nl> - ConditionTests . cpp : 60 : <nl> <nl> + ConditionTests . cpp : 63 : <nl> PASSED : <nl> REQUIRE ( x = = Approx ( 1 . 3 ) ) <nl> with expansion : <nl> 1 . 3 = = Approx ( 1 . 3 ) <nl> - ConditionTests . cpp : 63 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / conditions / equality <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 71 : FAILED : <nl> CHECK ( data . int_seven = = 6 ) <nl> with expansion : <nl> 7 = = 6 <nl> - ConditionTests . cpp : 71 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 72 : FAILED : <nl> CHECK ( data . int_seven = = 8 ) <nl> with expansion : <nl> 7 = = 8 <nl> - ConditionTests . cpp : 72 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 73 : FAILED : <nl> CHECK ( data . int_seven = = 0 ) <nl> with expansion : <nl> 7 = = 0 <nl> - ConditionTests . cpp : 73 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 74 : FAILED : <nl> CHECK ( data . float_nine_point_one = = Approx ( 9 . 11f ) ) <nl> with expansion : <nl> 9 . 1 = = Approx ( 9 . 11 ) <nl> - ConditionTests . cpp : 74 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 75 : FAILED : <nl> CHECK ( data . float_nine_point_one = = Approx ( 9 . 0f ) ) <nl> with expansion : <nl> 9 . 1 = = Approx ( 9 ) <nl> - ConditionTests . cpp : 75 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 76 : FAILED : <nl> CHECK ( data . float_nine_point_one = = Approx ( 1 ) ) <nl> with expansion : <nl> 9 . 1 = = Approx ( 1 ) <nl> - ConditionTests . cpp : 76 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 77 : FAILED : <nl> CHECK ( data . float_nine_point_one = = Approx ( 0 ) ) <nl> with expansion : <nl> 9 . 1 = = Approx ( 0 ) <nl> - ConditionTests . cpp : 77 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 78 : FAILED : <nl> CHECK ( data . double_pi = = Approx ( 3 . 1415 ) ) <nl> with expansion : <nl> - 3 . 14159 = = Approx ( 3 . 1415 ) <nl> - ConditionTests . cpp : 78 : <nl> + 3 . 1415926535 = = Approx ( 3 . 1415 ) <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 79 : FAILED : <nl> CHECK ( data . str_hello = = " goodbye " ) <nl> with expansion : <nl> " hello " = = " goodbye " <nl> - ConditionTests . cpp : 79 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 80 : FAILED : <nl> CHECK ( data . str_hello = = " hell " ) <nl> with expansion : <nl> " hello " = = " hell " <nl> - ConditionTests . cpp : 80 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 81 : FAILED : <nl> CHECK ( data . str_hello = = " hello1 " ) <nl> with expansion : <nl> " hello " = = " hello1 " <nl> - ConditionTests . cpp : 81 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 82 : FAILED : <nl> CHECK ( data . str_hello . size ( ) = = 6 ) <nl> with expansion : <nl> 5 = = 6 <nl> - ConditionTests . cpp : 82 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 85 : FAILED : <nl> CHECK ( x = = Approx ( 1 . 301 ) ) <nl> with expansion : <nl> 1 . 3 = = Approx ( 1 . 301 ) <nl> - ConditionTests . cpp : 85 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / conditions / inequality <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ConditionTests . cpp : 93 : <nl> PASSED : <nl> REQUIRE ( data . int_seven ! = 6 ) <nl> with expansion : <nl> 7 ! = 6 <nl> - ConditionTests . cpp : 93 : <nl> <nl> + ConditionTests . cpp : 94 : <nl> PASSED : <nl> REQUIRE ( data . int_seven ! = 8 ) <nl> with expansion : <nl> 7 ! = 8 <nl> - ConditionTests . cpp : 94 : <nl> <nl> + ConditionTests . cpp : 95 : <nl> PASSED : <nl> REQUIRE ( data . float_nine_point_one ! = Approx ( 9 . 11f ) ) <nl> with expansion : <nl> 9 . 1 ! = Approx ( 9 . 11 ) <nl> - ConditionTests . cpp : 95 : <nl> <nl> + ConditionTests . cpp : 96 : <nl> PASSED : <nl> REQUIRE ( data . float_nine_point_one ! = Approx ( 9 . 0f ) ) <nl> with expansion : <nl> 9 . 1 ! = Approx ( 9 ) <nl> - ConditionTests . cpp : 96 : <nl> <nl> + ConditionTests . cpp : 97 : <nl> PASSED : <nl> REQUIRE ( data . float_nine_point_one ! = Approx ( 1 ) ) <nl> with expansion : <nl> 9 . 1 ! = Approx ( 1 ) <nl> - ConditionTests . cpp : 97 : <nl> <nl> + ConditionTests . cpp : 98 : <nl> PASSED : <nl> REQUIRE ( data . float_nine_point_one ! = Approx ( 0 ) ) <nl> with expansion : <nl> 9 . 1 ! = Approx ( 0 ) <nl> - ConditionTests . cpp : 98 : <nl> <nl> + ConditionTests . cpp : 99 : <nl> PASSED : <nl> REQUIRE ( data . double_pi ! = Approx ( 3 . 1415 ) ) <nl> with expansion : <nl> - 3 . 14159 ! = Approx ( 3 . 1415 ) <nl> - ConditionTests . cpp : 99 : <nl> + 3 . 1415926535 ! = Approx ( 3 . 1415 ) <nl> <nl> + ConditionTests . cpp : 100 : <nl> PASSED : <nl> REQUIRE ( data . str_hello ! = " goodbye " ) <nl> with expansion : <nl> " hello " ! = " goodbye " <nl> - ConditionTests . cpp : 100 : <nl> <nl> + ConditionTests . cpp : 101 : <nl> PASSED : <nl> REQUIRE ( data . str_hello ! = " hell " ) <nl> with expansion : <nl> " hello " ! = " hell " <nl> - ConditionTests . cpp : 101 : <nl> <nl> + ConditionTests . cpp : 102 : <nl> PASSED : <nl> REQUIRE ( data . str_hello ! = " hello1 " ) <nl> with expansion : <nl> " hello " ! = " hello1 " <nl> - ConditionTests . cpp : 102 : <nl> <nl> + ConditionTests . cpp : 103 : <nl> PASSED : <nl> REQUIRE ( data . str_hello . size ( ) ! = 6 ) <nl> with expansion : <nl> 5 ! = 6 <nl> - ConditionTests . cpp : 103 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / conditions / inequality <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 111 : FAILED : <nl> CHECK ( data . int_seven ! = 7 ) <nl> with expansion : <nl> 7 ! = 7 <nl> - ConditionTests . cpp : 111 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 112 : FAILED : <nl> CHECK ( data . float_nine_point_one ! = Approx ( 9 . 1f ) ) <nl> with expansion : <nl> 9 . 1 ! = Approx ( 9 . 1 ) <nl> - ConditionTests . cpp : 112 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 113 : FAILED : <nl> CHECK ( data . double_pi ! = Approx ( 3 . 1415926535 ) ) <nl> with expansion : <nl> - 3 . 14159 ! = Approx ( 3 . 14159 ) <nl> - ConditionTests . cpp : 113 : <nl> + 3 . 1415926535 ! = Approx ( 3 . 14159 ) <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 114 : FAILED : <nl> CHECK ( data . str_hello ! = " hello " ) <nl> with expansion : <nl> " hello " ! = " hello " <nl> - ConditionTests . cpp : 114 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 115 : FAILED : <nl> CHECK ( data . str_hello . size ( ) ! = 5 ) <nl> with expansion : <nl> 5 ! = 5 <nl> - ConditionTests . cpp : 115 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / conditions / ordered <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ConditionTests . cpp : 124 : <nl> PASSED : <nl> REQUIRE ( data . int_seven < 8 ) <nl> with expansion : <nl> 7 < 8 <nl> - ConditionTests . cpp : 124 : <nl> <nl> + ConditionTests . cpp : 125 : <nl> PASSED : <nl> REQUIRE ( data . int_seven > 6 ) <nl> with expansion : <nl> 7 > 6 <nl> - ConditionTests . cpp : 125 : <nl> <nl> + ConditionTests . cpp : 126 : <nl> PASSED : <nl> REQUIRE ( data . int_seven > 0 ) <nl> with expansion : <nl> 7 > 0 <nl> - ConditionTests . cpp : 126 : <nl> <nl> + ConditionTests . cpp : 127 : <nl> PASSED : <nl> REQUIRE ( data . int_seven > - 1 ) <nl> with expansion : <nl> 7 > - 1 <nl> - ConditionTests . cpp : 127 : <nl> <nl> + ConditionTests . cpp : 129 : <nl> PASSED : <nl> REQUIRE ( data . int_seven > = 7 ) <nl> with expansion : <nl> 7 > = 7 <nl> - ConditionTests . cpp : 129 : <nl> <nl> + ConditionTests . cpp : 130 : <nl> PASSED : <nl> REQUIRE ( data . int_seven > = 6 ) <nl> with expansion : <nl> 7 > = 6 <nl> - ConditionTests . cpp : 130 : <nl> <nl> + ConditionTests . cpp : 131 : <nl> PASSED : <nl> REQUIRE ( data . int_seven < = 7 ) <nl> with expansion : <nl> 7 < = 7 <nl> - ConditionTests . cpp : 131 : <nl> <nl> + ConditionTests . cpp : 132 : <nl> PASSED : <nl> REQUIRE ( data . int_seven < = 8 ) <nl> with expansion : <nl> 7 < = 8 <nl> - ConditionTests . cpp : 132 : <nl> <nl> + ConditionTests . cpp : 134 : <nl> PASSED : <nl> REQUIRE ( data . float_nine_point_one > 9 ) <nl> with expansion : <nl> 9 . 1 > 9 <nl> - ConditionTests . cpp : 134 : <nl> <nl> + ConditionTests . cpp : 135 : <nl> PASSED : <nl> REQUIRE ( data . float_nine_point_one < 10 ) <nl> with expansion : <nl> 9 . 1 < 10 <nl> - ConditionTests . cpp : 135 : <nl> <nl> + ConditionTests . cpp : 136 : <nl> PASSED : <nl> REQUIRE ( data . float_nine_point_one < 9 . 2 ) <nl> with expansion : <nl> - 9 . 1 < 9 . 2 <nl> - ConditionTests . cpp : 136 : <nl> + 9 . 1 < 9 . 199999999999999 <nl> <nl> + ConditionTests . cpp : 138 : <nl> PASSED : <nl> REQUIRE ( data . str_hello < = " hello " ) <nl> with expansion : <nl> " hello " < = " hello " <nl> - ConditionTests . cpp : 138 : <nl> <nl> + ConditionTests . cpp : 139 : <nl> PASSED : <nl> REQUIRE ( data . str_hello > = " hello " ) <nl> with expansion : <nl> " hello " > = " hello " <nl> - ConditionTests . cpp : 139 : <nl> <nl> + ConditionTests . cpp : 141 : <nl> PASSED : <nl> REQUIRE ( data . str_hello < " hellp " ) <nl> with expansion : <nl> " hello " < " hellp " <nl> - ConditionTests . cpp : 141 : <nl> <nl> + ConditionTests . cpp : 142 : <nl> PASSED : <nl> REQUIRE ( data . str_hello < " zebra " ) <nl> with expansion : <nl> " hello " < " zebra " <nl> - ConditionTests . cpp : 142 : <nl> <nl> + ConditionTests . cpp : 143 : <nl> PASSED : <nl> REQUIRE ( data . str_hello > " hellm " ) <nl> with expansion : <nl> " hello " > " hellm " <nl> - ConditionTests . cpp : 143 : <nl> <nl> + ConditionTests . cpp : 144 : <nl> PASSED : <nl> REQUIRE ( data . str_hello > " a " ) <nl> with expansion : <nl> " hello " > " a " <nl> - ConditionTests . cpp : 144 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / conditions / ordered <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 152 : FAILED : <nl> CHECK ( data . int_seven > 7 ) <nl> with expansion : <nl> 7 > 7 <nl> - ConditionTests . cpp : 152 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 153 : FAILED : <nl> CHECK ( data . int_seven < 7 ) <nl> with expansion : <nl> 7 < 7 <nl> - ConditionTests . cpp : 153 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 154 : FAILED : <nl> CHECK ( data . int_seven > 8 ) <nl> with expansion : <nl> 7 > 8 <nl> - ConditionTests . cpp : 154 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 155 : FAILED : <nl> CHECK ( data . int_seven < 6 ) <nl> with expansion : <nl> 7 < 6 <nl> - ConditionTests . cpp : 155 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 156 : FAILED : <nl> CHECK ( data . int_seven < 0 ) <nl> with expansion : <nl> 7 < 0 <nl> - ConditionTests . cpp : 156 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 157 : FAILED : <nl> CHECK ( data . int_seven < - 1 ) <nl> with expansion : <nl> 7 < - 1 <nl> - ConditionTests . cpp : 157 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 159 : FAILED : <nl> CHECK ( data . int_seven > = 8 ) <nl> with expansion : <nl> 7 > = 8 <nl> - ConditionTests . cpp : 159 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 160 : FAILED : <nl> CHECK ( data . int_seven < = 6 ) <nl> with expansion : <nl> 7 < = 6 <nl> - ConditionTests . cpp : 160 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 162 : FAILED : <nl> CHECK ( data . float_nine_point_one < 9 ) <nl> with expansion : <nl> 9 . 1 < 9 <nl> - ConditionTests . cpp : 162 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 163 : FAILED : <nl> CHECK ( data . float_nine_point_one > 10 ) <nl> with expansion : <nl> 9 . 1 > 10 <nl> - ConditionTests . cpp : 163 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 164 : FAILED : <nl> CHECK ( data . float_nine_point_one > 9 . 2 ) <nl> with expansion : <nl> - 9 . 1 > 9 . 2 <nl> - ConditionTests . cpp : 164 : <nl> + 9 . 1 > 9 . 199999999999999 <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 166 : FAILED : <nl> CHECK ( data . str_hello > " hello " ) <nl> with expansion : <nl> " hello " > " hello " <nl> - ConditionTests . cpp : 166 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 167 : FAILED : <nl> CHECK ( data . str_hello < " hello " ) <nl> with expansion : <nl> " hello " < " hello " <nl> - ConditionTests . cpp : 167 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 168 : FAILED : <nl> CHECK ( data . str_hello > " hellp " ) <nl> with expansion : <nl> " hello " > " hellp " <nl> - ConditionTests . cpp : 168 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 169 : FAILED : <nl> CHECK ( data . str_hello > " z " ) <nl> with expansion : <nl> " hello " > " z " <nl> - ConditionTests . cpp : 169 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 170 : FAILED : <nl> CHECK ( data . str_hello < " hellm " ) <nl> with expansion : <nl> " hello " < " hellm " <nl> - ConditionTests . cpp : 170 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 171 : FAILED : <nl> CHECK ( data . str_hello < " a " ) <nl> with expansion : <nl> " hello " < " a " <nl> - ConditionTests . cpp : 171 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 173 : FAILED : <nl> CHECK ( data . str_hello > = " z " ) <nl> with expansion : <nl> " hello " > = " z " <nl> - ConditionTests . cpp : 173 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 174 : FAILED : <nl> CHECK ( data . str_hello < = " a " ) <nl> with expansion : <nl> " hello " < = " a " <nl> - ConditionTests . cpp : 174 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / conditions / int literals <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ConditionTests . cpp : 188 : <nl> PASSED : <nl> REQUIRE ( i = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - ConditionTests . cpp : 188 : <nl> <nl> + ConditionTests . cpp : 189 : <nl> PASSED : <nl> REQUIRE ( ui = = 2 ) <nl> with expansion : <nl> 2 = = 2 <nl> - ConditionTests . cpp : 189 : <nl> <nl> + ConditionTests . cpp : 190 : <nl> PASSED : <nl> REQUIRE ( l = = 3 ) <nl> with expansion : <nl> 3 = = 3 <nl> - ConditionTests . cpp : 190 : <nl> <nl> + ConditionTests . cpp : 191 : <nl> PASSED : <nl> REQUIRE ( ul = = 4 ) <nl> with expansion : <nl> 4 = = 4 <nl> - ConditionTests . cpp : 191 : <nl> <nl> + ConditionTests . cpp : 192 : <nl> PASSED : <nl> REQUIRE ( c = = 5 ) <nl> with expansion : <nl> 5 = = 5 <nl> - ConditionTests . cpp : 192 : <nl> <nl> + ConditionTests . cpp : 193 : <nl> PASSED : <nl> REQUIRE ( uc = = 6 ) <nl> with expansion : <nl> 6 = = 6 <nl> - ConditionTests . cpp : 193 : <nl> <nl> + ConditionTests . cpp : 195 : <nl> PASSED : <nl> REQUIRE ( 1 = = i ) <nl> with expansion : <nl> 1 = = 1 <nl> - ConditionTests . cpp : 195 : <nl> <nl> + ConditionTests . cpp : 196 : <nl> PASSED : <nl> REQUIRE ( 2 = = ui ) <nl> with expansion : <nl> 2 = = 2 <nl> - ConditionTests . cpp : 196 : <nl> <nl> + ConditionTests . cpp : 197 : <nl> PASSED : <nl> REQUIRE ( 3 = = l ) <nl> with expansion : <nl> 3 = = 3 <nl> - ConditionTests . cpp : 197 : <nl> <nl> + ConditionTests . cpp : 198 : <nl> PASSED : <nl> REQUIRE ( 4 = = ul ) <nl> with expansion : <nl> 4 = = 4 <nl> - ConditionTests . cpp : 198 : <nl> <nl> + ConditionTests . cpp : 199 : <nl> PASSED : <nl> REQUIRE ( 5 = = c ) <nl> with expansion : <nl> 5 = = 5 <nl> - ConditionTests . cpp : 199 : <nl> <nl> + ConditionTests . cpp : 200 : <nl> PASSED : <nl> REQUIRE ( 6 = = uc ) <nl> with expansion : <nl> 6 = = 6 <nl> - ConditionTests . cpp : 200 : <nl> <nl> + ConditionTests . cpp : 202 : <nl> PASSED : <nl> REQUIRE ( ( std : : numeric_limits < unsigned long > : : max ) ( ) > ul ) <nl> with expansion : <nl> 0x < hex digits > > 4 <nl> - ConditionTests . cpp : 202 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / conditions / / long_to_unsigned_x <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ConditionTests . cpp : 223 : <nl> PASSED : <nl> REQUIRE ( long_var = = unsigned_char_var ) <nl> with expansion : <nl> 1 = = 1 <nl> - ConditionTests . cpp : 223 : <nl> <nl> + ConditionTests . cpp : 224 : <nl> PASSED : <nl> REQUIRE ( long_var = = unsigned_short_var ) <nl> with expansion : <nl> 1 = = 1 <nl> - ConditionTests . cpp : 224 : <nl> <nl> + ConditionTests . cpp : 225 : <nl> PASSED : <nl> REQUIRE ( long_var = = unsigned_int_var ) <nl> with expansion : <nl> 1 = = 1 <nl> - ConditionTests . cpp : 225 : <nl> <nl> + ConditionTests . cpp : 226 : <nl> PASSED : <nl> REQUIRE ( long_var = = unsigned_long_var ) <nl> with expansion : <nl> 1 = = 1 <nl> - ConditionTests . cpp : 226 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / conditions / const ints to int literal <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ConditionTests . cpp : 237 : <nl> PASSED : <nl> REQUIRE ( unsigned_char_var = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - ConditionTests . cpp : 237 : <nl> <nl> + ConditionTests . cpp : 238 : <nl> PASSED : <nl> REQUIRE ( unsigned_short_var = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - ConditionTests . cpp : 238 : <nl> <nl> + ConditionTests . cpp : 239 : <nl> PASSED : <nl> REQUIRE ( unsigned_int_var = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - ConditionTests . cpp : 239 : <nl> <nl> + ConditionTests . cpp : 240 : <nl> PASSED : <nl> REQUIRE ( unsigned_long_var = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - ConditionTests . cpp : 240 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / conditions / negative ints <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ConditionTests . cpp : 246 : <nl> PASSED : <nl> CHECK ( ( - 1 > 2u ) ) <nl> with expansion : <nl> true <nl> - ConditionTests . cpp : 246 : <nl> <nl> + ConditionTests . cpp : 247 : <nl> PASSED : <nl> CHECK ( - 1 > 2u ) <nl> with expansion : <nl> - 1 > 2 <nl> - ConditionTests . cpp : 247 : <nl> <nl> + ConditionTests . cpp : 249 : <nl> PASSED : <nl> CHECK ( ( 2u < - 1 ) ) <nl> with expansion : <nl> true <nl> - ConditionTests . cpp : 249 : <nl> <nl> + ConditionTests . cpp : 250 : <nl> PASSED : <nl> CHECK ( 2u < - 1 ) <nl> with expansion : <nl> 2 < - 1 <nl> - ConditionTests . cpp : 250 : <nl> <nl> + ConditionTests . cpp : 253 : <nl> PASSED : <nl> CHECK ( ( minInt > 2u ) ) <nl> with expansion : <nl> true <nl> - ConditionTests . cpp : 253 : <nl> <nl> + ConditionTests . cpp : 254 : <nl> PASSED : <nl> CHECK ( minInt > 2u ) <nl> with expansion : <nl> - 2147483648 > 2 <nl> - ConditionTests . cpp : 254 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / conditions / computed ints <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ConditionTests . cpp : 269 : <nl> PASSED : <nl> CHECK ( 54 = = 6 * 9 ) <nl> with expansion : <nl> 54 = = 54 <nl> - ConditionTests . cpp : 269 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / conditions / ptr <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ConditionTests . cpp : 285 : <nl> PASSED : <nl> REQUIRE ( p = = __null ) <nl> with expansion : <nl> __null = = 0 <nl> - ConditionTests . cpp : 285 : <nl> <nl> + ConditionTests . cpp : 286 : <nl> PASSED : <nl> REQUIRE ( p = = pNULL ) <nl> with expansion : <nl> __null = = __null <nl> - ConditionTests . cpp : 286 : <nl> <nl> + ConditionTests . cpp : 291 : <nl> PASSED : <nl> REQUIRE ( p ! = __null ) <nl> with expansion : <nl> 0x < hex digits > ! = 0 <nl> - ConditionTests . cpp : 291 : <nl> <nl> + ConditionTests . cpp : 294 : <nl> PASSED : <nl> REQUIRE ( cp ! = __null ) <nl> with expansion : <nl> 0x < hex digits > ! = 0 <nl> - ConditionTests . cpp : 294 : <nl> <nl> + ConditionTests . cpp : 297 : <nl> PASSED : <nl> REQUIRE ( cpc ! = __null ) <nl> with expansion : <nl> 0x < hex digits > ! = 0 <nl> - ConditionTests . cpp : 297 : <nl> <nl> + ConditionTests . cpp : 299 : <nl> PASSED : <nl> REQUIRE ( returnsNull ( ) = = __null ) <nl> with expansion : <nl> { null string } = = 0 <nl> - ConditionTests . cpp : 299 : <nl> <nl> + ConditionTests . cpp : 300 : <nl> PASSED : <nl> REQUIRE ( returnsConstNull ( ) = = __null ) <nl> with expansion : <nl> { null string } = = 0 <nl> - ConditionTests . cpp : 300 : <nl> <nl> + ConditionTests . cpp : 302 : <nl> PASSED : <nl> REQUIRE ( __null ! = p ) <nl> with expansion : <nl> 0 ! = 0x < hex digits > <nl> - ConditionTests . cpp : 302 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / conditions / not <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ConditionTests . cpp : 317 : <nl> PASSED : <nl> REQUIRE ( false = = false ) <nl> - ConditionTests . cpp : 317 : <nl> <nl> + ConditionTests . cpp : 318 : <nl> PASSED : <nl> REQUIRE ( true = = true ) <nl> - ConditionTests . cpp : 318 : <nl> <nl> + ConditionTests . cpp : 319 : <nl> PASSED : <nl> REQUIRE ( ! false ) <nl> with expansion : <nl> true <nl> - ConditionTests . cpp : 319 : <nl> <nl> + ConditionTests . cpp : 320 : <nl> PASSED : <nl> REQUIRE_FALSE ( ! false ) <nl> - ConditionTests . cpp : 320 : <nl> <nl> + ConditionTests . cpp : 322 : <nl> PASSED : <nl> REQUIRE ( ! falseValue ) <nl> with expansion : <nl> true <nl> - ConditionTests . cpp : 322 : <nl> <nl> + ConditionTests . cpp : 323 : <nl> PASSED : <nl> REQUIRE_FALSE ( ! falseValue ) <nl> with expansion : <nl> ! false <nl> - ConditionTests . cpp : 323 : <nl> <nl> + ConditionTests . cpp : 325 : <nl> PASSED : <nl> REQUIRE ( ! ( 1 = = 2 ) ) <nl> with expansion : <nl> true <nl> - ConditionTests . cpp : 325 : <nl> <nl> + ConditionTests . cpp : 326 : <nl> PASSED : <nl> REQUIRE_FALSE ( ! 1 = = 2 ) <nl> with expansion : <nl> ! ( 1 = = 2 ) <nl> - ConditionTests . cpp : 326 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / conditions / not <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 334 : FAILED : <nl> CHECK ( false ! = false ) <nl> - ConditionTests . cpp : 334 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 335 : FAILED : <nl> CHECK ( true ! = true ) <nl> - ConditionTests . cpp : 335 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 336 : FAILED : <nl> CHECK ( ! true ) <nl> with expansion : <nl> false <nl> - ConditionTests . cpp : 336 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 337 : FAILED : <nl> CHECK_FALSE ( ! true ) <nl> - ConditionTests . cpp : 337 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 339 : FAILED : <nl> CHECK ( ! trueValue ) <nl> with expansion : <nl> false <nl> - ConditionTests . cpp : 339 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 340 : FAILED : <nl> CHECK_FALSE ( ! trueValue ) <nl> with expansion : <nl> ! true <nl> - ConditionTests . cpp : 340 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 342 : FAILED : <nl> CHECK ( ! ( 1 = = 1 ) ) <nl> with expansion : <nl> false <nl> - ConditionTests . cpp : 342 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 343 : FAILED : <nl> CHECK_FALSE ( ! 1 = = 1 ) <nl> with expansion : <nl> ! ( 1 = = 1 ) <nl> - ConditionTests . cpp : 343 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / exceptions / explicit <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ExceptionTests . cpp : 39 : <nl> PASSED : <nl> REQUIRE_THROWS_AS ( thisThrows ( ) ) <nl> - ExceptionTests . cpp : 39 : <nl> <nl> + ExceptionTests . cpp : 40 : <nl> PASSED : <nl> REQUIRE_NOTHROW ( thisDoesntThrow ( ) ) <nl> - ExceptionTests . cpp : 40 : <nl> <nl> + ExceptionTests . cpp : 41 : <nl> PASSED : <nl> REQUIRE_THROWS ( thisThrows ( ) ) <nl> - ExceptionTests . cpp : 41 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / exceptions / explicit <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ExceptionTests . cpp : 47 : FAILED : <nl> CHECK_THROWS_AS ( thisThrows ( ) ) <nl> due to unexpected exception with message : <nl> expected exception <nl> - ExceptionTests . cpp : 47 : <nl> <nl> - FAILED : <nl> + ExceptionTests . cpp : 48 : FAILED : <nl> CHECK_THROWS_AS ( thisDoesntThrow ( ) ) <nl> because no exception was thrown where one was expected : <nl> - ExceptionTests . cpp : 48 : <nl> <nl> - FAILED : <nl> + ExceptionTests . cpp : 49 : FAILED : <nl> CHECK_NOTHROW ( thisThrows ( ) ) <nl> due to unexpected exception with message : <nl> expected exception <nl> - ExceptionTests . cpp : 49 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / exceptions / implicit <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ExceptionTests . cpp : 52 : FAILED : <nl> due to unexpected exception with message : <nl> unexpected exception <nl> - ExceptionTests . cpp : 52 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / exceptions / implicit / 2 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ExceptionTests . cpp : 60 : <nl> PASSED : <nl> CHECK ( 1 = = 1 ) <nl> - ExceptionTests . cpp : 60 : <nl> <nl> - FAILED : <nl> + ExceptionTests . cpp : 60 : FAILED : <nl> { Unknown expression after the reported line } <nl> due to unexpected exception with message : <nl> unexpected exception <nl> - ExceptionTests . cpp : 60 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / exceptions / implicit / 3 <nl> section name <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ExceptionTests . cpp : 66 : FAILED : <nl> due to unexpected exception with message : <nl> unexpected exception <nl> - ExceptionTests . cpp : 66 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / exceptions / implicit <nl> No assertions in test case , ' . / succeeding / exceptions / implicit ' <nl> . / failing / exceptions / custom <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ExceptionTests . cpp : 110 : FAILED : <nl> due to unexpected exception with message : <nl> custom exception <nl> - ExceptionTests . cpp : 110 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / exceptions / custom / nothrow <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ExceptionTests . cpp : 117 : FAILED : <nl> REQUIRE_NOTHROW ( throw CustomException ( " unexpected custom exception " ) ) <nl> due to unexpected exception with message : <nl> unexpected custom exception <nl> - ExceptionTests . cpp : 117 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / exceptions / custom / throw <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ExceptionTests . cpp : 122 : FAILED : <nl> REQUIRE_THROWS_AS ( throw CustomException ( " custom exception - not std " ) ) <nl> due to unexpected exception with message : <nl> custom exception - not std <nl> - ExceptionTests . cpp : 122 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / exceptions / custom / double <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ExceptionTests . cpp : 126 : FAILED : <nl> due to unexpected exception with message : <nl> 3 . 14 <nl> - ExceptionTests . cpp : 126 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / exceptions / notimplemented <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ExceptionTests . cpp : 137 : <nl> PASSED : <nl> REQUIRE_THROWS ( thisFunctionNotImplemented ( 7 ) ) <nl> - ExceptionTests . cpp : 137 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / generators / 1 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 2 = = 2 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 200 = = 200 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 4 = = 4 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 200 = = 200 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 6 = = 6 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 200 = = 200 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 8 = = 8 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 200 = = 200 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 10 = = 10 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 200 = = 200 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 30 = = 30 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 200 = = 200 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 40 = = 40 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 200 = = 200 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 42 = = 42 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 200 = = 200 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 72 = = 72 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 200 = = 200 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 2 = = 2 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 202 = = 202 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 4 = = 4 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 202 = = 202 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 6 = = 6 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 202 = = 202 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 8 = = 8 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 202 = = 202 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 10 = = 10 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 202 = = 202 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 30 = = 30 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 202 = = 202 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 40 = = 40 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 202 = = 202 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 42 = = 42 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 202 = = 202 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 72 = = 72 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 202 = = 202 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 2 = = 2 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 204 = = 204 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 4 = = 4 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 204 = = 204 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 6 = = 6 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 204 = = 204 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 8 = = 8 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 204 = = 204 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 10 = = 10 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 204 = = 204 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 30 = = 30 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 204 = = 204 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 40 = = 40 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 204 = = 204 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 42 = = 42 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 204 = = 204 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 72 = = 72 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 204 = = 204 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 2 = = 2 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 206 = = 206 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 4 = = 4 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 206 = = 206 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 6 = = 6 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 206 = = 206 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 8 = = 8 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 206 = = 206 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 10 = = 10 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 206 = = 206 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 30 = = 30 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 206 = = 206 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 40 = = 40 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 206 = = 206 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 42 = = 42 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 206 = = 206 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 72 = = 72 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 206 = = 206 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 2 = = 2 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 208 = = 208 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 4 = = 4 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 208 = = 208 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 6 = = 6 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 208 = = 208 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 8 = = 8 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 208 = = 208 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 10 = = 10 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 208 = = 208 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 30 = = 30 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 208 = = 208 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 40 = = 40 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 208 = = 208 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 42 = = 42 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 208 = = 208 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 72 = = 72 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 208 = = 208 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 2 = = 2 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 210 = = 210 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 4 = = 4 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 210 = = 210 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 6 = = 6 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 210 = = 210 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 8 = = 8 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 210 = = 210 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 10 = = 10 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 210 = = 210 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 30 = = 30 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 210 = = 210 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 40 = = 40 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 210 = = 210 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 42 = = 42 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 210 = = 210 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 72 = = 72 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 210 = = 210 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 2 = = 2 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 212 = = 212 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 4 = = 4 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 212 = = 212 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 6 = = 6 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 212 = = 212 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 8 = = 8 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 212 = = 212 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 10 = = 10 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 212 = = 212 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 30 = = 30 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 212 = = 212 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 40 = = 40 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 212 = = 212 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 42 = = 42 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 212 = = 212 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 72 = = 72 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 212 = = 212 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 2 = = 2 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 214 = = 214 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 4 = = 4 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 214 = = 214 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 6 = = 6 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 214 = = 214 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 8 = = 8 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 214 = = 214 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 10 = = 10 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 214 = = 214 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 30 = = 30 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 214 = = 214 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 40 = = 40 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 214 = = 214 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 42 = = 42 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 214 = = 214 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> + GeneratorTests . cpp : 26 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( i , 2 ) = = i * 2 ) <nl> with expansion : <nl> 72 = = 72 <nl> - GeneratorTests . cpp : 26 : <nl> <nl> + GeneratorTests . cpp : 27 : <nl> PASSED : <nl> CATCH_REQUIRE ( multiply ( j , 2 ) = = j * 2 ) <nl> with expansion : <nl> 214 = = 214 <nl> - GeneratorTests . cpp : 27 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / generators / 2 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + GeneratorTests . cpp : 40 : <nl> PASSED : <nl> CATCH_REQUIRE ( i - > first = = i - > second - 1 ) <nl> with expansion : <nl> 0 = = 0 <nl> - GeneratorTests . cpp : 40 : <nl> <nl> + GeneratorTests . cpp : 40 : <nl> PASSED : <nl> CATCH_REQUIRE ( i - > first = = i - > second - 1 ) <nl> with expansion : <nl> 2 = = 2 <nl> - GeneratorTests . cpp : 40 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / message <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MessageTests . cpp : 14 : <nl> warning : <nl> this is a message <nl> this is a warning <nl> - MessageTests . cpp : 14 : <nl> <nl> <nl> No assertions in test case , ' . / succeeding / message ' <nl> No assertions in test case , ' . / succeeding / message ' <nl> . / succeeding / succeed <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MessageTests . cpp : 18 : <nl> PASSED : <nl> with message : <nl> this is a success <nl> - MessageTests . cpp : 18 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / message / info / 1 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MessageTests . cpp : 26 : FAILED : <nl> REQUIRE ( a = = 1 ) <nl> with expansion : <nl> 2 = = 1 <nl> with messages : <nl> this message should be logged <nl> so should this <nl> - MessageTests . cpp : 26 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / mixed / message / info / 2 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MessageTests . cpp : 33 : <nl> PASSED : <nl> CHECK ( a = = 2 ) <nl> with expansion : <nl> 2 = = 2 <nl> with message : <nl> this message should not be logged <nl> - MessageTests . cpp : 33 : <nl> <nl> - FAILED : <nl> + MessageTests . cpp : 37 : FAILED : <nl> CHECK ( a = = 1 ) <nl> with expansion : <nl> 2 = = 1 <nl> with message : <nl> this message should be logged <nl> - MessageTests . cpp : 37 : <nl> <nl> - FAILED : <nl> + MessageTests . cpp : 41 : FAILED : <nl> CHECK ( a = = 0 ) <nl> with expansion : <nl> 2 = = 0 <nl> with message : <nl> and this , but later <nl> - MessageTests . cpp : 41 : <nl> <nl> + MessageTests . cpp : 45 : <nl> PASSED : <nl> CHECK ( a = = 2 ) <nl> with expansion : <nl> 2 = = 2 <nl> with message : <nl> but not this <nl> - MessageTests . cpp : 45 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / message / fail <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MessageTests . cpp : 51 : FAILED : <nl> explicitly with message : <nl> This is a failure <nl> - MessageTests . cpp : 51 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / message / sections <nl> one <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MessageTests . cpp : 58 : FAILED : <nl> explicitly with message : <nl> Message from section one <nl> - MessageTests . cpp : 58 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / message / sections <nl> two <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MessageTests . cpp : 63 : FAILED : <nl> explicitly with message : <nl> Message from section two <nl> - MessageTests . cpp : 63 : <nl> <nl> Message from section one <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> No assertions in section , ' two ' <nl> . / mixed / message / scoped <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MessageTests . cpp : 86 : <nl> PASSED : <nl> REQUIRE ( i < 10 ) <nl> with expansion : <nl> with expansion : <nl> with messages : <nl> current counter 0 <nl> i : = 0 <nl> - MessageTests . cpp : 86 : <nl> <nl> + MessageTests . cpp : 86 : <nl> PASSED : <nl> REQUIRE ( i < 10 ) <nl> with expansion : <nl> with expansion : <nl> with messages : <nl> current counter 1 <nl> i : = 1 <nl> - MessageTests . cpp : 86 : <nl> <nl> + MessageTests . cpp : 86 : <nl> PASSED : <nl> REQUIRE ( i < 10 ) <nl> with expansion : <nl> with expansion : <nl> with messages : <nl> current counter 2 <nl> i : = 2 <nl> - MessageTests . cpp : 86 : <nl> <nl> + MessageTests . cpp : 86 : <nl> PASSED : <nl> REQUIRE ( i < 10 ) <nl> with expansion : <nl> with expansion : <nl> with messages : <nl> current counter 3 <nl> i : = 3 <nl> - MessageTests . cpp : 86 : <nl> <nl> + MessageTests . cpp : 86 : <nl> PASSED : <nl> REQUIRE ( i < 10 ) <nl> with expansion : <nl> with expansion : <nl> with messages : <nl> current counter 4 <nl> i : = 4 <nl> - MessageTests . cpp : 86 : <nl> <nl> + MessageTests . cpp : 86 : <nl> PASSED : <nl> REQUIRE ( i < 10 ) <nl> with expansion : <nl> with expansion : <nl> with messages : <nl> current counter 5 <nl> i : = 5 <nl> - MessageTests . cpp : 86 : <nl> <nl> + MessageTests . cpp : 86 : <nl> PASSED : <nl> REQUIRE ( i < 10 ) <nl> with expansion : <nl> with expansion : <nl> with messages : <nl> current counter 6 <nl> i : = 6 <nl> - MessageTests . cpp : 86 : <nl> <nl> + MessageTests . cpp : 86 : <nl> PASSED : <nl> REQUIRE ( i < 10 ) <nl> with expansion : <nl> with expansion : <nl> with messages : <nl> current counter 7 <nl> i : = 7 <nl> - MessageTests . cpp : 86 : <nl> <nl> + MessageTests . cpp : 86 : <nl> PASSED : <nl> REQUIRE ( i < 10 ) <nl> with expansion : <nl> with expansion : <nl> with messages : <nl> current counter 8 <nl> i : = 8 <nl> - MessageTests . cpp : 86 : <nl> <nl> + MessageTests . cpp : 86 : <nl> PASSED : <nl> REQUIRE ( i < 10 ) <nl> with expansion : <nl> with expansion : <nl> with messages : <nl> current counter 9 <nl> i : = 9 <nl> - MessageTests . cpp : 86 : <nl> <nl> - FAILED : <nl> + MessageTests . cpp : 86 : FAILED : <nl> REQUIRE ( i < 10 ) <nl> with expansion : <nl> 10 < 10 <nl> with messages : <nl> current counter 10 <nl> i : = 10 <nl> - MessageTests . cpp : 86 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / nofail <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MessageTests . cpp : 92 : <nl> FAILED - but was ok : <nl> CHECK_NOFAIL ( 1 = = 2 ) <nl> - MessageTests . cpp : 92 : <nl> <nl> <nl> No assertions in test case , ' . / succeeding / nofail ' <nl> No assertions in test case , ' just info ' <nl> just failure <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MessageTests . cpp : 101 : FAILED : <nl> explicitly with message : <nl> Previous info should not be seen <nl> - MessageTests . cpp : 101 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Misc / Sections <nl> s1 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 25 : <nl> PASSED : <nl> REQUIRE ( a ! = b ) <nl> with expansion : <nl> 1 ! = 2 <nl> - MiscTests . cpp : 25 : <nl> <nl> + MiscTests . cpp : 26 : <nl> PASSED : <nl> REQUIRE ( b ! = a ) <nl> with expansion : <nl> 2 ! = 1 <nl> - MiscTests . cpp : 26 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Misc / Sections <nl> s2 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 31 : <nl> PASSED : <nl> REQUIRE ( a ! = b ) <nl> with expansion : <nl> 1 ! = 2 <nl> - MiscTests . cpp : 31 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Misc / Sections / nested <nl> s1 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 42 : <nl> PASSED : <nl> REQUIRE ( a ! = b ) <nl> with expansion : <nl> 1 ! = 2 <nl> - MiscTests . cpp : 42 : <nl> <nl> + MiscTests . cpp : 43 : <nl> PASSED : <nl> REQUIRE ( b ! = a ) <nl> with expansion : <nl> 2 ! = 1 <nl> - MiscTests . cpp : 43 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Misc / Sections / nested <nl> MiscTests . cpp : 43 : <nl> s2 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 47 : <nl> PASSED : <nl> REQUIRE ( a ! = b ) <nl> with expansion : <nl> 1 ! = 2 <nl> - MiscTests . cpp : 47 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / mixed / Misc / Sections / nested2 <nl> MiscTests . cpp : 47 : <nl> s2 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 61 : FAILED : <nl> REQUIRE ( a = = b ) <nl> with expansion : <nl> 1 = = 2 <nl> - MiscTests . cpp : 61 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / mixed / Misc / Sections / nested2 <nl> MiscTests . cpp : 61 : <nl> s3 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 66 : <nl> PASSED : <nl> REQUIRE ( a ! = b ) <nl> with expansion : <nl> 1 ! = 2 <nl> - MiscTests . cpp : 66 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / mixed / Misc / Sections / nested2 <nl> MiscTests . cpp : 66 : <nl> s4 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 70 : <nl> PASSED : <nl> REQUIRE ( a < b ) <nl> with expansion : <nl> 1 < 2 <nl> - MiscTests . cpp : 70 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / Sections / nested / a / b <nl> No assertions in section , ' f ( leaf ) ' <nl> s1 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 103 : FAILED : <nl> CHECK ( b > a ) <nl> with expansion : <nl> 0 > 1 <nl> - MiscTests . cpp : 103 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / mixed / Misc / loops <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 115 : FAILED : <nl> CHECK ( ( fib [ i ] % 2 ) = = 0 ) <nl> with expansion : <nl> 1 = = 0 <nl> with message : <nl> Testing if fib [ 0 ] ( 1 ) is even <nl> - MiscTests . cpp : 115 : <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 115 : FAILED : <nl> CHECK ( ( fib [ i ] % 2 ) = = 0 ) <nl> with expansion : <nl> 1 = = 0 <nl> with message : <nl> Testing if fib [ 1 ] ( 1 ) is even <nl> - MiscTests . cpp : 115 : <nl> <nl> + MiscTests . cpp : 115 : <nl> PASSED : <nl> CHECK ( ( fib [ i ] % 2 ) = = 0 ) <nl> with expansion : <nl> 0 = = 0 <nl> with message : <nl> Testing if fib [ 2 ] ( 2 ) is even <nl> - MiscTests . cpp : 115 : <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 115 : FAILED : <nl> CHECK ( ( fib [ i ] % 2 ) = = 0 ) <nl> with expansion : <nl> 1 = = 0 <nl> with message : <nl> Testing if fib [ 3 ] ( 3 ) is even <nl> - MiscTests . cpp : 115 : <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 115 : FAILED : <nl> CHECK ( ( fib [ i ] % 2 ) = = 0 ) <nl> with expansion : <nl> 1 = = 0 <nl> with message : <nl> Testing if fib [ 4 ] ( 5 ) is even <nl> - MiscTests . cpp : 115 : <nl> <nl> + MiscTests . cpp : 115 : <nl> PASSED : <nl> CHECK ( ( fib [ i ] % 2 ) = = 0 ) <nl> with expansion : <nl> 0 = = 0 <nl> with message : <nl> Testing if fib [ 5 ] ( 8 ) is even <nl> - MiscTests . cpp : 115 : <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 115 : FAILED : <nl> CHECK ( ( fib [ i ] % 2 ) = = 0 ) <nl> with expansion : <nl> 1 = = 0 <nl> with message : <nl> Testing if fib [ 6 ] ( 13 ) is even <nl> - MiscTests . cpp : 115 : <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 115 : FAILED : <nl> CHECK ( ( fib [ i ] % 2 ) = = 0 ) <nl> with expansion : <nl> 1 = = 0 <nl> with message : <nl> Testing if fib [ 7 ] ( 21 ) is even <nl> - MiscTests . cpp : 115 : <nl> <nl> Some information <nl> An error <nl> No assertions in test case , ' . / succeeding / Misc / stdout , stderr ' <nl> . / succeeding / Misc / null strings <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 133 : <nl> PASSED : <nl> REQUIRE ( makeString ( false ) ! = static_cast < char * > ( __null ) ) <nl> with expansion : <nl> " valid string " ! = { null string } <nl> - MiscTests . cpp : 133 : <nl> <nl> + MiscTests . cpp : 134 : <nl> PASSED : <nl> REQUIRE ( makeString ( true ) = = static_cast < char * > ( __null ) ) <nl> with expansion : <nl> { null string } = = { null string } <nl> - MiscTests . cpp : 134 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / info <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 142 : FAILED : <nl> REQUIRE ( false ) <nl> with messages : <nl> hi <nl> i : = 7 <nl> - MiscTests . cpp : 142 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / checkedif <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 147 : <nl> PASSED : <nl> CHECKED_IF ( flag ) <nl> with expansion : <nl> true <nl> - MiscTests . cpp : 147 : <nl> <nl> + MiscTests . cpp : 155 : <nl> PASSED : <nl> REQUIRE ( testCheckedIf ( true ) ) <nl> with expansion : <nl> true <nl> - MiscTests . cpp : 155 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / checkedif <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 147 : FAILED : <nl> CHECKED_IF ( flag ) <nl> with expansion : <nl> false <nl> - MiscTests . cpp : 147 : <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 160 : FAILED : <nl> REQUIRE ( testCheckedIf ( false ) ) <nl> with expansion : <nl> false <nl> - MiscTests . cpp : 160 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / checkedelse <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 165 : <nl> PASSED : <nl> CHECKED_ELSE ( flag ) <nl> with expansion : <nl> true <nl> - MiscTests . cpp : 165 : <nl> <nl> + MiscTests . cpp : 173 : <nl> PASSED : <nl> REQUIRE ( testCheckedElse ( true ) ) <nl> with expansion : <nl> true <nl> - MiscTests . cpp : 173 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / checkedelse <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 165 : FAILED : <nl> CHECKED_ELSE ( flag ) <nl> with expansion : <nl> false <nl> - MiscTests . cpp : 165 : <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 178 : FAILED : <nl> REQUIRE ( testCheckedElse ( false ) ) <nl> with expansion : <nl> false <nl> - MiscTests . cpp : 178 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / misc / xmlentitycheck <nl> No assertions in section , ' encoded chars ' <nl> . / manual / onechar <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 196 : FAILED : <nl> REQUIRE ( false ) <nl> with message : <nl> 3 <nl> - MiscTests . cpp : 196 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / atomic if <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 206 : <nl> PASSED : <nl> REQUIRE ( x = = 0 ) <nl> with expansion : <nl> 0 = = 0 <nl> - MiscTests . cpp : 206 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / matchers <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 216 : <nl> PASSED : <nl> REQUIRE_THAT ( testStringForMatching ( ) Contains ( " string " ) ) <nl> with expansion : <nl> " this string contains ' abc ' as a substring " contains : " string " <nl> - MiscTests . cpp : 216 : <nl> <nl> + MiscTests . cpp : 217 : <nl> PASSED : <nl> CHECK_THAT ( testStringForMatching ( ) Contains ( " abc " ) ) <nl> with expansion : <nl> " this string contains ' abc ' as a substring " contains : " abc " <nl> - MiscTests . cpp : 217 : <nl> <nl> + MiscTests . cpp : 219 : <nl> PASSED : <nl> CHECK_THAT ( testStringForMatching ( ) StartsWith ( " this " ) ) <nl> with expansion : <nl> " this string contains ' abc ' as a substring " starts with : " this " <nl> - MiscTests . cpp : 219 : <nl> <nl> + MiscTests . cpp : 220 : <nl> PASSED : <nl> CHECK_THAT ( testStringForMatching ( ) EndsWith ( " substring " ) ) <nl> with expansion : <nl> " this string contains ' abc ' as a substring " ends with : " substring " <nl> - MiscTests . cpp : 220 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / matchers / Contains <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 225 : FAILED : <nl> CHECK_THAT ( testStringForMatching ( ) Contains ( " not there " ) ) <nl> with expansion : <nl> " this string contains ' abc ' as a substring " contains : " not there " <nl> - MiscTests . cpp : 225 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / matchers / StartsWith <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 230 : FAILED : <nl> CHECK_THAT ( testStringForMatching ( ) StartsWith ( " string " ) ) <nl> with expansion : <nl> " this string contains ' abc ' as a substring " starts with : " string " <nl> - MiscTests . cpp : 230 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / matchers / EndsWith <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 235 : FAILED : <nl> CHECK_THAT ( testStringForMatching ( ) EndsWith ( " this " ) ) <nl> with expansion : <nl> " this string contains ' abc ' as a substring " ends with : " this " <nl> - MiscTests . cpp : 235 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / matchers / Equals <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + MiscTests . cpp : 240 : FAILED : <nl> CHECK_THAT ( testStringForMatching ( ) Equals ( " something else " ) ) <nl> with expansion : <nl> " this string contains ' abc ' as a substring " equals : " something else " <nl> - MiscTests . cpp : 240 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / matchers / AllOf <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 248 : <nl> PASSED : <nl> CHECK_THAT ( testStringForMatching ( ) AllOf ( Catch : : Contains ( " string " ) , Catch : : Contains ( " abc " ) ) ) <nl> with expansion : <nl> " this string contains ' abc ' as a substring " ( contains : " string " and <nl> contains : " abc " ) <nl> - MiscTests . cpp : 248 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / matchers / AnyOf <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 252 : <nl> PASSED : <nl> CHECK_THAT ( testStringForMatching ( ) AnyOf ( Catch : : Contains ( " string " ) , Catch : : Contains ( " not there " ) ) ) <nl> with expansion : <nl> " this string contains ' abc ' as a substring " ( contains : " string " or <nl> contains : " not there " ) <nl> - MiscTests . cpp : 252 : <nl> <nl> + MiscTests . cpp : 253 : <nl> PASSED : <nl> CHECK_THAT ( testStringForMatching ( ) AnyOf ( Catch : : Contains ( " not there " ) , Catch : : Contains ( " string " ) ) ) <nl> with expansion : <nl> " this string contains ' abc ' as a substring " ( contains : " not there " or <nl> contains : " string " ) <nl> - MiscTests . cpp : 253 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / matchers / Equals <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 258 : <nl> PASSED : <nl> CHECK_THAT ( testStringForMatching ( ) Equals ( " this string contains ' abc ' as a substring " ) ) <nl> with expansion : <nl> " this string contains ' abc ' as a substring " equals : " this string contains <nl> ' abc ' as a substring " <nl> - MiscTests . cpp : 258 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> example / factorial <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 269 : <nl> PASSED : <nl> REQUIRE ( Factorial ( 0 ) = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - MiscTests . cpp : 269 : <nl> <nl> + MiscTests . cpp : 270 : <nl> PASSED : <nl> REQUIRE ( Factorial ( 1 ) = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - MiscTests . cpp : 270 : <nl> <nl> + MiscTests . cpp : 271 : <nl> PASSED : <nl> REQUIRE ( Factorial ( 2 ) = = 2 ) <nl> with expansion : <nl> 2 = = 2 <nl> - MiscTests . cpp : 271 : <nl> <nl> + MiscTests . cpp : 272 : <nl> PASSED : <nl> REQUIRE ( Factorial ( 3 ) = = 6 ) <nl> with expansion : <nl> 6 = = 6 <nl> - MiscTests . cpp : 272 : <nl> <nl> + MiscTests . cpp : 273 : <nl> PASSED : <nl> REQUIRE ( Factorial ( 10 ) = = 3628800 ) <nl> with expansion : <nl> 0x < hex digits > = = 3628800 <nl> - MiscTests . cpp : 273 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> empty <nl> No assertions in test case , ' empty ' <nl> Nice descriptive name <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + MiscTests . cpp : 282 : <nl> warning : <nl> This one ran <nl> - MiscTests . cpp : 282 : <nl> <nl> <nl> No assertions in test case , ' Nice descriptive name ' <nl> selftest / main <nl> selftest / expected result / failing tests <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> + catch_self_test . hpp : 114 : <nl> PASSED : <nl> with message : <nl> Tests failed , as expected <nl> - catch_self_test . hpp : 114 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / main <nl> selftest / main <nl> selftest / expected result / succeeding tests <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> Message from section one <nl> Message from section two <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> Some information <nl> An error <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> + catch_self_test . hpp : 103 : <nl> PASSED : <nl> with message : <nl> Tests passed , as expected <nl> - catch_self_test . hpp : 103 : <nl> <nl> Message from section one <nl> Message from section two <nl> selftest / main <nl> selftest / test counts / succeeding tests <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 40 : <nl> PASSED : <nl> CHECK ( totals . assertions . passed = = 296 ) <nl> with expansion : <nl> 296 = = 296 <nl> - TestMain . cpp : 40 : <nl> <nl> + TestMain . cpp : 41 : <nl> PASSED : <nl> CHECK ( totals . assertions . failed = = 0 ) <nl> with expansion : <nl> 0 = = 0 <nl> - TestMain . cpp : 41 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / main <nl> selftest / main <nl> selftest / test counts / failing tests <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 47 : <nl> PASSED : <nl> CHECK ( totals . assertions . passed = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - TestMain . cpp : 47 : <nl> <nl> + TestMain . cpp : 48 : <nl> PASSED : <nl> CHECK ( totals . assertions . failed = = 73 ) <nl> with expansion : <nl> 73 = = 73 <nl> - TestMain . cpp : 48 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> meta / Misc / Sections <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 57 : <nl> PASSED : <nl> CHECK ( totals . assertions . passed = = 2 ) <nl> with expansion : <nl> 2 = = 2 <nl> - TestMain . cpp : 57 : <nl> <nl> + TestMain . cpp : 58 : <nl> PASSED : <nl> CHECK ( totals . assertions . failed = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - TestMain . cpp : 58 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> default <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 97 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 97 : <nl> <nl> + TestMain . cpp : 99 : <nl> PASSED : <nl> CHECK ( config . shouldDebugBreak = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 99 : <nl> <nl> + TestMain . cpp : 100 : <nl> PASSED : <nl> CHECK ( config . cutoff = = - 1 ) <nl> with expansion : <nl> - 1 = = - 1 <nl> - TestMain . cpp : 100 : <nl> <nl> + TestMain . cpp : 101 : <nl> PASSED : <nl> CHECK ( config . allowThrows = = true ) <nl> with expansion : <nl> true = = true <nl> - TestMain . cpp : 101 : <nl> <nl> + TestMain . cpp : 102 : <nl> PASSED : <nl> CHECK ( config . reporter . empty ( ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 102 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - t / 1 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 108 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 108 : <nl> <nl> + TestMain . cpp : 110 : <nl> PASSED : <nl> REQUIRE ( config . filters . size ( ) = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - TestMain . cpp : 110 : <nl> <nl> + TestMain . cpp : 111 : <nl> PASSED : <nl> REQUIRE ( config . filters [ 0 ] . shouldInclude ( fakeTestCase ( " notIncluded " ) ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 111 : <nl> <nl> + TestMain . cpp : 112 : <nl> PASSED : <nl> REQUIRE ( config . filters [ 0 ] . shouldInclude ( fakeTestCase ( " test1 " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 112 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - t / exclude : 1 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 116 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 116 : <nl> <nl> + TestMain . cpp : 118 : <nl> PASSED : <nl> REQUIRE ( config . filters . size ( ) = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - TestMain . cpp : 118 : <nl> <nl> + TestMain . cpp : 119 : <nl> PASSED : <nl> REQUIRE ( config . filters [ 0 ] . shouldInclude ( fakeTestCase ( " test1 " ) ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 119 : <nl> <nl> + TestMain . cpp : 120 : <nl> PASSED : <nl> REQUIRE ( config . filters [ 0 ] . shouldInclude ( fakeTestCase ( " alwaysIncluded " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 120 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - - test / 1 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 125 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 125 : <nl> <nl> + TestMain . cpp : 127 : <nl> PASSED : <nl> REQUIRE ( config . filters . size ( ) = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - TestMain . cpp : 127 : <nl> <nl> + TestMain . cpp : 128 : <nl> PASSED : <nl> REQUIRE ( config . filters [ 0 ] . shouldInclude ( fakeTestCase ( " notIncluded " ) ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 128 : <nl> <nl> + TestMain . cpp : 129 : <nl> PASSED : <nl> REQUIRE ( config . filters [ 0 ] . shouldInclude ( fakeTestCase ( " test1 " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 129 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - - test / exclude : 1 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 134 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 134 : <nl> <nl> + TestMain . cpp : 136 : <nl> PASSED : <nl> REQUIRE ( config . filters . size ( ) = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - TestMain . cpp : 136 : <nl> <nl> + TestMain . cpp : 137 : <nl> PASSED : <nl> REQUIRE ( config . filters [ 0 ] . shouldInclude ( fakeTestCase ( " test1 " ) ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 137 : <nl> <nl> + TestMain . cpp : 138 : <nl> PASSED : <nl> REQUIRE ( config . filters [ 0 ] . shouldInclude ( fakeTestCase ( " alwaysIncluded " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 138 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - - test / exclude : 2 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 143 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 143 : <nl> <nl> + TestMain . cpp : 145 : <nl> PASSED : <nl> REQUIRE ( config . filters . size ( ) = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - TestMain . cpp : 145 : <nl> <nl> + TestMain . cpp : 146 : <nl> PASSED : <nl> REQUIRE ( config . filters [ 0 ] . shouldInclude ( fakeTestCase ( " test1 " ) ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 146 : <nl> <nl> + TestMain . cpp : 147 : <nl> PASSED : <nl> REQUIRE ( config . filters [ 0 ] . shouldInclude ( fakeTestCase ( " alwaysIncluded " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 147 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - t / 2 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 152 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 152 : <nl> <nl> + TestMain . cpp : 154 : <nl> PASSED : <nl> REQUIRE ( config . filters . size ( ) = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - TestMain . cpp : 154 : <nl> <nl> + TestMain . cpp : 155 : <nl> PASSED : <nl> REQUIRE ( config . filters [ 0 ] . shouldInclude ( fakeTestCase ( " notIncluded " ) ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 155 : <nl> <nl> + TestMain . cpp : 156 : <nl> PASSED : <nl> REQUIRE ( config . filters [ 0 ] . shouldInclude ( fakeTestCase ( " test1 " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 156 : <nl> <nl> + TestMain . cpp : 157 : <nl> PASSED : <nl> REQUIRE ( config . filters [ 0 ] . shouldInclude ( fakeTestCase ( " test2 " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 157 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - t / 0 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 162 : <nl> PASSED : <nl> REQUIRE_THAT ( parseIntoConfigAndReturnError ( argv , config ) Contains ( " at least 1 " ) ) <nl> with expansion : <nl> " Error while parsing arguments . Expected at least 1 argument . " contains : " at <nl> least 1 " <nl> - TestMain . cpp : 162 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - r / console <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 169 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 169 : <nl> <nl> + TestMain . cpp : 171 : <nl> PASSED : <nl> REQUIRE ( config . reporter = = " console " ) <nl> with expansion : <nl> " console " = = " console " <nl> - TestMain . cpp : 171 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - r / xml <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 175 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 175 : <nl> <nl> + TestMain . cpp : 177 : <nl> PASSED : <nl> REQUIRE ( config . reporter = = " xml " ) <nl> with expansion : <nl> " xml " = = " xml " <nl> - TestMain . cpp : 177 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - - reporter / junit <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 181 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 181 : <nl> <nl> + TestMain . cpp : 183 : <nl> PASSED : <nl> REQUIRE ( config . reporter = = " junit " ) <nl> with expansion : <nl> " junit " = = " junit " <nl> - TestMain . cpp : 183 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - r / error <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 187 : <nl> PASSED : <nl> REQUIRE_THAT ( parseIntoConfigAndReturnError ( argv , config ) Contains ( " 1 argument " ) ) <nl> with expansion : <nl> " Error while parsing arguments . Expected 1 argument . Arguments were : one <nl> two " contains : " 1 argument " <nl> - TestMain . cpp : 187 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - b <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 194 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 194 : <nl> <nl> + TestMain . cpp : 196 : <nl> PASSED : <nl> REQUIRE ( config . shouldDebugBreak = = true ) <nl> with expansion : <nl> true = = true <nl> - TestMain . cpp : 196 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - - break <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 200 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 200 : <nl> <nl> + TestMain . cpp : 202 : <nl> PASSED : <nl> REQUIRE ( config . shouldDebugBreak ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 202 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - b <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 206 : <nl> PASSED : <nl> REQUIRE_THAT ( parseIntoConfigAndReturnError ( argv , config ) Contains ( " 0 arguments " ) ) <nl> with expansion : <nl> " Error while parsing arguments . Expected 0 arguments . Arguments were : <nl> unexpected " contains : " 0 arguments " <nl> - TestMain . cpp : 206 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - a <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 213 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 213 : <nl> <nl> + TestMain . cpp : 215 : <nl> PASSED : <nl> REQUIRE ( config . cutoff = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - TestMain . cpp : 215 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - a / 2 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 219 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 219 : <nl> <nl> + TestMain . cpp : 221 : <nl> PASSED : <nl> REQUIRE ( config . cutoff = = 2 ) <nl> with expansion : <nl> 2 = = 2 <nl> - TestMain . cpp : 221 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - a / error / 0 <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 225 : <nl> PASSED : <nl> REQUIRE_THAT ( parseIntoConfigAndReturnError ( argv , config ) Contains ( " greater than zero " ) ) <nl> with expansion : <nl> " Error while parsing arguments . threshold must be a number greater than <nl> zero . Arguments were : 0 " contains : " greater than zero " <nl> - TestMain . cpp : 225 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - a / error / non numeric <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 229 : <nl> PASSED : <nl> REQUIRE_THAT ( parseIntoConfigAndReturnError ( argv , config ) Contains ( " greater than zero " ) ) <nl> with expansion : <nl> " Error while parsing arguments . threshold must be a number greater than <nl> zero . Arguments were : oops " contains : " greater than zero " <nl> - TestMain . cpp : 229 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - a / error / two args <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 233 : <nl> PASSED : <nl> REQUIRE_THAT ( parseIntoConfigAndReturnError ( argv , config ) Contains ( " 0 and 1 argument " ) ) <nl> with expansion : <nl> " Error while parsing arguments . Expected between 0 and 1 argument . Arguments <nl> were : 1 2 " contains : " 0 and 1 argument " <nl> - TestMain . cpp : 233 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - nt <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 240 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 240 : <nl> <nl> + TestMain . cpp : 242 : <nl> PASSED : <nl> REQUIRE ( config . allowThrows = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 242 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - - nothrow <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 246 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 246 : <nl> <nl> + TestMain . cpp : 248 : <nl> PASSED : <nl> REQUIRE ( config . allowThrows = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 248 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - o filename <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 255 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 255 : <nl> <nl> + TestMain . cpp : 257 : <nl> PASSED : <nl> REQUIRE ( config . outputFilename = = " filename . ext " ) <nl> with expansion : <nl> " filename . ext " = = " filename . ext " <nl> - TestMain . cpp : 257 : <nl> <nl> + TestMain . cpp : 258 : <nl> PASSED : <nl> REQUIRE ( config . stream . empty ( ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 258 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - o % stdout <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 262 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 262 : <nl> <nl> + TestMain . cpp : 264 : <nl> PASSED : <nl> REQUIRE ( config . stream = = " stdout " ) <nl> with expansion : <nl> " stdout " = = " stdout " <nl> - TestMain . cpp : 264 : <nl> <nl> + TestMain . cpp : 265 : <nl> PASSED : <nl> REQUIRE ( config . outputFilename . empty ( ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 265 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - - out <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 269 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 269 : <nl> <nl> + TestMain . cpp : 271 : <nl> PASSED : <nl> REQUIRE ( config . outputFilename = = " filename . ext " ) <nl> with expansion : <nl> " filename . ext " = = " filename . ext " <nl> - TestMain . cpp : 271 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / parser / 2 <nl> selftest / parser / 2 <nl> - a - b <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 278 : <nl> PASSED : <nl> CHECK_NOTHROW ( parseIntoConfig ( argv , config ) ) <nl> - TestMain . cpp : 278 : <nl> <nl> + TestMain . cpp : 280 : <nl> PASSED : <nl> CHECK ( config . cutoff = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - TestMain . cpp : 280 : <nl> <nl> + TestMain . cpp : 281 : <nl> PASSED : <nl> CHECK ( config . shouldDebugBreak ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 281 : <nl> <nl> + TestMain . cpp : 282 : <nl> PASSED : <nl> CHECK ( config . allowThrows = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 282 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / test filter <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 291 : <nl> PASSED : <nl> CHECK ( matchAny . shouldInclude ( fakeTestCase ( " any " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 291 : <nl> <nl> + TestMain . cpp : 292 : <nl> PASSED : <nl> CHECK ( matchNone . shouldInclude ( fakeTestCase ( " any " ) ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 292 : <nl> <nl> + TestMain . cpp : 297 : <nl> PASSED : <nl> CHECK ( matchHidden . shouldInclude ( fakeTestCase ( " any " ) ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 297 : <nl> <nl> + TestMain . cpp : 298 : <nl> PASSED : <nl> CHECK ( matchNonHidden . shouldInclude ( fakeTestCase ( " any " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 298 : <nl> <nl> + TestMain . cpp : 300 : <nl> PASSED : <nl> CHECK ( matchHidden . shouldInclude ( fakeTestCase ( " . / any " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 300 : <nl> <nl> + TestMain . cpp : 301 : <nl> PASSED : <nl> CHECK ( matchNonHidden . shouldInclude ( fakeTestCase ( " . / any " ) ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 301 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / test filters <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 312 : <nl> PASSED : <nl> CHECK ( matchHidden . shouldInclude ( fakeTestCase ( " . / something " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 312 : <nl> <nl> + TestMain . cpp : 314 : <nl> PASSED : <nl> CHECK ( filters . shouldInclude ( fakeTestCase ( " any " ) ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 314 : <nl> <nl> + TestMain . cpp : 315 : <nl> PASSED : <nl> CHECK ( filters . shouldInclude ( fakeTestCase ( " . / something " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 315 : <nl> <nl> + TestMain . cpp : 316 : <nl> PASSED : <nl> CHECK ( filters . shouldInclude ( fakeTestCase ( " . / anything " ) ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 316 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / filter / prefix wildcard <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 322 : <nl> PASSED : <nl> CHECK ( matchBadgers . shouldInclude ( fakeTestCase ( " big badger " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 322 : <nl> <nl> + TestMain . cpp : 323 : <nl> PASSED : <nl> CHECK ( matchBadgers . shouldInclude ( fakeTestCase ( " little badgers " ) ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 323 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / filter / wildcard at both ends <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 328 : <nl> PASSED : <nl> CHECK ( matchBadgers . shouldInclude ( fakeTestCase ( " big badger " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 328 : <nl> <nl> + TestMain . cpp : 329 : <nl> PASSED : <nl> CHECK ( matchBadgers . shouldInclude ( fakeTestCase ( " little badgers " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 329 : <nl> <nl> + TestMain . cpp : 330 : <nl> PASSED : <nl> CHECK ( matchBadgers . shouldInclude ( fakeTestCase ( " badgers are big " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 330 : <nl> <nl> + TestMain . cpp : 331 : <nl> PASSED : <nl> CHECK ( matchBadgers . shouldInclude ( fakeTestCase ( " hedgehogs " ) ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 331 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / option parsers <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 351 : <nl> PASSED : <nl> CHECK_NOTHROW ( opt . parseIntoConfig ( parser , config ) ) <nl> - TestMain . cpp : 351 : <nl> <nl> + TestMain . cpp : 353 : <nl> PASSED : <nl> REQUIRE ( config . filters . size ( ) = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - TestMain . cpp : 353 : <nl> <nl> + TestMain . cpp : 354 : <nl> PASSED : <nl> REQUIRE ( config . filters [ 0 ] . shouldInclude ( fakeTestCase ( " notIncluded " ) ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 354 : <nl> <nl> + TestMain . cpp : 355 : <nl> PASSED : <nl> REQUIRE ( config . filters [ 0 ] . shouldInclude ( fakeTestCase ( " test1 " ) ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 355 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / tags <nl> one tag <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 369 : <nl> PASSED : <nl> CHECK ( oneTag . getTestCaseInfo ( ) . description = = " " ) <nl> with expansion : <nl> " " = = " " <nl> - TestMain . cpp : 369 : <nl> <nl> + TestMain . cpp : 370 : <nl> PASSED : <nl> CHECK ( oneTag . hasTag ( " one " ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 370 : <nl> <nl> + TestMain . cpp : 371 : <nl> PASSED : <nl> CHECK ( oneTag . getTags ( ) . size ( ) = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - TestMain . cpp : 371 : <nl> <nl> + TestMain . cpp : 373 : <nl> PASSED : <nl> CHECK ( oneTag . matchesTags ( p1 ) = = true ) <nl> with expansion : <nl> true = = true <nl> - TestMain . cpp : 373 : <nl> <nl> + TestMain . cpp : 374 : <nl> PASSED : <nl> CHECK ( oneTag . matchesTags ( p2 ) = = true ) <nl> with expansion : <nl> true = = true <nl> - TestMain . cpp : 374 : <nl> <nl> + TestMain . cpp : 375 : <nl> PASSED : <nl> CHECK ( oneTag . matchesTags ( p3 ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 375 : <nl> <nl> + TestMain . cpp : 376 : <nl> PASSED : <nl> CHECK ( oneTag . matchesTags ( p4 ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 376 : <nl> <nl> + TestMain . cpp : 377 : <nl> PASSED : <nl> CHECK ( oneTag . matchesTags ( p5 ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 377 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / tags <nl> two tags <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 383 : <nl> PASSED : <nl> CHECK ( twoTags . getTestCaseInfo ( ) . description = = " " ) <nl> with expansion : <nl> " " = = " " <nl> - TestMain . cpp : 383 : <nl> <nl> + TestMain . cpp : 384 : <nl> PASSED : <nl> CHECK ( twoTags . hasTag ( " one " ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 384 : <nl> <nl> + TestMain . cpp : 385 : <nl> PASSED : <nl> CHECK ( twoTags . hasTag ( " two " ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 385 : <nl> <nl> + TestMain . cpp : 386 : <nl> PASSED : <nl> CHECK ( twoTags . hasTag ( " three " ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 386 : <nl> <nl> + TestMain . cpp : 387 : <nl> PASSED : <nl> CHECK ( twoTags . getTags ( ) . size ( ) = = 2 ) <nl> with expansion : <nl> 2 = = 2 <nl> - TestMain . cpp : 387 : <nl> <nl> + TestMain . cpp : 389 : <nl> PASSED : <nl> CHECK ( twoTags . matchesTags ( p1 ) = = true ) <nl> with expansion : <nl> true = = true <nl> - TestMain . cpp : 389 : <nl> <nl> + TestMain . cpp : 390 : <nl> PASSED : <nl> CHECK ( twoTags . matchesTags ( p2 ) = = true ) <nl> with expansion : <nl> true = = true <nl> - TestMain . cpp : 390 : <nl> <nl> + TestMain . cpp : 391 : <nl> PASSED : <nl> CHECK ( twoTags . matchesTags ( p3 ) = = true ) <nl> with expansion : <nl> true = = true <nl> - TestMain . cpp : 391 : <nl> <nl> + TestMain . cpp : 392 : <nl> PASSED : <nl> CHECK ( twoTags . matchesTags ( p4 ) = = true ) <nl> with expansion : <nl> true = = true <nl> - TestMain . cpp : 392 : <nl> <nl> + TestMain . cpp : 393 : <nl> PASSED : <nl> CHECK ( twoTags . matchesTags ( p5 ) = = true ) <nl> with expansion : <nl> true = = true <nl> - TestMain . cpp : 393 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / tags <nl> one tag with characters either side <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 399 : <nl> PASSED : <nl> CHECK ( oneTagWithExtras . getTestCaseInfo ( ) . description = = " 1234 " ) <nl> with expansion : <nl> " 1234 " = = " 1234 " <nl> - TestMain . cpp : 399 : <nl> <nl> + TestMain . cpp : 400 : <nl> PASSED : <nl> CHECK ( oneTagWithExtras . hasTag ( " one " ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 400 : <nl> <nl> + TestMain . cpp : 401 : <nl> PASSED : <nl> CHECK ( oneTagWithExtras . hasTag ( " two " ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 401 : <nl> <nl> + TestMain . cpp : 402 : <nl> PASSED : <nl> CHECK ( oneTagWithExtras . getTags ( ) . size ( ) = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - TestMain . cpp : 402 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / tags <nl> start of a tag , but not closed <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 409 : <nl> PASSED : <nl> CHECK ( oneTagOpen . getTestCaseInfo ( ) . description = = " [ one " ) <nl> with expansion : <nl> " [ one " = = " [ one " <nl> - TestMain . cpp : 409 : <nl> <nl> + TestMain . cpp : 410 : <nl> PASSED : <nl> CHECK ( oneTagOpen . hasTag ( " one " ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 410 : <nl> <nl> + TestMain . cpp : 411 : <nl> PASSED : <nl> CHECK ( oneTagOpen . getTags ( ) . size ( ) = = 0 ) <nl> with expansion : <nl> 0 = = 0 <nl> - TestMain . cpp : 411 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> selftest / tags <nl> hidden <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TestMain . cpp : 417 : <nl> PASSED : <nl> CHECK ( oneTag . getTestCaseInfo ( ) . description = = " " ) <nl> with expansion : <nl> " " = = " " <nl> - TestMain . cpp : 417 : <nl> <nl> + TestMain . cpp : 418 : <nl> PASSED : <nl> CHECK ( oneTag . hasTag ( " hide " ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 418 : <nl> <nl> + TestMain . cpp : 419 : <nl> PASSED : <nl> CHECK ( oneTag . isHidden ( ) ) <nl> with expansion : <nl> true <nl> - TestMain . cpp : 419 : <nl> <nl> + TestMain . cpp : 421 : <nl> PASSED : <nl> CHECK ( oneTag . matchesTags ( " ~ [ hide ] " ) = = false ) <nl> with expansion : <nl> false = = false <nl> - TestMain . cpp : 421 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Tricky / std : : pair <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TrickyTests . cpp : 37 : <nl> PASSED : <nl> REQUIRE ( ( std : : pair < int , int > ( 1 , 2 ) ) = = aNicePair ) <nl> with expansion : <nl> - <nl> - std : : pair ( 1 , 2 ) <nl> - = = <nl> - std : : pair ( 1 , 2 ) <nl> - TrickyTests . cpp : 37 : <nl> + std : : pair ( 1 , 2 ) = = std : : pair ( 1 , 2 ) <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / inprogress / failing / Tricky / trailing expression <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TrickyTests . cpp : 55 : <nl> warning : <nl> Uncomment the code in this test to check that it gives a sensible compiler <nl> error <nl> - TrickyTests . cpp : 55 : <nl> <nl> <nl> No assertions in test case , ' . / inprogress / failing / Tricky / trailing expression ' <nl> No assertions in test case , ' . / inprogress / failing / Tricky / trailing expression ' <nl> . / inprogress / failing / Tricky / compound lhs <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TrickyTests . cpp : 71 : <nl> warning : <nl> Uncomment the code in this test to check that it gives a sensible compiler <nl> error <nl> - TrickyTests . cpp : 71 : <nl> <nl> <nl> No assertions in test case , ' . / inprogress / failing / Tricky / compound lhs ' <nl> No assertions in test case , ' . / inprogress / failing / Tricky / compound lhs ' <nl> . / failing / Tricky / non streamable type <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + TrickyTests . cpp : 95 : FAILED : <nl> CHECK ( & o1 = = & o2 ) <nl> with expansion : <nl> 0x < hex digits > = = 0x < hex digits > <nl> - TrickyTests . cpp : 95 : <nl> <nl> - FAILED : <nl> + TrickyTests . cpp : 96 : FAILED : <nl> CHECK ( o1 = = o2 ) <nl> with expansion : <nl> { ? } = = { ? } <nl> - TrickyTests . cpp : 96 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / string literals <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + TrickyTests . cpp : 106 : FAILED : <nl> REQUIRE ( std : : string ( " first " ) = = " second " ) <nl> with expansion : <nl> " first " = = " second " <nl> - TrickyTests . cpp : 106 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / side - effects <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TrickyTests . cpp : 119 : <nl> PASSED : <nl> REQUIRE ( i + + = = 7 ) <nl> with expansion : <nl> 7 = = 7 <nl> - TrickyTests . cpp : 119 : <nl> <nl> + TrickyTests . cpp : 120 : <nl> PASSED : <nl> REQUIRE ( i + + = = 8 ) <nl> with expansion : <nl> 8 = = 8 <nl> - TrickyTests . cpp : 120 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / koenig <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TrickyTests . cpp : 186 : <nl> PASSED : <nl> REQUIRE ( 0x < hex digits > = = o ) <nl> with expansion : <nl> 0x < hex digits > = = { ? } <nl> - TrickyTests . cpp : 186 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / non - const = = <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TrickyTests . cpp : 212 : <nl> PASSED : <nl> REQUIRE ( t = = 1u ) <nl> with expansion : <nl> { ? } = = 1 <nl> - TrickyTests . cpp : 212 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / enum / bits <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TrickyTests . cpp : 224 : <nl> PASSED : <nl> REQUIRE ( 0x < hex digits > = = bit30and31 ) <nl> with expansion : <nl> 0x < hex digits > = = 3221225472 <nl> - TrickyTests . cpp : 224 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / boolean member <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TrickyTests . cpp : 239 : <nl> PASSED : <nl> REQUIRE ( obj . prop ! = __null ) <nl> with expansion : <nl> 0x < hex digits > ! = 0 <nl> - TrickyTests . cpp : 239 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / unimplemented static bool <nl> compare to true <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TrickyTests . cpp : 259 : <nl> PASSED : <nl> REQUIRE ( is_true < true > : : value = = true ) <nl> with expansion : <nl> true = = true <nl> - TrickyTests . cpp : 259 : <nl> <nl> + TrickyTests . cpp : 260 : <nl> PASSED : <nl> REQUIRE ( true = = is_true < true > : : value ) <nl> with expansion : <nl> true = = true <nl> - TrickyTests . cpp : 260 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / unimplemented static bool <nl> compare to false <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TrickyTests . cpp : 264 : <nl> PASSED : <nl> REQUIRE ( is_true < false > : : value = = false ) <nl> with expansion : <nl> false = = false <nl> - TrickyTests . cpp : 264 : <nl> <nl> + TrickyTests . cpp : 265 : <nl> PASSED : <nl> REQUIRE ( false = = is_true < false > : : value ) <nl> with expansion : <nl> false = = false <nl> - TrickyTests . cpp : 265 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / unimplemented static bool <nl> negation <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TrickyTests . cpp : 270 : <nl> PASSED : <nl> REQUIRE ( ! is_true < false > : : value ) <nl> with expansion : <nl> true <nl> - TrickyTests . cpp : 270 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / unimplemented static bool <nl> double negation <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TrickyTests . cpp : 275 : <nl> PASSED : <nl> REQUIRE ( ! ! is_true < true > : : value ) <nl> with expansion : <nl> true <nl> - TrickyTests . cpp : 275 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / unimplemented static bool <nl> direct <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TrickyTests . cpp : 280 : <nl> PASSED : <nl> REQUIRE ( is_true < true > : : value ) <nl> with expansion : <nl> true <nl> - TrickyTests . cpp : 280 : <nl> <nl> + TrickyTests . cpp : 281 : <nl> PASSED : <nl> REQUIRE_FALSE ( ! is_true < false > : : value ) <nl> with expansion : <nl> ! false <nl> - TrickyTests . cpp : 281 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / SafeBool <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + TrickyTests . cpp : 313 : <nl> PASSED : <nl> CHECK ( True ) <nl> with expansion : <nl> true <nl> - TrickyTests . cpp : 313 : <nl> <nl> + TrickyTests . cpp : 314 : <nl> PASSED : <nl> CHECK ( ! False ) <nl> with expansion : <nl> true <nl> - TrickyTests . cpp : 314 : <nl> <nl> + TrickyTests . cpp : 315 : <nl> PASSED : <nl> CHECK_FALSE ( ! False ) <nl> with expansion : <nl> ! false <nl> - TrickyTests . cpp : 315 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> Scenario : Do that thing with the thing <nl> - Given : This stuff exists <nl> - When : I do this <nl> - Then : it should do this <nl> + Given : This stuff exists <nl> + When : I do this <nl> + Then : it should do this <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + BDDTests . cpp : 33 : <nl> PASSED : <nl> REQUIRE ( itDoesThis ( ) ) <nl> with expansion : <nl> true <nl> - BDDTests . cpp : 29 : <nl> + <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + Scenario : Do that thing with the thing <nl> + Given : This stuff exists <nl> + When : I do this <nl> + Then : it should do this <nl> + And : do that <nl> + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> + <nl> + BDDTests . cpp : 35 : <nl> + PASSED : <nl> + REQUIRE ( itDoesThat ( ) ) <nl> + with expansion : <nl> + true <nl> <nl> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - 99 test cases - 47 failed ( 616 assertions - 104 failed ) <nl> + 100 test cases - 47 failed ( 619 assertions - 104 failed ) <nl> <nl> <nl> - CatchSelfTest is a CATCH v0 . 9 b19 ( integration ) host application . <nl> + CatchSelfTest is a CATCH v0 . 9 b21 ( integration ) host application . <nl> Run with - ? for options <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Approx / simple <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ApproxTests . cpp : 20 : <nl> PASSED : <nl> REQUIRE ( d = = Approx ( 1 . 23 ) ) <nl> with expansion : <nl> 1 . 23 = = Approx ( 1 . 23 ) <nl> - ApproxTests . cpp : 20 : <nl> <nl> + ApproxTests . cpp : 21 : <nl> PASSED : <nl> REQUIRE ( d ! = Approx ( 1 . 22 ) ) <nl> with expansion : <nl> 1 . 23 ! = Approx ( 1 . 22 ) <nl> - ApproxTests . cpp : 21 : <nl> <nl> + ApproxTests . cpp : 22 : <nl> PASSED : <nl> REQUIRE ( d ! = Approx ( 1 . 24 ) ) <nl> with expansion : <nl> 1 . 23 ! = Approx ( 1 . 24 ) <nl> - ApproxTests . cpp : 22 : <nl> <nl> + ApproxTests . cpp : 24 : <nl> PASSED : <nl> REQUIRE ( Approx ( d ) = = 1 . 23 ) <nl> with expansion : <nl> Approx ( 1 . 23 ) = = 1 . 23 <nl> - ApproxTests . cpp : 24 : <nl> <nl> + ApproxTests . cpp : 25 : <nl> PASSED : <nl> REQUIRE ( Approx ( d ) ! = 1 . 22 ) <nl> with expansion : <nl> Approx ( 1 . 23 ) ! = 1 . 22 <nl> - ApproxTests . cpp : 25 : <nl> <nl> + ApproxTests . cpp : 26 : <nl> PASSED : <nl> REQUIRE ( Approx ( d ) ! = 1 . 24 ) <nl> with expansion : <nl> Approx ( 1 . 23 ) ! = 1 . 24 <nl> - ApproxTests . cpp : 26 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Approx / epsilon <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ApproxTests . cpp : 38 : <nl> PASSED : <nl> REQUIRE ( d ! = Approx ( 1 . 231 ) ) <nl> with expansion : <nl> 1 . 23 ! = Approx ( 1 . 231 ) <nl> - ApproxTests . cpp : 38 : <nl> <nl> + ApproxTests . cpp : 39 : <nl> PASSED : <nl> REQUIRE ( d = = Approx ( 1 . 231 ) . epsilon ( 0 . 1 ) ) <nl> with expansion : <nl> 1 . 23 = = Approx ( 1 . 231 ) <nl> - ApproxTests . cpp : 39 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Approx / float <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ApproxTests . cpp : 49 : <nl> PASSED : <nl> REQUIRE ( 1 . 23f = = Approx ( 1 . 23f ) ) <nl> with expansion : <nl> 1 . 23 = = Approx ( 1 . 23 ) <nl> - ApproxTests . cpp : 49 : <nl> <nl> + ApproxTests . cpp : 50 : <nl> PASSED : <nl> REQUIRE ( 0 . 0f = = Approx ( 0 . 0f ) ) <nl> with expansion : <nl> 0 = = Approx ( 0 ) <nl> - ApproxTests . cpp : 50 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Approx / int <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ApproxTests . cpp : 60 : <nl> PASSED : <nl> REQUIRE ( 1 = = Approx ( 1 ) ) <nl> - ApproxTests . cpp : 60 : <nl> <nl> + ApproxTests . cpp : 61 : <nl> PASSED : <nl> REQUIRE ( 0 = = Approx ( 0 ) ) <nl> - ApproxTests . cpp : 61 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Approx / mixed <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ApproxTests . cpp : 75 : <nl> PASSED : <nl> REQUIRE ( 1 . 0f = = Approx ( 1 ) ) <nl> with expansion : <nl> 1 = = Approx ( 1 ) <nl> - ApproxTests . cpp : 75 : <nl> <nl> + ApproxTests . cpp : 76 : <nl> PASSED : <nl> REQUIRE ( 0 = = Approx ( dZero ) ) <nl> with expansion : <nl> 0 = = Approx ( 0 ) <nl> - ApproxTests . cpp : 76 : <nl> <nl> + ApproxTests . cpp : 77 : <nl> PASSED : <nl> REQUIRE ( 0 = = Approx ( dSmall ) . epsilon ( 0 . 001 ) ) <nl> with expansion : <nl> 0 = = Approx ( 1e - 05 ) <nl> - ApproxTests . cpp : 77 : <nl> <nl> + ApproxTests . cpp : 78 : <nl> PASSED : <nl> REQUIRE ( 1 . 234f = = Approx ( dMedium ) ) <nl> with expansion : <nl> 1 . 234 = = Approx ( 1 . 234 ) <nl> - ApproxTests . cpp : 78 : <nl> <nl> + ApproxTests . cpp : 79 : <nl> PASSED : <nl> REQUIRE ( dMedium = = Approx ( 1 . 234f ) ) <nl> with expansion : <nl> 1 . 234 = = Approx ( 1 . 234 ) <nl> - ApproxTests . cpp : 79 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Approx / custom <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ApproxTests . cpp : 93 : <nl> PASSED : <nl> REQUIRE ( d = = approx ( 1 . 23 ) ) <nl> with expansion : <nl> 1 . 23 = = Approx ( 1 . 23 ) <nl> - ApproxTests . cpp : 93 : <nl> <nl> + ApproxTests . cpp : 94 : <nl> PASSED : <nl> REQUIRE ( d = = approx ( 1 . 22 ) ) <nl> with expansion : <nl> 1 . 23 = = Approx ( 1 . 22 ) <nl> - ApproxTests . cpp : 94 : <nl> <nl> + ApproxTests . cpp : 95 : <nl> PASSED : <nl> REQUIRE ( d = = approx ( 1 . 24 ) ) <nl> with expansion : <nl> 1 . 23 = = Approx ( 1 . 24 ) <nl> - ApproxTests . cpp : 95 : <nl> <nl> + ApproxTests . cpp : 96 : <nl> PASSED : <nl> REQUIRE ( d ! = approx ( 1 . 25 ) ) <nl> with expansion : <nl> 1 . 23 ! = Approx ( 1 . 25 ) <nl> - ApproxTests . cpp : 96 : <nl> <nl> + ApproxTests . cpp : 98 : <nl> PASSED : <nl> REQUIRE ( approx ( d ) = = 1 . 23 ) <nl> with expansion : <nl> Approx ( 1 . 23 ) = = 1 . 23 <nl> - ApproxTests . cpp : 98 : <nl> <nl> + ApproxTests . cpp : 99 : <nl> PASSED : <nl> REQUIRE ( approx ( d ) = = 1 . 22 ) <nl> with expansion : <nl> Approx ( 1 . 23 ) = = 1 . 22 <nl> - ApproxTests . cpp : 99 : <nl> <nl> + ApproxTests . cpp : 100 : <nl> PASSED : <nl> REQUIRE ( approx ( d ) = = 1 . 24 ) <nl> with expansion : <nl> Approx ( 1 . 23 ) = = 1 . 24 <nl> - ApproxTests . cpp : 100 : <nl> <nl> + ApproxTests . cpp : 101 : <nl> PASSED : <nl> REQUIRE ( approx ( d ) ! = 1 . 25 ) <nl> with expansion : <nl> Approx ( 1 . 23 ) ! = 1 . 25 <nl> - ApproxTests . cpp : 101 : <nl> + <nl> + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + Approximate PI <nl> + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> + <nl> + ApproxTests . cpp : 110 : <nl> + PASSED : <nl> + REQUIRE ( divide ( 22 , 7 ) = = Approx ( 3 . 141 ) . epsilon ( 0 . 001 ) ) <nl> + with expansion : <nl> + 3 . 142857142857143 = = Approx ( 3 . 141 ) <nl> + <nl> + ApproxTests . cpp : 111 : <nl> + PASSED : <nl> + REQUIRE ( divide ( 22 , 7 ) ! = Approx ( 3 . 141 ) . epsilon ( 0 . 0001 ) ) <nl> + with expansion : <nl> + 3 . 142857142857143 ! = Approx ( 3 . 141 ) <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / TestClass / succeedingCase <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ClassTests . cpp : 24 : <nl> PASSED : <nl> REQUIRE ( s = = " hello " ) <nl> with expansion : <nl> " hello " = = " hello " <nl> - ClassTests . cpp : 24 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / TestClass / failingCase <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ClassTests . cpp : 28 : FAILED : <nl> REQUIRE ( s = = " world " ) <nl> with expansion : <nl> " hello " = = " world " <nl> - ClassTests . cpp : 28 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / Fixture / succeedingCase <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ClassTests . cpp : 47 : <nl> PASSED : <nl> REQUIRE ( m_a = = 1 ) <nl> with expansion : <nl> 1 = = 1 <nl> - ClassTests . cpp : 47 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / Fixture / failingCase <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ClassTests . cpp : 55 : FAILED : <nl> REQUIRE ( m_a = = 2 ) <nl> with expansion : <nl> 1 = = 2 <nl> - ClassTests . cpp : 55 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / succeeding / conditions / equality <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> + ConditionTests . cpp : 55 : <nl> PASSED : <nl> REQUIRE ( data . int_seven = = 7 ) <nl> with expansion : <nl> 7 = = 7 <nl> - ConditionTests . cpp : 55 : <nl> <nl> + ConditionTests . cpp : 56 : <nl> PASSED : <nl> REQUIRE ( data . float_nine_point_one = = Approx ( 9 . 1f ) ) <nl> with expansion : <nl> 9 . 1 = = Approx ( 9 . 1 ) <nl> - ConditionTests . cpp : 56 : <nl> <nl> + ConditionTests . cpp : 57 : <nl> PASSED : <nl> REQUIRE ( data . double_pi = = Approx ( 3 . 1415926535 ) ) <nl> with expansion : <nl> - 3 . 14159 = = Approx ( 3 . 14159 ) <nl> - ConditionTests . cpp : 57 : <nl> + 3 . 1415926535 = = Approx ( 3 . 14159 ) <nl> <nl> + ConditionTests . cpp : 58 : <nl> PASSED : <nl> REQUIRE ( data . str_hello = = " hello " ) <nl> with expansion : <nl> " hello " = = " hello " <nl> - ConditionTests . cpp : 58 : <nl> <nl> + ConditionTests . cpp : 59 : <nl> PASSED : <nl> REQUIRE ( " hello " = = data . str_hello ) <nl> with expansion : <nl> " hello " = = " hello " <nl> - ConditionTests . cpp : 59 : <nl> <nl> + ConditionTests . cpp : 60 : <nl> PASSED : <nl> REQUIRE ( data . str_hello . size ( ) = = 5 ) <nl> with expansion : <nl> 5 = = 5 <nl> - ConditionTests . cpp : 60 : <nl> <nl> + ConditionTests . cpp : 63 : <nl> PASSED : <nl> REQUIRE ( x = = Approx ( 1 . 3 ) ) <nl> with expansion : <nl> 1 . 3 = = Approx ( 1 . 3 ) <nl> - ConditionTests . cpp : 63 : <nl> <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> . / failing / conditions / equality <nl> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 71 : FAILED : <nl> CHECK ( data . int_seven = = 6 ) <nl> with expansion : <nl> 7 = = 6 <nl> - ConditionTests . cpp : 71 : <nl> <nl> - FAILED : <nl> + ConditionTests . cpp : 72 : FAILED : <nl> CHECK ( data . int_seven = = 8 ) <nl> with expansion : <nl> 7 = = 8 <nl> - ConditionTests . cpp : 72 : <nl> <nl> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - 12 test cases - 3 failed ( 38 assertions - 4 failed ) <nl> + 13 test cases - 3 failed ( 40 assertions - 4 failed ) <nl> <nl> < testsuites > <nl> - < testsuite name = " ~ dummy " errors = " 9 " failures = " 77 " tests = " 616 " hostname = " tbd " time = " tbd " timestamp = " tbd " > <nl> + < testsuite name = " ~ dummy " errors = " 9 " failures = " 77 " tests = " 619 " hostname = " tbd " time = " tbd " timestamp = " tbd " > <nl> < testcase classname = " global " name = " . / succeeding / Approx / simple " time = " tbd " / > <nl> < testcase classname = " global " name = " . / succeeding / Approx / epsilon " time = " tbd " / > <nl> < testcase classname = " global " name = " . / succeeding / Approx / float " time = " tbd " / > <nl> < testcase classname = " global " name = " . / succeeding / Approx / int " time = " tbd " / > <nl> < testcase classname = " global " name = " . / succeeding / Approx / mixed " time = " tbd " / > <nl> < testcase classname = " global " name = " . / succeeding / Approx / custom " time = " tbd " / > <nl> + < testcase classname = " global " name = " Approximate PI " time = " tbd " / > <nl> < testcase classname = " TestClass " name = " . / succeeding / TestClass / succeedingCase " time = " tbd " / > <nl> < testcase classname = " TestClass " name = " . / failing / TestClass / failingCase " time = " tbd " > <nl> < failure message = " & quot ; hello & quot ; = = & quot ; world & quot ; " type = " REQUIRE " > <nl> ConditionTests . cpp : 76 <nl> < failure message = " 9 . 1 = = Approx ( 0 ) " type = " CHECK " > <nl> ConditionTests . cpp : 77 <nl> < / failure > <nl> - < failure message = " 3 . 14159 = = Approx ( 3 . 1415 ) " type = " CHECK " > <nl> + < failure message = " 3 . 1415926535 = = Approx ( 3 . 1415 ) " type = " CHECK " > <nl> ConditionTests . cpp : 78 <nl> < / failure > <nl> < failure message = " & quot ; hello & quot ; = = & quot ; goodbye & quot ; " type = " CHECK " > <nl> ConditionTests . cpp : 111 <nl> < failure message = " 9 . 1 ! = Approx ( 9 . 1 ) " type = " CHECK " > <nl> ConditionTests . cpp : 112 <nl> < / failure > <nl> - < failure message = " 3 . 14159 ! = Approx ( 3 . 14159 ) " type = " CHECK " > <nl> + < failure message = " 3 . 1415926535 ! = Approx ( 3 . 14159 ) " type = " CHECK " > <nl> ConditionTests . cpp : 113 <nl> < / failure > <nl> < failure message = " & quot ; hello & quot ; ! = & quot ; hello & quot ; " type = " CHECK " > <nl> ConditionTests . cpp : 162 <nl> < failure message = " 9 . 1 > 10 " type = " CHECK " > <nl> ConditionTests . cpp : 163 <nl> < / failure > <nl> - < failure message = " 9 . 1 > 9 . 2 " type = " CHECK " > <nl> + < failure message = " 9 . 1 > 9 . 199999999999999 " type = " CHECK " > <nl> ConditionTests . cpp : 164 <nl> < / failure > <nl> < failure message = " & quot ; hello & quot ; > & quot ; hello & quot ; " type = " CHECK " > <nl> ApproxTests . cpp " line = " 101 " > <nl> < / Expression > <nl> < OverallResult success = " true " / > <nl> < / TestCase > <nl> + < TestCase name = " Approximate PI " > <nl> + ApproxTests . cpp " line = " 110 " > <nl> + < Original > <nl> + divide ( 22 , 7 ) = = Approx ( 3 . 141 ) . epsilon ( 0 . 001 ) <nl> + < / Original > <nl> + < Expanded > <nl> + 3 . 142857142857143 = = Approx ( 3 . 141 ) <nl> + < / Expanded > <nl> + < / Expression > <nl> + ApproxTests . cpp " line = " 111 " > <nl> + < Original > <nl> + divide ( 22 , 7 ) ! = Approx ( 3 . 141 ) . epsilon ( 0 . 0001 ) <nl> + < / Original > <nl> + < Expanded > <nl> + 3 . 142857142857143 ! = Approx ( 3 . 141 ) <nl> + < / Expanded > <nl> + < / Expression > <nl> + < OverallResult success = " true " / > <nl> + < / TestCase > <nl> < TestCase name = " . / succeeding / TestClass / succeedingCase " > <nl> ClassTests . cpp " line = " 24 " > <nl> < Original > <nl> ConditionTests . cpp " line = " 57 " > <nl> data . double_pi = = Approx ( 3 . 1415926535 ) <nl> < / Original > <nl> < Expanded > <nl> - 3 . 14159 = = Approx ( 3 . 14159 ) <nl> + 3 . 1415926535 = = Approx ( 3 . 14159 ) <nl> < / Expanded > <nl> < / Expression > <nl> ConditionTests . cpp " line = " 58 " > <nl> ConditionTests . cpp " line = " 78 " > <nl> data . double_pi = = Approx ( 3 . 1415 ) <nl> < / Original > <nl> < Expanded > <nl> - 3 . 14159 = = Approx ( 3 . 1415 ) <nl> + 3 . 1415926535 = = Approx ( 3 . 1415 ) <nl> < / Expanded > <nl> < / Expression > <nl> ConditionTests . cpp " line = " 79 " > <nl> ConditionTests . cpp " line = " 99 " > <nl> data . double_pi ! = Approx ( 3 . 1415 ) <nl> < / Original > <nl> < Expanded > <nl> - 3 . 14159 ! = Approx ( 3 . 1415 ) <nl> + 3 . 1415926535 ! = Approx ( 3 . 1415 ) <nl> < / Expanded > <nl> < / Expression > <nl> ConditionTests . cpp " line = " 100 " > <nl> ConditionTests . cpp " line = " 113 " > <nl> data . double_pi ! = Approx ( 3 . 1415926535 ) <nl> < / Original > <nl> < Expanded > <nl> - 3 . 14159 ! = Approx ( 3 . 14159 ) <nl> + 3 . 1415926535 ! = Approx ( 3 . 14159 ) <nl> < / Expanded > <nl> < / Expression > <nl> ConditionTests . cpp " line = " 114 " > <nl> ConditionTests . cpp " line = " 136 " > <nl> data . float_nine_point_one & lt ; 9 . 2 <nl> < / Original > <nl> < Expanded > <nl> - 9 . 1 & lt ; 9 . 2 <nl> + 9 . 1 & lt ; 9 . 199999999999999 <nl> < / Expanded > <nl> < / Expression > <nl> ConditionTests . cpp " line = " 138 " > <nl> ConditionTests . cpp " line = " 164 " > <nl> data . float_nine_point_one > 9 . 2 <nl> < / Original > <nl> < Expanded > <nl> - 9 . 1 > 9 . 2 <nl> + 9 . 1 > 9 . 199999999999999 <nl> < / Expanded > <nl> < / Expression > <nl> ConditionTests . cpp " line = " 166 " > <nl> TrickyTests . cpp " line = " 37 " > <nl> ( std : : pair & lt ; int , int > ( 1 , 2 ) ) = = aNicePair <nl> < / Original > <nl> < Expanded > <nl> - <nl> - std : : pair ( 1 , 2 ) <nl> - = = <nl> - std : : pair ( 1 , 2 ) <nl> + std : : pair ( 1 , 2 ) = = std : : pair ( 1 , 2 ) <nl> < / Expanded > <nl> < / Expression > <nl> < OverallResult success = " true " / > <nl> TrickyTests . cpp " line = " 315 " > <nl> < OverallResult success = " true " / > <nl> < / TestCase > <nl> < TestCase name = " Scenario : Do that thing with the thing " > <nl> - < Section name = " Given : This stuff exists " > <nl> - < Section name = " When : I do this " > <nl> - < Section name = " Then : it should do this " > <nl> - BDDTests . cpp " line = " 29 " > <nl> + < Section name = " Given : This stuff exists " > <nl> + < Section name = " When : I do this " > <nl> + < Section name = " Then : it should do this " > <nl> + BDDTests . cpp " line = " 33 " > <nl> < Original > <nl> itDoesThis ( ) <nl> < / Original > <nl> BDDTests . cpp " line = " 29 " > <nl> true <nl> < / Expanded > <nl> < / Expression > <nl> - < OverallResults successes = " 1 " failures = " 0 " / > <nl> + < Section name = " And : do that " > <nl> + BDDTests . cpp " line = " 35 " > <nl> + < Original > <nl> + itDoesThat ( ) <nl> + < / Original > <nl> + < Expanded > <nl> + true <nl> + < / Expanded > <nl> + < / Expression > <nl> + < OverallResults successes = " 1 " failures = " 0 " / > <nl> + < / Section > <nl> + < OverallResults successes = " 2 " failures = " 0 " / > <nl> < / Section > <nl> - < OverallResults successes = " 1 " failures = " 0 " / > <nl> + < OverallResults successes = " 2 " failures = " 0 " / > <nl> < / Section > <nl> - < OverallResults successes = " 1 " failures = " 0 " / > <nl> + < OverallResults successes = " 2 " failures = " 0 " / > <nl> < / Section > <nl> < OverallResult success = " true " / > <nl> < / TestCase > <nl> - < OverallResults successes = " 512 " failures = " 104 " / > <nl> + < OverallResults successes = " 515 " failures = " 104 " / > <nl> < / Group > <nl> - < OverallResults successes = " 512 " failures = " 104 " / > <nl> + < OverallResults successes = " 515 " failures = " 104 " / > <nl> < / Catch > <nl> [ Started testing : CatchSelfTest ] <nl> [ Started group : ' ~ dummy ' ] <nl> ApproxTests . cpp : 100 : approx ( d ) = = 1 . 24 succeeded for : Approx ( 1 . 23 ) = = 1 . 24 <nl> ApproxTests . cpp : 101 : approx ( d ) ! = 1 . 25 succeeded for : Approx ( 1 . 23 ) ! = 1 . 25 <nl> [ Finished : ' . / succeeding / Approx / custom ' All tests passed ( 8 assertions in 1 test case ) ] <nl> <nl> + [ Running : Approximate PI ] <nl> + ApproxTests . cpp : 110 : divide ( 22 , 7 ) = = Approx ( 3 . 141 ) . epsilon ( 0 . 001 ) succeeded for : 3 . 142857142857143 = = Approx ( 3 . 141 ) <nl> + ApproxTests . cpp : 111 : divide ( 22 , 7 ) ! = Approx ( 3 . 141 ) . epsilon ( 0 . 0001 ) succeeded for : 3 . 142857142857143 ! = Approx ( 3 . 141 ) <nl> + [ Finished : ' Approximate PI ' All tests passed ( 2 assertions in 1 test case ) ] <nl> + <nl> [ Running : . / succeeding / TestClass / succeedingCase ] <nl> ClassTests . cpp : 24 : s = = " hello " succeeded for : " hello " = = " hello " <nl> [ Finished : ' . / succeeding / TestClass / succeedingCase ' All tests passed ( 1 assertion in 1 test case ) ] <nl> ClassTests . cpp : 55 : m_a = = 2 failed for : 1 = = 2 <nl> [ Running : . / succeeding / conditions / equality ] <nl> ConditionTests . cpp : 55 : data . int_seven = = 7 succeeded for : 7 = = 7 <nl> ConditionTests . cpp : 56 : data . float_nine_point_one = = Approx ( 9 . 1f ) succeeded for : 9 . 1 = = Approx ( 9 . 1 ) <nl> - ConditionTests . cpp : 57 : data . double_pi = = Approx ( 3 . 1415926535 ) succeeded for : 3 . 14159 = = Approx ( 3 . 14159 ) <nl> + ConditionTests . cpp : 57 : data . double_pi = = Approx ( 3 . 1415926535 ) succeeded for : 3 . 1415926535 = = Approx ( 3 . 14159 ) <nl> ConditionTests . cpp : 58 : data . str_hello = = " hello " succeeded for : " hello " = = " hello " <nl> ConditionTests . cpp : 59 : " hello " = = data . str_hello succeeded for : " hello " = = " hello " <nl> ConditionTests . cpp : 60 : data . str_hello . size ( ) = = 5 succeeded for : 5 = = 5 <nl> ConditionTests . cpp : 74 : data . float_nine_point_one = = Approx ( 9 . 11f ) failed for : <nl> ConditionTests . cpp : 75 : data . float_nine_point_one = = Approx ( 9 . 0f ) failed for : 9 . 1 = = Approx ( 9 ) <nl> ConditionTests . cpp : 76 : data . float_nine_point_one = = Approx ( 1 ) failed for : 9 . 1 = = Approx ( 1 ) <nl> ConditionTests . cpp : 77 : data . float_nine_point_one = = Approx ( 0 ) failed for : 9 . 1 = = Approx ( 0 ) <nl> - ConditionTests . cpp : 78 : data . double_pi = = Approx ( 3 . 1415 ) failed for : 3 . 14159 = = Approx ( 3 . 1415 ) <nl> + ConditionTests . cpp : 78 : data . double_pi = = Approx ( 3 . 1415 ) failed for : 3 . 1415926535 = = Approx ( 3 . 1415 ) <nl> ConditionTests . cpp : 79 : data . str_hello = = " goodbye " failed for : " hello " = = " goodbye " <nl> ConditionTests . cpp : 80 : data . str_hello = = " hell " failed for : " hello " = = " hell " <nl> ConditionTests . cpp : 81 : data . str_hello = = " hello1 " failed for : " hello " = = " hello1 " <nl> ConditionTests . cpp : 95 : data . float_nine_point_one ! = Approx ( 9 . 11f ) succeeded fo <nl> ConditionTests . cpp : 96 : data . float_nine_point_one ! = Approx ( 9 . 0f ) succeeded for : 9 . 1 ! = Approx ( 9 ) <nl> ConditionTests . cpp : 97 : data . float_nine_point_one ! = Approx ( 1 ) succeeded for : 9 . 1 ! = Approx ( 1 ) <nl> ConditionTests . cpp : 98 : data . float_nine_point_one ! = Approx ( 0 ) succeeded for : 9 . 1 ! = Approx ( 0 ) <nl> - ConditionTests . cpp : 99 : data . double_pi ! = Approx ( 3 . 1415 ) succeeded for : 3 . 14159 ! = Approx ( 3 . 1415 ) <nl> + ConditionTests . cpp : 99 : data . double_pi ! = Approx ( 3 . 1415 ) succeeded for : 3 . 1415926535 ! = Approx ( 3 . 1415 ) <nl> ConditionTests . cpp : 100 : data . str_hello ! = " goodbye " succeeded for : " hello " ! = " goodbye " <nl> ConditionTests . cpp : 101 : data . str_hello ! = " hell " succeeded for : " hello " ! = " hell " <nl> ConditionTests . cpp : 102 : data . str_hello ! = " hello1 " succeeded for : " hello " ! = " hello1 " <nl> ConditionTests . cpp : 103 : data . str_hello . size ( ) ! = 6 succeeded for : 5 ! = 6 <nl> [ Running : . / failing / conditions / inequality ] <nl> ConditionTests . cpp : 111 : data . int_seven ! = 7 failed for : 7 ! = 7 <nl> ConditionTests . cpp : 112 : data . float_nine_point_one ! = Approx ( 9 . 1f ) failed for : 9 . 1 ! = Approx ( 9 . 1 ) <nl> - ConditionTests . cpp : 113 : data . double_pi ! = Approx ( 3 . 1415926535 ) failed for : 3 . 14159 ! = Approx ( 3 . 14159 ) <nl> + ConditionTests . cpp : 113 : data . double_pi ! = Approx ( 3 . 1415926535 ) failed for : 3 . 1415926535 ! = Approx ( 3 . 14159 ) <nl> ConditionTests . cpp : 114 : data . str_hello ! = " hello " failed for : " hello " ! = " hello " <nl> ConditionTests . cpp : 115 : data . str_hello . size ( ) ! = 5 failed for : 5 ! = 5 <nl> [ Finished : ' . / failing / conditions / inequality ' 1 test case failed ( All 5 assertions failed ) ] <nl> ConditionTests . cpp : 131 : data . int_seven < = 7 succeeded for : 7 < = 7 <nl> ConditionTests . cpp : 132 : data . int_seven < = 8 succeeded for : 7 < = 8 <nl> ConditionTests . cpp : 134 : data . float_nine_point_one > 9 succeeded for : 9 . 1 > 9 <nl> ConditionTests . cpp : 135 : data . float_nine_point_one < 10 succeeded for : 9 . 1 < 10 <nl> - ConditionTests . cpp : 136 : data . float_nine_point_one < 9 . 2 succeeded for : 9 . 1 < 9 . 2 <nl> + ConditionTests . cpp : 136 : data . float_nine_point_one < 9 . 2 succeeded for : 9 . 1 < 9 . 199999999999999 <nl> ConditionTests . cpp : 138 : data . str_hello < = " hello " succeeded for : " hello " < = " hello " <nl> ConditionTests . cpp : 139 : data . str_hello > = " hello " succeeded for : " hello " > = " hello " <nl> ConditionTests . cpp : 141 : data . str_hello < " hellp " succeeded for : " hello " < " hellp " <nl> ConditionTests . cpp : 159 : data . int_seven > = 8 failed for : 7 > = 8 <nl> ConditionTests . cpp : 160 : data . int_seven < = 6 failed for : 7 < = 6 <nl> ConditionTests . cpp : 162 : data . float_nine_point_one < 9 failed for : 9 . 1 < 9 <nl> ConditionTests . cpp : 163 : data . float_nine_point_one > 10 failed for : 9 . 1 > 10 <nl> - ConditionTests . cpp : 164 : data . float_nine_point_one > 9 . 2 failed for : 9 . 1 > 9 . 2 <nl> + ConditionTests . cpp : 164 : data . float_nine_point_one > 9 . 2 failed for : 9 . 1 > 9 . 199999999999999 <nl> ConditionTests . cpp : 166 : data . str_hello > " hello " failed for : " hello " > " hello " <nl> ConditionTests . cpp : 167 : data . str_hello < " hello " failed for : " hello " < " hello " <nl> ConditionTests . cpp : 168 : data . str_hello > " hellp " failed for : " hello " > " hellp " <nl> TestMain . cpp : 421 : oneTag . matchesTags ( " ~ [ hide ] " ) = = false succeeded for : false <nl> [ Finished : ' selftest / tags ' All tests passed ( 29 assertions in 1 test case ) ] <nl> <nl> [ Running : . / succeeding / Tricky / std : : pair ] <nl> - TrickyTests . cpp : 37 : ( std : : pair < int , int > ( 1 , 2 ) ) = = aNicePair succeeded for : <nl> - <nl> - std : : pair ( 1 , 2 ) <nl> - = = <nl> - std : : pair ( 1 , 2 ) <nl> + TrickyTests . cpp : 37 : ( std : : pair < int , int > ( 1 , 2 ) ) = = aNicePair succeeded for : std : : pair ( 1 , 2 ) = = std : : pair ( 1 , 2 ) <nl> [ Finished : ' . / succeeding / Tricky / std : : pair ' All tests passed ( 1 assertion in 1 test case ) ] <nl> <nl> [ Running : . / inprogress / failing / Tricky / trailing expression ] <nl> TrickyTests . cpp : 315 : ! False succeeded for : ! false <nl> [ Finished : ' . / succeeding / SafeBool ' All tests passed ( 3 assertions in 1 test case ) ] <nl> <nl> [ Running : Scenario : Do that thing with the thing ] <nl> - [ Started section : ' Given : This stuff exists ' ] <nl> - [ Started section : ' When : I do this ' ] <nl> - [ Started section : ' Then : it should do this ' ] <nl> - BDDTests . cpp : 29 : itDoesThis ( ) succeeded for : true <nl> - [ End of section : ' Then : it should do this ' 1 assertion passed ] <nl> + [ Started section : ' Given : This stuff exists ' ] <nl> + [ Started section : ' When : I do this ' ] <nl> + [ Started section : ' Then : it should do this ' ] <nl> + BDDTests . cpp : 33 : itDoesThis ( ) succeeded for : true <nl> + [ Started section : ' And : do that ' ] <nl> + BDDTests . cpp : 35 : itDoesThat ( ) succeeded for : true <nl> + [ End of section : ' And : do that ' 1 assertion passed ] <nl> <nl> - [ End of section : ' When : I do this ' 1 assertion passed ] <nl> + [ End of section : ' Then : it should do this ' All 2 assertions passed ] <nl> <nl> - [ End of section : ' Given : This stuff exists ' 1 assertion passed ] <nl> + [ End of section : ' When : I do this ' All 2 assertions passed ] <nl> <nl> - [ Finished : ' Scenario : Do that thing with the thing ' All tests passed ( 1 assertion in 1 test case ) ] <nl> - [ End of group : ' ~ dummy ' . 47 of 99 test cases failed ( 104 of 616 assertions failed ) ] <nl> + [ End of section : ' Given : This stuff exists ' All 2 assertions passed ] <nl> <nl> + [ Finished : ' Scenario : Do that thing with the thing ' All tests passed ( 2 assertions in 1 test case ) ] <nl> + [ End of group : ' ~ dummy ' . 47 of 100 test cases failed ( 104 of 619 assertions failed ) ] <nl> <nl> - [ Testing completed . 47 of 99 test cases failed ( 104 of 616 assertions failed ) ] <nl> + <nl> + [ Testing completed . 47 of 100 test cases failed ( 104 of 619 assertions failed ) ] <nl> <nl> [ Started testing : CatchSelfTest ] <nl> [ Started group : ' ~ dummy ' ] <nl> ApproxTests . cpp : 100 : approx ( d ) = = 1 . 24 succeeded for : Approx ( 1 . 23 ) = = 1 . 24 <nl> ApproxTests . cpp : 101 : approx ( d ) ! = 1 . 25 succeeded for : Approx ( 1 . 23 ) ! = 1 . 25 <nl> [ Finished : ' . / succeeding / Approx / custom ' All tests passed ( 8 assertions in 1 test case ) ] <nl> <nl> + [ Running : Approximate PI ] <nl> + ApproxTests . cpp : 110 : divide ( 22 , 7 ) = = Approx ( 3 . 141 ) . epsilon ( 0 . 001 ) succeeded for : 3 . 142857142857143 = = Approx ( 3 . 141 ) <nl> + ApproxTests . cpp : 111 : divide ( 22 , 7 ) ! = Approx ( 3 . 141 ) . epsilon ( 0 . 0001 ) succeeded for : 3 . 142857142857143 ! = Approx ( 3 . 141 ) <nl> + [ Finished : ' Approximate PI ' All tests passed ( 2 assertions in 1 test case ) ] <nl> + <nl> [ Running : . / succeeding / TestClass / succeedingCase ] <nl> ClassTests . cpp : 24 : s = = " hello " succeeded for : " hello " = = " hello " <nl> [ Finished : ' . / succeeding / TestClass / succeedingCase ' All tests passed ( 1 assertion in 1 test case ) ] <nl> ClassTests . cpp : 55 : m_a = = 2 failed for : 1 = = 2 <nl> [ Running : . / succeeding / conditions / equality ] <nl> ConditionTests . cpp : 55 : data . int_seven = = 7 succeeded for : 7 = = 7 <nl> ConditionTests . cpp : 56 : data . float_nine_point_one = = Approx ( 9 . 1f ) succeeded for : 9 . 1 = = Approx ( 9 . 1 ) <nl> - ConditionTests . cpp : 57 : data . double_pi = = Approx ( 3 . 1415926535 ) succeeded for : 3 . 14159 = = Approx ( 3 . 14159 ) <nl> + ConditionTests . cpp : 57 : data . double_pi = = Approx ( 3 . 1415926535 ) succeeded for : 3 . 1415926535 = = Approx ( 3 . 14159 ) <nl> ConditionTests . cpp : 58 : data . str_hello = = " hello " succeeded for : " hello " = = " hello " <nl> ConditionTests . cpp : 59 : " hello " = = data . str_hello succeeded for : " hello " = = " hello " <nl> ConditionTests . cpp : 60 : data . str_hello . size ( ) = = 5 succeeded for : 5 = = 5 <nl> ConditionTests . cpp : 63 : x = = Approx ( 1 . 3 ) succeeded for : 1 . 3 = = Approx ( 1 . 3 ) <nl> ConditionTests . cpp : 71 : data . int_seven = = 6 failed for : 7 = = 6 <nl> ConditionTests . cpp : 72 : data . int_seven = = 8 failed for : 7 = = 8 <nl> [ Finished : ' . / failing / conditions / equality ' 1 test case failed ( All 2 assertions failed ) ] <nl> - [ End of group : ' ~ dummy ' . 3 of 12 test cases failed ( 4 of 38 assertions failed ) ] <nl> + [ End of group : ' ~ dummy ' . 3 of 13 test cases failed ( 4 of 40 assertions failed ) ] <nl> <nl> <nl> - [ Testing aborted . 3 of 12 test cases failed ( 4 of 38 assertions failed ) ] <nl> + [ Testing aborted . 3 of 13 test cases failed ( 4 of 40 assertions failed ) ] <nl> <nl> mmm a / projects / XCode4 / CatchSelfTest / CatchSelfTest . xcodeproj / project . pbxproj <nl> ppp b / projects / XCode4 / CatchSelfTest / CatchSelfTest . xcodeproj / project . pbxproj <nl> <nl> CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES ; <nl> CLANG_CXX_LANGUAGE_STANDARD = " gnu + + 98 " ; <nl> CLANG_WARN__DUPLICATE_METHOD_MATCH = NO ; <nl> - GCC_PREPROCESSOR_DEFINITIONS = CATCH_CONFIG_USE_ANSI_COLOUR_CODES ; <nl> GCC_VERSION = com . apple . compilers . llvm . clang . 1_0 ; <nl> PRODUCT_NAME = " $ ( TARGET_NAME ) " ; <nl> WARNING_CFLAGS = ( <nl> <nl> CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES ; <nl> CLANG_CXX_LANGUAGE_STANDARD = " gnu + + 98 " ; <nl> CLANG_WARN__DUPLICATE_METHOD_MATCH = NO ; <nl> - GCC_PREPROCESSOR_DEFINITIONS = CATCH_CONFIG_USE_ANSI_COLOUR_CODES ; <nl> GCC_VERSION = com . apple . compilers . llvm . clang . 1_0 ; <nl> PRODUCT_NAME = " $ ( TARGET_NAME ) " ; <nl> WARNING_CFLAGS = ( <nl> mmm a / projects / XCode4 / CatchSelfTest / CatchSelfTest / BDDTests . cpp <nl> ppp b / projects / XCode4 / CatchSelfTest / CatchSelfTest / BDDTests . cpp <nl> <nl> <nl> / / ! TBD : story scenarios map to class based tests <nl> # define SCENARIO ( name , tags ) TEST_CASE ( " Scenario : " name , tags ) <nl> - # define GIVEN ( desc ) SECTION ( " Given : " desc , " " ) <nl> - # define WHEN ( desc ) SECTION ( " When : " desc , " " ) <nl> - # define THEN ( desc ) SECTION ( " Then : " desc , " " ) <nl> + # define GIVEN ( desc ) SECTION ( " Given : " desc , " " ) <nl> + # define WHEN ( desc ) SECTION ( " When : " desc , " " ) <nl> + # define AND_WHEN ( desc ) SECTION ( " And : " desc , " " ) <nl> + # define THEN ( desc ) SECTION ( " Then : " desc , " " ) <nl> + # define AND_THEN ( desc ) SECTION ( " And : " desc , " " ) <nl> <nl> inline bool itDoesThis ( ) { return true ; } <nl> + inline bool itDoesThat ( ) { return true ; } <nl> <nl> SCENARIO ( " Do that thing with the thing " , " [ tags ] " ) { <nl> GIVEN ( " This stuff exists " ) { <nl> SCENARIO ( " Do that thing with the thing " , " [ tags ] " ) { <nl> WHEN ( " I do this " ) { <nl> / / do this <nl> THEN ( " it should do this " ) <nl> + { <nl> REQUIRE ( itDoesThis ( ) ) ; <nl> + AND_THEN ( " do that " ) <nl> + REQUIRE ( itDoesThat ( ) ) ; <nl> + } <nl> } <nl> <nl> } <nl> mmm a / single_include / catch . hpp <nl> ppp b / single_include / catch . hpp <nl> <nl> / * <nl> - * CATCH v0 . 9 build 20 ( integration branch ) <nl> - * Generated : 2013 - 02 - 19 19 : 57 : 51 . 967870 <nl> + * CATCH v0 . 9 build 21 ( integration branch ) <nl> + * Generated : 2013 - 03 - 04 12 : 17 : 59 . 865403 <nl> * mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> * This file has been merged from multiple headers . Please don ' t edit it directly <nl> * Copyright ( c ) 2012 Two Blue Cubes Ltd . All rights reserved . <nl> struct AutoReg { <nl> # define TWOBLUECUBES_CATCH_TOSTRING_HPP_INCLUDED <nl> <nl> # include < sstream > <nl> + # include < iomanip > <nl> + # include < limits > <nl> <nl> # ifdef __OBJC__ <nl> / / # included from : catch_objc_arc . hpp <nl> namespace Detail { <nl> template < typename T > NonStreamable ( const T & ) { } <nl> } ; <nl> <nl> - / / If the type does not have its own < < overload for ostream then <nl> - / / this one will be used instead <nl> - inline std : : ostream & operator < < ( std : : ostream & ss , NonStreamable ) { <nl> - return ss < < " { ? } " ; <nl> - } <nl> + } / / end namespace Detail <nl> <nl> - template < typename T > <nl> - inline std : : string makeString ( const T & value ) { <nl> + / / If the type does not have its own < < overload for ostream then <nl> + / / this one will be used instead <nl> + inline std : : ostream & operator < < ( std : : ostream & ss , Detail : : NonStreamable ) { <nl> + return ss < < " { ? } " ; <nl> + } <nl> + <nl> + template < typename T > <nl> + struct StringMaker { <nl> + static std : : string convert ( T const & value ) { <nl> std : : ostringstream oss ; <nl> oss < < value ; <nl> return oss . str ( ) ; <nl> } <nl> - <nl> - template < typename T > <nl> - inline std : : string makeString ( T * p ) { <nl> + } ; <nl> + template < typename T > <nl> + struct StringMaker < T * > { <nl> + static std : : string convert ( T const * p ) { <nl> if ( ! p ) <nl> return INTERNAL_CATCH_STRINGIFY ( NULL ) ; <nl> std : : ostringstream oss ; <nl> oss < < p ; <nl> return oss . str ( ) ; <nl> } <nl> + } ; <nl> <nl> - template < typename T > <nl> - inline std : : string makeString ( const T * p ) { <nl> - if ( ! p ) <nl> - return INTERNAL_CATCH_STRINGIFY ( NULL ) ; <nl> + template < typename T > <nl> + struct StringMaker < std : : vector < T > > { <nl> + static std : : string convert ( std : : vector < T > const & v ) { <nl> std : : ostringstream oss ; <nl> - oss < < p ; <nl> + oss < < " { " ; <nl> + for ( std : : size_t i = 0 ; i < v . size ( ) ; + + i ) { <nl> + oss < < v [ i ] ; <nl> + if ( i < v . size ( ) - 1 ) <nl> + oss < < " , " ; <nl> + } <nl> + oss < < " } " ; <nl> return oss . str ( ) ; <nl> } <nl> + } ; <nl> <nl> + namespace Detail { <nl> + template < typename T > <nl> + inline std : : string makeString ( const T & value ) { <nl> + return StringMaker < T > : : convert ( value ) ; <nl> + } <nl> } / / end namespace Detail <nl> <nl> / / / \ brief converts any type to a string <nl> namespace Detail { <nl> / / / to provide an ostream overload for . <nl> template < typename T > <nl> std : : string toString ( const T & value ) { <nl> - return Detail : : makeString ( value ) ; <nl> + return StringMaker < T > : : convert ( value ) ; <nl> + / / return Detail : : makeString ( value ) ; <nl> } <nl> <nl> / / Built in overloads <nl> inline std : : string toString ( unsigned int value ) { <nl> <nl> inline std : : string toString ( const double value ) { <nl> std : : ostringstream oss ; <nl> - oss < < value ; <nl> + oss < < std : : setprecision ( std : : numeric_limits < double > : : digits10 + 1 ) <nl> + < < value ; <nl> return oss . str ( ) ; <nl> } <nl> <nl> namespace Catch { <nl> return false ; <nl> } <nl> <nl> - void endSection ( const std : : string & ) { <nl> + void endSection ( const std : : string & , bool stealth ) { <nl> if ( m_currentSection - > ran ( ) ) { <nl> - m_runStatus = RanAtLeastOneSection ; <nl> + if ( ! stealth ) <nl> + m_runStatus = RanAtLeastOneSection ; <nl> m_changed = true ; <nl> } <nl> else if ( m_runStatus = = EncounteredASection ) { <nl> - m_runStatus = RanAtLeastOneSection ; <nl> + if ( ! stealth ) <nl> + m_runStatus = RanAtLeastOneSection ; <nl> m_lastSectionToRun = m_currentSection ; <nl> } <nl> m_currentSection = m_currentSection - > getParent ( ) ; <nl> namespace Catch { <nl> missingAssertions = true ; <nl> <nl> } <nl> - m_runningTest - > endSection ( info . name ) ; <nl> + m_runningTest - > endSection ( info . name , false ) ; <nl> <nl> m_reporter - > sectionEnded ( SectionStats ( info , assertions , missingAssertions ) ) ; <nl> m_messages . clear ( ) ; <nl> namespace Catch { <nl> <nl> } / / end namespace Catch <nl> <nl> + # if ! defined ( CATCH_CONFIG_USE_ANSI_COLOUR_CODES ) & & ! defined ( CATCH_PLATFORM_WINDOWS ) <nl> + # define CATCH_CONFIG_USE_ANSI_COLOUR_CODES 1 <nl> + # endif <nl> + <nl> # if defined ( CATCH_CONFIG_USE_ANSI_COLOUR_CODES ) <nl> <nl> # include < unistd . h > <nl> namespace Catch { <nl> <nl> namespace { const char colourEscape = ' \ 033 ' ; } <nl> <nl> + inline bool shouldUseColour ( ) { <nl> + static bool s_shouldUseColour <nl> + = CATCH_CONFIG_USE_ANSI_COLOUR_CODES ! = 0 & & <nl> + isatty ( fileno ( stdout ) ) & & <nl> + ! isDebuggerActive ( ) ; <nl> + return s_shouldUseColour ; <nl> + } <nl> void TextColour : : set ( Colours colour ) { <nl> - if ( isatty ( fileno ( stdout ) ) & & ! isDebuggerActive ( ) ) { <nl> + if ( shouldUseColour ( ) ) { <nl> switch ( colour ) { <nl> case TextColour : : FileName : <nl> std : : cout < < colourEscape < < " [ 0m " ; / / white / normal <nl> namespace Catch { <nl> else if ( m_exprComponents . op = = " matches " ) <nl> return m_exprComponents . lhs + " " + m_exprComponents . rhs ; <nl> else if ( m_exprComponents . op ! = " ! " ) { <nl> - if ( m_exprComponents . lhs . size ( ) + m_exprComponents . rhs . size ( ) < 30 ) <nl> + if ( m_exprComponents . lhs . size ( ) + m_exprComponents . rhs . size ( ) < 40 ) <nl> return m_exprComponents . lhs + " " + m_exprComponents . op + " " + m_exprComponents . rhs ; <nl> - else if ( m_exprComponents . lhs . size ( ) < 70 & & m_exprComponents . rhs . size ( ) < 70 ) <nl> - return " \ n \ t " + m_exprComponents . lhs + " \ n \ t " + m_exprComponents . op + " \ n \ t " + m_exprComponents . rhs ; <nl> else <nl> - return " \ n " + m_exprComponents . lhs + " \ n " + m_exprComponents . op + " \ n " + m_exprComponents . rhs + " \ n \ n " ; <nl> + return m_exprComponents . lhs + " \ n " + m_exprComponents . op + " \ n " + m_exprComponents . rhs ; <nl> } <nl> else <nl> return " { can ' t expand - use " + info . macroName + " _FALSE ( " + info . capturedExpression . substr ( 1 ) + " ) instead of " + info . macroName + " ( " + info . capturedExpression + " ) for better diagnostics } " ; <nl> namespace Catch { <nl> namespace Catch { <nl> <nl> / / These numbers are maintained by a script <nl> - Version libraryVersion ( 0 , 9 , 20 , " integration " ) ; <nl> + Version libraryVersion ( 0 , 9 , 21 , " integration " ) ; <nl> } <nl> <nl> / / # included from : catch_line_wrap . hpp <nl> namespace Catch { <nl> } <nl> <nl> void print ( ) const { <nl> + printSourceInfo ( ) ; <nl> if ( stats . totals . assertions . total ( ) > 0 ) { <nl> + if ( result . isOk ( ) ) <nl> + stream < < " \ n " ; <nl> printResultType ( ) ; <nl> printOriginalExpression ( ) ; <nl> printReconstructedExpression ( ) ; <nl> } <nl> + else { <nl> + stream < < " \ n " ; <nl> + } <nl> printMessage ( ) ; <nl> - printSourceInfo ( ) ; <nl> } <nl> <nl> private : <nl> namespace Catch { <nl> } <nl> void printSourceInfo ( ) const { <nl> TextColour colourGuard ( TextColour : : FileName ) ; <nl> - stream < < result . getSourceInfo ( ) < < " : \ n " ; <nl> + stream < < result . getSourceInfo ( ) < < " : " ; <nl> } <nl> <nl> static std : : string wrapLongStrings ( std : : string const & _string ) { <nl>
Added StringMaker ( for partially specialising string conversions ) , extended BDD macros and moved file / line info to top of message .
catchorg/Catch2
767f1588dc208ef6b22b83e18e645786770ce204
2013-03-04T11:19:15Z
mmm a / tensorflow / core / distributed_runtime / rpc / eager / grpc_eager_client . cc <nl> ppp b / tensorflow / core / distributed_runtime / rpc / eager / grpc_eager_client . cc <nl> class GrpcEagerClient : public EagerClient { <nl> const auto & it = enqueue_dispatchers_ . find ( request - > context_id ( ) ) ; <nl> if ( it ! = enqueue_dispatchers_ . end ( ) ) { <nl> it - > second . CancelCall ( ) ; <nl> - enqueue_dispatchers_ . erase ( request - > context_id ( ) ) ; <nl> + enqueue_dispatchers_ . erase ( it ) ; <nl> } else if ( EnableStreaming ( ) ) { <nl> LOG ( ERROR ) < < " Remote EagerContext with id " < < request - > context_id ( ) <nl> < < " does not seem to exist . " ; <nl> class GrpcEagerClient : public EagerClient { <nl> if ( EnableStreaming ( ) ) { <nl> tf_shared_lock l ( mu_ ) ; <nl> auto it = enqueue_dispatchers_ . find ( request - > context_id ( ) ) ; <nl> - if ( enqueue_dispatchers_ . find ( request - > context_id ( ) ) = = <nl> - enqueue_dispatchers_ . end ( ) ) { <nl> + if ( it = = enqueue_dispatchers_ . end ( ) ) { <nl> auto it_and_bool = enqueue_dispatchers_ . emplace ( <nl> std : : piecewise_construct , <nl> std : : forward_as_tuple ( request - > context_id ( ) ) , <nl>
Remove duplicate hash table lookups in grpc_eager_client .
tensorflow/tensorflow
a6163f12ab50f8e0098b47437f87a355c6b2c8a2
2019-11-13T22:50:24Z
mmm a / docs / root / intro / arch_overview / security / rbac_filter . rst <nl> ppp b / docs / root / intro / arch_overview / security / rbac_filter . rst <nl> The following attributes are exposed to the language runtime : <nl> connection . uri_san_local_certificate , string , The first URI entry in the SAN field of the local certificate in the downstream TLS connection <nl> connection . uri_san_peer_certificate , string , The first URI entry in the SAN field of the peer certificate in the downstream TLS connection <nl> connection . id , uint , Downstream connection ID <nl> + connection . termination_details , string , The termination details of the connection <nl> upstream . address , string , Upstream connection remote address <nl> upstream . port , int , Upstream connection remote port <nl> upstream . tls_version , string , TLS version of the upstream TLS connection <nl> mmm a / docs / root / version_history / current . rst <nl> ppp b / docs / root / version_history / current . rst <nl> Minor Behavior Changes <nl> <nl> * build : the Alpine based debug images are no longer built in CI , use Ubuntu based images instead . <nl> * cluster manager : the cluster which can ' t extract secret entity by SDS to be warming and never activate . This feature is disabled by default and is controlled by runtime guard ` envoy . reloadable_features . cluster_keep_warming_no_secret_entity ` . <nl> + * expr filter : added ` connection . termination_details ` property support . <nl> * ext_authz filter : disable ` envoy . reloadable_features . ext_authz_measure_timeout_on_check_created ` by default . <nl> * ext_authz filter : the deprecated field : ref : ` use_alpha < envoy_api_field_config . filter . http . ext_authz . v2 . ExtAuthz . use_alpha > ` is no longer supported and cannot be set anymore . <nl> * grpc_web filter : if a ` grpc - accept - encoding ` header is present it ' s passed as - is to the upstream and if it isn ' t ` grpc - accept - encoding : identity ` is sent instead . The header was always overwriten with ` grpc - accept - encoding : identity , deflate , gzip ` before . <nl> mmm a / source / extensions / filters / common / expr / context . cc <nl> ppp b / source / extensions / filters / common / expr / context . cc <nl> absl : : optional < CelValue > ConnectionWrapper : : operator [ ] ( CelValue key ) const { <nl> return CelValue : : CreateUint64 ( id . value ( ) ) ; <nl> } <nl> return { } ; <nl> + } else if ( value = = ConnectionTerminationDetails ) { <nl> + if ( info_ . connectionTerminationDetails ( ) . has_value ( ) ) { <nl> + return CelValue : : CreateString ( & info_ . connectionTerminationDetails ( ) . value ( ) ) ; <nl> + } <nl> + return { } ; <nl> } <nl> <nl> auto ssl_info = info_ . downstreamSslConnection ( ) ; <nl> mmm a / source / extensions / filters / common / expr / context . h <nl> ppp b / source / extensions / filters / common / expr / context . h <nl> constexpr absl : : string_view Connection = " connection " ; <nl> constexpr absl : : string_view MTLS = " mtls " ; <nl> constexpr absl : : string_view RequestedServerName = " requested_server_name " ; <nl> constexpr absl : : string_view TLSVersion = " tls_version " ; <nl> + constexpr absl : : string_view ConnectionTerminationDetails = " termination_details " ; <nl> constexpr absl : : string_view SubjectLocalCertificate = " subject_local_certificate " ; <nl> constexpr absl : : string_view SubjectPeerCertificate = " subject_peer_certificate " ; <nl> constexpr absl : : string_view URISanLocalCertificate = " uri_san_local_certificate " ; <nl> mmm a / test / extensions / filters / common / expr / context_test . cc <nl> ppp b / test / extensions / filters / common / expr / context_test . cc <nl> TEST ( Context , ConnectionAttributes ) { <nl> EXPECT_CALL ( info , upstreamTransportFailureReason ( ) ) <nl> . WillRepeatedly ( ReturnRef ( upstream_transport_failure_reason ) ) ; <nl> EXPECT_CALL ( info , connectionID ( ) ) . WillRepeatedly ( Return ( 123 ) ) ; <nl> + const absl : : optional < std : : string > connection_termination_details = " unauthorized " ; <nl> + EXPECT_CALL ( info , connectionTerminationDetails ( ) ) <nl> + . WillRepeatedly ( ReturnRef ( connection_termination_details ) ) ; <nl> <nl> EXPECT_CALL ( * downstream_ssl_info , peerCertificatePresented ( ) ) . WillRepeatedly ( Return ( true ) ) ; <nl> EXPECT_CALL ( * upstream_host , address ( ) ) . WillRepeatedly ( Return ( upstream_address ) ) ; <nl> TEST ( Context , ConnectionAttributes ) { <nl> EXPECT_EQ ( 123 , value . value ( ) . Uint64OrDie ( ) ) ; <nl> } <nl> <nl> + { <nl> + auto value = connection [ CelValue : : CreateStringView ( ConnectionTerminationDetails ) ] ; <nl> + EXPECT_TRUE ( value . has_value ( ) ) ; <nl> + ASSERT_TRUE ( value . value ( ) . IsString ( ) ) ; <nl> + EXPECT_EQ ( connection_termination_details . value ( ) , value . value ( ) . StringOrDie ( ) . value ( ) ) ; <nl> + } <nl> + <nl> { <nl> auto value = upstream [ CelValue : : CreateStringView ( TLSVersion ) ] ; <nl> EXPECT_TRUE ( value . has_value ( ) ) ; <nl>
Add Connection_Termination_Details as a CEL property ( )
envoyproxy/envoy
bd73f3c4da0efffb2593d7c9ecf87788856dc052
2020-11-03T03:39:22Z
mmm a / src / imperative / cached_op . cc <nl> ppp b / src / imperative / cached_op . cc <nl> std : : vector < nnvm : : NodeEntry > Imperative : : CachedOp : : Gradient ( <nl> auto nop = Node : : Create ( ) ; <nl> nop - > attrs . op = _NoGrad ; <nl> nop - > attrs . name = " NoGradient " ; <nl> - uint32_t j = 0 , k = 0 ; <nl> + uint32_t k = 0 ; <nl> for ( const auto & i : fwd_graph_ . indexed_graph ( ) . input_nodes ( ) ) { <nl> if ( auxs . count ( i ) ) { <nl> ret . emplace_back ( NodeEntry { nop , 0 , 0 } ) ; <nl> mmm a / src / kvstore / kvstore_dist_server . h <nl> ppp b / src / kvstore / kvstore_dist_server . h <nl> class KVStoreDistServer { <nl> using namespace mshadow ; <nl> Engine : : Get ( ) - > PushAsync ( <nl> [ recved , merged , out ] ( RunContext ctx , Engine : : CallbackOnComplete on_complete ) { <nl> - op : : ElemwiseBinaryOp : : ComputeEx < cpu , mshadow : : op : : plus > ( <nl> + op : : ElemwiseBinaryOp : : ComputeEx < cpu , op : : mshadow_op : : plus > ( <nl> { } , { } , { recved , merged . array } , { kWriteTo } , { out } ) ; <nl> on_complete ( ) ; <nl> } , recved . ctx ( ) , const_vars , { out . var ( ) } , <nl> mmm a / src / ndarray / ndarray_function - inl . h <nl> ppp b / src / ndarray / ndarray_function - inl . h <nl> void ElementwiseSum < DEVICE > ( const std : : vector < TBlob > source , <nl> } <nl> default : { <nl> Tensor < xpu , 2 , DType > in_0 = source [ 0 ] . FlatTo2D < xpu , DType > ( s ) ; <nl> - out = F < mshadow : : op : : identity > ( in_0 ) ; <nl> + out = F < op : : mshadow_op : : identity > ( in_0 ) ; <nl> for ( size_t i = 1 ; i < source . size ( ) ; + + i ) { <nl> out + = source [ i ] . FlatTo2D < xpu , DType > ( s ) ; <nl> } <nl> mmm a / src / ndarray / ndarray_function . h <nl> ppp b / src / ndarray / ndarray_function . h <nl> struct BinaryBase { <nl> <nl> / / operators <nl> struct Plus : public BinaryBase { <nl> - typedef mshadow : : op : : plus mshadow_op ; <nl> + typedef op : : mshadow_op : : plus mshadow_op ; <nl> } ; <nl> <nl> struct Minus : public BinaryBase { <nl> - typedef mshadow : : op : : minus mshadow_op ; <nl> + typedef op : : mshadow_op : : minus mshadow_op ; <nl> } ; <nl> <nl> struct Mul : public BinaryBase { <nl> - typedef mshadow : : op : : mul mshadow_op ; <nl> + typedef op : : mshadow_op : : mul mshadow_op ; <nl> } ; <nl> <nl> struct Div : public BinaryBase { <nl> - typedef mshadow : : op : : div mshadow_op ; <nl> + typedef op : : mshadow_op : : div mshadow_op ; <nl> } ; <nl> <nl> struct Mod : public BinaryBase { <nl> mmm a / src / operator / activation - inl . h <nl> ppp b / src / operator / activation - inl . h <nl> class ActivationOp : public Operator { <nl> if ( sz ) { <nl> MXNET_ASSIGN_REQ_SWITCH ( req [ activation : : kData ] , Req , { <nl> mxnet_op : : Kernel < mxnet_op : : op_with_req < <nl> - mxnet : : op : : mxnet_op : : backward_grad < BackwardOp > , Req > , xpu > : : Launch ( <nl> + mxnet : : op : : mxnet_op : : backward_grad_tuned < BackwardOp > , Req > , xpu > : : Launch ( <nl> s , sz , <nl> m_in_grad . dptr < DType > ( ) , <nl> m_out_grad . dptr < DType > ( ) , <nl> mmm a / src / operator / contrib / ctc_loss - inl . h <nl> ppp b / src / operator / contrib / ctc_loss - inl . h <nl> class CTCLossOp : public Operator { <nl> workspace_bytes ) ) ; <nl> <nl> if ( req_grad ) { <nl> - mxnet_op : : SoftmaxGrad < mshadow : : op : : mul , mxnet_op : : softmax_bwd > ( s , <nl> + mxnet_op : : SoftmaxGrad < mshadow_op : : mul , mxnet_op : : softmax_bwd > ( s , <nl> prob . dptr_ , grad . dptr_ , grad . dptr_ , data . shape_ , 2 ) ; <nl> Assign ( grad , mxnet : : kWriteInplace , grad * alphabet_size ) ; <nl> } <nl> mmm a / src / operator / mshadow_op . h <nl> ppp b / src / operator / mshadow_op . h <nl> <nl> # include " math . h " <nl> # include " math_functions - inl . h " <nl> # include " special_functions - inl . h " <nl> - # include " . / mxnet_op . h " <nl> + # include " . / operator_tune . h " <nl> <nl> # ifdef __CUDACC__ <nl> # include < cuda_fp16 . h > <nl> namespace mxnet { <nl> namespace op { <nl> namespace mshadow_op { <nl> <nl> - / * ! <nl> - * \ brief Use the ' MXNET_TUNABLE_MSHADOW_OP_FWD_AND_BWD ' macro outside of the mshadow_op namespace <nl> - * See mxnet_op . h for a description of ' MXNET_TUNABLE_MSHADOW_OP_FWD_AND_BWD ' <nl> - * <nl> - * \ note An entry for the operator must also be added in operator_tune . cc , which will register it <nl> - * for auto - tuning and also hold its workload weight <nl> - * / <nl> - # define MSHADOW_OP_DECLARE_TUNABLE_FWD_AND_BWD ( __op $ ) \ <nl> - } MXNET_TUNABLE_MSHADOW_OP_FWD_AND_BWD ( mshadow_op : : __op $ ) namespace mshadow_op { / / NOLINT ( * ) <nl> - / * ! <nl> - * \ brief Use the ' MXNET_TUNABLE_MSHADOW_OP_BACKWARD ' macro outside of the mshadow_op namespace <nl> - * See mxnet_op . h for a description of ' MXNET_TUNABLE_MSHADOW_OP_BACKWARD ' <nl> - * <nl> - * \ note An entry for the operator must also be added in operator_tune . cc , which will register it <nl> - * for auto - tuning and also hold its workload weight <nl> - * / <nl> - # define MSHADOW_OP_DECLARE_TUNABLE_BACKWARD ( __op $ ) \ <nl> - } MXNET_TUNABLE_MSHADOW_OP_BACKWARD ( mshadow_op : : __op $ ) namespace mshadow_op { / / NOLINT ( * ) <nl> # ifdef __CUDA_ARCH__ <nl> __constant__ const float PI = 3 . 14159265358979323846 ; <nl> # else <nl> using std : : enable_if ; <nl> using std : : is_unsigned ; <nl> <nl> # define MXNET_UNARY_MATH_OP ( name , expr ) \ <nl> - struct name { \ <nl> + struct name : public mxnet_op : : tunable { \ <nl> template < typename DType > \ <nl> MSHADOW_XINLINE static DType Map ( DType a ) { \ <nl> return DType ( expr ) ; \ <nl> } \ <nl> - } ; \ <nl> - MSHADOW_OP_DECLARE_TUNABLE_FWD_AND_BWD ( name ) <nl> - <nl> + } <nl> <nl> # define MXNET_UNARY_MATH_OP_NC ( name , expr ) \ <nl> - struct name { \ <nl> + struct name : public mxnet_op : : tunable { \ <nl> template < typename DType > \ <nl> MSHADOW_XINLINE static DType Map ( DType a ) { \ <nl> return ( expr ) ; \ <nl> } \ <nl> - } ; \ <nl> - MSHADOW_OP_DECLARE_TUNABLE_FWD_AND_BWD ( name ) <nl> + } <nl> <nl> # define MXNET_BINARY_MATH_OP ( name , expr ) \ <nl> - struct name { \ <nl> + struct name : public mxnet_op : : tunable { \ <nl> template < typename DType > \ <nl> MSHADOW_XINLINE static DType Map ( DType a , DType b ) { \ <nl> return DType ( expr ) ; \ <nl> } \ <nl> - } ; \ <nl> - MSHADOW_OP_DECLARE_TUNABLE_FWD_AND_BWD ( name ) <nl> + } <nl> <nl> # define MXNET_BINARY_MATH_OP_NC ( name , expr ) \ <nl> - struct name { \ <nl> + struct name : public mxnet_op : : tunable { \ <nl> template < typename DType > \ <nl> MSHADOW_XINLINE static DType Map ( DType a , DType b ) { \ <nl> return ( expr ) ; \ <nl> } \ <nl> - } ; \ <nl> - MSHADOW_OP_DECLARE_TUNABLE_FWD_AND_BWD ( name ) <nl> + } <nl> <nl> # define MXNET_SIMPLE_UNARY_MATH_OP ( name ) MXNET_UNARY_MATH_OP ( name , math : : name ( a ) ) <nl> <nl> MXNET_BINARY_MATH_OP_NC ( left , a ) ; <nl> <nl> MXNET_BINARY_MATH_OP_NC ( right , b ) ; <nl> <nl> + MXNET_BINARY_MATH_OP_NC ( mul , a * b ) ; <nl> + <nl> + MXNET_BINARY_MATH_OP_NC ( div , a / b ) ; <nl> + <nl> + MXNET_BINARY_MATH_OP_NC ( plus , a + b ) ; <nl> + <nl> + MXNET_BINARY_MATH_OP_NC ( minus , a - b ) ; <nl> + <nl> MXNET_UNARY_MATH_OP ( negation , - a ) ; <nl> <nl> MXNET_UNARY_MATH_OP ( reciprocal , 1 . 0f / math : : id ( a ) ) ; <nl> MXNET_SIMPLE_UNARY_MATH_OP ( tanh ) ; <nl> MXNET_UNARY_MATH_OP ( tanh_grad , 1 . 0f - math : : sqr ( a ) ) ; <nl> <nl> / * ! \ brief SoftReLU , also known as softplus activation * / <nl> - struct softrelu { <nl> + struct softrelu : public mxnet_op : : tunable { <nl> template < typename DType > <nl> MSHADOW_XINLINE static DType Map ( DType a ) { <nl> / / Avoid overflow of exp for large inputs . <nl> struct softrelu { <nl> } <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_FWD_AND_BWD ( softrelu ) <nl> <nl> MXNET_UNARY_MATH_OP ( softrelu_grad , - math : : expm1 ( - a ) ) ; <nl> <nl> MXNET_UNARY_MATH_OP ( log_grad , 1 . 0f / math : : id ( a ) ) ; <nl> MXNET_SIMPLE_UNARY_MATH_OP ( log10 ) ; <nl> <nl> / / Constant is 1 / log ( 10 ) <nl> - struct log10_grad { <nl> + struct log10_grad : public mxnet_op : : tunable { <nl> template < typename DType > <nl> MSHADOW_XINLINE static DType Map ( DType a ) { <nl> return DType ( 0 . 4342944819f / static_cast < float > ( a ) ) ; <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_BACKWARD ( log10_grad ) <nl> <nl> template < > <nl> MSHADOW_XINLINE double log10_grad : : Map < double > ( double a ) { <nl> MSHADOW_XINLINE double log10_grad : : Map < double > ( double a ) { <nl> MXNET_SIMPLE_UNARY_MATH_OP ( log2 ) ; <nl> <nl> / / Constant is 1 / log ( 2 ) <nl> - struct log2_grad { <nl> + struct log2_grad : public mxnet_op : : tunable { <nl> template < typename DType > <nl> MSHADOW_XINLINE static DType Map ( DType a ) { <nl> return DType ( 1 . 442695041f / static_cast < float > ( a ) ) ; <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_BACKWARD ( log2_grad ) <nl> <nl> template < > <nl> MSHADOW_XINLINE double log2_grad : : Map < double > ( double a ) { <nl> MXNET_BINARY_MATH_OP_NC ( threshold , a < b ? DType ( 1 ) : DType ( 0 ) ) ; <nl> MXNET_UNARY_MATH_OP ( abs , math : : fabs ( a ) ) ; / / NOLINT ( * ) <nl> <nl> / * ! \ brief used for generate element of sign * / <nl> - struct sign { <nl> + struct sign : public mxnet_op : : tunable { <nl> template < typename DType > <nl> MSHADOW_XINLINE static typename enable_if < ! is_unsigned < DType > : : value , DType > : : type <nl> Map ( DType a ) { <nl> struct sign { <nl> return DType ( 0 ) ; <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_FWD_AND_BWD ( sign ) <nl> <nl> MXNET_UNARY_MATH_OP_NC ( sign_grad , DType ( 0 ) ) ; <nl> <nl> MXNET_SIMPLE_UNARY_MATH_OP ( floor ) ; <nl> MXNET_SIMPLE_UNARY_MATH_OP ( trunc ) ; <nl> <nl> / * ! \ brief used to round number to nearest integer * / <nl> - struct rint { <nl> + struct rint : public mxnet_op : : tunable { <nl> template < typename DType > <nl> MSHADOW_XINLINE static DType Map ( DType a ) { <nl> auto floor = math : : floor ( a ) ; <nl> struct rint { <nl> return DType ( ( af - floor ) < = ( ceil - af ) ? floor : ceil ) ; <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_FWD_AND_BWD ( rint ) <nl> <nl> / * ! \ brief used to round number to integer nearest to 0 * / <nl> - struct fix { <nl> + struct fix : public mxnet_op : : tunable { <nl> template < typename DType > <nl> MSHADOW_XINLINE static DType Map ( DType a ) { <nl> auto floor = math : : floor ( a ) ; <nl> struct fix { <nl> return DType ( ( floor > 0 ? floor : - floor ) < ( ceil > 0 ? ceil : - ceil ) ? floor : ceil ) ; <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_FWD_AND_BWD ( fix ) <nl> <nl> / * ! \ brief used for generate gradient of MAE loss * / <nl> MXNET_BINARY_MATH_OP_NC ( minus_sign , a - b > DType ( 0 ) ? DType ( 1 ) : - DType ( 1 ) ) ; <nl> MXNET_BINARY_MATH_OP ( rdiv , math : : id ( b ) / math : : id ( a ) ) ; <nl> <nl> MXNET_BINARY_MATH_OP ( rdiv_grad , - math : : id ( b ) / math : : sqr ( a ) ) ; <nl> <nl> - struct mod { <nl> + struct mod : public mxnet_op : : tunable { <nl> template < typename DType > <nl> MSHADOW_XINLINE static typename enable_if < ! is_unsigned < DType > : : value , DType > : : type <nl> Map ( DType a , DType b ) { <nl> struct mod { <nl> } <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_FWD_AND_BWD ( mod ) <nl> <nl> template < > <nl> MSHADOW_XINLINE mshadow : : half : : half2_t mod : : Map < mshadow : : half : : half2_t > <nl> MSHADOW_XINLINE mshadow : : half : : half2_t mod : : Map < mshadow : : half : : half2_t > <nl> return a % b ; <nl> } <nl> <nl> - struct mod_grad { <nl> + struct mod_grad : public mxnet_op : : tunable { <nl> template < typename DType > <nl> MSHADOW_XINLINE static DType Map ( DType a , DType b ) { <nl> return DType ( 0 ) ; <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_BACKWARD ( mod_grad ) <nl> - <nl> template < > <nl> MSHADOW_XINLINE double mod_grad : : Map < double > ( double a , double b ) { <nl> return 1 . 0 ; <nl> MSHADOW_XINLINE mshadow : : half : : half2_t mod_grad : : Map < mshadow : : half : : half2_t > <nl> return result ; <nl> } <nl> <nl> - struct mod_rgrad { <nl> + struct mod_rgrad : public mxnet_op : : tunable { <nl> template < typename DType > <nl> MSHADOW_XINLINE static DType Map ( DType a , DType b ) { <nl> return DType ( 0 ) ; <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_BACKWARD ( mod_rgrad ) <nl> - <nl> template < > <nl> MSHADOW_XINLINE double mod_rgrad : : Map < double > ( double a , double b ) { <nl> return - : : floor ( a / b ) ; <nl> MSHADOW_XINLINE mshadow : : half : : half2_t mod_rgrad : : Map < mshadow : : half : : half2_t > <nl> # endif <nl> } <nl> <nl> - struct rmod { <nl> + struct rmod : public mxnet_op : : tunable { <nl> template < typename DType > <nl> MSHADOW_XINLINE static typename enable_if < ! is_unsigned < DType > : : value , DType > : : type <nl> Map ( DType a , DType b ) { <nl> struct rmod { <nl> } <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_FWD_AND_BWD ( rmod ) <nl> <nl> template < > <nl> MSHADOW_XINLINE mshadow : : half : : half2_t rmod : : Map < mshadow : : half : : half2_t > <nl> struct rmod_grad { <nl> return DType ( 0 ) ; <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_BACKWARD ( rmod_grad ) <nl> - <nl> template < > <nl> MSHADOW_XINLINE double rmod_grad : : Map < double > ( double a , double b ) { <nl> return - : : floor ( b / a ) ; <nl> MSHADOW_XINLINE mshadow : : half : : half2_t rmod_grad : : Map < mshadow : : half : : half2_t > <nl> # endif <nl> } <nl> <nl> - struct clip { <nl> + struct clip : public mxnet_op : : tunable { <nl> template < typename DType > <nl> MSHADOW_XINLINE static DType Map ( DType x , DType bound ) { <nl> if ( x > bound ) { <nl> struct clip { <nl> } <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_FWD_AND_BWD ( clip ) <nl> <nl> / * * * * * gamma * * * * * * / <nl> <nl> MXNET_UNARY_MATH_OP ( gamma , math : : tgamma ( a ) ) ; <nl> <nl> - struct gamma_grad { <nl> + struct gamma_grad : public mxnet_op : : tunable { <nl> template < typename DType > <nl> MSHADOW_XINLINE static DType Map ( DType a ) { <nl> / / default implementation using floating precision <nl> struct gamma_grad { <nl> return DType ( math : : tgamma ( af ) * special_functions : : cephes : : psi < float > ( af ) ) ; <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_BACKWARD ( gamma_grad ) <nl> <nl> template < > <nl> MSHADOW_XINLINE double gamma_grad : : Map < double > ( double a ) { <nl> MSHADOW_XINLINE double gamma_grad : : Map < double > ( double a ) { <nl> <nl> MXNET_UNARY_MATH_OP ( gammaln , math : : lgamma ( a ) ) ; <nl> <nl> - struct gammaln_grad { <nl> + struct gammaln_grad : public mxnet_op : : tunable { <nl> template < typename DType > <nl> MSHADOW_XINLINE static DType Map ( DType a ) { <nl> / / default implementation using floating precision <nl> return DType ( special_functions : : cephes : : psi < float > ( a ) ) ; <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_BACKWARD ( gammaln_grad ) <nl> <nl> template < > <nl> MSHADOW_XINLINE double gammaln_grad : : Map < double > ( double a ) { <nl> MSHADOW_XINLINE double gammaln_grad : : Map < double > ( double a ) { <nl> * smooth_l1_loss = w_out * f ( w_in * x ) <nl> * with w_in , w_out provided by input_data . <nl> * / <nl> - struct smooth_l1_loss { <nl> + struct smooth_l1_loss : public mxnet_op : : tunable { <nl> / / a is x , b is sigma <nl> template < typename DType > <nl> MSHADOW_XINLINE static DType Map ( DType a , DType b ) { <nl> struct smooth_l1_loss { <nl> } <nl> } <nl> } ; / / struct smooth_l1_loss <nl> - MSHADOW_OP_DECLARE_TUNABLE_FWD_AND_BWD ( smooth_l1_loss ) <nl> <nl> / * The derivative of smooth l1 loss is <nl> * f ' ( x ) = sigma ^ 2 * x , | x | < 1 / sigma ^ 2 <nl> * = sign ( x ) , otherwise <nl> * / <nl> - struct smooth_l1_gradient { <nl> + struct smooth_l1_gradient : public mxnet_op : : tunable { <nl> / / a is x , b is sigma2 <nl> template < typename DType > <nl> MSHADOW_XINLINE static DType Map ( DType a , DType b ) { <nl> struct smooth_l1_gradient { <nl> } <nl> } <nl> } ; / / struct smooth_l1_derivative <nl> - MSHADOW_OP_DECLARE_TUNABLE_BACKWARD ( smooth_l1_gradient ) <nl> <nl> / * ! \ brief product reducer * / <nl> struct product { <nl> struct nansum { <nl> } <nl> } ; <nl> <nl> - struct nansum_grad { <nl> + struct nansum_grad : public mxnet_op : : tunable { <nl> template < typename DType > <nl> MSHADOW_XINLINE static DType Map ( DType a , DType b ) { <nl> return isnan_typed : : IsNan ( a ) ? DType ( 0 ) : DType ( 1 ) ; <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_BACKWARD ( nansum_grad ) <nl> <nl> / * ! \ brief product reducer that ignores NaN values in the input * / <nl> struct nanprod { <nl> struct nanprod { <nl> } <nl> } ; <nl> <nl> - struct nanprod_grad { <nl> + struct nanprod_grad : public mxnet_op : : tunable { <nl> template < typename DType > <nl> MSHADOW_XINLINE static DType Map ( DType a , DType b ) { <nl> return isnan_typed : : IsNan ( a ) ? DType ( 0 ) : b / a ; <nl> } <nl> } ; <nl> - MSHADOW_OP_DECLARE_TUNABLE_BACKWARD ( nanprod_grad ) <nl> + <nl> } / / namespace mshadow_op <nl> } / / namespace op <nl> } / / namespace mxnet <nl> mmm a / src / operator / mxnet_op . h <nl> ppp b / src / operator / mxnet_op . h <nl> inline int get_num_threads < gpu > ( const int N ) { <nl> <nl> template < > <nl> inline int get_num_threads < cpu > ( const int N ) { <nl> - return omp_get_max_threads ( ) ; <nl> + return engine : : OpenMP : : Get ( ) - > GetRecommendedOMPThreadCount ( ) ; <nl> } <nl> <nl> / * ! \ brief operator request type switch * / <nl> struct backward_grad { <nl> } <nl> } ; <nl> <nl> + / * ! \ brief Binary op backward gradient OP wrapper ( tuned ) * / <nl> + template < typename GRAD_OP > <nl> + struct backward_grad_tuned : public backward_grad < GRAD_OP > , public tunable { <nl> + using backward_grad < GRAD_OP > : : Map ; <nl> + } ; <nl> + <nl> / * ! \ brief Select assignment operation based upon the req value <nl> * Also useful for mapping mshadow Compute ( F < OP > ) to Kernel < OP > : : Launch <nl> * / <nl> struct Kernel < OP , cpu > { <nl> * operator_tune . cc <nl> * \ tparam Args Varargs type to eventually pass to the OP : : Map ( ) functoion <nl> * \ param N Number of iterations <nl> - * \ param dest Destination pointer ( used to infer DType ) <nl> * \ param args Varargs to eventually pass to the OP : : Map ( ) functoion <nl> * / <nl> template < typename . . . Args > <nl> - inline static void Launch ( mshadow : : Stream < cpu > * , const int N , Args . . . args ) { <nl> + inline static bool Launch ( mshadow : : Stream < cpu > * , const int N , Args . . . args ) { <nl> # ifdef _OPENMP <nl> const int omp_threads = engine : : OpenMP : : Get ( ) - > GetRecommendedOMPThreadCount ( ) ; <nl> if ( omp_threads < 2 ) { <nl> struct Kernel < OP , cpu > { <nl> OP : : Map ( i , args . . . ) ; <nl> } <nl> # endif <nl> + return true ; <nl> } <nl> <nl> / * ! <nl> struct Kernel < OP , cpu > { <nl> OP : : Map ( 0 , N , args . . . ) ; <nl> # endif <nl> } <nl> + <nl> + / * ! <nl> + * \ brief Launch a tunable OP with implicitly - supplied data type <nl> + * \ tparam DType Data type <nl> + * \ tparam T OP type <nl> + * \ tparam Args Varargs type to eventually pass to the OP : : Map ( ) functoion <nl> + * \ param s Stream ( usually null for CPU ) <nl> + * \ param N Number of iterations <nl> + * \ param args Varargs to eventually pass to the OP : : Map ( ) functoion <nl> + * \ return Always true <nl> + * / <nl> + template < typename DType , typename T = OP , typename . . . Args > <nl> + static MSHADOW_CINLINE <nl> + typename std : : enable_if < std : : is_base_of < tunable , T > : : value , bool > : : type <nl> + Launch ( mshadow : : Stream < cpu > * s , const int N , DType * dest , Args . . . args ) { <nl> + LaunchTuned < T , DType > ( s , N , dest , args . . . ) ; <nl> + return true ; <nl> + } <nl> + <nl> + / * ! <nl> + * \ brief Launch a tunable OP wrapper with explicitly - supplied data type ( ie op_with_req ) <nl> + * \ tparam DType Data type <nl> + * \ tparam T Wrapper type <nl> + * \ tparam Args Varargs type to eventually pass to the OP : : Map ( ) functoion <nl> + * \ param s Stream ( usually null for CPU ) <nl> + * \ param N Number of iterations <nl> + * \ param args Varargs to eventually pass to the OP : : Map ( ) functoion <nl> + * \ return Always true <nl> + * / <nl> + template < typename DType , typename T = OP , typename . . . Args > <nl> + static MSHADOW_CINLINE <nl> + typename std : : enable_if < std : : is_base_of < tunable , typename T : : Operation > : : value , bool > : : type <nl> + Launch ( mshadow : : Stream < cpu > * s , const int N , DType * dest , Args . . . args ) { <nl> + LaunchTuned < typename T : : Operation , DType > ( s , N , dest , args . . . ) ; <nl> + return true ; <nl> + } <nl> } ; <nl> <nl> + <nl> + <nl> # ifdef __CUDACC__ <nl> template < typename OP , typename . . . Args > <nl> __global__ void mxnet_generic_kernel ( int N , Args . . . args ) { <nl> struct Kernel < OP , gpu > { <nl> } ; <nl> # endif / / __CUDACC__ <nl> <nl> - / * ! <nl> - * \ brief Wrap Kernel < OP , xpu > : : Launch * with some special - case helpers <nl> - * / <nl> - template < typename OP , typename xpu > <nl> - struct KernelWrapper { <nl> - / * ! <nl> - * \ brief Launch ' mshadow_op - type ' op ( i . e . DType ( * ) ( . . . ) { return < operation > } <nl> - * \ tparam Args Varargs type to eventually pass to the OP : : Map ( ) function <nl> - * \ param s Stream object pointer ( unused ) <nl> - * \ param N Number of iterations <nl> - * \ param args Varargs to eventually pass to the OP : : Map ( ) functoion <nl> - * / <nl> - template < typename DType , typename . . . Args > <nl> - MSHADOW_CINLINE static void LaunchMShadowOpEx ( mshadow : : Stream < xpu > * s , <nl> - const int N , <nl> - DType * dest , <nl> - Args . . . args ) { <nl> - mxnet : : op : : mxnet_op : : Kernel < OP , xpu > : : template LaunchTuned < <nl> - typename OP : : Operation , DType > ( s , N , dest , args . . . ) ; <nl> - } <nl> - <nl> - / * ! <nl> - * \ brief Launch ' mxnet_op - type ' op ( i . e . void ( * ) ( int N , DType * out , . . . ) <nl> - * \ tparam Args Varargs type to eventually pass to the OP : : Map ( ) function <nl> - * \ param s Stream object pointer ( unused ) <nl> - * \ param N Number of iterations <nl> - * \ param args Varargs to eventually pass to the OP : : Map ( ) functoion <nl> - * / <nl> - template < typename DType , typename . . . Args > <nl> - MSHADOW_CINLINE static void LaunchMXNetOpEx ( mshadow : : Stream < xpu > * s , <nl> - const int N , <nl> - DType * dest , <nl> - Args . . . args ) { <nl> - mxnet : : op : : mxnet_op : : Kernel < OP , xpu > : : template LaunchTuned < OP , DType > ( s , N , dest , args . . . ) ; <nl> - } <nl> - } ; <nl> - <nl> / * ! <nl> * \ brief Set to immediate scalar value kernel <nl> * \ tparam val Scalar immediate <nl> * / <nl> template < int val > <nl> - struct set_to_int { <nl> + struct set_to_int : public tunable { <nl> / / mxnet_op version ( when used directly with Kernel < > : : Launch ( ) ) * / <nl> template < typename DType > <nl> MSHADOW_XINLINE static void Map ( int i , DType * out ) { <nl> struct set_to_int { <nl> * / <nl> using set_zero = set_to_int < 0 > ; <nl> using set_one = set_to_int < 1 > ; <nl> - _MXNET_TUNABLE_MXNET_OP_FWD ( set_zero ) ; / / _ prefix denotes " already in mxnet_op namespace " <nl> - _MXNET_TUNABLE_MXNET_OP_FWD ( set_one ) ; <nl> } / / namespace mxnet_op <nl> <nl> - / * ! <nl> - * \ brief Tuning specializations for the simple ops in < mshadow / base . h > <nl> - * Basically , this overrides mxnet : : op : : mxnet_op : : Kernel < OP , cpu > : : Launch ( ) and <nl> - * redirects to mxnet : : op : : mxnet_op : : KernelWrapper < OP , cpu > : : Launch ? ? ? ? OpEx ( ) , <nl> - * which eventually leads back to mxnet : : op : : mxnet_op : : Kernel < OP , cpu > : : LaunchTuned ( ) <nl> - * / <nl> - MXNET_TUNABLE_MSHADOW_OP_FWD_AND_BWD ( mshadow : : op : : identity ) <nl> - MXNET_TUNABLE_MSHADOW_OP_FWD_AND_BWD ( mshadow : : op : : plus ) <nl> - MXNET_TUNABLE_MSHADOW_OP_FWD_AND_BWD ( mshadow : : op : : minus ) <nl> - MXNET_TUNABLE_MSHADOW_OP_FWD_AND_BWD ( mshadow : : op : : mul ) <nl> - MXNET_TUNABLE_MSHADOW_OP_FWD_AND_BWD ( mshadow : : op : : div ) <nl> - MXNET_TUNABLE_MSHADOW_OP_FWD_AND_BWD ( mshadow : : op : : right ) <nl> - <nl> } / / namespace op <nl> } / / namespace mxnet <nl> <nl> mmm a / src / operator / nn / softmax . cc <nl> ppp b / src / operator / nn / softmax . cc <nl> Example : : <nl> <nl> MXNET_OPERATOR_REGISTER_BINARY ( _backward_softmax ) <nl> . set_attr_parser ( ParamParser < SoftmaxParam > ) <nl> - . set_attr < FCompute > ( " FCompute < cpu > " , SoftmaxGradCompute < cpu , mshadow : : op : : mul , <nl> + . set_attr < FCompute > ( " FCompute < cpu > " , SoftmaxGradCompute < cpu , op : : mshadow_op : : mul , <nl> mxnet_op : : softmax_bwd > ) ; <nl> <nl> MXNET_OPERATOR_REGISTER_UNARY ( log_softmax ) <nl> mmm a / src / operator / nn / softmax . cu <nl> ppp b / src / operator / nn / softmax . cu <nl> NNVM_REGISTER_OP ( softmax ) <nl> . set_attr < FCompute > ( " FCompute < gpu > " , SoftmaxCompute < gpu , mxnet_op : : softmax_fwd > ) ; <nl> <nl> NNVM_REGISTER_OP ( _backward_softmax ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , SoftmaxGradCompute < gpu , mshadow : : op : : mul , <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , SoftmaxGradCompute < gpu , op : : mshadow_op : : mul , <nl> mxnet_op : : softmax_bwd > ) ; <nl> <nl> NNVM_REGISTER_OP ( log_softmax ) <nl> mmm a / src / operator / operator_tune - inl . h <nl> ppp b / src / operator / operator_tune - inl . h <nl> class UnaryOpTune : public OperatorTune < DType > { <nl> * / <nl> template < typename OP > <nl> static void TuneBlankOperator ( ) { <nl> - mxnet : : op : : mxnet_op : : tuned_op < OP , DType > : : workload_ = GetBlankWorkload < OP > ( ) ; <nl> + mxnet : : op : : mxnet_op : : tuned_op < OP , DType > : : workload_ [ 0 ] = GetBlankWorkload < OP > ( ) ; <nl> if ( Super : : output_tuning_data_ ) { <nl> std : : cout < < " IMPLEMENT_UNARY_WORKLOAD_FWD ( " <nl> < < Super : : template type_name < OP > ( ) <nl> class UnaryOpTune : public OperatorTune < DType > { <nl> * / <nl> template < typename OP > <nl> static void TuneUnaryOperator ( ) { <nl> - mxnet : : op : : mxnet_op : : tuned_op < OP , DType > : : workload_ = GetUnaryWorkload < OP > ( ) ; <nl> + mxnet : : op : : mxnet_op : : tuned_op < OP , DType > : : workload_ [ 0 ] = GetUnaryWorkload < OP > ( ) ; <nl> if ( Super : : output_tuning_data_ ) { <nl> std : : cout < < " IMPLEMENT_UNARY_WORKLOAD_FWD ( " <nl> < < Super : : template type_name < OP > ( ) <nl> class UnaryOpTune : public OperatorTune < DType > { <nl> * / <nl> template < typename OP > <nl> static void TuneUnaryBackwardOperator ( ) { <nl> - mxnet : : op : : mxnet_op : : tuned_op < mxnet_op : : backward_grad < OP > , DType > : : workload_ = <nl> - GetBinaryWorkload < mxnet : : op : : mxnet_op : : backward_grad < OP > > ( ) ; <nl> + mxnet : : op : : mxnet_op : : tuned_op < mxnet_op : : backward_grad_tuned < OP > , DType > : : workload_ [ 0 ] = <nl> + GetBinaryWorkload < mxnet : : op : : mxnet_op : : backward_grad_tuned < OP > > ( ) ; <nl> if ( Super : : output_tuning_data_ ) { <nl> std : : cout < < " IMPLEMENT_UNARY_WORKLOAD_BWD ( " <nl> < < Super : : template type_name < OP > ( ) <nl> class UnaryOpTune : public OperatorTune < DType > { <nl> * / <nl> template < typename OP > <nl> static void TuneBlankOperatorEx ( ) { <nl> - mxnet : : op : : mxnet_op : : tuned_op < OP , DType > : : workload_ = GetBlankWorkloadEx < OP > ( ) ; <nl> + mxnet : : op : : mxnet_op : : tuned_op < OP , DType > : : workload_ [ 0 ] = GetBlankWorkloadEx < OP > ( ) ; <nl> if ( Super : : output_tuning_data_ ) { <nl> std : : cout < < " IMPLEMENT_BLANK_WORKLOAD_FWD ( " <nl> < < Super : : template type_name < OP > ( ) <nl> class UnaryOpTune : public OperatorTune < DType > { <nl> / * ! <nl> * \ brief Determine whether to use OMP based upon both timing and configuration using the <nl> * given ( templated ) operator ' s workload <nl> - * \ tparam OP Operator whose workload to use ( tuned_op : : workload_ ) <nl> + * \ tparam OP Operator whose workload to use ( tuned_op : : workload_ [ 0 ] ) <nl> * \ param N Number of iterations desired <nl> * \ param thread_count Number of OMP threads available to perform the iterations <nl> * \ returns Whether it ' s faster to use OMP for these iterations <nl> class UnaryOpTune : public OperatorTune < DType > { <nl> inline static bool UseOMP ( size_t N , size_t thread_count ) { <nl> return OperatorTune < DType > : : UseOMP ( N , <nl> thread_count , <nl> - static_cast < uint64_t > ( N ) * OP : : workload_ ) ; <nl> + static_cast < uint64_t > ( N ) * OP : : workload_ [ 0 ] ) ; <nl> } <nl> } ; <nl> <nl> class BinaryOpTune : public UnaryOpTune < DType > { <nl> * / <nl> template < typename OP > <nl> static void TuneBinaryOperator ( ) { <nl> - mxnet_op : : tuned_op < OP , DType > : : workload_ = Super : : template GetBinaryWorkload < OP > ( ) ; <nl> + mxnet_op : : tuned_op < OP , DType > : : workload_ [ 0 ] = Super : : template GetBinaryWorkload < OP > ( ) ; <nl> if ( Super : : Super : : output_tuning_data_ ) { <nl> std : : cout < < " IMPLEMENT_BINARY_WORKLOAD_FWD ( " <nl> < < Super : : template type_name < OP > ( ) <nl> class BinaryOpTune : public UnaryOpTune < DType > { <nl> * / <nl> template < typename OP > <nl> static void TuneBinaryBackwardOperator ( ) { <nl> - mxnet : : op : : mxnet_op : : tuned_op < mxnet_op : : backward_grad < OP > , DType > : : workload_ = <nl> - Super : : template GetTertiaryWorkload < mxnet : : op : : mxnet_op : : backward_grad < OP > > ( ) ; <nl> + mxnet : : op : : mxnet_op : : tuned_op < mxnet_op : : backward_grad_tuned < OP > , DType > : : workload_ [ 0 ] = <nl> + Super : : template GetTertiaryWorkload < mxnet : : op : : mxnet_op : : backward_grad_tuned < OP > > ( ) ; <nl> if ( Super : : Super : : output_tuning_data_ ) { <nl> std : : cout < < " IMPLEMENT_BINARY_WORKLOAD_BWD ( " <nl> < < Super : : template type_name < OP > ( ) <nl> mmm a / src / operator / operator_tune . cc <nl> ppp b / src / operator / operator_tune . cc <nl> <nl> - <nl> / * <nl> * Licensed to the Apache Software Foundation ( ASF ) under one <nl> * or more contributor license agreements . See the NOTICE file <nl> <nl> * specific language governing permissions and limitations <nl> * under the License . <nl> * / <nl> + # include < float . h > <nl> # include < atomic > <nl> # include " . / mxnet_op . h " <nl> # include " . / mshadow_op . h " <nl> struct static_init_var { <nl> __macro $ ( __VA_ARGS__ , int32_t ) ; \ <nl> __macro $ ( __VA_ARGS__ , int64_t ) ; <nl> <nl> - <nl> # define IMPLEMENT_WORKLOAD_VALUE_FOR_TYPE ( __op $ , __typ $ ) \ <nl> namespace mxnet_op { \ <nl> - template < > size_t mxnet : : op : : mxnet_op : : tuned_op < __op $ , __typ $ > : : workload_ = INT_MAX / 4 ; \ <nl> - template < > std : : vector < float > mxnet : : op : : mxnet_op : : tuned_op < __op $ , __typ $ > : : workload_ex_ = { } ; \ <nl> + template < > std : : vector < float > mxnet : : op : : mxnet_op : : tuned_op < __op $ , __typ $ > : : workload_ = \ <nl> + { static_cast < float > ( INT_MAX > > 3 ) } ; \ <nl> } / * namespace mxnet_op * / <nl> - <nl> / * ! <nl> * \ brief Implement tuning objects for a forward blank ( no arguments ) kernel operator <nl> * / <nl> # define _IMPLEMENT_BLANK_WORKLOAD_FWD ( __op $ , __typ $ ) \ <nl> IMPLEMENT_WORKLOAD_VALUE_FOR_TYPE ( __op $ , __typ $ ) ; \ <nl> namespace mxnet_op { \ <nl> - template < > bool mxnet : : op : : mxnet_op : : tuned_op < __op $ , __typ $ > : : UseOMP ( \ <nl> + template < > bool : : mxnet : : op : : mxnet_op : : tuned_op < __op $ , __typ $ > : : UseOMP ( \ <nl> size_t N , size_t omp_threads ) { \ <nl> - return mxnet : : op : : UnaryOpTune < __typ $ > : : UseOMP < mxnet_op : : tuned_op < __op $ , __typ $ > > ( \ <nl> + return : : mxnet : : op : : UnaryOpTune < __typ $ > : : UseOMP < mxnet_op : : tuned_op < __op $ , __typ $ > > ( \ <nl> N , omp_threads ) ; \ <nl> } } / * namespace mxnet_op * / \ <nl> template < > bool static_init_var < __op $ , __typ $ > : : init_ = \ <nl> - mxnet : : op : : OperatorTune < __typ $ > : : ScheduleTune < __op $ > ( \ <nl> - mxnet : : op : : UnaryOpTune < __typ $ > : : TuneBlankOperatorEx < __op $ > ) <nl> + : : mxnet : : op : : OperatorTune < __typ $ > : : ScheduleTune < __op $ > ( \ <nl> + : : mxnet : : op : : UnaryOpTune < __typ $ > : : TuneBlankOperatorEx < __op $ > ) <nl> <nl> / * ! <nl> * \ brief Implement tuning objects for a forward unary kernel operator <nl> struct static_init_var { <nl> # define _IMPLEMENT_UNARY_WORKLOAD_FWD ( __op $ , __typ $ ) \ <nl> IMPLEMENT_WORKLOAD_VALUE_FOR_TYPE ( __op $ , __typ $ ) ; \ <nl> namespace mxnet_op { \ <nl> - template < > bool mxnet : : op : : mxnet_op : : tuned_op < __op $ , __typ $ > : : UseOMP ( \ <nl> + template < > bool : : mxnet : : op : : mxnet_op : : tuned_op < __op $ , __typ $ > : : UseOMP ( \ <nl> size_t N , size_t omp_threads ) { \ <nl> - return mxnet : : op : : UnaryOpTune < __typ $ > : : UseOMP < mxnet_op : : tuned_op < __op $ , __typ $ > > ( \ <nl> + return : : mxnet : : op : : UnaryOpTune < __typ $ > : : UseOMP < mxnet_op : : tuned_op < __op $ , __typ $ > > ( \ <nl> N , omp_threads ) ; \ <nl> } } / * namespace mxnet_op * / \ <nl> template < > bool static_init_var < __op $ , __typ $ > : : init_ = \ <nl> - mxnet : : op : : OperatorTune < __typ $ > : : ScheduleTune < __op $ > ( \ <nl> - mxnet : : op : : UnaryOpTune < __typ $ > : : TuneUnaryOperator < __op $ > ) <nl> + : : mxnet : : op : : OperatorTune < __typ $ > : : ScheduleTune < __op $ > ( \ <nl> + : : mxnet : : op : : UnaryOpTune < __typ $ > : : TuneUnaryOperator < __op $ > ) <nl> <nl> / * ! <nl> * \ brief Implement tuning objects for a backward unary kernel operator <nl> * / <nl> # define _IMPLEMENT_UNARY_WORKLOAD_BWD ( __op $ , __typ $ ) \ <nl> - IMPLEMENT_WORKLOAD_VALUE_FOR_TYPE ( mxnet : : op : : mxnet_op : : backward_grad < __op $ > , __typ $ ) ; \ <nl> + IMPLEMENT_WORKLOAD_VALUE_FOR_TYPE ( : : mxnet : : op : : mxnet_op : : backward_grad_tuned < __op $ > , __typ $ ) ; \ <nl> namespace mxnet_op { \ <nl> template < > \ <nl> - bool mxnet : : op : : mxnet_op : : tuned_op < mxnet : : op : : mxnet_op : : backward_grad < __op $ > , __typ $ > : : UseOMP ( \ <nl> - size_t N , size_t omp_threads ) { \ <nl> - return mxnet : : op : : UnaryOpTune < __typ $ > : : UseOMP < mxnet_op : : tuned_op < \ <nl> - mxnet : : op : : mxnet_op : : backward_grad < __op $ > , __typ $ > > ( N , omp_threads ) ; \ <nl> + bool : : mxnet : : op : : mxnet_op : : tuned_op < : : mxnet : : op : : mxnet_op : : backward_grad_tuned < __op $ > , __typ $ > : : \ <nl> + UseOMP ( size_t N , size_t omp_threads ) { \ <nl> + return : : mxnet : : op : : UnaryOpTune < __typ $ > : : UseOMP < mxnet_op : : tuned_op < \ <nl> + : : mxnet : : op : : mxnet_op : : backward_grad_tuned < __op $ > , __typ $ > > ( N , omp_threads ) ; \ <nl> } } / * namespace mxnet_op * / \ <nl> - template < > bool static_init_var < mxnet : : op : : mxnet_op : : backward_grad < __op $ > , __typ $ > : : init_ = \ <nl> - mxnet : : op : : OperatorTune < __typ $ > : : ScheduleTune < __op $ > ( \ <nl> - mxnet : : op : : UnaryOpTune < __typ $ > : : TuneUnaryBackwardOperator < __op $ > ) <nl> + template < > bool static_init_var < : : mxnet : : op : : mxnet_op : : backward_grad_tuned < __op $ > , __typ $ > : : \ <nl> + init_ = : : mxnet : : op : : OperatorTune < __typ $ > : : ScheduleTune < __op $ > ( \ <nl> + : : mxnet : : op : : UnaryOpTune < __typ $ > : : TuneUnaryBackwardOperator < __op $ > ) <nl> <nl> / * ! <nl> * \ brief Implement tuning objects for a forward binary kernel operator <nl> struct static_init_var { <nl> # define _IMPLEMENT_BINARY_WORKLOAD_FWD ( __op $ , __typ $ ) \ <nl> IMPLEMENT_WORKLOAD_VALUE_FOR_TYPE ( __op $ , __typ $ ) ; \ <nl> namespace mxnet_op { \ <nl> - template < > bool mxnet : : op : : mxnet_op : : tuned_op < __op $ , __typ $ > : : UseOMP ( \ <nl> + template < > bool : : mxnet : : op : : mxnet_op : : tuned_op < __op $ , __typ $ > : : UseOMP ( \ <nl> size_t N , size_t omp_threads ) { \ <nl> - return mxnet : : op : : BinaryOpTune < __typ $ > : : UseOMP < mxnet_op : : tuned_op < __op $ , __typ $ > > ( \ <nl> + return : : mxnet : : op : : BinaryOpTune < __typ $ > : : UseOMP < mxnet_op : : tuned_op < __op $ , __typ $ > > ( \ <nl> N , omp_threads ) ; \ <nl> } } / * namespace mxnet_op * / \ <nl> template < > bool static_init_var < __op $ , __typ $ > : : init_ = \ <nl> - mxnet : : op : : OperatorTune < __typ $ > : : ScheduleTune < __op $ > ( \ <nl> - mxnet : : op : : BinaryOpTune < __typ $ > : : TuneBinaryOperator < __op $ > ) <nl> + : : mxnet : : op : : OperatorTune < __typ $ > : : ScheduleTune < __op $ > ( \ <nl> + : : mxnet : : op : : BinaryOpTune < __typ $ > : : TuneBinaryOperator < __op $ > ) <nl> <nl> / * ! <nl> * \ brief Implement tuning objects for a backward binary kernel operator <nl> * / <nl> # define _IMPLEMENT_BINARY_WORKLOAD_BWD ( __op $ , __typ $ ) \ <nl> - IMPLEMENT_WORKLOAD_VALUE_FOR_TYPE ( mxnet : : op : : mxnet_op : : backward_grad < __op $ > , __typ $ ) ; \ <nl> + IMPLEMENT_WORKLOAD_VALUE_FOR_TYPE ( : : mxnet : : op : : mxnet_op : : backward_grad_tuned < __op $ > , __typ $ ) ; \ <nl> namespace mxnet_op { \ <nl> template < > \ <nl> - bool mxnet : : op : : mxnet_op : : tuned_op < mxnet : : op : : mxnet_op : : backward_grad < __op $ > , __typ $ > : : UseOMP ( \ <nl> - size_t N , size_t omp_threads ) { \ <nl> - return mxnet : : op : : BinaryOpTune < __typ $ > : : UseOMP < mxnet_op : : tuned_op < \ <nl> - mxnet : : op : : mxnet_op : : backward_grad < __op $ > , __typ $ > > ( N , omp_threads ) ; \ <nl> + bool : : mxnet : : op : : mxnet_op : : tuned_op < \ <nl> + : : mxnet : : op : : mxnet_op : : backward_grad_tuned < __op $ > , __typ $ > : : \ <nl> + UseOMP ( size_t N , size_t omp_threads ) { \ <nl> + return : : mxnet : : op : : BinaryOpTune < __typ $ > : : UseOMP < mxnet_op : : tuned_op < \ <nl> + : : mxnet : : op : : mxnet_op : : backward_grad_tuned < __op $ > , __typ $ > > ( N , omp_threads ) ; \ <nl> } } / * namespace mxnet_op * / \ <nl> - template < > bool static_init_var < mxnet : : op : : mxnet_op : : backward_grad < __op $ > , __typ $ > : : init_ = \ <nl> - mxnet : : op : : OperatorTune < __typ $ > : : ScheduleTune < __op $ > ( \ <nl> - mxnet : : op : : BinaryOpTune < __typ $ > : : TuneBinaryBackwardOperator < __op $ > ) <nl> + template < > bool static_init_var < : : mxnet : : op : : mxnet_op : : backward_grad_tuned < __op $ > , \ <nl> + __typ $ > : : init_ = \ <nl> + : : mxnet : : op : : OperatorTune < __typ $ > : : ScheduleTune < __op $ > ( \ <nl> + : : mxnet : : op : : BinaryOpTune < __typ $ > : : TuneBinaryBackwardOperator < __op $ > ) <nl> <nl> / * ! <nl> * \ brief Implement tuning objects for a custom forward kernel operator <nl> struct static_init_var { <nl> # define _IMPLEMENT_CUSTOM_WORKLOAD_FWD ( __op $ , __typ $ ) \ <nl> IMPLEMENT_WORKLOAD_VALUE_FOR_TYPE ( __op $ < __typ $ > , __typ $ ) ; \ <nl> template < > bool static_init_var < __op $ < __typ $ > , __typ $ > : : init_ = \ <nl> - mxnet : : op : : OperatorTune < __typ $ > : : ScheduleTune < __op $ < __typ $ > > ( \ <nl> + : : mxnet : : op : : OperatorTune < __typ $ > : : ScheduleTune < __op $ < __typ $ > > ( \ <nl> __op $ < __typ $ > : : Tune ) <nl> <nl> / * ! <nl> struct static_init_var { <nl> * integer value <nl> * / <nl> OperatorTuneBase : : duration_t OperatorTuneBase : : omp_overhead_ns_ = 5000 ; <nl> - IMPLEMENT_UNARY_WORKLOAD_FWD ( mshadow : : op : : identity ) ; / / NOLINT ( ) <nl> IMPLEMENT_UNARY_WORKLOAD_FWD ( mxnet : : op : : mshadow_op : : identity ) ; / / NOLINT ( ) <nl> IMPLEMENT_UNARY_WORKLOAD_BWD ( mxnet : : op : : mshadow_op : : identity_grad ) ; / / NOLINT ( ) <nl> IMPLEMENT_UNARY_WORKLOAD_FWD ( mxnet : : op : : mshadow_op : : negation ) ; / / NOLINT ( ) <nl> IMPLEMENT_UNARY_WORKLOAD_FWD ( mxnet : : op : : mshadow_op : : degrees ) ; / / NOLINT ( ) <nl> IMPLEMENT_UNARY_WORKLOAD_BWD ( mxnet : : op : : mshadow_op : : degrees_grad ) ; / / NOLINT ( ) <nl> IMPLEMENT_UNARY_WORKLOAD_FWD ( mxnet : : op : : mshadow_op : : radians ) ; / / NOLINT ( ) <nl> IMPLEMENT_UNARY_WORKLOAD_BWD ( mxnet : : op : : mshadow_op : : radians_grad ) ; / / NOLINT ( ) <nl> - IMPLEMENT_BINARY_WORKLOAD_FWD ( mshadow : : op : : plus ) ; / / NOLINT ( ) <nl> - IMPLEMENT_BINARY_WORKLOAD_FWD ( mshadow : : op : : minus ) ; / / NOLINT ( ) <nl> - IMPLEMENT_BINARY_WORKLOAD_FWD ( mshadow : : op : : mul ) ; / / NOLINT ( ) <nl> - IMPLEMENT_BINARY_WORKLOAD_FWD ( mshadow : : op : : div ) ; / / NOLINT ( ) <nl> - IMPLEMENT_BINARY_WORKLOAD_FWD ( mshadow : : op : : right ) ; / / NOLINT ( ) <nl> + IMPLEMENT_BINARY_WORKLOAD_FWD ( mxnet : : op : : mshadow_op : : clip ) ; / / NOLINT ( ) <nl> + IMPLEMENT_BINARY_WORKLOAD_BWD ( mxnet : : op : : mshadow_op : : clip ) ; / / NOLINT ( ) <nl> + IMPLEMENT_BINARY_WORKLOAD_FWD ( mxnet : : op : : mshadow_op : : plus ) ; / / NOLINT ( ) <nl> + IMPLEMENT_BINARY_WORKLOAD_FWD ( mxnet : : op : : mshadow_op : : minus ) ; / / NOLINT ( ) <nl> + IMPLEMENT_BINARY_WORKLOAD_FWD ( mxnet : : op : : mshadow_op : : mul ) ; / / NOLINT ( ) <nl> + IMPLEMENT_BINARY_WORKLOAD_FWD ( mxnet : : op : : mshadow_op : : div ) ; / / NOLINT ( ) <nl> IMPLEMENT_BINARY_WORKLOAD_FWD ( mxnet : : op : : mshadow_op : : rminus ) ; / / NOLINT ( ) <nl> + IMPLEMENT_BINARY_WORKLOAD_BWD ( mxnet : : op : : mshadow_op : : rdiv ) ; / / NOLINT ( ) <nl> + IMPLEMENT_BINARY_WORKLOAD_BWD ( mxnet : : op : : mshadow_op : : plus ) ; / / NOLINT ( ) <nl> + IMPLEMENT_BINARY_WORKLOAD_BWD ( mxnet : : op : : mshadow_op : : minus ) ; / / NOLINT ( ) <nl> + IMPLEMENT_BINARY_WORKLOAD_BWD ( mxnet : : op : : mshadow_op : : mul ) ; / / NOLINT ( ) <nl> + IMPLEMENT_BINARY_WORKLOAD_BWD ( mxnet : : op : : mshadow_op : : div ) ; / / NOLINT ( ) <nl> + IMPLEMENT_BINARY_WORKLOAD_BWD ( mxnet : : op : : mshadow_op : : rminus ) ; / / NOLINT ( ) <nl> IMPLEMENT_BINARY_WORKLOAD_FWD ( mxnet : : op : : mshadow_op : : rdiv ) ; / / NOLINT ( ) <nl> IMPLEMENT_BINARY_WORKLOAD_FWD ( mxnet : : op : : mshadow_op : : div_grad ) ; / / NOLINT ( ) <nl> IMPLEMENT_BINARY_WORKLOAD_BWD ( mxnet : : op : : mshadow_op : : div_grad ) ; / / NOLINT ( ) <nl> mmm a / src / operator / operator_tune . h <nl> ppp b / src / operator / operator_tune . h <nl> <nl> # include < vector > <nl> # include < set > <nl> # include < atomic > <nl> + # include < string > <nl> + <nl> + / / # define MXNET_DEBUG_TUNING_LAUNCH <nl> + <nl> + # ifdef MXNET_DEBUG_TUNING_LAUNCH <nl> + # include < cxxabi . h > <nl> + template < typename T > inline std : : string type_name ( ) { <nl> + const char * name = typeid ( T ) . name ( ) ; <nl> + int status = - 4 ; / / some arbitrary value to eliminate the compiler warning <nl> + std : : unique_ptr < char , void ( * ) ( void * ) > res { <nl> + abi : : __cxa_demangle ( name , nullptr , nullptr , & status ) , <nl> + & std : : free <nl> + } ; <nl> + if ( ! status ) { <nl> + return res . get ( ) ; <nl> + } <nl> + return std : : move ( name ) ; <nl> + } <nl> + # define MXNET_DEBUG_PRINT_UNIQUE_OP ( __label $ , __op $ ) \ <nl> + { \ <nl> + static std : : mutex cs ; \ <nl> + static std : : unordered_set < std : : string > ops ; \ <nl> + const std : : string name = type_name < __op $ > ( ) ; \ <nl> + if ( ops . emplace ( name ) . second ) { \ <nl> + std : : cout < < ( __label $ ) < < " : " < < name < < std : : endl < < std : : flush ; \ <nl> + } \ <nl> + } <nl> + # else <nl> + # define MXNET_DEBUG_PRINT_UNIQUE_OP ( __label $ , __op $ ) / * * / <nl> + # endif <nl> <nl> namespace mxnet { <nl> namespace op { <nl> namespace mxnet_op { <nl> * / <nl> template < typename Operation , typename DType > <nl> struct tuned_op : public Operation { <nl> - / * ! \ brief nanoseconds to perform WORKLOAD_COUNT operations <nl> - * \ note It is conceivable that a vector of values could be used for more complex tuning , <nl> - * but the need hasn ' t yet arisen <nl> + / * ! \ brief Runtime workload calculation values . Generally , nanoseconds to perform WORKLOAD_COUNT <nl> + * operations ( for unary and binary ops ) , although they can be anything if the UseOMP ( ) <nl> + * function is written elsewhere for that op ( other than in operator_tune - inl . h ) <nl> * \ remarks This variable generally needs to be implemented somewhere . Currently this is mostly <nl> * done via macros in operator_tune . cc . If you get undefined reference errors when <nl> * linking , then try to use one of the macros in that file to instantiate the required <nl> * data / functions <nl> * / <nl> - static size_t workload_ ; <nl> - <nl> - / * ! <nl> - * \ brief Extra workload - calculating information ( ie times for sub - portions of the calculation ) <nl> - * / <nl> - static std : : vector < float > workload_ex_ ; <nl> + static std : : vector < float > workload_ ; <nl> <nl> / * ! <nl> * \ brief Calls parent class ( Operation ) ' s UseOMP <nl> struct tuned_op : public Operation { <nl> * / <nl> static bool UseOMP ( size_t N , size_t thread_count ) ; <nl> } ; <nl> - } / / namespace mxnet_op <nl> <nl> / * ! <nl> * \ brief Calculate workload for a given lambda function <nl> inline int64_t get_workload ( Function function ) { <nl> return * + + durations . begin ( ) ; / / return median value <nl> } <nl> <nl> - / * ! <nl> - * \ brief Declare a template specialization for the Kernel : : Launch call for the given OP <nl> - * wrapped with mxnet_op : : op_with_req , using the given OpReqType as the ' req ' <nl> - * template parameter for ' op_with_req ' . This is useful for the standard mshadow_op <nl> - * operators which need to be wrapped with op_with_req in order to be used with the <nl> - * Kernel : : Launch command . <nl> - * <nl> - * \ note Expects to be used within the mxnet : : op namespace <nl> - * <nl> - * For example : <nl> - * <nl> - * namespace mxnet_op { <nl> - * template < > <nl> - * template < typename . . . Args > <nl> - * inline void Kernel < typename mxnet_op : : op_with_req < mshadow : : op : : identity , kNullOp > , cpu > <nl> - * : : Launch ( mshadow : : Stream < cpu > * s , const int N , Args . . . args ) { <nl> - * : : mxnet : : op : : mxnet_op : : Kernel < typename mxnet_op : : op_with_req < mshadow : : op : : identity , kNullOp > , <nl> - * cpu > : : LaunchMShadowOpEx ( s , N , args . . . ) ; <nl> - * } <nl> - * } <nl> - * <nl> - * / <nl> - # define MXNET_TUNABLE_MSHADOW_OP_WITH_REQ ( __op $ , __req $ ) \ <nl> - namespace mxnet_op { \ <nl> - template < > template < typename . . . Args > \ <nl> - inline void Kernel < typename mxnet_op : : op_with_req < __op $ , __req $ > , : : mshadow : : cpu > : : \ <nl> - Launch ( mshadow : : Stream < : : mshadow : : cpu > * s , const int N , Args . . . args ) { \ <nl> - / * Launch via LaunchMShadowOpEx ( ) * / \ <nl> - KernelWrapper < typename mxnet_op : : op_with_req < __op $ , __req $ > , : : mshadow : : cpu > : : \ <nl> - LaunchMShadowOpEx ( s , N , args . . . ) ; \ <nl> - } \ <nl> - } / * namespace mxnet_op * / <nl> - <nl> - / * ! <nl> - * \ brief Declare template specializations for the Kernel : : Launch call for the given OP <nl> - * wrapped with mxnet_op : : op_with_req , using the all supported OpReqType as the ' req ' <nl> - * template parameter for ' op_with_req ' . This is useful for the standard mshadow_op <nl> - * operators which need to be wrapped with op_with_req in order to be used with the <nl> - * Kernel : : Launch command . <nl> - * \ note Expects to be used within the mxnet : : op namespace <nl> - * / <nl> - # define MXNET_TUNABLE_MSHADOW_OP ( __op $ ) \ <nl> - MXNET_TUNABLE_MSHADOW_OP_WITH_REQ ( __op $ , kNullOp ) ; \ <nl> - MXNET_TUNABLE_MSHADOW_OP_WITH_REQ ( __op $ , kWriteTo ) ; \ <nl> - MXNET_TUNABLE_MSHADOW_OP_WITH_REQ ( __op $ , kWriteInplace ) ; \ <nl> - MXNET_TUNABLE_MSHADOW_OP_WITH_REQ ( __op $ , kAddTo ) ; <nl> - <nl> - # define MXNET_TUNABLE_MSHADOW_OP_BACKWARD ( __op $ ) \ <nl> - MXNET_TUNABLE_MSHADOW_OP ( mxnet : : op : : mxnet_op : : backward_grad < __op $ > ) <nl> - <nl> - # define MXNET_TUNABLE_MSHADOW_OP_FWD_AND_BWD ( __op $ ) \ <nl> - MXNET_TUNABLE_MSHADOW_OP ( __op $ ) \ <nl> - MXNET_TUNABLE_MSHADOW_OP_BACKWARD ( __op $ ) <nl> - <nl> - / * ! <nl> - * \ brief mxnet : : op : : mxnet_op format ops ( work directly with Kernel < > : : Launch ( ) <nl> - * Used from within mxnet : : op : : mxnet_op namespace <nl> - * / <nl> - # define _MXNET_TUNABLE_MXNET_OP_FWD ( __op $ ) \ <nl> - template < > template < typename . . . Args > inline void Kernel < __op $ , : : mshadow : : cpu > : : Launch ( \ <nl> - mshadow : : Stream < : : mshadow : : cpu > * s , const int N , Args . . . args ) { \ <nl> - / * Launch via LaunchMXNetOpEx ( ) * / \ <nl> - KernelWrapper < __op $ , : : mshadow : : cpu > : : LaunchMXNetOpEx ( s , N , args . . . ) ; \ <nl> - } <nl> - <nl> - / * ! <nl> - * \ brief mxnet : : op : : mxnet_op format ops ( work directly with Kernel < > : : Launch ( ) <nl> - * Used from within mxnet : : op <nl> - * / <nl> - # define MXNET_TUNABLE_MXNET_OP_FWD ( __op $ ) \ <nl> - namespace mxnet_op { _MXNET_TUNABLE_MXNET_OP_FWD ( __op $ ) } / * namespace mxnet_op * / <nl> + struct tunable { } ; <nl> <nl> + } / / namespace mxnet_op <nl> } / / namespace op <nl> } / / namespace mxnet <nl> <nl> mmm a / src / operator / regression_output . cc <nl> ppp b / src / operator / regression_output . cc <nl> Operator * CreateRegressionOutputOp < cpu > ( reg_enum : : RegressionOutputType type , <nl> RegressionOutputParam param ) { <nl> switch ( type ) { <nl> case reg_enum : : kLinear : <nl> - return new RegressionOutputOp < cpu , mshadow : : op : : identity , mshadow : : op : : minus > ( param ) ; <nl> + return new RegressionOutputOp < cpu , op : : mshadow_op : : identity , op : : mshadow_op : : minus > ( param ) ; <nl> case reg_enum : : kLogistic : <nl> - return new RegressionOutputOp < cpu , mshadow_op : : sigmoid , mshadow : : op : : minus > ( param ) ; <nl> + return new RegressionOutputOp < cpu , mshadow_op : : sigmoid , op : : mshadow_op : : minus > ( param ) ; <nl> case reg_enum : : kMAE : <nl> - return new RegressionOutputOp < cpu , mshadow : : op : : identity , mshadow_op : : minus_sign > ( param ) ; <nl> + return new RegressionOutputOp < cpu , op : : mshadow_op : : identity , mshadow_op : : minus_sign > ( param ) ; <nl> default : <nl> LOG ( FATAL ) < < " unknown activation type " < < type ; <nl> } <nl> mmm a / src / operator / regression_output . cu <nl> ppp b / src / operator / regression_output . cu <nl> Operator * CreateRegressionOutputOp < gpu > ( reg_enum : : RegressionOutputType type , <nl> RegressionOutputParam param ) { <nl> switch ( type ) { <nl> case reg_enum : : kLinear : <nl> - return new RegressionOutputOp < gpu , mshadow : : op : : identity , mshadow : : op : : minus > ( param ) ; <nl> + return new RegressionOutputOp < gpu , op : : mshadow_op : : identity , op : : mshadow_op : : minus > ( param ) ; <nl> case reg_enum : : kLogistic : <nl> - return new RegressionOutputOp < gpu , mshadow_op : : sigmoid , mshadow : : op : : minus > ( param ) ; <nl> + return new RegressionOutputOp < gpu , mshadow_op : : sigmoid , op : : mshadow_op : : minus > ( param ) ; <nl> case reg_enum : : kMAE : <nl> - return new RegressionOutputOp < gpu , mshadow : : op : : identity , mshadow_op : : minus_sign > ( param ) ; <nl> + return new RegressionOutputOp < gpu , op : : mshadow_op : : identity , mshadow_op : : minus_sign > ( param ) ; <nl> default : <nl> LOG ( FATAL ) < < " unknown activation type " < < type ; <nl> } <nl> mmm a / src / operator / tensor / broadcast_reduce_op . h <nl> ppp b / src / operator / tensor / broadcast_reduce_op . h <nl> void ReduceAxesComputeImpl ( const nnvm : : NodeAttrs & attrs , <nl> s , out_data , req [ 0 ] , in_data ) ; <nl> Tensor < xpu , 1 , char > workspace = <nl> ctx . requested [ 0 ] . get_space_typed < xpu , 1 , char > ( Shape1 ( workspace_size ) , s ) ; <nl> - broadcast : : Reduce < reducer , NDim , DType , mshadow : : op : : identity > ( <nl> + broadcast : : Reduce < reducer , NDim , DType , op : : mshadow_op : : identity > ( <nl> s , out_data , req [ 0 ] , workspace , in_data ) ; <nl> if ( normalize ) { <nl> auto out = out_data . FlatTo2D < xpu , DType > ( s ) ; <nl> void SumCsrImpl ( const nnvm : : NodeAttrs & attrs , mshadow : : Stream < xpu > * s , const OpC <nl> seg_len ) ; <nl> if ( normalize ) { <nl> mxnet_op : : Kernel < <nl> - mxnet_op : : op_with_req < mshadow : : op : : div , req_type > , <nl> + mxnet_op : : op_with_req < op : : mshadow_op : : div , req_type > , <nl> xpu > : : Launch ( s , out_data_size , output - > data ( ) . dptr < DType > ( ) , <nl> output - > data ( ) . dptr < DType > ( ) , DType ( num_rows ) ) ; <nl> } <nl> void SumCsrImpl ( const nnvm : : NodeAttrs & attrs , mshadow : : Stream < xpu > * s , const OpC <nl> in_data ) ; <nl> if ( normalize ) { <nl> mxnet_op : : Kernel < <nl> - mxnet_op : : op_with_req < mshadow : : op : : div , req_type > , <nl> + mxnet_op : : op_with_req < op : : mshadow_op : : div , req_type > , <nl> xpu > : : Launch ( s , out_data_size , output - > data ( ) . dptr < DType > ( ) , <nl> output - > data ( ) . dptr < DType > ( ) , DType ( num_cols ) ) ; <nl> } <nl> mmm a / src / operator / tensor / elemwise_binary_broadcast_op . h <nl> ppp b / src / operator / tensor / elemwise_binary_broadcast_op . h <nl> inline int BinaryBroadcastShapeCompact ( const TShape & lshape , const TShape & rshap <nl> namespace mxnet_op { <nl> template < int ndim , typename DType , typename OP > <nl> struct binary_broadcast_kernel { <nl> + / * ! \ brief Map function for binary_broadcast_kernel * / <nl> MSHADOW_XINLINE static void Map ( int base , int length , OpReqType req , <nl> - const Shape < ndim > & lstride , const Shape < ndim > & rstride , <nl> - const Shape < ndim > & oshape , DType * lhs , DType * rhs , <nl> - DType * out , int lsize , int rsize ) { <nl> - Shape < ndim > coord = unravel ( base , oshape ) ; <nl> - index_t lidx = dot ( coord , lstride ) ; <nl> - index_t ridx = dot ( coord , rstride ) ; <nl> - KERNEL_ASSIGN ( out [ base ] , req , OP : : Map ( lhs [ lidx ] , rhs [ ridx ] ) ) ; <nl> - / / starts from 1 to avoid extra inc at end of loop <nl> - for ( int i = 1 ; i < length ; + + i ) { <nl> - inc ( & coord , oshape , & lidx , lstride , & ridx , rstride ) ; <nl> - KERNEL_ASSIGN ( out [ base + i ] , req , OP : : Map ( lhs [ lidx ] , rhs [ ridx ] ) ) ; <nl> - } <nl> + const Shape < ndim > & lstride , const Shape < ndim > & rstride , <nl> + const Shape < ndim > & oshape , DType * lhs , DType * rhs , <nl> + DType * out ) { <nl> + Shape < ndim > coord = unravel ( base , oshape ) ; <nl> + auto lidx = static_cast < index_t > ( dot ( coord , lstride ) ) ; <nl> + auto ridx = static_cast < index_t > ( dot ( coord , rstride ) ) ; <nl> + KERNEL_ASSIGN ( out [ base ] , req , OP : : Map ( lhs [ lidx ] , rhs [ ridx ] ) ) ; <nl> + / / starts from 1 to avoid extra inc at end of loop <nl> + for ( int i = 1 ; i < length ; + + i ) { <nl> + inc ( & coord , oshape , & lidx , lstride , & ridx , rstride ) ; <nl> + / / When tuning , don ' t actually run the op , since it ' s not going to be tuned against <nl> + / / the actual op we ' ll eventually be using <nl> + KERNEL_ASSIGN ( out [ base + i ] , req , OP : : Map ( lhs [ lidx ] , rhs [ ridx ] ) ) ; <nl> } <nl> + } <nl> } ; <nl> - <nl> } / / namespace mxnet_op <nl> <nl> template < typename xpu , typename OP > <nl> void BinaryBroadcastCompute ( const nnvm : : NodeAttrs & attrs , <nl> const std : : vector < TBlob > & inputs , <nl> const std : : vector < OpReqType > & req , <nl> const std : : vector < TBlob > & outputs ) { <nl> - using namespace mxnet_op ; <nl> TShape new_lshape , new_rshape , new_oshape ; <nl> int ndim = BinaryBroadcastShapeCompact ( inputs [ 0 ] . shape_ , inputs [ 1 ] . shape_ , outputs [ 0 ] . shape_ , <nl> & new_lshape , & new_rshape , & new_oshape ) ; <nl> if ( ! ndim ) { <nl> ElemwiseBinaryOp : : Compute < xpu , OP > ( attrs , ctx , inputs , req , outputs ) ; <nl> } else { <nl> - mshadow : : Stream < xpu > * s = ctx . get_stream < xpu > ( ) ; <nl> - MSHADOW_TYPE_SWITCH ( outputs [ 0 ] . type_flag_ , DType , { <nl> - BROADCAST_NDIM_SWITCH ( ndim , NDim , { <nl> - Shape < NDim > oshape = new_oshape . get < NDim > ( ) ; <nl> - Shape < NDim > lstride = calc_stride ( new_lshape . get < NDim > ( ) ) ; <nl> - Shape < NDim > rstride = calc_stride ( new_rshape . get < NDim > ( ) ) ; <nl> - Kernel < binary_broadcast_kernel < NDim , DType , OP > , xpu > : : LaunchEx ( <nl> - s , new_oshape . Size ( ) , req [ 0 ] , lstride , rstride , oshape , <nl> - inputs [ 0 ] . dptr < DType > ( ) , inputs [ 1 ] . dptr < DType > ( ) , outputs [ 0 ] . dptr < DType > ( ) , <nl> - inputs [ 0 ] . Size ( ) , inputs [ 1 ] . Size ( ) ) ; <nl> + if ( req [ 0 ] ! = kNullOp ) { <nl> + mshadow : : Stream < xpu > * s = ctx . get_stream < xpu > ( ) ; <nl> + MSHADOW_TYPE_SWITCH ( outputs [ 0 ] . type_flag_ , DType , { <nl> + BROADCAST_NDIM_SWITCH ( ndim , NDim , { <nl> + mshadow : : Shape < NDim > oshape = new_oshape . get < NDim > ( ) ; <nl> + mshadow : : Shape < NDim > lstride = mxnet_op : : calc_stride ( new_lshape . get < NDim > ( ) ) ; <nl> + mshadow : : Shape < NDim > rstride = mxnet_op : : calc_stride ( new_rshape . get < NDim > ( ) ) ; <nl> + mxnet_op : : Kernel < mxnet_op : : binary_broadcast_kernel < NDim , DType , OP > , xpu > : : <nl> + template LaunchEx ( s , new_oshape . Size ( ) , req [ 0 ] , lstride , rstride , oshape , <nl> + inputs [ 0 ] . dptr < DType > ( ) , inputs [ 1 ] . dptr < DType > ( ) , outputs [ 0 ] . dptr < DType > ( ) ) ; <nl> + } ) ; <nl> } ) ; <nl> - } ) ; <nl> + } <nl> } <nl> } <nl> <nl> inline void BinaryBroadcastBackwardUseInImpl ( const OpContext & ctx , <nl> size_t workspace_size = std : : max ( workspace_size_l , workspace_size_r ) ; <nl> Tensor < xpu , 1 , char > workspace = <nl> ctx . requested [ 0 ] . get_space_typed < xpu , 1 , char > ( Shape1 ( workspace_size ) , s ) ; <nl> - Reduce < red : : sum , ndim , DType , mshadow : : op : : mul , LOP > ( s , lgrad , req [ 0 ] , workspace , <nl> + Reduce < red : : sum , ndim , DType , op : : mshadow_op : : mul , LOP > ( s , lgrad , req [ 0 ] , workspace , <nl> ograd , lhs , rhs ) ; <nl> - Reduce < red : : sum , ndim , DType , mshadow : : op : : mul , ROP > ( s , rgrad , req [ 1 ] , workspace , <nl> + Reduce < red : : sum , ndim , DType , op : : mshadow_op : : mul , ROP > ( s , rgrad , req [ 1 ] , workspace , <nl> ograd , lhs , rhs ) ; <nl> } <nl> <nl> mmm a / src / operator / tensor / elemwise_binary_broadcast_op_basic . cc <nl> ppp b / src / operator / tensor / elemwise_binary_broadcast_op_basic . cc <nl> Example : : <nl> [ 2 . , 2 . , 2 . ] ] <nl> <nl> ) code " ADD_FILELINE ) <nl> - . set_attr < FCompute > ( " FCompute < cpu > " , BinaryBroadcastCompute < cpu , mshadow : : op : : plus > ) <nl> + . set_attr < FCompute > ( " FCompute < cpu > " , BinaryBroadcastCompute < cpu , op : : mshadow_op : : plus > ) <nl> . set_attr < nnvm : : FGradient > ( " FGradient " , ElemwiseGradUseNone { " _backward_broadcast_add " } ) ; <nl> <nl> NNVM_REGISTER_OP ( _backward_broadcast_add ) <nl> Example : : <nl> [ 0 . , 0 . , 0 . ] ] <nl> <nl> ) code " ADD_FILELINE ) <nl> - . set_attr < FCompute > ( " FCompute < cpu > " , BinaryBroadcastCompute < cpu , mshadow : : op : : minus > ) <nl> + . set_attr < FCompute > ( " FCompute < cpu > " , BinaryBroadcastCompute < cpu , op : : mshadow_op : : minus > ) <nl> . set_attr < nnvm : : FGradient > ( " FGradient " , ElemwiseGradUseNone { " _backward_broadcast_sub " } ) ; <nl> <nl> NNVM_REGISTER_OP ( _backward_broadcast_sub ) <nl> Example : : <nl> [ 1 . , 1 . , 1 . ] ] <nl> <nl> ) code " ADD_FILELINE ) <nl> - . set_attr < FCompute > ( " FCompute < cpu > " , BinaryBroadcastCompute < cpu , mshadow : : op : : mul > ) <nl> + . set_attr < FCompute > ( " FCompute < cpu > " , BinaryBroadcastCompute < cpu , op : : mshadow_op : : mul > ) <nl> . set_attr < nnvm : : FGradient > ( " FGradient " , ElemwiseGradUseIn { " _backward_broadcast_mul " } ) ; <nl> <nl> <nl> Example : : <nl> [ 2 . , 2 . , 2 . ] ] <nl> <nl> ) code " ADD_FILELINE ) <nl> - . set_attr < FCompute > ( " FCompute < cpu > " , BinaryBroadcastCompute < cpu , mshadow : : op : : div > ) <nl> + . set_attr < FCompute > ( " FCompute < cpu > " , BinaryBroadcastCompute < cpu , op : : mshadow_op : : div > ) <nl> . set_attr < nnvm : : FGradient > ( " FGradient " , ElemwiseGradUseIn { " _backward_broadcast_div " } ) ; <nl> <nl> NNVM_REGISTER_OP ( _backward_broadcast_div ) <nl> mmm a / src / operator / tensor / elemwise_binary_broadcast_op_basic . cu <nl> ppp b / src / operator / tensor / elemwise_binary_broadcast_op_basic . cu <nl> <nl> namespace mxnet { <nl> namespace op { <nl> NNVM_REGISTER_OP ( broadcast_add ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , BinaryBroadcastCompute < gpu , mshadow : : op : : plus > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , BinaryBroadcastCompute < gpu , op : : mshadow_op : : plus > ) ; <nl> <nl> NNVM_REGISTER_OP ( _backward_broadcast_add ) <nl> . set_attr < FCompute > ( " FCompute < gpu > " , BinaryBroadcastBackwardUseNone < gpu , mshadow_op : : identity , <nl> mshadow_op : : identity > ) ; <nl> <nl> NNVM_REGISTER_OP ( broadcast_sub ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , BinaryBroadcastCompute < gpu , mshadow : : op : : minus > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , BinaryBroadcastCompute < gpu , op : : mshadow_op : : minus > ) ; <nl> <nl> NNVM_REGISTER_OP ( _backward_broadcast_sub ) <nl> . set_attr < FCompute > ( " FCompute < gpu > " , BinaryBroadcastBackwardUseNone < gpu , mshadow_op : : identity , <nl> mshadow_op : : negation > ) ; <nl> <nl> NNVM_REGISTER_OP ( broadcast_mul ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , BinaryBroadcastCompute < gpu , mshadow : : op : : mul > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , BinaryBroadcastCompute < gpu , op : : mshadow_op : : mul > ) ; <nl> <nl> NNVM_REGISTER_OP ( _backward_broadcast_mul ) <nl> . set_attr < FCompute > ( " FCompute < gpu > " , BinaryBroadcastBackwardUseIn < gpu , mshadow_op : : right , <nl> mshadow_op : : left > ) ; <nl> <nl> NNVM_REGISTER_OP ( broadcast_div ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , BinaryBroadcastCompute < gpu , mshadow : : op : : div > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , BinaryBroadcastCompute < gpu , op : : mshadow_op : : div > ) ; <nl> <nl> NNVM_REGISTER_OP ( _backward_broadcast_div ) <nl> . set_attr < FCompute > ( " FCompute < gpu > " , BinaryBroadcastBackwardUseIn < gpu , mshadow_op : : div_grad , <nl> mmm a / src / operator / tensor / elemwise_binary_op - inl . h <nl> ppp b / src / operator / tensor / elemwise_binary_op - inl . h <nl> void ElemwiseBinaryOp : : RspRspOp ( mshadow : : Stream < cpu > * s , <nl> Tensor < cpu , 1 , DType > rvalue = ! rhs_is_dense ? data_r [ iter_r + + ] : data_r [ idx_r ] ; <nl> DCHECK_EQ ( lvalue . shape_ . Size ( ) , rvalue . shape_ . Size ( ) ) ; <nl> MXNET_ASSIGN_REQ_SWITCH ( req , Req , { <nl> - SerialLaunchCPU < mxnet_op : : op_with_req < OP , Req > > ( <nl> + mxnet_op : : Kernel < mxnet_op : : op_with_req < OP , Req > , cpu > : : Launch ( <nl> s , lvalue . shape_ . Size ( ) , out [ iter_out ] . dptr_ , lvalue . dptr_ , rvalue . dptr_ ) ; <nl> } ) ; <nl> num_common_rows + + ; <nl> void ElemwiseBinaryOp : : RspRspOp ( mshadow : : Stream < cpu > * s , <nl> } <nl> Tensor < cpu , 1 , DType > lvalue = ! lhs_is_dense ? data_l [ iter_l + + ] : data_l [ idx_l ] ; <nl> MXNET_ASSIGN_REQ_SWITCH ( req , Req , { <nl> - SerialLaunchCPU < MissingRValueOp < OP , Req > > ( <nl> + mxnet_op : : Kernel < MissingRValueOp < OP , Req > , cpu > : : Launch ( <nl> s , lvalue . shape_ . Size ( ) , out [ iter_out ] . dptr_ , lvalue . dptr_ ) ; <nl> } ) ; <nl> } else { <nl> void ElemwiseBinaryOp : : RspRspOp ( mshadow : : Stream < cpu > * s , <nl> } <nl> Tensor < cpu , 1 , DType > rvalue = ! rhs_is_dense ? data_r [ iter_r + + ] : data_r [ idx_r ] ; <nl> MXNET_ASSIGN_REQ_SWITCH ( req , Req , { <nl> - SerialLaunchCPU < MissingLValueOp < OP , Req > > ( <nl> + mxnet_op : : Kernel < MissingLValueOp < OP , Req > , cpu > : : Launch ( <nl> s , rvalue . shape_ . Size ( ) , out [ iter_out ] . dptr_ , rvalue . dptr_ ) ; <nl> } ) ; <nl> } <nl> void ElemwiseBinaryOp : : RspRspOp ( mshadow : : Stream < cpu > * s , <nl> } <nl> Tensor < cpu , 1 , DType > lvalue = data_l [ iter_l + + ] ; <nl> MXNET_ASSIGN_REQ_SWITCH ( req , Req , { <nl> - SerialLaunchCPU < MissingRValueOp < OP , Req > > ( <nl> + mxnet_op : : Kernel < MissingRValueOp < OP , Req > , cpu > : : Launch ( <nl> s , lvalue . shape_ . Size ( ) , out [ iter_out + + ] . dptr_ , lvalue . dptr_ ) ; <nl> } ) ; <nl> } <nl> void ElemwiseBinaryOp : : RspRspOp ( mshadow : : Stream < cpu > * s , <nl> } <nl> Tensor < cpu , 1 , DType > rvalue = data_r [ iter_r + + ] ; <nl> MXNET_ASSIGN_REQ_SWITCH ( req , Req , { <nl> - SerialLaunchCPU < MissingLValueOp < OP , Req > > ( <nl> + mxnet_op : : Kernel < MissingLValueOp < OP , Req > , cpu > : : Launch ( <nl> s , rvalue . shape_ . Size ( ) , out [ iter_out + + ] . dptr_ , rvalue . dptr_ ) ; <nl> } ) ; <nl> } <nl> mmm a / src / operator / tensor / elemwise_binary_op . h <nl> ppp b / src / operator / tensor / elemwise_binary_op . h <nl> class ElemwiseBinaryOp : public OpBase { <nl> / * ! \ brief For sparse , assume missing rvalue is 0 * / <nl> template < typename OP , int Req > <nl> struct MissingRValueOp { <nl> + typedef OP Operation ; <nl> template < typename DType > <nl> MSHADOW_XINLINE static void Map ( int i , DType * out , const DType * lhs ) { <nl> KERNEL_ASSIGN ( out [ i ] , Req , OP : : Map ( lhs [ i ] , DType ( 0 ) ) ) ; <nl> class ElemwiseBinaryOp : public OpBase { <nl> / * ! \ brief For sparse , assume missing lvalue is 0 * / <nl> template < typename OP , int Req > <nl> struct MissingLValueOp { <nl> + typedef OP Operation ; <nl> template < typename DType > <nl> MSHADOW_XINLINE static void Map ( int i , DType * out , const DType * rhs ) { <nl> KERNEL_ASSIGN ( out [ i ] , Req , OP : : Map ( DType ( 0 ) , rhs [ i ] ) ) ; <nl> class ElemwiseBinaryOp : public OpBase { <nl> ( outputs [ 0 ] . Size ( ) + mxnet_op : : DataType < DType > : : kLanes - 1 ) <nl> / mxnet_op : : DataType < DType > : : kLanes ) ; <nl> DType * lgrad_dptr = outputs [ 0 ] . dptr < DType > ( ) ; <nl> - mxnet_op : : Kernel < mxnet_op : : op_with_req < mxnet_op : : backward_grad < LOP > , Req > , xpu > : : Launch ( <nl> + mxnet_op : : Kernel < mxnet_op : : op_with_req < mxnet_op : : backward_grad_tuned < LOP > , Req > , xpu > : : Launch ( <nl> s , size , lgrad_dptr , ograd_dptr , lhs_dptr , rhs_dptr ) ; } ) ; <nl> MXNET_ASSIGN_REQ_SWITCH ( req [ 1 ] , Req , { <nl> const int size = static_cast < int > ( <nl> ( outputs [ 1 ] . Size ( ) + mxnet_op : : DataType < DType > : : kLanes - 1 ) <nl> / mxnet_op : : DataType < DType > : : kLanes ) ; <nl> DType * rgrad_dptr = outputs [ 1 ] . dptr < DType > ( ) ; <nl> - mxnet_op : : Kernel < mxnet_op : : op_with_req < mxnet_op : : backward_grad < ROP > , Req > , xpu > : : Launch ( <nl> + mxnet_op : : Kernel < mxnet_op : : op_with_req < mxnet_op : : backward_grad_tuned < ROP > , Req > , xpu > : : Launch ( <nl> s , size , rgrad_dptr , ograd_dptr , lhs_dptr , rhs_dptr ) ; } ) ; <nl> } <nl> <nl> class ElemwiseBinaryOp : public OpBase { <nl> } ) ; <nl> / / lhs in - place <nl> MSHADOW_IDX_TYPE_SWITCH ( inputs [ 0 ] . aux_type ( rowsparse : : kIdx ) , IType , { <nl> - RspRspOp < DType , IType , mshadow : : op : : mul > ( <nl> + RspRspOp < DType , IType , op : : mshadow_op : : mul > ( <nl> s , attrs , ctx , outputs [ 0 ] , inputs [ 0 ] , req [ 0 ] , outputs [ 0 ] , <nl> false , false , true , false ) ; <nl> } ) ; <nl> class ElemwiseBinaryOp : public OpBase { <nl> } ) ; <nl> / / rhs in - place <nl> MSHADOW_IDX_TYPE_SWITCH ( inputs [ 0 ] . aux_type ( rowsparse : : kIdx ) , IType , { <nl> - RspRspOp < DType , IType , mshadow : : op : : mul > ( <nl> + RspRspOp < DType , IType , op : : mshadow_op : : mul > ( <nl> s , attrs , ctx , inputs [ 0 ] , outputs [ 1 ] , req [ 1 ] , outputs [ 1 ] , <nl> false , false , true , false ) ; <nl> } ) ; <nl> mmm a / src / operator / tensor / elemwise_binary_op_basic . cc <nl> ppp b / src / operator / tensor / elemwise_binary_op_basic . cc <nl> <nl> namespace mxnet { <nl> namespace op { <nl> <nl> - MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU ( elemwise_add , mshadow : : op : : plus ) <nl> + MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU ( elemwise_add , op : : mshadow_op : : plus ) <nl> MXNET_ADD_SPARSE_OP_ALIAS ( elemwise_add ) <nl> . add_alias ( " _add " ) . add_alias ( " _plus " ) . add_alias ( " _Plus " ) <nl> . describe ( R " code ( Adds arguments element - wise . <nl> The storage type of ` ` elemwise_add ` ` output depends on storage types of inputs <nl> <nl> / / specialized gradient add function to do add to optimization <nl> / / this must differ from elemwise_add to prevent add to optimization in forward pass . <nl> - MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU ( _grad_add , mshadow : : op : : plus ) ; <nl> + MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU ( _grad_add , op : : mshadow_op : : plus ) ; <nl> <nl> NNVM_REGISTER_OP ( _backward_add ) <nl> . set_num_inputs ( 1 ) <nl> NNVM_REGISTER_OP ( _backward_add ) <nl> . set_attr < FInferStorageType > ( " FInferStorageType " , <nl> ElemwiseStorageType < 1 , 2 , true , true , true > ) ; <nl> <nl> - MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU ( elemwise_sub , mshadow : : op : : minus ) <nl> + MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU ( elemwise_sub , op : : mshadow_op : : minus ) <nl> MXNET_ADD_SPARSE_OP_ALIAS ( elemwise_sub ) <nl> . add_alias ( " _sub " ) . add_alias ( " _minus " ) . add_alias ( " _Minus " ) <nl> . describe ( R " code ( Subtracts arguments element - wise . <nl> The storage type of ` ` elemwise_mul ` ` output depends on storage types of inputs <nl> . set_attr < FInferStorageType > ( " FInferStorageType " , <nl> ElemwiseBinaryOp : : AllowLRDenseInputWithSparseOutputStorageType < <nl> false , false > ) / / 0 * nan or nan * 0 - > nan , so rsp * dns - > dns <nl> - . set_attr < FCompute > ( " FCompute < cpu > " , ElemwiseBinaryOp : : Compute < cpu , mshadow : : op : : mul > ) <nl> + . set_attr < FCompute > ( " FCompute < cpu > " , ElemwiseBinaryOp : : Compute < cpu , op : : mshadow_op : : mul > ) <nl> . set_attr < FComputeEx > ( " FComputeEx < cpu > " , <nl> - ElemwiseBinaryOp : : ComputeDnsLRValueEx < cpu , mshadow : : op : : mul , true , true > ) <nl> + ElemwiseBinaryOp : : ComputeDnsLRValueEx < cpu , op : : mshadow_op : : mul , true , true > ) <nl> . set_attr < FResourceRequest > ( " FResourceRequest " , / * For Sparse CSR * / <nl> [ ] ( const NodeAttrs & attrs ) { <nl> return std : : vector < ResourceRequest > { ResourceRequest : : kTempSpace } ; <nl> NNVM_REGISTER_OP ( _backward_mul ) <nl> . set_attr < FComputeEx > ( " FComputeEx < cpu > " , ElemwiseBinaryOp : : BackwardUseInEx < <nl> cpu , mshadow_op : : right , mshadow_op : : left > ) ; <nl> <nl> - MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU_DR ( elemwise_div , mshadow : : op : : div ) <nl> + MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU_DR ( elemwise_div , op : : mshadow_op : : div ) <nl> MXNET_ADD_SPARSE_OP_ALIAS ( elemwise_div ) <nl> . describe ( R " code ( Divides arguments element - wise . <nl> <nl> mmm a / src / operator / tensor / elemwise_binary_op_basic . cu <nl> ppp b / src / operator / tensor / elemwise_binary_op_basic . cu <nl> <nl> namespace mxnet { <nl> namespace op { <nl> NNVM_REGISTER_OP ( elemwise_add ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , ElemwiseBinaryOp : : ComputeWithHalf2 < gpu , mshadow : : op : : plus > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , ElemwiseBinaryOp : : ComputeWithHalf2 < gpu , op : : mshadow_op : : plus > ) ; <nl> <nl> NNVM_REGISTER_OP ( _grad_add ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , ElemwiseBinaryOp : : ComputeWithHalf2 < gpu , mshadow : : op : : plus > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , ElemwiseBinaryOp : : ComputeWithHalf2 < gpu , op : : mshadow_op : : plus > ) ; <nl> <nl> NNVM_REGISTER_OP ( _backward_add ) <nl> . set_attr < FCompute > ( " FCompute < gpu > " , <nl> NNVM_REGISTER_OP ( _backward_add ) <nl> mshadow_op : : identity > ) ; <nl> <nl> NNVM_REGISTER_OP ( elemwise_sub ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , ElemwiseBinaryOp : : ComputeWithHalf2 < gpu , mshadow : : op : : minus > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , ElemwiseBinaryOp : : ComputeWithHalf2 < <nl> + gpu , op : : mshadow_op : : minus > ) ; <nl> <nl> NNVM_REGISTER_OP ( _backward_sub ) <nl> . set_attr < FCompute > ( " FCompute < gpu > " , <nl> NNVM_REGISTER_OP ( _backward_sub ) <nl> mshadow_op : : negation > ) ; <nl> <nl> NNVM_REGISTER_OP ( elemwise_mul ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , ElemwiseBinaryOp : : ComputeWithHalf2 < gpu , mshadow : : op : : mul > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , ElemwiseBinaryOp : : ComputeWithHalf2 < gpu , op : : mshadow_op : : mul > ) ; <nl> <nl> NNVM_REGISTER_OP ( _backward_mul ) <nl> . set_attr < FCompute > ( " FCompute < gpu > " , <nl> NNVM_REGISTER_OP ( _backward_mul ) <nl> <nl> NNVM_REGISTER_OP ( elemwise_div ) <nl> . set_attr < FCompute > ( " FCompute < gpu > " , <nl> - ElemwiseBinaryOp : : ElemwiseBinaryOp : : ComputeWithHalf2 < gpu , mshadow : : op : : div > ) ; <nl> + ElemwiseBinaryOp : : ElemwiseBinaryOp : : ComputeWithHalf2 < gpu , op : : mshadow_op : : div > ) ; <nl> <nl> NNVM_REGISTER_OP ( _backward_div ) <nl> . set_attr < FCompute > ( " FCompute < gpu > " , <nl> mmm a / src / operator / tensor / elemwise_binary_scalar_op . h <nl> ppp b / src / operator / tensor / elemwise_binary_scalar_op . h <nl> class BinaryScalarOp : public UnaryOp { <nl> MSHADOW_TYPE_SWITCH ( outputs [ 0 ] . type_flag_ , DType , { <nl> MXNET_ASSIGN_REQ_SWITCH ( req [ 0 ] , Req , { <nl> mxnet : : op : : mxnet_op : : Kernel < mxnet : : op : : mxnet_op : : op_with_req < <nl> - mxnet : : op : : mxnet_op : : backward_grad < OP > , Req > , xpu > : : <nl> + mxnet : : op : : mxnet_op : : backward_grad_tuned < OP > , Req > , xpu > : : <nl> Launch ( s , inputs [ 0 ] . Size ( ) , outputs [ 0 ] . dptr < DType > ( ) , <nl> inputs [ 0 ] . dptr < DType > ( ) , inputs [ 1 ] . dptr < DType > ( ) , <nl> DType ( alpha ) ) ; <nl> mmm a / src / operator / tensor / elemwise_binary_scalar_op_basic . cc <nl> ppp b / src / operator / tensor / elemwise_binary_scalar_op_basic . cc <nl> static bool BinaryScalarStorageType ( const nnvm : : NodeAttrs & attrs , <nl> } <nl> <nl> MXNET_OPERATOR_REGISTER_BINARY_WITH_SCALAR_SUPPORT_WITH_DENSE_RESULT ( _plus_scalar ) <nl> - . set_attr < FCompute > ( " FCompute < cpu > " , BinaryScalarOp : : Compute < cpu , mshadow : : op : : plus > ) <nl> - . set_attr < FComputeEx > ( " FComputeEx < cpu > " , BinaryScalarOp : : ComputeEx < cpu , mshadow : : op : : plus > ) <nl> + . set_attr < FCompute > ( " FCompute < cpu > " , BinaryScalarOp : : Compute < cpu , op : : mshadow_op : : plus > ) <nl> + . set_attr < FComputeEx > ( " FComputeEx < cpu > " , BinaryScalarOp : : ComputeEx < cpu , op : : mshadow_op : : plus > ) <nl> . set_attr < nnvm : : FGradient > ( " FGradient " , ElemwiseGradUseNone { " _copy " } ) <nl> . add_alias ( " _PlusScalar " ) ; <nl> <nl> MXNET_OPERATOR_REGISTER_BINARY_WITH_SCALAR_SUPPORT_WITH_DENSE_RESULT ( _minus_scalar ) <nl> - . set_attr < FCompute > ( " FCompute < cpu > " , BinaryScalarOp : : Compute < cpu , mshadow : : op : : minus > ) <nl> - . set_attr < FComputeEx > ( " FComputeEx < cpu > " , BinaryScalarOp : : ComputeEx < cpu , mshadow : : op : : minus > ) <nl> + . set_attr < FCompute > ( " FCompute < cpu > " , BinaryScalarOp : : Compute < cpu , op : : mshadow_op : : minus > ) <nl> + . set_attr < FComputeEx > ( " FComputeEx < cpu > " , BinaryScalarOp : : ComputeEx < cpu , op : : mshadow_op : : minus > ) <nl> . set_attr < nnvm : : FGradient > ( " FGradient " , ElemwiseGradUseNone { " _copy " } ) <nl> . add_alias ( " _MinusScalar " ) ; <nl> <nl> it will result output . data = [ nan , nan ] instead of 10000 nans . <nl> <nl> ) doc " ADD_FILELINE ) <nl> . set_attr < FInferStorageType > ( " FInferStorageType " , BinaryScalarStorageType ) <nl> - . set_attr < FCompute > ( " FCompute < cpu > " , BinaryScalarOp : : Compute < cpu , mshadow : : op : : mul > ) <nl> - . set_attr < FComputeEx > ( " FComputeEx < cpu > " , BinaryScalarOp : : ComputeEx < cpu , mshadow : : op : : mul > ) <nl> + . set_attr < FCompute > ( " FCompute < cpu > " , BinaryScalarOp : : Compute < cpu , op : : mshadow_op : : mul > ) <nl> + . set_attr < FComputeEx > ( " FComputeEx < cpu > " , BinaryScalarOp : : ComputeEx < cpu , op : : mshadow_op : : mul > ) <nl> . set_attr < nnvm : : FGradient > ( " FGradient " , ElemwiseGradUseNone { " _backward_mul_scalar " } ) <nl> . add_alias ( " _MulScalar " ) ; <nl> <nl> MXNET_OPERATOR_REGISTER_BINARY_SCALAR ( _backward_mul_scalar ) <nl> . set_attr < nnvm : : TIsBackward > ( " TIsBackward " , true ) <nl> . set_attr < FInferStorageType > ( " FInferStorageType " , BinaryScalarStorageType ) <nl> - . set_attr < FCompute > ( " FCompute < cpu > " , BinaryScalarOp : : Compute < cpu , mshadow : : op : : mul > ) <nl> - . set_attr < FComputeEx > ( " FComputeEx < cpu > " , BinaryScalarOp : : ComputeEx < cpu , mshadow : : op : : mul > ) ; <nl> + . set_attr < FCompute > ( " FCompute < cpu > " , BinaryScalarOp : : Compute < cpu , op : : mshadow_op : : mul > ) <nl> + . set_attr < FComputeEx > ( " FComputeEx < cpu > " , BinaryScalarOp : : ComputeEx < cpu , op : : mshadow_op : : mul > ) ; <nl> <nl> MXNET_OPERATOR_REGISTER_BINARY_SCALAR ( _div_scalar ) <nl> . describe ( R " doc ( Divide an array with a scalar . <nl> it will result output . data = [ nan , nan ] instead of 10000 nans . <nl> <nl> ) doc " ADD_FILELINE ) <nl> . set_attr < FInferStorageType > ( " FInferStorageType " , BinaryScalarStorageType ) <nl> - . set_attr < FCompute > ( " FCompute < cpu > " , BinaryScalarOp : : Compute < cpu , mshadow : : op : : div > ) <nl> - . set_attr < FComputeEx > ( " FComputeEx < cpu > " , BinaryScalarOp : : ComputeEx < cpu , mshadow : : op : : div > ) <nl> + . set_attr < FCompute > ( " FCompute < cpu > " , BinaryScalarOp : : Compute < cpu , op : : mshadow_op : : div > ) <nl> + . set_attr < FComputeEx > ( " FComputeEx < cpu > " , BinaryScalarOp : : ComputeEx < cpu , op : : mshadow_op : : div > ) <nl> . set_attr < nnvm : : FGradient > ( " FGradient " , ElemwiseGradUseNone { " _backward_div_scalar " } ) <nl> . add_alias ( " _DivScalar " ) ; <nl> <nl> MXNET_OPERATOR_REGISTER_BINARY_SCALAR ( _backward_div_scalar ) <nl> . set_attr < nnvm : : TIsBackward > ( " TIsBackward " , true ) <nl> . set_attr < FInferStorageType > ( " FInferStorageType " , BinaryScalarStorageType ) <nl> - . set_attr < FCompute > ( " FCompute < cpu > " , BinaryScalarOp : : Compute < cpu , mshadow : : op : : div > ) <nl> - . set_attr < FComputeEx > ( " FComputeEx < cpu > " , BinaryScalarOp : : ComputeEx < cpu , mshadow : : op : : div > ) ; <nl> + . set_attr < FCompute > ( " FCompute < cpu > " , BinaryScalarOp : : Compute < cpu , op : : mshadow_op : : div > ) <nl> + . set_attr < FComputeEx > ( " FComputeEx < cpu > " , BinaryScalarOp : : ComputeEx < cpu , op : : mshadow_op : : div > ) ; <nl> <nl> <nl> MXNET_OPERATOR_REGISTER_BINARY_SCALAR ( _rdiv_scalar ) <nl> mmm a / src / operator / tensor / elemwise_binary_scalar_op_basic . cu <nl> ppp b / src / operator / tensor / elemwise_binary_scalar_op_basic . cu <nl> <nl> namespace mxnet { <nl> namespace op { <nl> NNVM_REGISTER_OP ( _plus_scalar ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , mshadow : : op : : plus > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , op : : mshadow_op : : plus > ) ; <nl> <nl> NNVM_REGISTER_OP ( _minus_scalar ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , mshadow : : op : : minus > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , op : : mshadow_op : : minus > ) ; <nl> <nl> NNVM_REGISTER_OP ( _rminus_scalar ) <nl> . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , mshadow_op : : rminus > ) ; <nl> <nl> NNVM_REGISTER_OP ( _mul_scalar ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , mshadow : : op : : mul > ) <nl> - . set_attr < FComputeEx > ( " FComputeEx < gpu > " , BinaryScalarOp : : ComputeEx < gpu , mshadow : : op : : mul > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , op : : mshadow_op : : mul > ) <nl> + . set_attr < FComputeEx > ( " FComputeEx < gpu > " , BinaryScalarOp : : ComputeEx < gpu , op : : mshadow_op : : mul > ) ; <nl> <nl> NNVM_REGISTER_OP ( _backward_mul_scalar ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , mshadow : : op : : mul > ) <nl> - . set_attr < FComputeEx > ( " FComputeEx < gpu > " , BinaryScalarOp : : ComputeEx < gpu , mshadow : : op : : mul > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , op : : mshadow_op : : mul > ) <nl> + . set_attr < FComputeEx > ( " FComputeEx < gpu > " , BinaryScalarOp : : ComputeEx < gpu , op : : mshadow_op : : mul > ) ; <nl> <nl> NNVM_REGISTER_OP ( _div_scalar ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , mshadow : : op : : div > ) <nl> - . set_attr < FComputeEx > ( " FComputeEx < gpu > " , BinaryScalarOp : : ComputeEx < gpu , mshadow : : op : : div > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , op : : mshadow_op : : div > ) <nl> + . set_attr < FComputeEx > ( " FComputeEx < gpu > " , BinaryScalarOp : : ComputeEx < gpu , op : : mshadow_op : : div > ) ; <nl> <nl> NNVM_REGISTER_OP ( _backward_div_scalar ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , mshadow : : op : : div > ) <nl> - . set_attr < FComputeEx > ( " FComputeEx < gpu > " , BinaryScalarOp : : ComputeEx < gpu , mshadow : : op : : div > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , op : : mshadow_op : : div > ) <nl> + . set_attr < FComputeEx > ( " FComputeEx < gpu > " , BinaryScalarOp : : ComputeEx < gpu , op : : mshadow_op : : div > ) ; <nl> <nl> NNVM_REGISTER_OP ( _rdiv_scalar ) <nl> . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , mshadow_op : : rdiv > ) ; <nl> mmm a / src / operator / tensor / elemwise_scatter_op . cc <nl> ppp b / src / operator / tensor / elemwise_scatter_op . cc <nl> static bool StorageTypeScatteredScalarOp ( const NodeAttrs & attrs , <nl> <nl> / * ! \ brief _scatter_elemwise_div * / <nl> MXNET_OPERATOR_REGISTER_BINARY ( _scatter_elemwise_div ) <nl> - . set_attr < FCompute > ( " FCompute < cpu > " , ElemwiseScatterBinaryOp : : Compute < cpu , mshadow : : op : : div > ) <nl> - . set_attr < FComputeEx > ( " FComputeEx < cpu > " , ElemwiseScatterBinaryOp : : ComputeEx < cpu , mshadow : : op : : div > ) <nl> + . set_attr < FCompute > ( " FCompute < cpu > " , ElemwiseScatterBinaryOp : : Compute < cpu , op : : mshadow_op : : div > ) <nl> + . set_attr < FComputeEx > ( " FComputeEx < cpu > " , ElemwiseScatterBinaryOp : : ComputeEx < <nl> + cpu , op : : mshadow_op : : div > ) <nl> . describe ( R " code ( Divides arguments element - wise . If the left - hand - side input is ' row_sparse ' , then <nl> only the values which exist in the left - hand sparse array are computed . The ' missing ' values <nl> are ignored . <nl> with default storage <nl> ) code " ) <nl> . set_attr < FInferStorageType > ( " FInferStorageType " , StorageTypeScatteredScalarOp ) <nl> . set_attr < FCompute > ( " FCompute < cpu > " , <nl> - ElemwiseScatterBinaryScalarOp : : Compute < cpu , mshadow : : op : : plus > ) <nl> + ElemwiseScatterBinaryScalarOp : : Compute < cpu , op : : mshadow_op : : plus > ) <nl> . set_attr < FComputeEx > ( " FComputeEx < cpu > " , <nl> - ElemwiseScatterBinaryScalarOp : : ComputeEx < cpu , mshadow : : op : : plus > ) <nl> + ElemwiseScatterBinaryScalarOp : : ComputeEx < cpu , op : : mshadow_op : : plus > ) <nl> . set_attr < nnvm : : FGradient > ( " FGradient " , ElemwiseGradUseNone { " _copy " } ) ; <nl> <nl> / * ! \ brief _scatter_minus_scalar * / <nl> with default storage <nl> ) code " ) <nl> . set_attr < FInferStorageType > ( " FInferStorageType " , StorageTypeScatteredScalarOp ) <nl> . set_attr < FCompute > ( " FCompute < cpu > " , <nl> - ElemwiseScatterBinaryScalarOp : : Compute < cpu , mshadow : : op : : minus > ) <nl> + ElemwiseScatterBinaryScalarOp : : Compute < cpu , op : : mshadow_op : : minus > ) <nl> . set_attr < FComputeEx > ( " FComputeEx < cpu > " , <nl> - ElemwiseScatterBinaryScalarOp : : ComputeEx < cpu , mshadow : : op : : minus > ) <nl> + ElemwiseScatterBinaryScalarOp : : ComputeEx < cpu , op : : mshadow_op : : minus > ) <nl> . set_attr < nnvm : : FGradient > ( " FGradient " , ElemwiseGradUseNone { " _copy " } ) ; <nl> <nl> } / / namespace op <nl> mmm a / src / operator / tensor / elemwise_scatter_op . cu <nl> ppp b / src / operator / tensor / elemwise_scatter_op . cu <nl> namespace mxnet { <nl> namespace op { <nl> <nl> NNVM_REGISTER_OP ( _scatter_elemwise_div ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , ElemwiseScatterBinaryOp : : Compute < gpu , mshadow : : op : : div > ) <nl> - . set_attr < FComputeEx > ( " FComputeEx < gpu > " , ElemwiseScatterBinaryOp : : ComputeEx < gpu , mshadow : : op : : div > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , ElemwiseScatterBinaryOp : : Compute < gpu , op : : mshadow_op : : div > ) <nl> + . set_attr < FComputeEx > ( " FComputeEx < gpu > " , ElemwiseScatterBinaryOp : : ComputeEx < gpu , <nl> + op : : mshadow_op : : div > ) ; <nl> <nl> NNVM_REGISTER_OP ( _scatter_plus_scalar ) <nl> . set_attr < FCompute > ( " FCompute < gpu > " , <nl> - ElemwiseScatterBinaryScalarOp : : Compute < gpu , mshadow : : op : : plus > ) <nl> + ElemwiseScatterBinaryScalarOp : : Compute < gpu , op : : mshadow_op : : plus > ) <nl> . set_attr < FComputeEx > ( " FComputeEx < gpu > " , <nl> - ElemwiseScatterBinaryScalarOp : : ComputeEx < gpu , mshadow : : op : : plus > ) ; <nl> + ElemwiseScatterBinaryScalarOp : : ComputeEx < gpu , op : : mshadow_op : : plus > ) ; <nl> <nl> NNVM_REGISTER_OP ( _scatter_minus_scalar ) <nl> - . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , mshadow : : op : : minus > ) <nl> - . set_attr < FComputeEx > ( " FComputeEx < gpu > " , BinaryScalarOp : : ComputeEx < gpu , mshadow : : op : : minus > ) ; <nl> + . set_attr < FCompute > ( " FCompute < gpu > " , BinaryScalarOp : : Compute < gpu , op : : mshadow_op : : minus > ) <nl> + . set_attr < FComputeEx > ( " FComputeEx < gpu > " , BinaryScalarOp : : ComputeEx < gpu , op : : mshadow_op : : minus > ) ; <nl> <nl> } / / namespace op <nl> } / / namespace mxnet <nl> mmm a / src / operator / tensor / elemwise_unary_op . h <nl> ppp b / src / operator / tensor / elemwise_unary_op . h <nl> namespace op { <nl> <nl> class OpBase { <nl> protected : <nl> - / * ! <nl> - * \ brief Launch CPU - only kernel without OMP ( temporary solution until OMP - tuned kernels arrive ) <nl> - * \ tparam OP Kernel operation type <nl> - * \ tparam Args Argument types to be passed to kernel <nl> - * \ param s CPU stream <nl> - * \ param N Number of iterations <nl> - * \ param args Arguments to be passed to kernel <nl> - * / <nl> - template < typename OP , typename . . . Args > <nl> - static inline void SerialLaunchCPU ( mshadow : : Stream < cpu > * s , const int N , Args . . . args ) { <nl> - for ( int i = 0 ; i < N ; + + i ) { <nl> - OP : : Map ( i , args . . . ) ; <nl> - } <nl> - } <nl> - <nl> / * ! \ brief simple kernel to set to a scalar value of arbitrary type * / <nl> template < int req > <nl> using set_to_scalar = mxnet_op : : op_with_req < mshadow_op : : identity , req > ; <nl> class OpBase { <nl> const OpReqType req , <nl> DType * out ) { <nl> MXNET_ASSIGN_REQ_SWITCH ( req , Req , { <nl> - SerialLaunchCPU < OpBase : : set_to_scalar < Req > > ( s , size , out , val ) ; <nl> + mxnet_op : : Kernel < OpBase : : set_to_scalar < Req > , cpu > : : Launch ( s , size , out , val ) ; <nl> } ) ; <nl> } <nl> } ; / / OpBase <nl> class UnaryOp : public OpBase { <nl> <nl> / * ! \ brief Map legacy unary_bwd to backward_grad * / <nl> template < typename GRAD_OP > <nl> - using unary_bwd = : : mxnet : : op : : mxnet_op : : backward_grad < GRAD_OP > ; <nl> + using unary_bwd = : : mxnet : : op : : mxnet_op : : backward_grad_tuned < GRAD_OP > ; <nl> <nl> struct CastParam : public dmlc : : Parameter < CastParam > { <nl> / / use int for enumeration <nl> mmm a / src / operator / tensor / init_op . h <nl> ppp b / src / operator / tensor / init_op . h <nl> void InitFillWithScalarCompute ( const nnvm : : NodeAttrs & attrs , <nl> CHECK_EQ ( inputs . size ( ) , 0 ) ; <nl> CHECK_EQ ( outputs . size ( ) , 1U ) ; <nl> const auto & param = nnvm : : get < InitOpWithScalarParam > ( attrs . parsed ) ; <nl> - Fill < true > ( ctx . get_stream < xpu > ( ) , outputs [ 0 ] , req [ 0 ] , param . value ) ; <nl> + Fill < false > ( ctx . get_stream < xpu > ( ) , outputs [ 0 ] , req [ 0 ] , param . value ) ; <nl> } <nl> <nl> - struct PopulateFullIdxRspKernel { <nl> + struct PopulateFullIdxRspKernel : public mxnet_op : : tunable { <nl> template < typename IType > <nl> MSHADOW_XINLINE static void Map ( int i , IType * out ) { <nl> KERNEL_ASSIGN ( out [ i ] , kWriteTo , i ) ; <nl> } <nl> } ; <nl> - MXNET_TUNABLE_MXNET_OP_FWD ( PopulateFullIdxRspKernel ) ; <nl> <nl> / / Fill in the indices and values of a RowSparse NDArray to represent a zeros NDArray , <nl> / / instead of the usual compact representation . <nl>
Tune without Launch specialization macros ( )
apache/incubator-mxnet
05047ad8fee4e8ee63ae2b7f96e7e9c7684fa4a0
2017-11-25T22:00:38Z
mmm a / tensorflow / c / c_api_function_test . cc <nl> ppp b / tensorflow / c / c_api_function_test . cc <nl> void DefineStatefulFunction ( const char * name , TF_Function * * func ) { <nl> <nl> TF_Output inputs [ ] = { } ; <nl> TF_Output outputs [ ] = { { random , 0 } } ; <nl> - * func = TF_GraphToFunction ( func_graph . get ( ) , name , / * append_hash = * / false , - 1 , <nl> + * func = TF_GraphToFunction ( func_graph . get ( ) , name , <nl> + / * append_hash_to_fn_name = * / false , - 1 , <nl> / * opers = * / nullptr , 0 , inputs , 1 , outputs , <nl> / * output_names = * / nullptr , <nl> / * opts = * / nullptr , " " , s . get ( ) ) ; <nl>
Fix argument comment in c_api_function_test . cc
tensorflow/tensorflow
7c2e16f92a13762a50d37049bd8c80fc439b03ab
2018-07-19T14:51:22Z