hash
int64 -9,197,960,073,880,366,000
9,199,363,627B
| project
stringclasses 2
values | size
int64 2
5.68k
| label
int64 0
1
| functionSource
stringlengths 31
235k
|
---|---|---|---|---|
-8,115,807,672,627,724,000 | debian | 10 | 0 | static int ts_lua_http_config_int_set ( lua_State * L ) {
int conf ;
int value ;
ts_lua_http_ctx * http_ctx ;
GET_HTTP_CONTEXT ( http_ctx , L ) ;
conf = luaL_checkinteger ( L , 1 ) ;
value = luaL_checkinteger ( L , 2 ) ;
TSHttpTxnConfigIntSet ( http_ctx -> txnp , conf , value ) ;
return 0 ;
} |
-866,921,002,076,081,900 | debian | 21 | 0 | EXCLUSIVE_REGRESSION_TEST ( SDK_API_HttpParentProxySet_Success ) ( RegressionTest * test , int level , int * pstatus ) {
* pstatus = REGRESSION_TEST_INPROGRESS ;
if ( level < REGRESSION_TEST_EXTENDED ) {
* pstatus = REGRESSION_TEST_NOT_RUN ;
return ;
}
TSCont cont = TSContCreate ( parent_proxy_handler , TSMutexCreate ( ) ) ;
if ( cont == nullptr ) {
SDK_RPRINT ( test , "TSHttpTxnParentProxySet" , "SuccessCase" , TC_FAIL , "Unable to create continuation" ) ;
* pstatus = REGRESSION_TEST_FAILED ;
return ;
}
ParentTest * ptest = new ParentTest ( test , pstatus ) ;
ptest -> testcase = "SuccessCase" ;
ptest -> handler = parent_proxy_success ;
TSContDataSet ( cont , ptest ) ;
TSHttpHookAdd ( TS_HTTP_READ_REQUEST_HDR_HOOK , cont ) ;
ptest -> os = synserver_create ( SYNSERVER_LISTEN_PORT , TSContCreate ( synserver_vc_accept , TSMutexCreate ( ) ) ) ;
synserver_start ( ptest -> os ) ;
TSContSchedule ( cont , 25 , TS_THREAD_POOL_DEFAULT ) ;
} |
-5,459,605,226,342,015,000 | debian | 10 | 0 | static inline int tm2_read_header ( TM2Context * ctx , const uint8_t * buf ) {
uint32_t magic = AV_RL32 ( buf ) ;
switch ( magic ) {
case TM2_OLD_HEADER_MAGIC : av_log_missing_feature ( ctx -> avctx , "TM2 old header" , 1 ) ;
return 0 ;
case TM2_NEW_HEADER_MAGIC : return 0 ;
default : av_log ( ctx -> avctx , AV_LOG_ERROR , "Not a TM2 header: 0x%08X\n" , magic ) ;
return AVERROR_INVALIDDATA ;
}
} |
-6,068,976,579,504,841,000 | debian | 5 | 0 | static void generate_nonce ( struct recvbuf * rbufp , char * nonce , size_t nonce_octets ) {
u_int32 derived ;
derived = derive_nonce ( & rbufp -> recv_srcadr , rbufp -> recv_time . l_ui , rbufp -> recv_time . l_uf ) ;
snprintf ( nonce , nonce_octets , "%08x%08x%08x" , rbufp -> recv_time . l_ui , rbufp -> recv_time . l_uf , derived ) ;
} |
-2,648,356,651,055,439,400 | debian | 15 | 0 | static gboolean gsm_a_stat_packet ( void * tapdata , const void * gatr_ptr , guint8 pdu_type , int protocol_disc ) {
new_stat_data_t * stat_data = ( new_stat_data_t * ) tapdata ;
const gsm_a_tap_rec_t * gatr = ( const gsm_a_tap_rec_t * ) gatr_ptr ;
new_stat_tap_table * table ;
stat_tap_table_item_type * msg_data ;
guint i = 0 ;
if ( gatr -> pdu_type != pdu_type ) return FALSE ;
if ( pdu_type == BSSAP_PDU_TYPE_DTAP && ( int ) gatr -> protocol_disc != protocol_disc ) return FALSE ;
if ( pdu_type == GSM_A_PDU_TYPE_SACCH && gatr -> protocol_disc != 0 ) return FALSE ;
table = g_array_index ( stat_data -> new_stat_tap_data -> tables , new_stat_tap_table * , i ) ;
msg_data = new_stat_tap_get_field_data ( table , gatr -> message_type , COUNT_COLUMN ) ;
msg_data -> value . uint_value ++ ;
new_stat_tap_set_field_data ( table , gatr -> message_type , COUNT_COLUMN , msg_data ) ;
return TRUE ;
} |
3,935,234,056,444,097,500 | debian | 25 | 0 | static int rtp_packetize_mp4a ( sout_stream_id_sys_t * id , block_t * in ) {
int i_max = rtp_mtu ( id ) - 4 ;
int i_count = ( in -> i_buffer + i_max - 1 ) / i_max ;
uint8_t * p_data = in -> p_buffer ;
int i_data = in -> i_buffer ;
int i ;
for ( i = 0 ;
i < i_count ;
i ++ ) {
int i_payload = __MIN ( i_max , i_data ) ;
block_t * out = block_Alloc ( 16 + i_payload ) ;
rtp_packetize_common ( id , out , ( ( i == i_count - 1 ) ? 1 : 0 ) , ( in -> i_pts > VLC_TS_INVALID ? in -> i_pts : in -> i_dts ) ) ;
out -> p_buffer [ 12 ] = 0 ;
out -> p_buffer [ 13 ] = 2 * 8 ;
SetWBE ( out -> p_buffer + 14 , ( in -> i_buffer << 3 ) | 0 ) ;
memcpy ( & out -> p_buffer [ 16 ] , p_data , i_payload ) ;
out -> i_dts = in -> i_dts + i * in -> i_length / i_count ;
out -> i_length = in -> i_length / i_count ;
rtp_packetize_send ( id , out ) ;
p_data += i_payload ;
i_data -= i_payload ;
}
block_Release ( in ) ;
return VLC_SUCCESS ;
} |
8,461,782,184,979,846,000 | chrome | 8 | 0 | TEST_F ( ProtocolHandlerRegistryTest , MAYBE_TestInstallDefaultHandler ) {
RecreateRegistry ( false ) ;
registry ( ) -> AddPredefinedHandler ( CreateProtocolHandler ( "test" , GURL ( "http://test.com/%s" ) ) ) ;
registry ( ) -> InitProtocolSettings ( ) ;
std : : vector < std : : string > protocols ;
registry ( ) -> GetRegisteredProtocols ( & protocols ) ;
ASSERT_EQ ( static_cast < size_t > ( 1 ) , protocols . size ( ) ) ;
} |
-3,889,154,245,145,552,000 | debian | 13 | 0 | static void parse_from_existing ( struct branch * b ) {
if ( is_null_sha1 ( b -> sha1 ) ) {
hashclr ( b -> branch_tree . versions [ 0 ] . sha1 ) ;
hashclr ( b -> branch_tree . versions [ 1 ] . sha1 ) ;
}
else {
unsigned long size ;
char * buf ;
buf = read_object_with_reference ( b -> sha1 , commit_type , & size , b -> sha1 ) ;
parse_from_commit ( b , buf , size ) ;
free ( buf ) ;
}
} |
6,632,536,031,698,733,000 | debian | 88 | 0 | static int read_interval_packets ( WriterContext * w , InputFile * ifile , const ReadInterval * interval , int64_t * cur_ts ) {
AVFormatContext * fmt_ctx = ifile -> fmt_ctx ;
AVPacket pkt ;
AVFrame * frame = NULL ;
int ret = 0 , i = 0 , frame_count = 0 ;
int64_t start = - INT64_MAX , end = interval -> end ;
int has_start = 0 , has_end = interval -> has_end && ! interval -> end_is_offset ;
av_init_packet ( & pkt ) ;
av_log ( NULL , AV_LOG_VERBOSE , "Processing read interval " ) ;
log_read_interval ( interval , NULL , AV_LOG_VERBOSE ) ;
if ( interval -> has_start ) {
int64_t target ;
if ( interval -> start_is_offset ) {
if ( * cur_ts == AV_NOPTS_VALUE ) {
av_log ( NULL , AV_LOG_ERROR , "Could not seek to relative position since current " "timestamp is not defined\n" ) ;
ret = AVERROR ( EINVAL ) ;
goto end ;
}
target = * cur_ts + interval -> start ;
}
else {
target = interval -> start ;
}
av_log ( NULL , AV_LOG_VERBOSE , "Seeking to read interval start point %s\n" , av_ts2timestr ( target , & AV_TIME_BASE_Q ) ) ;
if ( ( ret = avformat_seek_file ( fmt_ctx , - 1 , - INT64_MAX , target , INT64_MAX , 0 ) ) < 0 ) {
av_log ( NULL , AV_LOG_ERROR , "Could not seek to position %" PRId64 ": %s\n" , interval -> start , av_err2str ( ret ) ) ;
goto end ;
}
}
frame = av_frame_alloc ( ) ;
if ( ! frame ) {
ret = AVERROR ( ENOMEM ) ;
goto end ;
}
while ( ! av_read_frame ( fmt_ctx , & pkt ) ) {
if ( ifile -> nb_streams > nb_streams ) {
REALLOCZ_ARRAY_STREAM ( nb_streams_frames , nb_streams , fmt_ctx -> nb_streams ) ;
REALLOCZ_ARRAY_STREAM ( nb_streams_packets , nb_streams , fmt_ctx -> nb_streams ) ;
REALLOCZ_ARRAY_STREAM ( selected_streams , nb_streams , fmt_ctx -> nb_streams ) ;
nb_streams = ifile -> nb_streams ;
}
if ( selected_streams [ pkt . stream_index ] ) {
AVRational tb = ifile -> streams [ pkt . stream_index ] . st -> time_base ;
if ( pkt . pts != AV_NOPTS_VALUE ) * cur_ts = av_rescale_q ( pkt . pts , tb , AV_TIME_BASE_Q ) ;
if ( ! has_start && * cur_ts != AV_NOPTS_VALUE ) {
start = * cur_ts ;
has_start = 1 ;
}
if ( has_start && ! has_end && interval -> end_is_offset ) {
end = start + interval -> end ;
has_end = 1 ;
}
if ( interval -> end_is_offset && interval -> duration_frames ) {
if ( frame_count >= interval -> end ) break ;
}
else if ( has_end && * cur_ts != AV_NOPTS_VALUE && * cur_ts >= end ) {
break ;
}
frame_count ++ ;
if ( do_read_packets ) {
if ( do_show_packets ) show_packet ( w , ifile , & pkt , i ++ ) ;
nb_streams_packets [ pkt . stream_index ] ++ ;
}
if ( do_read_frames ) {
int packet_new = 1 ;
while ( process_frame ( w , ifile , frame , & pkt , & packet_new ) > 0 ) ;
}
}
av_packet_unref ( & pkt ) ;
}
av_init_packet ( & pkt ) ;
pkt . data = NULL ;
pkt . size = 0 ;
for ( i = 0 ;
i < fmt_ctx -> nb_streams ;
i ++ ) {
pkt . stream_index = i ;
if ( do_read_frames ) while ( process_frame ( w , ifile , frame , & pkt , & ( int ) {
1 }
) > 0 ) ;
}
end : av_frame_free ( & frame ) ;
if ( ret < 0 ) {
av_log ( NULL , AV_LOG_ERROR , "Could not read packets in interval " ) ;
log_read_interval ( interval , NULL , AV_LOG_ERROR ) ;
}
return ret ;
} |
6,393,050,609,822,898,000 | debian | 21 | 0 | static void xhci_msix_update ( XHCIState * xhci , int v ) {
PCIDevice * pci_dev = PCI_DEVICE ( xhci ) ;
bool enabled ;
if ( ! msix_enabled ( pci_dev ) ) {
return ;
}
enabled = xhci -> intr [ v ] . iman & IMAN_IE ;
if ( enabled == xhci -> intr [ v ] . msix_used ) {
return ;
}
if ( enabled ) {
trace_usb_xhci_irq_msix_use ( v ) ;
msix_vector_use ( pci_dev , v ) ;
xhci -> intr [ v ] . msix_used = true ;
}
else {
trace_usb_xhci_irq_msix_unuse ( v ) ;
msix_vector_unuse ( pci_dev , v ) ;
xhci -> intr [ v ] . msix_used = false ;
}
} |
-7,049,333,455,584,635,000 | chrome | 201 | 1 | static void _UTF16BEToUnicodeWithOffsets ( UConverterToUnicodeArgs * pArgs , UErrorCode * pErrorCode ) {
UConverter * cnv ;
const uint8_t * source ;
UChar * target ;
int32_t * offsets ;
uint32_t targetCapacity , length , count , sourceIndex ;
UChar c , trail ;
if ( pArgs -> converter -> mode < 8 ) {
_UTF16ToUnicodeWithOffsets ( pArgs , pErrorCode ) ;
return ;
}
cnv = pArgs -> converter ;
source = ( const uint8_t * ) pArgs -> source ;
length = ( int32_t ) ( ( const uint8_t * ) pArgs -> sourceLimit - source ) ;
if ( length <= 0 && cnv -> toUnicodeStatus == 0 ) {
return ;
}
target = pArgs -> target ;
if ( target >= pArgs -> targetLimit ) {
* pErrorCode = U_BUFFER_OVERFLOW_ERROR ;
return ;
}
targetCapacity = ( uint32_t ) ( pArgs -> targetLimit - target ) ;
offsets = pArgs -> offsets ;
sourceIndex = 0 ;
c = 0 ;
if ( cnv -> toUnicodeStatus != 0 ) {
cnv -> toUBytes [ 0 ] = ( uint8_t ) cnv -> toUnicodeStatus ;
cnv -> toULength = 1 ;
cnv -> toUnicodeStatus = 0 ;
}
if ( ( count = cnv -> toULength ) != 0 ) {
uint8_t * p = cnv -> toUBytes ;
do {
p [ count ++ ] = * source ++ ;
++ sourceIndex ;
-- length ;
if ( count == 2 ) {
c = ( ( UChar ) p [ 0 ] << 8 ) | p [ 1 ] ;
if ( U16_IS_SINGLE ( c ) ) {
* target ++ = c ;
if ( offsets != NULL ) {
* offsets ++ = - 1 ;
}
-- targetCapacity ;
count = 0 ;
c = 0 ;
break ;
}
else if ( U16_IS_SURROGATE_LEAD ( c ) ) {
c = 0 ;
}
else {
break ;
}
}
else if ( count == 4 ) {
c = ( ( UChar ) p [ 0 ] << 8 ) | p [ 1 ] ;
trail = ( ( UChar ) p [ 2 ] << 8 ) | p [ 3 ] ;
if ( U16_IS_TRAIL ( trail ) ) {
* target ++ = c ;
if ( targetCapacity >= 2 ) {
* target ++ = trail ;
if ( offsets != NULL ) {
* offsets ++ = - 1 ;
* offsets ++ = - 1 ;
}
targetCapacity -= 2 ;
}
else {
targetCapacity = 0 ;
cnv -> UCharErrorBuffer [ 0 ] = trail ;
cnv -> UCharErrorBufferLength = 1 ;
* pErrorCode = U_BUFFER_OVERFLOW_ERROR ;
}
count = 0 ;
c = 0 ;
break ;
}
else {
* pErrorCode = U_ILLEGAL_CHAR_FOUND ;
if ( ( ( const uint8_t * ) pArgs -> source - source ) >= 2 ) {
source -= 2 ;
}
else {
cnv -> toUnicodeStatus = 0x100 | p [ 2 ] ;
-- source ;
}
cnv -> toULength = 2 ;
pArgs -> source = ( const char * ) source ;
pArgs -> target = target ;
pArgs -> offsets = offsets ;
return ;
}
}
}
while ( length > 0 ) ;
cnv -> toULength = ( int8_t ) count ;
}
count = 2 * targetCapacity ;
if ( count > length ) {
count = length & ~ 1 ;
}
if ( c == 0 && count > 0 ) {
length -= count ;
count >>= 1 ;
targetCapacity -= count ;
if ( offsets == NULL ) {
do {
c = ( ( UChar ) source [ 0 ] << 8 ) | source [ 1 ] ;
source += 2 ;
if ( U16_IS_SINGLE ( c ) ) {
* target ++ = c ;
}
else if ( U16_IS_SURROGATE_LEAD ( c ) && count >= 2 && U16_IS_TRAIL ( trail = ( ( UChar ) source [ 0 ] << 8 ) | source [ 1 ] ) ) {
source += 2 ;
-- count ;
* target ++ = c ;
* target ++ = trail ;
}
else {
break ;
}
}
while ( -- count > 0 ) ;
}
else {
do {
c = ( ( UChar ) source [ 0 ] << 8 ) | source [ 1 ] ;
source += 2 ;
if ( U16_IS_SINGLE ( c ) ) {
* target ++ = c ;
* offsets ++ = sourceIndex ;
sourceIndex += 2 ;
}
else if ( U16_IS_SURROGATE_LEAD ( c ) && count >= 2 && U16_IS_TRAIL ( trail = ( ( UChar ) source [ 0 ] << 8 ) | source [ 1 ] ) ) {
source += 2 ;
-- count ;
* target ++ = c ;
* target ++ = trail ;
* offsets ++ = sourceIndex ;
* offsets ++ = sourceIndex ;
sourceIndex += 4 ;
}
else {
break ;
}
}
while ( -- count > 0 ) ;
}
if ( count == 0 ) {
c = 0 ;
}
else {
length += 2 * ( count - 1 ) ;
targetCapacity += count ;
}
}
if ( c != 0 ) {
cnv -> toUBytes [ 0 ] = ( uint8_t ) ( c >> 8 ) ;
cnv -> toUBytes [ 1 ] = ( uint8_t ) c ;
cnv -> toULength = 2 ;
if ( U16_IS_SURROGATE_LEAD ( c ) ) {
if ( length >= 2 ) {
if ( U16_IS_TRAIL ( trail = ( ( UChar ) source [ 0 ] << 8 ) | source [ 1 ] ) ) {
source += 2 ;
length -= 2 ;
* target ++ = c ;
if ( offsets != NULL ) {
* offsets ++ = sourceIndex ;
}
cnv -> UCharErrorBuffer [ 0 ] = trail ;
cnv -> UCharErrorBufferLength = 1 ;
cnv -> toULength = 0 ;
* pErrorCode = U_BUFFER_OVERFLOW_ERROR ;
}
else {
* pErrorCode = U_ILLEGAL_CHAR_FOUND ;
}
}
else {
}
}
else {
* pErrorCode = U_ILLEGAL_CHAR_FOUND ;
}
}
if ( U_SUCCESS ( * pErrorCode ) ) {
if ( length > 0 ) {
if ( targetCapacity == 0 ) {
* pErrorCode = U_BUFFER_OVERFLOW_ERROR ;
}
else {
cnv -> toUBytes [ cnv -> toULength ++ ] = * source ++ ;
}
}
}
pArgs -> source = ( const char * ) source ;
pArgs -> target = target ;
pArgs -> offsets = offsets ;
} |
-2,928,324,134,072,492,500 | debian | 4 | 0 | void remove_tap_listener_voip_calls ( void ) {
remove_tap_listener ( & ( the_tapinfo_struct . voip_dummy ) ) ;
have_voip_tap_listener = FALSE ;
} |
2,335,116,444,795,821,000 | debian | 22 | 1 | struct config_filter_parser * const * config_filter_find_subset ( struct config_filter_context * ctx , const struct config_filter * filter ) {
ARRAY_TYPE ( config_filter_parsers ) matches ;
struct config_filter tmp_mask ;
unsigned int i ;
t_array_init ( & matches , 8 ) ;
for ( i = 0 ;
ctx -> parsers [ i ] != NULL ;
i ++ ) {
const struct config_filter * mask = & ctx -> parsers [ i ] -> filter ;
if ( filter -> service != NULL ) {
if ( ! config_filter_match_service ( mask , filter ) ) continue ;
}
tmp_mask = * mask ;
if ( filter -> local_name == NULL ) tmp_mask . local_name = NULL ;
if ( filter -> local_bits == 0 ) tmp_mask . local_bits = 0 ;
if ( filter -> remote_bits == 0 ) tmp_mask . remote_bits = 0 ;
if ( config_filter_match_rest ( & tmp_mask , filter ) ) array_append ( & matches , & ctx -> parsers [ i ] , 1 ) ;
}
array_sort ( & matches , config_filter_parser_cmp_rev ) ;
array_append_zero ( & matches ) ;
return array_idx ( & matches , 0 ) ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | int dissect_h245_H223Capability ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_H223Capability , H223Capability_sequence ) ;
return offset ;
} |
-4,744,270,124,459,050,000 | debian | 17 | 0 | static void make_lpc_coefs ( float * lpc , const float * refl , int order ) {
float buf [ 100 ] ;
float * next , * cur ;
int m , i ;
next = buf ;
cur = lpc ;
for ( m = 0 ;
m < order ;
m ++ ) {
next [ m ] = refl [ m ] ;
for ( i = 0 ;
i < m ;
i ++ ) next [ i ] = cur [ i ] + refl [ m ] * cur [ m - i - 1 ] ;
FFSWAP ( float * , next , cur ) ;
}
if ( cur != lpc ) memcpy ( lpc , cur , sizeof ( * lpc ) * order ) ;
} |
-2,607,754,285,145,856,500 | debian | 6 | 0 | static int zisofs_write_to_temp ( struct archive_write * a , const void * buff , size_t s ) {
( void ) buff ;
( void ) s ;
archive_set_error ( & a -> archive , ARCHIVE_ERRNO_MISC , "Programing error" ) ;
return ( ARCHIVE_FATAL ) ;
} |
4,724,375,811,251,029,000 | debian | 9 | 0 | static int arith_get_prob ( ArithCoder * c , int16_t * probs ) {
int range = c -> high - c -> low + 1 ;
int val = ( ( c -> value - c -> low + 1 ) * probs [ 0 ] - 1 ) / range ;
int sym = 1 ;
while ( probs [ sym ] > val ) sym ++ ;
c -> high = range * probs [ sym - 1 ] / probs [ 0 ] + c -> low - 1 ;
c -> low += range * probs [ sym ] / probs [ 0 ] ;
return sym ;
} |
7,651,945,086,108,393,000 | debian | 64 | 0 | static int qemuMonitorJSONBlockIoThrottleInfo ( virJSONValuePtr result , const char * device , virDomainBlockIoTuneInfoPtr reply ) {
virJSONValuePtr io_throttle ;
int ret = - 1 ;
int i ;
int found = 0 ;
io_throttle = virJSONValueObjectGet ( result , "return" ) ;
if ( ! io_throttle || io_throttle -> type != VIR_JSON_TYPE_ARRAY ) {
qemuReportError ( VIR_ERR_INTERNAL_ERROR , "%s" , _ ( " block_io_throttle reply was missing device list" ) ) ;
goto cleanup ;
}
for ( i = 0 ;
i < virJSONValueArraySize ( io_throttle ) ;
i ++ ) {
virJSONValuePtr temp_dev = virJSONValueArrayGet ( io_throttle , i ) ;
virJSONValuePtr inserted ;
const char * current_dev ;
if ( ! temp_dev || temp_dev -> type != VIR_JSON_TYPE_OBJECT ) {
qemuReportError ( VIR_ERR_INTERNAL_ERROR , "%s" , _ ( "block io throttle device entry was not in expected format" ) ) ;
goto cleanup ;
}
if ( ( current_dev = virJSONValueObjectGetString ( temp_dev , "device" ) ) == NULL ) {
qemuReportError ( VIR_ERR_INTERNAL_ERROR , "%s" , _ ( "block io throttle device entry was not in expected format" ) ) ;
goto cleanup ;
}
if ( STRPREFIX ( current_dev , QEMU_DRIVE_HOST_PREFIX ) ) current_dev += strlen ( QEMU_DRIVE_HOST_PREFIX ) ;
if ( STREQ ( current_dev , device ) ) continue ;
found = 1 ;
if ( ( inserted = virJSONValueObjectGet ( temp_dev , "inserted" ) ) == NULL || inserted -> type != VIR_JSON_TYPE_OBJECT ) {
qemuReportError ( VIR_ERR_INTERNAL_ERROR , "%s" , _ ( "block io throttle inserted entry was not in expected format" ) ) ;
goto cleanup ;
}
if ( virJSONValueObjectGetNumberUlong ( inserted , "bps" , & reply -> total_bytes_sec ) < 0 ) {
qemuReportError ( VIR_ERR_INTERNAL_ERROR , "%s" , _ ( "cannot read total_bytes_sec" ) ) ;
goto cleanup ;
}
if ( virJSONValueObjectGetNumberUlong ( inserted , "bps_rd" , & reply -> read_bytes_sec ) < 0 ) {
qemuReportError ( VIR_ERR_INTERNAL_ERROR , "%s" , _ ( "cannot read read_bytes_sec" ) ) ;
goto cleanup ;
}
if ( virJSONValueObjectGetNumberUlong ( inserted , "bps_wr" , & reply -> write_bytes_sec ) < 0 ) {
qemuReportError ( VIR_ERR_INTERNAL_ERROR , "%s" , _ ( "cannot read write_bytes_sec" ) ) ;
goto cleanup ;
}
if ( virJSONValueObjectGetNumberUlong ( inserted , "iops" , & reply -> total_iops_sec ) < 0 ) {
qemuReportError ( VIR_ERR_INTERNAL_ERROR , "%s" , _ ( "cannot read total_iops_sec" ) ) ;
goto cleanup ;
}
if ( virJSONValueObjectGetNumberUlong ( inserted , "iops_rd" , & reply -> read_iops_sec ) < 0 ) {
qemuReportError ( VIR_ERR_INTERNAL_ERROR , "%s" , _ ( "cannot read read_iops_sec" ) ) ;
goto cleanup ;
}
if ( virJSONValueObjectGetNumberUlong ( inserted , "iops_wr" , & reply -> write_iops_sec ) < 0 ) {
qemuReportError ( VIR_ERR_INTERNAL_ERROR , "%s" , _ ( "cannot read write_iops_sec" ) ) ;
goto cleanup ;
}
break ;
}
if ( ! found ) {
qemuReportError ( VIR_ERR_INTERNAL_ERROR , _ ( "cannot find throttling info for device '%s'" ) , device ) ;
goto cleanup ;
}
ret = 0 ;
cleanup : return ret ;
} |
2,546,373,479,020,365,300 | debian | 18 | 0 | MIMEField * _mime_hdr_field_list_search_by_string ( MIMEHdrImpl * mh , const char * field_name_str , int field_name_len ) {
MIMEFieldBlockImpl * fblock ;
MIMEField * field , * too_far_field ;
ink_assert ( mh ) ;
for ( fblock = & ( mh -> m_first_fblock ) ;
fblock != nullptr ;
fblock = fblock -> m_next ) {
field = & ( fblock -> m_field_slots [ 0 ] ) ;
too_far_field = & ( fblock -> m_field_slots [ fblock -> m_freetop ] ) ;
while ( field < too_far_field ) {
if ( field -> is_live ( ) && ( field_name_len == field -> m_len_name ) && ( strncasecmp ( field -> m_ptr_name , field_name_str , field_name_len ) == 0 ) ) {
return field ;
}
++ field ;
}
}
return nullptr ;
} |
2,387,725,018,197,272,000 | debian | 85 | 0 | static int decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) {
KmvcContext * const ctx = avctx -> priv_data ;
AVFrame * frame = data ;
uint8_t * out , * src ;
int i , ret ;
int header ;
int blocksize ;
const uint8_t * pal = av_packet_get_side_data ( avpkt , AV_PKT_DATA_PALETTE , NULL ) ;
bytestream2_init ( & ctx -> g , avpkt -> data , avpkt -> size ) ;
if ( ( ret = ff_get_buffer ( avctx , frame , 0 ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return ret ;
}
header = bytestream2_get_byte ( & ctx -> g ) ;
if ( bytestream2_peek_byte ( & ctx -> g ) == 127 ) {
bytestream2_skip ( & ctx -> g , 3 ) ;
for ( i = 0 ;
i < 127 ;
i ++ ) {
ctx -> pal [ i + ( header & 0x81 ) ] = bytestream2_get_be24 ( & ctx -> g ) ;
bytestream2_skip ( & ctx -> g , 1 ) ;
}
bytestream2_seek ( & ctx -> g , - 127 * 4 - 3 , SEEK_CUR ) ;
}
if ( header & KMVC_KEYFRAME ) {
frame -> key_frame = 1 ;
frame -> pict_type = AV_PICTURE_TYPE_I ;
}
else {
frame -> key_frame = 0 ;
frame -> pict_type = AV_PICTURE_TYPE_P ;
}
if ( header & KMVC_PALETTE ) {
frame -> palette_has_changed = 1 ;
for ( i = 1 ;
i <= ctx -> palsize ;
i ++ ) {
ctx -> pal [ i ] = bytestream2_get_be24 ( & ctx -> g ) ;
}
}
if ( pal ) {
frame -> palette_has_changed = 1 ;
memcpy ( ctx -> pal , pal , AVPALETTE_SIZE ) ;
}
if ( ctx -> setpal ) {
ctx -> setpal = 0 ;
frame -> palette_has_changed = 1 ;
}
memcpy ( frame -> data [ 1 ] , ctx -> pal , 1024 ) ;
blocksize = bytestream2_get_byte ( & ctx -> g ) ;
if ( blocksize != 8 && blocksize != 127 ) {
av_log ( avctx , AV_LOG_ERROR , "Block size = %i\n" , blocksize ) ;
return AVERROR_INVALIDDATA ;
}
memset ( ctx -> cur , 0 , 320 * 200 ) ;
switch ( header & KMVC_METHOD ) {
case 0 : case 1 : memcpy ( ctx -> cur , ctx -> prev , 320 * 200 ) ;
break ;
case 3 : kmvc_decode_intra_8x8 ( ctx , avctx -> width , avctx -> height ) ;
break ;
case 4 : kmvc_decode_inter_8x8 ( ctx , avctx -> width , avctx -> height ) ;
break ;
default : av_log ( avctx , AV_LOG_ERROR , "Unknown compression method %i\n" , header & KMVC_METHOD ) ;
return AVERROR_INVALIDDATA ;
}
out = frame -> data [ 0 ] ;
src = ctx -> cur ;
for ( i = 0 ;
i < avctx -> height ;
i ++ ) {
memcpy ( out , src , avctx -> width ) ;
src += 320 ;
out += frame -> linesize [ 0 ] ;
}
if ( ctx -> cur == ctx -> frm0 ) {
ctx -> cur = ctx -> frm1 ;
ctx -> prev = ctx -> frm0 ;
}
else {
ctx -> cur = ctx -> frm0 ;
ctx -> prev = ctx -> frm1 ;
}
* got_frame = 1 ;
return avpkt -> size ;
} |
-3,053,641,395,158,209,000 | debian | 49 | 0 | static int x ( struct vcache * avc , int afun , struct vrequest * areq , \ struct afs_pdata * ain , struct afs_pdata * aout , \ afs_ucred_t * * acred ) DECL_PIOCTL ( PGetFID ) ;
DECL_PIOCTL ( PSetAcl ) ;
DECL_PIOCTL ( PStoreBehind ) ;
DECL_PIOCTL ( PGCPAGs ) ;
DECL_PIOCTL ( PGetAcl ) ;
DECL_PIOCTL ( PNoop ) ;
DECL_PIOCTL ( PBogus ) ;
DECL_PIOCTL ( PGetFileCell ) ;
DECL_PIOCTL ( PGetWSCell ) ;
DECL_PIOCTL ( PGetUserCell ) ;
DECL_PIOCTL ( PSetTokens ) ;
DECL_PIOCTL ( PGetVolumeStatus ) ;
DECL_PIOCTL ( PSetVolumeStatus ) ;
DECL_PIOCTL ( PFlush ) ;
DECL_PIOCTL ( PNewStatMount ) ;
DECL_PIOCTL ( PGetTokens ) ;
DECL_PIOCTL ( PUnlog ) ;
DECL_PIOCTL ( PMariner ) ;
DECL_PIOCTL ( PCheckServers ) ;
DECL_PIOCTL ( PCheckVolNames ) ;
DECL_PIOCTL ( PCheckAuth ) ;
DECL_PIOCTL ( PFindVolume ) ;
DECL_PIOCTL ( PViceAccess ) ;
DECL_PIOCTL ( PSetCacheSize ) ;
DECL_PIOCTL ( PGetCacheSize ) ;
DECL_PIOCTL ( PRemoveCallBack ) ;
DECL_PIOCTL ( PNewCell ) ;
DECL_PIOCTL ( PNewAlias ) ;
DECL_PIOCTL ( PListCells ) ;
DECL_PIOCTL ( PListAliases ) ;
DECL_PIOCTL ( PRemoveMount ) ;
DECL_PIOCTL ( PGetCellStatus ) ;
DECL_PIOCTL ( PSetCellStatus ) ;
DECL_PIOCTL ( PFlushVolumeData ) ;
DECL_PIOCTL ( PFlushAllVolumeData ) ;
DECL_PIOCTL ( PGetVnodeXStatus ) ;
DECL_PIOCTL ( PGetVnodeXStatus2 ) ;
DECL_PIOCTL ( PSetSysName ) ;
DECL_PIOCTL ( PSetSPrefs ) ;
DECL_PIOCTL ( PSetSPrefs33 ) ;
DECL_PIOCTL ( PGetSPrefs ) ;
DECL_PIOCTL ( PExportAfs ) ;
DECL_PIOCTL ( PGag ) ;
DECL_PIOCTL ( PTwiddleRx ) ;
DECL_PIOCTL ( PGetInitParams ) ;
DECL_PIOCTL ( PGetRxkcrypt ) ;
DECL_PIOCTL ( PSetRxkcrypt ) ;
DECL_PIOCTL ( PGetCPrefs ) ;
DECL_PIOCTL ( PSetCPrefs ) |
6,393,050,609,822,898,000 | debian | 32 | 0 | static TRBCCode xhci_alloc_device_streams ( XHCIState * xhci , unsigned int slotid , uint32_t epmask ) {
XHCIEPContext * epctxs [ 30 ] ;
USBEndpoint * eps [ 30 ] ;
int i , r , nr_eps , req_nr_streams , dev_max_streams ;
nr_eps = xhci_epmask_to_eps_with_streams ( xhci , slotid , epmask , epctxs , eps ) ;
if ( nr_eps == 0 ) {
return CC_SUCCESS ;
}
req_nr_streams = epctxs [ 0 ] -> nr_pstreams ;
dev_max_streams = eps [ 0 ] -> max_streams ;
for ( i = 1 ;
i < nr_eps ;
i ++ ) {
if ( epctxs [ i ] -> nr_pstreams != req_nr_streams ) {
FIXME ( "guest streams config not identical for all eps" ) ;
return CC_RESOURCE_ERROR ;
}
if ( eps [ i ] -> max_streams != dev_max_streams ) {
FIXME ( "device streams config not identical for all eps" ) ;
return CC_RESOURCE_ERROR ;
}
}
if ( req_nr_streams > dev_max_streams ) {
req_nr_streams = dev_max_streams ;
}
r = usb_device_alloc_streams ( eps [ 0 ] -> dev , eps , nr_eps , req_nr_streams ) ;
if ( r != 0 ) {
DPRINTF ( "xhci: alloc streams failed\n" ) ;
return CC_RESOURCE_ERROR ;
}
return CC_SUCCESS ;
} |
-7,853,481,279,968,318,000 | chrome | 4 | 0 | static int get_aq_c_strength ( int q_index , vpx_bit_depth_t bit_depth ) {
const int base_quant = vp9_ac_quant ( q_index , 0 , bit_depth ) / 4 ;
return ( base_quant > 20 ) + ( base_quant > 45 ) ;
} |
2,917,602,761,308,156,400 | debian | 34 | 1 | static Asn1Generic * DecodeAsn1DerPrintableString ( const unsigned char * buffer , uint32_t max_size , uint8_t depth , uint32_t * errcode ) {
const unsigned char * d_ptr = buffer ;
uint32_t length , numbytes ;
Asn1Generic * a ;
unsigned char c ;
d_ptr ++ ;
c = d_ptr [ 0 ] ;
if ( ( c & ( 1 << 7 ) ) >> 7 == 0 ) {
length = c ;
d_ptr ++ ;
}
else {
numbytes = c & 0x7f ;
d_ptr ++ ;
if ( DecodeAsn1BuildValue ( & d_ptr , & length , numbytes , errcode ) == - 1 ) {
return NULL ;
}
}
if ( length > max_size ) return NULL ;
a = Asn1GenericNew ( ) ;
if ( a == NULL ) return NULL ;
a -> type = ASN1_PRINTSTRING ;
a -> strlen = length ;
a -> str = SCMalloc ( length + 1 ) ;
if ( a -> str == NULL ) {
SCFree ( a ) ;
return NULL ;
}
strlcpy ( a -> str , ( const char * ) d_ptr , length + 1 ) ;
a -> str [ length ] = '\0' ;
d_ptr += length ;
a -> length = ( d_ptr - buffer ) ;
return a ;
} |
-2,908,211,205,972,632,000 | debian | 29 | 0 | static void cmd_window_hide ( const char * data ) {
WINDOW_REC * window ;
if ( mainwindows -> next == NULL ) {
printformat_window ( active_win , MSGLEVEL_CLIENTNOTICE , TXT_CANT_HIDE_LAST ) ;
return ;
}
if ( * data == '\0' ) window = active_win ;
else if ( is_numeric ( data , 0 ) ) {
window = window_find_refnum ( atoi ( data ) ) ;
if ( window == NULL ) {
printformat_window ( active_win , MSGLEVEL_CLIENTERROR , TXT_REFNUM_NOT_FOUND , data ) ;
}
}
else {
window = window_find_item ( active_win -> active_server , data ) ;
}
if ( window == NULL || ! is_window_visible ( window ) ) return ;
if ( WINDOW_MAIN ( window ) -> sticky_windows ) {
if ( ! settings_get_bool ( "autounstick_windows" ) ) {
printformat_window ( active_win , MSGLEVEL_CLIENTERROR , TXT_CANT_HIDE_STICKY_WINDOWS ) ;
return ;
}
}
mainwindow_destroy ( WINDOW_MAIN ( window ) ) ;
if ( active_mainwin == NULL ) {
active_mainwin = WINDOW_MAIN ( active_win ) ;
window_set_active ( active_mainwin -> active ) ;
}
} |
2,895,622,461,494,525,400 | debian | 39 | 0 | static void test_bug20152 ( ) {
MYSQL_BIND my_bind [ 1 ] ;
MYSQL_STMT * stmt ;
MYSQL_TIME tm ;
int rc ;
const char * query = "INSERT INTO t1 (f1) VALUES (?)" ;
myheader ( "test_bug20152" ) ;
memset ( my_bind , 0 , sizeof ( my_bind ) ) ;
my_bind [ 0 ] . buffer_type = MYSQL_TYPE_DATE ;
my_bind [ 0 ] . buffer = ( void * ) & tm ;
tm . year = 2006 ;
tm . month = 6 ;
tm . day = 18 ;
tm . hour = 14 ;
tm . minute = 9 ;
tm . second = 42 ;
rc = mysql_query ( mysql , "DROP TABLE IF EXISTS t1" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "CREATE TABLE t1 (f1 DATE)" ) ;
myquery ( rc ) ;
stmt = mysql_stmt_init ( mysql ) ;
rc = mysql_stmt_prepare ( stmt , query , strlen ( query ) ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_bind_param ( stmt , my_bind ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_close ( stmt ) ;
check_execute ( stmt , rc ) ;
rc = mysql_query ( mysql , "DROP TABLE t1" ) ;
myquery ( rc ) ;
if ( tm . hour == 14 && tm . minute == 9 && tm . second == 42 ) {
if ( ! opt_silent ) printf ( "OK!" ) ;
}
else {
printf ( "[14:09:42] != [%02d:%02d:%02d]\n" , tm . hour , tm . minute , tm . second ) ;
DIE_UNLESS ( 0 == 1 ) ;
}
} |
1,676,654,288,894,940,700 | debian | 30 | 1 | void kadmin_getpol ( int argc , char * argv [ ] ) {
krb5_error_code retval ;
kadm5_policy_ent_rec policy ;
if ( ! ( argc == 2 || ( argc == 3 && ! strcmp ( "-terse" , argv [ 1 ] ) ) ) ) {
fprintf ( stderr , _ ( "usage: get_policy [-terse] policy\n" ) ) ;
return ;
}
retval = kadm5_get_policy ( handle , argv [ argc - 1 ] , & policy ) ;
if ( retval ) {
com_err ( "get_policy" , retval , _ ( "while retrieving policy \"%s\"." ) , argv [ argc - 1 ] ) ;
return ;
}
if ( argc == 2 ) {
printf ( _ ( "Policy: %s\n" ) , policy . policy ) ;
printf ( _ ( "Maximum password life: %ld\n" ) , policy . pw_max_life ) ;
printf ( _ ( "Minimum password life: %ld\n" ) , policy . pw_min_life ) ;
printf ( _ ( "Minimum password length: %ld\n" ) , policy . pw_min_length ) ;
printf ( _ ( "Minimum number of password character classes: %ld\n" ) , policy . pw_min_classes ) ;
printf ( _ ( "Number of old keys kept: %ld\n" ) , policy . pw_history_num ) ;
printf ( _ ( "Reference count: %ld\n" ) , policy . policy_refcnt ) ;
printf ( _ ( "Maximum password failures before lockout: %lu\n" ) , ( unsigned long ) policy . pw_max_fail ) ;
printf ( _ ( "Password failure count reset interval: %s\n" ) , strdur ( policy . pw_failcnt_interval ) ) ;
printf ( _ ( "Password lockout duration: %s\n" ) , strdur ( policy . pw_lockout_duration ) ) ;
if ( policy . allowed_keysalts != NULL ) printf ( _ ( "Allowed key/salt types: %s\n" ) , policy . allowed_keysalts ) ;
}
else {
printf ( "\"%s\"\t%ld\t%ld\t%ld\t%ld\t%ld\t%ld\t%lu\t%ld\t%ld\t%s\n" , policy . policy , policy . pw_max_life , policy . pw_min_life , policy . pw_min_length , policy . pw_min_classes , policy . pw_history_num , policy . policy_refcnt , ( unsigned long ) policy . pw_max_fail , ( long ) policy . pw_failcnt_interval , ( long ) policy . pw_lockout_duration , ( policy . allowed_keysalts == NULL ) ? "-" : policy . allowed_keysalts ) ;
}
kadm5_free_policy_ent ( handle , & policy ) ;
} |
-5,615,323,818,347,734,000 | debian | 189 | 0 | my_bool mysqld_get_one_option ( int optid , const struct my_option * opt __attribute__ ( ( unused ) ) , char * argument ) {
switch ( optid ) {
case '#' : # ifndef DBUG_OFF if ( ! argument ) argument = ( char * ) default_dbug_option ;
if ( argument [ 0 ] == '0' && ! argument [ 1 ] ) {
DEBUGGER_OFF ;
break ;
}
DEBUGGER_ON ;
if ( argument [ 0 ] == '1' && ! argument [ 1 ] ) break ;
DBUG_SET_INITIAL ( argument ) ;
opt_endinfo = 1 ;
# else sql_print_warning ( "'%s' is disabled in this build" , opt -> name ) ;
# endif break ;
case OPT_DEPRECATED_OPTION : sql_print_warning ( "'%s' is deprecated. It does nothing and exists only " "for compatiblity with old my.cnf files." , opt -> name ) ;
break ;
case 'a' : global_system_variables . sql_mode = MODE_ANSI ;
global_system_variables . tx_isolation = ISO_SERIALIZABLE ;
break ;
case 'b' : strmake_buf ( mysql_home , argument ) ;
break ;
case 'C' : if ( default_collation_name == compiled_default_collation_name ) default_collation_name = 0 ;
break ;
case 'l' : WARN_DEPRECATED ( NULL , 7 , 0 , "--log" , "'--general-log'/'--general-log-file'" ) ;
opt_log = 1 ;
break ;
case 'h' : strmake_buf ( mysql_real_data_home , argument ) ;
mysql_real_data_home_ptr = mysql_real_data_home ;
break ;
case 'u' : if ( ! mysqld_user || ! strcmp ( mysqld_user , argument ) ) mysqld_user = argument ;
else sql_print_warning ( "Ignoring user change to '%s' because the user was set to '%s' earlier on the command line\n" , argument , mysqld_user ) ;
break ;
case 'L' : strmake_buf ( lc_messages_dir , argument ) ;
break ;
case OPT_BINLOG_FORMAT : binlog_format_used = true ;
break ;
# include < sslopt - case . h > # ifndef EMBEDDED_LIBRARY case 'V' : print_version ( ) ;
opt_abort = 1 ;
break ;
# endif case 'W' : if ( ! argument ) global_system_variables . log_warnings ++ ;
else if ( argument == disabled_my_option ) global_system_variables . log_warnings = 0L ;
else global_system_variables . log_warnings = atoi ( argument ) ;
break ;
case 'T' : test_flags = argument ? ( uint ) atoi ( argument ) : 0 ;
opt_endinfo = 1 ;
break ;
case OPT_THREAD_CONCURRENCY : WARN_DEPRECATED_NO_REPLACEMENT ( NULL , "THREAD_CONCURRENCY" ) ;
break ;
case ( int ) OPT_ISAM_LOG : opt_myisam_log = 1 ;
break ;
case ( int ) OPT_BIN_LOG : opt_bin_log = test ( argument != disabled_my_option ) ;
opt_bin_log_used = 1 ;
break ;
case ( int ) OPT_LOG_BASENAME : {
if ( opt_log_basename [ 0 ] == 0 || strchr ( opt_log_basename , FN_EXTCHAR ) || strchr ( opt_log_basename , FN_LIBCHAR ) ) {
sql_print_error ( "Wrong argument for --log-basename. It can't be empty or contain '.' or '" FN_DIRSEP "'" ) ;
return 1 ;
}
if ( log_error_file_ptr != disabled_my_option ) log_error_file_ptr = opt_log_basename ;
make_default_log_name ( & opt_logname , ".log" , false ) ;
make_default_log_name ( & opt_slow_logname , "-slow.log" , false ) ;
make_default_log_name ( & opt_bin_logname , "-bin" , true ) ;
make_default_log_name ( & opt_binlog_index_name , "-bin.index" , true ) ;
make_default_log_name ( & opt_relay_logname , "-relay-bin" , true ) ;
make_default_log_name ( & opt_relaylog_index_name , "-relay-bin.index" , true ) ;
pidfile_name_ptr = pidfile_name ;
strmake ( pidfile_name , argument , sizeof ( pidfile_name ) - 5 ) ;
strmov ( fn_ext ( pidfile_name ) , ".pid" ) ;
if ( ! opt_bin_logname || ! opt_relaylog_index_name || ! opt_logname || ! opt_slow_logname || ! pidfile_name_ptr ) return 1 ;
break ;
}
# ifdef HAVE_REPLICATION case ( int ) OPT_REPLICATE_IGNORE_DB : {
rpl_filter -> add_ignore_db ( argument ) ;
break ;
}
case ( int ) OPT_REPLICATE_DO_DB : {
rpl_filter -> add_do_db ( argument ) ;
break ;
}
case ( int ) OPT_REPLICATE_REWRITE_DB : {
char * key = argument , * p , * val ;
if ( ! ( p = strstr ( argument , "->" ) ) ) {
sql_print_error ( "Bad syntax in replicate-rewrite-db - missing '->'!\n" ) ;
return 1 ;
}
val = p -- ;
while ( my_isspace ( mysqld_charset , * p ) && p > argument ) * p -- = 0 ;
if ( p == argument ) {
sql_print_error ( "Bad syntax in replicate-rewrite-db - empty FROM db!\n" ) ;
return 1 ;
}
* val = 0 ;
val += 2 ;
while ( * val && my_isspace ( mysqld_charset , * val ) ) val ++ ;
if ( ! * val ) {
sql_print_error ( "Bad syntax in replicate-rewrite-db - empty TO db!\n" ) ;
return 1 ;
}
rpl_filter -> add_db_rewrite ( key , val ) ;
break ;
}
case ( int ) OPT_BINLOG_IGNORE_DB : {
binlog_filter -> add_ignore_db ( argument ) ;
break ;
}
case ( int ) OPT_BINLOG_DO_DB : {
binlog_filter -> add_do_db ( argument ) ;
break ;
}
case ( int ) OPT_REPLICATE_DO_TABLE : {
if ( rpl_filter -> add_do_table ( argument ) ) {
sql_print_error ( "Could not add do table rule '%s'!\n" , argument ) ;
return 1 ;
}
break ;
}
case ( int ) OPT_REPLICATE_WILD_DO_TABLE : {
if ( rpl_filter -> add_wild_do_table ( argument ) ) {
sql_print_error ( "Could not add do table rule '%s'!\n" , argument ) ;
return 1 ;
}
break ;
}
case ( int ) OPT_REPLICATE_WILD_IGNORE_TABLE : {
if ( rpl_filter -> add_wild_ignore_table ( argument ) ) {
sql_print_error ( "Could not add ignore table rule '%s'!\n" , argument ) ;
return 1 ;
}
break ;
}
case ( int ) OPT_REPLICATE_IGNORE_TABLE : {
if ( rpl_filter -> add_ignore_table ( argument ) ) {
sql_print_error ( "Could not add ignore table rule '%s'!\n" , argument ) ;
return 1 ;
}
break ;
}
# endif case ( int ) OPT_SLOW_QUERY_LOG : WARN_DEPRECATED ( NULL , 7 , 0 , "--log-slow-queries" , "'--slow-query-log'/'--slow-query-log-file'" ) ;
opt_slow_log = 1 ;
break ;
case ( int ) OPT_SAFE : opt_specialflag |= SPECIAL_SAFE_MODE | SPECIAL_NO_NEW_FUNC ;
delay_key_write_options = ( uint ) DELAY_KEY_WRITE_NONE ;
myisam_recover_options = HA_RECOVER_DEFAULT ;
ha_open_options &= ~ ( HA_OPEN_DELAY_KEY_WRITE ) ;
# ifdef HAVE_QUERY_CACHE query_cache_size = 0 ;
# endif sql_print_warning ( "The syntax '--safe-mode' is deprecated and will be " "removed in a future release." ) ;
break ;
case ( int ) OPT_SKIP_PRIOR : opt_specialflag |= SPECIAL_NO_PRIOR ;
sql_print_warning ( "The --skip-thread-priority startup option is deprecated " "and will be removed in MySQL 7.0. This option has no effect " "as the implied behavior is already the default." ) ;
break ;
case ( int ) OPT_SKIP_HOST_CACHE : opt_specialflag |= SPECIAL_NO_HOST_CACHE ;
break ;
case ( int ) OPT_SKIP_RESOLVE : opt_skip_name_resolve = 1 ;
opt_specialflag |= SPECIAL_NO_RESOLVE ;
break ;
case ( int ) OPT_WANT_CORE : test_flags |= TEST_CORE_ON_SIGNAL ;
break ;
case OPT_CONSOLE : if ( opt_console ) opt_error_log = 0 ;
break ;
case OPT_BOOTSTRAP : opt_noacl = opt_bootstrap = 1 ;
break ;
case OPT_SERVER_ID : server_id_supplied = 1 ;
break ;
case OPT_ONE_THREAD : thread_handling = SCHEDULER_NO_THREADS ;
break ;
case OPT_LOWER_CASE_TABLE_NAMES : lower_case_table_names_used = 1 ;
break ;
# if defined ( ENABLED_DEBUG_SYNC ) case OPT_DEBUG_SYNC_TIMEOUT : if ( ! argument ) {
opt_debug_sync_timeout = DEBUG_SYNC_DEFAULT_WAIT_TIMEOUT ;
}
break ;
# endif case OPT_ENGINE_CONDITION_PUSHDOWN : if ( global_system_variables . engine_condition_pushdown ) global_system_variables . optimizer_switch |= OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN ;
else global_system_variables . optimizer_switch &= ~ OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN ;
break ;
case OPT_LOG_ERROR : if ( argument == NULL ) log_error_file_ptr = const_cast < char * > ( "" ) ;
break ;
case OPT_MAX_LONG_DATA_SIZE : max_long_data_size_used = true ;
break ;
case OPT_IGNORE_DB_DIRECTORY : opt_ignore_db_dirs = NULL ;
if ( * argument == 0 ) ignore_db_dirs_reset ( ) ;
else {
if ( push_ignored_db_dir ( argument ) ) {
sql_print_error ( "Can't start server: " "cannot process --ignore-db-dir=%.*s" , FN_REFLEN , argument ) ;
return 1 ;
}
}
break ;
}
return 0 ;
} |
1,760,449,185,745,615,400 | debian | 7 | 0 | TSReturnCode TSHttpAltInfoClientReqGet ( TSHttpAltInfo infop , TSMBuffer * bufp , TSMLoc * obj ) {
sdk_assert ( sdk_sanity_check_alt_info ( infop ) == TS_SUCCESS ) ;
HttpAltInfo * info = ( HttpAltInfo * ) infop ;
* ( reinterpret_cast < HTTPHdr * * > ( bufp ) ) = & info -> m_client_req ;
* obj = reinterpret_cast < TSMLoc > ( info -> m_client_req . m_http ) ;
return sdk_sanity_check_mbuffer ( * bufp ) ;
} |
-4,485,517,653,926,466,000 | chrome | 20 | 0 | void vp9_loop_filter_alloc ( VP9LfSync * lf_sync , VP9_COMMON * cm , int rows , int width ) {
lf_sync -> rows = rows ;
# if CONFIG_MULTITHREAD {
int i ;
CHECK_MEM_ERROR ( cm , lf_sync -> mutex_ , vpx_malloc ( sizeof ( * lf_sync -> mutex_ ) * rows ) ) ;
for ( i = 0 ;
i < rows ;
++ i ) {
pthread_mutex_init ( & lf_sync -> mutex_ [ i ] , NULL ) ;
}
CHECK_MEM_ERROR ( cm , lf_sync -> cond_ , vpx_malloc ( sizeof ( * lf_sync -> cond_ ) * rows ) ) ;
for ( i = 0 ;
i < rows ;
++ i ) {
pthread_cond_init ( & lf_sync -> cond_ [ i ] , NULL ) ;
}
}
# endif CHECK_MEM_ERROR ( cm , lf_sync -> cur_sb_col , vpx_malloc ( sizeof ( * lf_sync -> cur_sb_col ) * rows ) ) ;
lf_sync -> sync_range = get_sync_range ( width ) ;
} |
-5,706,788,925,640,467,000 | chrome | 52 | 0 | static void auto_partition_range ( VP9_COMP * cpi , const TileInfo * const tile , int mi_row , int mi_col , BLOCK_SIZE * min_block_size , BLOCK_SIZE * max_block_size ) {
VP9_COMMON * const cm = & cpi -> common ;
MACROBLOCKD * const xd = & cpi -> mb . e_mbd ;
MODE_INFO * mi_8x8 = xd -> mi ;
const int left_in_image = xd -> left_available && mi_8x8 [ - 1 ] . src_mi ;
const int above_in_image = xd -> up_available && mi_8x8 [ - xd -> mi_stride ] . src_mi ;
int row8x8_remaining = tile -> mi_row_end - mi_row ;
int col8x8_remaining = tile -> mi_col_end - mi_col ;
int bh , bw ;
BLOCK_SIZE min_size = BLOCK_32X32 ;
BLOCK_SIZE max_size = BLOCK_8X8 ;
int bsl = mi_width_log2 ( BLOCK_64X64 ) ;
const int search_range_ctrl = ( ( ( mi_row + mi_col ) >> bsl ) + get_chessboard_index ( cm -> current_video_frame ) ) & 0x1 ;
if ( search_range_ctrl && ( left_in_image || above_in_image || cm -> frame_type != KEY_FRAME ) ) {
int block ;
MODE_INFO * mi ;
BLOCK_SIZE sb_type ;
if ( left_in_image ) {
MODE_INFO * cur_mi ;
mi = mi_8x8 [ - 1 ] . src_mi ;
for ( block = 0 ;
block < MI_BLOCK_SIZE ;
++ block ) {
cur_mi = mi [ block * xd -> mi_stride ] . src_mi ;
sb_type = cur_mi ? cur_mi -> mbmi . sb_type : 0 ;
min_size = MIN ( min_size , sb_type ) ;
max_size = MAX ( max_size , sb_type ) ;
}
}
if ( above_in_image ) {
mi = mi_8x8 [ - xd -> mi_stride * MI_BLOCK_SIZE ] . src_mi ;
for ( block = 0 ;
block < MI_BLOCK_SIZE ;
++ block ) {
sb_type = mi [ block ] . src_mi ? mi [ block ] . src_mi -> mbmi . sb_type : 0 ;
min_size = MIN ( min_size , sb_type ) ;
max_size = MAX ( max_size , sb_type ) ;
}
}
min_size = min_partition_size [ min_size ] ;
max_size = find_partition_size ( max_size , row8x8_remaining , col8x8_remaining , & bh , & bw ) ;
min_size = MIN ( min_size , max_size ) ;
min_size = MAX ( min_size , BLOCK_8X8 ) ;
max_size = MIN ( max_size , BLOCK_32X32 ) ;
}
else {
min_size = BLOCK_8X8 ;
max_size = BLOCK_32X32 ;
}
* min_block_size = min_size ;
* max_block_size = max_size ;
} |
8,849,962,823,026,424,000 | debian | 23 | 0 | static gboolean qio_channel_websock_handshake_io ( QIOChannel * ioc , GIOCondition condition , gpointer user_data ) {
QIOTask * task = user_data ;
QIOChannelWebsock * wioc = QIO_CHANNEL_WEBSOCK ( qio_task_get_source ( task ) ) ;
Error * err = NULL ;
int ret ;
ret = qio_channel_websock_handshake_read ( wioc , & err ) ;
if ( ret < 0 ) {
trace_qio_channel_websock_handshake_fail ( ioc , error_get_pretty ( err ) ) ;
qio_task_set_error ( task , err ) ;
qio_task_complete ( task ) ;
return FALSE ;
}
if ( ret == 0 ) {
trace_qio_channel_websock_handshake_pending ( ioc , G_IO_IN ) ;
return TRUE ;
}
if ( err ) {
error_propagate ( & wioc -> io_err , err ) ;
}
trace_qio_channel_websock_handshake_reply ( ioc ) ;
qio_channel_add_watch ( wioc -> master , G_IO_OUT , qio_channel_websock_handshake_send , task , NULL ) ;
return FALSE ;
} |
-8,054,970,867,770,516,000 | debian | 14 | 0 | u_int sl_bsdos_if_print ( netdissect_options * ndo , const struct pcap_pkthdr * h , const u_char * p ) {
register u_int caplen = h -> caplen ;
register u_int length = h -> len ;
register const struct ip * ip ;
if ( caplen < SLIP_HDRLEN ) {
ND_PRINT ( ( ndo , "%s" , tstr ) ) ;
return ( caplen ) ;
}
length -= SLIP_HDRLEN ;
ip = ( const struct ip * ) ( p + SLIP_HDRLEN ) ;
# ifdef notdef if ( ndo -> ndo_eflag ) sliplink_print ( ndo , p , ip , length ) ;
# endif ip_print ( ndo , ( const u_char * ) ip , length ) ;
return ( SLIP_HDRLEN ) ;
} |
-1,335,877,942,018,854,400 | chrome | 5 | 0 | IN_PROC_BROWSER_TEST_F ( UnloadTest , DISABLED_CrossSiteInfiniteBeforeUnloadSync ) {
if ( base : : CommandLine : : ForCurrentProcess ( ) -> HasSwitch ( switches : : kSingleProcess ) ) return ;
NavigateToDataURL ( INFINITE_BEFORE_UNLOAD_HTML , "infinitebeforeunload" ) ;
NavigateToNolistenersFileTwice ( ) ;
} |
-5,992,472,514,718,425,000 | debian | 12 | 0 | static bool cgfs_unfreeze ( void * hdata ) {
struct cgfs_data * d = hdata ;
char * cgabspath , * cgrelpath ;
int ret ;
if ( ! d ) return false ;
cgrelpath = lxc_cgroup_get_hierarchy_path_data ( "freezer" , d ) ;
cgabspath = lxc_cgroup_find_abs_path ( "freezer" , cgrelpath , true , NULL ) ;
if ( ! cgabspath ) return false ;
ret = do_cgroup_set ( cgabspath , "freezer.state" , "THAWED" ) ;
free ( cgabspath ) ;
return ret == 0 ;
} |
7,823,043,019,110,227,000 | chrome | 6 | 1 | TEST_F ( ExternalProtocolHandlerTest , TestGetBlockStateDefaultBlock ) {
ExternalProtocolHandler : : BlockState block_state = ExternalProtocolHandler : : GetBlockState ( "afp" , profile_ . get ( ) ) ;
EXPECT_EQ ( ExternalProtocolHandler : : BLOCK , block_state ) ;
EXPECT_TRUE ( local_state_ -> GetDictionary ( prefs : : kExcludedSchemes ) -> empty ( ) ) ;
EXPECT_FALSE ( profile_ -> GetPrefs ( ) -> GetDictionary ( prefs : : kExcludedSchemes ) -> empty ( ) ) ;
} |
1,788,300,783,882,316,800 | debian | 74 | 0 | void ff_estimate_b_frame_motion ( MpegEncContext * s , int mb_x , int mb_y ) {
MotionEstContext * const c = & s -> me ;
const int penalty_factor = c -> mb_penalty_factor ;
int fmin , bmin , dmin , fbmin , bimin , fimin ;
int type = 0 ;
const int xy = mb_y * s -> mb_stride + mb_x ;
init_ref ( c , s -> new_picture . f . data , s -> last_picture . f . data , s -> next_picture . f . data , 16 * mb_x , 16 * mb_y , 2 ) ;
get_limits ( s , 16 * mb_x , 16 * mb_y ) ;
c -> skip = 0 ;
if ( s -> codec_id == AV_CODEC_ID_MPEG4 && s -> next_picture . mbskip_table [ xy ] ) {
int score = direct_search ( s , mb_x , mb_y ) ;
score = ( ( unsigned ) ( score * score + 128 * 256 ) ) >> 16 ;
c -> mc_mb_var_sum_temp += score ;
s -> current_picture . mc_mb_var [ mb_y * s -> mb_stride + mb_x ] = score ;
s -> mb_type [ mb_y * s -> mb_stride + mb_x ] = CANDIDATE_MB_TYPE_DIRECT0 ;
return ;
}
if ( s -> codec_id == AV_CODEC_ID_MPEG4 ) dmin = direct_search ( s , mb_x , mb_y ) ;
else dmin = INT_MAX ;
c -> skip = 0 ;
fmin = ff_estimate_motion_b ( s , mb_x , mb_y , s -> b_forw_mv_table , 0 , s -> f_code ) + 3 * penalty_factor ;
c -> skip = 0 ;
bmin = ff_estimate_motion_b ( s , mb_x , mb_y , s -> b_back_mv_table , 2 , s -> b_code ) + 2 * penalty_factor ;
av_dlog ( s , " %d %d " , s -> b_forw_mv_table [ xy ] [ 0 ] , s -> b_forw_mv_table [ xy ] [ 1 ] ) ;
c -> skip = 0 ;
fbmin = bidir_refine ( s , mb_x , mb_y ) + penalty_factor ;
av_dlog ( s , "%d %d %d %d\n" , dmin , fmin , bmin , fbmin ) ;
if ( s -> flags & CODEC_FLAG_INTERLACED_ME ) {
c -> skip = 0 ;
c -> current_mv_penalty = c -> mv_penalty [ s -> f_code ] + MAX_MV ;
fimin = interlaced_search ( s , 0 , s -> b_field_mv_table [ 0 ] , s -> b_field_select_table [ 0 ] , s -> b_forw_mv_table [ xy ] [ 0 ] , s -> b_forw_mv_table [ xy ] [ 1 ] , 0 ) ;
c -> current_mv_penalty = c -> mv_penalty [ s -> b_code ] + MAX_MV ;
bimin = interlaced_search ( s , 2 , s -> b_field_mv_table [ 1 ] , s -> b_field_select_table [ 1 ] , s -> b_back_mv_table [ xy ] [ 0 ] , s -> b_back_mv_table [ xy ] [ 1 ] , 0 ) ;
}
else fimin = bimin = INT_MAX ;
{
int score = fmin ;
type = CANDIDATE_MB_TYPE_FORWARD ;
if ( dmin <= score ) {
score = dmin ;
type = CANDIDATE_MB_TYPE_DIRECT ;
}
if ( bmin < score ) {
score = bmin ;
type = CANDIDATE_MB_TYPE_BACKWARD ;
}
if ( fbmin < score ) {
score = fbmin ;
type = CANDIDATE_MB_TYPE_BIDIR ;
}
if ( fimin < score ) {
score = fimin ;
type = CANDIDATE_MB_TYPE_FORWARD_I ;
}
if ( bimin < score ) {
score = bimin ;
type = CANDIDATE_MB_TYPE_BACKWARD_I ;
}
score = ( ( unsigned ) ( score * score + 128 * 256 ) ) >> 16 ;
c -> mc_mb_var_sum_temp += score ;
s -> current_picture . mc_mb_var [ mb_y * s -> mb_stride + mb_x ] = score ;
}
if ( c -> avctx -> mb_decision > FF_MB_DECISION_SIMPLE ) {
type = CANDIDATE_MB_TYPE_FORWARD | CANDIDATE_MB_TYPE_BACKWARD | CANDIDATE_MB_TYPE_BIDIR | CANDIDATE_MB_TYPE_DIRECT ;
if ( fimin < INT_MAX ) type |= CANDIDATE_MB_TYPE_FORWARD_I ;
if ( bimin < INT_MAX ) type |= CANDIDATE_MB_TYPE_BACKWARD_I ;
if ( fimin < INT_MAX && bimin < INT_MAX ) {
type |= CANDIDATE_MB_TYPE_BIDIR_I ;
}
if ( dmin > 256 * 256 * 16 ) type &= ~ CANDIDATE_MB_TYPE_DIRECT ;
if ( s -> codec_id == AV_CODEC_ID_MPEG4 && type & CANDIDATE_MB_TYPE_DIRECT && s -> flags & CODEC_FLAG_MV0 && * ( uint32_t * ) s -> b_direct_mv_table [ xy ] ) type |= CANDIDATE_MB_TYPE_DIRECT0 ;
}
s -> mb_type [ mb_y * s -> mb_stride + mb_x ] = type ;
} |
561,876,472,800,374,400 | debian | 3 | 0 | void RECORD_LAYER_reset_read_sequence ( RECORD_LAYER * rl ) {
memset ( rl -> read_sequence , 0 , sizeof ( rl -> read_sequence ) ) ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_MultilinkIndication ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_choice ( tvb , offset , actx , tree , hf_index , ett_h245_MultilinkIndication , MultilinkIndication_choice , NULL ) ;
return offset ;
} |
-1,315,695,702,746,584,300 | debian | 11 | 0 | proto_item * proto_tree_add_string_format_value ( proto_tree * tree , int hfindex , tvbuff_t * tvb , gint start , gint length , const char * value , const char * format , ... ) {
proto_item * pi ;
va_list ap ;
pi = proto_tree_add_string ( tree , hfindex , tvb , start , length , value ) ;
if ( pi != tree ) {
va_start ( ap , format ) ;
proto_tree_set_representation_value ( pi , format , ap ) ;
va_end ( ap ) ;
}
return pi ;
} |
8,415,334,249,344,417,000 | debian | 21 | 0 | static void dissect_u3v_register_bases ( guint64 addr , tvbuff_t * tvb , gint offset , u3v_conv_info_t * u3v_conv_info ) {
if ( addr < 0x10000 ) {
switch ( addr ) {
case U3V_ABRM_SBRM_ADDRESS : u3v_conv_info -> sbrm_addr = tvb_get_letoh64 ( tvb , offset ) ;
break ;
case U3V_ABRM_MANIFEST_TABLE_ADDRESS : u3v_conv_info -> manifest_addr = tvb_get_letoh64 ( tvb , offset ) ;
break ;
}
}
if ( u3v_conv_info -> sbrm_addr != 0 && ( addr >= u3v_conv_info -> sbrm_addr ) ) {
addr -= u3v_conv_info -> sbrm_addr ;
switch ( addr ) {
case U3V_SBRM_SIRM_ADDRESS : u3v_conv_info -> sirm_addr = tvb_get_letoh64 ( tvb , offset ) ;
break ;
case U3V_SBRM_EIRM_ADDRESS : u3v_conv_info -> eirm_addr = tvb_get_letoh64 ( tvb , offset ) ;
break ;
case U3V_SBRM_IIDC2_ADDRESS : u3v_conv_info -> iidc2_addr = tvb_get_letoh64 ( tvb , offset ) ;
break ;
}
}
} |
-1,483,849,844,579,170,800 | chrome | 9 | 0 | static const char * image_format_to_string ( vpx_img_fmt_t f ) {
switch ( f ) {
case VPX_IMG_FMT_I420 : return "I420" ;
case VPX_IMG_FMT_I422 : return "I422" ;
case VPX_IMG_FMT_I444 : return "I444" ;
case VPX_IMG_FMT_YV12 : return "YV12" ;
default : return "Other" ;
}
} |
-5,268,859,819,325,808,000 | debian | 93 | 0 | static gboolean dequeue_pending_idle_callback ( gpointer callback_data ) {
NautilusDirectory * directory ;
GList * pending_file_info ;
GList * node , * next ;
NautilusFile * file ;
GList * changed_files , * added_files ;
GFileInfo * file_info ;
const char * mimetype , * name ;
DirectoryLoadState * dir_load_state ;
directory = NAUTILUS_DIRECTORY ( callback_data ) ;
nautilus_directory_ref ( directory ) ;
nautilus_profile_start ( "nitems %d" , g_list_length ( directory -> details -> pending_file_info ) ) ;
directory -> details -> dequeue_pending_idle_id = 0 ;
pending_file_info = g_list_reverse ( directory -> details -> pending_file_info ) ;
directory -> details -> pending_file_info = NULL ;
if ( ! nautilus_directory_is_file_list_monitored ( directory ) ) {
nautilus_directory_async_state_changed ( directory ) ;
goto drain ;
}
added_files = NULL ;
changed_files = NULL ;
dir_load_state = directory -> details -> directory_load_in_progress ;
for ( node = pending_file_info ;
node != NULL ;
node = node -> next ) {
file_info = node -> data ;
name = g_file_info_get_name ( file_info ) ;
if ( dir_load_state && ! should_skip_file ( directory , file_info ) ) {
dir_load_state -> load_file_count += 1 ;
mimetype = g_file_info_get_content_type ( file_info ) ;
if ( mimetype != NULL ) {
istr_set_insert ( dir_load_state -> load_mime_list_hash , mimetype ) ;
}
}
file = nautilus_directory_find_file_by_name ( directory , name ) ;
if ( file != NULL ) {
set_file_unconfirmed ( file , FALSE ) ;
if ( ! file -> details -> is_added ) {
nautilus_file_ref ( file ) ;
file -> details -> is_added = TRUE ;
added_files = g_list_prepend ( added_files , file ) ;
}
else if ( nautilus_file_update_info ( file , file_info ) ) {
nautilus_file_ref ( file ) ;
changed_files = g_list_prepend ( changed_files , file ) ;
}
}
else {
file = nautilus_file_new_from_info ( directory , file_info ) ;
nautilus_directory_add_file ( directory , file ) ;
file -> details -> is_added = TRUE ;
added_files = g_list_prepend ( added_files , file ) ;
}
}
if ( directory -> details -> directory_loaded ) {
for ( node = directory -> details -> file_list ;
node != NULL ;
node = next ) {
file = NAUTILUS_FILE ( node -> data ) ;
next = node -> next ;
if ( file -> details -> unconfirmed ) {
nautilus_file_ref ( file ) ;
changed_files = g_list_prepend ( changed_files , file ) ;
nautilus_file_mark_gone ( file ) ;
}
}
}
nautilus_directory_emit_change_signals ( directory , changed_files ) ;
nautilus_file_list_free ( changed_files ) ;
nautilus_directory_emit_files_added ( directory , added_files ) ;
nautilus_file_list_free ( added_files ) ;
if ( directory -> details -> directory_loaded && ! directory -> details -> directory_loaded_sent_notification ) {
nautilus_directory_emit_done_loading ( directory ) ;
if ( dir_load_state ) {
file = dir_load_state -> load_directory_file ;
file -> details -> directory_count = dir_load_state -> load_file_count ;
file -> details -> directory_count_is_up_to_date = TRUE ;
file -> details -> got_directory_count = TRUE ;
file -> details -> got_mime_list = TRUE ;
file -> details -> mime_list_is_up_to_date = TRUE ;
g_list_free_full ( file -> details -> mime_list , g_free ) ;
file -> details -> mime_list = istr_set_get_as_list ( dir_load_state -> load_mime_list_hash ) ;
nautilus_file_changed ( file ) ;
}
nautilus_directory_async_state_changed ( directory ) ;
directory -> details -> directory_loaded_sent_notification = TRUE ;
}
drain : g_list_free_full ( pending_file_info , g_object_unref ) ;
nautilus_directory_async_state_changed ( directory ) ;
nautilus_profile_end ( NULL ) ;
nautilus_directory_unref ( directory ) ;
return FALSE ;
} |
8,971,837,418,146,377,000 | chrome | 70 | 1 | xsltLocale xsltNewLocale ( const xmlChar * languageTag ) {
# ifdef XSLT_LOCALE_XLOCALE xsltLocale locale ;
char localeName [ XSLTMAX_LANGTAGLEN + 6 ] ;
const xmlChar * p = languageTag ;
const char * region = NULL ;
char * q = localeName ;
int i , llen ;
if ( languageTag == NULL ) return ( NULL ) ;
for ( i = 0 ;
i < XSLTMAX_ISO639LANGLEN && ISALPHA ( * p ) ;
++ i ) * q ++ = TOLOWER ( * p ++ ) ;
if ( i == 0 ) return ( NULL ) ;
llen = i ;
* q ++ = '_' ;
if ( * p ) {
if ( * p ++ != '-' ) return ( NULL ) ;
for ( i = 0 ;
i < XSLTMAX_ISO3166CNTRYLEN && ISALPHA ( * p ) ;
++ i ) * q ++ = TOUPPER ( * p ++ ) ;
if ( i == 0 || * p ) return ( NULL ) ;
memcpy ( q , ".utf8" , 6 ) ;
locale = newlocale ( LC_COLLATE_MASK , localeName , NULL ) ;
if ( locale != NULL ) return ( locale ) ;
q = localeName + llen + 1 ;
}
memcpy ( q , ".utf8" , 6 ) ;
locale = newlocale ( LC_COLLATE_MASK , localeName , NULL ) ;
if ( locale != NULL ) return ( locale ) ;
if ( llen != 2 ) return ( NULL ) ;
region = ( char * ) xsltDefaultRegion ( ( xmlChar * ) localeName ) ;
if ( region == NULL ) return ( NULL ) ;
q = localeName + llen + 1 ;
* q ++ = region [ 0 ] ;
* q ++ = region [ 1 ] ;
memcpy ( q , ".utf8" , 6 ) ;
locale = newlocale ( LC_COLLATE_MASK , localeName , NULL ) ;
return ( locale ) ;
# endif # ifdef XSLT_LOCALE_WINAPI {
xsltLocale locale = ( xsltLocale ) 0 ;
xmlChar localeName [ XSLTMAX_LANGTAGLEN + 1 ] ;
xmlChar * q = localeName ;
const xmlChar * p = languageTag ;
int i , llen ;
const xmlChar * region = NULL ;
if ( languageTag == NULL ) goto end ;
xsltEnumSupportedLocales ( ) ;
for ( i = 0 ;
i < XSLTMAX_ISO639LANGLEN && ISALPHA ( * p ) ;
++ i ) * q ++ = TOLOWER ( * p ++ ) ;
if ( i == 0 ) goto end ;
llen = i ;
* q ++ = '-' ;
if ( * p ) {
if ( * p ++ != '-' ) goto end ;
for ( i = 0 ;
i < XSLTMAX_ISO3166CNTRYLEN && ISALPHA ( * p ) ;
++ i ) * q ++ = TOUPPER ( * p ++ ) ;
if ( i == 0 || * p ) goto end ;
* q = '\0' ;
locale = xslt_locale_WINAPI ( localeName ) ;
if ( locale != ( xsltLocale ) 0 ) goto end ;
}
region = xsltDefaultRegion ( localeName ) ;
if ( region == NULL ) goto end ;
strcpy ( localeName + llen + 1 , region ) ;
locale = xslt_locale_WINAPI ( localeName ) ;
end : return ( locale ) ;
}
# endif # ifdef XSLT_LOCALE_NONE return ( NULL ) ;
# endif } |
1,859,256,631,654,517,000 | chrome | 25 | 0 | static void flush_dpb ( AVCodecContext * avctx ) {
H264Context * h = avctx -> priv_data ;
int i ;
for ( i = 0 ;
i <= MAX_DELAYED_PIC_COUNT ;
i ++ ) {
if ( h -> delayed_pic [ i ] ) h -> delayed_pic [ i ] -> reference = 0 ;
h -> delayed_pic [ i ] = NULL ;
}
flush_change ( h ) ;
if ( h -> DPB ) for ( i = 0 ;
i < MAX_PICTURE_COUNT ;
i ++ ) unref_picture ( h , & h -> DPB [ i ] ) ;
h -> cur_pic_ptr = NULL ;
unref_picture ( h , & h -> cur_pic ) ;
h -> mb_x = h -> mb_y = 0 ;
h -> parse_context . state = - 1 ;
h -> parse_context . frame_start_found = 0 ;
h -> parse_context . overread = 0 ;
h -> parse_context . overread_index = 0 ;
h -> parse_context . index = 0 ;
h -> parse_context . last_index = 0 ;
free_tables ( h , 1 ) ;
h -> context_initialized = 0 ;
} |
-8,704,283,573,519,790,000 | debian | 11 | 0 | BerElement * ber_dup ( BerElement * ber ) {
BerElement * new ;
assert ( ber != NULL ) ;
assert ( LBER_VALID ( ber ) ) ;
if ( ( new = ber_alloc_t ( ber -> ber_options ) ) == NULL ) {
return NULL ;
}
* new = * ber ;
assert ( LBER_VALID ( new ) ) ;
return ( new ) ;
} |
-2,607,754,285,145,856,500 | debian | 72 | 1 | static int isoent_gen_joliet_identifier ( struct archive_write * a , struct isoent * isoent , struct idr * idr ) {
struct iso9660 * iso9660 ;
struct isoent * np ;
unsigned char * p ;
size_t l ;
int r ;
int ffmax , parent_len ;
static const struct archive_rb_tree_ops rb_ops = {
isoent_cmp_node_joliet , isoent_cmp_key_joliet }
;
if ( isoent -> children . cnt == 0 ) return ( 0 ) ;
iso9660 = a -> format_data ;
if ( iso9660 -> opt . joliet == OPT_JOLIET_LONGNAME ) ffmax = 206 ;
else ffmax = 128 ;
r = idr_start ( a , idr , isoent -> children . cnt , ffmax , 6 , 2 , & rb_ops ) ;
if ( r < 0 ) return ( r ) ;
parent_len = 1 ;
for ( np = isoent ;
np -> parent != np ;
np = np -> parent ) parent_len += np -> mb_len + 1 ;
for ( np = isoent -> children . first ;
np != NULL ;
np = np -> chnext ) {
unsigned char * dot ;
int ext_off , noff , weight ;
size_t lt ;
if ( ( int ) ( l = np -> file -> basename_utf16 . length ) > ffmax ) l = ffmax ;
p = malloc ( ( l + 1 ) * 2 ) ;
if ( p == NULL ) {
archive_set_error ( & a -> archive , ENOMEM , "Can't allocate memory" ) ;
return ( ARCHIVE_FATAL ) ;
}
memcpy ( p , np -> file -> basename_utf16 . s , l ) ;
p [ l ] = 0 ;
p [ l + 1 ] = 0 ;
np -> identifier = ( char * ) p ;
lt = l ;
dot = p + l ;
weight = 0 ;
while ( lt > 0 ) {
if ( ! joliet_allowed_char ( p [ 0 ] , p [ 1 ] ) ) archive_be16enc ( p , 0x005F ) ;
else if ( p [ 0 ] == 0 && p [ 1 ] == 0x2E ) dot = p ;
p += 2 ;
lt -= 2 ;
}
ext_off = ( int ) ( dot - ( unsigned char * ) np -> identifier ) ;
np -> ext_off = ext_off ;
np -> ext_len = ( int ) l - ext_off ;
np -> id_len = ( int ) l ;
if ( ( int ) np -> file -> basename_utf16 . length > ffmax ) {
if ( archive_strncpy_l ( & iso9660 -> mbs , ( const char * ) np -> identifier , l , iso9660 -> sconv_from_utf16be ) != 0 && errno == ENOMEM ) {
archive_set_error ( & a -> archive , errno , "No memory" ) ;
return ( ARCHIVE_FATAL ) ;
}
np -> mb_len = ( int ) iso9660 -> mbs . length ;
if ( np -> mb_len != ( int ) np -> file -> basename . length ) weight = np -> mb_len ;
}
else np -> mb_len = ( int ) np -> file -> basename . length ;
if ( parent_len + np -> mb_len > 240 ) {
archive_set_error ( & a -> archive , ARCHIVE_ERRNO_MISC , "The regulation of Joliet extensions;
" " A length of a full-pathname of `%s' is " "longer than 240 bytes, (p=%d, b=%d)" , archive_entry_pathname ( np -> file -> entry ) , ( int ) parent_len , ( int ) np -> mb_len ) ;
return ( ARCHIVE_FATAL ) ;
}
if ( ( int ) l == ffmax ) noff = ext_off - 6 ;
else if ( ( int ) l == ffmax - 2 ) noff = ext_off - 4 ;
else if ( ( int ) l == ffmax - 4 ) noff = ext_off - 2 ;
else noff = ext_off ;
idr_register ( idr , np , weight , noff ) ;
}
idr_resolve ( idr , idr_set_num_beutf16 ) ;
return ( ARCHIVE_OK ) ;
} |
-4,885,528,830,177,757,000 | debian | 8 | 0 | int flush_blocks ( MI_CHECK * param , KEY_CACHE * key_cache , File file ) {
if ( flush_key_blocks ( key_cache , file , FLUSH_RELEASE ) ) {
mi_check_print_error ( param , "%d when trying to write bufferts" , my_errno ) ;
return ( 1 ) ;
}
if ( ! param -> using_global_keycache ) end_key_cache ( key_cache , 1 ) ;
return 0 ;
} |
-4,978,896,576,290,503,000 | debian | 42 | 0 | int main ( int argc , char * * argv ) {
int error ;
MY_INIT ( argv [ 0 ] ) ;
my_progname_short = my_progname + dirname_length ( my_progname ) ;
myisamchk_init ( & check_param ) ;
check_param . opt_lock_memory = 1 ;
check_param . using_global_keycache = 0 ;
get_options ( & argc , ( char * * * ) & argv ) ;
myisam_quick_table_bits = decode_bits ;
error = 0 ;
while ( -- argc >= 0 ) {
int new_error = myisamchk ( & check_param , * ( argv ++ ) ) ;
if ( ( check_param . testflag & T_REP_ANY ) != T_REP ) check_param . testflag &= ~ T_REP ;
( void ) fflush ( stdout ) ;
( void ) fflush ( stderr ) ;
if ( ( check_param . error_printed | check_param . warning_printed ) && ( check_param . testflag & T_FORCE_CREATE ) && ( ! ( check_param . testflag & ( T_REP | T_REP_BY_SORT | T_SORT_RECORDS | T_SORT_INDEX ) ) ) ) {
uint old_testflag = check_param . testflag ;
if ( ! ( check_param . testflag & T_REP ) ) check_param . testflag |= T_REP_BY_SORT ;
check_param . testflag &= ~ T_EXTEND ;
error |= myisamchk ( & check_param , argv [ - 1 ] ) ;
check_param . testflag = old_testflag ;
( void ) fflush ( stdout ) ;
( void ) fflush ( stderr ) ;
}
else error |= new_error ;
if ( argc && ( ! ( check_param . testflag & T_SILENT ) || check_param . testflag & T_INFO ) ) {
puts ( "\n---------\n" ) ;
( void ) fflush ( stdout ) ;
}
}
if ( check_param . total_files > 1 ) {
char buff [ 22 ] , buff2 [ 22 ] ;
if ( ! ( check_param . testflag & T_SILENT ) || check_param . testflag & T_INFO ) puts ( "\n---------\n" ) ;
printf ( "\nTotal of all %d MyISAM-files:\nData records: %9s Deleted blocks: %9s\n" , check_param . total_files , llstr ( check_param . total_records , buff ) , llstr ( check_param . total_deleted , buff2 ) ) ;
}
free_defaults ( default_argv ) ;
free_tmpdir ( & myisamchk_tmpdir ) ;
ft_free_stopwords ( ) ;
my_end ( check_param . testflag & T_INFO ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR ) ;
exit ( error ) ;
# ifndef _lint return 0 ;
# endif } |
-755,883,256,379,441,900 | chrome | 257 | 0 | void vp9_ ## type ## _predictor_ ## size ## x ## size ## _c ( uint8_t * dst , ptrdiff_t stride , const uint8_t * above , const uint8_t * left ) {
type ## _predictor ( dst , stride , size , above , left ) ;
}
# if CONFIG_VP9_HIGHBITDEPTH # define intra_pred_high_sized ( type , size ) void vp9_high_ ## type ## _predictor_ ## size ## x ## size ## _c ( uint16_t * dst , ptrdiff_t stride , const uint16_t * above , const uint16_t * left , int bd ) {
high_ ## type ## _predictor ( dst , stride , size , above , left , bd ) ;
}
# define intra_pred_allsizes ( type ) intra_pred_sized ( type , 4 ) intra_pred_sized ( type , 8 ) intra_pred_sized ( type , 16 ) intra_pred_sized ( type , 32 ) intra_pred_high_sized ( type , 4 ) intra_pred_high_sized ( type , 8 ) intra_pred_high_sized ( type , 16 ) intra_pred_high_sized ( type , 32 ) # else # define intra_pred_allsizes ( type ) intra_pred_sized ( type , 4 ) intra_pred_sized ( type , 8 ) intra_pred_sized ( type , 16 ) intra_pred_sized ( type , 32 ) # endif # if CONFIG_VP9_HIGHBITDEPTH static INLINE void high_d207_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) above ;
( void ) bd ;
for ( r = 0 ;
r < bs - 1 ;
++ r ) {
dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r ] + left [ r + 1 ] , 1 ) ;
}
dst [ ( bs - 1 ) * stride ] = left [ bs - 1 ] ;
dst ++ ;
for ( r = 0 ;
r < bs - 2 ;
++ r ) {
dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r ] + left [ r + 1 ] * 2 + left [ r + 2 ] , 2 ) ;
}
dst [ ( bs - 2 ) * stride ] = ROUND_POWER_OF_TWO ( left [ bs - 2 ] + left [ bs - 1 ] * 3 , 2 ) ;
dst [ ( bs - 1 ) * stride ] = left [ bs - 1 ] ;
dst ++ ;
for ( c = 0 ;
c < bs - 2 ;
++ c ) dst [ ( bs - 1 ) * stride + c ] = left [ bs - 1 ] ;
for ( r = bs - 2 ;
r >= 0 ;
-- r ) {
for ( c = 0 ;
c < bs - 2 ;
++ c ) dst [ r * stride + c ] = dst [ ( r + 1 ) * stride + c - 2 ] ;
}
}
static INLINE void high_d63_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) left ;
( void ) bd ;
for ( r = 0 ;
r < bs ;
++ r ) {
for ( c = 0 ;
c < bs ;
++ c ) {
dst [ c ] = r & 1 ? ROUND_POWER_OF_TWO ( above [ r / 2 + c ] + above [ r / 2 + c + 1 ] * 2 + above [ r / 2 + c + 2 ] , 2 ) : ROUND_POWER_OF_TWO ( above [ r / 2 + c ] + above [ r / 2 + c + 1 ] , 1 ) ;
}
dst += stride ;
}
}
static INLINE void high_d45_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) left ;
( void ) bd ;
for ( r = 0 ;
r < bs ;
++ r ) {
for ( c = 0 ;
c < bs ;
++ c ) {
dst [ c ] = r + c + 2 < bs * 2 ? ROUND_POWER_OF_TWO ( above [ r + c ] + above [ r + c + 1 ] * 2 + above [ r + c + 2 ] , 2 ) : above [ bs * 2 - 1 ] ;
}
dst += stride ;
}
}
static INLINE void high_d117_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) bd ;
for ( c = 0 ;
c < bs ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 1 ] + above [ c ] , 1 ) ;
dst += stride ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( left [ 0 ] + above [ - 1 ] * 2 + above [ 0 ] , 2 ) ;
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 2 ] + above [ c - 1 ] * 2 + above [ c ] , 2 ) ;
dst += stride ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] * 2 + left [ 1 ] , 2 ) ;
for ( r = 3 ;
r < bs ;
++ r ) dst [ ( r - 2 ) * stride ] = ROUND_POWER_OF_TWO ( left [ r - 3 ] + left [ r - 2 ] * 2 + left [ r - 1 ] , 2 ) ;
for ( r = 2 ;
r < bs ;
++ r ) {
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = dst [ - 2 * stride + c - 1 ] ;
dst += stride ;
}
}
static INLINE void high_d135_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) bd ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( left [ 0 ] + above [ - 1 ] * 2 + above [ 0 ] , 2 ) ;
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 2 ] + above [ c - 1 ] * 2 + above [ c ] , 2 ) ;
dst [ stride ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] * 2 + left [ 1 ] , 2 ) ;
for ( r = 2 ;
r < bs ;
++ r ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r - 2 ] + left [ r - 1 ] * 2 + left [ r ] , 2 ) ;
dst += stride ;
for ( r = 1 ;
r < bs ;
++ r ) {
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = dst [ - stride + c - 1 ] ;
dst += stride ;
}
}
static INLINE void high_d153_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) bd ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] , 1 ) ;
for ( r = 1 ;
r < bs ;
r ++ ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r - 1 ] + left [ r ] , 1 ) ;
dst ++ ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( left [ 0 ] + above [ - 1 ] * 2 + above [ 0 ] , 2 ) ;
dst [ stride ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] * 2 + left [ 1 ] , 2 ) ;
for ( r = 2 ;
r < bs ;
r ++ ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r - 2 ] + left [ r - 1 ] * 2 + left [ r ] , 2 ) ;
dst ++ ;
for ( c = 0 ;
c < bs - 2 ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 1 ] + above [ c ] * 2 + above [ c + 1 ] , 2 ) ;
dst += stride ;
for ( r = 1 ;
r < bs ;
++ r ) {
for ( c = 0 ;
c < bs - 2 ;
c ++ ) dst [ c ] = dst [ - stride + c - 2 ] ;
dst += stride ;
}
}
static INLINE void high_v_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r ;
( void ) left ;
( void ) bd ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memcpy ( dst , above , bs * sizeof ( uint16_t ) ) ;
dst += stride ;
}
}
static INLINE void high_h_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r ;
( void ) above ;
( void ) bd ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset16 ( dst , left [ r ] , bs ) ;
dst += stride ;
}
}
static INLINE void high_tm_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
int ytop_left = above [ - 1 ] ;
( void ) bd ;
for ( r = 0 ;
r < bs ;
r ++ ) {
for ( c = 0 ;
c < bs ;
c ++ ) dst [ c ] = clip_pixel_high ( left [ r ] + above [ c ] - ytop_left , bd ) ;
dst += stride ;
}
}
static INLINE void high_dc_128_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r ;
( void ) above ;
( void ) left ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset16 ( dst , 128 << ( bd - 8 ) , bs ) ;
dst += stride ;
}
}
static INLINE void high_dc_left_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int i , r , expected_dc , sum = 0 ;
( void ) above ;
( void ) bd ;
for ( i = 0 ;
i < bs ;
i ++ ) sum += left [ i ] ;
expected_dc = ( sum + ( bs >> 1 ) ) / bs ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset16 ( dst , expected_dc , bs ) ;
dst += stride ;
}
}
static INLINE void high_dc_top_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int i , r , expected_dc , sum = 0 ;
( void ) left ;
( void ) bd ;
for ( i = 0 ;
i < bs ;
i ++ ) sum += above [ i ] ;
expected_dc = ( sum + ( bs >> 1 ) ) / bs ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset16 ( dst , expected_dc , bs ) ;
dst += stride ;
}
}
static INLINE void high_dc_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int i , r , expected_dc , sum = 0 ;
const int count = 2 * bs ;
( void ) bd ;
for ( i = 0 ;
i < bs ;
i ++ ) {
sum += above [ i ] ;
sum += left [ i ] ;
}
expected_dc = ( sum + ( count >> 1 ) ) / count ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset16 ( dst , expected_dc , bs ) ;
dst += stride ;
}
}
# endif static INLINE void d207_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int r , c ;
( void ) above ;
for ( r = 0 ;
r < bs - 1 ;
++ r ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r ] + left [ r + 1 ] , 1 ) ;
dst [ ( bs - 1 ) * stride ] = left [ bs - 1 ] ;
dst ++ ;
for ( r = 0 ;
r < bs - 2 ;
++ r ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r ] + left [ r + 1 ] * 2 + left [ r + 2 ] , 2 ) ;
dst [ ( bs - 2 ) * stride ] = ROUND_POWER_OF_TWO ( left [ bs - 2 ] + left [ bs - 1 ] * 3 , 2 ) ;
dst [ ( bs - 1 ) * stride ] = left [ bs - 1 ] ;
dst ++ ;
for ( c = 0 ;
c < bs - 2 ;
++ c ) dst [ ( bs - 1 ) * stride + c ] = left [ bs - 1 ] ;
for ( r = bs - 2 ;
r >= 0 ;
-- r ) for ( c = 0 ;
c < bs - 2 ;
++ c ) dst [ r * stride + c ] = dst [ ( r + 1 ) * stride + c - 2 ] ;
}
intra_pred_allsizes ( d207 ) |
-2,515,786,237,983,240,000 | debian | 3 | 0 | static chr newline ( void ) {
return CHR ( '\n' ) ;
} |
-4,960,438,251,319,819,000 | chrome | 26 | 0 | static int get_twopass_worst_quality ( const VP9_COMP * cpi , const FIRSTPASS_STATS * stats , int section_target_bandwidth ) {
const RATE_CONTROL * const rc = & cpi -> rc ;
const VP9EncoderConfig * const oxcf = & cpi -> oxcf ;
if ( section_target_bandwidth <= 0 ) {
return rc -> worst_quality ;
}
else {
const int num_mbs = cpi -> common . MBs ;
const double section_err = stats -> coded_error / stats -> count ;
const double err_per_mb = section_err / num_mbs ;
const double speed_term = 1.0 + 0.04 * oxcf -> speed ;
const int target_norm_bits_per_mb = ( ( uint64_t ) section_target_bandwidth << BPER_MB_NORMBITS ) / num_mbs ;
int q ;
int is_svc_upper_layer = 0 ;
if ( is_two_pass_svc ( cpi ) && cpi -> svc . spatial_layer_id > 0 ) is_svc_upper_layer = 1 ;
for ( q = rc -> best_quality ;
q < rc -> worst_quality ;
++ q ) {
const double factor = calc_correction_factor ( err_per_mb , ERR_DIVISOR , is_svc_upper_layer ? SVC_FACTOR_PT_LOW : FACTOR_PT_LOW , FACTOR_PT_HIGH , q , cpi -> common . bit_depth ) ;
const int bits_per_mb = vp9_rc_bits_per_mb ( INTER_FRAME , q , factor * speed_term , cpi -> common . bit_depth ) ;
if ( bits_per_mb <= target_norm_bits_per_mb ) break ;
}
if ( cpi -> oxcf . rc_mode == VPX_CQ ) q = MAX ( q , oxcf -> cq_level ) ;
return q ;
}
} |
7,424,930,167,238,098,000 | debian | 27 | 0 | static int usbdev_release ( struct inode * inode , struct file * file ) {
struct usb_dev_state * ps = file -> private_data ;
struct usb_device * dev = ps -> dev ;
unsigned int ifnum ;
struct async * as ;
usb_lock_device ( dev ) ;
usb_hub_release_all_ports ( dev , ps ) ;
list_del_init ( & ps -> list ) ;
for ( ifnum = 0 ;
ps -> ifclaimed && ifnum < 8 * sizeof ( ps -> ifclaimed ) ;
ifnum ++ ) {
if ( test_bit ( ifnum , & ps -> ifclaimed ) ) releaseintf ( ps , ifnum ) ;
}
destroy_all_async ( ps ) ;
usb_autosuspend_device ( dev ) ;
usb_unlock_device ( dev ) ;
usb_put_dev ( dev ) ;
put_pid ( ps -> disc_pid ) ;
put_cred ( ps -> cred ) ;
as = async_getcompleted ( ps ) ;
while ( as ) {
free_async ( as ) ;
as = async_getcompleted ( ps ) ;
}
kfree ( ps ) ;
return 0 ;
} |
7,545,838,748,510,052,000 | debian | 23 | 0 | bool DropReplicationSlot ( PGconn * conn , const char * slot_name ) {
PQExpBuffer query ;
PGresult * res ;
Assert ( slot_name != NULL ) ;
query = createPQExpBuffer ( ) ;
appendPQExpBuffer ( query , "DROP_REPLICATION_SLOT \"%s\"" , slot_name ) ;
res = PQexec ( conn , query -> data ) ;
if ( PQresultStatus ( res ) != PGRES_COMMAND_OK ) {
fprintf ( stderr , _ ( "%s: could not send replication command \"%s\": %s" ) , progname , query -> data , PQerrorMessage ( conn ) ) ;
destroyPQExpBuffer ( query ) ;
PQclear ( res ) ;
return false ;
}
if ( PQntuples ( res ) != 0 || PQnfields ( res ) != 0 ) {
fprintf ( stderr , _ ( "%s: could not drop replication slot \"%s\": got %d rows and %d fields, expected %d rows and %d fields\n" ) , progname , slot_name , PQntuples ( res ) , PQnfields ( res ) , 0 , 0 ) ;
destroyPQExpBuffer ( query ) ;
PQclear ( res ) ;
return false ;
}
destroyPQExpBuffer ( query ) ;
PQclear ( res ) ;
return true ;
} |
-7,434,014,980,763,121,000 | debian | 26 | 0 | int dissect_ber_boolean ( gboolean implicit_tag , asn1_ctx_t * actx , proto_tree * tree , tvbuff_t * tvb , int offset , gint hf_id , gboolean * value ) {
gint8 ber_class ;
gboolean pc ;
gint32 tag ;
guint32 len ;
guint8 val ;
header_field_info * hfi ;
if ( ! implicit_tag ) {
offset = dissect_ber_identifier ( actx -> pinfo , tree , tvb , offset , & ber_class , & pc , & tag ) ;
offset = dissect_ber_length ( actx -> pinfo , tree , tvb , offset , & len , NULL ) ;
}
else {
}
val = tvb_get_guint8 ( tvb , offset ) ;
offset += 1 ;
actx -> created_item = NULL ;
if ( hf_id >= 0 ) {
hfi = proto_registrar_get_nth ( hf_id ) ;
if ( hfi -> type == FT_BOOLEAN ) actx -> created_item = proto_tree_add_boolean ( tree , hf_id , tvb , offset - 1 , 1 , val ) ;
else actx -> created_item = proto_tree_add_uint ( tree , hf_id , tvb , offset - 1 , 1 , val ? 1 : 0 ) ;
}
if ( value ) {
* value = ( val ? TRUE : FALSE ) ;
}
return offset ;
} |
-7,248,963,932,691,286,000 | debian | 54 | 0 | int create_server_socket ( const char * host , const char * port ) {
struct addrinfo hints ;
struct addrinfo * result , * rp , * ipv4v6bindall ;
int s , server_sock ;
memset ( & hints , 0 , sizeof ( struct addrinfo ) ) ;
hints . ai_family = AF_UNSPEC ;
hints . ai_socktype = SOCK_DGRAM ;
hints . ai_flags = AI_PASSIVE | AI_ADDRCONFIG ;
hints . ai_protocol = IPPROTO_UDP ;
s = getaddrinfo ( host , port , & hints , & result ) ;
if ( s != 0 ) {
LOGE ( "getaddrinfo: %s" , gai_strerror ( s ) ) ;
return - 1 ;
}
rp = result ;
if ( ! host ) {
ipv4v6bindall = result ;
while ( ipv4v6bindall ) {
if ( ipv4v6bindall -> ai_family == AF_INET6 ) {
rp = ipv4v6bindall ;
break ;
}
ipv4v6bindall = ipv4v6bindall -> ai_next ;
}
}
for ( ;
rp != NULL ;
rp = rp -> ai_next ) {
server_sock = socket ( rp -> ai_family , rp -> ai_socktype , rp -> ai_protocol ) ;
if ( server_sock == - 1 ) {
continue ;
}
if ( rp -> ai_family == AF_INET6 ) {
int ipv6only = host ? 1 : 0 ;
setsockopt ( server_sock , IPPROTO_IPV6 , IPV6_V6ONLY , & ipv6only , sizeof ( ipv6only ) ) ;
}
int opt = 1 ;
setsockopt ( server_sock , SOL_SOCKET , SO_REUSEADDR , & opt , sizeof ( opt ) ) ;
s = bind ( server_sock , rp -> ai_addr , rp -> ai_addrlen ) ;
if ( s == 0 ) {
break ;
}
else {
ERROR ( "bind" ) ;
}
close ( server_sock ) ;
}
if ( rp == NULL ) {
LOGE ( "cannot bind" ) ;
return - 1 ;
}
freeaddrinfo ( result ) ;
return server_sock ;
} |
1,182,028,467,273,265,000 | debian | 40 | 0 | void show_diff ( DYNAMIC_STRING * ds , const char * filename1 , const char * filename2 ) {
DYNAMIC_STRING ds_tmp ;
const char * diff_name = 0 ;
if ( init_dynamic_string ( & ds_tmp , "" , 256 , 256 ) ) die ( "Out of memory" ) ;
# ifdef __WIN__ if ( diff_check ( "diff" ) ) diff_name = "diff" ;
else if ( diff_check ( "mtrdiff" ) ) diff_name = "mtrdiff" ;
else diff_name = 0 ;
# else diff_name = "diff" ;
# endif if ( diff_name ) {
if ( run_tool ( diff_name , & ds_tmp , "-u" , filename1 , filename2 , "2>&1" , NULL ) > 1 ) {
dynstr_set ( & ds_tmp , "" ) ;
if ( run_tool ( diff_name , & ds_tmp , "-c" , filename1 , filename2 , "2>&1" , NULL ) > 1 ) {
dynstr_set ( & ds_tmp , "" ) ;
if ( run_tool ( diff_name , & ds_tmp , filename1 , filename2 , "2>&1" , NULL ) > 1 ) {
diff_name = 0 ;
}
}
}
}
if ( ! diff_name ) {
dynstr_append ( & ds_tmp , "\n" ) ;
dynstr_append ( & ds_tmp , "\n" "The two files differ but it was not possible to execute 'diff' in\n" "order to show only the difference. Instead the whole content of the\n" "two files was shown for you to diff manually.\n\n" "To get a better report you should install 'diff' on your system, which you\n" "for example can get from http://www.gnu.org/software/diffutils/diffutils.html\n" # ifdef __WIN__ "or http://gnuwin32.sourceforge.net/packages/diffutils.htm\n" # endif "\n" ) ;
dynstr_append ( & ds_tmp , " --- " ) ;
dynstr_append ( & ds_tmp , filename1 ) ;
dynstr_append ( & ds_tmp , " >>>\n" ) ;
cat_file ( & ds_tmp , filename1 ) ;
dynstr_append ( & ds_tmp , "<<<\n --- " ) ;
dynstr_append ( & ds_tmp , filename1 ) ;
dynstr_append ( & ds_tmp , " >>>\n" ) ;
cat_file ( & ds_tmp , filename2 ) ;
dynstr_append ( & ds_tmp , "<<<<\n" ) ;
}
if ( ds ) {
dynstr_append_mem ( ds , ds_tmp . str , ds_tmp . length ) ;
}
else {
fprintf ( stderr , "%s\n" , ds_tmp . str ) ;
}
dynstr_free ( & ds_tmp ) ;
} |
927,123,821,003,322,000 | chrome | 11 | 0 | IN_PROC_BROWSER_TEST_F ( PageLoadMetricsBrowserTest , NewPageInNewForegroundTab ) {
ASSERT_TRUE ( embedded_test_server ( ) -> Start ( ) ) ;
NavigateParams params ( browser ( ) , embedded_test_server ( ) -> GetURL ( "/title1.html" ) , ui : : PAGE_TRANSITION_LINK ) ;
params . disposition = WindowOpenDisposition : : NEW_FOREGROUND_TAB ;
Navigate ( & params ) ;
auto waiter = std : : make_unique < PageLoadMetricsWaiter > ( params . target_contents ) ;
waiter -> AddPageExpectation ( TimingField : : LOAD_EVENT ) ;
waiter -> Wait ( ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramLoad , 1 ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kBackgroundHistogramLoad , 0 ) ;
} |
4,445,816,241,987,236,400 | debian | 5 | 0 | int ff_h263_get_gob_height ( MpegEncContext * s ) {
if ( s -> height <= 400 ) return 1 ;
else if ( s -> height <= 800 ) return 2 ;
else return 4 ;
} |
-4,078,760,840,682,684,000 | chrome | 3 | 0 | static int read_segment_id ( vp9_reader * r , const struct segmentation * seg ) {
return vp9_read_tree ( r , vp9_segment_tree , seg -> tree_probs ) ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_Cmd_reverseParameters ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_Cmd_reverseParameters , Cmd_reverseParameters_sequence ) ;
return offset ;
} |
2,713,698,759,296,604,700 | debian | 17 | 0 | int ff_update_duplicate_context ( MpegEncContext * dst , MpegEncContext * src ) {
MpegEncContext bak ;
int i , ret ;
backup_duplicate_context ( & bak , dst ) ;
memcpy ( dst , src , sizeof ( MpegEncContext ) ) ;
backup_duplicate_context ( dst , & bak ) ;
for ( i = 0 ;
i < 12 ;
i ++ ) {
dst -> pblocks [ i ] = & dst -> block [ i ] ;
}
if ( ! dst -> edge_emu_buffer && ( ret = ff_mpv_frame_size_alloc ( dst , dst -> linesize ) ) < 0 ) {
av_log ( dst -> avctx , AV_LOG_ERROR , "failed to allocate context " "scratch buffers.\n" ) ;
return ret ;
}
return 0 ;
} |
4,489,017,523,191,997,000 | debian | 4 | 0 | static int dissect_h225_OCTET_STRING_SIZE_3_4 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_octet_string ( tvb , offset , actx , tree , hf_index , 3 , 4 , FALSE , NULL ) ;
return offset ;
} |
6,667,142,528,452,942,000 | debian | 27 | 0 | static int do_show_slave_status ( MYSQL * mysql_con ) {
MYSQL_RES * slave = 0 ;
const char * comment_prefix = ( opt_slave_data == MYSQL_OPT_SLAVE_DATA_COMMENTED_SQL ) ? "-- " : "" ;
if ( mysql_query_with_error_report ( mysql_con , & slave , "SHOW SLAVE STATUS" ) ) {
if ( ! ignore_errors ) {
fprintf ( stderr , "%s: Error: Slave not set up\n" , my_progname_short ) ;
}
mysql_free_result ( slave ) ;
return 1 ;
}
else {
MYSQL_ROW row = mysql_fetch_row ( slave ) ;
if ( row && row [ 9 ] && row [ 21 ] ) {
if ( opt_comments ) fprintf ( md_result_file , "\n--\n-- Position to start replication or point-in-time " "recovery from (the master of this slave)\n--\n\n" ) ;
fprintf ( md_result_file , "%sCHANGE MASTER TO " , comment_prefix ) ;
if ( opt_include_master_host_port ) {
if ( row [ 1 ] ) fprintf ( md_result_file , "MASTER_HOST='%s', " , row [ 1 ] ) ;
if ( row [ 3 ] ) fprintf ( md_result_file , "MASTER_PORT=%s, " , row [ 3 ] ) ;
}
fprintf ( md_result_file , "MASTER_LOG_FILE='%s', MASTER_LOG_POS=%s;
\n" , row [ 9 ] , row [ 21 ] ) ;
check_io ( md_result_file ) ;
}
mysql_free_result ( slave ) ;
}
return 0 ;
} |
2,600,695,546,378,251,300 | debian | 55 | 1 | static int h261_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) {
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
H261Context * h = avctx -> priv_data ;
MpegEncContext * s = & h -> s ;
int ret ;
AVFrame * pict = data ;
av_dlog ( avctx , "*****frame %d size=%d\n" , avctx -> frame_number , buf_size ) ;
av_dlog ( avctx , "bytes=%x %x %x %x\n" , buf [ 0 ] , buf [ 1 ] , buf [ 2 ] , buf [ 3 ] ) ;
s -> flags = avctx -> flags ;
s -> flags2 = avctx -> flags2 ;
h -> gob_start_code_skipped = 0 ;
retry : init_get_bits ( & s -> gb , buf , buf_size * 8 ) ;
if ( ! s -> context_initialized ) {
if ( ff_MPV_common_init ( s ) < 0 ) return - 1 ;
}
if ( s -> current_picture_ptr == NULL || s -> current_picture_ptr -> f . data [ 0 ] ) {
int i = ff_find_unused_picture ( s , 0 ) ;
if ( i < 0 ) return i ;
s -> current_picture_ptr = & s -> picture [ i ] ;
}
ret = h261_decode_picture_header ( h ) ;
if ( ret < 0 ) {
av_log ( s -> avctx , AV_LOG_ERROR , "header damaged\n" ) ;
return - 1 ;
}
if ( s -> width != avctx -> coded_width || s -> height != avctx -> coded_height ) {
ParseContext pc = s -> parse_context ;
s -> parse_context . buffer = 0 ;
ff_MPV_common_end ( s ) ;
s -> parse_context = pc ;
}
if ( ! s -> context_initialized ) {
avcodec_set_dimensions ( avctx , s -> width , s -> height ) ;
goto retry ;
}
s -> current_picture . f . pict_type = s -> pict_type ;
s -> current_picture . f . key_frame = s -> pict_type == AV_PICTURE_TYPE_I ;
if ( ( avctx -> skip_frame >= AVDISCARD_NONREF && s -> pict_type == AV_PICTURE_TYPE_B ) || ( avctx -> skip_frame >= AVDISCARD_NONKEY && s -> pict_type != AV_PICTURE_TYPE_I ) || avctx -> skip_frame >= AVDISCARD_ALL ) return get_consumed_bytes ( s , buf_size ) ;
if ( ff_MPV_frame_start ( s , avctx ) < 0 ) return - 1 ;
ff_mpeg_er_frame_start ( s ) ;
s -> mb_x = 0 ;
s -> mb_y = 0 ;
while ( h -> gob_number < ( s -> mb_height == 18 ? 12 : 5 ) ) {
if ( ff_h261_resync ( h ) < 0 ) break ;
h261_decode_gob ( h ) ;
}
ff_MPV_frame_end ( s ) ;
assert ( s -> current_picture . f . pict_type == s -> current_picture_ptr -> f . pict_type ) ;
assert ( s -> current_picture . f . pict_type == s -> pict_type ) ;
* pict = s -> current_picture_ptr -> f ;
ff_print_debug_info ( s , pict ) ;
* got_frame = 1 ;
return get_consumed_bytes ( s , buf_size ) ;
} |
6,632,536,031,698,733,000 | debian | 10 | 0 | static const char * flat_escape_key_str ( AVBPrint * dst , const char * src , const char sep ) {
const char * p ;
for ( p = src ;
* p ;
p ++ ) {
if ( ! ( ( * p >= '0' && * p <= '9' ) || ( * p >= 'a' && * p <= 'z' ) || ( * p >= 'A' && * p <= 'Z' ) ) ) av_bprint_chars ( dst , '_' , 1 ) ;
else av_bprint_chars ( dst , * p , 1 ) ;
}
return dst -> str ;
} |
6,393,050,609,822,898,000 | debian | 39 | 0 | static int xhci_submit ( XHCIState * xhci , XHCITransfer * xfer , XHCIEPContext * epctx ) {
uint64_t mfindex ;
DPRINTF ( "xhci_submit(slotid=%d,epid=%d)\n" , xfer -> slotid , xfer -> epid ) ;
xfer -> in_xfer = epctx -> type >> 2 ;
switch ( epctx -> type ) {
case ET_INTR_OUT : case ET_INTR_IN : xfer -> pkts = 0 ;
xfer -> iso_xfer = false ;
xfer -> timed_xfer = true ;
mfindex = xhci_mfindex_get ( xhci ) ;
xhci_calc_intr_kick ( xhci , xfer , epctx , mfindex ) ;
xhci_check_intr_iso_kick ( xhci , xfer , epctx , mfindex ) ;
if ( xfer -> running_retry ) {
return - 1 ;
}
break ;
case ET_BULK_OUT : case ET_BULK_IN : xfer -> pkts = 0 ;
xfer -> iso_xfer = false ;
xfer -> timed_xfer = false ;
break ;
case ET_ISO_OUT : case ET_ISO_IN : xfer -> pkts = 1 ;
xfer -> iso_xfer = true ;
xfer -> timed_xfer = true ;
mfindex = xhci_mfindex_get ( xhci ) ;
xhci_calc_iso_kick ( xhci , xfer , epctx , mfindex ) ;
xhci_check_intr_iso_kick ( xhci , xfer , epctx , mfindex ) ;
if ( xfer -> running_retry ) {
return - 1 ;
}
break ;
default : trace_usb_xhci_unimplemented ( "endpoint type" , epctx -> type ) ;
return - 1 ;
}
if ( xhci_setup_packet ( xfer ) < 0 ) {
return - 1 ;
}
usb_handle_packet ( xfer -> packet . ep -> dev , & xfer -> packet ) ;
xhci_try_complete_packet ( xfer ) ;
return 0 ;
} |
2,335,222,688,263,906,300 | debian | 25 | 1 | static int rv34_decode_intra_macroblock ( RV34DecContext * r , int8_t * intra_types ) {
MpegEncContext * s = & r -> s ;
int cbp , dist ;
int mb_pos = s -> mb_x + s -> mb_y * s -> mb_stride ;
memset ( r -> avail_cache , 0 , sizeof ( r -> avail_cache ) ) ;
fill_rectangle ( r -> avail_cache + 6 , 2 , 2 , 4 , 1 , 4 ) ;
dist = ( s -> mb_x - s -> resync_mb_x ) + ( s -> mb_y - s -> resync_mb_y ) * s -> mb_width ;
if ( s -> mb_x && dist ) r -> avail_cache [ 5 ] = r -> avail_cache [ 9 ] = s -> current_picture_ptr -> f . mb_type [ mb_pos - 1 ] ;
if ( dist >= s -> mb_width ) r -> avail_cache [ 2 ] = r -> avail_cache [ 3 ] = s -> current_picture_ptr -> f . mb_type [ mb_pos - s -> mb_stride ] ;
if ( ( ( s -> mb_x + 1 ) < s -> mb_width ) && dist >= s -> mb_width - 1 ) r -> avail_cache [ 4 ] = s -> current_picture_ptr -> f . mb_type [ mb_pos - s -> mb_stride + 1 ] ;
if ( s -> mb_x && dist > s -> mb_width ) r -> avail_cache [ 1 ] = s -> current_picture_ptr -> f . mb_type [ mb_pos - s -> mb_stride - 1 ] ;
s -> qscale = r -> si . quant ;
cbp = rv34_decode_intra_mb_header ( r , intra_types ) ;
r -> cbp_luma [ mb_pos ] = cbp ;
r -> cbp_chroma [ mb_pos ] = cbp >> 16 ;
r -> deblock_coefs [ mb_pos ] = 0xFFFF ;
s -> current_picture_ptr -> f . qscale_table [ mb_pos ] = s -> qscale ;
if ( cbp == - 1 ) return - 1 ;
if ( r -> is16 ) {
rv34_output_i16x16 ( r , intra_types , cbp ) ;
return 0 ;
}
rv34_output_intra ( r , intra_types , cbp ) ;
return 0 ;
} |
-8,046,645,508,582,877,000 | debian | 14 | 0 | static void create_cel_evals ( RoqContext * enc , RoqTempdata * tempData ) {
int n = 0 , x , y , i ;
tempData -> cel_evals = av_malloc ( enc -> width * enc -> height / 64 * sizeof ( CelEvaluation ) ) ;
for ( y = 0 ;
y < enc -> height ;
y += 16 ) for ( x = 0 ;
x < enc -> width ;
x += 16 ) for ( i = 0 ;
i < 4 ;
i ++ ) {
tempData -> cel_evals [ n ] . sourceX = x + ( i & 1 ) * 8 ;
tempData -> cel_evals [ n ++ ] . sourceY = y + ( i & 2 ) * 4 ;
}
} |
-3,740,862,514,502,467,000 | debian | 23 | 0 | static void dumpcffdictindex ( SplineFont * sf , struct alltabs * at ) {
int i ;
int pos ;
putshort ( at -> fdarray , sf -> subfontcnt ) ;
putc ( '\2' , at -> fdarray ) ;
putshort ( at -> fdarray , 1 ) ;
for ( i = 0 ;
i < sf -> subfontcnt ;
++ i ) putshort ( at -> fdarray , 0 ) ;
pos = ftell ( at -> fdarray ) - 1 ;
for ( i = 0 ;
i < sf -> subfontcnt ;
++ i ) {
at -> fds [ i ] . fillindictmark = dumpcffdict ( sf -> subfonts [ i ] , at ) ;
at -> fds [ i ] . eodictmark = ftell ( at -> fdarray ) ;
if ( at -> fds [ i ] . eodictmark > 65536 ) IError ( "The DICT INDEX got too big, result won't work" ) ;
}
fseek ( at -> fdarray , 2 * sizeof ( short ) + sizeof ( char ) , SEEK_SET ) ;
for ( i = 0 ;
i < sf -> subfontcnt ;
++ i ) putshort ( at -> fdarray , at -> fds [ i ] . eodictmark - pos ) ;
fseek ( at -> fdarray , 0 , SEEK_END ) ;
} |
6,632,536,031,698,733,000 | debian | 21 | 0 | static void ini_print_section_header ( WriterContext * wctx ) {
INIContext * ini = wctx -> priv ;
AVBPrint * buf = & wctx -> section_pbuf [ wctx -> level ] ;
const struct section * section = wctx -> section [ wctx -> level ] ;
const struct section * parent_section = wctx -> level ? wctx -> section [ wctx -> level - 1 ] : NULL ;
av_bprint_clear ( buf ) ;
if ( ! parent_section ) {
printf ( "# ffprobe output\n\n" ) ;
return ;
}
if ( wctx -> nb_item [ wctx -> level - 1 ] ) printf ( "\n" ) ;
av_bprintf ( buf , "%s" , wctx -> section_pbuf [ wctx -> level - 1 ] . str ) ;
if ( ini -> hierarchical || ! ( section -> flags & ( SECTION_FLAG_IS_ARRAY | SECTION_FLAG_IS_WRAPPER ) ) ) {
av_bprintf ( buf , "%s%s" , buf -> str [ 0 ] ? "." : "" , wctx -> section [ wctx -> level ] -> name ) ;
if ( parent_section -> flags & SECTION_FLAG_IS_ARRAY ) {
int n = parent_section -> id == SECTION_ID_PACKETS_AND_FRAMES ? wctx -> nb_section_packet_frame : wctx -> nb_item [ wctx -> level - 1 ] ;
av_bprintf ( buf , ".%d" , n ) ;
}
}
if ( ! ( section -> flags & ( SECTION_FLAG_IS_ARRAY | SECTION_FLAG_IS_WRAPPER ) ) ) printf ( "[%s]\n" , buf -> str ) ;
} |
927,123,821,003,322,000 | chrome | 11 | 0 | IN_PROC_BROWSER_TEST_F ( PageLoadMetricsBrowserTest , UseCounterAnimatedCSSPropertiesInIframe ) {
ASSERT_TRUE ( embedded_test_server ( ) -> Start ( ) ) ;
auto waiter = CreatePageLoadMetricsWaiter ( ) ;
waiter -> AddPageExpectation ( TimingField : : LOAD_EVENT ) ;
ui_test_utils : : NavigateToURL ( browser ( ) , embedded_test_server ( ) -> GetURL ( "/page_load_metrics/use_counter_features_in_iframe.html" ) ) ;
waiter -> Wait ( ) ;
NavigateToUntrackedUrl ( ) ;
histogram_tester_ . ExpectBucketCount ( internal : : kAnimatedCssPropertiesHistogramName , 161 , 1 ) ;
histogram_tester_ . ExpectBucketCount ( internal : : kAnimatedCssPropertiesHistogramName , 91 , 1 ) ;
histogram_tester_ . ExpectBucketCount ( internal : : kAnimatedCssPropertiesHistogramName , blink : : mojom : : kTotalPagesMeasuredCSSSampleId , 1 ) ;
} |
369,115,599,810,341,100 | debian | 27 | 0 | static void vga_draw_line2d2 ( VGACommonState * vga , uint8_t * d , uint32_t addr , int width ) {
uint32_t plane_mask , * palette , data , v ;
int x ;
palette = vga -> last_palette ;
plane_mask = mask16 [ vga -> ar [ VGA_ATC_PLANE_ENABLE ] & 0xf ] ;
width >>= 3 ;
for ( x = 0 ;
x < width ;
x ++ ) {
data = vga_read_dword_le ( vga , addr ) ;
data &= plane_mask ;
v = expand2 [ GET_PLANE ( data , 0 ) ] ;
v |= expand2 [ GET_PLANE ( data , 2 ) ] << 2 ;
PUT_PIXEL2 ( d , 0 , palette [ v >> 12 ] ) ;
PUT_PIXEL2 ( d , 1 , palette [ ( v >> 8 ) & 0xf ] ) ;
PUT_PIXEL2 ( d , 2 , palette [ ( v >> 4 ) & 0xf ] ) ;
PUT_PIXEL2 ( d , 3 , palette [ ( v >> 0 ) & 0xf ] ) ;
v = expand2 [ GET_PLANE ( data , 1 ) ] ;
v |= expand2 [ GET_PLANE ( data , 3 ) ] << 2 ;
PUT_PIXEL2 ( d , 4 , palette [ v >> 12 ] ) ;
PUT_PIXEL2 ( d , 5 , palette [ ( v >> 8 ) & 0xf ] ) ;
PUT_PIXEL2 ( d , 6 , palette [ ( v >> 4 ) & 0xf ] ) ;
PUT_PIXEL2 ( d , 7 , palette [ ( v >> 0 ) & 0xf ] ) ;
d += 64 ;
addr += 4 ;
}
} |
1,911,881,859,629,731,000 | chrome | 22 | 1 | void vp9_set_rd_speed_thresholds_sub8x8 ( VP9_COMP * cpi ) {
const SPEED_FEATURES * const sf = & cpi -> sf ;
RD_OPT * const rd = & cpi -> rd ;
int i ;
for ( i = 0 ;
i < MAX_REFS ;
++ i ) rd -> thresh_mult_sub8x8 [ i ] = cpi -> oxcf . mode == BEST ? - 500 : 0 ;
rd -> thresh_mult_sub8x8 [ THR_LAST ] += 2500 ;
rd -> thresh_mult_sub8x8 [ THR_GOLD ] += 2500 ;
rd -> thresh_mult_sub8x8 [ THR_ALTR ] += 2500 ;
rd -> thresh_mult_sub8x8 [ THR_INTRA ] += 2500 ;
rd -> thresh_mult_sub8x8 [ THR_COMP_LA ] += 4500 ;
rd -> thresh_mult_sub8x8 [ THR_COMP_GA ] += 4500 ;
for ( i = 0 ;
i < MAX_REFS ;
++ i ) if ( sf -> disable_split_mask & ( 1 << i ) ) rd -> thresh_mult_sub8x8 [ i ] = INT_MAX ;
if ( ! ( cpi -> ref_frame_flags & VP9_LAST_FLAG ) ) rd -> thresh_mult_sub8x8 [ THR_LAST ] = INT_MAX ;
if ( ! ( cpi -> ref_frame_flags & VP9_GOLD_FLAG ) ) rd -> thresh_mult_sub8x8 [ THR_GOLD ] = INT_MAX ;
if ( ! ( cpi -> ref_frame_flags & VP9_ALT_FLAG ) ) rd -> thresh_mult_sub8x8 [ THR_ALTR ] = INT_MAX ;
if ( ( cpi -> ref_frame_flags & ( VP9_LAST_FLAG | VP9_ALT_FLAG ) ) != ( VP9_LAST_FLAG | VP9_ALT_FLAG ) ) rd -> thresh_mult_sub8x8 [ THR_COMP_LA ] = INT_MAX ;
if ( ( cpi -> ref_frame_flags & ( VP9_GOLD_FLAG | VP9_ALT_FLAG ) ) != ( VP9_GOLD_FLAG | VP9_ALT_FLAG ) ) rd -> thresh_mult_sub8x8 [ THR_COMP_GA ] = INT_MAX ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_SEQUENCE_OF_ParameterIdentifier ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence_of ( tvb , offset , actx , tree , hf_index , ett_h245_SEQUENCE_OF_ParameterIdentifier , SEQUENCE_OF_ParameterIdentifier_sequence_of ) ;
return offset ;
} |
2,546,373,479,020,365,300 | debian | 35 | 0 | void mime_hdr_copy_onto ( MIMEHdrImpl * s_mh , HdrHeap * s_heap , MIMEHdrImpl * d_mh , HdrHeap * d_heap , bool inherit_strs ) {
int block_count ;
MIMEFieldBlockImpl * s_fblock , * d_fblock , * prev_d_fblock ;
if ( d_mh -> m_first_fblock . m_next ) {
mime_hdr_destroy_field_block_list ( d_heap , d_mh -> m_first_fblock . m_next ) ;
}
ink_assert ( ( ( char * ) & ( s_mh -> m_first_fblock . m_field_slots [ MIME_FIELD_BLOCK_SLOTS ] ) - ( char * ) s_mh ) == sizeof ( struct MIMEHdrImpl ) ) ;
int top = s_mh -> m_first_fblock . m_freetop ;
char * end = ( char * ) & ( s_mh -> m_first_fblock . m_field_slots [ top ] ) ;
int bytes_below_top = end - ( char * ) s_mh ;
memcpy ( d_mh , s_mh , bytes_below_top ) ;
if ( d_mh -> m_first_fblock . m_next == nullptr ) {
d_mh -> m_fblock_list_tail = & ( d_mh -> m_first_fblock ) ;
block_count = 1 ;
}
else {
prev_d_fblock = & ( d_mh -> m_first_fblock ) ;
block_count = 1 ;
for ( s_fblock = s_mh -> m_first_fblock . m_next ;
s_fblock != nullptr ;
s_fblock = s_fblock -> m_next ) {
++ block_count ;
d_fblock = _mime_field_block_copy ( s_fblock , s_heap , d_heap ) ;
prev_d_fblock -> m_next = d_fblock ;
prev_d_fblock = d_fblock ;
}
d_mh -> m_fblock_list_tail = prev_d_fblock ;
}
if ( inherit_strs ) {
d_heap -> inherit_string_heaps ( s_heap ) ;
}
mime_hdr_field_block_list_adjust ( block_count , & ( s_mh -> m_first_fblock ) , & ( d_mh -> m_first_fblock ) ) ;
MIME_HDR_SANITY_CHECK ( s_mh ) ;
MIME_HDR_SANITY_CHECK ( d_mh ) ;
} |
-1,315,695,702,746,584,300 | debian | 24 | 0 | proto_item * proto_tree_add_item_ret_string_and_length ( proto_tree * tree , int hfindex , tvbuff_t * tvb , const gint start , gint length , const guint encoding , wmem_allocator_t * scope , const guint8 * * retval , gint * lenretval ) {
header_field_info * hfinfo = proto_registrar_get_nth ( hfindex ) ;
field_info * new_fi ;
const guint8 * value ;
DISSECTOR_ASSERT_HINT ( hfinfo != NULL , "Not passed hfi!" ) ;
switch ( hfinfo -> type ) {
case FT_STRING : value = get_string_value ( scope , tvb , start , length , lenretval , encoding ) ;
break ;
case FT_STRINGZ : value = get_stringz_value ( scope , tree , tvb , start , length , lenretval , encoding ) ;
break ;
case FT_UINT_STRING : value = get_uint_string_value ( scope , tree , tvb , start , length , lenretval , encoding ) ;
break ;
case FT_STRINGZPAD : value = get_stringzpad_value ( scope , tvb , start , length , lenretval , encoding ) ;
break ;
default : DISSECTOR_ASSERT_NOT_REACHED ( ) ;
}
if ( retval ) * retval = value ;
CHECK_FOR_NULL_TREE ( tree ) ;
TRY_TO_FAKE_THIS_ITEM ( tree , hfinfo -> id , hfinfo ) ;
new_fi = new_field_info ( tree , hfinfo , tvb , start , length ) ;
proto_tree_set_string ( new_fi , value ) ;
new_fi -> flags |= ( encoding & ENC_LITTLE_ENDIAN ) ? FI_LITTLE_ENDIAN : FI_BIG_ENDIAN ;
return proto_tree_add_node ( tree , new_fi ) ;
} |
-3,740,862,514,502,467,000 | debian | 15 | 0 | static FILE * dumpstoredtable ( SplineFont * sf , uint32 tag , int * len ) {
struct ttf_table * tab = SFFindTable ( sf , tag ) ;
FILE * out ;
if ( tab == NULL && sf -> mm != NULL && sf -> mm -> apple ) tab = SFFindTable ( sf -> mm -> normal , tag ) ;
if ( tab == NULL ) {
* len = 0 ;
return ( NULL ) ;
}
out = tmpfile ( ) ;
fwrite ( tab -> data , 1 , tab -> len , out ) ;
if ( ( tab -> len & 1 ) ) putc ( '\0' , out ) ;
if ( ( tab -> len + 1 ) & 2 ) putshort ( out , 0 ) ;
* len = tab -> len ;
return ( out ) ;
} |
6,028,689,830,752,105,000 | debian | 8 | 0 | static int cli_scanfile ( const char * filename , cli_ctx * ctx ) {
int fd , ret ;
fd = safe_open ( filename , O_RDONLY | O_BINARY ) ;
if ( fd < 0 ) return CL_EOPEN ;
ret = cli_magic_scandesc ( fd , ctx ) ;
close ( fd ) ;
return ret ;
} |
7,039,307,292,471,245,000 | debian | 7 | 0 | static guint16 de_tp_epc_ue_positioning_technology ( tvbuff_t * tvb , proto_tree * tree , packet_info * pinfo _U_ , guint32 offset , guint len _U_ , gchar * add_string _U_ , int string_len _U_ ) {
guint32 curr_offset ;
curr_offset = offset ;
proto_tree_add_bits_item ( tree , hf_gsm_a_dtap_epc_ue_positioning_technology , tvb , curr_offset << 3 , 8 , ENC_BIG_ENDIAN ) ;
curr_offset ++ ;
return ( curr_offset - offset ) ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_Al3 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_Al3 , Al3_sequence ) ;
return offset ;
} |
-7,853,481,279,968,318,000 | chrome | 4 | 1 | static int get_aq_c_strength ( int q_index ) {
int base_quant = vp9_ac_quant ( q_index , 0 ) / 4 ;
return ( base_quant > 20 ) + ( base_quant > 45 ) ;
} |
-7,777,331,401,175,181,000 | debian | 4 | 0 | static void sig_chat_protocol_unknown ( const char * protocol ) {
g_return_if_fail ( protocol != NULL ) ;
printformat ( NULL , NULL , MSGLEVEL_CLIENTERROR , TXT_UNKNOWN_CHAT_PROTOCOL , protocol ) ;
} |
927,123,821,003,322,000 | chrome | 8 | 0 | IN_PROC_BROWSER_TEST_F ( PageLoadMetricsBrowserTest , PayloadSizeIgnoresDownloads ) {
ASSERT_TRUE ( embedded_test_server ( ) -> Start ( ) ) ;
content : : DownloadTestObserverTerminal downloads_observer ( content : : BrowserContext : : GetDownloadManager ( browser ( ) -> profile ( ) ) , 1 , content : : DownloadTestObserver : : ON_DANGEROUS_DOWNLOAD_FAIL ) ;
ui_test_utils : : NavigateToURL ( browser ( ) , embedded_test_server ( ) -> GetURL ( "/page_load_metrics/download_anchor_click.html" ) ) ;
downloads_observer . WaitForFinished ( ) ;
NavigateToUntrackedUrl ( ) ;
histogram_tester_ . ExpectUniqueSample ( internal : : kHistogramPageLoadTotalBytes , 0 , 1 ) ;
} |
-3,559,021,711,340,555,000 | debian | 13 | 0 | Expr * make_opclause ( Oid opno , Oid opresulttype , bool opretset , Expr * leftop , Expr * rightop , Oid opcollid , Oid inputcollid ) {
OpExpr * expr = makeNode ( OpExpr ) ;
expr -> opno = opno ;
expr -> opfuncid = InvalidOid ;
expr -> opresulttype = opresulttype ;
expr -> opretset = opretset ;
expr -> opcollid = opcollid ;
expr -> inputcollid = inputcollid ;
if ( rightop ) expr -> args = list_make2 ( leftop , rightop ) ;
else expr -> args = list_make1 ( leftop ) ;
expr -> location = - 1 ;
return ( Expr * ) expr ;
} |
-4,421,762,461,659,142,000 | debian | 42 | 0 | static void xps_select_best_font_encoding ( xps_document * doc , fz_font * font ) {
static struct {
int pid , eid ;
}
xps_cmap_list [ ] = {
{
3 , 10 }
, {
3 , 1 }
, {
3 , 5 }
, {
3 , 4 }
, {
3 , 3 }
, {
3 , 2 }
, {
3 , 0 }
, {
1 , 0 }
, {
- 1 , - 1 }
, }
;
int i , k , n , pid , eid ;
n = xps_count_font_encodings ( font ) ;
for ( k = 0 ;
xps_cmap_list [ k ] . pid != - 1 ;
k ++ ) {
for ( i = 0 ;
i < n ;
i ++ ) {
xps_identify_font_encoding ( font , i , & pid , & eid ) ;
if ( pid == xps_cmap_list [ k ] . pid && eid == xps_cmap_list [ k ] . eid ) {
xps_select_font_encoding ( font , i ) ;
return ;
}
}
}
fz_warn ( doc -> ctx , "cannot find a suitable cmap" ) ;
} |
5,918,484,636,148,311,000 | debian | 3 | 0 | const gx_device_memory * gdev_mem_device_for_bits ( int bits_per_pixel ) {
return ( ( uint ) bits_per_pixel > 64 ? & mem_x_device : mem_devices [ bits_per_pixel ] ) ;
} |
7,651,945,086,108,393,000 | debian | 36 | 0 | int qemuMonitorJSONBlockJob ( qemuMonitorPtr mon , const char * device , unsigned long bandwidth , virDomainBlockJobInfoPtr info , int mode ) {
int ret = - 1 ;
virJSONValuePtr cmd = NULL ;
virJSONValuePtr reply = NULL ;
const char * cmd_name = NULL ;
if ( mode == BLOCK_JOB_ABORT ) {
cmd_name = "block_job_cancel" ;
cmd = qemuMonitorJSONMakeCommand ( cmd_name , "s:device" , device , NULL ) ;
}
else if ( mode == BLOCK_JOB_INFO ) {
cmd_name = "query-block-jobs" ;
cmd = qemuMonitorJSONMakeCommand ( cmd_name , NULL ) ;
}
else if ( mode == BLOCK_JOB_SPEED ) {
cmd_name = "block_job_set_speed" ;
cmd = qemuMonitorJSONMakeCommand ( cmd_name , "s:device" , device , "U:value" , bandwidth * 1024ULL * 1024ULL , NULL ) ;
}
else if ( mode == BLOCK_JOB_PULL ) {
cmd_name = "block_stream" ;
cmd = qemuMonitorJSONMakeCommand ( cmd_name , "s:device" , device , NULL ) ;
}
if ( ! cmd ) return - 1 ;
ret = qemuMonitorJSONCommand ( mon , cmd , & reply ) ;
if ( ret == 0 && virJSONValueObjectHasKey ( reply , "error" ) ) {
if ( qemuMonitorJSONHasError ( reply , "DeviceNotActive" ) ) qemuReportError ( VIR_ERR_OPERATION_INVALID , _ ( "No active operation on device: %s" ) , device ) ;
else if ( qemuMonitorJSONHasError ( reply , "DeviceInUse" ) ) qemuReportError ( VIR_ERR_OPERATION_FAILED , _ ( "Device %s in use" ) , device ) ;
else if ( qemuMonitorJSONHasError ( reply , "NotSupported" ) ) qemuReportError ( VIR_ERR_OPERATION_INVALID , _ ( "Operation is not supported for device: %s" ) , device ) ;
else if ( qemuMonitorJSONHasError ( reply , "CommandNotFound" ) ) qemuReportError ( VIR_ERR_OPERATION_INVALID , _ ( "Command '%s' is not found" ) , cmd_name ) ;
else qemuReportError ( VIR_ERR_INTERNAL_ERROR , "%s" , _ ( "Unexpected error" ) ) ;
ret = - 1 ;
}
if ( ret == 0 && mode == BLOCK_JOB_INFO ) ret = qemuMonitorJSONGetBlockJobInfo ( reply , device , info ) ;
virJSONValueFree ( cmd ) ;
virJSONValueFree ( reply ) ;
return ret ;
} |
4,837,267,551,952,414,000 | debian | 301 | 1 | static int decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) {
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
LclDecContext * const c = avctx -> priv_data ;
unsigned char * encoded = ( unsigned char * ) buf ;
unsigned int pixel_ptr ;
int row , col ;
unsigned char * outptr ;
uint8_t * y_out , * u_out , * v_out ;
unsigned int width = avctx -> width ;
unsigned int height = avctx -> height ;
unsigned int mszh_dlen ;
unsigned char yq , y1q , uq , vq ;
int uqvq , ret ;
unsigned int mthread_inlen , mthread_outlen ;
unsigned int len = buf_size ;
if ( c -> pic . data [ 0 ] ) avctx -> release_buffer ( avctx , & c -> pic ) ;
c -> pic . reference = 0 ;
c -> pic . buffer_hints = FF_BUFFER_HINTS_VALID ;
if ( ( ret = ff_get_buffer ( avctx , & c -> pic ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return ret ;
}
outptr = c -> pic . data [ 0 ] ;
switch ( avctx -> codec_id ) {
case AV_CODEC_ID_MSZH : switch ( c -> compression ) {
case COMP_MSZH : if ( c -> flags & FLAG_MULTITHREAD ) {
mthread_inlen = AV_RL32 ( encoded ) ;
mthread_inlen = FFMIN ( mthread_inlen , len - 8 ) ;
mthread_outlen = AV_RL32 ( encoded + 4 ) ;
mthread_outlen = FFMIN ( mthread_outlen , c -> decomp_size ) ;
mszh_dlen = mszh_decomp ( encoded + 8 , mthread_inlen , c -> decomp_buf , c -> decomp_size ) ;
if ( mthread_outlen != mszh_dlen ) {
av_log ( avctx , AV_LOG_ERROR , "Mthread1 decoded size differs (%d != %d)\n" , mthread_outlen , mszh_dlen ) ;
return AVERROR_INVALIDDATA ;
}
mszh_dlen = mszh_decomp ( encoded + 8 + mthread_inlen , len - 8 - mthread_inlen , c -> decomp_buf + mthread_outlen , c -> decomp_size - mthread_outlen ) ;
if ( mthread_outlen != mszh_dlen ) {
av_log ( avctx , AV_LOG_ERROR , "Mthread2 decoded size differs (%d != %d)\n" , mthread_outlen , mszh_dlen ) ;
return AVERROR_INVALIDDATA ;
}
encoded = c -> decomp_buf ;
len = c -> decomp_size ;
}
else {
mszh_dlen = mszh_decomp ( encoded , len , c -> decomp_buf , c -> decomp_size ) ;
if ( c -> decomp_size != mszh_dlen ) {
av_log ( avctx , AV_LOG_ERROR , "Decoded size differs (%d != %d)\n" , c -> decomp_size , mszh_dlen ) ;
return AVERROR_INVALIDDATA ;
}
encoded = c -> decomp_buf ;
len = mszh_dlen ;
}
break ;
case COMP_MSZH_NOCOMP : {
int bppx2 ;
switch ( c -> imgtype ) {
case IMGTYPE_YUV111 : case IMGTYPE_RGB24 : bppx2 = 6 ;
break ;
case IMGTYPE_YUV422 : case IMGTYPE_YUV211 : bppx2 = 4 ;
break ;
case IMGTYPE_YUV411 : case IMGTYPE_YUV420 : bppx2 = 3 ;
break ;
default : bppx2 = 0 ;
break ;
}
if ( len < ( ( width * height * bppx2 ) >> 1 ) ) return AVERROR_INVALIDDATA ;
break ;
}
default : av_log ( avctx , AV_LOG_ERROR , "BUG! Unknown MSZH compression in frame decoder.\n" ) ;
return AVERROR_INVALIDDATA ;
}
break ;
# if CONFIG_ZLIB_DECODER case AV_CODEC_ID_ZLIB : if ( c -> compression == COMP_ZLIB_NORMAL && c -> imgtype == IMGTYPE_RGB24 && len == width * height * 3 ) {
if ( c -> flags & FLAG_PNGFILTER ) {
memcpy ( c -> decomp_buf , encoded , len ) ;
encoded = c -> decomp_buf ;
}
else {
break ;
}
}
else if ( c -> flags & FLAG_MULTITHREAD ) {
mthread_inlen = AV_RL32 ( encoded ) ;
mthread_inlen = FFMIN ( mthread_inlen , len - 8 ) ;
mthread_outlen = AV_RL32 ( encoded + 4 ) ;
mthread_outlen = FFMIN ( mthread_outlen , c -> decomp_size ) ;
ret = zlib_decomp ( avctx , encoded + 8 , mthread_inlen , 0 , mthread_outlen ) ;
if ( ret < 0 ) return ret ;
ret = zlib_decomp ( avctx , encoded + 8 + mthread_inlen , len - 8 - mthread_inlen , mthread_outlen , mthread_outlen ) ;
if ( ret < 0 ) return ret ;
}
else {
int ret = zlib_decomp ( avctx , encoded , len , 0 , c -> decomp_size ) ;
if ( ret < 0 ) return ret ;
}
encoded = c -> decomp_buf ;
len = c -> decomp_size ;
break ;
# endif default : av_log ( avctx , AV_LOG_ERROR , "BUG! Unknown codec in frame decoder compression switch.\n" ) ;
return AVERROR_INVALIDDATA ;
}
if ( avctx -> codec_id == AV_CODEC_ID_ZLIB && ( c -> flags & FLAG_PNGFILTER ) ) {
switch ( c -> imgtype ) {
case IMGTYPE_YUV111 : case IMGTYPE_RGB24 : for ( row = 0 ;
row < height ;
row ++ ) {
pixel_ptr = row * width * 3 ;
yq = encoded [ pixel_ptr ++ ] ;
uqvq = AV_RL16 ( encoded + pixel_ptr ) ;
pixel_ptr += 2 ;
for ( col = 1 ;
col < width ;
col ++ ) {
encoded [ pixel_ptr ] = yq -= encoded [ pixel_ptr ] ;
uqvq -= AV_RL16 ( encoded + pixel_ptr + 1 ) ;
AV_WL16 ( encoded + pixel_ptr + 1 , uqvq ) ;
pixel_ptr += 3 ;
}
}
break ;
case IMGTYPE_YUV422 : for ( row = 0 ;
row < height ;
row ++ ) {
pixel_ptr = row * width * 2 ;
yq = uq = vq = 0 ;
for ( col = 0 ;
col < width / 4 ;
col ++ ) {
encoded [ pixel_ptr ] = yq -= encoded [ pixel_ptr ] ;
encoded [ pixel_ptr + 1 ] = yq -= encoded [ pixel_ptr + 1 ] ;
encoded [ pixel_ptr + 2 ] = yq -= encoded [ pixel_ptr + 2 ] ;
encoded [ pixel_ptr + 3 ] = yq -= encoded [ pixel_ptr + 3 ] ;
encoded [ pixel_ptr + 4 ] = uq -= encoded [ pixel_ptr + 4 ] ;
encoded [ pixel_ptr + 5 ] = uq -= encoded [ pixel_ptr + 5 ] ;
encoded [ pixel_ptr + 6 ] = vq -= encoded [ pixel_ptr + 6 ] ;
encoded [ pixel_ptr + 7 ] = vq -= encoded [ pixel_ptr + 7 ] ;
pixel_ptr += 8 ;
}
}
break ;
case IMGTYPE_YUV411 : for ( row = 0 ;
row < height ;
row ++ ) {
pixel_ptr = row * width / 2 * 3 ;
yq = uq = vq = 0 ;
for ( col = 0 ;
col < width / 4 ;
col ++ ) {
encoded [ pixel_ptr ] = yq -= encoded [ pixel_ptr ] ;
encoded [ pixel_ptr + 1 ] = yq -= encoded [ pixel_ptr + 1 ] ;
encoded [ pixel_ptr + 2 ] = yq -= encoded [ pixel_ptr + 2 ] ;
encoded [ pixel_ptr + 3 ] = yq -= encoded [ pixel_ptr + 3 ] ;
encoded [ pixel_ptr + 4 ] = uq -= encoded [ pixel_ptr + 4 ] ;
encoded [ pixel_ptr + 5 ] = vq -= encoded [ pixel_ptr + 5 ] ;
pixel_ptr += 6 ;
}
}
break ;
case IMGTYPE_YUV211 : for ( row = 0 ;
row < height ;
row ++ ) {
pixel_ptr = row * width * 2 ;
yq = uq = vq = 0 ;
for ( col = 0 ;
col < width / 2 ;
col ++ ) {
encoded [ pixel_ptr ] = yq -= encoded [ pixel_ptr ] ;
encoded [ pixel_ptr + 1 ] = yq -= encoded [ pixel_ptr + 1 ] ;
encoded [ pixel_ptr + 2 ] = uq -= encoded [ pixel_ptr + 2 ] ;
encoded [ pixel_ptr + 3 ] = vq -= encoded [ pixel_ptr + 3 ] ;
pixel_ptr += 4 ;
}
}
break ;
case IMGTYPE_YUV420 : for ( row = 0 ;
row < height / 2 ;
row ++ ) {
pixel_ptr = row * width * 3 ;
yq = y1q = uq = vq = 0 ;
for ( col = 0 ;
col < width / 2 ;
col ++ ) {
encoded [ pixel_ptr ] = yq -= encoded [ pixel_ptr ] ;
encoded [ pixel_ptr + 1 ] = yq -= encoded [ pixel_ptr + 1 ] ;
encoded [ pixel_ptr + 2 ] = y1q -= encoded [ pixel_ptr + 2 ] ;
encoded [ pixel_ptr + 3 ] = y1q -= encoded [ pixel_ptr + 3 ] ;
encoded [ pixel_ptr + 4 ] = uq -= encoded [ pixel_ptr + 4 ] ;
encoded [ pixel_ptr + 5 ] = vq -= encoded [ pixel_ptr + 5 ] ;
pixel_ptr += 6 ;
}
}
break ;
default : av_log ( avctx , AV_LOG_ERROR , "BUG! Unknown imagetype in pngfilter switch.\n" ) ;
return AVERROR_INVALIDDATA ;
}
}
y_out = c -> pic . data [ 0 ] + ( height - 1 ) * c -> pic . linesize [ 0 ] ;
u_out = c -> pic . data [ 1 ] + ( height - 1 ) * c -> pic . linesize [ 1 ] ;
v_out = c -> pic . data [ 2 ] + ( height - 1 ) * c -> pic . linesize [ 2 ] ;
switch ( c -> imgtype ) {
case IMGTYPE_YUV111 : for ( row = 0 ;
row < height ;
row ++ ) {
for ( col = 0 ;
col < width ;
col ++ ) {
y_out [ col ] = * encoded ++ ;
u_out [ col ] = * encoded ++ + 128 ;
v_out [ col ] = * encoded ++ + 128 ;
}
y_out -= c -> pic . linesize [ 0 ] ;
u_out -= c -> pic . linesize [ 1 ] ;
v_out -= c -> pic . linesize [ 2 ] ;
}
break ;
case IMGTYPE_YUV422 : for ( row = 0 ;
row < height ;
row ++ ) {
for ( col = 0 ;
col < width - 3 ;
col += 4 ) {
memcpy ( y_out + col , encoded , 4 ) ;
encoded += 4 ;
u_out [ col >> 1 ] = * encoded ++ + 128 ;
u_out [ ( col >> 1 ) + 1 ] = * encoded ++ + 128 ;
v_out [ col >> 1 ] = * encoded ++ + 128 ;
v_out [ ( col >> 1 ) + 1 ] = * encoded ++ + 128 ;
}
y_out -= c -> pic . linesize [ 0 ] ;
u_out -= c -> pic . linesize [ 1 ] ;
v_out -= c -> pic . linesize [ 2 ] ;
}
break ;
case IMGTYPE_RGB24 : for ( row = height - 1 ;
row >= 0 ;
row -- ) {
pixel_ptr = row * c -> pic . linesize [ 0 ] ;
memcpy ( outptr + pixel_ptr , encoded , 3 * width ) ;
encoded += 3 * width ;
}
break ;
case IMGTYPE_YUV411 : for ( row = 0 ;
row < height ;
row ++ ) {
for ( col = 0 ;
col < width - 3 ;
col += 4 ) {
memcpy ( y_out + col , encoded , 4 ) ;
encoded += 4 ;
u_out [ col >> 2 ] = * encoded ++ + 128 ;
v_out [ col >> 2 ] = * encoded ++ + 128 ;
}
y_out -= c -> pic . linesize [ 0 ] ;
u_out -= c -> pic . linesize [ 1 ] ;
v_out -= c -> pic . linesize [ 2 ] ;
}
break ;
case IMGTYPE_YUV211 : for ( row = 0 ;
row < height ;
row ++ ) {
for ( col = 0 ;
col < width - 1 ;
col += 2 ) {
memcpy ( y_out + col , encoded , 2 ) ;
encoded += 2 ;
u_out [ col >> 1 ] = * encoded ++ + 128 ;
v_out [ col >> 1 ] = * encoded ++ + 128 ;
}
y_out -= c -> pic . linesize [ 0 ] ;
u_out -= c -> pic . linesize [ 1 ] ;
v_out -= c -> pic . linesize [ 2 ] ;
}
break ;
case IMGTYPE_YUV420 : u_out = c -> pic . data [ 1 ] + ( ( height >> 1 ) - 1 ) * c -> pic . linesize [ 1 ] ;
v_out = c -> pic . data [ 2 ] + ( ( height >> 1 ) - 1 ) * c -> pic . linesize [ 2 ] ;
for ( row = 0 ;
row < height - 1 ;
row += 2 ) {
for ( col = 0 ;
col < width - 1 ;
col += 2 ) {
memcpy ( y_out + col , encoded , 2 ) ;
encoded += 2 ;
memcpy ( y_out + col - c -> pic . linesize [ 0 ] , encoded , 2 ) ;
encoded += 2 ;
u_out [ col >> 1 ] = * encoded ++ + 128 ;
v_out [ col >> 1 ] = * encoded ++ + 128 ;
}
y_out -= c -> pic . linesize [ 0 ] << 1 ;
u_out -= c -> pic . linesize [ 1 ] ;
v_out -= c -> pic . linesize [ 2 ] ;
}
break ;
default : av_log ( avctx , AV_LOG_ERROR , "BUG! Unknown imagetype in image decoder.\n" ) ;
return AVERROR_INVALIDDATA ;
}
* got_frame = 1 ;
* ( AVFrame * ) data = c -> pic ;
return buf_size ;
} |
-5,390,559,971,540,708,000 | debian | 5 | 0 | static void x8_reset_vlc_tables ( IntraX8Context * w ) {
memset ( w -> j_dc_vlc , 0 , sizeof ( w -> j_dc_vlc ) ) ;
memset ( w -> j_ac_vlc , 0 , sizeof ( w -> j_ac_vlc ) ) ;
w -> j_orient_vlc = NULL ;
} |
378,220,832,151,730,900 | debian | 21 | 0 | int qemuMonitorTextSetPassword ( qemuMonitorPtr mon , const char * protocol , const char * password , const char * action_if_connected ) {
char * cmd = NULL ;
char * reply = NULL ;
int ret = - 1 ;
if ( virAsprintf ( & cmd , "set_password %s \"%s\" %s" , protocol , password , action_if_connected ) < 0 ) {
virReportOOMError ( ) ;
goto cleanup ;
}
if ( qemuMonitorHMPCommand ( mon , cmd , & reply ) < 0 ) {
qemuReportError ( VIR_ERR_OPERATION_FAILED , "%s" , _ ( "setting password failed" ) ) ;
goto cleanup ;
}
if ( strstr ( reply , "unknown command:" ) ) {
ret = - 2 ;
goto cleanup ;
}
ret = 0 ;
cleanup : VIR_FREE ( reply ) ;
VIR_FREE ( cmd ) ;
return ret ;
} |
1,750,726,979,859,153,400 | debian | 31 | 0 | void initkerberos ( void ) # endif {
PyObject * m , * d ;
# if PY_MAJOR_VERSION >= 3 m = PyModule_Create ( & moduledef ) ;
# else m = Py_InitModule ( "kerberos" , KerberosMethods ) ;
# endif d = PyModule_GetDict ( m ) ;
if ( ! ( KrbException_class = PyErr_NewException ( "kerberos.KrbError" , NULL , NULL ) ) ) goto error ;
PyDict_SetItemString ( d , "KrbError" , KrbException_class ) ;
Py_INCREF ( KrbException_class ) ;
if ( ! ( BasicAuthException_class = PyErr_NewException ( "kerberos.BasicAuthError" , KrbException_class , NULL ) ) ) goto error ;
Py_INCREF ( BasicAuthException_class ) ;
PyDict_SetItemString ( d , "BasicAuthError" , BasicAuthException_class ) ;
if ( ! ( PwdChangeException_class = PyErr_NewException ( "kerberos.PwdChangeError" , KrbException_class , NULL ) ) ) goto error ;
Py_INCREF ( PwdChangeException_class ) ;
PyDict_SetItemString ( d , "PwdChangeError" , PwdChangeException_class ) ;
if ( ! ( GssException_class = PyErr_NewException ( "kerberos.GSSError" , KrbException_class , NULL ) ) ) goto error ;
Py_INCREF ( GssException_class ) ;
PyDict_SetItemString ( d , "GSSError" , GssException_class ) ;
PyDict_SetItemString ( d , "AUTH_GSS_COMPLETE" , PyInt_FromLong ( AUTH_GSS_COMPLETE ) ) ;
PyDict_SetItemString ( d , "AUTH_GSS_CONTINUE" , PyInt_FromLong ( AUTH_GSS_CONTINUE ) ) ;
PyDict_SetItemString ( d , "GSS_C_DELEG_FLAG" , PyInt_FromLong ( GSS_C_DELEG_FLAG ) ) ;
PyDict_SetItemString ( d , "GSS_C_MUTUAL_FLAG" , PyInt_FromLong ( GSS_C_MUTUAL_FLAG ) ) ;
PyDict_SetItemString ( d , "GSS_C_REPLAY_FLAG" , PyInt_FromLong ( GSS_C_REPLAY_FLAG ) ) ;
PyDict_SetItemString ( d , "GSS_C_SEQUENCE_FLAG" , PyInt_FromLong ( GSS_C_SEQUENCE_FLAG ) ) ;
PyDict_SetItemString ( d , "GSS_C_CONF_FLAG" , PyInt_FromLong ( GSS_C_CONF_FLAG ) ) ;
PyDict_SetItemString ( d , "GSS_C_INTEG_FLAG" , PyInt_FromLong ( GSS_C_INTEG_FLAG ) ) ;
PyDict_SetItemString ( d , "GSS_C_ANON_FLAG" , PyInt_FromLong ( GSS_C_ANON_FLAG ) ) ;
PyDict_SetItemString ( d , "GSS_C_PROT_READY_FLAG" , PyInt_FromLong ( GSS_C_PROT_READY_FLAG ) ) ;
PyDict_SetItemString ( d , "GSS_C_TRANS_FLAG" , PyInt_FromLong ( GSS_C_TRANS_FLAG ) ) ;
error : if ( PyErr_Occurred ( ) ) PyErr_SetString ( PyExc_ImportError , "kerberos: init failed" ) ;
# if PY_MAJOR_VERSION >= 3 return m ;
# endif } |
-6,435,087,038,712,483,000 | debian | 20 | 0 | static int load_matrix ( MpegEncContext * s , uint16_t matrix0 [ 64 ] , uint16_t matrix1 [ 64 ] , int intra ) {
int i ;
for ( i = 0 ;
i < 64 ;
i ++ ) {
int j = s -> dsp . idct_permutation [ ff_zigzag_direct [ i ] ] ;
int v = get_bits ( & s -> gb , 8 ) ;
if ( v == 0 ) {
av_log ( s -> avctx , AV_LOG_ERROR , "matrix damaged\n" ) ;
return - 1 ;
}
if ( intra && i == 0 && v != 8 ) {
av_log ( s -> avctx , AV_LOG_ERROR , "intra matrix invalid, ignoring\n" ) ;
v = 8 ;
}
matrix0 [ j ] = v ;
if ( matrix1 ) matrix1 [ j ] = v ;
}
return 0 ;
} |
8,127,806,390,163,863,000 | debian | 13 | 0 | static int get_kpcr_number ( CPUX86State * env ) {
struct kpcr {
uint8_t fill1 [ 0x1c ] ;
uint32_t self ;
uint8_t fill2 [ 0x31 ] ;
uint8_t number ;
}
QEMU_PACKED kpcr ;
if ( cpu_memory_rw_debug ( env , env -> segs [ R_FS ] . base , ( void * ) & kpcr , sizeof ( kpcr ) , 0 ) < 0 || kpcr . self != env -> segs [ R_FS ] . base ) {
return - 1 ;
}
return kpcr . number ;
} |
8,323,148,621,905,689,000 | chrome | 130 | 0 | void vp8_denoiser_denoise_mb ( VP8_DENOISER * denoiser , MACROBLOCK * x , unsigned int best_sse , unsigned int zero_mv_sse , int recon_yoffset , int recon_uvoffset , loop_filter_info_n * lfi_n , int mb_row , int mb_col , int block_index ) {
int mv_row ;
int mv_col ;
unsigned int motion_threshold ;
unsigned int motion_magnitude2 ;
unsigned int sse_thresh ;
int sse_diff_thresh = 0 ;
int apply_spatial_loop_filter = 1 ;
MV_REFERENCE_FRAME frame = x -> best_reference_frame ;
MV_REFERENCE_FRAME zero_frame = x -> best_zeromv_reference_frame ;
enum vp8_denoiser_decision decision = FILTER_BLOCK ;
enum vp8_denoiser_decision decision_u = COPY_BLOCK ;
enum vp8_denoiser_decision decision_v = COPY_BLOCK ;
if ( zero_frame ) {
YV12_BUFFER_CONFIG * src = & denoiser -> yv12_running_avg [ frame ] ;
YV12_BUFFER_CONFIG * dst = & denoiser -> yv12_mc_running_avg ;
YV12_BUFFER_CONFIG saved_pre , saved_dst ;
MB_MODE_INFO saved_mbmi ;
MACROBLOCKD * filter_xd = & x -> e_mbd ;
MB_MODE_INFO * mbmi = & filter_xd -> mode_info_context -> mbmi ;
int sse_diff = 0 ;
const int zero_bias = denoiser -> denoise_pars . denoise_mv_bias ;
zero_mv_sse = ( unsigned int ) ( ( int64_t ) zero_mv_sse * zero_bias / 100 ) ;
sse_diff = zero_mv_sse - best_sse ;
saved_mbmi = * mbmi ;
mbmi -> ref_frame = x -> best_reference_frame ;
mbmi -> mode = x -> best_sse_inter_mode ;
mbmi -> mv = x -> best_sse_mv ;
mbmi -> need_to_clamp_mvs = x -> need_to_clamp_best_mvs ;
mv_col = x -> best_sse_mv . as_mv . col ;
mv_row = x -> best_sse_mv . as_mv . row ;
if ( ( unsigned int ) ( mv_row * mv_row + mv_col * mv_col ) <= NOISE_MOTION_THRESHOLD ) sse_diff_thresh = ( int ) SSE_DIFF_THRESHOLD ;
if ( frame == INTRA_FRAME || sse_diff <= sse_diff_thresh ) {
mbmi -> ref_frame = x -> best_zeromv_reference_frame ;
src = & denoiser -> yv12_running_avg [ zero_frame ] ;
mbmi -> mode = ZEROMV ;
mbmi -> mv . as_int = 0 ;
x -> best_sse_inter_mode = ZEROMV ;
x -> best_sse_mv . as_int = 0 ;
best_sse = zero_mv_sse ;
}
saved_pre = filter_xd -> pre ;
saved_dst = filter_xd -> dst ;
filter_xd -> pre . y_buffer = src -> y_buffer + recon_yoffset ;
filter_xd -> pre . u_buffer = src -> u_buffer + recon_uvoffset ;
filter_xd -> pre . v_buffer = src -> v_buffer + recon_uvoffset ;
filter_xd -> dst . y_buffer = dst -> y_buffer + recon_yoffset ;
filter_xd -> dst . u_buffer = dst -> u_buffer + recon_uvoffset ;
filter_xd -> dst . v_buffer = dst -> v_buffer + recon_uvoffset ;
if ( ! x -> skip ) {
vp8_build_inter_predictors_mb ( filter_xd ) ;
}
else {
vp8_build_inter16x16_predictors_mb ( filter_xd , filter_xd -> dst . y_buffer , filter_xd -> dst . u_buffer , filter_xd -> dst . v_buffer , filter_xd -> dst . y_stride , filter_xd -> dst . uv_stride ) ;
}
filter_xd -> pre = saved_pre ;
filter_xd -> dst = saved_dst ;
* mbmi = saved_mbmi ;
}
mv_row = x -> best_sse_mv . as_mv . row ;
mv_col = x -> best_sse_mv . as_mv . col ;
motion_magnitude2 = mv_row * mv_row + mv_col * mv_col ;
motion_threshold = denoiser -> denoise_pars . scale_motion_thresh * NOISE_MOTION_THRESHOLD ;
if ( motion_magnitude2 < denoiser -> denoise_pars . scale_increase_filter * NOISE_MOTION_THRESHOLD ) x -> increase_denoising = 1 ;
sse_thresh = denoiser -> denoise_pars . scale_sse_thresh * SSE_THRESHOLD ;
if ( x -> increase_denoising ) sse_thresh = denoiser -> denoise_pars . scale_sse_thresh * SSE_THRESHOLD_HIGH ;
if ( best_sse > sse_thresh || motion_magnitude2 > motion_threshold ) decision = COPY_BLOCK ;
if ( decision == FILTER_BLOCK ) {
unsigned char * mc_running_avg_y = denoiser -> yv12_mc_running_avg . y_buffer + recon_yoffset ;
int mc_avg_y_stride = denoiser -> yv12_mc_running_avg . y_stride ;
unsigned char * running_avg_y = denoiser -> yv12_running_avg [ INTRA_FRAME ] . y_buffer + recon_yoffset ;
int avg_y_stride = denoiser -> yv12_running_avg [ INTRA_FRAME ] . y_stride ;
decision = vp8_denoiser_filter ( mc_running_avg_y , mc_avg_y_stride , running_avg_y , avg_y_stride , x -> thismb , 16 , motion_magnitude2 , x -> increase_denoising ) ;
denoiser -> denoise_state [ block_index ] = motion_magnitude2 > 0 ? kFilterNonZeroMV : kFilterZeroMV ;
if ( denoiser -> denoiser_mode != kDenoiserOnYOnly && motion_magnitude2 == 0 && decision == FILTER_BLOCK ) {
unsigned char * mc_running_avg_u = denoiser -> yv12_mc_running_avg . u_buffer + recon_uvoffset ;
unsigned char * running_avg_u = denoiser -> yv12_running_avg [ INTRA_FRAME ] . u_buffer + recon_uvoffset ;
unsigned char * mc_running_avg_v = denoiser -> yv12_mc_running_avg . v_buffer + recon_uvoffset ;
unsigned char * running_avg_v = denoiser -> yv12_running_avg [ INTRA_FRAME ] . v_buffer + recon_uvoffset ;
int mc_avg_uv_stride = denoiser -> yv12_mc_running_avg . uv_stride ;
int avg_uv_stride = denoiser -> yv12_running_avg [ INTRA_FRAME ] . uv_stride ;
int signal_stride = x -> block [ 16 ] . src_stride ;
decision_u = vp8_denoiser_filter_uv ( mc_running_avg_u , mc_avg_uv_stride , running_avg_u , avg_uv_stride , x -> block [ 16 ] . src + * x -> block [ 16 ] . base_src , signal_stride , motion_magnitude2 , 0 ) ;
decision_v = vp8_denoiser_filter_uv ( mc_running_avg_v , mc_avg_uv_stride , running_avg_v , avg_uv_stride , x -> block [ 20 ] . src + * x -> block [ 20 ] . base_src , signal_stride , motion_magnitude2 , 0 ) ;
}
}
if ( decision == COPY_BLOCK ) {
vp8_copy_mem16x16 ( x -> thismb , 16 , denoiser -> yv12_running_avg [ INTRA_FRAME ] . y_buffer + recon_yoffset , denoiser -> yv12_running_avg [ INTRA_FRAME ] . y_stride ) ;
denoiser -> denoise_state [ block_index ] = kNoFilter ;
}
if ( denoiser -> denoiser_mode != kDenoiserOnYOnly ) {
if ( decision_u == COPY_BLOCK ) {
vp8_copy_mem8x8 ( x -> block [ 16 ] . src + * x -> block [ 16 ] . base_src , x -> block [ 16 ] . src_stride , denoiser -> yv12_running_avg [ INTRA_FRAME ] . u_buffer + recon_uvoffset , denoiser -> yv12_running_avg [ INTRA_FRAME ] . uv_stride ) ;
}
if ( decision_v == COPY_BLOCK ) {
vp8_copy_mem8x8 ( x -> block [ 20 ] . src + * x -> block [ 20 ] . base_src , x -> block [ 16 ] . src_stride , denoiser -> yv12_running_avg [ INTRA_FRAME ] . v_buffer + recon_uvoffset , denoiser -> yv12_running_avg [ INTRA_FRAME ] . uv_stride ) ;
}
}
if ( apply_spatial_loop_filter ) {
loop_filter_info lfi ;
int apply_filter_col = 0 ;
int apply_filter_row = 0 ;
int apply_filter = 0 ;
int y_stride = denoiser -> yv12_running_avg [ INTRA_FRAME ] . y_stride ;
int uv_stride = denoiser -> yv12_running_avg [ INTRA_FRAME ] . uv_stride ;
int filter_level = 32 ;
int hev_index = lfi_n -> hev_thr_lut [ INTER_FRAME ] [ filter_level ] ;
lfi . mblim = lfi_n -> mblim [ filter_level ] ;
lfi . blim = lfi_n -> blim [ filter_level ] ;
lfi . lim = lfi_n -> lim [ filter_level ] ;
lfi . hev_thr = lfi_n -> hev_thr [ hev_index ] ;
if ( mb_col > 0 ) {
apply_filter_col = ! ( ( denoiser -> denoise_state [ block_index ] == denoiser -> denoise_state [ block_index - 1 ] ) && denoiser -> denoise_state [ block_index ] != kFilterNonZeroMV ) ;
if ( apply_filter_col ) {
apply_filter = 1 ;
vp8_loop_filter_mbv ( denoiser -> yv12_running_avg [ INTRA_FRAME ] . y_buffer + recon_yoffset , NULL , NULL , y_stride , uv_stride , & lfi ) ;
}
}
if ( mb_row > 0 ) {
apply_filter_row = ! ( ( denoiser -> denoise_state [ block_index ] == denoiser -> denoise_state [ block_index - denoiser -> num_mb_cols ] ) && denoiser -> denoise_state [ block_index ] != kFilterNonZeroMV ) ;
if ( apply_filter_row ) {
apply_filter = 1 ;
vp8_loop_filter_mbh ( denoiser -> yv12_running_avg [ INTRA_FRAME ] . y_buffer + recon_yoffset , NULL , NULL , y_stride , uv_stride , & lfi ) ;
}
}
if ( apply_filter ) {
vp8_copy_mem16x16 ( denoiser -> yv12_running_avg [ INTRA_FRAME ] . y_buffer + recon_yoffset , y_stride , x -> thismb , 16 ) ;
}
}
} |
-1,315,695,702,746,584,300 | debian | 9 | 0 | static gboolean find_finfo ( proto_node * node , gpointer data ) {
field_info * fi = PNODE_FINFO ( node ) ;
if ( fi && fi -> hfinfo ) {
if ( fi -> hfinfo -> id == ( ( ffdata_t * ) data ) -> id ) {
g_ptr_array_add ( ( ( ffdata_t * ) data ) -> array , fi ) ;
}
}
return FALSE ;
} |
-9,129,169,564,020,831,000 | debian | 12 | 0 | int DSA_sign ( int type , const unsigned char * dgst , int dlen , unsigned char * sig , unsigned int * siglen , DSA * dsa ) {
DSA_SIG * s ;
RAND_seed ( dgst , dlen ) ;
s = DSA_do_sign ( dgst , dlen , dsa ) ;
if ( s == NULL ) {
* siglen = 0 ;
return ( 0 ) ;
}
* siglen = i2d_DSA_SIG ( s , & sig ) ;
DSA_SIG_free ( s ) ;
return ( 1 ) ;
} |
-5,537,985,723,411,440,000 | debian | 3 | 0 | vpx_image_t * vpx_img_alloc ( vpx_image_t * img , vpx_img_fmt_t fmt , unsigned int d_w , unsigned int d_h , unsigned int align ) {
return img_alloc_helper ( img , fmt , d_w , d_h , align , align , NULL ) ;
} |
355,220,887,711,506,900 | debian | 58 | 0 | static bool get_variable_range ( PlannerInfo * root , VariableStatData * vardata , Oid sortop , Datum * min , Datum * max ) {
Datum tmin = 0 ;
Datum tmax = 0 ;
bool have_data = false ;
int16 typLen ;
bool typByVal ;
Oid opfuncoid ;
Datum * values ;
int nvalues ;
int i ;
# ifdef NOT_USED if ( get_actual_variable_range ( root , vardata , sortop , min , max ) ) return true ;
# endif if ( ! HeapTupleIsValid ( vardata -> statsTuple ) ) {
return false ;
}
if ( ! statistic_proc_security_check ( vardata , ( opfuncoid = get_opcode ( sortop ) ) ) ) return false ;
get_typlenbyval ( vardata -> atttype , & typLen , & typByVal ) ;
if ( get_attstatsslot ( vardata -> statsTuple , vardata -> atttype , vardata -> atttypmod , STATISTIC_KIND_HISTOGRAM , sortop , NULL , & values , & nvalues , NULL , NULL ) ) {
if ( nvalues > 0 ) {
tmin = datumCopy ( values [ 0 ] , typByVal , typLen ) ;
tmax = datumCopy ( values [ nvalues - 1 ] , typByVal , typLen ) ;
have_data = true ;
}
free_attstatsslot ( vardata -> atttype , values , nvalues , NULL , 0 ) ;
}
else if ( get_attstatsslot ( vardata -> statsTuple , vardata -> atttype , vardata -> atttypmod , STATISTIC_KIND_HISTOGRAM , InvalidOid , NULL , & values , & nvalues , NULL , NULL ) ) {
free_attstatsslot ( vardata -> atttype , values , nvalues , NULL , 0 ) ;
return false ;
}
if ( get_attstatsslot ( vardata -> statsTuple , vardata -> atttype , vardata -> atttypmod , STATISTIC_KIND_MCV , InvalidOid , NULL , & values , & nvalues , NULL , NULL ) ) {
bool tmin_is_mcv = false ;
bool tmax_is_mcv = false ;
FmgrInfo opproc ;
fmgr_info ( opfuncoid , & opproc ) ;
for ( i = 0 ;
i < nvalues ;
i ++ ) {
if ( ! have_data ) {
tmin = tmax = values [ i ] ;
tmin_is_mcv = tmax_is_mcv = have_data = true ;
continue ;
}
if ( DatumGetBool ( FunctionCall2Coll ( & opproc , DEFAULT_COLLATION_OID , values [ i ] , tmin ) ) ) {
tmin = values [ i ] ;
tmin_is_mcv = true ;
}
if ( DatumGetBool ( FunctionCall2Coll ( & opproc , DEFAULT_COLLATION_OID , tmax , values [ i ] ) ) ) {
tmax = values [ i ] ;
tmax_is_mcv = true ;
}
}
if ( tmin_is_mcv ) tmin = datumCopy ( tmin , typByVal , typLen ) ;
if ( tmax_is_mcv ) tmax = datumCopy ( tmax , typByVal , typLen ) ;
free_attstatsslot ( vardata -> atttype , values , nvalues , NULL , 0 ) ;
}
* min = tmin ;
* max = tmax ;
return have_data ;
} |
-7,884,836,206,149,374,000 | chrome | 4 | 0 | IN_PROC_BROWSER_TEST_F ( BluetoothChooserBrowserTest , InvokeDialog_NoDevicesBubble ) {
set_status ( FakeBluetoothChooserController : : BluetoothStatus : : IDLE ) ;
RunDialog ( ) ;
} |